@openfin/ui-library 0.0.38 → 0.0.40

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.
Files changed (45) hide show
  1. package/README.md +7 -6
  2. package/dist/components/{elements → controls}/Button/button.js +7 -3
  3. package/dist/components/{elements → controls}/Button/button.variants.d.ts +2 -2
  4. package/dist/components/{elements → controls}/Button/button.variants.js +6 -23
  5. package/dist/components/controls/Toggle/toggle.d.ts +9 -0
  6. package/dist/components/{elements → controls}/Toggle/toggle.js +18 -35
  7. package/dist/components/elements/Badge/badge.d.ts +17 -0
  8. package/dist/components/elements/Badge/badge.js +41 -0
  9. package/dist/components/elements/Badge/index.d.ts +1 -0
  10. package/dist/components/elements/Badge/index.js +13 -0
  11. package/dist/components/{elements → input}/Input/input.d.ts +2 -4
  12. package/dist/components/input/Input/input.js +12 -0
  13. package/dist/components/input/TextInput/index.d.ts +1 -0
  14. package/dist/components/input/TextInput/index.js +13 -0
  15. package/dist/components/input/TextInput/textInput.d.ts +3 -0
  16. package/dist/components/{elements/Input/input.js → input/TextInput/textInput.js} +12 -8
  17. package/dist/components/layout/Box/box.d.ts +16 -2
  18. package/dist/components/layout/Box/box.js +11 -9
  19. package/dist/components/layout/Box/types.d.ts +1 -1
  20. package/dist/components/system/GlobalStyles/globalStyles.js +2 -2
  21. package/dist/components/system/ThemeProvider/lib/constants.d.ts +12 -13
  22. package/dist/components/system/ThemeProvider/lib/constants.js +12 -12
  23. package/dist/components/system/ThemeProvider/lib/palette.d.ts +18 -21
  24. package/dist/components/system/ThemeProvider/lib/palette.js +18 -21
  25. package/dist/components/system/ThemeProvider/themes/openfin.js +27 -3
  26. package/dist/components/typography/Heading/heading.d.ts +984 -984
  27. package/dist/components/typography/Text/text.d.ts +5 -1
  28. package/dist/components/typography/Text/text.js +1 -0
  29. package/dist/hooks/useColorScheme.js +5 -0
  30. package/dist/index.d.ts +4 -3
  31. package/dist/index.js +4 -3
  32. package/dist/react-app-env.d.js +2 -0
  33. package/dist/storybookHelpers.d.ts +28 -28
  34. package/dist/storybookHelpers.js +2 -2
  35. package/package.json +28 -22
  36. package/dist/components/elements/Toggle/toggle.d.ts +0 -10
  37. package/dist/components/elements/Toggle/toggle.variants.d.ts +0 -26
  38. package/dist/components/elements/Toggle/toggle.variants.js +0 -62
  39. /package/dist/components/{elements → controls}/Button/button.d.ts +0 -0
  40. /package/dist/components/{elements → controls}/Button/index.d.ts +0 -0
  41. /package/dist/components/{elements → controls}/Button/index.js +0 -0
  42. /package/dist/components/{elements → controls}/Toggle/index.d.ts +0 -0
  43. /package/dist/components/{elements → controls}/Toggle/index.js +0 -0
  44. /package/dist/components/{elements → input}/Input/index.d.ts +0 -0
  45. /package/dist/components/{elements → input}/Input/index.js +0 -0
package/README.md CHANGED
@@ -116,7 +116,7 @@ touch .git/hooks/pre-push &&
116
116
 
117
117
  Pull requests are a great way to express an idea or need, if it's easier to "show" instead of "tell", go for it, propose a change!
118
118
 
119
- Also keep in mind, UI Library is a home of centralized common elements, **used by several products**. It's reasonable to expect PRs may spark conversations about the **essence of the change** and it's benefits and impact across the application ecosystem.
119
+ Also keep in mind, UI Library is a home of centralized common components, **used by several products**. It's reasonable to expect PRs may spark conversations about the **essence of the change** and it's benefits and impact across the application ecosystem.
120
120
 
