@bspk/ui 1.2.0 → 1.3.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 (801) hide show
  1. package/.scripts/index.ts +110 -0
  2. package/README.md +13 -0
  3. package/build.ts +2 -2
  4. package/dist/components/Accordion/Accordion.d.ts +42 -5
  5. package/dist/components/Accordion/Accordion.js +24 -20
  6. package/dist/components/Accordion/Accordion.js.map +1 -1
  7. package/dist/components/Accordion/AccordionExample.d.ts +2 -1
  8. package/dist/components/Accordion/AccordionExample.js +77 -64
  9. package/dist/components/Accordion/AccordionExample.js.map +1 -1
  10. package/dist/components/Accordion/accordion.css +37 -34
  11. package/dist/components/Accordion/accordion.css.js +37 -34
  12. package/dist/components/Avatar/Avatar.d.ts +10 -6
  13. package/dist/components/Avatar/Avatar.js +5 -10
  14. package/dist/components/Avatar/Avatar.js.map +1 -1
  15. package/dist/components/Avatar/AvatarExample.d.ts +2 -1
  16. package/dist/components/Avatar/AvatarExample.js +42 -41
  17. package/dist/components/Avatar/AvatarExample.js.map +1 -1
  18. package/dist/components/AvatarGroup/AvatarGroup.d.ts +1 -1
  19. package/dist/components/AvatarGroup/AvatarGroup.js +1 -1
  20. package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -1
  21. package/dist/components/AvatarGroup/AvatarGroupExample.d.ts +2 -1
  22. package/dist/components/AvatarGroup/AvatarGroupExample.js +33 -27
  23. package/dist/components/AvatarGroup/AvatarGroupExample.js.map +1 -1
  24. package/dist/components/Badge/Badge.d.ts +1 -1
  25. package/dist/components/Badge/Badge.js +1 -1
  26. package/dist/components/Badge/Badge.js.map +1 -1
  27. package/dist/components/BadgeDot/BadgeDot.d.ts +1 -1
  28. package/dist/components/BadgeDot/BadgeDot.js +1 -1
  29. package/dist/components/BadgeDot/BadgeDot.js.map +1 -1
  30. package/dist/components/BannerAlert/BannerAlert.d.ts +1 -1
  31. package/dist/components/BannerAlert/BannerAlert.js +3 -2
  32. package/dist/components/BannerAlert/BannerAlert.js.map +1 -1
  33. package/dist/components/BannerAlert/BannerAlertExample.js +4 -0
  34. package/dist/components/BannerAlert/BannerAlertExample.js.map +1 -1
  35. package/dist/components/BannerAlert/banner-alert.css +0 -26
  36. package/dist/components/BannerAlert/banner-alert.css.js +0 -26
  37. package/dist/components/BottomNavigation/BottomNavigation.d.ts +53 -0
  38. package/dist/components/BottomNavigation/BottomNavigation.js +42 -0
  39. package/dist/components/BottomNavigation/BottomNavigation.js.map +1 -0
  40. package/dist/components/BottomNavigation/BottomNavigationExample.d.ts +4 -0
  41. package/dist/components/BottomNavigation/BottomNavigationExample.js +119 -0
  42. package/dist/components/BottomNavigation/BottomNavigationExample.js.map +1 -0
  43. package/dist/components/BottomNavigation/bottom-navigation.css +68 -0
  44. package/dist/components/BottomNavigation/bottom-navigation.css.js +73 -0
  45. package/dist/components/BottomNavigation/index.d.ts +1 -0
  46. package/dist/components/BottomNavigation/index.js +2 -0
  47. package/dist/components/BottomNavigation/index.js.map +1 -0
  48. package/dist/components/Breadcrumb/Breadcrumb.d.ts +4 -4
  49. package/dist/components/Breadcrumb/Breadcrumb.js +7 -16
  50. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
  51. package/dist/components/Breadcrumb/BreadcrumbExample.d.ts +2 -1
  52. package/dist/components/Breadcrumb/BreadcrumbExample.js +150 -149
  53. package/dist/components/Breadcrumb/BreadcrumbExample.js.map +1 -1
  54. package/dist/components/Button/Button.d.ts +1 -1
  55. package/dist/components/Button/Button.js +6 -3
  56. package/dist/components/Button/Button.js.map +1 -1
  57. package/dist/components/Button/ButtonExample.d.ts +2 -1
  58. package/dist/components/Button/ButtonExample.js +25 -24
  59. package/dist/components/Button/ButtonExample.js.map +1 -1
  60. package/dist/components/ButtonDock/ButtonDock.d.ts +55 -0
  61. package/dist/components/ButtonDock/ButtonDock.js +33 -0
  62. package/dist/components/ButtonDock/ButtonDock.js.map +1 -0
  63. package/dist/components/ButtonDock/ButtonDockExample.d.ts +4 -0
  64. package/dist/components/ButtonDock/ButtonDockExample.js +75 -0
  65. package/dist/components/ButtonDock/ButtonDockExample.js.map +1 -0
  66. package/dist/components/ButtonDock/button-dock.css +42 -0
  67. package/dist/components/ButtonDock/button-dock.css.js +47 -0
  68. package/dist/components/ButtonDock/index.d.ts +1 -0
  69. package/dist/components/ButtonDock/index.js +2 -0
  70. package/dist/components/ButtonDock/index.js.map +1 -0
  71. package/dist/components/CalendarPicker/CalendarPicker.d.ts +32 -0
  72. package/dist/components/CalendarPicker/CalendarPicker.js +203 -0
  73. package/dist/components/CalendarPicker/CalendarPicker.js.map +1 -0
  74. package/dist/components/CalendarPicker/CalendarPickerExample.d.ts +3 -0
  75. package/dist/components/CalendarPicker/CalendarPickerExample.js +17 -0
  76. package/dist/components/CalendarPicker/CalendarPickerExample.js.map +1 -0
  77. package/dist/components/CalendarPicker/calendar-picker.css +70 -0
  78. package/dist/components/CalendarPicker/calendar-picker.css.js +75 -0
  79. package/dist/components/CalendarPicker/index.d.ts +1 -0
  80. package/dist/components/CalendarPicker/index.js +2 -0
  81. package/dist/components/CalendarPicker/index.js.map +1 -0
  82. package/dist/components/Card/Card.d.ts +3 -9
  83. package/dist/components/Card/Card.js +2 -2
  84. package/dist/components/Card/Card.js.map +1 -1
  85. package/dist/components/Card/CardExample.js +1 -0
  86. package/dist/components/Card/CardExample.js.map +1 -1
  87. package/dist/components/Card/card.css +0 -4
  88. package/dist/components/Card/card.css.js +0 -4
  89. package/dist/components/Carousel/Carousel.d.ts +63 -0
  90. package/dist/components/Carousel/Carousel.js +68 -0
  91. package/dist/components/Carousel/Carousel.js.map +1 -0
  92. package/dist/components/Carousel/CarouselExample.d.ts +5 -0
  93. package/dist/components/Carousel/CarouselExample.js +51 -0
  94. package/dist/components/Carousel/CarouselExample.js.map +1 -0
  95. package/dist/components/Carousel/carousel.css +34 -0
  96. package/dist/components/Carousel/carousel.css.js +39 -0
  97. package/dist/components/Carousel/index.d.ts +1 -0
  98. package/dist/components/Carousel/index.js +2 -0
  99. package/dist/components/Carousel/index.js.map +1 -0
  100. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  101. package/dist/components/Checkbox/Checkbox.js +1 -1
  102. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  103. package/dist/components/Checkbox/checkbox.css +8 -8
  104. package/dist/components/Checkbox/checkbox.css.js +8 -8
  105. package/dist/components/CheckboxGroup/CheckboxGroupExample.d.ts +2 -1
  106. package/dist/components/CheckboxGroup/CheckboxGroupExample.js +49 -42
  107. package/dist/components/CheckboxGroup/CheckboxGroupExample.js.map +1 -1
  108. package/dist/components/ChipAssist/ChipAssistExample.d.ts +2 -1
  109. package/dist/components/ChipAssist/ChipAssistExample.js +24 -23
  110. package/dist/components/ChipAssist/ChipAssistExample.js.map +1 -1
  111. package/dist/components/ChipFilter/ChipFilterExample.js +3 -0
  112. package/dist/components/ChipFilter/ChipFilterExample.js.map +1 -1
  113. package/dist/components/ChipGroup/ChipGroupExample.d.ts +2 -1
  114. package/dist/components/ChipGroup/ChipGroupExample.js +9 -8
  115. package/dist/components/ChipGroup/ChipGroupExample.js.map +1 -1
  116. package/dist/components/ChipInput/ChipInputExample.d.ts +2 -1
  117. package/dist/components/ChipInput/ChipInputExample.js +39 -38
  118. package/dist/components/ChipInput/ChipInputExample.js.map +1 -1
  119. package/dist/components/ChipSuggestion/ChipSuggestionExample.d.ts +2 -1
  120. package/dist/components/ChipSuggestion/ChipSuggestionExample.js +16 -15
  121. package/dist/components/ChipSuggestion/ChipSuggestionExample.js.map +1 -1
  122. package/dist/components/ChipUtility/ChipUtility.d.ts +1 -1
  123. package/dist/components/ChipUtility/ChipUtility.js +1 -1
  124. package/dist/components/ChipUtility/ChipUtility.js.map +1 -1
  125. package/dist/components/ChipUtility/ChipUtilityExample.d.ts +2 -1
  126. package/dist/components/ChipUtility/ChipUtilityExample.js +53 -52
  127. package/dist/components/ChipUtility/ChipUtilityExample.js.map +1 -1
  128. package/dist/components/DateField/DateField.d.ts +32 -0
  129. package/dist/components/DateField/DateField.js +34 -0
  130. package/dist/components/DateField/DateField.js.map +1 -0
  131. package/dist/components/DateField/DateFieldExample.d.ts +4 -0
  132. package/dist/components/DateField/DateFieldExample.js +11 -0
  133. package/dist/components/DateField/DateFieldExample.js.map +1 -0
  134. package/dist/components/DateField/date-field.css +8 -0
  135. package/dist/components/DateField/date-field.css.js +13 -0
  136. package/dist/components/DateField/index.d.ts +1 -0
  137. package/dist/components/DateField/index.js +2 -0
  138. package/dist/components/DateField/index.js.map +1 -0
  139. package/dist/components/DateInput/DateInput.d.ts +39 -0
  140. package/dist/components/DateInput/DateInput.js +102 -0
  141. package/dist/components/DateInput/DateInput.js.map +1 -0
  142. package/dist/components/DateInput/DateInputExample.d.ts +4 -0
  143. package/dist/components/DateInput/DateInputExample.js +14 -0
  144. package/dist/components/DateInput/DateInputExample.js.map +1 -0
  145. package/dist/components/DateInput/date-input.css +12 -0
  146. package/dist/components/DateInput/date-input.css.js +17 -0
  147. package/dist/components/DateInput/index.d.ts +1 -0
  148. package/dist/components/DateInput/index.js +2 -0
  149. package/dist/components/DateInput/index.js.map +1 -0
  150. package/dist/components/Dialog/Dialog.d.ts +15 -2
  151. package/dist/components/Dialog/Dialog.js +11 -9
  152. package/dist/components/Dialog/Dialog.js.map +1 -1
  153. package/dist/components/Dialog/DialogExample.d.ts +2 -1
  154. package/dist/components/Dialog/DialogExample.js +2 -0
  155. package/dist/components/Dialog/DialogExample.js.map +1 -1
  156. package/dist/components/Dialog/dialog.css +19 -67
  157. package/dist/components/Dialog/dialog.css.js +19 -67
  158. package/dist/components/Divider/Divider.d.ts +1 -1
  159. package/dist/components/Divider/Divider.js +1 -1
  160. package/dist/components/Divider/Divider.js.map +1 -1
  161. package/dist/components/Divider/DividerExample.d.ts +4 -2
  162. package/dist/components/Divider/DividerExample.js +2 -0
  163. package/dist/components/Divider/DividerExample.js.map +1 -1
  164. package/dist/components/Divider/divider.css +1 -1
  165. package/dist/components/Divider/divider.css.js +1 -1
  166. package/dist/components/Drawer/Drawer.d.ts +75 -0
  167. package/dist/components/Drawer/Drawer.js +49 -0
  168. package/dist/components/Drawer/Drawer.js.map +1 -0
  169. package/dist/components/Drawer/DrawerExample.d.ts +4 -0
  170. package/dist/components/Drawer/DrawerExample.js +47 -0
  171. package/dist/components/Drawer/DrawerExample.js.map +1 -0
  172. package/dist/components/Drawer/drawer.css +56 -0
  173. package/dist/components/Drawer/drawer.css.js +61 -0
  174. package/dist/components/Drawer/index.d.ts +1 -0
  175. package/dist/components/Drawer/index.js +2 -0
  176. package/dist/components/Drawer/index.js.map +1 -0
  177. package/dist/components/EmptyState/EmptyStateExample.d.ts +2 -1
  178. package/dist/components/EmptyState/EmptyStateExample.js +18 -11
  179. package/dist/components/EmptyState/EmptyStateExample.js.map +1 -1
  180. package/dist/components/Fab/Fab.d.ts +1 -1
  181. package/dist/components/Fab/Fab.js +5 -2
  182. package/dist/components/Fab/Fab.js.map +1 -1
  183. package/dist/components/Fab/FabExample.d.ts +1 -0
  184. package/dist/components/Fab/FabExample.js +4 -2
  185. package/dist/components/Fab/FabExample.js.map +1 -1
  186. package/dist/components/FileUpload/FileUpload.d.ts +1 -1
  187. package/dist/components/FileUpload/FileUpload.js +1 -1
  188. package/dist/components/FileUpload/FileUpload.js.map +1 -1
  189. package/dist/components/FileUpload/FileUploadExample.d.ts +2 -1
  190. package/dist/components/FileUpload/FileUploadExample.js +17 -16
  191. package/dist/components/FileUpload/FileUploadExample.js.map +1 -1
  192. package/dist/components/FileUploadItem/FileUploadItem.d.ts +1 -1
  193. package/dist/components/FileUploadItem/FileUploadItem.js +1 -1
  194. package/dist/components/FileUploadItem/FileUploadItem.js.map +1 -1
  195. package/dist/components/FileUploadItem/FileUploadItemExample.d.ts +2 -1
  196. package/dist/components/FileUploadItem/FileUploadItemExample.js +44 -39
  197. package/dist/components/FileUploadItem/FileUploadItemExample.js.map +1 -1
  198. package/dist/components/FormField/FormField.d.ts +3 -3
  199. package/dist/components/FormField/FormField.js +2 -2
  200. package/dist/components/FormField/FormField.js.map +1 -1
  201. package/dist/components/FormField/form-field.css +3 -3
  202. package/dist/components/FormField/form-field.css.js +3 -3
  203. package/dist/components/InlineAlert/InlineAlert.d.ts +1 -1
  204. package/dist/components/InlineAlert/InlineAlert.js +1 -1
  205. package/dist/components/InlineAlert/InlineAlert.js.map +1 -1
  206. package/dist/components/Layout/LayoutExample.d.ts +2 -1
  207. package/dist/components/Layout/LayoutExample.js +2 -0
  208. package/dist/components/Layout/LayoutExample.js.map +1 -1
  209. package/dist/components/Link/Link.d.ts +1 -1
  210. package/dist/components/Link/Link.js +1 -1
  211. package/dist/components/Link/Link.js.map +1 -1
  212. package/dist/components/Link/LinkExample.d.ts +2 -1
  213. package/dist/components/Link/LinkExample.js +2 -0
  214. package/dist/components/Link/LinkExample.js.map +1 -1
  215. package/dist/components/ListItem/ListItem.d.ts +40 -14
  216. package/dist/components/ListItem/ListItem.js +26 -13
  217. package/dist/components/ListItem/ListItem.js.map +1 -1
  218. package/dist/components/ListItem/ListItemExample.d.ts +2 -1
  219. package/dist/components/ListItem/ListItemExample.js +12 -12
  220. package/dist/components/ListItem/ListItemExample.js.map +1 -1
  221. package/dist/components/ListItem/list-item.css +10 -7
  222. package/dist/components/ListItem/list-item.css.js +10 -7
  223. package/dist/components/ListItemMenu/ListItemMenu.d.ts +146 -0
  224. package/dist/components/ListItemMenu/ListItemMenu.js +159 -0
  225. package/dist/components/ListItemMenu/ListItemMenu.js.map +1 -0
  226. package/dist/components/ListItemMenu/index.d.ts +1 -0
  227. package/dist/components/ListItemMenu/index.js +2 -0
  228. package/dist/components/ListItemMenu/index.js.map +1 -0
  229. package/dist/components/Menu/Menu.d.ts +12 -39
  230. package/dist/components/Menu/Menu.js +6 -26
  231. package/dist/components/Menu/Menu.js.map +1 -1
  232. package/dist/components/Menu/MenuExample.d.ts +3 -3
  233. package/dist/components/Menu/MenuExample.js +1 -24
  234. package/dist/components/Menu/MenuExample.js.map +1 -1
  235. package/dist/components/Menu/menu.css +3 -10
  236. package/dist/components/Menu/menu.css.js +3 -10
  237. package/dist/components/MenuButton/MenuButton.d.ts +1 -1
  238. package/dist/components/MenuButton/MenuButton.js +1 -1
  239. package/dist/components/MenuButton/MenuButton.js.map +1 -1
  240. package/dist/components/Modal/Modal.d.ts +4 -4
  241. package/dist/components/Modal/Modal.js +4 -4
  242. package/dist/components/Modal/Modal.js.map +1 -1
  243. package/dist/components/NumberInput/NumberInput.d.ts +8 -4
  244. package/dist/components/NumberInput/NumberInput.js +5 -14
  245. package/dist/components/NumberInput/NumberInput.js.map +1 -1
  246. package/dist/components/NumberInput/number-input.css +0 -1
  247. package/dist/components/NumberInput/number-input.css.js +0 -1
  248. package/dist/components/OTPInput/OTPInput.d.ts +3 -3
  249. package/dist/components/OTPInput/OTPInput.js +3 -3
  250. package/dist/components/OTPInput/OTPInput.js.map +1 -1
  251. package/dist/components/OTPInput/OTPInputExample.d.ts +2 -1
  252. package/dist/components/OTPInput/OTPInputExample.js +19 -16
  253. package/dist/components/OTPInput/OTPInputExample.js.map +1 -1
  254. package/dist/components/PageControl/PageControl.d.ts +5 -3
  255. package/dist/components/PageControl/PageControl.js +17 -16
  256. package/dist/components/PageControl/PageControl.js.map +1 -1
  257. package/dist/components/PageControl/PageControlExample.d.ts +4 -0
  258. package/dist/components/PageControl/PageControlExample.js +34 -0
  259. package/dist/components/PageControl/PageControlExample.js.map +1 -0
  260. package/dist/components/Pagination/Pagination.d.ts +1 -5
  261. package/dist/components/Pagination/Pagination.js +2 -6
  262. package/dist/components/Pagination/Pagination.js.map +1 -1
  263. package/dist/components/PasswordField/PasswordField.d.ts +2 -2
  264. package/dist/components/PasswordField/PasswordField.js +3 -3
  265. package/dist/components/PasswordField/PasswordField.js.map +1 -1
  266. package/dist/components/PasswordInput/PasswordInput.d.ts +1 -1
  267. package/dist/components/PasswordInput/PasswordInput.js +2 -2
  268. package/dist/components/PasswordInput/PasswordInput.js.map +1 -1
  269. package/dist/components/PhoneNumberInput/PhoneNumberInput.d.ts +3 -3
  270. package/dist/components/PhoneNumberInput/PhoneNumberInput.js +49 -52
  271. package/dist/components/PhoneNumberInput/PhoneNumberInput.js.map +1 -1
  272. package/dist/components/PhoneNumberInput/PhoneNumberInputExample.d.ts +4 -0
  273. package/dist/components/PhoneNumberInput/PhoneNumberInputExample.js +5 -0
  274. package/dist/components/PhoneNumberInput/PhoneNumberInputExample.js.map +1 -0
  275. package/dist/components/PhoneNumberInput/phone-number-input.css +36 -26
  276. package/dist/components/PhoneNumberInput/phone-number-input.css.js +36 -26
  277. package/dist/components/Popover/Popover.d.ts +7 -4
  278. package/dist/components/Popover/Popover.js +22 -19
  279. package/dist/components/Popover/Popover.js.map +1 -1
  280. package/dist/components/Popover/PopoverExample.js +7 -1
  281. package/dist/components/Popover/PopoverExample.js.map +1 -1
  282. package/dist/components/Popover/popover.css +3 -12
  283. package/dist/components/Popover/popover.css.js +3 -12
  284. package/dist/components/ProgressBar/ProgressBar.js +1 -1
  285. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  286. package/dist/components/ProgressCircle/ProgressCircle.js +1 -1
  287. package/dist/components/ProgressCircle/ProgressCircle.js.map +1 -1
  288. package/dist/components/ProgressionStepper/ProgressionStepper.d.ts +1 -1
  289. package/dist/components/ProgressionStepper/ProgressionStepper.js +2 -2
  290. package/dist/components/ProgressionStepper/ProgressionStepper.js.map +1 -1
  291. package/dist/components/ProgressionStepper/ProgressionStepperExample.d.ts +2 -1
  292. package/dist/components/ProgressionStepper/ProgressionStepperExample.js +47 -46
  293. package/dist/components/ProgressionStepper/ProgressionStepperExample.js.map +1 -1
  294. package/dist/components/ProgressionStepperBar/ProgressionStepperBar.d.ts +1 -1
  295. package/dist/components/ProgressionStepperBar/ProgressionStepperBar.js +3 -3
  296. package/dist/components/ProgressionStepperBar/ProgressionStepperBar.js.map +1 -1
  297. package/dist/components/Radio/Radio.d.ts +1 -1
  298. package/dist/components/Radio/Radio.js.map +1 -1
  299. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  300. package/dist/components/RadioGroup/RadioGroup.js +2 -2
  301. package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
  302. package/dist/components/RadioGroup/RadioGroupExample.d.ts +1 -0
  303. package/dist/components/RadioGroup/RadioGroupExample.js +2 -1
  304. package/dist/components/RadioGroup/RadioGroupExample.js.map +1 -1
  305. package/dist/components/RadioOption/RadioOption.js +1 -1
  306. package/dist/components/RadioOption/RadioOption.js.map +1 -1
  307. package/dist/components/Rating/Rating.js +2 -2
  308. package/dist/components/Rating/Rating.js.map +1 -1
  309. package/dist/components/Rating/RatingExample.d.ts +2 -1
  310. package/dist/components/Rating/RatingExample.js +9 -8
  311. package/dist/components/Rating/RatingExample.js.map +1 -1
  312. package/dist/components/Scrim/Scrim.d.ts +2 -2
  313. package/dist/components/Scrim/Scrim.js +2 -2
  314. package/dist/components/Scrim/Scrim.js.map +1 -1
  315. package/dist/components/Scrim/scrim.css +0 -3
  316. package/dist/components/Scrim/scrim.css.js +0 -3
  317. package/dist/components/SearchBar/SearchBar.d.ts +11 -8
  318. package/dist/components/SearchBar/SearchBar.js +46 -34
  319. package/dist/components/SearchBar/SearchBar.js.map +1 -1
  320. package/dist/components/SearchBar/SearchBarExample.d.ts +2 -1
  321. package/dist/components/SearchBar/SearchBarExample.js +2 -6
  322. package/dist/components/SearchBar/SearchBarExample.js.map +1 -1
  323. package/dist/components/SegmentedControl/SegmentedControl.d.ts +2 -2
  324. package/dist/components/SegmentedControl/SegmentedControl.js +1 -1
  325. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  326. package/dist/components/SegmentedControl/SegmentedControlExample.d.ts +2 -1
  327. package/dist/components/SegmentedControl/SegmentedControlExample.js +32 -23
  328. package/dist/components/SegmentedControl/SegmentedControlExample.js.map +1 -1
  329. package/dist/components/SegmentedControl/segmented-control.css +7 -7
  330. package/dist/components/SegmentedControl/segmented-control.css.js +7 -7
  331. package/dist/components/Select/Select.d.ts +53 -35
  332. package/dist/components/Select/Select.js +99 -27
  333. package/dist/components/Select/Select.js.map +1 -1
  334. package/dist/components/Select/SelectExample.d.ts +2 -1
  335. package/dist/components/Select/SelectExample.js +104 -89
  336. package/dist/components/Select/SelectExample.js.map +1 -1
  337. package/dist/components/Select/select.css +12 -18
  338. package/dist/components/Select/select.css.js +12 -18
  339. package/dist/components/SelectField/SelectFieldExample.d.ts +23 -0
  340. package/dist/components/SelectField/SelectFieldExample.js +13 -0
  341. package/dist/components/SelectField/SelectFieldExample.js.map +1 -0
  342. package/dist/components/Skeleton/SkeletonExample.d.ts +2 -1
  343. package/dist/components/Skeleton/SkeletonExample.js +10 -9
  344. package/dist/components/Skeleton/SkeletonExample.js.map +1 -1
  345. package/dist/components/SkeletonText/SkeletonTextExample.d.ts +2 -1
  346. package/dist/components/SkeletonText/SkeletonTextExample.js +12 -11
  347. package/dist/components/SkeletonText/SkeletonTextExample.js.map +1 -1
  348. package/dist/components/Slider/Slider.js +1 -1
  349. package/dist/components/Slider/Slider.js.map +1 -1
  350. package/dist/components/Slider/SliderExample.js +3 -0
  351. package/dist/components/Slider/SliderExample.js.map +1 -1
  352. package/dist/components/Snackbar/Snackbar.d.ts +27 -0
  353. package/dist/components/Snackbar/Snackbar.js +23 -0
  354. package/dist/components/Snackbar/Snackbar.js.map +1 -0
  355. package/dist/components/Snackbar/SnackbarExample.d.ts +3 -0
  356. package/dist/components/Snackbar/SnackbarExample.js +11 -0
  357. package/dist/components/Snackbar/SnackbarExample.js.map +1 -0
  358. package/dist/components/Snackbar/index.d.ts +1 -0
  359. package/dist/components/Snackbar/index.js +2 -0
  360. package/dist/components/Snackbar/index.js.map +1 -0
  361. package/dist/components/Snackbar/snackbar.css +19 -0
  362. package/dist/components/Snackbar/snackbar.css.js +24 -0
  363. package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +90 -0
  364. package/dist/components/SnackbarProvider/SnackbarProvider.js +115 -0
  365. package/dist/components/SnackbarProvider/SnackbarProvider.js.map +1 -0
  366. package/dist/components/SnackbarProvider/SnackbarProviderExample.d.ts +4 -0
  367. package/dist/components/SnackbarProvider/SnackbarProviderExample.js +59 -0
  368. package/dist/components/SnackbarProvider/SnackbarProviderExample.js.map +1 -0
  369. package/dist/components/SnackbarProvider/index.d.ts +1 -0
  370. package/dist/components/SnackbarProvider/index.js +2 -0
  371. package/dist/components/SnackbarProvider/index.js.map +1 -0
  372. package/dist/components/SnackbarProvider/snackbar-provider-example.css +15 -0
  373. package/dist/components/SnackbarProvider/snackbar-provider-example.css.js +20 -0
  374. package/dist/components/SnackbarProvider/snackbar-provider.css +15 -0
  375. package/dist/components/SnackbarProvider/snackbar-provider.css.js +20 -0
  376. package/dist/components/Switch/Switch.d.ts +1 -1
  377. package/dist/components/Switch/Switch.js.map +1 -1
  378. package/dist/components/TabGroup/TabGroup.d.ts +1 -1
  379. package/dist/components/TabGroup/TabGroup.js +1 -1
  380. package/dist/components/TabGroup/TabGroup.js.map +1 -1
  381. package/dist/components/TabGroup/TabGroupExample.d.ts +2 -1
  382. package/dist/components/TabGroup/TabGroupExample.js +50 -45
  383. package/dist/components/TabGroup/TabGroupExample.js.map +1 -1
  384. package/dist/components/TabGroup/tab-group.css +6 -6
  385. package/dist/components/TabGroup/tab-group.css.js +6 -6
  386. package/dist/components/TabList/TabList.d.ts +1 -1
  387. package/dist/components/TabList/TabList.js +32 -22
  388. package/dist/components/TabList/TabList.js.map +1 -1
  389. package/dist/components/TabList/tab-list.css +6 -9
  390. package/dist/components/TabList/tab-list.css.js +6 -9
  391. package/dist/components/Tag/Tag.d.ts +1 -1
  392. package/dist/components/Tag/Tag.js +1 -1
  393. package/dist/components/Tag/Tag.js.map +1 -1
  394. package/dist/components/Tag/TagExample.d.ts +2 -1
  395. package/dist/components/Tag/TagExample.js +12 -11
  396. package/dist/components/Tag/TagExample.js.map +1 -1
  397. package/dist/components/TextField/TextField.js +1 -1
  398. package/dist/components/TextField/TextField.js.map +1 -1
  399. package/dist/components/TextField/TextFieldExample.d.ts +3 -0
  400. package/dist/components/TextField/TextFieldExample.js +6 -0
  401. package/dist/components/TextField/TextFieldExample.js.map +1 -0
  402. package/dist/components/TextInput/TextInput.d.ts +2 -2
  403. package/dist/components/TextInput/TextInput.js +27 -4
  404. package/dist/components/TextInput/TextInput.js.map +1 -1
  405. package/dist/components/TextInput/TextInputExample.js +9 -0
  406. package/dist/components/TextInput/TextInputExample.js.map +1 -1
  407. package/dist/components/TextInput/text-input.css +12 -25
  408. package/dist/components/TextInput/text-input.css.js +12 -25
  409. package/dist/components/Textarea/Textarea.d.ts +3 -3
  410. package/dist/components/Textarea/Textarea.js +2 -10
  411. package/dist/components/Textarea/Textarea.js.map +1 -1
  412. package/dist/components/TextareaField/TextareaField.d.ts +1 -1
  413. package/dist/components/TextareaField/TextareaField.js +2 -2
  414. package/dist/components/TextareaField/TextareaField.js.map +1 -1
  415. package/dist/components/TimeInput/Listbox.d.ts +10 -5
  416. package/dist/components/TimeInput/Listbox.js +14 -55
  417. package/dist/components/TimeInput/Listbox.js.map +1 -1
  418. package/dist/components/TimeInput/Segment.d.ts +3 -4
  419. package/dist/components/TimeInput/Segment.js +17 -13
  420. package/dist/components/TimeInput/Segment.js.map +1 -1
  421. package/dist/components/TimeInput/TimeInput.d.ts +3 -5
  422. package/dist/components/TimeInput/TimeInput.js +70 -23
  423. package/dist/components/TimeInput/TimeInput.js.map +1 -1
  424. package/dist/components/TimeInput/time-input.css +10 -9
  425. package/dist/components/TimeInput/time-input.css.js +10 -9
  426. package/dist/components/ToggleOption/ToggleOption.d.ts +1 -1
  427. package/dist/components/ToggleOption/ToggleOption.js.map +1 -1
  428. package/dist/components/Tooltip/Tooltip.d.ts +4 -3
  429. package/dist/components/Tooltip/Tooltip.js +12 -18
  430. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  431. package/dist/components/Tooltip/TooltipExample.js +1 -1
  432. package/dist/components/Tooltip/TooltipExample.js.map +1 -1
  433. package/dist/components/Tooltip/tooltip.css +0 -2
  434. package/dist/components/Tooltip/tooltip.css.js +0 -2
  435. package/dist/components/Truncated/Truncated.d.ts +1 -0
  436. package/dist/components/Truncated/Truncated.js +2 -8
  437. package/dist/components/Truncated/Truncated.js.map +1 -1
  438. package/dist/components/Truncated/truncated.css +8 -0
  439. package/dist/components/Truncated/truncated.css.js +13 -0
  440. package/dist/components/UIProvider/AriaLiveMessageHandler.d.ts +13 -0
  441. package/dist/components/UIProvider/AriaLiveMessageHandler.js +30 -0
  442. package/dist/components/UIProvider/AriaLiveMessageHandler.js.map +1 -0
  443. package/dist/components/UIProvider/UIProvider.d.ts +12 -1
  444. package/dist/components/UIProvider/UIProvider.js +13 -4
  445. package/dist/components/UIProvider/UIProvider.js.map +1 -1
  446. package/dist/components/UIProvider/UIProviderExample.d.ts +5 -0
  447. package/dist/components/UIProvider/UIProviderExample.js +92 -0
  448. package/dist/components/UIProvider/UIProviderExample.js.map +1 -0
  449. package/dist/constants/phases.js +0 -1
  450. package/dist/constants/phases.js.map +1 -1
  451. package/dist/hooks/useAddEventListener.d.ts +2 -1
  452. package/dist/hooks/useAddEventListener.js.map +1 -1
  453. package/dist/hooks/useArrowNavigation.d.ts +50 -0
  454. package/dist/hooks/useArrowNavigation.js +57 -0
  455. package/dist/hooks/useArrowNavigation.js.map +1 -0
  456. package/dist/hooks/useCheckboxGroupState.d.ts +1 -1
  457. package/dist/hooks/useContainerWidth.d.ts +16 -0
  458. package/dist/hooks/useContainerWidth.js +35 -0
  459. package/dist/hooks/useContainerWidth.js.map +1 -0
  460. package/dist/hooks/useFloating.d.ts +7 -6
  461. package/dist/hooks/useFloating.js +10 -12
  462. package/dist/hooks/useFloating.js.map +1 -1
  463. package/dist/hooks/useSnackbarContext.d.ts +1 -0
  464. package/dist/hooks/useSnackbarContext.js +16 -0
  465. package/dist/hooks/useSnackbarContext.js.map +1 -0
  466. package/dist/hooks/useSwipe.d.ts +6 -0
  467. package/dist/hooks/useSwipe.js +28 -0
  468. package/dist/hooks/useSwipe.js.map +1 -0
  469. package/dist/styles/base.css +87 -15
  470. package/dist/styles/base.css.js +87 -15
  471. package/dist/types/common.d.ts +9 -4
  472. package/dist/types/common.js.map +1 -1
  473. package/dist/types/meta.d.ts +1 -1
  474. package/dist/types/meta.js +0 -7
  475. package/dist/types/meta.js.map +1 -1
  476. package/dist/utils/createExampleChildElement.js +1 -1
  477. package/dist/utils/createExampleChildElement.js.map +1 -1
  478. package/dist/utils/demo.d.ts +31 -6
  479. package/dist/utils/demo.js.map +1 -1
  480. package/dist/utils/dom.d.ts +2 -0
  481. package/dist/utils/dom.js +9 -0
  482. package/dist/utils/dom.js.map +1 -0
  483. package/dist/utils/handleKeyDown.d.ts +4 -3
  484. package/dist/utils/handleKeyDown.js +6 -3
  485. package/dist/utils/handleKeyDown.js.map +1 -1
  486. package/dist/utils/keyboard.d.ts +2 -1
  487. package/dist/utils/keyboard.js.map +1 -1
  488. package/dist/utils/scrollListItemsStyle.d.ts +10 -0
  489. package/dist/utils/scrollListItemsStyle.js +17 -0
  490. package/dist/utils/scrollListItemsStyle.js.map +1 -0
  491. package/dist/utils/snackbarContext.d.ts +38 -0
  492. package/dist/utils/snackbarContext.js +3 -0
  493. package/dist/utils/snackbarContext.js.map +1 -0
  494. package/dist/utils/uiContext.d.ts +6 -0
  495. package/dist/utils/uiContext.js.map +1 -1
  496. package/dist/utils/useIds.d.ts +4 -0
  497. package/dist/utils/useIds.js +11 -0
  498. package/dist/utils/useIds.js.map +1 -0
  499. package/package.json +41 -12
  500. package/src/components/Accordion/Accordion.rtl.test.tsx +17 -0
  501. package/src/components/Accordion/Accordion.tsx +87 -24
  502. package/src/components/Accordion/AccordionExample.tsx +78 -72
  503. package/src/components/Accordion/accordion.scss +37 -36
  504. package/src/components/Avatar/Avatar.rtl.test.tsx +16 -0
  505. package/src/components/Avatar/Avatar.tsx +30 -26
  506. package/src/components/Avatar/AvatarExample.tsx +44 -42
  507. package/src/components/AvatarGroup/AvatarGroup.rtl.test.tsx +16 -0
  508. package/src/components/AvatarGroup/AvatarGroup.tsx +1 -2
  509. package/src/components/AvatarGroup/AvatarGroupExample.tsx +36 -28
  510. package/src/components/Badge/Badge.rtl.test.tsx +19 -0
  511. package/src/components/Badge/Badge.tsx +1 -2
  512. package/src/components/BadgeDot/BadgeDot.rtl.test.tsx +19 -0
  513. package/src/components/BadgeDot/BadgeDot.tsx +1 -2
  514. package/src/components/BannerAlert/BannerAlert.rtl.test.tsx +26 -0
  515. package/src/components/BannerAlert/BannerAlert.tsx +16 -7
  516. package/src/components/BannerAlert/BannerAlertExample.tsx +4 -0
  517. package/src/components/BannerAlert/banner-alert.scss +0 -28
  518. package/src/components/BottomNavigation/BottomNavigation.rtl.test.tsx +21 -0
  519. package/src/components/BottomNavigation/BottomNavigation.tsx +60 -0
  520. package/src/components/BottomNavigation/BottomNavigationExample.tsx +121 -0
  521. package/src/components/BottomNavigation/bottom-navigation.scss +87 -0
  522. package/src/components/BottomNavigation/index.tsx +1 -0
  523. package/src/components/Breadcrumb/Breadcrumb.rtl.test.tsx +16 -0
  524. package/src/components/Breadcrumb/Breadcrumb.tsx +57 -73
  525. package/src/components/Breadcrumb/BreadcrumbExample.tsx +152 -150
  526. package/src/components/Button/Button.rtl.test.tsx +16 -0
  527. package/src/components/Button/Button.tsx +8 -5
  528. package/src/components/Button/ButtonExample.tsx +27 -25
  529. package/src/components/ButtonDock/ButtonDock.rtl.test.tsx +18 -0
  530. package/src/components/ButtonDock/ButtonDock.tsx +68 -0
  531. package/src/components/ButtonDock/ButtonDockExample.tsx +77 -0
  532. package/src/components/ButtonDock/button-dock.scss +49 -0
  533. package/src/components/ButtonDock/index.tsx +1 -0
  534. package/src/components/CalendarPicker/CalendarPicker.rtl.test.tsx +15 -0
  535. package/src/components/CalendarPicker/CalendarPicker.tsx +424 -0
  536. package/src/components/CalendarPicker/CalendarPickerExample.tsx +24 -0
  537. package/src/components/CalendarPicker/calendar-picker.scss +89 -0
  538. package/src/components/CalendarPicker/index.tsx +1 -0
  539. package/src/components/Card/Card.rtl.test.tsx +19 -0
  540. package/src/components/Card/Card.tsx +4 -11
  541. package/src/components/Card/CardExample.tsx +1 -0
  542. package/src/components/Card/card.scss +0 -5
  543. package/src/components/Carousel/Carousel.tsx +177 -0
  544. package/src/components/Carousel/CarouselExample.tsx +82 -0
  545. package/src/components/Carousel/carousel.scss +39 -0
  546. package/src/components/Carousel/index.tsx +1 -0
  547. package/src/components/Checkbox/Checkbox.rtl.test.tsx +27 -0
  548. package/src/components/Checkbox/Checkbox.tsx +1 -3
  549. package/src/components/Checkbox/checkbox.scss +4 -4
  550. package/src/components/CheckboxGroup/CheckboxGroup.rtl.test.tsx +19 -0
  551. package/src/components/CheckboxGroup/CheckboxGroupExample.tsx +51 -43
  552. package/src/components/CheckboxOption/CheckboxOption.rtl.test.tsx +24 -0
  553. package/src/components/ChipAssist/ChipAssist.rtl.test.tsx +16 -0
  554. package/src/components/ChipAssist/ChipAssistExample.tsx +26 -24
  555. package/src/components/ChipFilter/ChipFilter.rtl.test.tsx +15 -0
  556. package/src/components/ChipFilter/ChipFilterExample.tsx +3 -0
  557. package/src/components/ChipGroup/ChipGroup.rtl.test.tsx +32 -0
  558. package/src/components/ChipGroup/ChipGroupExample.tsx +11 -9
  559. package/src/components/ChipInput/ChipInput.rtl.test.tsx +16 -0
  560. package/src/components/ChipInput/ChipInputExample.tsx +41 -39
  561. package/src/components/ChipSuggestion/ChipSuggestion.rtl.test.tsx +19 -0
  562. package/src/components/ChipSuggestion/ChipSuggestionExample.tsx +18 -16
  563. package/src/components/ChipUtility/ChipUtility.rtl.test.tsx +16 -0
  564. package/src/components/ChipUtility/ChipUtility.tsx +1 -3
  565. package/src/components/ChipUtility/ChipUtilityExample.tsx +56 -54
  566. package/src/components/DateField/DateField.rtl.test.tsx +24 -0
  567. package/src/components/DateField/DateField.tsx +58 -0
  568. package/src/components/DateField/DateFieldExample.tsx +13 -0
  569. package/src/components/DateField/date-field.scss +8 -0
  570. package/src/components/DateField/index.tsx +1 -0
  571. package/src/components/DateInput/DateInput.rtl.test.tsx +17 -0
  572. package/src/components/DateInput/DateInput.tsx +197 -0
  573. package/src/components/DateInput/DateInputExample.tsx +17 -0
  574. package/src/components/DateInput/date-input.scss +13 -0
  575. package/src/components/DateInput/index.tsx +1 -0
  576. package/src/components/Dialog/Dialog.rtl.test.tsx +22 -0
  577. package/src/components/Dialog/Dialog.tsx +26 -7
  578. package/src/components/Dialog/DialogExample.tsx +4 -1
  579. package/src/components/Dialog/dialog.scss +25 -79
  580. package/src/components/Divider/Divider.rtl.test.tsx +8 -0
  581. package/src/components/Divider/Divider.tsx +1 -2
  582. package/src/components/Divider/DividerExample.tsx +6 -2
  583. package/src/components/Divider/divider.scss +1 -1
  584. package/src/components/Drawer/Drawer.rtl.test.tsx +27 -0
  585. package/src/components/Drawer/Drawer.tsx +135 -0
  586. package/src/components/Drawer/DrawerExample.tsx +93 -0
  587. package/src/components/Drawer/drawer.scss +67 -0
  588. package/src/components/Drawer/index.tsx +1 -0
  589. package/src/components/EmptyState/EmptyState.rtl.test.tsx +16 -0
  590. package/src/components/EmptyState/EmptyStateExample.tsx +24 -16
  591. package/src/components/Fab/Fab.rtl.test.tsx +15 -0
  592. package/src/components/Fab/Fab.tsx +6 -4
  593. package/src/components/Fab/FabExample.tsx +5 -2
  594. package/src/components/FileUpload/FileUpload.rtl.test.tsx +14 -0
  595. package/src/components/FileUpload/FileUpload.tsx +1 -2
  596. package/src/components/FileUpload/FileUploadExample.tsx +19 -17
  597. package/src/components/FileUploadItem/FileUploadItem.rtl.test.tsx +19 -0
  598. package/src/components/FileUploadItem/FileUploadItem.tsx +1 -3
  599. package/src/components/FileUploadItem/FileUploadItemExample.tsx +47 -40
  600. package/src/components/FormField/FormField.rtl.test.tsx +30 -0
  601. package/src/components/FormField/FormField.tsx +3 -4
  602. package/src/components/FormField/form-field.scss +1 -1
  603. package/src/components/Img/Img.rtl.test.tsx +15 -0
  604. package/src/components/InlineAlert/InlineAlert.rtl.test.tsx +15 -0
  605. package/src/components/InlineAlert/InlineAlert.tsx +1 -2
  606. package/src/components/Layout/Layout.rtl.test.tsx +15 -0
  607. package/src/components/Layout/LayoutExample.tsx +4 -1
  608. package/src/components/Link/Link.rtl.test.tsx +14 -0
  609. package/src/components/Link/Link.tsx +1 -3
  610. package/src/components/Link/LinkExample.tsx +4 -1
  611. package/src/components/ListItem/ListItem.rtl.test.tsx +18 -0
  612. package/src/components/ListItem/ListItem.tsx +132 -73
  613. package/src/components/ListItem/ListItemExample.tsx +14 -13
  614. package/src/components/ListItem/list-item.scss +16 -10
  615. package/src/components/ListItemMenu/ListItemMenu.tsx +358 -0
  616. package/src/components/ListItemMenu/index.tsx +1 -0
  617. package/src/components/Menu/Menu.rtl.test.tsx +15 -0
  618. package/src/components/Menu/Menu.tsx +39 -106
  619. package/src/components/Menu/MenuExample.tsx +2 -32
  620. package/src/components/Menu/menu.scss +4 -16
  621. package/src/components/MenuButton/MenuButton.rtl.test.tsx +15 -0
  622. package/src/components/MenuButton/MenuButton.tsx +1 -3
  623. package/src/components/Modal/Modal.rtl.test.tsx +20 -0
  624. package/src/components/Modal/Modal.tsx +8 -5
  625. package/src/components/NumberField/NumberField.rtl.test.tsx +24 -0
  626. package/src/components/NumberInput/NumberInput.rtl.test.tsx +15 -0
  627. package/src/components/NumberInput/NumberInput.tsx +16 -22
  628. package/src/components/NumberInput/number-input.scss +0 -1
  629. package/src/components/OTPInput/OTPInput.rtl.test.tsx +19 -0
  630. package/src/components/OTPInput/OTPInput.tsx +3 -4
  631. package/src/components/OTPInput/OTPInputExample.tsx +21 -17
  632. package/src/components/PageControl/PageControl.rtl.test.tsx +15 -0
  633. package/src/components/PageControl/PageControl.tsx +23 -23
  634. package/src/components/PageControl/PageControlExample.tsx +36 -0
  635. package/src/components/Pagination/Pagination.rtl.test.tsx +15 -0
  636. package/src/components/Pagination/Pagination.tsx +2 -7
  637. package/src/components/PasswordField/PasswordField.rtl.test.tsx +24 -0
  638. package/src/components/PasswordField/PasswordField.tsx +4 -5
  639. package/src/components/PasswordInput/PasswordInput.rtl.test.tsx +15 -0
  640. package/src/components/PasswordInput/PasswordInput.tsx +2 -2
  641. package/src/components/PhoneNumberField/PhoneNumberField.rtl.test.tsx +24 -0
  642. package/src/components/PhoneNumberInput/PhoneNumberInput.rtl.test.tsx +17 -0
  643. package/src/components/PhoneNumberInput/PhoneNumberInput.tsx +103 -144
  644. package/src/components/PhoneNumberInput/PhoneNumberInputExample.tsx +8 -0
  645. package/src/components/PhoneNumberInput/phone-number-input.scss +40 -31
  646. package/src/components/Popover/Popover.rtl.test.tsx +28 -0
  647. package/src/components/Popover/Popover.tsx +82 -72
  648. package/src/components/Popover/PopoverExample.tsx +7 -1
  649. package/src/components/Popover/popover.scss +3 -13
  650. package/src/components/Portal/Portal.rtl.test.tsx +15 -0
  651. package/src/components/ProgressBar/ProgressBar.rtl.test.tsx +15 -0
  652. package/src/components/ProgressBar/ProgressBar.tsx +1 -2
  653. package/src/components/ProgressCircle/ProgressCircle.rtl.test.tsx +15 -0
  654. package/src/components/ProgressCircle/ProgressCircle.tsx +1 -2
  655. package/src/components/ProgressionStepper/ProgressionStepper.rtl.test.tsx +19 -0
  656. package/src/components/ProgressionStepper/ProgressionStepper.tsx +2 -4
  657. package/src/components/ProgressionStepper/ProgressionStepperExample.tsx +49 -47
  658. package/src/components/ProgressionStepperBar/ProgressionStepperBar.rtl.test.tsx +15 -0
  659. package/src/components/ProgressionStepperBar/ProgressionStepperBar.tsx +9 -4
  660. package/src/components/Radio/Radio.rtl.test.tsx +15 -0
  661. package/src/components/Radio/Radio.tsx +1 -3
  662. package/src/components/RadioGroup/RadioGroup.rtl.test.tsx +32 -0
  663. package/src/components/RadioGroup/RadioGroup.tsx +2 -3
  664. package/src/components/RadioGroup/RadioGroupExample.tsx +3 -1
  665. package/src/components/RadioOption/RadioOption.rtl.test.tsx +15 -0
  666. package/src/components/RadioOption/RadioOption.tsx +1 -1
  667. package/src/components/Rating/Rating.rtl.test.tsx +16 -0
  668. package/src/components/Rating/Rating.tsx +9 -12
  669. package/src/components/Rating/RatingExample.tsx +11 -9
  670. package/src/components/Scrim/Scrim.rtl.test.tsx +15 -0
  671. package/src/components/Scrim/Scrim.tsx +11 -4
  672. package/src/components/Scrim/scrim.scss +0 -4
  673. package/src/components/SearchBar/SearchBar.rtl.test.tsx +41 -0
  674. package/src/components/SearchBar/SearchBar.tsx +95 -89
  675. package/src/components/SearchBar/SearchBarExample.tsx +3 -20
  676. package/src/components/SegmentedControl/SegmentedControl.rtl.test.tsx +26 -0
  677. package/src/components/SegmentedControl/SegmentedControl.tsx +2 -4
  678. package/src/components/SegmentedControl/SegmentedControlExample.tsx +34 -24
  679. package/src/components/SegmentedControl/segmented-control.scss +19 -14
  680. package/src/components/Select/Select.rtl.test.tsx +25 -0
  681. package/src/components/Select/Select.tsx +229 -102
  682. package/src/components/Select/SelectExample.tsx +111 -91
  683. package/src/components/Select/select.scss +13 -23
  684. package/src/components/SelectField/SelectField.rtl.test.tsx +25 -0
  685. package/src/components/SelectField/SelectFieldExample.tsx +16 -0
  686. package/src/components/Skeleton/Skeleton.rtl.test.tsx +16 -0
  687. package/src/components/Skeleton/SkeletonExample.tsx +12 -10
  688. package/src/components/SkeletonText/SkeletonText.rtl.test.tsx +16 -0
  689. package/src/components/SkeletonText/SkeletonTextExample.tsx +14 -13
  690. package/src/components/Slider/Slider.rtl.test.tsx +8 -0
  691. package/src/components/Slider/Slider.tsx +1 -2
  692. package/src/components/Slider/SliderExample.tsx +3 -0
  693. package/src/components/Snackbar/Snackbar.tsx +48 -0
  694. package/src/components/Snackbar/SnackbarExample.tsx +12 -0
  695. package/src/components/Snackbar/index.tsx +1 -0
  696. package/src/components/Snackbar/snackbar.scss +22 -0
  697. package/src/components/SnackbarProvider/SnackbarProvider.tsx +160 -0
  698. package/src/components/SnackbarProvider/SnackbarProviderExample.tsx +127 -0
  699. package/src/components/SnackbarProvider/index.tsx +1 -0
  700. package/src/components/SnackbarProvider/snackbar-provider-example.scss +17 -0
  701. package/src/components/SnackbarProvider/snackbar-provider.scss +15 -0
  702. package/src/components/Switch/Switch.rtl.test.tsx +15 -0
  703. package/src/components/Switch/Switch.tsx +1 -3
  704. package/src/components/SwitchOption/SwitchOption.rtl.test.tsx +15 -0
  705. package/src/components/TabGroup/TabGroup.rtl.test.tsx +19 -0
  706. package/src/components/TabGroup/TabGroup.tsx +1 -2
  707. package/src/components/TabGroup/TabGroupExample.tsx +52 -46
  708. package/src/components/TabGroup/tab-group.scss +7 -5
  709. package/src/components/TabList/TabList.rtl.test.tsx +26 -0
  710. package/src/components/TabList/TabList.tsx +36 -31
  711. package/src/components/TabList/tab-list.scss +6 -9
  712. package/src/components/Table/Table.rtl.test.tsx +28 -0
  713. package/src/components/Tag/Tag.rtl.test.tsx +20 -0
  714. package/src/components/Tag/Tag.tsx +1 -3
  715. package/src/components/Tag/TagExample.tsx +14 -12
  716. package/src/components/TextField/TextField.rtl.test.tsx +24 -0
  717. package/src/components/TextField/TextField.tsx +0 -1
  718. package/src/components/TextField/TextFieldExample.tsx +8 -0
  719. package/src/components/TextInput/TextInput.rtl.test.tsx +17 -0
  720. package/src/components/TextInput/TextInput.tsx +46 -12
  721. package/src/components/TextInput/TextInputExample.tsx +9 -0
  722. package/src/components/TextInput/text-input.scss +9 -31
  723. package/src/components/Textarea/Textarea.rtl.test.tsx +17 -0
  724. package/src/components/Textarea/Textarea.tsx +5 -16
  725. package/src/components/TextareaField/TextareaField.rtl.test.tsx +24 -0
  726. package/src/components/TextareaField/TextareaField.tsx +2 -0
  727. package/src/components/TimeInput/Listbox.tsx +37 -64
  728. package/src/components/TimeInput/Segment.tsx +31 -21
  729. package/src/components/TimeInput/TimeInput.rtl.test.tsx +15 -0
  730. package/src/components/TimeInput/TimeInput.tsx +132 -65
  731. package/src/components/TimeInput/time-input.scss +5 -4
  732. package/src/components/ToggleOption/ToggleOption.rtl.test.tsx +15 -0
  733. package/src/components/ToggleOption/ToggleOption.tsx +1 -2
  734. package/src/components/Tooltip/Tooltip.rtl.test.tsx +24 -0
  735. package/src/components/Tooltip/Tooltip.tsx +14 -31
  736. package/src/components/Tooltip/TooltipExample.tsx +6 -8
  737. package/src/components/Tooltip/tooltip.scss +0 -2
  738. package/src/components/TopNavigation/TopNavigation.rtl.test.tsx +15 -0
  739. package/src/components/Truncated/Truncated.rtl.test.tsx +15 -0
  740. package/src/components/Truncated/Truncated.tsx +2 -9
  741. package/src/components/Truncated/truncated.scss +8 -0
  742. package/src/components/Txt/Txt.rtl.test.tsx +15 -0
  743. package/src/components/UIProvider/AriaLiveMessageHandler.tsx +44 -0
  744. package/src/components/UIProvider/UIProvider.tsx +16 -2
  745. package/src/components/UIProvider/UIProviderExample.tsx +146 -0
  746. package/src/constants/phases.ts +0 -1
  747. package/src/hooks/useAddEventListener.ts +3 -1
  748. package/src/hooks/useArrowNavigation.ts +107 -0
  749. package/src/hooks/useContainerWidth.tsx +37 -0
  750. package/src/hooks/useFloating.ts +20 -19
  751. package/src/hooks/useSnackbarContext.ts +18 -0
  752. package/src/hooks/useSwipe.ts +32 -0
  753. package/src/rtl/hasNoBasicA11yIssues.tsx +27 -0
  754. package/src/rtl/util.tsx +10 -0
  755. package/src/styles/base.scss +131 -70
  756. package/src/types/common.ts +9 -4
  757. package/src/types/meta.ts +1 -9
  758. package/src/utils/createExampleChildElement.tsx +1 -1
  759. package/src/utils/demo.ts +41 -7
  760. package/src/utils/dom.ts +6 -0
  761. package/src/utils/handleKeyDown.ts +11 -6
  762. package/src/utils/keyboard.ts +3 -0
  763. package/src/utils/scrollListItemsStyle.ts +29 -0
  764. package/src/utils/snackbarContext.tsx +43 -0
  765. package/src/utils/uiContext.ts +4 -1
  766. package/src/utils/useIds.ts +16 -0
  767. package/tsconfig.build.json +21 -0
  768. package/tsconfig.json +9 -1
  769. package/dist/components/Accordion/AccordionSection.d.ts +0 -84
  770. package/dist/components/Accordion/AccordionSection.js +0 -27
  771. package/dist/components/Accordion/AccordionSection.js.map +0 -1
  772. package/dist/components/Combobox/Combobox.d.ts +0 -92
  773. package/dist/components/Combobox/Combobox.js +0 -58
  774. package/dist/components/Combobox/Combobox.js.map +0 -1
  775. package/dist/components/Combobox/ListItems.d.ts +0 -26
  776. package/dist/components/Combobox/ListItems.js +0 -22
  777. package/dist/components/Combobox/ListItems.js.map +0 -1
  778. package/dist/components/Combobox/index.d.ts +0 -1
  779. package/dist/components/Combobox/index.js +0 -2
  780. package/dist/components/Combobox/index.js.map +0 -1
  781. package/dist/components/Listbox/Listbox.d.ts +0 -116
  782. package/dist/components/Listbox/Listbox.js +0 -83
  783. package/dist/components/Listbox/Listbox.js.map +0 -1
  784. package/dist/components/Listbox/index.d.ts +0 -1
  785. package/dist/components/Listbox/index.js +0 -2
  786. package/dist/components/Listbox/index.js.map +0 -1
  787. package/dist/hooks/useCombobox.d.ts +0 -56
  788. package/dist/hooks/useCombobox.js +0 -104
  789. package/dist/hooks/useCombobox.js.map +0 -1
  790. package/dist/hooks/useKeyNavigation.d.ts +0 -17
  791. package/dist/hooks/useKeyNavigation.js +0 -46
  792. package/dist/hooks/useKeyNavigation.js.map +0 -1
  793. package/src/components/Accordion/AccordionSection.tsx +0 -128
  794. package/src/components/Combobox/Combobox.tsx +0 -224
  795. package/src/components/Combobox/ListItems.tsx +0 -107
  796. package/src/components/Combobox/index.tsx +0 -1
  797. package/src/components/Listbox/Listbox.tsx +0 -257
  798. package/src/components/Listbox/index.tsx +0 -1
  799. package/src/hooks/useCombobox.ts +0 -173
  800. package/src/hooks/useKeyNavigation.ts +0 -66
  801. package/src/utils/placeholder.test.ts +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bspk/ui",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "license": "CC-BY-4.0",
