@arbor-education/design-system.components 0.6.0 → 0.7.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 (285) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/components/avatar/Avatar.d.ts +1 -1
  3. package/dist/components/avatar/Avatar.d.ts.map +1 -1
  4. package/dist/components/avatar/Avatar.js +1 -1
  5. package/dist/components/avatar/Avatar.js.map +1 -1
  6. package/dist/components/avatar/Avatar.stories.d.ts.map +1 -1
  7. package/dist/components/avatar/Avatar.stories.js +7 -0
  8. package/dist/components/avatar/Avatar.stories.js.map +1 -1
  9. package/dist/components/badge/Badge.d.ts +12 -0
  10. package/dist/components/badge/Badge.d.ts.map +1 -0
  11. package/dist/components/badge/Badge.js +6 -0
  12. package/dist/components/badge/Badge.js.map +1 -0
  13. package/dist/components/badge/Badge.stories.d.ts +10 -0
  14. package/dist/components/badge/Badge.stories.d.ts.map +1 -0
  15. package/dist/components/badge/Badge.stories.js +51 -0
  16. package/dist/components/badge/Badge.stories.js.map +1 -0
  17. package/dist/components/badge/Badge.test.d.ts +2 -0
  18. package/dist/components/badge/Badge.test.d.ts.map +1 -0
  19. package/dist/components/badge/Badge.test.js +23 -0
  20. package/dist/components/badge/Badge.test.js.map +1 -0
  21. package/dist/components/card/Card.js +1 -1
  22. package/dist/components/card/Card.js.map +1 -1
  23. package/dist/components/combobox/Combobox.d.ts +16 -0
  24. package/dist/components/combobox/Combobox.d.ts.map +1 -0
  25. package/dist/components/combobox/Combobox.js +195 -0
  26. package/dist/components/combobox/Combobox.js.map +1 -0
  27. package/dist/components/combobox/Combobox.stories.d.ts +24 -0
  28. package/dist/components/combobox/Combobox.stories.d.ts.map +1 -0
  29. package/dist/components/combobox/Combobox.stories.js +246 -0
  30. package/dist/components/combobox/Combobox.stories.js.map +1 -0
  31. package/dist/components/combobox/Combobox.test.d.ts +2 -0
  32. package/dist/components/combobox/Combobox.test.d.ts.map +1 -0
  33. package/dist/components/combobox/Combobox.test.js +798 -0
  34. package/dist/components/combobox/Combobox.test.js.map +1 -0
  35. package/dist/components/combobox/ComboboxButtonTrigger.d.ts +28 -0
  36. package/dist/components/combobox/ComboboxButtonTrigger.d.ts.map +1 -0
  37. package/dist/components/combobox/ComboboxButtonTrigger.js +64 -0
  38. package/dist/components/combobox/ComboboxButtonTrigger.js.map +1 -0
  39. package/dist/components/combobox/ComboboxListbox.d.ts +44 -0
  40. package/dist/components/combobox/ComboboxListbox.d.ts.map +1 -0
  41. package/dist/components/combobox/ComboboxListbox.js +37 -0
  42. package/dist/components/combobox/ComboboxListbox.js.map +1 -0
  43. package/dist/components/combobox/ComboboxOptionRow.d.ts +23 -0
  44. package/dist/components/combobox/ComboboxOptionRow.d.ts.map +1 -0
  45. package/dist/components/combobox/ComboboxOptionRow.js +27 -0
  46. package/dist/components/combobox/ComboboxOptionRow.js.map +1 -0
  47. package/dist/components/combobox/ComboboxTrigger.d.ts +35 -0
  48. package/dist/components/combobox/ComboboxTrigger.d.ts.map +1 -0
  49. package/dist/components/combobox/ComboboxTrigger.js +15 -0
  50. package/dist/components/combobox/ComboboxTrigger.js.map +1 -0
  51. package/dist/components/combobox/buildListboxDisplayOptions.d.ts +3 -0
  52. package/dist/components/combobox/buildListboxDisplayOptions.d.ts.map +1 -0
  53. package/dist/components/combobox/buildListboxDisplayOptions.js +13 -0
  54. package/dist/components/combobox/buildListboxDisplayOptions.js.map +1 -0
  55. package/dist/components/combobox/buildListboxDisplayOptions.test.d.ts +2 -0
  56. package/dist/components/combobox/buildListboxDisplayOptions.test.d.ts.map +1 -0
  57. package/dist/components/combobox/buildListboxDisplayOptions.test.js +22 -0
  58. package/dist/components/combobox/buildListboxDisplayOptions.test.js.map +1 -0
  59. package/dist/components/combobox/comboboxKeyboardTypes.d.ts +41 -0
  60. package/dist/components/combobox/comboboxKeyboardTypes.d.ts.map +1 -0
  61. package/dist/components/combobox/comboboxKeyboardTypes.js +2 -0
  62. package/dist/components/combobox/comboboxKeyboardTypes.js.map +1 -0
  63. package/dist/components/combobox/highlightLabel.d.ts +10 -0
  64. package/dist/components/combobox/highlightLabel.d.ts.map +1 -0
  65. package/dist/components/combobox/highlightLabel.js +18 -0
  66. package/dist/components/combobox/highlightLabel.js.map +1 -0
  67. package/dist/components/combobox/normaliseComboboxQuery.d.ts +2 -0
  68. package/dist/components/combobox/normaliseComboboxQuery.d.ts.map +1 -0
  69. package/dist/components/combobox/normaliseComboboxQuery.js +2 -0
  70. package/dist/components/combobox/normaliseComboboxQuery.js.map +1 -0
  71. package/dist/components/combobox/types.d.ts +46 -0
  72. package/dist/components/combobox/types.d.ts.map +1 -0
  73. package/dist/components/combobox/types.js +2 -0
  74. package/dist/components/combobox/types.js.map +1 -0
  75. package/dist/components/combobox/useChipSelection.d.ts +11 -0
  76. package/dist/components/combobox/useChipSelection.d.ts.map +1 -0
  77. package/dist/components/combobox/useChipSelection.js +35 -0
  78. package/dist/components/combobox/useChipSelection.js.map +1 -0
  79. package/dist/components/combobox/useComboboxChipKeyboard.d.ts +3 -0
  80. package/dist/components/combobox/useComboboxChipKeyboard.d.ts.map +1 -0
  81. package/dist/components/combobox/useComboboxChipKeyboard.js +103 -0
  82. package/dist/components/combobox/useComboboxChipKeyboard.js.map +1 -0
  83. package/dist/components/combobox/useComboboxChipKeyboard.test.d.ts +2 -0
  84. package/dist/components/combobox/useComboboxChipKeyboard.test.d.ts.map +1 -0
  85. package/dist/components/combobox/useComboboxChipKeyboard.test.js +116 -0
  86. package/dist/components/combobox/useComboboxChipKeyboard.test.js.map +1 -0
  87. package/dist/components/combobox/useComboboxKeyboard.d.ts +4 -0
  88. package/dist/components/combobox/useComboboxKeyboard.d.ts.map +1 -0
  89. package/dist/components/combobox/useComboboxKeyboard.js +68 -0
  90. package/dist/components/combobox/useComboboxKeyboard.js.map +1 -0
  91. package/dist/components/combobox/useComboboxListboxDom.d.ts +11 -0
  92. package/dist/components/combobox/useComboboxListboxDom.d.ts.map +1 -0
  93. package/dist/components/combobox/useComboboxListboxDom.js +15 -0
  94. package/dist/components/combobox/useComboboxListboxDom.js.map +1 -0
  95. package/dist/components/combobox/useComboboxListboxKeyboard.d.ts +3 -0
  96. package/dist/components/combobox/useComboboxListboxKeyboard.d.ts.map +1 -0
  97. package/dist/components/combobox/useComboboxListboxKeyboard.js +143 -0
  98. package/dist/components/combobox/useComboboxListboxKeyboard.js.map +1 -0
  99. package/dist/components/combobox/useComboboxListboxKeyboard.test.d.ts +2 -0
  100. package/dist/components/combobox/useComboboxListboxKeyboard.test.d.ts.map +1 -0
  101. package/dist/components/combobox/useComboboxListboxKeyboard.test.js +152 -0
  102. package/dist/components/combobox/useComboboxListboxKeyboard.test.js.map +1 -0
  103. package/dist/components/combobox/useComboboxPopoverBehavior.d.ts +38 -0
  104. package/dist/components/combobox/useComboboxPopoverBehavior.d.ts.map +1 -0
  105. package/dist/components/combobox/useComboboxPopoverBehavior.js +104 -0
  106. package/dist/components/combobox/useComboboxPopoverBehavior.js.map +1 -0
  107. package/dist/components/combobox/useComboboxState.d.ts +27 -0
  108. package/dist/components/combobox/useComboboxState.d.ts.map +1 -0
  109. package/dist/components/combobox/useComboboxState.js +122 -0
  110. package/dist/components/combobox/useComboboxState.js.map +1 -0
  111. package/dist/components/combobox/useElementWidth.d.ts +2 -0
  112. package/dist/components/combobox/useElementWidth.d.ts.map +1 -0
  113. package/dist/components/combobox/useElementWidth.js +31 -0
  114. package/dist/components/combobox/useElementWidth.js.map +1 -0
  115. package/dist/components/combobox/useVisibleChips.d.ts +21 -0
  116. package/dist/components/combobox/useVisibleChips.d.ts.map +1 -0
  117. package/dist/components/combobox/useVisibleChips.js +59 -0
  118. package/dist/components/combobox/useVisibleChips.js.map +1 -0
  119. package/dist/components/combobox/useVisibleChips.test.d.ts +2 -0
  120. package/dist/components/combobox/useVisibleChips.test.d.ts.map +1 -0
  121. package/dist/components/combobox/useVisibleChips.test.js +81 -0
  122. package/dist/components/combobox/useVisibleChips.test.js.map +1 -0
  123. package/dist/components/dot/Dot.d.ts +8 -0
  124. package/dist/components/dot/Dot.d.ts.map +1 -0
  125. package/dist/components/dot/Dot.js +6 -0
  126. package/dist/components/dot/Dot.js.map +1 -0
  127. package/dist/components/dot/Dot.stories.d.ts +15 -0
  128. package/dist/components/dot/Dot.stories.d.ts.map +1 -0
  129. package/dist/components/dot/Dot.stories.js +25 -0
  130. package/dist/components/dot/Dot.stories.js.map +1 -0
  131. package/dist/components/dot/Dot.test.d.ts +2 -0
  132. package/dist/components/dot/Dot.test.d.ts.map +1 -0
  133. package/dist/components/dot/Dot.test.js +19 -0
  134. package/dist/components/dot/Dot.test.js.map +1 -0
  135. package/dist/components/formField/FormField.d.ts +8 -4
  136. package/dist/components/formField/FormField.d.ts.map +1 -1
  137. package/dist/components/formField/FormField.js +7 -6
  138. package/dist/components/formField/FormField.js.map +1 -1
  139. package/dist/components/formField/FormField.stories.d.ts +1 -0
  140. package/dist/components/formField/FormField.stories.d.ts.map +1 -1
  141. package/dist/components/formField/FormField.stories.js +13 -1
  142. package/dist/components/formField/FormField.stories.js.map +1 -1
  143. package/dist/components/formField/FormField.test.js +10 -0
  144. package/dist/components/formField/FormField.test.js.map +1 -1
  145. package/dist/components/icon/allowedIcons.d.ts +1 -0
  146. package/dist/components/icon/allowedIcons.d.ts.map +1 -1
  147. package/dist/components/icon/allowedIcons.js +2 -1
  148. package/dist/components/icon/allowedIcons.js.map +1 -1
  149. package/dist/components/progress/Progress.stories.d.ts +49 -49
  150. package/dist/components/singleUser/SingleUser.d.ts +15 -0
  151. package/dist/components/singleUser/SingleUser.d.ts.map +1 -0
  152. package/dist/components/singleUser/SingleUser.js +9 -0
  153. package/dist/components/singleUser/SingleUser.js.map +1 -0
  154. package/dist/components/singleUser/SingleUser.stories.d.ts +11 -0
  155. package/dist/components/singleUser/SingleUser.stories.d.ts.map +1 -0
  156. package/dist/components/singleUser/SingleUser.stories.js +52 -0
  157. package/dist/components/singleUser/SingleUser.stories.js.map +1 -0
  158. package/dist/components/singleUser/SingleUser.test.d.ts +2 -0
  159. package/dist/components/singleUser/SingleUser.test.d.ts.map +1 -0
  160. package/dist/components/singleUser/SingleUser.test.js +30 -0
  161. package/dist/components/singleUser/SingleUser.test.js.map +1 -0
  162. package/dist/components/tabs/TabsItem.stories.d.ts +2 -2
  163. package/dist/components/tag/Tag.d.ts +9 -6
  164. package/dist/components/tag/Tag.d.ts.map +1 -1
  165. package/dist/components/tag/Tag.js +8 -2
  166. package/dist/components/tag/Tag.js.map +1 -1
  167. package/dist/components/tag/Tag.stories.d.ts +11 -6
  168. package/dist/components/tag/Tag.stories.d.ts.map +1 -1
  169. package/dist/components/tag/Tag.stories.js +68 -4
  170. package/dist/components/tag/Tag.stories.js.map +1 -1
  171. package/dist/components/tag/Tag.test.js +86 -50
  172. package/dist/components/tag/Tag.test.js.map +1 -1
  173. package/dist/components/toggle/Toggle.d.ts +3 -0
  174. package/dist/components/toggle/Toggle.d.ts.map +1 -0
  175. package/dist/components/toggle/Toggle.js +8 -0
  176. package/dist/components/toggle/Toggle.js.map +1 -0
  177. package/dist/components/toggle/Toggle.stories.d.ts +97 -0
  178. package/dist/components/toggle/Toggle.stories.d.ts.map +1 -0
  179. package/dist/components/toggle/Toggle.stories.js +186 -0
  180. package/dist/components/toggle/Toggle.stories.js.map +1 -0
  181. package/dist/components/toggle/Toggle.test.d.ts +2 -0
  182. package/dist/components/toggle/Toggle.test.d.ts.map +1 -0
  183. package/dist/components/toggle/Toggle.test.js +58 -0
  184. package/dist/components/toggle/Toggle.test.js.map +1 -0
  185. package/dist/index.css +656 -25
  186. package/dist/index.css.map +1 -1
  187. package/dist/index.d.ts +34 -25
  188. package/dist/index.d.ts.map +1 -1
  189. package/dist/index.js +30 -25
  190. package/dist/index.js.map +1 -1
  191. package/dist/mocks/comboboxStoryOptions.d.ts +5 -0
  192. package/dist/mocks/comboboxStoryOptions.d.ts.map +1 -0
  193. package/dist/mocks/comboboxStoryOptions.js +22 -0
  194. package/dist/mocks/comboboxStoryOptions.js.map +1 -0
  195. package/dist/utils/isSelectAllChord.d.ts +5 -0
  196. package/dist/utils/isSelectAllChord.d.ts.map +1 -0
  197. package/dist/utils/isSelectAllChord.js +7 -0
  198. package/dist/utils/isSelectAllChord.js.map +1 -0
  199. package/dist/utils/isSelectAllChord.test.d.ts +2 -0
  200. package/dist/utils/isSelectAllChord.test.d.ts.map +1 -0
  201. package/dist/utils/isSelectAllChord.test.js +19 -0
  202. package/dist/utils/isSelectAllChord.test.js.map +1 -0
  203. package/dist/utils/nextCircularIndex.d.ts +3 -0
  204. package/dist/utils/nextCircularIndex.d.ts.map +1 -0
  205. package/dist/utils/nextCircularIndex.js +10 -0
  206. package/dist/utils/nextCircularIndex.js.map +1 -0
  207. package/dist/utils/nextCircularIndex.test.d.ts +2 -0
  208. package/dist/utils/nextCircularIndex.test.d.ts.map +1 -0
  209. package/dist/utils/nextCircularIndex.test.js +23 -0
  210. package/dist/utils/nextCircularIndex.test.js.map +1 -0
  211. package/dist/utils/scrollElementIntoViewById.d.ts +2 -0
  212. package/dist/utils/scrollElementIntoViewById.d.ts.map +1 -0
  213. package/dist/utils/scrollElementIntoViewById.js +16 -0
  214. package/dist/utils/scrollElementIntoViewById.js.map +1 -0
  215. package/dist/utils/scrollElementIntoViewById.test.d.ts +2 -0
  216. package/dist/utils/scrollElementIntoViewById.test.d.ts.map +1 -0
  217. package/dist/utils/scrollElementIntoViewById.test.js +31 -0
  218. package/dist/utils/scrollElementIntoViewById.test.js.map +1 -0
  219. package/package.json +1 -1
  220. package/src/components/avatar/Avatar.stories.tsx +8 -0
  221. package/src/components/avatar/Avatar.tsx +3 -3
  222. package/src/components/badge/Badge.stories.tsx +74 -0
  223. package/src/components/badge/Badge.test.tsx +28 -0
  224. package/src/components/badge/Badge.tsx +35 -0
  225. package/src/components/badge/badge.scss +86 -0
  226. package/src/components/card/Card.tsx +1 -1
  227. package/src/components/combobox/Combobox.stories.tsx +340 -0
  228. package/src/components/combobox/Combobox.test.tsx +1160 -0
  229. package/src/components/combobox/Combobox.tsx +434 -0
  230. package/src/components/combobox/ComboboxButtonTrigger.tsx +195 -0
  231. package/src/components/combobox/ComboboxListbox.tsx +224 -0
  232. package/src/components/combobox/ComboboxOptionRow.tsx +128 -0
  233. package/src/components/combobox/ComboboxTrigger.tsx +134 -0
  234. package/src/components/combobox/buildListboxDisplayOptions.test.ts +24 -0
  235. package/src/components/combobox/buildListboxDisplayOptions.ts +12 -0
  236. package/src/components/combobox/combobox.scss +390 -0
  237. package/src/components/combobox/comboboxKeyboardTypes.ts +45 -0
  238. package/src/components/combobox/highlightLabel.tsx +42 -0
  239. package/src/components/combobox/normaliseComboboxQuery.ts +1 -0
  240. package/src/components/combobox/types.ts +53 -0
  241. package/src/components/combobox/useChipSelection.ts +53 -0
  242. package/src/components/combobox/useComboboxChipKeyboard.test.tsx +141 -0
  243. package/src/components/combobox/useComboboxChipKeyboard.ts +121 -0
  244. package/src/components/combobox/useComboboxKeyboard.ts +108 -0
  245. package/src/components/combobox/useComboboxListboxDom.ts +36 -0
  246. package/src/components/combobox/useComboboxListboxKeyboard.test.tsx +186 -0
  247. package/src/components/combobox/useComboboxListboxKeyboard.ts +172 -0
  248. package/src/components/combobox/useComboboxPopoverBehavior.ts +179 -0
  249. package/src/components/combobox/useComboboxState.ts +232 -0
  250. package/src/components/combobox/useElementWidth.ts +40 -0
  251. package/src/components/combobox/useVisibleChips.test.tsx +91 -0
  252. package/src/components/combobox/useVisibleChips.ts +100 -0
  253. package/src/components/dot/Dot.stories.tsx +41 -0
  254. package/src/components/dot/Dot.test.tsx +21 -0
  255. package/src/components/dot/Dot.tsx +18 -0
  256. package/src/components/dot/dot.scss +35 -0
  257. package/src/components/formField/FormField.stories.tsx +30 -1
  258. package/src/components/formField/FormField.test.tsx +20 -0
  259. package/src/components/formField/FormField.tsx +11 -5
  260. package/src/components/formField/inputs/number/numberInput.scss +12 -4
  261. package/src/components/icon/allowedIcons.tsx +2 -0
  262. package/src/components/pill/pill.scss +4 -6
  263. package/src/components/singleUser/SingleUser.stories.tsx +63 -0
  264. package/src/components/singleUser/SingleUser.test.tsx +61 -0
  265. package/src/components/singleUser/SingleUser.tsx +45 -0
  266. package/src/components/singleUser/singleUser.scss +14 -0
  267. package/src/components/tag/Tag.stories.tsx +88 -6
  268. package/src/components/tag/Tag.test.tsx +110 -44
  269. package/src/components/tag/Tag.tsx +38 -14
  270. package/src/components/tag/tag.scss +45 -30
  271. package/src/components/toggle/Toggle.stories.tsx +239 -0
  272. package/src/components/toggle/Toggle.test.tsx +66 -0
  273. package/src/components/toggle/Toggle.tsx +12 -0
  274. package/src/components/toggle/toggle.scss +126 -0
  275. package/src/index.scss +5 -0
  276. package/src/index.ts +47 -31
  277. package/src/mocks/comboboxStoryOptions.ts +25 -0
  278. package/src/tokens.scss +33 -4
  279. package/src/utils/isSelectAllChord.test.ts +24 -0
  280. package/src/utils/isSelectAllChord.ts +8 -0
  281. package/src/utils/nextCircularIndex.test.ts +26 -0
  282. package/src/utils/nextCircularIndex.ts +15 -0
  283. package/src/utils/scrollElementIntoViewById.test.ts +38 -0
  284. package/src/utils/scrollElementIntoViewById.ts +20 -0
  285. package/tokens/json/Arbor.json +3828 -3704
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#135](https://github.com/arbor-education/design-system.components/pull/135) [`d02b004`](https://github.com/arbor-education/design-system.components/commit/d02b00496098a69abf0ebdbf79ddd2efd8b59591) Thanks [@danielpeplow](https://github.com/danielpeplow)! - MIS-66716 - Combobox initial build and Tag/Dot API updates
8
+
9
+ Breaking changes:
10
+
11
+ - `Tag` no longer accepts `text`; pass the label as `children`.
12
+ - `Tag` no longer accepts `dotColour`; use `slotStart={<Dot colour="..." />}` instead.
13
+ - `DotColour` should be imported from the package entrypoint or `Components/dot/Dot`, not from `Tag`.
14
+
15
+ - [#138](https://github.com/arbor-education/design-system.components/pull/138) [`fbda9be`](https://github.com/arbor-education/design-system.components/commit/fbda9be94f236ec1f8849c9502c502a5143b1ea5) Thanks [@danielpeplow](https://github.com/danielpeplow)! - MIS-66719 - Initial build of single user
16
+
17
+ **Avatar (consumer-visible DOM, minor release)**
18
+
19
+ - Root element is now a `<span>` instead of a `<div>` so the component can nest correctly in phrasing-only contexts (for example inside `SingleUser`).
20
+ - **Styling:** target `.ds-avatar`; selectors such as `div.ds-avatar` will no longer match.
21
+ - **Snapshots:** tests that assert the root tag name may need updating.
22
+ - Documented for consumers; released as a **minor** per team policy.
23
+
24
+ ### Patch Changes
25
+
26
+ - [#149](https://github.com/arbor-education/design-system.components/pull/149) [`7c4abca`](https://github.com/arbor-education/design-system.components/commit/7c4abcab8e82f0ee48b35565373432c8bd160584) Thanks [@AmeeMorris](https://github.com/AmeeMorris)! - MIS-69108 toggle component
27
+
3
28
  ## 0.6.0
4
29
 
5
30
  ### Minor Changes
@@ -6,6 +6,6 @@ export type AvatarProps = {
6
6
  alt?: string;
7
7
  initials?: string;
8
8
  className?: string;
9
- } & React.HTMLAttributes<HTMLDivElement>;
9
+ } & React.HTMLAttributes<HTMLSpanElement>;
10
10
  export declare const Avatar: (props: AvatarProps) => import("react/jsx-runtime").JSX.Element;
11
11
  //# sourceMappingURL=Avatar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/Avatar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;AAEtE,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAEzC,eAAO,MAAM,MAAM,GAAI,OAAO,WAAW,4CAsDxC,CAAC"}
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/Avatar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;AAEtE,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;AAE1C,eAAO,MAAM,MAAM,GAAI,OAAO,WAAW,4CAsDxC,CAAC"}
@@ -12,6 +12,6 @@ export const Avatar = (props) => {
12
12
  }
13
13
  return (_jsx("span", { className: "ds-avatar__placeholder", "aria-label": alt || 'User avatar', children: _jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "ds-avatar__placeholder-icon", children: _jsx("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) }) }));
14
14
  };
15
- return (_jsx("div", { className: classNames('ds-avatar', `ds-avatar--${size}`, className), ...rest, children: renderContent() }));
15
+ return (_jsx("span", { className: classNames('ds-avatar', `ds-avatar--${size}`, className), ...rest, children: renderContent() }));
16
16
  };
17
17
  //# sourceMappingURL=Avatar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../../../src/components/avatar/Avatar.tsx"],"names":[],"mappings":";A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AAG,GAAG,EAAE,EACR,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,GAAG,KAAK,CAAC;IAEV,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,IAAI,GAAG,EAAE,CAAC;YACR,OAAO,CACL,cACE,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAC,kBAAkB,GAC5B,CACH,CAAC;QACJ,CAAC;QAED,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,CACL,eAAM,SAAS,EAAC,qBAAqB,gBAAa,GAAG,YAClD,QAAQ,GACJ,CACR,CAAC;QACJ,CAAC;QAED,OAAO,CACL,eAAM,SAAS,EAAC,wBAAwB,gBAAa,GAAG,IAAI,aAAa,YACvE,cACE,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,cAAc,EACnB,SAAS,EAAC,6BAA6B,YAEvC,eAAM,CAAC,EAAC,+GAA+G,GAAG,GACtH,GACD,CACR,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,eACE,SAAS,EAAE,UAAU,CACnB,WAAW,EACX,cAAc,IAAI,EAAE,EACpB,SAAS,CACV,KACG,IAAI,YAEP,aAAa,EAAE,GACX,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/Avatar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAU7B,CAAC;AAEF,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAErC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAM1B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAKzB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAStB,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Avatar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/Avatar.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAkB7B,CAAC;AAEF,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAErC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAM1B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAKzB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAStB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -4,6 +4,13 @@ const meta = {
4
4
  title: 'Components/Avatar',
5
5
  component: Avatar,
6
6
  tags: ['autodocs'],
7
+ parameters: {
8
+ docs: {
9
+ description: {
10
+ component: 'Renders a user avatar as a `<span>`',
11
+ },
12
+ },
13
+ },
7
14
  argTypes: {
8
15
  size: {
9
16
  control: 'select',
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.stories.js","sourceR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C,OAAO,EAAC,GAAG,EAAC,iCAAiC,EAAC,GAAG,EAAC,cAAc,GAAG,EAChF,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAC,iCAAiC,EAAC,GAAG,EAAC,eAAe,GAAG,EAClF,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,GAAG,EAAC,iCAAiC,EAAC,GAAG,EAAC,cAAc,GAAG,EAChF,KAAC,MAAM,IAAC,IAAI,EAAC,aAAa,EAAC,GAAG,EAAC,iCAAiC,EAAC,GAAG,EAAC,oBAAoB,GAAG,IACxF,CACP;CACF,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { DotColour } from '../dot/Dot';
2
+ export type BadgeSize = 'sm' | 'md' | 'lg';
3
+ export type BadgeColour = DotColour;
4
+ export type BadgeProps = {
5
+ children: React.ReactNode;
6
+ a11yLabel?: string;
7
+ className?: string;
8
+ size?: BadgeSize;
9
+ colour?: BadgeColour;
10
+ };
11
+ export declare const Badge: ({ children, a11yLabel, className, size, colour, }: BadgeProps) => React.JSX.Element;
12
+ //# sourceMappingURL=Badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/badge/Badge.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC3C,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC;AAEpC,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,mDAMnB,UAAU,KAAG,KAAK,CAAC,GAAG,CAAC,OAczB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import classNames from 'classnames';
3
+ export const Badge = ({ children, a11yLabel, className, size = 'md', colour, }) => {
4
+ return (_jsx("span", { className: classNames('ds-badge', `ds-badge--size-${size}`, colour && `ds-badge--${colour}`, className), "aria-label": a11yLabel, children: a11yLabel ? _jsx("span", { "aria-hidden": "true", children: children }) : children }));
5
+ };
6
+ //# sourceMappingURL=Badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../src/components/badge/Badge.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAcpC,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EACpB,QAAQ,EACR,SAAS,EACT,SAAS,EACT,IAAI,GAAG,IAAI,EACX,MAAM,GACK,EAAqB,EAAE;IAClC,OAAO,CACL,eACE,SAAS,EAAE,UAAU,CACnB,UAAU,EACV,kBAAkB,IAAI,EAAE,EACxB,MAAM,IAAI,aAAa,MAAM,EAAE,EAC/B,SAAS,CACV,gBACW,SAAS,YAEpB,SAAS,CAAC,CAAC,CAAC,8BAAkB,MAAM,YAAE,QAAQ,GAAQ,CAAC,CAAC,CAAC,QAAQ,GAC7D,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Badge } from './Badge';
3
+ declare const meta: Meta<typeof Badge>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Badge>;
6
+ export declare const Count: Story;
7
+ export declare const WithA11yLabel: Story;
8
+ export declare const Sizes: Story;
9
+ export declare const Colours: Story;
10
+ //# sourceMappingURL=Badge.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.stories.d.ts","sourceRoot":"","sources":["../../../src/components/badge/Badge.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAoB,MAAM,SAAS,CAAC;AAYlD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,KAAK,CAQ5B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAC;AAepC,eAAO,MAAM,KAAK,EAAE,KAIoD,CAAC;AAEzE,eAAO,MAAM,aAAa,EAAE,KAK2D,CAAC;AAExF,eAAO,MAAM,KAAK,EAAE,KAQ4C,CAAC;AAEjE,eAAO,MAAM,OAAO,EAAE,KAU0C,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Badge } from './Badge';
3
+ const colours = [
4
+ 'purple',
5
+ 'salmon',
6
+ 'teal',
7
+ 'yellow',
8
+ 'green',
9
+ 'orange',
10
+ 'blue',
11
+ ];
12
+ const meta = {
13
+ tags: ['autodocs'],
14
+ title: 'Components/Badge',
15
+ component: Badge,
16
+ argTypes: {
17
+ size: { control: 'select', options: ['sm', 'md', 'lg'] },
18
+ colour: { control: 'select', options: [undefined, ...colours] },
19
+ },
20
+ };
21
+ export default meta;
22
+ const withDescription = (story, description) => ({
23
+ ...story,
24
+ parameters: {
25
+ ...story.parameters,
26
+ docs: {
27
+ ...story.parameters?.docs,
28
+ description: {
29
+ story: description,
30
+ },
31
+ },
32
+ },
33
+ });
34
+ export const Count = withDescription({
35
+ args: {
36
+ children: '3',
37
+ },
38
+ }, 'Shows the default numeric Badge used for counts and status totals.');
39
+ export const WithA11yLabel = withDescription({
40
+ args: {
41
+ children: '3',
42
+ a11yLabel: '3 selected items',
43
+ },
44
+ }, 'Adds an accessible label when the visual content alone is not descriptive enough.');
45
+ export const Sizes = withDescription({
46
+ render: () => (_jsxs("div", { style: { display: 'flex', gap: '1rem', alignItems: 'center' }, children: [_jsx(Badge, { size: "sm", children: "1" }), _jsx(Badge, { size: "md", children: "2" }), _jsx(Badge, { size: "lg", children: "3" })] })),
47
+ }, 'Compares the small, medium, and large Badge size variants.');
48
+ export const Colours = withDescription({
49
+ render: () => (_jsx("div", { style: { display: 'flex', flexWrap: 'wrap', gap: '0.5rem' }, children: colours.map(c => (_jsx(Badge, { colour: c, size: "md", children: c.slice(0, 1).toUpperCase() }, c))) })),
50
+ }, 'Displays each available Badge colour variant side by side.');
51
+ //# sourceMappingURL=Badge.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.stories.js","sourceRoot":"","sources":["../../../src/components/badge/Badge.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAoB,MAAM,SAAS,CAAC;AAElD,MAAM,OAAO,GAAkB;IAC7B,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;CACP,CAAC;AAEF,MAAM,IAAI,GAAuB;IAC/B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,KAAK;IAChB,QAAQ,EAAE;QACR,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;QACxD,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,GAAG,OAAO,CAAC,EAAE;KAChE;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,eAAe,GAAG,CAAC,KAAY,EAAE,WAAmB,EAAS,EAAE,CAAC,CAAC;IACrE,GAAG,KAAK;IACR,UAAU,EAAE;QACV,GAAG,KAAK,CAAC,UAAU;QACnB,IAAI,EAAE;YACJ,GAAG,KAAK,CAAC,UAAU,EAAE,IAAI;YACzB,WAAW,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
2
+ //# sourceMappingURL=Badge.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.test.d.ts","sourceRoot":"","sources":["../../../src/components/badge/Badge.test.tsx"],"names":[],"mappings":"AACA,OAAO,kCAAkC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render, screen } from '@testing-library/react';
3
+ import '@testing-library/jest-dom/vitest';
4
+ import { describe, expect, test } from 'vitest';
5
+ import { Badge } from './Badge';
6
+ describe('Badge', () => {
7
+ test('renders children text when no a11yLabel is provided', () => {
8
+ render(_jsx(Badge, { children: "3" }));
9
+ expect(screen.getByText('3')).toBeInTheDocument();
10
+ });
11
+ test('uses aria-label and hides visible children from assistive tech when a11yLabel is provided', () => {
12
+ render(_jsx(Badge, { a11yLabel: "3 selected items", children: "3" }));
13
+ const badge = screen.getByLabelText('3 selected items');
14
+ expect(badge).toBeInTheDocument();
15
+ expect(screen.getByText('3')).toHaveAttribute('aria-hidden', 'true');
16
+ });
17
+ test('applies size and colour modifier classes', () => {
18
+ const { container } = render(_jsx(Badge, { size: "sm", colour: "salmon", children: "2" }));
19
+ const el = container.firstChild;
20
+ expect(el).toHaveClass('ds-badge--size-sm', 'ds-badge--salmon');
21
+ });
22
+ });
23
+ //# sourceMappingURL=Badge.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.test.js","sourceRoot":"","sources":["../../../src/components/badge/Badge.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,IAAI,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC/D,MAAM,CAAC,KAAC,KAAK,oBAAU,CAAC,CAAC;QACzB,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,2FAA2F,EAAE,GAAG,EAAE;QACrG,MAAM,CAAC,KAAC,KAAK,IAAC,SAAS,EAAC,kBAAkB,kBAAU,CAAC,CAAC;QACtD,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;QACxD,MAAM,CAAC,KAAK,CAAC,CAAC,iBAAiB,EAAE,CAAC;QAClC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,0CAA0C,EAAE,GAAG,EAAE;QACpD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAC1B,KAAC,KAAK,IAAC,IAAI,EAAC,IAAI,EAAC,MAAM,EAAC,QAAQ,kBAExB,CACT,CAAC;QACF,MAAM,EAAE,GAAG,SAAS,CAAC,UAAyB,CAAC;QAC/C,MAAM,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -26,6 +26,6 @@ export const Card = ({ title, paragraph, icon, iconColor, iconScreenReaderText,
26
26
  if (isCardClickable) {
27
27
  handleKeyDown(e);
28
28
  }
29
- }, "aria-label": "Card", tabIndex: isCardClickable ? 0 : -1, children: _jsxs("div", { className: "ds-card__content", children: [icon && (_jsx(Icon, { name: icon, className: "ds-card__icon-left", screenReaderText: iconScreenReaderText, color: iconColor, size: 24 })), _jsxs("div", { className: "ds-card__text", children: [title && (_jsx("span", { className: "ds-card__title-container", children: title && _jsx("h4", { className: "ds-card__title", children: title }) })), paragraph && _jsx("p", { className: "ds-card__paragraph", children: paragraph }), tagText && _jsx(Tag, { text: tagText, color: tagColor })] }), isCardClickable && (_jsxs(_Fragment, { children: [_jsx(Icon, { name: "chevron-right", className: "ds-card__icon-click", size: 24 }), _jsx(Icon, { name: "arrow-right", className: "ds-card__icon-click", size: 24 })] }))] }) }));
29
+ }, "aria-label": "Card", tabIndex: isCardClickable ? 0 : -1, children: _jsxs("div", { className: "ds-card__content", children: [icon && (_jsx(Icon, { name: icon, className: "ds-card__icon-left", screenReaderText: iconScreenReaderText, color: iconColor, size: 24 })), _jsxs("div", { className: "ds-card__text", children: [title && (_jsx("span", { className: "ds-card__title-container", children: title && _jsx("h4", { className: "ds-card__title", children: title }) })), paragraph && _jsx("p", { className: "ds-card__paragraph", children: paragraph }), tagText && _jsx(Tag, { color: tagColor, children: tagText })] }), isCardClickable && (_jsxs(_Fragment, { children: [_jsx(Icon, { name: "chevron-right", className: "ds-card__icon-click", size: 24 }), _jsx(Icon, { name: "arrow-right", className: "ds-card__icon-click", size: 24 })] }))] }) }));
30
30
  };
