@stokelp/ui 2.127.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 (698) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_rolldown/runtime.cjs +1 -1
  3. package/dist/_virtual/_rolldown/runtime.js +4 -5
  4. package/dist/components/accordion/Accordion.cjs +1 -1
  5. package/dist/components/accordion/Accordion.cjs.map +1 -1
  6. package/dist/components/accordion/Accordion.d.ts +1 -1
  7. package/dist/components/accordion/Accordion.js +1 -2
  8. package/dist/components/accordion/Accordion.js.map +1 -1
  9. package/dist/components/action-card/ActionCard.cjs.map +1 -1
  10. package/dist/components/action-card/ActionCard.d.ts +1 -1
  11. package/dist/components/action-card/ActionCard.js +1 -2
  12. package/dist/components/action-card/ActionCard.js.map +1 -1
  13. package/dist/components/alert/Alert.cjs.map +1 -1
  14. package/dist/components/alert/Alert.d.ts +1 -1
  15. package/dist/components/alert/Alert.js +1 -2
  16. package/dist/components/alert/Alert.js.map +1 -1
  17. package/dist/components/app/mobile-card/MobileCardEntityRow.cjs.map +1 -1
  18. package/dist/components/app/mobile-card/MobileCardEntityRow.d.ts +1 -1
  19. package/dist/components/app/mobile-card/MobileCardEntityRow.js +1 -2
  20. package/dist/components/app/mobile-card/MobileCardEntityRow.js.map +1 -1
  21. package/dist/components/app/mobile-card/MobileCardHeader.cjs.map +1 -1
  22. package/dist/components/app/mobile-card/MobileCardHeader.d.ts +1 -1
  23. package/dist/components/app/mobile-card/MobileCardHeader.js +1 -2
  24. package/dist/components/app/mobile-card/MobileCardHeader.js.map +1 -1
  25. package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs +1 -1
  26. package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs.map +1 -1
  27. package/dist/components/app/mobile-card/MobileCardNotificationBadge.d.ts +1 -1
  28. package/dist/components/app/mobile-card/MobileCardNotificationBadge.js +2 -3
  29. package/dist/components/app/mobile-card/MobileCardNotificationBadge.js.map +1 -1
  30. package/dist/components/app/mobile-card/MobileCardShell.cjs.map +1 -1
  31. package/dist/components/app/mobile-card/MobileCardShell.d.ts +1 -1
  32. package/dist/components/app/mobile-card/MobileCardShell.js +1 -2
  33. package/dist/components/app/mobile-card/MobileCardShell.js.map +1 -1
  34. package/dist/components/app/mobile-card/MobileCardSkeleton.cjs.map +1 -1
  35. package/dist/components/app/mobile-card/MobileCardSkeleton.d.ts +3 -3
  36. package/dist/components/app/mobile-card/MobileCardSkeleton.js +1 -2
  37. package/dist/components/app/mobile-card/MobileCardSkeleton.js.map +1 -1
  38. package/dist/components/app/mobile-navigation/MobileNavigation.cjs +1 -1
  39. package/dist/components/app/mobile-navigation/MobileNavigation.cjs.map +1 -1
  40. package/dist/components/app/mobile-navigation/MobileNavigation.js +2 -3
  41. package/dist/components/app/mobile-navigation/MobileNavigation.js.map +1 -1
  42. package/dist/components/app/navigation/AppNavigation.cjs +1 -1
  43. package/dist/components/app/navigation/AppNavigation.cjs.map +1 -1
  44. package/dist/components/app/navigation/AppNavigation.js +3 -4
  45. package/dist/components/app/navigation/AppNavigation.js.map +1 -1
  46. package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs +1 -1
  47. package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs.map +1 -1
  48. package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js +5 -6
  49. package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js.map +1 -1
  50. package/dist/components/app/price-tag/PriceTag.cjs.map +1 -1
  51. package/dist/components/app/price-tag/PriceTag.d.ts +3 -5
  52. package/dist/components/app/price-tag/PriceTag.js +1 -2
  53. package/dist/components/app/price-tag/PriceTag.js.map +1 -1
  54. package/dist/components/app/product-card-catalog/styled.cjs +1 -1
  55. package/dist/components/app/product-card-catalog/styled.cjs.map +1 -1
  56. package/dist/components/app/product-card-catalog/styled.d.ts +1 -1
  57. package/dist/components/app/product-card-catalog/styled.js +2 -3
  58. package/dist/components/app/product-card-catalog/styled.js.map +1 -1
  59. package/dist/components/avatar/styled.cjs +1 -1
  60. package/dist/components/avatar/styled.cjs.map +1 -1
  61. package/dist/components/avatar/styled.d.ts +4 -7
  62. package/dist/components/avatar/styled.js +2 -3
  63. package/dist/components/avatar/styled.js.map +1 -1
  64. package/dist/components/box/Box.cjs +1 -1
  65. package/dist/components/box/Box.cjs.map +1 -1
  66. package/dist/components/box/Box.d.ts +1 -1
  67. package/dist/components/box/Box.js +3 -4
  68. package/dist/components/box/Box.js.map +1 -1
  69. package/dist/components/breadcrumb/Breadcrumb.cjs.map +1 -1
  70. package/dist/components/breadcrumb/Breadcrumb.js +1 -2
  71. package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
  72. package/dist/components/button/Button.cjs.map +1 -1
  73. package/dist/components/button/Button.js +1 -2
  74. package/dist/components/button/Button.js.map +1 -1
  75. package/dist/components/button-filter/ButtonFilter.cjs.map +1 -1
  76. package/dist/components/button-filter/ButtonFilter.d.ts +4 -5
  77. package/dist/components/button-filter/ButtonFilter.js +1 -2
  78. package/dist/components/button-filter/ButtonFilter.js.map +1 -1
  79. package/dist/components/chat/Chat.cjs +1 -1
  80. package/dist/components/chat/Chat.cjs.map +1 -1
  81. package/dist/components/chat/Chat.d.ts +4 -8
  82. package/dist/components/chat/Chat.js +2 -3
  83. package/dist/components/chat/Chat.js.map +1 -1
  84. package/dist/components/chat/ChatDocumentMessage.cjs +1 -1
  85. package/dist/components/chat/ChatDocumentMessage.cjs.map +1 -1
  86. package/dist/components/chat/ChatDocumentMessage.js +3 -4
  87. package/dist/components/chat/ChatDocumentMessage.js.map +1 -1
  88. package/dist/components/chat/ChatMessage.cjs.map +1 -1
  89. package/dist/components/chat/ChatMessage.d.ts +4 -7
  90. package/dist/components/chat/ChatMessage.js +1 -2
  91. package/dist/components/chat/ChatMessage.js.map +1 -1
  92. package/dist/components/chat/ChatProfileAvatar.cjs.map +1 -1
  93. package/dist/components/chat/ChatProfileAvatar.js +1 -2
  94. package/dist/components/chat/ChatProfileAvatar.js.map +1 -1
  95. package/dist/components/chat/ChatScoreBreakdown.cjs.map +1 -1
  96. package/dist/components/chat/ChatScoreBreakdown.d.ts +1 -1
  97. package/dist/components/chat/ChatScoreBreakdown.js +1 -2
  98. package/dist/components/chat/ChatScoreBreakdown.js.map +1 -1
  99. package/dist/components/chat/ChatTextInput.cjs.map +1 -1
  100. package/dist/components/chat/ChatTextInput.js +1 -2
  101. package/dist/components/chat/ChatTextInput.js.map +1 -1
  102. package/dist/components/checkbox/Checkbox.cjs.map +1 -1
  103. package/dist/components/checkbox/Checkbox.js +1 -2
  104. package/dist/components/checkbox/Checkbox.js.map +1 -1
  105. package/dist/components/checkbox-card/CheckboxCard.cjs.map +1 -1
  106. package/dist/components/checkbox-card/CheckboxCard.js +1 -2
  107. package/dist/components/checkbox-card/CheckboxCard.js.map +1 -1
  108. package/dist/components/checkbox-card/namespace.cjs +1 -1
  109. package/dist/components/checkbox-card/namespace.cjs.map +1 -1
  110. package/dist/components/checkbox-card/namespace.js +2 -3
  111. package/dist/components/checkbox-card/namespace.js.map +1 -1
  112. package/dist/components/chip/Chip.cjs.map +1 -1
  113. package/dist/components/chip/Chip.d.ts +1 -1
  114. package/dist/components/chip/Chip.js +1 -2
  115. package/dist/components/chip/Chip.js.map +1 -1
  116. package/dist/components/collapsible/styled.cjs +1 -1
  117. package/dist/components/collapsible/styled.cjs.map +1 -1
  118. package/dist/components/collapsible/styled.d.ts +1 -1
  119. package/dist/components/collapsible/styled.js +2 -3
  120. package/dist/components/collapsible/styled.js.map +1 -1
  121. package/dist/components/combobox/Combobox.cjs +1 -1
  122. package/dist/components/combobox/Combobox.cjs.map +1 -1
  123. package/dist/components/combobox/Combobox.d.ts +1 -1
  124. package/dist/components/combobox/Combobox.js +6 -5
  125. package/dist/components/combobox/Combobox.js.map +1 -1
  126. package/dist/components/date-picker/DatePicker.cjs.map +1 -1
  127. package/dist/components/date-picker/DatePicker.js +1 -2
  128. package/dist/components/date-picker/DatePicker.js.map +1 -1
  129. package/dist/components/dialog/styled.cjs +1 -1
  130. package/dist/components/dialog/styled.cjs.map +1 -1
  131. package/dist/components/dialog/styled.d.ts +2 -2
  132. package/dist/components/dialog/styled.js +2 -3
  133. package/dist/components/dialog/styled.js.map +1 -1
  134. package/dist/components/drawer/Drawer.cjs.map +1 -1
  135. package/dist/components/drawer/Drawer.d.ts +2 -2
  136. package/dist/components/drawer/Drawer.js +1 -2
  137. package/dist/components/drawer/Drawer.js.map +1 -1
  138. package/dist/components/flag/styled.cjs.map +1 -1
  139. package/dist/components/flag/styled.d.ts +209 -211
  140. package/dist/components/flag/styled.js +1 -2
  141. package/dist/components/flag/styled.js.map +1 -1
  142. package/dist/components/form/FormControl.cjs +1 -1
  143. package/dist/components/form/FormControl.cjs.map +1 -1
  144. package/dist/components/form/FormControl.js +11 -7
  145. package/dist/components/form/FormControl.js.map +1 -1
  146. package/dist/components/form/FormHelperText.cjs.map +1 -1
  147. package/dist/components/form/FormHelperText.js +1 -2
  148. package/dist/components/form/FormHelperText.js.map +1 -1
  149. package/dist/components/form/FormLabel.cjs.map +1 -1
  150. package/dist/components/form/FormLabel.js +1 -2
  151. package/dist/components/form/FormLabel.js.map +1 -1
  152. package/dist/components/heading/Heading.cjs +1 -1
  153. package/dist/components/heading/Heading.cjs.map +1 -1
  154. package/dist/components/heading/Heading.d.ts +1 -1
  155. package/dist/components/heading/Heading.js +3 -4
  156. package/dist/components/heading/Heading.js.map +1 -1
  157. package/dist/components/icon/Icon.cjs.map +1 -1
  158. package/dist/components/icon/Icon.js +1 -2
  159. package/dist/components/icon/Icon.js.map +1 -1
  160. package/dist/components/icon-button/IconButton.cjs.map +1 -1
  161. package/dist/components/icon-button/IconButton.js +1 -2
  162. package/dist/components/icon-button/IconButton.js.map +1 -1
  163. package/dist/components/illustration/Illustration.cjs.map +1 -1
  164. package/dist/components/illustration/Illustration.js +1 -2
  165. package/dist/components/illustration/Illustration.js.map +1 -1
  166. package/dist/components/illustration/patterns.cjs.map +1 -1
  167. package/dist/components/illustration/patterns.js +1 -2
  168. package/dist/components/illustration/patterns.js.map +1 -1
  169. package/dist/components/input/HighlightedInput.cjs.map +1 -1
  170. package/dist/components/input/HighlightedInput.d.ts +1 -1
  171. package/dist/components/input/HighlightedInput.js +1 -2
  172. package/dist/components/input/HighlightedInput.js.map +1 -1
  173. package/dist/components/input/Input.cjs.map +1 -1
  174. package/dist/components/input/Input.js +1 -2
  175. package/dist/components/input/Input.js.map +1 -1
  176. package/dist/components/input/InputAddon.cjs.map +1 -1
  177. package/dist/components/input/InputAddon.d.ts +4 -5
  178. package/dist/components/input/InputAddon.js +1 -2
  179. package/dist/components/input/InputAddon.js.map +1 -1
  180. package/dist/components/input/InputGroup.cjs.map +1 -1
  181. package/dist/components/input/InputGroup.js +1 -2
  182. package/dist/components/input/InputGroup.js.map +1 -1
  183. package/dist/components/input/PhoneNumberInput.cjs.map +1 -1
  184. package/dist/components/input/PhoneNumberInput.js +1 -2
  185. package/dist/components/input/PhoneNumberInput.js.map +1 -1
  186. package/dist/components/menu/Menu.cjs +1 -1
  187. package/dist/components/menu/Menu.cjs.map +1 -1
  188. package/dist/components/menu/Menu.d.ts +2 -2
  189. package/dist/components/menu/Menu.js +2 -3
  190. package/dist/components/menu/Menu.js.map +1 -1
  191. package/dist/components/origin-select/OriginSelect.cjs.map +1 -1
  192. package/dist/components/origin-select/OriginSelect.d.ts +1 -1
  193. package/dist/components/origin-select/OriginSelect.js +1 -2
  194. package/dist/components/origin-select/OriginSelect.js.map +1 -1
  195. package/dist/components/pagination/Pagination.cjs.map +1 -1
  196. package/dist/components/pagination/Pagination.d.ts +1 -1
  197. package/dist/components/pagination/Pagination.js +1 -2
  198. package/dist/components/pagination/Pagination.js.map +1 -1
  199. package/dist/components/pagination/use-pagination.cjs.map +1 -1
  200. package/dist/components/pagination/use-pagination.js +1 -2
  201. package/dist/components/pagination/use-pagination.js.map +1 -1
  202. package/dist/components/popover/Popover.cjs.map +1 -1
  203. package/dist/components/popover/Popover.d.ts +2 -2
  204. package/dist/components/popover/Popover.js +1 -2
  205. package/dist/components/popover/Popover.js.map +1 -1
  206. package/dist/components/radio-button-group/RadioButtonGroup.cjs.map +1 -1
  207. package/dist/components/radio-button-group/RadioButtonGroup.d.ts +1 -1
  208. package/dist/components/radio-button-group/RadioButtonGroup.js +1 -2
  209. package/dist/components/radio-button-group/RadioButtonGroup.js.map +1 -1
  210. package/dist/components/radio-card-group/RadioCardGroup.cjs.map +1 -1
  211. package/dist/components/radio-card-group/RadioCardGroup.d.ts +1 -1
  212. package/dist/components/radio-card-group/RadioCardGroup.js +1 -2
  213. package/dist/components/radio-card-group/RadioCardGroup.js.map +1 -1
  214. package/dist/components/radio-card-group/namespace.cjs +1 -1
  215. package/dist/components/radio-card-group/namespace.cjs.map +1 -1
  216. package/dist/components/radio-card-group/namespace.js +2 -3
  217. package/dist/components/radio-card-group/namespace.js.map +1 -1
  218. package/dist/components/radio-group/RadioGroup.cjs.map +1 -1
  219. package/dist/components/radio-group/RadioGroup.d.ts +1 -1
  220. package/dist/components/radio-group/RadioGroup.js +1 -2
  221. package/dist/components/radio-group/RadioGroup.js.map +1 -1
  222. package/dist/components/select/Select.cjs +1 -1
  223. package/dist/components/select/Select.cjs.map +1 -1
  224. package/dist/components/select/Select.d.ts +1 -1
  225. package/dist/components/select/Select.js +2 -7
  226. package/dist/components/select/Select.js.map +1 -1
  227. package/dist/components/select-language/SelectLanguage.cjs +1 -1
  228. package/dist/components/select-language/SelectLanguage.cjs.map +1 -1
  229. package/dist/components/select-language/SelectLanguage.js +45 -43
  230. package/dist/components/select-language/SelectLanguage.js.map +1 -1
  231. package/dist/components/status-tag-select/StatusTagSelect.cjs +1 -1
  232. package/dist/components/status-tag-select/StatusTagSelect.cjs.map +1 -1
  233. package/dist/components/status-tag-select/StatusTagSelect.js +30 -31
  234. package/dist/components/status-tag-select/StatusTagSelect.js.map +1 -1
  235. package/dist/components/steps/Steps.cjs.map +1 -1
  236. package/dist/components/steps/Steps.d.ts +1 -1
  237. package/dist/components/steps/Steps.js +1 -2
  238. package/dist/components/steps/Steps.js.map +1 -1
  239. package/dist/components/supplier-rating-badge/SupplierRatingBadge.cjs.map +1 -1
  240. package/dist/components/supplier-rating-badge/SupplierRatingBadge.d.ts +1 -1
  241. package/dist/components/supplier-rating-badge/SupplierRatingBadge.js +1 -2
  242. package/dist/components/supplier-rating-badge/SupplierRatingBadge.js.map +1 -1
  243. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.cjs +1 -1
  244. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.cjs.map +1 -1
  245. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.d.ts +1 -1
  246. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.js +53 -54
  247. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.js.map +1 -1
  248. package/dist/components/supplier-rating-badge/labels.cjs.map +1 -1
  249. package/dist/components/supplier-rating-badge/labels.js +1 -2
  250. package/dist/components/supplier-rating-badge/labels.js.map +1 -1
  251. package/dist/components/switch/Switch.cjs.map +1 -1
  252. package/dist/components/switch/Switch.js +1 -2
  253. package/dist/components/switch/Switch.js.map +1 -1
  254. package/dist/components/switch-card/SwitchCard.cjs.map +1 -1
  255. package/dist/components/switch-card/SwitchCard.d.ts +2 -1
  256. package/dist/components/switch-card/SwitchCard.js +1 -2
  257. package/dist/components/switch-card/SwitchCard.js.map +1 -1
  258. package/dist/components/switch-card/namespace.cjs +1 -1
  259. package/dist/components/switch-card/namespace.cjs.map +1 -1
  260. package/dist/components/switch-card/namespace.js +2 -3
  261. package/dist/components/switch-card/namespace.js.map +1 -1
  262. package/dist/components/table/Table.cjs +1 -1
  263. package/dist/components/table/Table.cjs.map +1 -1
  264. package/dist/components/table/Table.js +3 -4
  265. package/dist/components/table/Table.js.map +1 -1
  266. package/dist/components/table/TableProvider.cjs.map +1 -1
  267. package/dist/components/table/TableProvider.js +1 -2
  268. package/dist/components/table/TableProvider.js.map +1 -1
  269. package/dist/components/tabs/Tabs.cjs.map +1 -1
  270. package/dist/components/tabs/Tabs.d.ts +4 -7
  271. package/dist/components/tabs/Tabs.js +1 -2
  272. package/dist/components/tabs/Tabs.js.map +1 -1
  273. package/dist/components/tag/Tag.cjs.map +1 -1
  274. package/dist/components/tag/Tag.js +1 -2
  275. package/dist/components/tag/Tag.js.map +1 -1
  276. package/dist/components/text/Text.cjs +1 -1
  277. package/dist/components/text/Text.cjs.map +1 -1
  278. package/dist/components/text/Text.d.ts +1 -1
  279. package/dist/components/text/Text.js +3 -4
  280. package/dist/components/text/Text.js.map +1 -1
  281. package/dist/components/textarea/Textarea.cjs.map +1 -1
  282. package/dist/components/textarea/Textarea.d.ts +4 -5
  283. package/dist/components/textarea/Textarea.js +1 -2
  284. package/dist/components/textarea/Textarea.js.map +1 -1
  285. package/dist/components/tooltip/Tooltip.cjs.map +1 -1
  286. package/dist/components/tooltip/Tooltip.d.ts +2 -2
  287. package/dist/components/tooltip/Tooltip.js +1 -2
  288. package/dist/components/tooltip/Tooltip.js.map +1 -1
  289. package/dist/components/ui-labels/UiLabelsProvider.cjs.map +1 -1
  290. package/dist/components/ui-labels/UiLabelsProvider.js +1 -2
  291. package/dist/components/ui-labels/UiLabelsProvider.js.map +1 -1
  292. package/dist/icons/index.cjs.map +1 -1
  293. package/dist/icons/index.js +1 -2
  294. package/dist/icons/index.js.map +1 -1
  295. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +1 -0
  296. package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js +4 -5
  297. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +1 -0
  298. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +1 -0
  299. package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js +4 -5
  300. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +1 -0
  301. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs.map +1 -0
  302. package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js +4 -5
  303. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +1 -0
  304. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs.map +1 -0
  305. package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js +4 -5
  306. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js.map +1 -0
  307. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs.map +1 -0
  308. package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js +4 -5
  309. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +1 -0
  310. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs.map +1 -0
  311. package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js +4 -5
  312. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js.map +1 -0
  313. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.cjs +1 -1
  314. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.cjs.map +1 -1
  315. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js +2 -3
  316. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js.map +1 -1
  317. package/dist/preset.cjs +1 -1
  318. package/dist/preset.cjs.map +1 -1
  319. package/dist/preset.js +7 -6
  320. package/dist/preset.js.map +1 -1
  321. package/dist/shared/ConditionalWrapper.cjs.map +1 -1
  322. package/dist/shared/ConditionalWrapper.js +1 -2
  323. package/dist/shared/ConditionalWrapper.js.map +1 -1
  324. package/dist/shared/assets/icons.cjs.map +1 -1
  325. package/dist/shared/assets/icons.d.ts +2 -2
  326. package/dist/shared/assets/icons.js +1 -2
  327. package/dist/shared/assets/icons.js.map +1 -1
  328. package/dist/shared/hooks/useUncontrolled.cjs.map +1 -1
  329. package/dist/shared/hooks/useUncontrolled.js +1 -2
  330. package/dist/shared/hooks/useUncontrolled.js.map +1 -1
  331. package/dist/shared/utils/events.cjs.map +1 -1
  332. package/dist/shared/utils/events.js +1 -2
  333. package/dist/shared/utils/events.js.map +1 -1
  334. package/dist/theme/breakpoints.cjs.map +1 -1
  335. package/dist/theme/breakpoints.js +1 -2
  336. package/dist/theme/breakpoints.js.map +1 -1
  337. package/dist/theme/conditions.cjs.map +1 -1
  338. package/dist/theme/conditions.js +1 -2
  339. package/dist/theme/conditions.js.map +1 -1
  340. package/dist/theme/containers.cjs +1 -1
  341. package/dist/theme/containers.cjs.map +1 -1
  342. package/dist/theme/containers.d.ts +1 -1
  343. package/dist/theme/containers.js +2 -3
  344. package/dist/theme/containers.js.map +1 -1
  345. package/dist/theme/globalCss.cjs.map +1 -1
  346. package/dist/theme/globalCss.d.ts +1 -1
  347. package/dist/theme/globalCss.js +1 -2
  348. package/dist/theme/globalCss.js.map +1 -1
  349. package/dist/theme/keyframes.cjs.map +1 -1
  350. package/dist/theme/keyframes.d.ts +1 -1
  351. package/dist/theme/keyframes.js +1 -2
  352. package/dist/theme/keyframes.js.map +1 -1
  353. package/dist/theme/recipes/accordion.cjs.map +1 -1
  354. package/dist/theme/recipes/accordion.d.ts +32 -2
  355. package/dist/theme/recipes/accordion.js +1 -2
  356. package/dist/theme/recipes/accordion.js.map +1 -1
  357. package/dist/theme/recipes/action-card.cjs.map +1 -1
  358. package/dist/theme/recipes/action-card.d.ts +2 -2
  359. package/dist/theme/recipes/action-card.js +1 -2
  360. package/dist/theme/recipes/action-card.js.map +1 -1
  361. package/dist/theme/recipes/alert.cjs.map +1 -1
  362. package/dist/theme/recipes/alert.d.ts +30 -2
  363. package/dist/theme/recipes/alert.js +1 -2
  364. package/dist/theme/recipes/alert.js.map +1 -1
  365. package/dist/theme/recipes/app/mobile-navigation.cjs.map +1 -1
  366. package/dist/theme/recipes/app/mobile-navigation.d.ts +51 -2
  367. package/dist/theme/recipes/app/mobile-navigation.js +1 -2
  368. package/dist/theme/recipes/app/mobile-navigation.js.map +1 -1
  369. package/dist/theme/recipes/app/navigation-language-select.cjs +1 -1
  370. package/dist/theme/recipes/app/navigation-language-select.cjs.map +1 -1
  371. package/dist/theme/recipes/app/navigation-language-select.d.ts +105 -2
  372. package/dist/theme/recipes/app/navigation-language-select.js +31 -39
  373. package/dist/theme/recipes/app/navigation-language-select.js.map +1 -1
  374. package/dist/theme/recipes/app/navigation.cjs.map +1 -1
  375. package/dist/theme/recipes/app/navigation.d.ts +125 -2
  376. package/dist/theme/recipes/app/navigation.js +1 -2
  377. package/dist/theme/recipes/app/navigation.js.map +1 -1
  378. package/dist/theme/recipes/app/price-tag.cjs.map +1 -1
  379. package/dist/theme/recipes/app/price-tag.d.ts +41 -2
  380. package/dist/theme/recipes/app/price-tag.js +1 -2
  381. package/dist/theme/recipes/app/price-tag.js.map +1 -1
  382. package/dist/theme/recipes/app/product-card-catalog.cjs.map +1 -1
  383. package/dist/theme/recipes/app/product-card-catalog.d.ts +2 -2
  384. package/dist/theme/recipes/app/product-card-catalog.js +1 -2
  385. package/dist/theme/recipes/app/product-card-catalog.js.map +1 -1
  386. package/dist/theme/recipes/avatar-group.cjs.map +1 -1
  387. package/dist/theme/recipes/avatar-group.d.ts +14 -2
  388. package/dist/theme/recipes/avatar-group.js +1 -2
  389. package/dist/theme/recipes/avatar-group.js.map +1 -1
  390. package/dist/theme/recipes/avatar.cjs.map +1 -1
  391. package/dist/theme/recipes/avatar.d.ts +53 -2
  392. package/dist/theme/recipes/avatar.js +1 -2
  393. package/dist/theme/recipes/avatar.js.map +1 -1
  394. package/dist/theme/recipes/breadcrumb.cjs.map +1 -1
  395. package/dist/theme/recipes/breadcrumb.d.ts +2 -2
  396. package/dist/theme/recipes/breadcrumb.js +1 -2
  397. package/dist/theme/recipes/breadcrumb.js.map +1 -1
  398. package/dist/theme/recipes/button-filter.cjs.map +1 -1
  399. package/dist/theme/recipes/button-filter.d.ts +1 -1
  400. package/dist/theme/recipes/button-filter.js +1 -2
  401. package/dist/theme/recipes/button-filter.js.map +1 -1
  402. package/dist/theme/recipes/button.cjs.map +1 -1
  403. package/dist/theme/recipes/button.d.ts +93 -2
  404. package/dist/theme/recipes/button.js +1 -2
  405. package/dist/theme/recipes/button.js.map +1 -1
  406. package/dist/theme/recipes/chat/chat-document-message.cjs.map +1 -1
  407. package/dist/theme/recipes/chat/chat-document-message.d.ts +1 -1
  408. package/dist/theme/recipes/chat/chat-document-message.js +1 -2
  409. package/dist/theme/recipes/chat/chat-document-message.js.map +1 -1
  410. package/dist/theme/recipes/chat/chat-input-text.cjs.map +1 -1
  411. package/dist/theme/recipes/chat/chat-input-text.d.ts +1 -1
  412. package/dist/theme/recipes/chat/chat-input-text.js +1 -2
  413. package/dist/theme/recipes/chat/chat-input-text.js.map +1 -1
  414. package/dist/theme/recipes/chat/chat-message.cjs.map +1 -1
  415. package/dist/theme/recipes/chat/chat-message.d.ts +28 -2
  416. package/dist/theme/recipes/chat/chat-message.js +1 -2
  417. package/dist/theme/recipes/chat/chat-message.js.map +1 -1
  418. package/dist/theme/recipes/chat/chat-profile-avatar.cjs.map +1 -1
  419. package/dist/theme/recipes/chat/chat-profile-avatar.d.ts +9 -2
  420. package/dist/theme/recipes/chat/chat-profile-avatar.js +1 -2
  421. package/dist/theme/recipes/chat/chat-profile-avatar.js.map +1 -1
  422. package/dist/theme/recipes/chat/chat.cjs.map +1 -1
  423. package/dist/theme/recipes/chat/chat.d.ts +2 -2
  424. package/dist/theme/recipes/chat/chat.js +1 -2
  425. package/dist/theme/recipes/chat/chat.js.map +1 -1
  426. package/dist/theme/recipes/checkbox-card.cjs.map +1 -1
  427. package/dist/theme/recipes/checkbox-card.d.ts +1 -1
  428. package/dist/theme/recipes/checkbox-card.js +1 -2
  429. package/dist/theme/recipes/checkbox-card.js.map +1 -1
  430. package/dist/theme/recipes/checkbox-group.cjs.map +1 -1
  431. package/dist/theme/recipes/checkbox-group.d.ts +1 -1
  432. package/dist/theme/recipes/checkbox-group.js +1 -2
  433. package/dist/theme/recipes/checkbox-group.js.map +1 -1
  434. package/dist/theme/recipes/checkbox.cjs +1 -1
  435. package/dist/theme/recipes/checkbox.cjs.map +1 -1
  436. package/dist/theme/recipes/checkbox.d.ts +26 -2
  437. package/dist/theme/recipes/checkbox.js +7 -8
  438. package/dist/theme/recipes/checkbox.js.map +1 -1
  439. package/dist/theme/recipes/chip.cjs.map +1 -1
  440. package/dist/theme/recipes/chip.d.ts +148 -2
  441. package/dist/theme/recipes/chip.js +1 -2
  442. package/dist/theme/recipes/chip.js.map +1 -1
  443. package/dist/theme/recipes/collapsible.cjs.map +1 -1
  444. package/dist/theme/recipes/collapsible.d.ts +2 -2
  445. package/dist/theme/recipes/collapsible.js +1 -2
  446. package/dist/theme/recipes/collapsible.js.map +1 -1
  447. package/dist/theme/recipes/combobox.cjs +1 -1
  448. package/dist/theme/recipes/combobox.cjs.map +1 -1
  449. package/dist/theme/recipes/combobox.d.ts +33 -2
  450. package/dist/theme/recipes/combobox.js +6 -6
  451. package/dist/theme/recipes/combobox.js.map +1 -1
  452. package/dist/theme/recipes/common/group-card.cjs.map +1 -1
  453. package/dist/theme/recipes/common/group-card.d.ts +1 -1
  454. package/dist/theme/recipes/common/group-card.js +1 -2
  455. package/dist/theme/recipes/common/group-card.js.map +1 -1
  456. package/dist/theme/recipes/datepicker.cjs +1 -1
  457. package/dist/theme/recipes/datepicker.cjs.map +1 -1
  458. package/dist/theme/recipes/datepicker.d.ts +2 -2
  459. package/dist/theme/recipes/datepicker.js +6 -7
  460. package/dist/theme/recipes/datepicker.js.map +1 -1
  461. package/dist/theme/recipes/dialog.cjs.map +1 -1
  462. package/dist/theme/recipes/dialog.d.ts +2 -2
  463. package/dist/theme/recipes/dialog.js +1 -2
  464. package/dist/theme/recipes/dialog.js.map +1 -1
  465. package/dist/theme/recipes/drawer.cjs.map +1 -1
  466. package/dist/theme/recipes/drawer.d.ts +31 -2
  467. package/dist/theme/recipes/drawer.js +4 -4
  468. package/dist/theme/recipes/drawer.js.map +1 -1
  469. package/dist/theme/recipes/flag.cjs.map +1 -1
  470. package/dist/theme/recipes/flag.d.ts +15 -2
  471. package/dist/theme/recipes/flag.js +1 -2
  472. package/dist/theme/recipes/flag.js.map +1 -1
  473. package/dist/theme/recipes/form/control.cjs.map +1 -1
  474. package/dist/theme/recipes/form/control.d.ts +1 -1
  475. package/dist/theme/recipes/form/control.js +1 -2
  476. package/dist/theme/recipes/form/control.js.map +1 -1
  477. package/dist/theme/recipes/form/helper-text.cjs.map +1 -1
  478. package/dist/theme/recipes/form/helper-text.d.ts +1 -1
  479. package/dist/theme/recipes/form/helper-text.js +1 -2
  480. package/dist/theme/recipes/form/helper-text.js.map +1 -1
  481. package/dist/theme/recipes/form/label.cjs.map +1 -1
  482. package/dist/theme/recipes/form/label.d.ts +15 -2
  483. package/dist/theme/recipes/form/label.js +1 -2
  484. package/dist/theme/recipes/form/label.js.map +1 -1
  485. package/dist/theme/recipes/heading.cjs.map +1 -1
  486. package/dist/theme/recipes/heading.d.ts +33 -2
  487. package/dist/theme/recipes/heading.js +1 -2
  488. package/dist/theme/recipes/heading.js.map +1 -1
  489. package/dist/theme/recipes/highlightedInput.cjs.map +1 -1
  490. package/dist/theme/recipes/highlightedInput.d.ts +2 -2
  491. package/dist/theme/recipes/highlightedInput.js +1 -2
  492. package/dist/theme/recipes/highlightedInput.js.map +1 -1
  493. package/dist/theme/recipes/icon-button.cjs.map +1 -1
  494. package/dist/theme/recipes/icon-button.d.ts +1 -1
  495. package/dist/theme/recipes/icon-button.js +0 -1
  496. package/dist/theme/recipes/icon-button.js.map +1 -1
  497. package/dist/theme/recipes/icon.cjs.map +1 -1
  498. package/dist/theme/recipes/icon.d.ts +25 -2
  499. package/dist/theme/recipes/icon.js +1 -2
  500. package/dist/theme/recipes/icon.js.map +1 -1
  501. package/dist/theme/recipes/illustration.cjs.map +1 -1
  502. package/dist/theme/recipes/illustration.d.ts +29 -2
  503. package/dist/theme/recipes/illustration.js +1 -2
  504. package/dist/theme/recipes/illustration.js.map +1 -1
  505. package/dist/theme/recipes/index.cjs +1 -1
  506. package/dist/theme/recipes/index.cjs.map +1 -1
  507. package/dist/theme/recipes/index.d.ts +1464 -49
  508. package/dist/theme/recipes/index.js +3 -4
  509. package/dist/theme/recipes/index.js.map +1 -1
  510. package/dist/theme/recipes/input-addon.cjs.map +1 -1
  511. package/dist/theme/recipes/input-addon.d.ts +1 -1
  512. package/dist/theme/recipes/input-addon.js +1 -2
  513. package/dist/theme/recipes/input-addon.js.map +1 -1
  514. package/dist/theme/recipes/input-group.cjs.map +1 -1
  515. package/dist/theme/recipes/input-group.d.ts +1 -1
  516. package/dist/theme/recipes/input-group.js +1 -2
  517. package/dist/theme/recipes/input-group.js.map +1 -1
  518. package/dist/theme/recipes/input.cjs +1 -1
  519. package/dist/theme/recipes/input.cjs.map +1 -1
  520. package/dist/theme/recipes/input.d.ts +9 -2
  521. package/dist/theme/recipes/input.js +5 -6
  522. package/dist/theme/recipes/input.js.map +1 -1
  523. package/dist/theme/recipes/menu.cjs.map +1 -1
  524. package/dist/theme/recipes/menu.d.ts +20 -2
  525. package/dist/theme/recipes/menu.js +1 -2
  526. package/dist/theme/recipes/menu.js.map +1 -1
  527. package/dist/theme/recipes/pagination.cjs +1 -1
  528. package/dist/theme/recipes/pagination.cjs.map +1 -1
  529. package/dist/theme/recipes/pagination.d.ts +2 -2
  530. package/dist/theme/recipes/pagination.js +3 -4
  531. package/dist/theme/recipes/pagination.js.map +1 -1
  532. package/dist/theme/recipes/phone-number-input.cjs.map +1 -1
  533. package/dist/theme/recipes/phone-number-input.d.ts +9 -2
  534. package/dist/theme/recipes/phone-number-input.js +1 -2
  535. package/dist/theme/recipes/phone-number-input.js.map +1 -1
  536. package/dist/theme/recipes/popover.cjs.map +1 -1
  537. package/dist/theme/recipes/popover.d.ts +2 -2
  538. package/dist/theme/recipes/popover.js +1 -2
  539. package/dist/theme/recipes/popover.js.map +1 -1
  540. package/dist/theme/recipes/radio-button-group.cjs.map +1 -1
  541. package/dist/theme/recipes/radio-button-group.d.ts +25 -2
  542. package/dist/theme/recipes/radio-button-group.js +1 -2
  543. package/dist/theme/recipes/radio-button-group.js.map +1 -1
  544. package/dist/theme/recipes/radio-card-group.cjs.map +1 -1
  545. package/dist/theme/recipes/radio-card-group.d.ts +36 -2
  546. package/dist/theme/recipes/radio-card-group.js +1 -2
  547. package/dist/theme/recipes/radio-card-group.js.map +1 -1
  548. package/dist/theme/recipes/radio-group.cjs.map +1 -1
  549. package/dist/theme/recipes/radio-group.d.ts +27 -2
  550. package/dist/theme/recipes/radio-group.js +1 -2
  551. package/dist/theme/recipes/radio-group.js.map +1 -1
  552. package/dist/theme/recipes/select-language.cjs.map +1 -1
  553. package/dist/theme/recipes/select-language.d.ts +15 -2
  554. package/dist/theme/recipes/select-language.js +1 -2
  555. package/dist/theme/recipes/select-language.js.map +1 -1
  556. package/dist/theme/recipes/select.cjs +1 -1
  557. package/dist/theme/recipes/select.cjs.map +1 -1
  558. package/dist/theme/recipes/select.d.ts +30 -2
  559. package/dist/theme/recipes/select.js +3 -18
  560. package/dist/theme/recipes/select.js.map +1 -1
  561. package/dist/theme/recipes/status-tag-select.cjs.map +1 -1
  562. package/dist/theme/recipes/status-tag-select.d.ts +125 -2
  563. package/dist/theme/recipes/status-tag-select.js +1 -2
  564. package/dist/theme/recipes/status-tag-select.js.map +1 -1
  565. package/dist/theme/recipes/steps.cjs.map +1 -1
  566. package/dist/theme/recipes/steps.d.ts +2 -2
  567. package/dist/theme/recipes/steps.js +1 -2
  568. package/dist/theme/recipes/steps.js.map +1 -1
  569. package/dist/theme/recipes/switch-card.cjs.map +1 -1
  570. package/dist/theme/recipes/switch-card.d.ts +1 -1
  571. package/dist/theme/recipes/switch-card.js +1 -2
  572. package/dist/theme/recipes/switch-card.js.map +1 -1
  573. package/dist/theme/recipes/switch.cjs.map +1 -1
  574. package/dist/theme/recipes/switch.d.ts +22 -2
  575. package/dist/theme/recipes/switch.js +1 -2
  576. package/dist/theme/recipes/switch.js.map +1 -1
  577. package/dist/theme/recipes/table-container.cjs.map +1 -1
  578. package/dist/theme/recipes/table-container.d.ts +1 -1
  579. package/dist/theme/recipes/table-container.js +1 -2
  580. package/dist/theme/recipes/table-container.js.map +1 -1
  581. package/dist/theme/recipes/table-empty-row.cjs.map +1 -1
  582. package/dist/theme/recipes/table-empty-row.d.ts +1 -1
  583. package/dist/theme/recipes/table-empty-row.js +1 -2
  584. package/dist/theme/recipes/table-empty-row.js.map +1 -1
  585. package/dist/theme/recipes/table-group-title.cjs.map +1 -1
  586. package/dist/theme/recipes/table-group-title.d.ts +15 -2
  587. package/dist/theme/recipes/table-group-title.js +1 -2
  588. package/dist/theme/recipes/table-group-title.js.map +1 -1
  589. package/dist/theme/recipes/table.cjs.map +1 -1
  590. package/dist/theme/recipes/table.d.ts +2 -2
  591. package/dist/theme/recipes/table.js +1 -2
  592. package/dist/theme/recipes/table.js.map +1 -1
  593. package/dist/theme/recipes/tabs-chip.cjs.map +1 -1
  594. package/dist/theme/recipes/tabs-chip.d.ts +29 -2
  595. package/dist/theme/recipes/tabs-chip.js +1 -2
  596. package/dist/theme/recipes/tabs-chip.js.map +1 -1
  597. package/dist/theme/recipes/tabs.cjs.map +1 -1
  598. package/dist/theme/recipes/tabs.d.ts +49 -2
  599. package/dist/theme/recipes/tabs.js +1 -2
  600. package/dist/theme/recipes/tabs.js.map +1 -1
  601. package/dist/theme/recipes/tag.cjs.map +1 -1
  602. package/dist/theme/recipes/tag.d.ts +109 -2
  603. package/dist/theme/recipes/tag.js +1 -2
  604. package/dist/theme/recipes/tag.js.map +1 -1
  605. package/dist/theme/recipes/text.cjs.map +1 -1
  606. package/dist/theme/recipes/text.d.ts +29 -2
  607. package/dist/theme/recipes/text.js +1 -2
  608. package/dist/theme/recipes/text.js.map +1 -1
  609. package/dist/theme/recipes/textarea.cjs.map +1 -1
  610. package/dist/theme/recipes/textarea.d.ts +1 -1
  611. package/dist/theme/recipes/textarea.js +1 -2
  612. package/dist/theme/recipes/textarea.js.map +1 -1
  613. package/dist/theme/recipes/tooltip.cjs.map +1 -1
  614. package/dist/theme/recipes/tooltip.d.ts +2 -2
  615. package/dist/theme/recipes/tooltip.js +1 -2
  616. package/dist/theme/recipes/tooltip.js.map +1 -1
  617. package/dist/theme/semantic-tokens/colors.cjs.map +1 -1
  618. package/dist/theme/semantic-tokens/colors.js +1 -2
  619. package/dist/theme/semantic-tokens/colors.js.map +1 -1
  620. package/dist/theme/semantic-tokens/gradients.cjs.map +1 -1
  621. package/dist/theme/semantic-tokens/gradients.js +1 -2
  622. package/dist/theme/semantic-tokens/gradients.js.map +1 -1
  623. package/dist/theme/semantic-tokens/index.cjs.map +1 -1
  624. package/dist/theme/semantic-tokens/index.js +1 -2
  625. package/dist/theme/semantic-tokens/index.js.map +1 -1
  626. package/dist/theme/text-styles.cjs.map +1 -1
  627. package/dist/theme/text-styles.d.ts +1 -1
  628. package/dist/theme/text-styles.js +1 -2
  629. package/dist/theme/text-styles.js.map +1 -1
  630. package/dist/theme/tokens/animations.cjs.map +1 -1
  631. package/dist/theme/tokens/animations.js +1 -2
  632. package/dist/theme/tokens/animations.js.map +1 -1
  633. package/dist/theme/tokens/aspect-ratios.cjs.map +1 -1
  634. package/dist/theme/tokens/aspect-ratios.js +1 -2
  635. package/dist/theme/tokens/aspect-ratios.js.map +1 -1
  636. package/dist/theme/tokens/blurs.cjs.map +1 -1
  637. package/dist/theme/tokens/blurs.js +1 -2
  638. package/dist/theme/tokens/blurs.js.map +1 -1
  639. package/dist/theme/tokens/borders.cjs.map +1 -1
  640. package/dist/theme/tokens/borders.js +1 -2
  641. package/dist/theme/tokens/borders.js.map +1 -1
  642. package/dist/theme/tokens/colors.cjs.map +1 -1
  643. package/dist/theme/tokens/colors.js +1 -2
  644. package/dist/theme/tokens/colors.js.map +1 -1
  645. package/dist/theme/tokens/durations.cjs.map +1 -1
  646. package/dist/theme/tokens/durations.js +1 -2
  647. package/dist/theme/tokens/durations.js.map +1 -1
  648. package/dist/theme/tokens/easings.cjs.map +1 -1
  649. package/dist/theme/tokens/easings.js +1 -2
  650. package/dist/theme/tokens/easings.js.map +1 -1
  651. package/dist/theme/tokens/index.cjs.map +1 -1
  652. package/dist/theme/tokens/index.js +1 -2
  653. package/dist/theme/tokens/index.js.map +1 -1
  654. package/dist/theme/tokens/radii.cjs.map +1 -1
  655. package/dist/theme/tokens/radii.js +1 -2
  656. package/dist/theme/tokens/radii.js.map +1 -1
  657. package/dist/theme/tokens/shadows.cjs.map +1 -1
  658. package/dist/theme/tokens/shadows.js +1 -2
  659. package/dist/theme/tokens/shadows.js.map +1 -1
  660. package/dist/theme/tokens/sizes.cjs.map +1 -1
  661. package/dist/theme/tokens/sizes.js +1 -2
  662. package/dist/theme/tokens/sizes.js.map +1 -1
  663. package/dist/theme/tokens/spacing.cjs.map +1 -1
  664. package/dist/theme/tokens/spacing.js +1 -2
  665. package/dist/theme/tokens/spacing.js.map +1 -1
  666. package/dist/theme/tokens/typography.cjs.map +1 -1
  667. package/dist/theme/tokens/typography.js +1 -2
  668. package/dist/theme/tokens/typography.js.map +1 -1
  669. package/dist/theme/tokens/z-index.cjs.map +1 -1
  670. package/dist/theme/tokens/z-index.js +1 -2
  671. package/dist/theme/tokens/z-index.js.map +1 -1
  672. package/dist/theme/utilities.cjs.map +1 -1
  673. package/dist/theme/utilities.js +0 -1
  674. package/dist/theme/utilities.js.map +1 -1
  675. package/dist/ui.css +1 -1
  676. package/dist/utils/slots.cjs +1 -1
  677. package/dist/utils/slots.cjs.map +1 -1
  678. package/dist/utils/slots.js +3 -4
  679. package/dist/utils/slots.js.map +1 -1
  680. package/package.json +9 -9
  681. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +0 -1
  682. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +0 -1
  683. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +0 -1
  684. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +0 -1
  685. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs.map +0 -1
  686. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +0 -1
  687. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs.map +0 -1
  688. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.js.map +0 -1
  689. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs.map +0 -1
  690. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +0 -1
  691. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs.map +0 -1
  692. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.js.map +0 -1
  693. /package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +0 -0
  694. /package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +0 -0
  695. /package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs +0 -0
  696. /package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs +0 -0
  697. /package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +0 -0
  698. /package/dist/node_modules/.pnpm/{@heroicons_react@2.2.0_react@19.2.6 → @heroicons_react@2.2.0_react@19.3.1}/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.cjs","names":[],"sources":["../../../src/components/combobox/Combobox.tsx"],"sourcesContent":["import {\n Combobox as ArkCombobox,\n type ComboboxRootProps,\n createListCollection,\n Portal,\n useComboboxItemContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { debounce } from 'lodash'\n\nimport { combobox } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input as UIInput } from '~/components/input'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport { Chip, ChipClearTrigger, ChipLabel } from '~/components/chip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { FixedSizeList } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(combobox)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkCombobox.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkCombobox.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkCombobox.Content), 'content')\nconst Input = withContext(styled(ArkCombobox.Input), 'input')\nconst Control = withContext(styled(ArkCombobox.Control), 'control')\nconst Item = withContext(styled(ArkCombobox.Item), 'item')\nconst ItemText = withContext(styled(ArkCombobox.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkCombobox.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkCombobox.Trigger), 'trigger')\n\nexport type ComboboxItem = {\n value: string | number\n label: string\n disabled?: boolean\n tooltip?: ReactNode\n}\n\nexport type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value'> & {\n value?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n /**\n * Renders the inner content of each selected chip in `multiple` mode.\n * Receives the selected item and should return the chip body (the removable\n * clear button is appended automatically). Defaults to the item label.\n */\n renderValue?: (item: T) => ReactNode\n loadItems?: (inputValue: string) => Promise<T[]>\n debounceMs?: number\n emptyLabel?: ReactNode\n loadingLabel?: ReactNode\n placeholder?: string\n usePortal?: boolean\n isLoading?: boolean\n withAutoFilter?: boolean\n onResetInitialItems?: () => void\n openDropdownOnFocus?: boolean\n clearValueWhenEmpty?: boolean\n virtualized?: boolean\n rowHeight?: number\n returnItemsOnEmpty?: boolean\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof combobox>\n\nconst MultipleUncheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" className={css({ stroke: 'grey.100' })} />\n </svg>\n)\n\nconst MultipleCheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"0.5\" width=\"16\" height=\"16\" rx=\"4\" className={css({ fill: 'primary.500' })} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z\"\n fill=\"white\"\n />\n </svg>\n)\n\ninterface InnerItemProps<Item extends ComboboxItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\nfunction CustomInnerItem<Item extends ComboboxItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useComboboxItemContext()\n\n return (\n <>\n {isMultiple ? context.selected ? <MultipleCheckedIndicator /> : <MultipleUncheckedIndicator /> : null}\n {renderItem ? renderItem(item) : <ItemText truncate>{item.label}</ItemText>}\n </>\n )\n}\n\nexport const Combobox = <T extends ComboboxItem>({\n items: itemsFromUsers = [],\n initialItems,\n debounceMs = 0,\n placeholder,\n emptyLabel,\n loadingLabel,\n usePortal = true,\n withAutoFilter = true,\n positioning,\n loadItems,\n renderItem,\n renderValue,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n multiple = false,\n ...props\n}: ComboboxProps<T>) => {\n const uiLabels = useUiLabels()\n const [items, setItems] = useState(() => itemsFromUsers)\n const [isLoading, setIsLoading] = useState(false)\n const [firstQueryTriggered, setFirstQueryTriggered] = useState(false)\n const asyncMode = typeof loadItems === 'function'\n\n const debouncedLoadItems = useMemo(\n () =>\n loadItems\n ? debounce(async (value: string) => {\n try {\n setFirstQueryTriggered(true)\n setIsLoading(true)\n const newItems = await loadItems(value)\n setItems(newItems)\n } catch (error) {\n console.error(error)\n setItems([])\n } finally {\n setIsLoading(false)\n }\n }, debounceMs)\n : null,\n [loadItems, debounceMs],\n )\n\n // A sync, unfiltered list has nothing to derive: read the prop itself. The mirrored\n // `items` state only catches up in an effect, one render late, and zag re-derives the\n // input text from the collection the moment `value` changes: a value set in the same\n // render as the item that carries it was stringified against a list without it, and\n // the input went blank.\n const sourceItems = !asyncMode && !withAutoFilter ? itemsFromUsers : items\n const allItems = [...sourceItems, ...(initialItems ?? [])]\n\n const handleInputChange = useCallback(\n async (details: ArkCombobox.InputValueChangeDetails) => {\n if (\n initialItems &&\n initialItems.length > 0 &&\n !initialItems.find((item: ComboboxItem) => item.label === details.inputValue)\n ) {\n onResetInitialItems?.()\n }\n const { inputValue } = details\n\n if (debouncedLoadItems) {\n debouncedLoadItems(inputValue)\n } else {\n const items =\n withAutoFilter && inputValue !== ''\n ? itemsFromUsers.filter((item: ComboboxItem) => item.label.toLowerCase().includes(inputValue.toLowerCase()))\n : itemsFromUsers\n\n if (items.length === 0 && returnItemsOnEmpty) {\n return setItems(itemsFromUsers)\n }\n setItems(items)\n }\n },\n [debouncedLoadItems, itemsFromUsers, withAutoFilter],\n )\n\n // Keep the visible items in sync with the source list whenever it changes\n // (e.g. options that load asynchronously after mount). Without this, an empty\n // input shows a stale/empty list (the no-results label) until the user types.\n // Consumers memoize `items`, so this only fires on real data changes, not on\n // every keystroke.\n useEffect(() => {\n if (!debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, debouncedLoadItems])\n\n const collection = useMemo(() => createListCollection({ items: allItems }), [allItems])\n\n const effectiveIsLoading = controlledIsLoading ?? isLoading\n\n const loadingContent = loadingLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.loading}\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.noResults}\n </Text>\n )\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"combobox\"\n onInputValueChange={handleInputChange}\n value={value as string[] | undefined}\n {...props}\n multiple={multiple}\n >\n {multiple ? (\n // Tags-input layout: the control (styled via the recipe's `&[data-multiple]`\n // selectors) is the bordered box holding the selected chips and a\n // borderless growing input.\n <ArkCombobox.Context>\n {api => (\n <Control data-multiple=\"true\" data-open={api.open || undefined}>\n {/* Resolve chips from the current value against the full source\n list rather than ark's cached `selectedItems`: the cache is only\n re-derived on value changes, so async-loaded defaults would show\n 0 chips until the user selects something. Looking up in\n itemsFromUsers (never the filtered list) also keeps chips visible\n while the user is typing to filter. */}\n {api.value.map(v => {\n const item = itemsFromUsers.find((i: T) => String(i.value) === String(v))\n if (!item) return null\n return (\n <Chip key={v} size=\"sm\">\n {renderValue ? renderValue(item) : <ChipLabel>{item.label}</ChipLabel>}\n {!props.readOnly && !props.disabled && (\n <ChipClearTrigger\n aria-label={`Retirer ${item.label}`}\n // Remove by strict-equality-safe filter: stored values may\n // be numbers while item.value is compared as a string.\n onClick={() => api.setValue(api.value.filter(x => String(x) !== String(v)))}\n />\n )}\n </Chip>\n )\n })}\n <Input\n asChild\n data-multiple=\"true\"\n placeholder={api.hasSelectedItems ? undefined : placeholder}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n </Control>\n )}\n </ArkCombobox.Context>\n ) : (\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n )}\n </ArkCombobox.Context>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} onClick={onResetInitialItems} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n )}\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {effectiveIsLoading ? (\n loadingContent\n ) : allItems.length === 0 ? (\n <>{asyncMode ? (firstQueryTriggered ? emptyContent : loadingContent) : emptyContent}</>\n ) : virtualized ? (\n <>\n <FixedSizeList\n height={Math.min(rowHeight * allItems.length, 180)}\n itemCount={allItems.length}\n itemSize={rowHeight}\n width=\"100%\"\n >\n {({ index, style }) => (\n <ConditionalWrapper\n key={allItems[index].value}\n when={!!allItems[index].tooltip}\n wrapper={children => <Tooltip label={allItems[index].tooltip}>{children}</Tooltip>}\n >\n <Item key={allItems[index].value} item={allItems[index]} style={style}>\n <CustomInnerItem renderItem={renderItem} item={allItems[index]} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n )}\n </FixedSizeList>\n </>\n ) : (\n allItems.map(item => (\n <ConditionalWrapper\n key={item.value}\n when={!!item.tooltip}\n wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}\n >\n <Item key={item.value} item={item}>\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n ))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AA,EACpF,IACF,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,UACE,EAAA,EAAA,KAAC,EAAA,cAAD,CACE,OAAQ,KAAK,IAAI,EAAY,EAAS,OAAQ,GAAG,EACjD,UAAW,EAAS,OACpB,SAAU,EACV,MAAM,iBAEJ,CAAE,QAAO,YACT,EAAA,EAAA,KAAC,EAAA,mBAAD,CAEE,KAAM,CAAC,CAAC,EAAS,GAAO,QACxB,QAAS,IAAY,EAAA,EAAA,KAAC,EAAA,QAAD,CAAS,MAAO,EAAS,GAAO,QAAU,UAAkB,CAAA,YAEjF,EAAA,EAAA,KAAC,EAAD,CAAkC,KAAM,EAAS,GAAe,kBAC9D,EAAA,EAAA,KAAC,EAAD,CAA6B,aAAY,KAAM,EAAS,GAAQ,WAAY,CAAW,CAAA,CACnF,EAFK,EAAS,GAAO,KAErB,CACY,EAPb,EAAS,GAAO,KAOH,CAET,CAAA,CACf,CAAA,EAEF,EAAS,IAAI,IACX,EAAA,EAAA,KAAC,EAAA,mBAAD,CAEE,KAAM,CAAC,CAAC,EAAK,QACb,QAAS,IAAY,EAAA,EAAA,KAAC,EAAA,QAAD,CAAS,MAAO,EAAK,QAAU,UAAkB,CAAA,YAEtE,EAAA,EAAA,KAAC,EAAD,CAA6B,iBAC3B,EAAA,EAAA,KAAC,EAAD,CAA6B,aAAkB,OAAM,WAAY,CAAW,CAAA,CACxE,EAFK,EAAK,KAEV,CACY,EAPb,EAAK,KAOQ,CACrB,CAEI,CAAA,CACC,CAAA,CACM,CAAA,CAChB,GAEV"}