121
121
  Meaning: While there are no hard rules about what belongs in _our_ library, if a change is too opinionated or too specialized, it may make sense to leave it out. **A library that does less, is a lot easier to know and work with**.
122
122
 
@@ -170,12 +170,13 @@ This triggers a Github Action to automatically build the latest version of the `
170
170
 
171
171
  ## Components
172
172
 
173
- ### Elements
173
+ ### Controls
174
174
 
175
- - [Button](./src/components/elements/Button)
176
- - [Icon](./src/components/elements/Icon)
177
- - [Input](./src/components/elements/Input)
178
- - [Toggle](./src/components/elements/Toggle)
175
+ - [Button](./src/components/controls/Button)
176
+ - [Icon](./src/components/controls/Icon)
177
+ - [Input](./src/components/input/Input)
178
+ - [Toggle](./src/components/controls/Toggle)
179
+ - [Badge](./src/components/controls/Badge)
179
180
 
180
181
  ### Layout
181
182
 
@@ -39,8 +39,12 @@ const ButtonElement = styled_components_1.default.button `
39
39
  /**
40
40
  * 1. Initialize local variables with reasonable defaults
41
41
  */
42
- --color-background: ${({ theme }) => theme.palette.primaryBg};
43
- --color-foreground: ${({ theme }) => theme.palette.primaryColor};
42
+ --color-background: ${({ theme }) => theme.palette.inputBg};
43
+ --color-foreground: ${({ theme }) => theme.palette.inputColor};
44
+
45
+ &:disabled {
46
+ --color-background: ${({ theme }) => theme.palette.inputDisabled};
47
+ }
44
48
 