5
5
  "type": "module",
6
6
  "files": [
@@ -9,10 +9,13 @@
9
9
  "README.md",
10
10
  "LICENSE",
11
11
  "meta.ts",
12
- "meta-types.ts",
13
12
  "build.ts",
14
- "tsconfig.json"
13
+ "tsconfig.json",
14
+ "tsconfig.build.json"
15
15
  ],
16
+ "bin": {
17
+ "ui": "./.scripts/index.ts"
18
+ },
16
19
  "scripts": {
17
20
  "sass": "npx sass --no-source-map --silence-deprecation=mixed-decls src:dist",
18
21
  "build": "npx tsx build.ts",
@@ -21,14 +24,15 @@
21
24
  "lint": "eslint && tsc --noEmit && stylelint '**/*.scss'",
22
25
  "lint:fix": "eslint --fix",
23
26
  "semantic-release": "semantic-release",
24
- "test": "jest",
27
+ "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ./node_modules/.bin/jest",
25
28
  "prepare": "husky",
26
29
  "pre:commit": "tsx .scripts/pre-commit.ts",
27
30
  "meta": "tsx meta.ts",
28
31
  "pretty": "npx prettier --write src/",
29
32
  "newc": "tsx .scripts/tasks/new-component.ts",
33
+ "create:tests": "tsx .scripts/tasks/create-tests.ts",
30
34
  "clean": "tsx .scripts/clean.ts",
31
- "pr-check": "npx tsx .scripts/tasks/lint-components.ts && npm run lint && npm run lint:css && npx tsx .scripts/check-css-vars.ts && npm run build"
35
+ "pr-check": "npx tsx .scripts/tasks/lint-components.ts && npm run lint && npm run lint:css && npx tsx .scripts/check-css-vars.ts && npm run build && npm run test"
32
36
  },
