@edvisor/product-language 0.2.0 → 0.3.1
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/index.d.ts +2 -0
- package/index.js +7914 -0
- package/lib/components/alert-banner/alert-banner.d.ts +11 -0
- package/lib/components/alert-banner/alert-level-flags.d.ts +13 -0
- package/lib/components/alert-banner/index.d.ts +1 -0
- package/lib/components/badge/badge-type-flags.d.ts +18 -0
- package/lib/components/badge/badge.d.ts +5 -0
- package/lib/components/badge/index.d.ts +1 -0
- package/{src/lib/components/card/atoms/card-frame.tsx → lib/components/card/atoms/card-frame.d.ts} +7 -17
- package/lib/components/card/atoms/index.d.ts +1 -0
- package/lib/components/card/card.d.ts +14 -0
- package/lib/components/card/components/card-alert-banner-slot.d.ts +5 -0
- package/lib/components/card/components/card-controls-slot.d.ts +4 -0
- package/lib/components/card/components/card-section-slot.d.ts +11 -0
- package/lib/components/card/components/index.d.ts +3 -0
- package/lib/components/card/index.d.ts +2 -0
- package/lib/components/card/molecules/index.d.ts +1 -0
- package/lib/components/card/molecules/left-right-card.d.ts +16 -0
- package/lib/components/checkbox/checkbox.d.ts +10 -0
- package/lib/components/checkbox/helpers.d.ts +12 -0
- package/lib/components/checkbox/index.d.ts +1 -0
- package/lib/components/divider/divider-type-flags.d.ts +9 -0
- package/lib/components/divider/divider.d.ts +7 -0
- package/lib/components/divider/index.d.ts +1 -0
- package/lib/components/flag/flag-size-flags.d.ts +12 -0
- package/lib/components/flag/flag.d.ts +9 -0
- package/lib/components/flag/flag.list.d.ts +781 -0
- package/lib/components/flag/index.d.ts +1 -0
- package/lib/components/icon/icon-list.d.ts +131 -0
- package/lib/components/icon/icon.d.ts +131 -0
- package/lib/components/icon/index.d.ts +1 -0
- package/lib/components/index.d.ts +17 -0
- package/lib/components/input-field/components/index.d.ts +2 -0
- package/lib/components/input-field/components/labeled-input.d.ts +10 -0
- package/lib/components/input-field/components/stepper.d.ts +7 -0
- package/lib/components/input-field/index.d.ts +3 -0
- package/lib/components/input-field/input-field.d.ts +25 -0
- package/lib/components/input-field/input-number.d.ts +18 -0
- package/lib/components/input-field/input-text.d.ts +14 -0
- package/lib/components/layout/flex.d.ts +16 -0
- package/lib/components/layout/grid-layout.d.ts +11 -0
- package/lib/components/layout/index.d.ts +3 -0
- package/lib/components/layout/left-right-layout.d.ts +34 -0
- package/lib/components/link/index.d.ts +1 -0
- package/lib/components/link/link.d.ts +14 -0
- package/lib/components/molecules/avatar/avatar-size-flags.d.ts +12 -0
- package/lib/components/molecules/avatar/avatar.d.ts +12 -0
- package/lib/components/molecules/avatar/index.d.ts +1 -0
- package/lib/components/molecules/button/button-flags.d.ts +44 -0
- package/lib/components/molecules/button/button.d.ts +12 -0
- package/lib/components/molecules/button/index.d.ts +1 -0
- package/lib/components/molecules/index.d.ts +3 -0
- package/lib/components/molecules/input-checkbox/index.d.ts +1 -0
- package/lib/components/molecules/input-checkbox/input-checkbox.d.ts +8 -0
- package/lib/components/organisms/index.d.ts +1 -0
- package/lib/components/organisms/multi-choice-list/index.d.ts +1 -0
- package/lib/components/organisms/multi-choice-list/multi-choice-list.d.ts +10 -0
- package/lib/components/spinner/index.d.ts +1 -0
- package/lib/components/spinner/spinner-size-flags.d.ts +10 -0
- package/lib/components/spinner/spinner.d.ts +9 -0
- package/lib/components/tabs/components/index.d.ts +1 -0
- package/lib/components/tabs/components/tab.d.ts +7 -0
- package/lib/components/tabs/index.d.ts +1 -0
- package/lib/components/tabs/tabs.d.ts +15 -0
- package/lib/components/tag/components/close-button.d.ts +8 -0
- package/lib/components/tag/components/index.d.ts +2 -0
- package/lib/components/tag/components/tag-label.d.ts +8 -0
- package/lib/components/tag/index.d.ts +1 -0
- package/lib/components/tag/tag.d.ts +10 -0
- package/lib/components/thumbnail/index.d.ts +1 -0
- package/lib/components/thumbnail/thumbnail-size-flags.d.ts +10 -0
- package/lib/components/thumbnail/thumbnail.d.ts +10 -0
- package/lib/components/typography/index.d.ts +1 -0
- package/lib/components/typography/typography.d.ts +24 -0
- package/lib/foundations/color-system/base-palette/base-palette.d.ts +76 -0
- package/lib/foundations/color-system/base-palette/index.d.ts +1 -0
- package/lib/foundations/color-system/color-guidelines/color-guidelines.d.ts +132 -0
- package/lib/foundations/color-system/color-guidelines/index.d.ts +1 -0
- package/lib/foundations/color-system/components/color-sample.d.ts +17 -0
- package/lib/foundations/color-system/components/index.d.ts +1 -0
- package/lib/foundations/color-system/index.d.ts +1 -0
- package/lib/foundations/index.d.ts +4 -0
- package/lib/foundations/shadows/components.d.ts +8 -0
- package/lib/foundations/shadows/index.d.ts +1 -0
- package/lib/foundations/shadows/shadows.d.ts +8 -0
- package/lib/foundations/spacing/index.d.ts +1 -0
- package/lib/foundations/spacing/spacing-guidelines.d.ts +22 -0
- package/lib/foundations/spacing/spacing.d.ts +18 -0
- package/lib/foundations/typography/constants.d.ts +22 -0
- package/lib/foundations/typography/fonts.d.ts +1 -0
- package/lib/foundations/typography/index.d.ts +1 -0
- package/lib/foundations/typography/text-aspect-flags.d.ts +19 -0
- package/lib/foundations/typography/typography.d.ts +24 -0
- package/lib/helpers/generic-types.d.ts +21 -0
- package/lib/helpers/index.d.ts +6 -0
- package/lib/helpers/nothing.d.ts +8 -0
- package/{src/lib/helpers/numbers.ts → lib/helpers/numbers.d.ts} +50 -53
- package/lib/helpers/safe-navigation.d.ts +15 -0
- package/lib/helpers/slots.d.ts +23 -0
- package/lib/helpers/strings.d.ts +1 -0
- package/package.json +12 -5
- package/.babelrc +0 -12
- package/.eslintrc.json +0 -139
- package/.storybook/main.js +0 -57
- package/.storybook/manager.js +0 -7
- package/.storybook/preview-head.html +0 -1
- package/.storybook/preview.js +0 -15
- package/.storybook/tsconfig.json +0 -30
- package/jest.config.ts +0 -15
- package/jest.setup.ts +0 -2
- package/project.json +0 -85
- package/release-it.json +0 -18
- package/src/assets/svg/example_icon.svg +0 -3
- package/src/assets/svg/example_icon_white.svg +0 -3
- package/src/assets/svg/spinner.svg +0 -3
- package/src/assets/svg/spinner_white.svg +0 -3
- package/src/helpers/index.ts +0 -3
- package/src/helpers/talesOf.tsx +0 -42
- package/src/index.ts +0 -2
- package/src/lib/components/README.md +0 -49
- package/src/lib/components/alert-banner/alert-banner.tsx +0 -34
- package/src/lib/components/alert-banner/alert-level-flags.ts +0 -77
- package/src/lib/components/alert-banner/index.ts +0 -1
- package/src/lib/components/badge/badge-type-flags.ts +0 -72
- package/src/lib/components/badge/badge.stories.tsx +0 -16
- package/src/lib/components/badge/badge.test.tsx +0 -29
- package/src/lib/components/badge/badge.tsx +0 -31
- package/src/lib/components/badge/index.ts +0 -1
- package/src/lib/components/card/atoms/index.ts +0 -1
- package/src/lib/components/card/card.test.tsx +0 -163
- package/src/lib/components/card/card.tsx +0 -78
- package/src/lib/components/card/components/card-alert-banner-slot.tsx +0 -16
- package/src/lib/components/card/components/card-controls-slot.tsx +0 -19
- package/src/lib/components/card/components/card-section-slot.tsx +0 -51
- package/src/lib/components/card/components/index.ts +0 -3
- package/src/lib/components/card/index.ts +0 -2
- package/src/lib/components/card/molecules/index.ts +0 -1
- package/src/lib/components/card/molecules/left-right-card.test.tsx +0 -89
- package/src/lib/components/card/molecules/left-right-card.tsx +0 -63
- package/src/lib/components/card/storybook/card.stories.mdx +0 -100
- package/src/lib/components/card/storybook/components.tsx +0 -240
- package/src/lib/components/checkbox/checkbox.test.tsx +0 -39
- package/src/lib/components/checkbox/checkbox.tsx +0 -124
- package/src/lib/components/checkbox/components/components.tsx +0 -59
- package/src/lib/components/checkbox/index.tsx +0 -1
- package/src/lib/components/checkbox/stories/checkbox.stories.mdx +0 -54
- package/src/lib/components/checkbox/stories/components.tsx +0 -36
- package/src/lib/components/checkbox/stories/index.tsx +0 -1
- package/src/lib/components/divider/divider-type-flags.tsx +0 -37
- package/src/lib/components/divider/divider.test.tsx +0 -34
- package/src/lib/components/divider/divider.tsx +0 -37
- package/src/lib/components/divider/index.tsx +0 -1
- package/src/lib/components/divider/stories/components.tsx +0 -13
- package/src/lib/components/divider/stories/divider.stories.mdx +0 -50
- package/src/lib/components/index.ts +0 -14
- package/src/lib/components/input-field/components/index.ts +0 -2
- package/src/lib/components/input-field/components/labeled-input.tsx +0 -61
- package/src/lib/components/input-field/components/stepper.tsx +0 -59
- package/src/lib/components/input-field/index.ts +0 -6
- package/src/lib/components/input-field/input-field.test.tsx +0 -108
- package/src/lib/components/input-field/input-field.tsx +0 -126
- package/src/lib/components/input-field/input-number.tsx +0 -41
- package/src/lib/components/input-field/input-text.tsx +0 -30
- package/src/lib/components/input-field/storybook/components.tsx +0 -334
- package/src/lib/components/input-field/storybook/input-field.stories.mdx +0 -113
- package/src/lib/components/layout/flex.tsx +0 -22
- package/src/lib/components/layout/grid-layout.tsx +0 -40
- package/src/lib/components/layout/index.ts +0 -3
- package/src/lib/components/layout/left-right-layout.tsx +0 -67
- package/src/lib/components/link/index.ts +0 -1
- package/src/lib/components/link/link.test.tsx +0 -29
- package/src/lib/components/link/link.tsx +0 -56
- package/src/lib/components/link/storybook/link.stories.mdx +0 -51
- package/src/lib/components/molecules/avatar/avatar-size-flags.tsx +0 -55
- package/src/lib/components/molecules/avatar/avatar.test.tsx +0 -114
- package/src/lib/components/molecules/avatar/avatar.tsx +0 -80
- package/src/lib/components/molecules/avatar/index.tsx +0 -1
- package/src/lib/components/molecules/avatar/stories/avatar.stories.mdx +0 -55
- package/src/lib/components/molecules/avatar/stories/components.tsx +0 -36
- package/src/lib/components/molecules/button/button-flags.tsx +0 -235
- package/src/lib/components/molecules/button/button.test.tsx +0 -77
- package/src/lib/components/molecules/button/button.tsx +0 -231
- package/src/lib/components/molecules/button/index.tsx +0 -1
- package/src/lib/components/molecules/button/stories/button.stories.mdx +0 -104
- package/src/lib/components/molecules/button/stories/components.tsx +0 -86
- package/src/lib/components/molecules/index.ts +0 -3
- package/src/lib/components/molecules/input-checkbox/index.tsx +0 -1
- package/src/lib/components/molecules/input-checkbox/input-checkbox.test.tsx +0 -34
- package/src/lib/components/molecules/input-checkbox/input-checkbox.tsx +0 -50
- package/src/lib/components/molecules/input-checkbox/stories/components.tsx +0 -36
- package/src/lib/components/molecules/input-checkbox/stories/index.tsx +0 -1
- package/src/lib/components/molecules/input-checkbox/stories/input-checkbox.stories.mdx +0 -51
- package/src/lib/components/organisms/index.ts +0 -1
- package/src/lib/components/organisms/multi-choice-list/index.tsx +0 -1
- package/src/lib/components/organisms/multi-choice-list/multi-choice-list.test.tsx +0 -33
- package/src/lib/components/organisms/multi-choice-list/multi-choice-list.tsx +0 -53
- package/src/lib/components/organisms/multi-choice-list/stories/components.tsx +0 -126
- package/src/lib/components/organisms/multi-choice-list/stories/index.tsx +0 -1
- package/src/lib/components/organisms/multi-choice-list/stories/multi-choice-list.stories.mdx +0 -99
- package/src/lib/components/spinner/index.tsx +0 -1
- package/src/lib/components/spinner/spinner-size-flags.tsx +0 -39
- package/src/lib/components/spinner/spinner.test.tsx +0 -31
- package/src/lib/components/spinner/spinner.tsx +0 -67
- package/src/lib/components/spinner/stories/components.tsx +0 -8
- package/src/lib/components/spinner/stories/spinner.stories.mdx +0 -42
- package/src/lib/components/thumbnail/index.tsx +0 -1
- package/src/lib/components/thumbnail/stories/thumbnail.stories.mdx +0 -34
- package/src/lib/components/thumbnail/thumbnail-size-flags.tsx +0 -41
- package/src/lib/components/thumbnail/thumbnail.test.tsx +0 -51
- package/src/lib/components/thumbnail/thumbnail.tsx +0 -40
- package/src/lib/components/typography/index.ts +0 -1
- package/src/lib/components/typography/storybook/components.tsx +0 -256
- package/src/lib/components/typography/storybook/typography.stories.mdx +0 -88
- package/src/lib/components/typography/typography.test.tsx +0 -93
- package/src/lib/components/typography/typography.tsx +0 -57
- package/src/lib/foundations/color-system/base-palette/base-palette.stories.tsx +0 -123
- package/src/lib/foundations/color-system/base-palette/base-palette.ts +0 -94
- package/src/lib/foundations/color-system/base-palette/index.ts +0 -1
- package/src/lib/foundations/color-system/color-guidelines/color-guidelines.stories.mdx +0 -85
- package/src/lib/foundations/color-system/color-guidelines/color-guidelines.stories.tsx +0 -231
- package/src/lib/foundations/color-system/color-guidelines/color-guidelines.ts +0 -159
- package/src/lib/foundations/color-system/color-guidelines/index.ts +0 -1
- package/src/lib/foundations/color-system/components/color-sample.tsx +0 -99
- package/src/lib/foundations/color-system/components/index.ts +0 -1
- package/src/lib/foundations/color-system/index.ts +0 -1
- package/src/lib/foundations/index.ts +0 -4
- package/src/lib/foundations/shadows/components.tsx +0 -59
- package/src/lib/foundations/shadows/index.ts +0 -1
- package/src/lib/foundations/shadows/shadows.stories.mdx +0 -71
- package/src/lib/foundations/shadows/shadows.tsx +0 -47
- package/src/lib/foundations/spacing/index.ts +0 -1
- package/src/lib/foundations/spacing/spacing-guidelines.ts +0 -24
- package/src/lib/foundations/spacing/spacing.stories.mdx +0 -51
- package/src/lib/foundations/spacing/spacing.ts +0 -18
- package/src/lib/foundations/typography/constants.ts +0 -25
- package/src/lib/foundations/typography/index.tsx +0 -1
- package/src/lib/foundations/typography/text-aspect-flags.ts +0 -54
- package/src/lib/foundations/typography/typography.tsx +0 -97
- package/src/lib/helpers/generic-types.ts +0 -44
- package/src/lib/helpers/index.ts +0 -6
- package/src/lib/helpers/nothing.tsx +0 -18
- package/src/lib/helpers/safe-navigation.ts +0 -34
- package/src/lib/helpers/slots.tsx +0 -76
- package/src/lib/helpers/strings.test.ts +0 -47
- package/src/lib/helpers/strings.ts +0 -16
- package/tsconfig.json +0 -35
- package/tsconfig.lib.json +0 -28
- package/tsconfig.spec.json +0 -21
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { clamp, concatHex, Hex, toHex } from '@helpers'
|
|
2
|
-
import { GRAY, RED, ORANGE, GREEN, BLUE, WHITE } from '../base-palette'
|
|
3
|
-
|
|
4
|
-
export const Background = {
|
|
5
|
-
Default: GRAY[100],
|
|
6
|
-
} as const
|
|
7
|
-
|
|
8
|
-
export const Surface = {
|
|
9
|
-
Default: {
|
|
10
|
-
Default: WHITE,
|
|
11
|
-
Subdued: GRAY[50],
|
|
12
|
-
Hover: GRAY[100],
|
|
13
|
-
Pressed: GRAY[200],
|
|
14
|
-
Depressed: GRAY[200],
|
|
15
|
-
Inverse: GRAY[800],
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
Selected: {
|
|
19
|
-
Default: BLUE[50],
|
|
20
|
-
Hover: BLUE[100],
|
|
21
|
-
Pressed: BLUE[200],
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
Critical: {
|
|
25
|
-
Default: RED[200],
|
|
26
|
-
Subdued: RED[50],
|
|
27
|
-
Hover: RED[50],
|
|
28
|
-
Pressed: RED[100],
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
Warning: {
|
|
32
|
-
Default: ORANGE[200],
|
|
33
|
-
Subdued: ORANGE[50],
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
Success: {
|
|
37
|
-
Default: GREEN[200],
|
|
38
|
-
Subdued: GREEN[50],
|
|
39
|
-
Depressed: GREEN[500],
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
Highlight: {
|
|
44
|
-
Default: BLUE[200],
|
|
45
|
-
Subdued: BLUE[50],
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
Neutral: {
|
|
49
|
-
Default: GRAY[200],
|
|
50
|
-
Subdued: GRAY[100],
|
|
51
|
-
Hover: GRAY[300],
|
|
52
|
-
Pressed: GRAY[400],
|
|
53
|
-
},
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export const Borders = {
|
|
57
|
-
Default: {
|
|
58
|
-
Default: GRAY[300],
|
|
59
|
-
Subdued: GRAY[200],
|
|
60
|
-
Light: WHITE,
|
|
61
|
-
Dark: GRAY[400],
|
|
62
|
-
},
|
|
63
|
-
Critical: {
|
|
64
|
-
Default: RED[600],
|
|
65
|
-
Subdued: RED[300],
|
|
66
|
-
},
|
|
67
|
-
Warning: {
|
|
68
|
-
Subdued: ORANGE[300],
|
|
69
|
-
},
|
|
70
|
-
Success: {
|
|
71
|
-
Subdued: GREEN[300],
|
|
72
|
-
},
|
|
73
|
-
Highlight: {
|
|
74
|
-
Default: BLUE[600],
|
|
75
|
-
Subdued: BLUE[300],
|
|
76
|
-
},
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export const Focused = {
|
|
80
|
-
Default: BLUE[400],
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export const Text = {
|
|
84
|
-
Default: GRAY[800],
|
|
85
|
-
Subdued: GRAY[500],
|
|
86
|
-
Light: GRAY[400],
|
|
87
|
-
Critical: RED[600],
|
|
88
|
-
Success: GREEN[600],
|
|
89
|
-
OnPrimary: WHITE,
|
|
90
|
-
OnCritical: WHITE,
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export const Icons = {
|
|
94
|
-
Default: GRAY[500],
|
|
95
|
-
Subdued: GRAY[400],
|
|
96
|
-
Hover: GRAY[800],
|
|
97
|
-
Pressed: GRAY[600],
|
|
98
|
-
Disabled: GRAY[300],
|
|
99
|
-
Critical: RED[600],
|
|
100
|
-
Warning: ORANGE[500],
|
|
101
|
-
Success: GREEN[600],
|
|
102
|
-
Highlight: BLUE[600],
|
|
103
|
-
OnPrimary: WHITE,
|
|
104
|
-
OnCritical: WHITE,
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export const Interactive = {
|
|
108
|
-
Default: {
|
|
109
|
-
Default: BLUE[600],
|
|
110
|
-
Hover: BLUE[800],
|
|
111
|
-
Pressed: BLUE[800],
|
|
112
|
-
Disabled: GRAY[400],
|
|
113
|
-
},
|
|
114
|
-
Subtle: {
|
|
115
|
-
Default: GRAY[800],
|
|
116
|
-
Hover: GRAY[800],
|
|
117
|
-
Pressed: GRAY[800],
|
|
118
|
-
Disabled: GRAY[400],
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function addOpacity(hex: Hex, opacity: number): Hex {
|
|
123
|
-
const opacityHex = toHex(clamp(0, Math.floor(0xFF * opacity), 0xFF), 2)
|
|
124
|
-
|
|
125
|
-
return concatHex(hex, opacityHex)
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/** in order for disabled to appear light gray on any background
|
|
129
|
-
* we have to give a darker gray some opacity */
|
|
130
|
-
const DisabledGray = addOpacity(GRAY[800], 0.06)
|
|
131
|
-
const PressedGray = addOpacity(GRAY[800], 0.12)
|
|
132
|
-
|
|
133
|
-
export const Actions = {
|
|
134
|
-
Primary: {
|
|
135
|
-
Default: BLUE[600],
|
|
136
|
-
Hover: BLUE[700],
|
|
137
|
-
Pressed: BLUE[800],
|
|
138
|
-
Disabled: DisabledGray,
|
|
139
|
-
},
|
|
140
|
-
Secondary: {
|
|
141
|
-
Default: WHITE,
|
|
142
|
-
Hover: DisabledGray,
|
|
143
|
-
Pressed: PressedGray,
|
|
144
|
-
Depressed: GRAY[500],
|
|
145
|
-
Disabled: DisabledGray,
|
|
146
|
-
},
|
|
147
|
-
Critical: {
|
|
148
|
-
Default: RED[600],
|
|
149
|
-
Hover: RED[500],
|
|
150
|
-
Pressed: RED[700],
|
|
151
|
-
Disabled: DisabledGray,
|
|
152
|
-
},
|
|
153
|
-
SecondaryCritical: {
|
|
154
|
-
Default: WHITE,
|
|
155
|
-
Hover: RED[500],
|
|
156
|
-
Pressed: RED[700],
|
|
157
|
-
Disabled: DisabledGray,
|
|
158
|
-
},
|
|
159
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './color-guidelines'
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components'
|
|
2
|
-
|
|
3
|
-
import { FC, Hex, isDefined } from '@helpers'
|
|
4
|
-
import { Flex, SpaceBetween } from '@components'
|
|
5
|
-
|
|
6
|
-
import { GRAY, WHITE } from '../base-palette'
|
|
7
|
-
import { Caption, Label1 } from 'components/typography'
|
|
8
|
-
import { Margin } from '../../spacing'
|
|
9
|
-
|
|
10
|
-
function isPale (color: string) {
|
|
11
|
-
return color === WHITE || color === GRAY[50] || color === GRAY[100]
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/** a ColorSample is a rectangular area with a uniform color */
|
|
15
|
-
const ColorSample = styled.div<{ color: string; border?: Hex }>`
|
|
16
|
-
${({ border, color }) =>
|
|
17
|
-
isDefined(border) ? '' : `background-color: ${color};` }
|
|
18
|
-
${({ border, color }) =>
|
|
19
|
-
isDefined(border) ? `border: 1px solid ${color};` : ''}
|
|
20
|
-
${({ border, color }) =>
|
|
21
|
-
!isDefined(border) && isPale(color) ? `border: 1px solid ${GRAY[200]};` : ''}
|
|
22
|
-
|
|
23
|
-
height: 40px;
|
|
24
|
-
border-radius: 4px;
|
|
25
|
-
`
|
|
26
|
-
|
|
27
|
-
const RectangularColorSample = styled(ColorSample)`
|
|
28
|
-
max-width: 122px;
|
|
29
|
-
margin-bottom: ${Margin.xxs};
|
|
30
|
-
`
|
|
31
|
-
|
|
32
|
-
const SquareColorSample = styled(ColorSample)`
|
|
33
|
-
width: 40px;
|
|
34
|
-
flex-shrink: 0;
|
|
35
|
-
margin-right: ${Margin.s};
|
|
36
|
-
border-radius: 6px;
|
|
37
|
-
|
|
38
|
-
${({ border, color }) =>
|
|
39
|
-
isDefined(border) ? `background-color: ${border};` : `background-color: ${color};` }
|
|
40
|
-
${({ border, color }) =>
|
|
41
|
-
isDefined(border) ? `border: 1px solid ${color};` : `border: 2px solid ${WHITE};`}
|
|
42
|
-
`
|
|
43
|
-
|
|
44
|
-
interface IColorRectangleProps {
|
|
45
|
-
name: string
|
|
46
|
-
hex: Hex
|
|
47
|
-
border?: Hex
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export const ColorRectangle: FC<IColorRectangleProps> = (props) => {
|
|
51
|
-
return (
|
|
52
|
-
<div>
|
|
53
|
-
<RectangularColorSample color={props.hex} border={props.border} />
|
|
54
|
-
<SpaceBetween>
|
|
55
|
-
<Caption>{props.name}</Caption>
|
|
56
|
-
<Caption subdued>{props.hex}</Caption>
|
|
57
|
-
</SpaceBetween>
|
|
58
|
-
</div>
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const ColorFrame = styled(Flex)`
|
|
63
|
-
margin-bottom: ${Margin.l};
|
|
64
|
-
margin-right: ${Margin.xxl};
|
|
65
|
-
`
|
|
66
|
-
|
|
67
|
-
const Details = styled(Flex)`
|
|
68
|
-
justify-content: center;
|
|
69
|
-
`
|
|
70
|
-
|
|
71
|
-
const ColorName = styled(Label1)`
|
|
72
|
-
white-space: nowrap;
|
|
73
|
-
margin-bottom: ${Margin.xxxs};
|
|
74
|
-
`
|
|
75
|
-
|
|
76
|
-
const ColorId = styled(Caption)`
|
|
77
|
-
white-space: nowrap;
|
|
78
|
-
`
|
|
79
|
-
|
|
80
|
-
interface IColorSquareProps {
|
|
81
|
-
name: string,
|
|
82
|
-
colorId: string
|
|
83
|
-
hex: Hex,
|
|
84
|
-
/** if true the color will only show in the border
|
|
85
|
-
* rather than as a fill color */
|
|
86
|
-
border?: Hex,
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export const ColorSquare: FC<IColorSquareProps> = (props) => {
|
|
90
|
-
return (
|
|
91
|
-
<ColorFrame>
|
|
92
|
-
<SquareColorSample color={props.hex} border={props.border} />
|
|
93
|
-
<Details column>
|
|
94
|
-
<ColorName emphasis>{props.name}</ColorName>
|
|
95
|
-
<ColorId subdued>{props.colorId}</ColorId>
|
|
96
|
-
</Details>
|
|
97
|
-
</ColorFrame>
|
|
98
|
-
)
|
|
99
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './color-sample'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './color-guidelines'
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components'
|
|
2
|
-
import { Surface } from '../color-system'
|
|
3
|
-
import { Padding } from '../spacing'
|
|
4
|
-
import {
|
|
5
|
-
shadowSm,
|
|
6
|
-
shadow,
|
|
7
|
-
shadowMd,
|
|
8
|
-
shadowLg,
|
|
9
|
-
shadowXl,
|
|
10
|
-
shadow2Xl,
|
|
11
|
-
shadowInner,
|
|
12
|
-
} from './shadows'
|
|
13
|
-
|
|
14
|
-
const Container = styled.div`
|
|
15
|
-
width: 128px;
|
|
16
|
-
height: 128px;
|
|
17
|
-
background: ${Surface.Default};
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: row;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
align-items: center;
|
|
22
|
-
padding: ${Padding.none};
|
|
23
|
-
`
|
|
24
|
-
|
|
25
|
-
const ShadowSm = styled(Container)`
|
|
26
|
-
${shadowSm}
|
|
27
|
-
`
|
|
28
|
-
const Shadow = styled(Container)`
|
|
29
|
-
${shadow}
|
|
30
|
-
`
|
|
31
|
-
|
|
32
|
-
const ShadowMd = styled(Container)`
|
|
33
|
-
${shadowMd}
|
|
34
|
-
`
|
|
35
|
-
const ShadowLg = styled(Container)`
|
|
36
|
-
${shadowLg}
|
|
37
|
-
`
|
|
38
|
-
|
|
39
|
-
const ShadowXl = styled(Container)`
|
|
40
|
-
${shadowXl}
|
|
41
|
-
`
|
|
42
|
-
|
|
43
|
-
const Shadow2Xl = styled(Container)`
|
|
44
|
-
${shadow2Xl}
|
|
45
|
-
`
|
|
46
|
-
|
|
47
|
-
const ShadowInner = styled(Container)`
|
|
48
|
-
${shadowInner}
|
|
49
|
-
`
|
|
50
|
-
|
|
51
|
-
export {
|
|
52
|
-
ShadowSm,
|
|
53
|
-
Shadow,
|
|
54
|
-
ShadowLg,
|
|
55
|
-
ShadowMd,
|
|
56
|
-
ShadowXl,
|
|
57
|
-
Shadow2Xl,
|
|
58
|
-
ShadowInner,
|
|
59
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './shadows'
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Canvas, Meta } from '@storybook/addon-docs';
|
|
2
|
-
import {
|
|
3
|
-
ShadowSm,
|
|
4
|
-
Shadow,
|
|
5
|
-
Shadow2Xl,
|
|
6
|
-
ShadowInner,
|
|
7
|
-
ShadowMd,
|
|
8
|
-
ShadowLg,
|
|
9
|
-
ShadowXl
|
|
10
|
-
} from './components'
|
|
11
|
-
|
|
12
|
-
<Meta title="Foundations/Shadows"/>
|
|
13
|
-
|
|
14
|
-
# Shadows
|
|
15
|
-
|
|
16
|
-
For more details, check out the guidelines on [Figma](https://www.figma.com/file/ue1CurHfZ426o2T2l8Dk64/UI-Library-(in-progress)?node-id=743%3A7913)
|
|
17
|
-
|
|
18
|
-
## How to use
|
|
19
|
-
|
|
20
|
-
```javascript
|
|
21
|
-
// Import the shadow that we'd like to use.
|
|
22
|
-
import {
|
|
23
|
-
shadowSm,
|
|
24
|
-
} from './shadows';
|
|
25
|
-
|
|
26
|
-
import styled from 'styled-components';
|
|
27
|
-
|
|
28
|
-
// Add them to the styled strucute that you'd like to add the shadow
|
|
29
|
-
const ShadowSm = styled.div`
|
|
30
|
-
${shadowSm}
|
|
31
|
-
`
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Examples
|
|
35
|
-
|
|
36
|
-
<Canvas>
|
|
37
|
-
<ShadowSm>
|
|
38
|
-
.shadow-sm
|
|
39
|
-
</ShadowSm>
|
|
40
|
-
<Shadow>
|
|
41
|
-
.shadow
|
|
42
|
-
</Shadow>
|
|
43
|
-
<ShadowMd>
|
|
44
|
-
.shadow-md
|
|
45
|
-
</ShadowMd>
|
|
46
|
-
<ShadowLg>
|
|
47
|
-
.shadow-lg
|
|
48
|
-
</ShadowLg>
|
|
49
|
-
<ShadowXl>
|
|
50
|
-
.shadow-xl
|
|
51
|
-
</ShadowXl>
|
|
52
|
-
<Shadow2Xl>
|
|
53
|
-
.shadow-2xl
|
|
54
|
-
</Shadow2Xl>
|
|
55
|
-
<ShadowInner>
|
|
56
|
-
.shadow-inner
|
|
57
|
-
</ShadowInner>
|
|
58
|
-
</Canvas>
|
|
59
|
-
|
|
60
|
-
## List of Values
|
|
61
|
-
|
|
62
|
-
| Name |
|
|
63
|
-
| ---- |
|
|
64
|
-
| `shadowSm` |
|
|
65
|
-
| `shadow` |
|
|
66
|
-
| `shadowMd` |
|
|
67
|
-
| `shadowLg` |
|
|
68
|
-
| `shadowXl` |
|
|
69
|
-
| `shadow2Xl` |
|
|
70
|
-
| `shadowInner` |
|
|
71
|
-
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { css } from 'styled-components'
|
|
2
|
-
|
|
3
|
-
const shadowSm = css`
|
|
4
|
-
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.05);
|
|
5
|
-
border-radius: 6px;
|
|
6
|
-
`
|
|
7
|
-
|
|
8
|
-
const shadow = css`
|
|
9
|
-
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1), 0px 1px 2px rgba(0, 0, 0, 0.06);
|
|
10
|
-
border-radius: 6px;
|
|
11
|
-
`
|
|
12
|
-
|
|
13
|
-
const shadowMd = css`
|
|
14
|
-
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
|
|
15
|
-
border-radius: 6px;
|
|
16
|
-
`
|
|
17
|
-
|
|
18
|
-
const shadowLg = css`
|
|
19
|
-
box-shadow: 0px 10px 15px -3px rgba(0, 0, 0, 0.1), 0px 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
20
|
-
border-radius: 6px;
|
|
21
|
-
`
|
|
22
|
-
|
|
23
|
-
const shadowXl = css`
|
|
24
|
-
box-shadow: 0px 20px 25px -5px rgba(0, 0, 0, 0.1), 0px 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
25
|
-
border-radius: 6px;
|
|
26
|
-
`
|
|
27
|
-
|
|
28
|
-
const shadow2Xl = css`
|
|
29
|
-
box-shadow: 0px 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
30
|
-
border-radius: 6px;
|
|
31
|
-
`
|
|
32
|
-
|
|
33
|
-
const shadowInner = css`
|
|
34
|
-
box-shadow: inset 0px 2px 4px rgba(0, 0, 0, 0.06);
|
|
35
|
-
border-radius: 6px;
|
|
36
|
-
`
|
|
37
|
-
|
|
38
|
-
export {
|
|
39
|
-
shadowSm,
|
|
40
|
-
shadow,
|
|
41
|
-
shadowMd,
|
|
42
|
-
shadowLg,
|
|
43
|
-
shadowXl,
|
|
44
|
-
shadow2Xl,
|
|
45
|
-
shadowInner,
|
|
46
|
-
}
|
|
47
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './spacing-guidelines'
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SPACING } from './spacing'
|
|
2
|
-
|
|
3
|
-
export const Padding = {
|
|
4
|
-
none: 0,
|
|
5
|
-
xxxs: SPACING.Size2,
|
|
6
|
-
xxs: SPACING.Size4,
|
|
7
|
-
xs: SPACING.Size8,
|
|
8
|
-
s: SPACING.Size12,
|
|
9
|
-
m: SPACING.Size16,
|
|
10
|
-
l: SPACING.Size24,
|
|
11
|
-
xl: SPACING.Size32,
|
|
12
|
-
} as const
|
|
13
|
-
|
|
14
|
-
export const Margin = {
|
|
15
|
-
none: 0,
|
|
16
|
-
xxxs: SPACING.Size2,
|
|
17
|
-
xxs: SPACING.Size4,
|
|
18
|
-
xs: SPACING.Size8,
|
|
19
|
-
s: SPACING.Size12,
|
|
20
|
-
m: SPACING.Size16,
|
|
21
|
-
l: SPACING.Size24,
|
|
22
|
-
xl: SPACING.Size32,
|
|
23
|
-
xxl: SPACING.Size64,
|
|
24
|
-
} as const
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Meta, Description } from '@storybook/addon-docs';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
<Meta title="Foundations/Spacing" />
|
|
5
|
-
|
|
6
|
-
# Spacing System
|
|
7
|
-
|
|
8
|
-
All spacing for components and typography is done in increments of 8 pixels.
|
|
9
|
-
This forms the basic unit of measurement for spacing.
|
|
10
|
-
|
|
11
|
-
For more details, check out the guidelines on [Figma](https://www.figma.com/file/ue1CurHfZ426o2T2l8Dk64/UI-Library-(in-progress)?node-id=388%3A364)
|
|
12
|
-
|
|
13
|
-
## How to use
|
|
14
|
-
|
|
15
|
-
```javascript
|
|
16
|
-
import SPACING from './spacing'
|
|
17
|
-
|
|
18
|
-
//get the token value
|
|
19
|
-
SPACING.[`YOUR-VALUE-HERE`]
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## When to use
|
|
23
|
-
|
|
24
|
-
You can set this values from this props:
|
|
25
|
-
|
|
26
|
-
- width
|
|
27
|
-
- heigth
|
|
28
|
-
- margin
|
|
29
|
-
- padding
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
## List of Values
|
|
33
|
-
|
|
34
|
-
| Name | Value |
|
|
35
|
-
| ---- | ----- |
|
|
36
|
-
| `Size2` | 2px|
|
|
37
|
-
| `Size4` | 4px|
|
|
38
|
-
| `Size8` | 8px|
|
|
39
|
-
| `Size12` | 12px|
|
|
40
|
-
| `Size16` | 16px|
|
|
41
|
-
| `Size24` | 24px|
|
|
42
|
-
| `Size32` | 32px|
|
|
43
|
-
| `Size64` | 64px|
|
|
44
|
-
| `Size96` | 96px|
|
|
45
|
-
| `Size128` | 128px|
|
|
46
|
-
| `Size192` | 192px|
|
|
47
|
-
| `Size256` | 256px|
|
|
48
|
-
| `Size384` | 384px|
|
|
49
|
-
| `Size512` | 512px|
|
|
50
|
-
| `Size640` | 640px|
|
|
51
|
-
| `Size768` | 768px|
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export enum SPACING {
|
|
2
|
-
Size2 = '2px',
|
|
3
|
-
Size4 = '4px',
|
|
4
|
-
Size8 = '8px',
|
|
5
|
-
Size12 = '12px',
|
|
6
|
-
Size16 = '16px',
|
|
7
|
-
Size24 = '24px',
|
|
8
|
-
Size32 = '32px',
|
|
9
|
-
Size64 = '64px',
|
|
10
|
-
Size96 = '96px',
|
|
11
|
-
Size128 = '128px',
|
|
12
|
-
Size192 = '192px',
|
|
13
|
-
Size256 = '256px',
|
|
14
|
-
Size384 = '384px',
|
|
15
|
-
Size512 = '512px',
|
|
16
|
-
Size640 = '640px',
|
|
17
|
-
Size768 = '768px',
|
|
18
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export const enum FontWeight {
|
|
3
|
-
Regular = '400',
|
|
4
|
-
Medium = '500',
|
|
5
|
-
SemiBold = '600',
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const FontSize = {
|
|
9
|
-
a: '13px',
|
|
10
|
-
b: '14px',
|
|
11
|
-
c: '16px',
|
|
12
|
-
d: '18px',
|
|
13
|
-
e: '20px',
|
|
14
|
-
f: '28px',
|
|
15
|
-
g: '36px',
|
|
16
|
-
} as const
|
|
17
|
-
|
|
18
|
-
export const LineHeight = {
|
|
19
|
-
a: '16px',
|
|
20
|
-
b: '20px',
|
|
21
|
-
c: '24px',
|
|
22
|
-
d: '28px',
|
|
23
|
-
e: '32px',
|
|
24
|
-
f: '44px',
|
|
25
|
-
} as const
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './typography'
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { bitwiseOr, MappedEnum, PropsWithChildren, RequireOnlyOne } from '@helpers'
|
|
2
|
-
import { Text } from '../color-system'
|
|
3
|
-
|
|
4
|
-
export const enum TextAspects {
|
|
5
|
-
default = 1,
|
|
6
|
-
subdued = 2,
|
|
7
|
-
light = 4,
|
|
8
|
-
critical = 8,
|
|
9
|
-
success = 16,
|
|
10
|
-
onPrimary = 32,
|
|
11
|
-
onCritical = 64,
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
type TextOptions<T> = MappedEnum<typeof TextAspects, T>
|
|
15
|
-
|
|
16
|
-
function toTextAspect(n: number): TextAspects {
|
|
17
|
-
switch (n) {
|
|
18
|
-
case TextAspects.subdued: return TextAspects.subdued
|
|
19
|
-
case TextAspects.light: return TextAspects.light
|
|
20
|
-
case TextAspects.critical: return TextAspects.critical
|
|
21
|
-
case TextAspects.success: return TextAspects.success
|
|
22
|
-
case TextAspects.onPrimary: return TextAspects.onPrimary
|
|
23
|
-
case TextAspects.onCritical: return TextAspects.onCritical
|
|
24
|
-
default: return TextAspects.default
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const TextAspectColors = {
|
|
29
|
-
[TextAspects.default]: Text.Default,
|
|
30
|
-
[TextAspects.subdued]: Text.Subdued,
|
|
31
|
-
[TextAspects.light]: Text.Light,
|
|
32
|
-
[TextAspects.onPrimary]: Text.OnPrimary,
|
|
33
|
-
[TextAspects.onCritical]: Text.OnPrimary,
|
|
34
|
-
[TextAspects.success]: Text.Success,
|
|
35
|
-
[TextAspects.critical]: Text.Critical,
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export type ITextAspectProps = Partial<RequireOnlyOne<TextOptions<boolean>>> & PropsWithChildren
|
|
39
|
-
|
|
40
|
-
export function getTextAspect(props: ITextAspectProps) {
|
|
41
|
-
return TextAspectColors[
|
|
42
|
-
toTextAspect(
|
|
43
|
-
bitwiseOr([
|
|
44
|
-
props.default,
|
|
45
|
-
props.subdued,
|
|
46
|
-
props.light,
|
|
47
|
-
props.critical,
|
|
48
|
-
props.success,
|
|
49
|
-
props.onPrimary,
|
|
50
|
-
props.onCritical,
|
|
51
|
-
])
|
|
52
|
-
)
|
|
53
|
-
]
|
|
54
|
-
}
|