@basic-ui/material 0.1.16 → 1.0.0-alpha.2

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 (443) hide show
  1. package/build/cjs/index.js +586 -337
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/esm/Alert/Alert.d.ts +2 -2
  4. package/build/esm/Alert/Alert.js +9 -9
  5. package/build/esm/Alert/Alert.js.map +1 -1
  6. package/build/esm/AppBar/AppBar.d.ts +3 -3
  7. package/build/esm/AppBar/AppBar.js +25 -18
  8. package/build/esm/AppBar/AppBar.js.map +1 -1
  9. package/build/esm/AppBar/AppBarButton.d.ts +2 -2
  10. package/build/esm/AppBar/AppBarButton.js +8 -9
  11. package/build/esm/AppBar/AppBarButton.js.map +1 -1
  12. package/build/esm/AppBar/context.d.ts +1 -1
  13. package/build/esm/AppBar/context.js +6 -5
  14. package/build/esm/AppBar/context.js.map +1 -1
  15. package/build/esm/Badge/Badge.d.ts +2 -2
  16. package/build/esm/Badge/Badge.js +2 -2
  17. package/build/esm/Badge/Badge.js.map +1 -1
  18. package/build/esm/BaseLine/BaseLine.d.ts +0 -1
  19. package/build/esm/BaseLine/BaseLine.js +4 -4
  20. package/build/esm/BaseLine/BaseLine.js.map +1 -1
  21. package/build/esm/BottomSheet/BottomSheet.d.ts +2 -2
  22. package/build/esm/BottomSheet/BottomSheet.js +11 -13
  23. package/build/esm/BottomSheet/BottomSheet.js.map +1 -1
  24. package/build/esm/BottomSheet/BottomSheetSurface.d.ts +4 -4
  25. package/build/esm/BottomSheet/BottomSheetSurface.js +9 -9
  26. package/build/esm/BottomSheet/BottomSheetSurface.js.map +1 -1
  27. package/build/esm/Box/Box.d.ts +5 -5
  28. package/build/esm/Box/Box.js +27 -19
  29. package/build/esm/Box/Box.js.map +1 -1
  30. package/build/esm/Button/BaseButton.d.ts +4 -3
  31. package/build/esm/Button/BaseButton.js +11 -12
  32. package/build/esm/Button/BaseButton.js.map +1 -1
  33. package/build/esm/Button/Button.d.ts +5 -5
  34. package/build/esm/Button/Button.js +45 -24
  35. package/build/esm/Button/Button.js.map +1 -1
  36. package/build/esm/Button/ButtonGroup.d.ts +5 -0
  37. package/build/esm/Button/ButtonGroup.js +31 -0
  38. package/build/esm/Button/ButtonGroup.js.map +1 -0
  39. package/build/esm/Button/FilledButton.d.ts +3 -2
  40. package/build/esm/Button/FilledButton.js +62 -21
  41. package/build/esm/Button/FilledButton.js.map +1 -1
  42. package/build/esm/Button/FloatingActionButton.d.ts +1 -1
  43. package/build/esm/Button/FloatingActionButton.js.map +1 -1
  44. package/build/esm/Button/IconButton.d.ts +2 -1
  45. package/build/esm/Button/IconButton.js +2 -1
  46. package/build/esm/Button/IconButton.js.map +1 -1
  47. package/build/esm/Button/OutlinedButton.d.ts +1 -1
  48. package/build/esm/Button/OutlinedButton.js +36 -4
  49. package/build/esm/Button/OutlinedButton.js.map +1 -1
  50. package/build/esm/Button/TransparentButton.d.ts +3 -2
  51. package/build/esm/Button/TransparentButton.js +49 -15
  52. package/build/esm/Button/TransparentButton.js.map +1 -1
  53. package/build/esm/Button/context.d.ts +8 -0
  54. package/build/esm/Button/context.js +7 -0
  55. package/build/esm/Button/context.js.map +1 -0
  56. package/build/esm/Button/index.d.ts +1 -0
  57. package/build/esm/Button/index.js +1 -0
  58. package/build/esm/Button/index.js.map +1 -1
  59. package/build/esm/CheckBox/CheckBox.d.ts +3 -3
  60. package/build/esm/CheckBox/CheckBox.js +43 -36
  61. package/build/esm/CheckBox/CheckBox.js.map +1 -1
  62. package/build/esm/CheckBox/CheckBoxIcon.d.ts +3 -3
  63. package/build/esm/CheckBox/CheckBoxIcon.js +15 -13
  64. package/build/esm/CheckBox/CheckBoxIcon.js.map +1 -1
  65. package/build/esm/CheckBox/CheckPath.js +15 -14
  66. package/build/esm/CheckBox/CheckPath.js.map +1 -1
  67. package/build/esm/CheckBox/IndeterminatePath.js +14 -13
  68. package/build/esm/CheckBox/IndeterminatePath.js.map +1 -1
  69. package/build/esm/Chip/ButtonChip.d.ts +5 -5
  70. package/build/esm/Chip/ButtonChip.js +49 -65
  71. package/build/esm/Chip/ButtonChip.js.map +1 -1
  72. package/build/esm/Chip/ChipBase.d.ts +2 -2
  73. package/build/esm/Chip/ChipBase.js +42 -29
  74. package/build/esm/Chip/ChipBase.js.map +1 -1
  75. package/build/esm/Chip/ChoiceChip.d.ts +5 -4
  76. package/build/esm/Chip/ChoiceChip.js +38 -45
  77. package/build/esm/Chip/ChoiceChip.js.map +1 -1
  78. package/build/esm/ColorMode/ColorModeProvider.d.ts +1 -1
  79. package/build/esm/ColorMode/ColorModeProvider.js +32 -19
  80. package/build/esm/ColorMode/ColorModeProvider.js.map +1 -1
  81. package/build/esm/ColorMode/color-mode.js +3 -3
  82. package/build/esm/ColorMode/color-mode.js.map +1 -1
  83. package/build/esm/ColorMode/color-vars.js +20 -12
  84. package/build/esm/ColorMode/color-vars.js.map +1 -1
  85. package/build/esm/ColorMode/constants.js +3 -3
  86. package/build/esm/ColorMode/constants.js.map +1 -1
  87. package/build/esm/Combobox/Combobox.d.ts +15 -15
  88. package/build/esm/Combobox/Combobox.js +51 -57
  89. package/build/esm/Combobox/Combobox.js.map +1 -1
  90. package/build/esm/Dialog/Dialog.d.ts +5 -5
  91. package/build/esm/Dialog/Dialog.js +22 -23
  92. package/build/esm/Dialog/Dialog.js.map +1 -1
  93. package/build/esm/Dialog/DialogBackdrop.d.ts +4 -4
  94. package/build/esm/Dialog/DialogBackdrop.js +10 -11
  95. package/build/esm/Dialog/DialogBackdrop.js.map +1 -1
  96. package/build/esm/Dialog/DialogContainer.d.ts +1 -1
  97. package/build/esm/Dialog/DialogContainer.js +4 -6
  98. package/build/esm/Dialog/DialogContainer.js.map +1 -1
  99. package/build/esm/Dialog/DialogSurface.d.ts +7 -5
  100. package/build/esm/Dialog/DialogSurface.js +24 -12
  101. package/build/esm/Dialog/DialogSurface.js.map +1 -1
  102. package/build/esm/Dialog/Scrim.d.ts +1 -1
  103. package/build/esm/Dialog/Scrim.js +4 -6
  104. package/build/esm/Dialog/Scrim.js.map +1 -1
  105. package/build/esm/Dialog/useDialogAnimation.js +19 -20
  106. package/build/esm/Dialog/useDialogAnimation.js.map +1 -1
  107. package/build/esm/Divider/Divider.d.ts +3 -3
  108. package/build/esm/Divider/Divider.js +9 -8
  109. package/build/esm/Divider/Divider.js.map +1 -1
  110. package/build/esm/FloatingLabel/FloatingLabel.d.ts +1 -1
  111. package/build/esm/FloatingLabel/FloatingLabel.js +26 -22
  112. package/build/esm/FloatingLabel/FloatingLabel.js.map +1 -1
  113. package/build/esm/LineRipple/LineRipple.d.ts +3 -3
  114. package/build/esm/LineRipple/LineRipple.js +27 -18
  115. package/build/esm/LineRipple/LineRipple.js.map +1 -1
  116. package/build/esm/Link/Link.d.ts +3 -3
  117. package/build/esm/Link/Link.js +10 -9
  118. package/build/esm/Link/Link.js.map +1 -1
  119. package/build/esm/List/List.d.ts +3 -3
  120. package/build/esm/List/List.js +20 -13
  121. package/build/esm/List/List.js.map +1 -1
  122. package/build/esm/ListItem/ListItem.d.ts +3 -3
  123. package/build/esm/ListItem/ListItem.js +72 -50
  124. package/build/esm/ListItem/ListItem.js.map +1 -1
  125. package/build/esm/ListItem/ListItemText.d.ts +1 -1
  126. package/build/esm/ListItem/ListItemText.js +10 -15
  127. package/build/esm/ListItem/ListItemText.js.map +1 -1
  128. package/build/esm/Menu/Menu.d.ts +10 -10
  129. package/build/esm/Menu/Menu.js +23 -27
  130. package/build/esm/Menu/Menu.js.map +1 -1
  131. package/build/esm/Menu/animation.d.ts +1 -1
  132. package/build/esm/Menu/animation.js +1 -1
  133. package/build/esm/Menu/animation.js.map +1 -1
  134. package/build/esm/NotchedOutline/NotchedOutline.d.ts +1 -1
  135. package/build/esm/NotchedOutline/NotchedOutline.js +25 -21
  136. package/build/esm/NotchedOutline/NotchedOutline.js.map +1 -1
  137. package/build/esm/NotchedOutline/context.js +6 -5
  138. package/build/esm/NotchedOutline/context.js.map +1 -1
  139. package/build/esm/NotchedOutline/styledComponents.d.ts +96 -50
  140. package/build/esm/NotchedOutline/styledComponents.js +58 -63
  141. package/build/esm/NotchedOutline/styledComponents.js.map +1 -1
  142. package/build/esm/Paper/Paper.d.ts +4 -3
  143. package/build/esm/Paper/Paper.js +15 -13
  144. package/build/esm/Paper/Paper.js.map +1 -1
  145. package/build/esm/ProgressSpinner/ProgressSpinner.d.ts +1 -1
  146. package/build/esm/ProgressSpinner/ProgressSpinner.js +16 -16
  147. package/build/esm/ProgressSpinner/ProgressSpinner.js.map +1 -1
  148. package/build/esm/RadioButton/RadioButton.d.ts +1 -1
  149. package/build/esm/RadioButton/RadioButton.js +17 -20
  150. package/build/esm/RadioButton/RadioButton.js.map +1 -1
  151. package/build/esm/RadioButton/RadioButtonIcon.d.ts +1 -1
  152. package/build/esm/RadioButton/RadioButtonIcon.js +7 -8
  153. package/build/esm/RadioButton/RadioButtonIcon.js.map +1 -1
  154. package/build/esm/RadioButton/RadioGroup.d.ts +3 -3
  155. package/build/esm/RadioButton/RadioGroup.js +5 -4
  156. package/build/esm/RadioButton/RadioGroup.js.map +1 -1
  157. package/build/esm/Ripple/Ripple.d.ts +1 -1
  158. package/build/esm/Ripple/Ripple.js +21 -20
  159. package/build/esm/Ripple/Ripple.js.map +1 -1
  160. package/build/esm/Ripple/RippleBox.d.ts +4 -4
  161. package/build/esm/Ripple/RippleBox.js +22 -15
  162. package/build/esm/Ripple/RippleBox.js.map +1 -1
  163. package/build/esm/Ripple/constants.js +7 -7
  164. package/build/esm/Ripple/constants.js.map +1 -1
  165. package/build/esm/Ripple/keyframes.d.ts +1 -1
  166. package/build/esm/Ripple/keyframes.js +3 -3
  167. package/build/esm/Ripple/keyframes.js.map +1 -1
  168. package/build/esm/Ripple/useRipple.js +55 -48
  169. package/build/esm/Ripple/useRipple.js.map +1 -1
  170. package/build/esm/Ripple/useRippleHandlers.d.ts +1 -1
  171. package/build/esm/Ripple/useRippleHandlers.js +13 -15
  172. package/build/esm/Ripple/useRippleHandlers.js.map +1 -1
  173. package/build/esm/Ripple/useRippleSurface.d.ts +6 -5
  174. package/build/esm/Ripple/useRippleSurface.js +60 -37
  175. package/build/esm/Ripple/useRippleSurface.js.map +1 -1
  176. package/build/esm/Select/Select.d.ts +4 -4
  177. package/build/esm/Select/Select.js +69 -47
  178. package/build/esm/Select/Select.js.map +1 -1
  179. package/build/esm/Select/SelectIcon.d.ts +3 -3
  180. package/build/esm/Select/SelectIcon.js +6 -7
  181. package/build/esm/Select/SelectIcon.js.map +1 -1
  182. package/build/esm/Select/context.js +7 -6
  183. package/build/esm/Select/context.js.map +1 -1
  184. package/build/esm/Select/defaultRender.js +12 -10
  185. package/build/esm/Select/defaultRender.js.map +1 -1
  186. package/build/esm/Select/styledComponents.d.ts +2 -2
  187. package/build/esm/Select/styledComponents.js +16 -19
  188. package/build/esm/Select/styledComponents.js.map +1 -1
  189. package/build/esm/SelectItem/SelectItem.d.ts +2 -2
  190. package/build/esm/SelectItem/SelectItem.js +18 -19
  191. package/build/esm/SelectItem/SelectItem.js.map +1 -1
  192. package/build/esm/SelectionControl/SelectionControlLabel.d.ts +3 -3
  193. package/build/esm/SelectionControl/SelectionControlLabel.js +7 -7
  194. package/build/esm/SelectionControl/SelectionControlLabel.js.map +1 -1
  195. package/build/esm/SelectionControl/SelectionControlText.d.ts +3 -3
  196. package/build/esm/SelectionControl/SelectionControlText.js +8 -8
  197. package/build/esm/SelectionControl/SelectionControlText.js.map +1 -1
  198. package/build/esm/Skeleton/DelayAppearance.d.ts +4 -4
  199. package/build/esm/Skeleton/DelayAppearance.js +9 -9
  200. package/build/esm/Skeleton/DelayAppearance.js.map +1 -1
  201. package/build/esm/Skeleton/Skeleton.d.ts +3 -3
  202. package/build/esm/Skeleton/Skeleton.js +11 -10
  203. package/build/esm/Skeleton/Skeleton.js.map +1 -1
  204. package/build/esm/Skeleton/animation.d.ts +2 -2
  205. package/build/esm/Skeleton/animation.js +25 -22
  206. package/build/esm/Skeleton/animation.js.map +1 -1
  207. package/build/esm/Snackbar/Snackbar.d.ts +3 -3
  208. package/build/esm/Snackbar/Snackbar.js +24 -24
  209. package/build/esm/Snackbar/Snackbar.js.map +1 -1
  210. package/build/esm/Snackbar/Stack.d.ts +2 -3
  211. package/build/esm/Snackbar/Stack.js +78 -65
  212. package/build/esm/Snackbar/Stack.js.map +1 -1
  213. package/build/esm/Snackbar/useSnackbarAnimation.d.ts +1 -1
  214. package/build/esm/Snackbar/useSnackbarAnimation.js +113 -78
  215. package/build/esm/Snackbar/useSnackbarAnimation.js.map +1 -1
  216. package/build/esm/Switch/Switch.d.ts +3 -3
  217. package/build/esm/Switch/Switch.js +29 -28
  218. package/build/esm/Switch/Switch.js.map +1 -1
  219. package/build/esm/Switch/styledComponents.d.ts +2 -2
  220. package/build/esm/Switch/styledComponents.js +66 -40
  221. package/build/esm/Switch/styledComponents.js.map +1 -1
  222. package/build/esm/Tab/Tab.d.ts +4 -4
  223. package/build/esm/Tab/Tab.js +17 -19
  224. package/build/esm/Tab/Tab.js.map +1 -1
  225. package/build/esm/Tab/TabList.d.ts +3 -3
  226. package/build/esm/Tab/TabList.js +18 -19
  227. package/build/esm/Tab/TabList.js.map +1 -1
  228. package/build/esm/Tab/TabPanel.d.ts +3 -3
  229. package/build/esm/Tab/TabPanel.js +8 -11
  230. package/build/esm/Tab/TabPanel.js.map +1 -1
  231. package/build/esm/Tab/context.js +6 -5
  232. package/build/esm/Tab/context.js.map +1 -1
  233. package/build/esm/TabIndicator/TabIndicator.d.ts +2 -2
  234. package/build/esm/TabIndicator/TabIndicator.js +22 -21
  235. package/build/esm/TabIndicator/TabIndicator.js.map +1 -1
  236. package/build/esm/TabIndicator/context.js +6 -5
  237. package/build/esm/TabIndicator/context.js.map +1 -1
  238. package/build/esm/Table/Table.d.ts +2 -2
  239. package/build/esm/Table/Table.js +8 -8
  240. package/build/esm/Table/Table.js.map +1 -1
  241. package/build/esm/Table/TableBody.d.ts +1 -1
  242. package/build/esm/Table/TableBody.js +4 -6
  243. package/build/esm/Table/TableBody.js.map +1 -1
  244. package/build/esm/Table/TableCell.d.ts +1 -1
  245. package/build/esm/Table/TableCell.js +6 -8
  246. package/build/esm/Table/TableCell.js.map +1 -1
  247. package/build/esm/Table/TableHead.d.ts +1 -1
  248. package/build/esm/Table/TableHead.js +5 -7
  249. package/build/esm/Table/TableHead.js.map +1 -1
  250. package/build/esm/Table/TableRow.d.ts +2 -2
  251. package/build/esm/Table/TableRow.js +5 -7
  252. package/build/esm/Table/TableRow.js.map +1 -1
  253. package/build/esm/Table/context.js +6 -5
  254. package/build/esm/Table/context.js.map +1 -1
  255. package/build/esm/Text/LoremIpsum.d.ts +1 -1
  256. package/build/esm/Text/LoremIpsum.js +6 -6
  257. package/build/esm/Text/LoremIpsum.js.map +1 -1
  258. package/build/esm/Text/Text.d.ts +3 -3
  259. package/build/esm/Text/Text.js +9 -9
  260. package/build/esm/Text/Text.js.map +1 -1
  261. package/build/esm/TextField/FilledContainer.d.ts +3 -3
  262. package/build/esm/TextField/FilledContainer.js +61 -57
  263. package/build/esm/TextField/FilledContainer.js.map +1 -1
  264. package/build/esm/TextField/HelperText.d.ts +3 -3
  265. package/build/esm/TextField/HelperText.js +14 -13
  266. package/build/esm/TextField/HelperText.js.map +1 -1
  267. package/build/esm/TextField/IconContainer.d.ts +2 -2
  268. package/build/esm/TextField/IconContainer.js +15 -23
  269. package/build/esm/TextField/IconContainer.js.map +1 -1
  270. package/build/esm/TextField/Input.d.ts +3 -3
  271. package/build/esm/TextField/Input.js +14 -14
  272. package/build/esm/TextField/Input.js.map +1 -1
  273. package/build/esm/TextField/OutlinedContainer.d.ts +4 -4
  274. package/build/esm/TextField/OutlinedContainer.js +28 -22
  275. package/build/esm/TextField/OutlinedContainer.js.map +1 -1
  276. package/build/esm/TextField/TextField.d.ts +4 -4
  277. package/build/esm/TextField/TextField.js +59 -41
  278. package/build/esm/TextField/TextField.js.map +1 -1
  279. package/build/esm/TextField/consts.js +5 -5
  280. package/build/esm/TextField/consts.js.map +1 -1
  281. package/build/esm/ThemeExplorer/ColorPicker.d.ts +4 -4
  282. package/build/esm/ThemeExplorer/ColorPicker.js +16 -16
  283. package/build/esm/ThemeExplorer/ColorPicker.js.map +1 -1
  284. package/build/esm/ThemeExplorer/TextFieldColorPicker.d.ts +2 -2
  285. package/build/esm/ThemeExplorer/TextFieldColorPicker.js +49 -29
  286. package/build/esm/ThemeExplorer/TextFieldColorPicker.js.map +1 -1
  287. package/build/esm/ThemeExplorer/ThemeColors.d.ts +1 -1
  288. package/build/esm/ThemeExplorer/ThemeColors.js +3 -3
  289. package/build/esm/ThemeExplorer/ThemeColors.js.map +1 -1
  290. package/build/esm/ThemeExplorer/components.d.ts +2 -1
  291. package/build/esm/ThemeExplorer/components.js +64 -56
  292. package/build/esm/ThemeExplorer/components.js.map +1 -1
  293. package/build/esm/ThemeExplorer/makeColorScheme.d.ts +1 -1
  294. package/build/esm/ThemeExplorer/makeColorScheme.js.map +1 -1
  295. package/build/esm/ThemeExplorer/useDeferredColor.d.ts +1 -1
  296. package/build/esm/ThemeExplorer/useDeferredColor.js +10 -3
  297. package/build/esm/ThemeExplorer/useDeferredColor.js.map +1 -1
  298. package/build/esm/ThemeExplorer/useLocalStorageCachedState.js +9 -2
  299. package/build/esm/ThemeExplorer/useLocalStorageCachedState.js.map +1 -1
  300. package/build/esm/Tooltip/Tooltip.d.ts +3 -3
  301. package/build/esm/Tooltip/Tooltip.js +7 -8
  302. package/build/esm/Tooltip/Tooltip.js.map +1 -1
  303. package/build/esm/color.d.ts +5 -4
  304. package/build/esm/color.js +26 -16
  305. package/build/esm/color.js.map +1 -1
  306. package/build/esm/hooks/useAnimation.d.ts +1 -1
  307. package/build/esm/hooks/useAnimation.js +54 -41
  308. package/build/esm/hooks/useAnimation.js.map +1 -1
  309. package/build/esm/theme/theme.d.ts +96 -50
  310. package/build/esm/theme/theme.js +134 -94
  311. package/build/esm/theme/theme.js.map +1 -1
  312. package/build/esm/theme/typography-raleway.js +1 -1
  313. package/build/esm/theme/typography-raleway.js.map +1 -1
  314. package/build/esm/theme/typography-roboto.js +1 -1
  315. package/build/esm/theme/typography-roboto.js.map +1 -1
  316. package/build/esm/theme/useTheme.d.ts +1 -1
  317. package/build/esm/theme/useTheme.js +1 -1
  318. package/build/esm/theme/useTheme.js.map +1 -1
  319. package/build/tsconfig.tsbuildinfo +1 -1
  320. package/package.json +6 -4
  321. package/src/Alert/Alert.tsx +4 -2
  322. package/src/AppBar/AppBar.story.tsx +7 -6
  323. package/src/AppBar/AppBar.tsx +10 -9
  324. package/src/AppBar/AppBarButton.tsx +3 -1
  325. package/src/AppBar/context.ts +2 -1
  326. package/src/Badge/Badge.tsx +3 -1
  327. package/src/BaseLine/BaseLine.tsx +15 -11
  328. package/src/BottomSheet/BottomSheet.story.tsx +1 -0
  329. package/src/BottomSheet/BottomSheet.tsx +2 -1
  330. package/src/BottomSheet/BottomSheetSurface.tsx +9 -5
  331. package/src/Box/Box.tsx +21 -18
  332. package/src/Button/BaseButton.tsx +5 -2
  333. package/src/Button/Button.story.tsx +35 -35
  334. package/src/Button/Button.tsx +23 -8
  335. package/src/Button/ButtonGroup.story.tsx +106 -0
  336. package/src/Button/ButtonGroup.tsx +35 -0
  337. package/src/Button/FilledButton.tsx +41 -6
  338. package/src/Button/FloatingActionButton.tsx +9 -0
  339. package/src/Button/IconButton.tsx +2 -1
  340. package/src/Button/OutlinedButton.tsx +33 -4
  341. package/src/Button/SpinnerButton.story.tsx +10 -11
  342. package/src/Button/TransparentButton.tsx +35 -4
  343. package/src/Button/context.tsx +17 -0
  344. package/src/Button/index.ts +1 -0
  345. package/src/CheckBox/CheckBox.story.tsx +3 -2
  346. package/src/CheckBox/CheckBox.tsx +10 -6
  347. package/src/CheckBox/CheckBoxIcon.tsx +4 -2
  348. package/src/Chip/ButtonChip.tsx +47 -51
  349. package/src/Chip/Chip.story.tsx +48 -27
  350. package/src/Chip/ChipBase.tsx +44 -14
  351. package/src/Chip/ChoiceChip.tsx +28 -24
  352. package/src/ColorMode/ColorModeProvider.tsx +4 -2
  353. package/src/Combobox/Combobox.story.tsx +2 -1
  354. package/src/Combobox/Combobox.tsx +30 -18
  355. package/src/Dialog/Dialog.story.tsx +3 -1
  356. package/src/Dialog/Dialog.tsx +9 -4
  357. package/src/Dialog/DialogBackdrop.tsx +6 -6
  358. package/src/Dialog/DialogContainer.tsx +3 -1
  359. package/src/Dialog/DialogSurface.tsx +26 -9
  360. package/src/Dialog/Scrim.tsx +3 -1
  361. package/src/Divider/Divider.tsx +4 -2
  362. package/src/FloatingLabel/FloatingLabel.story.tsx +1 -0
  363. package/src/FloatingLabel/FloatingLabel.tsx +3 -2
  364. package/src/LineRipple/LineRipple.story.tsx +1 -0
  365. package/src/LineRipple/LineRipple.tsx +6 -3
  366. package/src/Link/Link.tsx +4 -2
  367. package/src/List/List.tsx +5 -2
  368. package/src/ListItem/ListItem.story.tsx +1 -0
  369. package/src/ListItem/ListItem.tsx +59 -34
  370. package/src/ListItem/ListItemText.tsx +4 -5
  371. package/src/Menu/Menu.tsx +21 -14
  372. package/src/Menu/animation.ts +1 -1
  373. package/src/NotchedOutline/NotchedOutline.story.tsx +3 -2
  374. package/src/NotchedOutline/NotchedOutline.tsx +2 -1
  375. package/src/NotchedOutline/styledComponents.ts +8 -7
  376. package/src/Paper/Paper.story.tsx +17 -3
  377. package/src/Paper/Paper.tsx +22 -5
  378. package/src/ProgressSpinner/ProgressSpinner.story.tsx +1 -0
  379. package/src/ProgressSpinner/ProgressSpinner.tsx +5 -2
  380. package/src/RadioButton/RadioButton.story.tsx +2 -1
  381. package/src/RadioButton/RadioButton.tsx +10 -8
  382. package/src/RadioButton/RadioButtonIcon.tsx +4 -3
  383. package/src/RadioButton/RadioGroup.tsx +5 -5
  384. package/src/Ripple/Ripple.story.tsx +9 -3
  385. package/src/Ripple/Ripple.tsx +3 -2
  386. package/src/Ripple/RippleBox.tsx +9 -4
  387. package/src/Ripple/keyframes.ts +2 -1
  388. package/src/Ripple/useRipple.ts +1 -0
  389. package/src/Ripple/useRippleHandlers.ts +3 -1
  390. package/src/Ripple/useRippleSurface.ts +39 -13
  391. package/src/Select/PaymentMethodSelect.story.tsx +3 -1
  392. package/src/Select/Select.story.tsx +1 -0
  393. package/src/Select/Select.tsx +6 -4
  394. package/src/Select/SelectIcon.tsx +6 -3
  395. package/src/Select/defaultRender.ts +13 -13
  396. package/src/Select/styledComponents.tsx +5 -3
  397. package/src/SelectItem/SelectItem.tsx +4 -2
  398. package/src/SelectionControl/SelectionControlLabel.tsx +6 -3
  399. package/src/SelectionControl/SelectionControlText.tsx +4 -2
  400. package/src/Skeleton/DelayAppearance.tsx +5 -3
  401. package/src/Skeleton/Skeleton.story.tsx +2 -2
  402. package/src/Skeleton/Skeleton.tsx +4 -2
  403. package/src/Skeleton/animation.ts +3 -2
  404. package/src/Snackbar/Snackbar.story.tsx +1 -0
  405. package/src/Snackbar/Snackbar.tsx +8 -6
  406. package/src/Snackbar/Stack.tsx +3 -3
  407. package/src/Snackbar/useSnackbarAnimation.ts +3 -1
  408. package/src/Switch/Switch.tsx +16 -11
  409. package/src/Switch/styledComponents.tsx +72 -22
  410. package/src/Tab/Tab.tsx +8 -4
  411. package/src/Tab/TabList.tsx +5 -5
  412. package/src/Tab/TabPanel.tsx +5 -5
  413. package/src/TabIndicator/TabIndicator.tsx +6 -3
  414. package/src/Table/Table.tsx +5 -2
  415. package/src/Table/TableBody.tsx +3 -1
  416. package/src/Table/TableCell.tsx +3 -1
  417. package/src/Table/TableHead.tsx +4 -2
  418. package/src/Table/TableRow.tsx +4 -2
  419. package/src/Text/LoremIpsum.tsx +2 -1
  420. package/src/Text/Text.tsx +4 -2
  421. package/src/TextField/FilledContainer.tsx +13 -8
  422. package/src/TextField/HelperText.tsx +3 -2
  423. package/src/TextField/IconContainer.tsx +3 -2
  424. package/src/TextField/Input.tsx +9 -4
  425. package/src/TextField/OutlinedContainer.tsx +5 -3
  426. package/src/TextField/TextField.story.tsx +1 -0
  427. package/src/TextField/TextField.tsx +6 -3
  428. package/src/ThemeExplorer/ColorPicker.tsx +104 -0
  429. package/src/ThemeExplorer/TextFieldColorPicker.tsx +115 -0
  430. package/src/ThemeExplorer/ThemeBuilder.story.tsx +165 -0
  431. package/src/ThemeExplorer/ThemeColors.tsx +89 -0
  432. package/src/ThemeExplorer/ThemeExplorer.story.tsx +43 -0
  433. package/src/ThemeExplorer/components.tsx +195 -0
  434. package/src/ThemeExplorer/makeColorScheme.tsx +74 -0
  435. package/src/ThemeExplorer/useDeferredColor.tsx +25 -0
  436. package/src/ThemeExplorer/useLocalStorageCachedState.ts +18 -0
  437. package/src/Tooltip/Tooltip.story.tsx +1 -0
  438. package/src/Tooltip/Tooltip.tsx +8 -4
  439. package/src/color.ts +36 -29
  440. package/src/hooks/useAnimation.ts +2 -1
  441. package/src/theme/theme.ts +131 -92
  442. package/src/theme/useTheme.ts +3 -1
  443. package/src/ListItem/context.ts +0 -13