33
37
  "static-exports": {
34
38
  "./*": "./dist/*.js"
@@ -47,12 +51,20 @@
47
51
  "./BadgeDot/*": "./dist/components/BadgeDot/*.js",
48
52
  "./BannerAlert": "./dist/components/BannerAlert/index.js",
49
53
  "./BannerAlert/*": "./dist/components/BannerAlert/*.js",
54
+ "./BottomNavigation": "./dist/components/BottomNavigation/index.js",
55
+ "./BottomNavigation/*": "./dist/components/BottomNavigation/*.js",
50
56
  "./Breadcrumb": "./dist/components/Breadcrumb/index.js",
51
57
  "./Breadcrumb/*": "./dist/components/Breadcrumb/*.js",
52
58
  "./Button": "./dist/components/Button/index.js",
53
59
  "./Button/*": "./dist/components/Button/*.js",
60
+ "./ButtonDock": "./dist/components/ButtonDock/index.js",
61
+ "./ButtonDock/*": "./dist/components/ButtonDock/*.js",
62
+ "./CalendarPicker": "./dist/components/CalendarPicker/index.js",
63
+ "./CalendarPicker/*": "./dist/components/CalendarPicker/*.js",
54
64
  "./Card": "./dist/components/Card/index.js",
55
65
  "./Card/*": "./dist/components/Card/*.js",
66
+ "./Carousel": "./dist/components/Carousel/index.js",
67
+ "./Carousel/*": "./dist/components/Carousel/*.js",
56
68
  "./Checkbox": "./dist/components/Checkbox/index.js",
57
69
  "./Checkbox/*": "./dist/components/Checkbox/*.js",
58
70
  "./CheckboxGroup": "./dist/components/CheckboxGroup/index.js",
@@ -71,12 +83,16 @@
71
83
  "./ChipSuggestion/*": "./dist/components/ChipSuggestion/*.js",
72
84
  "./ChipUtility": "./dist/components/ChipUtility/index.js",
73
85
  "./ChipUtility/*": "./dist/components/ChipUtility/*.js",
74
- "./Combobox": "./dist/components/Combobox/index.js",
75
- "./Combobox/*": "./dist/components/Combobox/*.js",
86
+ "./DateField": "./dist/components/DateField/index.js",
87
+ "./DateField/*": "./dist/components/DateField/*.js",
88
+ "./DateInput": "./dist/components/DateInput/index.js",
89
+ "./DateInput/*": "./dist/components/DateInput/*.js",
76
90
  "./Dialog": "./dist/components/Dialog/index.js",
77
91
  "./Dialog/*": "./dist/components/Dialog/*.js",
78
92
  "./Divider": "./dist/components/Divider/index.js",
79
93
  "./Divider/*": "./dist/components/Divider/*.js",
94
+ "./Drawer": "./dist/components/Drawer/index.js",
95
+ "./Drawer/*": "./dist/components/Drawer/*.js",
80
96
  "./EmptyState": "./dist/components/EmptyState/index.js",
81
97
  "./EmptyState/*": "./dist/components/EmptyState/*.js",
82
98
  "./ExamplePlaceholder": "./dist/components/ExamplePlaceholder/index.js",
@@ -97,10 +113,10 @@
97
113
  "./Layout/*": "./dist/components/Layout/*.js",
98
114
  "./Link": "./dist/components/Link/index.js",
99
115
  "./Link/*": "./dist/components/Link/*.js",
100
- "./Listbox": "./dist/components/Listbox/index.js",
101
- "./Listbox/*": "./dist/components/Listbox/*.js",
102
116
  "./ListItem": "./dist/components/ListItem/index.js",
103
117
  "./ListItem/*": "./dist/components/ListItem/*.js",
118
+ "./ListItemMenu": "./dist/components/ListItemMenu/index.js",
119
+ "./ListItemMenu/*": "./dist/components/ListItemMenu/*.js",
104
120
  "./Menu": "./dist/components/Menu/index.js",
105
121
  "./Menu/*": "./dist/components/Menu/*.js",
106
122
  "./MenuButton": "./dist/components/MenuButton/index.js",
@@ -161,6 +177,10 @@
161
177
  "./SkeletonText/*": "./dist/components/SkeletonText/*.js",
162
178
  "./Slider": "./dist/components/Slider/index.js",
163
179
  "./Slider/*": "./dist/components/Slider/*.js",
180
+ "./Snackbar": "./dist/components/Snackbar/index.js",
181
+ "./Snackbar/*": "./dist/components/Snackbar/*.js",
182
+ "./SnackbarProvider": "./dist/components/SnackbarProvider/index.js",
183
+ "./SnackbarProvider/*": "./dist/components/SnackbarProvider/*.js",
164
184
  "./StylesProviderAnywhere": "./dist/components/StylesProviderAnywhere/index.js",
165
185
  "./StylesProviderAnywhere/*": "./dist/components/StylesProviderAnywhere/*.js",
166
186
  "./StylesProviderBetterHomesGardens": "./dist/components/StylesProviderBetterHomesGardens/index.js",
@@ -223,13 +243,14 @@
223
243
  "node": ">=20"
224
244
  },