1
+ {"version":3,"file":"Combobox.cjs","names":["createStyleContext","combobox","styled","ArkCombobox","css","useComboboxItemContext","_Fragment","useUiLabels","useState","useMemo","debounce","useCallback","createListCollection","Text","Chip","ChipLabel","ChipClearTrigger","UIInput","ConditionalWrapper","Portal","FixedSizeList","Tooltip","require_slots","require_Tooltip","require_Text","require_ConditionalWrapper","require_UiLabelsProvider","require_Input","require_Chip","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react","react_jsx_runtime","_stokelp_styled_system_css","react_window","lodash","Root","withProvider","ClearTrigger","withContext","Content","Input","Control","Item","ItemText","Positioner","Trigger","MultipleUncheckedIndicator","MultipleCheckedIndicator","CustomInnerItem","context","isMultiple","renderItem","item","Combobox","itemsFromUsers","controlledIsLoading","props","uiLabels","items","setItems","isLoading","setIsLoading","firstQueryTriggered","setFirstQueryTriggered","asyncMode","loadItems","debouncedLoadItems","newItems","value","error","debounceMs","allItems","withAutoFilter","initialItems","handleInputChange","details","onResetInitialItems","inputValue","returnItemsOnEmpty","collection","effectiveIsLoading","loadingContent","loadingLabel","emptyContent","emptyLabel","positioning","multiple","api","i","v","renderValue","x","placeholder","openDropdownOnFocus","e","clearValueWhenEmpty","usePortal","virtualized","rowHeight","index"],"sources":["../../../src/components/combobox/Combobox.tsx"],"sourcesContent":["import {\n Combobox as ArkCombobox,\n type ComboboxRootProps,\n createListCollection,\n Portal,\n useComboboxItemContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { debounce } from 'lodash'\n\nimport { combobox } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input as UIInput } from '~/components/input'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport { Chip, ChipClearTrigger, ChipLabel } from '~/components/chip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { FixedSizeList } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(combobox)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkCombobox.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkCombobox.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkCombobox.Content), 'content')\nconst Input = withContext(styled(ArkCombobox.Input), 'input')\nconst Control = withContext(styled(ArkCombobox.Control), 'control')\nconst Item = withContext(styled(ArkCombobox.Item), 'item')\nconst ItemText = withContext(styled(ArkCombobox.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkCombobox.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkCombobox.Trigger), 'trigger')\n\nexport type ComboboxItem = {\n value: string | number\n label: string\n disabled?: boolean\n tooltip?: ReactNode\n}\n\nexport type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value'> & {\n value?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n /**\n * Renders the inner content of each selected chip in `multiple` mode.\n * Receives the selected item and should return the chip body (the removable\n * clear button is appended automatically). Defaults to the item label.\n */\n renderValue?: (item: T) => ReactNode\n loadItems?: (inputValue: string) => Promise<T[]>\n debounceMs?: number\n emptyLabel?: ReactNode\n loadingLabel?: ReactNode\n placeholder?: string\n usePortal?: boolean\n isLoading?: boolean\n withAutoFilter?: boolean\n onResetInitialItems?: () => void\n openDropdownOnFocus?: boolean\n clearValueWhenEmpty?: boolean\n virtualized?: boolean\n rowHeight?: number\n returnItemsOnEmpty?: boolean\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof combobox>\n\nconst MultipleUncheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" className={css({ stroke: 'grey.100' })} />\n </svg>\n)\n\nconst MultipleCheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"0.5\" width=\"16\" height=\"16\" rx=\"4\" className={css({ fill: 'primary.500' })} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z\"\n fill=\"white\"\n />\n </svg>\n)\n\ninterface InnerItemProps<Item extends ComboboxItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\nfunction CustomInnerItem<Item extends ComboboxItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useComboboxItemContext()\n\n return (\n <>\n {isMultiple ? context.selected ? <MultipleCheckedIndicator /> : <MultipleUncheckedIndicator /> : null}\n {renderItem ? renderItem(item) : <ItemText truncate>{item.label}</ItemText>}\n </>\n )\n}\n\nexport const Combobox = <T extends ComboboxItem>({\n items: itemsFromUsers = [],\n initialItems,\n debounceMs = 0,\n placeholder,\n emptyLabel,\n loadingLabel,\n usePortal = true,\n withAutoFilter = true,\n positioning,\n loadItems,\n renderItem,\n renderValue,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n multiple = false,\n ...props\n}: ComboboxProps<T>) => {\n const uiLabels = useUiLabels()\n const [items, setItems] = useState(() => itemsFromUsers)\n const [isLoading, setIsLoading] = useState(false)\n const [firstQueryTriggered, setFirstQueryTriggered] = useState(false)\n const asyncMode = typeof loadItems === 'function'\n\n const debouncedLoadItems = useMemo(\n () =>\n loadItems\n ? debounce(async (value: string) => {\n try {\n setFirstQueryTriggered(true)\n setIsLoading(true)\n const newItems = await loadItems(value)\n setItems(newItems)\n } catch (error) {\n console.error(error)\n setItems([])\n } finally {\n setIsLoading(false)\n }\n }, debounceMs)\n : null,\n [loadItems, debounceMs],\n )\n\n // A sync, unfiltered list has nothing to derive: read the prop itself. The mirrored\n // `items` state only catches up in an effect, one render late, and zag re-derives the\n // input text from the collection the moment `value` changes: a value set in the same\n // render as the item that carries it was stringified against a list without it, and\n // the input went blank.\n const sourceItems = !asyncMode && !withAutoFilter ? itemsFromUsers : items\n const allItems = [...sourceItems, ...(initialItems ?? [])]\n\n const handleInputChange = useCallback(\n async (details: ArkCombobox.InputValueChangeDetails) => {\n if (\n initialItems &&\n initialItems.length > 0 &&\n !initialItems.find((item: ComboboxItem) => item.label === details.inputValue)\n ) {\n onResetInitialItems?.()\n }\n const { inputValue } = details\n\n if (debouncedLoadItems) {\n debouncedLoadItems(inputValue)\n } else {\n const items =\n withAutoFilter && inputValue !== ''\n ? itemsFromUsers.filter((item: ComboboxItem) => item.label.toLowerCase().includes(inputValue.toLowerCase()))\n : itemsFromUsers\n\n if (items.length === 0 && returnItemsOnEmpty) {\n return setItems(itemsFromUsers)\n }\n setItems(items)\n }\n },\n [debouncedLoadItems, itemsFromUsers, withAutoFilter],\n )\n\n // Keep the visible items in sync with the source list whenever it changes\n // (e.g. options that load asynchronously after mount). Without this, an empty\n // input shows a stale/empty list (the no-results label) until the user types.\n // Consumers memoize `items`, so this only fires on real data changes, not on\n // every keystroke.\n useEffect(() => {\n if (!debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, debouncedLoadItems])\n\n const collection = useMemo(() => createListCollection({ items: allItems }), [allItems])\n\n const effectiveIsLoading = controlledIsLoading ?? isLoading\n\n const loadingContent = loadingLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.loading}\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.noResults}\n </Text>\n )\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"combobox\"\n onInputValueChange={handleInputChange}\n value={value as string[] | undefined}\n {...props}\n multiple={multiple}\n >\n {multiple ? (\n // Tags-input layout: the control (styled via the recipe's `&[data-multiple]`\n // selectors) is the bordered box holding the selected chips and a\n // borderless growing input.\n <ArkCombobox.Context>\n {api => (\n <Control data-multiple=\"true\" data-open={api.open || undefined}>\n {/* Resolve chips from the current value against the full source\n list rather than ark's cached `selectedItems`: the cache is only\n re-derived on value changes, so async-loaded defaults would show\n 0 chips until the user selects something. Looking up in\n itemsFromUsers (never the filtered list) also keeps chips visible\n while the user is typing to filter. */}\n {api.value.map(v => {\n const item = itemsFromUsers.find((i: T) => String(i.value) === String(v))\n if (!item) return null\n return (\n <Chip key={v} size=\"sm\">\n {renderValue ? renderValue(item) : <ChipLabel>{item.label}</ChipLabel>}\n {!props.readOnly && !props.disabled && (\n <ChipClearTrigger\n aria-label={`Retirer ${item.label}`}\n // Remove by strict-equality-safe filter: stored values may\n // be numbers while item.value is compared as a string.\n onClick={() => api.setValue(api.value.filter(x => String(x) !== String(v)))}\n />\n )}\n </Chip>\n )\n })}\n <Input\n asChild\n data-multiple=\"true\"\n placeholder={api.hasSelectedItems ? undefined : placeholder}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n </Control>\n )}\n </ArkCombobox.Context>\n ) : (\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n )}\n </ArkCombobox.Context>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} onClick={onResetInitialItems} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n )}\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {effectiveIsLoading ? (\n loadingContent\n ) : allItems.length === 0 ? (\n <>{asyncMode ? (firstQueryTriggered ? emptyContent : loadingContent) : emptyContent}</>\n ) : virtualized ? (\n <>\n <FixedSizeList\n height={Math.min(rowHeight * allItems.length, 180)}\n itemCount={allItems.length}\n itemSize={rowHeight}\n width=\"100%\"\n >\n {({ index, style }) => (\n <ConditionalWrapper\n key={allItems[index].value}\n when={!!allItems[index].tooltip}\n wrapper={children => <Tooltip label={allItems[index].tooltip}>{children}</Tooltip>}\n >\n <Item key={allItems[index].value} item={allItems[index]} style={style}>\n <CustomInnerItem renderItem={renderItem} item={allItems[index]} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n )}\n </FixedSizeList>\n </>\n ) : (\n allItems.map(item => (\n <ConditionalWrapper\n key={item.value}\n when={!!item.tooltip}\n wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}\n >\n <Item key={item.value} item={item}>\n <CustomInnerItem renderItem={renderItem} item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AAO,YACT,EAAAnE,EAAA,IAAA,CAACf,EAAAA,mBAAD,CAEE,KAAM,CAAC,CAACuD,EAAS4B,EAAM,CAAC,QACxB,QAAS,IAAY,EAAApE,EAAA,IAAA,CAACZ,EAAAA,QAAD,CAAS,MAAOoD,EAAS4B,EAAM,CAAC,QAAU,UAAkB,CAAA,EAEjF,UAAA,EAAApE,EAAA,IAAA,CAACW,EAAD,CAAkC,KAAM6B,EAAS4B,GAAe,QAC9D,UAAA,EAAApE,EAAA,IAAA,CAACiB,EAAD,CAA6B,aAAY,KAAMuB,EAAS4B,GAAQ,WAAYb,CAAW,CAAA,CACnF,EAFKf,EAAS4B,EAAM,CAAC,KAErB,CACY,EAPb5B,EAAS4B,EAAM,CAAC,KAOH,CAET,CAAA,CACf,CAAA,EAEF5B,EAAS,IAAI,IACX,EAAAxC,EAAA,IAAA,CAACf,EAAAA,mBAAD,CAEE,KAAM,CAAC,CAACoC,EAAK,QACb,QAAS,IAAY,EAAArB,EAAA,IAAA,CAACZ,EAAAA,QAAD,CAAS,MAAOiC,EAAK,QAAU,UAAkB,CAAA,EAEtE,UAAA,EAAArB,EAAA,IAAA,CAACW,EAAD,CAA6B,OAC3B,UAAA,EAAAX,EAAA,IAAA,CAACiB,EAAD,CAA6B,aAAkB,OAAM,WAAYsC,CAAW,CAAA,CACxE,EAFKlC,EAAK,KAEV,CACY,EAPbA,EAAK,KAOQ,CACrB,CAEI,CAAA,CACC,CAAA,CACM,CAAA,CAChB,C,EAEV,E"}
@@ -34,4 +34,4 @@ export type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, '
34
34
  rowHeight?: number;
