@seed-design/react 1.2.15 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (387) hide show
  1. package/lib/components/Accordion/Accordion.cjs +42 -0
  2. package/lib/components/Accordion/Accordion.d.ts +35 -0
  3. package/lib/components/Accordion/Accordion.d.ts.map +1 -0
  4. package/lib/components/Accordion/Accordion.js +32 -0
  5. package/lib/components/Accordion/Accordion.namespace.cjs +22 -0
  6. package/lib/components/Accordion/Accordion.namespace.d.ts +2 -0
  7. package/lib/components/Accordion/Accordion.namespace.d.ts.map +1 -0
  8. package/lib/components/Accordion/Accordion.namespace.js +17 -0
  9. package/lib/components/Accordion/index.cjs +19 -0
  10. package/lib/components/Accordion/index.d.ts +3 -0
  11. package/lib/components/Accordion/index.d.ts.map +1 -0
  12. package/lib/components/Accordion/index.js +3 -0
  13. package/lib/components/ActionButton/ActionButton.cjs +1 -1
  14. package/lib/components/ActionButton/ActionButton.d.ts +1 -1
  15. package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
  16. package/lib/components/ActionButton/ActionButton.js +1 -1
  17. package/lib/components/ActionSheet/ActionSheet.cjs +12 -12
  18. package/lib/components/ActionSheet/ActionSheet.d.ts +22 -22
  19. package/lib/components/ActionSheet/ActionSheet.js +12 -12
  20. package/lib/components/Article/Article.d.ts +2 -3
  21. package/lib/components/Article/Article.d.ts.map +1 -1
  22. package/lib/components/AspectRatio/AspectRatio.d.ts +2 -2
  23. package/lib/components/AspectRatio/AspectRatio.d.ts.map +1 -1
  24. package/lib/components/AttachmentDisplay/AttachmentDisplay.cjs +63 -0
  25. package/lib/components/AttachmentDisplay/AttachmentDisplay.d.ts +43 -0
  26. package/lib/components/AttachmentDisplay/AttachmentDisplay.d.ts.map +1 -0
  27. package/lib/components/AttachmentDisplay/AttachmentDisplay.js +49 -0
  28. package/lib/components/AttachmentDisplay/AttachmentDisplay.namespace.cjs +37 -0
  29. package/lib/components/AttachmentDisplay/AttachmentDisplay.namespace.d.ts +5 -0
  30. package/lib/components/AttachmentDisplay/AttachmentDisplay.namespace.d.ts.map +1 -0
  31. package/lib/components/AttachmentDisplay/AttachmentDisplay.namespace.js +32 -0
  32. package/lib/components/AttachmentDisplay/AttachmentDisplayItem.cjs +110 -0
  33. package/lib/components/AttachmentDisplay/AttachmentDisplayItem.d.ts +30 -0
  34. package/lib/components/AttachmentDisplay/AttachmentDisplayItem.d.ts.map +1 -0
  35. package/lib/components/AttachmentDisplay/AttachmentDisplayItem.js +100 -0
  36. package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.cjs +50 -0
  37. package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.d.ts +18 -0
  38. package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.d.ts.map +1 -0
  39. package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.js +45 -0
  40. package/lib/components/AttachmentDisplay/index.cjs +34 -0
  41. package/lib/components/AttachmentDisplay/index.d.ts +6 -0
  42. package/lib/components/AttachmentDisplay/index.d.ts.map +1 -0
  43. package/lib/components/AttachmentDisplay/index.js +5 -0
  44. package/lib/components/AttachmentInput/AttachmentInput.cjs +37 -0
  45. package/lib/components/AttachmentInput/AttachmentInput.d.ts +23 -0
  46. package/lib/components/AttachmentInput/AttachmentInput.d.ts.map +1 -0
  47. package/lib/components/AttachmentInput/AttachmentInput.js +30 -0
  48. package/lib/components/AttachmentInput/AttachmentInput.namespace.cjs +35 -0
  49. package/lib/components/AttachmentInput/AttachmentInput.namespace.d.ts +6 -0
  50. package/lib/components/AttachmentInput/AttachmentInput.namespace.d.ts.map +1 -0
  51. package/lib/components/AttachmentInput/AttachmentInput.namespace.js +30 -0
  52. package/lib/components/AttachmentInput/AttachmentInput.test.d.ts +2 -0
  53. package/lib/components/AttachmentInput/AttachmentInput.test.d.ts.map +1 -0
  54. package/lib/components/AttachmentInput/AttachmentInputDropzone.cjs +12 -0
  55. package/lib/components/AttachmentInput/AttachmentInputDropzone.d.ts +9 -0
  56. package/lib/components/AttachmentInput/AttachmentInputDropzone.d.ts.map +1 -0
  57. package/lib/components/AttachmentInput/AttachmentInputDropzone.js +10 -0
  58. package/lib/components/AttachmentInput/AttachmentInputItem.cjs +138 -0
  59. package/lib/components/AttachmentInput/AttachmentInputItem.d.ts +36 -0
  60. package/lib/components/AttachmentInput/AttachmentInputItem.d.ts.map +1 -0
  61. package/lib/components/AttachmentInput/AttachmentInputItem.js +126 -0
  62. package/lib/components/AttachmentInput/AttachmentInputTrigger.cjs +54 -0
  63. package/lib/components/AttachmentInput/AttachmentInputTrigger.d.ts +21 -0
  64. package/lib/components/AttachmentInput/AttachmentInputTrigger.d.ts.map +1 -0
  65. package/lib/components/AttachmentInput/AttachmentInputTrigger.js +49 -0
  66. package/lib/components/AttachmentInput/index.cjs +32 -0
  67. package/lib/components/AttachmentInput/index.d.ts +7 -0
  68. package/lib/components/AttachmentInput/index.d.ts.map +1 -0
  69. package/lib/components/AttachmentInput/index.js +6 -0
  70. package/lib/components/BottomSheet/BottomSheet.cjs +36 -9
  71. package/lib/components/BottomSheet/BottomSheet.d.ts +2 -7
  72. package/lib/components/BottomSheet/BottomSheet.d.ts.map +1 -1
  73. package/lib/components/BottomSheet/BottomSheet.js +35 -9
  74. package/lib/components/Box/Box.cjs +10 -3
  75. package/lib/components/Box/Box.d.ts +4 -2
  76. package/lib/components/Box/Box.d.ts.map +1 -1
  77. package/lib/components/Box/Box.js +10 -3
  78. package/lib/components/Checkbox/Checkbox.cjs +2 -6
  79. package/lib/components/Checkbox/Checkbox.d.ts +1 -7
  80. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  81. package/lib/components/Checkbox/Checkbox.js +2 -6
  82. package/lib/components/Chip/Chip.cjs +1 -1
  83. package/lib/components/Chip/Chip.js +1 -1
  84. package/lib/components/ChipTabs/ChipTabs.cjs +0 -1
  85. package/lib/components/ChipTabs/ChipTabs.d.ts.map +1 -1
  86. package/lib/components/ChipTabs/ChipTabs.js +0 -1
  87. package/lib/components/Columns/Columns.d.ts +4 -4
  88. package/lib/components/Columns/Columns.d.ts.map +1 -1
  89. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.cjs +13 -13
  90. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.d.ts +24 -24
  91. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.js +13 -13
  92. package/lib/components/FieldButton/FieldButton.cjs +22 -3
  93. package/lib/components/FieldButton/FieldButton.d.ts +3 -2
  94. package/lib/components/FieldButton/FieldButton.d.ts.map +1 -1
  95. package/lib/components/FieldButton/FieldButton.js +23 -3
  96. package/lib/components/Flex/Flex.d.ts +5 -3
  97. package/lib/components/Flex/Flex.d.ts.map +1 -1
  98. package/lib/components/Footer/Footer.namespace.cjs +11 -0
  99. package/lib/components/Footer/Footer.namespace.d.ts +2 -0
  100. package/lib/components/Footer/Footer.namespace.d.ts.map +1 -0
  101. package/lib/components/Footer/Footer.namespace.js +6 -0
  102. package/lib/components/Footer/FooterLinkText.cjs +23 -0
  103. package/lib/components/Footer/FooterLinkText.d.ts +7 -0
  104. package/lib/components/Footer/FooterLinkText.d.ts.map +1 -0
  105. package/lib/components/Footer/FooterLinkText.js +20 -0
  106. package/lib/components/Footer/index.cjs +10 -0
  107. package/lib/components/Footer/index.d.ts +3 -0
  108. package/lib/components/Footer/index.d.ts.map +1 -0
  109. package/lib/components/Footer/index.js +3 -0
  110. package/lib/components/Grid/Grid.cjs +7 -2
  111. package/lib/components/Grid/Grid.d.ts +7 -5
  112. package/lib/components/Grid/Grid.d.ts.map +1 -1
  113. package/lib/components/Grid/Grid.js +7 -2
  114. package/lib/components/GridItem/GridItem.d.ts +3 -2
  115. package/lib/components/GridItem/GridItem.d.ts.map +1 -1
  116. package/lib/components/HelpBubble/HelpBubble.cjs +4 -7
  117. package/lib/components/HelpBubble/HelpBubble.d.ts.map +1 -1
  118. package/lib/components/HelpBubble/HelpBubble.js +4 -7
  119. package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.cjs +64 -0
  120. package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.d.ts +60 -0
  121. package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.d.ts.map +1 -0
  122. package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.js +52 -0
  123. package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.namespace.cjs +23 -0
  124. package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.namespace.d.ts +2 -0
  125. package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.namespace.d.ts.map +1 -0
  126. package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.namespace.js +18 -0
  127. package/lib/components/HelpBubbleTooltip/index.cjs +20 -0
  128. package/lib/components/HelpBubbleTooltip/index.d.ts +3 -0
  129. package/lib/components/HelpBubbleTooltip/index.d.ts.map +1 -0
  130. package/lib/components/HelpBubbleTooltip/index.js +3 -0
  131. package/lib/components/Icon/Icon.d.ts +2 -1
  132. package/lib/components/Icon/Icon.d.ts.map +1 -1
  133. package/lib/components/ImageFrame/ImageFrame.cjs +3 -2
  134. package/lib/components/ImageFrame/ImageFrame.d.ts +3 -8
  135. package/lib/components/ImageFrame/ImageFrame.d.ts.map +1 -1
  136. package/lib/components/ImageFrame/ImageFrame.js +3 -2
  137. package/lib/components/Inline/Inline.d.ts +2 -2
  138. package/lib/components/Inline/Inline.d.ts.map +1 -1
  139. package/lib/components/Layout/Layout.cjs +12 -0
  140. package/lib/components/Layout/Layout.d.ts +10 -0
  141. package/lib/components/Layout/Layout.d.ts.map +1 -0
  142. package/lib/components/Layout/Layout.js +10 -0
  143. package/lib/components/Layout/Layout.namespace.cjs +14 -0
  144. package/lib/components/Layout/Layout.namespace.d.ts +2 -0
  145. package/lib/components/Layout/Layout.namespace.d.ts.map +1 -0
  146. package/lib/components/Layout/Layout.namespace.js +9 -0
  147. package/lib/components/Layout/index.cjs +11 -0
  148. package/lib/components/Layout/index.d.ts +3 -0
  149. package/lib/components/Layout/index.d.ts.map +1 -0
  150. package/lib/components/Layout/index.js +3 -0
  151. package/lib/components/List/List.cjs +1 -1
  152. package/lib/components/List/List.d.ts +1 -1
  153. package/lib/components/List/List.d.ts.map +1 -1
  154. package/lib/components/List/List.js +1 -1
  155. package/lib/components/Menu/Menu.cjs +76 -0
  156. package/lib/components/Menu/Menu.d.ts +42 -0
  157. package/lib/components/Menu/Menu.d.ts.map +1 -0
  158. package/lib/components/Menu/Menu.js +62 -0
  159. package/lib/components/Menu/Menu.namespace.cjs +24 -0
  160. package/lib/components/Menu/Menu.namespace.d.ts +2 -0
  161. package/lib/components/Menu/Menu.namespace.d.ts.map +1 -0
  162. package/lib/components/Menu/Menu.namespace.js +19 -0
  163. package/lib/components/Menu/index.cjs +21 -0
  164. package/lib/components/Menu/index.d.ts +3 -0
  165. package/lib/components/Menu/index.d.ts.map +1 -0
  166. package/lib/components/Menu/index.js +3 -0
  167. package/lib/components/MenuSheet/MenuSheet.cjs +48 -0
  168. package/lib/components/MenuSheet/MenuSheet.d.ts +96 -0
  169. package/lib/components/MenuSheet/MenuSheet.d.ts.map +1 -1
  170. package/lib/components/MenuSheet/MenuSheet.js +48 -0
  171. package/lib/components/NavigationMenu/NavigationMenu.cjs +76 -0
  172. package/lib/components/NavigationMenu/NavigationMenu.d.ts +42 -0
  173. package/lib/components/NavigationMenu/NavigationMenu.d.ts.map +1 -0
  174. package/lib/components/NavigationMenu/NavigationMenu.js +62 -0
  175. package/lib/components/NavigationMenu/NavigationMenu.namespace.cjs +24 -0
  176. package/lib/components/NavigationMenu/NavigationMenu.namespace.d.ts +2 -0
  177. package/lib/components/NavigationMenu/NavigationMenu.namespace.d.ts.map +1 -0
  178. package/lib/components/NavigationMenu/NavigationMenu.namespace.js +19 -0
  179. package/lib/components/NavigationMenu/index.cjs +21 -0
  180. package/lib/components/NavigationMenu/index.d.ts +3 -0
  181. package/lib/components/NavigationMenu/index.d.ts.map +1 -0
  182. package/lib/components/NavigationMenu/index.js +3 -0
  183. package/lib/components/RadioGroup/RadioGroup.cjs +1 -1
  184. package/lib/components/RadioGroup/RadioGroup.js +1 -1
  185. package/lib/components/ResponsivePair/ResponsivePair.cjs +8 -5
  186. package/lib/components/ResponsivePair/ResponsivePair.d.ts +3 -2
  187. package/lib/components/ResponsivePair/ResponsivePair.d.ts.map +1 -1
  188. package/lib/components/ResponsivePair/ResponsivePair.js +8 -5
  189. package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.cjs +184 -0
  190. package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.d.ts +65 -0
  191. package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.d.ts.map +1 -0
  192. package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.js +170 -0
  193. package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.namespace.cjs +24 -0
  194. package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.namespace.d.ts +2 -0
  195. package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.namespace.d.ts.map +1 -0
  196. package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.namespace.js +19 -0
  197. package/lib/components/ResponsiveSidePanel/index.cjs +22 -0
  198. package/lib/components/ResponsiveSidePanel/index.d.ts +3 -0
  199. package/lib/components/ResponsiveSidePanel/index.d.ts.map +1 -0
  200. package/lib/components/ResponsiveSidePanel/index.js +3 -0
  201. package/lib/components/SelectBox/CheckSelectBox.cjs +2 -2
  202. package/lib/components/SelectBox/CheckSelectBox.d.ts +1 -1
  203. package/lib/components/SelectBox/CheckSelectBox.d.ts.map +1 -1
  204. package/lib/components/SelectBox/CheckSelectBox.js +1 -1
  205. package/lib/components/SideNavigation/SideNavigation.cjs +175 -0
  206. package/lib/components/SideNavigation/SideNavigation.d.ts +59 -0
  207. package/lib/components/SideNavigation/SideNavigation.d.ts.map +1 -0
  208. package/lib/components/SideNavigation/SideNavigation.js +157 -0
  209. package/lib/components/SideNavigation/SideNavigation.namespace.cjs +28 -0
  210. package/lib/components/SideNavigation/SideNavigation.namespace.d.ts +3 -0
  211. package/lib/components/SideNavigation/SideNavigation.namespace.d.ts.map +1 -0
  212. package/lib/components/SideNavigation/SideNavigation.namespace.js +23 -0
  213. package/lib/components/SideNavigation/index.cjs +25 -0
  214. package/lib/components/SideNavigation/index.d.ts +4 -0
  215. package/lib/components/SideNavigation/index.d.ts.map +1 -0
  216. package/lib/components/SideNavigation/index.js +3 -0
  217. package/lib/components/SidePanel/SidePanel.cjs +100 -0
  218. package/lib/components/SidePanel/SidePanel.d.ts +41 -0
  219. package/lib/components/SidePanel/SidePanel.d.ts.map +1 -0
  220. package/lib/components/SidePanel/SidePanel.js +87 -0
  221. package/lib/components/SidePanel/SidePanel.namespace.cjs +23 -0
  222. package/lib/components/SidePanel/SidePanel.namespace.d.ts +2 -0
  223. package/lib/components/SidePanel/SidePanel.namespace.d.ts.map +1 -0
  224. package/lib/components/SidePanel/SidePanel.namespace.js +18 -0
  225. package/lib/components/SidePanel/index.cjs +20 -0
  226. package/lib/components/SidePanel/index.d.ts +3 -0
  227. package/lib/components/SidePanel/index.d.ts.map +1 -0
  228. package/lib/components/SidePanel/index.js +3 -0
  229. package/lib/components/Slider/Slider.cjs +2 -2
  230. package/lib/components/Slider/Slider.js +2 -2
  231. package/lib/components/Snackbar/Snackbar.cjs +2 -2
  232. package/lib/components/Snackbar/Snackbar.d.ts +1 -1
  233. package/lib/components/Snackbar/Snackbar.d.ts.map +1 -1
  234. package/lib/components/Snackbar/Snackbar.js +2 -2
  235. package/lib/components/Stack/Stack.d.ts +4 -6
  236. package/lib/components/Stack/Stack.d.ts.map +1 -1
  237. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.cjs +123 -0
  238. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.d.ts +60 -0
  239. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.d.ts.map +1 -0
  240. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.js +104 -0
  241. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.cjs +29 -0
  242. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.d.ts +2 -0
  243. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.d.ts.map +1 -0
  244. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.js +24 -0
  245. package/lib/components/SwipeableMenuSheet/index.cjs +26 -0
  246. package/lib/components/SwipeableMenuSheet/index.d.ts +3 -0
  247. package/lib/components/SwipeableMenuSheet/index.d.ts.map +1 -0
  248. package/lib/components/SwipeableMenuSheet/index.js +3 -0
  249. package/lib/components/Switch/Switch.cjs +1 -5
  250. package/lib/components/Switch/Switch.d.ts +1 -7
  251. package/lib/components/Switch/Switch.d.ts.map +1 -1
  252. package/lib/components/Switch/Switch.js +1 -5
  253. package/lib/components/TagGroup/TagGroup.cjs +1 -1
  254. package/lib/components/TagGroup/TagGroup.js +1 -1
  255. package/lib/components/TextField/TextField.cjs +1 -1
  256. package/lib/components/TextField/TextField.js +1 -1
  257. package/lib/components/index.cjs +249 -0
  258. package/lib/components/index.d.ts +12 -0
  259. package/lib/components/index.d.ts.map +1 -1
  260. package/lib/components/index.js +30 -1
  261. package/lib/components/private/useDismissible.d.ts +6 -6
  262. package/lib/hooks/useBreakpoint.cjs +15 -0
  263. package/lib/hooks/useBreakpoint.d.ts +12 -0
  264. package/lib/hooks/useBreakpoint.d.ts.map +1 -0
  265. package/lib/hooks/useBreakpoint.js +13 -0
  266. package/lib/hooks/useBreakpoint.test.d.ts +2 -0
  267. package/lib/hooks/useBreakpoint.test.d.ts.map +1 -0
  268. package/lib/hooks/useBreakpointValue.cjs +23 -0
  269. package/lib/hooks/useBreakpointValue.d.ts +8 -0
  270. package/lib/hooks/useBreakpointValue.d.ts.map +1 -0
  271. package/lib/hooks/useBreakpointValue.js +22 -0
  272. package/lib/hooks/useBreakpointValue.test.d.ts +2 -0
  273. package/lib/hooks/useBreakpointValue.test.d.ts.map +1 -0
  274. package/lib/index.cjs +255 -0
  275. package/lib/index.d.ts +6 -0
  276. package/lib/index.d.ts.map +1 -1
  277. package/lib/index.js +33 -1
  278. package/lib/primitive.cjs +45 -0
  279. package/lib/primitive.d.ts +5 -0
  280. package/lib/primitive.d.ts.map +1 -1
  281. package/lib/primitive.js +5 -0
  282. package/lib/primitives/breakpoint-store.cjs +52 -0
  283. package/lib/primitives/breakpoint-store.d.ts +7 -0
  284. package/lib/primitives/breakpoint-store.d.ts.map +1 -0
  285. package/lib/primitives/breakpoint-store.js +50 -0
  286. package/lib/providers/BreakpointProvider.cjs +20 -0
  287. package/lib/providers/BreakpointProvider.d.ts +8 -0
  288. package/lib/providers/BreakpointProvider.d.ts.map +1 -0
  289. package/lib/providers/BreakpointProvider.js +19 -0
  290. package/lib/types/responsive.cjs +7 -0
  291. package/lib/types/responsive.d.ts +12 -0
  292. package/lib/types/responsive.d.ts.map +1 -0
  293. package/lib/types/responsive.js +7 -0
  294. package/lib/utils/createRenderTrackingContext.cjs +45 -0
  295. package/lib/utils/createRenderTrackingContext.d.ts +28 -0
  296. package/lib/utils/createRenderTrackingContext.d.ts.map +1 -0
  297. package/lib/utils/createRenderTrackingContext.js +44 -0
  298. package/lib/utils/getHelpBubbleArrowTipPath.cjs +14 -0
  299. package/lib/utils/getHelpBubbleArrowTipPath.d.ts +7 -0
  300. package/lib/utils/getHelpBubbleArrowTipPath.d.ts.map +1 -0
  301. package/lib/utils/getHelpBubbleArrowTipPath.js +14 -0
  302. package/lib/utils/styled.cjs +49 -75
  303. package/lib/utils/styled.d.ts +180 -62
  304. package/lib/utils/styled.d.ts.map +1 -1
  305. package/lib/utils/styled.js +49 -76
  306. package/package.json +33 -26
  307. package/src/components/Accordion/Accordion.namespace.ts +22 -0
  308. package/src/components/Accordion/Accordion.tsx +119 -0
  309. package/src/components/Accordion/index.ts +24 -0
  310. package/src/components/ActionButton/ActionButton.tsx +1 -1
  311. package/src/components/ActionSheet/ActionSheet.tsx +22 -22
  312. package/src/components/Article/Article.tsx +1 -1
  313. package/src/components/AspectRatio/AspectRatio.tsx +2 -2
  314. package/src/components/AttachmentDisplay/AttachmentDisplay.namespace.ts +57 -0
  315. package/src/components/AttachmentDisplay/AttachmentDisplay.tsx +165 -0
  316. package/src/components/AttachmentDisplay/AttachmentDisplayItem.tsx +204 -0
  317. package/src/components/AttachmentDisplay/AttachmentDisplayTrigger.tsx +82 -0
  318. package/src/components/AttachmentDisplay/index.ts +59 -0
  319. package/src/components/AttachmentInput/AttachmentInput.namespace.ts +54 -0
  320. package/src/components/AttachmentInput/AttachmentInput.test.tsx +161 -0
  321. package/src/components/AttachmentInput/AttachmentInput.tsx +77 -0
  322. package/src/components/AttachmentInput/AttachmentInputDropzone.tsx +25 -0
  323. package/src/components/AttachmentInput/AttachmentInputItem.tsx +246 -0
  324. package/src/components/AttachmentInput/AttachmentInputTrigger.tsx +85 -0
  325. package/src/components/AttachmentInput/index.ts +56 -0
  326. package/src/components/BottomSheet/BottomSheet.tsx +51 -22
  327. package/src/components/Box/Box.tsx +30 -7
  328. package/src/components/Checkbox/Checkbox.tsx +3 -31
  329. package/src/components/ChipTabs/ChipTabs.tsx +0 -6
  330. package/src/components/Columns/Columns.tsx +4 -3
  331. package/src/components/ExtendedActionSheet/ExtendedActionSheet.tsx +24 -24
  332. package/src/components/FieldButton/FieldButton.tsx +36 -8
  333. package/src/components/Flex/Flex.tsx +5 -3
  334. package/src/components/Footer/Footer.namespace.ts +4 -0
  335. package/src/components/Footer/FooterLinkText.tsx +23 -0
  336. package/src/components/Footer/index.ts +3 -0
  337. package/src/components/Grid/Grid.tsx +15 -8
  338. package/src/components/GridItem/GridItem.tsx +3 -2
  339. package/src/components/HelpBubble/HelpBubble.tsx +2 -5
  340. package/src/components/HelpBubbleTooltip/HelpBubbleTooltip.namespace.ts +24 -0
  341. package/src/components/HelpBubbleTooltip/HelpBubbleTooltip.tsx +169 -0
  342. package/src/components/HelpBubbleTooltip/index.ts +26 -0
  343. package/src/components/Icon/Icon.tsx +2 -1
  344. package/src/components/ImageFrame/ImageFrame.test.tsx +1 -3
  345. package/src/components/ImageFrame/ImageFrame.tsx +25 -23
  346. package/src/components/Inline/Inline.tsx +2 -1
  347. package/src/components/Layout/Layout.namespace.ts +6 -0
  348. package/src/components/Layout/Layout.tsx +21 -0
  349. package/src/components/Layout/index.ts +8 -0
  350. package/src/components/List/List.tsx +5 -1
  351. package/src/components/Menu/Menu.namespace.ts +26 -0
  352. package/src/components/Menu/Menu.tsx +157 -0
  353. package/src/components/Menu/index.ts +28 -0
  354. package/src/components/MenuSheet/MenuSheet.tsx +96 -0
  355. package/src/components/NavigationMenu/NavigationMenu.namespace.ts +26 -0
  356. package/src/components/NavigationMenu/NavigationMenu.tsx +172 -0
  357. package/src/components/NavigationMenu/index.ts +28 -0
  358. package/src/components/ResponsivePair/ResponsivePair.tsx +13 -7
  359. package/src/components/ResponsiveSidePanel/ResponsiveSidePanel.namespace.ts +26 -0
  360. package/src/components/ResponsiveSidePanel/ResponsiveSidePanel.tsx +316 -0
  361. package/src/components/ResponsiveSidePanel/index.ts +29 -0
  362. package/src/components/SelectBox/CheckSelectBox.tsx +1 -1
  363. package/src/components/SideNavigation/SideNavigation.namespace.ts +37 -0
  364. package/src/components/SideNavigation/SideNavigation.tsx +342 -0
  365. package/src/components/SideNavigation/index.ts +39 -0
  366. package/src/components/SidePanel/SidePanel.namespace.ts +24 -0
  367. package/src/components/SidePanel/SidePanel.tsx +216 -0
  368. package/src/components/SidePanel/index.ts +26 -0
  369. package/src/components/Snackbar/Snackbar.tsx +2 -4
  370. package/src/components/Stack/Stack.tsx +4 -3
  371. package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.ts +36 -0
  372. package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.tsx +269 -0
  373. package/src/components/SwipeableMenuSheet/index.ts +38 -0
  374. package/src/components/Switch/Switch.tsx +3 -26
  375. package/src/components/index.ts +12 -0
  376. package/src/hooks/useBreakpoint.test.tsx +94 -0
  377. package/src/hooks/useBreakpoint.ts +24 -0
  378. package/src/hooks/useBreakpointValue.test.tsx +102 -0
  379. package/src/hooks/useBreakpointValue.ts +33 -0
  380. package/src/index.ts +8 -0
  381. package/src/primitive.ts +5 -0
  382. package/src/primitives/breakpoint-store.ts +69 -0
  383. package/src/providers/BreakpointProvider.tsx +26 -0
  384. package/src/types/responsive.ts +19 -0
  385. package/src/utils/createRenderTrackingContext.tsx +50 -0
  386. package/src/utils/getHelpBubbleArrowTipPath.ts +11 -0
  387. package/src/utils/styled.tsx +387 -268
