@livechat/design-system-react-components 1.0.0-alpha.4 → 1.0.0-alpha.5

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 (233) hide show
  1. package/dist/dsrc.cjs.js +1 -0
  2. package/dist/dsrc.es.js +2213 -0
  3. package/dist/dsrc.umd.js +1 -0
  4. package/dist/src/components/Alert/Alert.d.ts +19 -0
  5. package/{src/components/Alert/index.ts → dist/src/components/Alert/index.d.ts} +0 -0
  6. package/dist/src/components/Badge/Badge.d.ts +5 -0
  7. package/{src/components/Badge/index.ts → dist/src/components/Badge/index.d.ts} +0 -0
  8. package/dist/src/components/Button/Button.d.ts +13 -0
  9. package/{src/components/Button/index.ts → dist/src/components/Button/index.d.ts} +0 -0
  10. package/dist/src/components/ButtonGroup/ButtonGroup.d.ts +11 -0
  11. package/{src/components/ButtonGroup/index.ts → dist/src/components/ButtonGroup/index.d.ts} +0 -0
  12. package/dist/src/components/Card/Card.d.ts +6 -0
  13. package/{src/components/Card/index.ts → dist/src/components/Card/index.d.ts} +0 -0
  14. package/dist/src/components/Checkbox/Checkbox.d.ts +7 -0
  15. package/dist/src/components/Checkbox/CheckboxField.d.ts +7 -0
  16. package/{src/components/Checkbox/index.ts → dist/src/components/Checkbox/index.d.ts} +0 -0
  17. package/dist/src/components/FieldDescription/FieldDescription.d.ts +3 -0
  18. package/{src/components/FieldDescription/index.ts → dist/src/components/FieldDescription/index.d.ts} +0 -0
  19. package/dist/src/components/FieldError/FieldError.d.ts +3 -0
  20. package/{src/components/FieldError/index.ts → dist/src/components/FieldError/index.d.ts} +0 -0
  21. package/dist/src/components/FieldGroup/FieldGroup.d.ts +8 -0
  22. package/{src/components/FieldGroup/index.ts → dist/src/components/FieldGroup/index.d.ts} +0 -0
  23. package/dist/src/components/Form/Form.d.ts +7 -0
  24. package/{src/components/Form/index.ts → dist/src/components/Form/index.d.ts} +0 -0
  25. package/dist/src/components/FormGroup/FormGroup.d.ts +7 -0
  26. package/{src/components/FormGroup/index.ts → dist/src/components/FormGroup/index.d.ts} +0 -0
  27. package/dist/src/components/Icon/Icon.d.ts +70 -0
  28. package/{src/components/Icon/index.ts → dist/src/components/Icon/index.d.ts} +0 -0
  29. package/dist/src/components/InputField/InputField.d.ts +15 -0
  30. package/{src/components/InputField/index.ts → dist/src/components/InputField/index.d.ts} +0 -0
  31. package/{src/components/Link/Link.tsx → dist/src/components/Link/Link.d.ts} +3 -26
  32. package/{src/components/Link/index.ts → dist/src/components/Link/index.d.ts} +0 -0
  33. package/dist/src/components/Loader/Loader.d.ts +10 -0
  34. package/{src/components/Loader/index.ts → dist/src/components/Loader/index.d.ts} +0 -0
  35. package/dist/src/components/Modal/ActionModal.d.ts +8 -0
  36. package/dist/src/components/Modal/Modal.d.ts +7 -0
  37. package/dist/src/components/Modal/ModalBase.d.ts +6 -0
  38. package/dist/src/components/Modal/ModalCloseButton.d.ts +3 -0
  39. package/dist/src/components/Modal/ModalPortal.d.ts +7 -0
  40. package/{src/components/Modal/index.ts → dist/src/components/Modal/index.d.ts} +0 -1
  41. package/dist/src/components/NumericInput/NumericInput.d.ts +14 -0
  42. package/dist/src/components/NumericInput/NumericInputField.d.ts +19 -0
  43. package/{src/components/NumericInput/index.ts → dist/src/components/NumericInput/index.d.ts} +0 -0
  44. package/dist/src/components/Popover/Popover.d.ts +15 -0
  45. package/{src/components/Popover/index.ts → dist/src/components/Popover/index.d.ts} +0 -0
  46. package/dist/src/components/Progress/ProgressCircle.d.ts +9 -0
  47. package/dist/src/components/Progress/constants.d.ts +12 -0
  48. package/dist/src/components/Progress/helpers.d.ts +3 -0
  49. package/{src/components/Progress/index.ts → dist/src/components/Progress/index.d.ts} +0 -0
  50. package/dist/src/components/PromoBanner/PromoBanner.d.ts +19 -0
  51. package/{src/components/PromoBanner/index.ts → dist/src/components/PromoBanner/index.d.ts} +0 -0
  52. package/dist/src/components/RadioButton/RadioButton.d.ts +7 -0
  53. package/{src/components/RadioButton/index.ts → dist/src/components/RadioButton/index.d.ts} +0 -0
  54. package/dist/src/components/Switch/Switch.d.ts +20 -0
  55. package/{src/components/Switch/index.ts → dist/src/components/Switch/index.d.ts} +0 -0
  56. package/dist/src/components/Tab/Tab.d.ts +12 -0
  57. package/dist/src/components/Tab/TabsWrapper.d.ts +3 -0
  58. package/{src/components/Tab/index.ts → dist/src/components/Tab/index.d.ts} +0 -0
  59. package/dist/src/components/Tag/Tag.d.ts +12 -0
  60. package/{src/components/Tag/index.ts → dist/src/components/Tag/index.d.ts} +0 -0
  61. package/dist/src/components/TagInput/EditableTag.d.ts +11 -0
  62. package/dist/src/components/TagInput/EditableTagContent.d.ts +11 -0
  63. package/dist/src/components/TagInput/EmailTagInput.d.ts +5 -0
  64. package/dist/src/components/TagInput/TagInput.d.ts +12 -0
  65. package/{src/components/TagInput/index.ts → dist/src/components/TagInput/index.d.ts} +0 -0
  66. package/dist/src/components/TextField/TextField.d.ts +13 -0
  67. package/{src/components/TextField/index.ts → dist/src/components/TextField/index.d.ts} +0 -0
  68. package/dist/src/components/Toast/Toast.d.ts +22 -0
  69. package/dist/src/components/Toast/ToastWrapper.d.ts +27 -0
  70. package/{src/components/Toast/index.ts → dist/src/components/Toast/index.d.ts} +0 -0
  71. package/dist/src/components/Typography/Heading.d.ts +11 -0
  72. package/dist/src/components/Typography/Text.d.ts +15 -0
  73. package/{src/components/Typography/index.ts → dist/src/components/Typography/index.d.ts} +0 -0
  74. package/{src/index.ts → dist/src/index.d.ts} +0 -3
  75. package/dist/src/themes/designTokens.d.ts +126 -0
  76. package/dist/src/utils/keyCodes.d.ts +12 -0
  77. package/dist/src/utils/noop.d.ts +1 -0
  78. package/{src → dist/src}/vite-env.d.ts +0 -0
  79. package/dist/style.css +1 -0
  80. package/{src/themes/dark.scss → dist/themes/dark.css} +2 -0
  81. package/dist/themes/dark.css.map +1 -0
  82. package/{src/themes/legacy.scss → dist/themes/legacy.css} +2 -0
  83. package/dist/themes/legacy.css.map +1 -0
  84. package/{src/themes/light.scss → dist/themes/light.css} +2 -0
  85. package/dist/themes/light.css.map +1 -0
  86. package/package.json +5 -2
  87. package/.eslintrc +0 -9
  88. package/.storybook/main.js +0 -20
  89. package/.storybook/preview-head.html +0 -31
  90. package/.storybook/preview.js +0 -21
  91. package/src/components/Alert/Alert.module.scss +0 -88
  92. package/src/components/Alert/Alert.spec.tsx +0 -78
  93. package/src/components/Alert/Alert.stories.tsx +0 -73
  94. package/src/components/Alert/Alert.tsx +0 -94
  95. package/src/components/Badge/Badge.module.scss +0 -23
  96. package/src/components/Badge/Badge.spec.tsx +0 -12
  97. package/src/components/Badge/Badge.stories.tsx +0 -24
  98. package/src/components/Badge/Badge.tsx +0 -24
  99. package/src/components/Button/Button.module.scss +0 -257
  100. package/src/components/Button/Button.spec.tsx +0 -110
  101. package/src/components/Button/Button.stories.tsx +0 -152
  102. package/src/components/Button/Button.tsx +0 -88
  103. package/src/components/ButtonGroup/ButtonGroup.module.scss +0 -31
  104. package/src/components/ButtonGroup/ButtonGroup.spec.tsx +0 -61
  105. package/src/components/ButtonGroup/ButtonGroup.stories.tsx +0 -53
  106. package/src/components/ButtonGroup/ButtonGroup.tsx +0 -75
  107. package/src/components/Card/Card.module.scss +0 -31
  108. package/src/components/Card/Card.spec.tsx +0 -38
  109. package/src/components/Card/Card.stories.tsx +0 -30
  110. package/src/components/Card/Card.tsx +0 -34
  111. package/src/components/Checkbox/Checkbox.module.scss +0 -99
  112. package/src/components/Checkbox/Checkbox.tsx +0 -39
  113. package/src/components/Checkbox/CheckboxField.spec.tsx +0 -58
  114. package/src/components/Checkbox/CheckboxField.stories.tsx +0 -30
  115. package/src/components/Checkbox/CheckboxField.tsx +0 -46
  116. package/src/components/FieldDescription/FieldDescription.module.scss +0 -5
  117. package/src/components/FieldDescription/FieldDescription.tsx +0 -23
  118. package/src/components/FieldError/FieldError.module.scss +0 -5
  119. package/src/components/FieldError/FieldError.tsx +0 -23
  120. package/src/components/FieldGroup/FieldGroup.module.scss +0 -25
  121. package/src/components/FieldGroup/FieldGroup.spec.tsx +0 -42
  122. package/src/components/FieldGroup/FieldGroup.stories.tsx +0 -34
  123. package/src/components/FieldGroup/FieldGroup.tsx +0 -38
  124. package/src/components/Form/Form.module.scss +0 -22
  125. package/src/components/Form/Form.spec.tsx +0 -38
  126. package/src/components/Form/Form.stories.tsx +0 -42
  127. package/src/components/Form/Form.tsx +0 -46
  128. package/src/components/FormGroup/FormGroup.module.scss +0 -20
  129. package/src/components/FormGroup/FormGroup.spec.tsx +0 -34
  130. package/src/components/FormGroup/FormGroup.stories.tsx +0 -30
  131. package/src/components/FormGroup/FormGroup.tsx +0 -44
  132. package/src/components/Icon/Icon.module.scss +0 -70
  133. package/src/components/Icon/Icon.stories.tsx +0 -53
  134. package/src/components/Icon/Icon.tsx +0 -118
  135. package/src/components/InputField/InputField.module.scss +0 -37
  136. package/src/components/InputField/InputField.spec.tsx +0 -53
  137. package/src/components/InputField/InputField.stories.tsx +0 -73
  138. package/src/components/InputField/InputField.tsx +0 -72
  139. package/src/components/Link/Link.module.scss +0 -18
  140. package/src/components/Link/Link.stories.tsx +0 -17
  141. package/src/components/Loader/Loader.module.scss +0 -66
  142. package/src/components/Loader/Loader.spec.tsx +0 -64
  143. package/src/components/Loader/Loader.stories.tsx +0 -25
  144. package/src/components/Loader/Loader.tsx +0 -48
  145. package/src/components/Modal/ActionModal.tsx +0 -37
  146. package/src/components/Modal/Modal.module.scss +0 -131
  147. package/src/components/Modal/Modal.stories.tsx +0 -85
  148. package/src/components/Modal/Modal.tsx +0 -41
  149. package/src/components/Modal/ModalBase.spec.tsx +0 -58
  150. package/src/components/Modal/ModalBase.tsx +0 -66
  151. package/src/components/Modal/ModalCloseButton.tsx +0 -20
  152. package/src/components/Modal/ModalPortal.tsx +0 -35
  153. package/src/components/NumericInput/NumericInput.module.scss +0 -110
  154. package/src/components/NumericInput/NumericInput.spec.tsx +0 -129
  155. package/src/components/NumericInput/NumericInput.stories.tsx +0 -56
  156. package/src/components/NumericInput/NumericInput.tsx +0 -161
  157. package/src/components/NumericInput/NumericInputField.stories.tsx +0 -58
  158. package/src/components/NumericInput/NumericInputField.tsx +0 -57
  159. package/src/components/Popover/Popover.module.scss +0 -16
  160. package/src/components/Popover/Popover.spec.tsx +0 -39
  161. package/src/components/Popover/Popover.stories.css +0 -23
  162. package/src/components/Popover/Popover.stories.tsx +0 -164
  163. package/src/components/Popover/Popover.tsx +0 -124
  164. package/src/components/Progress/ProgressBar.module.scss +0 -48
  165. package/src/components/Progress/ProgressBar.spec.tsx +0 -33
  166. package/src/components/Progress/ProgressBar.stories.tsx +0 -23
  167. package/src/components/Progress/ProgressBar.tsx +0 -62
  168. package/src/components/Progress/ProgressCircle.module.scss +0 -64
  169. package/src/components/Progress/ProgressCircle.spec.tsx +0 -34
  170. package/src/components/Progress/ProgressCircle.stories.tsx +0 -28
  171. package/src/components/Progress/ProgressCircle.tsx +0 -104
  172. package/src/components/Progress/constants.ts +0 -23
  173. package/src/components/Progress/helpers.ts +0 -23
  174. package/src/components/PromoBanner/PromoBanner.module.scss +0 -121
  175. package/src/components/PromoBanner/PromoBanner.spec.tsx +0 -119
  176. package/src/components/PromoBanner/PromoBanner.stories.tsx +0 -125
  177. package/src/components/PromoBanner/PromoBanner.tsx +0 -99
  178. package/src/components/RadioButton/RadioButton.module.scss +0 -100
  179. package/src/components/RadioButton/RadioButton.spec.tsx +0 -70
  180. package/src/components/RadioButton/RadioButton.stories.tsx +0 -34
  181. package/src/components/RadioButton/RadioButton.tsx +0 -54
  182. package/src/components/Switch/Switch.module.scss +0 -126
  183. package/src/components/Switch/Switch.spec.tsx +0 -40
  184. package/src/components/Switch/Switch.stories.tsx +0 -23
  185. package/src/components/Switch/Switch.tsx +0 -100
  186. package/src/components/Tab/Tab.module.scss +0 -56
  187. package/src/components/Tab/Tab.spec.tsx +0 -34
  188. package/src/components/Tab/Tab.stories.tsx +0 -20
  189. package/src/components/Tab/Tab.tsx +0 -49
  190. package/src/components/Tab/TabsWrapper.module.scss +0 -11
  191. package/src/components/Tab/TabsWrapper.spec.tsx +0 -19
  192. package/src/components/Tab/TabsWrapper.stories.tsx +0 -46
  193. package/src/components/Tab/TabsWrapper.tsx +0 -24
  194. package/src/components/Tag/Tag.module.scss +0 -131
  195. package/src/components/Tag/Tag.spec.tsx +0 -93
  196. package/src/components/Tag/Tag.stories.tsx +0 -151
  197. package/src/components/Tag/Tag.tsx +0 -129
  198. package/src/components/TagInput/EditableTag.tsx +0 -54
  199. package/src/components/TagInput/EditableTagContent.tsx +0 -81
  200. package/src/components/TagInput/EmailTagInput.tsx +0 -31
  201. package/src/components/TagInput/TagInput.module.scss +0 -81
  202. package/src/components/TagInput/TagInput.spec.tsx +0 -58
  203. package/src/components/TagInput/TagInput.stories.tsx +0 -49
  204. package/src/components/TagInput/TagInput.tsx +0 -133
  205. package/src/components/TextField/TextField.module.scss +0 -90
  206. package/src/components/TextField/TextField.spec.tsx +0 -40
  207. package/src/components/TextField/TextField.stories.tsx +0 -60
  208. package/src/components/TextField/TextField.tsx +0 -100
  209. package/src/components/Toast/Toast.module.scss +0 -218
  210. package/src/components/Toast/Toast.spec.tsx +0 -96
  211. package/src/components/Toast/Toast.stories.tsx +0 -64
  212. package/src/components/Toast/Toast.tsx +0 -121
  213. package/src/components/Toast/ToastWrapper.spec.tsx +0 -13
  214. package/src/components/Toast/ToastWrapper.stories.tsx +0 -55
  215. package/src/components/Toast/ToastWrapper.tsx +0 -87
  216. package/src/components/Typography/Heading.tsx +0 -36
  217. package/src/components/Typography/Text.tsx +0 -49
  218. package/src/components/Typography/Typography.module.scss +0 -132
  219. package/src/index.scss +0 -9
  220. package/src/stories/ColorTokens.stories.mdx +0 -10
  221. package/src/stories/Icons.stories.mdx +0 -12
  222. package/src/stories/Typography.stories.mdx +0 -65
  223. package/src/stories/components/ColorTokens.tsx +0 -99
  224. package/src/stories/components/IconsShowcase.tsx +0 -25
  225. package/src/stories/components/iconsShowcase.css +0 -13
  226. package/src/test/setup.ts +0 -1
  227. package/src/test/utils.ts +0 -3
  228. package/src/themes/designTokens.ts +0 -126
  229. package/src/utils/keyCodes.ts +0 -12
  230. package/src/utils/noop.ts +0 -2
  231. package/tsconfig.json +0 -25
  232. package/tsconfig.node.json +0 -8
  233. package/vite.config.ts +0 -44
