@openfin/ui-library 0.1.5 → 0.1.6-alpha.1617063254

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,13 +19,13 @@ export declare type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & (But
19
19
  };
20
20
  /**
21
21
  * Button as Anchor
22
- * @example <Button as="a" href="https://..."/>
22
+ * @example <Button as="a" href="https://..." />
23
23
  *
24
24
  * Button with Label
25
- * @example <Button label="..."/>
25
+ * @example <Button label="..." />
26
26
  *
27
27
  * Button with Child Element
28
- * @example <Button><Child></Button>
28
+ * @example <Button><Child /></Button>
29
29
  */
30
30
  export declare const Button: FC<ButtonProps>;
31
31
  /**
@@ -33,5 +33,5 @@ export declare const Button: FC<ButtonProps>;
33
33
  */
34
34
  export declare const ButtonPrimary: FC<ButtonProps>;
35
35
  export declare const ButtonSecondary: FC<ButtonProps>;
36
- export declare const ButtonTertiary: FC<ButtonProps>;
36
+ export declare const ButtonTextOnly: FC<ButtonProps>;
37
37
  export {};
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.ButtonTertiary = exports.ButtonSecondary = exports.ButtonPrimary = exports.Button = void 0;
17
+ exports.ButtonTextOnly = exports.ButtonSecondary = exports.ButtonPrimary = exports.Button = void 0;
18
18
  const jsx_runtime_1 = require("react/jsx-runtime");
19
19
  const styled_components_1 = __importDefault(require("styled-components"));
20
20
  const Box_1 = require("../../layout/Box");
@@ -22,66 +22,54 @@ const helpers_1 = require("../../system/ThemeProvider/lib/helpers");
22
22
  const button_variants_1 = require("./button.variants");
23
23
  /**
24
24
  * Button as Anchor
25
- * @example <Button as="a" href="https://..."/>
25
+ * @example <Button as="a" href="https://..." />
26
26
  *
27
27
  * Button with Label
28
- * @example <Button label="..."/>
28
+ * @example <Button label="..." />
29
29
  *
30
30
  * Button with Child Element
31
- * @example <Button><Child></Button>
31
+ * @example <Button><Child /></Button>
32
32
  */
33
33
  const Button = (_a) => {
34
34
  var { label, children, size = 'base', shape = 'square', kind = 'primary', layout = 'fit', href } = _a, buttonProps = __rest(_a, ["label", "children", "size", "shape", "kind", "layout", "href"]);
35
- return (jsx_runtime_1.jsx(ButtonElement, Object.assign({ as: href ? 'a' : 'button', size: size, shape: shape, kind: kind, layout: layout }, buttonProps, { children: label ? jsx_runtime_1.jsx(ButtonLabel, { children: label }, void 0) : children }), void 0));
35
+ return (jsx_runtime_1.jsx(ButtonElement, Object.assign({ as: href ? 'a' : 'button', size: size, shape: shape, kind: kind, layout: layout }, buttonProps, { children: label ? (jsx_runtime_1.jsx(ButtonLabel, Object.assign({ alignItems: "center", justifyContent: "center" }, { children: label }), void 0)) : (children) }), void 0));
36
36
  };
37
37
  exports.Button = Button;
