Skip to content

Commit

Permalink
[Labs] Replicate core directory structure (#1316)
Browse files Browse the repository at this point in the history
  • Loading branch information
llorca committed Jul 5, 2017
1 parent e587390 commit e6447f0
Show file tree
Hide file tree
Showing 13 changed files with 59 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Expand Up @@ -6,7 +6,7 @@
*/

export * from "./accessibility";
export * from "./common"
export * from "./common";
export * from "./components";
export { IconClasses } from "./generated/iconClasses";
export { IconContents } from "./generated/iconStrings";
2 changes: 1 addition & 1 deletion packages/labs/examples/tagInputExample.tsx
Expand Up @@ -10,7 +10,7 @@ import * as React from "react";

import { Classes, Intent, ITagProps, Switch } from "@blueprintjs/core";
import { BaseExample, handleBooleanChange } from "@blueprintjs/docs";
import { TagInput } from "../src/tag-input/tagInput";
import { TagInput } from "../src";

const INTENTS = [Intent.NONE, Intent.PRIMARY, Intent.SUCCESS, Intent.DANGER, Intent.WARNING];

Expand Down
3 changes: 1 addition & 2 deletions packages/labs/src/blueprint-labs.scss
Expand Up @@ -5,5 +5,4 @@
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*/

@import "./select/select";
@import "./tag-input/tag-input";
@import "./components/index";
10 changes: 10 additions & 0 deletions packages/labs/src/common/classes.ts
@@ -0,0 +1,10 @@
/*
* Copyright 2017 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*/

export const SELECT = "pt-select";
export const TAG_INPUT = "pt-tag-input";
export const INPUT_GHOST = "pt-input-ghost";
10 changes: 10 additions & 0 deletions packages/labs/src/common/index.ts
@@ -0,0 +1,10 @@
/*
* Copyright 2017 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*/

import * as classes from "../common/classes";

export const Classes = classes;
9 changes: 9 additions & 0 deletions packages/labs/src/components/_index.scss
@@ -0,0 +1,9 @@
/*
* Copyright 2017 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*/

@import "select/select";
@import "tag-input/tag-input";
10 changes: 10 additions & 0 deletions packages/labs/src/components/index.ts
@@ -0,0 +1,10 @@
/*
* Copyright 2017 Palantir Technologies, Inc. All rights reserved.
* Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
* of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*/

export * from "./query-list/queryList";
export * from "./select/select";
export * from "./tag-input/tagInput";
File renamed without changes.
File renamed without changes.
Expand Up @@ -151,7 +151,7 @@ export class Select<T> extends AbstractComponent<ISelectProps<T>, ISelectState<T
{...popoverProps}
className={classNames(listProps.className, popoverProps.className)}
onInteraction={this.handlePopoverInteraction}
popoverClassName={classNames("pt-select-popover", popoverProps.popoverClassName)}
popoverClassName={classNames(`${Classes.SELECT}-popover`, popoverProps.popoverClassName)}
popoverWillOpen={this.handlePopoverWillOpen}
popoverDidOpen={this.handlePopoverDidOpen}
popoverWillClose={this.handlePopoverWillClose}
Expand Down
File renamed without changes.
Expand Up @@ -9,7 +9,17 @@ import * as classNames from "classnames";
import * as PureRender from "pure-render-decorator";
import * as React from "react";

import { AbstractComponent, Classes, HTMLInputProps, IProps, ITagProps, Keys, Tag, Utils } from "@blueprintjs/core";
import {
AbstractComponent,
Classes as CoreClasses,
HTMLInputProps,
IProps,
ITagProps,
Keys,
Tag,
Utils,
} from "@blueprintjs/core";
import * as Classes from "../../common/classes";

export interface ITagInputProps extends IProps {
/** React props to pass to the `<input>` element */
Expand Down Expand Up @@ -80,8 +90,8 @@ export class TagInput extends AbstractComponent<ITagInputProps, ITagInputState>
public render() {
const { className, inputProps, values } = this.props;

const classes = classNames(Classes.INPUT, "pt-tag-input", {
[Classes.ACTIVE]: this.state.isInputFocused,
const classes = classNames(CoreClasses.INPUT, Classes.TAG_INPUT, {
[CoreClasses.ACTIVE]: this.state.isInputFocused,
}, className);

return (
Expand All @@ -98,7 +108,7 @@ export class TagInput extends AbstractComponent<ITagInputProps, ITagInputState>
onChange={this.handleInputChange}
onKeyDown={this.handleInputKeyDown}
ref={this.refHandlers.input}
className={classNames("pt-input-ghost", inputProps.className)}
className={classNames(Classes.INPUT_GHOST, inputProps.className)}
/>
</div>
);
Expand Down
5 changes: 2 additions & 3 deletions packages/labs/src/index.ts
Expand Up @@ -5,6 +5,5 @@
* and https://github.com/palantir/blueprint/blob/master/PATENTS
*/

export * from "./query-list/queryList";
export * from "./select/select";
export * from "./tag-input/tagInput";
export * from "./common";
export * from "./components";

1 comment on commit e6447f0

@blueprint-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Labs] Replicate core directory structure (#1316)

Preview: documentation
Coverage: core | datetime

Please sign in to comment.