@chotot/clad-ui 2.0.0-next.4 → 2.1.0

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 (200) hide show
  1. package/README.md +7 -9
  2. package/dist/components/Announcer/Announcer.stories.d.ts.map +1 -1
  3. package/dist/components/Announcer/Announcer.stories.js +1 -26
  4. package/dist/components/Badge/Badge.d.ts +1 -1
  5. package/dist/components/Badge/Badge.d.ts.map +1 -1
  6. package/dist/components/Badge/Badge.js +34 -24
  7. package/dist/components/Badge/Badge.stories.d.ts.map +1 -1
  8. package/dist/components/Badge/Badge.stories.js +61 -54
  9. package/dist/components/Badge/Badge.styles.d.ts +1 -0
  10. package/dist/components/Badge/Badge.styles.d.ts.map +1 -1
  11. package/dist/components/Badge/Badge.styles.js +17 -8
  12. package/dist/components/Breadcrumbs/BreadcrumbItem.d.ts +6 -0
  13. package/dist/components/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -0
  14. package/dist/components/Breadcrumbs/BreadcrumbItem.js +11 -0
  15. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  16. package/dist/components/Breadcrumbs/Breadcrumbs.js +7 -25
  17. package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -11
  18. package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
  19. package/dist/components/Breadcrumbs/Breadcrumbs.stories.js +47 -96
  20. package/dist/components/Button/Button.d.ts +8 -17
  21. package/dist/components/Button/Button.d.ts.map +1 -1
  22. package/dist/components/Button/Button.js +5 -3
  23. package/dist/components/Button/Button.stories.d.ts +78 -4
  24. package/dist/components/Button/Button.stories.d.ts.map +1 -1
  25. package/dist/components/Button/Button.stories.js +105 -11
  26. package/dist/components/Button/Button.styles.d.ts.map +1 -1
  27. package/dist/components/Button/Button.styles.js +30 -11
  28. package/dist/components/Button/GhostButton.d.ts +6 -26
  29. package/dist/components/Button/GhostButton.d.ts.map +1 -1
  30. package/dist/components/Button/GhostButton.js +4 -4
  31. package/dist/components/Button/GhostButton.stories.d.ts +80 -2
  32. package/dist/components/Button/GhostButton.stories.d.ts.map +1 -1
  33. package/dist/components/Button/GhostButton.stories.js +80 -7
  34. package/dist/components/Button/GhostButton.styles.d.ts.map +1 -1
  35. package/dist/components/Button/GhostButton.styles.js +17 -1
  36. package/dist/components/Button/IconButton.d.ts +1 -2
  37. package/dist/components/Button/IconButton.d.ts.map +1 -1
  38. package/dist/components/Button/IconButton.js +2 -7
  39. package/dist/components/Button/IconButton.stories.d.ts +75 -3
  40. package/dist/components/Button/IconButton.stories.d.ts.map +1 -1
  41. package/dist/components/Button/IconButton.stories.js +74 -7
  42. package/dist/components/Button/constant.d.ts +10 -0
  43. package/dist/components/Button/constant.d.ts.map +1 -0
  44. package/dist/components/Button/constant.js +21 -0
  45. package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -10
  46. package/dist/components/Checkbox/Checkbox.stories.d.ts.map +1 -1
  47. package/dist/components/Checkbox/Checkbox.stories.js +1 -34
  48. package/dist/components/Chip/Chip.stories.js +1 -1
  49. package/dist/components/CurrencyInput/CurrencyInput.stories.js +1 -1
  50. package/dist/components/DatePicker/DatePicker.d.ts +4 -0
  51. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  52. package/dist/components/DatePicker/DatePicker.js +4 -1
  53. package/dist/components/DatePicker/DatePicker.stories.d.ts +1 -0
  54. package/dist/components/DatePicker/DatePicker.stories.d.ts.map +1 -1
  55. package/dist/components/Dropdown/Dropdown.d.ts.map +1 -1
  56. package/dist/components/Dropdown/Dropdown.js +5 -0
  57. package/dist/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
  58. package/dist/components/Dropdown/Dropdown.styles.js +27 -3
  59. package/dist/components/Input/Input.d.ts +1 -1
  60. package/dist/components/Input/Input.d.ts.map +1 -1
  61. package/dist/components/Input/Input.js +17 -15
  62. package/dist/components/Input/Input.stories.js +1 -1
  63. package/dist/components/Pagination/PageItem.d.ts +6 -11
  64. package/dist/components/Pagination/PageItem.d.ts.map +1 -1
  65. package/dist/components/Pagination/PageItem.js +11 -5
  66. package/dist/components/Pagination/Pagination.stories.d.ts +0 -3
  67. package/dist/components/Pagination/Pagination.stories.d.ts.map +1 -1
  68. package/dist/components/Pagination/Pagination.stories.js +5 -15
  69. package/dist/components/Popover/Popover.stories.d.ts.map +1 -1
  70. package/dist/components/Popover/Popover.stories.js +1 -0
  71. package/dist/components/RadioButton/RadioButton.stories.d.ts +0 -10
  72. package/dist/components/RadioButton/RadioButton.stories.d.ts.map +1 -1
  73. package/dist/components/RadioButton/RadioButton.stories.js +1 -38
  74. package/dist/components/RowItem/RowItem.d.ts.map +1 -1
  75. package/dist/components/RowItem/RowItem.js +3 -6
  76. package/dist/components/RowItem/RowItem.stories.d.ts.map +1 -1
  77. package/dist/components/RowItem/RowItem.stories.js +1 -2
  78. package/dist/components/Slider/Slider.stories.js +1 -1
  79. package/dist/components/Snack/Snack.stories.js +1 -1
  80. package/dist/components/Tabs/Tab.d.ts +7 -14
  81. package/dist/components/Tabs/Tab.d.ts.map +1 -1
  82. package/dist/components/Tabs/Tab.js +6 -9
  83. package/dist/components/Tabs/Tabs.stories.d.ts +3 -3
  84. package/dist/components/Tabs/Tabs.stories.d.ts.map +1 -1
  85. package/dist/components/Tabs/Tabs.stories.js +32 -10
  86. package/dist/components/Tabs/Tabs.styles.js +1 -1
  87. package/dist/components/TextArea/TextArea.d.ts +1 -1
  88. package/dist/components/TextArea/TextArea.stories.js +1 -1
  89. package/dist/components/TextLabel/TextLabel.stories.js +1 -1
  90. package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
  91. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  92. package/dist/components/Tooltip/Tooltip.js +2 -1
  93. package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
  94. package/dist/components/Tooltip/Tooltip.stories.js +1 -30
  95. package/dist/components/index.d.ts +2 -0
  96. package/dist/components/index.d.ts.map +1 -1
  97. package/dist/components/index.js +1 -0
  98. package/dist/index.d.ts +4 -0
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +4 -0
  101. package/dist/patterns/Drawer/Drawer.d.ts +1 -0
  102. package/dist/patterns/Drawer/Drawer.d.ts.map +1 -1
  103. package/dist/patterns/Drawer/Drawer.js +7 -16
  104. package/dist/patterns/Drawer/Drawer.stories.d.ts +6 -0
  105. package/dist/patterns/Drawer/Drawer.stories.d.ts.map +1 -1
  106. package/dist/patterns/Drawer/Drawer.stories.js +23 -24
  107. package/dist/patterns/Drawer/Drawer.styles.d.ts +1 -2
  108. package/dist/patterns/Drawer/Drawer.styles.d.ts.map +1 -1
  109. package/dist/patterns/Drawer/Drawer.styles.js +1 -6
  110. package/dist/patterns/EmptyState/EmptyState.d.ts +1 -1
  111. package/dist/patterns/EmptyState/EmptyState.d.ts.map +1 -1
  112. package/dist/patterns/EmptyState/EmptyState.js +52 -47
  113. package/dist/patterns/EmptyState/EmptyState.stories.d.ts +11 -1
  114. package/dist/patterns/EmptyState/EmptyState.stories.d.ts.map +1 -1
  115. package/dist/patterns/EmptyState/EmptyState.stories.js +51 -12
  116. package/dist/patterns/EmptyState/EmptyState.styles.d.ts +3 -15
  117. package/dist/patterns/EmptyState/EmptyState.styles.d.ts.map +1 -1
  118. package/dist/patterns/EmptyState/EmptyState.styles.js +23 -40
  119. package/dist/patterns/InputGroup/InputGroup.d.ts +1 -1
  120. package/dist/patterns/InputGroup/InputGroup.styles.d.ts.map +1 -1
  121. package/dist/patterns/InputGroup/InputGroup.styles.js +3 -2
  122. package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.d.ts +1 -1
  123. package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.d.ts.map +1 -1
  124. package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.js +4 -0
  125. package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.stories.js +1 -1
  126. package/dist/patterns/Popup/Popup.d.ts +1 -0
  127. package/dist/patterns/Popup/Popup.d.ts.map +1 -1
  128. package/dist/patterns/Popup/Popup.js +6 -15
  129. package/dist/patterns/Popup/Popup.stories.d.ts +6 -0
  130. package/dist/patterns/Popup/Popup.stories.d.ts.map +1 -1
  131. package/dist/patterns/Popup/Popup.stories.js +29 -30
  132. package/dist/patterns/Popup/Popup.styles.d.ts +1 -2
  133. package/dist/patterns/Popup/Popup.styles.d.ts.map +1 -1
  134. package/dist/patterns/Popup/Popup.styles.js +1 -6
  135. package/dist/patterns/RangeInput/RangeInput.d.ts +30 -0
  136. package/dist/patterns/RangeInput/RangeInput.d.ts.map +1 -0
  137. package/dist/patterns/RangeInput/RangeInput.js +27 -0
  138. package/dist/patterns/RangeInput/RangeInput.stories.d.ts +68 -0
  139. package/dist/patterns/RangeInput/RangeInput.stories.d.ts.map +1 -0
  140. package/dist/patterns/RangeInput/RangeInput.stories.js +121 -0
  141. package/dist/patterns/RangeInput/RangeInput.styles.d.ts +5 -0
  142. package/dist/patterns/RangeInput/RangeInput.styles.d.ts.map +1 -0
  143. package/dist/patterns/RangeInput/RangeInput.styles.js +32 -0
  144. package/dist/patterns/SearchInput/SearchInput.d.ts +1 -1
  145. package/dist/patterns/SearchInput/SearchInput.d.ts.map +1 -1
  146. package/dist/patterns/SearchInput/SearchInput.js +7 -8
  147. package/dist/patterns/SearchInput/SearchInput.stories.d.ts.map +1 -1
  148. package/dist/patterns/SearchInput/SearchInput.stories.js +1 -3
  149. package/dist/patterns/Searchbar/Searchbar.d.ts +28 -0
  150. package/dist/patterns/Searchbar/Searchbar.d.ts.map +1 -0
  151. package/dist/patterns/Searchbar/Searchbar.js +37 -0
  152. package/dist/patterns/Searchbar/Searchbar.stories.d.ts +70 -0
  153. package/dist/patterns/Searchbar/Searchbar.stories.d.ts.map +1 -0
  154. package/dist/patterns/Searchbar/Searchbar.stories.js +80 -0
  155. package/dist/patterns/Searchbar/Searchbar.styles.d.ts +3 -0
  156. package/dist/patterns/Searchbar/Searchbar.styles.d.ts.map +1 -0
  157. package/dist/patterns/Searchbar/Searchbar.styles.js +48 -0
  158. package/dist/patterns/TagCloud/TagCloud.d.ts +1 -1
  159. package/dist/patterns/TagCloud/TagCloud.stories.d.ts.map +1 -1
  160. package/dist/patterns/TagCloud/TagCloud.stories.js +1 -5
  161. package/dist/patterns/index.d.ts +4 -0
  162. package/dist/patterns/index.d.ts.map +1 -1
  163. package/dist/patterns/index.js +2 -0
  164. package/dist/storybook/ColorFoundationList.js +2 -2
  165. package/dist/theme/chotot.d.ts +57 -52
  166. package/dist/theme/chotot.d.ts.map +1 -1
  167. package/dist/theme/chotot.js +18 -13
  168. package/dist/theme/ct-job.d.ts +56 -51
  169. package/dist/theme/ct-job.d.ts.map +1 -1
  170. package/dist/theme/ct-pty.d.ts +56 -51
  171. package/dist/theme/ct-pty.d.ts.map +1 -1
  172. package/dist/theme/ct-veh.d.ts +57 -52
  173. package/dist/theme/ct-veh.d.ts.map +1 -1
  174. package/dist/theme/ct-veh.js +1 -1
  175. package/dist/theme/mudah.js +1 -1
  176. package/dist/typography/HeaderAnnotation.d.ts +19 -0
  177. package/dist/typography/HeaderAnnotation.d.ts.map +1 -0
  178. package/dist/typography/HeaderAnnotation.js +15 -0
  179. package/dist/typography/index.d.ts +2 -0
  180. package/dist/typography/index.d.ts.map +1 -1
  181. package/dist/typography/index.js +1 -0
  182. package/dist/utils/index.d.ts +1 -0
  183. package/dist/utils/index.js +1 -0
  184. package/dist/utils/scrollLock/index.d.ts +7 -0
  185. package/dist/utils/scrollLock/index.d.ts.map +1 -0
  186. package/dist/utils/scrollLock/index.js +7 -0
  187. package/dist/utils/scrollLock/scrollLock.styles.d.ts +6 -0
  188. package/dist/utils/scrollLock/scrollLock.styles.d.ts.map +1 -0
  189. package/dist/utils/scrollLock/scrollLock.styles.js +9 -0
  190. package/dist/utils/scrollLock/useBodyScrollLock.d.ts +10 -0
  191. package/dist/utils/scrollLock/useBodyScrollLock.d.ts.map +1 -0
  192. package/dist/utils/scrollLock/useBodyScrollLock.js +41 -0
  193. package/dist/utils/sx.d.ts +8 -8
  194. package/dist/utils/types.d.ts +23 -0
  195. package/dist/utils/types.d.ts.map +1 -0
  196. package/dist/utils/types.js +5 -0
  197. package/package.json +4 -3
  198. package/dist/storybook/GuideImage.d.ts +0 -9
  199. package/dist/storybook/GuideImage.d.ts.map +0 -1
  200. package/dist/storybook/GuideImage.js +0 -40
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <!-- badges -->
2
2
 