38
38
  const ButtonElement = styled_components_1.default.button `
39
- /**
40
- * 1. Initialize local variables with reasonable defaults
41
- */
42
- --color-background: ${({ theme }) => theme.palette.inputBg};
43
- --color-foreground: ${({ theme }) => theme.palette.inputColor};
39
+ /* Default values that get overridden by variants */
40
+ background: ${({ theme }) => theme.palette.inputBg};
41
+ border: 1px solid ${({ theme }) => theme.palette.inputBg};
42
+ color: ${({ theme }) => theme.palette.inputColor};
44
43
 
45
- &:disabled {
46
- --color-background: ${({ theme }) => theme.palette.inputDisabled};
47
- }
48
-
49
- /**
50
- * 2. Inject variants -- ? What are Variants
51
- */
44
+ /* Inject variants */
52
45
  ${helpers_1.getVariantCSS(button_variants_1.variants, button_variants_1.Variant.size)}
53
46
  ${helpers_1.getVariantCSS(button_variants_1.variants, button_variants_1.Variant.shape)}
54
47
  ${helpers_1.getVariantCSS(button_variants_1.variants, button_variants_1.Variant.kind)}
55
48
  ${helpers_1.getVariantCSS(button_variants_1.variants, button_variants_1.Variant.layout)}
56
49
 
57
- /**
58
- * 3. Component Build
59
- */
60
- background: var(--color-background);
61
- color: var(--color-foreground);
62
-
63
50
  display: inline-flex;
64
- border: none;
51
+ align-items: center;
52
+ gap: ${({ theme }) => theme.px.small};
65
53
  outline: none;
66
54
  text-decoration: none;
67
55
  white-space: nowrap;
68
56
  line-height: ${({ theme }) => theme.lineHeight.ui};
69
57
  font-weight: ${({ theme }) => theme.fontWeight.bold};
70
-
71
- &:focus,
72
- &:active {
73
- box-shadow: 0 0 0 2px ${({ theme }) => theme._color.black30},
74
- 0 0 0 2px var(--color-background);
75
- }
58
+ transition: border-color var(--openfin-ui-globalTransition);
76
59
 
77
60
  &:not(:disabled) {
78
61
  cursor: pointer;
79
62
  }
63
+
64
+ &:disabled,
65
+ &:active:disabled {
66
+ background: ${({ theme }) => theme.palette.inputDisabled};
67
+ border-color: ${({ theme }) => theme.palette.inputDisabled};
68
+ color: ${({ theme }) => theme.palette.inputPlaceholder};
69
+ cursor: not-allowed;
70
+ }
80
71
  `;
81
- const ButtonLabel = styled_components_1.default(Box_1.Box).attrs({
82
- alignItems: 'center',
83
- justifyContent: 'center',
84
- }) `
72
+ const ButtonLabel = styled_components_1.default(Box_1.Box) `
85
73
  padding: ${({ theme }) => `0 ${theme.px.xsmall}`};
86
74
  `;
87
75
  /**
@@ -91,5 +79,5 @@ const ButtonPrimary = (props) => (jsx_runtime_1.jsx(exports.Button, Object.assig
91
79
  exports.ButtonPrimary = ButtonPrimary;
92
80
  const ButtonSecondary = (props) => (jsx_runtime_1.jsx(exports.Button, Object.assign({}, props, { kind: "secondary" }), void 0));
93
81
  exports.ButtonSecondary = ButtonSecondary;
94
- const ButtonTertiary = (props) => (jsx_runtime_1.jsx(exports.Button, Object.assign({}, props, { kind: "textOnly" }), void 0));
95
- exports.ButtonTertiary = ButtonTertiary;
82
+ const ButtonTextOnly = (props) => (jsx_runtime_1.jsx(exports.Button, Object.assign({}, props, { kind: "textOnly" }), void 0));
83
+ exports.ButtonTextOnly = ButtonTextOnly;
@@ -45,21 +45,21 @@ exports.ButtonShape = {
45
45
  exports.variants = {
46
46
  [exports.Variant.size]: {
47
47
  [exports.ButtonSize.base]: styled_components_1.css `
48
- padding: ${({ theme }) => theme.px.large};
49
- font-size: ${({ theme }) => theme.fontSize.xlarge};
48
+ padding: ${({ theme }) => `${theme.px.small} ${theme.px.large}`};
49
+ font-size: ${({ theme }) => theme.fontSize.base};
50
50
  `,
51
51
  [exports.ButtonSize.small]: styled_components_1.css `
52
- padding: ${({ theme }) => theme.px.small};
53
- font-size: ${({ theme }) => theme.fontSize.base};
52
+ padding: ${({ theme }) => `${theme.px.xsmall} ${theme.px.base}`};
53
+ font-size: ${({ theme }) => theme.fontSize.small};
54
54
  `,
55
55
  [exports.ButtonSize.large]: styled_components_1.css `