31
31
  //# sourceMappingURL=Card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../src/components/card/Card.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAiB,MAAM,oBAAoB,CAAC;AAexD,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EACnB,KAAK,EACL,SAAS,EACT,IAAI,EACJ,SAAS,EACT,oBAAoB,EACpB,OAAO,EACP,SAAS,EACT,QAAQ,EACR,OAAO,EACP,QAAQ,GACE,EAAE,EAAE;IACd,MAAM,WAAW,GAAG,CAAC,CAAgC,EAAE,EAAE;QACvD,IAAI,OAAO,EAAE,CAAC;YACZ,OAA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b,IAAI,eAAe,EAAE,CAAC;gBACpB,WAAW,CAAC,CAAC,CAAC,CAAC;YACjB,CAAC;QACH,CAAC,EACD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;YACf,IAAI,eAAe,EAAE,CAAC;gBACpB,aAAa,CAAC,CAAC,CAAC,CAAC;YACnB,CAAC;QACH,CAAC,gBACU,MAAM,EACjB,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAElC,eAAK,SAAS,EAAC,kBAAkB,aAC9B,IAAI,IAAI,CACP,KAAC,IAAI,IACH,IAAI,EAAE,IAAI,EACV,SAAS,EAAC,oBAAoB,EAC9B,gBAAgB,EAAE,oBAAoB,EACtC,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,EAAE,GACR,CACH,EACD,eAAK,SAAS,EAAC,eAAe,aAC3B,KAAK,IAAI,CACR,eAAM,SAAS,EAAC,0BAA0B,YACvC,KAAK,IAAI,aAAI,SAAS,EAAC,gBAAgB,YAAE,KAAK,GAAM,GAChD,CACR,EACA,SAAS,IAAI,YAAG,SAAS,EAAC,oBAAoB,YAAE,SAAS,GAAK,EAC9D,OAAO,IAAI,KAAC,GAAG,IAAC,KAAK,EAAE,QAAQ,YAAG,OAAO,GAAO,IAC7C,EACL,eAAe,IAAI,CAClB,8BACE,KAAC,IAAI,IACH,IAAI,EAAC,eAAe,EACpB,SAAS,EAAC,qBAAqB,EAC/B,IAAI,EAAE,EAAE,GACR,EACF,KAAC,IAAI,IACH,IAAI,EAAC,aAAa,EAClB,SAAS,EAAC,qBAAqB,EAC/B,IAAI,EAAE,EAAE,GACR,IACD,CACJ,IACG,GACE,CACX,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { ComboboxButtonTrigger } from './ComboboxButtonTrigger';