45
49
  /**
46
50
  * 2. Inject variants -- ? What are Variants
@@ -87,5 +91,5 @@ const ButtonPrimary = (props) => (jsx_runtime_1.jsx(exports.Button, Object.assig
87
91
  exports.ButtonPrimary = ButtonPrimary;
88
92
  const ButtonSecondary = (props) => (jsx_runtime_1.jsx(exports.Button, Object.assign({}, props, { kind: "secondary" }), void 0));
89
93
  exports.ButtonSecondary = ButtonSecondary;
90
- const ButtonTertiary = (props) => (jsx_runtime_1.jsx(exports.Button, Object.assign({}, props, { kind: "tertiary" }), void 0));
94
+ const ButtonTertiary = (props) => (jsx_runtime_1.jsx(exports.Button, Object.assign({}, props, { kind: "textOnly" }), void 0));
91
95
  exports.ButtonTertiary = ButtonTertiary;
@@ -14,7 +14,7 @@ export declare const Variant: {
14
14
  export declare const ButtonKind: {
15
15
  readonly primary: "primary";
16
16
  readonly secondary: "secondary";
17
- readonly tertiary: "tertiary";
17
+ readonly textOnly: "textOnly";
18
18
  };
19
19
  export declare type ButtonKindType = keyof typeof ButtonKind;
20
20
  /**
@@ -59,6 +59,6 @@ export declare const variants: {
59
59
  readonly kind: {
60
60
  readonly primary: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
61
61
  readonly secondary: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
62
- readonly tertiary: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
62
+ readonly textOnly: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
63
63
  };
64
64
  };
@@ -18,7 +18,7 @@ exports.Variant = {
18
18
  exports.ButtonKind = {
19
19
  primary: 'primary',
20
20
  secondary: 'secondary',
21
- tertiary: 'tertiary',
21
+ textOnly: 'textOnly',
22
22
  };
23
23
  /**
24
24
  * Button Size
@@ -75,31 +75,14 @@ exports.variants = {
75
75
  },
76
76
  [exports.Variant.kind]: {
77
77
  [exports.ButtonKind.primary]: styled_components_1.css `
78
- --color-background: ${({ theme }) => theme.palette.primaryBg};
79
- --color-foreground: ${({ theme }) => theme.palette.primaryColor};
80
-
81
- &:disabled {
82
- --color-background: ${({ theme }) => theme.palette.primaryDisabledBg};
83
- --color-foreground: ${({ theme }) => theme.palette.primaryDisabledColor};
84
- }
78
+ --color-background: ${({ theme }) => theme.palette.brandPrimary};
85
79
  `,
86
80
  [exports.ButtonKind.secondary]: styled_components_1.css `
87
- --color-background: ${({ theme }) => theme.palette.secondaryBg};
88
- --color-foreground: ${({ theme }) => theme.palette.secondaryColor};
89
-
90
- &:disabled {
91
- --color-background: ${({ theme }) => theme.palette.secondaryDisabledBg};
92
- --color-foreground: ${({ theme }) => theme.palette.secondaryDisabledColor};
93
- }
81
+ --color-background: ${({ theme }) => theme.palette.brandSecondary};
94
82
  `,
95
- [exports.ButtonKind.tertiary]: styled_components_1.css `
96
- --color-background: ${({ theme }) => theme.palette.tertiaryBg};
97
- --color-foreground: ${({ theme }) => theme.palette.tertiaryColor};
98
-
99
- &:disabled {
100
- --color-background: ${({ theme }) => theme.palette.tertiaryDisabledBg};
101
- --color-foreground: ${({ theme }) => theme.palette.tertiaryDisabledColor};
102
- }
83
+ [exports.ButtonKind.textOnly]: styled_components_1.css `
84
+ --color-background: transparent;
85
+ --color-foreground: ${({ theme }) => theme.palette.textDefault};
103
86
  `,
104
87
  },
105
88
  };
@@ -0,0 +1,9 @@
1
+ import { FC, InputHTMLAttributes } from 'react';
2
+ export declare type LabelSideType = 'left' | 'right';
3
+ export declare type ToggleProps = InputHTMLAttributes<HTMLInputElement> & {
4
+ label?: string;
5
+ labelSide?: LabelSideType;
6
+ type?: 'checkbox' | 'radio';
7
+ onChange?: Function;
8
+ };
9
+ export declare const Toggle: FC<ToggleProps>;
@@ -16,60 +16,43 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.Toggle = void 0;
18
18
  const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const react_1 = require("react");
19
20
  const styled_components_1 = __importDefault(require("styled-components"));
20
- const helpers_1 = require("../../system/ThemeProvider/lib/helpers");
21
- const Input_1 = require("../Input");
22
- const toggle_variants_1 = require("./toggle.variants");
21
+ const Input_1 = require("../../input/Input");
22
+ const Box_1 = require("../../layout/Box");
23
23
  const Toggle = (_a) => {
24
- var { id, label, labelSide = 'right', type = 'checkbox', kind = 'primary' } = _a, inputProps = __rest(_a, ["id", "label", "labelSide", "type", "kind"]);
24
+ var { id, label, labelSide = 'right', type = 'checkbox', onChange = () => { } } = _a, inputProps = __rest(_a, ["id", "label", "labelSide", "type", "onChange"]);
25
+ const [isChecked, setIsChecked] = react_1.useState(inputProps.checked);
25
26
  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,
26
- jsx_runtime_1.jsxs(InputContainer, Object.assign({ kind: kind, isChecked: inputProps.checked }, { children: [jsx_runtime_1.jsx(ToggleInput, Object.assign({ id: id, type: type }, inputProps), void 0),
27
- jsx_runtime_1.jsx(ToggleKnob, {}, void 0)] }), void 0)] }), void 0));
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) => {
28
+ setIsChecked(event.target.checked);
29
+ onChange(event);
30
+ } }), void 0),
31
+ jsx_runtime_1.jsx(ToggleKnob, { tabIndex: -1 }, void 0)] }), void 0)] }), void 0));
28
32
  };
29
33
  exports.Toggle = Toggle;
30
34
  const ToggleContainer = styled_components_1.default.div `
31
- /**
32
- * 1. Inject variants
33
- */
34
- ${helpers_1.getVariantCSS(toggle_variants_1.variants, toggle_variants_1.Variant.labelSide)}
35
-
36
- /**
37
- * 2. Component Build
38
- */
39
35
  display: flex;
40
36
  gap: ${({ theme }) => theme.px.xlarge};