35
35
  returnItemsOnEmpty?: boolean;
36
36
  } & HTMLStyledProps<'div'> & RecipeVariantProps<typeof combobox>;
37
- export declare const Combobox: <T extends ComboboxItem>({ items: itemsFromUsers, initialItems, debounceMs, placeholder, emptyLabel, loadingLabel, usePortal, withAutoFilter, positioning, loadItems, renderItem, renderValue, onResetInitialItems, isLoading: controlledIsLoading, value, openDropdownOnFocus, clearValueWhenEmpty, virtualized, rowHeight, returnItemsOnEmpty, multiple, ...props }: ComboboxProps<T>) => import("react/jsx-runtime").JSX.Element;
37
+ export declare const Combobox: <T extends ComboboxItem>({ items: itemsFromUsers, initialItems, debounceMs, placeholder, emptyLabel, loadingLabel, usePortal, withAutoFilter, positioning, loadItems, renderItem, renderValue, onResetInitialItems, isLoading: controlledIsLoading, value, openDropdownOnFocus, clearValueWhenEmpty, virtualized, rowHeight, returnItemsOnEmpty, multiple, ...props }: ComboboxProps<T>) => import('react').JSX.Element;
@@ -14,7 +14,7 @@ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
14
14
  import { css as v } from "@stokelp/styled-system/css";