@@ -1,10 +1,11 @@
1
1
  import * as React from "react";
2
+ import type { DistributiveOmit } from "../../utils/styled";
2
3
  import { Flex, type FlexProps } from "../Flex";
3
4
 
4
5
  /**
5
6
  * @deprecated Use `VStack` instead.
6
7
  */
7
- export interface StackProps extends Omit<FlexProps, "flexDirection"> {}
8
+ export type StackProps = DistributiveOmit<FlexProps, "flexDirection">;
8
9
 
9
10
  /**
10
11
  * @deprecated Use `VStack` instead.
@@ -13,13 +14,13 @@ export const Stack = React.forwardRef<HTMLDivElement, StackProps>((props, ref) =
13
14
  return <Flex ref={ref} display="flex" flexDirection="column" {...props} />;
14
15
  });
15
16
 
16
- export interface VStackProps extends Omit<FlexProps, "flexDirection"> {}
17
+ export type VStackProps = DistributiveOmit<FlexProps, "flexDirection">;
17
18
 
18
19
  export const VStack = React.forwardRef<HTMLDivElement, VStackProps>((props, ref) => {
19
20
  return <Flex ref={ref} display="flex" flexDirection="column" {...props} />;
20
21
  });
21
22
 
22
- export interface HStackProps extends Omit<FlexProps, "flexDirection"> {}
23
+ export type HStackProps = DistributiveOmit<FlexProps, "flexDirection">;
23
24
 
24
25
  export const HStack = React.forwardRef<HTMLDivElement, HStackProps>((props, ref) => {
25
26
  return <Flex ref={ref} display="flex" flexDirection="row" {...props} />;
@@ -0,0 +1,36 @@
1
+ export {
2
+ SwipeableMenuSheetBackdrop as Backdrop,
3
+ SwipeableMenuSheetPositioner as Positioner,
4
+ SwipeableMenuSheetContent as Content,
5
+ SwipeableMenuSheetHandle as Handle,
6
+ SwipeableMenuSheetCloseButton as CloseButton,
7
+ SwipeableMenuSheetHeader as Header,
8
+ SwipeableMenuSheetRoot as Root,
9
+ SwipeableMenuSheetTitle as Title,
10
+ SwipeableMenuSheetDescription as Description,
11
+ SwipeableMenuSheetTrigger as Trigger,
12
+ SwipeableMenuSheetList as List,
13
+ SwipeableMenuSheetGroup as Group,
14
+ SwipeableMenuSheetFooter as Footer,
15
+ SwipeableMenuSheetItem as Item,
16
+ SwipeableMenuSheetItemContent as ItemContent,
17
+ SwipeableMenuSheetItemLabel as ItemLabel,
18
+ SwipeableMenuSheetItemDescription as ItemDescription,
19
+ type SwipeableMenuSheetBackdropProps as BackdropProps,
20
+ type SwipeableMenuSheetPositionerProps as PositionerProps,
21
+ type SwipeableMenuSheetContentProps as ContentProps,
22
+ type SwipeableMenuSheetHandleProps as HandleProps,
23
+ type SwipeableMenuSheetCloseButtonProps as CloseButtonProps,
24
+ type SwipeableMenuSheetHeaderProps as HeaderProps,
25
+ type SwipeableMenuSheetRootProps as RootProps,
26
+ type SwipeableMenuSheetTitleProps as TitleProps,
27
+ type SwipeableMenuSheetDescriptionProps as DescriptionProps,
28
+ type SwipeableMenuSheetTriggerProps as TriggerProps,
29
+ type SwipeableMenuSheetListProps as ListProps,
30
+ type SwipeableMenuSheetGroupProps as GroupProps,
31
+ type SwipeableMenuSheetFooterProps as FooterProps,
32
+ type SwipeableMenuSheetItemProps as ItemProps,
33
+ type SwipeableMenuSheetItemContentProps as ItemContentProps,
34
+ type SwipeableMenuSheetItemLabelProps as ItemLabelProps,
35
+ type SwipeableMenuSheetItemDescriptionProps as ItemDescriptionProps,
36
+ } from "./SwipeableMenuSheet";
@@ -0,0 +1,269 @@
1
+ import { bottomSheetHandle } from "@seed-design/css/recipes/bottom-sheet-handle";
2
+ import { menuSheet, type MenuSheetVariantProps } from "@seed-design/css/recipes/menu-sheet";
3
+ import {
4
+ menuSheetItem,
5
+ type MenuSheetItemVariantProps,
6
+ } from "@seed-design/css/recipes/menu-sheet-item";
7
+ import { Drawer } from "@seed-design/react-drawer";
8
+ import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
9
+ import clsx from "clsx";
10
+ import * as React from "react";
11
+ import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
12
+
13
+ const { withContext, useClassNames, ClassNamesProvider } = createSlotRecipeContext(menuSheet);
14
+ const {
15
+ PropsProvider: ItemPropsProvider,
16
+ useProps: useItemProps,
17
+ withContext: withItemContext,
18
+ ClassNamesProvider: ItemClassNamesProvider,
19
+ } = createSlotRecipeContext(menuSheetItem);
20
+
21
+ ////////////////////////////////////////////////////////////////////////////////////
22
+
23
+ // Allowlist only the Drawer props that fit a bottom menu sheet, so the public surface
24
+ // stays stable if Drawer changes or its implementation is swapped later. Intentionally
25
+ // left out: `direction` (forced "bottom" below so the bottom-only recipe transform holds),
26
+ // `dismissible` (no default close button → would trap users), and `modal` (omitted so it
27
+ // stays at Drawer's default `true`, keeping the focus trap and aria-modal contract on the
28
+ // action list).
29
+ export interface SwipeableMenuSheetRootProps
30
+ extends MenuSheetVariantProps,
31
+ Pick<
32
+ Drawer.RootProps,
33
+ | "children"
34
+ | "open"
35
+ | "defaultOpen"
36
+ | "onOpenChange"
37
+ | "closeOnEscape"
38
+ | "closeOnInteractOutside"
39
+ | "lazyMount"
40
+ | "unmountOnExit"
41
+ | "onAnimationEnd"
42
+ > {}
43
+
44
+ // Forces `direction="bottom"` so the bottom-only recipe transform isn't broken.
45
+ export function SwipeableMenuSheetRoot(props: SwipeableMenuSheetRootProps) {
46
+ const [variantProps, otherProps] = menuSheet.splitVariantProps({
47
+ lazyMount: true,
48
+ unmountOnExit: true,
49
+ ...props,
50
+ });
51
+ const classNames = menuSheet(variantProps);
52
+
53
+ return (
54
+ <ClassNamesProvider value={classNames}>
55
+ <Drawer.Root {...otherProps} direction="bottom" />
56
+ </ClassNamesProvider>
57
+ );
58
+ }
59
+
60
+ ////////////////////////////////////////////////////////////////////////////////////
61
+
62
+ export interface SwipeableMenuSheetTriggerProps extends Drawer.TriggerProps {}
63
+
64
+ export const SwipeableMenuSheetTrigger = Drawer.Trigger;
65
+
66
+ ////////////////////////////////////////////////////////////////////////////////////
67
+
68
+ export interface SwipeableMenuSheetPositionerProps extends Drawer.PositionerProps {}
69
+
70
+ export const SwipeableMenuSheetPositioner = withContext<
71
+ HTMLDivElement,
72
+ SwipeableMenuSheetPositionerProps
73
+ >(Drawer.Positioner, "positioner");
74
+
75
+ ////////////////////////////////////////////////////////////////////////////////////
76
+
77
+ export interface SwipeableMenuSheetBackdropProps extends Drawer.BackdropProps {}
78
+
79
+ export const SwipeableMenuSheetBackdrop = withContext<
80
+ HTMLDivElement,
81
+ SwipeableMenuSheetBackdropProps
82
+ >(Drawer.Backdrop, "backdrop");
83
+
84
+ ////////////////////////////////////////////////////////////////////////////////////
85
+
86
+ export interface SwipeableMenuSheetContentProps
87
+ extends Drawer.ContentProps,
88
+ Pick<MenuSheetItemVariantProps, "labelAlign"> {}
89
+
90
+ export const SwipeableMenuSheetContent = React.forwardRef<
91
+ HTMLDivElement,
92
+ SwipeableMenuSheetContentProps
93
+ >(({ className, ...props }, ref) => {
94
+ const [variantProps, otherProps] = menuSheetItem.splitVariantProps(props);
95
+ const classNames = useClassNames();
96
+
97
+ return (
98
+ <ItemPropsProvider value={variantProps}>
99
+ <Drawer.Content ref={ref} className={clsx(classNames.content, className)} {...otherProps} />
100
+ </ItemPropsProvider>
101
+ );
102
+ });
103
+
104
+ SwipeableMenuSheetContent.displayName = "SwipeableMenuSheetContent";
105
+
106
+ ////////////////////////////////////////////////////////////////////////////////////
107
+
108
+ // `preventCycle` only applies when snap points are configured, and
109
+ // SwipeableMenuSheet omits snap points from its Root API.
110
+ export interface SwipeableMenuSheetHandleProps
111
+ extends PrimitiveProps,
112
+ Omit<Drawer.HandleProps, "preventCycle"> {}
113
+
114
+ export const SwipeableMenuSheetHandle = React.forwardRef<
115
+ HTMLDivElement,
116
+ SwipeableMenuSheetHandleProps
117
+ >(({ className, ...props }, ref) => {
118
+ const classNames = bottomSheetHandle();
119
+
120
+ return (
121
+ <Drawer.Handle ref={ref} className={clsx(classNames.root, className)} {...props}>
122
+ <Primitive.div aria-hidden="true" className={classNames.touchArea} />
123
+ </Drawer.Handle>
124
+ );
125
+ });
126
+
127
+ SwipeableMenuSheetHandle.displayName = "SwipeableMenuSheetHandle";
128
+
129
+ ////////////////////////////////////////////////////////////////////////////////////
130
+
131
+ export interface SwipeableMenuSheetHeaderProps extends Drawer.HeaderProps {}
132
+
133
+ export const SwipeableMenuSheetHeader = withContext<HTMLDivElement, SwipeableMenuSheetHeaderProps>(
134
+ Drawer.Header,
135
+ "header",
136
+ );
137
+
138
+ ////////////////////////////////////////////////////////////////////////////////////
139
+
140
+ export interface SwipeableMenuSheetTitleProps extends Drawer.TitleProps {}
141
+
142
+ export const SwipeableMenuSheetTitle = withContext<
143
+ HTMLHeadingElement,
144
+ SwipeableMenuSheetTitleProps
145
+ >(Drawer.Title, "title");
146
+
147
+ SwipeableMenuSheetTitle.displayName = "SwipeableMenuSheetTitle";
148
+
149
+ ////////////////////////////////////////////////////////////////////////////////////
150
+
151
+ export interface SwipeableMenuSheetDescriptionProps extends Drawer.DescriptionProps {}
152
+
153
+ export const SwipeableMenuSheetDescription = withContext<
154
+ HTMLParagraphElement,
155
+ SwipeableMenuSheetDescriptionProps
156
+ >(Drawer.Description, "description");
157
+
158
+ ////////////////////////////////////////////////////////////////////////////////////
159
+
160
+ export interface SwipeableMenuSheetListProps
161
+ extends PrimitiveProps,
162
+ React.HTMLAttributes<HTMLDivElement> {}
163
+
164
+ export const SwipeableMenuSheetList = withContext<HTMLDivElement, SwipeableMenuSheetListProps>(
165
+ Primitive.div,
166
+ "list",
167
+ );
168
+
169
+ ////////////////////////////////////////////////////////////////////////////////////
170
+
171
+ export interface SwipeableMenuSheetGroupProps
172
+ extends PrimitiveProps,
173
+ React.HTMLAttributes<HTMLDivElement>,
174
+ Pick<MenuSheetItemVariantProps, "labelAlign"> {}
175
+
176
+ export const SwipeableMenuSheetGroup = React.forwardRef<
177
+ HTMLDivElement,
178
+ SwipeableMenuSheetGroupProps
179
+ >(({ className, ...props }, ref) => {
180
+ const [variantProps, otherProps] = menuSheetItem.splitVariantProps(props);
181
+ const parentProps = useItemProps();
182
+ const classNames = useClassNames();
183
+
184
+ return (
185
+ <ItemPropsProvider value={{ ...parentProps, ...variantProps }}>
186
+ <Primitive.div className={clsx(classNames.group, className)} ref={ref} {...otherProps} />
187
+ </ItemPropsProvider>
188
+ );
189
+ });
190
+
191
+ SwipeableMenuSheetGroup.displayName = "SwipeableMenuSheetGroup";
192
+
193
+ ////////////////////////////////////////////////////////////////////////////////////
194
+
195
+ export interface SwipeableMenuSheetItemProps
196
+ extends PrimitiveProps,
197
+ MenuSheetItemVariantProps,
198
+ React.HTMLAttributes<HTMLButtonElement> {}
199
+
200
+ export const SwipeableMenuSheetItem = React.forwardRef<
201
+ HTMLButtonElement,
202
+ SwipeableMenuSheetItemProps
203
+ >(({ className: propClassName, ...props }, ref) => {
204
+ const [variantProps, otherProps] = menuSheetItem.splitVariantProps(props);
205
+ const parentProps = useItemProps();
206
+ const classNames = menuSheetItem({ ...parentProps, ...variantProps });
207
+
208
+ return (
209
+ <ItemClassNamesProvider value={classNames}>
210
+ <Primitive.button
211
+ ref={ref}
212
+ className={clsx(classNames.root, propClassName)}
213
+ {...otherProps}
214
+ />
215
+ </ItemClassNamesProvider>
216
+ );
217
+ });
218
+
219
+ SwipeableMenuSheetItem.displayName = "SwipeableMenuSheetItem";
220
+
221
+ export interface SwipeableMenuSheetItemContentProps
222
+ extends PrimitiveProps,
223
+ React.HTMLAttributes<HTMLDivElement> {}
224
+
225
+ export const SwipeableMenuSheetItemContent = withItemContext<
226
+ HTMLDivElement,
227
+ SwipeableMenuSheetItemContentProps
228
+ >(Primitive.div, "content");
229
+
230
+ export interface SwipeableMenuSheetItemLabelProps
231
+ extends PrimitiveProps,
232
+ React.HTMLAttributes<HTMLSpanElement> {}
233
+
234
+ export const SwipeableMenuSheetItemLabel = withItemContext<
235
+ HTMLSpanElement,
236
+ SwipeableMenuSheetItemLabelProps
237
+ >(Primitive.span, "label");
238
+
239
+ export interface SwipeableMenuSheetItemDescriptionProps
240
+ extends PrimitiveProps,
241
+ React.HTMLAttributes<HTMLSpanElement> {}
242
+
243
+ export const SwipeableMenuSheetItemDescription = withItemContext<
244
+ HTMLSpanElement,
245
+ SwipeableMenuSheetItemDescriptionProps
246
+ >(Primitive.span, "description");
247
+
248
+ ////////////////////////////////////////////////////////////////////////////////////
249
+
250
+ export interface SwipeableMenuSheetFooterProps
251
+ extends PrimitiveProps,
252
+ React.HTMLAttributes<HTMLDivElement> {}
253
+
254
+ export const SwipeableMenuSheetFooter = withContext<HTMLDivElement, SwipeableMenuSheetFooterProps>(
255
+ Primitive.div,
256
+ "footer",
257
+ );
258
+
259
+ ////////////////////////////////////////////////////////////////////////////////////
260
+
261
+ export interface SwipeableMenuSheetCloseButtonProps extends Drawer.CloseButtonProps {}
262
+
263
+ /**
264
+ * Visible button that closes the swipeable menu sheet.
265
+ */
266
+ export const SwipeableMenuSheetCloseButton = withContext<
267
+ HTMLButtonElement,
268
+ SwipeableMenuSheetCloseButtonProps
269
+ >(Drawer.CloseButton, "closeButton");
@@ -0,0 +1,38 @@
1
+ export {
2
+ SwipeableMenuSheetBackdrop,
3
+ SwipeableMenuSheetPositioner,
4
+ SwipeableMenuSheetContent,
5
+ SwipeableMenuSheetHandle,
6
+ SwipeableMenuSheetCloseButton,
7
+ SwipeableMenuSheetHeader,
8
+ SwipeableMenuSheetRoot,
9
+ SwipeableMenuSheetTitle,
10
+ SwipeableMenuSheetDescription,
11
+ SwipeableMenuSheetTrigger,
12
+ SwipeableMenuSheetList,
13
+ SwipeableMenuSheetGroup,
14
+ SwipeableMenuSheetFooter,
15
+ SwipeableMenuSheetItem,
16
+ SwipeableMenuSheetItemContent,
17
+ SwipeableMenuSheetItemLabel,
18
+ SwipeableMenuSheetItemDescription,
19
+ type SwipeableMenuSheetBackdropProps,
20
+ type SwipeableMenuSheetPositionerProps,
21
+ type SwipeableMenuSheetContentProps,
22
+ type SwipeableMenuSheetHandleProps,
23
+ type SwipeableMenuSheetCloseButtonProps,
24
+ type SwipeableMenuSheetHeaderProps,
25
+ type SwipeableMenuSheetRootProps,
26
+ type SwipeableMenuSheetTitleProps,
27
+ type SwipeableMenuSheetDescriptionProps,
28
+ type SwipeableMenuSheetTriggerProps,
29
+ type SwipeableMenuSheetListProps,
30
+ type SwipeableMenuSheetGroupProps,
31
+ type SwipeableMenuSheetFooterProps,
32
+ type SwipeableMenuSheetItemProps,
33
+ type SwipeableMenuSheetItemContentProps,
34
+ type SwipeableMenuSheetItemLabelProps,
35
+ type SwipeableMenuSheetItemDescriptionProps,
36
+ } from "./SwipeableMenuSheet";
37
+
38
+ export * as SwipeableMenuSheet from "./SwipeableMenuSheet.namespace";
@@ -18,38 +18,15 @@ const withStateProps = createWithStateProps([useSwitchContext]);
18
18
 
