@seed-design/react 2.6.0 → 3.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 (464) hide show
  1. package/lib/components/Accordion/Accordion.cjs +2 -1
  2. package/lib/components/Accordion/Accordion.d.ts.map +1 -1
  3. package/lib/components/Accordion/Accordion.js +2 -1
  4. package/lib/components/ActionButton/ActionButton.cjs +1 -1
  5. package/lib/components/ActionButton/ActionButton.js +1 -1
  6. package/lib/components/AlertDialog/AlertDialog.cjs +34 -0
  7. package/lib/components/AlertDialog/AlertDialog.d.ts +51 -0
  8. package/lib/components/AlertDialog/AlertDialog.d.ts.map +1 -0
  9. package/lib/components/AlertDialog/AlertDialog.js +24 -0
  10. package/lib/components/AlertDialog/AlertDialog.namespace.cjs +22 -0
  11. package/lib/components/AlertDialog/AlertDialog.namespace.d.ts +2 -0
  12. package/lib/components/AlertDialog/AlertDialog.namespace.d.ts.map +1 -0
  13. package/lib/components/AlertDialog/AlertDialog.namespace.js +17 -0
  14. package/lib/components/AlertDialog/AlertDialog.test.d.ts +2 -0
  15. package/lib/components/AlertDialog/AlertDialog.test.d.ts.map +1 -0
  16. package/lib/components/AlertDialog/index.cjs +19 -0
  17. package/lib/components/AlertDialog/index.d.ts +3 -0
  18. package/lib/components/AlertDialog/index.d.ts.map +1 -0
  19. package/lib/components/AlertDialog/index.js +3 -0
  20. package/lib/components/AttachmentDisplay/AttachmentDisplay.cjs +1 -1
  21. package/lib/components/AttachmentDisplay/AttachmentDisplay.js +1 -1
  22. package/lib/components/AttachmentDisplay/AttachmentDisplayItem.cjs +1 -1
  23. package/lib/components/AttachmentDisplay/AttachmentDisplayItem.d.ts.map +1 -1
  24. package/lib/components/AttachmentDisplay/AttachmentDisplayItem.js +1 -1
  25. package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.cjs +1 -1
  26. package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.js +1 -1
  27. package/lib/components/AttachmentDisplay/index.cjs +8 -0
  28. package/lib/components/AttachmentDisplay/index.d.ts +2 -0
  29. package/lib/components/AttachmentDisplay/index.d.ts.map +1 -1
  30. package/lib/components/AttachmentDisplay/index.js +2 -1
  31. package/lib/components/AttachmentInput/AttachmentInput.cjs +1 -1
  32. package/lib/components/AttachmentInput/AttachmentInput.js +1 -1
  33. package/lib/components/AttachmentInput/AttachmentInputDropzone.cjs +1 -1
  34. package/lib/components/AttachmentInput/AttachmentInputDropzone.js +1 -1
  35. package/lib/components/AttachmentInput/AttachmentInputItem.cjs +2 -2
  36. package/lib/components/AttachmentInput/AttachmentInputItem.d.ts.map +1 -1
  37. package/lib/components/AttachmentInput/AttachmentInputItem.js +2 -2
  38. package/lib/components/AttachmentInput/AttachmentInputTrigger.cjs +1 -1
  39. package/lib/components/AttachmentInput/AttachmentInputTrigger.js +1 -1
  40. package/lib/components/AttachmentInput/index.cjs +8 -0
  41. package/lib/components/AttachmentInput/index.d.ts +2 -0
  42. package/lib/components/AttachmentInput/index.d.ts.map +1 -1
  43. package/lib/components/AttachmentInput/index.js +2 -1
  44. package/lib/components/Badge/Badge.cjs +52 -10
  45. package/lib/components/Badge/Badge.d.ts +13 -4
  46. package/lib/components/Badge/Badge.d.ts.map +1 -1
  47. package/lib/components/Badge/Badge.js +49 -11
  48. package/lib/components/Badge/Badge.namespace.cjs +16 -0
  49. package/lib/components/Badge/Badge.namespace.d.ts +2 -0
  50. package/lib/components/Badge/Badge.namespace.d.ts.map +1 -0
  51. package/lib/components/Badge/Badge.namespace.js +11 -0
  52. package/lib/components/Badge/Badge.test.d.ts +2 -0
  53. package/lib/components/Badge/Badge.test.d.ts.map +1 -0
  54. package/lib/components/Badge/index.cjs +11 -1
  55. package/lib/components/Badge/index.d.ts +2 -1
  56. package/lib/components/Badge/index.d.ts.map +1 -1
  57. package/lib/components/Badge/index.js +3 -2
  58. package/lib/components/Checkbox/Checkbox.cjs +2 -2
  59. package/lib/components/Checkbox/Checkbox.d.ts +3 -1
  60. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  61. package/lib/components/Checkbox/Checkbox.js +2 -2
  62. package/lib/components/Checkbox/Checkbox.namespace.d.ts +1 -1
  63. package/lib/components/Checkbox/Checkbox.namespace.d.ts.map +1 -1
  64. package/lib/components/Checkbox/index.d.ts +1 -1
  65. package/lib/components/Checkbox/index.d.ts.map +1 -1
  66. package/lib/components/Chip/Chip.cjs +13 -5
  67. package/lib/components/Chip/Chip.d.ts +13 -2
  68. package/lib/components/Chip/Chip.d.ts.map +1 -1
  69. package/lib/components/Chip/Chip.js +10 -5
  70. package/lib/components/Chip/Chip.namespace.cjs +5 -2
  71. package/lib/components/Chip/Chip.namespace.d.ts +1 -1
  72. package/lib/components/Chip/Chip.namespace.d.ts.map +1 -1
  73. package/lib/components/Chip/Chip.namespace.js +6 -3
  74. package/lib/components/Chip/index.cjs +4 -1
  75. package/lib/components/Chip/index.d.ts +1 -1
  76. package/lib/components/Chip/index.d.ts.map +1 -1
  77. package/lib/components/Chip/index.js +2 -2
  78. package/lib/components/ChipTabs/ChipTabs.cjs +1 -1
  79. package/lib/components/ChipTabs/ChipTabs.js +1 -1
  80. package/lib/components/DatePicker/DatePicker.cjs +192 -190
  81. package/lib/components/DatePicker/DatePicker.d.ts +50 -21
  82. package/lib/components/DatePicker/DatePicker.d.ts.map +1 -1
  83. package/lib/components/DatePicker/DatePicker.js +189 -187
  84. package/lib/components/DatePicker/DatePicker.namespace.cjs +16 -0
  85. package/lib/components/DatePicker/DatePicker.namespace.d.ts +2 -0
  86. package/lib/components/DatePicker/DatePicker.namespace.d.ts.map +1 -0
  87. package/lib/components/DatePicker/DatePicker.namespace.js +11 -0
  88. package/lib/components/DatePicker/index.cjs +11 -4
  89. package/lib/components/DatePicker/index.d.ts +3 -2
  90. package/lib/components/DatePicker/index.d.ts.map +1 -1
  91. package/lib/components/DatePicker/index.js +3 -2
  92. package/lib/components/Dialog/Dialog.cjs +84 -9
  93. package/lib/components/Dialog/Dialog.d.ts +21 -14
  94. package/lib/components/Dialog/Dialog.d.ts.map +1 -1
  95. package/lib/components/Dialog/Dialog.js +80 -9
  96. package/lib/components/Dialog/Dialog.namespace.cjs +2 -0
  97. package/lib/components/Dialog/Dialog.namespace.d.ts +1 -1
  98. package/lib/components/Dialog/Dialog.namespace.d.ts.map +1 -1
  99. package/lib/components/Dialog/Dialog.namespace.js +3 -1
  100. package/lib/components/Dialog/index.cjs +2 -0
  101. package/lib/components/Dialog/index.d.ts +1 -1
  102. package/lib/components/Dialog/index.d.ts.map +1 -1
  103. package/lib/components/Dialog/index.js +2 -2
  104. package/lib/components/HelpBubble/HelpBubble.cjs +18 -5
  105. package/lib/components/HelpBubble/HelpBubble.d.ts +5 -0
  106. package/lib/components/HelpBubble/HelpBubble.d.ts.map +1 -1
  107. package/lib/components/HelpBubble/HelpBubble.js +18 -5
  108. package/lib/components/HelpBubble/HelpBubble.test.d.ts +2 -0
  109. package/lib/components/HelpBubble/HelpBubble.test.d.ts.map +1 -0
  110. package/lib/components/ImageFrame/ImageFrame.cjs +5 -4
  111. package/lib/components/ImageFrame/ImageFrame.d.ts +2 -2
  112. package/lib/components/ImageFrame/ImageFrame.d.ts.map +1 -1
  113. package/lib/components/ImageFrame/ImageFrame.js +6 -5
  114. package/lib/components/List/List.cjs +14 -3
  115. package/lib/components/List/List.d.ts +15 -0
  116. package/lib/components/List/List.d.ts.map +1 -1
  117. package/lib/components/List/List.js +11 -4
  118. package/lib/components/List/List.namespace.cjs +4 -0
  119. package/lib/components/List/List.namespace.d.ts +1 -1
  120. package/lib/components/List/List.namespace.d.ts.map +1 -1
  121. package/lib/components/List/List.namespace.js +5 -1
  122. package/lib/components/List/index.cjs +4 -0
  123. package/lib/components/List/index.d.ts +1 -1
  124. package/lib/components/List/index.d.ts.map +1 -1
  125. package/lib/components/List/index.js +2 -2
  126. package/lib/components/Menu/Menu.cjs +3 -2
  127. package/lib/components/Menu/Menu.d.ts.map +1 -1
  128. package/lib/components/Menu/Menu.js +3 -2
  129. package/lib/components/MenuSheet/MenuSheet.cjs +4 -3
  130. package/lib/components/MenuSheet/MenuSheet.d.ts.map +1 -1
  131. package/lib/components/MenuSheet/MenuSheet.js +4 -3
  132. package/lib/components/NavigationMenu/NavigationMenu.cjs +4 -3
  133. package/lib/components/NavigationMenu/NavigationMenu.d.ts.map +1 -1
  134. package/lib/components/NavigationMenu/NavigationMenu.js +4 -3
  135. package/lib/components/PageBanner/PageBanner.cjs +3 -2
  136. package/lib/components/PageBanner/PageBanner.d.ts.map +1 -1
  137. package/lib/components/PageBanner/PageBanner.js +3 -2
  138. package/lib/components/{ContentDialog/ContentDialog.cjs → Popover/Popover.cjs} +61 -40
  139. package/lib/components/Popover/Popover.d.ts +69 -0
  140. package/lib/components/Popover/Popover.d.ts.map +1 -0
  141. package/lib/components/{ContentDialog/ContentDialog.js → Popover/Popover.js} +49 -29
  142. package/lib/components/Popover/Popover.namespace.cjs +26 -0
  143. package/lib/components/Popover/Popover.namespace.d.ts +2 -0
  144. package/lib/components/Popover/Popover.namespace.d.ts.map +1 -0
  145. package/lib/components/Popover/Popover.namespace.js +21 -0
  146. package/lib/components/Popover/Popover.test.d.ts +2 -0
  147. package/lib/components/Popover/Popover.test.d.ts.map +1 -0
  148. package/lib/components/Popover/index.cjs +23 -0
  149. package/lib/components/Popover/index.d.ts +3 -0
  150. package/lib/components/Popover/index.d.ts.map +1 -0
  151. package/lib/components/Popover/index.js +3 -0
  152. package/lib/components/QuantityPicker/QuantityPicker.d.ts.map +1 -1
  153. package/lib/components/RadioGroup/RadioGroup.cjs +2 -2
  154. package/lib/components/RadioGroup/RadioGroup.d.ts +2 -0
  155. package/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  156. package/lib/components/RadioGroup/RadioGroup.js +2 -2
  157. package/lib/components/RadioGroup/RadioGroup.namespace.d.ts +1 -1
  158. package/lib/components/RadioGroup/RadioGroup.namespace.d.ts.map +1 -1
  159. package/lib/components/RadioGroup/index.d.ts +1 -1
  160. package/lib/components/RadioGroup/index.d.ts.map +1 -1
  161. package/lib/components/RadioGroupField/RadioGroupField.cjs +2 -2
  162. package/lib/components/RadioGroupField/RadioGroupField.d.ts +5 -1
  163. package/lib/components/RadioGroupField/RadioGroupField.d.ts.map +1 -1
  164. package/lib/components/RadioGroupField/RadioGroupField.js +2 -2
  165. package/lib/components/RadioGroupField/RadioGroupField.namespace.d.ts +1 -1
  166. package/lib/components/RadioGroupField/RadioGroupField.namespace.d.ts.map +1 -1
  167. package/lib/components/ReactionButton/ReactionButton.cjs +1 -1
  168. package/lib/components/ReactionButton/ReactionButton.js +1 -1
  169. package/lib/components/ResponsiveDialog/ResponsiveDialog.cjs +13 -13
  170. package/lib/components/ResponsiveDialog/ResponsiveDialog.d.ts +15 -15
  171. package/lib/components/ResponsiveDialog/ResponsiveDialog.d.ts.map +1 -1
  172. package/lib/components/ResponsiveDialog/ResponsiveDialog.js +13 -13
  173. package/lib/components/SegmentedControl/SegmentedControl.cjs +2 -1
  174. package/lib/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  175. package/lib/components/SegmentedControl/SegmentedControl.js +2 -1
  176. package/lib/components/Select/Select.cjs +5 -4
  177. package/lib/components/Select/Select.d.ts.map +1 -1
  178. package/lib/components/Select/Select.js +5 -4
  179. package/lib/components/SelectBox/CheckSelectBox.cjs +20 -6
  180. package/lib/components/SelectBox/CheckSelectBox.d.ts +7 -0
  181. package/lib/components/SelectBox/CheckSelectBox.d.ts.map +1 -1
  182. package/lib/components/SelectBox/CheckSelectBox.js +21 -7
  183. package/lib/components/SelectBox/RadioSelectBox.cjs +20 -6
  184. package/lib/components/SelectBox/RadioSelectBox.d.ts +7 -0
  185. package/lib/components/SelectBox/RadioSelectBox.d.ts.map +1 -1
  186. package/lib/components/SelectBox/RadioSelectBox.js +21 -7
  187. package/lib/components/SelectBox/SelectBox.test.d.ts +2 -0
  188. package/lib/components/SelectBox/SelectBox.test.d.ts.map +1 -0
  189. package/lib/components/SideNavigation/SideNavigation.cjs +2 -2
  190. package/lib/components/SideNavigation/SideNavigation.js +2 -2
  191. package/lib/components/SideNavigation/index.cjs +8 -0
  192. package/lib/components/SideNavigation/index.d.ts +1 -0
  193. package/lib/components/SideNavigation/index.d.ts.map +1 -1
  194. package/lib/components/SideNavigation/index.js +2 -1
  195. package/lib/components/SidePanel/SidePanel.d.ts +0 -12
  196. package/lib/components/SidePanel/SidePanel.d.ts.map +1 -1
  197. package/lib/components/Slider/Slider.cjs +1 -1
  198. package/lib/components/Slider/Slider.js +1 -1
  199. package/lib/components/Snackbar/Snackbar.cjs +2 -2
  200. package/lib/components/Snackbar/Snackbar.js +2 -2
  201. package/lib/components/Snackbar/useSnackbarAdapter.cjs +1 -1
  202. package/lib/components/Snackbar/useSnackbarAdapter.js +1 -1
  203. package/lib/components/Stack/Stack.cjs +0 -12
  204. package/lib/components/Stack/Stack.d.ts +0 -8
  205. package/lib/components/Stack/Stack.d.ts.map +1 -1
  206. package/lib/components/Stack/Stack.js +1 -12
  207. package/lib/components/Stack/index.cjs +0 -1
  208. package/lib/components/Stack/index.d.ts +1 -1
  209. package/lib/components/Stack/index.d.ts.map +1 -1
  210. package/lib/components/Stack/index.js +2 -2
  211. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.cjs +3 -2
  212. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.d.ts.map +1 -1
  213. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.js +3 -2
  214. package/lib/components/Switch/Switch.cjs +3 -3
  215. package/lib/components/Switch/Switch.d.ts +5 -1
  216. package/lib/components/Switch/Switch.d.ts.map +1 -1
  217. package/lib/components/Switch/Switch.js +3 -3
  218. package/lib/components/Switch/Switch.namespace.d.ts +1 -1
  219. package/lib/components/Switch/Switch.namespace.d.ts.map +1 -1
  220. package/lib/components/Switch/index.d.ts +1 -1
  221. package/lib/components/Switch/index.d.ts.map +1 -1
  222. package/lib/components/TagGroup/TagGroup.d.ts.map +1 -1
  223. package/lib/components/ToggleButton/ToggleButton.cjs +1 -1
  224. package/lib/components/ToggleButton/ToggleButton.js +1 -1
  225. package/lib/components/WheelPicker/WheelPicker.cjs +11 -12
  226. package/lib/components/WheelPicker/WheelPicker.d.ts +7 -2
  227. package/lib/components/WheelPicker/WheelPicker.d.ts.map +1 -1
  228. package/lib/components/WheelPicker/WheelPicker.js +11 -12
  229. package/lib/components/index.cjs +90 -94
  230. package/lib/components/index.d.ts +2 -12
  231. package/lib/components/index.d.ts.map +1 -1
  232. package/lib/components/index.js +17 -24
  233. package/lib/index.cjs +116 -94
  234. package/lib/index.d.ts +4 -2
  235. package/lib/index.d.ts.map +1 -1
  236. package/lib/index.js +20 -25
  237. package/lib/utils/withContentScale.cjs +30 -0
  238. package/lib/utils/withContentScale.d.ts +12 -0
  239. package/lib/utils/withContentScale.d.ts.map +1 -0
  240. package/lib/utils/withContentScale.js +27 -0
  241. package/lib/utils/withContentScale.test.d.ts +2 -0
  242. package/lib/utils/withContentScale.test.d.ts.map +1 -0
  243. package/package.json +9 -14
  244. package/src/components/Accordion/Accordion.tsx +3 -3
  245. package/src/components/AlertDialog/AlertDialog.namespace.ts +22 -0
  246. package/src/components/AlertDialog/AlertDialog.test.tsx +61 -0
  247. package/src/components/AlertDialog/AlertDialog.tsx +115 -0
  248. package/src/components/AlertDialog/index.ts +24 -0
  249. package/src/components/AttachmentDisplay/AttachmentDisplayItem.tsx +2 -0
  250. package/src/components/AttachmentDisplay/index.ts +10 -0
  251. package/src/components/AttachmentInput/AttachmentInputItem.tsx +2 -0
  252. package/src/components/AttachmentInput/index.ts +10 -0
  253. package/src/components/Badge/Badge.namespace.ts +10 -0
  254. package/src/components/Badge/Badge.test.tsx +56 -0
  255. package/src/components/Badge/Badge.tsx +82 -11
  256. package/src/components/Badge/index.ts +12 -1
  257. package/src/components/Checkbox/Checkbox.namespace.ts +1 -0
  258. package/src/components/Checkbox/Checkbox.tsx +3 -1
  259. package/src/components/Checkbox/index.ts +1 -0
  260. package/src/components/Chip/Chip.namespace.ts +8 -2
  261. package/src/components/Chip/Chip.tsx +34 -7
  262. package/src/components/Chip/index.ts +8 -2
  263. package/src/components/DatePicker/DatePicker.namespace.ts +14 -0
  264. package/src/components/DatePicker/DatePicker.test.tsx +85 -276
  265. package/src/components/DatePicker/DatePicker.tsx +327 -284
  266. package/src/components/DatePicker/index.ts +25 -21
  267. package/src/components/Dialog/Dialog.namespace.ts +4 -0
  268. package/src/components/Dialog/Dialog.tsx +128 -10
  269. package/src/components/Dialog/index.ts +4 -5
  270. package/src/components/HelpBubble/HelpBubble.test.tsx +111 -0
  271. package/src/components/HelpBubble/HelpBubble.tsx +19 -3
  272. package/src/components/ImageFrame/ImageFrame.tsx +12 -4
  273. package/src/components/List/List.namespace.ts +8 -0
  274. package/src/components/List/List.tsx +43 -3
  275. package/src/components/List/index.ts +8 -0
  276. package/src/components/Menu/Menu.tsx +4 -3
  277. package/src/components/MenuSheet/MenuSheet.tsx +20 -17
  278. package/src/components/NavigationMenu/NavigationMenu.tsx +20 -17
  279. package/src/components/PageBanner/PageBanner.tsx +6 -3
  280. package/src/components/Popover/Popover.namespace.ts +30 -0
  281. package/src/components/Popover/Popover.test.tsx +222 -0
  282. package/src/components/Popover/Popover.tsx +282 -0
  283. package/src/components/Popover/index.ts +32 -0
  284. package/src/components/QuantityPicker/QuantityPicker.tsx +2 -0
  285. package/src/components/RadioGroup/RadioGroup.namespace.ts +1 -0
  286. package/src/components/RadioGroup/RadioGroup.tsx +2 -0
  287. package/src/components/RadioGroup/index.ts +1 -0
  288. package/src/components/RadioGroupField/RadioGroupField.namespace.ts +1 -0
  289. package/src/components/RadioGroupField/RadioGroupField.tsx +5 -3
  290. package/src/components/ResponsiveDialog/ResponsiveDialog.tsx +45 -48
  291. package/src/components/SegmentedControl/SegmentedControl.tsx +3 -3
  292. package/src/components/Select/Select.tsx +7 -6
  293. package/src/components/SelectBox/CheckSelectBox.tsx +28 -10
  294. package/src/components/SelectBox/RadioSelectBox.tsx +28 -10
  295. package/src/components/SelectBox/SelectBox.test.tsx +138 -0
  296. package/src/components/SideNavigation/index.ts +5 -0
  297. package/src/components/SidePanel/SidePanel.tsx +1 -16
  298. package/src/components/Stack/Stack.tsx +0 -12
  299. package/src/components/Stack/index.ts +1 -8
  300. package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.tsx +20 -18
  301. package/src/components/Switch/Switch.namespace.ts +1 -0
  302. package/src/components/Switch/Switch.tsx +6 -3
  303. package/src/components/Switch/index.ts +1 -0
  304. package/src/components/TagGroup/TagGroup.tsx +2 -0
  305. package/src/components/WheelPicker/WheelPicker.test.tsx +53 -44
  306. package/src/components/WheelPicker/WheelPicker.tsx +24 -21
  307. package/src/components/index.ts +2 -12
  308. package/src/index.ts +25 -2
  309. package/src/utils/withContentScale.test.tsx +88 -0
  310. package/src/utils/withContentScale.tsx +48 -0
  311. package/lib/components/ActionChip/ActionChip.cjs +0 -15
  312. package/lib/components/ActionChip/ActionChip.d.ts +0 -23
  313. package/lib/components/ActionChip/ActionChip.d.ts.map +0 -1
  314. package/lib/components/ActionChip/ActionChip.js +0 -14
  315. package/lib/components/ActionChip/index.cjs +0 -3
  316. package/lib/components/ActionChip/index.d.ts +0 -2
  317. package/lib/components/ActionChip/index.d.ts.map +0 -1
  318. package/lib/components/ActionChip/index.js +0 -2
  319. package/lib/components/ActionSheet/ActionSheet.cjs +0 -72
  320. package/lib/components/ActionSheet/ActionSheet.d.ts +0 -113
  321. package/lib/components/ActionSheet/ActionSheet.d.ts.map +0 -1
  322. package/lib/components/ActionSheet/ActionSheet.js +0 -61
  323. package/lib/components/ActionSheet/ActionSheet.namespace.cjs +0 -23
  324. package/lib/components/ActionSheet/ActionSheet.namespace.d.ts +0 -2
  325. package/lib/components/ActionSheet/ActionSheet.namespace.d.ts.map +0 -1
  326. package/lib/components/ActionSheet/ActionSheet.namespace.js +0 -18
  327. package/lib/components/ActionSheet/index.cjs +0 -20
  328. package/lib/components/ActionSheet/index.d.ts +0 -3
  329. package/lib/components/ActionSheet/index.d.ts.map +0 -1
  330. package/lib/components/ActionSheet/index.js +0 -3
  331. package/lib/components/Columns/Columns.cjs +0 -38
  332. package/lib/components/Columns/Columns.d.ts +0 -22
  333. package/lib/components/Columns/Columns.d.ts.map +0 -1
  334. package/lib/components/Columns/Columns.js +0 -35
  335. package/lib/components/Columns/index.cjs +0 -4
  336. package/lib/components/Columns/index.d.ts +0 -2
  337. package/lib/components/Columns/index.d.ts.map +0 -1
  338. package/lib/components/Columns/index.js +0 -2
  339. package/lib/components/ContentDialog/ContentDialog.d.ts +0 -50
  340. package/lib/components/ContentDialog/ContentDialog.d.ts.map +0 -1
  341. package/lib/components/ContentDialog/ContentDialog.namespace.cjs +0 -24
  342. package/lib/components/ContentDialog/ContentDialog.namespace.d.ts +0 -2
  343. package/lib/components/ContentDialog/ContentDialog.namespace.d.ts.map +0 -1
  344. package/lib/components/ContentDialog/ContentDialog.namespace.js +0 -19
  345. package/lib/components/ContentDialog/index.cjs +0 -21
  346. package/lib/components/ContentDialog/index.d.ts +0 -3
  347. package/lib/components/ContentDialog/index.d.ts.map +0 -1
  348. package/lib/components/ContentDialog/index.js +0 -3
  349. package/lib/components/ControlChip/ControlChip.cjs +0 -15
  350. package/lib/components/ControlChip/ControlChip.d.ts +0 -28
  351. package/lib/components/ControlChip/ControlChip.d.ts.map +0 -1
  352. package/lib/components/ControlChip/ControlChip.js +0 -14
  353. package/lib/components/ControlChip/index.cjs +0 -3
  354. package/lib/components/ControlChip/index.d.ts +0 -2
  355. package/lib/components/ControlChip/index.d.ts.map +0 -1
  356. package/lib/components/ControlChip/index.js +0 -2
  357. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.cjs +0 -77
  358. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.d.ts +0 -122
  359. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.d.ts.map +0 -1
  360. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.js +0 -65
  361. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.namespace.cjs +0 -24
  362. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.namespace.d.ts +0 -2
  363. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.namespace.d.ts.map +0 -1
  364. package/lib/components/ExtendedActionSheet/ExtendedActionSheet.namespace.js +0 -19
  365. package/lib/components/ExtendedActionSheet/index.cjs +0 -21
  366. package/lib/components/ExtendedActionSheet/index.d.ts +0 -3
  367. package/lib/components/ExtendedActionSheet/index.d.ts.map +0 -1
  368. package/lib/components/ExtendedActionSheet/index.js +0 -3
  369. package/lib/components/ExtendedFab/ExtendedFab.cjs +0 -16
  370. package/lib/components/ExtendedFab/ExtendedFab.d.ts +0 -13
  371. package/lib/components/ExtendedFab/ExtendedFab.d.ts.map +0 -1
  372. package/lib/components/ExtendedFab/ExtendedFab.js +0 -15
  373. package/lib/components/ExtendedFab/index.cjs +0 -3
  374. package/lib/components/ExtendedFab/index.d.ts +0 -2
  375. package/lib/components/ExtendedFab/index.d.ts.map +0 -1
  376. package/lib/components/ExtendedFab/index.js +0 -2
  377. package/lib/components/Fab/Fab.cjs +0 -13
  378. package/lib/components/Fab/Fab.d.ts +0 -13
  379. package/lib/components/Fab/Fab.d.ts.map +0 -1
  380. package/lib/components/Fab/Fab.js +0 -12
  381. package/lib/components/Fab/index.cjs +0 -3
  382. package/lib/components/Fab/index.d.ts +0 -2
  383. package/lib/components/Fab/index.d.ts.map +0 -1
  384. package/lib/components/Fab/index.js +0 -2
  385. package/lib/components/Inline/Inline.cjs +0 -23
  386. package/lib/components/Inline/Inline.d.ts +0 -12
  387. package/lib/components/Inline/Inline.d.ts.map +0 -1
  388. package/lib/components/Inline/Inline.js +0 -21
  389. package/lib/components/Inline/index.cjs +0 -3
  390. package/lib/components/Inline/index.d.ts +0 -2
  391. package/lib/components/Inline/index.d.ts.map +0 -1
  392. package/lib/components/Inline/index.js +0 -2
  393. package/lib/components/InlineBanner/InlineBanner.cjs +0 -39
  394. package/lib/components/InlineBanner/InlineBanner.d.ts +0 -59
  395. package/lib/components/InlineBanner/InlineBanner.d.ts.map +0 -1
  396. package/lib/components/InlineBanner/InlineBanner.js +0 -33
  397. package/lib/components/InlineBanner/InlineBanner.namespace.cjs +0 -18
  398. package/lib/components/InlineBanner/InlineBanner.namespace.d.ts +0 -2
  399. package/lib/components/InlineBanner/InlineBanner.namespace.d.ts.map +0 -1
  400. package/lib/components/InlineBanner/InlineBanner.namespace.js +0 -13
  401. package/lib/components/InlineBanner/index.cjs +0 -15
  402. package/lib/components/InlineBanner/index.d.ts +0 -3
  403. package/lib/components/InlineBanner/index.d.ts.map +0 -1
  404. package/lib/components/InlineBanner/index.js +0 -3
  405. package/lib/components/LinkContent/LinkContent.cjs +0 -14
  406. package/lib/components/LinkContent/LinkContent.d.ts +0 -14
  407. package/lib/components/LinkContent/LinkContent.d.ts.map +0 -1
  408. package/lib/components/LinkContent/LinkContent.js +0 -13
  409. package/lib/components/LinkContent/index.cjs +0 -3
  410. package/lib/components/LinkContent/index.d.ts +0 -2
  411. package/lib/components/LinkContent/index.d.ts.map +0 -1
  412. package/lib/components/LinkContent/index.js +0 -2
  413. package/lib/components/TimePicker/TimePicker.cjs +0 -97
  414. package/lib/components/TimePicker/TimePicker.d.ts +0 -28
  415. package/lib/components/TimePicker/TimePicker.d.ts.map +0 -1
  416. package/lib/components/TimePicker/TimePicker.js +0 -94
  417. package/lib/components/TimePicker/TimePicker.test.d.ts +0 -2
  418. package/lib/components/TimePicker/TimePicker.test.d.ts.map +0 -1
  419. package/lib/components/TimePicker/index.cjs +0 -3
  420. package/lib/components/TimePicker/index.d.ts +0 -2
  421. package/lib/components/TimePicker/index.d.ts.map +0 -1
  422. package/lib/components/TimePicker/index.js +0 -2
  423. package/lib/components/private/WheelPicker.cjs +0 -63
  424. package/lib/components/private/WheelPicker.d.ts +0 -16
  425. package/lib/components/private/WheelPicker.d.ts.map +0 -1
  426. package/lib/components/private/WheelPicker.js +0 -59
  427. package/lib/components/private/WheelPicker.test.d.ts +0 -2
  428. package/lib/components/private/WheelPicker.test.d.ts.map +0 -1
  429. package/lib/primitive.cjs +0 -154
  430. package/lib/primitive.d.ts +0 -18
  431. package/lib/primitive.d.ts.map +0 -1
  432. package/lib/primitive.js +0 -17
  433. package/src/components/ActionChip/ActionChip.tsx +0 -34
  434. package/src/components/ActionChip/index.ts +0 -4
  435. package/src/components/ActionSheet/ActionSheet.namespace.ts +0 -24
  436. package/src/components/ActionSheet/ActionSheet.tsx +0 -192
  437. package/src/components/ActionSheet/index.ts +0 -26
  438. package/src/components/Columns/Columns.tsx +0 -50
  439. package/src/components/Columns/index.ts +0 -1
  440. package/src/components/ContentDialog/ContentDialog.namespace.ts +0 -26
  441. package/src/components/ContentDialog/ContentDialog.tsx +0 -224
  442. package/src/components/ContentDialog/index.ts +0 -33
  443. package/src/components/ControlChip/ControlChip.tsx +0 -38
  444. package/src/components/ControlChip/index.ts +0 -5
  445. package/src/components/ExtendedActionSheet/ExtendedActionSheet.namespace.ts +0 -26
  446. package/src/components/ExtendedActionSheet/ExtendedActionSheet.tsx +0 -220
  447. package/src/components/ExtendedActionSheet/index.ts +0 -28
  448. package/src/components/ExtendedFab/ExtendedFab.tsx +0 -25
  449. package/src/components/ExtendedFab/index.ts +0 -4
  450. package/src/components/Fab/Fab.tsx +0 -21
  451. package/src/components/Fab/index.ts +0 -4
  452. package/src/components/Inline/Inline.tsx +0 -25
  453. package/src/components/Inline/index.ts +0 -1
  454. package/src/components/InlineBanner/InlineBanner.namespace.ts +0 -14
  455. package/src/components/InlineBanner/InlineBanner.tsx +0 -103
  456. package/src/components/InlineBanner/index.ts +0 -16
  457. package/src/components/LinkContent/LinkContent.tsx +0 -23
  458. package/src/components/LinkContent/index.ts +0 -4
  459. package/src/components/TimePicker/TimePicker.test.tsx +0 -166
  460. package/src/components/TimePicker/TimePicker.tsx +0 -163
  461. package/src/components/TimePicker/index.ts +0 -6
  462. package/src/components/private/WheelPicker.test.tsx +0 -55
  463. package/src/components/private/WheelPicker.tsx +0 -110
  464. package/src/primitive.ts +0 -17
