@stokelp/ui 2.103.0 → 2.104.1

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 (807) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +1 -0
  2. package/dist/_virtual/_rolldown/runtime.js +21 -0
  3. package/dist/components/accordion/Accordion.cjs +2 -2
  4. package/dist/components/accordion/Accordion.cjs.map +1 -1
  5. package/dist/components/accordion/Accordion.js +22 -27
  6. package/dist/components/accordion/Accordion.js.map +1 -1
  7. package/dist/components/action-card/ActionCard.cjs +2 -2
  8. package/dist/components/action-card/ActionCard.cjs.map +1 -1
  9. package/dist/components/action-card/ActionCard.js +23 -26
  10. package/dist/components/action-card/ActionCard.js.map +1 -1
  11. package/dist/components/alert/Alert.cjs +2 -2
  12. package/dist/components/alert/Alert.cjs.map +1 -1
  13. package/dist/components/alert/Alert.js +117 -84
  14. package/dist/components/alert/Alert.js.map +1 -1
  15. package/dist/components/app/mobile-card/MobileCardEntityRow.cjs +2 -2
  16. package/dist/components/app/mobile-card/MobileCardEntityRow.cjs.map +1 -1
  17. package/dist/components/app/mobile-card/MobileCardEntityRow.js +44 -25
  18. package/dist/components/app/mobile-card/MobileCardEntityRow.js.map +1 -1
  19. package/dist/components/app/mobile-card/MobileCardHeader.cjs +2 -2
  20. package/dist/components/app/mobile-card/MobileCardHeader.cjs.map +1 -1
  21. package/dist/components/app/mobile-card/MobileCardHeader.js +18 -20
  22. package/dist/components/app/mobile-card/MobileCardHeader.js.map +1 -1
  23. package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs +2 -2
  24. package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs.map +1 -1
  25. package/dist/components/app/mobile-card/MobileCardNotificationBadge.js +31 -13
  26. package/dist/components/app/mobile-card/MobileCardNotificationBadge.js.map +1 -1
  27. package/dist/components/app/mobile-card/MobileCardShell.cjs +2 -2
  28. package/dist/components/app/mobile-card/MobileCardShell.cjs.map +1 -1
  29. package/dist/components/app/mobile-card/MobileCardShell.js +17 -19
  30. package/dist/components/app/mobile-card/MobileCardShell.js.map +1 -1
  31. package/dist/components/app/mobile-card/MobileCardSkeleton.cjs +2 -2
  32. package/dist/components/app/mobile-card/MobileCardSkeleton.cjs.map +1 -1
  33. package/dist/components/app/mobile-card/MobileCardSkeleton.js +45 -22
  34. package/dist/components/app/mobile-card/MobileCardSkeleton.js.map +1 -1
  35. package/dist/components/app/mobile-navigation/MobileNavigation.cjs +2 -2
  36. package/dist/components/app/mobile-navigation/MobileNavigation.cjs.map +1 -1
  37. package/dist/components/app/mobile-navigation/MobileNavigation.d.ts +4 -5
  38. package/dist/components/app/mobile-navigation/MobileNavigation.js +16 -18
  39. package/dist/components/app/mobile-navigation/MobileNavigation.js.map +1 -1
  40. package/dist/components/app/navigation/AppNavigation.cjs +2 -2
  41. package/dist/components/app/navigation/AppNavigation.cjs.map +1 -1
  42. package/dist/components/app/navigation/AppNavigation.d.ts +11 -11
  43. package/dist/components/app/navigation/AppNavigation.js +35 -47
  44. package/dist/components/app/navigation/AppNavigation.js.map +1 -1
  45. package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs +2 -2
  46. package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.cjs.map +1 -1
  47. package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js +188 -119
  48. package/dist/components/app/navigation/language-select/AppNavigationLanguageSelect.js.map +1 -1
  49. package/dist/components/app/price-tag/PriceTag.cjs +2 -2
  50. package/dist/components/app/price-tag/PriceTag.cjs.map +1 -1
  51. package/dist/components/app/price-tag/PriceTag.js +25 -19
  52. package/dist/components/app/price-tag/PriceTag.js.map +1 -1
  53. package/dist/components/app/product-card-catalog/styled.cjs +2 -2
  54. package/dist/components/app/product-card-catalog/styled.cjs.map +1 -1
  55. package/dist/components/app/product-card-catalog/styled.js +23 -21
  56. package/dist/components/app/product-card-catalog/styled.js.map +1 -1
  57. package/dist/components/avatar/styled.cjs +2 -2
  58. package/dist/components/avatar/styled.cjs.map +1 -1
  59. package/dist/components/avatar/styled.d.ts +11 -7
  60. package/dist/components/avatar/styled.js +28 -27
  61. package/dist/components/avatar/styled.js.map +1 -1
  62. package/dist/components/box/Box.cjs +2 -2
  63. package/dist/components/box/Box.cjs.map +1 -1
  64. package/dist/components/box/Box.js +11 -10
  65. package/dist/components/box/Box.js.map +1 -1
  66. package/dist/components/breadcrumb/Breadcrumb.cjs +2 -2
  67. package/dist/components/breadcrumb/Breadcrumb.cjs.map +1 -1
  68. package/dist/components/breadcrumb/Breadcrumb.d.ts +6 -8
  69. package/dist/components/breadcrumb/Breadcrumb.js +39 -35
  70. package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
  71. package/dist/components/button/Button.cjs +2 -2
  72. package/dist/components/button/Button.cjs.map +1 -1
  73. package/dist/components/button/Button.d.ts +8 -4
  74. package/dist/components/button/Button.js +9 -8
  75. package/dist/components/button/Button.js.map +1 -1
  76. package/dist/components/button-filter/ButtonFilter.cjs +2 -2
  77. package/dist/components/button-filter/ButtonFilter.cjs.map +1 -1
  78. package/dist/components/button-filter/ButtonFilter.d.ts +5 -4
  79. package/dist/components/button-filter/ButtonFilter.js +9 -8
  80. package/dist/components/button-filter/ButtonFilter.js.map +1 -1
  81. package/dist/components/chat/Chat.cjs +2 -2
  82. package/dist/components/chat/Chat.cjs.map +1 -1
  83. package/dist/components/chat/Chat.d.ts +15 -8
  84. package/dist/components/chat/Chat.js +27 -26
  85. package/dist/components/chat/Chat.js.map +1 -1
  86. package/dist/components/chat/ChatDocumentMessage.cjs +2 -2
  87. package/dist/components/chat/ChatDocumentMessage.cjs.map +1 -1
  88. package/dist/components/chat/ChatDocumentMessage.js +32 -31
  89. package/dist/components/chat/ChatDocumentMessage.js.map +1 -1
  90. package/dist/components/chat/ChatMessage.cjs +2 -2
  91. package/dist/components/chat/ChatMessage.cjs.map +1 -1
  92. package/dist/components/chat/ChatMessage.d.ts +7 -4
  93. package/dist/components/chat/ChatMessage.js +8 -7
  94. package/dist/components/chat/ChatMessage.js.map +1 -1
  95. package/dist/components/chat/ChatProfileAvatar.cjs +2 -2
  96. package/dist/components/chat/ChatProfileAvatar.cjs.map +1 -1
  97. package/dist/components/chat/ChatProfileAvatar.js +24 -16
  98. package/dist/components/chat/ChatProfileAvatar.js.map +1 -1
  99. package/dist/components/chat/ChatTextInput.cjs +2 -2
  100. package/dist/components/chat/ChatTextInput.cjs.map +1 -1
  101. package/dist/components/chat/ChatTextInput.d.ts +2 -2
  102. package/dist/components/chat/ChatTextInput.js +44 -52
  103. package/dist/components/chat/ChatTextInput.js.map +1 -1
  104. package/dist/components/checkbox/Checkbox.cjs +2 -2
  105. package/dist/components/checkbox/Checkbox.cjs.map +1 -1
  106. package/dist/components/checkbox/Checkbox.js +36 -34
  107. package/dist/components/checkbox/Checkbox.js.map +1 -1
  108. package/dist/components/checkbox-card/CheckboxCard.cjs +2 -2
  109. package/dist/components/checkbox-card/CheckboxCard.cjs.map +1 -1
  110. package/dist/components/checkbox-card/CheckboxCard.d.ts +2 -2
  111. package/dist/components/checkbox-card/CheckboxCard.js +33 -38
  112. package/dist/components/checkbox-card/CheckboxCard.js.map +1 -1
  113. package/dist/components/checkbox-card/namespace.cjs +2 -2
  114. package/dist/components/checkbox-card/namespace.cjs.map +1 -1
  115. package/dist/components/checkbox-card/namespace.js +14 -9
  116. package/dist/components/checkbox-card/namespace.js.map +1 -1
  117. package/dist/components/chip/Chip.cjs +2 -2
  118. package/dist/components/chip/Chip.cjs.map +1 -1
  119. package/dist/components/chip/Chip.d.ts +1 -1
  120. package/dist/components/chip/Chip.js +23 -23
  121. package/dist/components/chip/Chip.js.map +1 -1
  122. package/dist/components/collapsible/styled.cjs +2 -2
  123. package/dist/components/collapsible/styled.cjs.map +1 -1
  124. package/dist/components/collapsible/styled.js +15 -11
  125. package/dist/components/collapsible/styled.js.map +1 -1
  126. package/dist/components/combobox/Combobox.cjs +2 -2
  127. package/dist/components/combobox/Combobox.cjs.map +1 -1
  128. package/dist/components/combobox/Combobox.js +206 -173
  129. package/dist/components/combobox/Combobox.js.map +1 -1
  130. package/dist/components/date-picker/DatePicker.cjs +2 -2
  131. package/dist/components/date-picker/DatePicker.cjs.map +1 -1
  132. package/dist/components/date-picker/DatePicker.d.ts +2 -2
  133. package/dist/components/date-picker/DatePicker.js +151 -127
  134. package/dist/components/date-picker/DatePicker.js.map +1 -1
  135. package/dist/components/dialog/styled.cjs +2 -2
  136. package/dist/components/dialog/styled.cjs.map +1 -1
  137. package/dist/components/dialog/styled.js +75 -65
  138. package/dist/components/dialog/styled.js.map +1 -1
  139. package/dist/components/drawer/Drawer.cjs +2 -2
  140. package/dist/components/drawer/Drawer.cjs.map +1 -1
  141. package/dist/components/drawer/Drawer.js +69 -63
  142. package/dist/components/drawer/Drawer.js.map +1 -1
  143. package/dist/components/flag/styled.cjs +2 -2
  144. package/dist/components/flag/styled.cjs.map +1 -1
  145. package/dist/components/flag/styled.d.ts +9 -7
  146. package/dist/components/flag/styled.js +8437 -3751
  147. package/dist/components/flag/styled.js.map +1 -1
  148. package/dist/components/form/FormControl.cjs +2 -2
  149. package/dist/components/form/FormControl.cjs.map +1 -1
  150. package/dist/components/form/FormControl.d.ts +3 -3
  151. package/dist/components/form/FormControl.js +13 -18
  152. package/dist/components/form/FormControl.js.map +1 -1
  153. package/dist/components/form/FormHelperText.cjs +2 -2
  154. package/dist/components/form/FormHelperText.cjs.map +1 -1
  155. package/dist/components/form/FormHelperText.d.ts +1 -1
  156. package/dist/components/form/FormHelperText.js +8 -9
  157. package/dist/components/form/FormHelperText.js.map +1 -1
  158. package/dist/components/form/FormLabel.cjs +2 -2
  159. package/dist/components/form/FormLabel.cjs.map +1 -1
  160. package/dist/components/form/FormLabel.d.ts +3 -3
  161. package/dist/components/form/FormLabel.js +38 -33
  162. package/dist/components/form/FormLabel.js.map +1 -1
  163. package/dist/components/heading/Heading.cjs +2 -2
  164. package/dist/components/heading/Heading.cjs.map +1 -1
  165. package/dist/components/heading/Heading.js +14 -10
  166. package/dist/components/heading/Heading.js.map +1 -1
  167. package/dist/components/icon/Icon.cjs +2 -2
  168. package/dist/components/icon/Icon.cjs.map +1 -1
  169. package/dist/components/icon/Icon.d.ts +2 -2
  170. package/dist/components/icon/Icon.js +15 -10
  171. package/dist/components/icon/Icon.js.map +1 -1
  172. package/dist/components/icon-button/IconButton.cjs +2 -2
  173. package/dist/components/icon-button/IconButton.cjs.map +1 -1
  174. package/dist/components/icon-button/IconButton.d.ts +2 -3
  175. package/dist/components/icon-button/IconButton.js +8 -7
  176. package/dist/components/icon-button/IconButton.js.map +1 -1
  177. package/dist/components/illustration/Illustration.cjs +2 -2
  178. package/dist/components/illustration/Illustration.cjs.map +1 -1
  179. package/dist/components/illustration/Illustration.js +35 -39
  180. package/dist/components/illustration/Illustration.js.map +1 -1
  181. package/dist/components/illustration/patterns.cjs +2 -2
  182. package/dist/components/illustration/patterns.cjs.map +1 -1
  183. package/dist/components/illustration/patterns.js +5563 -8897
  184. package/dist/components/illustration/patterns.js.map +1 -1
  185. package/dist/components/input/HighlightedInput.cjs +2 -2
  186. package/dist/components/input/HighlightedInput.cjs.map +1 -1
  187. package/dist/components/input/HighlightedInput.d.ts +13 -16
  188. package/dist/components/input/HighlightedInput.js +43 -58
  189. package/dist/components/input/HighlightedInput.js.map +1 -1
  190. package/dist/components/input/Input.cjs +2 -2
  191. package/dist/components/input/Input.cjs.map +1 -1
  192. package/dist/components/input/Input.d.ts +2 -3
  193. package/dist/components/input/Input.js +12 -13
  194. package/dist/components/input/Input.js.map +1 -1
  195. package/dist/components/input/InputAddon.cjs +2 -2
  196. package/dist/components/input/InputAddon.cjs.map +1 -1
  197. package/dist/components/input/InputAddon.d.ts +5 -4
  198. package/dist/components/input/InputAddon.js +8 -9
  199. package/dist/components/input/InputAddon.js.map +1 -1
  200. package/dist/components/input/InputGroup.cjs +2 -2
  201. package/dist/components/input/InputGroup.cjs.map +1 -1
  202. package/dist/components/input/InputGroup.d.ts +1 -1
  203. package/dist/components/input/InputGroup.js +8 -9
  204. package/dist/components/input/InputGroup.js.map +1 -1
  205. package/dist/components/input/PhoneNumberInput.cjs +2 -2
  206. package/dist/components/input/PhoneNumberInput.cjs.map +1 -1
  207. package/dist/components/input/PhoneNumberInput.js +21 -23
  208. package/dist/components/input/PhoneNumberInput.js.map +1 -1
  209. package/dist/components/menu/Menu.cjs +2 -2
  210. package/dist/components/menu/Menu.cjs.map +1 -1
  211. package/dist/components/menu/Menu.js +32 -28
  212. package/dist/components/menu/Menu.js.map +1 -1
  213. package/dist/components/pagination/Pagination.cjs +2 -2
  214. package/dist/components/pagination/Pagination.cjs.map +1 -1
  215. package/dist/components/pagination/Pagination.d.ts +1 -1
  216. package/dist/components/pagination/Pagination.js +76 -84
  217. package/dist/components/pagination/Pagination.js.map +1 -1
  218. package/dist/components/pagination/use-pagination.cjs +2 -2
  219. package/dist/components/pagination/use-pagination.cjs.map +1 -1
  220. package/dist/components/pagination/use-pagination.js +56 -54
  221. package/dist/components/pagination/use-pagination.js.map +1 -1
  222. package/dist/components/popover/Popover.cjs +2 -2
  223. package/dist/components/popover/Popover.cjs.map +1 -1
  224. package/dist/components/popover/Popover.js +21 -25
  225. package/dist/components/popover/Popover.js.map +1 -1
  226. package/dist/components/radio-button-group/RadioButtonGroup.cjs +2 -2
  227. package/dist/components/radio-button-group/RadioButtonGroup.cjs.map +1 -1
  228. package/dist/components/radio-button-group/RadioButtonGroup.js +20 -20
  229. package/dist/components/radio-button-group/RadioButtonGroup.js.map +1 -1
  230. package/dist/components/radio-card-group/RadioCardGroup.cjs +2 -2
  231. package/dist/components/radio-card-group/RadioCardGroup.cjs.map +1 -1
  232. package/dist/components/radio-card-group/RadioCardGroup.d.ts +2 -2
  233. package/dist/components/radio-card-group/RadioCardGroup.js +21 -22
  234. package/dist/components/radio-card-group/RadioCardGroup.js.map +1 -1
  235. package/dist/components/radio-card-group/namespace.cjs +2 -2
  236. package/dist/components/radio-card-group/namespace.cjs.map +1 -1
  237. package/dist/components/radio-card-group/namespace.js +15 -10
  238. package/dist/components/radio-card-group/namespace.js.map +1 -1
  239. package/dist/components/radio-group/RadioGroup.cjs +2 -2
  240. package/dist/components/radio-group/RadioGroup.cjs.map +1 -1
  241. package/dist/components/radio-group/RadioGroup.js +21 -21
  242. package/dist/components/radio-group/RadioGroup.js.map +1 -1
  243. package/dist/components/select/Select.cjs +2 -2
  244. package/dist/components/select/Select.cjs.map +1 -1
  245. package/dist/components/select/Select.js +194 -141
  246. package/dist/components/select/Select.js.map +1 -1
  247. package/dist/components/select-language/SelectLanguage.cjs +2 -2
  248. package/dist/components/select-language/SelectLanguage.cjs.map +1 -1
  249. package/dist/components/select-language/SelectLanguage.js +114 -88
  250. package/dist/components/select-language/SelectLanguage.js.map +1 -1
  251. package/dist/components/status-tag-select/StatusTagSelect.cjs +2 -2
  252. package/dist/components/status-tag-select/StatusTagSelect.cjs.map +1 -1
  253. package/dist/components/status-tag-select/StatusTagSelect.js +93 -115
  254. package/dist/components/status-tag-select/StatusTagSelect.js.map +1 -1
  255. package/dist/components/switch/Switch.cjs +2 -2
  256. package/dist/components/switch/Switch.cjs.map +1 -1
  257. package/dist/components/switch/Switch.js +30 -18
  258. package/dist/components/switch/Switch.js.map +1 -1
  259. package/dist/components/switch-card/SwitchCard.cjs +2 -2
  260. package/dist/components/switch-card/SwitchCard.cjs.map +1 -1
  261. package/dist/components/switch-card/SwitchCard.d.ts +2 -2
  262. package/dist/components/switch-card/SwitchCard.js +28 -25
  263. package/dist/components/switch-card/SwitchCard.js.map +1 -1
  264. package/dist/components/switch-card/namespace.cjs +2 -2
  265. package/dist/components/switch-card/namespace.cjs.map +1 -1
  266. package/dist/components/switch-card/namespace.js +14 -9
  267. package/dist/components/switch-card/namespace.js.map +1 -1
  268. package/dist/components/table/Table.cjs +2 -2
  269. package/dist/components/table/Table.cjs.map +1 -1
  270. package/dist/components/table/Table.d.ts +12 -13
  271. package/dist/components/table/Table.js +133 -109
  272. package/dist/components/table/Table.js.map +1 -1
  273. package/dist/components/table/TableProvider.cjs +2 -2
  274. package/dist/components/table/TableProvider.cjs.map +1 -1
  275. package/dist/components/table/TableProvider.js +36 -39
  276. package/dist/components/table/TableProvider.js.map +1 -1
  277. package/dist/components/tabs/Tabs.cjs +2 -2
  278. package/dist/components/tabs/Tabs.cjs.map +1 -1
  279. package/dist/components/tabs/Tabs.d.ts +8 -4
  280. package/dist/components/tabs/Tabs.js +18 -26
  281. package/dist/components/tabs/Tabs.js.map +1 -1
  282. package/dist/components/tag/Tag.cjs +2 -2
  283. package/dist/components/tag/Tag.cjs.map +1 -1
  284. package/dist/components/tag/Tag.js +22 -16
  285. package/dist/components/tag/Tag.js.map +1 -1
  286. package/dist/components/text/Text.cjs +2 -2
  287. package/dist/components/text/Text.cjs.map +1 -1
  288. package/dist/components/text/Text.js +12 -11
  289. package/dist/components/text/Text.js.map +1 -1
  290. package/dist/components/textarea/Textarea.cjs +2 -2
  291. package/dist/components/textarea/Textarea.cjs.map +1 -1
  292. package/dist/components/textarea/Textarea.d.ts +6 -6
  293. package/dist/components/textarea/Textarea.js +9 -8
  294. package/dist/components/textarea/Textarea.js.map +1 -1
  295. package/dist/components/tooltip/Tooltip.cjs +2 -2
  296. package/dist/components/tooltip/Tooltip.cjs.map +1 -1
  297. package/dist/components/tooltip/Tooltip.js +38 -42
  298. package/dist/components/tooltip/Tooltip.js.map +1 -1
  299. package/dist/icons/index.cjs +2 -2
  300. package/dist/icons/index.cjs.map +1 -1
  301. package/dist/icons/index.js +65 -58
  302. package/dist/icons/index.js.map +1 -1
  303. package/dist/index.cjs +1 -2
  304. package/dist/index.js +66 -191
  305. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +2 -0
  306. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +1 -0
  307. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js +25 -0
  308. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +1 -0
  309. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +2 -0
  310. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +1 -0
  311. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js +25 -0
  312. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +1 -0
  313. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs +2 -0
  314. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs.map +1 -0
  315. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js +25 -0
  316. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +1 -0
  317. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +2 -0
  318. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs.map +1 -0
  319. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js +25 -0
  320. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.2.6/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +1 -0
  321. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.cjs +2 -0
  322. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.cjs.map +1 -0
  323. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js +77 -0
  324. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js.map +1 -0
  325. package/dist/preset.cjs +2 -2
  326. package/dist/preset.cjs.map +1 -1
  327. package/dist/preset.d.ts +1 -1
  328. package/dist/preset.js +30 -31
  329. package/dist/preset.js.map +1 -1
  330. package/dist/shared/ConditionalWrapper.cjs +2 -2
  331. package/dist/shared/ConditionalWrapper.cjs.map +1 -1
  332. package/dist/shared/ConditionalWrapper.js +6 -5
  333. package/dist/shared/ConditionalWrapper.js.map +1 -1
  334. package/dist/shared/assets/icons.cjs +2 -2
  335. package/dist/shared/assets/icons.cjs.map +1 -1
  336. package/dist/shared/assets/icons.js +30 -22
  337. package/dist/shared/assets/icons.js.map +1 -1
  338. package/dist/shared/hooks/useUncontrolled.cjs +2 -2
  339. package/dist/shared/hooks/useUncontrolled.cjs.map +1 -1
  340. package/dist/shared/hooks/useUncontrolled.js +19 -16
  341. package/dist/shared/hooks/useUncontrolled.js.map +1 -1
  342. package/dist/shared/utils/events.cjs +2 -2
  343. package/dist/shared/utils/events.cjs.map +1 -1
  344. package/dist/shared/utils/events.js +7 -6
  345. package/dist/shared/utils/events.js.map +1 -1
  346. package/dist/theme/breakpoints.cjs +2 -2
  347. package/dist/theme/breakpoints.cjs.map +1 -1
  348. package/dist/theme/breakpoints.js +10 -9
  349. package/dist/theme/breakpoints.js.map +1 -1
  350. package/dist/theme/conditions.cjs +2 -2
  351. package/dist/theme/conditions.cjs.map +1 -1
  352. package/dist/theme/conditions.js +23 -24
  353. package/dist/theme/conditions.js.map +1 -1
  354. package/dist/theme/containers.cjs +2 -2
  355. package/dist/theme/containers.cjs.map +1 -1
  356. package/dist/theme/containers.js +18 -17
  357. package/dist/theme/containers.js.map +1 -1
  358. package/dist/theme/globalCss.cjs +4 -4
  359. package/dist/theme/globalCss.cjs.map +1 -1
  360. package/dist/theme/globalCss.d.ts +1 -1
  361. package/dist/theme/globalCss.js +94 -99
  362. package/dist/theme/globalCss.js.map +1 -1
  363. package/dist/theme/keyframes.cjs +2 -2
  364. package/dist/theme/keyframes.cjs.map +1 -1
  365. package/dist/theme/keyframes.d.ts +1 -1
  366. package/dist/theme/keyframes.js +256 -171
  367. package/dist/theme/keyframes.js.map +1 -1
  368. package/dist/theme/recipes/accordion.cjs +2 -2
  369. package/dist/theme/recipes/accordion.cjs.map +1 -1
  370. package/dist/theme/recipes/accordion.d.ts +1 -1
  371. package/dist/theme/recipes/accordion.js +93 -110
  372. package/dist/theme/recipes/accordion.js.map +1 -1
  373. package/dist/theme/recipes/action-card.cjs +2 -2
  374. package/dist/theme/recipes/action-card.cjs.map +1 -1
  375. package/dist/theme/recipes/action-card.d.ts +1 -1
  376. package/dist/theme/recipes/action-card.js +88 -84
  377. package/dist/theme/recipes/action-card.js.map +1 -1
  378. package/dist/theme/recipes/alert.cjs +2 -2
  379. package/dist/theme/recipes/alert.cjs.map +1 -1
  380. package/dist/theme/recipes/alert.d.ts +1 -1
  381. package/dist/theme/recipes/alert.js +52 -65
  382. package/dist/theme/recipes/alert.js.map +1 -1
  383. package/dist/theme/recipes/app/mobile-navigation.cjs +2 -2
  384. package/dist/theme/recipes/app/mobile-navigation.cjs.map +1 -1
  385. package/dist/theme/recipes/app/mobile-navigation.d.ts +1 -1
  386. package/dist/theme/recipes/app/mobile-navigation.js +94 -108
  387. package/dist/theme/recipes/app/mobile-navigation.js.map +1 -1
  388. package/dist/theme/recipes/app/navigation-language-select.cjs +2 -2
  389. package/dist/theme/recipes/app/navigation-language-select.cjs.map +1 -1
  390. package/dist/theme/recipes/app/navigation-language-select.d.ts +1 -1
  391. package/dist/theme/recipes/app/navigation-language-select.js +135 -148
  392. package/dist/theme/recipes/app/navigation-language-select.js.map +1 -1
  393. package/dist/theme/recipes/app/navigation.cjs +2 -2
  394. package/dist/theme/recipes/app/navigation.cjs.map +1 -1
  395. package/dist/theme/recipes/app/navigation.d.ts +1 -1
  396. package/dist/theme/recipes/app/navigation.js +214 -269
  397. package/dist/theme/recipes/app/navigation.js.map +1 -1
  398. package/dist/theme/recipes/app/price-tag.cjs +2 -2
  399. package/dist/theme/recipes/app/price-tag.cjs.map +1 -1
  400. package/dist/theme/recipes/app/price-tag.d.ts +1 -1
  401. package/dist/theme/recipes/app/price-tag.js +59 -70
  402. package/dist/theme/recipes/app/price-tag.js.map +1 -1
  403. package/dist/theme/recipes/app/product-card-catalog.cjs +2 -2
  404. package/dist/theme/recipes/app/product-card-catalog.cjs.map +1 -1
  405. package/dist/theme/recipes/app/product-card-catalog.d.ts +1 -1
  406. package/dist/theme/recipes/app/product-card-catalog.js +189 -194
  407. package/dist/theme/recipes/app/product-card-catalog.js.map +1 -1
  408. package/dist/theme/recipes/avatar-group.cjs +2 -2
  409. package/dist/theme/recipes/avatar-group.cjs.map +1 -1
  410. package/dist/theme/recipes/avatar-group.d.ts +1 -1
  411. package/dist/theme/recipes/avatar-group.js +27 -38
  412. package/dist/theme/recipes/avatar-group.js.map +1 -1
  413. package/dist/theme/recipes/avatar.cjs +2 -2
  414. package/dist/theme/recipes/avatar.cjs.map +1 -1
  415. package/dist/theme/recipes/avatar.d.ts +1 -1
  416. package/dist/theme/recipes/avatar.js +97 -95
  417. package/dist/theme/recipes/avatar.js.map +1 -1
  418. package/dist/theme/recipes/breadcrumb.cjs +2 -2
  419. package/dist/theme/recipes/breadcrumb.cjs.map +1 -1
  420. package/dist/theme/recipes/breadcrumb.d.ts +1 -1
  421. package/dist/theme/recipes/breadcrumb.js +35 -31
  422. package/dist/theme/recipes/breadcrumb.js.map +1 -1
  423. package/dist/theme/recipes/button-filter.cjs +2 -2
  424. package/dist/theme/recipes/button-filter.cjs.map +1 -1
  425. package/dist/theme/recipes/button-filter.d.ts +1 -1
  426. package/dist/theme/recipes/button-filter.js +57 -60
  427. package/dist/theme/recipes/button-filter.js.map +1 -1
  428. package/dist/theme/recipes/button.cjs +2 -2
  429. package/dist/theme/recipes/button.cjs.map +1 -1
  430. package/dist/theme/recipes/button.d.ts +1 -1
  431. package/dist/theme/recipes/button.js +287 -295
  432. package/dist/theme/recipes/button.js.map +1 -1
  433. package/dist/theme/recipes/chat/chat-document-message.cjs +2 -2
  434. package/dist/theme/recipes/chat/chat-document-message.cjs.map +1 -1
  435. package/dist/theme/recipes/chat/chat-document-message.d.ts +1 -1
  436. package/dist/theme/recipes/chat/chat-document-message.js +38 -43
  437. package/dist/theme/recipes/chat/chat-document-message.js.map +1 -1
  438. package/dist/theme/recipes/chat/chat-input-text.cjs +2 -2
  439. package/dist/theme/recipes/chat/chat-input-text.cjs.map +1 -1
  440. package/dist/theme/recipes/chat/chat-input-text.d.ts +1 -1
  441. package/dist/theme/recipes/chat/chat-input-text.js +26 -27
  442. package/dist/theme/recipes/chat/chat-input-text.js.map +1 -1
  443. package/dist/theme/recipes/chat/chat-message.cjs +2 -2
  444. package/dist/theme/recipes/chat/chat-message.cjs.map +1 -1
  445. package/dist/theme/recipes/chat/chat-message.d.ts +1 -1
  446. package/dist/theme/recipes/chat/chat-message.js +49 -45
  447. package/dist/theme/recipes/chat/chat-message.js.map +1 -1
  448. package/dist/theme/recipes/chat/chat-profile-avatar.cjs +2 -2
  449. package/dist/theme/recipes/chat/chat-profile-avatar.cjs.map +1 -1
  450. package/dist/theme/recipes/chat/chat-profile-avatar.d.ts +1 -1
  451. package/dist/theme/recipes/chat/chat-profile-avatar.js +20 -25
  452. package/dist/theme/recipes/chat/chat-profile-avatar.js.map +1 -1
  453. package/dist/theme/recipes/chat/chat.cjs +2 -2
  454. package/dist/theme/recipes/chat/chat.cjs.map +1 -1
  455. package/dist/theme/recipes/chat/chat.d.ts +1 -1
  456. package/dist/theme/recipes/chat/chat.js +51 -56
  457. package/dist/theme/recipes/chat/chat.js.map +1 -1
  458. package/dist/theme/recipes/checkbox-card.cjs +2 -2
  459. package/dist/theme/recipes/checkbox-card.cjs.map +1 -1
  460. package/dist/theme/recipes/checkbox-card.js +44 -40
  461. package/dist/theme/recipes/checkbox-card.js.map +1 -1
  462. package/dist/theme/recipes/checkbox-group.cjs +2 -2
  463. package/dist/theme/recipes/checkbox-group.cjs.map +1 -1
  464. package/dist/theme/recipes/checkbox-group.d.ts +1 -1
  465. package/dist/theme/recipes/checkbox-group.js +13 -12
  466. package/dist/theme/recipes/checkbox-group.js.map +1 -1
  467. package/dist/theme/recipes/checkbox.cjs +2 -2
  468. package/dist/theme/recipes/checkbox.cjs.map +1 -1
  469. package/dist/theme/recipes/checkbox.d.ts +1 -1
  470. package/dist/theme/recipes/checkbox.js +110 -129
  471. package/dist/theme/recipes/checkbox.js.map +1 -1
  472. package/dist/theme/recipes/chip.cjs +2 -2
  473. package/dist/theme/recipes/chip.cjs.map +1 -1
  474. package/dist/theme/recipes/chip.d.ts +1 -1
  475. package/dist/theme/recipes/chip.js +144 -182
  476. package/dist/theme/recipes/chip.js.map +1 -1
  477. package/dist/theme/recipes/collapsible.cjs +2 -2
  478. package/dist/theme/recipes/collapsible.cjs.map +1 -1
  479. package/dist/theme/recipes/collapsible.d.ts +1 -1
  480. package/dist/theme/recipes/collapsible.js +30 -28
  481. package/dist/theme/recipes/collapsible.js.map +1 -1
  482. package/dist/theme/recipes/combobox.cjs +2 -2
  483. package/dist/theme/recipes/combobox.cjs.map +1 -1
  484. package/dist/theme/recipes/combobox.d.ts +1 -1
  485. package/dist/theme/recipes/combobox.js +149 -176
  486. package/dist/theme/recipes/combobox.js.map +1 -1
  487. package/dist/theme/recipes/common/group-card.cjs +2 -2
  488. package/dist/theme/recipes/common/group-card.cjs.map +1 -1
  489. package/dist/theme/recipes/common/group-card.js +60 -80
  490. package/dist/theme/recipes/common/group-card.js.map +1 -1
  491. package/dist/theme/recipes/datepicker.cjs +2 -2
  492. package/dist/theme/recipes/datepicker.cjs.map +1 -1
  493. package/dist/theme/recipes/datepicker.d.ts +1 -1
  494. package/dist/theme/recipes/datepicker.js +149 -176
  495. package/dist/theme/recipes/datepicker.js.map +1 -1
  496. package/dist/theme/recipes/dialog.cjs +2 -2
  497. package/dist/theme/recipes/dialog.cjs.map +1 -1
  498. package/dist/theme/recipes/dialog.d.ts +1 -1
  499. package/dist/theme/recipes/dialog.js +137 -151
  500. package/dist/theme/recipes/dialog.js.map +1 -1
  501. package/dist/theme/recipes/drawer.cjs +2 -2
  502. package/dist/theme/recipes/drawer.cjs.map +1 -1
  503. package/dist/theme/recipes/drawer.d.ts +1 -1
  504. package/dist/theme/recipes/drawer.js +105 -125
  505. package/dist/theme/recipes/drawer.js.map +1 -1
  506. package/dist/theme/recipes/flag.cjs +2 -2
  507. package/dist/theme/recipes/flag.cjs.map +1 -1
  508. package/dist/theme/recipes/flag.d.ts +1 -1
  509. package/dist/theme/recipes/flag.js +21 -30
  510. package/dist/theme/recipes/flag.js.map +1 -1
  511. package/dist/theme/recipes/form/control.cjs +2 -2
  512. package/dist/theme/recipes/form/control.cjs.map +1 -1
  513. package/dist/theme/recipes/form/control.d.ts +1 -1
  514. package/dist/theme/recipes/form/control.js +27 -34
  515. package/dist/theme/recipes/form/control.js.map +1 -1
  516. package/dist/theme/recipes/form/helper-text.cjs +2 -2
  517. package/dist/theme/recipes/form/helper-text.cjs.map +1 -1
  518. package/dist/theme/recipes/form/helper-text.d.ts +1 -1
  519. package/dist/theme/recipes/form/helper-text.js +14 -13
  520. package/dist/theme/recipes/form/helper-text.js.map +1 -1
  521. package/dist/theme/recipes/form/label.cjs +2 -2
  522. package/dist/theme/recipes/form/label.cjs.map +1 -1
  523. package/dist/theme/recipes/form/label.d.ts +1 -1
  524. package/dist/theme/recipes/form/label.js +47 -48
  525. package/dist/theme/recipes/form/label.js.map +1 -1
  526. package/dist/theme/recipes/heading.cjs +2 -2
  527. package/dist/theme/recipes/heading.cjs.map +1 -1
  528. package/dist/theme/recipes/heading.d.ts +1 -1
  529. package/dist/theme/recipes/heading.js +25 -34
  530. package/dist/theme/recipes/heading.js.map +1 -1
  531. package/dist/theme/recipes/highlightedInput.cjs +2 -2
  532. package/dist/theme/recipes/highlightedInput.cjs.map +1 -1
  533. package/dist/theme/recipes/highlightedInput.d.ts +1 -1
  534. package/dist/theme/recipes/highlightedInput.js +54 -45
  535. package/dist/theme/recipes/highlightedInput.js.map +1 -1
  536. package/dist/theme/recipes/icon-button.cjs +2 -2
  537. package/dist/theme/recipes/icon-button.cjs.map +1 -1
  538. package/dist/theme/recipes/icon-button.js +81 -89
  539. package/dist/theme/recipes/icon-button.js.map +1 -1
  540. package/dist/theme/recipes/icon.cjs +2 -2
  541. package/dist/theme/recipes/icon.cjs.map +1 -1
  542. package/dist/theme/recipes/icon.d.ts +1 -1
  543. package/dist/theme/recipes/icon.js +39 -42
  544. package/dist/theme/recipes/icon.js.map +1 -1
  545. package/dist/theme/recipes/illustration.cjs +2 -2
  546. package/dist/theme/recipes/illustration.cjs.map +1 -1
  547. package/dist/theme/recipes/illustration.d.ts +1 -1
  548. package/dist/theme/recipes/illustration.js +29 -48
  549. package/dist/theme/recipes/illustration.js.map +1 -1
  550. package/dist/theme/recipes/index.cjs +2 -2
  551. package/dist/theme/recipes/index.cjs.map +1 -1
  552. package/dist/theme/recipes/index.d.ts +1 -1
  553. package/dist/theme/recipes/index.js +127 -127
  554. package/dist/theme/recipes/index.js.map +1 -1
  555. package/dist/theme/recipes/input-addon.cjs +2 -2
  556. package/dist/theme/recipes/input-addon.cjs.map +1 -1
  557. package/dist/theme/recipes/input-addon.d.ts +1 -1
  558. package/dist/theme/recipes/input-addon.js +24 -24
  559. package/dist/theme/recipes/input-addon.js.map +1 -1
  560. package/dist/theme/recipes/input-group.cjs +2 -2
  561. package/dist/theme/recipes/input-group.cjs.map +1 -1
  562. package/dist/theme/recipes/input-group.d.ts +1 -1
  563. package/dist/theme/recipes/input-group.js +40 -49
  564. package/dist/theme/recipes/input-group.js.map +1 -1
  565. package/dist/theme/recipes/input.cjs +2 -2
  566. package/dist/theme/recipes/input.cjs.map +1 -1
  567. package/dist/theme/recipes/input.d.ts +1 -1
  568. package/dist/theme/recipes/input.js +48 -61
  569. package/dist/theme/recipes/input.js.map +1 -1
  570. package/dist/theme/recipes/menu.cjs +2 -2
  571. package/dist/theme/recipes/menu.cjs.map +1 -1
  572. package/dist/theme/recipes/menu.d.ts +1 -1
  573. package/dist/theme/recipes/menu.js +96 -100
  574. package/dist/theme/recipes/menu.js.map +1 -1
  575. package/dist/theme/recipes/pagination.cjs +2 -2
  576. package/dist/theme/recipes/pagination.cjs.map +1 -1
  577. package/dist/theme/recipes/pagination.d.ts +1 -1
  578. package/dist/theme/recipes/pagination.js +76 -71
  579. package/dist/theme/recipes/pagination.js.map +1 -1
  580. package/dist/theme/recipes/phone-number-input.cjs +2 -2
  581. package/dist/theme/recipes/phone-number-input.cjs.map +1 -1
  582. package/dist/theme/recipes/phone-number-input.d.ts +1 -1
  583. package/dist/theme/recipes/phone-number-input.js +55 -66
  584. package/dist/theme/recipes/phone-number-input.js.map +1 -1
  585. package/dist/theme/recipes/popover.cjs +2 -2
  586. package/dist/theme/recipes/popover.cjs.map +1 -1
  587. package/dist/theme/recipes/popover.d.ts +1 -1
  588. package/dist/theme/recipes/popover.js +30 -28
  589. package/dist/theme/recipes/popover.js.map +1 -1
  590. package/dist/theme/recipes/radio-button-group.cjs +2 -2
  591. package/dist/theme/recipes/radio-button-group.cjs.map +1 -1
  592. package/dist/theme/recipes/radio-button-group.d.ts +1 -1
  593. package/dist/theme/recipes/radio-button-group.js +83 -94
  594. package/dist/theme/recipes/radio-button-group.js.map +1 -1
  595. package/dist/theme/recipes/radio-card-group.cjs +2 -2
  596. package/dist/theme/recipes/radio-card-group.cjs.map +1 -1
  597. package/dist/theme/recipes/radio-card-group.d.ts +1 -1
  598. package/dist/theme/recipes/radio-card-group.js +64 -67
  599. package/dist/theme/recipes/radio-card-group.js.map +1 -1
  600. package/dist/theme/recipes/radio-group.cjs +2 -2
  601. package/dist/theme/recipes/radio-group.cjs.map +1 -1
  602. package/dist/theme/recipes/radio-group.d.ts +1 -1
  603. package/dist/theme/recipes/radio-group.js +101 -118
  604. package/dist/theme/recipes/radio-group.js.map +1 -1
  605. package/dist/theme/recipes/select-language.cjs +2 -2
  606. package/dist/theme/recipes/select-language.cjs.map +1 -1
  607. package/dist/theme/recipes/select-language.d.ts +1 -1
  608. package/dist/theme/recipes/select-language.js +93 -112
  609. package/dist/theme/recipes/select-language.js.map +1 -1
  610. package/dist/theme/recipes/select.cjs +2 -2
  611. package/dist/theme/recipes/select.cjs.map +1 -1
  612. package/dist/theme/recipes/select.d.ts +1 -1
  613. package/dist/theme/recipes/select.js +194 -206
  614. package/dist/theme/recipes/select.js.map +1 -1
  615. package/dist/theme/recipes/status-tag-select.cjs +2 -2
  616. package/dist/theme/recipes/status-tag-select.cjs.map +1 -1
  617. package/dist/theme/recipes/status-tag-select.d.ts +1 -1
  618. package/dist/theme/recipes/status-tag-select.js +162 -175
  619. package/dist/theme/recipes/status-tag-select.js.map +1 -1
  620. package/dist/theme/recipes/switch-card.cjs +2 -2
  621. package/dist/theme/recipes/switch-card.cjs.map +1 -1
  622. package/dist/theme/recipes/switch-card.js +43 -42
  623. package/dist/theme/recipes/switch-card.js.map +1 -1
  624. package/dist/theme/recipes/switch.cjs +2 -2
  625. package/dist/theme/recipes/switch.cjs.map +1 -1
  626. package/dist/theme/recipes/switch.d.ts +1 -1
  627. package/dist/theme/recipes/switch.js +71 -86
  628. package/dist/theme/recipes/switch.js.map +1 -1
  629. package/dist/theme/recipes/table-container.cjs +2 -2
  630. package/dist/theme/recipes/table-container.cjs.map +1 -1
  631. package/dist/theme/recipes/table-container.d.ts +1 -1
  632. package/dist/theme/recipes/table-container.js +19 -18
  633. package/dist/theme/recipes/table-container.js.map +1 -1
  634. package/dist/theme/recipes/table-empty-row.cjs +2 -2
  635. package/dist/theme/recipes/table-empty-row.cjs.map +1 -1
  636. package/dist/theme/recipes/table-empty-row.d.ts +1 -1
  637. package/dist/theme/recipes/table-empty-row.js +17 -16
  638. package/dist/theme/recipes/table-empty-row.js.map +1 -1
  639. package/dist/theme/recipes/table-group-title.cjs +2 -2
  640. package/dist/theme/recipes/table-group-title.cjs.map +1 -1
  641. package/dist/theme/recipes/table-group-title.d.ts +1 -1
  642. package/dist/theme/recipes/table-group-title.js +26 -33
  643. package/dist/theme/recipes/table-group-title.js.map +1 -1
  644. package/dist/theme/recipes/table.cjs +2 -2
  645. package/dist/theme/recipes/table.cjs.map +1 -1
  646. package/dist/theme/recipes/table.d.ts +1 -1
  647. package/dist/theme/recipes/table.js +111 -109
  648. package/dist/theme/recipes/table.js.map +1 -1
  649. package/dist/theme/recipes/tabs-chip.cjs +2 -2
  650. package/dist/theme/recipes/tabs-chip.cjs.map +1 -1
  651. package/dist/theme/recipes/tabs-chip.d.ts +1 -1
  652. package/dist/theme/recipes/tabs-chip.js +43 -46
  653. package/dist/theme/recipes/tabs-chip.js.map +1 -1
  654. package/dist/theme/recipes/tabs.cjs +2 -2
  655. package/dist/theme/recipes/tabs.cjs.map +1 -1
  656. package/dist/theme/recipes/tabs.d.ts +1 -1
  657. package/dist/theme/recipes/tabs.js +92 -125
  658. package/dist/theme/recipes/tabs.js.map +1 -1
  659. package/dist/theme/recipes/tag.cjs +2 -2
  660. package/dist/theme/recipes/tag.cjs.map +1 -1
  661. package/dist/theme/recipes/tag.d.ts +1 -1
  662. package/dist/theme/recipes/tag.js +110 -121
  663. package/dist/theme/recipes/tag.js.map +1 -1
  664. package/dist/theme/recipes/text.cjs +2 -2
  665. package/dist/theme/recipes/text.cjs.map +1 -1
  666. package/dist/theme/recipes/text.d.ts +1 -1
  667. package/dist/theme/recipes/text.js +25 -38
  668. package/dist/theme/recipes/text.js.map +1 -1
  669. package/dist/theme/recipes/textarea.cjs +2 -2
  670. package/dist/theme/recipes/textarea.cjs.map +1 -1
  671. package/dist/theme/recipes/textarea.d.ts +1 -1
  672. package/dist/theme/recipes/textarea.js +15 -14
  673. package/dist/theme/recipes/textarea.js.map +1 -1
  674. package/dist/theme/recipes/tooltip.cjs +2 -2
  675. package/dist/theme/recipes/tooltip.cjs.map +1 -1
  676. package/dist/theme/recipes/tooltip.d.ts +1 -1
  677. package/dist/theme/recipes/tooltip.js +47 -62
  678. package/dist/theme/recipes/tooltip.js.map +1 -1
  679. package/dist/theme/semantic-tokens/colors.cjs +2 -2
  680. package/dist/theme/semantic-tokens/colors.cjs.map +1 -1
  681. package/dist/theme/semantic-tokens/colors.js +189 -140
  682. package/dist/theme/semantic-tokens/colors.js.map +1 -1
  683. package/dist/theme/semantic-tokens/index.cjs +2 -2
  684. package/dist/theme/semantic-tokens/index.cjs.map +1 -1
  685. package/dist/theme/semantic-tokens/index.js +7 -8
  686. package/dist/theme/semantic-tokens/index.js.map +1 -1
  687. package/dist/theme/text-styles.cjs +2 -2
  688. package/dist/theme/text-styles.cjs.map +1 -1
  689. package/dist/theme/text-styles.d.ts +1 -1
  690. package/dist/theme/text-styles.js +70 -87
  691. package/dist/theme/text-styles.js.map +1 -1
  692. package/dist/theme/tokens/animations.cjs +2 -2
  693. package/dist/theme/tokens/animations.cjs.map +1 -1
  694. package/dist/theme/tokens/animations.js +22 -45
  695. package/dist/theme/tokens/animations.js.map +1 -1
  696. package/dist/theme/tokens/aspect-ratios.cjs +2 -2
  697. package/dist/theme/tokens/aspect-ratios.cjs.map +1 -1
  698. package/dist/theme/tokens/aspect-ratios.js +12 -11
  699. package/dist/theme/tokens/aspect-ratios.js.map +1 -1
  700. package/dist/theme/tokens/blurs.cjs +2 -2
  701. package/dist/theme/tokens/blurs.cjs.map +1 -1
  702. package/dist/theme/tokens/blurs.js +13 -12
  703. package/dist/theme/tokens/blurs.js.map +1 -1
  704. package/dist/theme/tokens/borders.cjs +2 -2
  705. package/dist/theme/tokens/borders.cjs.map +1 -1
  706. package/dist/theme/tokens/borders.js +6 -9
  707. package/dist/theme/tokens/borders.js.map +1 -1
  708. package/dist/theme/tokens/colors.cjs +2 -2
  709. package/dist/theme/tokens/colors.cjs.map +1 -1
  710. package/dist/theme/tokens/colors.js +78 -77
  711. package/dist/theme/tokens/colors.js.map +1 -1
  712. package/dist/theme/tokens/durations.cjs +2 -2
  713. package/dist/theme/tokens/durations.cjs.map +1 -1
  714. package/dist/theme/tokens/durations.js +14 -13
  715. package/dist/theme/tokens/durations.js.map +1 -1
  716. package/dist/theme/tokens/easings.cjs +3 -3
  717. package/dist/theme/tokens/easings.cjs.map +1 -1
  718. package/dist/theme/tokens/easings.js +24 -92
  719. package/dist/theme/tokens/easings.js.map +1 -1
  720. package/dist/theme/tokens/index.cjs +2 -2
  721. package/dist/theme/tokens/index.cjs.map +1 -1
  722. package/dist/theme/tokens/index.js +36 -35
  723. package/dist/theme/tokens/index.js.map +1 -1
  724. package/dist/theme/tokens/radii.cjs +2 -2
  725. package/dist/theme/tokens/radii.cjs.map +1 -1
  726. package/dist/theme/tokens/radii.js +28 -27
  727. package/dist/theme/tokens/radii.js.map +1 -1
  728. package/dist/theme/tokens/shadows.cjs +2 -2
  729. package/dist/theme/tokens/shadows.cjs.map +1 -1
  730. package/dist/theme/tokens/shadows.js +14 -13
  731. package/dist/theme/tokens/shadows.js.map +1 -1
  732. package/dist/theme/tokens/sizes.cjs +2 -2
  733. package/dist/theme/tokens/sizes.cjs.map +1 -1
  734. package/dist/theme/tokens/sizes.js +35 -84
  735. package/dist/theme/tokens/sizes.js.map +1 -1
  736. package/dist/theme/tokens/spacing.cjs +2 -2
  737. package/dist/theme/tokens/spacing.cjs.map +1 -1
  738. package/dist/theme/tokens/spacing.js +32 -83
  739. package/dist/theme/tokens/spacing.js.map +1 -1
  740. package/dist/theme/tokens/typography.cjs +2 -2
  741. package/dist/theme/tokens/typography.cjs.map +1 -1
  742. package/dist/theme/tokens/typography.js +82 -85
  743. package/dist/theme/tokens/typography.js.map +1 -1
  744. package/dist/theme/tokens/z-index.cjs +2 -2
  745. package/dist/theme/tokens/z-index.cjs.map +1 -1
  746. package/dist/theme/tokens/z-index.js +18 -41
  747. package/dist/theme/tokens/z-index.js.map +1 -1
  748. package/dist/theme/utilities.cjs +2 -2
  749. package/dist/theme/utilities.cjs.map +1 -1
  750. package/dist/theme/utilities.js +15 -16
  751. package/dist/theme/utilities.js.map +1 -1
  752. package/dist/ui.css +2 -1
  753. package/dist/utils/slots.cjs +2 -2
  754. package/dist/utils/slots.cjs.map +1 -1
  755. package/dist/utils/slots.js +42 -40
  756. package/dist/utils/slots.js.map +1 -1
  757. package/package.json +11 -7
  758. package/dist/_virtual/_commonjsHelpers.cjs +0 -2
  759. package/dist/_virtual/_commonjsHelpers.cjs.map +0 -1
  760. package/dist/_virtual/_commonjsHelpers.js +0 -10
  761. package/dist/_virtual/_commonjsHelpers.js.map +0 -1
  762. package/dist/_virtual/cjs.cjs +0 -2
  763. package/dist/_virtual/cjs.cjs.map +0 -1
  764. package/dist/_virtual/cjs.js +0 -9
  765. package/dist/_virtual/cjs.js.map +0 -1
  766. package/dist/_virtual/lodash.cjs +0 -2
  767. package/dist/_virtual/lodash.cjs.map +0 -1
  768. package/dist/_virtual/lodash.js +0 -7
  769. package/dist/_virtual/lodash.js.map +0 -1
  770. package/dist/_virtual/lodash2.cjs +0 -2
  771. package/dist/_virtual/lodash2.cjs.map +0 -1
  772. package/dist/_virtual/lodash2.js +0 -6
  773. package/dist/_virtual/lodash2.js.map +0 -1
  774. package/dist/index.cjs.map +0 -1
  775. package/dist/index.js.map +0 -1
  776. package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +0 -2
  777. package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +0 -1
  778. package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js +0 -30
  779. package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js.map +0 -1
  780. package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +0 -2
  781. package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +0 -1
  782. package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js +0 -30
  783. package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js.map +0 -1
  784. package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs +0 -2
  785. package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs.map +0 -1
  786. package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js +0 -30
  787. package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +0 -1
  788. package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +0 -2
  789. package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs.map +0 -1
  790. package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js +0 -30
  791. package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js.map +0 -1
  792. package/dist/node_modules/@pandacss/shared/dist/index.cjs +0 -2
  793. package/dist/node_modules/@pandacss/shared/dist/index.cjs.map +0 -1
  794. package/dist/node_modules/@pandacss/shared/dist/index.js +0 -469
  795. package/dist/node_modules/@pandacss/shared/dist/index.js.map +0 -1
  796. package/dist/node_modules/@zag-js/utils/dist/functions.cjs +0 -2
  797. package/dist/node_modules/@zag-js/utils/dist/functions.cjs.map +0 -1
  798. package/dist/node_modules/@zag-js/utils/dist/functions.js +0 -6
  799. package/dist/node_modules/@zag-js/utils/dist/functions.js.map +0 -1
  800. package/dist/node_modules/deepmerge/dist/cjs.cjs +0 -2
  801. package/dist/node_modules/deepmerge/dist/cjs.cjs.map +0 -1
  802. package/dist/node_modules/deepmerge/dist/cjs.js +0 -81
  803. package/dist/node_modules/deepmerge/dist/cjs.js.map +0 -1
  804. package/dist/node_modules/lodash/lodash.cjs +0 -21
  805. package/dist/node_modules/lodash/lodash.cjs.map +0 -1
  806. package/dist/node_modules/lodash/lodash.js +0 -3686
  807. package/dist/node_modules/lodash/lodash.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.cjs","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 { 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 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 onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n ...props\n}: ComboboxProps<T>) => {\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 const allItems = [...items, ...(initialItems ?? [])]\n\n const handleInputChange = useCallback(\n async (details: ArkCombobox.InputValueChangeDetails) => {\n if (initialItems && initialItems.length > 0 && !initialItems.find(item => item.label === details.inputValue)) {\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 => 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 useEffect(() => {\n if (!withAutoFilter && !debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, withAutoFilter, 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 Chargement...\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Aucun résultat\n </Text>\n )\n // TODO: const multiple = props.multiple\n // TODO: multiple design, using input chips https://ark-ui.com/reat/examples/combobox-with-tags-input\n const multiple = false\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 // TODO: multiple design\n multiple={multiple}\n >\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={e => {\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 <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"],"names":["withProvider","withContext","createStyleContext","combobox","Root","styled","ArkCombobox","ClearTrigger","Content","Input","Control","Item","ItemText","Positioner","Trigger","MultipleUncheckedIndicator","jsxs","jsx","css","MultipleCheckedIndicator","CustomInnerItem","item","isMultiple","renderItem","context","useComboboxItemContext","Fragment","Combobox","itemsFromUsers","initialItems","debounceMs","placeholder","emptyLabel","loadingLabel","usePortal","withAutoFilter","positioning","loadItems","onResetInitialItems","controlledIsLoading","value","openDropdownOnFocus","clearValueWhenEmpty","virtualized","rowHeight","returnItemsOnEmpty","props","items","setItems","useState","isLoading","setIsLoading","firstQueryTriggered","setFirstQueryTriggered","asyncMode","debouncedLoadItems","useMemo","debounce","newItems","error","allItems","handleInputChange","useCallback","details","inputValue","useEffect","collection","createListCollection","effectiveIsLoading","loadingContent","Text","emptyContent","multiple","api","e","UIInput","ConditionalWrapper","children","Portal","Fix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KAEhB,CAAA,EANKA,EAAK,KAAA,CAQb,CAAA,CAEL,CAAA,CACF,CAAA,CACF,CAAA,CAAA,CAAA,CAGN"}
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 { 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 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 onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n ...props\n}: ComboboxProps<T>) => {\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 const allItems = [...items, ...(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 useEffect(() => {\n if (!withAutoFilter && !debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, withAutoFilter, 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 Chargement...\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Aucun résultat\n </Text>\n )\n // TODO: const multiple = props.multiple\n // TODO: multiple design, using input chips https://ark-ui.com/reat/examples/combobox-with-tags-input\n const multiple = false\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 // TODO: multiple design\n multiple={multiple}\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 <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":"ocAsBA,GAAM,CAAE,eAAc,eAAgB,EAAA,mBAAmB,EAAA,QAAQ,EAG3D,EAAO,GAAA,EAAA,EAAA,QAAoB,EAAA,SAAY,IAAS,EAAG,OAAQ,CAC/D,aAAc,CACZ,UAAW,EACb,CACF,CAAC,EAEK,EAAe,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,YAAY,EAAG,cAAc,EAC3E,EAAU,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,OAAO,EAAG,SAAS,EAC5D,EAAQ,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,KAAK,EAAG,OAAO,EACtD,EAAU,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,OAAO,EAAG,SAAS,EAC5D,EAAO,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,IAAI,EAAG,MAAM,EACnD,EAAW,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,QAAQ,EAAG,UAAU,EAC/D,EAAa,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,UAAU,EAAG,YAAY,EACrE,EAAU,GAAA,EAAA,EAAA,QAAmB,EAAA,SAAY,OAAO,EAAG,SAAS,EA+B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,EAAA,KAAC,EAAD,CAA6B,iBAC3B,EAAA,EAAA,KAAC,EAAD,CAA6B,aAAkB,OAAM,WAAY,EAAW,CAAA,CACxE,EAFK,EAAK,KAEV,CACY,EAPb,EAAK,KAOQ,CACrB,CAEI,CAAA,CACC,CAAA,CACM,CAAA,CAChB,GAEV"}
@@ -1,176 +1,209 @@
1
1
  "use client";
2
- import { jsxs as p, jsx as e, Fragment as L } from "react/jsx-runtime";
3
- import { createListCollection as U, Combobox as r, Portal as e1, useComboboxItemContext as t1 } from "@ark-ui/react";
4
- import { useState as x, useMemo as P, useCallback as o1, useEffect as n1 } from "react";
5
- import { styled as i } from "@stokelp/styled-system/jsx";
6
- import { l as l1 } from "../../_virtual/lodash.js";
7
- import { combobox as r1 } from "@stokelp/styled-system/recipes";
8
- import { createStyleContext as i1 } from "../../utils/slots.js";
9
- import { ConditionalWrapper as v } from "../../shared/ConditionalWrapper.js";
10
- import { Text as Z } from "../text/Text.js";
11
- import { Tooltip as B } from "../tooltip/Tooltip.js";
12
- import { FixedSizeList as c1 } from "react-window";
13
- import { css as z } from "@stokelp/styled-system/css";
14
- import { Input as s1 } from "../input/Input.js";
15
- const { withProvider: h1, withContext: h } = i1(r1), u1 = h1(i(r.Root), "root", {
16
- defaultProps: {
17
- loopFocus: !0
18
- }
19
- }), a1 = h(i(r.ClearTrigger), "clearTrigger"), d1 = h(i(r.Content), "content"), p1 = h(i(r.Input), "input"), C1 = h(i(r.Control), "control"), S = h(i(r.Item), "item"), g1 = h(i(r.ItemText), "itemText"), f1 = h(i(r.Positioner), "positioner"), m1 = h(i(r.Trigger), "trigger"), w1 = () => /* @__PURE__ */ p("svg", { width: "16", height: "17", viewBox: "0 0 16 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
20
- /* @__PURE__ */ e("rect", { x: "0.5", y: "1", width: "15", height: "15", rx: "3.5", fill: "white" }),
21
- /* @__PURE__ */ e("rect", { x: "0.5", y: "1", width: "15", height: "15", rx: "3.5", className: z({ stroke: "grey.100" }) })
22
- ] }), x1 = () => /* @__PURE__ */ p("svg", { width: "16", height: "17", viewBox: "0 0 16 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
23
- /* @__PURE__ */ e("rect", { y: "0.5", width: "16", height: "16", rx: "4", className: z({ fill: "primary.500" }) }),
24
- /* @__PURE__ */ e(
25
- "path",
26
- {
27
- fillRule: "evenodd",
28
- clipRule: "evenodd",
29
- 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",
30
- fill: "white"
31
- }
32
- )
33
- ] });
34
- function V({ item: l, isMultiple: c, renderItem: u }) {
35
- const f = t1();
36
- return /* @__PURE__ */ p(L, { children: [
37
- c ? f.selected ? /* @__PURE__ */ e(x1, {}) : /* @__PURE__ */ e(w1, {}) : null,
38
- u ? u(l) : /* @__PURE__ */ e(g1, { truncate: !0, children: l.label })
39
- ] });
2
+ import { createStyleContext as e } from "../../utils/slots.js";
3
+ import { Tooltip as t } from "../tooltip/Tooltip.js";
4
+ import { Text as n } from "../text/Text.js";
5
+ import { ConditionalWrapper as r } from "../../shared/ConditionalWrapper.js";
6
+ import { Input as ee } from "../input/Input.js";
7
+ import { Combobox as i, Portal as a, createListCollection as o, useComboboxItemContext as s } from "@ark-ui/react";
8
+ import { styled as c } from "@stokelp/styled-system/jsx";
9
+ import { combobox as l } from "@stokelp/styled-system/recipes";
10
+ import { useCallback as u, useEffect as d, useMemo as f, useState as p } from "react";
11
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
12
+ import { css as _ } from "@stokelp/styled-system/css";
13
+ import { FixedSizeList as v } from "react-window";
14
+ import { debounce as y } from "lodash";
15
+ //#region src/components/combobox/Combobox.tsx
16
+ var { withProvider: b, withContext: x } = e(l), S = b(c(i.Root), "root", { defaultProps: { loopFocus: !0 } }), te = x(c(i.ClearTrigger), "clearTrigger"), C = x(c(i.Content), "content"), w = x(c(i.Input), "input"), T = x(c(i.Control), "control"), E = x(c(i.Item), "item"), D = x(c(i.ItemText), "itemText"), O = x(c(i.Positioner), "positioner"), k = x(c(i.Trigger), "trigger"), A = () => /* @__PURE__ */ g("svg", {
17
+ width: "16",
18
+ height: "17",
19
+ viewBox: "0 0 16 17",
20
+ fill: "none",
21
+ xmlns: "http://www.w3.org/2000/svg",
22
+ children: [/* @__PURE__ */ h("rect", {
23
+ x: "0.5",
24
+ y: "1",
25
+ width: "15",
26
+ height: "15",
27
+ rx: "3.5",
28
+ fill: "white"
29
+ }), /* @__PURE__ */ h("rect", {
30
+ x: "0.5",
31
+ y: "1",
32
+ width: "15",
33
+ height: "15",
34
+ rx: "3.5",
35
+ className: _({ stroke: "grey.100" })
36
+ })]
37
+ }), j = () => /* @__PURE__ */ g("svg", {
38
+ width: "16",
39
+ height: "17",
40
+ viewBox: "0 0 16 17",
41
+ fill: "none",
42
+ xmlns: "http://www.w3.org/2000/svg",
43
+ children: [/* @__PURE__ */ h("rect", {
44
+ y: "0.5",
45
+ width: "16",
46
+ height: "16",
47
+ rx: "4",
48
+ className: _({ fill: "primary.500" })
49
+ }), /* @__PURE__ */ h("path", {
50
+ fillRule: "evenodd",
51
+ clipRule: "evenodd",
52
+ 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",
53
+ fill: "white"
54
+ })]
55
+ });
56
+ function M({ item: e, isMultiple: t, renderItem: n }) {
57
+ let r = s();
58
+ return /* @__PURE__ */ g(m, { children: [t ? r.selected ? /* @__PURE__ */ h(j, {}) : /* @__PURE__ */ h(A, {}) : null, n ? n(e) : /* @__PURE__ */ h(D, {
59
+ truncate: !0,
60
+ children: e.label
61
+ })] });
40
62
  }
41
- const V1 = ({
42
- items: l = [],
43
- initialItems: c,
44
- debounceMs: u = 0,
45
- placeholder: f,
46
- emptyLabel: E,
47
- loadingLabel: O,
48
- usePortal: j = !0,
49
- withAutoFilter: C = !0,
50
- positioning: N,
51
- loadItems: g,
52
- renderItem: b,
53
- onResetInitialItems: y,
54
- isLoading: Q,
55
- value: W,
56
- openDropdownOnFocus: $ = !0,
57
- clearValueWhenEmpty: q = !0,
58
- virtualized: A,
59
- rowHeight: T = 34,
60
- returnItemsOnEmpty: D,
61
- ...M
62
- }) => {
63
- const [G, a] = x(() => l), [J, I] = x(!1), [K, X] = x(!1), m = typeof g == "function", d = P(
64
- () => g ? l1.debounce(async (t) => {
65
- try {
66
- X(!0), I(!0);
67
- const o = await g(t);
68
- a(o);
69
- } catch (o) {
70
- console.error(o), a([]);
71
- } finally {
72
- I(!1);
73
- }
74
- }, u) : null,
75
- [g, u]
76
- ), n = [...G, ...c ?? []], Y = o1(
77
- async (t) => {
78
- c && c.length > 0 && !c.find((s) => s.label === t.inputValue) && y?.();
79
- const { inputValue: o } = t;
80
- if (d)
81
- d(o);
82
- else {
83
- const s = C && o !== "" ? l.filter((F) => F.label.toLowerCase().includes(o.toLowerCase())) : l;
84
- if (s.length === 0 && D)
85
- return a(l);
86
- a(s);
87
- }
88
- },
89
- [d, l, C]
90
- );
91
- n1(() => {
92
- !C && !d && a(l);
93
- }, [l, C, d]);
94
- const _ = P(() => U({ items: n }), [n]), H = Q ?? J, R = O ?? /* @__PURE__ */ e(Z, { p: "space-8", textAlign: "center", children: "Chargement..." }), k = E ?? /* @__PURE__ */ e(Z, { p: "space-8", textAlign: "center", children: "Aucun résultat" }), w = !1;
95
- return /* @__PURE__ */ p(
96
- u1,
97
- {
98
- lazyMount: !0,
99
- unmountOnExit: !0,
100
- collection: _,
101
- positioning: { sameWidth: !0, gutter: 0, ...N },
102
- "data-recipe": "combobox",
103
- onInputValueChange: Y,
104
- value: W,
105
- ...M,
106
- multiple: w,
107
- children: [
108
- /* @__PURE__ */ p(C1, { children: [
109
- /* @__PURE__ */ e(r.Context, { children: (t) => /* @__PURE__ */ e(
110
- p1,
111
- {
112
- asChild: !0,
113
- placeholder: f,
114
- onInput: (o) => {
115
- const s = o.currentTarget.value;
116
- q && s === "" && t.clearValue();
117
- },
118
- onFocus: () => {
119
- !$ || m || t.setOpen(!0);
120
- },
121
- children: /* @__PURE__ */ e(s1, {})
122
- }
123
- ) }),
124
- /* @__PURE__ */ e(m1, { asChild: !0, hidden: m && (!c || c.length === 0), children: /* @__PURE__ */ e("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
125
- "path",
126
- {
127
- fillRule: "evenodd",
128
- clipRule: "evenodd",
129
- 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",
130
- fill: "currentColor"
131
- }
132
- ) }) }),
133
- /* @__PURE__ */ e(a1, { disabled: M.readOnly, onClick: y, asChild: !0, children: /* @__PURE__ */ e("button", { children: /* @__PURE__ */ e("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
134
- "path",
135
- {
136
- fillRule: "evenodd",
137
- clipRule: "evenodd",
138
- 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",
139
- fill: "currentColor"
140
- }
141
- ) }) }) })
142
- ] }),
143
- /* @__PURE__ */ e(v, { when: j, wrapper: (t) => /* @__PURE__ */ e(e1, { children: t }), children: /* @__PURE__ */ e(f1, { children: /* @__PURE__ */ e(d1, { children: H ? R : n.length === 0 ? /* @__PURE__ */ e(L, { children: m ? K ? k : R : k }) : A ? /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
144
- c1,
145
- {
146
- height: Math.min(T * n.length, 180),
147
- itemCount: n.length,
148
- itemSize: T,
149
- width: "100%",
150
- children: ({ index: t, style: o }) => /* @__PURE__ */ e(
151
- v,
152
- {
153
- when: !!n[t].tooltip,
154
- wrapper: (s) => /* @__PURE__ */ e(B, { label: n[t].tooltip, children: s }),
155
- children: /* @__PURE__ */ e(S, { item: n[t], style: o, children: /* @__PURE__ */ e(V, { renderItem: b, item: n[t], isMultiple: w }) }, n[t].value)
156
- },
157
- n[t].value
158
- )
159
- }
160
- ) }) : n.map((t) => /* @__PURE__ */ e(
161
- v,
162
- {
163
- when: !!t.tooltip,
164
- wrapper: (o) => /* @__PURE__ */ e(B, { label: t.tooltip, children: o }),
165
- children: /* @__PURE__ */ e(S, { item: t, children: /* @__PURE__ */ e(V, { renderItem: b, item: t, isMultiple: w }) }, t.value)
166
- },
167
- t.value
168
- )) }) }) })
169
- ]
170
- }
171
- );
63
+ var N = ({ items: e = [], initialItems: s, debounceMs: c = 0, placeholder: l, emptyLabel: _, loadingLabel: b, usePortal: x = !0, withAutoFilter: D = !0, positioning: A, loadItems: j, renderItem: N, onResetInitialItems: P, isLoading: F, value: I, openDropdownOnFocus: L = !0, clearValueWhenEmpty: R = !0, virtualized: z, rowHeight: B = 34, returnItemsOnEmpty: V, ...H }) => {
64
+ let [U, W] = p(() => e), [G, K] = p(!1), [q, J] = p(!1), Y = typeof j == "function", X = f(() => j ? y(async (e) => {
65
+ try {
66
+ J(!0), K(!0), W(await j(e));
67
+ } catch (e) {
68
+ console.error(e), W([]);
69
+ } finally {
70
+ K(!1);
71
+ }
72
+ }, c) : null, [j, c]), Z = [...U, ...s ?? []], ne = u(async (t) => {
73
+ s && s.length > 0 && !s.find((e) => e.label === t.inputValue) && P?.();
74
+ let { inputValue: n } = t;
75
+ if (X) X(n);
76
+ else {
77
+ let t = D && n !== "" ? e.filter((e) => e.label.toLowerCase().includes(n.toLowerCase())) : e;
78
+ if (t.length === 0 && V) return W(e);
79
+ W(t);
80
+ }
81
+ }, [
82
+ X,
83
+ e,
84
+ D
85
+ ]);
86
+ d(() => {
87
+ !D && !X && W(e);
88
+ }, [
89
+ e,
90
+ D,
91
+ X
92
+ ]);
93
+ let re = f(() => o({ items: Z }), [Z]), ie = F ?? G, Q = b ?? /* @__PURE__ */ h(n, {
94
+ p: "space-8",
95
+ textAlign: "center",
96
+ children: "Chargement..."
97
+ }), $ = _ ?? /* @__PURE__ */ h(n, {
98
+ p: "space-8",
99
+ textAlign: "center",
100
+ children: "Aucun résultat"
101
+ });
102
+ return /* @__PURE__ */ g(S, {
103
+ lazyMount: !0,
104
+ unmountOnExit: !0,
105
+ collection: re,
106
+ positioning: {
107
+ sameWidth: !0,
108
+ gutter: 0,
109
+ ...A
110
+ },
111
+ "data-recipe": "combobox",
112
+ onInputValueChange: ne,
113
+ value: I,
114
+ ...H,
115
+ multiple: !1,
116
+ children: [/* @__PURE__ */ g(T, { children: [
117
+ /* @__PURE__ */ h(i.Context, { children: (e) => /* @__PURE__ */ h(w, {
118
+ asChild: !0,
119
+ placeholder: l,
120
+ onInput: (t) => {
121
+ let n = t.currentTarget.value;
122
+ R && n === "" && e.clearValue();
123
+ },
124
+ onFocus: () => {
125
+ !L || Y || e.setOpen(!0);
126
+ },
127
+ children: /* @__PURE__ */ h(ee, {})
128
+ }) }),
129
+ /* @__PURE__ */ h(k, {
130
+ asChild: !0,
131
+ hidden: Y && (!s || s.length === 0),
132
+ children: /* @__PURE__ */ h("svg", {
133
+ width: "24",
134
+ height: "24",
135
+ viewBox: "0 0 24 24",
136
+ fill: "none",
137
+ xmlns: "http://www.w3.org/2000/svg",
138
+ children: /* @__PURE__ */ h("path", {
139
+ fillRule: "evenodd",
140
+ clipRule: "evenodd",
141
+ 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",
142
+ fill: "currentColor"
143
+ })
144
+ })
145
+ }),
146
+ /* @__PURE__ */ h(te, {
147
+ disabled: H.readOnly,
148
+ onClick: P,
149
+ asChild: !0,
150
+ children: /* @__PURE__ */ h("button", { children: /* @__PURE__ */ h("svg", {
151
+ width: "20",
152
+ height: "20",
153
+ viewBox: "0 0 20 20",
154
+ fill: "none",
155
+ xmlns: "http://www.w3.org/2000/svg",
156
+ children: /* @__PURE__ */ h("path", {
157
+ fillRule: "evenodd",
158
+ clipRule: "evenodd",
159
+ 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",
160
+ fill: "currentColor"
161
+ })
162
+ }) })
163
+ })
164
+ ] }), /* @__PURE__ */ h(r, {
165
+ when: x,
166
+ wrapper: (e) => /* @__PURE__ */ h(a, { children: e }),
167
+ children: /* @__PURE__ */ h(O, { children: /* @__PURE__ */ h(C, { children: ie ? Q : Z.length === 0 ? /* @__PURE__ */ h(m, { children: Y ? q ? $ : Q : $ }) : z ? /* @__PURE__ */ h(m, { children: /* @__PURE__ */ h(v, {
168
+ height: Math.min(B * Z.length, 180),
169
+ itemCount: Z.length,
170
+ itemSize: B,
171
+ width: "100%",
172
+ children: ({ index: e, style: n }) => /* @__PURE__ */ h(r, {
173
+ when: !!Z[e].tooltip,
174
+ wrapper: (n) => /* @__PURE__ */ h(t, {
175
+ label: Z[e].tooltip,
176
+ children: n
177
+ }),
178
+ children: /* @__PURE__ */ h(E, {
179
+ item: Z[e],
180
+ style: n,
181
+ children: /* @__PURE__ */ h(M, {
182
+ renderItem: N,
183
+ item: Z[e],
184
+ isMultiple: !1
185
+ })
186
+ }, Z[e].value)
187
+ }, Z[e].value)
188
+ }) }) : Z.map((e) => /* @__PURE__ */ h(r, {
189
+ when: !!e.tooltip,
190
+ wrapper: (n) => /* @__PURE__ */ h(t, {
191
+ label: e.tooltip,
192
+ children: n
193
+ }),
194
+ children: /* @__PURE__ */ h(E, {
195
+ item: e,
196
+ children: /* @__PURE__ */ h(M, {
197
+ renderItem: N,
198
+ item: e,
199
+ isMultiple: !1
200
+ })
201
+ }, e.value)
202
+ }, e.value)) }) })
203
+ })]
204
+ });
172
205
  };
173
- export {
174
- V1 as Combobox
175
- };
176
- //# sourceMappingURL=Combobox.js.map
206
+ //#endregion
207
+ export { N as Combobox };
208
+
209
+ //# sourceMappingURL=Combobox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.js","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 { 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 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 onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n ...props\n}: ComboboxProps<T>) => {\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 const allItems = [...items, ...(initialItems ?? [])]\n\n const handleInputChange = useCallback(\n async (details: ArkCombobox.InputValueChangeDetails) => {\n if (initialItems && initialItems.length > 0 && !initialItems.find(item => item.label === details.inputValue)) {\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 => 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 useEffect(() => {\n if (!withAutoFilter && !debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, withAutoFilter, 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 Chargement...\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Aucun résultat\n </Text>\n )\n // TODO: const multiple = props.multiple\n // TODO: multiple design, using input chips https://ark-ui.com/reat/examples/combobox-with-tags-input\n const multiple = false\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 // TODO: multiple design\n multiple={multiple}\n >\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={e => {\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 <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"],"names":["withProvider","withContext","createStyleContext","combobox","Root","styled","ArkCombobox","ClearTrigger","Content","Input","Control","Item","ItemText","Positioner","Trigger","MultipleUncheckedIndicator","jsxs","jsx","css","MultipleCheckedIndicator","CustomInnerItem","item","isMultiple","renderItem","context","useComboboxItemContext","Fragment","Combobox","itemsFromUsers","initialItems","debounceMs","placeholder","emptyLabel","loadingLabel","usePortal","withAutoFilter","positioning","loadItems","onResetInitialItems","controlledIsLoading","value","openDropdownOnFocus","clearValueWhenEmpty","virtualized","rowHeight","returnItemsOnEmpty","props","items","setItems","useState","isLoading","setIsLoading","firstQueryTriggered","setFirstQueryTriggered","asyncMode","debouncedLoadItems","useMemo","debounce","newItems","error","allItems","handleInputChange","useCallback","details","inputValue","useEffect","collection","createListCollection","effectiveIsLoading","loadingContent","Text","emptyContent","multiple","api","e","UIInput","ConditionalWrapper","children","Portal","FixedSizeList","index","style","Tooltip"],"mappings":";;;;;;;;;;;;;;AAsBA,MAAM,EAAE,cAAAA,IAAc,aAAAC,MAAgBC,GAAmBC,EAAQ,GAG3DC,KAAOJ,GAAaK,EAAOC,EAAY,IAAS,GAAG,QAAQ;AAAA,EAC/D,cAAc;AAAA,IACZ,WAAW;AAAA,EAAA;AAEf,CAAC,GAEKC,KAAeN,EAAYI,EAAOC,EAAY,YAAY,GAAG,cAAc,GAC3EE,KAAUP,EAAYI,EAAOC,EAAY,OAAO,GAAG,SAAS,GAC5DG,KAAQR,EAAYI,EAAOC,EAAY,KAAK,GAAG,OAAO,GACtDI,KAAUT,EAAYI,EAAOC,EAAY,OAAO,GAAG,SAAS,GAC5DK,IAAOV,EAAYI,EAAOC,EAAY,IAAI,GAAG,MAAM,GACnDM,KAAWX,EAAYI,EAAOC,EAAY,QAAQ,GAAG,UAAU,GAC/DO,KAAaZ,EAAYI,EAAOC,EAAY,UAAU,GAAG,YAAY,GACrEQ,KAAUb,EAAYI,EAAOC,EAAY,OAAO,GAAG,SAAS,GA+B5DS,KAAiC,MACrC,gBAAAC,EAAC,OAAA,EAAI,OAAM,MAAK,QAAO,MAAK,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAChE,UAAA;AAAA,EAAA,gBAAAC,EAAC,QAAA,EAAK,GAAE,OAAM,GAAE,KAAI,OAAM,MAAK,QAAO,MAAK,IAAG,OAAM,MAAK,SAAQ;AAAA,oBAChE,QAAA,EAAK,GAAE,OAAM,GAAE,KAAI,OAAM,MAAK,QAAO,MAAK,IAAG,OAAM,WAAWC,EAAI,EAAE,QAAQ,WAAA,CAAY,EAAA,C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C,MAAM,CAAC,CAAChB,EAASoB,CAAK,EAAE;AAAA,gBACxB,SAAS,OAAY,gBAAA/D,EAACiE,GAAA,EAAQ,OAAOtB,EAASoB,CAAK,EAAE,SAAU,UAAAH,EAAA,CAAS;AAAA,gBAExE,UAAA,gBAAA5D,EAACN,KAAiC,MAAMiD,EAASoB,CAAK,GAAG,OAAAC,GACvD,4BAAC7D,GAAA,EAAgB,YAAAG,GAAwB,MAAMqC,EAASoB,CAAK,GAAG,YAAYR,EAAA,CAAU,KAD7EZ,EAASoB,CAAK,EAAE,KAE3B;AAAA,cAAA;AAAA,cANKpB,EAASoB,CAAK,EAAE;AAAA,YAAA;AAAA,UAOvB;AAAA,QAAA,EAEJ,CACF,IAEApB,EAAS,IAAI,CAAAvC,MACX,gBAAAJ;AAAA,UAAC2D;AAAA,UAAA;AAAA,YAEC,MAAM,CAAC,CAACvD,EAAK;AAAA,YACb,SAAS,CAAAwD,MAAY,gBAAA5D,EAACiE,KAAQ,OAAO7D,EAAK,SAAU,UAAAwD,GAAS;AAAA,YAE7D,UAAA,gBAAA5D,EAACN,GAAA,EAAsB,MAAAU,GACrB,UAAA,gBAAAJ,EAACG,GAAA,EAAgB,YAAAG,GAAwB,MAAAF,GAAY,YAAYmD,EAAA,CAAU,EAAA,GADlEnD,EAAK,KAEhB;AAAA,UAAA;AAAA,UANKA,EAAK;AAAA,QAAA,CAQb,EAAA,CAEL,EAAA,CACF,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
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 { 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 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 onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n ...props\n}: ComboboxProps<T>) => {\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 const allItems = [...items, ...(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 useEffect(() => {\n if (!withAutoFilter && !debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, withAutoFilter, 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 Chargement...\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n Aucun résultat\n </Text>\n )\n // TODO: const multiple = props.multiple\n // TODO: multiple design, using input chips https://ark-ui.com/reat/examples/combobox-with-tags-input\n const multiple = false\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 // TODO: multiple design\n multiple={multiple}\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 <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 render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