19
19
  ////////////////////////////////////////////////////////////////////////////////////
20
20
 
21
- /**
22
- * @deprecated Use `16` or `32` instead of `small` or `medium`.
23
- */
24
- type SwitchVariantDeprecatedSizeProps = "small" | "medium";
25
-
26
21
  export interface SwitchRootProps
27
- extends Omit<SwitchVariantProps, "size">,
22
+ extends SwitchVariantProps,
28
23
  Omit<SwitchmarkVariantProps, "size">,
29
- SwitchPrimitive.RootProps {
30
- size?: SwitchVariantProps["size"] | SwitchVariantDeprecatedSizeProps;
31
- }
24
+ SwitchPrimitive.RootProps {}
32
25
 
33
26
  export const SwitchRoot = React.forwardRef<HTMLLabelElement, SwitchRootProps>(
34
27
  ({ className, ...props }, ref) => {
35
- if (
36
- process.env.NODE_ENV !== "production" &&
37
- (props.size === "small" || props.size === "medium")
38
- ) {
39
- console.warn(
40
- `[SEED Design System] Switch size='${props.size}' is deprecated and will be removed in @seed-design/react@2.0.0. Use size='${props.size === "small" ? "16" : "32"}' instead.`,
41
- );
42
- }
43
-
44
28
  const [{ switch: switchVariantProps, switchmark: switchmarkVariantProps }, otherProps] =
45
- splitMultipleVariantsProps(
46
- {
47
- ...props,
48
- // TODO: replace this mapping completely
49
- size: props.size === "small" ? "16" : props.size === "medium" ? "32" : props.size,
50
- },
51
- { switchmark, switch: switchStyle },
52
- );
29
+ splitMultipleVariantsProps(props, { switchmark, switch: switchStyle });
53
30
 
54
31
  const classNames = switchStyle(switchVariantProps);
55
32
 
@@ -1,3 +1,4 @@
1
+ export * from "./Accordion";
1
2
  export * from "./ActionButton";
2
3
  export * from "./ActionChip";
3
4
  export * from "./ActionSheet";
@@ -26,23 +27,30 @@ export * from "./Fab";
26
27
  export * from "./Field";
27
28
  export * from "./FieldButton";
28
29
  export * from "./Fieldset";
30
+ export * from "./AttachmentDisplay";
31
+ export * from "./AttachmentInput";
29
32
  export * from "./Flex";
30
33
  export * from "./Float";
31
34
  export * from "./FloatingActionButton";
35
+ export * from "./Footer";
32
36
  export * from "./Grid";
33
37
  export * from "./GridItem";
34
38
  export * from "./HelpBubble";
39
+ export * from "./HelpBubbleTooltip";
35
40
  export * from "./Icon";
36
41
  export * from "./IdentityPlaceholder";
37
42
  export * from "./ImageFrame";
38
43
  export * from "./Inline";
39
44
  export * from "./InlineBanner";
45
+ export * from "./Layout";
40
46
  export * from "./LinkContent";
41
47
  export * from "./List";
42
48
  export * from "./LoadingIndicator";
43
49
  export * from "./MannerTemp";
44
50
  export * from "./MannerTempBadge";
51
+ export * from "./Menu";
45
52
  export * from "./MenuSheet";
53
+ export * from "./NavigationMenu";
46
54
  export * from "./NotificationBadge";
47
55
  export * from "./PageBanner";
48
56
  export * from "./Portal";
@@ -52,13 +60,17 @@ export * from "./RadioGroup";
52
60
  export * from "./RadioGroupField";
53
61
  export * from "./ReactionButton";
54
62
  export * from "./ResponsivePair";
63
+ export * from "./ResponsiveSidePanel";
55
64
  export * from "./ScrollFog";
56
65
  export * from "./SegmentedControl";
57
66
  export * from "./SelectBox";
67
+ export * from "./SideNavigation";
68
+ export * from "./SidePanel";
58
69
  export * from "./Skeleton";
59
70
  export * from "./Slider";
60
71
  export * from "./Snackbar";
61
72
  export * from "./Stack";
73
+ export * from "./SwipeableMenuSheet";
62
74
  export * from "./Switch";
63
75
  export * from "./Tabs";
64
76
  export * from "./TagGroup";
@@ -0,0 +1,94 @@
1
+ import { act, renderHook } from "@testing-library/react";
2
+ import { beforeEach, describe, expect, it, mock } from "bun:test";
3
+ import type * as React from "react";
4
+
5
+ import { BreakpointProvider } from "../providers/BreakpointProvider";
6
+ import { useBreakpoint } from "./useBreakpoint";
7
+
8
+ type ChangeHandler = (e: { matches: boolean }) => void;
9
+
10
+ let currentWidth = 0;
11
+ const entries = new Map<string, { minWidth: number; handlers: Set<ChangeHandler> }>();
12
+
13
+ function mockMatchMedia(query: string) {
14
+ const match = query.match(/min-width:\s*(\d+)px/);
15
+ const minWidth = match ? Number(match[1]) : 0;
16
+ const entry = entries.get(query) ?? { minWidth, handlers: new Set<ChangeHandler>() };
17
+ entries.set(query, entry);
18
+ return {
19
+ get matches() {
20
+ return currentWidth >= entry.minWidth;
21
+ },
22
+ media: query,
23
+ addEventListener(_: string, handler: ChangeHandler) {
24
+ entry.handlers.add(handler);
25
+ },
26
+ removeEventListener(_: string, handler: ChangeHandler) {
27
+ entry.handlers.delete(handler);
28
+ },
29
+ onchange: null,
30
+ addListener: mock(),
31
+ removeListener: mock(),
32
+ dispatchEvent: () => false,
33
+ };
34
+ }
35
+
36
+ function setViewport(minWidthPx: number) {
37
+ currentWidth = minWidthPx;
38
+ for (const [, entry] of entries) {
39
+ const nowMatches = currentWidth >= entry.minWidth;
40
+ for (const handler of entry.handlers) {
41
+ handler({ matches: nowMatches });
42
+ }
43
+ }
44
+ }
45
+
46
+ beforeEach(() => {
47
+ currentWidth = 0;
48
+ entries.clear();
49
+ window.matchMedia = mockMatchMedia as unknown as typeof window.matchMedia;
50
+ });
51
+
52
+ describe("useBreakpoint", () => {
53
+ it("returns 'base' when no media query matches", () => {
54
+ const { result } = renderHook(() => useBreakpoint());
55
+ expect(result.current).toBe("base");
56
+ });
57
+
58
+ it("returns 'md' when viewport is 768px", () => {
59
+ currentWidth = 768;
60
+ const { result } = renderHook(() => useBreakpoint());
61
+ expect(result.current).toBe("md");
62
+ });
63
+
64
+ it("returns the largest matching breakpoint", () => {
65
+ currentWidth = 1440;
66
+ const { result } = renderHook(() => useBreakpoint());
67
+ expect(result.current).toBe("xl");
68
+ });
69
+
70
+ it("updates when viewport changes", () => {
71
+ const { result } = renderHook(() => useBreakpoint());
72
+ expect(result.current).toBe("base");
73
+
74
+ act(() => setViewport(768));
75
+ expect(result.current).toBe("md");
76
+
77
+ act(() => setViewport(1280));
78
+ expect(result.current).toBe("lg");
79
+ });
80
+
81
+ it("respects defaultBreakpoint option", () => {
82
+ const { result } = renderHook(() => useBreakpoint({ defaultBreakpoint: "lg" }));
83
+ expect(result.current).toBe("base");
84
+ });
85
+
86
+ it("uses BreakpointProvider context when wrapped", () => {
87
+ currentWidth = 768;
88
+ const wrapper = ({ children }: { children: React.ReactNode }) => (
89
+ <BreakpointProvider>{children}</BreakpointProvider>
90
+ );
91
+ const { result } = renderHook(() => useBreakpoint(), { wrapper });
92
+ expect(result.current).toBe("md");
93
+ });
94
+ });
@@ -0,0 +1,24 @@
1
+ import type { Breakpoint } from "@seed-design/css/breakpoints";
2
+ import { createContext, useContext, useSyncExternalStore } from "react";
3
+
4
+ import * as store from "../primitives/breakpoint-store";
5
+
6
+ export interface UseBreakpointOptions {
7
+ defaultBreakpoint?: Breakpoint;
8
+ }
9
+
10
+ export interface BreakpointContextValue {
11
+ breakpoint: Breakpoint;
12
+ defaultBreakpoint: Breakpoint;
13
+ }
14
+
15
+ export const BreakpointContext = createContext<BreakpointContextValue | null>(null);
16
+
17
+ export function useBreakpoint(options?: UseBreakpointOptions): Breakpoint {
18
+ const ctx = useContext(BreakpointContext);
19
+ const defaultBp = options?.defaultBreakpoint ?? ctx?.defaultBreakpoint ?? "base";
20
+
21
+ const storeBreakpoint = useSyncExternalStore(store.subscribe, store.getSnapshot, () => defaultBp);
22
+
23
+ return ctx ? ctx.breakpoint : storeBreakpoint;
24
+ }