56
- padding: ${({ theme }) => theme.px.xlarge};
57
- font-size: ${({ theme }) => theme.fontSize.xxxlarge};
56
+ padding: ${({ theme }) => `${theme.px.base} ${theme.px.xlarge}`};
57
+ font-size: ${({ theme }) => theme.fontSize.large};
58
58
  `,
59
59
  },
60
60
  [exports.Variant.shape]: {
61
61
  [exports.ButtonShape.square]: styled_components_1.css `
62
- border-radius: ${({ theme }) => theme.radius.base};
62
+ border-radius: ${({ theme }) => theme.radius.small};
63
63
  `,
64
64
  [exports.ButtonShape.pill]: styled_components_1.css `
65
65
  border-radius: ${({ theme }) => theme.radius.pill};
@@ -75,14 +75,49 @@ exports.variants = {
75
75
  },
76
76
  [exports.Variant.kind]: {
77
77
  [exports.ButtonKind.primary]: styled_components_1.css `
78
- --color-background: ${({ theme }) => theme.palette.brandPrimary};
78
+ background: ${({ theme }) => theme.palette.brandPrimary};
79
+ border-color: ${({ theme }) => theme.palette.brandPrimary};
80
+
81
+ &:hover {
82
+ background: ${({ theme }) => theme.palette.brandPrimaryHover};
83
+ }
84
+
85
+ &:active {
86
+ background: ${({ theme }) => theme.palette.brandPrimaryActive};
87
+ }
88
+
89
+ &:focus {
90
+ border-color: ${({ theme }) => theme.palette.brandPrimaryFocused};
91
+ }
79
92
  `,
80
93
  [exports.ButtonKind.secondary]: styled_components_1.css `
81
- --color-background: ${({ theme }) => theme.palette.brandSecondary};
94
+ background: ${({ theme }) => theme.palette.brandSecondary};
95
+ border-color: ${({ theme }) => theme.palette.brandSecondary};
96
+
97
+ &:hover {
98
+ background: ${({ theme }) => theme.palette.brandSecondaryHover};
99
+ }
100
+
101
+ &:active {
102
+ background: ${({ theme }) => theme.palette.brandSecondaryActive};
103
+ }
104
+
105
+ &:focus {
106
+ border-color: ${({ theme }) => theme.palette.brandSecondaryFocused};
107
+ }
82
108
  `,
83
109
  [exports.ButtonKind.textOnly]: styled_components_1.css `
84
- --color-background: transparent;
85
- --color-foreground: ${({ theme }) => theme.palette.textDefault};
110
+ background: transparent;
111
+ border-color: transparent;
112
+ color: ${({ theme }) => theme.palette.textDefault};
113
+
114
+ &:active {
115
+ opacity: 0.8;
116
+ }
117
+
118
+ &:focus {
119
+ border-color: ${({ theme }) => theme.palette.inputFocused};
120
+ }
86
121
  `,
87
122
  },
88
123
  };
@@ -1,9 +1,9 @@
1
- import { FC, InputHTMLAttributes } from 'react';
1
+ import React, { FC, InputHTMLAttributes } from 'react';
2
2
  export declare type LabelSideType = 'left' | 'right';
3
3
  export declare type ToggleProps = InputHTMLAttributes<HTMLInputElement> & {
4
4
  label?: string;
5
5
  labelSide?: LabelSideType;
6
6
  type?: 'checkbox' | 'radio';
7
- onChange?: Function;
7
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
8
8
  };
9
9
  export declare const Toggle: FC<ToggleProps>;
@@ -21,12 +21,15 @@ const styled_components_1 = __importDefault(require("styled-components"));
21
21
  const RawInput_1 = require("../../input/RawInput");
22
22
  const Box_1 = require("../../layout/Box");