@@ -0,0 +1,35 @@
1
+ import React, { forwardRef, useMemo } from 'react';
2
+
3
+ import type { ButtonProps } from './Button';
4
+ import type { ButtonGroupContextProps } from './context';
5
+ import { ButtonGroupContext } from './context';
6
+
7
+ export type ButtonGroupProps = ButtonProps & ButtonGroupContextProps;
8
+
9
+ export const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(
10
+ function ButtonGroup(props, forwardedRef) {
11
+ const {
12
+ as: Comp = 'div',
13
+ variant = 'text',
14
+ direction = 'row',
15
+ ...otherProps
16
+ } = props;
17
+
18
+ const value: ButtonGroupContextProps = useMemo(
19
+ () => ({ direction, variant }),
20
+ [direction, variant]
21
+ );
22
+
23
+ return (
24
+ <ButtonGroupContext.Provider value={value}>
25
+ <Comp
26
+ ref={forwardedRef}
27
+ role="group"
28
+ data-button-group=""
29
+ data-button-group-direction={direction}
30
+ {...otherProps}
31
+ />
32
+ </ButtonGroupContext.Provider>
33
+ );
34
+ }
35
+ );
@@ -1,10 +1,11 @@
1
1
  import styled from '@emotion/styled';
2
- import { readableColor } from 'polished';
3
- import { BaseButton } from './BaseButton';
4
- import { Theme } from '../theme';
5
- import { alpha, getDarkThemeBackgroundOverlay } from '../color';
2
+ import { readableColor, rem } from 'polished';
6
3
  import { get, css } from '@styled-system/css';