15
15
  import { FixedSizeList as ie } from "react-window";
16
16
  import { debounce as ae } from "lodash";
17
- //#region src/components/combobox/Combobox.tsx
17
+ // src/components/combobox/Combobox.tsx
18
18
  var { withProvider: y, withContext: b } = e(f), x = y(d(s.Root), "root", { defaultProps: { loopFocus: !0 } }), S = b(d(s.ClearTrigger), "clearTrigger"), C = b(d(s.Content), "content"), w = b(d(s.Input), "input"), T = b(d(s.Control), "control"), E = b(d(s.Item), "item"), D = b(d(s.ItemText), "itemText"), oe = b(d(s.Positioner), "positioner"), O = b(d(s.Trigger), "trigger"), k = () => /* @__PURE__ */ _("svg", {
19
19
  width: "16",
20
20
  height: "17",
@@ -65,7 +65,9 @@ function j({ item: e, isMultiple: t, renderItem: n }) {
65
65
  var M = ({ items: e = [], initialItems: u, debounceMs: d = 0, placeholder: f, emptyLabel: v, loadingLabel: y, usePortal: b = !0, withAutoFilter: D = !0, positioning: k, loadItems: A, renderItem: M, renderValue: N, onResetInitialItems: P, isLoading: F, value: I, openDropdownOnFocus: L = !0, clearValueWhenEmpty: R = !0, virtualized: z, rowHeight: B = 34, returnItemsOnEmpty: V, multiple: H = !1, ...U }) => {
66
66
  let W = i(), [G, K] = m(() => e), [se, q] = m(!1), [ce, le] = m(!1), J = typeof A == "function", Y = p(() => A ? ae(async (e) => {
67
67
  try {
68
- le(!0), q(!0), K(await A(e));
68
+ le(!0), q(!0);
69
+ let t = await A(e);
70
+ K(t);
69
71
  } catch (e) {
70
72
  console.error(e), K([]);
71
73
  } finally {
@@ -130,7 +132,7 @@ var M = ({ items: e = [], initialItems: u, debounceMs: d = 0, placeholder: f, em
130
132
  "data-multiple": "true",
131
133
  placeholder: t.hasSelectedItems ? void 0 : f,
132
134
  onFocus: () => {
133
- !L || J || t.setOpen(!0);
135
+ L && !J && t.setOpen(!0);
134
136
  },
135
137
  children: /* @__PURE__ */ g(a, {})
136
138
  }),
@@ -161,7 +163,7 @@ var M = ({ items: e = [], initialItems: u, debounceMs: d = 0, placeholder: f, em
161
163
  R && n === "" && e.clearValue();
162
164
  },
163
165
  onFocus: () => {
164
- !L || J || e.setOpen(!0);
166
+ L && !J && e.setOpen(!0);
165
167
  },
166
168
  children: /* @__PURE__ */ g(a, {})
167
169
  }) }),
@@ -242,7 +244,6 @@ var M = ({ items: e = [], initialItems: u, debounceMs: d = 0, placeholder: f, em
242
244
  })]
243
245
  });
244
246
  };
245
- //#endregion
246
247
  export { M as Combobox };
247
248
 
248
249
  //# sourceMappingURL=Combobox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.js","names":[],"sources":["../../../src/components/combobox/Combobox.tsx"],"sourcesContent":["import {\n Combobox as ArkCombobox,\n type ComboboxRootProps,\n createListCollection,\n Portal,\n useComboboxItemContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { debounce } from 'lodash'\n\nimport { combobox } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input as UIInput } from '~/components/input'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport { Chip, ChipClearTrigger, ChipLabel } from '~/components/chip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { FixedSizeList } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(combobox)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkCombobox.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkCombobox.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkCombobox.Content), 'content')\nconst Input = withContext(styled(ArkCombobox.Input), 'input')\nconst Control = withContext(styled(ArkCombobox.Control), 'control')\nconst Item = withContext(styled(ArkCombobox.Item), 'item')\nconst ItemText = withContext(styled(ArkCombobox.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkCombobox.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkCombobox.Trigger), 'trigger')\n\nexport type ComboboxItem = {\n value: string | number\n label: string\n disabled?: boolean\n tooltip?: ReactNode\n}\n\nexport type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value'> & {\n value?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n /**\n * Renders the inner content of each selected chip in `multiple` mode.\n * Receives the selected item and should return the chip body (the removable\n * clear button is appended automatically). Defaults to the item label.\n */\n renderValue?: (item: T) => ReactNode\n loadItems?: (inputValue: string) => Promise<T[]>\n debounceMs?: number\n emptyLabel?: ReactNode\n loadingLabel?: ReactNode\n placeholder?: string\n usePortal?: boolean\n isLoading?: boolean\n withAutoFilter?: boolean\n onResetInitialItems?: () => void\n openDropdownOnFocus?: boolean\n clearValueWhenEmpty?: boolean\n virtualized?: boolean\n rowHeight?: number\n returnItemsOnEmpty?: boolean\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof combobox>\n\nconst MultipleUncheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" className={css({ stroke: 'grey.100' })} />\n </svg>\n)\n\nconst MultipleCheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"0.5\" width=\"16\" height=\"16\" rx=\"4\" className={css({ fill: 'primary.500' })} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z\"\n fill=\"white\"\n />\n </svg>\n)\n\ninterface InnerItemProps<Item extends ComboboxItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\nfunction CustomInnerItem<Item extends ComboboxItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useComboboxItemContext()\n\n return (\n <>\n {isMultiple ? context.selected ? <MultipleCheckedIndicator /> : <MultipleUncheckedIndicator /> : null}\n {renderItem ? renderItem(item) : <ItemText truncate>{item.label}</ItemText>}\n </>\n )\n}\n\nexport const Combobox = <T extends ComboboxItem>({\n items: itemsFromUsers = [],\n initialItems,\n debounceMs = 0,\n placeholder,\n emptyLabel,\n loadingLabel,\n usePortal = true,\n withAutoFilter = true,\n positioning,\n loadItems,\n renderItem,\n renderValue,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n multiple = false,\n ...props\n}: ComboboxProps<T>) => {\n const uiLabels = useUiLabels()\n const [items, setItems] = useState(() => itemsFromUsers)\n const [isLoading, setIsLoading] = useState(false)\n const [firstQueryTriggered, setFirstQueryTriggered] = useState(false)\n const asyncMode = typeof loadItems === 'function'\n\n const debouncedLoadItems = useMemo(\n () =>\n loadItems\n ? debounce(async (value: string) => {\n try {\n setFirstQueryTriggered(true)\n setIsLoading(true)\n const newItems = await loadItems(value)\n setItems(newItems)\n } catch (error) {\n console.error(error)\n setItems([])\n } finally {\n setIsLoading(false)\n }\n }, debounceMs)\n : null,\n [loadItems, debounceMs],\n )\n\n // A sync, unfiltered list has nothing to derive: read the prop itself. The mirrored\n // `items` state only catches up in an effect, one render late, and zag re-derives the\n // input text from the collection the moment `value` changes: a value set in the same\n // render as the item that carries it was stringified against a list without it, and\n // the input went blank.\n const sourceItems = !asyncMode && !withAutoFilter ? itemsFromUsers : items\n const allItems = [...sourceItems, ...(initialItems ?? [])]\n\n const handleInputChange = useCallback(\n async (details: ArkCombobox.InputValueChangeDetails) => {\n if (\n initialItems &&\n initialItems.length > 0 &&\n !initialItems.find((item: ComboboxItem) => item.label === details.inputValue)\n ) {\n onResetInitialItems?.()\n }\n const { inputValue } = details\n\n if (debouncedLoadItems) {\n debouncedLoadItems(inputValue)\n } else {\n const items =\n withAutoFilter && inputValue !== ''\n ? itemsFromUsers.filter((item: ComboboxItem) => item.label.toLowerCase().includes(inputValue.toLowerCase()))\n : itemsFromUsers\n\n if (items.length === 0 && returnItemsOnEmpty) {\n return setItems(itemsFromUsers)\n }\n setItems(items)\n }\n },\n [debouncedLoadItems, itemsFromUsers, withAutoFilter],\n )\n\n // Keep the visible items in sync with the source list whenever it changes\n // (e.g. options that load asynchronously after mount). Without this, an empty\n // input shows a stale/empty list (the no-results label) until the user types.\n // Consumers memoize `items`, so this only fires on real data changes, not on\n // every keystroke.\n useEffect(() => {\n if (!debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, debouncedLoadItems])\n\n const collection = useMemo(() => createListCollection({ items: allItems }), [allItems])\n\n const effectiveIsLoading = controlledIsLoading ?? isLoading\n\n const loadingContent = loadingLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.loading}\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.noResults}\n </Text>\n )\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"combobox\"\n onInputValueChange={handleInputChange}\n value={value as string[] | undefined}\n {...props}\n multiple={multiple}\n >\n {multiple ? (\n // Tags-input layout: the control (styled via the recipe's `&[data-multiple]`\n // selectors) is the bordered box holding the selected chips and a\n // borderless growing input.\n <ArkCombobox.Context>\n {api => (\n <Control data-multiple=\"true\" data-open={api.open || undefined}>\n {/* Resolve chips from the current value against the full source\n list rather than ark's cached `selectedItems`: the cache is only\n re-derived on value changes, so async-loaded defaults would show\n 0 chips until the user selects something. Looking up in\n itemsFromUsers (never the filtered list) also keeps chips visible\n while the user is typing to filter. */}\n {api.value.map(v => {\n const item = itemsFromUsers.find((i: T) => String(i.value) === String(v))\n if (!item) return null\n return (\n <Chip key={v} size=\"sm\">\n {renderValue ? renderValue(item) : <ChipLabel>{item.label}</ChipLabel>}\n {!props.readOnly && !props.disabled && (\n <ChipClearTrigger\n aria-label={`Retirer ${item.label}`}\n // Remove by strict-equality-safe filter: stored values may\n // be numbers while item.value is compared as a string.\n onClick={() => api.setValue(api.value.filter(x => String(x) !== String(v)))}\n />\n )}\n </Chip>\n )\n })}\n <Input\n asChild\n data-multiple=\"true\"\n placeholder={api.hasSelectedItems ? undefined : placeholder}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n </Control>\n )}\n </ArkCombobox.Context>\n ) : (\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n )}\n </ArkCombobox.Context>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} onClick={onResetInitialItems} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n )}\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {effectiveIsLoading ? (\n loadingContent\n ) : allItems.length === 0 ? (\n <>{asyncMode ? (firstQueryTriggered ? emptyContent : loadingContent) : emptyContent}</>\n ) : virtualized ? (\n <>\n <FixedSizeList\n height={Math.min(rowHeight * allItems.length, 180)}\n itemCount={allItems.length}\n itemSize={rowHeight}\n width=\"100%\"\n >\n {({ index, style }) => (\n <ConditionalWrapper\n key={allItems[index].value}\n when={!!allItems[index].tooltip}\n wrapper={children => <Tooltip label={allItems[index].tooltip}>{children}</Tooltip>}\n >\n <Item key={allItems[index].value} item={allItems[index]} style={style}>\n <CustomInnerItem renderItem={renderItem} item={allItems[index]} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n )}\n </FixedSizeList>\n </>\n ) : (\n allItems.map(item => (\n <ConditionalWrapper\n key={item.value}\n when={!!item.tooltip}\n wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}\n >\n <Item key={item.value} item={item}>\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n ))\n )}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n </Root>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,IAAM,EAAE,iBAAc,mBAAgB,EAAmB,CAAQ,GAG3D,IAAO,EAAa,EAAO,EAAY,IAAS,GAAG,QAAQ,EAC/D,cAAc,EACZ,WAAW,GACb,EACF,CAAC,GAEK,IAAe,EAAY,EAAO,EAAY,YAAY,GAAG,cAAc,GAC3E,IAAU,EAAY,EAAO,EAAY,OAAO,GAAG,SAAS,GAC5D,IAAQ,EAAY,EAAO,EAAY,KAAK,GAAG,OAAO,GACtD,IAAU,EAAY,EAAO,EAAY,OAAO,GAAG,SAAS,GAC5D,IAAO,EAAY,EAAO,EAAY,IAAI,GAAG,MAAM,GACnD,IAAW,EAAY,EAAO,EAAY,QAAQ,GAAG,UAAU,GAC/D,KAAa,EAAY,EAAO,EAAY,UAAU,GAAG,YAAY,GACrE,IAAU,EAAY,EAAO,EAAY,OAAO,GAAG,SAAS,GAqC5D,UACJ,kBAAC,OAAD;CAAK,OAAM;CAAK,QAAO;CAAK,SAAQ;CAAY,MAAK;CAAO,OAAM;WAAlE,CACE,kBAAC,QAAD;EAAM,GAAE;EAAM,GAAE;EAAI,OAAM;EAAK,QAAO;EAAK,IAAG;EAAM,MAAK;CAAS,CAAA,GAClE,kBAAC,QAAD;EAAM,GAAE;EAAM,GAAE;EAAI,OAAM;EAAK,QAAO;EAAK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,EAAS,GAAO,KAOH;GAET,CAAA,EACf,CAAA,IAEF,EAAS,KAAI,MACX,kBAAC,GAAD;IAEE,MAAM,CAAC,CAAC,EAAK;IACb,UAAS,MAAY,kBAAC,GAAD;KAAS,OAAO,EAAK;KAAU;IAAkB,CAAA;cAEtE,kBAAC,GAAD;KAA6B;eAC3B,kBAAC,GAAD;MAA6B;MAAkB;MAAM,YAAY;KAAW,CAAA;IACxE,GAFK,EAAK,KAEV;GACY,GAPb,EAAK,KAOQ,CACrB,EAEI,CAAA,EACC,CAAA;EACM,CAAA,CAChB;;AAEV"}
1
+ {"version":3,"file":"Combobox.js","names":["ArkCombobox","_Fragment","Combobox","UIInput","Tooltip","Tooltip$1","Input$1","Fragment$1","createStyleContext","combobox","Root","withProvider","styled","Combobox","ClearTrigger","withContext","Content","Input","Control","Item","ItemText","Positioner","Trigger","MultipleUncheckedIndicator","css","MultipleCheckedIndicator","CustomInnerItem","context","useComboboxItemContext","isMultiple","renderItem","item","Combobox$1","itemsFromUsers","controlledIsLoading","props","uiLabels","useUiLabels","items","setItems","useState","isLoading","setIsLoading","firstQueryTriggered","setFirstQueryTriggered","asyncMode","loadItems","debouncedLoadItems","useMemo","debounce","newItems","value","error","debounceMs","allItems","withAutoFilter","initialItems","handleInputChange","useCallback","details","onResetInitialItems","inputValue","returnItemsOnEmpty","collection","createListCollection","effectiveIsLoading","loadingContent","loadingLabel","Text","emptyContent","emptyLabel","positioning","multiple","api","i","v","Chip","renderValue","ChipLabel","ChipClearTrigger","x","placeholder","openDropdownOnFocus","e","clearValueWhenEmpty","ConditionalWrapper","usePortal","Portal","virtualized","FixedSizeList","rowHeight","index"],"sources":["../../../src/components/combobox/Combobox.tsx"],"sourcesContent":["import {\n Combobox as ArkCombobox,\n type ComboboxRootProps,\n createListCollection,\n Portal,\n useComboboxItemContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { debounce } from 'lodash'\n\nimport { combobox } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input as UIInput } from '~/components/input'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport { Chip, ChipClearTrigger, ChipLabel } from '~/components/chip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { FixedSizeList } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(combobox)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkCombobox.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkCombobox.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkCombobox.Content), 'content')\nconst Input = withContext(styled(ArkCombobox.Input), 'input')\nconst Control = withContext(styled(ArkCombobox.Control), 'control')\nconst Item = withContext(styled(ArkCombobox.Item), 'item')\nconst ItemText = withContext(styled(ArkCombobox.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkCombobox.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkCombobox.Trigger), 'trigger')\n\nexport type ComboboxItem = {\n value: string | number\n label: string\n disabled?: boolean\n tooltip?: ReactNode\n}\n\nexport type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value'> & {\n value?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n /**\n * Renders the inner content of each selected chip in `multiple` mode.\n * Receives the selected item and should return the chip body (the removable\n * clear button is appended automatically). Defaults to the item label.\n */\n renderValue?: (item: T) => ReactNode\n loadItems?: (inputValue: string) => Promise<T[]>\n debounceMs?: number\n emptyLabel?: ReactNode\n loadingLabel?: ReactNode\n placeholder?: string\n usePortal?: boolean\n isLoading?: boolean\n withAutoFilter?: boolean\n onResetInitialItems?: () => void\n openDropdownOnFocus?: boolean\n clearValueWhenEmpty?: boolean\n virtualized?: boolean\n rowHeight?: number\n returnItemsOnEmpty?: boolean\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof combobox>\n\nconst MultipleUncheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" className={css({ stroke: 'grey.100' })} />\n </svg>\n)\n\nconst MultipleCheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"0.5\" width=\"16\" height=\"16\" rx=\"4\" className={css({ fill: 'primary.500' })} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z\"\n fill=\"white\"\n />\n </svg>\n)\n\ninterface InnerItemProps<Item extends ComboboxItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\nfunction CustomInnerItem<Item extends ComboboxItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useComboboxItemContext()\n\n return (\n <>\n {isMultiple ? context.selected ? <MultipleCheckedIndicator /> : <MultipleUncheckedIndicator /> : null}\n {renderItem ? renderItem(item) : <ItemText truncate>{item.label}</ItemText>}\n </>\n )\n}\n\nexport const Combobox = <T extends ComboboxItem>({\n items: itemsFromUsers = [],\n initialItems,\n debounceMs = 0,\n placeholder,\n emptyLabel,\n loadingLabel,\n usePortal = true,\n withAutoFilter = true,\n positioning,\n loadItems,\n renderItem,\n renderValue,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n multiple = false,\n ...props\n}: ComboboxProps<T>) => {\n const uiLabels = useUiLabels()\n const [items, setItems] = useState(() => itemsFromUsers)\n const [isLoading, setIsLoading] = useState(false)\n const [firstQueryTriggered, setFirstQueryTriggered] = useState(false)\n const asyncMode = typeof loadItems === 'function'\n\n const debouncedLoadItems = useMemo(\n () =>\n loadItems\n ? debounce(async (value: string) => {\n try {\n setFirstQueryTriggered(true)\n setIsLoading(true)\n const newItems = await loadItems(value)\n setItems(newItems)\n } catch (error) {\n console.error(error)\n setItems([])\n } finally {\n setIsLoading(false)\n }\n }, debounceMs)\n : null,\n [loadItems, debounceMs],\n )\n\n // A sync, unfiltered list has nothing to derive: read the prop itself. The mirrored\n // `items` state only catches up in an effect, one render late, and zag re-derives the\n // input text from the collection the moment `value` changes: a value set in the same\n // render as the item that carries it was stringified against a list without it, and\n // the input went blank.\n const sourceItems = !asyncMode && !withAutoFilter ? itemsFromUsers : items\n const allItems = [...sourceItems, ...(initialItems ?? [])]\n\n const handleInputChange = useCallback(\n async (details: ArkCombobox.InputValueChangeDetails) => {\n if (\n initialItems &&\n initialItems.length > 0 &&\n !initialItems.find((item: ComboboxItem) => item.label === details.inputValue)\n ) {\n onResetInitialItems?.()\n }\n const { inputValue } = details\n\n if (debouncedLoadItems) {\n debouncedLoadItems(inputValue)\n } else {\n const items =\n withAutoFilter && inputValue !== ''\n ? itemsFromUsers.filter((item: ComboboxItem) => item.label.toLowerCase().includes(inputValue.toLowerCase()))\n : itemsFromUsers\n\n if (items.length === 0 && returnItemsOnEmpty) {\n return setItems(itemsFromUsers)\n }\n setItems(items)\n }\n },\n [debouncedLoadItems, itemsFromUsers, withAutoFilter],\n )\n\n // Keep the visible items in sync with the source list whenever it changes\n // (e.g. options that load asynchronously after mount). Without this, an empty\n // input shows a stale/empty list (the no-results label) until the user types.\n // Consumers memoize `items`, so this only fires on real data changes, not on\n // every keystroke.\n useEffect(() => {\n if (!debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, debouncedLoadItems])\n\n const collection = useMemo(() => createListCollection({ items: allItems }), [allItems])\n\n const effectiveIsLoading = controlledIsLoading ?? isLoading\n\n const loadingContent = loadingLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.loading}\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.noResults}\n </Text>\n )\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"combobox\"\n onInputValueChange={handleInputChange}\n value={value as string[] | undefined}\n {...props}\n multiple={multiple}\n >\n {multiple ? (\n // Tags-input layout: the control (styled via the recipe's `&[data-multiple]`\n // selectors) is the bordered box holding the selected chips and a\n // borderless growing input.\n <ArkCombobox.Context>\n {api => (\n <Control data-multiple=\"true\" data-open={api.open || undefined}>\n {/* Resolve chips from the current value against the full source\n list rather than ark's cached `selectedItems`: the cache is only\n re-derived on value changes, so async-loaded defaults would show\n 0 chips until the user selects something. Looking up in\n itemsFromUsers (never the filtered list) also keeps chips visible\n while the user is typing to filter. */}\n {api.value.map(v => {\n const item = itemsFromUsers.find((i: T) => String(i.value) === String(v))\n if (!item) return null\n return (\n <Chip key={v} size=\"sm\">\n {renderValue ? renderValue(item) : <ChipLabel>{item.label}</ChipLabel>}\n {!props.readOnly && !props.disabled && (\n <ChipClearTrigger\n aria-label={`Retirer ${item.label}`}\n // Remove by strict-equality-safe filter: stored values may\n // be numbers while item.value is compared as a string.\n onClick={() => api.setValue(api.value.filter(x => String(x) !== String(v)))}\n />\n )}\n </Chip>\n )\n })}\n <Input\n asChild\n data-multiple=\"true\"\n placeholder={api.hasSelectedItems ? undefined : placeholder}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n </Control>\n )}\n </ArkCombobox.Context>\n ) : (\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n )}\n </ArkCombobox.Context>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} onClick={onResetInitialItems} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n )}\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {effectiveIsLoading ? (\n loadingContent\n ) : allItems.length === 0 ? (\n <>{asyncMode ? (firstQueryTriggered ? emptyContent : loadingContent) : emptyContent}</>\n ) : virtualized ? (\n <>\n <FixedSizeList\n height={Math.min(rowHeight * allItems.length, 180)}\n itemCount={allItems.length}\n itemSize={rowHeight}\n width=\"100%\"\n >\n {({ index, style }) => (\n <ConditionalWrapper\n key={allItems[index].value}\n when={!!allItems[index].tooltip}\n wrapper={children => <Tooltip label={allItems[index].tooltip}>{children}</Tooltip>}\n >\n <Item key={allItems[index].value} item={allItems[index]} style={style}>\n <CustomInnerItem renderItem={renderItem} item={allItems[index]} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n )}\n </FixedSizeList>\n </>\n ) : (\n allItems.map(item => (\n <ConditionalWrapper\n key={item.value}\n when={!!item.tooltip}\n wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}\n >\n <Item key={item.value} item={item}>\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n ))\n )}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n </Root>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,IAAM,EAAE,iBAAc,mBAAgBQ,EAAmBC,CAAQ,GAG3DC,IAAOC,EAAaC,EAAOZ,EAAY,IAAS,GAAG,QAAQ,EAC/D,cAAc,EACZ,WAAW,GACb,EACF,CAAC,GAEKc,IAAeC,EAAYH,EAAOZ,EAAY,YAAY,GAAG,cAAc,GAC3EgB,IAAUD,EAAYH,EAAOZ,EAAY,OAAO,GAAG,SAAS,GAC5DiB,IAAQF,EAAYH,EAAOZ,EAAY,KAAK,GAAG,OAAO,GACtDkB,IAAUH,EAAYH,EAAOZ,EAAY,OAAO,GAAG,SAAS,GAC5DmB,IAAOJ,EAAYH,EAAOZ,EAAY,IAAI,GAAG,MAAM,GACnDoB,IAAWL,EAAYH,EAAOZ,EAAY,QAAQ,GAAG,UAAU,GAC/DqB,KAAaN,EAAYH,EAAOZ,EAAY,UAAU,GAAG,YAAY,GACrEsB,IAAUP,EAAYH,EAAOZ,EAAY,O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ourcesContent":["import { datepicker } from '@stokelp/styled-system/recipes'\nimport { DatePicker as ArkDatePicker, Portal } from '@ark-ui/react'\nimport { createStyleContext } from '~/utils/slots'\nimport { ComponentProps, FC } from 'react'\nimport { IconButton, Input, InputAddon, InputGroup } from '~/components'\nimport { styled } from '@stokelp/styled-system/jsx'\n\nconst { withProvider, withContext } = createStyleContext(datepicker)\n\nconst DatePickerRoot = withProvider(ArkDatePicker.Root, 'root', {\n defaultProps: {\n positioning: {\n placement: 'bottom-start',\n },\n view: 'day',\n locale: 'fr',\n unmountOnExit: true,\n lazyMount: true,\n startOfWeek: 6,\n },\n})\nconst DatePickerContent = withContext(ArkDatePicker.Content, 'content')\nconst DatePickerControl = withContext(ArkDatePicker.Control, 'control')\nconst DatePickerInput = withContext(ArkDatePicker.Input, 'input')\nconst DatePickerMonthSelect = withContext(ArkDatePicker.MonthSelect, 'monthSelect')\nconst DatePickerNextTrigger = withContext(ArkDatePicker.NextTrigger, 'nextTrigger')\nconst DatePickerPositioner = withContext(ArkDatePicker.Positioner, 'positioner')\nconst DatePickerPrevTrigger = withContext(ArkDatePicker.PrevTrigger, 'prevTrigger')\nconst DatePickerTableBody = withContext(ArkDatePicker.TableBody, 'tableBody')\nconst DatePickerTableCell = withContext(ArkDatePicker.TableCell, 'tableCell')\nconst DatePickerTableCellTrigger = withContext(ArkDatePicker.TableCellTrigger, 'tableCellTrigger')\nconst DatePickerTableHead = withContext(ArkDatePicker.TableHead, 'tableHead')\nconst DatePickerTableHeader = withContext(ArkDatePicker.TableHeader, 'tableHeader')\nconst DatePickerTable = withContext(ArkDatePicker.Table, 'table')\nconst DatePickerTableRow = withContext(ArkDatePicker.TableRow, 'tableRow')\nconst DatePickerTrigger = withContext(ArkDatePicker.Trigger, 'trigger')\nconst DatePickerViewControl = withContext(ArkDatePicker.ViewControl, 'viewControl')\nconst DatePickerView = withContext(ArkDatePicker.View, 'view')\nconst DatePickerYearSelect = withContext(ArkDatePicker.YearSelect, 'yearSelect')\nconst ClearTrigger = withContext(styled(ArkDatePicker.ClearTrigger), 'clearTrigger')\n\nexport type DatePickerProps = ComponentProps<typeof DatePickerRoot> & {\n placeholder?: string\n clearValueWhenEmpty?: boolean\n preflightClassName?: string\n}\n\nconst DateIcon = () => (\n <svg width=\"23\" height=\"24\" viewBox=\"0 0 23 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M6.46875 2.25C6.8657 2.25 7.1875 2.58579 7.1875 3V4.5H15.8125V3C15.8125 2.58579 16.1343 2.25 16.5312 2.25C16.9282 2.25 17.25 2.58579 17.25 3V4.5H17.9688C19.5566 4.5 20.8438 5.84315 20.8438 7.5V18.75C20.8438 20.4069 19.5566 21.75 17.9688 21.75H5.03125C3.44343 21.75 2.15625 20.4069 2.15625 18.75V7.5C2.15625 5.84315 3.44343 4.5 5.03125 4.5H5.75V3C5.75 2.58579 6.0718 2.25 6.46875 2.25ZM5.03125 6C4.23734 6 3.59375 6.67157 3.59375 7.5V8.65135C4.01662 8.39609 4.50759 8.25 5.03125 8.25H17.9688C18.4924 8.25 18.9834 8.39609 19.4062 8.65135V7.5C19.4062 6.67157 18.7627 6 17.9688 6H5.03125ZM19.4062 11.25C19.4062 10.4216 18.7627 9.75 17.9688 9.75H5.03125C4.23734 9.75 3.59375 10.4216 3.59375 11.25V18.75C3.59375 19.5784 4.23734 20.25 5.03125 20.25H17.9688C18.7627 20.25 19.4062 19.5784 19.4062 18.75V11.25ZM10.7812 12.75C10.7812 12.3358 11.103 12 11.5 12H11.5072C11.9041 12 12.2259 12.3358 12.2259 12.75V12.7575C12.2259 13.1717 11.9041 13.5075 11.5072 13.5075H11.5C11.103 13.5075 10.7812 13.1717 10.7812 12.7575V12.75ZM12.9375 12.75C12.9375 12.3358 13.2593 12 13.6562 12H13.6634C14.0604 12 14.3822 12.3358 14.3822 12.75V12.7575C14.3822 13.1717 14.0604 13.5075 13.6634 13.5075H13.6562C13.2593 13.5075 12.9375 13.1717 12.9375 12.7575V12.75ZM15.0938 12.75C15.0938 12.3358 15.4155 12 15.8125 12H15.8197C16.2166 12 16.5384 12.3358 16.5384 12.75V12.7575C16.5384 13.1717 16.2166 13.5075 15.8197 13.5075H15.8125C15.4155 13.5075 15.0938 13.1717 15.0938 12.7575V12.75ZM6.46875 15C6.46875 14.5858 6.79054 14.25 7.1875 14.25H7.19469C7.59164 14.25 7.91344 14.5858 7.91344 15V15.0075C7.91344 15.4217 7.59164 15.7575 7.19469 15.7575H7.1875C6.79054 15.7575 6.46875 15.4217 6.46875 15.0075V15ZM8.625 15C8.625 14.5858 8.94679 14.25 9.34375 14.25H9.35094C9.74789 14.25 10.0697 14.5858 10.0697 15V15.0075C10.0697 15.4217 9.74789 15.7575 9.35094 15.7575H9.34375C8.94679 15.7575 8.625 15.4217 8.625 15.0075V15ZM10.7812 15C10.7812 14.5858 11.103 14.25 11.5 14.25H11.5072C11.9041 14.25 12.2259 14.5858 12.2259 15V15.0075C12.2259 15.4217 11.9041 15.7575 11.5072 15.7575H11.5C11.103 15.7575 10.7812 15.4217 10.7812 15.0075V15ZM12.9375 15C12.9375 14.5858 13.2593 14.25 13.6562 14.25H13.6634C14.0604 14.25 14.3822 14.5858 14.3822 15V15.0075C14.3822 15.4217 14.0604 15.7575 13.6634 15.7575H13.6562C13.2593 15.7575 12.9375 15.4217 12.9375 15.0075V15ZM15.0938 15C15.0938 14.5858 15.4155 14.25 15.8125 14.25H15.8197C16.2166 14.25 16.5384 14.5858 16.5384 15V15.0075C16.5384 15.4217 16.2166 15.7575 15.8197 15.7575H15.8125C15.4155 15.7575 15.0938 15.4217 15.0938 15.0075V15ZM6.46875 17.25C6.46875 16.8358 6.79054 16.5 7.1875 16.5H7.19469C7.59164 16.5 7.91344 16.8358 7.91344 17.25V17.2575C7.91344 17.6717 7.59164 18.0075 7.19469 18.0075H7.1875C6.79054 18.0075 6.46875 17.6717 6.46875 17.2575V17.25ZM8.625 17.25C8.625 16.8358 8.94679 16.5 9.34375 16.5H9.35094C9.74789 16.5 10.0697 16.8358 10.0697 17.25V17.2575C10.0697 17.6717 9.74789 18.0075 9.35094 18.0075H9.34375C8.94679 18.0075 8.625 17.6717 8.625 17.2575V17.25ZM10.7812 17.25C10.7812 16.8358 11.103 16.5 11.5 16.5H11.5072C11.9041 16.5 12.2259 16.8358 12.2259 17.25V17.2575C12.2259 17.6717 11.9041 18.0075 11.5072 18.0075H11.5C11.103 18.0075 10.7812 17.6717 10.7812 17.2575V17.25ZM12.9375 17.25C12.9375 16.8358 13.2593 16.5 13.6562 16.5H13.6634C14.0604 16.5 14.3822 16.8358 14.3822 17.25V17.2575C14.3822 17.6717 14.0604 18.0075 13.6634 18.0075H13.6562C13.2593 18.0075 12.9375 17.6717 12.9375 17.2575V17.25Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nconst ChevronLeftIcon = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L10.1464 2.64645C10.3417 2.45119 10.6583 2.45119 10.8536 2.64645C11.0488 2.84171 11.0488 3.15829 10.8536 3.35355L6.20711 8L10.8536 12.6464C11.0488 12.8417 11.0488 13.1583 10.8536 13.3536C10.6583 13.5488 10.3417 13.5488 10.1464 13.3536L5.14645 8.35355Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nconst ChevronRightIcon = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10.8536 7.64645C11.0488 7.84171 11.0488 8.15829 10.8536 8.35355L5.85355 13.3536C5.65829 13.5488 5.34171 13.5488 5.14645 13.3536C4.95118 13.1583 4.95118 12.8417 5.14645 12.6464L9.79289 8L5.14645 3.35355C4.95118 3.15829 4.95118 2.84171 5.14645 2.64645C5.34171 2.45118 5.65829 2.45118 5.85355 2.64645L10.8536 7.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nexport const DatePicker: FC<DatePickerProps> = ({\n placeholder,\n preflightClassName,\n selectionMode,\n clearValueWhenEmpty = true,\n ...props\n}) => {\n const isRange = selectionMode === 'range'\n\n return (\n <DatePickerRoot\n startOfWeek={1}\n {...props}\n selectionMode={selectionMode}\n onValueChange={value =>\n props.onValueChange?.({ ...value, valueAsString: value.value.length ? [value.value.toString()] : [] })\n }\n >\n <ArkDatePicker.Context>\n {api => (\n <DatePickerControl>\n <InputGroup>\n <DatePickerInput asChild index={0} placeholder={placeholder}>\n <Input\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n />\n </DatePickerInput>\n <InputAddon>\n <ClearTrigger asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n\n <DatePickerTrigger style={{ cursor: 'pointer' }}>\n <DateIcon />\n </DatePickerTrigger>\n </InputAddon>\n </InputGroup>\n {isRange ? (\n <InputGroup>\n <DatePickerInput asChild index={1} placeholder={placeholder}>\n <Input\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n />\n </DatePickerInput>\n <InputAddon>\n {api.value.length === 2 ? (\n <ClearTrigger asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n ) : null}\n <DatePickerTrigger>\n <DateIcon />\n </DatePickerTrigger>\n </InputAddon>\n </InputGroup>\n ) : null}\n </DatePickerControl>\n )}\n </ArkDatePicker.Context>\n <Portal>\n <DatePickerPositioner className={preflightClassName}>\n <DatePickerContent>\n <DatePickerView view=\"day\">\n <ArkDatePicker.Context>\n {api => (\n <>\n <DatePickerViewControl>\n <DatePickerPrevTrigger asChild>\n <IconButton aria-label=\"prev\" variant=\"secondary\" size=\"md\">\n <ChevronLeftIcon />\n </IconButton>\n </DatePickerPrevTrigger>\n <DatePickerMonthSelect />\n <DatePickerYearSelect />\n <DatePickerNextTrigger asChild>\n <IconButton aria-label=\"next\" variant=\"secondary\" size=\"md\">\n <ChevronRightIcon />\n </IconButton>\n </DatePickerNextTrigger>\n </DatePickerViewControl>\n <DatePickerTable>\n <DatePickerTableHead>\n <DatePickerTableRow>\n {api.weekDays.map((weekDay, id) => (\n <DatePickerTableHeader key={id}>{weekDay.short}</DatePickerTableHeader>\n ))}\n </DatePickerTableRow>\n </DatePickerTableHead>\n <DatePickerTableBody>\n {api.weeks.map((week, id) => (\n <DatePickerTableRow key={id}>\n {week.map((day, id) => (\n <DatePickerTableCell key={id} value={day}>\n <DatePickerTableCellTrigger asChild>\n <button>{day.day}</button>\n </DatePickerTableCellTrigger>\n </DatePickerTableCell>\n ))}\n </DatePickerTableRow>\n ))}\n </DatePickerTableBody>\n </DatePickerTable>\n </>\n )}\n </ArkDatePicker.Context>\n </DatePickerView>\n </DatePickerContent>\n </DatePickerPositioner>\n </Portal>\n </DatePickerRoot>\n )\n}\n"],"mappings":"6VAOA,GAAM,CAAE,eAAc,eAAgB,EAAA,mBAAmB,EAAA,UAAU,EAE7D,EAAiB,EAAa,EAAA,WAAc,KAAM,OAAQ,CAC9D,aAAc,CACZ,YAAa,CACX,UAAW,cACb,EACA,KAAM,MACN,OAAQ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DatePicker","styled","InputGroup","Input","InputAddon","Portal","_Fragment","IconButton","require_slots","require_IconButton","require_Input","require_InputAddon","require_InputGroup","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react_jsx_runtime","DatePickerRoot","withProvider","DatePickerContent","withContext","DatePickerControl","DatePickerInput","DatePickerMonthSelect","DatePickerNextTrigger","DatePickerPositioner","DatePickerPrevTrigger","DatePickerTableBody","DatePickerTableCell","DatePickerTableCellTrigger","DatePickerTableHead","DatePickerTableHeader","DatePickerTable","DatePickerTableRow","DatePickerTrigger","DatePickerViewControl","DatePickerView","DatePickerYearSelect","ClearTrigger","DateIcon","ChevronLeftIcon","ChevronRightIcon","DatePicker","props","isRange","selectionMode","value","clearValueWhenEmpty","api","preflightClassName","weekDay","id","week","day"],"sources":["../../../src/components/date-picker/DatePicker.tsx"],"sourcesContent":["import { datepicker } from '@stokelp/styled-system/recipes'\nimport { DatePicker as ArkDatePicker, Portal } from '@ark-ui/react'\nimport { createStyleContext } from '~/utils/slots'\nimport { ComponentProps, FC } from 'react'\nimport { IconButton, Input, InputAddon, InputGroup } from '~/components'\nimport { styled } from '@stokelp/styled-system/jsx'\n\nconst { withProvider, withContext } = createStyleContext(datepicker)\n\nconst DatePickerRoot = withProvider(ArkDatePicker.Root, 'root', {\n defaultProps: {\n positioning: {\n placement: 'bottom-start',\n },\n view: 'day',\n locale: 'fr',\n unmountOnExit: true,\n lazyMount: true,\n startOfWeek: 6,\n },\n})\nconst DatePickerContent = withContext(ArkDatePicker.Content, 'content')\nconst DatePickerControl = withContext(ArkDatePicker.Control, 'control')\nconst DatePickerInput = withContext(ArkDatePicker.Input, 'input')\nconst DatePickerMonthSelect = withContext(ArkDatePicker.MonthSelect, 'monthSelect')\nconst DatePickerNextTrigger = withContext(ArkDatePicker.NextTrigger, 'nextTrigger')\nconst DatePickerPositioner = withContext(ArkDatePicker.Positioner, 'positioner')\nconst DatePickerPrevTrigger = withContext(ArkDatePicker.PrevTrigger, 'prevTrigger')\nconst DatePickerTableBody = withContext(ArkDatePicker.TableBody, 'tableBody')\nconst DatePickerTableCell = withContext(ArkDatePicker.TableCell, 'tableCell')\nconst DatePickerTableCellTrigger = withContext(ArkDatePicker.TableCellTrigger, 'tableCellTrigger')\nconst DatePickerTableHead = withContext(ArkDatePicker.TableHead, 'tableHead')\nconst DatePickerTableHeader = withContext(ArkDatePicker.TableHeader, 'tableHeader')\nconst DatePickerTable = withContext(ArkDatePicker.Table, 'table')\nconst DatePickerTableRow = withContext(ArkDatePicker.TableRow, 'tableRow')\nconst DatePickerTrigger = withContext(ArkDatePicker.Trigger, 'trigger')\nconst DatePickerViewControl = withContext(ArkDatePicker.ViewControl, 'viewControl')\nconst DatePickerView = withContext(ArkDatePicker.View, 'view')\nconst DatePickerYearSelect = withContext(ArkDatePicker.YearSelect, 'yearSelect')\nconst ClearTrigger = withContext(styled(ArkDatePicker.ClearTrigger), 'clearTrigger')\n\nexport type DatePickerProps = ComponentProps<typeof DatePickerRoot> & {\n placeholder?: string\n clearValueWhenEmpty?: boolean\n preflightClassName?: string\n}\n\nconst DateIcon = () => (\n <svg width=\"23\" height=\"24\" viewBox=\"0 0 23 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M6.46875 2.25C6.8657 2.25 7.1875 2.58579 7.1875 3V4.5H15.8125V3C15.8125 2.58579 16.1343 2.25 16.5312 2.25C16.9282 2.25 17.25 2.58579 17.25 3V4.5H17.9688C19.5566 4.5 20.8438 5.84315 20.8438 7.5V18.75C20.8438 20.4069 19.5566 21.75 17.9688 21.75H5.03125C3.44343 21.75 2.15625 20.4069 2.15625 18.75V7.5C2.15625 5.84315 3.44343 4.5 5.03125 4.5H5.75V3C5.75 2.58579 6.0718 2.25 6.46875 2.25ZM5.03125 6C4.23734 6 3.59375 6.67157 3.59375 7.5V8.65135C4.01662 8.39609 4.50759 8.25 5.03125 8.25H17.9688C18.4924 8.25 18.9834 8.39609 19.4062 8.65135V7.5C19.4062 6.67157 18.7627 6 17.9688 6H5.03125ZM19.4062 11.25C19.4062 10.4216 18.7627 9.75 17.9688 9.75H5.03125C4.23734 9.75 3.59375 10.4216 3.59375 11.25V18.75C3.59375 19.5784 4.23734 20.25 5.03125 20.25H17.9688C18.7627 20.25 19.4062 19.5784 19.4062 18.75V11.25ZM10.7812 12.75C10.7812 12.3358 11.103 12 11.5 12H11.5072C11.9041 12 12.2259 12.3358 12.2259 12.75V12.7575C12.2259 13.1717 11.9041 13.5075 11.5072 13.5075H11.5C11.103 13.5075 10.7812 13.1717 10.7812 12.7575V12.75ZM12.9375 12.75C12.9375 12.3358 13.2593 12 13.6562 12H13.6634C14.0604 12 14.3822 12.3358 14.3822 12.75V12.7575C14.3822 13.1717 14.0604 13.5075 13.6634 13.5075H13.6562C13.2593 13.5075 12.9375 13.1717 12.9375 12.7575V12.75ZM15.0938 12.75C15.0938 12.3358 15.4155 12 15.8125 12H15.8197C16.2166 12 16.5384 12.3358 16.5384 12.75V12.7575C16.5384 13.1717 16.2166 13.5075 15.8197 13.5075H15.8125C15.4155 13.5075 15.0938 13.1717 15.0938 12.7575V12.75ZM6.46875 15C6.46875 14.5858 6.79054 14.25 7.1875 14.25H7.19469C7.59164 14.25 7.91344 14.5858 7.91344 15V15.0075C7.91344 15.4217 7.59164 15.7575 7.19469 15.7575H7.1875C6.79054 15.7575 6.46875 15.4217 6.46875 15.0075V15ZM8.625 15C8.625 14.5858 8.94679 14.25 9.34375 14.25H9.35094C9.74789 14.25 10.0697 14.5858 10.0697 15V15.0075C10.0697 15.4217 9.74789 15.7575 9.35094 15.7575H9.34375C8.94679 15.7575 8.625 15.4217 8.625 15.0075V15ZM10.7812 15C10.7812 14.5858 11.103 14.25 11.5 14.25H11.5072C11.9041 14.25 12.2259 14.5858 12.2259 15V15.0075C12.2259 15.4217 11.9041 15.7575 11.5072 15.7575H11.5C11.103 15.7575 10.7812 15.4217 10.7812 15.0075V15ZM12.9375 15C12.9375 14.5858 13.2593 14.25 13.6562 14.25H13.6634C14.0604 14.25 14.3822 14.5858 14.3822 15V15.0075C14.3822 15.4217 14.0604 15.7575 13.6634 15.7575H13.6562C13.2593 15.7575 12.9375 15.4217 12.9375 15.0075V15ZM15.0938 15C15.0938 14.5858 15.4155 14.25 15.8125 14.25H15.8197C16.2166 14.25 16.5384 14.5858 16.5384 15V15.0075C16.5384 15.4217 16.2166 15.7575 15.8197 15.7575H15.8125C15.4155 15.7575 15.0938 15.4217 15.0938 15.0075V15ZM6.46875 17.25C6.46875 16.8358 6.79054 16.5 7.1875 16.5H7.19469C7.59164 16.5 7.91344 16.8358 7.91344 17.25V17.2575C7.91344 17.6717 7.59164 18.0075 7.19469 18.0075H7.1875C6.79054 18.0075 6.46875 17.6717 6.46875 17.2575V17.25ZM8.625 17.25C8.625 16.8358 8.94679 16.5 9.34375 16.5H9.35094C9.74789 16.5 10.0697 16.8358 10.0697 17.25V17.2575C10.0697 17.6717 9.74789 18.0075 9.35094 18.0075H9.34375C8.94679 18.0075 8.625 17.6717 8.625 17.2575V17.25ZM10.7812 17.25C10.7812 16.8358 11.103 16.5 11.5 16.5H11.5072C11.9041 16.5 12.2259 16.8358 12.2259 17.25V17.2575C12.2259 17.6717 11.9041 18.0075 11.5072 18.0075H11.5C11.103 18.0075 10.7812 17.6717 10.7812 17.2575V17.25ZM12.9375 17.25C12.9375 16.8358 13.2593 16.5 13.6562 16.5H13.6634C14.0604 16.5 14.3822 16.8358 14.3822 17.25V17.2575C14.3822 17.6717 14.0604 18.0075 13.6634 18.0075H13.6562C13.2593 18.0075 12.9375 17.6717 12.9375 17.2575V17.25Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nconst ChevronLeftIcon = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L10.1464 2.64645C10.3417 2.45119 10.6583 2.45119 10.8536 2.64645C11.0488 2.84171 11.0488 3.15829 10.8536 3.35355L6.20711 8L10.8536 12.6464C11.0488 12.8417 11.0488 13.1583 10.8536 13.3536C10.6583 13.5488 10.3417 13.5488 10.1464 13.3536L5.14645 8.35355Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nconst ChevronRightIcon = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10.8536 7.64645C11.0488 7.84171 11.0488 8.15829 10.8536 8.35355L5.85355 13.3536C5.65829 13.5488 5.34171 13.5488 5.14645 13.3536C4.95118 13.1583 4.95118 12.8417 5.14645 12.6464L9.79289 8L5.14645 3.35355C4.95118 3.15829 4.95118 2.84171 5.14645 2.64645C5.34171 2.45118 5.65829 2.45118 5.85355 2.64645L10.8536 7.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nexport const DatePicker: FC<DatePickerProps> = ({\n placeholder,\n preflightClassName,\n selectionMode,\n clearValueWhenEmpty = true,\n ...props\n}) => {\n const isRange = selectionMode === 'range'\n\n return (\n <DatePickerRoot\n startOfWeek={1}\n {...props}\n selectionMode={selectionMode}\n onValueChange={value =>\n props.onValueChange?.({ ...value, valueAsString: value.value.length ? [value.value.toString()] : [] })\n }\n >\n <ArkDatePicker.Context>\n {api => (\n <DatePickerControl>\n <InputGroup>\n <DatePickerInput asChild index={0} placeholder={placeholder}>\n <Input\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n />\n </DatePickerInput>\n <InputAddon>\n <ClearTrigger asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n\n <DatePickerTrigger style={{ cursor: 'pointer' }}>\n <DateIcon />\n </DatePickerTrigger>\n </InputAddon>\n </InputGroup>\n {isRange ? (\n <InputGroup>\n <DatePickerInput asChild index={1} placeholder={placeholder}>\n <Input\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n />\n </DatePickerInput>\n <InputAddon>\n {api.value.length === 2 ? (\n <ClearTrigger asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n ) : null}\n <DatePickerTrigger>\n <DateIcon />\n </DatePickerTrigger>\n </InputAddon>\n </InputGroup>\n ) : null}\n </DatePickerControl>\n )}\n </ArkDatePicker.Context>\n <Portal>\n <DatePickerPositioner className={preflightClassName}>\n <DatePickerContent>\n <DatePickerView view=\"day\">\n <ArkDatePicker.Context>\n {api => (\n <>\n <DatePickerViewControl>\n <DatePickerPrevTrigger asChild>\n <IconButton aria-label=\"prev\" variant=\"secondary\" size=\"md\">\n <ChevronLeftIcon />\n </IconButton>\n </DatePickerPrevTrigger>\n <DatePickerMonthSelect />\n <DatePickerYearSelect />\n <DatePickerNextTrigger asChild>\n <IconButton aria-label=\"next\" variant=\"secondary\" size=\"md\">\n <ChevronRightIcon />\n </IconButton>\n </DatePickerNextTrigger>\n </DatePickerViewControl>\n <DatePickerTable>\n <DatePickerTableHead>\n <DatePickerTableRow>\n {api.weekDays.map((weekDay, id) => (\n <DatePickerTableHeader key={id}>{weekDay.short}</DatePickerTableHeader>\n ))}\n </DatePickerTableRow>\n </DatePickerTableHead>\n <DatePickerTableBody>\n {api.weeks.map((week, id) => (\n <DatePickerTableRow key={id}>\n {week.map((day, id) => (\n <DatePickerTableCell key={id} value={day}>\n <DatePickerTableCellTrigger asChild>\n <button>{day.day}</button>\n </DatePickerTableCellTrigger>\n </DatePickerTableCell>\n ))}\n </DatePickerTableRow>\n ))}\n </DatePickerTableBody>\n </DatePickerTable>\n </>\n )}\n </ArkDatePicker.Context>\n </DatePickerView>\n </DatePickerContent>\n </DatePickerPositioner>\n </Portal>\n </DatePickerRoot>\n )\n}\n"],"mappings":"A,6VAOA,GAAM,CAAE,eAAc,eAAgBA,EAAAA,mBAAmBC,EAAAA,UAAU,EAE7DkB,EAAiBC,EAAalB,EAAAA,WAAc,KAAM,OAAQ,CAC9D,aAAc,CACZ,YAAa,CACX,UAAW,cACb,EACA,KAAM,MACN,OAAQ,KACR,cAAe,GACf,UAAW,GACX,YAAa,CACf,CACF,CAAC,EACKmB,EAAoBC,EAAYpB,EAAAA,WAAc,QAAS,SAAS,EAChEqB,EAAoBD,EAAYpB,EAAAA,WAAc,QAAS,SAAS,EAChEsB,EAAkBF,EAAYpB,EAAAA,WAAc,MAAO,OAAO,EAC1DuB,EAAwBH,EAAYpB,EAAAA,WAAc,YAAa,aAAa,EAC5EwB,EAAwBJ,EAAYpB,EAAAA,WAAc,YAAa,aAAa,EAC5EyB,EAAuBL,EAAYpB,EAAAA,WAAc,WAAY,YAAY,EACzE0B,EAAwBN,EAAYpB,EAAAA,WAAc,YAAa,aAAa,EAC5E2B,EAAsBP,EAAYpB,EAAAA,WAAc,UAAW,WAAW,EACtE4B,EAAsBR,EAAYpB,EAAAA,WAAc,UAAW,WAAW,EACtE6B,EAA6BT,EAAYpB,EAAAA,WAAc,iBAAkB,kBAAkB,EAC3F8B,EAAsBV,EAAYpB,EAAAA,WAAc,UAAW,WAAW,EACtE+B,EAAwBX,EAAYpB,EAAAA,WAAc,YAAa,aAAa,EAC5EgC,EAAkBZ,EAA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B,CAAA,CACM,C,EAEpB,E"}
@@ -8,7 +8,7 @@ import { DatePicker as a, Portal as o } from "@ark-ui/react";
8
8
  import { styled as s } from "@stokelp/styled-system/jsx";
