@chotot/clad-ui 1.2.5 → 1.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 (224) hide show
  1. package/README.md +3 -3
  2. package/components/Announcer/Announcer.d.ts +9 -4
  3. package/components/Announcer/Announcer.stories.d.ts +142 -0
  4. package/components/Announcer/{Announcer.stories.js → Announcer.stories.tsx} +36 -31
  5. package/components/Announcer/Announcer.styles.d.ts +24 -12
  6. package/components/Announcer/{Announcer.styles.js → Announcer.styles.ts} +43 -18
  7. package/components/Announcer/Announcer.tsx +62 -47
  8. package/components/Badge/Badge.d.ts +4 -2
  9. package/components/Badge/Badge.stories.d.ts +61 -0
  10. package/components/Badge/{Badge.stories.js → Badge.stories.tsx} +5 -5
  11. package/components/Badge/Badge.styles.d.ts +20 -5
  12. package/components/Badge/{Badge.styles.js → Badge.styles.ts} +14 -1
  13. package/components/Badge/Badge.tsx +8 -4
  14. package/components/Box/Box.d.ts +3 -3
  15. package/components/Box/Box.stories.d.ts +240 -0
  16. package/components/Box/{Box.stories.js → Box.stories.tsx} +2 -2
  17. package/components/Box/Box.styles.d.ts +19 -4
  18. package/components/Box/{Box.styles.js → Box.styles.ts} +17 -4
  19. package/components/Box/Box.tsx +4 -4
  20. package/components/Breadcrumbs/Breadcrumbs.d.ts +2 -2
  21. package/components/Breadcrumbs/Breadcrumbs.stories.d.ts +52 -0
  22. package/components/Breadcrumbs/{Breadcrumbs.stories.js → Breadcrumbs.stories.tsx} +17 -15
  23. package/components/Breadcrumbs/Breadcrumbs.styles.d.ts +5 -4
  24. package/components/Breadcrumbs/Breadcrumbs.tsx +2 -2
  25. package/components/Button/Button.d.ts +21 -6
  26. package/components/Button/Button.stories.d.ts +103 -0
  27. package/components/Button/{Button.stories.js → Button.stories.tsx} +5 -1
  28. package/components/Button/Button.styles.d.ts +1 -1
  29. package/components/Button/{Button.styles.js → Button.styles.ts} +100 -6
  30. package/components/Button/Button.tsx +51 -18
  31. package/components/Button/ButtonLink.d.ts +4 -4
  32. package/components/Button/ButtonLink.stories.d.ts +30 -0
  33. package/components/Button/ButtonLink.styles.d.ts +1 -1
  34. package/components/Button/ButtonLink.tsx +5 -5
  35. package/components/Button/IconButton.d.ts +3 -29
  36. package/components/Button/IconButton.stories.d.ts +60 -0
  37. package/components/Button/{IconButton.stories.js → IconButton.stories.tsx} +27 -0
  38. package/components/Button/IconButton.tsx +2 -42
  39. package/components/Checkbox/Checkbox.d.ts +3 -3
  40. package/components/Checkbox/Checkbox.stories.d.ts +88 -0
  41. package/components/Checkbox/Checkbox.styles.d.ts +2 -2
  42. package/components/Checkbox/Checkbox.tsx +3 -6
  43. package/components/Chip/Chip.d.ts +5 -4
  44. package/components/Chip/Chip.stories.d.ts +153 -0
  45. package/components/Chip/{Chip.stories.js → Chip.stories.tsx} +4 -5
  46. package/components/Chip/Chip.styles.d.ts +11 -8
  47. package/components/Chip/{Chip.styles.js → Chip.styles.ts} +4 -4
  48. package/components/Chip/Chip.tsx +19 -12
  49. package/components/CurrencyInput/CurrencyInput.d.ts +3 -56
  50. package/components/CurrencyInput/CurrencyInput.stories.d.ts +104 -0
  51. package/components/CurrencyInput/{CurrencyInput.stories.js → CurrencyInput.stories.tsx} +2 -2
  52. package/components/CurrencyInput/CurrencyInput.styles.d.ts +16 -10
  53. package/components/CurrencyInput/{CurrencyInput.styles.js → CurrencyInput.styles.ts} +23 -9
  54. package/components/CurrencyInput/CurrencyInput.tsx +7 -61
  55. package/components/Dropdown/Dropdown.d.ts +22 -7
  56. package/components/Dropdown/Dropdown.stories.d.ts +148 -0
  57. package/components/Dropdown/{Dropdown.stories.js → Dropdown.stories.tsx} +115 -1
  58. package/components/Dropdown/Dropdown.styles.d.ts +10 -0
  59. package/components/Dropdown/Dropdown.styles.ts +42 -0
  60. package/components/Dropdown/Dropdown.tsx +120 -24
  61. package/components/Grid/Col.d.ts +2 -2
  62. package/components/Grid/Col.tsx +6 -3
  63. package/components/Grid/Grid.styles.d.ts +25 -5
  64. package/components/Grid/{Grid.styles.js → Grid.styles.ts} +16 -3
  65. package/components/Grid/aGrid.stories.d.ts +127 -0
  66. package/components/Grid/bCol.stories.d.ts +74 -0
  67. package/components/Input/Input.d.ts +14 -10
  68. package/components/Input/Input.stories.d.ts +226 -0
  69. package/components/Input/{Input.stories.js → Input.stories.tsx} +20 -16
  70. package/components/Input/Input.styles.d.ts +22 -11
  71. package/components/Input/{Input.styles.js → Input.styles.ts} +29 -7
  72. package/components/Input/Input.tsx +22 -20
  73. package/components/Popover/Popover.d.ts +44 -0
  74. package/components/Popover/Popover.stories.d.ts +53 -0
  75. package/components/Popover/Popover.stories.tsx +133 -0
  76. package/components/Popover/Popover.tsx +121 -0
  77. package/components/RadioButton/RadioButton.d.ts +5 -6
  78. package/components/RadioButton/RadioButton.stories.d.ts +94 -0
  79. package/components/RadioButton/RadioButton.styles.d.ts +7 -3
  80. package/components/RadioButton/{RadioButton.styles.js → RadioButton.styles.ts} +1 -1
  81. package/components/RadioButton/RadioButton.tsx +5 -11
  82. package/components/RowItem/RowItem.d.ts +27 -9
  83. package/components/RowItem/RowItem.stories.d.ts +131 -0
  84. package/components/RowItem/RowItem.stories.tsx +710 -0
  85. package/components/RowItem/RowItem.styles.d.ts +31 -10
  86. package/components/RowItem/{RowItem.styles.js → RowItem.styles.ts} +41 -13
  87. package/components/RowItem/RowItem.tsx +106 -42
  88. package/components/ShapeIcon/ShapeIcon.d.ts +23 -16
  89. package/components/ShapeIcon/ShapeIcon.stories.d.ts +91 -0
  90. package/components/ShapeIcon/{ShapeIcon.stories.js → ShapeIcon.stories.tsx} +21 -8
  91. package/components/ShapeIcon/ShapeIcon.styles.d.ts +8 -3
  92. package/components/ShapeIcon/{ShapeIcon.styles.js → ShapeIcon.styles.ts} +6 -3
  93. package/components/ShapeIcon/ShapeIcon.tsx +25 -21
  94. package/components/Slider/Slider.d.ts +9 -7
  95. package/components/Slider/Slider.stories.d.ts +81 -0
  96. package/components/Slider/{Slider.stories.js → Slider.stories.tsx} +7 -7
  97. package/components/Slider/Slider.styles.d.ts +15 -11
  98. package/components/Slider/{Slider.styles.js → Slider.styles.ts} +1 -1
  99. package/components/Slider/Slider.tsx +21 -16
  100. package/components/Snack/Snack.d.ts +4 -5
  101. package/components/Snack/Snack.stories.d.ts +87 -0
  102. package/components/Snack/Snack.styles.d.ts +9 -8
  103. package/components/Snack/{Snack.styles.js → Snack.styles.ts} +4 -4
  104. package/components/Snack/Snack.tsx +14 -11
  105. package/components/Tabs/Tab.d.ts +6 -6
  106. package/components/Tabs/Tab.tsx +6 -7
  107. package/components/Tabs/Tabs.d.ts +7 -4
  108. package/components/Tabs/Tabs.stories.d.ts +64 -0
  109. package/components/Tabs/{Tabs.stories.js → Tabs.stories.tsx} +2 -2
  110. package/components/Tabs/Tabs.styles.d.ts +30 -12
  111. package/components/Tabs/{Tabs.styles.js → Tabs.styles.ts} +4 -4
  112. package/components/Tabs/Tabs.tsx +11 -7
  113. package/components/TextArea/TextArea.d.ts +24 -11
  114. package/components/TextArea/TextArea.stories.d.ts +151 -0
  115. package/components/TextArea/{TextArea.stories.js → TextArea.stories.tsx} +5 -96
  116. package/components/TextArea/TextArea.styles.d.ts +18 -16
  117. package/components/TextArea/{TextArea.styles.js → TextArea.styles.ts} +39 -19
  118. package/components/TextArea/TextArea.tsx +85 -31
  119. package/components/TextLabel/TextLabel.d.ts +35 -0
  120. package/components/TextLabel/TextLabel.stories.d.ts +40 -0
  121. package/components/TextLabel/TextLabel.stories.tsx +177 -0
  122. package/components/TextLabel/TextLabel.styles.d.ts +9 -0
  123. package/components/TextLabel/TextLabel.styles.ts +24 -0
  124. package/components/TextLabel/TextLabel.tsx +112 -0
  125. package/components/ToggleSwitch/ToggleSwitch.d.ts +2 -2
  126. package/components/ToggleSwitch/ToggleSwitch.stories.d.ts +38 -0
  127. package/components/ToggleSwitch/ToggleSwitch.styles.d.ts +21 -14
  128. package/components/ToggleSwitch/{ToggleSwitch.styles.js → ToggleSwitch.styles.ts} +8 -12
  129. package/components/ToggleSwitch/ToggleSwitch.tsx +12 -6
  130. package/components/Tooltip/Tooltip.d.ts +9 -3
  131. package/components/Tooltip/Tooltip.spec.js +5 -3
  132. package/components/Tooltip/Tooltip.styles.d.ts +7 -8
  133. package/components/Tooltip/Tooltip.tsx +10 -3
  134. package/components/index.d.ts +2 -0
  135. package/components/index.ts +2 -0
  136. package/icons/PrivateSellerAvatar.d.ts +3 -0
  137. package/icons/PrivateSellerAvatar.js +3 -0
  138. package/icons/Sda.d.ts +5 -2
  139. package/icons/Sda.js +7 -7
  140. package/icons/VerifiedShop.d.ts +3 -0
  141. package/icons/VerifiedShop.js +3 -0
  142. package/package.json +6 -6
  143. package/patterns/Drawer/Drawer.d.ts +13 -13
  144. package/patterns/Drawer/Drawer.stories.d.ts +90 -0
  145. package/patterns/Drawer/{Drawer.stories.js → Drawer.stories.tsx} +25 -0
  146. package/patterns/Drawer/Drawer.styles.d.ts +30 -26
  147. package/patterns/Drawer/{Drawer.styles.js → Drawer.styles.ts} +2 -5
  148. package/patterns/Drawer/Drawer.tsx +20 -41
  149. package/patterns/EmptyState/EmptyState.d.ts +5 -4
  150. package/patterns/EmptyState/EmptyState.stories.d.ts +40 -0
  151. package/patterns/EmptyState/EmptyState.styles.d.ts +10 -10
  152. package/patterns/EmptyState/{EmptyState.styles.js → EmptyState.styles.ts} +5 -4
  153. package/patterns/EmptyState/EmptyState.tsx +14 -12
  154. package/patterns/InputGroup/InputGroup.d.ts +4 -0
  155. package/patterns/InputGroup/InputGroup.styles.d.ts +5 -4
  156. package/patterns/InputGroup/InputGroup.tsx +11 -5
  157. package/patterns/LegacyDialog/DialogMainIcon.d.ts +1 -0
  158. package/patterns/LegacyDialog/DialogMainIcon.js +51 -0
  159. package/patterns/LegacyDialog/LegacyDialog.d.ts +3 -3
  160. package/patterns/LegacyDialog/LegacyDialog.styles.d.ts +8 -10
  161. package/patterns/LegacyDialog/LegacyDialog.styles.js +1 -46
  162. package/patterns/LegacyDialog/LegacyDialog.tsx +5 -11
  163. package/patterns/LegacyPopup/LegacyPopup.d.ts +4 -4
  164. package/patterns/LegacyPopup/LegacyPopup.styles.d.ts +18 -13
  165. package/patterns/LegacyPopup/{LegacyPopup.styles.js → LegacyPopup.styles.ts} +3 -1
  166. package/patterns/LegacyPopup/LegacyPopup.tsx +4 -6
  167. package/patterns/MultiSearchDropdown/MultiSearchDropdown.d.ts +20 -17
  168. package/patterns/MultiSearchDropdown/MultiSearchDropdown.stories.d.ts +125 -0
  169. package/patterns/MultiSearchDropdown/{MultiSearchDropdown.stories.js → MultiSearchDropdown.stories.tsx} +31 -30
  170. package/patterns/MultiSearchDropdown/MultiSearchDropdown.styles.d.ts +22 -21
  171. package/patterns/MultiSearchDropdown/{MultiSearchDropdown.styles.js → MultiSearchDropdown.styles.ts} +1 -7
  172. package/patterns/MultiSearchDropdown/MultiSearchDropdown.tsx +33 -32
  173. package/patterns/Popup/Popup.d.ts +8 -7
  174. package/patterns/Popup/Popup.stories.d.ts +102 -0
  175. package/patterns/Popup/Popup.styles.d.ts +41 -30
  176. package/patterns/Popup/{Popup.styles.js → Popup.styles.ts} +26 -33
  177. package/patterns/Popup/Popup.tsx +14 -33
  178. package/patterns/SearchInput/SearchInput.d.ts +38 -21
  179. package/patterns/SearchInput/SearchInput.stories.d.ts +186 -0
  180. package/patterns/SearchInput/{SearchInput.stories.js → SearchInput.stories.tsx} +78 -45
  181. package/patterns/SearchInput/SearchInput.styles.d.ts +6 -5
  182. package/patterns/SearchInput/{SearchInput.styles.js → SearchInput.styles.ts} +7 -4
  183. package/patterns/SearchInput/SearchInput.tsx +53 -34
  184. package/patterns/TagCloud/TagCloud.d.ts +19 -6
  185. package/patterns/TagCloud/TagCloud.stories.d.ts +159 -0
  186. package/patterns/TagCloud/{TagCloud.stories.js → TagCloud.stories.tsx} +59 -14
  187. package/patterns/TagCloud/TagCloud.styles.d.ts +12 -8
  188. package/patterns/TagCloud/{TagCloud.styles.js → TagCloud.styles.ts} +6 -7
  189. package/patterns/TagCloud/TagCloud.tsx +24 -8
  190. package/patterns/TagCloud/TagCloudMultiActive.d.ts +6 -4
  191. package/patterns/TagCloud/TagCloudMultiActive.tsx +5 -5
  192. package/patterns/TagCloud/TagCloudSingleActive.d.ts +5 -2
  193. package/patterns/TagCloud/TagCloudSingleActive.tsx +18 -5
  194. package/patterns/patterns-index.spec.js +1 -1
  195. package/storybook/GuideImage.d.ts +2 -2
  196. package/storybook/Swatch.d.ts +2 -2
  197. package/theme/__snapshots__/chotot.spec.js.snap +2 -2
  198. package/theme/chotot-color1.d.ts +7 -14
  199. package/theme/chotot.d.ts +32 -32
  200. package/theme/chotot.js +4 -4
  201. package/theme/ct-job.d.ts +6 -14
  202. package/theme/ct-pty.d.ts +6 -8
  203. package/theme/mudah.d.ts +14 -13
  204. package/types.d.ts +0 -9
  205. package/utils/_simulateChangeEvent.d.ts +18 -3
  206. package/utils/_simulateChangeEvent.js +13 -6
  207. package/utils/_simulateChangeEvent.spec.js +1 -1
  208. package/utils/cx.d.ts +8 -4
  209. package/utils/cx.js +8 -4
  210. package/utils/sx.d.ts +12 -4192
  211. package/components/RowItem/RowItem.stories.js +0 -560
  212. /package/components/Breadcrumbs/{Breadcrumbs.styles.js → Breadcrumbs.styles.ts} +0 -0
  213. /package/components/Button/{ButtonLink.stories.js → ButtonLink.stories.tsx} +0 -0
  214. /package/components/Button/{ButtonLink.styles.js → ButtonLink.styles.ts} +0 -0
  215. /package/components/Checkbox/{Checkbox.stories.js → Checkbox.stories.tsx} +0 -0
  216. /package/components/Checkbox/{Checkbox.styles.js → Checkbox.styles.ts} +0 -0
  217. /package/components/Grid/{aGrid.stories.js → aGrid.stories.tsx} +0 -0
  218. /package/components/Grid/{bCol.stories.js → bCol.stories.tsx} +0 -0
  219. /package/components/RadioButton/{RadioButton.stories.js → RadioButton.stories.tsx} +0 -0
  220. /package/components/Snack/{Snack.stories.js → Snack.stories.tsx} +0 -0
  221. /package/components/ToggleSwitch/{ToggleSwitch.stories.js → ToggleSwitch.stories.tsx} +0 -0
  222. /package/patterns/EmptyState/{EmptyState.stories.js → EmptyState.stories.tsx} +0 -0
  223. /package/patterns/InputGroup/{InputGroup.styles.js → InputGroup.styles.ts} +0 -0
  224. /package/patterns/Popup/{Popup.stories.js → Popup.stories.tsx} +0 -0
