@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.
- package/README.md +7 -6
- package/dist/components/{elements → controls}/Button/button.js +7 -3
- package/dist/components/{elements → controls}/Button/button.variants.d.ts +2 -2
- package/dist/components/{elements → controls}/Button/button.variants.js +6 -23
- package/dist/components/controls/Toggle/toggle.d.ts +9 -0
- package/dist/components/{elements → controls}/Toggle/toggle.js +18 -35
- package/dist/components/elements/Badge/badge.d.ts +17 -0
- package/dist/components/elements/Badge/badge.js +41 -0
- package/dist/components/elements/Badge/index.d.ts +1 -0
- package/dist/components/elements/Badge/index.js +13 -0
- package/dist/components/{elements → input}/Input/input.d.ts +2 -4
- package/dist/components/input/Input/input.js +12 -0
- package/dist/components/input/TextInput/index.d.ts +1 -0
- package/dist/components/input/TextInput/index.js +13 -0
- package/dist/components/input/TextInput/textInput.d.ts +3 -0
- package/dist/components/{elements/Input/input.js → input/TextInput/textInput.js} +12 -8
- package/dist/components/layout/Box/box.d.ts +16 -2
- package/dist/components/layout/Box/box.js +11 -9
- package/dist/components/layout/Box/types.d.ts +1 -1
- package/dist/components/system/GlobalStyles/globalStyles.js +2 -2
- package/dist/components/system/ThemeProvider/lib/constants.d.ts +12 -13
- package/dist/components/system/ThemeProvider/lib/constants.js +12 -12
- package/dist/components/system/ThemeProvider/lib/palette.d.ts +18 -21
- package/dist/components/system/ThemeProvider/lib/palette.js +18 -21
- package/dist/components/system/ThemeProvider/themes/openfin.js +27 -3
- package/dist/components/typography/Heading/heading.d.ts +984 -984
- package/dist/components/typography/Text/text.d.ts +5 -1
- package/dist/components/typography/Text/text.js +1 -0
- package/dist/hooks/useColorScheme.js +5 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/dist/react-app-env.d.js +2 -0
- package/dist/storybookHelpers.d.ts +28 -28
- package/dist/storybookHelpers.js +2 -2
- package/package.json +28 -22
- package/dist/components/elements/Toggle/toggle.d.ts +0 -10
- package/dist/components/elements/Toggle/toggle.variants.d.ts +0 -26
- package/dist/components/elements/Toggle/toggle.variants.js +0 -62
- /package/dist/components/{elements → controls}/Button/button.d.ts +0 -0
- /package/dist/components/{elements → controls}/Button/index.d.ts +0 -0
- /package/dist/components/{elements → controls}/Button/index.js +0 -0
- /package/dist/components/{elements → controls}/Toggle/index.d.ts +0 -0
- /package/dist/components/{elements → controls}/Toggle/index.js +0 -0
- /package/dist/components/{elements → input}/Input/index.d.ts +0 -0
- /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
|
|
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
|
-
###
|
|
173
|
+
### Controls
|
|
174
174
|
|
|
175
|
-
- [Button](./src/components/
|
|
176
|
-
- [Icon](./src/components/
|
|
177
|
-
- [Input](./src/components/
|
|
178
|
-
- [Toggle](./src/components/
|
|
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.
|
|
43
|
-
--color-foreground: ${({ theme }) => theme.palette.
|
|
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: "
|
|
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
|
|
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
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
96
|
-
--color-background:
|
|
97
|
-
--color-foreground: ${({ theme }) => theme.palette.
|
|
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
|
|
21
|
-
const
|
|
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',
|
|
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({
|
|
27
|
-
|
|
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.
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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<
|
|
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.
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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,
|
|
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
|
-
* ##
|
|
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
|
|
16
|
-
1: palette_1.Palette.
|
|
17
|
-
2: palette_1.Palette.
|
|
18
|
-
3: palette_1.Palette.
|
|
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,
|
|
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
|
|
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.
|
|
10
|
+
--global-background: ${({ theme }) => theme.palette.background1};
|
|
11
11
|
--global-text: ${({ theme }) => theme.palette.textDefault};
|
|
12
|
-
--global-text-placeholder: ${({ theme }) => theme.palette.
|
|
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
|
|
30
|
-
readonly
|
|
31
|
-
readonly
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
readonly
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
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: "
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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: '
|
|
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
|
|
6
|
-
readonly
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
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
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
29
|
-
textError: 'textError',
|
|
30
|
-
textPlaceholder: 'textPlaceholder',
|
|
27
|
+
textInactive: 'textInactive',
|
|
31
28
|
};
|