37
+ flex-direction: ${({ labelSide }) => labelSide === 'right' ? 'row' : 'row-reverse'};
41
38
  line-height: ${({ theme }) => theme.px.xlarge /* Matches height of Input to vertically center text */};
42
39
  `;
43
- const InputContainer = styled_components_1.default.div `
44
- /**
45
- * 1. Initialize local variables with reasonable defaults
46
- */
47
- --color-background: ${({ theme }) => theme.palette.primaryBg};
48
- --color-foreground: ${({ theme }) => theme.palette.primaryColor};
49
- --color-active: ${({ theme }) => theme.palette.primaryActive};
50
- --color-knob: var(--color-foreground);
40
+ const InputContainer = styled_components_1.default(Box_1.Box) `
51
41
  --px-toggle: ${({ theme }) => theme.px.xlarge};
52
42
  --px-knob: ${({ theme }) => theme.px.base};
53
43
 
54
- /**
55
- * 2. Inject variants
56
- */
57
- ${helpers_1.getVariantCSS(toggle_variants_1.variants, toggle_variants_1.Variant.kind)}
58
-
59
- /**
60
- * 3. Component Build
61
- */
62
44
  position: relative;
63
45
  height: var(--px-toggle);
64
46
  width: calc(2 * var(--px-toggle));
47
+ border: 1px solid
48
+ ${({ isChecked, theme }) => isChecked ? theme.palette.brandPrimary : theme.palette.inputBg};
65
49
  border-radius: calc(0.5 * var(--px-toggle));
66
50
 
67
- background: var(--color-background);
51
+ background: ${({ isChecked, theme }) => isChecked ? theme.palette.brandPrimary : theme.palette.inputBg};
68
52
  transition: background var(--global-transition);
69
53
 
70
54
  &:focus-within {
71
- box-shadow: 0 0 0 2px ${({ theme }) => theme._color.black30},
72
- 0 0 0 2px var(--color-active);
55
+ border-color: ${({ theme }) => theme.palette.inputFocused};
73
56
  }
74
57
  `;
75
58
  const ToggleKnob = styled_components_1.default.button `
@@ -80,7 +63,7 @@ const ToggleKnob = styled_components_1.default.button `
80
63
  left: ${({ theme }) => theme.px.xsmall};
81
64
  transform: translateY(-50%);
82
65
  border-radius: 50%;
83
- background: var(--color-knob);
66
+ background: ${({ theme }) => theme.palette.inputColor};
84
67
  border: none;
85
68
  outline: none;
86
69
  transition: left var(--global-transition);