@@ -1,560 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { css } from '@linaria/core';
3
- import theme from '@clad-ui/theme';
4
- import RowItem from './RowItem';
5
- import Col from '../Grid/Col';
6
- import Grid from '../Grid/Grid';
7
- import BoyFace from '../../icons/BoyFace';
8
- import ShapeIcon from '../ShapeIcon/ShapeIcon';
9
- import * as iconComponents from '../../icons';
10
-
11
- const { colors, space, fontSizes } = theme;
12
-
13
- const iconsNameArr = Object.keys(iconComponents);
14
- const iconsItemArr = Object.keys(iconComponents).map((iconName) => iconComponents[iconName]);
15
-
16
- const icons = iconsNameArr.reduce((a, v, index) => ({ ...a, [v]: iconsItemArr[index] }), {});
17
-
18
- const rowItemStories = {
19
- title: 'Components/RowItem',
20
- component: RowItem,
21
- tags: ['autodocs'],
22
- parameters: {
23
- docs: {
24
- description: {
25
- component: `Row item component for menus and Popups
26
-
27
- \`✅ Stable\` [\`🎨 Figma Specs\`](https://www.figma.com/file/sPjl33KoaW0bKVZOmm66iQ/CHOTOT-Design-System?node-id=17176%3A56800&t=kAUFUd513UAFnEne-4)
28
-
29
- ## How to use
30
- Row Items are interactive components which are often used as children in menus or Popups[link to popup].
31
-
32
- There are three main types of Row Item:
33
-
34
- - Menu items: clickable menus with customizable icon and label and an optional description line
35
- - Checkboxes: behave like a checkbox with additional \`name\`, \`value\` and \`checked\` props
36
- - Radio buttons: behave like a radio button with additional \`name\`, \`value\` and \`checked\` props. **A radio button group share a same name.**
37
- <img src="./row-item-how.png" />
38
- `,
39
- },
40
- },
41
- },
42
- argTypes: {
43
- children: {
44
- control: {
45
- type: 'text',
46
- },
47
- },
48
- icon: {
49
- options: iconsNameArr,
50
- mapping: icons,
51
- control: {
52
- type: 'select',
53
- },
54
- },
55
- },
56
- };
57
-
58
- export default rowItemStories;
59
-
60
- export const Overview = {
61
- render: (args) => (
62
- <Grid rowCols={[1, 3]}>
63
- <Col>
64
- <RowItem type="menu" {...args}>
65
- {args.children}
66
- </RowItem>
67
- <RowItem type="menu" {...args}>
68
- {args.children}
69
- </RowItem>
70
- </Col>
71
- </Grid>
72
- ),
73
- };
74
-
75
- export const IconType = {
76
- render: () => {
77
- const [event, setEvent] = useState({
78
- name: null,
79
- value: null,
80
- });
81
-
82
- const onClick = (e) => {
83
- e.persist();
84
- setEvent({
85
- name: 'Icon RowItem on click',
86
- value: e.target.outerHTML,
87
- });
88
- };
89
-
90
- return (
91
- <Grid rowCols={[1, 3]}>
92
- <Col>
93
- <RowItem
94
- type="menu"
95
- icon={
96
- <ShapeIcon bg="positive" color="white" radius="circle" size="md">
97
- <BoyFace />
98
- </ShapeIcon>
99
- }
100
- color="neutral"
101
- name="eventIcon"
102
- value="1"
103
- onClick={onClick}
104
- >
105
- Row content 1
106
- </RowItem>
107
- <RowItem
108
- type="menu"
109
- icon={
110
- <ShapeIcon bg="positive" color="white" radius="circle" size="md">
111
- <BoyFace />
112
- </ShapeIcon>
113
- }
114
- color="secondary"
115
- name="eventIcon"
116
- value="2"
117
- onClick={onClick}
118
- >
119
- Row content 2
120
- </RowItem>
121
- <RowItem
122
- type="menu"
123
- icon={
124
- <ShapeIcon bg="positive" color="white" radius="circle" size="md">
125
- <BoyFace />
126
- </ShapeIcon>
127
- }
128
- color="primary"
129
- name="eventIcon"
130
- value="3"
131
- onClick={onClick}
132
- >
133
- Row content 3
134
- </RowItem>
135
- </Col>
136
- <Col>
137
- <div>
138
- <h3>Event name:</h3>
139
- <div>{event.name}</div>
140
- <h3>Event Value:</h3>
141
- <div>{event.value}</div>
142
- </div>
143
- </Col>
144
- </Grid>
145
- );
146
- },
147
-
148
- parameters: {
149
- docs: {
150
- description: {
151
- story: 'Show how to use onClick event with ICON type',
152
- },
153
- },
154
- },
155
- };
156
-
157
- export const RadioType = {
158
- render: () => {
159
- const [event, setEvent] = useState({
160
- name: null,
161
- value: null,
162
- });
163
-
164
- const [selected, setSelected] = useState({
165
- value: null,
166
- checked: null,
167
- });
168
-
169
- const onChange = (e) => {
170
- setSelected(e);
171
- setEvent({
172
- name: 'RowItem Radio Value',
173
- value: e.value,
174
- });
175
- };
176
-
177
- return (
178
- <Grid rowCols={[1, 3]}>
179
- <Col>
180
- <RowItem
181
- type="radio"
182
- checked={selected.value === '1'}
183
- name="eventRadio"
184
- value="1"
185
- onChange={onChange}
186
- >
187
- Row content 1
188
- </RowItem>
189
- <RowItem
190
- type="radio"
191
- checked={selected.value === '2'}
192
- name="eventRadio"
193
- value="2"
194
- onChange={onChange}
195
- >
196
- Row content 2
197
- </RowItem>
198
- <RowItem
199
- type="radio"
200
- checked={selected.value === '3'}
201
- name="eventRadio"
202
- value="3"
203
- onChange={onChange}
204
- >
205
- Row content 3
206
- </RowItem>
207
- </Col>
208
- <Col>
209
- <div>
210
- <h3>Event name:</h3>
211
- <div>{event.name}</div>
212
- <h3>Event Value:</h3>
213
- <div>{selected.value}</div>
214
- </div>
215
- </Col>
216
- </Grid>
217
- );
218
- },
219
-
220
- parameters: {
221
- docs: {
222
- description: {
223
- story: 'Show how to use onClick event with RADIO type',
224
- },
225
- },
226
- },
227
- };
228
-
229
- export const CheckboxType = {
230
- render: () => {
231
- const [event, setEvent] = useState({
232
- name: null,
233
- value: [],
234
- });
235
- const [selected, setSelected] = useState([]);
236
-
237
- const onChange = (e) => {
238
- const { value } = e;
239
- const tempArr = selected;
240
- let tempRes = [];
241
- if (tempArr.includes(value)) {
242
- tempRes = tempArr.filter((val) => val !== value);
243
- setSelected(tempRes);
244
- } else {
245
- tempArr.push(value);
246
- tempRes = [...tempArr];
247
- setSelected(tempRes);
248
- }
249
- setEvent({
250
- name: 'RowItem Checkbox Value',
251
- value: tempRes,
252
- });
253
- };
254
-
255
- return (
256
- <Grid rowCols={[1, 3]}>
257
- <Col>
258
- <RowItem
259
- type="checkbox"
260
- checked={selected.includes('1')}
261
- name="eventCheckbox"
262
- value="1"
263
- onChange={onChange}
264
- >
265
- Row content 1
266
- </RowItem>
267
- <RowItem
268
- type="checkbox"
269
- checked={selected.includes('2')}
270
- name="eventCheckbox"
271
- value="2"
272
- onChange={onChange}
273
- >
274
- Row content 2
275
- </RowItem>
276
- <RowItem
277
- type="checkbox"
278
- checked={selected.includes('3')}
279
- name="eventCheckbox"
280
- value="3"
281
- onChange={onChange}
282
- >
283
- Row content 3
284
- </RowItem>
285
- </Col>
286
- <Col>
287
- <div>
288
- <h3>Event name:</h3>
289
- <div>{event.name}</div>
290
- <h3>Event Value:</h3>
291
- <div>{JSON.stringify(selected)}</div>
292
- </div>
293
- </Col>
294
- </Grid>
295
- );
296
- },
297
-
298
- parameters: {
299
- docs: {
300
- description: {
301
- story: 'Show how to use onClick event with CHECKBOX type',
302
- },
303
- },
304
- },
305
- };
306
-
307
- export const BorderVariants = {
308
- render: () => (
309
- <Grid rowCols={[1, 3]}>
310
- <Col>
311
- <RowItem
312
- type="menu"
313
- icon={
314
- <ShapeIcon bg="positive" color="white" radius="circle" size="md">
315
- <BoyFace />
316
- </ShapeIcon>
317
- }
318
- name="borderVar"
319
- value="1"
320
- >
321
- Row with border none
322
- </RowItem>
323
- <RowItem
324
- type="menu"
325
- icon={
326
- <ShapeIcon bg="critical" color="white" radius="circle" size="md">
327
- <BoyFace />
328
- </ShapeIcon>
329
- }
330
- name="borderVar"
331
- value="2"
332
- border="wrap"
333
- >
334
- Row with border wrap
335
- </RowItem>
336
- <RowItem
337
- type="menu"
338
- icon={
339
- <ShapeIcon bg="primary" color="white" radius="circle" size="md">
340
- <BoyFace />
341
- </ShapeIcon>
342
- }
343
- name="borderVar"
344
- value="3"
345
- border="bottom"
346
- >
347
- Row with border bottom
348
- </RowItem>
349
- </Col>
350
- </Grid>
351
- ),
352
-
353
- parameters: {
354
- docs: {
355
- description: {
356
- story: 'Show how to use border',
357
- },
358
- },
359
- },
360
- };
361
-
362
- export const InvertedMode = {
363
- render: () => (
364
- <Grid rowCols={[1, 3]} justify="around">
365
- <Col>
366
- <RowItem
367
- type="menu"
368
- icon={
369
- <ShapeIcon bg="positive" color="white" radius="circle" size="md">
370
- <BoyFace />
371
- </ShapeIcon>
372
- }
373
- name="invertedMode"
374
- value="1"
375
- border="bottom"
376
- >
377
- Menu type without inverted
378
- </RowItem>
379
- <RowItem
380
- type="radio"
381
- icon={
382
- <ShapeIcon bg="critical" color="white" radius="circle" size="md">
383
- <BoyFace />
384
- </ShapeIcon>
385
- }
386
- name="invertedMode"
387
- value="2"
388
- border="bottom"
389
- checked
390
- >
391
- Radio type without inverted
392
- </RowItem>
393
- <RowItem
394
- type="checkbox"
395
- icon={
396
- <ShapeIcon bg="primary" color="white" radius="circle" size="md">
397
- <BoyFace />
398
- </ShapeIcon>
399
- }
400
- name="invertedMode"
401
- value="3"
402
- border="bottom"
403
- checked
404
- >
405
- Checkbox without inverted
406
- </RowItem>
407
- </Col>
408
- <Col>
409
- <RowItem
410
- type="menu"
411
- icon={
412
- <ShapeIcon bg="positive" color="white" radius="circle" size="md">
413
- <BoyFace />
414
- </ShapeIcon>
415
- }
416
- name="invertedMode"
417
- value="1"
418
- border="bottom"
419
- inverted
420
- >
421
- Menu type with inverted
422
- </RowItem>
423
- <RowItem
424
- type="radio"
425
- icon={
426
- <ShapeIcon bg="critical" color="white" radius="circle" size="md">
427
- <BoyFace />
428
- </ShapeIcon>
429
- }
430
- name="invertedMode"
431
- value="2"
432
- border="bottom"
433
- inverted
434
- checked
435
- >
436
- Radio type with inverted
437
- </RowItem>
438
- <RowItem
439
- type="checkbox"
440
- icon={
441
- <ShapeIcon bg="primary" color="white" radius="circle" size="md">
442
- <BoyFace />
443
- </ShapeIcon>
444
- }
445
- name="invertedMode"
446
- value="3"
447
- border="bottom"
448
- inverted
449
- checked
450
- >
451
- Checkbox type with inverted
452
- </RowItem>
453
- </Col>
454
- </Grid>
455
- ),
456
-
457
- parameters: {
458
- docs: {
459
- description: {
460
- story: 'Show how to use inverted mode',
461
- },
462
- },
463
- },
464
- };
465
-
466
- export const SizeAndMultiLine = {
467
- render: () => {
468
- const demoWrapperClass = css`
469
- display: flex;
470
- flex-direction: column;
471
- gap: ${space.sm};
472
- `;
473
- const demoClass = css`
474
- display: flex;
475
- flex-direction: column;
476
- `;
477
- const titleClass = css`
478
- font-size: ${fontSizes.body};
479
- line-height: ${space.md};
480
- `;
481
- const descriptionClass = css`
482
- font-size: ${fontSizes.xs};
483
- line-height: ${space.md};
484
- color: ${colors.textLighter};
485
- `;
486
-
487
- return (
488
- <Grid rowCols={[1, 3]} justify="around">
489
- <Col>
490
- <div className={demoWrapperClass}>
491
- <RowItem type="menu" name="sizeNLine" border="wrap" value="2" size="lg">
492
- Row with Lg size
493
- </RowItem>
494
- <RowItem type="menu" name="sizeNLine" border="wrap" value="3" size="lg">
495
- <div className={demoClass}>
496
- <div className={titleClass}>Lg size row with</div>
497
- <div className={descriptionClass}>A line of description</div>
498
- </div>
499
- </RowItem>
500
- <RowItem
501
- type="menu"
502
- name="sizeNLine"
503
- border="wrap"
504
- value="3"
505
- size="lg"
506
- icon={
507
- <ShapeIcon bg="critical" color="white" radius="circle" size="md">
508
- <BoyFace />
509
- </ShapeIcon>
510
- }
511
- >
512
- <div className={demoClass}>
513
- <div className={titleClass}>Lg size row with a line of description</div>
514
- <div className={descriptionClass}>Along with icon</div>
515
- </div>
516
- </RowItem>
517
- </div>
518
- </Col>
519
- <Col>
520
- <div className={demoWrapperClass}>
521
- <RowItem type="menu" name="sizeNLine" border="wrap" value="1" size="md">
522
- Row with Md size
523
- </RowItem>
524
- <RowItem type="menu" name="sizeNLine" border="wrap" value="3" size="md">
525
- <div className={demoClass}>
526
- <div className={titleClass}>Md size row with</div>
527
- <div className={descriptionClass}>A line of description</div>
528
- </div>
529
- </RowItem>
530
- <RowItem
531
- type="menu"
532
- name="sizeNLine"
533
- border="wrap"
534
- value="3"
535
- size="md"
536
- icon={
537
- <ShapeIcon bg="white" color="critical" radius="circle" size="md">
538
- <BoyFace />
539
- </ShapeIcon>
540
- }
541
- >
542
- <div className={demoClass}>
543
- <div className={titleClass}>Md size row with a line of description</div>
544
- <div className={descriptionClass}>Along with icon</div>
545
- </div>
546
- </RowItem>
547
- </div>
548
- </Col>
549
- </Grid>
550
- );
551
- },
552
-
553
- parameters: {
554
- docs: {
555
- description: {
556
- story: 'Show how to use size and add text with description',
557
- },
558
- },
559
- },
560
- };