225
245
  "dependencies": {
246
+ "@bspk/icons": "^1.0.5",
226
247
  "@bspk/styles": "^1.0.2",
227
248
  "@floating-ui/dom": "^1.6.13",
249
+ "date-fns": "^4.1.0",
228
250
  "focus-trap-react": "^11.0.1",
229
251
  "libphonenumber-js": "^1.12.9"
230
252
  },
231
253
  "peerDependencies": {
232
- "@bspk/icons": "^1.0.4",
233
254
  "react": "^18.3.1",
234
255
  "react-dom": "^18.3.1"
235
256
  },
@@ -241,9 +262,13 @@
241
262
  "@semantic-release/git": "^10.0.1",
242
263
  "@semantic-release/github": "^11.0.2",
243
264
  "@semantic-release/npm": "^12.0.1",
265
+ "@testing-library/jest-dom": "^6.8.0",
266
+ "@testing-library/react": "^16.3.0",
267
+ "@testing-library/user-event": "^14.6.1",
244
268
  "@types/eslint-config-prettier": "^6.11.3",
245
269
  "@types/eslint-plugin-jsx-a11y": "^6.10.0",
246
270
  "@types/jest": "^29.5.14",
271
+ "@types/jest-axe": "^3.5.9",
247
272
  "@types/node": "^22.10.2",
