@bspk/ui 1.3.8 → 1.3.10

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 (466) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +19 -3
  2. package/dist/components/Accordion/Accordion.js +20 -3
  3. package/dist/components/Accordion/Accordion.js.map +1 -1
  4. package/dist/components/Avatar/Avatar.d.ts +13 -14
  5. package/dist/components/Avatar/Avatar.js +13 -14
  6. package/dist/components/Avatar/Avatar.js.map +1 -1
  7. package/dist/components/AvatarGroup/AvatarGroup.d.ts +29 -12
  8. package/dist/components/AvatarGroup/AvatarGroup.js +29 -12
  9. package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -1
  10. package/dist/components/Badge/Badge.d.ts +1 -3
  11. package/dist/components/Badge/Badge.js +1 -3
  12. package/dist/components/Badge/Badge.js.map +1 -1
  13. package/dist/components/BadgeDot/BadgeDot.d.ts +4 -4
  14. package/dist/components/BadgeDot/BadgeDot.js +5 -4
  15. package/dist/components/BadgeDot/BadgeDot.js.map +1 -1
  16. package/dist/components/BannerAlert/BannerAlert.d.ts +11 -12
  17. package/dist/components/BannerAlert/BannerAlert.js +11 -12
  18. package/dist/components/BannerAlert/BannerAlert.js.map +1 -1
  19. package/dist/components/BottomNavigation/BottomNavigation.d.ts +6 -3
  20. package/dist/components/BottomNavigation/BottomNavigation.js +6 -3
  21. package/dist/components/BottomNavigation/BottomNavigation.js.map +1 -1
  22. package/dist/components/BottomNavigation/BottomNavigationExample.js +31 -36
  23. package/dist/components/BottomNavigation/BottomNavigationExample.js.map +1 -1
  24. package/dist/components/BottomNavigation/bottom-navigation.css +8 -1
  25. package/dist/components/BottomNavigation/bottom-navigation.css.js +8 -1
  26. package/dist/components/Breadcrumb/Breadcrumb.d.ts +17 -18
  27. package/dist/components/Breadcrumb/Breadcrumb.js +17 -18
  28. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
  29. package/dist/components/Breadcrumb/BreadcrumbDropdown.d.ts +6 -0
  30. package/dist/components/Breadcrumb/BreadcrumbDropdown.js +6 -0
  31. package/dist/components/Breadcrumb/BreadcrumbDropdown.js.map +1 -1
  32. package/dist/components/Button/Button.d.ts +1 -11
  33. package/dist/components/Button/Button.js +1 -11
  34. package/dist/components/Button/Button.js.map +1 -1
  35. package/dist/components/Button/ButtonExample.js +1 -3
  36. package/dist/components/Button/ButtonExample.js.map +1 -1
  37. package/dist/components/ButtonDock/ButtonDock.d.ts +10 -14
  38. package/dist/components/ButtonDock/ButtonDock.js +10 -14
  39. package/dist/components/ButtonDock/ButtonDock.js.map +1 -1
  40. package/dist/components/Card/Card.d.ts +8 -10
  41. package/dist/components/Card/Card.js +6 -10
  42. package/dist/components/Card/Card.js.map +1 -1
  43. package/dist/components/Carousel/Carousel.d.ts +9 -13
  44. package/dist/components/Carousel/Carousel.js +9 -13
  45. package/dist/components/Carousel/Carousel.js.map +1 -1
  46. package/dist/components/Carousel/CarouselExample.js +14 -14
  47. package/dist/components/Carousel/CarouselExample.js.map +1 -1
  48. package/dist/components/Checkbox/Checkbox.d.ts +7 -4
  49. package/dist/components/Checkbox/Checkbox.js +7 -4
  50. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  51. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +3 -3
  52. package/dist/components/CheckboxGroup/CheckboxGroup.js +3 -3
  53. package/dist/components/CheckboxGroup/CheckboxGroupExample.js +1 -0
  54. package/dist/components/CheckboxGroup/CheckboxGroupExample.js.map +1 -1
  55. package/dist/components/CheckboxOption/CheckboxOption.d.ts +4 -4
  56. package/dist/components/CheckboxOption/CheckboxOption.js +4 -4
  57. package/dist/components/Chip/Chip.d.ts +3 -7
  58. package/dist/components/Chip/Chip.js +3 -7
  59. package/dist/components/Chip/Chip.js.map +1 -1
  60. package/dist/components/Chip/ChipExample.js +50 -3
  61. package/dist/components/Chip/ChipExample.js.map +1 -1
  62. package/dist/components/ChipGroup/ChipGroup.d.ts +21 -10
  63. package/dist/components/ChipGroup/ChipGroup.js +21 -10
  64. package/dist/components/ChipGroup/ChipGroup.js.map +1 -1
  65. package/dist/components/ChipGroup/ChipGroupExample.js +1 -0
  66. package/dist/components/ChipGroup/ChipGroupExample.js.map +1 -1
  67. package/dist/components/DatePicker/DatePicker.d.ts +13 -12
  68. package/dist/components/DatePicker/DatePicker.js +13 -12
  69. package/dist/components/DatePicker/DatePicker.js.map +1 -1
  70. package/dist/components/Dialog/Dialog.d.ts +11 -6
  71. package/dist/components/Dialog/Dialog.js +11 -6
  72. package/dist/components/Dialog/Dialog.js.map +1 -1
  73. package/dist/components/Divider/Divider.d.ts +5 -9
  74. package/dist/components/Divider/Divider.js +5 -9
  75. package/dist/components/Divider/Divider.js.map +1 -1
  76. package/dist/components/Divider/DividerExample.js +16 -1
  77. package/dist/components/Divider/DividerExample.js.map +1 -1
  78. package/dist/components/Drawer/Drawer.d.ts +3 -3
  79. package/dist/components/Drawer/Drawer.js +3 -3
  80. package/dist/components/Drawer/Drawer.js.map +1 -1
  81. package/dist/components/EmptyState/EmptyState.d.ts +3 -7
  82. package/dist/components/EmptyState/EmptyState.js +3 -7
  83. package/dist/components/EmptyState/EmptyState.js.map +1 -1
  84. package/dist/components/Fab/Fab.d.ts +4 -5
  85. package/dist/components/Fab/Fab.js +4 -6
  86. package/dist/components/Fab/Fab.js.map +1 -1
  87. package/dist/components/Fab/FabExample.d.ts +2 -1
  88. package/dist/components/Fab/FabExample.js +20 -2
  89. package/dist/components/Fab/FabExample.js.map +1 -1
  90. package/dist/components/Field/Field.d.ts +4 -5
  91. package/dist/components/Field/Field.js +4 -5
  92. package/dist/components/Field/Field.js.map +1 -1
  93. package/dist/components/Field/FieldDescription.d.ts +7 -5
  94. package/dist/components/Field/FieldDescription.js +7 -3
  95. package/dist/components/Field/FieldDescription.js.map +1 -1
  96. package/dist/components/Field/FieldError.d.ts +6 -0
  97. package/dist/components/Field/FieldError.js +6 -0
  98. package/dist/components/Field/FieldError.js.map +1 -1
  99. package/dist/components/Field/FieldLabel.d.ts +6 -0
  100. package/dist/components/Field/FieldLabel.js +6 -0
  101. package/dist/components/Field/FieldLabel.js.map +1 -1
  102. package/dist/components/Field/utils.d.ts +5 -0
  103. package/dist/components/Field/utils.js +5 -0
  104. package/dist/components/Field/utils.js.map +1 -1
  105. package/dist/components/FileUpload/FileUpload.d.ts +3 -3
  106. package/dist/components/FileUpload/FileUpload.js +3 -3
  107. package/dist/components/FileUploadItem/FileUploadItem.d.ts +6 -10
  108. package/dist/components/FileUploadItem/FileUploadItem.js +6 -10
  109. package/dist/components/FileUploadItem/FileUploadItem.js.map +1 -1
  110. package/dist/components/FormField/FormField.d.ts +5 -16
  111. package/dist/components/FormField/FormField.js +5 -16
  112. package/dist/components/FormField/FormField.js.map +1 -1
  113. package/dist/components/Img/Img.d.ts +1 -3
  114. package/dist/components/Img/Img.js +1 -3
  115. package/dist/components/Img/Img.js.map +1 -1
  116. package/dist/components/InlineAlert/InlineAlert.d.ts +1 -3
  117. package/dist/components/InlineAlert/InlineAlert.js +1 -3
  118. package/dist/components/InlineAlert/InlineAlert.js.map +1 -1
  119. package/dist/components/InlineAlert/SvgWarningTwoTone.d.ts +6 -0
  120. package/dist/components/InlineAlert/SvgWarningTwoTone.js +6 -0
  121. package/dist/components/InlineAlert/SvgWarningTwoTone.js.map +1 -1
  122. package/dist/components/Input/Input.d.ts +13 -13
  123. package/dist/components/Input/Input.js +13 -13
  124. package/dist/components/Input/InputElement.d.ts +11 -5
  125. package/dist/components/Input/InputElement.js +11 -5
  126. package/dist/components/Input/InputElement.js.map +1 -1
  127. package/dist/components/InputNumber/IncrementButton.d.ts +13 -3
  128. package/dist/components/InputNumber/IncrementButton.js +11 -4
  129. package/dist/components/InputNumber/IncrementButton.js.map +1 -1
  130. package/dist/components/InputNumber/InputNumber.d.ts +20 -20
  131. package/dist/components/InputNumber/InputNumber.js +46 -30
  132. package/dist/components/InputNumber/InputNumber.js.map +1 -1
  133. package/dist/components/InputNumber/InputNumberExample.js +1 -0
  134. package/dist/components/InputNumber/InputNumberExample.js.map +1 -1
  135. package/dist/components/InputNumber/input-number.css +6 -0
  136. package/dist/components/InputNumber/input-number.css.js +6 -0
  137. package/dist/components/InputPhone/InputPhone.d.ts +21 -16
  138. package/dist/components/InputPhone/InputPhone.js +21 -16
  139. package/dist/components/InputPhone/InputPhone.js.map +1 -1
  140. package/dist/components/Layout/Layout.d.ts +1 -3
  141. package/dist/components/Layout/Layout.js +1 -3
  142. package/dist/components/Layout/Layout.js.map +1 -1
  143. package/dist/components/Link/Link.d.ts +1 -3
  144. package/dist/components/Link/Link.js +1 -3
  145. package/dist/components/Link/Link.js.map +1 -1
  146. package/dist/components/ListItem/ListItem.d.ts +22 -21
  147. package/dist/components/ListItem/ListItem.js +19 -16
  148. package/dist/components/ListItem/ListItem.js.map +1 -1
  149. package/dist/components/Menu/Menu.d.ts +5 -9
  150. package/dist/components/Menu/Menu.js +5 -9
  151. package/dist/components/Menu/Menu.js.map +1 -1
  152. package/dist/components/Modal/Modal.d.ts +4 -4
  153. package/dist/components/Modal/Modal.js +4 -4
  154. package/dist/components/Modal/Modal.js.map +1 -1
  155. package/dist/components/Modal/modal.css +12 -1
  156. package/dist/components/Modal/modal.css.js +12 -1
  157. package/dist/components/OTPInput/OTPInput.d.ts +5 -3
  158. package/dist/components/OTPInput/OTPInput.js +5 -3
  159. package/dist/components/OTPInput/OTPInput.js.map +1 -1
  160. package/dist/components/PageControl/PageControl.d.ts +1 -3
  161. package/dist/components/PageControl/PageControl.js +1 -3
  162. package/dist/components/PageControl/PageControl.js.map +1 -1
  163. package/dist/components/Pagination/PageList.d.ts +6 -0
  164. package/dist/components/Pagination/PageList.js +6 -0
  165. package/dist/components/Pagination/PageList.js.map +1 -1
  166. package/dist/components/Pagination/Pagination.d.ts +6 -7
  167. package/dist/components/Pagination/Pagination.js +28 -15
  168. package/dist/components/Pagination/Pagination.js.map +1 -1
  169. package/dist/components/Pagination/pagination.css +5 -14
  170. package/dist/components/Pagination/pagination.css.js +5 -14
  171. package/dist/components/Password/Password.d.ts +19 -20
  172. package/dist/components/Password/Password.js +19 -20
  173. package/dist/components/Password/Password.js.map +1 -1
  174. package/dist/components/Popover/Popover.d.ts +11 -20
  175. package/dist/components/Popover/Popover.js +11 -20
  176. package/dist/components/Popover/Popover.js.map +1 -1
  177. package/dist/components/Popover/PopoverExample.js +1 -1
  178. package/dist/components/Popover/PopoverExample.js.map +1 -1
  179. package/dist/components/ProgressBar/ProgressBar.d.ts +1 -3
  180. package/dist/components/ProgressBar/ProgressBar.js +1 -3
  181. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  182. package/dist/components/ProgressCircle/ProgressCircle.d.ts +1 -3
  183. package/dist/components/ProgressCircle/ProgressCircle.js +1 -3
  184. package/dist/components/ProgressCircle/ProgressCircle.js.map +1 -1
  185. package/dist/components/ProgressionStepper/ProgressionStepper.d.ts +1 -3
  186. package/dist/components/ProgressionStepper/ProgressionStepper.js +1 -3
  187. package/dist/components/ProgressionStepper/ProgressionStepper.js.map +1 -1
  188. package/dist/components/RadioGroup/RadioGroup.d.ts +2 -2
  189. package/dist/components/RadioGroup/RadioGroup.js +2 -2
  190. package/dist/components/Rating/Rating.d.ts +2 -4
  191. package/dist/components/Rating/Rating.js +8 -6
  192. package/dist/components/Rating/Rating.js.map +1 -1
  193. package/dist/components/Rating/RatingExample.js +17 -1
  194. package/dist/components/Rating/RatingExample.js.map +1 -1
  195. package/dist/components/Scrim/Scrim.d.ts +0 -1
  196. package/dist/components/Scrim/Scrim.js +0 -1
  197. package/dist/components/Scrim/Scrim.js.map +1 -1
  198. package/dist/components/SearchBar/SearchBar.d.ts +2 -2
  199. package/dist/components/SearchBar/SearchBar.js +2 -2
  200. package/dist/components/SegmentedControl/SegmentedControl.d.ts +3 -3
  201. package/dist/components/SegmentedControl/SegmentedControl.js +3 -3
  202. package/dist/components/SegmentedControl/SegmentedControlExample.js +10 -12
  203. package/dist/components/SegmentedControl/SegmentedControlExample.js.map +1 -1
  204. package/dist/components/Select/Select.d.ts +33 -34
  205. package/dist/components/Select/Select.js +33 -34
  206. package/dist/components/Select/Select.js.map +1 -1
  207. package/dist/components/Skeleton/Circular.d.ts +6 -0
  208. package/dist/components/Skeleton/Circular.js +6 -0
  209. package/dist/components/Skeleton/Circular.js.map +1 -1
  210. package/dist/components/Skeleton/Photo.d.ts +6 -0
  211. package/dist/components/Skeleton/Photo.js +6 -0
  212. package/dist/components/Skeleton/Photo.js.map +1 -1
  213. package/dist/components/Skeleton/Profile.d.ts +6 -0
  214. package/dist/components/Skeleton/Profile.js +6 -0
  215. package/dist/components/Skeleton/Profile.js.map +1 -1
  216. package/dist/components/Skeleton/Rectangular.d.ts +6 -0
  217. package/dist/components/Skeleton/Rectangular.js +6 -0
  218. package/dist/components/Skeleton/Rectangular.js.map +1 -1
  219. package/dist/components/Skeleton/Skeleton.d.ts +10 -14
  220. package/dist/components/Skeleton/Skeleton.js +10 -14
  221. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  222. package/dist/components/Skeleton/SkeletonExample.js +4 -3
  223. package/dist/components/Skeleton/SkeletonExample.js.map +1 -1
  224. package/dist/components/Skeleton/Thumbnail.d.ts +6 -0
  225. package/dist/components/Skeleton/Thumbnail.js +6 -0
  226. package/dist/components/Skeleton/Thumbnail.js.map +1 -1
  227. package/dist/components/SkeletonText/SkeletonText.d.ts +5 -9
  228. package/dist/components/SkeletonText/SkeletonText.js +5 -9
  229. package/dist/components/SkeletonText/SkeletonText.js.map +1 -1
  230. package/dist/components/Slider/Slider.d.ts +2 -2
  231. package/dist/components/Slider/Slider.js +2 -2
  232. package/dist/components/Slider/SliderExample.js +40 -18
  233. package/dist/components/Slider/SliderExample.js.map +1 -1
  234. package/dist/components/Slider/SliderIntervalDots.d.ts +6 -0
  235. package/dist/components/Slider/SliderIntervalDots.js +6 -0
  236. package/dist/components/Slider/SliderIntervalDots.js.map +1 -1
  237. package/dist/components/Snackbar/Manager.d.ts +28 -0
  238. package/dist/components/Snackbar/Manager.js +34 -0
  239. package/dist/components/Snackbar/Manager.js.map +1 -0
  240. package/dist/components/Snackbar/Snackbar.d.ts +23 -6
  241. package/dist/components/Snackbar/Snackbar.js +23 -5
  242. package/dist/components/Snackbar/Snackbar.js.map +1 -1
  243. package/dist/components/Snackbar/SnackbarExample.js +8 -1
  244. package/dist/components/Snackbar/SnackbarExample.js.map +1 -1
  245. package/dist/components/Snackbar/index.d.ts +1 -0
  246. package/dist/components/Snackbar/index.js +1 -0
  247. package/dist/components/Snackbar/index.js.map +1 -1
  248. package/dist/components/StylesProviderDemo/StylesProviderDemo.d.ts +1 -3
  249. package/dist/components/StylesProviderDemo/StylesProviderDemo.js +1 -3
  250. package/dist/components/StylesProviderDemo/StylesProviderDemo.js.map +1 -1
  251. package/dist/components/Switch/Switch.d.ts +2 -2
  252. package/dist/components/Switch/Switch.js +2 -2
  253. package/dist/components/TabGroup/TabGroup.d.ts +2 -2
  254. package/dist/components/TabGroup/TabGroup.js +2 -2
  255. package/dist/components/TabGroup/TabGroupExample.js +5 -11
  256. package/dist/components/TabGroup/TabGroupExample.js.map +1 -1
  257. package/dist/components/TabGroup/tab-group.css +1 -0
  258. package/dist/components/TabGroup/tab-group.css.js +1 -0
  259. package/dist/components/TabList/TabList.d.ts +2 -2
  260. package/dist/components/TabList/TabList.js +3 -4
  261. package/dist/components/TabList/TabList.js.map +1 -1
  262. package/dist/components/TabList/tab-list.css +0 -1
  263. package/dist/components/TabList/tab-list.css.js +0 -1
  264. package/dist/components/Table/Footer.d.ts +6 -0
  265. package/dist/components/Table/Footer.js +6 -0
  266. package/dist/components/Table/Footer.js.map +1 -1
  267. package/dist/components/Table/Table.d.ts +53 -16
  268. package/dist/components/Table/Table.js +53 -16
  269. package/dist/components/Table/Table.js.map +1 -1
  270. package/dist/components/Table/table.css +0 -1
  271. package/dist/components/Table/table.css.js +0 -1
  272. package/dist/components/Tag/Tag.d.ts +1 -3
  273. package/dist/components/Tag/Tag.js +1 -3
  274. package/dist/components/Tag/Tag.js.map +1 -1
  275. package/dist/components/Textarea/Textarea.d.ts +13 -13
  276. package/dist/components/Textarea/Textarea.js +13 -13
  277. package/dist/components/TimePicker/Listbox.d.ts +6 -0
  278. package/dist/components/TimePicker/Listbox.js +6 -0
  279. package/dist/components/TimePicker/Listbox.js.map +1 -1
  280. package/dist/components/TimePicker/Segment.d.ts +6 -0
  281. package/dist/components/TimePicker/Segment.js +6 -0
  282. package/dist/components/TimePicker/Segment.js.map +1 -1
  283. package/dist/components/TimePicker/TimePicker.d.ts +14 -14
  284. package/dist/components/TimePicker/TimePicker.js +14 -14
  285. package/dist/components/ToggleOption/ToggleOption.js +1 -1
  286. package/dist/components/ToggleOption/ToggleOption.js.map +1 -1
  287. package/dist/components/ToggleOption/toggle-option.css +2 -49
  288. package/dist/components/ToggleOption/toggle-option.css.js +2 -49
  289. package/dist/components/Tooltip/Tooltip.d.ts +3 -7
  290. package/dist/components/Tooltip/Tooltip.js +3 -7
  291. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  292. package/dist/components/Tooltip/TooltipExample.js +23 -3
  293. package/dist/components/Tooltip/TooltipExample.js.map +1 -1
  294. package/dist/components/Truncated/Truncated.d.ts +0 -1
  295. package/dist/components/Truncated/Truncated.js +1 -2
  296. package/dist/components/Truncated/Truncated.js.map +1 -1
  297. package/dist/components/Txt/Txt.d.ts +1 -3
  298. package/dist/components/Txt/Txt.js +1 -3
  299. package/dist/components/Txt/Txt.js.map +1 -1
  300. package/dist/components/UIProvider/AriaLiveMessageHandler.js +3 -2
  301. package/dist/components/UIProvider/AriaLiveMessageHandler.js.map +1 -1
  302. package/dist/components/UIProvider/UIProvider.d.ts +0 -1
  303. package/dist/components/UIProvider/UIProvider.js +0 -1
  304. package/dist/components/UIProvider/UIProvider.js.map +1 -1
  305. package/dist/hooks/useAddEventListener.d.ts +1 -2
  306. package/dist/hooks/useAddEventListener.js.map +1 -1
  307. package/dist/hooks/useLongPress.d.ts +30 -15
  308. package/dist/hooks/useLongPress.js +26 -42
  309. package/dist/hooks/useLongPress.js.map +1 -1
  310. package/dist/hooks/useRadioState.d.ts +1 -1
  311. package/dist/hooks/useTimeout.d.ts +1 -2
  312. package/dist/hooks/useTimeout.js +20 -4
  313. package/dist/hooks/useTimeout.js.map +1 -1
  314. package/dist/styles/base.css +9 -0
  315. package/dist/styles/base.css.js +9 -0
  316. package/dist/types/common.d.ts +3 -0
  317. package/dist/types/common.js.map +1 -1
  318. package/dist/types/meta.d.ts +1 -0
  319. package/dist/types/meta.js.map +1 -1
  320. package/dist/utils/createCustomEvent.d.ts +17 -0
  321. package/dist/utils/createCustomEvent.js +21 -0
  322. package/dist/utils/createCustomEvent.js.map +1 -0
  323. package/dist/utils/createExampleChildElement.js +3 -3
  324. package/dist/utils/createExampleChildElement.js.map +1 -1
  325. package/dist/utils/demo.d.ts +18 -26
  326. package/dist/utils/demo.js.map +1 -1
  327. package/meta.ts +6 -1
  328. package/package.json +1 -1
  329. package/src/components/Accordion/Accordion.tsx +20 -3
  330. package/src/components/Avatar/Avatar.tsx +13 -14
  331. package/src/components/AvatarGroup/AvatarGroup.tsx +30 -13
  332. package/src/components/Badge/Badge.tsx +1 -3
  333. package/src/components/BadgeDot/BadgeDot.tsx +6 -4
  334. package/src/components/BannerAlert/BannerAlert.tsx +11 -12
  335. package/src/components/BottomNavigation/BottomNavigation.tsx +6 -3
  336. package/src/components/BottomNavigation/BottomNavigationExample.tsx +31 -36
  337. package/src/components/BottomNavigation/bottom-navigation.scss +10 -1
  338. package/src/components/Breadcrumb/Breadcrumb.tsx +17 -18
  339. package/src/components/Breadcrumb/BreadcrumbDropdown.tsx +6 -0
  340. package/src/components/Button/Button.tsx +1 -11
  341. package/src/components/Button/ButtonExample.tsx +1 -2
  342. package/src/components/ButtonDock/ButtonDock.tsx +10 -14
  343. package/src/components/Card/Card.tsx +9 -11
  344. package/src/components/Carousel/Carousel.tsx +9 -13
  345. package/src/components/Carousel/CarouselExample.tsx +25 -25
  346. package/src/components/Checkbox/Checkbox.tsx +7 -4
  347. package/src/components/CheckboxGroup/CheckboxGroup.tsx +3 -3
  348. package/src/components/CheckboxGroup/CheckboxGroupExample.tsx +1 -0
  349. package/src/components/CheckboxOption/CheckboxOption.tsx +4 -4
  350. package/src/components/Chip/Chip.tsx +3 -7
  351. package/src/components/Chip/ChipExample.tsx +52 -3
  352. package/src/components/ChipGroup/ChipGroup.tsx +21 -10
  353. package/src/components/ChipGroup/ChipGroupExample.tsx +1 -1
  354. package/src/components/DatePicker/DatePicker.tsx +13 -12
  355. package/src/components/Dialog/Dialog.tsx +11 -6
  356. package/src/components/Divider/Divider.tsx +5 -9
  357. package/src/components/Divider/DividerExample.tsx +18 -1
  358. package/src/components/Drawer/Drawer.tsx +3 -4
  359. package/src/components/EmptyState/EmptyState.tsx +3 -7
  360. package/src/components/Fab/Fab.tsx +8 -5
  361. package/src/components/Fab/FabExample.tsx +22 -3
  362. package/src/components/Field/Field.tsx +4 -5
  363. package/src/components/Field/FieldDescription.tsx +7 -5
  364. package/src/components/Field/FieldError.tsx +6 -0
  365. package/src/components/Field/FieldLabel.tsx +6 -0
  366. package/src/components/Field/utils.ts +5 -0
  367. package/src/components/FileUpload/FileUpload.tsx +3 -3
  368. package/src/components/FileUploadItem/FileUploadItem.tsx +6 -10
  369. package/src/components/FormField/FormField.tsx +5 -16
  370. package/src/components/Img/Img.tsx +1 -3
  371. package/src/components/InlineAlert/InlineAlert.tsx +1 -3
  372. package/src/components/InlineAlert/SvgWarningTwoTone.tsx +6 -0
  373. package/src/components/Input/Input.tsx +13 -13
  374. package/src/components/Input/InputElement.tsx +11 -5
  375. package/src/components/InputNumber/IncrementButton.tsx +21 -11
  376. package/src/components/InputNumber/InputNumber.tsx +53 -51
  377. package/src/components/InputNumber/InputNumberExample.tsx +1 -0
  378. package/src/components/InputNumber/input-number.scss +10 -0
  379. package/src/components/InputPhone/InputPhone.tsx +21 -16
  380. package/src/components/Layout/Layout.tsx +1 -3
  381. package/src/components/Link/Link.tsx +1 -3
  382. package/src/components/ListItem/ListItem.tsx +22 -20
  383. package/src/components/Menu/Menu.tsx +5 -9
  384. package/src/components/Modal/Modal.tsx +10 -5
  385. package/src/components/Modal/modal.scss +13 -1
  386. package/src/components/OTPInput/OTPInput.tsx +5 -3
  387. package/src/components/PageControl/PageControl.tsx +1 -3
  388. package/src/components/Pagination/PageList.tsx +6 -0
  389. package/src/components/Pagination/Pagination.tsx +50 -24
  390. package/src/components/Pagination/pagination.scss +7 -17
  391. package/src/components/Password/Password.tsx +19 -20
  392. package/src/components/Popover/Popover.tsx +11 -20
  393. package/src/components/Popover/PopoverExample.tsx +1 -1
  394. package/src/components/ProgressBar/ProgressBar.tsx +1 -3
  395. package/src/components/ProgressCircle/ProgressCircle.tsx +1 -3
  396. package/src/components/ProgressionStepper/ProgressionStepper.tsx +1 -3
  397. package/src/components/RadioGroup/RadioGroup.tsx +2 -2
  398. package/src/components/Rating/Rating.tsx +34 -14
  399. package/src/components/Rating/RatingExample.tsx +18 -1
  400. package/src/components/Scrim/Scrim.tsx +0 -1
  401. package/src/components/SearchBar/SearchBar.tsx +2 -2
  402. package/src/components/SegmentedControl/SegmentedControl.tsx +3 -3
  403. package/src/components/SegmentedControl/SegmentedControlExample.tsx +10 -12
  404. package/src/components/Select/Select.tsx +33 -34
  405. package/src/components/Skeleton/Circular.tsx +6 -0
  406. package/src/components/Skeleton/Photo.tsx +6 -0
  407. package/src/components/Skeleton/Profile.tsx +6 -0
  408. package/src/components/Skeleton/Rectangular.tsx +6 -0
  409. package/src/components/Skeleton/Skeleton.tsx +10 -14
  410. package/src/components/Skeleton/SkeletonExample.tsx +5 -3
  411. package/src/components/Skeleton/Thumbnail.tsx +6 -0
  412. package/src/components/SkeletonText/SkeletonText.tsx +5 -9
  413. package/src/components/Slider/Slider.tsx +2 -2
  414. package/src/components/Slider/SliderExample.tsx +42 -17
  415. package/src/components/Slider/SliderIntervalDots.tsx +6 -0
  416. package/src/components/Snackbar/Manager.tsx +63 -0
  417. package/src/components/Snackbar/Snackbar.tsx +23 -7
  418. package/src/components/Snackbar/SnackbarExample.tsx +28 -6
  419. package/src/components/Snackbar/index.tsx +1 -0
  420. package/src/components/StylesProviderDemo/StylesProviderDemo.tsx +1 -3
  421. package/src/components/Switch/Switch.tsx +2 -2
  422. package/src/components/TabGroup/TabGroup.tsx +2 -2
  423. package/src/components/TabGroup/TabGroupExample.tsx +5 -11
  424. package/src/components/TabGroup/tab-group.scss +1 -0
  425. package/src/components/TabList/TabList.tsx +3 -4
  426. package/src/components/TabList/tab-list.scss +0 -1
  427. package/src/components/Table/Footer.tsx +6 -0
  428. package/src/components/Table/Table.tsx +53 -16
  429. package/src/components/Table/table.scss +0 -1
  430. package/src/components/Tag/Tag.tsx +1 -3
  431. package/src/components/Textarea/Textarea.tsx +13 -13
  432. package/src/components/TimePicker/Listbox.tsx +6 -0
  433. package/src/components/TimePicker/Segment.tsx +6 -0
  434. package/src/components/TimePicker/TimePicker.tsx +14 -14
  435. package/src/components/ToggleOption/ToggleOption.tsx +1 -0
  436. package/src/components/ToggleOption/toggle-option.scss +2 -61
  437. package/src/components/Tooltip/Tooltip.tsx +3 -7
  438. package/src/components/Tooltip/TooltipExample.tsx +23 -11
  439. package/src/components/Truncated/Truncated.tsx +1 -2
  440. package/src/components/Txt/Txt.tsx +1 -3
  441. package/src/components/UIProvider/AriaLiveMessageHandler.tsx +4 -2
  442. package/src/components/UIProvider/UIProvider.tsx +0 -1
  443. package/src/hooks/useAddEventListener.ts +1 -3
  444. package/src/hooks/useLongPress.ts +58 -48
  445. package/src/hooks/useTimeout.ts +1 -5
  446. package/src/styles/base.scss +9 -0
  447. package/src/types/common.ts +4 -0
  448. package/src/types/meta.ts +1 -0
  449. package/src/utils/createCustomEvent.ts +35 -0
  450. package/src/utils/createExampleChildElement.tsx +3 -8
  451. package/src/utils/demo.ts +24 -27
  452. package/dist/components/ListItem/ListItemButton.d.ts +0 -2
  453. package/dist/components/ListItem/ListItemButton.js +0 -7
  454. package/dist/components/ListItem/ListItemButton.js.map +0 -1
  455. package/dist/components/Pagination/PageInput.d.ts +0 -4
  456. package/dist/components/Pagination/PageInput.js +0 -36
  457. package/dist/components/Pagination/PageInput.js.map +0 -1
  458. package/dist/components/Truncated/truncated.css +0 -8
  459. package/dist/components/Truncated/truncated.css.js +0 -13
  460. package/dist/hooks/usePaginationState.d.ts +0 -4
  461. package/dist/hooks/usePaginationState.js +0 -22
  462. package/dist/hooks/usePaginationState.js.map +0 -1
  463. package/src/components/ListItem/ListItemButton.tsx +0 -6
  464. package/src/components/Pagination/PageInput.tsx +0 -65
  465. package/src/components/Truncated/truncated.scss +0 -8
  466. package/src/hooks/usePaginationState.tsx +0 -24