7
4
 
5
+ import { BaseButton } from './BaseButton';
6
+ import type { Theme } from '../theme';
7
+ import { alpha, getBackgroundOverlay } from '../color';
8
+
8
9
  export const FilledButton = styled(BaseButton)(
9
10
  ({ color = 'primary', theme }) =>
10
11
  css({
@@ -21,13 +22,46 @@ export const FilledButton = styled(BaseButton)(
21
22
  backgroundBlendMode: 'overlay',
22
23
  cursor: 'default',
23
24
  },
25
+ '&:focus-visible': {
26
+ outlineColor: get(theme, `colors.${String(color)}`) || color,
27
+ outlineWidth: 2,
28
+ outlineStyle: 'auto',
29
+ outlineOffset: '2px',
30
+ },
24
31
  }),
25
32
  ({ color = 'primary', elevation = 'none', theme }) =>
26
33
  color === 'surface' && {
27
- ...getDarkThemeBackgroundOverlay(
34
+ ...getBackgroundOverlay(
28
35
  theme,
29
- get(theme, `buttons.elevations.${elevation}.boxShadow`, 0)
36
+ get(theme, `buttons.elevations.${elevation}.boxShadow`, 0),
37
+ 'primary'
30
38
  ),
39
+ },
40
+ ({ color = 'primary', theme, isGroupedButton = false }) =>
41
+ isGroupedButton && {
42
+ '[data-button-group=""] &': {
43
+ borderColor:
44
+ get(theme, `colors.on.${String(color)}`) ||
45
+ (typeof color === 'string' ? readableColor(color) : undefined),
46
+ ':first-of-type': {
47
+ borderTopRightRadius: 0,
48
+ borderBottomRightRadius: 0,
49
+ borderRightStyle: 'solid',
50
+ borderRightWidth: rem(1),
51
+ },
52
+ ':not(:first-of-type):not(:last-of-type)': {
53
+ borderRadius: 0,
54
+ },
55
+ ':last-of-type': {
56
+ borderTopLeftRadius: 0,
57
+ borderBottomLeftRadius: 0,
58
+ borderLeftStyle: 'solid',
59
+ borderLeftWidth: rem(1),
60
+ },
61
+ ':last-of-type:nth-of-type(2)': {
62
+ borderLeftWidth: 0,
63
+ },
64
+ },
31
65
  }
32
66
  );
33
67
 
@@ -36,5 +70,6 @@ export function getRippleProperties(theme: Theme) {
36
70
  hoverOpacity: get(theme, `buttons.overlays.filled.hover.opacity`),
37
71
  focusOpacity: get(theme, `buttons.overlays.filled.focus.opacity`),
38
72
  pressedOpacity: get(theme, `buttons.overlays.filled.pressed.opacity`),
73
+ rippleEnabled: false,
39
74
  };
40
75
  }
