@edvisor/product-language 0.3.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.
Files changed (278) hide show
  1. package/index.d.ts +2 -0
  2. package/index.js +7914 -0
  3. package/lib/components/alert-banner/alert-banner.d.ts +11 -0
  4. package/lib/components/alert-banner/alert-level-flags.d.ts +13 -0
  5. package/lib/components/alert-banner/index.d.ts +1 -0
  6. package/lib/components/badge/badge-type-flags.d.ts +18 -0
  7. package/lib/components/badge/badge.d.ts +5 -0
  8. package/lib/components/badge/index.d.ts +1 -0
  9. package/{src/lib/components/card/atoms/card-frame.tsx → lib/components/card/atoms/card-frame.d.ts} +7 -17
  10. package/lib/components/card/atoms/index.d.ts +1 -0
  11. package/lib/components/card/card.d.ts +14 -0
  12. package/lib/components/card/components/card-alert-banner-slot.d.ts +5 -0
  13. package/lib/components/card/components/card-controls-slot.d.ts +4 -0
  14. package/lib/components/card/components/card-section-slot.d.ts +11 -0
  15. package/lib/components/card/components/index.d.ts +3 -0
  16. package/lib/components/card/index.d.ts +2 -0
  17. package/lib/components/card/molecules/index.d.ts +1 -0
  18. package/lib/components/card/molecules/left-right-card.d.ts +16 -0
  19. package/lib/components/checkbox/checkbox.d.ts +10 -0
  20. package/lib/components/checkbox/helpers.d.ts +12 -0
  21. package/lib/components/checkbox/index.d.ts +1 -0
  22. package/lib/components/divider/divider-type-flags.d.ts +9 -0
  23. package/lib/components/divider/divider.d.ts +7 -0
  24. package/lib/components/divider/index.d.ts +1 -0
  25. package/lib/components/flag/flag-size-flags.d.ts +12 -0
  26. package/lib/components/flag/flag.d.ts +9 -0
  27. package/lib/components/flag/flag.list.d.ts +781 -0
  28. package/lib/components/flag/index.d.ts +1 -0
  29. package/lib/components/icon/icon-list.d.ts +131 -0
  30. package/lib/components/icon/icon.d.ts +131 -0
  31. package/lib/components/icon/index.d.ts +1 -0
  32. package/lib/components/index.d.ts +17 -0
  33. package/lib/components/input-field/components/index.d.ts +2 -0
  34. package/lib/components/input-field/components/labeled-input.d.ts +10 -0
  35. package/lib/components/input-field/components/stepper.d.ts +7 -0
  36. package/lib/components/input-field/index.d.ts +3 -0
  37. package/lib/components/input-field/input-field.d.ts +25 -0
  38. package/lib/components/input-field/input-number.d.ts +18 -0
  39. package/lib/components/input-field/input-text.d.ts +14 -0
  40. package/lib/components/layout/flex.d.ts +16 -0
  41. package/lib/components/layout/grid-layout.d.ts +11 -0
  42. package/lib/components/layout/index.d.ts +3 -0
  43. package/lib/components/layout/left-right-layout.d.ts +34 -0
  44. package/lib/components/link/index.d.ts +1 -0
  45. package/lib/components/link/link.d.ts +14 -0
  46. package/lib/components/molecules/avatar/avatar-size-flags.d.ts +12 -0
  47. package/lib/components/molecules/avatar/avatar.d.ts +12 -0
  48. package/lib/components/molecules/avatar/index.d.ts +1 -0
  49. package/lib/components/molecules/button/button-flags.d.ts +44 -0
  50. package/lib/components/molecules/button/button.d.ts +12 -0
  51. package/lib/components/molecules/button/index.d.ts +1 -0
  52. package/lib/components/molecules/index.d.ts +3 -0
  53. package/lib/components/molecules/input-checkbox/index.d.ts +1 -0
  54. package/lib/components/molecules/input-checkbox/input-checkbox.d.ts +8 -0
  55. package/lib/components/organisms/index.d.ts +1 -0
  56. package/lib/components/organisms/multi-choice-list/index.d.ts +1 -0
  57. package/lib/components/organisms/multi-choice-list/multi-choice-list.d.ts +10 -0
  58. package/lib/components/spinner/index.d.ts +1 -0
  59. package/lib/components/spinner/spinner-size-flags.d.ts +10 -0
  60. package/lib/components/spinner/spinner.d.ts +9 -0
  61. package/lib/components/tabs/components/index.d.ts +1 -0
  62. package/lib/components/tabs/components/tab.d.ts +7 -0
  63. package/lib/components/tabs/index.d.ts +1 -0
  64. package/lib/components/tabs/tabs.d.ts +15 -0
  65. package/lib/components/tag/components/close-button.d.ts +8 -0
  66. package/lib/components/tag/components/index.d.ts +2 -0
  67. package/lib/components/tag/components/tag-label.d.ts +8 -0
  68. package/lib/components/tag/index.d.ts +1 -0
  69. package/lib/components/tag/tag.d.ts +10 -0
  70. package/lib/components/thumbnail/index.d.ts +1 -0
  71. package/lib/components/thumbnail/thumbnail-size-flags.d.ts +10 -0
  72. package/lib/components/thumbnail/thumbnail.d.ts +10 -0
  73. package/lib/components/typography/index.d.ts +1 -0
  74. package/lib/components/typography/typography.d.ts +24 -0
  75. package/lib/foundations/color-system/base-palette/base-palette.d.ts +76 -0
  76. package/lib/foundations/color-system/base-palette/index.d.ts +1 -0
  77. package/lib/foundations/color-system/color-guidelines/color-guidelines.d.ts +132 -0
  78. package/lib/foundations/color-system/color-guidelines/index.d.ts +1 -0
  79. package/lib/foundations/color-system/components/color-sample.d.ts +17 -0
  80. package/lib/foundations/color-system/components/index.d.ts +1 -0
  81. package/lib/foundations/color-system/index.d.ts +1 -0
  82. package/lib/foundations/index.d.ts +4 -0
  83. package/lib/foundations/shadows/components.d.ts +8 -0
  84. package/lib/foundations/shadows/index.d.ts +1 -0
  85. package/lib/foundations/shadows/shadows.d.ts +8 -0
  86. package/lib/foundations/spacing/index.d.ts +1 -0
  87. package/lib/foundations/spacing/spacing-guidelines.d.ts +22 -0
  88. package/lib/foundations/spacing/spacing.d.ts +18 -0
  89. package/lib/foundations/typography/constants.d.ts +22 -0
  90. package/lib/foundations/typography/fonts.d.ts +1 -0
  91. package/lib/foundations/typography/index.d.ts +1 -0
  92. package/lib/foundations/typography/text-aspect-flags.d.ts +19 -0
  93. package/lib/foundations/typography/typography.d.ts +24 -0
  94. package/lib/helpers/generic-types.d.ts +21 -0
  95. package/lib/helpers/index.d.ts +6 -0
  96. package/lib/helpers/nothing.d.ts +8 -0
  97. package/{src/lib/helpers/numbers.ts → lib/helpers/numbers.d.ts} +50 -67
  98. package/lib/helpers/safe-navigation.d.ts +15 -0
  99. package/lib/helpers/slots.d.ts +23 -0
  100. package/lib/helpers/strings.d.ts +1 -0
  101. package/package.json +11 -3
  102. package/.babelrc +0 -12
  103. package/.eslintrc.json +0 -147
  104. package/.storybook/main.js +0 -57
  105. package/.storybook/manager.js +0 -7
  106. package/.storybook/preview.js +0 -15
  107. package/.storybook/tsconfig.json +0 -30
  108. package/jest.config.ts +0 -15
  109. package/jest.setup.ts +0 -2
  110. package/project.json +0 -96
  111. package/release-it.json +0 -18
  112. package/src/README.md +0 -61
  113. package/src/assets/svg/example_icon.svg +0 -3
  114. package/src/assets/svg/example_icon_white.svg +0 -3
  115. package/src/assets/svg/spinner.svg +0 -3
  116. package/src/assets/svg/spinner_white.svg +0 -3
  117. package/src/helpers/index.ts +0 -4
  118. package/src/helpers/playground.ts +0 -16
  119. package/src/helpers/talesOf.tsx +0 -42
  120. package/src/index.ts +0 -2
  121. package/src/lib/components/README.md +0 -49
  122. package/src/lib/components/alert-banner/alert-banner.tsx +0 -34
  123. package/src/lib/components/alert-banner/alert-level-flags.ts +0 -77
  124. package/src/lib/components/alert-banner/index.ts +0 -1
  125. package/src/lib/components/badge/badge-type-flags.ts +0 -72
  126. package/src/lib/components/badge/badge.test.tsx +0 -29
  127. package/src/lib/components/badge/badge.tsx +0 -22
  128. package/src/lib/components/badge/index.ts +0 -1
  129. package/src/lib/components/badge/stories/badge.stories.mdx +0 -44
  130. package/src/lib/components/badge/stories/components.tsx +0 -49
  131. package/src/lib/components/card/atoms/index.ts +0 -1
  132. package/src/lib/components/card/card.test.tsx +0 -162
  133. package/src/lib/components/card/card.tsx +0 -78
  134. package/src/lib/components/card/components/card-alert-banner-slot.tsx +0 -16
  135. package/src/lib/components/card/components/card-controls-slot.tsx +0 -19
  136. package/src/lib/components/card/components/card-section-slot.tsx +0 -51
  137. package/src/lib/components/card/components/index.ts +0 -3
  138. package/src/lib/components/card/index.ts +0 -2
  139. package/src/lib/components/card/molecules/index.ts +0 -1
  140. package/src/lib/components/card/molecules/left-right-card.test.tsx +0 -89
  141. package/src/lib/components/card/molecules/left-right-card.tsx +0 -63
  142. package/src/lib/components/card/storybook/card.stories.mdx +0 -100
  143. package/src/lib/components/card/storybook/components.tsx +0 -223
  144. package/src/lib/components/checkbox/checkbox.test.tsx +0 -39
  145. package/src/lib/components/checkbox/checkbox.tsx +0 -63
  146. package/src/lib/components/checkbox/helpers.tsx +0 -100
  147. package/src/lib/components/checkbox/index.tsx +0 -1
  148. package/src/lib/components/checkbox/stories/checkbox.stories.mdx +0 -57
  149. package/src/lib/components/checkbox/stories/components.tsx +0 -84
  150. package/src/lib/components/divider/divider-type-flags.tsx +0 -37
  151. package/src/lib/components/divider/divider.test.tsx +0 -34
  152. package/src/lib/components/divider/divider.tsx +0 -37
  153. package/src/lib/components/divider/index.tsx +0 -1
  154. package/src/lib/components/divider/stories/components.tsx +0 -13
  155. package/src/lib/components/divider/stories/divider.stories.mdx +0 -44
  156. package/src/lib/components/flag/flag-size-flags.tsx +0 -55
  157. package/src/lib/components/flag/flag.list.tsx +0 -788
  158. package/src/lib/components/flag/flag.test.tsx +0 -65
  159. package/src/lib/components/flag/flag.tsx +0 -97
  160. package/src/lib/components/flag/index.tsx +0 -1
  161. package/src/lib/components/flag/stories/components.tsx +0 -403
  162. package/src/lib/components/flag/stories/flag.stories.mdx +0 -48
  163. package/src/lib/components/flag/stories/playGround-select.tsx +0 -145
  164. package/src/lib/components/icon/icon-list.tsx +0 -135
  165. package/src/lib/components/icon/icon.test.tsx +0 -48
  166. package/src/lib/components/icon/icon.tsx +0 -181
  167. package/src/lib/components/icon/index.tsx +0 -1
  168. package/src/lib/components/icon/stories/components.tsx +0 -282
  169. package/src/lib/components/icon/stories/icon.stories.mdx +0 -65
  170. package/src/lib/components/index.ts +0 -19
  171. package/src/lib/components/input-field/components/index.ts +0 -2
  172. package/src/lib/components/input-field/components/labeled-input.tsx +0 -54
  173. package/src/lib/components/input-field/components/stepper.tsx +0 -60
  174. package/src/lib/components/input-field/index.ts +0 -6
  175. package/src/lib/components/input-field/input-field.test.tsx +0 -107
  176. package/src/lib/components/input-field/input-field.tsx +0 -126
  177. package/src/lib/components/input-field/input-number.tsx +0 -41
  178. package/src/lib/components/input-field/input-text.tsx +0 -30
  179. package/src/lib/components/input-field/storybook/components.tsx +0 -327
  180. package/src/lib/components/input-field/storybook/input-field.stories.mdx +0 -113
  181. package/src/lib/components/layout/flex.tsx +0 -22
  182. package/src/lib/components/layout/grid-layout.tsx +0 -40
  183. package/src/lib/components/layout/index.ts +0 -3
  184. package/src/lib/components/layout/left-right-layout.tsx +0 -67
  185. package/src/lib/components/link/index.ts +0 -1
  186. package/src/lib/components/link/link.test.tsx +0 -29
  187. package/src/lib/components/link/link.tsx +0 -56
  188. package/src/lib/components/link/storybook/link.stories.mdx +0 -52
  189. package/src/lib/components/molecules/avatar/avatar-size-flags.tsx +0 -55
  190. package/src/lib/components/molecules/avatar/avatar.test.tsx +0 -114
  191. package/src/lib/components/molecules/avatar/avatar.tsx +0 -80
  192. package/src/lib/components/molecules/avatar/index.tsx +0 -1
  193. package/src/lib/components/molecules/avatar/stories/avatar.stories.mdx +0 -52
  194. package/src/lib/components/molecules/avatar/stories/components.tsx +0 -36
  195. package/src/lib/components/molecules/button/button-flags.tsx +0 -340
  196. package/src/lib/components/molecules/button/button.test.tsx +0 -77
  197. package/src/lib/components/molecules/button/button.tsx +0 -214
  198. package/src/lib/components/molecules/button/index.tsx +0 -1
  199. package/src/lib/components/molecules/button/stories/button.stories.mdx +0 -105
  200. package/src/lib/components/molecules/button/stories/components.tsx +0 -84
  201. package/src/lib/components/molecules/index.ts +0 -3
  202. package/src/lib/components/molecules/input-checkbox/index.tsx +0 -1
  203. package/src/lib/components/molecules/input-checkbox/input-checkbox.test.tsx +0 -34
  204. package/src/lib/components/molecules/input-checkbox/input-checkbox.tsx +0 -49
  205. package/src/lib/components/molecules/input-checkbox/stories/components.tsx +0 -53
  206. package/src/lib/components/molecules/input-checkbox/stories/input-checkbox.stories.mdx +0 -49
  207. package/src/lib/components/organisms/index.ts +0 -1
  208. package/src/lib/components/organisms/multi-choice-list/index.tsx +0 -1
  209. package/src/lib/components/organisms/multi-choice-list/multi-choice-list.test.tsx +0 -33
  210. package/src/lib/components/organisms/multi-choice-list/multi-choice-list.tsx +0 -52
  211. package/src/lib/components/organisms/multi-choice-list/stories/components.tsx +0 -124
  212. package/src/lib/components/organisms/multi-choice-list/stories/multi-choice-list.stories.mdx +0 -99
  213. package/src/lib/components/spinner/index.tsx +0 -1
  214. package/src/lib/components/spinner/spinner-size-flags.tsx +0 -39
  215. package/src/lib/components/spinner/spinner.test.tsx +0 -31
  216. package/src/lib/components/spinner/spinner.tsx +0 -54
  217. package/src/lib/components/spinner/stories/components.tsx +0 -39
  218. package/src/lib/components/spinner/stories/spinner.stories.mdx +0 -35
  219. package/src/lib/components/tabs/components/index.ts +0 -1
  220. package/src/lib/components/tabs/components/tab.tsx +0 -62
  221. package/src/lib/components/tabs/index.tsx +0 -1
  222. package/src/lib/components/tabs/storybook/components.tsx +0 -282
  223. package/src/lib/components/tabs/storybook/tabs.stories.mdx +0 -97
  224. package/src/lib/components/tabs/tabs.test.tsx +0 -86
  225. package/src/lib/components/tabs/tabs.tsx +0 -101
  226. package/src/lib/components/tag/components/close-button.tsx +0 -85
  227. package/src/lib/components/tag/components/index.ts +0 -2
  228. package/src/lib/components/tag/components/tag-label.tsx +0 -44
  229. package/src/lib/components/tag/index.tsx +0 -1
  230. package/src/lib/components/tag/stories/components.tsx +0 -86
  231. package/src/lib/components/tag/stories/tag.stories.mdx +0 -42
  232. package/src/lib/components/tag/tag.test.tsx +0 -36
  233. package/src/lib/components/tag/tag.tsx +0 -33
  234. package/src/lib/components/thumbnail/index.tsx +0 -1
  235. package/src/lib/components/thumbnail/stories/thumbnail.stories.mdx +0 -34
  236. package/src/lib/components/thumbnail/thumbnail-size-flags.tsx +0 -41
  237. package/src/lib/components/thumbnail/thumbnail.test.tsx +0 -51
  238. package/src/lib/components/thumbnail/thumbnail.tsx +0 -45
  239. package/src/lib/components/typography/index.ts +0 -1
  240. package/src/lib/components/typography/storybook/components.tsx +0 -288
  241. package/src/lib/components/typography/storybook/typography.stories.mdx +0 -90
  242. package/src/lib/components/typography/typography.test.tsx +0 -97
  243. package/src/lib/components/typography/typography.tsx +0 -99
  244. package/src/lib/foundations/color-system/base-palette/base-palette.stories.tsx +0 -123
  245. package/src/lib/foundations/color-system/base-palette/base-palette.ts +0 -93
  246. package/src/lib/foundations/color-system/base-palette/index.ts +0 -1
  247. package/src/lib/foundations/color-system/color-guidelines/color-guidelines.stories.mdx +0 -85
  248. package/src/lib/foundations/color-system/color-guidelines/color-guidelines.stories.tsx +0 -231
  249. package/src/lib/foundations/color-system/color-guidelines/color-guidelines.ts +0 -160
  250. package/src/lib/foundations/color-system/color-guidelines/index.ts +0 -1
  251. package/src/lib/foundations/color-system/components/color-sample.tsx +0 -99
  252. package/src/lib/foundations/color-system/components/index.ts +0 -1
  253. package/src/lib/foundations/color-system/index.ts +0 -1
  254. package/src/lib/foundations/index.ts +0 -4
  255. package/src/lib/foundations/shadows/components.tsx +0 -59
  256. package/src/lib/foundations/shadows/index.ts +0 -1
  257. package/src/lib/foundations/shadows/shadows.stories.mdx +0 -71
  258. package/src/lib/foundations/shadows/shadows.tsx +0 -47
  259. package/src/lib/foundations/spacing/index.ts +0 -1
  260. package/src/lib/foundations/spacing/spacing-guidelines.ts +0 -24
  261. package/src/lib/foundations/spacing/spacing.stories.mdx +0 -51
  262. package/src/lib/foundations/spacing/spacing.ts +0 -18
  263. package/src/lib/foundations/typography/constants.ts +0 -25
  264. package/src/lib/foundations/typography/fonts.ts +0 -205
  265. package/src/lib/foundations/typography/index.tsx +0 -1
  266. package/src/lib/foundations/typography/text-aspect-flags.ts +0 -61
  267. package/src/lib/foundations/typography/typography.tsx +0 -102
  268. package/src/lib/helpers/generic-types.ts +0 -44
  269. package/src/lib/helpers/index.ts +0 -6
  270. package/src/lib/helpers/nothing.tsx +0 -18
  271. package/src/lib/helpers/safe-navigation.ts +0 -44
  272. package/src/lib/helpers/slots.test.tsx +0 -98
  273. package/src/lib/helpers/slots.tsx +0 -157
  274. package/src/lib/helpers/strings.test.ts +0 -47
  275. package/src/lib/helpers/strings.ts +0 -16
  276. package/tsconfig.json +0 -35
  277. package/tsconfig.lib.json +0 -28
  278. package/tsconfig.spec.json +0 -21