2
+ import { ComboboxListbox } from './ComboboxListbox';
3
+ import { ComboboxTrigger } from './ComboboxTrigger';
4
+ import type { ComboboxProps } from './types';
5
+ declare const ComboboxRoot: {
6
+ (props: ComboboxProps): React.JSX.Element;
7
+ displayName: string;
8
+ };
9
+ type ComboboxCompound = typeof ComboboxRoot & {
10
+ Trigger: typeof ComboboxTrigger;
11
+ ButtonTrigger: typeof ComboboxButtonTrigger;
12
+ Listbox: typeof ComboboxListbox;
13
+ };
14
+ export declare const Combobox: ComboboxCompound;
15
+ export {};
16
+ //# sourceMappingURL=Combobox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../src/components/combobox/Combobox.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAO7C,QAAA,MAAM,YAAY;YAAW,aAAa,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO;;CAoZ7D,CAAC;AAIF,KAAK,gBAAgB,GAAG,OAAO,YAAY,GAAG;IAC5C,OAAO,EAAE,OAAO,eAAe,CAAC;IAChC,aAAa,EAAE,OAAO,qBAAqB,CAAC;IAC5C,OAAO,EAAE,OAAO,eAAe,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAmB,gBAAgB,CAAC"}
@@ -0,0 +1,195 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import classNames from 'classnames';
3
+ import { Popover } from 'radix-ui';
4
+ import { useCallback, useContext, useId, useMemo, useRef } from 'react';
5
+ import { PopupParentContext } from '../../utils/PopupParentContext';
6
+ import { buildOptionGroups } from './buildListboxDisplayOptions';
7
+ import { ComboboxButtonTrigger } from './ComboboxButtonTrigger';
8
+ import { ComboboxListbox } from './ComboboxListbox';
9
+ import { ComboboxTrigger } from './ComboboxTrigger';
10
+ import { useChipSelection } from './useChipSelection';
11
+ import { useComboboxKeyboard } from './useComboboxKeyboard';
12
+ import { useComboboxListboxDom } from './useComboboxListboxDom';
13
+ import { useComboboxPopoverBehavior } from './useComboboxPopoverBehavior';
14
+ import { useComboboxState } from './useComboboxState';
15
+ const ComboboxRoot = (props) => {
16
+ const { options, multiple = false, value: controlledValue, defaultValue, onValueChange, onSearch, searchType = 'prefix', highlightStringMatches = false, allowCreate = false, onCreateNew, onDeleteCreated, placeholder = 'Select...', disabled = false, dropdownOnFocus = true, triggerVariant = 'input', showDropdownTrigger = true, showSelectionCountBadge = triggerVariant === 'button' && multiple, selectionCountA11yLabel, loading = false, hasError = false, showClearAll = false, clearAllLabel = 'Clear all', renderOption, getTagLabel, id: externalId, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, } = props;
17
+ const generatedId = useId();
18
+ const comboboxId = externalId ?? generatedId;
19
+ const listboxId = `${comboboxId}-listbox`;
20
+ const state = useComboboxState({
21
+ options,
22
+ multiple,
23
+ value: controlledValue,
24
+ defaultValue,
25
+ onValueChange,
26
+ onSearch,
27
+ searchType,
28
+ allowCreate,
29
+ onCreateNew,
30
+ onDeleteCreated,
31
+ disabled,
32
+ });
33
+ const { selectedValues, selectedValuesSet, query, setQuery, isOpen, setIsOpen, highlightIndex, setHighlightIndex, mergedOptions, filteredOptions, createdValuesSet, showCreateRow, totalItems, selectOption, removeValue, clearAll, handleCreate, deleteCreatedOption, openPopover, isAsync, } = state;
34
+ const inputRef = useRef(null);
35
+ const triggerRef = useRef(null);
36
+ const deleteButtonRefs = useRef(new Map());
37
+ const popupParentRef = useContext(PopupParentContext);
38
+ const { listboxRef, getOptionId, scrollHighlightedIntoView } = useComboboxListboxDom({
39
+ comboboxId,
40
+ });
41
+ const { selectedChipValues, selectedChipValuesSet, setSelectedChipValues, clearChipSelection, focusedChipIndex, setFocusedChipIndex, exitChipNav, } = useChipSelection(selectedValues);
42
+ const { shouldRenderPopoverContent, shouldShowPopover, showListboxLoading, handleInputChange, handleTriggerClick, handleInputFocus, handleInputBlur, handleChevronClick, handlePopoverInteractOutside, } = useComboboxPopoverBehavior({
43
+ inputRef,
44
+ triggerRef,
45
+ listboxRef,
46
+ disabled,
47
+ dropdownOnFocus,
48
+ loading,
49
+ onSearch,
50
+ isAsync,
51
+ isOpen,
52
+ setIsOpen,
53
+ setQuery,
54
+ setHighlightIndex,
55
+ openPopover,
56
+ totalItems,
57
+ showCreateRow,
58
+ filteredOptionsLength: filteredOptions.length,
59
+ highlightIndex,
60
+ clearChipSelection,
61
+ exitChipNav,
62
+ triggerContainsInput: triggerVariant === 'input',
63
+ });
64
+ const optionGroups = useMemo(() => buildOptionGroups(filteredOptions), [filteredOptions]);
65
+ const optionIndexMap = useMemo(() => {
66
+ const map = new Map();
67
+ filteredOptions.forEach((opt, i) => map.set(opt.value, i));
68
+ return map;
69
+ }, [filteredOptions]);
70
+ const resolveTagLabel = useCallback((opt) => {
71
+ if (getTagLabel)
72
+ return getTagLabel(opt);
73
+ return opt.tagLabel ?? opt.label;
74
+ }, [getTagLabel]);
75
+ const registerDeleteButton = useCallback((value, node) => {
76
+ if (node) {
77
+ deleteButtonRefs.current.set(value, node);
78
+ }
79
+ else {
80
+ deleteButtonRefs.current.delete(value);
81
+ }
82
+ }, []);
83
+ const focusDeleteButtonForHighlighted = useCallback(() => {
84
+ if (highlightIndex < 0 || highlightIndex >= filteredOptions.length)
85
+ return false;
86
+ const highlightedOption = filteredOptions[highlightIndex];
87
+ if (!highlightedOption || !createdValuesSet.has(highlightedOption.value))
88
+ return false;
89
+ const button = deleteButtonRefs.current.get(highlightedOption.value);
90
+ if (!button)
91
+ return false;
92
+ button.focus();
93
+ return true;
94
+ }, [createdValuesSet, filteredOptions, highlightIndex]);
95
+ const focusInputAtIndex = useCallback((index) => {
96
+ setHighlightIndex(index);
97
+ inputRef.current?.focus();
98
+ }, [setHighlightIndex]);
99
+ const handleDeleteCreatedFromList = useCallback((value, index) => {
100
+ const nextIndex = filteredOptions.length > 1
101
+ ? Math.min(index, filteredOptions.length - 2)
102
+ : -1;
103
+ deleteCreatedOption(value);
104
+ focusInputAtIndex(nextIndex);
105
+ }, [deleteCreatedOption, filteredOptions.length, focusInputAtIndex]);
106
+ const handleDeleteButtonKeyDown = useCallback((e, index) => {
107
+ if (e.key === 'ArrowLeft') {
108
+ e.preventDefault();
109
+ focusInputAtIndex(index);
110
+ }
111
+ else if (e.key === 'Tab' && e.shiftKey) {
112
+ e.preventDefault();
113
+ focusInputAtIndex(index);
114
+ }
115
+ }, [focusInputAtIndex]);
116
+ const handleKeyDown = useComboboxKeyboard({
117
+ inputRef,
118
+ allowCreate,
119
+ clearAll,
120
+ clearChipSelection,
121
+ exitChipNav,
122
+ focusDeleteButtonForHighlighted,
123
+ listboxOptions: filteredOptions,
124
+ focusedChipIndex,
125
+ handleCreate,
126
+ highlightIndex,
127
+ isOpen,
128
+ mergedOptions,
129
+ openPopover,
130
+ query,
131
+ removeValue,
132
+ scrollHighlightedIntoView,
133
+ selectOption,
134
+ selectedChipValues,
135
+ selectedValues,
136
+ setFocusedChipIndex,
137
+ setHighlightIndex,
138
+ setIsOpen,
139
+ setQuery,
140
+ setSelectedChipValues,
141
+ showCreateRow,
142
+ showListboxLoading,
143
+ totalItems,
144
+ });
145
+ const activeDescendant = shouldShowPopover && !showListboxLoading && highlightIndex >= 0
146
+ ? getOptionId(highlightIndex)
147
+ : undefined;
148
+ const selectedChips = useMemo(() => selectedValues
149
+ .map(v => mergedOptions.find(o => o.value === v))
150
+ .filter(Boolean), [selectedValues, mergedOptions]);
151
+ const preventMouseDefault = useCallback((e) => {
152
+ e.preventDefault();
153
+ }, []);
154
+ const renderSearchInputInListbox = triggerVariant === 'button';
155
+ const handlePopoverOpenAutoFocus = useCallback((e) => {
156
+ e.preventDefault();
157
+ if (triggerVariant === 'button') {
158
+ requestAnimationFrame(() => {
159
+ inputRef.current?.focus();
160
+ });
161
+ }
162
+ }, [triggerVariant]);
163
+ const resolvedSelectionCountA11yLabel = useMemo(() => {
164
+ if (!showSelectionCountBadge || selectedValues.length === 0) {
165
+ return undefined;
166
+ }
167
+ if (typeof selectionCountA11yLabel === 'function') {
168
+ return selectionCountA11yLabel(selectedValues.length);
169
+ }
170
+ if (selectionCountA11yLabel) {
171
+ return selectionCountA11yLabel;
172
+ }
173
+ return `${selectedValues.length} selected item${selectedValues.length === 1 ? '' : 's'}`;
174
+ }, [selectedValues.length, selectionCountA11yLabel, showSelectionCountBadge]);
175
+ const handleButtonTriggerKeyDown = useCallback((e) => {
176
+ if (disabled)
177
+ return;
178
+ if (e.key === 'Enter' || e.key === ' ' || e.key === 'ArrowDown') {
179
+ e.preventDefault();
180
+ handleTriggerClick();
181
+ }
182
+ }, [disabled, handleTriggerClick]);
183
+ return (_jsxs("div", { className: classNames('ds-combobox', {
184
+ 'ds-combobox--disabled': disabled,
185
+ 'ds-combobox--error': hasError,
186
+ }), children: [_jsxs(Popover.Root, { open: isOpen, onOpenChange: setIsOpen, children: [triggerVariant === 'input'
187
+ ? (_jsx(ComboboxTrigger, { inputRef: inputRef, triggerRef: triggerRef, comboboxId: comboboxId, listboxId: listboxId, isOpen: isOpen, hasError: hasError, disabled: disabled, placeholder: placeholder, query: query, shouldShowPopover: shouldShowPopover, showListboxLoading: showListboxLoading, activeDescendant: activeDescendant, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, showDropdownTrigger: showDropdownTrigger, selectedChips: selectedChips, selectedChipValuesSet: selectedChipValuesSet, focusedChipIndex: focusedChipIndex, resolveTagLabel: resolveTagLabel, removeValue: removeValue, handleTriggerClick: handleTriggerClick, handleInputChange: handleInputChange, handleInputFocus: handleInputFocus, handleInputBlur: handleInputBlur, handleKeyDown: handleKeyDown, handleChevronClick: handleChevronClick }))
188
+ : (_jsx(ComboboxButtonTrigger, { triggerRef: triggerRef, listboxId: listboxId, isOpen: isOpen, hasError: hasError, disabled: disabled, placeholder: placeholder, ariaLabel: ariaLabel, ariaDescribedBy: ariaDescribedBy, ariaInvalid: ariaInvalid, showDropdownTrigger: showDropdownTrigger, selectedChips: selectedChips, selectedChipValuesSet: selectedChipValuesSet, focusedChipIndex: focusedChipIndex, resolveTagLabel: resolveTagLabel, removeValue: removeValue, handleTriggerClick: handleTriggerClick, handleTriggerKeyDown: handleButtonTriggerKeyDown, handleChevronClick: handleChevronClick, showSelectionCountBadge: showSelectionCountBadge, selectionCountA11yLabel: resolvedSelectionCountA11yLabel })), _jsx(Popover.Portal, { container: popupParentRef.current, children: shouldRenderPopoverContent && (_jsx(Popover.Content, { align: "start", sideOffset: 4, onOpenAutoFocus: handlePopoverOpenAutoFocus, onCloseAutoFocus: e => e.preventDefault(), onInteractOutside: handlePopoverInteractOutside, className: classNames('ds-dropdown__content', 'ds-combobox__popover'), children: _jsx(ComboboxListbox, { listboxRef: listboxRef, listboxId: listboxId, multiple: multiple, ariaLabel: ariaLabel, showListboxLoading: showListboxLoading, optionGroups: optionGroups, optionIndexMap: optionIndexMap, getOptionId: getOptionId, highlightIndex: highlightIndex, setHighlightIndex: setHighlightIndex, query: query, searchType: searchType, highlightStringMatches: highlightStringMatches, renderOption: renderOption, selectedValuesSet: selectedValuesSet, createdValuesSet: createdValuesSet, selectOption: selectOption, deleteCreatedOption: handleDeleteCreatedFromList, handleCreate: handleCreate, showCreateRow: showCreateRow, filteredOptionsLength: filteredOptions.length, preventMouseDefault: preventMouseDefault, renderSearchInputInListbox: renderSearchInputInListbox, inputRef: inputRef, comboboxId: comboboxId, shouldShowPopover: shouldShowPopover, activeDescendant: activeDescendant, ariaDescribedBy: ariaDescribedBy, ariaInvalid: ariaInvalid, placeholder: placeholder, handleInputChange: handleInputChange, handleInputFocus: handleInputFocus, handleInputBlur: handleInputBlur, handleKeyDown: handleKeyDown, registerDeleteButton: registerDeleteButton, handleDeleteButtonKeyDown: handleDeleteButtonKeyDown }) })) })] }), showClearAll && selectedValues.length > 0 && (_jsx("div", { className: "ds-combobox__clear-all-wrapper", children: _jsx("button", { type: "button", className: "ds-combobox__clear-all", onClick: clearAll, disabled: disabled, children: clearAllLabel }) }))] }));
189
+ };
190
+ ComboboxRoot.displayName = 'Combobox';
191
+ export const Combobox = ComboboxRoot;
192
+ Combobox.Trigger = ComboboxTrigger;
193
+ Combobox.ButtonTrigger = ComboboxButtonTrigger;
194
+ Combobox.Listbox = ComboboxListbox;
195
+ //# sourceMappingURL=Combobox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Combobox.js","sourceRoot":"","sources":["../../../src/components/combobox/Combobox.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,YAAY,GAAG,CAAC,KAAoB,EAAqB,EAAE;IAC/D,MAAM,EACJ,OAAO,EACP,QAAQ,GAAG,KAAK,EAChB,KAAK,EAAE,eAAe,EACtB,YAAY,EACZ,aAA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yBAAyB,EAAE,yBAAyB,GACpD,GACc,CACnB,GACc,IACJ,EAEd,YAAY,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,CAC5C,cAAK,SAAS,EAAC,gCAAgC,YAC7C,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,wBAAwB,EAClC,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,QAAQ,YAEjB,aAAa,GACP,GACL,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,UAAU,CAAC;AAQtC,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAgC,CAAC;AAEzD,QAAQ,CAAC,OAAO,GAAG,eAAe,CAAC;AACnC,QAAQ,CAAC,aAAa,GAAG,qBAAqB,CAAC;AAC/C,QAAQ,CAAC,OAAO,GAAG,eAAe,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Combobox } from './Combobox';
3
+ declare const meta: Meta<typeof Combobox>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Combobox>;
6
+ export declare const ScrollableLongList: Story;
7
+ export declare const ButtonTriggerSingleSelect: Story;
8
+ export declare const ButtonTriggerMultiSelect: Story;
9
+ export declare const SingleSelect: Story;
10
+ export declare const SubstringSearch: Story;
11
+ export declare const HighlightedMatches: Story;
12
+ export declare const MultiSelect: Story;
13
+ export declare const WithDefaultValue: Story;
14
+ export declare const WithGroups: Story;
15
+ export declare const Disabled: Story;
16
+ export declare const HiddenTrigger: Story;
17
+ export declare const ManualOpenOnFocus: Story;
18
+ export declare const CustomOptionLayout: Story;
19
+ export declare const AsyncSearch: Story;
20
+ export declare const CreateNew: Story;
21
+ export declare const SingleSelectCreate: Story;
22
+ export declare const CustomTagLabel: Story;
23
+ export declare const WithDisabledOptions: Story;
24
+ //# sourceMappingURL=Combobox.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Combobox.stories.d.ts","s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