@@ -1,6 +1,5 @@
1
1
  "use client";
2
2
 
3
- import { composeRefs } from "@radix-ui/react-compose-refs";
4
3
  import { datePicker } from "@seed-design/css/recipes/date-picker";
5
4
  import { mergeProps } from "@seed-design/dom-utils";
6
5
  import {
@@ -13,17 +12,20 @@ import {
13
12
  type DatePickerVisibleRange,
14
13
  type UseDatePickerProps,
15
14
  } from "@seed-design/react-date-picker";
15
+ import { Popover as PopoverPrimitive, usePopoverContext } from "@seed-design/react-popover";
16
16
  import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
17
17
  import clsx from "clsx";
18
18
  import * as React from "react";
19
- import { InternalWheelPickerColumn, InternalWheelPickerRoot } from "../private/WheelPicker";
20
- import { useStyleProps, type StyleProps } from "../../utils/styled";
21
- import { ActionButton } from "../ActionButton";
22
- import { Icon } from "../Icon";
19
+ import { ActionButton } from "../ActionButton/ActionButton";
20
+ import { Box, type BoxProps } from "../Box/Box";
21
+ import { Icon } from "../Icon/Icon";
23
22
 
24
- // 44px × 7개 항목으로 308px viewport를 만들고, 336px 컨테이너 안에 중앙 정렬합니다.
25
- const WHEEL_ITEM_SIZE = 44;
26
- const WHEEL_VISIBLE_ITEM_COUNT = 7;
23
+ // Month는 44px × 7개 항목으로 308px viewport를 만들고, 336px 컨테이너 안에 중앙 정렬합니다.
24
+ // Week는 Wheel Picker small 크기(36px × 5개 항목)를 popover 안에 그대로 사용합니다.
25
+ const MONTH_WHEEL_ITEM_SIZE = 44;
26
+ const MONTH_WHEEL_VISIBLE_ITEM_COUNT = 7;
27
+ const MONTH_WHEEL_SCROLL_FOG_SIZE = 102;
28
+ const WEEK_WHEEL_POPOVER_GUTTER = 4;
27
29
 
28
30
  type DatePickerCssProperties = React.CSSProperties & {
29
31
  "--seed-date-picker-continuous-spacer-height"?: string;
@@ -33,8 +35,17 @@ function getContinuousSpacerStyle(height: number): DatePickerCssProperties {
33
35
  return { "--seed-date-picker-continuous-spacer-height": `${height}px` };
34
36
  }
35
37
 
36
- type DatePickerRootProps = PrimitiveProps &
37
- Pick<StyleProps, "height" | "minHeight" | "maxHeight"> &
38
+ function composeRefs<T>(...refs: Array<React.Ref<T> | undefined>) {
39
+ return (value: T | null) => {
40
+ for (const ref of refs) {
41
+ if (typeof ref === "function") ref(value);
42
+ else if (ref) ref.current = value;
43
+ }
44
+ };
45
+ }
46
+
47
+ type DatePickerRootElementProps = PrimitiveProps &
48
+ Pick<BoxProps, "height" | "minHeight" | "maxHeight"> &
38
49
  Omit<
39
50
  React.HTMLAttributes<HTMLDivElement>,
40
51
  "children" | "defaultValue" | "onChange" | "onValueChange"
@@ -66,75 +77,36 @@ type DatePickerCellCustomization =
66
77
  renderDateCellSupplement?: never;
67
78
  };
68
79
 
69
- type DatePickerSharedProps = DatePickerBehaviorProps &
70
- DatePickerRootProps & {
80
+ export type DatePickerRootProps = DatePickerBehaviorProps &
81
+ DatePickerRootElementProps &
82
+ DatePickerCellCustomization & {
83
+ /** Date Picker가 표시할 달력 레이아웃입니다. */
84
+ visibleRange: DatePickerVisibleRange;
85
+
86
+ /** Continuous 레이아웃에서 노출하고 이동할 수 있는 월 범위입니다. */
87
+ monthRange?: DatePickerMonthRange;
88
+
71
89
  /** 날짜 이동과 포커스 action을 받는 ref입니다. */
72
90
  actionsRef?: React.Ref<DatePickerActions>;
73
- } & DatePickerCellCustomization;
74
-
75
- type ContinuousSizeConstraint =
76
- | (Required<Pick<StyleProps, "height">> & Pick<StyleProps, "minHeight" | "maxHeight">)
77
- | (Required<Pick<StyleProps, "minHeight">> & Pick<StyleProps, "height" | "maxHeight">)
78
- | (Required<Pick<StyleProps, "maxHeight">> & Pick<StyleProps, "height" | "minHeight">);
79
-
80
- export type DatePickerProps = DatePickerSharedProps;
81
- export type TwoMonthDatePickerProps = DatePickerSharedProps;
82
- export type WeekDatePickerProps = DatePickerSharedProps;
83
- type DatePickerPropsWithoutSize<Props = DatePickerSharedProps> = Props extends DatePickerSharedProps
84
- ? Omit<Props, "height" | "minHeight" | "maxHeight">
85
- : never;
86
- export type ContinuousDatePickerProps = DatePickerPropsWithoutSize &
87
- ContinuousSizeConstraint & {
88
- /**
89
- * 노출하고 이동할 수 있는 월 범위입니다. 양끝 월을 포함합니다.
90
- * 생략하면 `yearRange.start`의 1월부터 `yearRange.end`의 12월까지 노출합니다.
91
- */
92
- monthRange?: DatePickerMonthRange;
93
- };
94
91
 
95
- type DatePickerImplementationProps = DatePickerSharedProps & {
96
- visibleRange: DatePickerVisibleRange;
97
- monthRange?: DatePickerMonthRange;
98
- };
92
+ children?: React.ReactNode;
93
+ };
99
94
 
100
- type NavigationChevronIconProps = React.SVGProps<SVGSVGElement> & {
101
- direction: "left" | "right";
95
+ type DatePickerContextValue = {
96
+ api: ReturnType<typeof useDatePicker>;
97
+ classNames: ReturnType<typeof datePicker>;
98
+ renderDateCellContent: DatePickerRootProps["renderDateCellContent"];
99
+ renderDateCellSupplement: DatePickerRootProps["renderDateCellSupplement"];
102
100
  };
103
101
 
104
- const NavigationChevronIcon = React.forwardRef<SVGSVGElement, NavigationChevronIconProps>(
105
- ({ direction, ...props }, ref) => {
106
- const path =
107
- direction === "left"
108
- ? "M22.7931 13.0704C23.0788 13.3703 23.0672 13.8451 22.7673 14.1307L16.5875 20.0166L22.7672 25.9017C23.0672 26.1873 23.0788 26.6621 22.7931 26.962C22.5075 27.262 22.0327 27.2736 21.7328 26.9879L14.9828 20.5598C14.8341 20.4182 14.75 20.2219 14.75 20.0167C14.75 19.8114 14.8341 19.6151 14.9827 19.4736L21.7327 13.0446C22.0327 12.7589 22.5074 12.7704 22.7931 13.0704Z"
109
- : "M17.2069 13.0704C16.9212 13.3703 16.9328 13.8451 17.2327 14.1307L23.4125 20.0166L17.2328 25.9017C16.9328 26.1873 16.9212 26.6621 17.2069 26.962C17.4925 27.262 17.9673 27.2736 18.2672 26.9879L25.0172 20.5598C25.1659 20.4182 25.25 20.2219 25.25 20.0167C25.25 19.8114 25.1659 19.6151 25.0173 19.4736L18.2673 13.0446C17.9673 12.7589 17.4926 12.7704 17.2069 13.0704Z";
110
-
111
- return (
112
- <svg ref={ref} {...props} viewBox="8 8 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
113
- <path fillRule="evenodd" clipRule="evenodd" d={path} fill="currentColor" />
114
- </svg>
115
- );
116
- },
117
- );
118
- NavigationChevronIcon.displayName = "NavigationChevronIcon";
102
+ const DatePickerContext = React.createContext<DatePickerContextValue | null>(null);
119
103
 
120
- type HeaderChevronIconProps = React.SVGProps<SVGSVGElement> & {
121
- expanded: boolean;
122
- };
123
-
124
- const HeaderChevronIcon = React.forwardRef<SVGSVGElement, HeaderChevronIconProps>(
125
- ({ expanded, ...props }, ref) => (
126
- <svg ref={ref} {...props} viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
127
- <path
128
- fillRule="evenodd"
129
- clipRule="evenodd"
130
- d="M5.2453 7.74286C5.57141 7.4181 6.09905 7.41919 6.42381 7.7453L9.98736 11.3237L13.5808 7.77134C13.9081 7.44778 14.4357 7.45081 14.7593 7.77812C15.0829 8.10542 15.0798 8.63305 14.7525 8.95661L10.5686 13.0926C10.2422 13.4154 9.7162 13.4133 9.39228 13.088L5.24286 8.92137C4.9181 8.59526 4.91919 8.06762 5.2453 7.74286Z"
131
- fill="currentColor"
132
- transform={expanded ? "rotate(180 10 10)" : undefined}
133
- />
134
- </svg>
135
- ),
136
- );
137
- HeaderChevronIcon.displayName = "HeaderChevronIcon";
104
+ function useDatePickerContext() {
105
+ const context = React.useContext(DatePickerContext);
106
+ if (!context)
107
+ throw new Error("DatePicker compound components must be used within DatePicker.Root");
108
+ return context;
109
+ }
138
110
 
139
111
  function WeekdayRow({
140
112
  api,
@@ -173,8 +145,8 @@ function DateCellView({
173
145
  }: {
174
146
  cell: DatePickerCell | null;
175
147
  classNames: ReturnType<typeof datePicker>;
176
- renderDateCellContent: DatePickerImplementationProps["renderDateCellContent"];
177
- renderDateCellSupplement: DatePickerImplementationProps["renderDateCellSupplement"];
148
+ renderDateCellContent: DatePickerRootProps["renderDateCellContent"];
149
+ renderDateCellSupplement: DatePickerRootProps["renderDateCellSupplement"];
178
150
  }) {
179
151
  if (cell === null) {
180
152
  return <Primitive.div role="gridcell" className={classNames.emptyCell} />;
@@ -214,8 +186,8 @@ function MonthView({
214
186
  api: ReturnType<typeof useDatePicker>;
215
187
  classNames: ReturnType<typeof datePicker>;
216
188
  month: DatePickerMonth;
217
- renderDateCellContent: DatePickerImplementationProps["renderDateCellContent"];
218
- renderDateCellSupplement: DatePickerImplementationProps["renderDateCellSupplement"];
189
+ renderDateCellContent: DatePickerRootProps["renderDateCellContent"];
190
+ renderDateCellSupplement: DatePickerRootProps["renderDateCellSupplement"];
219
191
  showWeekdays: boolean;
220
192
  showMonthLabel: boolean;
221
193
  renderHeader?: (labelId: string) => React.ReactNode;
@@ -267,56 +239,69 @@ function MonthView({
267
239
  }
268
240
 
269
241
  function NavigationButton({
270
- direction,
242
+ icon,
271
243
  className,
272
244
  ...props
273
245
  }: Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color"> & {
274
- direction: "left" | "right";
246
+ icon: React.ReactNode;
275
247
  }) {
276
248
  return (
277
249
  <ActionButton {...props} variant="ghost" size="medium" layout="iconOnly" className={className}>
278
- <Icon svg={<NavigationChevronIcon direction={direction} />} />
250
+ <Icon svg={icon} />
279
251
  </ActionButton>
280
252
  );
281
253
  }
282
254
 
283
- function Header({
284
- api,
285
- classNames,
286
- }: {
287
- api: ReturnType<typeof useDatePicker>;
288
- classNames: ReturnType<typeof datePicker>;
289
- }) {
290
- const previousDirection = api.isRtl ? "right" : "left";
291
- const nextDirection = api.isRtl ? "left" : "right";
255
+ export interface DatePickerHeaderProps {
256
+ leftIcon: React.ReactNode;
257
+ rightIcon: React.ReactNode;
258
+ headerIcon: React.ReactNode;
259
+ }
292
260
 
293
- return (
294
- <Primitive.div className={classNames.header}>
295
- <Primitive.button
296
- {...api.monthYearButtonProps}
297
- id={`${api.rootProps.id}-header-label`}
298
- className={classNames.headerLabel}
299
- >
300
- <Primitive.span data-date-picker-header-label="">{api.headerLabel}</Primitive.span>
301
- <Primitive.span className={classNames.headerChevron}>
302
- <Icon svg={<HeaderChevronIcon expanded={api.isWheelOpen} />} />
303
- </Primitive.span>
304
- </Primitive.button>
305
- <Primitive.div className={classNames.navigation}>
306
- <NavigationButton
307
- {...api.previousButtonProps}
308
- direction={previousDirection}
309
- className={classNames.navigationButton}
310
- />
311
- <NavigationButton
312
- {...api.nextButtonProps}
313
- direction={nextDirection}
314
- className={classNames.navigationButton}
315
- />
261
+ export const DatePickerHeader = React.forwardRef<HTMLDivElement, DatePickerHeaderProps>(
262
+ ({ leftIcon, rightIcon, headerIcon }, ref) => {
263
+ const { api, classNames } = useDatePickerContext();
264
+ // Week의 연·월 Wheel popover는 제목 버튼에 붙습니다.
265
+ const popover = usePopoverContext();
266
+
267
+ if (api.visibleRange === "continuous" || api.visibleRange === "twoMonths") return null;
268
+
269
+ const previousIcon = api.isRtl ? rightIcon : leftIcon;
270
+ const nextIcon = api.isRtl ? leftIcon : rightIcon;
271
+
272
+ return (
273
+ <Primitive.div ref={ref} className={classNames.header}>
274
+ <Primitive.button
275
+ ref={popover.refs.anchor}
276
+ {...api.monthYearButtonProps}
277
+ id={`${api.rootProps.id}-header-label`}
278
+ className={classNames.headerLabel}
279
+ >
280
+ <Primitive.span data-date-picker-header-label="">{api.headerLabel}</Primitive.span>
281
+ <Primitive.span
282
+ data-expanded={api.isWheelOpen ? "" : undefined}
283
+ className={classNames.headerChevron}
284
+ >
285
+ <Icon svg={headerIcon} />
286
+ </Primitive.span>
287
+ </Primitive.button>
288
+ <Primitive.div className={classNames.navigation}>
289
+ <NavigationButton
290
+ {...api.previousButtonProps}
291
+ icon={previousIcon}
292
+ className={classNames.navigationButton}
293
+ />
294
+ <NavigationButton
295
+ {...api.nextButtonProps}
296
+ icon={nextIcon}
297
+ className={classNames.navigationButton}
298
+ />
299
+ </Primitive.div>
316
300
  </Primitive.div>
317
- </Primitive.div>
318
- );
319
- }
301
+ );
302
+ },
303
+ );
304
+ DatePickerHeader.displayName = "DatePickerHeader";
320
305
 
321
306
  function TwoMonthHeader({
322
307
  api,
@@ -324,12 +309,16 @@ function TwoMonthHeader({
324
309
  label,
325
310
  labelId,
326
311
  position,
312
+ leftIcon,
313
+ rightIcon,
327
314
  }: {
328
315
  api: ReturnType<typeof useDatePicker>;
329
316
  classNames: ReturnType<typeof datePicker>;
330
317
  label: string;
331
318
  labelId: string;
332
319
  position: "first" | "last";
320
+ leftIcon: React.ReactNode;
321
+ rightIcon: React.ReactNode;
333
322
  }) {
334
323
  const isFirst = position === "first";
335
324
  const direction = api.isRtl ? (isFirst ? "right" : "left") : isFirst ? "left" : "right";
@@ -342,7 +331,7 @@ function TwoMonthHeader({
342
331
  </Primitive.div>
343
332
  <NavigationButton
344
333
  {...buttonProps}
345
- direction={direction}
334
+ icon={direction === "left" ? leftIcon : rightIcon}
346
335
  data-placement={isFirst ? "start" : "end"}
347
336
  className={classNames.twoMonthNavigationButton}
348
337
  />
@@ -350,52 +339,194 @@ function TwoMonthHeader({
350
339
  );
351
340
  }
352
341
 
353
- function WheelView({
354
- api,
355
- classNames,
356
- }: {
357
- api: ReturnType<typeof useDatePicker>;
358
- classNames: ReturnType<typeof datePicker>;
359
- }) {
360
- return (
361
- <Primitive.div className={classNames.wheelContainer}>
362
- <InternalWheelPickerRoot
363
- {...api.wheelProps}
364
- itemSize={WHEEL_ITEM_SIZE}
365
- visibleItemCount={WHEEL_VISIBLE_ITEM_COUNT}
366
- disabled={api.disabled}
367
- readOnly={api.readOnly}
368
- aria-label={api.headerLabel}
369
- className={classNames.wheelView}
370
- columnsClassName={classNames.wheelColumns}
371
- scrollFogClassName={classNames.wheelScrollFog}
372
- selectionIndicatorClassName={classNames.wheelSelectionIndicator}
373
- fogSize={102}
374
- >
375
- <InternalWheelPickerColumn
376
- aria-label={api.ariaLabels.yearWheel}
377
- className={classNames.yearColumn}
378
- itemClassName={classNames.wheelItem}
379
- options={api.wheel.yearOptions}
380
- value={api.wheel.yearValue}
381
- onValueChange={api.wheel.onYearValueChange}
382
- loop={false}
383
- />
384
- <InternalWheelPickerColumn
385
- aria-label={api.ariaLabels.monthWheel}
386
- className={classNames.monthColumn}
387
- itemClassName={classNames.wheelItem}
388
- options={api.wheel.monthOptions}
389
- value={api.wheel.monthValue}
390
- onValueChange={api.wheel.onMonthValueChange}
391
- loop
392
- />
393
- </InternalWheelPickerRoot>
394
- </Primitive.div>
395
- );
342
+ export interface DatePickerWheelColumn {
343
+ id: "year" | "month";
344
+ "aria-label": string;
345
+ className: string;
346
+ options: readonly { value: string; label: React.ReactNode }[];
347
+ value: string;
348
+ onValueChange: (value: string) => void;
349
+ loop: boolean;
396
350
  }
397
351
 
398
- const DatePickerImplementation = React.forwardRef<HTMLDivElement, DatePickerImplementationProps>(
352
+ export interface DatePickerWheelRenderProps {
353
+ rootProps: React.HTMLAttributes<HTMLDivElement> & {
354
+ /** Month는 `medium`, Week popover는 `small` 크기를 사용합니다. */
355
+ size: "small" | "medium";
356
+ itemSize?: number;
357
+ visibleItemCount?: number;
358
+ disabled: boolean;
359
+ readOnly: boolean;
360
+ scrollFogSize?: number;
361
+ };
362
+ columns: readonly DatePickerWheelColumn[];
363
+ }
364
+
365
+ export interface DatePickerWheelProps {
366
+ children: (props: DatePickerWheelRenderProps) => React.ReactNode;
367
+ }
368
+
369
+ export const DatePickerWheel = React.forwardRef<HTMLDivElement, DatePickerWheelProps>(
370
+ ({ children }, ref) => {
371
+ const { api, classNames } = useDatePickerContext();
372
+
373
+ if (!api.isWheelOpen || api.visibleRange === "twoMonths" || api.visibleRange === "continuous") {
374
+ return null;
375
+ }
376
+
377
+ const columns: readonly DatePickerWheelColumn[] = [
378
+ {
379
+ id: "year",
380
+ "aria-label": api.ariaLabels.yearWheel,
381
+ className: classNames.yearColumn,
382
+ options: api.wheel.yearOptions,
383
+ value: api.wheel.yearValue,
384
+ onValueChange: api.wheel.onYearValueChange,
385
+ loop: false,
386
+ },
387
+ {
388
+ id: "month",
389
+ "aria-label": api.ariaLabels.monthWheel,
390
+ className: classNames.monthColumn,
391
+ options: api.wheel.monthOptions,
392
+ value: api.wheel.monthValue,
393
+ onValueChange: api.wheel.onMonthValueChange,
394
+ loop: true,
395
+ },
396
+ ];
397
+
398
+ const sharedRootProps = {
399
+ ...api.wheelProps,
400
+ disabled: api.disabled,
401
+ readOnly: api.readOnly,
402
+ "aria-label": api.headerLabel,
403
+ className: classNames.wheelView,
404
+ };
405
+
406
+ if (api.visibleRange === "week") {
407
+ // Popover가 Escape·바깥 누르기·상위 layer 닫힘과 focus 이동·복귀를 맡습니다.
408
+ return (
409
+ <PopoverPrimitive.Positioner className={classNames.wheelPositioner}>
410
+ <PopoverPrimitive.Content
411
+ ref={ref}
412
+ aria-labelledby={`${api.rootProps.id}-header-label`}
413
+ className={classNames.wheelPopover}
414
+ >
415
+ {children({ rootProps: { ...sharedRootProps, size: "small" }, columns })}
416
+ </PopoverPrimitive.Content>
417
+ </PopoverPrimitive.Positioner>
418
+ );
419
+ }
420
+
421
+ return (
422
+ <Primitive.div ref={ref} className={classNames.wheelContainer}>
423
+ {children({
424
+ rootProps: {
425
+ ...sharedRootProps,
426
+ size: "medium",
427
+ itemSize: MONTH_WHEEL_ITEM_SIZE,
428
+ visibleItemCount: MONTH_WHEEL_VISIBLE_ITEM_COUNT,
429
+ scrollFogSize: MONTH_WHEEL_SCROLL_FOG_SIZE,
430
+ },
431
+ columns,
432
+ })}
433
+ </Primitive.div>
434
+ );
435
+ },
436
+ );
437
+ DatePickerWheel.displayName = "DatePickerWheel";
438
+
439
+ export interface DatePickerCalendarProps {
440
+ leftIcon: React.ReactNode;
441
+ rightIcon: React.ReactNode;
442
+ }
443
+
444
+ export const DatePickerCalendar = React.forwardRef<HTMLDivElement, DatePickerCalendarProps>(
445
+ ({ leftIcon, rightIcon }, ref) => {
446
+ const { api, classNames, renderDateCellContent, renderDateCellSupplement } =
447
+ useDatePickerContext();
448
+
449
+ if (api.visibleRange === "continuous") {
450
+ return (
451
+ <Primitive.div
452
+ ref={composeRefs(ref, api.refs.continuousScroll)}
453
+ {...api.continuousScrollProps}
454
+ data-date-picker-continuous-scroll=""
455
+ className={classNames.continuousScroll}
456
+ >
457
+ <WeekdayRow api={api} classNames={classNames} semantic={false} />
458
+ <Primitive.div className={classNames.continuousContent}>
459
+ <Primitive.div
460
+ aria-hidden="true"
461
+ data-date-picker-continuous-spacer=""
462
+ className={classNames.continuousSpacer}
463
+ style={getContinuousSpacerStyle(api.virtual.topHeight)}
464
+ />
465
+ {api.months.map((month) => (
466
+ <MonthView
467
+ key={month.key}
468
+ api={api}
469
+ classNames={classNames}
470
+ month={month}
471
+ renderDateCellContent={renderDateCellContent}
472
+ renderDateCellSupplement={renderDateCellSupplement}
473
+ showWeekdays={false}
474
+ showMonthLabel
475
+ monthRef={api.refs.continuousMonth(month.key)}
476
+ />
477
+ ))}
478
+ <Primitive.div
479
+ aria-hidden="true"
480
+ data-date-picker-continuous-spacer=""
481
+ className={classNames.continuousSpacer}
482
+ style={getContinuousSpacerStyle(api.virtual.bottomHeight)}
483
+ />
484
+ </Primitive.div>
485
+ </Primitive.div>
486
+ );
487
+ }
488
+
489
+ return (
490
+ <Primitive.div
491
+ ref={ref}
492
+ data-wheel-open={api.isWheelOpen && api.visibleRange === "month" ? "" : undefined}
493
+ aria-hidden={api.isWheelOpen && api.visibleRange === "month" ? true : undefined}
494
+ className={classNames.months}
495
+ >
496
+ {api.months.map((month, index) => (
497
+ <MonthView
498
+ key={month.key}
499
+ api={api}
500
+ classNames={classNames}
501
+ month={month}
502
+ renderDateCellContent={renderDateCellContent}
503
+ renderDateCellSupplement={renderDateCellSupplement}
504
+ showWeekdays
505
+ showMonthLabel={false}
506
+ renderHeader={
507
+ api.visibleRange === "twoMonths"
508
+ ? (labelId) => (
509
+ <TwoMonthHeader
510
+ api={api}
511
+ classNames={classNames}
512
+ label={month.label}
513
+ labelId={labelId}
514
+ position={index === 0 ? "first" : "last"}
515
+ leftIcon={leftIcon}
516
+ rightIcon={rightIcon}
517
+ />
518
+ )
519
+ : undefined
520
+ }
521
+ />
522
+ ))}
523
+ </Primitive.div>
524
+ );
525
+ },
526
+ );
527
+ DatePickerCalendar.displayName = "DatePickerCalendar";
528
+
529
+ export const DatePickerRoot = React.forwardRef<HTMLDivElement, DatePickerRootProps>(
399
530
  (props, forwardedRef) => {
400
531
  const api = useDatePicker(props);
401
532
  const [variantProps, otherProps] = datePicker.splitVariantProps(props);
@@ -404,6 +535,7 @@ const DatePickerImplementation = React.forwardRef<HTMLDivElement, DatePickerImpl
404
535
  visibleRange: api.visibleRange,
405
536
  });
406
537
  const {
538
+ children,
407
539
  renderDateCellContent,
408
540
  renderDateCellSupplement,
409
541
  actionsRef,
@@ -427,17 +559,20 @@ const DatePickerImplementation = React.forwardRef<HTMLDivElement, DatePickerImpl
427
559
  className,
428
560
  "aria-label": ariaLabel,
429
561
  "aria-labelledby": ariaLabelledby,
430
- ...styleAndRootProps
562
+ height,
563
+ minHeight,
564
+ maxHeight,
565
+ ...rootProps
431
566
  } = otherProps;
432
- const { style: styleProps, restProps: rootProps } = useStyleProps(styleAndRootProps);
433
- const rootRef = React.useRef<HTMLDivElement | null>(null);
434
567
  const hasContinuousSizeConstraint =
435
568
  props.height !== undefined || props.minHeight !== undefined || props.maxHeight !== undefined;
436
569
 
437
570
  React.useEffect(() => {
438
571
  if (process.env.NODE_ENV === "production" || api.visibleRange !== "continuous") return;
439
572
  if (!hasContinuousSizeConstraint) {
440
- console.warn("ContinuousDatePicker: height, minHeight 또는 maxHeight가 필요합니다.");
573
+ console.warn(
574
+ "DatePicker.Root: continuous에서는 height, minHeight 또는 maxHeight가 필요합니다.",
575
+ );
441
576
  }
442
577
  }, [api.visibleRange, hasContinuousSizeConstraint]);
443
578
 
@@ -446,130 +581,38 @@ const DatePickerImplementation = React.forwardRef<HTMLDivElement, DatePickerImpl
446
581
  const rootAriaLabel = ariaLabelledby ? ariaLabel : (ariaLabel ?? api.ariaLabels.root);
447
582
 
448
583
  return (
449
- <Primitive.div
450
- ref={composeRefs(forwardedRef, rootRef, api.refs.root)}
451
- {...mergeProps(api.rootProps, rootProps)}
452
- aria-label={rootAriaLabel}
453
- aria-labelledby={ariaLabelledby}
454
- className={clsx(classNames.root, className)}
455
- style={styleProps}
584
+ <DatePickerContext.Provider
585
+ value={{ api, classNames, renderDateCellContent, renderDateCellSupplement }}
456
586
  >
457
- {api.visibleRange === "continuous" ? (
458
- <Primitive.div
459
- ref={api.refs.continuousScroll}
460
- {...api.continuousScrollProps}
461
- data-date-picker-continuous-scroll=""
462
- className={classNames.continuousScroll}
587
+ <PopoverPrimitive.Root
588
+ open={api.visibleRange === "week" && api.isWheelOpen}
589
+ // 바깥 누르기·Escape로 닫아도 제목 버튼으로 닫을 때처럼 고른 월을 반영합니다.
590
+ onOpenChange={(open) => {
591
+ if (!open) api.closeWheel();
592
+ }}
593
+ placement="bottom-start"
594
+ gutter={WEEK_WHEEL_POPOVER_GUTTER}
595
+ >
596
+ <Box
597
+ ref={composeRefs(forwardedRef, api.refs.root)}
598
+ {...mergeProps(api.rootProps, rootProps)}
599
+ aria-label={rootAriaLabel}
600
+ aria-labelledby={ariaLabelledby}
601
+ className={clsx(classNames.root, className)}
602
+ height={height}
603
+ minHeight={minHeight}
604
+ maxHeight={maxHeight}
463
605
  >
464
- <WeekdayRow api={api} classNames={classNames} semantic={false} />
465
- <Primitive.div className={classNames.continuousContent}>
466
- <Primitive.div
467
- aria-hidden="true"
468
- data-date-picker-continuous-spacer=""
469
- className={classNames.continuousSpacer}
470
- style={getContinuousSpacerStyle(api.virtual.topHeight)}
471
- />
472
- {api.months.map((month) => (
473
- <MonthView
474
- key={month.key}
475
- api={api}
476
- classNames={classNames}
477
- month={month}
478
- renderDateCellContent={renderDateCellContent}
479
- renderDateCellSupplement={renderDateCellSupplement}
480
- showWeekdays={false}
481
- showMonthLabel
482
- monthRef={api.refs.continuousMonth(month.key)}
483
- />
484
- ))}
485
- <Primitive.div
486
- aria-hidden="true"
487
- data-date-picker-continuous-spacer=""
488
- className={classNames.continuousSpacer}
489
- style={getContinuousSpacerStyle(api.virtual.bottomHeight)}
490
- />
491
- </Primitive.div>
492
- </Primitive.div>
493
- ) : (
494
- <>
495
- {api.visibleRange !== "twoMonths" && <Header api={api} classNames={classNames} />}
496
- <Primitive.div
497
- data-wheel-open={api.isWheelOpen && api.visibleRange !== "twoMonths" ? "" : undefined}
498
- aria-hidden={api.isWheelOpen && api.visibleRange !== "twoMonths" ? true : undefined}
499
- className={classNames.months}
500
- >
501
- {api.months.map((month, index) => (
502
- <MonthView
503
- key={month.key}
504
- api={api}
505
- classNames={classNames}
506
- month={month}
507
- renderDateCellContent={renderDateCellContent}
508
- renderDateCellSupplement={renderDateCellSupplement}
509
- showWeekdays
510
- showMonthLabel={false}
511
- renderHeader={
512
- api.visibleRange === "twoMonths"
513
- ? (labelId) => (
514
- <TwoMonthHeader
515
- api={api}
516
- classNames={classNames}
517
- label={month.label}
518
- labelId={labelId}
519
- position={index === 0 ? "first" : "last"}
520
- />
521
- )
522
- : undefined
523
- }
524
- />
525
- ))}
526
- </Primitive.div>
527
- {api.isWheelOpen && api.visibleRange !== "twoMonths" && (
528
- <WheelView api={api} classNames={classNames} />
529
- )}
530
- </>
531
- )}
532
- <Primitive.span {...api.liveRegionProps} className={classNames.liveRegion}>
533
- {api.headerLabel}
534
- </Primitive.span>
535
- </Primitive.div>
606
+ {children}
607
+ <Primitive.span {...api.liveRegionProps} className={classNames.liveRegion}>
608
+ {api.headerLabel}
609
+ </Primitive.span>
610
+ </Box>
611
+ </PopoverPrimitive.Root>
612
+ </DatePickerContext.Provider>
536
613
  );
537
614
  },
538
615
  );
539
- DatePickerImplementation.displayName = "DatePickerImplementation";
616
+ DatePickerRoot.displayName = "DatePickerRoot";
540
617
 
541
- export const DatePicker = React.forwardRef<HTMLDivElement, DatePickerProps>((props, ref) => (
542
- <DatePickerImplementation ref={ref} {...props} visibleRange="month" />
543
- ));
544
- DatePicker.displayName = "DatePicker";
545
-
546
- export const TwoMonthDatePicker = React.forwardRef<HTMLDivElement, TwoMonthDatePickerProps>(
547
- (props, ref) => <DatePickerImplementation ref={ref} {...props} visibleRange="twoMonths" />,
548
- );
549
- TwoMonthDatePicker.displayName = "TwoMonthDatePicker";
550
-
551
- export const WeekDatePicker = React.forwardRef<HTMLDivElement, WeekDatePickerProps>(
552
- (props, ref) => <DatePickerImplementation ref={ref} {...props} visibleRange="week" />,
553
- );
554
- WeekDatePicker.displayName = "WeekDatePicker";
555
-
556
- export const ContinuousDatePicker = React.forwardRef<HTMLDivElement, ContinuousDatePickerProps>(
557
- (props, ref) => <DatePickerImplementation ref={ref} {...props} visibleRange="continuous" />,
558
- );
559
- ContinuousDatePicker.displayName = "ContinuousDatePicker";
560
-
561
- export type {
562
- DatePickerActions,
563
- DatePickerAriaLabels,
564
- DatePickerConstraint,
565
- DatePickerConstraintContext,
566
- DatePickerDate,
567
- DatePickerMonthRange,
568
- DatePickerMultipleProps,
569
- DatePickerRangeProps,
570
- DatePickerRangeValue,
571
- DatePickerSelectionMode,
572
- DatePickerSingleProps,
573
- DatePickerValue,
574
- DatePickerYearMonth,
575
- } from "@seed-design/react-date-picker";
618
+ export type { DatePickerActions } from "@seed-design/react-date-picker";