248
273
  "@types/react": "^18.3.12",
249
274
  "@types/react-dom": "^18.3.5",
@@ -257,14 +282,18 @@
257
282
  "eslint-plugin-react-hooks": "^5.0.0",
258
283
  "globals": "^15.12.0",
259
284
  "husky": "^9.1.7",
260
- "jest": "^29.7.0",
285
+ "identity-obj-proxy": "^3.0.0",
286
+ "inquirer": "^12.9.6",
287
+ "jest": "^30.0.0",
288
+ "jest-axe": "^10.0.0",
289
+ "jest-environment-jsdom": "^30.1.2",
261
290
  "prettier-plugin-jsdoc": "^1.3.0",
262
291
  "sass": "^1.89.2",
263
292
  "semantic-release": "^24.2.0",
264
293
  "stylelint": "^16.19.1",
265
294
  "stylelint-config-standard": "^38.0.0",
266
295
  "stylelint-config-standard-scss": "^14.0.0",
267
- "ts-jest": "^29.2.5",
296
+ "ts-jest": "^29.4.3",
268
297
  "tslib": "^2.8.1",
269
298
  "tsx": "^4.19.4",
270
299
  "typescript": "5.6.3",
@@ -0,0 +1,17 @@
1
+ import { Accordion } from './Accordion';
2
+ import { presets } from './AccordionExample';
3
+ import { hasNoBasicA11yIssues } from '-/rtl/hasNoBasicA11yIssues';
4
+ import { render } from '-/rtl/util';
5
+
6
+ describe('Accordion (RTL)', () => {
7
+ presets.forEach((preset) => {
8
+ it(`has no basic a11y issues - ${preset.label}`, hasNoBasicA11yIssues(<Accordion {...preset.propState} />));
9
+ });
10
+
11
+ it('renders its sections', () => {
12
+ const { getByText } = render(<Accordion {...presets[0].propState} />);
13
+
14
+ expect(getByText('Section 2')).toBeInTheDocument();
15
+ expect(getByText('Section 3')).toBeInTheDocument();
16
+ });
17
+ });
@@ -1,17 +1,56 @@
1
- import { useEffect, useState } from 'react';
2
- import { AccordionSectionProps, AccordionSection } from './AccordionSection';
3
1
  import './accordion.scss';