@@ -0,0 +1,9 @@
1
+ import { getRippleProperties as filledButtonGetProperties } from './FilledButton';
2
+ import type { Theme } from '../theme';
3
+
4
+ export function getRippleProperties(theme: Theme) {
5
+ return {
6
+ ...filledButtonGetProperties(theme),
7
+ rippleEnabled: true,
8
+ };
9
+ }
@@ -1,9 +1,10 @@
1
1
  import { getRippleProperties as filledButtonGetProperties } from './FilledButton';
2
- import { Theme } from '../theme';
2
+ import type { Theme } from '../theme';
3
3
 
4
4
  export function getRippleProperties(theme: Theme) {
5
5
  return {
6
6
  ...filledButtonGetProperties(theme),
7
7
  center: true,
8
+ rippleEnabled: true,
8
9
  };
9
10
  }
@@ -1,18 +1,47 @@
1
- import { TransparentButton } from './TransparentButton';
2
1
  import styled from '@emotion/styled';
3
2
  import { css } from '@styled-system/css';
4
- import { alpha } from '../color';
5
3
  import { rem } from 'polished';
6
4
 
5
+ import { alpha } from '../color';
6
+ import { TransparentButton } from './TransparentButton';
7
+
7
8
  export const OutlinedButton = styled(TransparentButton)(
8
9
  css({
9
10
  borderStyle: 'solid',
10
11
  borderWidth: rem(1),
11
- borderColor: alpha('on.surface', 0.12),
12
+ borderColor: 'outline',
13
+ boxShadow: 0,
14
+ '&:focus,:&active,:&hover': { boxShadow: 0 },
15
+ '&:focus-visible,&:active': {
16
+ borderColor: 'currentColor',
17
+ },
12
18
  '&:disabled': {
13
19
  color: alpha('on.surface', 0.38),
14
20
  borderColor: alpha('on.surface', 0.12),
15
21
  cursor: 'default',
16
22
  },
17
- })
23
+ }),
24
+ ({ isGroupedButton = false }) =>
25
+ isGroupedButton && {
26
+ '[data-button-group=""] &': {
27
+ ':first-of-type': {
28
+ borderTopRightRadius: 0,
29
+ borderBottomRightRadius: 0,
30
+ },
31
+ ':not(:first-of-type):not(:last-of-type)': {
32
+ borderRadius: 0,
33
+ borderRightWidth: 0,
34
+ borderLeftWidth: 0,
35
+ },
36
+ ':last-of-type': {
37
+ borderTopLeftRadius: 0,
38
+ borderBottomLeftRadius: 0,
39
+ borderLeftStyle: 'solid',
40
+ borderLeftWidth: rem(1),
41
+ },
42
+ ':last-of-type:nth-of-type(2)': {
43
+ borderLeftWidth: 0,
44
+ },
45
+ },
46
+ }
18
47
  );