@@ -1,49 +0,0 @@
1
- import * as React from 'react';
2
- import cx from 'clsx';
3
-
4
- import styles from './Typography.module.scss';
5
-
6
- type TSize = 'md' | 'sm' | 'xs';
7
-
8
- interface IProps {
9
- /** DOM element name that will be rendered */
10
- as?: string;
11
- size?: TSize;
12
- /** Optional custom className */
13
- className?: string;
14
- caps?: boolean;
15
- bold?: boolean;
16
- underline?: boolean;
17
- strike?: boolean;
18
- }
19
-
20
- export const Text: React.FC<IProps> = ({
21
- as = 'p',
22
- size = 'md',
23
- caps = false,
24
- bold = false,
25
- underline = false,
26
- strike = false,
27
- children,
28
- className,
29
- ...props
30
- }) => {
31
- const baseClassPrefix = caps ? 'caps' : `paragraph-${size}`;
32
-
33
- return React.createElement(
34
- as,
35
- {
36
- className: cx(
37
- {
38
- [styles[`${baseClassPrefix}`]]: true,
39
- [styles[`${baseClassPrefix}--bold`]]: bold,
40
- [styles[`${baseClassPrefix}--strike`]]: strike,
41
- [styles[`${baseClassPrefix}--underline`]]: underline,
42
- },
43
- className
44
- ),
45
- ...props,
46
- },
47
- children
48
- );
49
- };
@@ -1,132 +0,0 @@
1
- @mixin heading-xl {
2
- font-size: 32px;
3
- font-style: normal;
4
- font-weight: 600;
5
- letter-spacing: 0;
6
- line-height: 40px;
7
- }
8
-
9
- @mixin heading-lg {
10
- font-size: 24px;
11
- font-style: normal;
12
- font-weight: 600;
13
- letter-spacing: 0;
14
- line-height: 32px;
15
- }
16
-
17
- @mixin heading-md {
18
- font-size: 20px;
19
- font-style: normal;
20
- font-weight: 600;
21
- letter-spacing: 0;
22
- line-height: 28px;
23
- }
24
-
25
- @mixin heading-sm {
26
- font-size: 18px;
27
- font-style: normal;
28
- font-weight: 600;
29
- letter-spacing: 0;
30
- line-height: 24px;
31
- }
32
-
33
- @mixin heading-xs {
34
- font-size: 16px;
35
- font-style: normal;
36
- font-weight: 600;
37
- letter-spacing: 0;
38
- line-height: 24px;
39
- }
40
-
41
- @mixin caps {
42
- font-size: 12px;
43
- font-style: normal;
44
- font-weight: 400;
45
- letter-spacing: 0.2px;
46
- line-height: 20px;
47
- text-transform: uppercase;
48
-
49
- &--bold {
50
- font-weight: 600;
51
- }
52
- }
53
-
54
- @mixin paragraph-md {
55
- font-size: 15px;
56
- font-style: normal;
57
- font-weight: 400;
58
- letter-spacing: 0;
59
- line-height: 22px;
60
-
61
- &--bold {
62
- font-weight: 600;
63
- }
64
-
65
- &--underline {
66
- text-decoration-line: underline;
67
- }
68
-
69
- &--strike {
70
- text-decoration-line: line-through;
71
- }
72
- }
73
-
74
- @mixin paragraph-sm {
75
- font-size: 14px;
76
- font-style: normal;
77
- font-weight: 400;
78
- letter-spacing: 0;
79
- line-height: 20px;
80
-
81
- &--bold {
82
- font-weight: 600;
83
- }
84
- }
85
-
86
- @mixin paragraph-xs {
87
- font-size: 12px;
88
- font-style: normal;
89
- font-weight: 400;
90
- letter-spacing: 0.2px;
91
- line-height: 16px;
92
-
93
- &--bold {
94
- font-weight: 600;
95
- }
96
- }
97
-
98
- .heading-xl {
99
- @include heading-xl;
100
- }
101
-
102
- .heading-lg {
103
- @include heading-lg;
104
- }
105
-
106
- .heading-md {
107
- @include heading-md;
108
- }
109
-
110
- .heading-sm {
111
- @include heading-sm;
112
- }
113
-
114
- .heading-xs {
115
- @include heading-xs;
116
- }
117
-
118
- .caps {
119
- @include caps;
120
- }
121
-
122
- .paragraph-md {
123
- @include paragraph-md;
124
- }
125
-
126
- .paragraph-sm {
127
- @include paragraph-sm;
128
- }
129
-
130
- .paragraph-xs {
131
- @include paragraph-xs;
132
- }
package/src/index.scss DELETED
@@ -1,9 +0,0 @@
1
- @use './themes/legacy';
2
-
3
- *[class^='lc-'] {
4
- box-sizing: border-box;
5
- font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, Segoe UI,
6
- Helvetica Neue, Arial, sans-serif;
7
- -webkit-font-smoothing: antialiased;
8
- -moz-osx-font-smoothing: grayscale;
9
- }
@@ -1,10 +0,0 @@
1
- import { Meta, Canvas } from '@storybook/addon-docs';
2
- import { ColorTokensPallete } from './components/ColorTokens';
3
-
4
- <Meta title="Foundations/Color Tokens" />
5
-
6
- # Color Tokens
7
-
8
- List of available color tokens. Click on token to copy it's value to clipboard.
9
-
10
- <ColorTokensPallete />
@@ -1,12 +0,0 @@
1
- import { Meta, Canvas, ArgsTable } from "@storybook/addon-docs";
2
-
3
- import { Icon, IconTypeName, IconSizeName } from "../components/Icon";
4
- import { IconsShowcase } from "./components/IconsShowcase";
5
-
6
- <Meta title="Foundations/Icons" />
7
-
8
- # Icons
9
-
10
- List of the icons available in the design system.
11
-
12
- <IconsShowcase />
@@ -1,65 +0,0 @@
1
- import { Meta, Canvas, ArgsTable } from "@storybook/addon-docs";
2
-
3
- import { Heading, Text } from "../components/Typography";
4
-
5
- <Meta title="Foundations/Typography" />
6
-
7
- # Typography
8
-
9
- This guide will help you create a typography hierarchy in the interface you build. This can be achieved by using size and weight.
10
-
11
- ## Heading
12
-
13
- `Heading` component renders heading element with given size.
14
-
15
- You can modify the output element via `as` prop. For example if you want to render XLarge heading as `h3` just pass `as='h3'`
16
-
17
- ```jsx
18
- <Heading size="xl" as="h3">
19
- My h3 heading
20
- </Heading>
21
- ```
22
-
23
- <ArgsTable of={Heading} />
24
-
25
- <Canvas style={{ color: "var(--content-default)" }}>
26
- <Heading size="xl">Heading XLarge</Heading>
27
- <Heading size="lg">Heading Large</Heading>
28
- <Heading size="md">Heading Medium</Heading>
29
- <Heading size="sm">Heading Small</Heading>
30
- <Heading size="xs">Heading XSmall</Heading>
31
- </Canvas>
32
-
33
- ## Text
34
-
35
- `Text` component renders a paragraph.
36
-
37
- ```jsx
38
- <Text size="sm" bold>
39
- This text is a small bold p
40
- </Text>
41
- ```
42
-
43
- <ArgsTable of={Text} />
44
-
45
- <Canvas style={{ color: "var(--content-default)" }}>
46
- <Text>Paragraph Medium</Text>
47
- <Text bold>Paragraph Medium Bold</Text>
48
- <Text underline>Paragraph Medium Underline</Text>
49
- <Text strike>Paragraph Medium Strikethrough</Text>
50
- <Text size="sm">Paragraph Small</Text>
51
- <Text size="sm" bold>
52
- Paragraph Small Bold
53
- </Text>
54
- <Text size="xs">Paragraph XSmall</Text>
55
- <Text size="xs" bold>
56
- Paragraph XSmall Bold
57
- </Text>
58
- <Text caps>Caps</Text>
59
- <Text caps bold>
60
- Bold Caps
61
- </Text>
62
- <Text as="div" size="sm">
63
- Small text as div
64
- </Text>
65
- </Canvas>
@@ -1,99 +0,0 @@
1
- import * as React from 'react';
2
- import { DesignTokens } from '../../themes/designTokens';
3
- import { Text } from '../../components/Typography';
4
-
5
- interface TokensGroup {
6
- background: string[];
7
- surface: string[];
8
- content: string[];
9
- border: string[];
10
- color: string[];
11
- decor: string[];
12
- }
13
-
14
- type TokenGroupName =
15
- | 'background'
16
- | 'surface'
17
- | 'content'
18
- | 'border'
19
- | 'color'
20
- | 'decor';
21
-
22
- const Tokens: TokensGroup = Object.values(
23
- DesignTokens as { [key: string]: string }
24
- ).reduce(
25
- (acc: TokensGroup, value) => {
26
- const groupName = value.split('-').filter(Boolean)[0] as TokenGroupName;
27
- acc[groupName].push(value);
28
-
29
- return acc;
30
- },
31
- { background: [], surface: [], content: [], border: [], color: [], decor: [] }
32
- );
33
-
34
- const CONTENT = {
35
- background: {
36
- heading: 'Background',
37
- content:
38
- 'Basic layer of the UI – this represents the canvas (for developers) or frame (for designers)',
39
- },
40
- surface: {
41
- heading: 'Surface',
42
- content:
43
- 'Background of components, like cards, input fields, tooltips, ect.',
44
- },
45
- content: {
46
- heading: 'Content',
47
- content: 'Fonts & icons (mostly)',
48
- },
49
- border: {
50
- heading: 'Border',
51
- content: 'Style for components borders',
52
- },
53
- color: {
54
- heading: 'Accent colors',
55
- content:
56
- 'All colors that drive attention in the UI - it can be either action, warning, negative or positive',
57
- },
58
- decor: {
59
- heading: 'Decor',
60
- content:
61
- 'Those colors can be used for specific elements of the UI, they were purposely separated from all other tokens, as they are used only for decorative means. Those colors are shared between all three themes — Legacy, Light & Dark. This palette is not yet fully supported in dark mode.',
62
- },
63
- };
64
-
65
- export const ColorTokensPallete: React.FC = () => (
66
- <div style={{ color: 'var(--content-default)' }}>
67
- {Object.entries(CONTENT).map(([section, { heading, content }]) => (
68
- <React.Fragment key={section}>
69
- <h2>{heading}</h2>
70
- <Text as="p">{content}</Text>
71
- <ul style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr' }}>
72
- {Tokens[section as TokenGroupName].map((colorToken: string) => (
73
- <li
74
- key={colorToken}
75
- style={{
76
- display: 'flex',
77
- cursor: 'pointer',
78
- alignItems: 'center',
79
- }}
80
- onClick={() => navigator.clipboard.writeText(colorToken)}
81
- >
82
- <div
83
- style={{
84
- backgroundColor: `var(${colorToken})`,
85
- border: '1px solid var(--border-subtle)',
86
- borderRadius: '4px',
87
- width: '50px',
88
- height: '50px',
89
- margin: '5px',
90
- }}
91
- />
92
- <Text>{colorToken}</Text>
93
- </li>
94
- ))}
95
- </ul>
96
- </React.Fragment>
97
- ))}
98
- </div>
99
- );
@@ -1,25 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import * as MaterialIcons from '@livechat/design-system-icons/react/material';
4
- import { Icon, IconSizeName } from '../../components/Icon';
5
- import './iconsShowcase.css';
6
-
7
- export type IconsMap = {
8
- [key: string]: React.FC<React.SVGProps<SVGSVGElement>>;
9
- };
10
-
11
- const Icons = MaterialIcons as IconsMap;
12
-
13
- export const IconsShowcase = (): React.ReactElement => {
14
- const iconsGrid = Object.keys(Icons).map((item) => {
15
- const iconSource = Icons[item];
16
- return (
17
- <div className="icon-showcase-card">
18
- <Icon source={iconSource} size={IconSizeName.XLarge}></Icon>
19
- <p>{item}</p>
20
- </div>
21
- );
22
- });
23
-
24
- return <div className="icons-showcase-wrapper">{iconsGrid}</div>;
25
- };
@@ -1,13 +0,0 @@
1
- .icons-showcase-card {
2
- align-items: center;
3
- display: flex;
4
- flex-direction: column;
5
- justify-content: center;
6
- }
7
-
8
- .icons-showcase-wrapper {
9
- display: grid;
10
- gap: 10px;
11
- grid-auto-rows: minmax(100px, auto);
12
- grid-template-columns: repeat(8, 1fr);
13
- }
package/src/test/setup.ts DELETED
@@ -1 +0,0 @@
1
- import '@testing-library/jest-dom';
package/src/test/utils.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from '@testing-library/react';
2
- export { default as userEvent } from '@testing-library/user-event';
3
- export * from 'vitest';
@@ -1,126 +0,0 @@
1
- export const DesignTokens = {
2
- Background: '--background',
3
- SurfaceBasicDefault: '--surface-basic-default',
4
- SurfaceBasicSubtle: '--surface-basic-subtle',
5
- SurfaceBasicHover: '--surface-basic-hover',
6
- SurfaceBasicActive: '--surface-basic-active',
7
- SurfaceBasicDisabled: '--surface-basic-disabled',
8
- SurfaceSecondaryDefault: '--surface-secondary-default',
9
- SurfaceSecondarySubtle: '--surface-secondary-subtle',
10
- SurfaceSecondaryHover: '--surface-secondary-hover',
11
- SurfaceSecondaryDisabled: '--surface-secondary-disabled',
12
- SurfaceFeedbackInfo: '--surface-feedback-info',
13
- SurfaceFeedbackNegative: '--surface-feedback-negative',
14
- SurfaceFeedbackWarning: '--surface-feedback-warning',
15
- SurfaceFeedbackPositive: '--surface-feedback-positive',
16
- SurfaceInvertDefault: '--surface-invert-default',
17
- SurfaceInvertSubtle: '--surface-invert-subtle',
18
- SurfaceInvertDisabled: '--surface-invert-disabled',
19
- SurfaceOverlay: '--surface-overlay',
20
- ContentDefault: '--content-default',
21
- ContentSubtle: '--content-subtle',
22
- ContentDisabled: '--content-disabled',
23
- ContentWhiteLocked: '--content-white-locked',
24
- ContentInvertDefault: '--content-invert-default',
25
- ContentInvertSubtle: '--content-invert-subtle',
26
- ContentInvertDisabled: '--content-invert-disabled',
27
- BorderDefault: '--border-default',
28
- BorderSubtle: '--border-subtle',
29
- BorderHover: '--border-hover',
30
- BorderDisabled: '--border-disabled',
31
- BorderInvertDefault: '--border-invert-default',
32
- BorderInvertSubtle: '--border-invert-subtle',
33
- BorderInvertHover: '--border-invert-hover',
34
- BorderInvertDisabled: '--border-invert-disabled',
35
- ColorActionActive: '--color-action-active',
36
- ColorActionHover: '--color-action-hover',
37
- ColorActionDefault: '--color-action-default',
38
- ColorActionDisabled: '--color-action-disabled',
39
- ColorNegativeActive: '--color-negative-active',
40
- ColorNegativeHover: '--color-negative-hover',
41
- ColorNegativeDefault: '--color-negative-default',
42
- ColorNegativeDisabled: '--color-negative-disabled',
43
- ColorWarningDefault: '--color-warning-default',
44
- ColorWarningHover: '--color-warning-hover',
45
- ColorPositiveDefault: '--color-positive-default',
46
- ColorPositiveHover: '--color-positive-hover',
47
- ColorPositiveDisabled: '--color-positive-disabled',
48
- ColorBot: '--color-bot',
49
- ColorBlack: '--color-black',
50
- ColorWhite: '--color-white',
51
- DecorBlue900: '--decor-blue900',
52
- DecorBlue800: '--decor-blue800',
53
- DecorBlue700: '--decor-blue700',
54
- DecorBlue600: '--decor-blue600',
55
- DecorBlue500: '--decor-blue500',
56
- DecorBlue400: '--decor-blue400',
57
- DecorBlue300: '--decor-blue300',
58
- DecorBlue200: '--decor-blue200',
59
- DecorBlue100: '--decor-blue100',
60
- DecorBlue50: '--decor-blue50',
61
- DecorOrange900: '--decor-orange900',
62
- DecorOrange800: '--decor-orange800',
63
- DecorOrange700: '--decor-orange700',
64
- DecorOrange600: '--decor-orange600',
65
- DecorOrange500: '--decor-orange500',
66
- DecorOrange400: '--decor-orange400',
67
- DecorOrange300: '--decor-orange300',
68
- DecorOrange200: '--decor-orange200',
69
- DecorOrange100: '--decor-orange100',
70
- DecorOrange50: '--decor-orange50',
71
- DecorYellow900: '--decor-yellow900',
72
- DecorYellow800: '--decor-yellow800',
73
- DecorYellow700: '--decor-yellow700',
74
- DecorYellow600: '--decor-yellow600',
75
- DecorYellow500: '--decor-yellow500',
76
- DecorYellow400: '--decor-yellow400',
77
- DecorYellow300: '--decor-yellow300',
78
- DecorYellow200: '--decor-yellow200',
79
- DecorYellow100: '--decor-yellow100',
80
- DecorYellow50: '--decor-yellow50',
81
- DecorGray950: '--decor-gray950',
82
- DecorGray900: '--decor-gray900',
83
- DecorGray800: '--decor-gray800',
84
- DecorGray700: '--decor-gray700',
85
- DecorGray600: '--decor-gray600',
86
- DecorGray500: '--decor-gray500',
87
- DecorGray400: '--decor-gray400',
88
- DecorGray300: '--decor-gray300',
89
- DecorGray200: '--decor-gray200',
90
- DecorGray150: '--decor-gray150',
91
- DecorGray100: '--decor-gray100',
92
- DecorGray75: '--decor-gray75',
93
- DecorGray50: '--decor-gray50',
94
- DecorGray40: '--decor-gray40',
95
- DecorGray20: '--decor-gray20',
96
- DecorGreen900: '--decor-green900',
97
- DecorGreen800: '--decor-green800',
98
- DecorGreen700: '--decor-green700',
99
- DecorGreen600: '--decor-green600',
100
- DecorGreen500: '--decor-green500',
101
- DecorGreen400: '--decor-green400',
102
- DecorGreen300: '--decor-green300',
103
- DecorGreen200: '--decor-green200',
104
- DecorGreen100: '--decor-green100',
105
- DecorGreen50: '--decor-green50',
106
- DecorRed900: '--decor-red900',
107
- DecorRed800: '--decor-red800',
108
- DecorRed700: '--decor-red700',
109
- DecorRed600: '--decor-red600',
110
- DecorRed500: '--decor-red500',
111
- DecorRed400: '--decor-red400',
112
- DecorRed300: '--decor-red300',
113
- DecorRed200: '--decor-red200',
114
- DecorRed100: '--decor-red100',
115
- DecorRed50: '--decor-red50',
116
- DecorPurple900: '--decor-purple900',
117
- DecorPurple800: '--decor-purple800',
118
- DecorPurple700: '--decor-purple700',
119
- DecorPurple600: '--decor-purple600',
120
- DecorPurple500: '--decor-purple500',
121
- DecorPurple400: '--decor-purple400',
122
- DecorPurple300: '--decor-purple300',
123
- DecorPurple200: '--decor-purple200',
124
- DecorPurple100: '--decor-purple100',
125
- DecorPurple50: '--decor-purple50',
126
- };
@@ -1,12 +0,0 @@
1
- export const KeyCodes = {
2
- esc: 'Escape',
3
- enter: 'Enter',
4
- backspace: 'Backspace',
5
- delete: 'Delete',
6
- spacebar: ' ',
7
- tab: 'Tab',
8
- semicolon: ';',
9
- comma: ',',
10
- arrowUp: 'ArrowUp',
11
- arrowDown: 'ArrowDown',
12
- };
package/src/utils/noop.ts DELETED
@@ -1,2 +0,0 @@
1
- // eslint-disable-next-line @typescript-eslint/no-empty-function
2
- export default function (): void {}
package/tsconfig.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "useDefineForClassFields": true,
5
- "lib": ["DOM", "DOM.Iterable", "ESNext"],
6
- "allowJs": false,
7
- "skipLibCheck": false,
8
- "esModuleInterop": false,
9
- "allowSyntheticDefaultImports": true,
10
- "strict": true,
11
- "forceConsistentCasingInFileNames": true,
12
- "module": "ESNext",
13
- "moduleResolution": "Node",
14
- "resolveJsonModule": true,
15
- "isolatedModules": true,
16
- "noEmit": true,
17
- "jsx": "react",
18
- "baseUrl": "src",
19
- "paths": {
20
- "test-utils": ["test/utils.ts"]
21
- }
22
- },
23
- "include": ["src"],
24
- "references": [{ "path": "./tsconfig.node.json" }]
25
- }
@@ -1,8 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "module": "esnext",
5
- "moduleResolution": "node"
6
- },
7
- "include": ["vite.config.ts"]
8
- }
package/vite.config.ts DELETED
@@ -1,44 +0,0 @@
1
- /// <reference types="vitest" />
2
- /// <reference types="vite/client" />
3
-
4
- import { defineConfig } from 'vite';
5
- import dts from 'vite-plugin-dts';
6
- import react from '@vitejs/plugin-react';
7
-
8
- import * as path from 'path';
9
-
10
- // https://vitejs.dev/config/
11
- export default defineConfig({
12
- css: {
13
- modules: {
14
- generateScopedName: 'lc-[name]__[local]___[hash:base64:5]',
15
- },
16
- },
17
- build: {
18
- lib: {
19
- entry: path.resolve(__dirname, 'src/index.ts'),
20
- name: 'dsrc',
21
- formats: ['es', 'umd', 'cjs'],
22
- fileName: (format) => `dsrc.${format}.js`,
23
- },
24
- rollupOptions: {
25
- external: (id: string) => !id.startsWith('.') && !path.isAbsolute(id),
26
- output: {
27
- globals: {
28
- react: 'React',
29
- },
30
- },
31
- },
32
- },
33
- test: {
34
- globals: true,
35
- environment: 'jsdom',
36
- setupFiles: './src/test/setup.ts',
37
- },
38
- resolve: {
39
- alias: {
40
- 'test-utils': path.resolve(__dirname, 'src/test/utils.ts'),
41
- },
42
- },
43
- plugins: [dts(), react({ jsxRuntime: 'classic' })],
44
- });