23
23
  const Toggle = (_a) => {
24
- var { id, label, labelSide = 'right', type = 'checkbox', onChange = () => { } } = _a, inputProps = __rest(_a, ["id", "label", "labelSide", "type", "onChange"]);
24
+ var { id, label, onChange, labelSide = 'right', type = 'checkbox' } = _a, inputProps = __rest(_a, ["id", "label", "onChange", "labelSide", "type"]);
25
25
  const [isChecked, setIsChecked] = react_1.useState(inputProps.checked);
26
+ react_1.useEffect(() => {
27
+ setIsChecked(inputProps.checked);
28
+ }, [inputProps.checked]);
26
29
  return (jsx_runtime_1.jsxs(ToggleContainer, Object.assign({ labelSide: labelSide }, { children: [label ? jsx_runtime_1.jsx(ToggleLabel, Object.assign({ htmlFor: id }, { children: label }), void 0) : undefined,
27
- jsx_runtime_1.jsxs(InputContainer, Object.assign({ isChecked: isChecked }, { children: [jsx_runtime_1.jsx(ToggleInput, Object.assign({ id: id, type: type }, inputProps, { onChange: (event) => {
30
+ jsx_runtime_1.jsxs(InputContainer, Object.assign({ isChecked: isChecked }, { children: [jsx_runtime_1.jsx(ToggleInput, Object.assign({}, inputProps, { id: id, type: type, onChange: (event) => {
28
31
  setIsChecked(event.target.checked);
29
- onChange(event);
32
+ onChange === null || onChange === void 0 ? void 0 : onChange(event);
30
33
  } }), void 0),
31
34
  jsx_runtime_1.jsx(ToggleKnob, { tabIndex: -1 }, void 0)] }), void 0)] }), void 0));
32
35
  };
@@ -1,6 +1,7 @@
1
1
  import { FC, InputHTMLAttributes } from 'react';
2
+ import { WithStatusProps } from '../../system/HOC';
2
3
  export declare type TextInputProps = InputHTMLAttributes<HTMLInputElement> & {
3
4
  message?: string;
4
5
  label?: string;
5
6
  };
6
- export declare const TextInput: FC;
7
+ export declare const TextInput: FC<TextInputProps & WithStatusProps>;
@@ -23,9 +23,9 @@ const Box_1 = require("../../layout/Box");
23
23
  const Text_1 = require("../../typography/Text");
24
24
  const ThemeProvider_1 = require("../../system/ThemeProvider");
25
25
  exports.TextInput = HOC_1.withStatus((_a) => {
26
- var { className, message, label, status, name } = _a, rest = __rest(_a, ["className", "message", "label", "status", "name"]);
26
+ var { className, message, label, status, name } = _a, inputProps = __rest(_a, ["className", "message", "label", "status", "name"]);
27
27
  return (jsx_runtime_1.jsxs(InputContainer, Object.assign({ flexDirection: "column", alignItems: "flex-start" }, { children: [!!label && (jsx_runtime_1.jsx(InputLabel, Object.assign({ as: "label", htmlFor: name, weight: "bold" }, { children: label }), void 0)),
28
- jsx_runtime_1.jsx(StyledInputField, Object.assign({ className: className, type: "text", name: name, status: status }, rest), void 0),
28
+ jsx_runtime_1.jsx(StyledInputField, Object.assign({ className: className, type: "text", name: name, status: status }, inputProps), void 0),
29
29
  !!message && jsx_runtime_1.jsx(InputMessage, Object.assign({ status: status }, { children: message }), void 0)] }), void 0));
30
30
  });
31
31
  const InputLabel = styled_components_1.default(Text_1.Text) `
@@ -1,4 +1,5 @@
1
1
  export * from './lib/constants';
2
+ export * from './lib/createTheme';
2
3
  export * from './lib/helpers';
3
4
  export * from './lib/interface';
4
5
  export * from './lib/mixins';
@@ -11,6 +11,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./lib/constants"), exports);
14
+ __exportStar(require("./lib/createTheme"), exports);
14
15
  __exportStar(require("./lib/helpers"), exports);
15
16
  __exportStar(require("./lib/interface"), exports);
16
17
  __exportStar(require("./lib/mixins"), exports);
@@ -0,0 +1,3 @@
1
+ import { ColorInputWithoutInstance as Color } from 'tinycolor2';
2
+ export declare const lightenColor: (color: Color, amount?: number | undefined) => string;
3
+ export declare const darkenColor: (color: Color, amount?: number | undefined) => string;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.darkenColor = exports.lightenColor = void 0;
7
+ const tinycolor2_1 = __importDefault(require("tinycolor2"));
8
+ const lightenColor = (color, amount) => adjustColor(color, 'lighten', amount);
9
+ exports.lightenColor = lightenColor;
10
+ const darkenColor = (color, amount) => adjustColor(color, 'darken', amount);
11
+ exports.darkenColor = darkenColor;
12
+ const adjustColor = (color, func, amount) => {
13
+ if (amount && (amount < 0 || amount > 100)) {
14
+ throw new Error(`${amount} must be a number between 0 and 100`);
15
+ }
16
+ return tinycolor2_1.default(color)[func](amount).toString();
17
+ };
@@ -0,0 +1,9 @@
1
+ import { DefaultTheme } from 'styled-components';
2
+ import { PaletteType } from '../lib/types';
3
+ /**
4
+ * Create a theme by accepting an incomplete theme object and deriving the remaining colors based on button colors.
5
+ *
6
+ * @param {Partial<PaletteType>} paletteConfig The provided theme keys, whether we or the end user defined them.
7
+ * @returns {DefaultTheme}
8
+ */
9
+ export declare const createTheme: (paletteConfig: Partial<PaletteType>) => DefaultTheme;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createTheme = void 0;
4
+ const config_1 = require("../lib/config");
5
+ const constants_1 = require("../lib/constants");
6
+ const colors_1 = require("./colors");
7
+ const palette_1 = require("./palette");
8
+ const LIGHTNESS_PERCENTAGE_ACTIVE = 2;
9
+ const LIGHTNESS_PERCENTAGE_HOVER = 5;
10
+ const LIGHTNESS_PERCENTAGE_FOCUSED = 20;
11
+ const base = {
12
+ _config: config_1.Configuration,
13
+ _color: constants_1.Color,
14
+ fontSize: constants_1.FontSize,
15
+ fontWeight: constants_1.FontWeight,
16
+ lineHeight: constants_1.LineHeight,
17
+ iconSize: constants_1.IconSize,
18
+ radius: constants_1.Radius,
19
+ shadow: constants_1.Shadow,
20
+ transition: constants_1.Transition,
21
+ unit: constants_1.Unit,
22
+ px: constants_1.UnitPx,
23
+ };
24
+ /**
25
+ * Created Active, Hover, and Focused Colors derived from base color
26
+ */
27
+ const createDerivedButtonPalette = (key, baseColor) => ({
28
+ [`${key}Active`]: colors_1.darkenColor(baseColor, LIGHTNESS_PERCENTAGE_ACTIVE),
29
+ [`${key}Hover`]: colors_1.lightenColor(baseColor, LIGHTNESS_PERCENTAGE_HOVER),
30
+ [`${key}Focused`]: colors_1.lightenColor(baseColor, LIGHTNESS_PERCENTAGE_FOCUSED),
31
+ });
32
+ /**
33
+ * Create a theme by accepting an incomplete theme object and deriving the remaining colors based on button colors.
34
+ *
35
+ * @param {Partial<PaletteType>} paletteConfig The provided theme keys, whether we or the end user defined them.
36
+ * @returns {DefaultTheme}
37
+ */
38
+ const createTheme = (paletteConfig) => {
39
+ return Object.assign(Object.assign({}, base), { palette: Object.assign(Object.assign(Object.assign({}, paletteConfig), createDerivedButtonPalette(palette_1.Palette.brandPrimary, paletteConfig.brandPrimary)), createDerivedButtonPalette(palette_1.Palette.brandSecondary, paletteConfig.brandSecondary)) });
40
+ };
41
+ exports.createTheme = createTheme;
@@ -28,4 +28,4 @@ export declare const getFontFaces: ({ theme }: {
28
28
  * Retrive the correct palette value based on the provided status type.
29
29
  * Falls back to optionally provided palette key, then to 'inherit'.
30
30
  */
31
- export declare const getStatusColor: (theme: DefaultTheme, status?: StatusType | undefined, defaultKey?: "background1" | "background2" | "background3" | "background4" | "background5" | "background6" | "brandPrimary" | "brandSecondary" | "inputBg" | "inputColor" | "inputPlaceholder" | "inputDisabled" | "inputFocused" | "statusSuccess" | "statusWarning" | "statusCritical" | "statusActive" | "textDefault" | "textHelp" | "textInactive" | undefined) => string;
31
+ export declare const getStatusColor: (theme: DefaultTheme, status?: StatusType | undefined, defaultKey?: "background1" | "background2" | "background3" | "background4" | "background5" | "background6" | "brandPrimary" | "brandSecondary" | "brandPrimaryActive" | "brandPrimaryHover" | "brandPrimaryFocused" | "brandSecondaryActive" | "brandSecondaryHover" | "brandSecondaryFocused" | "inputBg" | "inputColor" | "inputPlaceholder" | "inputDisabled" | "inputFocused" | "statusSuccess" | "statusWarning" | "statusCritical" | "statusActive" | "textDefault" | "textHelp" | "textInactive" | undefined) => string;
@@ -10,6 +10,12 @@ export declare const Palette: {
10
10
  readonly background6: "background6";
11
11
  readonly brandPrimary: "brandPrimary";
12
12
  readonly brandSecondary: "brandSecondary";
13
+ readonly brandPrimaryActive: "brandPrimaryActive";
14
+ readonly brandPrimaryHover: "brandPrimaryHover";
15
+ readonly brandPrimaryFocused: "brandPrimaryFocused";
16
+ readonly brandSecondaryActive: "brandSecondaryActive";
17
+ readonly brandSecondaryHover: "brandSecondaryHover";
18
+ readonly brandSecondaryFocused: "brandSecondaryFocused";
13
19
  readonly inputBg: "inputBg";
14
20
  readonly inputColor: "inputColor";
15
21
  readonly inputPlaceholder: "inputPlaceholder";
@@ -13,6 +13,14 @@ exports.Palette = {
13
13
  background6: 'background6',
14
14
  brandPrimary: 'brandPrimary',
15
15
  brandSecondary: 'brandSecondary',
16
+ // --BEGIN These are calculated during theme creation. See ./createTheme.ts
17
+ brandPrimaryActive: 'brandPrimaryActive',
18
+ brandPrimaryHover: 'brandPrimaryHover',
19
+ brandPrimaryFocused: 'brandPrimaryFocused',
20
+ brandSecondaryActive: 'brandSecondaryActive',
21
+ brandSecondaryHover: 'brandSecondaryHover',
22
+ brandSecondaryFocused: 'brandSecondaryFocused',
23
+ // --END
16
24
  inputBg: 'inputBg',
17
25
  inputColor: 'inputColor',
18
26
  inputPlaceholder: 'inputPlaceholder',
@@ -1,22 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OpenFinDarkTheme = exports.OpenFinLightTheme = void 0;
4
- const config_1 = require("../lib/config");
5
- const constants_1 = require("../lib/constants");
6
4
  const palette_1 = require("../lib/palette");
7
- const base = {
8
- _config: config_1.Configuration,
9
- _color: constants_1.Color,
10
- fontSize: constants_1.FontSize,
11
- fontWeight: constants_1.FontWeight,
12
- lineHeight: constants_1.LineHeight,
13
- iconSize: constants_1.IconSize,
14
- radius: constants_1.Radius,
15
- shadow: constants_1.Shadow,
16
- transition: constants_1.Transition,
17
- unit: constants_1.Unit,
18
- px: constants_1.UnitPx,
19
- };
5
+ const constants_1 = require("../lib/constants");
6
+ const createTheme_1 = require("../lib/createTheme");
20
7
  const sharedPalette = {
21
8
  // Brand
22
9
  [palette_1.Palette.brandPrimary]: constants_1.Color.openFin,
@@ -29,24 +16,24 @@ const sharedPalette = {
29
16
  /**
30
17
  * Light Theme
31
18
  */
32
- exports.OpenFinLightTheme = Object.assign(Object.assign({}, base), { palette: Object.assign(Object.assign({}, sharedPalette), {
33
- // Background levels
34
- [palette_1.Palette.background1]: constants_1.Color.lightGray1, [palette_1.Palette.background2]: constants_1.Color.lightGray2, [palette_1.Palette.background3]: constants_1.Color.lightGray3, [palette_1.Palette.background4]: constants_1.Color.lightGray4, [palette_1.Palette.background5]: constants_1.Color.lightGray4, [palette_1.Palette.background6]: constants_1.Color.lightGray4,
35
- // Brand
36
- [palette_1.Palette.brandSecondary]: constants_1.Color.darkGray6,
37
- // Inputs
38
- [palette_1.Palette.inputBg]: constants_1.Color.darkGray1, [palette_1.Palette.inputColor]: constants_1.Color.white, [palette_1.Palette.inputPlaceholder]: constants_1.Color.lightGray4, [palette_1.Palette.inputDisabled]: constants_1.Color.neutralGray, [palette_1.Palette.inputFocused]: constants_1.Color.lightGray4,
39
- // Text
40
- [palette_1.Palette.textDefault]: constants_1.Color.darkGray6, [palette_1.Palette.textHelp]: constants_1.Color.darkGray3, [palette_1.Palette.textInactive]: constants_1.Color.neutralGray }) });
19
+ exports.OpenFinLightTheme = createTheme_1.createTheme(Object.assign(Object.assign({}, sharedPalette), {
20
+ // Background levels
21
+ [palette_1.Palette.background1]: constants_1.Color.lightGray1, [palette_1.Palette.background2]: constants_1.Color.lightGray2, [palette_1.Palette.background3]: constants_1.Color.lightGray3, [palette_1.Palette.background4]: constants_1.Color.lightGray4, [palette_1.Palette.background5]: constants_1.Color.lightGray4, [palette_1.Palette.background6]: constants_1.Color.lightGray4,
22
+ // Brand
23
+ [palette_1.Palette.brandSecondary]: constants_1.Color.darkGray6,
24
+ // Inputs
25
+ [palette_1.Palette.inputBg]: constants_1.Color.darkGray1, [palette_1.Palette.inputColor]: constants_1.Color.white, [palette_1.Palette.inputPlaceholder]: constants_1.Color.lightGray4, [palette_1.Palette.inputDisabled]: constants_1.Color.neutralGray, [palette_1.Palette.inputFocused]: constants_1.Color.lightGray4,
26
+ // Text
27
+ [palette_1.Palette.textDefault]: constants_1.Color.darkGray6, [palette_1.Palette.textHelp]: constants_1.Color.darkGray3, [palette_1.Palette.textInactive]: constants_1.Color.neutralGray }));
41
28
  /**
42
29
  * Dark Theme
43
30
  */
44
- exports.OpenFinDarkTheme = Object.assign(Object.assign({}, base), { palette: Object.assign(Object.assign({}, sharedPalette), {
45
- // Background levels
46
- [palette_1.Palette.background1]: constants_1.Color.darkGray6, [palette_1.Palette.background2]: constants_1.Color.darkGray5, [palette_1.Palette.background3]: constants_1.Color.darkGray4, [palette_1.Palette.background4]: constants_1.Color.darkGray3, [palette_1.Palette.background5]: constants_1.Color.darkGray2, [palette_1.Palette.background6]: constants_1.Color.darkGray1,
47
- // Brand
48
- [palette_1.Palette.brandSecondary]: constants_1.Color.darkGray2,
49
- // Inputs
50
- [palette_1.Palette.inputBg]: constants_1.Color.darkGray1, [palette_1.Palette.inputColor]: constants_1.Color.white, [palette_1.Palette.inputPlaceholder]: constants_1.Color.lightGray4, [palette_1.Palette.inputDisabled]: constants_1.Color.neutralGray, [palette_1.Palette.inputFocused]: constants_1.Color.lightGray4,
51
- // Text
52
- [palette_1.Palette.textDefault]: constants_1.Color.white, [palette_1.Palette.textHelp]: constants_1.Color.lightGray4, [palette_1.Palette.textInactive]: constants_1.Color.neutralGray }) });
31
+ exports.OpenFinDarkTheme = createTheme_1.createTheme(Object.assign(Object.assign({}, sharedPalette), {
32
+ // Background levels
33
+ [palette_1.Palette.background1]: constants_1.Color.darkGray6, [palette_1.Palette.background2]: constants_1.Color.darkGray5, [palette_1.Palette.background3]: constants_1.Color.darkGray4, [palette_1.Palette.background4]: constants_1.Color.darkGray3, [palette_1.Palette.background5]: constants_1.Color.darkGray2, [palette_1.Palette.background6]: constants_1.Color.darkGray1,
34
+ // Brand
35
+ [palette_1.Palette.brandSecondary]: constants_1.Color.darkGray1,
36
+ // Inputs
37
+ [palette_1.Palette.inputBg]: constants_1.Color.darkGray1, [palette_1.Palette.inputColor]: constants_1.Color.white, [palette_1.Palette.inputPlaceholder]: constants_1.Color.lightGray4, [palette_1.Palette.inputDisabled]: constants_1.Color.neutralGray, [palette_1.Palette.inputFocused]: constants_1.Color.lightGray4,
38
+ // Text
39
+ [palette_1.Palette.textDefault]: constants_1.Color.white, [palette_1.Palette.textHelp]: constants_1.Color.lightGray4, [palette_1.Palette.textInactive]: constants_1.Color.neutralGray }));
@@ -48,6 +48,9 @@ exports.SpatialLink = styled_components_1.default.a.attrs({
48
48
  display: block;
49
49
  color: ${({ theme }) => theme.palette.textDefault};
50
50
  text-decoration: none;
51
+ padding: ${({ theme }) => theme.px.small};
52
+ border: 1px solid ${({ theme }) => theme.palette.textDefault};
53
+ border-radius: ${({ theme }) => theme.radius.small};
51
54
  &:after {
52
55
  display: block;
53
56
  content: 'Source: Spatial';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openfin/ui-library",
3
3
  "description": "OpenFin UI Component Library",
4
- "version": "0.1.5",
4
+ "version": "0.1.6-alpha.1617063254",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "repository": "github:openfin/ui-library",
@@ -11,7 +11,8 @@
11
11
  ],
12
12
  "license": "MIT",
13
13
  "dependencies": {
14
- "@modulz/radix-icons": "^4.0.0"
14
+ "@modulz/radix-icons": "^4.0.0",
15
+ "tinycolor2": "^1.4.2"
15
16
  },
16
17
  "peerDependencies": {
17
18
  "styled-components": "^5.2.1"
@@ -38,6 +39,7 @@
38
39
  "@types/react": "^17.0.3",
39
40
  "@types/react-dom": "^17.0.2",
40
41
  "@types/styled-components": "^5.1.8",
42
+ "@types/tinycolor2": "^1.4.2",
41
43
  "@typescript-eslint/eslint-plugin": "^4.17.0",
42
44
  "@typescript-eslint/parser": "^4.17.0",
43
45
  "babel-plugin-styled-components": "^1.12.0",
@@ -52,6 +54,7 @@
52
54
  "react-dom": "^17.0.1",
53
55
  "react-scripts": "4.0.1",
54
56
  "rimraf": "^3.0.2",
57
+ "storybook-addon-performance": "^0.14.0",
55
58
  "styled-components": "^5.2.1",
56
59
  "stylelint": "^13.12.0",
57
60
  "stylelint-config-recommended": "^4.0.0",