9
9
  import { datepicker as c } from "@stokelp/styled-system/recipes";
10
10
  import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
11
- //#region src/components/date-picker/DatePicker.tsx
11
+ // src/components/date-picker/DatePicker.tsx
12
12
  var { withProvider: f, withContext: p } = e(c), m = f(a.Root, "root", { defaultProps: {
13
13
  positioning: { placement: "bottom-start" },
14
14
  view: "day",
@@ -147,7 +147,6 @@ var { withProvider: f, withContext: p } = e(c), m = f(a.Root, "root", { defaultP
147
147
  }) })]
148
148
  });
149
149
  };
150
- //#endregion
151
150
  export { L as DatePicker };
152
151
 
153
152
  //# sourceMappingURL=DatePicker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatePicker.js","names":[],"sources":["../../../src/components/date-picker/DatePicker.tsx"],"sourcesContent":["import { datepicker } from '@stokelp/styled-system/recipes'\nimport { DatePicker as ArkDatePicker, Portal } from '@ark-ui/react'\nimport { createStyleContext } from '~/utils/slots'\nimport { ComponentProps, FC } from 'react'\nimport { IconButton, Input, InputAddon, InputGroup } from '~/components'\nimport { styled } from '@stokelp/styled-system/jsx'\n\nconst { withProvider, withContext } = createStyleContext(datepicker)\n\nconst DatePickerRoot = withProvider(ArkDatePicker.Root, 'root', {\n defaultProps: {\n positioning: {\n placement: 'bottom-start',\n },\n view: 'day',\n locale: 'fr',\n unmountOnExit: true,\n lazyMount: true,\n startOfWeek: 6,\n },\n})\nconst DatePickerContent = withContext(ArkDatePicker.Content, 'content')\nconst DatePickerControl = withContext(ArkDatePicker.Control, 'control')\nconst DatePickerInput = withContext(ArkDatePicker.Input, 'input')\nconst DatePickerMonthSelect = withContext(ArkDatePicker.MonthSelect, 'monthSelect')\nconst DatePickerNextTrigger = withContext(ArkDatePicker.NextTrigger, 'nextTrigger')\nconst DatePickerPositioner = withContext(ArkDatePicker.Positioner, 'positioner')\nconst DatePickerPrevTrigger = withContext(ArkDatePicker.PrevTrigger, 'prevTrigger')\nconst DatePickerTableBody = withContext(ArkDatePicker.TableBody, 'tableBody')\nconst DatePickerTableCell = withContext(ArkDatePicker.TableCell, 'tableCell')\nconst DatePickerTableCellTrigger = withContext(ArkDatePicker.TableCellTrigger, 'tableCellTrigger')\nconst DatePickerTableHead = withContext(ArkDatePicker.TableHead, 'tableHead')\nconst DatePickerTableHeader = withContext(ArkDatePicker.TableHeader, 'tableHeader')\nconst DatePickerTable = withContext(ArkDatePicker.Table, 'table')\nconst DatePickerTableRow = withContext(ArkDatePicker.TableRow, 'tableRow')\nconst DatePickerTrigger = withContext(ArkDatePicker.Trigger, 'trigger')\nconst DatePickerViewControl = withContext(ArkDatePicker.ViewControl, 'viewControl')\nconst DatePickerView = withContext(ArkDatePicker.View, 'view')\nconst DatePickerYearSelect = withContext(ArkDatePicker.YearSelect, 'yearSelect')\nconst ClearTrigger = withContext(styled(ArkDatePicker.ClearTrigger), 'clearTrigger')\n\nexport type DatePickerProps = ComponentProps<typeof DatePickerRoot> & {\n placeholder?: string\n clearValueWhenEmpty?: boolean\n preflightClassName?: string\n}\n\nconst DateIcon = () => (\n <svg width=\"23\" height=\"24\" viewBox=\"0 0 23 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M6.46875 2.25C6.8657 2.25 7.1875 2.58579 7.1875 3V4.5H15.8125V3C15.8125 2.58579 16.1343 2.25 16.5312 2.25C16.9282 2.25 17.25 2.58579 17.25 3V4.5H17.9688C19.5566 4.5 20.8438 5.84315 20.8438 7.5V18.75C20.8438 20.4069 19.5566 21.75 17.9688 21.75H5.03125C3.44343 21.75 2.15625 20.4069 2.15625 18.75V7.5C2.15625 5.84315 3.44343 4.5 5.03125 4.5H5.75V3C5.75 2.58579 6.0718 2.25 6.46875 2.25ZM5.03125 6C4.23734 6 3.59375 6.67157 3.59375 7.5V8.65135C4.01662 8.39609 4.50759 8.25 5.03125 8.25H17.9688C18.4924 8.25 18.9834 8.39609 19.4062 8.65135V7.5C19.4062 6.67157 18.7627 6 17.9688 6H5.03125ZM19.4062 11.25C19.4062 10.4216 18.7627 9.75 17.9688 9.75H5.03125C4.23734 9.75 3.59375 10.4216 3.59375 11.25V18.75C3.59375 19.5784 4.23734 20.25 5.03125 20.25H17.9688C18.7627 20.25 19.4062 19.5784 19.4062 18.75V11.25ZM10.7812 12.75C10.7812 12.3358 11.103 12 11.5 12H11.5072C11.9041 12 12.2259 12.3358 12.2259 12.75V12.7575C12.2259 13.1717 11.9041 13.5075 11.5072 13.5075H11.5C11.103 13.5075 10.7812 13.1717 10.7812 12.7575V12.75ZM12.9375 12.75C12.9375 12.3358 13.2593 12 13.6562 12H13.6634C14.0604 12 14.3822 12.3358 14.3822 12.75V12.7575C14.3822 13.1717 14.0604 13.5075 13.6634 13.5075H13.6562C13.2593 13.5075 12.9375 13.1717 12.9375 12.7575V12.75ZM15.0938 12.75C15.0938 12.3358 15.4155 12 15.8125 12H15.8197C16.2166 12 16.5384 12.3358 16.5384 12.75V12.7575C16.5384 13.1717 16.2166 13.5075 15.8197 13.5075H15.8125C15.4155 13.5075 15.0938 13.1717 15.0938 12.7575V12.75ZM6.46875 15C6.46875 14.5858 6.79054 14.25 7.1875 14.25H7.19469C7.59164 14.25 7.91344 14.5858 7.91344 15V15.0075C7.91344 15.4217 7.59164 15.7575 7.19469 15.7575H7.1875C6.79054 15.7575 6.46875 15.4217 6.46875 15.0075V15ZM8.625 15C8.625 14.5858 8.94679 14.25 9.34375 14.25H9.35094C9.74789 14.25 10.0697 14.5858 10.0697 15V15.0075C10.0697 15.4217 9.74789 15.7575 9.35094 15.7575H9.34375C8.94679 15.7575 8.625 15.4217 8.625 15.0075V15ZM10.7812 15C10.7812 14.5858 11.103 14.25 11.5 14.25H11.5072C11.9041 14.25 12.2259 14.5858 12.2259 15V15.0075C12.2259 15.4217 11.9041 15.7575 11.5072 15.7575H11.5C11.103 15.7575 10.7812 15.4217 10.7812 15.0075V15ZM12.9375 15C12.9375 14.5858 13.2593 14.25 13.6562 14.25H13.6634C14.0604 14.25 14.3822 14.5858 14.3822 15V15.0075C14.3822 15.4217 14.0604 15.7575 13.6634 15.7575H13.6562C13.2593 15.7575 12.9375 15.4217 12.9375 15.0075V15ZM15.0938 15C15.0938 14.5858 15.4155 14.25 15.8125 14.25H15.8197C16.2166 14.25 16.5384 14.5858 16.5384 15V15.0075C16.5384 15.4217 16.2166 15.7575 15.8197 15.7575H15.8125C15.4155 15.7575 15.0938 15.4217 15.0938 15.0075V15ZM6.46875 17.25C6.46875 16.8358 6.79054 16.5 7.1875 16.5H7.19469C7.59164 16.5 7.91344 16.8358 7.91344 17.25V17.2575C7.91344 17.6717 7.59164 18.0075 7.19469 18.0075H7.1875C6.79054 18.0075 6.46875 17.6717 6.46875 17.2575V17.25ZM8.625 17.25C8.625 16.8358 8.94679 16.5 9.34375 16.5H9.35094C9.74789 16.5 10.0697 16.8358 10.0697 17.25V17.2575C10.0697 17.6717 9.74789 18.0075 9.35094 18.0075H9.34375C8.94679 18.0075 8.625 17.6717 8.625 17.2575V17.25ZM10.7812 17.25C10.7812 16.8358 11.103 16.5 11.5 16.5H11.5072C11.9041 16.5 12.2259 16.8358 12.2259 17.25V17.2575C12.2259 17.6717 11.9041 18.0075 11.5072 18.0075H11.5C11.103 18.0075 10.7812 17.6717 10.7812 17.2575V17.25ZM12.9375 17.25C12.9375 16.8358 13.2593 16.5 13.6562 16.5H13.6634C14.0604 16.5 14.3822 16.8358 14.3822 17.25V17.2575C14.3822 17.6717 14.0604 18.0075 13.6634 18.0075H13.6562C13.2593 18.0075 12.9375 17.6717 12.9375 17.2575V17.25Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nconst ChevronLeftIcon = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L10.1464 2.64645C10.3417 2.45119 10.6583 2.45119 10.8536 2.64645C11.0488 2.84171 11.0488 3.15829 10.8536 3.35355L6.20711 8L10.8536 12.6464C11.0488 12.8417 11.0488 13.1583 10.8536 13.3536C10.6583 13.5488 10.3417 13.5488 10.1464 13.3536L5.14645 8.35355Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nconst ChevronRightIcon = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10.8536 7.64645C11.0488 7.84171 11.0488 8.15829 10.8536 8.35355L5.85355 13.3536C5.65829 13.5488 5.34171 13.5488 5.14645 13.3536C4.95118 13.1583 4.95118 12.8417 5.14645 12.6464L9.79289 8L5.14645 3.35355C4.95118 3.15829 4.95118 2.84171 5.14645 2.64645C5.34171 2.45118 5.65829 2.45118 5.85355 2.64645L10.8536 7.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nexport const DatePicker: FC<DatePickerProps> = ({\n placeholder,\n preflightClassName,\n selectionMode,\n clearValueWhenEmpty = true,\n ...props\n}) => {\n const isRange = selectionMode === 'range'\n\n return (\n <DatePickerRoot\n startOfWeek={1}\n {...props}\n selectionMode={selectionMode}\n onValueChange={value =>\n props.onValueChange?.({ ...value, valueAsString: value.value.length ? [value.value.toString()] : [] })\n }\n >\n <ArkDatePicker.Context>\n {api => (\n <DatePickerControl>\n <InputGroup>\n <DatePickerInput asChild index={0} placeholder={placeholder}>\n <Input\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n />\n </DatePickerInput>\n <InputAddon>\n <ClearTrigger asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n\n <DatePickerTrigger style={{ cursor: 'pointer' }}>\n <DateIcon />\n </DatePickerTrigger>\n </InputAddon>\n </InputGroup>\n {isRange ? (\n <InputGroup>\n <DatePickerInput asChild index={1} placeholder={placeholder}>\n <Input\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n />\n </DatePickerInput>\n <InputAddon>\n {api.value.length === 2 ? (\n <ClearTrigger asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n ) : null}\n <DatePickerTrigger>\n <DateIcon />\n </DatePickerTrigger>\n </InputAddon>\n </InputGroup>\n ) : null}\n </DatePickerControl>\n )}\n </ArkDatePicker.Context>\n <Portal>\n <DatePickerPositioner className={preflightClassName}>\n <DatePickerContent>\n <DatePickerView view=\"day\">\n <ArkDatePicker.Context>\n {api => (\n <>\n <DatePickerViewControl>\n <DatePickerPrevTrigger asChild>\n <IconButton aria-label=\"prev\" variant=\"secondary\" size=\"md\">\n <ChevronLeftIcon />\n </IconButton>\n </DatePickerPrevTrigger>\n <DatePickerMonthSelect />\n <DatePickerYearSelect />\n <DatePickerNextTrigger asChild>\n <IconButton aria-label=\"next\" variant=\"secondary\" size=\"md\">\n <ChevronRightIcon />\n </IconButton>\n </DatePickerNextTrigger>\n </DatePickerViewControl>\n <DatePickerTable>\n <DatePickerTableHead>\n <DatePickerTableRow>\n {api.weekDays.map((weekDay, id) => (\n <DatePickerTableHeader key={id}>{weekDay.short}</DatePickerTableHeader>\n ))}\n </DatePickerTableRow>\n </DatePickerTableHead>\n <DatePickerTableBody>\n {api.weeks.map((week, id) => (\n <DatePickerTableRow key={id}>\n {week.map((day, id) => (\n <DatePickerTableCell key={id} value={day}>\n <DatePickerTableCellTrigger asChild>\n <button>{day.day}</button>\n </DatePickerTableCellTrigger>\n </DatePickerTableCell>\n ))}\n </DatePickerTableRow>\n ))}\n </DatePickerTableBody>\n </DatePickerTable>\n </>\n )}\n </ArkDatePicker.Context>\n </DatePickerView>\n </DatePickerContent>\n </DatePickerPositioner>\n </Portal>\n </DatePickerRoot>\n )\n}\n"],"mappings":";;;;;;;;;;;AAOA,IAAM,EAAE,iBAAc,mBAAgB,EAAmB,CAAU,GAE7D,IAAiB,EAAa,EAAc,MAAM,QAAQ,EAC9D,cAAc;CACZ,aAAa,EACX,WAAW,eACb;CACA,MAAM;CACN,QAAQ;CACR,eAAe;CACf,WAAW;CACX,aAAa;AACf,EACF,CAAC,GACK,IAAoB,EAAY,EAAc,SAAS,SAAS,GAChE,IAAoB,EAAY,EAAc,SAAS,SAAS,GAChE,IAAkB,EAAY,EAAc,OAAO,OAAO,GAC1D,IAAwB,EAAY,EAAc,aAAa,aAAa,GAC5E,IAAwB,EAAY,EAAc,aAAa,aAAa,GAC5E,IAAuB,EAAY,EAAc,YAAY,YAAY,GACzE,IAAwB,EAAY,EAAc,aAAa,aAAa,GAC5E,IAAsB,EAAY,EAAc,WAAW,WAAW,GACtE,IAAsB,EAAY,EAAc,WAAW,WAAW,GACtE,IAA6B,EAAY,EAAc,kBAAkB,kBAAkB,GAC3F,IAAsB,EAAY,EAAc,WAAW,WAAW,GACtE,IAAwB,EAAY,EAAc,aAAa,aAAa,GAC5E,IAAkB,EAAY,EAAc,OAAO,OAAO,GAC1D,IAAqB,EAAY,EAAc,UAAU,UAAU,GACnE,IAAoB,EAAY,EAAc,SAAS,SAAS,GAChE,IAAwB,EA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,UAAA,CACE,kBAAC,GAAD,EAAA,UAAA;KACE,kBAAC,GAAD;MAAuB,SAAA;gBACrB,kBAAC,GAAD;OAAY,cAAW;OAAO,SAAQ;OAAY,MAAK;iBACrD,kBAAC,GAAD,CAAkB,CAAA;MACR,CAAA;KACS,CAAA;KACvB,kBAAC,GAAD,CAAwB,CAAA;KACxB,kBAAC,GAAD,CAAuB,CAAA;KACvB,kBAAC,GAAD;MAAuB,SAAA;gBACrB,kBAAC,GAAD;OAAY,cAAW;OAAO,SAAQ;OAAY,MAAK;iBACrD,kBAAC,GAAD,CAAmB,CAAA;MACT,CAAA;KACS,CAAA;IACF,EAAA,CAAA,GACvB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD,EAAA,UACG,EAAI,SAAS,KAAK,GAAS,MAC1B,kBAAC,GAAD,EAAA,UAAiC,EAAQ,MAA6B,GAA1C,CAA0C,CACvE,EACiB,CAAA,EACD,CAAA,GACrB,kBAAC,GAAD,EAAA,UACG,EAAI,MAAM,KAAK,GAAM,MACpB,kBAAC,GAAD,EAAA,UACG,EAAK,KAAK,GAAK,MACd,kBAAC,GAAD;KAA8B,OAAO;eACnC,kBAAC,GAAD;MAA4B,SAAA;gBAC1B,kBAAC,UAAD,EAAA,UAAS,EAAI,IAAY,CAAA;KACC,CAAA;IACT,GAJK,CAIL,CACtB,EACiB,GARK,CAQL,CACrB,EACkB,CAAA,CACN,EAAA,CAAA,CACjB,EAAA,CAAA,EAEiB,CAAA;GACT,CAAA,EACC,CAAA;EACC,CAAA,EAChB,CAAA,CACM;;AAEpB"}