@@ -1,25 +1,24 @@
1
- import { useState, FC } from 'react';
1
+ import type { FC } from 'react';
2
+ import { useState } from 'react';
3
+ import type { SpinnerProps, SpinnerButtonProps } from '@basic-ui/core';
2
4
  import {
3
5
  Spinner as SpinnerBase,
4
6
  SpinnerButton as SpinnerButtonBase,
5
- SpinnerProps,
6
- SpinnerButtonProps,
7
7
  } from '@basic-ui/core';
8
+
8
9
  import { Button, Box, Text } from '../';
9
10
  import { alpha } from '../color';
10
11
  import { useTheme } from '../theme';
11
- import { BoxProps } from '../Box';
12
+ import type { BoxProps } from '../Box';
12
13
 
13
14
  export default {
14
15
  title: 'components/SpinnerButton',
15
16
  };
16
17
 
17
- const Spinner: FC<
18
- Omit<BoxProps, 'onChange'> & SpinnerProps
19
- > = SpinnerBase as any;
20
- const SpinnerButton: FC<
21
- BoxProps & SpinnerButtonProps
22
- > = SpinnerButtonBase as any;
18
+ const Spinner: FC<Omit<BoxProps, 'onChange'> & SpinnerProps> =
19
+ SpinnerBase as any;
20
+ const SpinnerButton: FC<BoxProps & SpinnerButtonProps> =
21
+ SpinnerButtonBase as any;
23
22
 