@@ -44,9 +44,7 @@ export type LayoutProps<As extends ElementType = ElementType> = {
44
44
  * @example
45
45
  * import { Layout } from '@bspk/ui/Layout';
46
46
  *
47
- * function Example() {
48
- * return <Layout>Low effort example</Layout>;
49
- * }
47
+ * <Layout>Low effort example</Layout>;
50
48
  *
51
49
  * @name Layout
52
50
  * @phase Utility
@@ -46,9 +46,7 @@ export type LinkProps = Pick<CommonPropsLibrary, 'disabled'> & {
46
46
  * @example
47
47
  * import { Link } from '@bspk/ui/Link';
48
48
  *
49
- * function Example() {
50
- * return <Link href="https://bspk.dev" label="Example label" trailingIcon="external" />;
51
- * }
49
+ * <Link href="https://anywhere.re" label="Example label" trailingIcon="external" />;
52
50
  *
53
51
  * @name Link
54
52
  * @phase UXReview
@@ -9,7 +9,6 @@ import {
9
9
  AriaRole,
10
10
  ComponentProps,
11
11
  } from 'react';
12
- import { ListItemButton } from './ListItemButton';
13
12
  import { Truncated } from '-/components/Truncated';
14
13
  import { useId } from '-/hooks/useId';
15
14
  import { CommonProps, ElementProps, SetRef } from '-/types/common';
@@ -47,11 +46,11 @@ export type ListItemProps<As extends ElementType = ElementType> = CommonProps<'a
47
46
  /**
48
47
  * The trailing element to display in the ListItem.
49
48
  *
50
- * Trailing elements should only be one of the following [Icon](/icons), Checkbox, ListItemButton, Radio,
51
- * Switch, Tag, Txt.
49
+ * Trailing elements should only be one of the following [Icon](/icons), Checkbox, Button, Radio, Switch, Tag,
50
+ * Txt.
52
51
  *
53
52
  * @exampleType select
54
- * @options Checkbox, Icon, ListItemButton, Radio, Switch, Tag, Txt
53
+ * @options Checkbox, Icon, Button, Radio, Switch, Tag, Txt
55
54
  */
56
55
  trailing?: ReactNode;
57
56
  /** Props to pass to the trailing element wrapper span. */
@@ -109,24 +108,29 @@ export type ListItemProps<As extends ElementType = ElementType> = CommonProps<'a
109
108
  *
110
109
  * Leading elements should be one of the following [Icon](/icons), Img, Avatar.
111
110
  *
112
- * Trailing elements should be one of the following [Icon](/icons), Checkbox, ListItemButton, Radio, Switch, Tag, Txt.
113
- *
114
- * The ListItemButton is a more limited Button with context specific options.
111
+ * Trailing elements should be one of the following [Icon](/icons), Checkbox, Button, Radio, Switch, Tag, Txt.
115
112
  *
116
113
  * @example
117
- * import { SvgSquare } from '@bspk/icons/Square';
114
+ * import { SvgFolder } from '@bspk/icons/Folder';
115
+ * import { SvgChevronRight } from '@bspk/icons/ChevronRight';
118
116
  * import { ListItem } from '@bspk/ui/ListItem';
119
117
  *
120
- * function Example() {
121
- * return (
122
- * <ListItem
123
- * label="Example label"
124
- * leading={<SvgSquare />}
125
- * subText="Example subtest"
126
- * trailing={<ListItem.Button label="Click me" onClick={() => console.log('Hello world')} />}
127
- * />
128
- * );
129
- * }
118
+ * <div style={{ width: 300 }}>
119
+ * <ListItem
120
+ * leading={<SvgDelete />}
121
+ * label="File 13"
122
+ * subText="Last modified: Jan 21, 2024"
123
+ * trailing={<SvgChevronRight />}
124
+ * onClick={() => sendSnackbar('Clicked Open Folder button')}
125
+ * />
126
+ * <ListItem
127
+ * leading={<SvgFolder />}
128
+ * label="Death Star Plans"
129
+ * subText="Last modified: May 25, 1977"
130
+ * trailing={<SvgChevronRight />}
131
+ * onClick={() => sendSnackbar('Downloading blueprints...')}
132
+ * />
133
+ * </div>;
130
134
  *
131
135
  * @name ListItem
132
136
  * @phase UXReview
@@ -201,8 +205,6 @@ function ListItem<As extends ElementType = ElementType>({
201
205
  );
202
206
  }
203
207
 
204
- ListItem.Button = ListItemButton;
205
-
206
208
  export { ListItem };
207
209
 
208
210
  function asLogic<As extends ElementType>(as: As | undefined, props: Partial<ListItemProps>): ElementType {
@@ -46,15 +46,11 @@ export type MenuProps<As extends ElementType = ElementType> = CommonProps<'id' |
46
46
  *
47
47
  * import { Menu } from '@bspk/ui/Menu';
48
48
  *
49
- * function Example() {
50
- * return (
51
- * <Menu>
52
- * <ListItem label="List Item" />
53
- * <ListItem label="List Item" />
54
- * <ListItem label="List Item" />
55
- * </Menu>
56
- * );
57
- * }
49
+ * <Menu>
50
+ * <ListItem label="List Item" />
51
+ * <ListItem label="List Item" />
52
+ * <ListItem label="List Item" />
53
+ * </Menu>;
58
54
  *
59
55
  * @name Menu
60
56
  * @phase UXReview
@@ -87,7 +87,7 @@ export type ModalProps = Pick<
87
87
  */
88
88
  callToAction?: ModalCallToAction;
89
89
  /**
90
- * The format of the buttons in the footer. Ignored if not mobile.
90
+ * The format of the buttons in the footer. Vertical applies only on screen widths less than or equal to 640px.
91
91
  *
92
92
  * @default horizontal
93
93
  */
@@ -114,8 +114,8 @@ export type ModalProps = Pick<
114
114
  * import { Button } from '@bspk/ui/Button';
115
115
  * import { Modal } from '@bspk/ui/Modal';
116
116
  *
117
- * function Example() {
118
- * const [open, setOpen] = React.useState(false);
117
+ * () => {
118
+ * const [open, setOpen] = useState(false);
119
119
  *
120
120
  * return (
121
121
  * <>
@@ -130,7 +130,7 @@ export type ModalProps = Pick<
130
130
  * </Modal>
131
131
  * </>
132
132
  * );
133
- * }
133
+ * };
134
134
  *
135
135
  * @name Modal
136
136
  * @phase UXReview
@@ -200,7 +200,12 @@ export function Modal({
200
200
  {Array.isArray(buttons) && buttons.length > 0 && (
201
201
  <div data-button-format={buttonFormat} data-modal-footer>
202
202
  {buttons.map((buttonProps, idx) => (
203
- <Button key={idx} {...buttonProps} size={isMobile ? 'medium' : 'small'} />
203
+ <Button
204
+ key={idx}
205
+ {...buttonProps}
206
+ size={isMobile ? 'medium' : 'small'}
207
+ width={buttonFormat === 'vertical' && isMobile ? 'fill' : 'hug'}
208
+ />
204
209
  ))}
205
210
  </div>
206
211
  )}
@@ -25,9 +25,21 @@
25
25
 
26
26
  > [data-modal-footer] {
27
27
  display: flex;
28
+ gap: var(--spacing-sizing-04);
29
+ }
30
+
31
+ [data-button-format='horizontal'] {
28
32
  flex-direction: row-reverse;
29
33
  justify-content: flex-start;
30
- gap: var(--spacing-sizing-04);
34
+ }
35
+
36
+ [data-button-format='vertical'] {
37
+ flex-direction: column;
38
+
39
+ @media (width >= 640px) {
40
+ flex-direction: row-reverse;
41
+ justify-content: flex-start;
42
+ }
31
43
  }
32
44
  }
33
45
 
@@ -34,9 +34,11 @@ export type OTPInputProps = CommonProps<'id' | 'invalid' | 'name' | 'size'> & {
34
34
  * @example
35
35
  * import { OTPInput } from '@bspk/ui/OTPInput';
36
36
  *
37
- * function Example() {
38
- * return <OTPInput name="2-auth-otp" length={4} value={otpValue} onChange={setOtpValue} />;
39
- * }
37
+ * () => {
38
+ * const [otpValue, setOtpValue] = useState('');
39
+ *
40
+ * <OTPInput name="2-auth" length={4} value={otpValue} onChange={setOtpValue} />;
41
+ * };
40
42
  *
41
43
  * @name OTPInput
42
44
  * @phase UXReview
@@ -40,9 +40,7 @@ export type DotSize = 'medium' | 'small' | 'x-small';
40
40
  * @example
41
41
  * import { PageControl } from '@bspk/ui/PageControl';
42
42
  *
43
- * function Example() {
44
- * return <PageControl value={1} numPages={3} />;
45
- * }
43
+ * <PageControl value={1} numPages={3} />;
46
44
  *
47
45
  * @name PageControl
48
46
  * @phase UXReview
@@ -3,6 +3,12 @@ import { Button } from '-/components/Button';
3
3
 
4
4
  export type PageListProps = Pick<PaginationProps, 'numPages' | 'onChange' | 'value'>;
5
5
 
6
+ /**
7
+ * PageList component displays a list of page buttons for pagination.
8
+ *
9
+ * @name PageList
10
+ * @parent Pagination
11
+ */
6
12
  export function PageList({ numPages, onChange, value }: PageListProps) {
7
13
  return Array.from({ length: numPages }, (_, index) => {
8
14
  const page = index + 1;
@@ -1,9 +1,9 @@
1
1
  import './pagination.scss';
2
2
  import { SvgIcon } from '@bspk/icons/SvgIcon';
3
- import { AriaAttributes } from 'react';
4
- import { PageInput } from './PageInput';
3
+ import { AriaAttributes, useEffect, useState } from 'react';
5
4
  import { PageList } from './PageList';
6
5
  import { Button } from '-/components/Button';
6
+ import { InputElement } from '-/components/Input';
7
7
 
8
8
  // After this point the manual input renders. With equal or fewer pages the individual page buttons render instead.
9
9
  const INPUT_TYPE_THRESHOLD = 7;
@@ -12,7 +12,9 @@ export type PaginationProps = {
12
12
  /**
13
13
  * The number of pages to display in the pagination component.
14
14
  *
15
- * @default 1
15
+ * If there is only one page, the component will not render.
16
+ *
17
+ * @default 2
16
18
  */
17
19
  numPages: number;
18
20
  /**
@@ -32,14 +34,11 @@ export type PaginationProps = {
32
34
  *
33
35
  * @example
34
36
  * import { Pagination } from '@bspk/ui/Pagination';
35
- * import { usePaginationState } from '@bspk/ui/hooks/usePaginationState';
36
37
  *
37
38
  * function Example() {
38
- * const numPages = 10;
39
- *
40
- * const { currentPage, setCurrentPage } = usePaginationState(numPages);
39
+ * const [currentPage, setCurrentPage] = useState(1);
41
40
  *
42
- * return <Pagination value={currentPage} onChange={setCurrentPage} numPages={numPages} />;
41
+ * return <Pagination value={currentPage} onChange={setCurrentPage} numPages={10} />;
43
42
  * }
44
43
  *
45
44
  * @name Pagination
@@ -47,46 +46,73 @@ export type PaginationProps = {
47
46
  */
48
47
  export function Pagination({ numPages, value, onChange, ...ariaProps }: AriaAttributes & PaginationProps) {
49
48
  const nextPage = () => {
50
- if (value < numPages) {
51
- onChange(value + 1);
52
- }
49
+ if (value < numPages) onChange(value + 1);
53
50
  };
54
51
 
55
52
  const previousPage = () => {
56
- if (value > 1) {
57
- onChange(value - 1);
58
- }
53
+ if (value > 1) onChange(value - 1);
59
54
  };
60
55
 
61
- const isFirstPage = value === 1;
62
- const isLastPage = value === numPages;
63
- const isOutOfBoundsValue = value < 1 || value > numPages;
64
- const isOneOrFewerPages = numPages <= 1;
56
+ const [inputValue, setInputValue] = useState<string | undefined>(`${value}`);
57
+
58
+ useEffect(() => setInputValue(`${value}`), [value]);
59
+
60
+ const submitInputChange = () => {
61
+ const parsedValue = parseInt(inputValue || '', 10);
62
+ if (isNaN(parsedValue)) return setInputValue(`${value}`);
63
+
64
+ let next = parsedValue;
65
+ if (parsedValue < 1) next = 1;
66
+ if (parsedValue > numPages) next = numPages;
67
+
68
+ onChange(next);
69
+ if (next !== parsedValue) setInputValue(`${next}`);
70
+ };
71
+
72
+ const inBounds = (n: number) => n >= 1 && n <= numPages;
73
+
74
+ if (numPages <= 1) return null;
65
75
 
66
76
  return (
67
77
  <span data-bspk="pagination" role="group" {...ariaProps}>
68
78
  <Button
69
- disabled={isOutOfBoundsValue || isOneOrFewerPages || isFirstPage}
79
+ disabled={!inBounds(value - 1)}
70
80
  icon={<SvgIcon name="ChevronLeft" />}
71
81
  iconOnly
72
- label={isFirstPage ? 'First page' : `Previous page (${value - 1})`}
82
+ label={value === 1 ? 'First page' : `Previous page (${value - 1})`}
73
83
  onClick={previousPage}
74
84
  owner="pagination"
75
85
  size="small"
76
86
  variant="tertiary"
77
87
  />
78
-
79
88
  {numPages > INPUT_TYPE_THRESHOLD ? (
80
- <PageInput numPages={numPages} onChange={onChange} value={value} />
89
+ <form
90
+ data-input-form
91
+ onSubmit={(e) => {
92
+ e.preventDefault();
93
+ submitInputChange();
94
+ }}
95
+ >
96
+ <InputElement
97
+ name="page-number"
98
+ onBlur={() => submitInputChange()}
99
+ onChange={setInputValue}
100
+ owner="pagination"
101
+ showClearButton={false}
102
+ type="number"
103
+ value={inputValue}
104
+ />
105
+ of {numPages}
106
+ </form>
81
107
  ) : (
82
108
  <PageList numPages={numPages} onChange={onChange} value={value} />
83
109
  )}
84
110
 
85
111
  <Button
86
- disabled={isOutOfBoundsValue || isOneOrFewerPages || isLastPage}
112
+ disabled={!inBounds(value + 1)}
87
113
  icon={<SvgIcon name="ChevronRight" />}
88
114
  iconOnly
89
- label={isLastPage ? 'Last page' : `Next page (${value + 1})`}
115
+ label={value === numPages ? 'Last page' : `Next page (${value + 1})`}
90
116
  onClick={nextPage}
91
117
  owner="pagination"
92
118
  size="small"
@@ -6,25 +6,15 @@
6
6
  gap: var(--spacing-sizing-01);
7
7
  flex: 1;
8
8
 
9
- [data-bspk='page-input'] {
10
- display: flex;
11
- flex-direction: row;
12
- align-items: center;
13
- justify-content: center;
14
- gap: var(--spacing-sizing-01);
15
-
16
- [data-bspk='txt'] {
17
- color: var(--foreground-neutral-on-surface-variant-02);
18
- text-wrap: nowrap;
19
- }
9
+ [data-input-form] {
10
+ display: contents;
11
+ }
20
12
 
21
- [data-bspk='text-input'] {
22
- width: var(--spacing-sizing-12);
13
+ [data-bspk='input'] {
14
+ max-width: var(--spacing-sizing-12);
23
15
 
24
- input {
25
- text-align: center;
26
- flex: 1;
27
- }
16
+ input {
17
+ text-align: center;
28
18
  }
29
19
  }
30
20
 
@@ -16,30 +16,29 @@ export type PasswordProps = FieldControlProps & Pick<InputProps, 'containerRef'
16
16
  * import { Password } from '@bspk/ui/Password';
17
17
  * import { useState } from 'react';
18
18
  *
19
- * function ExampleStandalone() {
19
+ * () => {
20
20
  * const [value, setValue] = useState('');
21
21
  *
22
22
  * return (
23
- * <Password
24
- * aria-label="Enter password"
25
- * value={value}
26
- * onChange={setValue}
27
- * aria-label="password"
28
- * name="password"
29
- * />
23
+ * <>
24
+ * // standalone password example
25
+ * <Password
26
+ * aria-label="Enter password"
27
+ * value={value}
28
+ * onChange={setValue}
29
+ * aria-label="password"
30
+ * name="password"
31
+ * />
32
+ * <br />
33
+ * // password used within a field
34
+ * <Field>
35
+ * <FieldLabel>Password</FieldLabel>
36
+ * <Password value={value} onChange={setValue} aria-label="password" name="password" />
37
+ * <FieldDescription>The password field allows you to enter a secure password.</FieldDescription>
38
+ * </Field>
39
+ * </>
30
40
  * );
31
- * }
32
- *
33
- * function ExampleWithField() {
34
- * const [value, setValue] = useState('');
35
- * return (
36
- * <Field>
37
- * <FieldLabel>Password</FieldLabel>
38
- * <Password value={value} onChange={setValue} aria-label="password" name="password" />
39
- * <FieldDescription>The password field allows you to enter a secure password.</FieldDescription>
40
- * </Field>
41
- * );
42
- * }
41
+ * };
43
42
  *
44
43
  * @name Password
45
44
  * @phase UXReview
@@ -60,26 +60,17 @@ export type PopoverProps = CommonProps<'disabled'> &
60
60
  * import { Popover } from '@bspk/ui/Popover';
61
61
  * import { Button } from '@bspk/ui/Button';
62
62
  *
63
- * function Example() {
64
- * const [showPopover, setShowPopover] = useState<boolean>(false);
65
- *
66
- * const togglePopover = () => setShowPopover(!showPopover);
67
- * const onPopoverCallToActionClick = () => alert('Action clicked');
68
- *
69
- * return (
70
- * <Popover
71
- * placement="bottom"
72
- * content="This is a popover content"
73
- * header="Popover Header"
74
- * callToAction={{
75
- * label: 'Action',
76
- * onClick: onPopoverCallToActionClick,
77
- * }}
78
- * >
79
- * <Button label="Toggle popover" onClick={togglePopover} />
80
- * </Popover>
81
- * );
82
- * }
63
+ * <Popover
64
+ * placement="bottom"
65
+ * content="This is a popover content"
66
+ * header="Popover Header"
67
+ * callToAction={{
68
+ * label: 'Action',
69
+ * onClick: () => action('Action clicked'),
70
+ * }}
71
+ * >
72
+ * {(triggerProps) => <Button {...triggerProps} label="Toggle popover" />}
73
+ * </Popover>;
83
74
  *
84
75
  * @name Popover
85
76
  * @phase UXReview
@@ -8,7 +8,7 @@ export const PopoverExample: ComponentExampleFn<PopoverProps> = ({ action }) =>
8
8
  render: ({ props, Component }) => {
9
9
  return (
10
10
  <>
11
- <Txt style={{ marginBottom: `var(--spacing-sizing-02)` }}>Click button for a Popover</Txt>
11
+ <Txt style={{ marginBottom: `var(--spacing-sizing-02)` }}>Click for a Popover</Txt>
12
12
  <Component {...props}>
13
13
  {(triggerProps) => <Button label={`${props.placement}`} variant="secondary" {...triggerProps} />}
14
14
  </Component>
@@ -53,9 +53,7 @@ export type ProgressBarProps = {
53
53
  * @example
54
54
  * import { ProgressBar } from '@bspk/ui/ProgressBar';
55
55
  *
56
- * function Example() {
57
- * return <ProgressBar label="Example label" completion={50} />;
58
- * }
56
+ * <ProgressBar label="Example label" completion={50} />;
59
57
  *
60
58
  * @name ProgressBar
61
59
  * @phase UXReview
@@ -27,9 +27,7 @@ export type ProgressCircleProps = {
27
27
  * @example
28
28
  * import { ProgressCircle } from '@bspk/ui/ProgressCircle';
29
29
  *
30
- * function Example() {
31
- * return <ProgressCircle label="Example label" />;
32
- * }
30
+ * <ProgressCircle label="Example label" />;
33
31
  *
34
32
  * @name ProgressCircle
35
33
  * @phase UXReview
@@ -59,9 +59,7 @@ export type ProgressionStepperProps = {
59
59
  * @example
60
60
  * import { ProgressionStepper } from '@bspk/ui/ProgressionStepper';
61
61
  *
62
- * function Example() {
63
- * return <ProgressionStepper steps={[{ name: 'Step 1' }, { name: 'Step 2' }, { name: 'Step 3' }]} />;
64
- * }
62
+ * <ProgressionStepper steps={[{ name: 'Step 1' }, { name: 'Step 2' }, { name: 'Step 3' }]} />;
65
63
  *
66
64
  * @name ProgressionStepper
67
65
  * @phase UXReview
@@ -40,7 +40,7 @@ export type RadioGroupProps = Omit<FieldControlProps, 'readOnly'> & {
40
40
  * import { useState } from 'react';
41
41
  * import { RadioGroup } from '@bspk/ui/RadioGroup';
42
42
  *
43
- * function Example() {
43
+ * () => {
44
44
  * const [selectedOption, setSelectedOption] = useState<string>('1');
45
45
  *
46
46
  * return (
@@ -59,7 +59,7 @@ export type RadioGroupProps = Omit<FieldControlProps, 'readOnly'> & {
59
59
  * value={selectedOption}
60
60
  * />
61
61
  * );
62
- * }
62
+ * };
63
63
  *
64
64
  * @name RadioGroup
65
65
  * @phase UXReview
@@ -1,6 +1,5 @@
1
1
  import './rating.scss';
2
2
  import { SvgStarFill } from '@bspk/icons/StarFill';
3
- import { ElementType } from 'react';
4
3
 
5
4
  export type RatingSize = 'large' | 'medium' | 'small';
6
5
  export type RatingProps = {
@@ -12,7 +11,7 @@ export type RatingProps = {
12
11
  */
13
12
  value?: number;
14
13
  /**
15
- * If included the component is in interactive mode and this callback is fired when a star is selected.
14
+ * If included the component is interactive and this callback is fired when the user selects a new rating value.
16
15
  *
17
16
  * @param value - The new value of the rating.
18
17
  */
@@ -39,37 +38,58 @@ const iconWidths: Record<RatingSize, number> = {
39
38
  * @example
40
39
  * import { Rating } from '@bspk/ui/Rating';
41
40
  *
42
- * function Example() {
43
- * return <Rating value={4.5} />;
44
- * }
41
+ * <Rating value={4.5} size="large" />;
45
42
  *
46
43
  * @name Rating
47
44
  * @phase UXReview
48
45
  */
49
46
  export function Rating({ size = 'medium', value, onChange }: RatingProps) {
50
- const As: ElementType = onChange ? 'button' : 'div';
47
+ if (!onChange)
48
+ return (
49
+ <div
50
+ aria-label={value ? `${value} out of ${MAX_STARS} stars` : 'Rating'}
51
+ data-bspk="rating"
52
+ data-size={size}
53
+ role="img"
54
+ >
55
+ {Array.from({ length: MAX_STARS }, (_, index) => {
56
+ const fill = getFill(index + 1, value);
57
+ return (
58
+ <div data-fill={fill} data-star key={index} role="presentation" tabIndex={-1}>
59
+ <SvgStarFill width={iconWidths[size]} />
60
+ {fill === 'half' && (
61
+ <div data-fill-half>
62
+ <div data-star>
63
+ <SvgStarFill width={iconWidths[size]} />
64
+ </div>
65
+ </div>
66
+ )}
67
+ </div>
68
+ );
69
+ })}
70
+ </div>
71
+ );
51
72
 
52
73
  return (
53
74
  <div
54
- aria-label={onChange ? 'Select a star rating' : value ? `${value} out of ${MAX_STARS} stars` : 'Rating'}
75
+ aria-label={value ? `${value} out of ${MAX_STARS} stars` : 'Select a star rating'}
55
76
  data-bspk="rating"
56
77
  data-size={size}
57
- role={onChange ? 'radiogroup' : 'img'}
78
+ role="radiogroup"
58
79
  >
59
80
  {Array.from({ length: MAX_STARS }, (_, index) => {
60
81
  const fill = getFill(index + 1, value);
61
82
  const selected = value !== undefined && Math.floor(value) === index;
62
83
  return (
63
- <As
84
+ <button
64
85
  aria-checked={selected}
65
- aria-hidden={!onChange}
66
- aria-label={onChange ? `Rate ${index + 1}` : undefined}
86
+ aria-label={`Rate ${index + 1}`}
67
87
  data-fill={fill}
68
88
  data-star
69
89
  key={index}
70
90
  onClick={() => onChange?.(index + 1)}
71
- role={onChange ? 'radio' : 'presentation'}
72
- tabIndex={onChange ? (selected ? 0 : -1) : -1}
91
+ role="radio"
92
+ tabIndex={selected ? 0 : -1}
73
93
  type="button"
74
94
  >
75
95
  <SvgStarFill width={iconWidths[size]} />
@@ -80,7 +100,7 @@ export function Rating({ size = 'medium', value, onChange }: RatingProps) {
80
100
  </div>
81
101
  </div>
82
102
  )}
83
- </As>
103
+ </button>
84
104
  );
85
105
  })}
86
106
  </div>