1
+ {"version":3,"file":"DatePicker.js","names":["ArkDatePicker","DatePicker","_Fragment","createStyleContext","datepicker","DatePickerRoot","withProvider","DatePicker","DatePickerContent","withContext","DatePickerControl","DatePickerInput","DatePickerMonthSelect","DatePickerNextTrigger","DatePickerPositioner","DatePickerPrevTrigger","DatePickerTableBody","DatePickerTableCell","DatePickerTableCellTrigger","DatePickerTableHead","DatePickerTableHeader","DatePickerTable","DatePickerTableRow","DatePickerTrigger","DatePickerViewControl","DatePickerView","DatePickerYearSelect","ClearTrigger","styled","DateIcon","ChevronLeftIcon","ChevronRightIcon","DatePicker$1","props","isRange","selectionMode","value","InputGroup","Input","clearValueWhenEmpty","api","InputAddon","Portal","preflightClassName","Fragment","IconButton","weekDay","id","week","day"],"sources":["../../../src/components/date-picker/DatePicker.tsx"],"sourcesContent":["import { datepicker } from '@stokelp/styled-system/recipes'\nimport { DatePicker as ArkDatePicker, Portal } from '@ark-ui/react'\nimport { createStyleContext } from '~/utils/slots'\nimport { ComponentProps, FC } from 'react'\nimport { IconButton, Input, InputAddon, InputGroup } from '~/components'\nimport { styled } from '@stokelp/styled-system/jsx'\n\nconst { withProvider, withContext } = createStyleContext(datepicker)\n\nconst DatePickerRoot = withProvider(ArkDatePicker.Root, 'root', {\n defaultProps: {\n positioning: {\n placement: 'bottom-start',\n },\n view: 'day',\n locale: 'fr',\n unmountOnExit: true,\n lazyMount: true,\n startOfWeek: 6,\n },\n})\nconst DatePickerContent = withContext(ArkDatePicker.Content, 'content')\nconst DatePickerControl = withContext(ArkDatePicker.Control, 'control')\nconst DatePickerInput = withContext(ArkDatePicker.Input, 'input')\nconst DatePickerMonthSelect = withContext(ArkDatePicker.MonthSelect, 'monthSelect')\nconst DatePickerNextTrigger = withContext(ArkDatePicker.NextTrigger, 'nextTrigger')\nconst DatePickerPositioner = withContext(ArkDatePicker.Positioner, 'positioner')\nconst DatePickerPrevTrigger = withContext(ArkDatePicker.PrevTrigger, 'prevTrigger')\nconst DatePickerTableBody = withContext(ArkDatePicker.TableBody, 'tableBody')\nconst DatePickerTableCell = withContext(ArkDatePicker.TableCell, 'tableCell')\nconst DatePickerTableCellTrigger = withContext(ArkDatePicker.TableCellTrigger, 'tableCellTrigger')\nconst DatePickerTableHead = withContext(ArkDatePicker.TableHead, 'tableHead')\nconst DatePickerTableHeader = withContext(ArkDatePicker.TableHeader, 'tableHeader')\nconst DatePickerTable = withContext(ArkDatePicker.Table, 'table')\nconst DatePickerTableRow = withContext(ArkDatePicker.TableRow, 'tableRow')\nconst DatePickerTrigger = withContext(ArkDatePicker.Trigger, 'trigger')\nconst DatePickerViewControl = withContext(ArkDatePicker.ViewControl, 'viewControl')\nconst DatePickerView = withContext(ArkDatePicker.View, 'view')\nconst DatePickerYearSelect = withContext(ArkDatePicker.YearSelect, 'yearSelect')\nconst ClearTrigger = withContext(styled(ArkDatePicker.ClearTrigger), 'clearTrigger')\n\nexport type DatePickerProps = ComponentProps<typeof DatePickerRoot> & {\n placeholder?: string\n clearValueWhenEmpty?: boolean\n preflightClassName?: string\n}\n\nconst DateIcon = () => (\n <svg width=\"23\" height=\"24\" viewBox=\"0 0 23 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M6.46875 2.25C6.8657 2.25 7.1875 2.58579 7.1875 3V4.5H15.8125V3C15.8125 2.58579 16.1343 2.25 16.5312 2.25C16.9282 2.25 17.25 2.58579 17.25 3V4.5H17.9688C19.5566 4.5 20.8438 5.84315 20.8438 7.5V18.75C20.8438 20.4069 19.5566 21.75 17.9688 21.75H5.03125C3.44343 21.75 2.15625 20.4069 2.15625 18.75V7.5C2.15625 5.84315 3.44343 4.5 5.03125 4.5H5.75V3C5.75 2.58579 6.0718 2.25 6.46875 2.25ZM5.03125 6C4.23734 6 3.59375 6.67157 3.59375 7.5V8.65135C4.01662 8.39609 4.50759 8.25 5.03125 8.25H17.9688C18.4924 8.25 18.9834 8.39609 19.4062 8.65135V7.5C19.4062 6.67157 18.7627 6 17.9688 6H5.03125ZM19.4062 11.25C19.4062 10.4216 18.7627 9.75 17.9688 9.75H5.03125C4.23734 9.75 3.59375 10.4216 3.59375 11.25V18.75C3.59375 19.5784 4.23734 20.25 5.03125 20.25H17.9688C18.7627 20.25 19.4062 19.5784 19.4062 18.75V11.25ZM10.7812 12.75C10.7812 12.3358 11.103 12 11.5 12H11.5072C11.9041 12 12.2259 12.3358 12.2259 12.75V12.7575C12.2259 13.1717 11.9041 13.5075 11.5072 13.5075H11.5C11.103 13.5075 10.7812 13.1717 10.7812 12.7575V12.75ZM12.9375 12.75C12.9375 12.3358 13.2593 12 13.6562 12H13.6634C14.0604 12 14.3822 12.3358 14.3822 12.75V12.7575C14.3822 13.1717 14.0604 13.5075 13.6634 13.5075H13.6562C13.2593 13.5075 12.9375 13.1717 12.9375 12.7575V12.75ZM15.0938 12.75C15.0938 12.3358 15.4155 12 15.8125 12H15.8197C16.2166 12 16.5384 12.3358 16.5384 12.75V12.7575C16.5384 13.1717 16.2166 13.5075 15.8197 13.5075H15.8125C15.4155 13.5075 15.0938 13.1717 15.0938 12.7575V12.75ZM6.46875 15C6.46875 14.5858 6.79054 14.25 7.1875 14.25H7.19469C7.59164 14.25 7.91344 14.5858 7.91344 15V15.0075C7.91344 15.4217 7.59164 15.7575 7.19469 15.7575H7.1875C6.79054 15.7575 6.46875 15.4217 6.46875 15.0075V15ZM8.625 15C8.625 14.5858 8.94679 14.25 9.34375 14.25H9.35094C9.74789 14.25 10.0697 14.5858 10.0697 15V15.0075C10.0697 15.4217 9.74789 15.7575 9.35094 15.7575H9.34375C8.94679 15.7575 8.625 15.4217 8.625 15.0075V15ZM10.7812 15C10.7812 14.5858 11.103 14.25 11.5 14.25H11.5072C11.9041 14.25 12.2259 14.5858 12.2259 15V15.0075C12.2259 15.4217 11.9041 15.7575 11.5072 15.7575H11.5C11.103 15.7575 10.7812 15.4217 10.7812 15.0075V15ZM12.9375 15C12.9375 14.5858 13.2593 14.25 13.6562 14.25H13.6634C14.0604 14.25 14.3822 14.5858 14.3822 15V15.0075C14.3822 15.4217 14.0604 15.7575 13.6634 15.7575H13.6562C13.2593 15.7575 12.9375 15.4217 12.9375 15.0075V15ZM15.0938 15C15.0938 14.5858 15.4155 14.25 15.8125 14.25H15.8197C16.2166 14.25 16.5384 14.5858 16.5384 15V15.0075C16.5384 15.4217 16.2166 15.7575 15.8197 15.7575H15.8125C15.4155 15.7575 15.0938 15.4217 15.0938 15.0075V15ZM6.46875 17.25C6.46875 16.8358 6.79054 16.5 7.1875 16.5H7.19469C7.59164 16.5 7.91344 16.8358 7.91344 17.25V17.2575C7.91344 17.6717 7.59164 18.0075 7.19469 18.0075H7.1875C6.79054 18.0075 6.46875 17.6717 6.46875 17.2575V17.25ZM8.625 17.25C8.625 16.8358 8.94679 16.5 9.34375 16.5H9.35094C9.74789 16.5 10.0697 16.8358 10.0697 17.25V17.2575C10.0697 17.6717 9.74789 18.0075 9.35094 18.0075H9.34375C8.94679 18.0075 8.625 17.6717 8.625 17.2575V17.25ZM10.7812 17.25C10.7812 16.8358 11.103 16.5 11.5 16.5H11.5072C11.9041 16.5 12.2259 16.8358 12.2259 17.25V17.2575C12.2259 17.6717 11.9041 18.0075 11.5072 18.0075H11.5C11.103 18.0075 10.7812 17.6717 10.7812 17.2575V17.25ZM12.9375 17.25C12.9375 16.8358 13.2593 16.5 13.6562 16.5H13.6634C14.0604 16.5 14.3822 16.8358 14.3822 17.25V17.2575C14.3822 17.6717 14.0604 18.0075 13.6634 18.0075H13.6562C13.2593 18.0075 12.9375 17.6717 12.9375 17.2575V17.25Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nconst ChevronLeftIcon = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L10.1464 2.64645C10.3417 2.45119 10.6583 2.45119 10.8536 2.64645C11.0488 2.84171 11.0488 3.15829 10.8536 3.35355L6.20711 8L10.8536 12.6464C11.0488 12.8417 11.0488 13.1583 10.8536 13.3536C10.6583 13.5488 10.3417 13.5488 10.1464 13.3536L5.14645 8.35355Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nconst ChevronRightIcon = () => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10.8536 7.64645C11.0488 7.84171 11.0488 8.15829 10.8536 8.35355L5.85355 13.3536C5.65829 13.5488 5.34171 13.5488 5.14645 13.3536C4.95118 13.1583 4.95118 12.8417 5.14645 12.6464L9.79289 8L5.14645 3.35355C4.95118 3.15829 4.95118 2.84171 5.14645 2.64645C5.34171 2.45118 5.65829 2.45118 5.85355 2.64645L10.8536 7.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\nexport const DatePicker: FC<DatePickerProps> = ({\n placeholder,\n preflightClassName,\n selectionMode,\n clearValueWhenEmpty = true,\n ...props\n}) => {\n const isRange = selectionMode === 'range'\n\n return (\n <DatePickerRoot\n startOfWeek={1}\n {...props}\n selectionMode={selectionMode}\n onValueChange={value =>\n props.onValueChange?.({ ...value, valueAsString: value.value.length ? [value.value.toString()] : [] })\n }\n >\n <ArkDatePicker.Context>\n {api => (\n <DatePickerControl>\n <InputGroup>\n <DatePickerInput asChild index={0} placeholder={placeholder}>\n <Input\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n />\n </DatePickerInput>\n <InputAddon>\n <ClearTrigger asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n\n <DatePickerTrigger style={{ cursor: 'pointer' }}>\n <DateIcon />\n </DatePickerTrigger>\n </InputAddon>\n </InputGroup>\n {isRange ? (\n <InputGroup>\n <DatePickerInput asChild index={1} placeholder={placeholder}>\n <Input\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n />\n </DatePickerInput>\n <InputAddon>\n {api.value.length === 2 ? (\n <ClearTrigger asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n ) : null}\n <DatePickerTrigger>\n <DateIcon />\n </DatePickerTrigger>\n </InputAddon>\n </InputGroup>\n ) : null}\n </DatePickerControl>\n )}\n </ArkDatePicker.Context>\n <Portal>\n <DatePickerPositioner className={preflightClassName}>\n <DatePickerContent>\n <DatePickerView view=\"day\">\n <ArkDatePicker.Context>\n {api => (\n <>\n <DatePickerViewControl>\n <DatePickerPrevTrigger asChild>\n <IconButton aria-label=\"prev\" variant=\"secondary\" size=\"md\">\n <ChevronLeftIcon />\n </IconButton>\n </DatePickerPrevTrigger>\n <DatePickerMonthSelect />\n <DatePickerYearSelect />\n <DatePickerNextTrigger asChild>\n <IconButton aria-label=\"next\" variant=\"secondary\" size=\"md\">\n <ChevronRightIcon />\n </IconButton>\n </DatePickerNextTrigger>\n </DatePickerViewControl>\n <DatePickerTable>\n <DatePickerTableHead>\n <DatePickerTableRow>\n {api.weekDays.map((weekDay, id) => (\n <DatePickerTableHeader key={id}>{weekDay.short}</DatePickerTableHeader>\n ))}\n </DatePickerTableRow>\n </DatePickerTableHead>\n <DatePickerTableBody>\n {api.weeks.map((week, id) => (\n <DatePickerTableRow key={id}>\n {week.map((day, id) => (\n <DatePickerTableCell key={id} value={day}>\n <DatePickerTableCellTrigger asChild>\n <button>{day.day}</button>\n </DatePickerTableCellTrigger>\n </DatePickerTableCell>\n ))}\n </DatePickerTableRow>\n ))}\n </DatePickerTableBody>\n </DatePickerTable>\n </>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GAAD;OAAY,cAAW;OAAO,SAAQ;OAAY,MAAK;OACrD,UAAA,kBAACf,GAAD,CAAkB,CAAA;MACR,CAAA;KACS,CAAA;KACvB,kBAAClB,GAAD,CAAwB,CAAA;KACxB,kBAACc,GAAD,CAAuB,CAAA;KACvB,kBAACb,GAAD;MAAuB,SAAA;MACrB,UAAA,kBAACgC,GAAD;OAAY,cAAW;OAAO,SAAQ;OAAY,MAAK;OACrD,UAAA,kBAACd,GAAD,CAAmB,CAAA;MACT,CAAA;KACS,CAAA;IACF,EAAA,CAAA,GACvB,kBAACV,GAAD,EAAA,UAAA,CACE,kBAACF,GAAD,EAAA,UACE,kBAACG,GAAD,EAAA,UACGkB,EAAI,SAAS,KAAK,GAAS,MAC1B,kBAACpB,GAAD,EAAA,UAAiC0B,EAAQ,MAA6B,GAA1CC,CAA0C,CACvE,EACiB,CAAA,EACD,CAAA,GACrB,kBAAC/B,GAAD,EAAA,UACGwB,EAAI,MAAM,KAAK,GAAM,MACpB,kBAAClB,GAAD,EAAA,UACG0B,EAAK,KAAK,GAAK,MACd,kBAAC/B,GAAD;KAA8B,OAAOgC;KACnC,UAAA,kBAAC/B,GAAD;MAA4B,SAAA;MAC1B,UAAA,kBAAC,UAAD,EAAA,UAAS+B,EAAI,IAAY,CAAA;KACC,CAAA;IACT,GAJKF,CAIL,CACtB,EACiB,GARKA,CAQL,CACrB,EACkB,CAAA,CACN,EAAA,CAAA,CACjB,EAAA,CAAA,EAEiB,CAAA;GACT,CAAA,EACC,CAAA;EACC,CAAA,EAChB,CAAA,CACM;;AAEpB"}
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utils/slots.cjs"),n=require("../icon-button/IconButton.cjs"),r=require("../drawer/Drawer.cjs");let i=require("@ark-ui/react"),a=require("@stokelp/styled-system/jsx"),o=require("@stokelp/styled-system/recipes"),s=require("react"),c=require("react/jsx-runtime"),l=require("usehooks-ts"),u=require("@stokelp/styled-system/tokens");var d=e.__exportAll({Backdrop:()=>h,Body:()=>x,CloseTrigger:()=>g,Content:()=>v,Footer:()=>S,Header:()=>b,Positioner:()=>C,Root:()=>m,Title:()=>w,Trigger:()=>T}),{withProvider:f,withContext:p}=t.createStyleContext(o.dialog,{dataAttr:!0}),m=f(i.Dialog.Root,void 0,{defaultProps:{lazyMount:!0,unmountOnExit:!0}}),h=p((0,a.styled)(i.Dialog.Backdrop),`backdrop`),g=p((0,a.styled)(i.Dialog.CloseTrigger),`closeTrigger`),_=(0,s.forwardRef)(({children:e,...t},n)=>{let r=(0,l.useMediaQuery)(`(max-width: ${(0,u.token)(`breakpoints.md`)})`,{defaultValue:!1}),{open:a,getContentProps:o}=(0,i.useDialogContext)();return(0,s.useLayoutEffect)(()=>{if(!a)return;let{id:e}=o();e&&setTimeout(()=>{let t=document.getElementById(e);if(t){let e=t.querySelector(`footer`);e&&(r?t.style.setProperty(`--footer-height`,`${Math.ceil(e.clientHeight)}px`):t.style.setProperty(`--footer-height`,`70px`))}},0)},[a,r]),(0,c.jsxs)(i.Portal,{children:[(0,c.jsx)(h,{}),(0,c.jsx)(C,{children:(0,c.jsx)(i.Dialog.Content,{ref:n,...t,children:e})})]})});_.displayName=i.Dialog.Content.displayName;var v=p((0,a.styled)(_),`content`),y=(0,s.forwardRef)(({children:e,showCloseTrigger:t=!0,...a},o)=>(0,c.jsxs)(i.ark.header,{...a,ref:o,children:[e,t&&(0,c.jsx)(r.DrawerCloseTrigger,{asChild:!0,children:(0,c.jsx)(n.IconButton,{ml:`auto`,"aria-label":`close`,variant:`tertiary`,children:(0,c.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,c.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z`,fill:`currentColor`})})})})]}));y.displayName=`DialogHeader`;var b=p((0,a.styled)(y),`header`),x=p((0,a.styled)(i.ark.main),`body`),S=p((0,a.styled)(i.ark.footer),`footer`),C=p((0,a.styled)(i.Dialog.Positioner),`positioner`),w=p((0,a.styled)(i.Dialog.Title),`title`),T=p((0,a.styled)(i.Dialog.Trigger),`trigger`);Object.defineProperty(exports,"styled_exports",{enumerable:!0,get:function(){return d}});
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../utils/slots.cjs"),n=require("../icon-button/IconButton.cjs"),r=require("../drawer/Drawer.cjs");let i=require("@ark-ui/react"),a=require("@stokelp/styled-system/jsx"),o=require("@stokelp/styled-system/recipes"),s=require("react"),c=require("react/jsx-runtime"),l=require("usehooks-ts"),u=require("@stokelp/styled-system/tokens");var d=e.__exportAll({Backdrop:()=>h,Body:()=>x,CloseTrigger:()=>g,Content:()=>v,Footer:()=>S,Header:()=>b,Positioner:()=>C,Root:()=>m,Title:()=>w,Trigger:()=>T}),{withProvider:f,withContext:p}=t.createStyleContext(o.dialog,{dataAttr:!0}),m=f(i.Dialog.Root,void 0,{defaultProps:{lazyMount:!0,unmountOnExit:!0}}),h=p((0,a.styled)(i.Dialog.Backdrop),`backdrop`),g=p((0,a.styled)(i.Dialog.CloseTrigger),`closeTrigger`),_=(0,s.forwardRef)(({children:e,...t},n)=>{let r=(0,l.useMediaQuery)(`(max-width: ${(0,u.token)(`breakpoints.md`)})`,{defaultValue:!1}),{open:a,getContentProps:o}=(0,i.useDialogContext)();return(0,s.useLayoutEffect)(()=>{if(!a)return;let{id:e}=o();e&&setTimeout(()=>{let t=document.getElementById(e);if(t){let e=t.querySelector(`footer`);e&&(r?t.style.setProperty(`--footer-height`,`${Math.ceil(e.clientHeight)}px`):t.style.setProperty(`--footer-height`,`70px`))}},0)},[a,r]),(0,c.jsxs)(i.Portal,{children:[(0,c.jsx)(h,{}),(0,c.jsx)(C,{children:(0,c.jsx)(i.Dialog.Content,{ref:n,...t,children:e})})]})});_.displayName=i.Dialog.Content.displayName;var v=p((0,a.styled)(_),`content`),y=(0,s.forwardRef)(({children:e,showCloseTrigger:t=!0,...a},o)=>(0,c.jsxs)(i.ark.header,{...a,ref:o,children:[e,t&&(0,c.jsx)(r.DrawerCloseTrigger,{asChild:!0,children:(0,c.jsx)(n.IconButton,{ml:`auto`,"aria-label":`close`,variant:`tertiary`,children:(0,c.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,c.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z`,fill:`currentColor`})})})})]}));y.displayName=`DialogHeader`;var b=p((0,a.styled)(y),`header`),x=p((0,a.styled)(i.ark.main),`body`),S=p((0,a.styled)(i.ark.footer),`footer`),C=p((0,a.styled)(i.Dialog.Positioner),`positioner`),w=p((0,a.styled)(i.Dialog.Title),`title`),T=p((0,a.styled)(i.Dialog.Trigger),`trigger`);exports.Backdrop=h,exports.Body=x,exports.CloseTrigger=g,exports.Content=v,exports.Footer=S,exports.Header=b,exports.Positioner=C,exports.Root=m,exports.Title=w,exports.Trigger=T,Object.defineProperty(exports,"styled_exports",{enumerable:!0,get:function(){return d}});
2
2
  //# sourceMappingURL=styled.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"styled.cjs","names":[],"sources":["../../../src/components/dialog/styled.tsx"],"sourcesContent":["import { ark, Dialog as ArkDialog, Portal, useDialogContext } from '@ark-ui/react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { dialog } from '@stokelp/styled-system/recipes'\nimport { ComponentProps, ComponentPropsWithoutRef, ElementRef, forwardRef, useLayoutEffect } from 'react'\nimport { createStyleContext } from '~/utils/slots'\nimport { IconButton } from '~/components/icon-button'\nimport { DrawerCloseTrigger } from '~/components'\nimport { useMediaQuery } from 'usehooks-ts'\nimport { token } from '@stokelp/styled-system/tokens'\n\nconst { withProvider, withContext } = createStyleContext(dialog, {\n dataAttr: true,\n})\n\nexport const Root = withProvider(ArkDialog.Root, undefined, {\n defaultProps: {\n lazyMount: true,\n unmountOnExit: true,\n },\n})\nexport const Backdrop = withContext(styled(ArkDialog.Backdrop), 'backdrop')\nexport const CloseTrigger = withContext(styled(ArkDialog.CloseTrigger), 'closeTrigger')\n\nconst InternalContent = forwardRef<\n ElementRef<typeof ArkDialog.Content>,\n ComponentPropsWithoutRef<typeof ArkDialog.Content>\n>(({ children, ...props }, ref) => {\n const isMobile = useMediaQuery(`(max-width: ${token('breakpoints.md')})`, {\n defaultValue: false,\n })\n const { open, getContentProps } = useDialogContext()\n\n useLayoutEffect(() => {\n if (!open) return\n const { id } = getContentProps()\n if (!id) return\n setTimeout(() => {\n const $content = document.getElementById(id)\n\n if ($content) {\n const $footer = $content.querySelector('footer')\n if ($footer) {\n if (isMobile) {\n $content.style.setProperty('--footer-height', `${Math.ceil($footer.clientHeight)}px`)\n } else {\n $content.style.setProperty('--footer-height', `70px`)\n }\n }\n }\n }, 0)\n }, [open, isMobile])\n\n return (\n <Portal>\n <Backdrop />\n <Positioner>\n <ArkDialog.Content ref={ref} {...props}>\n {children}\n </ArkDialog.Content>\n </Positioner>\n </Portal>\n )\n})\nInternalContent.displayName = ArkDialog.Content.displayName\n\nexport const Content = withContext(styled(InternalContent), 'content')\n\ntype HeaderProps = ComponentPropsWithoutRef<typeof ark.header> & {\n showCloseTrigger?: boolean\n}\nconst InternalHeader = forwardRef<ElementRef<typeof ark.header>, HeaderProps>(\n ({ children, showCloseTrigger = true, ...props }, ref) => (\n <ark.header {...props} ref={ref}>\n {children}\n {showCloseTrigger && (\n <DrawerCloseTrigger asChild>\n <IconButton ml=\"auto\" aria-label=\"close\" variant=\"tertiary\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n </DrawerCloseTrigger>\n )}\n </ark.header>\n ),\n)\nInternalHeader.displayName = 'DialogHeader'\n\nexport const Header = withContext(styled(InternalHeader), 'header')\nexport const Body = withContext(styled(ark.main), 'body')\nexport const Footer = withContext(styled(ark.footer), 'footer')\nexport const Positioner = withContext(styled(ArkDialog.Positioner), 'positioner')\nexport const Title = withContext(styled(ArkDialog.Title), 'title')\nexport const Trigger = withContext(styled(ArkDialog.Trigger), 'trigger')\n\nexport interface DialogProps extends ComponentProps<typeof Root> {}\nexport interface DialogBackdropProps extends ComponentProps<typeof Backdrop> {}\nexport interface DialogCloseTriggerProps extends ComponentProps<typeof CloseTrigger> {}\nexport interface DialogContentProps extends ComponentProps<typeof Content> {}\nexport interface DialogHeaderProps extends ComponentProps<typeof Header> {}\nexport interface DialogBodyProps extends ComponentProps<typeof Body> {}\nexport interface DialogFooterProps extends ComponentProps<typeof Footer> {}\nexport interface DialogPositionerProps extends ComponentProps<typeof Positioner> {}\nexport interface DialogTitleProps extends ComponentProps<typeof Title> {}\nexport interface DialogTriggerProps extends ComponentProps<typeof Trigger> {}\n"],"mappings":"gkBAUM,CAAE,eAAc,eAAgB,EAAA,mBAAmB,EAAA,OAAQ,CAC/D,SAAU,EACZ,CAAC,EAEY,EAAO,EAAa,EAAA,OAAU,KAAM,IAAA,GAAW,CAC1D,aAAc,CACZ,UAAW,GACX,cAAe,EACjB,CACF,CAAC,EACY,EAAW,GAAA,EAAA,EAAA,QAAmB,EAAA,OAAU,QAAQ,EAAG,UAAU,EAC7D,EAAe,GAAA,EAAA,EAAA,QAAmB,EAAA,OAAU,YAAY,EAAG,cAAc,EAEhF,GAAA,EAAA,EAAA,aAGH,CAAE,WAAU,GAAG,GAAS,IAAQ,CACjC,IAAM,GAAA,EAAA,EAAA,eAAyB,gBAAA,EAAA,EAAA,OAAqB,gBAAgB,EAAE,GAAI,CACxE,aAAc,EAChB,CAAC,EACK,CAAE,OAAM,oBAAA,EAAA,EAAA,kBAAqC,EAsBnD,OApBA,EAAA,EAAA,qBAAsB,CACpB,GAAI,CAAC,EAAM,OACX,GAAM,CAAE,MAAO,EAAgB,EAC1B,GACL,eAAiB,CACf,IAAM,EAAW,SAAS,eAAe,CAAE,EAE3C,GAAI,EAAU,CACZ,IAAM,EAAU,EAAS,cAA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AAI,MAAM,EAAG,QAAQ,EACjD,EAAa,GAAA,EAAA,EAAA,QAAmB,EAAA,OAAU,UAAU,EAAG,YAAY,EACnE,EAAQ,GAAA,EAAA,EAAA,QAAmB,EAAA,OAAU,KAAK,EAAG,OAAO,EACpD,EAAU,GAAA,EAAA,EAAA,QAAmB,EAAA,OAAU,OAAO,EAAG,SAAS"}
1
+ {"version":3,"file":"styled.cjs","names":["createStyleContext","dialog","ArkDialog","styled","forwardRef","useMediaQuery","token","useDialogContext","Portal","ark","DrawerCloseTrigger","IconButton","require_runtime","require_slots","require_IconButton","require_Drawer","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react","react_jsx_runtime","usehooks_ts","_stokelp_styled_system_tokens","styled_exports","Backdrop","Body","CloseTrigger","Content","Footer","Header","Positioner","Root","Title","Trigger","withProvider","withContext","InternalContent","props","isMobile","open","getContentProps","id","$content","$footer","InternalHeader","children","showCloseTrigger"],"sources":["../../../src/components/dialog/styled.tsx"],"sourcesContent":["import { ark, Dialog as ArkDialog, Portal, useDialogContext } from '@ark-ui/react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { dialog } from '@stokelp/styled-system/recipes'\nimport { ComponentProps, ComponentPropsWithoutRef, ElementRef, forwardRef, useLayoutEffect } from 'react'\nimport { createStyleContext } from '~/utils/slots'\nimport { IconButton } from '~/components/icon-button'\nimport { DrawerCloseTrigger } from '~/components'\nimport { useMediaQuery } from 'usehooks-ts'\nimport { token } from '@stokelp/styled-system/tokens'\n\nconst { withProvider, withContext } = createStyleContext(dialog, {\n dataAttr: true,\n})\n\nexport const Root = withProvider(ArkDialog.Root, undefined, {\n defaultProps: {\n lazyMount: true,\n unmountOnExit: true,\n },\n})\nexport const Backdrop = withContext(styled(ArkDialog.Backdrop), 'backdrop')\nexport const CloseTrigger = withContext(styled(ArkDialog.CloseTrigger), 'closeTrigger')\n\nconst InternalContent = forwardRef<\n ElementRef<typeof ArkDialog.Content>,\n ComponentPropsWithoutRef<typeof ArkDialog.Content>\n>(({ children, ...props }, ref) => {\n const isMobile = useMediaQuery(`(max-width: ${token('breakpoints.md')})`, {\n defaultValue: false,\n })\n const { open, getContentProps } = useDialogContext()\n\n useLayoutEffect(() => {\n if (!open) return\n const { id } = getContentProps()\n if (!id) return\n setTimeout(() => {\n const $content = document.getElementById(id)\n\n if ($content) {\n const $footer = $content.querySelector('footer')\n if ($footer) {\n if (isMobile) {\n $content.style.setProperty('--footer-height', `${Math.ceil($footer.clientHeight)}px`)\n } else {\n $content.style.setProperty('--footer-height', `70px`)\n }\n }\n }\n }, 0)\n }, [open, isMobile])\n\n return (\n <Portal>\n <Backdrop />\n <Positioner>\n <ArkDialog.Content ref={ref} {...props}>\n {children}\n </ArkDialog.Content>\n </Positioner>\n </Portal>\n )\n})\nInternalContent.displayName = ArkDialog.Content.displayName\n\nexport const Content = withContext(styled(InternalContent), 'content')\n\ntype HeaderProps = ComponentPropsWithoutRef<typeof ark.header> & {\n showCloseTrigger?: boolean\n}\nconst InternalHeader = forwardRef<ElementRef<typeof ark.header>, HeaderProps>(\n ({ children, showCloseTrigger = true, ...props }, ref) => (\n <ark.header {...props} ref={ref}>\n {children}\n {showCloseTrigger && (\n <DrawerCloseTrigger asChild>\n <IconButton ml=\"auto\" aria-label=\"close\" variant=\"tertiary\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n </DrawerCloseTrigger>\n )}\n </ark.header>\n ),\n)\nInternalHeader.displayName = 'DialogHeader'\n\nexport const Header = withContext(styled(InternalHeader), 'header')\nexport const Body = withContext(styled(ark.main), 'body')\nexport const Footer = withContext(styled(ark.footer), 'footer')\nexport const Positioner = withContext(styled(ArkDialog.Positioner), 'positioner')\nexport const Title = withContext(styled(ArkDialog.Title), 'title')\nexport const Trigger = withContext(styled(ArkDialog.Trigger), 'trigger')\n\nexport interface DialogProps extends ComponentProps<typeof Root> {}\nexport interface DialogBackdropProps extends ComponentProps<typeof Backdrop> {}\nexport interface DialogCloseTriggerProps extends ComponentProps<typeof CloseTrigger> {}\nexport interface DialogContentProps extends ComponentProps<typeof Content> {}\nexport interface DialogHeaderProps extends ComponentProps<typeof Header> {}\nexport interface DialogBodyProps extends ComponentProps<typeof Body> {}\nexport interface DialogFooterProps extends ComponentProps<typeof Footer> {}\nexport interface DialogPositionerProps extends ComponentProps<typeof Positioner> {}\nexport interface DialogTitleProps extends ComponentProps<typeof Title> {}\nexport interface DialogTriggerProps extends ComponentProps<typeof Trigger> {}\n"],"mappings":"A,gkBAUM,CAAE,eAAc,eAAgBA,EAAAA,mBAAmBC,EAAAA,OAAQ,CAC/D,SAAU,EACZ,CAAC,EAEY8B,EAAOG,EAAahC,EAAAA,OAAU,KAAM,IAAA,GAAW,CAC1D,aAAc,CACZ,UAAW,GACX,cAAe,EACjB,CACF,CAAC,EACYsB,EAAWW,GAAA,EAAYhC,EAAAA,OAAAA,CAAOD,EAAAA,OAAU,QAAQ,EAAG,UAAU,EAC7DwB,EAAeS,GAAA,EAAYhC,EAAAA,OAAAA,CAAOD,EAAAA,OAAU,YAAY,EAAG,cAAc,EAEhFkC,GAAA,EAAkBhC,EAAAA,WAAAA,EAGrB,CA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