2
+ import { SvgKeyboardArrowDown } from '@bspk/icons/KeyboardArrowDown';
3
+ import { SvgKeyboardArrowUp } from '@bspk/icons/KeyboardArrowUp';
4
+ import { ReactNode, useEffect, useMemo, useState } from 'react';
5
+ import { randomString } from '-/utils/random';
4
6
 
5
- export type AccordionItem = Omit<AccordionSectionProps, 'toggleOpen'>;
7
+ export type AccordionSection = {
8
+ /**
9
+ * The content of the accordion.
10
+ *
11
+ * @required
12
+ */
13
+ children: ReactNode;
14
+ /**
15
+ * The title of the accordion.
16
+ *
17
+ * @required
18
+ */
19
+ title: string;
20
+ /** The subtitle of the accordion. */
21
+ subtitle?: string;
22
+ /** The leading element to display in the accordion header. */
23
+ leading?: ReactNode;
24
+ /** The trailing element to display in the accordion header. */
25
+ trailing?: ReactNode;
26
+ /**
27
+ * If the accordion is initially open.
28
+ *
29
+ * @default false
30
+ */
31
+ isOpen?: boolean;
32
+ /**
33
+ * Indicates whether the accordion is disabled.
34
+ *
35
+ * @default false
36
+ */
37
+ disabled?: boolean;
38
+ /**
39
+ * The unique identifier for the accordion item.
40
+ *
41
+ * If not provided it will be generated automatically.
42
+ */
43
+ id?: string;
44
+ };
6
45
 