24
23
  function AddIcon(props) {
25
24
  return (
@@ -54,7 +53,7 @@ const Example = ({ vertical = false }) => {
54
53
  display: 'inline-flex',
55
54
  alignItems: 'center',
56
55
  flexDirection: vertical ? 'column-reverse' : 'row',
57
- borderRadius: '4px',
56
+ borderRadius: 'full',
58
57
  '&:focus': {
59
58
  outline: 'none',
60
59
  boxShadow: `0px 0px 10px 0px ${alpha('primary', 0.6)(theme)}`,
@@ -1,8 +1,9 @@
1
1
  import styled from '@emotion/styled';
2
- import { get } from '@styled-system/css';
2
+ import { get, css } from '@styled-system/css';
3
+ import { rem } from 'polished';
4
+
3
5
  import { BaseButton } from './BaseButton';
4
- import { Theme } from '../theme';
5
- import { css } from '@styled-system/css';
6
+ import type { Theme } from '../theme';
6
7
  import { alpha } from '../color';
7
8
 
8
9
  export const TransparentButton = styled(BaseButton)(
@@ -14,7 +15,36 @@ export const TransparentButton = styled(BaseButton)(
14
15
  color: alpha('on.surface', 0.38),
15
16
  cursor: 'default',
16
17
  },
17
- })
18
+ '&:focus-visible': {
19
+ outline: 'none',
20
+ },
21
+ }),
22
+ ({ theme, color = 'primary', isGroupedButton = false }) =>
23
+ isGroupedButton && {
24
+ '[data-button-group=""] &': {
25
+ borderColor:
26
+ get(theme, `colors.${String(color)}`) ||
27
+ (typeof color === 'string' ? color : undefined),
28
+ ':first-of-type': {
29
+ borderTopRightRadius: 0,
30
+ borderBottomRightRadius: 0,
31
+ borderRightStyle: 'solid',
32
+ borderRightWidth: rem(1),
33
+ },
34
+ ':not(:first-of-type):not(:last-of-type)': {
35
+ borderRadius: 0,
36
+ },
37
+ ':last-of-type': {
38
+ borderTopLeftRadius: 0,
39
+ borderBottomLeftRadius: 0,
40
+ borderLeftStyle: 'solid',
41
+ borderLeftWidth: rem(1),
42
+ },
43
+ ':last-of-type:nth-of-type(2)': {
44
+ borderLeftWidth: 0,
45
+ },
46
+ },
47
+ }
18
48
  );
19
49
 
20
50
  export function getRippleProperties(theme: Theme) {
@@ -22,5 +52,6 @@ export function getRippleProperties(theme: Theme) {
22
52
  hoverOpacity: get(theme, `buttons.overlays.transparent.hover.opacity`),
23
53
  focusOpacity: get(theme, `buttons.overlays.transparent.focus.opacity`),
24
54
  pressedOpacity: get(theme, `buttons.overlays.transparent.pressed.opacity`),
55
+ rippleEnabled: false,
25
56
  };
26
57
  }