3
- [<img src="https://img.shields.io/badge/clad--ui-2.0.0--next.4-FFBA00" alt="clad-ui npm version" />](http://npmjs.cmco.io/-/web/detail/clad-ui)
3
+ [<img src="https://img.shields.io/badge/clad--ui-2.1.0-FFBA00" alt="clad-ui npm version" />](http://npmjs.cmco.io/-/web/detail/clad-ui)
4
4
  [<img src="https://img.shields.io/badge/@clad--ui/charts-1.0.2-FFBA00" alt="@clad-ui/charts npm version" />](http://npmjs.cmco.io/-/web/detail/clad-ui)
5
5
  [<img src="https://img.shields.io/badge/react-%3E=16.8-0088CC" alt="React dependency version" />](https://github.com/facebook/react/)
6
6
  [<img src="https://img.shields.io/badge/linaria-^4.2.10-DE2D68" alt="Linaria dependency version" />](https://github.com/callstack/linaria)
@@ -55,7 +55,7 @@ Maintaining the system:
55
55
  ## Components Status
56
56
 
57
57
  **Date update:**
58
- 2023-02-21
58
+ 2025-07-31
59
59
 
60
60
  | No | Component | Web | iOS | Android |
61
61
  | --- | ------------------------ | ------- | --- | ------- |
@@ -78,7 +78,7 @@ Maintaining the system:
78
78
  | 17 | LegacyDialog | ✅ 1.0+ | | |
79
79
  | 18 | LegacyPopup | ✅ 1.0+ | | |
80
80
  | 19 | MultiSearchDropdown\* | ✅ 1.0+ | | ✅ |
81
- | 20 | Notification | N/A | | ✅ |
81
+ | 20 | Notification | N/A | | ✅ |
82
82
  | 21 | Input/ Input Text | ✅ 1.2+ | ✅ | ✅ |
83
83
  | 22 | InputGroup | ✅ 1.0+ | ✅ | |
84
84
  | 23 | Popup | ✅ 1.2+ | | ✅ |
@@ -95,7 +95,9 @@ Maintaining the system:
95
95
  | 34 | TextLabel | ✅ 1.5+ | ✅ | ✅ |
96
96
  | 35 | ToggleSwitch | ✅ 1.0+ | | ✅ |
97
97
  | 36 | Tooltip | ✅ 1.0+ | ✅ | ✅ |
98
- | 37 | Pagination | 🧪 1.6+ | | |
98
+ | 37 | Pagination | 🧪 1.6+ | | |
99
+ | 38 | InputRange | 🧪 2.1+ | | |
100
+ | 39 | Searchbar | 🧪 2.1+ | | |
99
101
 
100
102
  **Legend:**
101
103
  ✅: stable; 🧪: beta; ⚠️: deprecated; [1.0+]: since this version
@@ -124,11 +126,7 @@ Open browser Devtool (F12) and add following CSS to the `:root` element:
124
126
 
125
127
  ## Frequently Asked Questions
126
128
 
127
- #### 1. Does this design system work with `create-react-app`?
128
-
129
- Yes. Since our solution introduce a custom Babel plugin and Webpack loader, it's not possible to use `clad-ui` with non-configurable `react-scripts`. You have to eject `react-scripts` to be able to customize Babel and webpack config or use [`react-app-rewired`](https://github.com/timarney/react-app-rewired).
130
-
131
- #### 2. Does this design system work with `Next.js` apps?
129
+ #### 1. Does this design system work with `Next.js` apps?
132
130
 
133
131
  Yes. But it requires custom next.js config. Refer to [Chotot Next.js Framework](https://github.com/carousell/ct-next-starterkit/) to see how it's configured.
134
132
 
@@ -1 +1 @@
1
- {"version":3,"file":"Announcer.stories.d.ts","sourceRoot":"","sources":["../../../components/Announcer/Announcer.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAQnD,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDrB,CAAC;AAEF,eAAe,gBAAgB,CAAC;AAOhC,eAAO,MAAM,QAAQ;;CAmBpB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;CAiCxB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;CAoCzB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;CAmB9B,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;CAiFpB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;CAmBtB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;CAsCvB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;CAsBxB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;CAwC9B,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;CAuCtB,CAAC"}
1
+ {"version":3,"file":"Announcer.stories.d.ts","sourceRoot":"","sources":["../../../components/Announcer/Announcer.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDrB,CAAC;AAEF,eAAe,gBAAgB,CAAC;AAOhC,eAAO,MAAM,QAAQ;;CAmBpB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;CA6BxB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;CAoCzB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;CAmB9B,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;CAiFpB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;CAmBtB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;CAsCvB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;CAsBxB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;CAwC9B,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;CAiBtB,CAAC"}
@@ -1,9 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
- import GuideImage from '../../storybook/GuideImage';
3
2
  import Button from '../Button/Button';
4
3
  import Announcer from './Announcer';
5
- import Grid from '../Grid/Grid';
6
- import Col from '../Grid/Col';
7
4
  import { Heart } from '../../icons';
8
5
  const announcerStories = {
9
6
  title: 'Components/Announcer',
@@ -14,7 +11,7 @@ const announcerStories = {
14
11
  description: {
15
12
  component: `Announcer box is used to displayed system messages, which can be dismissed.
16
13
 
17
- \`✅ Stable\` [\`🎨 Figma Specs\`](https://www.figma.com/file/sPjl33KoaW0bKVZOmm66iQ/CHOTOT-Design-System?node-id=17176%3A31672&t=KSxcQ4tweTEzgFwq-4)
14
+ \`✅ Stable\` [\`🎨 Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=38-11659&t=hz8QJLqNrGvTVY8R-4)
18
15
 
19
16
  ## How to use
20
17
 
@@ -290,29 +287,7 @@ export const UsageGuide = {
290
287
  On mobile viewport, when Announcer description (a.k.a children or dangerousHtml prop) number
291
288
  of line is more than 4, it will be truncated into 2 with an expand button.
292
289
  </p>
293
- <GuideImage src="./announcer-collapsed.png" alt="Announcer - Collapsed"/>
294
290
  <br />
295
- <h4>DO&apos;s</h4>
296
- <Grid rowCols={[1, 1, 2]} gutterx="sm" align="center">
297
- <Col>
298
- <GuideImage isGood src="./announcer-do-1.png" alt="Announcer - Do_1"/>
299
- </Col>
300
- <Col>
301
- <GuideImage isGood src="./announcer-do-2.png" alt="Announcer - Do_2"/>
302
- </Col>
303
- </Grid>
304
- <br />
305
- <h4>DON&apos;Ts</h4>
306
- <Grid rowCols={[1, 1, 2]} gutterx="sm" align="center">
307
- <Col>
308
- <GuideImage isBad src="./announcer-dont-1.png" alt="Announcer - Dont_1"/>
309
- <p>Wrong icon as well as background-color.</p>
310
- </Col>
311
- <Col>
312
- <GuideImage isBad src="./announcer-dont-2.png" alt="Announcer - Dont_2"/>
313
- <p>Wrong color on both regular Announcer and empty state Announcer.</p>
314
- </Col>
315
- </Grid>
316
291
  </>),
317
292
  parameters: {
318
293
  docs: {
@@ -3,7 +3,7 @@ export interface BadgeProps {
3
3
  /**
4
4
  * Size of Badge
5
5
  */
6
- size?: 'md' | 'sm';
6
+ size?: 'lg' | 'md' | 'sm';
7
7
  /**
8
8
  * Badge Label
9
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,eAAe,CAAC,EACZ,QAAQ,GACR,SAAS,GACT,UAAU,GACV,MAAM,GACN,SAAS,GACT,UAAU,GACV,SAAS,GACT,WAAW,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,CAAC;IAC5C;;OAEG;IACH,YAAY,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC7E;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AAEH,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA+E/B,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,eAAe,CAAC,EACZ,QAAQ,GACR,SAAS,GACT,UAAU,GACV,MAAM,GACN,SAAS,GACT,UAAU,GACV,SAAS,GACT,WAAW,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,CAAC;IAC5C;;OAEG;IACH,YAAY,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC7E;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AAEH,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA0F/B,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1,35 +1,38 @@
1
1
  import * as React from 'react';
2
2
  import theme from '@clad-ui/theme';
3
- import { badgeSizeSmallClass, badgeSizeMediumClass, StyledBadgeWrapper, StyledBadge, } from './Badge.styles';
3
+ import { badgeSizeSmallClass, badgeSizeLargeClass, badgeSizeMediumClass, StyledBadgeWrapper, StyledBadge, } from './Badge.styles';
4
4
  const { radii } = theme;
5
+ const { useMemo } = React;
5
6
  /**
6
7
  * Badge Component for menus and notifications
7
8
  *
8
9
  * `✅ Stable`
9
10
  */
10
- const Badge = ({ size = 'sm', children = 'Default Badge Children', label = '', backgroundColor = 'primary', position = 'topRight', zIndex = 1, borderRadius = 'none', }) => {
11
- const badgePosition = ((_position) => {
12
- switch (_position) {
11
+ const Badge = ({ size = 'sm', children = 'Default Badge Children', label = '', backgroundColor = 'primary', position = 'topRight', zIndex = 1, borderRadius: borderRadiusProp = 'none', }) => {
12
+ const badgePosition = useMemo(() => {
13
+ const positionValue = { sm: '8px', md: '8px', lg: '10px' }[size] || '8px';
14
+ switch (position) {
15
+ // Keep legacy behavior for right position
16
+ case 'right':
17
+ return {
18
+ top: '50%',
19
+ left: 'unset',
20
+ right: `-${positionValue}`,
21
+ transform: 'translateX(100%) translateY(-50%)',
22
+ };
13
23
  case 'topRight':
14
24
  return {
15
- top: '-8px',
25
+ top: `-${positionValue}`,
16
26
  left: 'unset',
17
- right: '0',
18
- transform: 'translateX(50%)',
27
+ right: `-${positionValue}`,
28
+ transform: 'unset',
19
29
  };
20
30
  case 'topLeft':
21
31
  return {
22
- top: '-8px',
23
- left: '0',
32
+ top: `-${positionValue}`,
33
+ left: `-${positionValue}`,
24
34
  right: 'unset',
25
- transform: 'translateX(-50%)',
26
- };
27
- case 'right':
28
- return {
29
- top: '50%',
30
- left: 'unset',
31
- right: '-8px',
32
- transform: 'translateX(100%) translateY(-50%)',
35
+ transform: 'unset',
33
36
  };
34
37
  default:
35
38
  return {
@@ -39,26 +42,33 @@ const Badge = ({ size = 'sm', children = 'Default Badge Children', label = '', b
39
42
  transform: 'unset',
40
43
  };
41
44
  }
42
- })(position);
43
- const badgeSizing = ((_size, _borderRadius) => {
44
- switch (_size) {
45
+ }, [position, size]);
46
+ const badgeSizing = useMemo(() => {
47
+ const borderRadius = borderRadiusProp ? radii[borderRadiusProp] : radii.pill;
48
+ switch (size) {
45
49
  case 'sm':
46
50
  return {
51
+ // Keep legacy behavior for sm size
47
52
  className: badgeSizeSmallClass,
48
- borderRadius: _borderRadius ? radii[_borderRadius] : radii.xs,
53
+ borderRadius,
49
54
  };
50
55
  case 'md':
51
56
  return {
52
57
  className: badgeSizeMediumClass,
53
- borderRadius: _borderRadius ? radii[_borderRadius] : radii.sm,
58
+ borderRadius,
59
+ };
60
+ case 'lg':
61
+ return {
62
+ className: badgeSizeLargeClass,
63
+ borderRadius,
54
64
  };
55
65
  default:
56
66
  return {
57
67
  className: '',
58
- borderRadius: '',
68
+ borderRadius: radii.pill,
59
69
  };
60
70
  }
61
- })(size, borderRadius);
71
+ }, [size, borderRadiusProp]);
62
72
  const attrs = {
63
73
  backgroundColor,
64
74
  position,
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.stories.d.ts","sourceRoot":"","sources":["../../../components/Badge/Badge.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;CA6Bf,CAAC;AAEF,eAAe,UAAU,CAAC;AAE1B,eAAO,MAAM,QAAQ;;CAiBpB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;CAqCxB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;CA6BzB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;CA+D5B,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;CAqDhC,CAAC"}
1
+ {"version":3,"file":"Badge.stories.d.ts","sourceRoot":"","sources":["../../../components/Badge/Badge.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;CA4Bf,CAAC;AAEF,eAAe,UAAU,CAAC;AAE1B,eAAO,MAAM,QAAQ;;CAiBpB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;CA6CxB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;CA6BzB,CAAC;AAuBF,eAAO,MAAM,gBAAgB;;;;;;;;;CA2C5B,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;CAqDhC,CAAC"}
@@ -15,7 +15,7 @@ const badgeStory = {
15
15
  description: {
16
16
  component: `Badge Component for menus and notifications
17
17
 
18
- \`✅ Stable\` [\`🎨 Figma Specs\`](https://www.figma.com/file/sPjl33KoaW0bKVZOmm66iQ/CHOTOT-Design-System?node-id=17176%3A39136&t=EPNuQtKvlw2DSxrI-4)
18
+ \`✅ Stable\` [\`🎨 Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=42-33055&t=hz8QJLqNrGvTVY8R-4)
19
19
 
20
20
  ## How to use
21
21
  Badge component is a static components which usually use in draw attention or supply count for some notification components
@@ -26,7 +26,6 @@ const badgeStory = {
26
26
  - Badge use \`string\` for color which mean \`Hex\` color or \`string\` or \`color from themes\` are all usable
27
27
  \`Example (red, #fcfcfc, theme.colors.orange2)\`
28
28
 
29
- <img src="./badge-how-to.png" />
30
29
  `,
31
30
  },
32
31
  },
@@ -72,11 +71,19 @@ export const SizeVariants = {
72
71
  <Col>
73
72
  Medium size:
74
73
  <div style={{ marginTop: '24px' }}>
75
- <Badge size="md" label="999">
74
+ <Badge size="md" label="9">
76
75
  <Button color="tertiary"> md Input</Button>
77
76
  </Badge>
78
77
  </div>
79
78
  </Col>
79
+ <Col>
80
+ Large size:
81
+ <div style={{ marginTop: '24px' }}>
82
+ <Badge size="lg" label="999">
83
+ <Button color="tertiary"> lg Input</Button>
84
+ </Badge>
85
+ </div>
86
+ </Col>
80
87
  </Grid>),
81
88
  parameters: {
82
89
  docs: {
@@ -99,7 +106,7 @@ export const ColorVariants = {
99
106
  <Col>
100
107
  With color input:
101
108
  <div style={{ marginTop: '24px' }}>
102
- <Badge backgroundColor="critical" label="critical">
109
+ <Badge backgroundColor="info" label="info">
103
110
  <Button color="primary"> With color input </Button>
104
111
  </Badge>
105
112
  </div>
@@ -113,59 +120,59 @@ export const ColorVariants = {
113
120
  },
114
121
  },
115
122
  };
123
+ const demoWrapperClass = css `
124
+ display: flex;
125
+ flex-direction: column;
126
+ gap: ${space.sm};
127
+ `;
128
+ const demoBorderedClass = css `
129
+ display: flex;
130
+ flex-direction: column;
131
+ border: 1px solid ${colors.borderRegular};
132
+ padding: 8px;
133
+ `;
134
+ const titleClass = css `
135
+ font-size: ${fontSizes.body};
136
+ line-height: ${space.md};
137
+ `;
138
+ const descriptionClass = css `
139
+ font-size: ${fontSizes.xs};
140
+ line-height: ${space.md};
141
+ color: ${colors.textTertiary};
142
+ `;
116
143
  export const PositionVariants = {
117
- render: () => {
118
- const demoWrapperClass = css `
119
- display: flex;
120
- flex-direction: column;
121
- gap: ${space.sm};
122
- `;
123
- const demoClass = css `
124
- display: flex;
125
- flex-direction: column;
126
- `;
127
- const demoBorderedClass = css `
128
- display: flex;
129
- flex-direction: column;
130
- border: 1px solid ${colors.borderRegular};
131
- padding: 8px;
132
- `;
133
- const titleClass = css `
134
- font-size: ${fontSizes.body};
135
- line-height: ${space.md};
136
- `;
137
- const descriptionClass = css `
138
- font-size: ${fontSizes.xs};
139
- line-height: ${space.md};
140
- color: ${colors.textTertiary};
141
- `;
142
- return (<Grid rowCols={[1, 3]} justify="between">
143
- <Col>
144
- <div className={demoWrapperClass}>
145
- <Badge position="right" label="Mới">
146
- <div className={demoClass}>
147
- <div className={titleClass}>Vật dụng gì đó</div>
148
- <div className={descriptionClass}>Position: right</div>
149
- </div>
150
- </Badge>
144
+ render: () => (<Grid>
145
+ <Col>
146
+ <div className={demoWrapperClass}>
147
+ <Badge position="right" label="Mới">
148
+ <div className={titleClass}>Vật dụng gì đó</div>
149
+ <div className={descriptionClass}>Position: right</div>
150
+ </Badge>
151
+ </div>
152
+ </Col>
151
153
 
152
- <Badge position="topRight" label="Mới">
153
- <div className={demoBorderedClass}>
154
- <div className={titleClass}>Vật dụng gì đó</div>
155
- <div className={descriptionClass}>Position: topright</div>
156
- </div>
157
- </Badge>
154
+ <Col>
155
+ <div className={demoWrapperClass}>
156
+ <Badge position="topRight" label="Mới">
157
+ <div className={demoBorderedClass}>
158
+ <div className={titleClass}>Vật dụng gì đó</div>
159
+ <div className={descriptionClass}>Position: topright</div>
160
+ </div>
161
+ </Badge>
162
+ </div>
163
+ </Col>
158
164
 
159
- <Badge position="topLeft" label="Mới">
160
- <div className={demoBorderedClass}>
161
- <div className={titleClass}>Vật dụng gì đó</div>
162
- <div className={descriptionClass}>Position: topleft</div>
163
- </div>
164
- </Badge>
165
- </div>
166
- </Col>
167
- </Grid>);
168
- },
165
+ <Col>
166
+ <div className={demoWrapperClass}>
167
+ <Badge position="topLeft" label="Mới">
168
+ <div className={demoBorderedClass}>
169
+ <div className={titleClass}>Vật dụng gì đó</div>
170
+ <div className={descriptionClass}>Position: topleft</div>
171
+ </div>
172
+ </Badge>
173
+ </div>
174
+ </Col>
175
+ </Grid>),
169
176
  parameters: {
170
177
  docs: {
171
178
  description: {
@@ -1,5 +1,6 @@
1
1
  export declare const badgeSizeSmallClass: import("@linaria/core").LinariaClassName;
2
2
  export declare const badgeSizeMediumClass: import("@linaria/core").LinariaClassName;
3
+ export declare const badgeSizeLargeClass: import("@linaria/core").LinariaClassName;
3
4
  export declare const StyledBadgeWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
4
5
  as?: import("react").ElementType;
5
6
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.styles.d.ts","sourceRoot":"","sources":["../../../components/Badge/Badge.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB,0CAQ/B,CAAC;AACF,eAAO,MAAM,oBAAoB,0CAQhC,CAAC;AACF,eAAO,MAAM,kBAAkB;;EAI9B,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,WAAW;YACd,MAAM;qBACG,MAAM;mBACR;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;KACnB;iBACY;QACX,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;KACnB;;;EAiBF,CAAC"}
1
+ {"version":3,"file":"Badge.styles.d.ts","sourceRoot":"","sources":["../../../components/Badge/Badge.styles.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB,0CAO/B,CAAC;AAEF,eAAO,MAAM,oBAAoB,0CAOhC,CAAC;AACF,eAAO,MAAM,mBAAmB,0CAO/B,CAAC;AACF,eAAO,MAAM,kBAAkB;;EAI9B,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,WAAW;YACd,MAAM;qBACG,MAAM;mBACR;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;KACnB;iBACY;QACX,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;KACnB;;;EAmBF,CAAC"}
@@ -1,24 +1,31 @@
1
1
  import { css } from '@linaria/core';
2
2
  import { styled } from '@linaria/react';
3
3
  import theme from '@clad-ui/theme';
4
- const { fontSizes, colors, typo, space } = theme;
4
+ const { colors, typo, space } = theme;
5
+ // Keep legacy behavior for sm size
5
6
  export const badgeSizeSmallClass = css `
6
7
  padding: 0 ${space.xxs};
7
8
  height: ${space.md};
8
- font-size: ${fontSizes.xxs};
9
9
  min-width: ${space.md};
10
10
  min-height: ${space.md};
11
- line-height: 6px;
11
+
12
12
  ${typo.body.annotation};
13
13
  `;
14
14
  export const badgeSizeMediumClass = css `
15
15
  padding: 0 ${space.xxs};
16
16
  height: ${space.mdl};
17
- font-size: ${fontSizes.xs};
18
17
  min-width: ${space.mdl};
19
18
  min-height: ${space.mdl};
20
- line-height: 10px;
21
- ${typo.body.caption};
19
+
20
+ ${typo.label.annotation};
21
+ `;
22
+ export const badgeSizeLargeClass = css `
23
+ padding: 0 6px;
24
+ height: ${space.lg};
25
+ min-width: ${space.lg};
26
+ min-height: ${space.lg};
27
+
28
+ ${typo.label.caption};
22
29
  `;
23
30
  export const StyledBadgeWrapper = styled.div `
24
31
  position: relative;
@@ -34,9 +41,11 @@ export const StyledBadge = styled.div `
34
41
  outline-offset: 1px;
35
42
  text-decoration: inherit;
36
43
  position: absolute;
37
- display: block;
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
38
47
  z-index: ${({ zIndex }) => zIndex};
39
- border: 1px solid ${colors.borderBlank};
48
+ border: 2px solid ${colors.borderBlank};
40
49
  color: ${colors.textBlank};
41
50
  background-color: ${({ backgroundColor }) => colors[backgroundColor]};
42
51
  top: ${({ badgePosition }) => badgePosition.top};
@@ -0,0 +1,6 @@
1
+ import { type GhostButtonProps } from '../Button/GhostButton';
2
+ export interface BreadcrumbItemProps extends GhostButtonProps {
3
+ }
4
+ declare const BreadcrumbItem: import("../../utils/types").InternalForwardRefRenderFunction<"a", BreadcrumbItemProps>;
5
+ export default BreadcrumbItem;
6
+ //# sourceMappingURL=BreadcrumbItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BreadcrumbItem.d.ts","sourceRoot":"","sources":["../../../components/Breadcrumbs/BreadcrumbItem.tsx"],"names":[],"mappings":"AAIA,OAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE3E,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;CAAG;AAEhE,QAAA,MAAM,cAAc,wFAelB,CAAC;AAEH,eAAe,cAAc,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { cx } from '../../utils';
3
+ import { labelClass } from './Breadcrumbs.styles';
4
+ import { forwardRef } from '../../utils/types';
5
+ import GhostButton from '../Button/GhostButton';
6
+ const BreadcrumbItem = forwardRef((props, ref) => {
7
+ const { as = 'a', className, ...rest } = props;
8
+ return (<GhostButton className={cx(labelClass, className)} as={as} ref={ref} variant="hyperlink" size="small" weight="normal" color="tertiary" {...rest}/>);
9
+ });
10
+ export default BreadcrumbItem;
11
+ BreadcrumbItem.displayName = 'BreadcrumbItem';
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../components/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA2D/B,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;IAC9C;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAmB3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../components/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;IAC9C;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAwB3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,34 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import { Children, isValidElement } from 'react';
3
3
  import { cx } from '../../utils';
4
- import { StyledBreadcrumbs, Placeholder, labelClass, separatorClass } from './Breadcrumbs.styles';
5
- import ButtonLink from '../Button/ButtonLink';
4
+ import { StyledBreadcrumbs, Placeholder, separatorClass } from './Breadcrumbs.styles';
5
+ import BreadcrumbItem from './BreadcrumbItem';
6
6
  const mapElementToListItem = (element, isLast) => {
7
- // normal <a>
8
- if (element.type === 'a') {
9
- // last element in breadcrumb must not be rendered as <a>
10
- return isLast ? (<span itemProp="name" style={{ marginLeft: '4px' }}>
7
+ if (isLast) {
8
+ return (<span itemProp="name" style={{ marginLeft: '4px' }}>
11
9
  {element.props.children}
12
- </span>) : (<>
13
- <ButtonLink variant="hyperlink" size="small" weight="normal" href={element.props.href} color="tertiary" className={labelClass}>
14
- {element.props.children}
15
- </ButtonLink>
16
- <span className={separatorClass}>/</span>
17
- </>);
10
+ </span>);
18
11
  }
19
- // <a> with wrapper tag
20
- const childrenElement = element.props.children;
21
- if (childrenElement.type !== 'a') {
22
- // not render elements with wrong structure
23
- return null;
24
- }
25
- // last element in breadcrumb must not be rendered as <a>
26
- return isLast ? (<span itemProp="item" style={{ marginLeft: '4px' }}>
27
- {childrenElement.props.children}
28
- </span>) : (<>
29
- <ButtonLink variant="hyperlink" size="small" weight="normal" href={childrenElement.props.href} color="tertiary" className={labelClass}>
30
- {childrenElement.props.children}
31
- </ButtonLink>
12
+ return (<>
13
+ <BreadcrumbItem {...element.props}/>
32
14
  <span className={separatorClass}>/</span>
33
15
  </>);
34
16
  };
@@ -24,17 +24,6 @@ export default breadcrumbsStories;
24
24
  export declare const Overview: {
25
25
  render: (args: any) => JSX.Element;
26
26
  };
27
- export declare const ChildrenWithWrapper: {
28
- render: () => JSX.Element;
29
- name: string;
30
- parameters: {
31
- docs: {
32
- description: {
33
- story: string;
34
- };
35
- };
36
- };
37
- };
38
27
  export declare const WithIsShow: {
39
28
  render: () => JSX.Element;
40
29
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs.stories.d.ts","sourceRoot":"","sources":["../../../components/Breadcrumbs/Breadcrumbs.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AA0BxC,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;CA4CvB,CAAC;AAEF,eAAe,kBAAkB,CAAC;AAElC,eAAO,MAAM,QAAQ;;CAQpB,CAAC;AAqCF,eAAO,MAAM,mBAAmB;;;;;;;;;;CAyB/B,CAAC;AAEF,eAAO,MAAM,UAAU;;;CAmBtB,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;CA2BlC,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;CA2BxB,CAAC"}
1
+ {"version":3,"file":"Breadcrumbs.stories.d.ts","sourceRoot":"","sources":["../../../components/Breadcrumbs/Breadcrumbs.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;CA0CvB,CAAC;AAEF,eAAe,kBAAkB,CAAC;AAElC,eAAO,MAAM,QAAQ;;CAUpB,CAAC;AAEF,eAAO,MAAM,UAAU;;;CAmBtB,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;CAiClC,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;CA4BxB,CAAC"}