7
46
  export type AccordionProps = {
8
47
  /**
9
48
  * Array of accordion sections
10
49
  *
11
- * @type Array<AccordionItem>
50
+ * @type Array<AccordionSection>
12
51
  * @required
13
52
  */
14
- items: AccordionItem[];
53
+ items: AccordionSection[];
15
54
  /**
16
55
  * If true only one accordion section can be opened at a time
17
56
  *
@@ -34,40 +73,64 @@ export type AccordionProps = {
34
73
  * @name Accordion
35
74
  * @phase UXReview
36
75
  */
37
- export function Accordion({ items, singleOpen = true }: AccordionProps) {
38
- const [activeItems, setActiveItems] = useState<(number | string)[]>(() => {
76
+ export function Accordion({ items: itemsProp, singleOpen = true }: AccordionProps) {
77
+ const items = useMemo(
78
+ () =>
79
+ itemsProp.map((item) => ({
80
+ ...item,
81
+ id: item.id || `accordion-item-${randomString(8)}`,
82
+ })),
83
+ [itemsProp],
84
+ );
85
+
86
+ const [openSections, setOpenSections] = useState<string[]>(() => {
39
87
  return items.filter((item) => item.isOpen).map((item) => item.id);
40
88
  });
41
89
 
42
90
  useEffect(() => {
43
- // Update active items based on the items prop
44
- setActiveItems(items.filter((item) => item.isOpen).map((item) => item.id));
91
+ // Update open sections based on the items prop
92
+ setOpenSections(items.filter((item) => item.isOpen).map((item) => item.id));
45
93
  }, [items]);
46
94
 
47
- const toggleOpen = (itemId: number | string) => {
48
- setActiveItems((prevItems) => {
49
- const isItemActive = prevItems.includes(itemId);
95
+ const toggleOpen = (itemId: string) => () =>
96
+ setOpenSections((prev) => {
97
+ const isSectionOpen = prev.includes(itemId);
50
98
 
51
99
  // If singleOpen is true, reset activeItems to only include the clicked item or empty if it was already active
52
- if (singleOpen) return isItemActive ? [] : [itemId];
100
+ if (singleOpen) return isSectionOpen ? [] : [itemId];
53
101
 
54
102
  // If singleOpen is false, toggle the clicked item and keep others active
55
- return isItemActive ? prevItems.filter((activeItemId) => activeItemId !== itemId) : [...prevItems, itemId];
103
+ return isSectionOpen ? prev.filter((activeItemId) => activeItemId !== itemId) : [...prev, itemId];
56
104
  });
57
- };
58
105
 
59
106
  return (
60
107
  <div data-bspk="accordion">
61
- {items.map((item, index) => {
108
+ {items.map(({ children, title, subtitle: subtitle, leading, trailing, disabled, id }, index) => {
109
+ const isOpen = openSections.includes(id);
62
110
  return (
63
- <AccordionSection
64
- {...item}
65
- isOpen={activeItems.includes(item.id)}
66
- key={`${item.id}-${index}`}
67
- toggleOpen={() => toggleOpen(item.id)}
68
- >
69
- {item.children}
70
- </AccordionSection>
111
+ <section data-disabled={disabled || undefined} id={id} key={id || index}>
112
+ <button
113
+ aria-controls={`${id}-content`}
114
+ aria-expanded={isOpen}
115
+ data-header
116
+ disabled={disabled || undefined}
117
+ onClick={!disabled ? toggleOpen(id) : undefined}
118
+ >
119
+ {leading && <span data-leading>{leading}</span>}
120
+ <span data-title-subtitle>
121
+ <span data-title>{title}</span>
122
+ {subtitle && <span data-subtitle>{subtitle}</span>}
123
+ </span>
124
+ {trailing && <span data-trailing>{trailing}</span>}
125
+ <span data-arrow>{isOpen ? <SvgKeyboardArrowUp /> : <SvgKeyboardArrowDown />}</span>
126
+ </button>
127
+ {isOpen && (
128
+ <div data-content data-hidden={!isOpen || undefined} id={`${id}-content`}>
129
+ {children}
130
+ </div>
131
+ )}
132
+ <span data-divider />
133
+ </section>
71
134
  );
72
135
  })}
73
136
  </div>
@@ -1,6 +1,6 @@
1
1
  import { AccordionProps } from '.';
2
- import { createExampleChildElement } from '-/utils/createExampleChildElement';
3
- import { ComponentExampleFn } from '-/utils/demo';
2
+ import { Avatar } from '-/components/Avatar';
3
+ import { ComponentExampleFn, Preset } from '-/utils/demo';
4
4
 
5
5
  const AccordionContent = () => (
6
6
  <p>
@@ -9,79 +9,85 @@ const AccordionContent = () => (
9
9
  </p>
10
10
  );
11
11
 
12
- export const AccordionExample: ComponentExampleFn<AccordionProps> = ({ action, setState }) => ({
13
- containerStyle: { minHeight: 225 },
14
- render: ({ props, Component, id, preset }) => {
15
- const trailing = createExampleChildElement({
16
- exampleState: props,
17
- name: 'trailing',
18
- setState,
19
- action,
20
- id,
21
- });
22
- const leading = createExampleChildElement({
23
- exampleState: props,
24
- name: 'leading',
25
- setState,
26
- action,
27
- id,
28
- });
29
-
30
- return (
31
- <>
32
- <Component
33
- {...props}
34
- items={[
35
- {
36
- id: '1',
37
- title: `Section 1`,
38
- leading: leading.element,
39
- trailing: trailing.element,
40
- children: <AccordionContent />,
41
- },
42
- ...(props.items ?? []),
43
- ]}
44
- key={preset?.label}
45
- />
46
- </>
47
- );
12
+ export const presets: Preset<AccordionProps>[] = [
13
+ {
14
+ label: 'Multiple Sections',
15
+ propState: {
16
+ items: [
17
+ {
18
+ id: '1',
19
+ title: `Section 1`,
20
+ subtitle: 'Subtitle',
21
+ children: <AccordionContent />,
22
+ },
23
+ {
24
+ id: '2',
25
+ title: 'Section 2',
26
+ children: <AccordionContent />,
27
+ leading: <Avatar name="Avatar" size="small" />,
28
+ trailing: <span>Trailing</span>,
29
+ },
30
+ {
31
+ id: '3',
32
+ title: 'Section 3',
33
+ children: <AccordionContent />,
34
+ },
35
+ ],
36
+ },
48
37
  },
49
- presets: [
50
- {
51
- label: 'Multiple Sections',
52
- propState: {
53
- items: [
54
- {
55
- id: '2',
56
- title: 'Section 2',
57
- children: <AccordionContent />,
58
- },
59
- {
60
- id: '3',
61
- title: 'Section 3',
62
- children: <AccordionContent />,
63
- },
64
- ],
65
- },
38
+ {
39
+ label: 'Multiple Sections with 1 disabled',
40
+ propState: {
41
+ items: [
42
+ {
43
+ id: '1',
44
+ title: `Section 1`,
45
+ children: <AccordionContent />,
46
+ },
47
+ { id: '2', title: 'Section 2', disabled: true, children: <AccordionContent /> },
48
+ { id: '3', title: 'Section 3', children: <AccordionContent /> },
49
+ ],
66
50
  },
67
- {
68
- label: 'Multiple Sections with 1 disabled',
69
- propState: {
70
- items: [
71
- { id: '2', title: 'Section 2', disabled: true, children: <AccordionContent /> },
72
- { id: '3', title: 'Section 3', children: <AccordionContent /> },
73
- ],
74
- },
51
+ },
52
+ {
53
+ label: 'Multiple Sections with 1 disabled and open',
54
+ propState: {
55
+ items: [
56
+ {
57
+ id: '1',
58
+ title: `Section 1`,
59
+ children: <AccordionContent />,
60
+ },
61
+ { id: '2', title: 'Section 2', disabled: true, isOpen: true, children: <AccordionContent /> },
62
+ { id: '3', title: 'Section 3', children: <AccordionContent /> },
63
+ ],
75
64
  },
76
- {
77
- label: 'Multiple Sections with 1 disabled and open',
78
- propState: {
79
- items: [
80
- { id: '2', title: 'Section 2', disabled: true, isOpen: true, children: <AccordionContent /> },
81
- { id: '3', title: 'Section 3', children: <AccordionContent /> },
82
- ],
65
+ },
66
+ ];
67
+
68
+ export const AccordionExample: ComponentExampleFn<AccordionProps> = () => ({
69
+ containerStyle: { minHeight: 225 },
70
+ defaultState: {
71
+ items: [
72
+ {
73
+ id: '1',
74
+ title: `Section 1`,
75
+ children: <AccordionContent />,
83
76
  },
84
- },
85
- ],
77
+ {
78
+ id: '2',
79
+ title: 'Section 2',
80
+ children: <AccordionContent />,
81
+ leading: <Avatar name="Avatar" size="small" />,
82
+ trailing: <span>Trailing</span>,
83
+ },
84
+ {
85
+ id: '3',
86
+ title: 'Section 3',
87
+ children: <AccordionContent />,
88
+ },
89
+ ],
90
+ },
91
+ presets,
86
92
  variants: false,
87
93
  });
@@ -1,22 +1,14 @@
1
1
  [data-bspk='accordion'] {
2
2
  width: 100%;
3
+ padding: var(--spacing-sizing-02);
3
4
 
4
- [data-accordion-section] {
5
+ > section {
5
6
  --border-bottom-color: var(--stroke-neutral-base);
6
7
 
7
8
  display: flex;
8
9
  flex-direction: column;
9
10
  justify-content: center;
10
-
11
- &[data-divider] {
12
- [data-not-a-divider-divider] {
13
- display: block;
14
- height: 1px;
15
- width: calc(100% - var(--spacing-sizing-04));
16
- margin: -1px var(--spacing-sizing-02) 0;
17
- background-color: var(--border-bottom-color);
18
- }
19
- }
11
+ color: var(--foreground-neutral-on-surface);
20
12
 
21
13
  &[data-disabled] {
22
14
  --border-bottom-color: var(--stroke-neutral-disabled-light);
@@ -27,38 +19,43 @@
27
19
  color: var(--foreground-neutral-disabled-on-surface);
28
20
  }
29
21
 
30
- [data-accordion-header] {
22
+ button[data-header] {
31
23
  display: flex;
32
24
  flex-direction: row;
33
25
  align-items: center;
34
26
  background: none;
35
27
  color: inherit;
36
28
  border: none;
37
- padding: var(--spacing-sizing-02);
38
- gap: var(--spacing-sizing-04);
29
+ padding: 0 var(--spacing-sizing-02);
30
+ gap: var(--spacing-sizing-02);
39
31
  font: inherit;
40
- outline: inherit;
41
32
  cursor: pointer;
33
+ outline: none;
34
+ min-height: var(--spacing-sizing-12);
42
35
 
43
- [data-accordion-header-body] {
44
- display: flex;
45
- align-items: center;
46
- flex-direction: row;
47
- flex: 1;
48
- gap: var(--spacing-sizing-03);
49
- }
50
-
51
- [data-accordion-title-wrapper] {
36
+ [data-title-subtitle] {
52
37
  display: flex;
53
38
  flex-direction: column;
54
39
  align-items: flex-start;
55
40
  flex: 1;
56
41
 
57
- [data-bspk='txt'] {
58
- text-align: left;
42
+ [data-title] {
43
+ font: var(--labels-base);
44
+ }
45
+
46
+ [data-subtitle] {
47
+ font: var(--body-x-small);
48
+ color: var(--foreground-neutral-on-surface-variant-01);
59
49
  }
60
50
  }
61
51
 
52
+ [data-arrow] {
53
+ display: flex;
54
+ align-items: center;
55
+ justify-content: center;
56
+ margin-left: var(--spacing-sizing-02);
57
+ }
58
+
62
59
  &:not(:disabled) {
63
60
  &:hover {
64
61
  background-image:
@@ -77,12 +74,6 @@
77
74
  ),
78
75
  linear-gradient(var(--surface-neutral-t1-base), var(--surface-neutral-t1-base));
79
76
  }
80
-
81
- &:focus-visible {
82
- outline: 2px solid var(--stroke-neutral-focus);
83
- border-color: var(--stroke-neutral-focus);
84
- margin-bottom: 1px;
85
- }
86
77
  }
87
78
 
88
79
  &:disabled {
@@ -92,14 +83,24 @@
92
83
  }
93
84
  }
94
85
 
95
- [data-accordion-content] {
96
- padding: var(--spacing-sizing-01) var(--spacing-sizing-02) var(--spacing-sizing-04);
86
+ &:has(:focus-visible) {
87
+ outline: 2px solid var(--stroke-neutral-focus);
88
+ border-color: var(--stroke-neutral-focus);
89
+ margin-bottom: 1px;
97
90
  }
98
91
 
99
- [data-not-a-divider-divider] {
100
- display: none;
92
+ [data-content] {
93
+ padding: var(--spacing-sizing-01) var(--spacing-sizing-02) var(--spacing-sizing-04);
101
94
  }
102
95
  }
96
+
97
+ [data-divider] {
98
+ display: block;
99
+ height: 1px;
100
+ width: calc(100% - var(--spacing-sizing-04));
101
+ margin: -1px var(--spacing-sizing-02) 0;
102
+ background-color: var(--border-bottom-color);
103
+ }
103
104
  }
104
105
 
105
106
  /** Copyright 2025 Anywhere Real Estate - CC BY 4.0 */
@@ -0,0 +1,16 @@
1
+ import { Avatar } from './Avatar';
2
+ import { presets } from './AvatarExample';
3
+ import { hasNoBasicA11yIssues } from '-/rtl/hasNoBasicA11yIssues';
4
+ import { render } from '-/rtl/util';
5
+
6
+ describe('Avatar (RTL)', () => {
7
+ presets.forEach((preset) => {
8
+ it(`has no basic a11y issues - ${preset.label}`, hasNoBasicA11yIssues(<Avatar {...preset.propState} />));
9
+ });
10
+
11
+ it('renders', () => {
12
+ const { getByText } = render(<Avatar {...presets[0].propState} />);
13
+
14
+ expect(getByText('AG')).toBeInTheDocument();
15
+ });
16
+ });