@openfin/ui-library 0.0.38 → 0.0.39
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 +8 -3
- package/dist/components/{elements → controls}/Button/button.variants.d.ts +2 -2
- package/dist/components/{elements → controls}/Button/button.variants.js +8 -23
- package/dist/components/{elements → controls}/Toggle/toggle.d.ts +2 -3
- package/dist/components/{elements → controls}/Toggle/toggle.js +4 -4
- package/dist/components/{elements → controls}/Toggle/toggle.variants.d.ts +0 -2
- package/dist/components/controls/Toggle/toggle.variants.js +50 -0
- 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 +11 -12
- package/dist/components/system/ThemeProvider/lib/constants.js +11 -11
- package/dist/components/system/ThemeProvider/lib/palette.d.ts +23 -21
- package/dist/components/system/ThemeProvider/lib/palette.js +23 -21
- package/dist/components/system/ThemeProvider/themes/openfin.js +29 -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.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,13 @@ 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.controlFill};
|
|
43
|
+
--color-foreground: ${({ theme }) => theme.palette.controlAccent};
|
|
44
|
+
|
|
45
|
+
&:disabled {
|
|
46
|
+
--color-background: ${({ theme }) => theme.palette.controlDisabledFill};
|
|
47
|
+
--color-foreground: ${({ theme }) => theme.palette.controlDisabledAccent};
|
|
48
|
+
}
|
|
44
49
|
|
|
45
50
|
/**
|
|
46
51
|
* 2. Inject variants -- ? What are Variants
|
|
@@ -87,5 +92,5 @@ const ButtonPrimary = (props) => (jsx_runtime_1.jsx(exports.Button, Object.assig
|
|
|
87
92
|
exports.ButtonPrimary = ButtonPrimary;
|
|
88
93
|
const ButtonSecondary = (props) => (jsx_runtime_1.jsx(exports.Button, Object.assign({}, props, { kind: "secondary" }), void 0));
|
|
89
94
|
exports.ButtonSecondary = ButtonSecondary;
|
|
90
|
-
const ButtonTertiary = (props) => (jsx_runtime_1.jsx(exports.Button, Object.assign({}, props, { kind: "
|
|
95
|
+
const ButtonTertiary = (props) => (jsx_runtime_1.jsx(exports.Button, Object.assign({}, props, { kind: "textOnly" }), void 0));
|
|
91
96
|
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,16 @@ 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.
|
|
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};
|
|
79
|
+
--color-foreground: ${({ theme }) => theme.palette.controlAccent};
|
|
85
80
|
`,
|
|
86
81
|
[exports.ButtonKind.secondary]: styled_components_1.css `
|
|
87
|
-
--color-background: ${({ theme }) => theme.palette.
|
|
88
|
-
--color-foreground: ${({ theme }) => theme.palette.
|
|
89
|
-
|
|
90
|
-
&:disabled {
|
|
91
|
-
--color-background: ${({ theme }) => theme.palette.secondaryDisabledBg};
|
|
92
|
-
--color-foreground: ${({ theme }) => theme.palette.secondaryDisabledColor};
|
|
93
|
-
}
|
|
82
|
+
--color-background: ${({ theme }) => theme.palette.brandSecondary};
|
|
83
|
+
--color-foreground: ${({ theme }) => theme.palette.controlAccent};
|
|
94
84
|
`,
|
|
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
|
-
}
|
|
85
|
+
[exports.ButtonKind.textOnly]: styled_components_1.css `
|
|
86
|
+
--color-background: transparent;
|
|
87
|
+
--color-foreground: ${({ theme }) => theme.palette.textDefault};
|
|
103
88
|
`,
|
|
104
89
|
},
|
|
105
90
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { InputProps } from '../Input';
|
|
1
|
+
import { FC, InputHTMLAttributes } from 'react';
|
|
3
2
|
import { LabelSideType, KindType } from './toggle.variants';
|
|
4
|
-
export declare type ToggleProps =
|
|
3
|
+
export declare type ToggleProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
5
4
|
label?: string;
|
|
6
5
|
labelSide?: LabelSideType;
|
|
7
6
|
kind?: KindType;
|
|
@@ -18,7 +18,7 @@ exports.Toggle = 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 helpers_1 = require("../../system/ThemeProvider/lib/helpers");
|
|
21
|
-
const Input_1 = require("
|
|
21
|
+
const Input_1 = require("../../input/Input");
|
|
22
22
|
const toggle_variants_1 = require("./toggle.variants");
|
|
23
23
|
const Toggle = (_a) => {
|
|
24
24
|
var { id, label, labelSide = 'right', type = 'checkbox', kind = 'primary' } = _a, inputProps = __rest(_a, ["id", "label", "labelSide", "type", "kind"]);
|
|
@@ -44,9 +44,9 @@ const InputContainer = styled_components_1.default.div `
|
|
|
44
44
|
/**
|
|
45
45
|
* 1. Initialize local variables with reasonable defaults
|
|
46
46
|
*/
|
|
47
|
-
--color-background: ${({ theme }) => theme.palette.
|
|
48
|
-
--color-foreground: ${({ theme }) => theme.palette.
|
|
49
|
-
--color-active: ${({ theme }) => theme.palette.
|
|
47
|
+
--color-background: ${({ theme }) => theme.palette.controlAccent};
|
|
48
|
+
--color-foreground: ${({ theme }) => theme.palette.controlFill};
|
|
49
|
+
--color-active: ${({ theme }) => theme.palette.controlActiveFill};
|
|
50
50
|
--color-knob: var(--color-foreground);
|
|
51
51
|
--px-toggle: ${({ theme }) => theme.px.xlarge};
|
|
52
52
|
--px-knob: ${({ theme }) => theme.px.base};
|
|
@@ -5,7 +5,6 @@ export declare const Variant: {
|
|
|
5
5
|
export declare const Kind: {
|
|
6
6
|
readonly primary: "primary";
|
|
7
7
|
readonly secondary: "secondary";
|
|
8
|
-
readonly tertiary: "tertiary";
|
|
9
8
|
};
|
|
10
9
|
export declare type KindType = keyof typeof Kind;
|
|
11
10
|
export declare const LabelSide: {
|
|
@@ -17,7 +16,6 @@ export declare const variants: {
|
|
|
17
16
|
readonly kind: {
|
|
18
17
|
readonly primary: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
|
|
19
18
|
readonly secondary: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
|
|
20
|
-
readonly tertiary: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
|
|
21
19
|
};
|
|
22
20
|
readonly labelSide: {
|
|
23
21
|
readonly left: import("styled-components").FlattenSimpleInterpolation;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.variants = exports.LabelSide = exports.Kind = exports.Variant = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
exports.Variant = {
|
|
6
|
+
kind: 'kind',
|
|
7
|
+
labelSide: 'labelSide',
|
|
8
|
+
};
|
|
9
|
+
exports.Kind = {
|
|
10
|
+
primary: 'primary',
|
|
11
|
+
secondary: 'secondary',
|
|
12
|
+
};
|
|
13
|
+
exports.LabelSide = {
|
|
14
|
+
left: 'left',
|
|
15
|
+
right: 'right',
|
|
16
|
+
};
|
|
17
|
+
exports.variants = {
|
|
18
|
+
[exports.Variant.kind]: {
|
|
19
|
+
[exports.Kind.primary]: styled_components_1.css `
|
|
20
|
+
--color-background: ${({ theme }) => theme.palette.controlFill};
|
|
21
|
+
--color-foreground: ${({ theme }) => theme.palette.controlAccent};
|
|
22
|
+
--color-active: ${({ theme }) => theme.palette.controlActiveFill};
|
|
23
|
+
--color-knob: ${({ theme }) => theme.palette.controlAccent};
|
|
24
|
+
|
|
25
|
+
&:disabled {
|
|
26
|
+
--color-background: ${({ theme }) => theme.palette.controlDisabledFill};
|
|
27
|
+
--color-foreground: ${({ theme }) => theme.palette.controlDisabledAccent};
|
|
28
|
+
}
|
|
29
|
+
`,
|
|
30
|
+
[exports.Kind.secondary]: styled_components_1.css `
|
|
31
|
+
--color-background: ${({ theme }) => theme.palette.brandSecondary};
|
|
32
|
+
--color-foreground: ${({ theme }) => theme.palette.controlAccent};
|
|
33
|
+
--color-active: ${({ theme }) => theme.palette.controlActiveFill};
|
|
34
|
+
--color-knob: ${({ theme }) => theme.palette.controlAccent};
|
|
35
|
+
|
|
36
|
+
&:disabled {
|
|
37
|
+
--color-background: ${({ theme }) => theme.palette.controlDisabledFill};
|
|
38
|
+
--color-foreground: ${({ theme }) => theme.palette.controlDisabledAccent};
|
|
39
|
+
}
|
|
40
|
+
`,
|
|
41
|
+
},
|
|
42
|
+
[exports.Variant.labelSide]: {
|
|
43
|
+
[exports.LabelSide.left]: styled_components_1.css `
|
|
44
|
+
flex-direction: row;
|
|
45
|
+
`,
|
|
46
|
+
[exports.LabelSide.right]: styled_components_1.css `
|
|
47
|
+
flex-direction: row-reverse;
|
|
48
|
+
`,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
@@ -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)";
|
|
@@ -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)',
|
|
@@ -2,27 +2,29 @@
|
|
|
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
|
|
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 controlFill: "controlFill";
|
|
14
|
+
readonly controlAccent: "controlAccent";
|
|
15
|
+
readonly controlActiveFill: "controlActiveFill";
|
|
16
|
+
readonly controlDisabledFill: "controlDisabledFill";
|
|
17
|
+
readonly controlDisabledAccent: "controlDisabledAccent";
|
|
18
|
+
readonly inputBg: "inputBg";
|
|
19
|
+
readonly inputColor: "inputColor";
|
|
20
|
+
readonly inputPlaceholder: "inputPlaceholder";
|
|
21
|
+
readonly inputDisabledBg: "inputDisabledBg";
|
|
22
|
+
readonly statusSuccess: "statusSuccess";
|
|
23
|
+
readonly statusWarning: "statusWarning";
|
|
24
|
+
readonly statusCritical: "statusCritical";
|
|
25
|
+
readonly statusInfo: "statusInfo";
|
|
26
|
+
readonly statusFocused: "statusFocused";
|
|
23
27
|
readonly textDefault: "textDefault";
|
|
24
28
|
readonly textHelp: "textHelp";
|
|
25
|
-
readonly
|
|
26
|
-
readonly textError: "textError";
|
|
27
|
-
readonly textPlaceholder: "textPlaceholder";
|
|
29
|
+
readonly textInactive: "textInactive";
|
|
28
30
|
};
|
|
@@ -5,27 +5,29 @@ 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
|
-
|
|
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
|
+
controlFill: 'controlFill',
|
|
17
|
+
controlAccent: 'controlAccent',
|
|
18
|
+
controlActiveFill: 'controlActiveFill',
|
|
19
|
+
controlDisabledFill: 'controlDisabledFill',
|
|
20
|
+
controlDisabledAccent: 'controlDisabledAccent',
|
|
21
|
+
inputBg: 'inputBg',
|
|
22
|
+
inputColor: 'inputColor',
|
|
23
|
+
inputPlaceholder: 'inputPlaceholder',
|
|
24
|
+
inputDisabledBg: 'inputDisabledBg',
|
|
25
|
+
statusSuccess: 'statusSuccess',
|
|
26
|
+
statusWarning: 'statusWarning',
|
|
27
|
+
statusCritical: 'statusCritical',
|
|
28
|
+
statusInfo: 'statusInfo',
|
|
29
|
+
statusFocused: 'statusFocused',
|
|
26
30
|
textDefault: 'textDefault',
|
|
27
31
|
textHelp: 'textHelp',
|
|
28
|
-
|
|
29
|
-
textError: 'textError',
|
|
30
|
-
textPlaceholder: 'textPlaceholder',
|
|
32
|
+
textInactive: 'textInactive',
|
|
31
33
|
};
|