@@ -1,231 +0,0 @@
1
- import styled from 'styled-components'
2
- import { Flex, Heading2 } from '@components'
3
- import { FC, Hex, isDefined, Nothing, isEmpty, isNil } from '@helpers'
4
- import { StoryComponent, talesOf } from '@stories'
5
- import { Margin } from 'foundations/spacing/spacing-guidelines'
6
-
7
- import { BLACK, BLUE, BRAND, ColorPalette, GRAY, GREEN, ORANGE, RED, SHADES, WHITE } from '../base-palette'
8
- import { ColorSquare } from '../components'
9
- import { Background, Surface, Borders, Focused, Text, Icons, Interactive, Actions } from './color-guidelines'
10
-
11
- export const BackgroundStory: FC = () => {
12
- return (
13
- <SemanticCategory
14
- name={'Background'}
15
- subCategories={[
16
- { name: '', palette: Background },
17
- ]}
18
- />
19
- )
20
- }
21
-
22
- export const SurfaceStory: FC = () => {
23
- return (
24
- <SemanticCategory
25
- name={'Surface'}
26
- subCategories={[
27
- { name: '', palette: Surface.Default },
28
- { name: 'Selected', palette: Surface.Selected },
29
- { name: 'Critical', palette: Surface.Critical },
30
- { name: 'Warning', palette: Surface.Warning },
31
- { name: 'Success', palette: Surface.Success },
32
- { name: 'Highlight', palette: Surface.Highlight },
33
- { name: 'Neutral', palette: Surface.Neutral },
34
- ]}
35
- />
36
- )
37
- }
38
-
39
- export const BordersStory: FC = () => {
40
- return (
41
- <SemanticCategory
42
- name={'Borders'}
43
- subCategories={[
44
- { name: '', border: Surface.Default.Default, palette: Borders.Default },
45
- { name: 'Critical', border: Surface.Critical.Subdued, palette: Borders.Critical },
46
- { name: 'Warning', border: Surface.Warning.Subdued, palette: Borders.Warning },
47
- { name: 'Success', border: Surface.Success.Subdued, palette: Borders.Success },
48
- { name: 'Highlight', border: Surface.Highlight.Subdued, palette: Borders.Highlight },
49
- ]}
50
- />
51
- )
52
- }
53
-
54
- const FocusedStory: FC = () => {
55
- return (
56
- <SemanticCategory
57
- name={'Focused'}
58
- subCategories={[
59
- { name: '', palette: Focused, border: Background.Default },
60
- ]}
61
- />
62
- )
63
- }
64
-
65
- const TextStory: FC = () => {
66
- const { Default, Subdued, Light, Critical, Success, OnPrimary, OnCritical } =
67
- Text
68
-
69
- return (
70
- <SemanticCategory
71
- name={'Text'}
72
- subCategories={[
73
- { name: '', palette: { Default, Subdued, Light } },
74
- { name: '', palette: { Critical, Success } },
75
- { name: '', palette: { OnPrimary, OnCritical } },
76
- ]}
77
- />
78
- )
79
- }
80
-
81
- const IconsStory: FC = () => {
82
- const { Default, Subdued, Hover, Pressed, Disabled, Critical, Success, Warning, Highlight, OnPrimary, OnCritical } =
83
- Icons
84
-
85
- return (
86
- <SemanticCategory
87
- name={'Icons'}
88
- subCategories={[
89
- { name: '', palette: { Default, Subdued, Hover, Pressed, Disabled } },
90
- { name: '', palette: { Critical, Warning, Success, Highlight } },
91
- { name: '', palette: { OnPrimary, OnCritical } },
92
- ]}
93
- />
94
- )
95
- }
96
-
97
- const InteractionsStory: FC = () => {
98
- return (
99
- <SemanticCategory
100
- name={'Interactions'}
101
- subCategories={[
102
- { name: '', palette: Interactive.Default },
103
- { name: 'Subtle', palette: Interactive.Subtle },
104
- ]}
105
- />
106
- )
107
- }
108
-
109
- const ActionsStory: FC = () => {
110
- return (
111
- <SemanticCategory
112
- name={'Actions'}
113
- subCategories={[
114
- { name: 'Primary', palette: Actions.Primary },
115
- { name: 'Secondary', palette: Actions.Secondary },
116
- { name: 'Critical', palette: Actions.Critical },
117
- { name: 'Secondary Critical', palette: Actions.SecondaryCritical },
118
- ]}
119
- />
120
- )
121
- }
122
-
123
- const Story: StoryComponent = () => {
124
- return (
125
- <>
126
- <BackgroundStory />
127
- <SurfaceStory />
128
- <BordersStory />
129
- <FocusedStory />
130
- <TextStory />
131
- <IconsStory />
132
- <InteractionsStory />
133
- <ActionsStory />
134
- </>
135
- )
136
- }
137
-
138
- const SemanticCategoryHeading = styled(Heading2)`
139
- margin-bottom: ${Margin.xl};
140
- `
141
-
142
- const COLOR_SYSTEM = { GRAY, BLUE, GREEN, ORANGE, RED, SHADES, BRAND } as const
143
-
144
- function getColorId (color: Hex) {
145
- if (color === WHITE) {
146
- return 'white'
147
- }
148
-
149
- if (color === BLACK) {
150
- return 'black'
151
- }
152
-
153
- const colorHex = color.slice(0, 7)
154
- const fadeHex = color.slice(7, 9)
155
-
156
- const colorId = Object.keys(COLOR_SYSTEM).reduce((acc, COLOR_NAME) => {
157
- const COLOR = COLOR_SYSTEM[COLOR_NAME as keyof typeof COLOR_SYSTEM]
158
- const id = Object.keys(COLOR).find((_id) => COLOR[_id as keyof typeof COLOR] === colorHex)
159
-
160
- if (isDefined(id)) {
161
- return `${COLOR_NAME.toLowerCase()}-${id}`
162
- }
163
-
164
- return acc
165
- }, undefined as string | undefined)
166
-
167
- if (isNil(colorId)) {
168
- return color
169
- }
170
-
171
- if (isEmpty(fadeHex)) {
172
- return colorId
173
- }
174
-
175
- return `${colorId} - ${toPercentage(fadeHex)}`
176
- }
177
-
178
- // convert a hex string like 1E to a percentage
179
- // by dividing out of 255
180
- function toPercentage (hex: string) {
181
- const dec = parseInt(hex, 16)
182
-
183
- return dec === 0 ? '' : `${Math.round((dec / 255) * 100)}%`
184
- }
185
-
186
- interface ISemanticCategoryProps {
187
- name: string
188
- subCategories: {
189
- name: string,
190
- palette: ColorPalette,
191
- border?: Hex,
192
- }[]
193
- }
194
-
195
- /** a semantic group is a kind of categorization based on meaning */
196
- const SemanticCategory: FC<ISemanticCategoryProps> = (props) => {
197
- return (
198
- <>
199
- <SemanticCategoryHeading>{props.name}</SemanticCategoryHeading>
200
- <Flex>
201
- {props.subCategories.map((subCategory, index) => {
202
-
203
- return (
204
- <div key={index}>
205
- {Object.keys(subCategory.palette).map((name) => {
206
- if (name === 'border') {
207
- return <Nothing />
208
- }
209
-
210
- const hex = subCategory.palette[name]
211
- const colorId = getColorId(hex)
212
-
213
- return (
214
- <ColorSquare
215
- key={`${subCategory.name} ${name}`}
216
- colorId={colorId}
217
- name={`${subCategory.name} ${name}`}
218
- hex={hex}
219
- border={subCategory.border}
220
- />
221
- )
222
- })}
223
- </div>
224
- )
225
- })}
226
- </Flex>
227
- </>
228
- )
229
- }
230
-
231
- talesOf(__filename, module, Story)
@@ -1,160 +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
- Depressed: BLUE[900],
139
- Disabled: DisabledGray,
140
- },
141
- Secondary: {
142
- Default: WHITE,
143
- Hover: DisabledGray,
144
- Pressed: PressedGray,
145
- Depressed: GRAY[500],
146
- Disabled: DisabledGray,
147
- },
148
- Critical: {
149
- Default: RED[600],
150
- Hover: RED[700],
151
- Pressed: RED[800],
152
- Disabled: DisabledGray,
153
- },
154
- SecondaryCritical: {
155
- Default: WHITE,
156
- Hover: RED[700],
157
- Pressed: RED[800],
158
- Disabled: DisabledGray,
159
- },
160
- }
@@ -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, Label } 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(Label)`
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 strong>{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,4 +0,0 @@
1
- export * from './color-system'
2
- export * from './typography'
3
- export * from './spacing'
4
- export * from './shadows'
@@ -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