@@ -102,7 +85,7 @@ const ToggleInput = styled_components_1.default(Input_1.Input) `
102
85
  left: calc(100% - ${({ theme }) => theme.px.large});
103
86
  }
104
87
  &:disabled + ${ToggleKnob} {
105
- opacity: 0.5;
88
+ background: ${({ theme }) => theme.palette.inputDisabled};
106
89
  }
107
90
  &:not(:disabled) {
108
91
  cursor: pointer;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /**
4
+ * Number displayed in the badge.
5
+ */
6
+ count: number;
7
+ /**
8
+ * If `count` is greater than `max` it will be clamped to `max`.
9
+ * When clamped it will display `{max}+`.
10
+ *
11
+ * @example
12
+ * <Badge count={200} max={99} />
13
+ * // outputs `99+`
14
+ */
15
+ max?: number;
16
+ }
17
+ export declare const Badge: React.FC<BadgeProps>;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Badge = void 0;
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const styled_components_1 = __importDefault(require("styled-components"));
20
+ const Box_1 = require("../../layout/Box");
21
+ const Badge = (_a) => {
22
+ var { count = 0, max } = _a, rest = __rest(_a, ["count", "max"]);
23
+ let value = count.toString();
24
+ if (max && count > max) {
25
+ value = `${max}+`;
26
+ }
27
+ return jsx_runtime_1.jsx(BadgeElement, Object.assign({}, rest, { children: value }), void 0);
28
+ };
29
+ exports.Badge = Badge;
30
+ const BadgeElement = styled_components_1.default(Box_1.Box) `
31
+ background: ${({ theme }) => theme.palette.statusCritical};
32
+ border-radius: ${({ theme }) => theme.radius.pill};
33
+ color: ${({ theme }) => theme._color.white};
34
+ font-size: ${({ theme }) => theme.fontSize.small};
35
+ min-width: ${({ theme }) => theme.px.xlarge};
36
+ padding: 2px 6px;
37
+ display: inline-flex;
38
+ align-items: center;
39
+ justify-content: center;
40
+ box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
41
+ `;
@@ -0,0 +1 @@
1
+ export * from './badge';
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./badge"), exports);
@@ -1,8 +1,6 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
- export declare type InputProps = InputHTMLAttributes<HTMLInputElement> & {
3
- className?: string;
4
- };
2
+ export declare type InputProps = InputHTMLAttributes<HTMLInputElement>;
5
3
  /**
6
4
  * Unstyled Input extended by other components
7
5
  */
8
- export declare const Input: import("styled-components").StyledComponent<({ className, ...props }: InputProps) => JSX.Element, import("styled-components").DefaultTheme, {}, never>;
6
+ export declare const Input: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,12 @@
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.Input = void 0;
7
+ const styled_components_1 = __importDefault(require("styled-components"));
8
+ /**
9
+ * Unstyled Input extended by other components
10
+ */
11
+ exports.Input = styled_components_1.default.input ``;
12
+ exports.Input.displayName = 'Input';
@@ -0,0 +1 @@
1
+ export * from './textInput';
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./textInput"), exports);
@@ -0,0 +1,3 @@
1
+ import { FC, InputHTMLAttributes } from 'react';
2
+ export declare type TextInputProps = InputHTMLAttributes<HTMLInputElement>;
3
+ export declare const TextInput: import("styled-components").StyledComponent<FC<TextInputProps>, import("styled-components").DefaultTheme, {}, never>;
@@ -14,13 +14,17 @@ 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.Input = void 0;
17
+ exports.TextInput = void 0;
18
18
  const jsx_runtime_1 = require("react/jsx-runtime");
19
19
  const styled_components_1 = __importDefault(require("styled-components"));
20
- /**
21
- * Unstyled Input extended by other components
22
- */
23
- exports.Input = styled_components_1.default((_a) => {
24
- var { className } = _a, props = __rest(_a, ["className"]);
25
- return jsx_runtime_1.jsx("input", Object.assign({ className: className }, props), void 0);
26
- }) ``;
20
+ const Input_1 = require("../Input");
21
+ const TextInputInner = (_a) => {
22
+ var { className } = _a, rest = __rest(_a, ["className"]);
23
+ return (jsx_runtime_1.jsx(Input_1.Input, Object.assign({ className: className, type: "text" }, rest), void 0));
24
+ };
25
+ exports.TextInput = styled_components_1.default(TextInputInner) `
26
+ background: ${({ theme }) => theme.palette.inputBg};
27
+ border: 1px solid ${({ theme }) => theme.palette.inputBg};
28
+ box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
29
+ color: ${({ theme }) => theme.palette.inputColor};
30
+ `;
@@ -13,7 +13,7 @@ export declare type BoxProps = HTMLAttributes<HTMLDivElement> & {
13
13
  flexGrow?: 1 | 0;
14
14
  flexShrink?: 1 | 0;
15
15
  order?: number;
16
- surfaceLevel?: BoxTypes.SurfaceLevel;
16
+ background?: BoxTypes.BackgroundLevel;
17
17
  padding?: UnitPxType;
18
18
  };
19
19
  /**
@@ -24,4 +24,18 @@ export declare type BoxProps = HTMLAttributes<HTMLDivElement> & {
24
24
  * - Box can be both the flex parent and the flex child.
25
25
  * - None of the child properties should be applied unless specified.
26
26
  */
27
- export declare const Box: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, BoxProps, never>;
27
+ export declare const Box: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, HTMLAttributes<HTMLDivElement> & {
28
+ alignItems?: BoxTypes.AlignItems | undefined;
29
+ display?: BoxTypes.Display | undefined;
30
+ flexDirection?: BoxTypes.FlexDirection | undefined;
31
+ flexWrap?: BoxTypes.FlexWrap | undefined;
32
+ justifyContent?: BoxTypes.JustifyContent | undefined;
33
+ gap?: "xsmall" | "small" | "base" | "large" | "xlarge" | "xxlarge" | "xxxlarge" | "xxxxlarge" | undefined;
34
+ alignSelf?: BoxTypes.AlignSelf | undefined;
35
+ flexBasis?: string | undefined;
36
+ flexGrow?: 0 | 1 | undefined;
37
+ flexShrink?: 0 | 1 | undefined;
38
+ order?: number | undefined;
39
+ background?: BoxTypes.BackgroundLevel | undefined;
40
+ padding?: "xsmall" | "small" | "base" | "large" | "xlarge" | "xxlarge" | "xxxlarge" | "xxxxlarge" | undefined;
41
+ }, never>;
@@ -7,15 +7,16 @@ exports.Box = void 0;
7
7
  const styled_components_1 = __importDefault(require("styled-components"));
8
8
  const palette_1 = require("../../system/ThemeProvider/lib/palette");
9
9
  /**
10
- * ## SurfaceLevels
11
- *
12
- * Maps “surface” levels to palette colors.
13
- * Passing a surface level will give the box a background color associated with a z-index position in our design system.
10
+ * ## BackgroundLevels
11
+ * Maps background levels to palette colors.
14
12
  */
15
- const SurfaceLevels = {
16
- 1: palette_1.Palette.surfaceBottom,
17
- 2: palette_1.Palette.surfaceMiddle,
18
- 3: palette_1.Palette.surfaceTop,
13
+ const BackgroundLevels = {
14
+ 1: palette_1.Palette.background1,
15
+ 2: palette_1.Palette.background2,
16
+ 3: palette_1.Palette.background3,
17
+ 4: palette_1.Palette.background4,
18
+ 5: palette_1.Palette.background5,
19
+ 6: palette_1.Palette.background6,
19
20
  };
20
21
  /**
21
22
  * ## Box
@@ -38,5 +39,6 @@ exports.Box = styled_components_1.default.div `
38
39
  flex-shrink: ${({ flexShrink }) => flexShrink};
