@openfin/ui-library 0.1.15 → 0.1.16-alpha.1621620164
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.
- package/README.md +4 -2
- package/dist/components/controls/Button/button.js +4 -4
- package/dist/components/controls/Button/button.variants.js +1 -0
- package/dist/components/controls/Toggle/toggle.js +5 -5
- package/dist/components/input/BaseInput/baseInput.d.ts +5 -1
- package/dist/components/input/BaseInput/baseInput.js +1 -0
- package/dist/components/input/TextInput/textInput.d.ts +1 -0
- package/dist/components/system/ThemeProvider/lib/colors.d.ts +1 -0
- package/dist/components/system/ThemeProvider/lib/colors.js +5 -1
- package/dist/components/system/ThemeProvider/lib/constants.d.ts +8 -8
- package/dist/components/system/ThemeProvider/lib/constants.js +8 -8
- package/dist/components/system/ThemeProvider/lib/createTheme.d.ts +2 -2
- package/dist/components/system/ThemeProvider/lib/createTheme.js +6 -4
- package/dist/components/system/ThemeProvider/lib/helpers.d.ts +1 -1
- package/dist/components/system/ThemeProvider/lib/palette.d.ts +2 -0
- package/dist/components/system/ThemeProvider/lib/palette.js +2 -0
- package/dist/components/system/ThemeProvider/themes/openfin.js +6 -6
- package/dist/hooks/useTheme.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
**TL;DR** – Use this library and write less CSS.
|
|
14
14
|
|
|
15
|
-
This is an opinionated React component library, which aims to provide the basic building blocks that you can use in any OpenFin environment. It was built w/ our [Spatial Design System](https://www.figma.com/file/0Y3pKZj0tJWuleF12h5Sua/Spatial---Components) in mind, so it should always reflect OpenFin's latest branding and designs.
|
|
15
|
+
This is an opinionated React component library, built on top of [styled-components](https://styled-components.com/docs), which aims to provide the basic building blocks that you can use in any OpenFin environment. It was built w/ our [Spatial Design System](https://www.figma.com/file/0Y3pKZj0tJWuleF12h5Sua/Spatial---Components) in mind, so it should always reflect OpenFin's latest branding and designs.
|
|
16
16
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
@@ -23,9 +23,11 @@ This is an opinionated React component library, which aims to provide the basic
|
|
|
23
23
|
|
|
24
24
|
### 2. Install the package
|
|
25
25
|
|
|
26
|
+
…along with `styled-components`.
|
|
27
|
+
|
|
26
28
|
```bash
|
|
27
29
|
# Install the latest version
|
|
28
|
-
$ yarn add @openfin/ui-library
|
|
30
|
+
$ yarn add @openfin/ui-library styled-components
|
|
29
31
|
```
|
|
30
32
|
|
|
31
33
|
```bash
|
|
@@ -39,7 +39,7 @@ const ButtonElement = styled_components_1.default.button `
|
|
|
39
39
|
/* Default values that get overridden by variants */
|
|
40
40
|
background: ${({ theme }) => theme.palette.inputBg};
|
|
41
41
|
border: 1px solid ${({ theme }) => theme.palette.inputBg};
|
|
42
|
-
color: ${({ theme }) => theme.palette.
|
|
42
|
+
color: ${({ theme }) => theme.palette.brandPrimaryText};
|
|
43
43
|
|
|
44
44
|
/* Inject variants */
|
|
45
45
|
${helpers_1.getVariantCSS(button_variants_1.variants, button_variants_1.Variant.size)}
|
|
@@ -75,9 +75,9 @@ const ButtonLabel = styled_components_1.default(Box_1.Box) `
|
|
|
75
75
|
/**
|
|
76
76
|
* ## Button Variants
|
|
77
77
|
*/
|
|
78
|
-
const ButtonPrimary = (props) =>
|
|
78
|
+
const ButtonPrimary = (props) => jsx_runtime_1.jsx(exports.Button, Object.assign({}, props, { kind: "primary" }), void 0);
|
|
79
79
|
exports.ButtonPrimary = ButtonPrimary;
|
|
80
|
-
const ButtonSecondary = (props) =>
|
|
80
|
+
const ButtonSecondary = (props) => jsx_runtime_1.jsx(exports.Button, Object.assign({}, props, { kind: "secondary" }), void 0);
|
|
81
81
|
exports.ButtonSecondary = ButtonSecondary;
|
|
82
|
-
const ButtonTextOnly = (props) =>
|
|
82
|
+
const ButtonTextOnly = (props) => jsx_runtime_1.jsx(exports.Button, Object.assign({}, props, { kind: "textOnly" }), void 0);
|
|
83
83
|
exports.ButtonTextOnly = ButtonTextOnly;
|
|
@@ -93,6 +93,7 @@ exports.variants = {
|
|
|
93
93
|
[exports.ButtonKind.secondary]: styled_components_1.css `
|
|
94
94
|
background: ${({ theme }) => theme.palette.brandSecondary};
|
|
95
95
|
border-color: ${({ theme }) => theme.palette.brandSecondary};
|
|
96
|
+
color: ${({ theme }) => theme.palette.brandSecondaryText};
|
|
96
97
|
|
|
97
98
|
&:hover {
|
|
98
99
|
background: ${({ theme }) => theme.palette.brandSecondaryHover};
|
|
@@ -31,13 +31,13 @@ const Toggle = (_a) => {
|
|
|
31
31
|
setIsChecked(event.target.checked);
|
|
32
32
|
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
33
33
|
} }), void 0),
|
|
34
|
-
jsx_runtime_1.jsx(ToggleKnob, { tabIndex: -1 }, void 0)] }), void 0)] }), void 0));
|
|
34
|
+
jsx_runtime_1.jsx(ToggleKnob, { tabIndex: -1, isChecked: isChecked }, void 0)] }), void 0)] }), void 0));
|
|
35
35
|
};
|
|
36
36
|
exports.Toggle = Toggle;
|
|
37
37
|
const ToggleContainer = styled_components_1.default.div `
|
|
38
38
|
display: flex;
|
|
39
39
|
gap: ${({ theme }) => theme.px.xlarge};
|
|
40
|
-
flex-direction: ${({ labelSide }) => labelSide === '
|
|
40
|
+
flex-direction: ${({ labelSide }) => (labelSide === 'left' ? 'row' : 'row-reverse')};
|
|
41
41
|
line-height: ${({ theme }) => theme.px.xlarge /* Matches height of Input to vertically center text */};
|
|
42
42
|
`;
|
|
43
43
|
const InputContainer = styled_components_1.default(Box_1.Box) `
|
|
@@ -48,7 +48,7 @@ const InputContainer = styled_components_1.default(Box_1.Box) `
|
|
|
48
48
|
height: var(--px-toggle);
|
|
49
49
|
width: calc(2 * var(--px-toggle));
|
|
50
50
|
border: 1px solid
|
|
51
|
-
${({ isChecked, theme }) => isChecked ? theme.palette.brandPrimary : theme.palette.inputBg};
|
|
51
|
+
${({ isChecked, theme }) => (isChecked ? theme.palette.brandPrimary : theme.palette.inputBg)};
|
|
52
52
|
border-radius: calc(0.5 * var(--px-toggle));
|
|
53
53
|
|
|
54
54
|
background: ${({ isChecked, theme }) => isChecked ? theme.palette.brandPrimary : theme.palette.inputBg};
|
|
@@ -67,10 +67,10 @@ const ToggleKnob = styled_components_1.default.button `
|
|
|
67
67
|
left: ${({ theme }) => theme.px.xsmall};
|
|
68
68
|
transform: translateY(-50%);
|
|
69
69
|
border-radius: 50%;
|
|
70
|
-
background: ${({ theme }) => theme.palette.inputColor};
|
|
70
|
+
background: ${({ isChecked, theme }) => isChecked ? theme.palette.brandPrimaryText : theme.palette.inputColor};
|
|
71
71
|
border: none;
|
|
72
72
|
outline: none;
|
|
73
|
-
transition: left var(--openfin-ui-globalTransition);
|
|
73
|
+
transition: left var(--openfin-ui-globalTransition), background var(--openfin-ui-globalTransition);
|
|
74
74
|
pointer-events: none; /* Allow pass-thru for native input */
|
|
75
75
|
`;
|
|
76
76
|
const ToggleInput = styled_components_1.default(RawInput_1.RawInput) `
|
|
@@ -4,10 +4,14 @@ export declare type BaseInputProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
|
4
4
|
message?: string;
|
|
5
5
|
label?: string;
|
|
6
6
|
renderInput?: Function;
|
|
7
|
+
isFullWidth?: true;
|
|
7
8
|
} & WithStatusProps;
|
|
8
9
|
export declare const BaseInput: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
|
|
9
10
|
message?: string | undefined;
|
|
10
11
|
label?: string | undefined;
|
|
11
12
|
renderInput?: Function | undefined;
|
|
13
|
+
isFullWidth?: true | undefined;
|
|
12
14
|
} & WithStatusProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
13
|
-
export declare const StyledInputField: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, InputHTMLAttributes<HTMLInputElement> & WithStatusProps
|
|
15
|
+
export declare const StyledInputField: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, InputHTMLAttributes<HTMLInputElement> & WithStatusProps & {
|
|
16
|
+
isFullWidth?: true | undefined;
|
|
17
|
+
}, never>;
|
|
@@ -49,6 +49,7 @@ exports.StyledInputField = styled_components_1.default.input `
|
|
|
49
49
|
font-size: ${({ theme }) => theme.fontSize.base};
|
|
50
50
|
padding: ${({ theme }) => `${theme.px.small} ${theme.px.base}`};
|
|
51
51
|
transition: border-color var(--openfin-ui-globalTransition);
|
|
52
|
+
width: ${({ isFullWidth }) => isFullWidth && '100%'};
|
|
52
53
|
|
|
53
54
|
&:focus {
|
|
54
55
|
outline: 0;
|
|
@@ -5,4 +5,5 @@ export declare const TextInput: import("react").ForwardRefExoticComponent<import
|
|
|
5
5
|
message?: string | undefined;
|
|
6
6
|
label?: string | undefined;
|
|
7
7
|
renderInput?: Function | undefined;
|
|
8
|
+
isFullWidth?: true | undefined;
|
|
8
9
|
} & import("../../system/HOC").WithStatusProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ColorInputWithoutInstance as Color } from 'tinycolor2';
|
|
2
2
|
export declare const lightenColor: (color: Color, amount?: number | undefined) => string;
|
|
3
3
|
export declare const darkenColor: (color: Color, amount?: number | undefined) => string;
|
|
4
|
+
export declare const getMostReadable: (baseColor: Color, colors: Color[]) => string;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.darkenColor = exports.lightenColor = void 0;
|
|
6
|
+
exports.getMostReadable = exports.darkenColor = exports.lightenColor = void 0;
|
|
7
7
|
const tinycolor2_1 = __importDefault(require("tinycolor2"));
|
|
8
8
|
const lightenColor = (color, amount) => adjustColor(color, 'lighten', amount);
|
|
9
9
|
exports.lightenColor = lightenColor;
|
|
@@ -15,3 +15,7 @@ const adjustColor = (color, func, amount) => {
|
|
|
15
15
|
}
|
|
16
16
|
return tinycolor2_1.default(color)[func](amount).toString();
|
|
17
17
|
};
|
|
18
|
+
const getMostReadable = (baseColor, colors) => {
|
|
19
|
+
return tinycolor2_1.default.mostReadable(baseColor, colors).toHexString();
|
|
20
|
+
};
|
|
21
|
+
exports.getMostReadable = getMostReadable;
|
|
@@ -9,17 +9,17 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const Color: {
|
|
11
11
|
readonly white: "#FFFFFF";
|
|
12
|
-
readonly lightGray1: "#
|
|
13
|
-
readonly lightGray2: "#
|
|
14
|
-
readonly lightGray3: "#
|
|
15
|
-
readonly lightGray4: "#
|
|
12
|
+
readonly lightGray1: "#FAFBFE";
|
|
13
|
+
readonly lightGray2: "#F3F5F8";
|
|
14
|
+
readonly lightGray3: "#ECEEF1";
|
|
15
|
+
readonly lightGray4: "#DDDFE4";
|
|
16
|
+
readonly lightGray5: "#C9CBD2";
|
|
16
17
|
readonly neutralGray: "#7D808A";
|
|
17
18
|
readonly darkGray1: "#53565F";
|
|
18
19
|
readonly darkGray2: "#383A40";
|
|
19
|
-
readonly darkGray3: "#
|
|
20
|
-
readonly darkGray4: "#
|
|
21
|
-
readonly darkGray5: "#
|
|
22
|
-
readonly darkGray6: "#111214";
|
|
20
|
+
readonly darkGray3: "#24262B";
|
|
21
|
+
readonly darkGray4: "#1E1F23";
|
|
22
|
+
readonly darkGray5: "#111214";
|
|
23
23
|
readonly openFinDarkest: "#3D39CD";
|
|
24
24
|
readonly openFinDarker: "#4642E0";
|
|
25
25
|
readonly openFin: "#504CFF";
|
|
@@ -33,17 +33,17 @@ const createFontFaceCss_1 = require("./createFontFaceCss");
|
|
|
33
33
|
*/
|
|
34
34
|
exports.Color = {
|
|
35
35
|
white: '#FFFFFF',
|
|
36
|
-
lightGray1: '#
|
|
37
|
-
lightGray2: '#
|
|
38
|
-
lightGray3: '#
|
|
39
|
-
lightGray4: '#
|
|
36
|
+
lightGray1: '#FAFBFE',
|
|
37
|
+
lightGray2: '#F3F5F8',
|
|
38
|
+
lightGray3: '#ECEEF1',
|
|
39
|
+
lightGray4: '#DDDFE4',
|
|
40
|
+
lightGray5: '#C9CBD2',
|
|
40
41
|
neutralGray: '#7D808A',
|
|
41
42
|
darkGray1: '#53565F',
|
|
42
43
|
darkGray2: '#383A40',
|
|
43
|
-
darkGray3: '#
|
|
44
|
-
darkGray4: '#
|
|
45
|
-
darkGray5: '#
|
|
46
|
-
darkGray6: '#111214',
|
|
44
|
+
darkGray3: '#24262B',
|
|
45
|
+
darkGray4: '#1E1F23',
|
|
46
|
+
darkGray5: '#111214',
|
|
47
47
|
openFinDarkest: '#3D39CD',
|
|
48
48
|
openFinDarker: '#4642E0',
|
|
49
49
|
openFin: '#504CFF',
|
|
@@ -3,7 +3,7 @@ import { PaletteType } from '../lib/types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Create a theme by accepting an incomplete theme object and deriving the remaining colors based on button colors.
|
|
5
5
|
*
|
|
6
|
-
* @param {Partial<PaletteType>}
|
|
6
|
+
* @param {Partial<PaletteType>} palettePartial The provided theme keys, whether we or the end user defined them.
|
|
7
7
|
* @returns {DefaultTheme}
|
|
8
8
|
*/
|
|
9
|
-
export declare const createTheme: (
|
|
9
|
+
export declare const createTheme: (palettePartial: Partial<PaletteType>) => DefaultTheme;
|
|
@@ -24,18 +24,20 @@ const base = {
|
|
|
24
24
|
/**
|
|
25
25
|
* Created Active, Hover, and Focused Colors derived from base color
|
|
26
26
|
*/
|
|
27
|
-
const
|
|
27
|
+
const createDerivedPaletteKeys = (key, baseColor) => ({
|
|
28
28
|
[`${key}Active`]: colors_1.darkenColor(baseColor, LIGHTNESS_PERCENTAGE_ACTIVE),
|
|
29
29
|
[`${key}Hover`]: colors_1.lightenColor(baseColor, LIGHTNESS_PERCENTAGE_HOVER),
|
|
30
30
|
[`${key}Focused`]: colors_1.lightenColor(baseColor, LIGHTNESS_PERCENTAGE_FOCUSED),
|
|
31
|
+
[`${key}Text`]: colors_1.getMostReadable(baseColor, [constants_1.Color.white, constants_1.Color.darkGray5]),
|
|
31
32
|
});
|
|
32
33
|
/**
|
|
33
34
|
* Create a theme by accepting an incomplete theme object and deriving the remaining colors based on button colors.
|
|
34
35
|
*
|
|
35
|
-
* @param {Partial<PaletteType>}
|
|
36
|
+
* @param {Partial<PaletteType>} palettePartial The provided theme keys, whether we or the end user defined them.
|
|
36
37
|
* @returns {DefaultTheme}
|
|
37
38
|
*/
|
|
38
|
-
const createTheme = (
|
|
39
|
-
|
|
39
|
+
const createTheme = (palettePartial) => {
|
|
40
|
+
const foo = Object.assign(Object.assign({}, base), { palette: Object.assign(Object.assign(Object.assign({}, palettePartial), createDerivedPaletteKeys(palette_1.Palette.brandPrimary, palettePartial.brandPrimary)), createDerivedPaletteKeys(palette_1.Palette.brandSecondary, palettePartial.brandSecondary)) });
|
|
41
|
+
return foo;
|
|
40
42
|
};
|
|
41
43
|
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" | "brandPrimaryActive" | "brandPrimaryHover" | "brandPrimaryFocused" | "brandSecondaryActive" | "brandSecondaryHover" | "brandSecondaryFocused" | "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" | "brandPrimaryText" | "brandSecondaryActive" | "brandSecondaryHover" | "brandSecondaryFocused" | "brandSecondaryText" | "inputBg" | "inputColor" | "inputPlaceholder" | "inputDisabled" | "inputFocused" | "statusSuccess" | "statusWarning" | "statusCritical" | "statusActive" | "textDefault" | "textHelp" | "textInactive" | undefined) => string;
|
|
@@ -13,9 +13,11 @@ export declare const Palette: {
|
|
|
13
13
|
readonly brandPrimaryActive: "brandPrimaryActive";
|
|
14
14
|
readonly brandPrimaryHover: "brandPrimaryHover";
|
|
15
15
|
readonly brandPrimaryFocused: "brandPrimaryFocused";
|
|
16
|
+
readonly brandPrimaryText: "brandPrimaryText";
|
|
16
17
|
readonly brandSecondaryActive: "brandSecondaryActive";
|
|
17
18
|
readonly brandSecondaryHover: "brandSecondaryHover";
|
|
18
19
|
readonly brandSecondaryFocused: "brandSecondaryFocused";
|
|
20
|
+
readonly brandSecondaryText: "brandSecondaryText";
|
|
19
21
|
readonly inputBg: "inputBg";
|
|
20
22
|
readonly inputColor: "inputColor";
|
|
21
23
|
readonly inputPlaceholder: "inputPlaceholder";
|
|
@@ -17,9 +17,11 @@ exports.Palette = {
|
|
|
17
17
|
brandPrimaryActive: 'brandPrimaryActive',
|
|
18
18
|
brandPrimaryHover: 'brandPrimaryHover',
|
|
19
19
|
brandPrimaryFocused: 'brandPrimaryFocused',
|
|
20
|
+
brandPrimaryText: 'brandPrimaryText',
|
|
20
21
|
brandSecondaryActive: 'brandSecondaryActive',
|
|
21
22
|
brandSecondaryHover: 'brandSecondaryHover',
|
|
22
23
|
brandSecondaryFocused: 'brandSecondaryFocused',
|
|
24
|
+
brandSecondaryText: 'brandSecondaryText',
|
|
23
25
|
// --END
|
|
24
26
|
inputBg: 'inputBg',
|
|
25
27
|
inputColor: 'inputColor',
|
|
@@ -18,21 +18,21 @@ const sharedPalette = {
|
|
|
18
18
|
*/
|
|
19
19
|
exports.OpenFinLightTheme = createTheme_1.createTheme(Object.assign(Object.assign({}, sharedPalette), {
|
|
20
20
|
// Background levels
|
|
21
|
-
[palette_1.Palette.background1]: constants_1.Color.
|
|
21
|
+
[palette_1.Palette.background1]: constants_1.Color.white, [palette_1.Palette.background2]: constants_1.Color.lightGray1, [palette_1.Palette.background3]: constants_1.Color.lightGray2, [palette_1.Palette.background4]: constants_1.Color.lightGray3, [palette_1.Palette.background5]: constants_1.Color.lightGray4, [palette_1.Palette.background6]: constants_1.Color.lightGray5,
|
|
22
22
|
// Brand
|
|
23
|
-
[palette_1.Palette.brandSecondary]: constants_1.Color.
|
|
23
|
+
[palette_1.Palette.brandSecondary]: constants_1.Color.darkGray5,
|
|
24
24
|
// Inputs
|
|
25
|
-
[palette_1.Palette.inputBg]: constants_1.Color.
|
|
25
|
+
[palette_1.Palette.inputBg]: constants_1.Color.lightGray3, [palette_1.Palette.inputColor]: constants_1.Color.darkGray5, [palette_1.Palette.inputPlaceholder]: constants_1.Color.darkGray2, [palette_1.Palette.inputDisabled]: constants_1.Color.neutralGray, [palette_1.Palette.inputFocused]: constants_1.Color.lightGray5,
|
|
26
26
|
// Text
|
|
27
|
-
[palette_1.Palette.textDefault]: constants_1.Color.
|
|
27
|
+
[palette_1.Palette.textDefault]: constants_1.Color.darkGray5, [palette_1.Palette.textHelp]: constants_1.Color.darkGray3, [palette_1.Palette.textInactive]: constants_1.Color.neutralGray }));
|
|
28
28
|
/**
|
|
29
29
|
* Dark Theme
|
|
30
30
|
*/
|
|
31
31
|
exports.OpenFinDarkTheme = createTheme_1.createTheme(Object.assign(Object.assign({}, sharedPalette), {
|
|
32
32
|
// Background levels
|
|
33
|
-
[palette_1.Palette.background1]: constants_1.Color.
|
|
33
|
+
[palette_1.Palette.background1]: constants_1.Color.darkGray5, [palette_1.Palette.background2]: constants_1.Color.darkGray4, [palette_1.Palette.background3]: constants_1.Color.darkGray3, [palette_1.Palette.background4]: constants_1.Color.darkGray2, [palette_1.Palette.background5]: constants_1.Color.darkGray1, [palette_1.Palette.background6]: constants_1.Color.neutralGray,
|
|
34
34
|
// Brand
|
|
35
|
-
[palette_1.Palette.brandSecondary]: constants_1.Color.
|
|
35
|
+
[palette_1.Palette.brandSecondary]: constants_1.Color.darkGray2,
|
|
36
36
|
// Inputs
|
|
37
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
38
|
// Text
|
package/dist/hooks/useTheme.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useTheme = void 0;
|
|
4
4
|
const themes_1 = require("../components/system/ThemeProvider/themes");
|
|
5
5
|
const useColorScheme_1 = require("../hooks/useColorScheme");
|
|
6
|
+
const ThemeProvider_1 = require("../components/system/ThemeProvider");
|
|
6
7
|
const Themes = {
|
|
7
8
|
[useColorScheme_1.ColorScheme.dark]: themes_1.OpenFinDarkTheme,
|
|
8
9
|
[useColorScheme_1.ColorScheme.light]: themes_1.OpenFinLightTheme,
|
|
@@ -22,7 +23,8 @@ const useTheme = ({ themes, scheme, config, }) => {
|
|
|
22
23
|
? // Built-in Theme
|
|
23
24
|
Themes[currentScheme]
|
|
24
25
|
: // Built-in Theme with User-provided Palette
|
|
25
|
-
|
|
26
|
+
// @todo – This is a potential performance bottleneck
|
|
27
|
+
ThemeProvider_1.createTheme(Object.assign(Object.assign({}, Themes[currentScheme].palette), themes[currentScheme].palette));
|
|
26
28
|
// 3. Merge any User-provided Config
|
|
27
29
|
if (config) {
|
|
28
30
|
currentTheme._config = Object.assign(Object.assign({}, currentTheme._config), config);
|
package/package.json
CHANGED