@@ -0,0 +1,17 @@
1
+ import { createContext, useContext } from 'react';
2
+
3
+ import type { ButtonProps } from './Button';
4
+
5
+ // ButtonGroup Component
6
+ export type ButtonGroupContextProps = {
7
+ variant?: ButtonProps['variant'];
8
+ direction?: 'row' | 'column';
9
+ };
10
+
11
+ export const ButtonGroupContext = createContext<ButtonGroupContextProps | null>(
12
+ null
13
+ );
14
+ ButtonGroupContext.displayName = 'ButtonGroupContext';
15
+
16
+ export const useButtonGroupContext = (): ButtonGroupContextProps | null =>
17
+ useContext(ButtonGroupContext);
@@ -1 +1,2 @@
1
1
  export * from './Button';
2
+ export * from './ButtonGroup';
@@ -1,7 +1,8 @@
1
1
  import { useState, useRef } from 'react';
2
- import { CheckBox, Box } from '../';
3
2
  import { keyframes } from '@emotion/react';
4
- import { Keyframes } from '@emotion/serialize';
3
+ import type { Keyframes } from '@emotion/serialize';
4
+
5
+ import { CheckBox, Box } from '../';
5
6
 
6
7
  export default {
7
8
  title: 'components/CheckBox',
@@ -1,10 +1,14 @@
1
- import { forwardRef, cloneElement, InputHTMLAttributes } from 'react';
2
- import type * as React from 'react';
3
- import { RippleBox, RippleBoxProps } from '../Ripple';
4
- import { Box, BoxProps } from '../Box';
5
- import { useTheme } from '../theme';
1
+ import type { InputHTMLAttributes } from 'react';
2
+ import { forwardRef, cloneElement } from 'react';
3
+ import * as React from 'react';
6
4
  import { rem } from 'polished';
7
5
  import { CheckBox as _CheckBoxCore } from '@basic-ui/core';
6
+
7
+ import type { RippleBoxProps } from '../Ripple';
8
+ import { RippleBox } from '../Ripple';
9
+ import type { BoxProps } from '../Box';
10
+ import { Box } from '../Box';
11
+ import { useTheme } from '../theme';
8
12
  import { CheckBoxIcon } from './CheckBoxIcon';
9
13
  import {
10
14
  SelectionControlLabel,
@@ -98,7 +102,7 @@ const CheckBoxInner = forwardRef<HTMLInputElement, CheckBoxProps>(
98
102
  outline: 'none',
99
103
  },
100
104
  border: 'none',
101
- borderRadius: '50%',
105
+ borderRadius: 'full',
102
106
  zIndex: 1,
103
107
  position: 'absolute',
104
108
  ...__css,
@@ -1,7 +1,9 @@
1
1
  import { forwardRef } from 'react';
2
- import type * as React from 'react';
3
- import { Box, BoxProps } from '../Box';
2
+ import * as React from 'react';
4
3
  import { rem } from 'polished';
4
+
5
+ import type { BoxProps } from '../Box';
6
+ import { Box } from '../Box';
5
7
  import { CheckPath } from './CheckPath';
6
8
  import { IndeterminatePath } from './IndeterminatePath';
7
9
 
@@ -1,27 +1,30 @@
1
1
  import { forwardRef } from 'react';
2
- import type * as React from 'react';
3
- import { ChipBaseProps, ChipBase } from './ChipBase';
2
+ import * as React from 'react';
3
+ import { rem } from 'polished';
4
+
5
+ import type { ChipBaseProps } from './ChipBase';
6
+ import { ChipBase } from './ChipBase';
4
7
  import { RippleBox } from '../Ripple';
5
8
  import { useTheme } from '../theme';
6
- import { Box } from '../Box';
7
- import { rem } from 'polished';
8
9
 
9
10
  export type ButtonChipProps = ChipBaseProps & {
10
11
  checked?: boolean;
11
12
  disabled?: boolean;
12
- leftIcon?: React.ReactNode;
13
- rightIcon?: React.ReactNode;
13
+ leadingIcon?: React.ReactNode;
14
+ trailingIcon?: React.ReactNode;
14
15
  };
15
16
 
16
17
  export const ButtonChip = forwardRef<HTMLDivElement, ButtonChipProps>(
17
18
  function ButtonChip(props, forwardedRef) {
18
19
  const {
19
- as = 'button',
20
+ as = 'div',
20
21
  onClick,
21
22
  disabled: disabledProp,
22
- leftIcon,
23
- rightIcon,
23
+ leadingIcon,
24
+ trailingIcon,
24
25
  children,
26
+ color,
27
+ __css,
25
28
  ...otherProps
26
29
  } = props;
27
30
 
@@ -30,60 +33,53 @@ export const ButtonChip = forwardRef<HTMLDivElement, ButtonChipProps>(
30
33
 
31
34
  return (
32
35
  <ChipBase
33
- as="label"
36
+ as="div"
34
37
  onClick={isClickable ? onClick : undefined}
35
38
  disabled={disabledProp}
39
+ color="on.surface"
40
+ backgroundColor="surface"
41
+ __css={__css}
36
42
  {...otherProps}
37
43
  >
38
- <Box
39
- as="span"
44
+ <RippleBox
45
+ as={as}
46
+ role={isClickable ? 'button' : undefined}
47
+ tabIndex={isClickable ? 0 : undefined}
48
+ theme={theme}
49
+ ref={forwardedRef}
50
+ rippleColor={'currentColor'}
51
+ baseOpacity={0}
52
+ hoverOpacity={0.12}
53
+ focusOpacity={0.24}
54
+ center={false}
55
+ disabled={!isClickable}
56
+ aria-disabled={!isClickable}
40
57
  __css={{
58
+ bg: 'transparent',
59
+ color: 'inherit',
60
+ padding: `0`,
61
+ pl: leadingIcon ? rem(8) : rem(12),
62
+ pr: trailingIcon ? rem(8) : rem(12),
63
+ gap: rem(8),
41
64
  width: '100%',
65
+ minWidth: 'auto',
42
66
  height: '100%',
67
+ appearance: 'none',
68
+ ':focus': {
69
+ outline: 'none',
70
+ },
43
71
  border: 'none',
72
+ borderRadius: 0,
73
+ position: 'relative',
44
74
  display: 'inline-flex',
45
75
  alignItems: 'center',
46
- justifyContent: 'center',
76
+ cursor: isClickable ? 'pointer' : 'default',
47
77
  }}
48
78
  >
49
- <RippleBox
50
- as={as}
51
- theme={theme}
52
- ref={forwardedRef}
53
- rippleColor={'currentColor'}
54
- baseOpacity={0}
55
- hoverOpacity={0.12}
56
- focusOpacity={0.24}
57
- center={false}
58
- disabled={!isClickable}
59
- aria-disabled={!isClickable}
60
- __css={{
61
- backgroundColor: 'rgba(0,0,0,0)',
62
- top: 0,
63
- left: 0,
64
- width: '100%',
65
- height: '100%',
66
- appearance: 'none',
67
- ':focus': {
68
- outline: 'none',
69
- },
70
- border: 'none',
71
- borderRadius: 0,
72
- position: 'absolute',
73
- color: 'inherit',
74
- cursor: isClickable ? 'pointer' : 'default',
75
- }}
76
- />
77
- <Box as="span" pl={rem(4)} pr={rem(8)}>
78
- {leftIcon}
79
- </Box>
80
- <Box as="span" __css={{ minWidth: 'auto', whiteSpace: 'nowrap' }}>
81
- {children}
82
- </Box>
83
- <Box as="span" pl={rem(6)} pr={rem(6)}>
84
- {rightIcon}
85
- </Box>
86
- </Box>
79
+ {leadingIcon}
80
+ {children}
81
+ {trailingIcon}
82
+ </RippleBox>
87
83
  </ChipBase>
88
84
  );
89
85
  }
@@ -1,7 +1,6 @@
1
1
  import { Chip } from './';
2
2
  import { Box } from '../Box';
3
3
  import { Text } from '../Text';
4
- import { alpha } from '../color';
5
4
  import { RadioGroup } from '../RadioButton';
6
5
  import { ChoiceChip } from './ChoiceChip';
7
6
  import { LoremIpsum } from '../Text/LoremIpsum';
@@ -12,15 +11,14 @@ export default {
12
11
 
13
12
  const CloseIcon = (props) => (
14
13
  <Box
14
+ role="button"
15
+ tabIndex={0}
15
16
  display="flex"
16
17
  width={20}
17
18
  height={20}
18
- borderRadius="50%"
19
19
  alignItems="center"
20
20
  justifyContent="center"
21
21
  sx={{
22
- bg: alpha('on.surface', 0.24),
23
- color: alpha('surface', 0.6),
24
22
  '& > svg': { display: 'block' },
25
23
  }}
26
24
  >
@@ -39,11 +37,12 @@ const LeftIcon = ({ color }) => (
39
37
  display="flex"
40
38
  width={24}
41
39
  height={24}
42
- borderRadius="50%"
40
+ borderRadius="full"
43
41
  alignItems="center"
44
42
  justifyContent="center"
45
43
  bg={color}
46
44
  color={`on.${color}`}
45
+ ml="-4px"
47
46
  >
48
47
  L
49
48
  </Box>
@@ -59,34 +58,38 @@ const Example = ({ variant, color = 'default' }) => {
59
58
  <Text variant="h6" mb={2}>
60
59
  Variant: {variant}, Color: {color}
61
60
  </Text>
62
- <Box my={2}>
61
+ <Box my={2} display="flex" sx={{ gap: 2 }}>
63
62
  <Text as="span" mr={2}>
64
63
  Non clickable
65
64
  </Text>
66
- <Chip variant={variant}>Buy now</Chip>
67
- <Chip variant={variant}>Close door</Chip>
68
- <Chip variant={variant} disabled>
65
+ <Chip variant={variant} color={color}>
66
+ Buy now
67
+ </Chip>
68
+ <Chip variant={variant} color={color}>
69
+ Close door
70
+ </Chip>
71
+ <Chip variant={variant} disabled color={color}>
69
72
  Nothing
70
73
  </Chip>
71
74
  </Box>
72
- <Box my={2}>
75
+ <Box my={2} display="flex" sx={{ gap: 2 }}>
73
76
  <Text as="span" mr={2}>
74
77
  Button
75
78
  </Text>
76
- <Chip variant={variant} onClick={noop}>
79
+ <Chip variant={variant} onClick={noop} color={color}>
77
80
  John
78
81
  </Chip>
79
- <Chip variant={variant} onClick={noop}>
82
+ <Chip variant={variant} onClick={noop} color={color}>
80
83
  Max
81
84
  </Chip>
82
- <Chip variant={variant} onClick={noop}>
85
+ <Chip variant={variant} onClick={noop} color={color}>
83
86
  Jane
84
87
  </Chip>
85
- <Chip variant={variant} onClick={noop} disabled>
88
+ <Chip variant={variant} onClick={noop} disabled color={color}>
86
89
  Off
87
90
  </Chip>
88
91
  </Box>
89
- <Box my={2}>
92
+ <Box my={2} display="flex" sx={{ gap: 2 }}>
90
93
  <Text as="span" mr={2}>
91
94
  CheckBox
92
95
  </Text>
@@ -103,7 +106,12 @@ const Example = ({ variant, color = 'default' }) => {
103
106
  Disabled
104
107
  </ChoiceChip>
105
108
  </Box>
106
- <RadioGroup name={`test-radio-${variant}-${color}`} my={2}>
109
+ <RadioGroup
110
+ name={`test-radio-${variant}-${color}`}
111
+ my={2}
112
+ display="flex"
113
+ sx={{ gap: 2 }}
114
+ >
107
115
  <Text as="span" mr={2}>
108
116
  RadioGroup
109
117
  </Text>
@@ -126,21 +134,21 @@ const Example = ({ variant, color = 'default' }) => {
126
134
  Disabled
127
135
  </ChoiceChip>
128
136
  </RadioGroup>
129
- <Box my={2} display="flex">
137
+ <Box my={2} display="flex" sx={{ gap: 2 }}>
130
138
  <Text as="span" mr={2}>
131
139
  With icons
132
140
  </Text>
133
141
  <Chip variant={variant}>Hello please</Chip>
134
- <Chip variant={variant} leftIcon={<LeftIcon color={color} />}>
142
+ <Chip variant={variant} leadingIcon={<LeftIcon color={color} />}>
135
143
  Hello please
136
144
  </Chip>
137
- <Chip variant={variant} rightIcon={<CloseIcon />}>
145
+ <Chip variant={variant} trailingIcon={<CloseIcon />}>
138
146
  Hello please
139
147
  </Chip>
140
148
  <Chip
141
149
  variant={variant}
142
- leftIcon={<LeftIcon color={color} />}
143
- rightIcon={<CloseIcon />}
150
+ leadingIcon={<LeftIcon color={color} />}
151
+ trailingIcon={<CloseIcon />}
144
152
  >
145
153
  Hello please
146
154
  </Chip>
@@ -192,26 +200,39 @@ export const HorizontallyScrollableExample = () => {
192
200
  borderColor: '#aeaeae',
193
201
  borderWidth: '1px',
194
202
  borderStyle: 'solid',
203
+ scrollbarWidth: 'none',
204
+ MsOverflowStyle: 'none',
205
+ '::-webkit-scrollbar': {
206
+ display: 'none',
207
+ },
195
208
  }}
196
209
  >
197
- <Box
210
+ <RadioGroup
198
211
  sx={{
199
212
  px: 3,
200
213
  display: 'flex',
201
214
  minWidth: 'auto',
202
- width: 'auto',
203
- scrollbarWidth: 'none',
204
- '& > :not(first-of-type)': {
215
+ overflow: 'visible',
216
+ '& > :not(:first-of-type)': {
205
217
  marginLeft: 2,
206
218
  },
207
219
  }}
208
220
  >
209
221
  {texts.map((text) => (
210
222
  <Box key={text} sx={{ minWidth: 'auto' }}>
211
- <Chip key={text}>{text}</Chip>
223
+ <ChoiceChip
224
+ type="radio"
225
+ value={text}
226
+ key={text}
227
+ onClick={() => {
228
+ /* noop */
229
+ }}
230
+ >
231
+ {text}
232
+ </ChoiceChip>
212
233
  </Box>
213
234
  ))}
214
- </Box>
235
+ </RadioGroup>
215
236
  </Box>
216
237
  <Box>
217
238
  <LoremIpsum count={20} />