39
40
  order: ${({ order }) => order};
40
41
  padding: ${({ theme, padding }) => padding && theme.px[padding]};
41
- background: ${({ theme, surfaceLevel }) => surfaceLevel && theme.palette[SurfaceLevels[surfaceLevel]]};
42
+ background: ${({ theme, background }) => background && theme.palette[BackgroundLevels[background]]};
42
43
  `;
44
+ exports.Box.displayName = 'Box';
@@ -4,4 +4,4 @@ export declare type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-r
4
4
  export declare type FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
5
5
  export declare type JustifyContent = 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly' | 'start' | 'end' | 'left' | 'right';
6
6
  export declare type AlignSelf = 'auto' | 'flex-start' | ' flex-end' | 'center' | 'baseline' | 'stretch';
7
- export declare type SurfaceLevel = 1 | 2 | 3;
7
+ export declare type BackgroundLevel = 1 | 2 | 3 | 4 | 5 | 6;
@@ -7,9 +7,9 @@ const helpers_1 = require("../ThemeProvider/lib/helpers");
7
7
  exports.GlobalStyles = styled_components_1.createGlobalStyle `
8
8
  /** -> Define Global CSS Vars */
9
9
  :root {
10
- --global-background: ${({ theme }) => theme.palette.surfaceBottom};
10
+ --global-background: ${({ theme }) => theme.palette.background1};
11
11
  --global-text: ${({ theme }) => theme.palette.textDefault};
12
- --global-text-placeholder: ${({ theme }) => theme.palette.textPlaceholder};
12
+ --global-text-placeholder: ${({ theme }) => theme.palette.inputPlaceholder};
13
13
  --global-typography: ${constants_1.Typography.base};
14
14
  --global-transition: ${({ theme }) => theme.transition.base};
15
15
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * Color --
4
3
  * Color maps names to values.
@@ -26,17 +25,17 @@ export declare const Color: {
26
25
  readonly openFinLight: "#5254FB";
27
26
  readonly openFinLighter: "#5C5EFE";
28
27
  readonly openFinLightest: "#6864FF";
29
- readonly active: "#189FFB";
30
- readonly success: "#35C759";
31
- readonly warning: "#F48F00";
32
- readonly error: "#C93400";
33
- readonly accent1: "#8C61FF";
34
- readonly accent2: "#36C3FE";
35
- readonly accent3: "#00CC88";
36
- readonly accent4: "#FFEB00";
37
- readonly accent5: "#FF8C4C";
38
- readonly accent6: "#FF5E60";
39
- readonly accent7: "#FF8FB8";
28
+ readonly blue: "#189FFB";
29
+ readonly green: "#35C759";
30
+ readonly orange: "#F48F00";
31
+ readonly red: "#C93400";
32
+ readonly purple: "#8C61FF";
33
+ readonly lightblue: "#36C3FE";
34
+ readonly aqua: "#00CC88";
35
+ readonly yellow: "#FFEB00";
36
+ readonly salmon: "#FF8C4C";
37
+ readonly pink: "#FF5E60";
38
+ readonly lightpink: "#FF8FB8";
40
39
  readonly white00: "rgba(255,255,255,0.0)";
41
40
  readonly white10: "rgba(255,255,255,0.1)";
42
41
  readonly white20: "rgba(255,255,255,0.2)";
@@ -193,7 +192,7 @@ export declare const Typography: {
193
192
  * Design System transition easings because UI motion feels better if everything moves the same way.
194
193
  */
195
194
  export declare const Transition: {
196
- readonly base: "250ms ease-in-out";
195
+ readonly base: "200ms cubic-bezier(0.16, 1, 0.3, 1)";
197
196
  readonly none: "0ms";
198
197
  };
199
198
  /**
@@ -49,17 +49,17 @@ exports.Color = {
49
49
  openFinLight: '#5254FB',
50
50
  openFinLighter: '#5C5EFE',
51
51
  openFinLightest: '#6864FF',
52
- active: '#189FFB',
53
- success: '#35C759',
54
- warning: '#F48F00',
55
- error: '#C93400',
56
- accent1: '#8C61FF',
57
- accent2: '#36C3FE',
58
- accent3: '#00CC88',
59
- accent4: '#FFEB00',
60
- accent5: '#FF8C4C',
61
- accent6: '#FF5E60',
62
- accent7: '#FF8FB8',
52
+ blue: '#189FFB',
53
+ green: '#35C759',
54
+ orange: '#F48F00',
55
+ red: '#C93400',
56
+ purple: '#8C61FF',
57
+ lightblue: '#36C3FE',
58
+ aqua: '#00CC88',
59
+ yellow: '#FFEB00',
60
+ salmon: '#FF8C4C',
61
+ pink: '#FF5E60',
62
+ lightpink: '#FF8FB8',
63
63
  white00: 'rgba(255,255,255,0.0)',
64
64
  white10: 'rgba(255,255,255,0.1)',
65
65
  white20: 'rgba(255,255,255,0.2)',
@@ -228,7 +228,7 @@ exports.Typography = {
228
228
  * Design System transition easings because UI motion feels better if everything moves the same way.
229
229
  */
230
230
  exports.Transition = {
231
- base: '250ms ease-in-out',
231
+ base: '200ms cubic-bezier(0.16, 1, 0.3, 1)',
232
232
  none: '0ms',
233
233
  };
234
234
  /**
@@ -2,27 +2,24 @@
2
2
  * Theme Palette -- Canonical list of names we use to reference color values within a theme
3
3
  */
4
4
  export declare const Palette: {
5
- readonly surfaceBottom: "surfaceBottom";
6
- readonly surfaceMiddle: "surfaceMiddle";
7
- readonly surfaceTop: "surfaceTop";
8
- readonly primaryBg: "primaryBg";
9
- readonly primaryColor: "primaryColor";
10
- readonly primaryActive: "primaryActive";
11
- readonly primaryDisabledBg: "primaryDisabledBg";
12
- readonly primaryDisabledColor: "primaryDisabledColor";
13
- readonly secondaryBg: "secondaryBg";
14
- readonly secondaryColor: "secondaryColor";
15
- readonly secondaryActive: "secondaryActive";
16
- readonly secondaryDisabledBg: "secondaryDisabledBg";
17
- readonly secondaryDisabledColor: "secondaryDisabledColor";
18
- readonly tertiaryBg: "tertiaryBg";
19
- readonly tertiaryColor: "tertiaryColor";
20
- readonly tertiaryActive: "tertiaryActive";
21
- readonly tertiaryDisabledBg: "tertiaryDisabledBg";
22
- readonly tertiaryDisabledColor: "tertiaryDisabledColor";
5
+ readonly background1: "background1";
6
+ readonly background2: "background2";
7
+ readonly background3: "background3";
8
+ readonly background4: "background4";
9
+ readonly background5: "background5";
10
+ readonly background6: "background6";
11
+ readonly brandPrimary: "brandPrimary";
12
+ readonly brandSecondary: "brandSecondary";
13
+ readonly inputBg: "inputBg";
14
+ readonly inputColor: "inputColor";
15
+ readonly inputPlaceholder: "inputPlaceholder";
16
+ readonly inputDisabled: "inputDisabled";
17
+ readonly inputFocused: "inputFocused";
18
+ readonly statusSuccess: "statusSuccess";
19
+ readonly statusWarning: "statusWarning";
20
+ readonly statusCritical: "statusCritical";
21
+ readonly statusActive: "statusActive";
23
22
  readonly textDefault: "textDefault";
24
23
  readonly textHelp: "textHelp";
25
- readonly textDisabled: "textDisabled";
26
- readonly textError: "textError";
27
- readonly textPlaceholder: "textPlaceholder";
24
+ readonly textInactive: "textInactive";
28
25
  };
@@ -5,27 +5,24 @@ exports.Palette = void 0;
5
5
  * Theme Palette -- Canonical list of names we use to reference color values within a theme
6
6
  */
7
7
  exports.Palette = {
8
- surfaceBottom: 'surfaceBottom',
9
- surfaceMiddle: 'surfaceMiddle',
10
- surfaceTop: 'surfaceTop',
11
- primaryBg: 'primaryBg',
12
- primaryColor: 'primaryColor',
13
- primaryActive: 'primaryActive',
14
- primaryDisabledBg: 'primaryDisabledBg',
15
- primaryDisabledColor: 'primaryDisabledColor',
16
- secondaryBg: 'secondaryBg',
17
- secondaryColor: 'secondaryColor',
18
- secondaryActive: 'secondaryActive',
19
- secondaryDisabledBg: 'secondaryDisabledBg',
20
- secondaryDisabledColor: 'secondaryDisabledColor',
21
- tertiaryBg: 'tertiaryBg',
22
- tertiaryColor: 'tertiaryColor',
23
- tertiaryActive: 'tertiaryActive',
24
- tertiaryDisabledBg: 'tertiaryDisabledBg',
25
- tertiaryDisabledColor: 'tertiaryDisabledColor',
8
+ background1: 'background1',
9
+ background2: 'background2',
10
+ background3: 'background3',
11
+ background4: 'background4',
12
+ background5: 'background5',
13
+ background6: 'background6',
14
+ brandPrimary: 'brandPrimary',
15
+ brandSecondary: 'brandSecondary',
16
+ inputBg: 'inputBg',
17
+ inputColor: 'inputColor',
18
+ inputPlaceholder: 'inputPlaceholder',
19
+ inputDisabled: 'inputDisabled',
20
+ inputFocused: 'inputFocused',
21
+ statusSuccess: 'statusSuccess',
22
+ statusWarning: 'statusWarning',
23
+ statusCritical: 'statusCritical',
24
+ statusActive: 'statusActive',
26
25
  textDefault: 'textDefault',
27
26
  textHelp: 'textHelp',
28
- textDisabled: 'textDisabled',
29
- textError: 'textError',
30
- textPlaceholder: 'textPlaceholder',
27
+ textInactive: 'textInactive',
31
28
  };