themelia-react-ui 1.0.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (542) hide show
  1. package/CHANGELOG.md +281 -1
  2. package/README.md +10 -5
  3. package/dist/{accordion-BRTcsp8J.js → accordion-CQXVcd7Q.js} +13 -13
  4. package/dist/accordion-CQXVcd7Q.js.map +1 -0
  5. package/dist/action-menu-BTpyPWJ2.js +264 -0
  6. package/dist/action-menu-BTpyPWJ2.js.map +1 -0
  7. package/dist/{affordance-geometry.generated-CL84ZN9A.js → affordance-geometry.generated-CCIXb2A1.js} +7 -2
  8. package/dist/affordance-geometry.generated-CCIXb2A1.js.map +1 -0
  9. package/dist/{ai-artifact-DLVdK0Py.js → ai-artifact-2PQ2fItc.js} +171 -176
  10. package/dist/ai-artifact-2PQ2fItc.js.map +1 -0
  11. package/dist/{app-shell-C_fKpljx.js → app-shell-BE_j8-AT.js} +4 -4
  12. package/dist/{app-shell-C_fKpljx.js.map → app-shell-BE_j8-AT.js.map} +1 -1
  13. package/dist/{attachment-DbjUWsP0.js → attachment-q69dlt5Y.js} +9 -9
  14. package/dist/{attachment-DbjUWsP0.js.map → attachment-q69dlt5Y.js.map} +1 -1
  15. package/dist/{auth-CAQcasMV.js → auth-M3vGMgDR.js} +42 -42
  16. package/dist/{auth-CAQcasMV.js.map → auth-M3vGMgDR.js.map} +1 -1
  17. package/dist/{avatar-Bu2HhitA.js → avatar-djdaaQ_s.js} +14 -12
  18. package/dist/avatar-djdaaQ_s.js.map +1 -0
  19. package/dist/{badge-CzId1Wlm.js → badge-0tATj-tW.js} +9 -9
  20. package/dist/badge-0tATj-tW.js.map +1 -0
  21. package/dist/base/accordion.js +1 -1
  22. package/dist/base/action-menu.js +1 -1
  23. package/dist/base/attachment.js +1 -1
  24. package/dist/base/avatar.js +1 -1
  25. package/dist/base/badge.js +1 -1
  26. package/dist/base/buttons.js +2 -2
  27. package/dist/base/cards.js +2 -2
  28. package/dist/base/carousel.js +11 -11
  29. package/dist/base/carousel.js.map +1 -1
  30. package/dist/base/cascader.js +244 -222
  31. package/dist/base/cascader.js.map +1 -1
  32. package/dist/base/chart.js +1 -1
  33. package/dist/base/choice-inputs.js +2 -2
  34. package/dist/base/code-block.js +1 -1
  35. package/dist/base/combobox.js +1 -1
  36. package/dist/base/command.js +1 -1
  37. package/dist/base/copyable.js +1 -1
  38. package/dist/base/date-pickers.js +2 -2
  39. package/dist/base/display.js +6 -6
  40. package/dist/base/feedback.js +3 -3
  41. package/dist/base/forms-numeric.js +1 -1
  42. package/dist/base/forms.js +2 -2
  43. package/dist/base/inline-edit.js +81 -76
  44. package/dist/base/inline-edit.js.map +1 -1
  45. package/dist/base/item.js +1 -1
  46. package/dist/base/media-gallery.js +1 -1
  47. package/dist/base/navigation.js +6 -6
  48. package/dist/base/popover-menu.js +1 -1
  49. package/dist/base/popover.js +1 -1
  50. package/dist/base/qr-code.js +7 -4
  51. package/dist/base/qr-code.js.map +1 -1
  52. package/dist/base/repeaters.js +42 -42
  53. package/dist/base/repeaters.js.map +1 -1
  54. package/dist/base/sheet.js +1 -1
  55. package/dist/base/sidebar.js +1 -1
  56. package/dist/base/signature-pad.js +9 -9
  57. package/dist/base/signature-pad.js.map +1 -1
  58. package/dist/base/skeleton.js +1 -1
  59. package/dist/base/spinner.js +1 -1
  60. package/dist/base/structure.js +1 -1
  61. package/dist/base/table.js +1 -1
  62. package/dist/base/text-inputs.js +2 -2
  63. package/dist/base/toaster.js +4 -4
  64. package/dist/base/toaster.js.map +1 -1
  65. package/dist/base/tree.js +1 -1
  66. package/dist/base/upload-queue.js +1 -1
  67. package/dist/base/upload.js +3 -3
  68. package/dist/base/value-inputs.js +1 -1
  69. package/dist/blocks/admin.js +229 -220
  70. package/dist/blocks/admin.js.map +1 -1
  71. package/dist/blocks/ai.js +147 -180
  72. package/dist/blocks/ai.js.map +1 -1
  73. package/dist/blocks/analytics/usage-card.js +1 -1
  74. package/dist/blocks/analytics.js +530 -523
  75. package/dist/blocks/analytics.js.map +1 -1
  76. package/dist/blocks/collaboration.js +1 -1
  77. package/dist/blocks/commerce/receipt.js +1 -1
  78. package/dist/blocks/commerce.js +1390 -1516
  79. package/dist/blocks/commerce.js.map +1 -1
  80. package/dist/blocks/data-display.js +1 -1
  81. package/dist/blocks/onboarding.js +5 -5
  82. package/dist/blocks/planning.js +82 -91
  83. package/dist/blocks/planning.js.map +1 -1
  84. package/dist/blocks/timelines.js +1 -1
  85. package/dist/{breadcrumbs-BuYz5SDU.js → breadcrumbs-BG_FfMK4.js} +5 -5
  86. package/dist/{breadcrumbs-BuYz5SDU.js.map → breadcrumbs-BG_FfMK4.js.map} +1 -1
  87. package/dist/{button-BZDasD04.js → button-BS3KDg00.js} +185 -162
  88. package/dist/button-BS3KDg00.js.map +1 -0
  89. package/dist/{button-BZyfTvwm.js → button-R9CCoH7A.js} +2 -2
  90. package/dist/{button-BZyfTvwm.js.map → button-R9CCoH7A.js.map} +1 -1
  91. package/dist/{buttons-D_6KJvEE.js → buttons-DS0ZIwJ_.js} +11 -11
  92. package/dist/buttons-DS0ZIwJ_.js.map +1 -0
  93. package/dist/{cards-qGSErLw_.js → cards-QoJ4syG9.js} +7 -7
  94. package/dist/{cards-qGSErLw_.js.map → cards-QoJ4syG9.js.map} +1 -1
  95. package/dist/{chart-Bsc5BICK.js → chart-DwYRKKc-.js} +17 -15
  96. package/dist/chart-DwYRKKc-.js.map +1 -0
  97. package/dist/checkbox-B7ygNTYp.js +35 -0
  98. package/dist/checkbox-B7ygNTYp.js.map +1 -0
  99. package/dist/choice-inputs-DrJ17tpL.js +752 -0
  100. package/dist/choice-inputs-DrJ17tpL.js.map +1 -0
  101. package/dist/{code-block-DzHKRybS.js → code-block-CD0B7M93.js} +19 -19
  102. package/dist/{code-block-DzHKRybS.js.map → code-block-CD0B7M93.js.map} +1 -1
  103. package/dist/{collapsible-ClvC7Bj3.js → collapsible-oMUGM4tr.js} +3 -3
  104. package/dist/{collapsible-ClvC7Bj3.js.map → collapsible-oMUGM4tr.js.map} +1 -1
  105. package/dist/{collection-content-D6S8cv_n.js → collection-content-Ys-OZOkY.js} +3 -3
  106. package/dist/{collection-content-D6S8cv_n.js.map → collection-content-Ys-OZOkY.js.map} +1 -1
  107. package/dist/{combobox-BFnbJJp3.js → combobox-6dvVny2q.js} +96 -97
  108. package/dist/combobox-6dvVny2q.js.map +1 -0
  109. package/dist/{combobox-hozNwUcc.js → combobox-CB7039j7.js} +326 -308
  110. package/dist/combobox-CB7039j7.js.map +1 -0
  111. package/dist/{command-BnmSchli.js → command-kPMPjIxJ.js} +34 -30
  112. package/dist/command-kPMPjIxJ.js.map +1 -0
  113. package/dist/{comments-u5L0OGip.js → comments-You0Bzbr.js} +349 -348
  114. package/dist/comments-You0Bzbr.js.map +1 -0
  115. package/dist/components/base/accordion/accordion-variants.d.ts +3 -3
  116. package/dist/components/base/action-menu/action-menu.d.ts +7 -2
  117. package/dist/components/base/avatar/stacked-avatars.d.ts +5 -4
  118. package/dist/components/base/badge/badge.d.ts +1 -1
  119. package/dist/components/base/badge/badge.recipes.d.ts +4 -4
  120. package/dist/components/base/buttons/base-button.d.ts +7 -0
  121. package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
  122. package/dist/components/base/buttons/button.variants.d.ts +1 -0
  123. package/dist/components/base/buttons/loader-button.d.ts +3 -1
  124. package/dist/components/base/buttons/text-button.d.ts +2 -2
  125. package/dist/components/base/carousel/carousel.d.ts +3 -1
  126. package/dist/components/base/chart/chart.d.ts +7 -7
  127. package/dist/components/base/choice-inputs/checkbox.d.ts +6 -7
  128. package/dist/components/base/choice-inputs/choice-types.d.ts +10 -1
  129. package/dist/components/base/choice-inputs/pill-radio-group.d.ts +9 -0
  130. package/dist/components/base/choice-inputs/select-popup.d.ts +9 -1
  131. package/dist/components/base/choice-inputs/switch-card.d.ts +1 -1
  132. package/dist/components/base/date-pickers/date-picker-field.d.ts +23 -0
  133. package/dist/components/base/date-pickers/datepicker.types.d.ts +13 -3
  134. package/dist/components/base/display/alert-dialog.d.ts +8 -2
  135. package/dist/components/base/display/content-block.d.ts +4 -2
  136. package/dist/components/base/display/date-block.d.ts +1 -1
  137. package/dist/components/base/display/dialog.d.ts +12 -5
  138. package/dist/components/base/display/surface-title.d.ts +6 -1
  139. package/dist/components/base/feedback/alert.d.ts +1 -1
  140. package/dist/components/base/feedback/state-display.d.ts +5 -4
  141. package/dist/components/base/forms/form-sizing.d.ts +32 -0
  142. package/dist/components/base/forms/workflow.d.ts +2 -0
  143. package/dist/components/base/forms-numeric/coordinates-input.d.ts +3 -0
  144. package/dist/components/base/forms-numeric/rounding-mode-select.d.ts +4 -1
  145. package/dist/components/base/navigation/dropdown-menu.d.ts +2 -2
  146. package/dist/components/base/navigation/language-switcher.d.ts +4 -1
  147. package/dist/components/base/navigation/overflow-tab-bar.d.ts +7 -0
  148. package/dist/components/base/navigation/page-header/page-header.d.ts +4 -1
  149. package/dist/components/base/qr-code/qr-code.d.ts +2 -0
  150. package/dist/components/base/sheet/index.d.ts +29 -1
  151. package/dist/components/base/sheet/sheet.d.ts +14 -5
  152. package/dist/components/base/spinner/spinner.d.ts +3 -2
  153. package/dist/components/base/structure/structure.types.d.ts +1 -1
  154. package/dist/components/base/text-inputs/input-group.d.ts +2 -2
  155. package/dist/components/base/upload/upload.recipes.d.ts +11 -0
  156. package/dist/components/base/value-inputs/date-time-input.d.ts +4 -2
  157. package/dist/components/base/value-inputs/tags-input.d.ts +2 -0
  158. package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +1 -1
  159. package/dist/components/blocks/analytics/format-metric-value.d.ts +11 -1
  160. package/dist/components/blocks/analytics/index.d.ts +1 -1
  161. package/dist/components/blocks/analytics/use-metric-format-options.d.ts +3 -0
  162. package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
  163. package/dist/components/blocks/commerce/address-card/types.d.ts +3 -1
  164. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +4 -0
  165. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +2 -2
  166. package/dist/components/blocks/commerce/discount-stack/types.d.ts +1 -1
  167. package/dist/components/blocks/commerce/inventory-section/types.d.ts +4 -1
  168. package/dist/components/blocks/commerce/loyalty-points/types.d.ts +1 -1
  169. package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
  170. package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +1 -1
  171. package/dist/components/blocks/commerce/payment-method/types.d.ts +3 -1
  172. package/dist/components/blocks/commerce/seo-listing/seo-listing-card.d.ts +1 -1
  173. package/dist/components/blocks/commerce/seo-listing/types.d.ts +3 -1
  174. package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -1
  175. package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +4 -1
  176. package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +4 -1
  177. package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +1 -1
  178. package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
  179. package/dist/components/features/overlays/drawer.d.ts +1 -1
  180. package/dist/components/features/overlays/hooks/use-overlay-actions.d.ts +2 -2
  181. package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +11 -4
  182. package/dist/components/features/overlays/overlay-tone-icon.d.ts +37 -0
  183. package/dist/components/features/overlays/overlays.types.d.ts +42 -19
  184. package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
  185. package/dist/components/features/products/partials/index.d.ts +1 -1
  186. package/dist/components/features/products/partials/product-metric-tile.d.ts +6 -0
  187. package/dist/components/features/products/partials/product-tone.d.ts +11 -1
  188. package/dist/components/features/products/products.types.d.ts +2 -1
  189. package/dist/components/features/table/partials/cell-renderers.d.ts +1 -1
  190. package/dist/components/layout/page/index.d.ts +1 -1
  191. package/dist/components/layout/page/page.types.d.ts +53 -3
  192. package/dist/components/layout/page/partials/page-header-commands.d.ts +13 -0
  193. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  194. package/dist/components/primitives/date.d.ts +16 -3
  195. package/dist/components/primitives/dimensions.d.ts +6 -0
  196. package/dist/components/primitives/duration.d.ts +6 -0
  197. package/dist/components/primitives/file-size.d.ts +6 -0
  198. package/dist/components/primitives/index.d.ts +1 -1
  199. package/dist/components/primitives/initials.d.ts +11 -2
  200. package/dist/components/primitives/link.d.ts +7 -0
  201. package/dist/components/primitives/money.d.ts +29 -7
  202. package/dist/components/primitives/number.d.ts +17 -0
  203. package/dist/components/primitives/value-typography.d.ts +54 -0
  204. package/dist/components/primitives/value.d.ts +31 -6
  205. package/dist/components/typography/heading.d.ts +9 -1
  206. package/dist/components/typography/label.d.ts +3 -0
  207. package/dist/components/typography/running-text.d.ts +12 -0
  208. package/dist/components/typography/text-link.d.ts +23 -1
  209. package/dist/components/typography/text.d.ts +12 -0
  210. package/dist/components/typography/text.styles.d.ts +35 -13
  211. package/dist/components/ui/button.d.ts +1 -1
  212. package/dist/components/ui/checkbox.d.ts +5 -0
  213. package/dist/components/ui/overlay.recipes.d.ts +15 -2
  214. package/dist/components/ui/select.d.ts +3 -1
  215. package/dist/components/ui/switch.d.ts +5 -0
  216. package/dist/{containers-DqB-bSYE.js → containers-D_L4mTVb.js} +3 -3
  217. package/dist/{containers-DqB-bSYE.js.map → containers-D_L4mTVb.js.map} +1 -1
  218. package/dist/{copyable-BTSByfmq.js → copyable-DDjTeW_j.js} +4 -4
  219. package/dist/{copyable-BTSByfmq.js.map → copyable-DDjTeW_j.js.map} +1 -1
  220. package/dist/{data-display-Bihs9Ven.js → data-display-3xWQUnMA.js} +471 -478
  221. package/dist/data-display-3xWQUnMA.js.map +1 -0
  222. package/dist/date-picker-DrDFj8Lo.js +1527 -0
  223. package/dist/date-picker-DrDFj8Lo.js.map +1 -0
  224. package/dist/date-pickers-CnFCb0n2.js +174 -0
  225. package/dist/date-pickers-CnFCb0n2.js.map +1 -0
  226. package/dist/date-uf3z37Nm.js +144 -0
  227. package/dist/date-uf3z37Nm.js.map +1 -0
  228. package/dist/{display-CS6Hbk18.js → display-DrdvPwF0.js} +25 -25
  229. package/dist/display-DrdvPwF0.js.map +1 -0
  230. package/dist/{dropdown-menu-D-boNgGO.js → dropdown-menu-CURh59jb.js} +22 -15
  231. package/dist/dropdown-menu-CURh59jb.js.map +1 -0
  232. package/dist/features/activities.js +38 -35
  233. package/dist/features/activities.js.map +1 -1
  234. package/dist/features/ai-chat.js +36 -35
  235. package/dist/features/ai-chat.js.map +1 -1
  236. package/dist/features/async-preview.js +8 -8
  237. package/dist/features/combobox.js +1 -1
  238. package/dist/features/comments.js +1 -1
  239. package/dist/features/data-view.js +10 -10
  240. package/dist/features/email-composer.js +325 -326
  241. package/dist/features/email-composer.js.map +1 -1
  242. package/dist/features/event-calendar.js +190 -200
  243. package/dist/features/event-calendar.js.map +1 -1
  244. package/dist/features/filters.js +1 -1
  245. package/dist/features/global-search.js +77 -77
  246. package/dist/features/global-search.js.map +1 -1
  247. package/dist/features/kanban.js +4 -4
  248. package/dist/features/map.js +8 -8
  249. package/dist/features/media-library.js +499 -502
  250. package/dist/features/media-library.js.map +1 -1
  251. package/dist/features/mentions.js +1 -1
  252. package/dist/features/overlays.js +1 -1
  253. package/dist/features/products.js +1216 -1248
  254. package/dist/features/products.js.map +1 -1
  255. package/dist/features/questionnaire.js +46 -44
  256. package/dist/features/questionnaire.js.map +1 -1
  257. package/dist/features/resource-assignment.js +96 -88
  258. package/dist/features/resource-assignment.js.map +1 -1
  259. package/dist/features/resource.js +11 -11
  260. package/dist/features/rich-text-editor.js +2 -2
  261. package/dist/features/schema-form.js +188 -184
  262. package/dist/features/schema-form.js.map +1 -1
  263. package/dist/features/suggestions.js +3 -3
  264. package/dist/features/sync.js +7 -7
  265. package/dist/features/sync.js.map +1 -1
  266. package/dist/features/table.js +1 -1
  267. package/dist/features/theme-tweaker.js +469 -470
  268. package/dist/features/theme-tweaker.js.map +1 -1
  269. package/dist/{feedback-CJkUAapr.js → feedback-C7nR0UtT.js} +9 -10
  270. package/dist/feedback-C7nR0UtT.js.map +1 -0
  271. package/dist/field-affordance-recipes-CkOCdE2y.js +46 -0
  272. package/dist/field-affordance-recipes-CkOCdE2y.js.map +1 -0
  273. package/dist/{field-state-recipes-DQQpiLWC.js → field-state-recipes-C-MFBX_8.js} +3 -3
  274. package/dist/field-state-recipes-C-MFBX_8.js.map +1 -0
  275. package/dist/{filters-D6FF8L6s.js → filters-Da-gNPsE.js} +467 -467
  276. package/dist/filters-Da-gNPsE.js.map +1 -0
  277. package/dist/{form-field-CZwrkP7m.js → form-field-VZRULhUK.js} +7 -7
  278. package/dist/{form-field-CZwrkP7m.js.map → form-field-VZRULhUK.js.map} +1 -1
  279. package/dist/form-sizing-uWP4lzVh.js +126 -0
  280. package/dist/form-sizing-uWP4lzVh.js.map +1 -0
  281. package/dist/{forms-B5NCbkSC.js → forms-DDeEnXSY.js} +11 -11
  282. package/dist/forms-DDeEnXSY.js.map +1 -0
  283. package/dist/forms-numeric-D3CO60IF.js +905 -0
  284. package/dist/forms-numeric-D3CO60IF.js.map +1 -0
  285. package/dist/{header-kxruN3RM.js → header-2ycNqGOR.js} +43 -42
  286. package/dist/header-2ycNqGOR.js.map +1 -0
  287. package/dist/{hooks-BrlnCwQd.js → hooks-DQ5SPwZw.js} +2 -2
  288. package/dist/{hooks-BrlnCwQd.js.map → hooks-DQ5SPwZw.js.map} +1 -1
  289. package/dist/{icon-badge-Btc6pQrp.js → icon-badge-DKlaKXoo.js} +3 -3
  290. package/dist/{icon-badge-Btc6pQrp.js.map → icon-badge-DKlaKXoo.js.map} +1 -1
  291. package/dist/index.js +2 -2
  292. package/dist/{input-vxcaNCYC.js → input-BoLm9Hks.js} +3 -3
  293. package/dist/{input-vxcaNCYC.js.map → input-BoLm9Hks.js.map} +1 -1
  294. package/dist/input-DhQdBnV3.js +255 -0
  295. package/dist/{input-SX9V0AL3.js.map → input-DhQdBnV3.js.map} +1 -1
  296. package/dist/item-xzh8Df65.js +264 -0
  297. package/dist/item-xzh8Df65.js.map +1 -0
  298. package/dist/layout/app-shell.js +1 -1
  299. package/dist/layout/auth.js +1 -1
  300. package/dist/layout/containers.js +1 -1
  301. package/dist/layout/header.js +1 -1
  302. package/dist/layout/hooks.js +1 -1
  303. package/dist/layout/navigation.js +1 -1
  304. package/dist/layout/page.js +1 -1
  305. package/dist/layout/settings.js +1 -1
  306. package/dist/layout/sidebar.js +2 -2
  307. package/dist/layout/workspace.js +1 -1
  308. package/dist/layout.js +10 -10
  309. package/dist/lib/affordance-geometry.generated.d.ts +6 -1
  310. package/dist/lib/field-affordance-recipes.d.ts +35 -0
  311. package/dist/lib/field-state-recipes.d.ts +4 -2
  312. package/dist/lib/format.d.ts +9 -0
  313. package/dist/lib/money-format.d.ts +30 -0
  314. package/dist/lib/overlay-anatomy-recipes.d.ts +1 -1
  315. package/dist/lib/surface-recipes.d.ts +8 -6
  316. package/dist/lib/token-merge.generated.d.ts +11 -11
  317. package/dist/lib/track-recipes.d.ts +1 -1
  318. package/dist/lib/ui-provider/provider.d.ts +7 -2
  319. package/dist/lib/ui-provider/store.d.ts +6 -2
  320. package/dist/lib/ui-provider/types.d.ts +5 -2
  321. package/dist/lib/utils.js +1 -1
  322. package/dist/{media-gallery-DLp3HAz0.js → media-gallery-DQUQ0m3O.js} +8 -8
  323. package/dist/media-gallery-DQUQ0m3O.js.map +1 -0
  324. package/dist/{mentions-Cl0Kt_Pd.js → mentions-DwnO1hh4.js} +34 -35
  325. package/dist/{mentions-Cl0Kt_Pd.js.map → mentions-DwnO1hh4.js.map} +1 -1
  326. package/dist/{message-SZUNB1eX.js → message-YfFmbXNP.js} +5 -5
  327. package/dist/{message-SZUNB1eX.js.map → message-YfFmbXNP.js.map} +1 -1
  328. package/dist/{navigation-DyytsLRB.js → navigation-Cbp5V8gG.js} +33 -34
  329. package/dist/navigation-Cbp5V8gG.js.map +1 -0
  330. package/dist/{navigation-DnQSNMT0.js → navigation-Cs1npsPm.js} +111 -87
  331. package/dist/navigation-Cs1npsPm.js.map +1 -0
  332. package/dist/{navigation-row-recipes-DQEXQcqY.js → navigation-row-recipes-DlU-4QYO.js} +2 -2
  333. package/dist/{navigation-row-recipes-DQEXQcqY.js.map → navigation-row-recipes-DlU-4QYO.js.map} +1 -1
  334. package/dist/number-CKRBYmZK.js +352 -0
  335. package/dist/number-CKRBYmZK.js.map +1 -0
  336. package/dist/overlay.recipes-CNO2S9V6.js +34 -0
  337. package/dist/overlay.recipes-CNO2S9V6.js.map +1 -0
  338. package/dist/overlays-DhZO7N-I.js +994 -0
  339. package/dist/overlays-DhZO7N-I.js.map +1 -0
  340. package/dist/page-C6R_8jFt.js +325 -0
  341. package/dist/page-C6R_8jFt.js.map +1 -0
  342. package/dist/{page-header-D8nERkn5.js → page-header-hUTzcRZX.js} +9 -9
  343. package/dist/page-header-hUTzcRZX.js.map +1 -0
  344. package/dist/{pagination-NLGqRirf.js → pagination-Cm0jqa3I.js} +8 -8
  345. package/dist/{pagination-NLGqRirf.js.map → pagination-Cm0jqa3I.js.map} +1 -1
  346. package/dist/{popover-CghIYdQf.js → popover-Dcv_9jxr.js} +6 -6
  347. package/dist/{popover-CghIYdQf.js.map → popover-Dcv_9jxr.js.map} +1 -1
  348. package/dist/{popover-menu-B4PoWhRl.js → popover-menu-DnRFKnHP.js} +6 -6
  349. package/dist/{popover-menu-B4PoWhRl.js.map → popover-menu-DnRFKnHP.js.map} +1 -1
  350. package/dist/{popover.recipes-QlD4JenO.js → popover.recipes-wmbvL8Ah.js} +2 -2
  351. package/dist/{popover.recipes-QlD4JenO.js.map → popover.recipes-wmbvL8Ah.js.map} +1 -1
  352. package/dist/primitives-BHrwQXFC.js +379 -0
  353. package/dist/primitives-BHrwQXFC.js.map +1 -0
  354. package/dist/primitives.js +5 -5
  355. package/dist/{progress-BroqrAyV.js → progress-Br9WTFya.js} +7 -7
  356. package/dist/progress-Br9WTFya.js.map +1 -0
  357. package/dist/{receipt-BuJynLgf.js → receipt-CV89q1fs.js} +6 -6
  358. package/dist/{receipt-BuJynLgf.js.map → receipt-CV89q1fs.js.map} +1 -1
  359. package/dist/{rich-text-editor-BKyG7rWz.js → rich-text-editor-CF8QYt5p.js} +6 -6
  360. package/dist/{rich-text-editor-BKyG7rWz.js.map → rich-text-editor-CF8QYt5p.js.map} +1 -1
  361. package/dist/{rich-text-editor.recipes-B72Nfuze.js → rich-text-editor.recipes-CnrbmTS1.js} +4 -4
  362. package/dist/{rich-text-editor.recipes-B72Nfuze.js.map → rich-text-editor.recipes-CnrbmTS1.js.map} +1 -1
  363. package/dist/{rich-text-DlxDOtf4.js → rich-text-j-FGAeZW.js} +4 -4
  364. package/dist/{rich-text-DlxDOtf4.js.map → rich-text-j-FGAeZW.js.map} +1 -1
  365. package/dist/{scroll-area-D-pIhEKl.js → scroll-area-DRdr16Pt.js} +3 -3
  366. package/dist/scroll-area-DRdr16Pt.js.map +1 -0
  367. package/dist/{separator-BhtFyo4x.js → separator-BMEvwnSX.js} +2 -2
  368. package/dist/{separator-BhtFyo4x.js.map → separator-BMEvwnSX.js.map} +1 -1
  369. package/dist/{separator-BNIgG3au.js → separator-Do5GWDYi.js} +4 -4
  370. package/dist/separator-Do5GWDYi.js.map +1 -0
  371. package/dist/services/actions/action-adapters.d.ts +4 -0
  372. package/dist/services/actions.js +8 -3
  373. package/dist/services/actions.js.map +1 -1
  374. package/dist/{settings-DOTOzeZ2.js → settings-DHk0L2MF.js} +17 -17
  375. package/dist/settings-DHk0L2MF.js.map +1 -0
  376. package/dist/sheet-DRFNY1_D.js +207 -0
  377. package/dist/sheet-DRFNY1_D.js.map +1 -0
  378. package/dist/sidebar-Cb8WzOvE.js +511 -0
  379. package/dist/sidebar-Cb8WzOvE.js.map +1 -0
  380. package/dist/{sidebar-CyR4XKwR.js → sidebar-Crc9M9JV.js} +18 -18
  381. package/dist/sidebar-Crc9M9JV.js.map +1 -0
  382. package/dist/{skeleton-3F0uhYn3.js → skeleton-DVMXr15h.js} +4 -4
  383. package/dist/{skeleton-3F0uhYn3.js.map → skeleton-DVMXr15h.js.map} +1 -1
  384. package/dist/{smart-card-DjGVV2xr.js → smart-card-Bek-TwUp.js} +222 -207
  385. package/dist/smart-card-Bek-TwUp.js.map +1 -0
  386. package/dist/{spinner-Cpf7oRkF.js → spinner-CmTAbEp0.js} +8 -6
  387. package/dist/spinner-CmTAbEp0.js.map +1 -0
  388. package/dist/{structure-CRdqVawd.js → structure-hzCW-XsV.js} +3 -3
  389. package/dist/{structure-CRdqVawd.js.map → structure-hzCW-XsV.js.map} +1 -1
  390. package/dist/{structure.recipes-Bqhf9oIh.js → structure.recipes-EPz60cU8.js} +37 -19
  391. package/dist/structure.recipes-EPz60cU8.js.map +1 -0
  392. package/dist/style.css +1 -1
  393. package/dist/surface-recipes-DOdoBXGm.js +28 -0
  394. package/dist/surface-recipes-DOdoBXGm.js.map +1 -0
  395. package/dist/table-D6zKeYQX.js +162 -0
  396. package/dist/table-D6zKeYQX.js.map +1 -0
  397. package/dist/{table-CcRDZiLP.js → table-Dn4XSrSB.js} +348 -348
  398. package/dist/table-Dn4XSrSB.js.map +1 -0
  399. package/dist/{tabs-BNgu7g0u.js → tabs-Dk8E_knt.js} +14 -13
  400. package/dist/tabs-Dk8E_knt.js.map +1 -0
  401. package/dist/{text-inputs-DsR56TR-.js → text-inputs-BFpku0Qd.js} +150 -149
  402. package/dist/text-inputs-BFpku0Qd.js.map +1 -0
  403. package/dist/{text.styles-Q4sGAIgA.js → text.styles-g4He6UIW.js} +17 -14
  404. package/dist/text.styles-g4He6UIW.js.map +1 -0
  405. package/dist/theme.css +16 -12
  406. package/dist/themes/green.css +24 -0
  407. package/dist/{timelines-D1pkt3se.js → timelines-CxuAFIc2.js} +25 -38
  408. package/dist/timelines-CxuAFIc2.js.map +1 -0
  409. package/dist/track-recipes-CDcKmndW.js +10 -0
  410. package/dist/track-recipes-CDcKmndW.js.map +1 -0
  411. package/dist/{tree-BtmYyMZV.js → tree-BotPlyiD.js} +13 -13
  412. package/dist/{tree-BtmYyMZV.js.map → tree-BotPlyiD.js.map} +1 -1
  413. package/dist/typography/rich-text.js +1 -1
  414. package/dist/typography-CAr3dQhX.js +116 -0
  415. package/dist/typography-CAr3dQhX.js.map +1 -0
  416. package/dist/typography.js +2 -2
  417. package/dist/{ui-provider-DRPn3qNl.js → ui-provider-D2_TeLqw.js} +20 -21
  418. package/dist/ui-provider-D2_TeLqw.js.map +1 -0
  419. package/dist/ui-provider.js +1 -1
  420. package/dist/{upload-CDbYw1WN.js → upload-B0WHW7ak.js} +221 -220
  421. package/dist/upload-B0WHW7ak.js.map +1 -0
  422. package/dist/{upload-queue-CNd_hH_a.js → upload-queue-BHZ_wBfd.js} +59 -62
  423. package/dist/upload-queue-BHZ_wBfd.js.map +1 -0
  424. package/dist/{usage-card-VyJLUwRr.js → usage-card-U0YBLTNT.js} +42 -43
  425. package/dist/{usage-card-VyJLUwRr.js.map → usage-card-U0YBLTNT.js.map} +1 -1
  426. package/dist/{utils-BvH9PSmq.js → utils-Cospvlj1.js} +221 -51
  427. package/dist/utils-Cospvlj1.js.map +1 -0
  428. package/dist/value-inputs-CjfzGMsN.js +854 -0
  429. package/dist/value-inputs-CjfzGMsN.js.map +1 -0
  430. package/dist/value-typography-Deb3yQZg.js +116 -0
  431. package/dist/value-typography-Deb3yQZg.js.map +1 -0
  432. package/dist/{workspace-CcR8r-Nt.js → workspace-YoFjXi6i.js} +44 -45
  433. package/dist/workspace-YoFjXi6i.js.map +1 -0
  434. package/docs/consumer-skill/SKILL.md +51 -38
  435. package/docs/consumer-skill/examples/app-layout.tsx +2 -4
  436. package/docs/consumer-skill/examples/detail.tsx +3 -4
  437. package/docs/consumer-skill/examples/edit.tsx +1 -1
  438. package/docs/consumer-skill/examples/layout-blocks.tsx +20 -0
  439. package/docs/consumer-skill/examples/manifest.json +28 -6
  440. package/docs/consumer-skill/examples/scoped-directory.tsx +2 -2
  441. package/docs/consumer-skill/references/composition.md +89 -17
  442. package/docs/consumer-skill/references/discovery.md +4 -0
  443. package/docs/consumer-skill/references/installation.md +22 -0
  444. package/docs/consumer-skill/references/integration.md +32 -1
  445. package/docs/consumer-skill/references/public-api.json +111 -70
  446. package/docs/consumer-skill/references/review.md +20 -4
  447. package/docs/consumer-skill/references/theming.md +7 -1
  448. package/docs/consumer-skill/references/tokens.json +5 -2
  449. package/docs/consumer-skill/references/workflows.md +4 -2
  450. package/docs/consumer-skill/scripts/composition-policy.mjs +93 -2
  451. package/docs/consumer-skill/scripts/discovery.mjs +11 -3
  452. package/docs/consumer-skill/scripts/pin-button-defaults.mjs +95 -0
  453. package/package.json +5 -3
  454. package/dist/accordion-BRTcsp8J.js.map +0 -1
  455. package/dist/action-menu-Drxw_vJk.js +0 -265
  456. package/dist/action-menu-Drxw_vJk.js.map +0 -1
  457. package/dist/affordance-geometry.generated-CL84ZN9A.js.map +0 -1
  458. package/dist/ai-artifact-DLVdK0Py.js.map +0 -1
  459. package/dist/avatar-Bu2HhitA.js.map +0 -1
  460. package/dist/badge-CzId1Wlm.js.map +0 -1
  461. package/dist/button-BZDasD04.js.map +0 -1
  462. package/dist/buttons-D_6KJvEE.js.map +0 -1
  463. package/dist/chart-Bsc5BICK.js.map +0 -1
  464. package/dist/checkbox-BQNDjUCh.js +0 -34
  465. package/dist/checkbox-BQNDjUCh.js.map +0 -1
  466. package/dist/choice-inputs-Mk3iWbhr.js +0 -725
  467. package/dist/choice-inputs-Mk3iWbhr.js.map +0 -1
  468. package/dist/combobox-BFnbJJp3.js.map +0 -1
  469. package/dist/combobox-hozNwUcc.js.map +0 -1
  470. package/dist/command-BnmSchli.js.map +0 -1
  471. package/dist/comments-u5L0OGip.js.map +0 -1
  472. package/dist/data-display-Bihs9Ven.js.map +0 -1
  473. package/dist/date-DOKhJPu7.js +0 -140
  474. package/dist/date-DOKhJPu7.js.map +0 -1
  475. package/dist/date-picker-DzP5HQq7.js +0 -1541
  476. package/dist/date-picker-DzP5HQq7.js.map +0 -1
  477. package/dist/date-pickers-BpgGz7S-.js +0 -196
  478. package/dist/date-pickers-BpgGz7S-.js.map +0 -1
  479. package/dist/display-CS6Hbk18.js.map +0 -1
  480. package/dist/dropdown-menu-D-boNgGO.js.map +0 -1
  481. package/dist/feedback-CJkUAapr.js.map +0 -1
  482. package/dist/field-affordance-recipes-uKY4MsZ_.js +0 -25
  483. package/dist/field-affordance-recipes-uKY4MsZ_.js.map +0 -1
  484. package/dist/field-state-recipes-DQQpiLWC.js.map +0 -1
  485. package/dist/filters-D6FF8L6s.js.map +0 -1
  486. package/dist/form-sizing-QP8aIRaW.js +0 -103
  487. package/dist/form-sizing-QP8aIRaW.js.map +0 -1
  488. package/dist/format-iamDSqs2.js +0 -110
  489. package/dist/format-iamDSqs2.js.map +0 -1
  490. package/dist/forms-B5NCbkSC.js.map +0 -1
  491. package/dist/forms-numeric-Crrm80Lm.js +0 -867
  492. package/dist/forms-numeric-Crrm80Lm.js.map +0 -1
  493. package/dist/header-kxruN3RM.js.map +0 -1
  494. package/dist/input-SX9V0AL3.js +0 -255
  495. package/dist/item-DE4YnuJx.js +0 -258
  496. package/dist/item-DE4YnuJx.js.map +0 -1
  497. package/dist/media-gallery-DLp3HAz0.js.map +0 -1
  498. package/dist/navigation-DnQSNMT0.js.map +0 -1
  499. package/dist/navigation-DyytsLRB.js.map +0 -1
  500. package/dist/number-DasMFWEG.js +0 -269
  501. package/dist/number-DasMFWEG.js.map +0 -1
  502. package/dist/overlay.recipes-BxW5FIfK.js +0 -6
  503. package/dist/overlay.recipes-BxW5FIfK.js.map +0 -1
  504. package/dist/overlays-DUbs1KEi.js +0 -1011
  505. package/dist/overlays-DUbs1KEi.js.map +0 -1
  506. package/dist/page-hGmT4nWK.js +0 -213
  507. package/dist/page-hGmT4nWK.js.map +0 -1
  508. package/dist/page-header-D8nERkn5.js.map +0 -1
  509. package/dist/primitives-C7ff0QaI.js +0 -337
  510. package/dist/primitives-C7ff0QaI.js.map +0 -1
  511. package/dist/progress-BroqrAyV.js.map +0 -1
  512. package/dist/scroll-area-D-pIhEKl.js.map +0 -1
  513. package/dist/separator-BNIgG3au.js.map +0 -1
  514. package/dist/settings-DOTOzeZ2.js.map +0 -1
  515. package/dist/sheet-BFhrNehm.js +0 -205
  516. package/dist/sheet-BFhrNehm.js.map +0 -1
  517. package/dist/sidebar-CyR4XKwR.js.map +0 -1
  518. package/dist/sidebar-SvGJ0Zwi.js +0 -506
  519. package/dist/sidebar-SvGJ0Zwi.js.map +0 -1
  520. package/dist/smart-card-DjGVV2xr.js.map +0 -1
  521. package/dist/spinner-Cpf7oRkF.js.map +0 -1
  522. package/dist/structure.recipes-Bqhf9oIh.js.map +0 -1
  523. package/dist/surface-recipes-Dd__PD-w.js +0 -28
  524. package/dist/surface-recipes-Dd__PD-w.js.map +0 -1
  525. package/dist/table-CLtJTxoR.js +0 -147
  526. package/dist/table-CLtJTxoR.js.map +0 -1
  527. package/dist/table-CcRDZiLP.js.map +0 -1
  528. package/dist/tabs-BNgu7g0u.js.map +0 -1
  529. package/dist/text-inputs-DsR56TR-.js.map +0 -1
  530. package/dist/text.styles-Q4sGAIgA.js.map +0 -1
  531. package/dist/timelines-D1pkt3se.js.map +0 -1
  532. package/dist/track-recipes-LLPNVwFg.js +0 -10
  533. package/dist/track-recipes-LLPNVwFg.js.map +0 -1
  534. package/dist/typography-BxQgiZyw.js +0 -96
  535. package/dist/typography-BxQgiZyw.js.map +0 -1
  536. package/dist/ui-provider-DRPn3qNl.js.map +0 -1
  537. package/dist/upload-CDbYw1WN.js.map +0 -1
  538. package/dist/upload-queue-CNd_hH_a.js.map +0 -1
  539. package/dist/utils-BvH9PSmq.js.map +0 -1
  540. package/dist/value-inputs-D0KCrfVC.js +0 -840
  541. package/dist/value-inputs-D0KCrfVC.js.map +0 -1
  542. package/dist/workspace-CcR8r-Nt.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"choice-inputs-Mk3iWbhr.js","names":["Select","SelectPrimitive","isScalar","baseui.SelectContent","baseui.SelectGroup","baseui.SelectItem","baseui.SelectLabel","baseui.SelectSeparator","Select","baseui.Select","baseui.SelectTrigger","baseui.SelectValue","Switch","SwitchPrimitive","Switch","SwitchPrimitive","React","Switch","isSimpleText","Switch","isSimpleText","GRID_COLS","isSimpleText","RadioGroupPrimitive","RadioPrimitive","React","RadioGroupPrimitive","RadioPrimitive","React","resolveComponentScale","useTypographyConfig","useDensityConfig","cn","textSizes","Text","Label","anchoredPositionMethod","motionRecipes","Stack","collectionRowClasses","popoverRecipes","collectionRecipes","CollectionLabel","CollectionContent","formFieldTriggerClasses","formControlIconClasses","resolveFormControlSize","formControlSizeClasses","Checkbox","React$1","Select$2","Select","SelectGroup","props","className","SelectValue","SelectTrigger","size","children","ChevronDownIcon","SelectContent","resolvedContainer","useThemePortalContainer","container","alignItemWithTrigger","SelectScrollUpButton","SelectScrollDownButton","SelectLabel","SelectItem","CheckIcon","SelectSeparator","ChevronUpIcon","SELECT_POPUP_BEM","selectPopupItemSizeClasses","isScalar$1","value","SelectPopupContent","SelectPopupGroup","SelectPopupItem","density","defaultTextSize","SelectPopupLabel","SelectPopupSeparator","defaultSelectStrings","CLEAR_VALUE","OPTION_VALUE_PREFIX","toInternalOptionValue","toInternalSelectedValue","toExternalValue","isScalar","typographyNode","DefaultOptionContent","option","Select$1","memo","forwardRef","isControlled","stringsProp","sizeProp","ariaLabel","ariaLabelledBy","ariaDescribedBy","ariaInvalid","triggerProps","strings","useStrings","defaultScale","resolvedPlaceholder","placeholder","internalOptions","useMemo","mapped","options","allowClear","internalValue","optionsByInternalValue","entry","normalizedValue","normalizedDefaultValue","defaultValue","handleValueChange","useCallback","externalValue","nextValue","onValueChange","serializeValue","invalid","selectedOption","currentValue","renderValue","contentClassName","rendered","renderOption","Switch$2","Switch","Switch$1","rest","resolvedAriaInvalid","resolvedInvalid","checked","SwitchCard","Icon","internal","setInternal","useState","generatedId","useId","id","name","hasDescription","description","describedById","handleToggle","disabled","newChecked","handleCardClick","label","hint","isSimpleText$3","ToggleField","inputId","labelId","descriptionId","set","next","onRowClick","Control","kind","v","TextBlock","controlPosition","choiceCardSizeTokens","choicePillSizeTokens","choiceListSizeTokens","choiceCardMarkerClasses","choiceCardMarkerClearance","isSimpleText$2","GRID_COLS$1","CardCheckboxGroup","selected","tokens","toggle","o","val","columns","optionLabel","isSelected","isDisabled","shouldIncludeHidden","nameAttr","CircleCheck","isSimpleText$1","GRID_COLS","CardRadioGroupImpl","gridClassName","RadioGroup","Radio","CardRadioGroup","isSimpleText","ListRadioGroup","rowPadding","Circle","PillRadioGroup","handleClick","optionValue","fullWidth","index"],"sources":["../src/components/ui/select.tsx","../src/components/base/choice-inputs/select-popup.tsx","../src/components/base/choice-inputs/select.tsx","../src/components/ui/switch.tsx","../src/components/base/choice-inputs/switch.tsx","../src/components/base/choice-inputs/switch-card.tsx","../src/components/base/choice-inputs/toggle-field.tsx","../src/components/base/choice-inputs/choice-types.ts","../src/components/base/choice-inputs/card-checkbox-group.tsx","../src/components/base/choice-inputs/card-radio-group.tsx","../src/components/base/choice-inputs/list-radio-group.tsx","../src/components/base/choice-inputs/pill-radio-group.tsx"],"sourcesContent":["import { anchoredPositionMethod } from '../../lib/anchored-positioning';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { useThemePortalContainer, type ThemePortalContainer } from '../../lib/theme-scope';\nimport { Select as SelectPrimitive } from \"@base-ui/react/select\"\nimport { ChevronDownIcon, CheckIcon, ChevronUpIcon } from \"lucide-react\"\nimport * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Select = SelectPrimitive.Root\n\nfunction SelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {\n return (\n <SelectPrimitive.Group\n data-slot=\"select-group\"\n className={cn(\"scroll-my-1 p-1\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectValue({ className, ...props }: SelectPrimitive.Value.Props) {\n return (\n <SelectPrimitive.Value\n data-slot=\"select-value\"\n className={cn(\"flex flex-1 text-start\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n}: SelectPrimitive.Trigger.Props & {\n size?: \"sm\" | \"default\"\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring aria-invalid:ring-destructive/20 aria-invalid:border-destructive gap-space-sm rounded-md border bg-transparent py-space-xs px-control text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-space-sm [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon\n render={\n <ChevronDownIcon className=\"text-muted-foreground size-4 pointer-events-none\" />\n }\n />\n </SelectPrimitive.Trigger>\n )\n}\n\nfunction SelectContent({\n className,\n container,\n children,\n side = \"bottom\",\n sideOffset = 4,\n align = \"center\",\n alignOffset = 0,\n alignItemWithTrigger = true,\n positionMethod = anchoredPositionMethod,\n ...props\n}: SelectPrimitive.Popup.Props &\n Pick<\n SelectPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"alignItemWithTrigger\" | \"positionMethod\"\n > & { container?: ThemePortalContainer }) {\n const resolvedContainer = useThemePortalContainer(container)\n return (\n <SelectPrimitive.Portal container={resolvedContainer}>\n <SelectPrimitive.Positioner\n positionMethod={positionMethod}\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n className=\"isolate z-50\"\n >\n <SelectPrimitive.Popup\n data-slot=\"select-content\"\n data-align-trigger={alignItemWithTrigger}\n className={cn(\n motionRecipes.popup,\n 'data-[align-trigger=true]:transition-none data-[align-trigger=true]:duration-0 data-[align-trigger=true]:scale-100 data-[align-trigger=true]:translate-none data-[align-trigger=true]:opacity-100',\n \"bg-popover text-popover-foreground ring-foreground/10 min-w-36 rounded-md shadow-md ring-1 relative isolate z-50 max-h-(--available-height) min-w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto\",\n className\n )}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.List>{children}</SelectPrimitive.List>\n <SelectScrollDownButton />\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n )\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: SelectPrimitive.GroupLabel.Props) {\n return (\n <SelectPrimitive.GroupLabel\n data-slot=\"select-label\"\n className={cn(\"text-muted-foreground px-2 py-1.5 text-xs\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: SelectPrimitive.Item.Props) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"relative flex w-full cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className\n )}\n {...props}\n >\n <SelectPrimitive.ItemText className=\"flex min-w-0 flex-1 gap-space-sm\">\n {children}\n </SelectPrimitive.ItemText>\n <SelectPrimitive.ItemIndicator\n render={<span className=\"pointer-events-none flex shrink-0 items-center justify-center\" />}\n >\n <CheckIcon className=\"pointer-events-none\" />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n )\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: SelectPrimitive.Separator.Props) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px pointer-events-none\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {\n return (\n <SelectPrimitive.ScrollUpArrow\n data-slot=\"select-scroll-up-button\"\n className={cn(\"bg-popover z-10 flex cursor-default items-center justify-center py-space-xs [&_svg:not([class*='size-'])]:size-4 top-0 w-full\", className)}\n {...props}\n >\n <ChevronUpIcon\n />\n </SelectPrimitive.ScrollUpArrow>\n )\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {\n return (\n <SelectPrimitive.ScrollDownArrow\n data-slot=\"select-scroll-down-button\"\n className={cn(\"bg-popover z-10 flex cursor-default items-center justify-center py-space-xs [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full\", className)}\n {...props}\n >\n <ChevronDownIcon\n />\n </SelectPrimitive.ScrollDownArrow>\n )\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n}\n","import { CollectionLabel } from '../popover/collection-content';\nimport type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport * as baseui from '../../ui/select';\nimport { Text } from '../../typography';\nimport { textSizes } from '../../typography/text.styles';\nimport { useTypographyConfig, type FormControlSize } from '../../../lib/ui-provider';\nimport { cn } from '../../../lib/utils';\nimport { collectionRecipes, collectionRowClasses, popoverRecipes, type CollectionDensity } from '../popover/popover.recipes';\n\nconst SELECT_POPUP_BEM = {\n\tcontent: 'select-popup--component',\n\tgroup: 'select-popup--group',\n\titem: 'select-popup--item',\n\tlabel: 'select-popup--label',\n\tseparator: 'select-popup--separator',\n} as const;\n\nconst selectPopupItemSizeClasses: Record<FormControlSize, string> = {\n\tsm: \"[&_svg:not([class*='size-'])]:size-icon-sm\",\n\tmd: \"[&_svg:not([class*='size-'])]:size-icon\",\n\tlg: \"[&_svg:not([class*='size-'])]:size-icon-lg\",\n};\n\nfunction isScalar(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n/**\n * Private presentation layer for every Select-based form popup.\n *\n * It deliberately leaves Root/Trigger/Value state and form semantics with the\n * owning control, while centralizing the collection popup's compact surface inset, row\n * rhythm, option indicator clearance, icon sizing, and group anatomy.\n */\nexport function SelectPopupContent({\n\tclassName,\n\talign = 'start',\n\talignItemWithTrigger = false,\n\t...props\n}: ComponentPropsWithoutRef<typeof baseui.SelectContent>) {\n\treturn (\n\t\t<baseui.SelectContent\n\t\t\talign={align}\n\t\t\talignItemWithTrigger={alignItemWithTrigger}\n\t\t\tclassName={cn(\n\t\t\t\tSELECT_POPUP_BEM.content,\n\t\t\t\tpopoverRecipes.surface,\n\t\t\t\tpopoverRecipes.menu,\n\t\t\t\t'w-max min-w-(--anchor-width) max-w-(--available-width)',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport function SelectPopupGroup({\n\tclassName,\n\t...props\n}: ComponentPropsWithoutRef<typeof baseui.SelectGroup>) {\n\treturn (\n\t\t<baseui.SelectGroup\n\t\t\tclassName={cn(SELECT_POPUP_BEM.group, 'p-0', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport interface SelectPopupItemProps\n\textends ComponentPropsWithoutRef<typeof baseui.SelectItem> {\n\t/** Match option typography, gap, icon, and indicator clearance to its trigger. */\n\tsize?: FormControlSize;\n\t/** Vertical option rhythm, independent from trigger/icon size. */\n\tdensity?: CollectionDensity;\n}\n\nexport function SelectPopupItem({\n\tchildren,\n\tclassName,\n\tsize = 'md',\n\tdensity = 'default',\n\t...props\n}: SelectPopupItemProps) {\n\tconst { defaultTextSize } = useTypographyConfig();\n\treturn (\n\t\t<baseui.SelectItem\n\t\t\tclassName={cn(\n\t\t\t\tSELECT_POPUP_BEM.item,\n\t\t\t\tcollectionRowClasses(density),\n\t\t\t\tcollectionRecipes.highlighted,\n\t\t\t\tcollectionRecipes.disabled,\n\t\t\t\tselectPopupItemSizeClasses[size],\n\t\t\t\ttextSizes[defaultTextSize ?? 'sm'],\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isScalar(children) ? <CollectionLabel>{children}</CollectionLabel> : children}\n\t\t</baseui.SelectItem>\n\t);\n}\n\nexport interface SelectPopupLabelProps\n\textends ComponentPropsWithoutRef<typeof baseui.SelectLabel> {\n\t/** Match the group label to the owning form control's text scale. */\n\tsize?: FormControlSize;\n}\n\nexport function SelectPopupLabel({\n\tchildren,\n\tclassName,\n\tsize = 'md',\n\t...props\n}: SelectPopupLabelProps) {\n\treturn (\n\t\t<baseui.SelectLabel\n\t\t\tclassName={cn(\n\t\t\t\tSELECT_POPUP_BEM.label,\n\t\t\t\t'px-row-x py-row-y',\n\t\t\t\tsize === 'sm' ? 'text-pxs' : size === 'lg' ? 'text-base' : 'text-sm',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isScalar(children) ? (\n\t\t\t\t<Text tag=\"span\" size=\"inherit\" type=\"secondary\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t{children}\n\t\t\t\t</Text>\n\t\t\t) : children}\n\t\t</baseui.SelectLabel>\n\t);\n}\n\nexport function SelectPopupSeparator({\n\tclassName,\n\t...props\n}: ComponentPropsWithoutRef<typeof baseui.SelectSeparator>) {\n\treturn (\n\t\t<baseui.SelectSeparator\n\t\t\tclassName={cn(\n\t\t\t\tSELECT_POPUP_BEM.separator,\n\t\t\t\tpopoverRecipes.separator,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n","import { CollectionContent } from '../popover/collection-content';\nimport {\n\tforwardRef,\n\tmemo,\n\tuseCallback,\n\tuseMemo,\n\ttype ComponentPropsWithoutRef,\n\ttype FocusEventHandler,\n\ttype ReactNode,\n\ttype Ref,\n} from 'react';\n\nimport * as baseui from '../../ui/select';\nimport { Text } from '../../typography';\nimport { useDensityConfig, type FormControlSize } from '../../../lib/ui-provider';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\nimport type { CollectionDensity } from '../popover/popover.recipes';\n\nimport {\n\tformControlIconClasses,\n\tformFieldTriggerClasses,\n\tresolveFormControlSize,\n} from '../forms/form-sizing';\nimport {\n\tSelectPopupContent,\n\tSelectPopupGroup,\n\tSelectPopupItem,\n} from './select-popup';\n\nexport interface SelectStrings {\n\tplaceholder: string;\n}\n\nexport const defaultSelectStrings: SelectStrings = {\n\tplaceholder: 'Select an option',\n};\n\nexport interface SelectOption {\n\tvalue: string;\n\tlabel: string;\n\tdescription?: string;\n\ticon?: ReactNode;\n\tdisabled?: boolean;\n}\n\ntype BaseSelectTriggerProps = ComponentPropsWithoutRef<typeof baseui.SelectTrigger>;\n\ntype SelectTriggerProps = Omit<\n\tBaseSelectTriggerProps,\n\t| 'aria-describedby'\n\t| 'aria-invalid'\n\t| 'aria-label'\n\t| 'aria-labelledby'\n\t| 'children'\n\t| 'className'\n\t| 'defaultValue'\n\t| 'disabled'\n\t| 'form'\n\t| 'id'\n\t| 'name'\n\t| 'onBlur'\n\t| 'onChange'\n\t| 'onFocus'\n\t| 'required'\n\t| 'size'\n\t| 'value'\n>;\n\nexport interface SelectProps extends SelectTriggerProps {\n\t/** Popup option rhythm, independent from the trigger size. Defaults to default. */\n\tdensity?: CollectionDensity;\n\t/** Available options. An empty-string option clears the selection. */\n\toptions: SelectOption[];\n\n\t/** Placeholder text — overrides `strings.placeholder` when provided. */\n\tplaceholder?: string;\n\n\t/** String overrides (e.g. placeholder). */\n\tstrings?: StringsProp<SelectStrings>;\n\n\t/** Add a placeholder option that clears the current selection. */\n\tallowClear?: boolean;\n\n\t/** Error state for styling (passed from FormField). */\n\tinvalid?: boolean;\n\n\t/** Visual size. */\n\tsize?: FormControlSize;\n\n\t/** Additional class names for the trigger. */\n\tclassName?: string;\n\n\t/** Additional class names for the popup surface. */\n\tcontentClassName?: string;\n\n\t/** Canonical value callback. Returns `undefined` when the selection is cleared. */\n\tonValueChange?: (value: string | undefined) => void;\n\n\t/** Current value. Passing `value={undefined}` explicitly keeps the control controlled and clear. */\n\tvalue?: string | null;\n\n\t/** Initial value for an uncontrolled select. */\n\tdefaultValue?: string | null;\n\n\t/** Disabled state. */\n\tdisabled?: boolean;\n\n\t/** Read-only state. */\n\treadOnly?: boolean;\n\n\t/** Field name used by the hidden native input. */\n\tname?: string;\n\n\t/** The owning form id when the select is rendered outside that form. */\n\tform?: string;\n\n\t/** Native autocomplete hint forwarded to the hidden input. */\n\tautoComplete?: string;\n\n\t/** Ref to the hidden native input used for form submission. */\n\tinputRef?: Ref<HTMLInputElement>;\n\n\t/** Root id; Base UI applies it to the trigger/field contract. */\n\tid?: string;\n\n\t/** Required state. */\n\trequired?: boolean;\n\n\t/** Accessible label for externally-labelled or compact trigger contexts. */\n\t'aria-label'?: string;\n\n\t/** Ids of elements that label the trigger. */\n\t'aria-labelledby'?: string;\n\n\t/** Ids of elements that describe the trigger. */\n\t'aria-describedby'?: string;\n\n\t/** Native invalid state forwarded to the trigger. `invalid` takes precedence. */\n\t'aria-invalid'?: BaseSelectTriggerProps['aria-invalid'];\n\n\t/** Native focus callback forwarded to the trigger. */\n\tonFocus?: FocusEventHandler<HTMLButtonElement>;\n\n\t/** Native blur callback forwarded to the trigger. */\n\tonBlur?: FocusEventHandler<HTMLButtonElement>;\n\n\t/** Open state (controlled). */\n\topen?: boolean;\n\n\t/** Default open state. */\n\tdefaultOpen?: boolean;\n\n\t/** Open change handler. */\n\tonOpenChange?: (open: boolean) => void;\n\n\t/** Called after the popup's opening or closing animation completes. */\n\tonOpenChangeComplete?: (open: boolean) => void;\n\n\t/** Whether the open popup should isolate interaction from the rest of the page. */\n\tmodal?: boolean;\n\n\t/** Whether pointer movement should highlight popup options. */\n\thighlightItemOnHover?: boolean;\n\n\t/** Replace the default icon/label/description option presentation. */\n\trenderOption?: (option: SelectOption) => ReactNode;\n\n\t/** Replace the trigger value presentation. Receives `undefined` for the placeholder state. */\n\trenderValue?: (option: SelectOption | undefined) => ReactNode;\n}\n\ninterface InternalSelectOption {\n\tinternalValue: string;\n\toption: SelectOption;\n}\n\n// Base UI reserves the empty string for an empty native form value. Encoding every\n// real option keeps consumer values collision-free, including values that happen to\n// equal this component's clear sentinel.\nconst CLEAR_VALUE = '__admin_ui_select_clear__';\nconst OPTION_VALUE_PREFIX = '__admin_ui_select_option__:';\n\nfunction toInternalOptionValue(value: string): string {\n\treturn value === '' ? CLEAR_VALUE : `${OPTION_VALUE_PREFIX}${value}`;\n}\n\nfunction toInternalSelectedValue(value: string | null | undefined): string | null {\n\tif (value === '' || value === null || value === undefined) return null;\n\treturn `${OPTION_VALUE_PREFIX}${value}`;\n}\n\nfunction toExternalValue(value: string | null): string | undefined {\n\tif (value === null || value === CLEAR_VALUE) return undefined;\n\tif (value.startsWith(OPTION_VALUE_PREFIX)) return value.slice(OPTION_VALUE_PREFIX.length);\n\treturn undefined;\n}\n\nfunction isScalar(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\nfunction typographyNode(value: ReactNode, className?: string): ReactNode {\n\tif (!isScalar(value)) return value;\n\n\treturn (\n\t\t<Text tag=\"span\" size=\"inherit\" lineHeight=\"tight\" className={cn('text-inherit', className)}>\n\t\t\t{value}\n\t\t</Text>\n\t);\n}\n\nfunction DefaultOptionContent({ option, size }: { option: SelectOption; size: FormControlSize }) {\n return <CollectionContent label={option.label} description={option.description} leading={option.icon} leadingDecorative wrap\n className=\"select--option-content\" leadingClassName={cn('select--option-icon',formControlIconClasses[size])}\n bodyClassName=\"select--option-text text-start\" labelClassName=\"select--option-label block\"\n descriptionClassName=\"select--option-description line-clamp-2\"/>;\n}\n\n/**\n * Canonical finite-option form control. `Select` owns the single Base UI state\n * engine used by both standard and descriptive option presentations.\n */\nexport const Select = memo(\n\tforwardRef<HTMLButtonElement, SelectProps>(function Select(props, ref) {\n\t\tconst isControlled = Object.prototype.hasOwnProperty.call(props, 'value');\n\t\tconst {\n\t\t\toptions,\n\t\t\tdensity,\n\t\t\tplaceholder,\n\t\t\tstrings: stringsProp,\n\t\t\tallowClear = false,\n\t\t\tinvalid,\n\t\t\tsize: sizeProp,\n\t\t\tclassName,\n\t\t\tcontentClassName,\n\t\t\tonValueChange,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tdefaultOpen,\n\t\t\topen,\n\t\t\tonOpenChange,\n\t\t\tonOpenChangeComplete,\n\t\t\tmodal,\n\t\t\thighlightItemOnHover,\n\t\t\tname,\n\t\t\tform,\n\t\t\tautoComplete,\n\t\t\tinputRef,\n\t\t\tid,\n\t\t\trequired,\n\t\t\t'aria-label': ariaLabel,\n\t\t\t'aria-labelledby': ariaLabelledBy,\n\t\t\t'aria-describedby': ariaDescribedBy,\n\t\t\t'aria-invalid': ariaInvalid,\n\t\t\tonFocus,\n\t\t\tonBlur,\n\t\t\tvalue,\n\t\t\tdefaultValue,\n\t\t\trenderOption,\n\t\t\trenderValue,\n\t\t\t...triggerProps\n\t\t} = props;\n\t\tconst strings = useStrings(defaultSelectStrings, stringsProp);\n\t\tconst { defaultScale } = useDensityConfig();\n\t\tconst size = resolveFormControlSize(sizeProp, defaultScale);\n\t\tconst resolvedPlaceholder = placeholder ?? strings.placeholder;\n\n\t\tconst internalOptions = useMemo<InternalSelectOption[]>(() => {\n\t\t\tconst mapped = options.map((option) => ({\n\t\t\t\toption,\n\t\t\t\tinternalValue: toInternalOptionValue(option.value),\n\t\t\t}));\n\n\t\t\tif (allowClear && !mapped.some(({ internalValue }) => internalValue === CLEAR_VALUE)) {\n\t\t\t\tmapped.unshift({\n\t\t\t\t\tinternalValue: CLEAR_VALUE,\n\t\t\t\t\toption: { value: '', label: resolvedPlaceholder },\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn mapped;\n\t\t}, [allowClear, options, resolvedPlaceholder]);\n\n\t\tconst optionsByInternalValue = useMemo(\n\t\t\t() => new Map(internalOptions.map((entry) => [entry.internalValue, entry.option])),\n\t\t\t[internalOptions],\n\t\t);\n\t\tconst normalizedValue = toInternalSelectedValue(value);\n\t\tconst normalizedDefaultValue = toInternalSelectedValue(defaultValue);\n\n\t\tconst handleValueChange = useCallback(\n\t\t\t(nextValue: string | null) => {\n\t\t\t\tconst externalValue = toExternalValue(nextValue);\n\t\t\t\tonValueChange?.(externalValue);\n\t\t\t},\n\t\t\t[onValueChange],\n\t\t);\n\n\t\tconst serializeValue = useCallback((internalValue: string) => {\n\t\t\treturn toExternalValue(internalValue) ?? '';\n\t\t}, []);\n\n\t\tconst controlledValueProps = isControlled ? { value: normalizedValue } : {};\n\n\t\treturn (\n\t\t\t<baseui.Select\n\t\t\t\tonValueChange={handleValueChange}\n\t\t\t\tdisabled={disabled}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tdefaultOpen={defaultOpen}\n\t\t\t\topen={open}\n\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\tonOpenChangeComplete={onOpenChangeComplete}\n\t\t\t\tmodal={modal}\n\t\t\t\thighlightItemOnHover={highlightItemOnHover}\n\t\t\t\tname={name}\n\t\t\t\tform={form}\n\t\t\t\tautoComplete={autoComplete}\n\t\t\t\tinputRef={inputRef}\n\t\t\t\tid={id}\n\t\t\t\trequired={required}\n\t\t\t\tdefaultValue={normalizedDefaultValue}\n\t\t\t\titemToStringValue={serializeValue}\n\t\t\t\t{...controlledValueProps}\n\t\t\t>\n\t\t\t\t<baseui.SelectTrigger\n\t\t\t\t\tref={ref}\n\t\t\t\t\taria-label={ariaLabel}\n\t\t\t\t\taria-labelledby={ariaLabelledBy}\n\t\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\t\taria-invalid={invalid ? true : ariaInvalid}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'select--component select--trigger',\n\t\t\t\t\t\tformFieldTriggerClasses(size),\n\t\t\t\t\t\t'data-[placeholder]:text-muted-foreground',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...triggerProps}\n\t\t\t\t>\n\t\t\t\t\t<baseui.SelectValue className=\"select--value min-w-0\">\n\t\t\t\t\t\t{(currentValue: string | null) => {\n\t\t\t\t\t\t\tconst selectedOption = currentValue && currentValue !== CLEAR_VALUE\n\t\t\t\t\t\t\t\t? optionsByInternalValue.get(currentValue)\n\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\tconst rendered = renderValue\n\t\t\t\t\t\t\t\t? renderValue(selectedOption)\n\t\t\t\t\t\t\t\t: selectedOption?.label ?? resolvedPlaceholder;\n\n\t\t\t\t\t\t\treturn typographyNode(rendered, 'min-w-0 truncate');\n\t\t\t\t\t\t}}\n\t\t\t\t\t</baseui.SelectValue>\n\t\t\t\t</baseui.SelectTrigger>\n\t\t\t\t<SelectPopupContent className={cn('select--content', contentClassName)}>\n\t\t\t\t\t<SelectPopupGroup className=\"select--group\">\n\t\t\t\t\t\t{internalOptions.map(({ internalValue, option }) => {\n\t\t\t\t\t\t\tconst rendered = renderOption?.(option);\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<SelectPopupItem\n\t\t\t\t\t\t\t\t\tkey={internalValue}\n\t\t\t\t\t\t\t\t\tvalue={internalValue}\n\t\t\t\t\t\t\t\t\tlabel={option.label}\n\t\t\t\t\t\t\t\t\taria-label={option.label}\n\t\t\t\t\t\t\t\t\tdisabled={option.disabled}\n\t\t\t\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\t\t\t\tdensity={density}\n\t\t\t\t\t\t\t\t\tclassName=\"select--item\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{renderOption\n\t\t\t\t\t\t\t\t\t\t? typographyNode(rendered, 'select--option-custom')\n\t\t\t\t\t\t\t\t\t\t: <DefaultOptionContent option={option} size={size} />}\n\t\t\t\t\t\t\t\t</SelectPopupItem>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\t\t\t\t\t</SelectPopupGroup>\n\t\t\t\t</SelectPopupContent>\n\t\t\t</baseui.Select>\n\t\t);\n\t}),\n);\n\nSelect.displayName = 'Select';\n","import { Switch as SwitchPrimitive } from \"@base-ui/react/switch\"\n\nimport { cn } from \"../../lib/utils\"\n\nfunction Switch({\n className,\n size = \"default\",\n ...props\n}: SwitchPrimitive.Root.Props & {\n size?: \"sm\" | \"default\"\n}) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n data-size={size}\n className={cn(\n \"data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring aria-invalid:ring-destructive/20 aria-invalid:border-destructive shrink-0 rounded-full border border-transparent focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-5 data-[size=default]:w-9 data-[size=sm]:h-4 data-[size=sm]:w-7 peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className=\"bg-background rounded-full shadow-sm group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[16px] group-data-[size=sm]/switch:data-checked:translate-x-[12px] group-data-[size=default]/switch:data-unchecked:translate-x-0.5 group-data-[size=sm]/switch:data-unchecked:translate-x-0.5 pointer-events-none block ring-0 transition-transform\"\n />\n </SwitchPrimitive.Root>\n )\n}\n\nexport { Switch }\n","/**\n * Switch — canonical boolean switch wrapper around the internal shadcn primitive.\n *\n * `onValueChange` is the package-wide value callback.\n */\nimport { forwardRef, type ComponentProps } from 'react';\n\nimport { Switch as SwitchPrimitive } from '../../ui/switch';\nimport { useDensityConfig, type ComponentScale } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { cn } from '../../../lib/utils';\n\ntype BaseSwitchProps = ComponentProps<typeof SwitchPrimitive>;\ntype SwitchElement = React.ElementRef<typeof SwitchPrimitive>;\n\nexport interface SwitchProps extends Omit<BaseSwitchProps, 'onCheckedChange' | 'size'> {\n\t/** Component scale. Falls back to `UIProvider.density.defaultScale`. */\n\tsize?: ComponentScale;\n\t/** Controlled checked state. */\n\tchecked?: boolean;\n\t/** Initial checked state for uncontrolled usage. */\n\tdefaultChecked?: boolean;\n\t/** Disable interaction and native form participation changes. */\n\tdisabled?: boolean;\n\t/** Prevent changes while retaining the current submitted value. */\n\treadOnly?: boolean;\n\t/** Require the switch to be checked for native form validation. */\n\trequired?: boolean;\n\t/** Hidden input name used during native form submission. */\n\tname?: string;\n\t/** Hidden input value submitted while checked. */\n\tvalue?: string;\n\t/** Optional value submitted while unchecked. */\n\tuncheckedValue?: string;\n\t/** Associate the hidden input with a form by id. */\n\tform?: string;\n\t/** Canonical boolean value callback. */\n\tonValueChange?: (checked: boolean) => void;\n\n\t/** Error state for styling (passed from FormField). */\n\tinvalid?: boolean;\n}\n\n/** Canonical boolean control with native form state and value-first callbacks. */\nexport const Switch = forwardRef<SwitchElement, SwitchProps>(function Switch(\n\t{\n\t\tonValueChange,\n\t\tsize: sizeProp,\n\t\tinvalid,\n\t\tclassName,\n\t\tid,\n\t\tname,\n\t\t'aria-invalid': ariaInvalid,\n\t\t...rest\n\t},\n\tref,\n) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComponentScale(sizeProp, defaultScale);\n\tconst resolvedAriaInvalid = invalid ? true : ariaInvalid;\n\tconst resolvedInvalid = resolvedAriaInvalid !== undefined && resolvedAriaInvalid !== false && resolvedAriaInvalid !== 'false';\n\n\treturn (\n\t\t<SwitchPrimitive\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t\tid={id}\n\t\t\tname={name}\n\t\t\tonCheckedChange={(checked) => onValueChange?.(checked)}\n\t\t\tsize={size === 'sm' ? 'sm' : 'default'}\n\t\t\taria-invalid={resolvedAriaInvalid}\n\t\t\tclassName={cn(\n\t\t\t\t'switch--component',\n\t\t\t\tsize === 'lg' && 'h-6! w-11! [&_[data-slot=switch-thumb]]:size-5! [&[data-checked]_[data-slot=switch-thumb]]:translate-x-[20px]!',\n\t\t\t\tresolvedInvalid && 'data-unchecked:border-destructive',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t/>\n\t);\n});\n\nSwitch.displayName = 'Switch';\n","/**\n * SwitchCard — bordered settings card with an icon, title, optional\n * description, optional hint, and a trailing switch. The whole card is\n * clickable and toggles the switch; clicking inside the actual switch only\n * toggles once. Active state lifts the border and tints the surface.\n *\n * Use for top-of-list \"feature\" toggles where the switch needs more visual\n * weight than a `ToggleField`. For dense rows, prefer `ToggleField`.\n */\nimport { type LucideIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { useCallback, useId, useMemo, useState } from 'react';\nimport { Stack } from '../structure';\nimport { Label, Text } from '../../typography';\nimport { cn } from '../../../lib/utils';\n\nimport { Switch } from './switch';\n\nexport interface SwitchCardProps {\n\t/** Additional supporting/error descriptions associated with the editable control. */\n\t'aria-describedby'?: string;\n\t/** Card title, also the switch's accessible name. */\n\tlabel: string;\n\t/** Supporting sentence under the label. */\n\tdescription?: string;\n\t/** Short guidance below the description. */\n\thint?: string;\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n\t/** Form field name, forwarded for native submits. */\n\tname?: string;\n\t/** Whether the switch is on. Controlled. */\n\tvalue?: boolean;\n\t/** Initial switch state for uncontrolled use. */\n\tdefaultValue?: boolean;\n\tonValueChange?: (checked: boolean) => void;\n\t/** Disables the switch and mutes the card. */\n\tdisabled?: boolean;\n\t/** Applies the invalid styling. */\n\tinvalid?: boolean;\n\tclassName?: string;\n}\n\nexport const SwitchCard = React.forwardRef<HTMLDivElement, SwitchCardProps>(function SwitchCard({\n\t'aria-describedby': ariaDescribedBy,\n\tlabel,\n\tdescription,\n\thint,\n\ticon: Icon,\n\tname,\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n\tdisabled = false,\n\tinvalid,\n\tclassName,\n}: SwitchCardProps, ref) {\n\tconst isControlled = value !== undefined;\n\tconst [internal, setInternal] = useState<boolean>(defaultValue ?? false);\n\tconst checked = isControlled ? value ?? false : internal;\n\tconst generatedId = useId();\n\tconst id = useMemo(() => name ?? generatedId, [name, generatedId]);\n\n\tconst hasDescription = typeof description === 'string' && description.trim() !== '';\n\tconst describedById = hasDescription ? `${id}-description` : undefined;\n\n\tconst handleToggle = useCallback(\n\t\t(newChecked: boolean) => {\n\t\t\tif (disabled) return;\n\t\t\tif (!isControlled) setInternal(newChecked);\n\t\t\tonValueChange?.(newChecked);\n\t\t},\n\t\t[disabled, isControlled, onValueChange],\n\t);\n\n\tconst handleCardClick = useCallback(\n\t\t(e: React.MouseEvent) => {\n\t\t\tif ((e.target as HTMLElement).closest('[role=\"switch\"]')) return;\n\t\t\thandleToggle(!checked);\n\t\t},\n\t\t[checked, handleToggle],\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\taria-invalid={invalid || undefined}\n\t\t\tonClick={handleCardClick}\n\t\t\tclassName={cn('switch-card--component', \n\t\t\t\t'group relative flex items-start gap-space-lg rounded-radius border bg-card p-surface transition-[background,border-color,box-shadow] duration-150',\n\t\t\t\t'border-border',\n\t\t\t\tchecked && 'border-primary bg-primary/[0.04]',\n\t\t\t\t'aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20',\n\t\t\t\t!disabled && 'cursor-pointer hover:border-foreground/20 hover:bg-muted/30',\n\t\t\t\tdisabled && 'cursor-not-allowed opacity-50',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{!!name && (\n\t\t\t\t<input\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={checked ? '1' : '0'}\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{!!Icon && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'mt-0.5 inline-flex size-9 shrink-0 items-center justify-center rounded-radius-md transition-colors',\n\t\t\t\t\t\tchecked\n\t\t\t\t\t\t\t? 'bg-primary/10 text-primary-accent'\n\t\t\t\t\t\t\t: 'bg-muted/50 text-muted-foreground group-hover:bg-muted group-hover:text-foreground',\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<Icon className=\"size-icon\" />\n\t\t\t\t</span>\n\t\t\t)}\n\n\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t\t<Label\n\t\t\t\t\thtmlFor={id}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'block font-semibold tracking-tight',\n\t\t\t\t\t\tdisabled ? 'cursor-not-allowed' : 'cursor-pointer',\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{label}\n\t\t\t\t</Label>\n\t\t\t\t{!!hasDescription && (\n\t\t\t\t\t<Text id={describedById} type=\"secondary\" className=\"leading-snug\">\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t\t{!!hint && (\n\t\t\t\t\t<Text size=\"xs\" type=\"discrete\" className=\"leading-snug\">\n\t\t\t\t\t\t{hint}\n\t\t\t\t\t</Text>\n\t\t\t\t)}\n\t\t\t\t</Stack>\n\n\t\t\t<div className=\"mt-1 flex shrink-0 items-center\">\n\t\t\t\t<Switch\n\t\t\t\t\tid={id}\n\t\t\t\t\tchecked={checked}\n\t\t\t\t\tonValueChange={handleToggle}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tinvalid={invalid}\n\t\t\t\t\taria-label={label}\n\t\t\t\t\taria-describedby={[ariaDescribedBy, describedById].filter(Boolean).join(' ') || undefined}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n});\n\nSwitchCard.displayName = 'SwitchCard';\n","/**\n * ToggleField — inline label-and-control row for switches and checkboxes.\n *\n * Pattern: a left-aligned descriptive label/description block with the\n * control sitting on the trailing edge. Use for settings rows (e.g. \"Email\n * notifications\" + switch) where a full SwitchCard is too heavy and a bare\n * `Switch` + `<label>` is too brittle. The whole row is clickable and\n * keyboard-accessible.\n *\n * Two control kinds: `'switch'` (default) and `'checkbox'`. Both honour\n * controlled `value` / `defaultValue` / `onValueChange`. Strings are passed via\n * standard React props rather than a `strings` object — there are no\n * defaults to override.\n */\nimport type { ReactNode } from 'react';\nimport { forwardRef, useCallback, useId, useState } from 'react';\n\nimport { Stack } from '../structure';\nimport { Label, Text } from '../../typography';\nimport { cn } from '../../../lib/utils';\n\nimport { Checkbox } from './checkbox';\nimport { Switch } from './switch';\n\nexport type ToggleFieldKind = 'switch' | 'checkbox';\n\nexport interface ToggleFieldProps {\n\t/** Additional supporting/error descriptions associated with the editable control. */\n\t'aria-describedby'?: string;\n\t/** Control label. */\n\tlabel: ReactNode;\n\t/** Supporting sentence under the label. */\n\tdescription?: ReactNode;\n\t/** Which control renders — a switch or a checkbox. */\n\tkind?: ToggleFieldKind;\n\t/** Whether the control is on. Controlled. */\n\tvalue?: boolean;\n\t/** Initial state for uncontrolled use. */\n\tdefaultValue?: boolean;\n\tonValueChange?: (checked: boolean) => void;\n\t/** Disables the control. */\n\tdisabled?: boolean;\n\t/** Applies the invalid styling. */\n\tinvalid?: boolean;\n\t/** Form field name, forwarded for native submits. */\n\tname?: string;\n\tclassName?: string;\n\t/** Place the control on the leading edge instead of trailing (default). */\n\tcontrolPosition?: 'leading' | 'trailing';\n}\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\nexport const ToggleField = forwardRef<HTMLDivElement, ToggleFieldProps>(function ToggleField({\n\t'aria-describedby': ariaDescribedBy,\n\tlabel,\n\tdescription,\n\tkind = 'switch',\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n\tdisabled = false,\n\tinvalid = false,\n\tname,\n\tclassName,\n\tcontrolPosition = 'trailing',\n}: ToggleFieldProps, ref) {\n\tconst isControlled = value !== undefined;\n\tconst [internal, setInternal] = useState<boolean>(defaultValue ?? false);\n\tconst checked = isControlled ? value ?? false : internal;\n\tconst inputId = useId();\n\tconst labelId = `${inputId}-label`;\n\tconst hasDescription = description !== null && description !== undefined && description !== false;\n\tconst descriptionId = hasDescription ? `${inputId}-description` : undefined;\n\n\tconst set = useCallback(\n\t\t(next: boolean) => {\n\t\t\tif (disabled) return;\n\t\t\tif (!isControlled) setInternal(next);\n\t\t\tonValueChange?.(next);\n\t\t},\n\t\t[disabled, isControlled, onValueChange],\n\t);\n\n\tconst onRowClick = (e: React.MouseEvent) => {\n\t\t// Avoid double-toggle when clicking the control itself.\n\t\tconst target = e.target as HTMLElement;\n\t\tif (target.closest('[role=\"switch\"], [role=\"checkbox\"], input[type=\"checkbox\"]')) return;\n\t\tset(!checked);\n\t};\n\n\tconst Control =\n\t\tkind === 'switch' ? (\n\t\t\t<Switch\n\t\t\t\t// The row already expands the hit area; a horizontal switch hit\n\t\t\t\t// extension would overflow when this field sits at a surface edge.\n\t\t\t\tclassName=\"after:inset-x-0\"\n\t\t\t\tid={inputId}\n\t\t\t\tname={name}\n\t\t\t\tchecked={checked}\n\t\t\t\tonValueChange={set}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tinvalid={invalid}\n\t\t\t\taria-labelledby={labelId}\n\t\t\t\taria-describedby={[ariaDescribedBy, descriptionId].filter(Boolean).join(' ') || undefined}\n\t\t\t/>\n\t\t) : (\n\t\t\t<Checkbox\n\t\t\t\tid={inputId}\n\t\t\t\tname={name}\n\t\t\t\tchecked={checked}\n\t\t\t\tonCheckedChange={(v) => set(v === true)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\taria-invalid={invalid || undefined}\n\t\t\t\taria-labelledby={labelId}\n\t\t\t\taria-describedby={[ariaDescribedBy, descriptionId].filter(Boolean).join(' ') || undefined}\n\t\t\t/>\n\t\t);\n\n\tconst TextBlock = (\n\t\t<Stack gap=\"dense\" className=\"min-w-0 flex-1\">\n\t\t\t<div id={labelId}>\n\t\t\t\t{isSimpleText(label) ? (\n\t\t\t\t\t<Label\n\t\t\t\t\t\thtmlFor={inputId}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t// Leading is left to `Label` so this sits on the same\n\t\t\t\t\t\t\t// baseline rhythm as the switch, checkbox, and switch-card\n\t\t\t\t\t\t\t// labels; `leading-snug` here made it the only inline\n\t\t\t\t\t\t\t// control label in the package at 19.25px.\n\t\t\t\t\t\t\t'block',\n\t\t\t\t\t\t\tdisabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</Label>\n\t\t\t\t) : label}\n\t\t\t</div>\n\t\t\t{hasDescription && (\n\t\t\t\t<div id={descriptionId}>\n\t\t\t\t\t{isSimpleText(description) ? (\n\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\" className=\"leading-snug\">\n\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t) : description}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Stack>\n\t);\n\n\treturn (\n\t\t<Stack\n\t\t\tref={ref}\n\t\t\tdirection=\"horizontal\"\n\t\t\talign=\"start\"\n\t\t\twrap={false}\n\t\t\tgap=\"md\"\n\t\t\trole=\"group\"\n\t\t\tonClick={onRowClick}\n\t\t\tclassName={cn('toggle-field--component rounded-radius py-row-y',\n\t\t\t\tdisabled && 'pointer-events-none',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{controlPosition === 'leading' && <div className=\"mt-0.5 flex shrink-0\">{Control}</div>}\n\t\t\t{TextBlock}\n\t\t\t{controlPosition === 'trailing' && <div className=\"mt-0.5 flex shrink-0\">{Control}</div>}\n\t\t</Stack>\n\t);\n});\n\nToggleField.displayName = 'ToggleField';\n","/**\n * Shared types for choice-style form fields (CardRadio, CardCheckbox,\n * ListRadio, PillRadio). Each variant exports its own `Option` type that\n * extends `ChoiceOptionBase`, so consumers see one consistent option shape\n * across the family.\n *\n * Sizes follow the package component scale (`sm | md | lg`). CardRadio and\n * CardCheckbox additionally accept `size` to drive padding, icon size, and type\n * scale through shared form/display variables.\n */\nimport type { ComponentType, ReactNode } from 'react';\nimport type { ComponentScale } from '../../../lib/ui-provider';\n\nexport type ChoiceSize = ComponentScale;\n\nexport interface ChoiceOptionBase<TValue extends string = string> {\n\tvalue: TValue;\n\tlabel: ReactNode;\n\tdescription?: ReactNode;\n\ticon?: ComponentType<{ className?: string }>;\n\tdisabled?: boolean;\n}\n\nexport interface ChoiceGroupBaseProps {\n\t/** Supporting/error descriptions associated with the group. */\n\t'aria-describedby'?: string;\n\t/** Form field name (also used for hidden inputs and aria grouping). */\n\tname?: string;\n\t/** Disable the entire group. */\n\tdisabled?: boolean;\n\t/** Show error styling. */\n\tinvalid?: boolean;\n\t/** Density / control size. Defaults from `useDensityConfig().defaultScale`. */\n\tsize?: ChoiceSize;\n\tclassName?: string;\n}\n\n/**\n * Padding / icon-size token map shared across CardRadio + CardCheckbox so the\n * two variants line up visually when placed side-by-side.\n */\nexport const choiceCardSizeTokens: Record<\n\tChoiceSize,\n\t{ padding: string; iconBox: string; iconSize: string; gap: string }\n> = {\n\tsm: { padding: 'p-surface-xs', iconBox: 'size-avatar-sm', iconSize: 'size-icon-sm', gap: 'gap-space-sm' },\n\tmd: { padding: 'p-surface', iconBox: 'size-avatar', iconSize: 'size-icon', gap: 'gap-space-md' },\n\tlg: { padding: 'p-surface-lg', iconBox: 'size-avatar-lg', iconSize: 'size-icon-lg', gap: 'gap-space-lg' },\n};\n\n/**\n * Pill height / horizontal padding tokens. Shared across PillRadioGroup\n * and any future toggle-bar variant so they stack cleanly.\n */\nexport const choicePillSizeTokens: Record<ChoiceSize, string> = {\n\tsm: 'h-control-sm px-control-sm text-pxs',\n\tmd: 'h-control px-control text-sm',\n\tlg: 'h-control-lg px-control text-sm',\n};\n\n/**\n * Row padding tokens for ListRadio and any future inline list variant.\n */\nexport const choiceListSizeTokens: Record<ChoiceSize, string> = {\n\tsm: 'px-row-x py-row-y-sm',\n\tmd: 'px-row-x py-row-y',\n\tlg: 'px-row-x py-row-y-lg',\n};\n\n/** Shared selected-card marker and content clearance; derives from action/icon geometry. */\nexport const choiceCardMarkerClasses = 'absolute top-space-sm end-space-sm size-action-sm text-primary-foreground fill-primary stroke-primary-foreground';\nexport const choiceCardMarkerClearance = '[&>*:not(svg)]:max-w-[calc(100%_-_var(--spacing-action-sm))]';\n","/**\n * CardCheckboxGroup — multi-select group rendered as a grid of card-shaped\n * options with title, optional description, and optional leading icon.\n * Use for a small set of feature flags / preferences where each option\n * benefits from extra context that a flat checkbox list can't carry.\n *\n * Pairs with `CardRadioGroup` (single-select). Both share spacing tokens\n * from `./choice-types` so they line up when used side-by-side.\n */\nimport { CircleCheck, type LucideIcon } from 'lucide-react';\nimport { forwardRef, useState, useCallback, useMemo, type ReactNode } from 'react';\nimport { Text } from '../../typography';\nimport { Stack } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport { useDensityConfig } from '../../../lib/ui-provider';\nimport { resolveFormControlSize } from '../forms/form-sizing';\nimport {\n\tchoiceCardSizeTokens,\n\tchoiceCardMarkerClasses,\n\tchoiceCardMarkerClearance,\n\ttype ChoiceGroupBaseProps,\n\ttype ChoiceOptionBase,\n} from './choice-types';\n\nexport interface CardCheckboxOption extends ChoiceOptionBase {\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n}\n\nexport interface CardCheckboxGroupProps extends ChoiceGroupBaseProps {\n\t/** Choices offered. */\n\toptions: CardCheckboxOption[];\n\t/** Current value. Controlled. */\n\tvalue?: string[];\n\t/** Initial value for uncontrolled use. */\n\tdefaultValue?: string[];\n\tonValueChange?: (values: string[]) => void;\n\t/** How many columns the grid uses. */\n\tcolumns?: 1 | 2 | 3 | 4;\n}\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n/*\n * Container widths, not viewport widths — a choice-card group is as likely to\n * sit in a settings rail or a drawer as at page width, and keyed to the screen\n * it laid three cards across a 300px column.\n *\n * 384/576/672 puts every tier clear of the widths this actually renders at: the\n * shipped three-up group is 672px wide, so the three-column step sits 96px\n * below it rather than exactly on it, and 384 keeps the two-column step above\n * every mobile mount (316px).\n */\nconst GRID_COLS: Record<NonNullable<CardCheckboxGroupProps['columns']>, string> = {\n\t1: 'grid grid-cols-1 gap-space-md',\n\t2: 'grid grid-cols-1 gap-space-md @sm/card-checkbox-group:grid-cols-2',\n\t3: 'grid grid-cols-1 gap-space-md @sm/card-checkbox-group:grid-cols-2 @xl/card-checkbox-group:grid-cols-3',\n\t4: 'grid grid-cols-1 gap-space-md @sm/card-checkbox-group:grid-cols-2 @2xl/card-checkbox-group:grid-cols-4',\n};\n\nexport const CardCheckboxGroup = forwardRef<HTMLDivElement, CardCheckboxGroupProps>(function CardCheckboxGroup({\n\t'aria-describedby': ariaDescribedBy,\n\toptions,\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n\tname,\n\tcolumns = 3,\n\tinvalid,\n\tdisabled,\n\tsize: sizeProp,\n\tclassName,\n}: CardCheckboxGroupProps, ref) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveFormControlSize(sizeProp, defaultScale);\n\n\tconst isControlled = value !== undefined;\n\tconst [internal, setInternal] = useState<string[]>(defaultValue ?? []);\n\tconst selected = useMemo(\n\t\t() => (isControlled ? value ?? [] : internal),\n\t\t[internal, isControlled, value],\n\t);\n\tconst tokens = choiceCardSizeTokens[size];\n\n\tconst toggle = useCallback(\n\t\t(val: string) => {\n\t\t\tif (disabled) return;\n\t\t\tif (options.find((o) => o.value === val)?.disabled) return;\n\t\t\tconst exists = selected.includes(val);\n\t\t\tconst next = exists ? selected.filter((v) => v !== val) : [...selected, val];\n\t\t\tif (!isControlled) setInternal(next);\n\t\t\tonValueChange?.(next);\n\t\t},\n\t\t[disabled, options, selected, isControlled, onValueChange],\n\t);\n\n\treturn (\n\t\t/*\n\t\t * The root exists to be the query container: an element cannot match its\n\t\t * own container query, so the grid whose columns react sits inside the\n\t\t * element being measured.\n\t\t */\n\t\t<div ref={ref} className={cn('card-checkbox-group--component @container/card-checkbox-group', className)}>\n\t\t\t<div\n\t\t\t\tclassName={cn('card-checkbox-group--grid', GRID_COLS[columns])}\n\t\t\t\trole=\"group\"\n\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\taria-invalid={invalid || undefined}\n\t\t\t\taria-disabled={disabled || undefined}\n\t\t\t>\n\t\t\t\t{options.map((option) => {\n\t\t\t\t\tconst Icon = option.icon;\n\t\t\t\t\tconst optionLabel = option.label;\n\t\t\t\t\tconst isSelected = selected.includes(option.value);\n\t\t\t\t\tconst isDisabled = disabled || option.disabled;\n\t\t\t\t\tconst shouldIncludeHidden = Boolean(name) && isSelected;\n\t\t\t\t\tconst nameAttr = name ? `${name}[]` : undefined;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div key={option.value} className=\"relative\">\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\t\t\t\tname={nameAttr}\n\t\t\t\t\t\t\t\tvalue={option.value}\n\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\thidden\n\t\t\t\t\t\t\t\tdisabled={!shouldIncludeHidden}\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\taria-pressed={isSelected}\n\t\t\t\t\t\t\t\taria-invalid={invalid || undefined}\n\t\t\t\t\t\t\t\tonClick={() => toggle(option.value)}\n\t\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\t\tdata-selected={isSelected}\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t'box-border group relative flex w-full flex-col items-start text-start outline-none cursor-pointer',\n\t\t\t\t\t\t\t\t\t'rounded-radius border bg-card transition-[color,box-shadow,background,border-color] duration-150',\n\t\t\t\t\t\t\t\t\t'border-border hover:border-foreground/20 hover:bg-muted/30',\n\t\t\t\t\t\t\t\t\t'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n\t\t\t\t\t\t\t\t\t'data-[selected=true]:border-primary data-[selected=true]:bg-primary/[0.04]',\n\t\t\t\t\t\t\t\t\ttokens.padding,\n\t\t\t\t\t\t\t\t\ttokens.gap,\n\t\t\t\t\t\t\t\tchoiceCardMarkerClearance,\n\t\t\t\t\t\t\t\t\t'aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20',\n\t\t\t\t\t\t\t\t\t'disabled:cursor-not-allowed disabled:opacity-50',\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<CircleCheck\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\tchoiceCardMarkerClasses,\n\t\t\t\t\t\t\t\t\t\t!isSelected && 'hidden',\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t\t{!!Icon && (\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t'inline-flex items-center justify-center rounded-radius-md bg-muted/50 text-muted-foreground group-hover:bg-muted',\n\t\t\t\t\t\t\t\t\t\t\t'group-data-[selected=true]:bg-primary/10 group-data-[selected=true]:text-primary-accent',\n\t\t\t\t\t\t\t\t\t\t\ttokens.iconBox,\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Icon className={tokens.iconSize} />\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0\">\n\t\t\t\t\t\t\t\t\t{isSimpleText(optionLabel) ? (\n\t\t\t\t\t\t\t\t\t\t<Text tag=\"span\" weight=\"medium\">\n\t\t\t\t\t\t\t\t\t\t\t{optionLabel}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t) : optionLabel}\n\t\t\t\t\t\t\t\t\t{!!option.description && (\n\t\t\t\t\t\t\t\t\t\tisSimpleText(option.description) ? (\n\t\t\t\t\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t\t\t\t\t{option.description}\n\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t) : option.description\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t</div>\n\t);\n});\n\nCardCheckboxGroup.displayName = 'CardCheckboxGroup';\n","/**\n * CardRadioGroup — single-select radio group rendered as a grid of card-shaped\n * options with title, optional description, and optional leading icon. Built\n * on `@base-ui/react/radio` for accessibility (keyboard navigation, focus\n * management, native form participation).\n *\n * Pairs with `CardCheckboxGroup` (multi-select). Shares spacing tokens from\n * `./choice-types`.\n */\nimport { Radio as RadioPrimitive } from '@base-ui/react/radio';\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';\nimport { CircleCheck, type LucideIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { memo, useMemo, type ReactNode } from 'react';\nimport { Text } from '../../typography';\nimport { Stack } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport { useDensityConfig } from '../../../lib/ui-provider';\nimport { resolveFormControlSize } from '../forms/form-sizing';\nimport {\n\tchoiceCardSizeTokens,\n\tchoiceCardMarkerClasses,\n\tchoiceCardMarkerClearance,\n\ttype ChoiceGroupBaseProps,\n\ttype ChoiceOptionBase,\n} from './choice-types';\n\nexport interface CardRadioOption extends ChoiceOptionBase {\n\t/** Leading glyph. */\n\ticon?: LucideIcon;\n}\n\nexport interface CardRadioGroupProps extends ChoiceGroupBaseProps {\n\t/** Choices offered. */\n\toptions: CardRadioOption[];\n\t/** Current value. Controlled. */\n\tvalue?: string;\n\t/** Initial value for uncontrolled use. */\n\tdefaultValue?: string;\n\tonValueChange?: (value: string) => void;\n\t/** How many columns the grid uses. */\n\tcolumns?: 1 | 2 | 3 | 4;\n}\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\n/*\n * Container widths, not viewport widths — a choice-card group is as likely to\n * sit in a settings rail or a drawer as at page width, and keyed to the screen\n * it laid three cards across a 300px column.\n *\n * 384/576/672 puts every tier clear of the widths this actually renders at: the\n * shipped three-up group is 672px wide, so the three-column step sits 96px\n * below it rather than exactly on it, and 384 keeps the two-column step above\n * every mobile mount (316px).\n */\nconst GRID_COLS: Record<NonNullable<CardRadioGroupProps['columns']>, string> = {\n\t1: 'grid grid-cols-1 gap-space-md',\n\t2: 'grid grid-cols-1 gap-space-md @sm/card-radio-group:grid-cols-2',\n\t3: 'grid grid-cols-1 gap-space-md @sm/card-radio-group:grid-cols-2 @xl/card-radio-group:grid-cols-3',\n\t4: 'grid grid-cols-1 gap-space-md @sm/card-radio-group:grid-cols-2 @2xl/card-radio-group:grid-cols-4',\n};\n\nfunction CardRadioGroupImpl({\n\t'aria-describedby': ariaDescribedBy,\n\toptions,\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n\tname,\n\tcolumns = 3,\n\tinvalid,\n\tdisabled,\n\tsize: sizeProp,\n\tclassName,\n}: CardRadioGroupProps, ref: React.ForwardedRef<HTMLDivElement>) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveFormControlSize(sizeProp, defaultScale);\n\n\tconst tokens = choiceCardSizeTokens[size];\n\tconst gridClassName = useMemo(() => cn('card-radio-group--grid', GRID_COLS[columns]), [columns]);\n\n\treturn (\n\t\t/*\n\t\t * The root exists to be the query container: an element cannot match its\n\t\t * own container query, so the grid whose columns react sits inside the\n\t\t * element being measured.\n\t\t */\n\t\t<div ref={ref} className={cn('card-radio-group--component @container/card-radio-group', className)}>\n\t\t\t<RadioGroupPrimitive\n\t\t\t\tvalue={value}\n\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\tonValueChange={(val) => val && onValueChange?.(val)}\n\t\t\t\tname={name}\n\t\t\t\tdisabled={disabled}\n\t\t\t\taria-describedby={ariaDescribedBy}\n\t\t\t\taria-invalid={invalid || undefined}\n\t\t\t\tclassName={gridClassName}\n\t\t\t>\n\t\t\t\t{options.map((option) => {\n\t\t\t\t\tconst Icon = option.icon;\n\t\t\t\t\tconst optionLabel = option.label;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<RadioPrimitive.Root\n\t\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\t\tvalue={option.value}\n\t\t\t\t\t\t\tdisabled={disabled || option.disabled}\n\t\t\t\t\t\t\taria-invalid={invalid || undefined}\n\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t'box-border relative group flex flex-col text-start outline-none cursor-pointer',\n\t\t\t\t\t\t\t\t'rounded-radius border bg-card transition-[color,box-shadow,background,border-color] duration-150',\n\t\t\t\t\t\t\t\t'border-border hover:border-foreground/20 hover:bg-muted/30',\n\t\t\t\t\t\t\t\t'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n\t\t\t\t\t\t\t\t'data-[checked]:border-primary data-[checked]:bg-primary/[0.04]',\n\t\t\t\t\t\t\t\ttokens.padding,\n\t\t\t\t\t\t\t\ttokens.gap,\n\t\t\t\t\t\t\t\tchoiceCardMarkerClearance,\n\t\t\t\t\t\t\t\t'aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20',\n\t\t\t\t\t\t\t\t'disabled:cursor-not-allowed disabled:opacity-50',\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RadioPrimitive.Indicator\n\t\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t\t<CircleCheck className={choiceCardMarkerClasses} />\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t{!!Icon && (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t'inline-flex items-center justify-center rounded-radius-md bg-muted/50 text-muted-foreground group-hover:bg-muted',\n\t\t\t\t\t\t\t\t\t\t'group-data-[checked]:bg-primary/10 group-data-[checked]:text-primary-accent',\n\t\t\t\t\t\t\t\t\t\ttokens.iconBox,\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Icon className={tokens.iconSize} />\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Stack gap=\"dense\" className=\"min-w-0\">\n\t\t\t\t\t\t\t\t{isSimpleText(optionLabel) ? (\n\t\t\t\t\t\t\t\t\t<Text tag=\"span\" weight=\"semibold\">\n\t\t\t\t\t\t\t\t\t\t{optionLabel}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t) : optionLabel}\n\t\t\t\t\t\t\t\t{!!option.description && (\n\t\t\t\t\t\t\t\t\tisSimpleText(option.description) ? (\n\t\t\t\t\t\t\t\t\t\t<Text size=\"xs\" type=\"secondary\">\n\t\t\t\t\t\t\t\t\t\t\t{option.description}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t) : option.description\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t</RadioPrimitive.Root>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</RadioGroupPrimitive>\n\t\t</div>\n\t);\n}\n\nexport const CardRadioGroup = memo(React.forwardRef<HTMLDivElement, CardRadioGroupProps>(CardRadioGroupImpl));\nCardRadioGroup.displayName = 'CardRadioGroup';\n","/**\n * ListRadioGroup — single-select radio group rendered as a vertical list with\n * dividers between rows. Use when options have descriptive secondary text and\n * read better as a stack than a grid (e.g. plan tiers, role definitions).\n *\n * Pairs with `CardRadioGroup` for grid-style choices and `PillRadioGroup` for\n * inline compact toggles.\n */\nimport { Radio as RadioPrimitive } from '@base-ui/react/radio';\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';\nimport { Circle } from 'lucide-react';\nimport { forwardRef } from 'react';\nimport { Text } from '../../typography';\nimport { Stack } from '../structure';\nimport { cn } from '../../../lib/utils';\nimport { useDensityConfig } from '../../../lib/ui-provider';\nimport { resolveFormControlSize } from '../forms/form-sizing';\nimport {\n\tchoiceListSizeTokens,\n\ttype ChoiceGroupBaseProps,\n\ttype ChoiceOptionBase,\n} from './choice-types';\n\nexport interface ListRadioOption extends ChoiceOptionBase {}\n\nexport interface ListRadioGroupProps extends ChoiceGroupBaseProps {\n\t/** Choices offered. */\n\toptions: ListRadioOption[];\n\t/** Current value. Controlled. */\n\tvalue?: string;\n\t/** Initial value for uncontrolled use. */\n\tdefaultValue?: string;\n\tonValueChange?: (value: string) => void;\n}\n\nfunction isSimpleText(value: React.ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\nexport const ListRadioGroup = forwardRef<HTMLDivElement, ListRadioGroupProps>(function ListRadioGroup({\n\toptions,\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n\tname,\n\tinvalid,\n\tdisabled,\n\tsize: sizeProp,\n\tclassName,\n}: ListRadioGroupProps, ref) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveFormControlSize(sizeProp, defaultScale);\n\n\tconst rowPadding = choiceListSizeTokens[size];\n\treturn (\n\t\t<RadioGroupPrimitive\n\t\t\tref={ref}\n\t\t\tvalue={value}\n\t\t\tdefaultValue={defaultValue}\n\t\t\tonValueChange={(val) => val && onValueChange?.(val)}\n\t\t\tname={name}\n\t\t\tdisabled={disabled}\n\t\t\taria-invalid={invalid || undefined}\n\t\t\tclassName={cn('list-radio-group--component', \n\t\t\t\t'overflow-hidden rounded-radius border border-border [&>[role=radio]~[role=radio]]:border-t [&>[role=radio]~[role=radio]]:border-border',\n\t\t\t\t'aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20',\n\t\t\t\tdisabled && 'pointer-events-none opacity-50',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{options.map((option) => (\n\t\t\t\t<RadioPrimitive.Root\n\t\t\t\t\tkey={option.value}\n\t\t\t\t\tvalue={option.value}\n\t\t\t\t\tdisabled={disabled || option.disabled}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t'box-border group flex w-full items-start gap-space-lg text-start outline-none cursor-pointer',\n\t\t\t\t\t\t'transition-colors hover:bg-muted/40 focus-visible:bg-muted/40',\n\t\t\t\t\t\t'data-[checked]:bg-primary/10',\n\t\t\t\t\t\t'disabled:cursor-not-allowed disabled:opacity-50',\n\t\t\t\t\t\trowPadding,\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary-accent group-data-[checked]:border-primary-accent group-not-data-[checked]:border-muted-foreground/50\">\n\t\t\t\t\t\t<RadioPrimitive.Indicator\n\t\t\t\t\t\t\trender={<Circle className=\"h-2.5 w-2.5 fill-primary-accent text-primary-accent\" />}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Stack gap=\"dense\" className=\"flex-1 min-w-0\">\n\t\t\t\t\t\t{isSimpleText(option.label) ? (\n\t\t\t\t\t\t\t<Text tag=\"span\" weight=\"medium\" lineHeight=\"tight\" className=\"block\">\n\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) : option.label}\n\t\t\t\t\t\t{!!option.description && (\n\t\t\t\t\t\t\tisSimpleText(option.description) ? (\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"block\">\n\t\t\t\t\t\t\t\t\t{option.description}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) : option.description\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Stack>\n\t\t\t\t</RadioPrimitive.Root>\n\t\t\t))}\n\t\t</RadioGroupPrimitive>\n\t);\n});\n\nListRadioGroup.displayName = 'ListRadioGroup';\n","/**\n * PillRadioGroup — compact, inline single-select rendered as connected pill\n * buttons. Best for 2–4 options where a full `<Select>` is too heavy and\n * cards are too tall (e.g. timeframe toggles, view-mode switchers).\n *\n * Custom-styled buttons rather than the shadcn ToggleGroup primitive: the\n * primitive strips inner rounding when spacing=0, which doesn't match this\n * design system's pill connector style.\n */\nimport * as React from 'react';\n\nimport { Text } from '../../typography';\nimport { cn } from '../../../lib/utils';\nimport { useDensityConfig } from '../../../lib/ui-provider';\nimport { formControlSizeClasses, resolveFormControlSize } from '../forms/form-sizing';\nimport {\n\tchoicePillSizeTokens,\n\ttype ChoiceGroupBaseProps,\n\ttype ChoiceOptionBase,\n} from './choice-types';\n\nexport interface PillRadioGroupOption extends ChoiceOptionBase {}\n\nexport interface PillRadioGroupProps\n\textends Omit<ChoiceGroupBaseProps, 'name'> {\n\t/** Form field name, forwarded for native submits. */\n\tname: string;\n\t/** Current value. Controlled. */\n\tvalue: string | null | undefined;\n\t/** Choices offered. */\n\toptions: PillRadioGroupOption[];\n\tonValueChange: (value: string | null) => void;\n\t/** Allow deselecting (click active pill to clear). Default false. */\n\tallowClear?: boolean;\n\t/** Stretch pills to fill the container. */\n\tfullWidth?: boolean;\n}\n\nexport const PillRadioGroup = React.forwardRef<HTMLDivElement, PillRadioGroupProps>(function PillRadioGroup({\n\tname,\n\tvalue,\n\toptions,\n\tonValueChange,\n\tallowClear = false,\n\tsize: sizeProp,\n\tfullWidth = false,\n\tdisabled = false,\n\tinvalid = false,\n\tclassName,\n}: PillRadioGroupProps, ref) {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveFormControlSize(sizeProp, defaultScale);\n\n\tconst handleClick = React.useCallback(\n\t\t(optionValue: string) => {\n\t\t\tif (optionValue === value) {\n\t\t\t\tif (allowClear) onValueChange(null);\n\t\t\t} else {\n\t\t\t\tonValueChange(optionValue);\n\t\t\t}\n\t\t},\n\t\t[allowClear, onValueChange, value],\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tdata-name={name}\n\t\t\trole=\"radiogroup\"\n\t\t\taria-invalid={invalid || undefined}\n\t\t\tclassName={cn('pill-radio-group--component', \n\t\t\t\t'border-input inline-flex items-center overflow-hidden rounded-inner border',\n\t\t\t\tformControlSizeClasses[size],\n\t\t\t\tfullWidth ? 'w-full' : 'w-fit self-start',\n\t\t\t\t'aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20',\n\t\t\t\tdisabled && 'pointer-events-none opacity-50',\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t{options.map((option, index) => {\n\t\t\t\tconst isSelected = option.value === value;\n\t\t\t\tconst Icon = option.icon;\n\t\t\t\tconst optionLabel =\n\t\t\t\t\ttypeof option.label === 'string' ? option.label : undefined;\n\t\t\t\treturn (\n\t\t\t\t\t<button\n\t\t\t\t\t\tkey={option.value}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\trole=\"radio\"\n\t\t\t\t\t\taria-checked={isSelected}\n\t\t\t\t\t\taria-label={optionLabel || option.value}\n\t\t\t\t\t\tdisabled={disabled || option.disabled}\n\t\t\t\t\t\tonClick={() => handleClick(option.value)}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t'box-border inline-flex select-none items-center justify-center border-0 p-0 font-sans font-medium transition-colors',\n\t\t\t\t\t\t\t'focus-visible:ring-ring outline-none focus-visible:z-10 focus-visible:ring-2',\n\t\t\t\t\t\t\t'disabled:pointer-events-none disabled:opacity-50',\n\t\t\t\t\t\t\tchoicePillSizeTokens[size],\n\t\t\t\t\t\t\t'h-full min-h-0',\n\t\t\t\t\t\t\tfullWidth && 'flex-1',\n\t\t\t\t\t\t\tindex > 0 && 'border-input border-l',\n\t\t\t\t\t\t\tisSelected\n\t\t\t\t\t\t\t\t? 'bg-primary text-primary-foreground'\n\t\t\t\t\t\t\t\t: 'bg-background text-foreground hover:bg-muted',\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{!!Icon && <Icon className={cn(size === 'sm' ? 'size-icon-sm' : 'size-icon', option.label && 'mr-space-sm')} />}\n\t\t\t\t\t\t{typeof option.label === 'string' || typeof option.label === 'number' || typeof option.label === 'bigint' ? (\n\t\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) : option.label}\n\t\t\t\t\t</button>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n});\n\nPillRadioGroup.displayName = 'PillRadioGroup';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AASA,IAAMA,KAASC,EAAgB;AAE/B,SAASmD,GAAY,EAAE,cAAW,GAAGC,KAAsC;CACzE,OACE,kBAACpD,EAAgB,OAAjB;EACE,aAAU;EACV,WAAW+B,EAAG,mBAAmBsB,CAAS;EAC1C,GAAID;CACL,CAAA;AAEL;AAEA,SAASE,GAAY,EAAE,cAAW,GAAGF,KAAsC;CACzE,OACE,kBAACpD,EAAgB,OAAjB;EACE,aAAU;EACV,WAAW+B,EAAG,0BAA0BsB,CAAS;EACjD,GAAID;CACL,CAAA;AAEL;AAEA,SAASG,EAAc,EACrB,cACA,UAAO,WACP,aACA,GAAGH,K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Combobox","ComboboxPrimitive","ComboboxInput","ComboboxTrigger","ComboboxPopup","ComboboxItem","ComboboxSeparator","Popup","Input","Trigger","Item","Separator","useTypographyConfig","useThemePortalContainer","cn","textSizes","anchoredPositionMethod","motionRecipes","surfaceInsetClasses","collectionRowClasses","popoverRecipes","collectionRecipes","CollectionLabel","modalBackdropRecipe","fieldStateRecipes","fieldAffordanceRecipes","editableTextSizeClasses","Combobox$1","Combobox","ComboboxInput$1","props","className","ComboboxTrigger$1","children","ChevronDownIcon","ComboboxValue","placeholder","ComboboxClear","XIcon","inputSizeClasses","inputSizeWithClearClasses","iconContainerSizeClasses","ComboboxInputTrigger","size","showClear","error","ComboboxPortal","resolvedContainer","container","ComboboxPositioner","ComboboxPopup$1","ComboboxList","itemIndicatorSizeClasses","ComboboxItem$1","CheckIcon","ComboboxItemIndicator","ComboboxEmpty","ComboboxStatus","ComboboxGroup","ComboboxGroupLabel","ComboboxCollection","ComboboxSeparator$1","chipsSizeClasses","ComboboxChips","ComboboxChip","ComboboxChipsInput","ComboboxBackdrop","ComboboxArrow","useComboboxFilter","ComboboxPopup","createElement","ComboboxInput","ComboboxTrigger","densityBySize","ComboboxItem","content","density","defaultTextSize","ComboboxSeparator"],"sources":["../src/components/ui/combobox.tsx","../src/components/base/combobox/index.ts"],"sourcesContent":["import { anchoredPositionMethod } from '../../lib/anchored-positioning';\nimport { fieldStateRecipes } from '../../lib/field-state-recipes';\nimport { fieldAffordanceRecipes } from '../../lib/field-affordance-recipes';\nimport { editableTextSizeClasses } from '../../lib/editable-text-recipe';\nimport { motionRecipes } from '../../lib/motion-recipes';\nimport { modalBackdropRecipe } from './overlay.recipes';\nimport { useThemePortalContainer } from '../../lib/theme-scope';\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox';\nimport { CheckIcon, ChevronDownIcon, XIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { cn } from '../../lib/utils';\n\nconst Combobox = ComboboxPrimitive.Root;\n\nfunction ComboboxInput({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Input.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Input\n\t\t\tdata-slot=\"combobox-input\"\n\t\t\tclassName={cn(\n\t\t\t\t'font-sans text-foreground',\n\t\t\t\t'box-border border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-control w-full min-w-0 rounded-inner border bg-background px-control py-space-xs shadow-none transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n\t\t\t\teditableTextSizeClasses.md,\n\t\t\t\tfieldStateRecipes.focus,\n\t\t\t\tfieldStateRecipes.invalid,\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction ComboboxTrigger({\n\tclassName,\n\tchildren,\n\t...props\n}: ComboboxPrimitive.Trigger.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Trigger\n\t\t\tdata-slot=\"combobox-trigger\"\n\t\t\tclassName={cn(\n\t\t\t\t'font-sans text-foreground',\n\t\t\t\t'box-border border-input file:text-foreground placeholder:text-muted-foreground flex h-control w-full items-center justify-between rounded-inner border bg-background px-control py-space-xs shadow-none transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n\t\t\t\t'text-sm',\n\t\t\t\tfieldStateRecipes.focus,\n\t\t\t\tfieldStateRecipes.invalid,\n\t\t\t\t'[&>span]:line-clamp-1',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<ComboboxPrimitive.Icon className=\"flex\">\n\t\t\t\t<ChevronDownIcon className=\"size-icon text-muted-foreground\" />\n\t\t\t</ComboboxPrimitive.Icon>\n\t\t</ComboboxPrimitive.Trigger>\n\t);\n}\n\nfunction ComboboxValue({\n\tplaceholder,\n\t...props\n}: ComboboxPrimitive.Value.Props & { placeholder?: React.ReactNode }) {\n\treturn (\n\t\t<ComboboxPrimitive.Value\n\t\t\tdata-slot=\"combobox-value\"\n\t\t\tplaceholder={\n\t\t\t\t!!placeholder && <span className=\"text-muted-foreground\">{placeholder}</span>\n\t\t\t}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction ComboboxClear({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Clear.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Clear\n\t\t\tdata-slot=\"combobox-clear\"\n\t\t\tclassName={cn(\n\t\t\t\tfieldAffordanceRecipes.target,\n\t\t\t\tfieldAffordanceRecipes.focus,\n\t\t\t\tfieldAffordanceRecipes.clear,\n\t\t\t\tfieldAffordanceRecipes.centered,\n\t\t\t\t'end-control-icon',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t\t<XIcon className={fieldAffordanceRecipes.icon} />\n\t\t</ComboboxPrimitive.Clear>\n\t);\n}\n\nexport type ComboboxSize = 'sm' | 'md' | 'lg';\n\nconst inputSizeClasses: Record<ComboboxSize, string> = {\n\tsm: 'h-control-sm ps-control-sm',\n\tmd: 'h-control ps-control',\n\tlg: 'h-control-lg ps-control',\n};\n\nconst inputSizeWithClearClasses: Record<ComboboxSize, string> = {\n\tsm: 'pe-control-actions-sm',\n\tmd: 'pe-control-actions',\n\tlg: 'pe-control-actions',\n};\n\nconst iconContainerSizeClasses: Record<ComboboxSize, string> = {\n\tsm: 'end-space-xs',\n\tmd: 'end-space-xs',\n\tlg: 'end-space-xs',\n};\n\ntype ComboboxInputTriggerProps = Omit<ComboboxPrimitive.Input.Props, 'size'> & {\n\tshowClear?: boolean;\n\tsize?: ComboboxSize;\n\terror?: boolean;\n};\n\nfunction ComboboxInputTrigger({\n\tclassName,\n\tshowClear = false,\n\tsize = 'md',\n\terror,\n\t...props\n}: ComboboxInputTriggerProps) {\n\treturn (\n\t\t<div className=\"relative h-fit\">\n\t\t\t<ComboboxPrimitive.Input\n\t\t\t\tdata-slot=\"combobox-input\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'font-sans text-foreground',\n\t\t\t\t\t'box-border border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground w-full min-w-0 rounded-inner border bg-background shadow-none transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n\t\t\t\t\tfieldStateRecipes.focus,\n\t\t\t\t\tfieldStateRecipes.invalid,\n\t\t\t\t\tinputSizeClasses[size],\n\t\t\t\t\teditableTextSizeClasses[size],\n\t\t\t\t\tshowClear ? inputSizeWithClearClasses[size] : fieldAffordanceRecipes.togglePadding,\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\taria-invalid={error || undefined}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'absolute top-1/2 -translate-y-1/2 flex items-center gap-space-xs text-muted-foreground',\n\t\t\t\t\ticonContainerSizeClasses[size]\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{!!showClear && (\n <ComboboxPrimitive.Clear\n\t\t\t\t\t\tdata-slot=\"combobox-clear\"\n\t\t\t\t\t\tclassName={cn(fieldAffordanceRecipes.target,fieldAffordanceRecipes.focus,fieldAffordanceRecipes.clear)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<XIcon className={fieldAffordanceRecipes.icon} />\n\t\t\t\t\t</ComboboxPrimitive.Clear>\n )}\n\t\t\t\t<ComboboxPrimitive.Trigger className={cn(fieldAffordanceRecipes.target,fieldAffordanceRecipes.focus,fieldAffordanceRecipes.toggle)}>\n\t\t\t\t\t<ChevronDownIcon className={fieldAffordanceRecipes.icon} />\n\t\t\t\t</ComboboxPrimitive.Trigger>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n// Portal\nfunction ComboboxPortal({ container, ...props }: ComboboxPrimitive.Portal.Props) {\n\tconst resolvedContainer = useThemePortalContainer(container);\n\treturn <ComboboxPrimitive.Portal container={resolvedContainer} {...props} />;\n}\n\n// Positioner\nfunction ComboboxPositioner({\n\tclassName,\n\tpositionMethod = anchoredPositionMethod,\n\tsideOffset = 4,\n\t...props\n}: ComboboxPrimitive.Positioner.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Positioner\n\t\t\tpositionMethod={positionMethod}\n\t\t\tdata-slot=\"combobox-positioner\"\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cn('z-50 outline-none', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Popup (content)\nfunction ComboboxPopup({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Popup.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Popup\n\t\t\tdata-slot=\"combobox-popup\"\n\t\t\tclassName={cn(\n\t\t\t\t'w-[var(--anchor-width)] min-w-[8rem] max-w-[var(--available-width)] max-h-[min(var(--available-height),24rem)]',\n\t\t\t\t'overflow-hidden rounded-inner border border-border bg-popover text-popover-foreground shadow-md',\n\t\t\t\t'origin-[var(--transform-origin)]',\n\t\t\t\tmotionRecipes.popup,\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// List\nfunction ComboboxList({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.List.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.List\n\t\t\tdata-slot=\"combobox-list\"\n\t\t\tclassName={cn(\n\t\t\t\t'max-h-[min(24rem,var(--available-height))] overflow-y-auto overscroll-contain p-surface-xs',\n\t\t\t\t'outline-none empty:hidden',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Item\n//\n// Layout: `[content][indicator]` with the selection check pinned to the\n// right (`justify-between`). Consumers render leading icons naturally inside\n// `renderItem` — the `gap` between icon and label is set by the consumer.\nconst itemIndicatorSizeClasses: Record<ComboboxSize, string> = {\n\tsm: 'size-icon-sm',\n\tmd: 'size-icon',\n\tlg: 'size-icon-lg',\n};\n\nfunction ComboboxItem({\n\tclassName,\n\tchildren,\n\tsize = 'md',\n\t...props\n}: ComboboxPrimitive.Item.Props & { size?: ComboboxSize }) {\n\treturn (\n\t\t<ComboboxPrimitive.Item\n\t\t\tdata-slot=\"combobox-item\"\n\t\t\tclassName={cn(\n\t\t\t\t'flex w-full cursor-default select-none items-center justify-between outline-none',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className=\"flex min-w-0 flex-1 items-center gap-space-sm truncate\">\n\t\t\t\t{children}\n\t\t\t</span>\n\t\t\t<ComboboxPrimitive.ItemIndicator\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'flex shrink-0 items-center justify-center text-muted-foreground',\n\t\t\t\t\titemIndicatorSizeClasses[size]\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<CheckIcon className={itemIndicatorSizeClasses[size]} />\n\t\t\t</ComboboxPrimitive.ItemIndicator>\n\t\t</ComboboxPrimitive.Item>\n\t);\n}\n\n// Item Indicator (standalone)\nfunction ComboboxItemIndicator({\n\tclassName,\n\tchildren,\n\t...props\n}: ComboboxPrimitive.ItemIndicator.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.ItemIndicator\n\t\t\tdata-slot=\"combobox-item-indicator\"\n\t\t\tclassName={cn(className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children ?? <CheckIcon className=\"size-4\" />}\n\t\t</ComboboxPrimitive.ItemIndicator>\n\t);\n}\n\n// Empty\nfunction ComboboxEmpty({\n\tclassName,\n\tchildren,\n\t...props\n}: ComboboxPrimitive.Empty.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Empty\n\t\t\tdata-slot=\"combobox-empty\"\n\t\t\tclassName={cn(\n\t\t\t\t'py-6 text-center text-sm text-muted-foreground empty:hidden',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</ComboboxPrimitive.Empty>\n\t);\n}\n\n// Status (for async loading states)\nfunction ComboboxStatus({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Status.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Status\n\t\t\tdata-slot=\"combobox-status\"\n\t\t\tclassName={cn(\n\t\t\t\t'flex items-center gap-space-sm px-row-x py-row-y text-sm text-muted-foreground empty:hidden',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Group\nfunction ComboboxGroup({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Group.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Group\n\t\t\tdata-slot=\"combobox-group\"\n\t\t\tclassName={cn('overflow-hidden p-0', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Group Label\nfunction ComboboxGroupLabel({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.GroupLabel.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.GroupLabel\n\t\t\tdata-slot=\"combobox-group-label\"\n\t\t\tclassName={cn('px-row-x py-row-y-sm text-xs font-medium text-muted-foreground', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Collection (for rendering items)\nconst ComboboxCollection = ComboboxPrimitive.Collection;\n\n// Separator\nfunction ComboboxSeparator({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Separator.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Separator\n\t\t\tdata-slot=\"combobox-separator\"\n\t\t\tclassName={cn('-mx-1 my-1 h-px bg-muted', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Chips container (for multiple selection)\nconst chipsSizeClasses: Record<ComboboxSize, string> = {\n\tsm: 'min-h-control-sm gap-space-xs px-control-sm py-space-xs text-sm',\n\tmd: 'min-h-control gap-space-xs px-control py-space-xs text-sm',\n\tlg: 'min-h-control-lg gap-space-sm px-control py-space-xs text-sm',\n};\n\nfunction ComboboxChips({\n\tclassName,\n\tsize = 'md',\n\terror,\n\t...props\n}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> & {\n\tsize?: ComboboxSize;\n\terror?: boolean;\n}) {\n\treturn (\n\t\t<ComboboxPrimitive.Chips\n\t\t\tdata-slot=\"combobox-chips\"\n\t\t\tclassName={cn(\n\t\t\t\t'font-sans text-foreground',\n\t\t\t\t'box-border flex flex-wrap items-center rounded-inner border border-input bg-background ring-offset-background shadow-none transition-[color,box-shadow] outline-none',\n\t\t\t\t'has-[:focus-visible]:border-input has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring',\n\t\t\t\tfieldStateRecipes.invalid,\n\t\t\t\tchipsSizeClasses[size],\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\taria-invalid={error || undefined}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Chip\nfunction ComboboxChip({\n\tclassName,\n\tchildren,\n\t...props\n}: ComboboxPrimitive.Chip.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Chip\n\t\t\tdata-slot=\"combobox-chip\"\n\t\t\tclassName={cn(\n\t\t\t\t'inline-flex items-center gap-space-xs rounded-inner bg-secondary px-control-xs py-space-xs text-xs font-medium text-secondary-foreground',\n\t\t\t\t'data-[highlighted]:bg-primary data-[highlighted]:text-primary-foreground',\n\t\t\t\t'focus-within:bg-primary focus-within:text-primary-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<ComboboxPrimitive.ChipRemove className=\"box-border inline-flex shrink-0 items-center justify-center rounded-inner border-0 bg-transparent p-0 font-sans text-inherit opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring\">\n\t\t\t\t<XIcon className=\"size-3\" />\n\t\t\t</ComboboxPrimitive.ChipRemove>\n\t\t</ComboboxPrimitive.Chip>\n\t);\n}\n\n// Chips Input\nfunction ComboboxChipsInput({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Input.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Input\n\t\t\tdata-slot=\"combobox-chips-input\"\n\t\t\tclassName={cn(\n\t\t\t\t'box-border min-w-[80px] flex-1 border-0 bg-transparent p-0 font-sans text-foreground outline-none placeholder:text-muted-foreground',\n\t\t\t\teditableTextSizeClasses.md,\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Backdrop (for modal)\nfunction ComboboxBackdrop({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Backdrop.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Backdrop\n\t\t\tdata-slot=\"combobox-backdrop\"\n\t\t\tclassName={cn(modalBackdropRecipe, \n\t\t\t\tmotionRecipes.backdrop,\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Arrow\nfunction ComboboxArrow({\n\tclassName,\n\t...props\n}: ComboboxPrimitive.Arrow.Props) {\n\treturn (\n\t\t<ComboboxPrimitive.Arrow\n\t\t\tdata-slot=\"combobox-arrow\"\n\t\t\tclassName={cn('fill-popover', className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// useFilter hook re-export\nconst useComboboxFilter = ComboboxPrimitive.useFilter;\n\nexport {\n\tCombobox,\n\tComboboxInput,\n\tComboboxInputTrigger,\n\tComboboxTrigger,\n\tComboboxValue,\n\tComboboxClear,\n\tComboboxPortal,\n\tComboboxPositioner,\n\tComboboxPopup,\n\tComboboxList,\n\tComboboxItem,\n\tComboboxItemIndicator,\n\tComboboxEmpty,\n\tComboboxStatus,\n\tComboboxGroup,\n\tComboboxGroupLabel,\n\tComboboxCollection,\n\tComboboxSeparator,\n\tComboboxChips,\n\tComboboxChip,\n\tComboboxChipsInput,\n\tComboboxBackdrop,\n\tComboboxArrow,\n\tuseComboboxFilter,\n};\n","import { CollectionLabel } from '../popover/collection-content';\n/**\n * Base wrapper for `ui/combobox`.\n *\n * This family is the sole importer of `@/components/ui/combobox`: it re-exports\n * the Base UI combobox anatomy untouched so every other layer composes the\n * parts without reaching into `ui/`. The searchable recipe built on top of this\n * anatomy — `Combobox`, `MultiCombobox`, `AsyncResourceCombobox`, and the\n * headless hooks — lives in `features/combobox`.\n *\n * The compound root is exported as `ComboboxRoot` so the canonical `Combobox`\n * name stays with the opinionated feature component.\n */\nexport {\n\tCombobox as ComboboxRoot,\n\tComboboxInputTrigger,\n\tComboboxValue,\n\tComboboxClear,\n\tComboboxPortal,\n\tComboboxPositioner,\n\tComboboxList,\n\tComboboxItemIndicator,\n\tComboboxEmpty,\n\tComboboxStatus,\n\tComboboxGroup,\n\tComboboxGroupLabel,\n\tComboboxCollection,\n\tComboboxChips,\n\tComboboxChip,\n\tComboboxChipsInput,\n\tComboboxBackdrop,\n\tComboboxArrow,\n\tuseComboboxFilter,\n} from '../../ui/combobox';\n\n\nimport { createElement, type ComponentProps } from 'react';\nimport { ComboboxItem as Item, ComboboxPopup as Popup, ComboboxInput as Input, ComboboxTrigger as Trigger, ComboboxSeparator as Separator } from '../../ui/combobox';\nimport { cn } from '../../../lib/utils';\nimport { collectionRecipes, collectionRowClasses, popoverRecipes, surfaceInsetClasses, type CollectionDensity } from '../popover/popover.recipes';\nimport { useTypographyConfig } from '../../../lib/ui-provider';\nimport { textSizes } from '../../typography/text.styles';\n\nexport function ComboboxPopup({ className, ...props }: ComponentProps<typeof Popup>) {\n // The list owns the collection inset so mixed search/status/footer regions stay flush.\n return createElement(Popup, { ...props, className: cn(popoverRecipes.surface, surfaceInsetClasses.flush, className) });\n}\nexport function ComboboxInput({ className, ...props }: ComponentProps<typeof Input>) {\n return createElement(Input, { ...props, className: cn('rounded-inner', className) });\n}\nexport function ComboboxTrigger({ className, ...props }: ComponentProps<typeof Trigger>) {\n return createElement(Trigger, { ...props, className: cn('rounded-inner', className) });\n}\n\nconst densityBySize = { sm: 'compact', md: 'default', lg: 'comfortable' } as const;\n\nexport function ComboboxItem({ className, size = 'md', density = densityBySize[size], children, ...props }: ComponentProps<typeof Item> & {\n /** Vertical option rhythm. Defaults to the owning control size's rhythm. */\n density?: CollectionDensity;\n}) {\n const { defaultTextSize } = useTypographyConfig();\n const content = typeof children === 'string' || typeof children === 'number' || typeof children === 'bigint' ? createElement(CollectionLabel, { children }) : children;\n return createElement(Item, { ...props, children: content, size, className: cn(collectionRowClasses(density), collectionRecipes.highlighted, collectionRecipes.disabled, textSizes[defaultTextSize ?? 'sm'], className) });\n}\n\n/** Shared collection divider, preserving Base UI separator semantics. */\nexport function ComboboxSeparator({ className, ...props }: ComponentProps<typeof Separator>) {\n return createElement(Separator, { ...props, className: cn(popoverRecipes.separator, className) });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAYA,IAAMA,IAAWC,EAAkB;AAEnC,SAASC,EAAc,EACtB,cACA,GAAG4B,KAC8B;CACjC,OACC,kBAAC7B,EAAkB,OAAnB;EACC,aAAU;EACV,WAAWa,EACV,6BACA,+bACAY,EAAwB,IACxBF,EAAkB,OAClBA,EAAkB,SAClBO,CACD;EACA,GAAID;CACJ,CAAA;AAEH;AAEA,SAAS3B,EAAgB,EACxB,cACA,aACA,GAAG2B,KACgC;CACnC,OACC,kBAAC7B,EAAkB,SAAnB;EACC,aAAU;EACV,WAAWa,EACV,6BACA,mUACA,WACAU,EAAkB,OAClBA,EAAkB,SAClB,yBACAO,CACD;EACA,GAAID;EAXL,UAAA,CAaEG,GACD,kBAAChC,EAAkB,MAAnB;GAAwB,WAAU;GACjC,UAAA,kBAACiC,GAAD,EAAiB,WAAU,kCAAmC,CAAA;EACvC,CAAA,CACE;;AAE7B;AAEA,SAASC,EAAc,EACtB,gBACA,GAAGL,KACkE;CACrE,OACC,kBAAC7B,EAAkB,OAAnB;EACC,aAAU;EACV,aACC,CAAC,CAACmC,KAAe,kBAAC,QAAD;GAAM,WAAU;GAAyB,UAAAA;EAAkB,CAAA;EAE7E,GAAIN;CACJ,CAAA;AAEH;AAEA,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iBAAiBiB,CAAS;CAAE,CAAC;AACtF;AAEA,IAAM0C,IAAgB;CAAE,IAAI;CAAW,IAAI;CAAW,IAAI;AAAc;AAExE,SAAgBC,GAAa,EAAE,cAAW,UAAO,MAAM,aAAUD,EAAc9B,IAAO,aAAU,GAAGb,KAGhG;CACF,IAAM,EAAE,uBAAoBlB,EAAoB,GAC1C+D,IAAU,OAAO1C,KAAa,YAAY,OAAOA,KAAa,YAAY,OAAOA,KAAa,WAAWqC,EAAchD,GAAiB,EAAE,YAAS,CAAC,IAAIW;CAC9J,OAAOqC,EAAc5D,GAAM;EAAE,GAAGoB;EAAO,UAAU6C;EAAS;EAAM,WAAW7D,EAAGK,EAAqByD,CAAO,GAAGvD,EAAkB,aAAaA,EAAkB,UAAUN,EAAU8D,KAAmB,OAAO9C,CAAS;CAAE,CAAC;AACzN;AAGA,SAAgB+C,GAAkB,EAAE,cAAW,GAAGhD,KAA2C;CAC5F,OAAOwC,EAAc3D,GAAW;EAAE,GAAGmB;EAAO,WAAWhB,EAAGM,EAAe,WAAWW,CAAS;CAAE,CAAC;AACjG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"combobox-hozNwUcc.js","names":["_Fragment","_Fragment","React","ComboboxPrimitive","Combobox","BaseCombobox","Combobox","resolveComponentScale","useDensityConfig","cn","Text","DisplayLabel","Button","Stack","ErrorState","fieldAffordanceRecipes","ComboboxStatus","ComboboxPortal","ComboboxChipsInput","ComboboxGroupLabel","ComboboxGroup","ComboboxChip","ComboboxEmpty","ComboboxItem","Combobox$2","ComboboxCollection","ComboboxPopup","ComboboxChips","ComboboxPositioner","ComboboxList","formControlMinHeightClasses","formControlPaddingClasses","Input","ScrollArea","useDebouncedCallback","React$1","Fragment$1","defaultComboboxStrings","CREATE_OPTION_SYMBOL","isCreateOption","item","getCreateOptionValue","createCreateOption","inputValue","LoadingMore","loading","className","Loader2","text","StatusText","StatusContent","trimmed","searchValue","strings","minSearchLength","remaining","primitiveSizeByComboboxSize","emptyClassByComboboxSize","ComboboxDropdown","positionerClassName","portalContainer","primitiveSize","size","showStatus","showEmpty","items","loadingMore","applyFooter","content","listRef","groupedItems","group","groupItems","groupLabel","renderGroupLabel","getItemDisabled","renderItemContent","getItemReactKey","createOptionItem","ErrorMessage","_size","error","escapeRegExp","str","HighlightedText","highlight","regex","parts","cursor","isMatch","index","key","part","highlightClassName","useDebouncedSearch","emitSearch","value","debounceMs","useGroupedItems","useMemo","getItemGroup","groups","groupKey","existing","useLoadMore","isLoadingRef","useRef","cooldownRef","requestLoadMore","onLoadMore","useEffect","useCallback","hasMore","event","scrollTop","clientHeight","scrollHeight","useComboboxStrings","useStrings","custom","hasExactMatch","normalizedSearch","getItemLabel","useComboboxCore","stringsProp","getKey","getItemKey","trimmedSearch","showListContent","listEl","handleScroll","baseItems","ensuredItems","merged","itemKey","ensured","showCreateOption","creatable","onCreate","PlusIcon","renderItem","label","highlightMatch","resolveComboboxSize","sizeProp","defaultScale","inputEndPaddingBySize","primitiveComboboxSizeBySize","getComboboxFormSize","ComboboxInputField","Combobox","clearable","required","clearLabel","XIcon","toggleLabel","ChevronDownIcon","Combobox$1","formSize","hasError","invalid","core","selectedValue","isOpen","setIsOpen","useState","handleOpenChange","nextOpen","clearSearchOnClose","onSearchValueChange","onOpenChange","displayInputValue","handleValueChange","onSelectedValueChange","reason","MultiCombobox","primitiveComboboxSize","containerRef","draftValues","setDraftValues","selectedValues","internalOpen","setInternalOpen","isOpenControlled","open","resolvedOpen","applyButton","setOpen","next","regularValues","createValue","values","onSelectedValuesChange","closeOnSelect","handleApply","onApply","handleCancel","onCancel","visibleValues","chipsPlaceholder","defaultAsyncResourceComboboxStrings","isSimpleText","AsyncResourceCombobox","props","isControlled","internalValue","setInternalValue","defaultValue","setSearchValue","setItems","isLoading","setIsLoading","fetchError","setFetchError","retryCount","setRetryCount","requestIdRef","nextValue","onValueChange","runFetch","fetcher","context","requestId","nextItems","onAfterFetch","nextError","onError","disabled","preload","controller","limit","retry","count","renderOption","description","getDescription","meta","getMeta","getLabel","resolvedError","errorMessage","hasFetchError","errorNode","renderError"],"sources":["../src/components/features/combobox/combobox.strings.ts","../src/components/features/combobox/constants.ts","../src/components/features/combobox/components/loading-more.tsx","../src/components/features/combobox/components/status-content.tsx","../src/components/features/combobox/components/combobox-dropdown.tsx","../src/components/features/combobox/components/error-message.tsx","../src/components/features/combobox/components/highlighted-text.tsx","../src/components/features/combobox/hooks/use-debounced-search.ts","../src/components/features/combobox/hooks/use-grouped-items.ts","../src/components/features/combobox/hooks/use-load-more.ts","../src/components/features/combobox/hooks/use-combobox-core.tsx","../src/components/features/combobox/combobox.tsx","../src/components/features/combobox/async-resource-combobox.tsx"],"sourcesContent":["/**\n * Default user-facing strings for `<Combobox>`.\n *\n * Consumers wire backend i18n at the call site:\n *\n * <Combobox strings={{ noResults: t('search.empty') }} … />\n *\n * Templates use `{placeholder}` tokens — the component substitutes them at\n * render time. Function-valued strings would also work; we keep templates\n * here for the constants file.\n */\nimport type { ComboboxStrings } from './types';\n\nexport const defaultComboboxStrings: ComboboxStrings = {\n\tplaceholder: 'Search...',\n\tclear: 'Clear selection',\n\ttoggle: 'Open options',\n\tsearching: 'Loading...',\n\tnoResults: 'No results found.',\n\ttypeToSearch: 'Type at least {min} characters to search...',\n\ttypeMore: 'Type {remaining} more character{s} to search...',\n\tcreateNew: 'Create {value}',\n\tloadingMore: 'Loading...',\n\tapply: 'Apply',\n\tcancel: 'Cancel',\n};\n\nexport type { ComboboxStrings };\n","/**\n * Constants and default values for the Combobox component.\n *\n * Default strings live in `./combobox.strings.ts` per rule 19.\n */\n\nexport { defaultComboboxStrings } from './combobox.strings';\n\n// ============================================================================\n// Default Values\n// ============================================================================\n\nexport const DEFAULT_MIN_SEARCH_LENGTH = 3;\n/** Re-exported so the combobox shares the library-wide debounce window. */\nexport { DEFAULT_DEBOUNCE_MS } from '../../../hooks/use-debounced-callback';\nexport const DEFAULT_SIZE = 'md';\nexport const LOAD_MORE_THRESHOLD = 0.8;\nexport const LOAD_MORE_DEBOUNCE_MS = 100;\nexport const LOAD_MORE_COOLDOWN_MS = 500;\n\n// ============================================================================\n// Symbols\n// ============================================================================\n\nexport const CREATE_OPTION_SYMBOL = Symbol('combobox-create-option');\n\n// ============================================================================\n// Type Guards\n// ============================================================================\n\nexport function isCreateOption<T>(item: T): item is T & { [CREATE_OPTION_SYMBOL]: string } {\n\treturn (\n\t\ttypeof item === 'object' &&\n\t\titem !== null &&\n\t\tCREATE_OPTION_SYMBOL in (item as object)\n\t);\n}\n\nexport function getCreateOptionValue<T>(item: T): string {\n\tif (!isCreateOption(item)) {\n\t\tthrow new Error('Item is not a create option');\n\t}\n\treturn (item as { [CREATE_OPTION_SYMBOL]: string })[CREATE_OPTION_SYMBOL];\n}\n\nexport function createCreateOption<T>(inputValue: string): T {\n\treturn { [CREATE_OPTION_SYMBOL]: inputValue } as unknown as T;\n}\n","/**\n * LoadingMore Component\n */\n\nimport { Loader2 } from 'lucide-react';\nimport * as React from 'react';\nimport { Stack } from '../../../base/structure';\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nexport interface LoadingMoreProps {\n\t/** Shows the pending indicator. */\n\tloading: boolean;\n\t/** Visible label. */\n\ttext: string;\n\tclassName?: string;\n}\n\nexport function LoadingMore({\n\tloading,\n\ttext,\n\tclassName,\n}: LoadingMoreProps): React.ReactElement | null {\n\tif (!loading) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Stack\n\t\t\tdirection=\"horizontal\"\n\t\t\tgap=\"sm\"\n\t\t\tjustify=\"center\"\n\t\t\twrap={false}\n\t\t\tclassName={cn('loading-more--component', \n\t\t\t\t'px-control py-space-xs text-xs text-muted-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\trole=\"status\"\n\t\t\taria-live=\"polite\"\n\t\t>\n\t\t\t<Loader2 className=\"size-icon-sm animate-spin\" aria-hidden=\"true\" />\n\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"text-inherit\">\n\t\t\t\t{text}\n\t\t\t</Text>\n\t\t</Stack>\n\t);\n}\n\nLoadingMore.displayName = 'LoadingMore';\n","/**\n * StatusContent Component\n */\n\nimport { Loader2 } from 'lucide-react';\nimport * as React from 'react';\nimport { Text } from '../../../typography';\nimport type { ComboboxStrings } from '../types';\n\nfunction StatusText({ children }: { children: string }) {\n\treturn (\n\t\t<Text tag=\"span\" size=\"inherit\" type=\"secondary\" className=\"text-inherit\">\n\t\t\t{children}\n\t\t</Text>\n\t);\n}\n\nexport interface StatusContentProps {\n\t/** Whether results are being fetched. */\n\tloading?: boolean;\n\t/** Current search text. */\n\tsearchValue: string;\n\t/** Characters required before the list becomes active. */\n\tminSearchLength: number;\n\t/** How many options matched, deciding between the empty and results copy. */\n\titemCount: number;\n\t/** Resolved copy for the status rows. */\n\tstrings: ComboboxStrings;\n}\n\nexport function StatusContent({\n\tloading,\n\tsearchValue,\n\tminSearchLength,\n\titemCount,\n\tstrings,\n}: StatusContentProps): React.ReactNode {\n\tconst trimmed = searchValue.trim();\n\n\tif (loading) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Loader2 className=\"size-icon-sm animate-spin\" />\n\t\t\t\t<StatusText>{strings.searching}</StatusText>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif (trimmed === '') {\n\t\tif (strings.typeToSearch.includes('{min}')) {\n\t\t\treturn (\n\t\t\t\t<StatusText>\n\t\t\t\t\t{strings.typeToSearch.replace('{min}', String(minSearchLength))}\n\t\t\t\t</StatusText>\n\t\t\t);\n\t\t}\n\t\treturn <StatusText>{strings.typeToSearch}</StatusText>;\n\t}\n\n\tif (trimmed.length < minSearchLength) {\n\t\tconst remaining = minSearchLength - trimmed.length;\n\t\tif (strings.typeMore.includes('{remaining}') || strings.typeMore.includes('{s}')) {\n\t\t\treturn (\n\t\t\t\t<StatusText>\n\t\t\t\t\t{strings.typeMore\n\t\t\t\t\t\t.replace('{remaining}', String(remaining))\n\t\t\t\t\t\t.replace('{s}', remaining !== 1 ? 's' : '')}\n\t\t\t\t</StatusText>\n\t\t\t);\n\t\t}\n\t\treturn <StatusText>{strings.typeMore}</StatusText>;\n\t}\n\n\tif (itemCount === 0) {\n\t\treturn null;\n\t}\n\n\treturn null;\n}\n\nStatusContent.displayName = 'StatusContent';\n","/**\n * Shared ComboboxDropdown Component\n *\n * Renders the dropdown content for both single and multiple selection variants.\n * Extracts shared rendering logic to reduce duplication.\n */\n\nimport * as React from 'react';\n\nimport {\n\tComboboxPortal,\n\tComboboxPositioner,\n\tComboboxPopup,\n\tComboboxEmpty,\n\tComboboxList,\n\tComboboxItem,\n\tComboboxStatus,\n\tComboboxGroup,\n\tComboboxGroupLabel,\n\tComboboxCollection,\n} from '../../../base/combobox';\nimport { Button } from '../../../base/buttons';\nimport { ScrollArea } from '../../../base/display/scroll-area';\nimport { Stack } from '../../../base/structure';\nimport { DisplayLabel, Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\n\nimport { DEFAULT_SIZE } from '../constants';\nimport type { ComboboxStrings, ComboboxSize } from '../types';\nimport { LoadingMore } from './loading-more';\nimport { StatusContent } from './status-content';\n\nconst primitiveSizeByComboboxSize: Record<ComboboxSize, 'sm' | 'md' | 'lg'> = {\n\tsm: 'sm',\n\tmd: 'md',\n\tlg: 'lg',\n};\n\nconst emptyClassByComboboxSize: Record<ComboboxSize, string> = {\n\tsm: 'flex min-h-control-sm items-center justify-center px-row-x py-row-y text-center text-pxs leading-tight text-muted-foreground',\n\tmd: 'flex min-h-control items-center justify-center px-row-x py-row-y text-center text-sm leading-tight text-muted-foreground',\n\tlg: 'flex min-h-control-lg items-center justify-center px-row-x py-row-y-lg text-center text-sm leading-tight text-muted-foreground',\n};\n\nexport interface ComboboxDropdownProps<T> {\n\t// Display state\n\t/** Whether results are being fetched. */\n\tloading: boolean;\n\t/** Whether the status row replaces the list — while loading, or below `minSearchLength`. */\n\tshowStatus: boolean;\n\t/** Whether the no-results row shows. */\n\tshowEmpty: boolean;\n\n\t// Search\n\t/** Current search text, used to highlight matches. */\n\tsearchValue: string;\n\t/** Characters required before the list becomes active. */\n\tminSearchLength: number;\n\n\t// Items\n\t/** Options to render, including the create row when offered. */\n\titems: T[];\n\t/** Options bucketed by group name, or `null` when grouping is off. */\n\tgroupedItems: Map<string, T[]> | null;\n\t/** The synthetic create row, or `null` when it is not offered. */\n\tcreateOptionItem: T | null;\n\n\t// Rendering\n\t/** Renders one option's content. */\n\trenderItemContent: (item: T) => React.ReactNode;\n\t/** Returns the React key for an option. */\n\tgetItemReactKey: (item: T) => string;\n\t/** Marks individual options unselectable while still rendering them. */\n\tgetItemDisabled?: (item: T) => boolean;\n\t/** Renders a group heading. */\n\trenderGroupLabel?: (group: string) => React.ReactNode;\n\n\t// Load more\n\t/** Whether the next page is being fetched. */\n\tloadingMore?: boolean;\n\n\t// Strings\n\t/** Resolved copy for the status, empty, and create rows. */\n\tstrings: ComboboxStrings;\n\n\t// Size\n\t/** Row density, matching the trigger's size. */\n\tsize?: ComboboxSize;\n\n\t// Portal\n\t/** Mounts the dropdown inside this element instead of the default portal root. */\n\tportalContainer?: React.RefObject<HTMLElement | null>;\n\n\t// Refs\n\t/** Ref to the scrollable list, used for scroll-triggered pagination. */\n\tlistRef: React.RefObject<HTMLDivElement | null>;\n\n\t// Multiple selection anchor\n\t/** Element the dropdown positions against. */\n\tanchor?: React.RefObject<HTMLElement | null>;\n\n\t/** Optional apply / cancel footer for the apply-button workflow. */\n\tapplyFooter?: {\n\t\tapplyLabel: string;\n\t\tcancelLabel: string;\n\t\tonApply: () => void;\n\t\tonCancel: () => void;\n\t};\n}\n\nexport function ComboboxDropdown<T>({\n\tloading,\n\tshowStatus,\n\tshowEmpty,\n\tsearchValue,\n\tminSearchLength,\n\titems,\n\tgroupedItems,\n\tcreateOptionItem,\n\trenderItemContent,\n\tgetItemReactKey,\n\tgetItemDisabled,\n\trenderGroupLabel,\n\tloadingMore,\n\tstrings,\n\tsize = DEFAULT_SIZE,\n\tportalContainer,\n\tlistRef,\n\tanchor,\n\tapplyFooter,\n}: ComboboxDropdownProps<T>): React.ReactElement | null {\n\tconst positionerClassName = portalContainer != null ? 'z-[100]' : undefined;\n\tconst primitiveSize = primitiveSizeByComboboxSize[size];\n\tconst hasPopupContent =\n\t\tshowStatus ||\n\t\tshowEmpty ||\n\t\titems.length > 0 ||\n\t\tBoolean(loadingMore) ||\n\t\tBoolean(applyFooter);\n\t// An exclusive inline error has no dropdown rows. Mounting a zero-height\n\t// popup still starts Base UI focus management and hides its Retry sibling.\n\tif (!hasPopupContent) return null;\n\n\tconst content = (\n\t\t<ComboboxPositioner\n\t\t\tanchor={anchor}\n\t\t\tclassName={positionerClassName}\n\t\t>\n\t\t\t<ComboboxPopup\n\t\t\t\taria-busy={loading || undefined}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'combobox-dropdown--popup',\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{/* Status message */}\n\t\t\t\t{!!showStatus && (\n\t\t\t\t\t<ComboboxStatus className=\"gap-space-sm px-control py-space-xs text-xs text-muted-foreground\">\n\t\t\t\t\t\t<StatusContent\n\t\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\t\tsearchValue={searchValue}\n\t\t\t\t\t\t\tminSearchLength={minSearchLength}\n\t\t\t\t\t\t\titemCount={items.length}\n\t\t\t\t\t\t\tstrings={strings}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ComboboxStatus>\n\t\t\t\t)}\n\n\t\t\t\t{/* Empty state */}\n\t\t\t\t{!!showEmpty && (\n\t\t\t\t\t<ComboboxEmpty className={emptyClassByComboboxSize[size]}>\n\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" type=\"secondary\" className=\"text-inherit\">\n\t\t\t\t\t\t\t{strings.noResults}\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</ComboboxEmpty>\n\t\t\t\t)}\n\n\t\t\t\t{/* Items list */}\n\t\t\t\t<ScrollArea\n\t\t\t\t\tviewportRef={listRef}\n\t\t\t\t\tclassName=\"max-h-[min(20rem,var(--available-height))]\"\n\t\t\t\t>\n\t\t\t\t\t<ComboboxList className=\"combobox-dropdown--list max-h-none overflow-visible\">\n\t\t\t\t\t\t{groupedItems ? (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{Array.from(groupedItems.entries()).map(([group, groupItems]) => {\n\t\t\t\t\t\t\t\t\tconst groupLabel =\n\t\t\t\t\t\t\t\t\t\ttypeof renderGroupLabel === 'function'\n\t\t\t\t\t\t\t\t\t\t\t? renderGroupLabel(group)\n\t\t\t\t\t\t\t\t\t\t\t: group;\n\t\t\t\t\t\t\t\t\tconst groupLabelContent =\n\t\t\t\t\t\t\t\t\t\ttypeof groupLabel === 'string' || typeof groupLabel === 'number' || typeof groupLabel === 'bigint'\n\t\t\t\t\t\t\t\t\t\t\t? <DisplayLabel>{groupLabel}</DisplayLabel>\n\t\t\t\t\t\t\t\t\t\t\t: groupLabel;\n\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ComboboxGroup className=\"combobox-dropdown--group p-0\" key={group} items={groupItems}>\n\t\t\t\t\t\t\t\t\t\t\t<ComboboxGroupLabel>{groupLabelContent}</ComboboxGroupLabel>\n\t\t\t\t\t\t\t\t\t\t\t<ComboboxCollection>\n\t\t\t\t\t\t\t\t\t\t\t\t{(item: T) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ComboboxItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={getItemReactKey(item)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={item}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize={primitiveSize}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={getItemDisabled?.(item)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{renderItemContent(item)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ComboboxItem>\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t</ComboboxCollection>\n\t\t\t\t\t\t\t\t\t\t</ComboboxGroup>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})}\n\n\t\t\t\t\t\t\t\t{createOptionItem != null && (\n\t\t\t\t\t\t\t\t\t<ComboboxItem\n\t\t\t\t\t\t\t\t\t\tkey={getItemReactKey(createOptionItem)}\n\t\t\t\t\t\t\t\t\t\tvalue={createOptionItem}\n\t\t\t\t\t\t\t\t\t\tsize={primitiveSize}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{renderItemContent(createOptionItem)}\n\t\t\t\t\t\t\t\t\t</ComboboxItem>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<ComboboxCollection>\n\t\t\t\t\t\t\t\t{(item: T) => (\n\t\t\t\t\t\t\t\t\t<ComboboxItem\n\t\t\t\t\t\t\t\t\t\tkey={getItemReactKey(item)}\n\t\t\t\t\t\t\t\t\t\tvalue={item}\n\t\t\t\t\t\t\t\t\t\tsize={primitiveSize}\n\t\t\t\t\t\t\t\t\t\tdisabled={getItemDisabled?.(item)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{renderItemContent(item)}\n\t\t\t\t\t\t\t\t\t</ComboboxItem>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</ComboboxCollection>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ComboboxList>\n\t\t\t\t</ScrollArea>\n\n\t\t\t\t{/* Loading more indicator */}\n\t\t\t\t<LoadingMore\n\t\t\t\t\tloading={!!loadingMore}\n\t\t\t\t\ttext={strings.loadingMore}\n\t\t\t\t/>\n\n\t\t\t\t{/* Apply / cancel footer (multi-select with applyButton). */}\n\t\t\t\t{!!applyFooter && (\n\t\t\t\t\t<Stack direction=\"horizontal\" gap=\"md\" justify=\"end\" wrap={false} className=\"border-t border-border/60 px-control py-space-xs\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\tapplyFooter.onCancel();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{applyFooter.cancelLabel}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"primary\"\n\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\t\tapplyFooter.onApply();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{applyFooter.applyLabel}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</Stack>\n\t\t\t\t)}\n\t\t\t</ComboboxPopup>\n\t\t</ComboboxPositioner>\n\t);\n\n\tif (portalContainer) {\n\t\treturn <ComboboxPortal container={portalContainer}>{content}</ComboboxPortal>;\n\t}\n\n\treturn <ComboboxPortal>{content}</ComboboxPortal>;\n}\n\nComboboxDropdown.displayName = 'ComboboxDropdown';\n","/**\n * ErrorMessage Component\n */\n\nimport * as React from 'react';\nimport { Text } from '../../../typography';\nimport { cn } from '../../../../lib/utils';\nimport type { ComboboxSize } from '../types';\n\nexport interface ErrorMessageProps {\n\terror?: string;\n\t/** Size preset. */\n\tsize: ComboboxSize;\n\tclassName?: string;\n}\n\nexport function ErrorMessage({\n\terror,\n\tsize: _size,\n\tclassName,\n}: ErrorMessageProps): React.ReactElement | null {\n\tif (!error) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t// `xs` at every control size, matching `FormField` and the date pickers.\n\t\t// Leaving the default size unpinned resolved to `sm`, which made the\n\t\t// combobox the one control whose error text grew as the control grew.\n\t\t<Text\n\t\t\ttag=\"p\"\n\t\t\tsize=\"xs\"\n\t\t\ttype=\"error\"\n\t\t\tclassName={cn('error-message--component', className)}\n\t\t\trole=\"alert\"\n\t\t\taria-live=\"polite\"\n\t\t>\n\t\t\t{error}\n\t\t</Text>\n\t);\n}\n\nErrorMessage.displayName = 'ErrorMessage';\n","/**\n * HighlightedText Component\n */\n\nimport * as React from 'react';\nimport { Text } from '../../../typography';\n\nexport interface HighlightedTextProps {\n\t/** Visible label. */\n\ttext: string;\n\thighlight: string;\n\thighlightClassName?: string;\n}\n\nfunction escapeRegExp(str: string): string {\n\treturn str.replace(/[$()*+.?[\\\\\\]^{|}]/g, '\\\\$&');\n}\n\nexport function HighlightedText({\n\ttext,\n\thighlight,\n\thighlightClassName = 'rounded-radius-sm bg-warning/20 px-space-2xs text-warning-accent dark:bg-warning/25',\n}: HighlightedTextProps): React.ReactNode {\n\tif (!highlight.trim()) {\n\t\treturn (\n\t\t\t<Text tag=\"span\" size=\"inherit\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t{text}\n\t\t\t</Text>\n\t\t);\n\t}\n\n\tconst regex = new RegExp(`(${escapeRegExp(highlight)})`, 'gi');\n\tconst parts = text.split(regex);\n\tlet cursor = 0;\n\n\treturn (\n\t\t<Text tag=\"span\" size=\"inherit\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t{parts.map((part, index) => {\n\t\t\t\tconst isMatch = index % 2 === 1;\n\t\t\t\tconst key = String(cursor);\n\t\t\t\tcursor += part.length;\n\n\t\t\t\tif (isMatch) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<mark key={key} className={highlightClassName}>\n\t\t\t\t\t\t\t{part}\n\t\t\t\t\t\t</mark>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn <React.Fragment key={key}>{part}</React.Fragment>;\n\t\t\t})}\n\t\t</Text>\n\t);\n}\n\nHighlightedText.displayName = 'HighlightedText';\n","/**\n * Hook for debounced search functionality\n */\n\nimport { useEffect } from 'react';\nimport { useDebouncedCallback } from '../../../../hooks/use-debounced-callback';\nimport { DEFAULT_DEBOUNCE_MS, DEFAULT_MIN_SEARCH_LENGTH } from '../constants';\n\nexport interface UseDebouncedSearchOptions {\n\tsearchValue: string;\n\tonSearch: ((value: string) => void) | undefined;\n\tdebounceMs?: number;\n\tminSearchLength?: number;\n}\n\nexport function useDebouncedSearch({\n\tsearchValue,\n\tonSearch,\n\tdebounceMs = DEFAULT_DEBOUNCE_MS,\n\tminSearchLength = DEFAULT_MIN_SEARCH_LENGTH,\n}: UseDebouncedSearchOptions): void {\n\t// `useDebouncedCallback` holds `onSearch` in a ref, so `emitSearch` keeps a\n\t// stable identity even though consumers pass a new inline callback every\n\t// render. Depending on the raw `onSearch` here re-ran the effect on every\n\t// render and — when it triggered a state update — caused an infinite fetch\n\t// loop.\n\tconst emitSearch = useDebouncedCallback((value: string) => {\n\t\tonSearch?.(value);\n\t}, debounceMs);\n\n\tuseEffect(() => {\n\t\tconst trimmed = searchValue.trim();\n\t\tif (trimmed.length < minSearchLength) return;\n\n\t\temitSearch(trimmed);\n\t\treturn emitSearch.cancel;\n\t}, [searchValue, minSearchLength, emitSearch]);\n}\n","/**\n * Hook for grouping items by category\n */\n\nimport { useMemo } from 'react';\n\nexport interface UseGroupedItemsOptions<T> {\n\titems: T[];\n\tgetItemGroup: ((item: T) => string) | undefined;\n}\n\nexport type GroupedItemsResult<T> = Map<string, T[]> | null;\n\nexport function useGroupedItems<T>({\n\titems,\n\tgetItemGroup,\n}: UseGroupedItemsOptions<T>): GroupedItemsResult<T> {\n\treturn useMemo(() => {\n\t\tif (!getItemGroup) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst groups = new Map<string, T[]>();\n\n\t\tfor (const item of items) {\n\t\t\tconst groupKey = getItemGroup(item);\n\t\t\tconst existing = groups.get(groupKey);\n\n\t\t\tif (existing) {\n\t\t\t\texisting.push(item);\n\t\t\t} else {\n\t\t\t\tgroups.set(groupKey, [item]);\n\t\t\t}\n\t\t}\n\n\t\treturn groups;\n\t}, [items, getItemGroup]);\n}\n","/**\n * Hook for infinite scroll / load more functionality\n */\n\nimport { useCallback, useEffect, useRef } from 'react';\nimport { useDebouncedCallback } from '../../../../hooks/use-debounced-callback';\nimport {\n\tLOAD_MORE_THRESHOLD,\n\tLOAD_MORE_DEBOUNCE_MS,\n\tLOAD_MORE_COOLDOWN_MS,\n} from '../constants';\n\nexport interface UseLoadMoreOptions {\n\thasMore: boolean | undefined;\n\tonLoadMore: (() => void) | undefined;\n\tloadingMore: boolean | undefined;\n}\n\nexport interface UseLoadMoreReturn {\n\thandleScroll: (event: Event) => void;\n}\n\nexport function useLoadMore({\n\thasMore,\n\tonLoadMore,\n\tloadingMore,\n}: UseLoadMoreOptions): UseLoadMoreReturn {\n\tconst isLoadingRef = useRef(false);\n\tconst cooldownRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n\tconst requestLoadMore = useDebouncedCallback(() => {\n\t\tisLoadingRef.current = true;\n\t\tonLoadMore?.();\n\n\t\t// Cooldown, not a debounce: it keeps a second page from being requested\n\t\t// while the first is still in flight.\n\t\tif (cooldownRef.current) clearTimeout(cooldownRef.current);\n\t\tcooldownRef.current = setTimeout(() => {\n\t\t\tisLoadingRef.current = false;\n\t\t\tcooldownRef.current = null;\n\t\t}, LOAD_MORE_COOLDOWN_MS);\n\t}, LOAD_MORE_DEBOUNCE_MS);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (cooldownRef.current) clearTimeout(cooldownRef.current);\n\t\t};\n\t}, []);\n\n\tconst handleScroll = useCallback(\n\t\t(event: Event) => {\n\t\t\tif (!hasMore || !onLoadMore || loadingMore || isLoadingRef.current) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst target = event.target as HTMLElement;\n\t\t\tconst { scrollHeight, scrollTop, clientHeight } = target;\n\t\t\tconst scrollPercentage = (scrollTop + clientHeight) / scrollHeight;\n\n\t\t\tif (scrollPercentage >= LOAD_MORE_THRESHOLD) {\n\t\t\t\trequestLoadMore();\n\t\t\t}\n\t\t},\n\t\t[hasMore, onLoadMore, loadingMore, requestLoadMore]\n\t);\n\n\treturn { handleScroll };\n}\n","/**\n * Headless state and rendering contract shared by the canonical comboboxes.\n *\n * Extracts shared logic between single and multiple selection variants\n * to reduce duplication and ensure consistent behavior.\n */\n\nimport { PlusIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { useRef, useMemo, useEffect, useCallback } from 'react';\nimport { Text } from '../../../typography';\nimport { useStrings, type StringsProp } from '../../../../lib/strings';\n\nimport { HighlightedText } from '../components/highlighted-text';\nimport { defaultComboboxStrings } from '../combobox.strings';\nimport {\n\tDEFAULT_MIN_SEARCH_LENGTH,\n\tDEFAULT_DEBOUNCE_MS,\n\tisCreateOption,\n\tgetCreateOptionValue,\n\tcreateCreateOption,\n} from '../constants';\nimport type { ComboboxStrings, ComboboxSharedProps } from '../types';\nimport { useDebouncedSearch } from './use-debounced-search';\nimport { useGroupedItems } from './use-grouped-items';\nimport { useLoadMore } from './use-load-more';\n\nimport { cn } from '../../../../lib/utils';\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface UseComboboxCoreOptions<T> extends ComboboxSharedProps<T> {\n\t/** Items that should always be included (selected items) */\n\tensuredItems?: T[];\n}\n\nexport interface UseComboboxCoreReturn<T> {\n\t// Resolved values\n\tstrings: ComboboxStrings;\n\tgetKey: (item: T) => string;\n\ttrimmedSearch: string;\n\n\t// Refs\n\tlistRef: React.RefObject<HTMLDivElement | null>;\n\n\t// Items\n\tbaseItems: T[];\n\tallItems: T[];\n\tgroupedItems: Map<string, T[]> | null;\n\tcreateOptionItem: T | null;\n\n\t// Display state\n\tshowStatus: boolean;\n\tshowEmpty: boolean;\n\tshowCreateOption: boolean;\n\n\t// Handlers\n\trenderItemContent: (item: T) => React.ReactNode;\n\titemToStringLabel: (item: T) => string;\n\tgetItemReactKey: (item: T) => string;\n\n\t// Scroll handling\n\thandleScroll: (event: Event) => void;\n}\n\n// ============================================================================\n// Hook Implementation\n// ============================================================================\n\nfunction useComboboxStrings(custom?: StringsProp<ComboboxStrings>): ComboboxStrings {\n\treturn useStrings(defaultComboboxStrings, custom);\n}\n\nfunction hasExactMatch<T>(\n\titems: T[],\n\tsearchValue: string,\n\tgetItemLabel: (item: T) => string\n): boolean {\n\tconst normalizedSearch = searchValue.toLowerCase();\n\treturn items.some(\n\t\t(item) => getItemLabel(item).toLowerCase() === normalizedSearch\n\t);\n}\n\nexport function useComboboxCore<T>({\n\t// Core props\n\titems,\n\tsearchValue,\n\tgetItemLabel,\n\tgetItemKey,\n\tloading = false,\n\tshowListContent = true,\n\tminSearchLength = DEFAULT_MIN_SEARCH_LENGTH,\n\tstrings: stringsProp,\n\trenderItem,\n\n\t// Debounced Search\n\tonSearch,\n\tdebounceMs = DEFAULT_DEBOUNCE_MS,\n\n\t// Creatable\n\tcreatable,\n\tonCreate,\n\n\t// Grouped Items\n\tgetItemGroup,\n\n\t// Load More\n\thasMore,\n\tonLoadMore,\n\tloadingMore,\n\n\t// Highlight Match\n\thighlightMatch,\n\n\t\t// Ensured items (selected items that should always be included)\n\tensuredItems = [],\n}: UseComboboxCoreOptions<T>): UseComboboxCoreReturn<T> {\n\t// -------------------------------------------------------------------------\n\t// Setup\n\t// -------------------------------------------------------------------------\n\n\tconst strings = useComboboxStrings(stringsProp);\n\tconst getKey = getItemKey ?? getItemLabel;\n\tconst listRef = useRef<HTMLDivElement | null>(null);\n\tconst trimmedSearch = searchValue.trim();\n\tconst showStatus = showListContent && (loading || trimmedSearch.length < minSearchLength);\n\n\t// -------------------------------------------------------------------------\n\t// Hooks\n\t// -------------------------------------------------------------------------\n\n\tuseDebouncedSearch({\n\t\tsearchValue,\n\t\tonSearch,\n\t\tdebounceMs,\n\t\tminSearchLength,\n\t});\n\n\tconst { handleScroll } = useLoadMore({\n\t\thasMore: showListContent && !showStatus ? hasMore : false,\n\t\tonLoadMore,\n\t\tloadingMore,\n\t});\n\n\t// Attach scroll listener\n\tuseEffect(() => {\n\t\tconst listEl = listRef.current;\n\t\tif (!showListContent || showStatus || !listEl || !hasMore || !onLoadMore) return;\n\n\t\tlistEl.addEventListener('scroll', handleScroll);\n\t\treturn () => listEl.removeEventListener('scroll', handleScroll);\n\t}, [handleScroll, hasMore, onLoadMore, showListContent, showStatus]);\n\n\t// -------------------------------------------------------------------------\n\t// Computed Values\n\t// -------------------------------------------------------------------------\n\n\t// Merge ensured items with fetched items\n\tconst baseItems = useMemo(() => {\n\t\tif (!showListContent || showStatus) return [];\n\t\tif (ensuredItems.length === 0) return items;\n\n\t\tconst merged = [...ensuredItems];\n\t\titems.forEach((item) => {\n\t\t\tconst itemKey = getKey(item);\n\t\t\tif (!ensuredItems.some((ensured) => getKey(ensured) === itemKey)) {\n\t\t\t\tmerged.push(item);\n\t\t\t}\n\t\t});\n\t\treturn merged;\n\t}, [items, ensuredItems, getKey, showListContent, showStatus]);\n\n\t// Group items if grouping is enabled\n\tconst groupedItems = useGroupedItems({\n\t\titems: baseItems,\n\t\tgetItemGroup,\n\t});\n\n\t// Determine if create option should be shown\n\tconst showCreateOption = useMemo(() => {\n\t\tif (!showListContent || showStatus) return false;\n\t\tif (!creatable || !onCreate) return false;\n\t\tif (trimmedSearch.length < minSearchLength) return false;\n\t\treturn !hasExactMatch(baseItems, trimmedSearch, getItemLabel);\n\t}, [creatable, onCreate, trimmedSearch, minSearchLength, baseItems, getItemLabel, showListContent, showStatus]);\n\n\tconst createOptionItem = useMemo(() => {\n\t\tif (!showCreateOption) return null;\n\t\treturn createCreateOption<T>(trimmedSearch);\n\t}, [showCreateOption, trimmedSearch]);\n\n\t// Build final items array with create option\n\tconst allItems = useMemo(() => {\n\t\tif (createOptionItem) return [...baseItems, createOptionItem];\n\t\treturn baseItems;\n\t}, [baseItems, createOptionItem]);\n\n\t// Status display conditions\n\tconst showEmpty =\n\t\tshowListContent &&\n\t\t!loading &&\n\t\ttrimmedSearch.length >= minSearchLength &&\n\t\titems.length === 0 &&\n\t\t!showCreateOption;\n\n\t// -------------------------------------------------------------------------\n\t// Handlers\n\t// -------------------------------------------------------------------------\n\n\tconst renderItemContent = useCallback(\n\t\t(item: T): React.ReactNode => {\n\t\t\t// Handle create option\n\t\t\tif (isCreateOption(item)) {\n\t\t\t\tconst value = getCreateOptionValue(item);\n\t\t\t\treturn (\n\t\t\t\t\t<span className={cn('combobox-core--component', 'flex items-center gap-space-sm')}>\n\t\t\t\t\t\t<PlusIcon className=\"size-icon-sm\" />\n\t\t\t\t\t\t{strings.createNew.includes('{value}') ? (\n\t\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t\t\t\t{strings.createNew.replace('{value}', value)}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<span className=\"inline-flex items-center gap-space-sm\">\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t\t\t\t\t{strings.createNew}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t\t\t\t\t{value}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Custom renderer takes precedence\n\t\t\tif (renderItem) {\n\t\t\t\treturn renderItem(item);\n\t\t\t}\n\n\t\t\t// Default rendering with optional highlighting\n\t\t\tconst label = getItemLabel(item);\n\t\t\tif (highlightMatch && trimmedSearch) {\n\t\t\t\treturn <HighlightedText text={label} highlight={trimmedSearch} />;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<Text tag=\"span\" size=\"inherit\" weight=\"medium\" lineHeight=\"tight\" className=\"text-inherit\">\n\t\t\t\t\t{label}\n\t\t\t\t</Text>\n\t\t\t);\n\t\t},\n\t\t[strings.createNew, renderItem, getItemLabel, highlightMatch, trimmedSearch]\n\t);\n\n\tconst itemToStringLabel = useCallback(\n\t\t(item: T): string => {\n\t\t\tif (isCreateOption(item)) {\n\t\t\t\treturn getCreateOptionValue(item);\n\t\t\t}\n\t\t\treturn getItemLabel(item);\n\t\t},\n\t\t[getItemLabel]\n\t);\n\n\tconst getItemReactKey = useCallback(\n\t\t(item: T): string => {\n\t\t\tif (isCreateOption(item)) return `__create__:${getCreateOptionValue(item)}`;\n\t\t\treturn String(getKey(item));\n\t\t},\n\t\t[getKey]\n\t);\n\n\treturn {\n\t\tstrings,\n\t\tgetKey,\n\t\ttrimmedSearch,\n\t\tlistRef,\n\t\tbaseItems,\n\t\tallItems,\n\t\tgroupedItems,\n\t\tcreateOptionItem,\n\t\tshowStatus,\n\t\tshowEmpty,\n\t\tshowCreateOption,\n\t\trenderItemContent,\n\t\titemToStringLabel,\n\t\tgetItemReactKey,\n\t\thandleScroll,\n\t};\n}\n","import { Stack } from '../../base/structure';\n/**\n * Combobox Components\n *\n * A feature-rich, API-driven combobox built on Base UI with shadcn styling.\n * Supports single and multiple selection, form integration, debounced search,\n * grouping, pagination, and more.\n *\n * This version uses shared hooks and components to eliminate duplication\n * between single and multiple selection variants.\n */\n\nimport * as React from 'react';\nimport { useRef, useCallback, useEffect, useState } from 'react';\nimport { ChevronDownIcon, XIcon } from 'lucide-react';\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox';\n\nimport {\n\tComboboxRoot as BaseCombobox,\n\tComboboxChips,\n\tComboboxChip,\n\tComboboxChipsInput,\n} from '../../base/combobox';\nimport { Button } from '../../base/buttons';\nimport { Input } from '../../base/text-inputs';\nimport { Text } from '../../typography';\nimport { useDensityConfig, type FormControlSize } from '../../../lib/ui-provider';\nimport { resolveComponentScale } from '../../../lib/ui-provider/scale';\nimport { cn } from '../../../lib/utils';\nimport { fieldAffordanceRecipes } from '../../../lib/field-affordance-recipes';\n\nimport { ComboboxDropdown } from './components/combobox-dropdown';\nimport { ErrorMessage } from './components/error-message';\nimport {\n\tformControlMinHeightClasses,\n\tformControlPaddingClasses,\n} from '../../base/forms/form-sizing';\nimport {\n\tDEFAULT_MIN_SEARCH_LENGTH,\n\tDEFAULT_SIZE,\n\tisCreateOption,\n\tgetCreateOptionValue,\n} from './constants';\n\nimport { useComboboxCore } from './hooks/use-combobox-core';\nimport type {\n\tComboboxProps,\n\tMultiComboboxProps,\n\tComboboxSize,\n} from './types';\n\nfunction resolveComboboxSize(\n\tsizeProp: ComboboxSize | undefined,\n\tdefaultScale: FormControlSize | undefined,\n): ComboboxSize {\n\treturn resolveComponentScale(sizeProp, defaultScale, DEFAULT_SIZE);\n};\n\nconst inputEndPaddingBySize: Record<ComboboxSize, string> = {\n\tsm: 'pe-control-actions-sm',\n\tmd: 'pe-control-actions',\n\tlg: 'pe-control-actions',\n};\n\nconst primitiveComboboxSizeBySize: Record<ComboboxSize, 'sm' | 'md' | 'lg'> = {\n\tsm: 'sm',\n\tmd: 'md',\n\tlg: 'lg',\n};\n\nfunction getComboboxFormSize(size: ComboboxSize): FormControlSize {\n\treturn size;\n}\n\ninterface ComboboxInputFieldProps {\n\tplaceholder: string;\n\tclearLabel: string;\n\ttoggleLabel: string;\n\tsize: FormControlSize;\n\terror?: boolean;\n\trequired?: boolean;\n\tdisabled?: boolean;\n\tclearable?: boolean;\n\tclassName?: string;\n\tonBlur?: () => void;\n}\n\nfunction ComboboxInputField({\n\tplaceholder,\n\tclearLabel,\n\ttoggleLabel,\n\tsize,\n\terror,\n\trequired,\n\tdisabled,\n\tclearable = true,\n\tclassName,\n\tonBlur,\n}: ComboboxInputFieldProps): React.ReactElement {\n\treturn (\n\t\t<div className=\"relative\">\n\t\t\t<ComboboxPrimitive.Input\n\t\t\t\trender={\n\t\t\t\t\t<Input\n\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\tinvalid={error}\n\t\t\t\t\t\tclassName={cn(clearable ? inputEndPaddingBySize[size] : fieldAffordanceRecipes.togglePadding, className)}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\taria-invalid={error || undefined}\n\t\t\t\taria-required={required}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tonBlur={onBlur}\n\t\t\t/>\n\t\t\t<div className=\"absolute inset-y-0 end-space-xs flex items-center gap-space-xs text-muted-foreground\">\n\t\t\t\t{clearable ? (\n\t\t\t\t\t<ComboboxPrimitive.Clear\n\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\tclassName={cn(fieldAffordanceRecipes.target,fieldAffordanceRecipes.focus,fieldAffordanceRecipes.clear)}\n\t\t\t\t\t\t\t\taria-label={clearLabel}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<XIcon className={fieldAffordanceRecipes.icon} aria-hidden=\"true\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t\t<ComboboxPrimitive.Trigger\n\t\t\t\t\trender={\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\ttone=\"secondary\"\n\t\t\t\t\t\t\tbuttonStyle=\"ghost\"\n\t\t\t\t\t\t\tsize=\"sm\" iconOnly\n\t\t\t\t\t\t\t\tclassName={cn(fieldAffordanceRecipes.target,fieldAffordanceRecipes.focus,fieldAffordanceRecipes.toggle)}\n\t\t\t\t\t\t\taria-label={toggleLabel}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t<ChevronDownIcon className={fieldAffordanceRecipes.icon} aria-hidden=\"true\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n// ============================================================================\n// Single Selection Component\n// ============================================================================\n\nexport function Combobox<T>({\n\t// Core props\n\titems,\n\tselectedValue,\n\tonSelectedValueChange,\n\tclearSearchOnClose = true,\n\tsearchValue,\n\tonSearchValueChange,\n\tgetItemLabel,\n\tgetItemKey,\n\tloading = false,\n\tshowListContent = true,\n\tminSearchLength = DEFAULT_MIN_SEARCH_LENGTH,\n\tstrings: stringsProp,\n\tdisabled = false,\n\tclassName,\n\tclearable = true,\n\trenderItem,\n\tportalContainer,\n\n\t// Form Integration\n\tname,\n\tinvalid,\n\terror,\n\trequired,\n\tonBlur,\n\n\t// Debounced Search\n\tonSearch,\n\tdebounceMs,\n\n\t// Creatable\n\tcreatable,\n\tonCreate,\n\n\t// Grouped Items\n\tgetItemGroup,\n\trenderGroupLabel,\n\n\t// Load More\n\thasMore,\n\tonLoadMore,\n\tloadingMore,\n\n\t// Disable individual items\n\tgetItemDisabled,\n\n\t// Highlight Match\n\thighlightMatch,\n\n\t// Size\n\tsize: sizeProp,\n\n\t// Controlled Open\n\topen,\n\tonOpenChange,\n}: ComboboxProps<T>): React.ReactElement {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComboboxSize(sizeProp, defaultScale);\n\tconst formSize = getComboboxFormSize(size);\n\tconst hasError = invalid || Boolean(error);\n\n\t// Use shared core hook\n\tconst core = useComboboxCore({\n\t\titems,\n\t\tsearchValue,\n\t\tonSearchValueChange,\n\t\tgetItemLabel,\n\t\tgetItemKey,\n\t\tloading,\n\t\tshowListContent,\n\t\tminSearchLength,\n\t\tstrings: stringsProp,\n\t\trenderItem,\n\t\tonSearch,\n\t\tdebounceMs,\n\t\tcreatable,\n\t\tonCreate,\n\t\tgetItemGroup,\n\t\thasMore,\n\t\tonLoadMore,\n\t\tloadingMore,\n\t\thighlightMatch,\n\t\tsize,\n\t\t// Include selected value in items list\n\t\tensuredItems: selectedValue ? [selectedValue] : [],\n\t});\n\n\t// Track open state so we can show the selected label when closed\n\tconst [isOpen, setIsOpen] = useState(false);\n\tconst handleOpenChange = useCallback(\n\t\t(nextOpen: boolean) => {\n\t\t\tsetIsOpen(nextOpen);\n\t\t\tif (!nextOpen && clearSearchOnClose) {\n\t\t\t\t// Clear search when closing so next open starts fresh\n\t\t\t\tonSearchValueChange('');\n\t\t\t}\n\t\t\tonOpenChange?.(nextOpen);\n\t\t},\n\t\t[clearSearchOnClose, onOpenChange, onSearchValueChange],\n\t);\n\n\t// When closed with a selected value, show the label; when open, show search text\n\tconst displayInputValue = isOpen\n\t\t? searchValue\n\t\t: (selectedValue ? core.itemToStringLabel(selectedValue) : '');\n\n\t// Handle value change, including create option\n\tconst handleValueChange = useCallback(\n\t\t(value: T | null): void => {\n\t\t\tif (value && isCreateOption(value)) {\n\t\t\t\tconst inputValue = getCreateOptionValue(value);\n\t\t\t\tonCreate?.(inputValue);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonSelectedValueChange(value);\n\t\t},\n\t\t[onSelectedValueChange, onCreate]\n\t);\n\n\treturn (\n\t\t<Stack gap=\"dense\" className=\"combobox--component\">\n\t\t\t<BaseCombobox\n\t\t\t\titems={core.allItems}\n\t\t\t\tvalue={selectedValue}\n\t\t\t\tonValueChange={handleValueChange}\n\t\t\t\tinputValue={displayInputValue}\n\t\t\t\tonInputValueChange={(value, { reason }) => {\n\t\t\t\t\tif (reason === 'item-press') {\n\t\t\t\t\t\tonSearchValueChange('');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonSearchValueChange(value);\n\t\t\t\t}}\n\t\t\t\titemToStringLabel={core.itemToStringLabel}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tfilter={null}\n\t\t\t\tname={name}\n\t\t\t\trequired={required}\n\t\t\t\topen={open}\n\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t>\n\t\t\t\t<ComboboxInputField\n\t\t\t\t\tplaceholder={core.strings.placeholder}\n\t\t\t\t\tclearLabel={core.strings.clear}\n\t\t\t\t\ttoggleLabel={core.strings.toggle}\n\t\t\t\t\tclassName={className}\n\t\t\t\t\tsize={formSize}\n\t\t\t\t\terror={hasError}\n\t\t\t\t\trequired={required}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tclearable={clearable}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t/>\n\n\t\t\t\t<ComboboxDropdown\n\t\t\t\t\tloading={loading}\n\t\t\t\t\tshowStatus={core.showStatus}\n\t\t\t\t\tshowEmpty={core.showEmpty}\n\t\t\t\t\tsearchValue={searchValue}\n\t\t\t\t\tminSearchLength={minSearchLength}\n\t\t\t\t\titems={core.allItems}\n\t\t\t\t\tgroupedItems={core.groupedItems}\n\t\t\t\t\tcreateOptionItem={core.createOptionItem}\n\t\t\t\t\trenderItemContent={core.renderItemContent}\n\t\t\t\t\tgetItemReactKey={core.getItemReactKey}\n\t\t\t\t\tgetItemDisabled={getItemDisabled}\n\t\t\t\t\trenderGroupLabel={renderGroupLabel}\n\t\t\t\t\tloadingMore={showListContent && !core.showStatus ? loadingMore : false}\n\t\t\t\t\tstrings={core.strings}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tportalContainer={portalContainer}\n\t\t\t\t\tlistRef={core.listRef}\n\t\t\t\t/>\n\t\t\t</BaseCombobox>\n\n\t\t\t<ErrorMessage error={error} size={size} />\n\t\t</Stack>\n\t);\n}\n\n// ============================================================================\n// Multiple Selection Component\n// ============================================================================\n\nexport function MultiCombobox<T>({\n\t// Core props\n\titems,\n\tselectedValues,\n\tonSelectedValuesChange,\n\tsearchValue,\n\tonSearchValueChange,\n\tgetItemLabel,\n\tgetItemKey,\n\tloading = false,\n\tshowListContent = true,\n\tminSearchLength = DEFAULT_MIN_SEARCH_LENGTH,\n\tstrings: stringsProp,\n\tdisabled = false,\n\tclassName,\n\trenderItem,\n\tportalContainer,\n\n\t// Form Integration\n\tname,\n\tinvalid,\n\terror,\n\trequired,\n\tonBlur,\n\n\t// Debounced Search\n\tonSearch,\n\tdebounceMs,\n\n\t// Creatable\n\tcreatable,\n\tonCreate,\n\n\t// Grouped Items\n\tgetItemGroup,\n\trenderGroupLabel,\n\n\t// Load More\n\thasMore,\n\tonLoadMore,\n\tloadingMore,\n\n\t// Disable individual items\n\tgetItemDisabled,\n\n\t// Highlight Match\n\thighlightMatch,\n\n\t// Size\n\tsize: sizeProp,\n\n\t// Controlled Open\n\topen,\n\tonOpenChange,\n\n\t// Behaviour\n\tcloseOnSelect = false,\n\tapplyButton = false,\n\tonApply,\n\tonCancel,\n}: MultiComboboxProps<T>): React.ReactElement {\n\tconst { defaultScale } = useDensityConfig();\n\tconst size = resolveComboboxSize(sizeProp, defaultScale);\n\tconst formSize = getComboboxFormSize(size);\n\tconst primitiveComboboxSize = primitiveComboboxSizeBySize[size];\n\tconst hasError = invalid || Boolean(error);\n\tconst containerRef = useRef<HTMLDivElement | null>(null);\n\tconst getKey = getItemKey ?? getItemLabel;\n\n\t// Draft state — only used in `applyButton` mode. Tracks the user's\n\t// in-progress selection so we can commit it on Apply or revert on\n\t// Cancel. When apply mode is OFF, we pass selections through immediately.\n\tconst [draftValues, setDraftValues] = useState<T[]>(selectedValues);\n\tconst [internalOpen, setInternalOpen] = useState(false);\n\tconst isOpenControlled = open !== undefined;\n\tconst resolvedOpen = isOpenControlled ? open : internalOpen;\n\n\tuseEffect(() => {\n\t\tif (applyButton) setDraftValues(selectedValues);\n\t}, [applyButton, selectedValues]);\n\n\tconst setOpen = useCallback(\n\t\t(next: boolean) => {\n\t\t\tif (!isOpenControlled) setInternalOpen(next);\n\t\t\tonOpenChange?.(next);\n\t\t},\n\t\t[isOpenControlled, onOpenChange],\n\t);\n\n\t// Use shared core hook\n\tconst core = useComboboxCore({\n\t\titems,\n\t\tsearchValue,\n\t\tonSearchValueChange,\n\t\tgetItemLabel,\n\t\tgetItemKey,\n\t\tloading,\n\t\tshowListContent,\n\t\tminSearchLength,\n\t\tstrings: stringsProp,\n\t\trenderItem,\n\t\tonSearch,\n\t\tdebounceMs,\n\t\tcreatable,\n\t\tonCreate,\n\t\tgetItemGroup,\n\t\thasMore,\n\t\tonLoadMore,\n\t\tloadingMore,\n\t\thighlightMatch,\n\t\tsize,\n\t\t// Include selected values in items list\n\t\tensuredItems: selectedValues,\n\t});\n\n\t// Handle value change, filtering out create options\n\tconst handleValueChange = useCallback(\n\t\t(values: T[]): void => {\n\t\t\tconst regularValues: T[] = [];\n\t\t\tlet createValue: string | null = null;\n\n\t\t\tfor (const value of values) {\n\t\t\t\tif (isCreateOption(value)) {\n\t\t\t\t\tcreateValue = getCreateOptionValue(value);\n\t\t\t\t} else {\n\t\t\t\t\tregularValues.push(value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (createValue) {\n\t\t\t\tonCreate?.(createValue);\n\t\t\t}\n\n\t\t\tconst next = (regularValues.length !== values.length || !createValue) ? regularValues : null;\n\t\t\tif (next) {\n\t\t\t\tif (applyButton) {\n\t\t\t\t\tsetDraftValues(next);\n\t\t\t\t} else {\n\t\t\t\t\tonSelectedValuesChange(next);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (closeOnSelect) {\n\t\t\t\tsetOpen(false);\n\t\t\t}\n\t\t},\n\t\t[onSelectedValuesChange, onCreate, applyButton, closeOnSelect, setOpen],\n\t);\n\n\tconst handleApply = useCallback(() => {\n\t\tif (applyButton) onSelectedValuesChange(draftValues);\n\t\tonApply?.();\n\t\tsetOpen(false);\n\t}, [applyButton, draftValues, onApply, onSelectedValuesChange, setOpen]);\n\n\tconst handleCancel = useCallback(() => {\n\t\tif (applyButton) setDraftValues(selectedValues);\n\t\tonCancel?.();\n\t\tsetOpen(false);\n\t}, [applyButton, selectedValues, onCancel, setOpen]);\n\n\tconst visibleValues = applyButton ? draftValues : selectedValues;\n\tconst chipsPlaceholder = visibleValues.length > 0 ? undefined : core.strings.placeholder;\n\n\treturn (\n\t\t<Stack gap=\"dense\" className=\"combobox--component\">\n\t\t\t<BaseCombobox\n\t\t\t\titems={core.allItems}\n\t\t\t\tmultiple\n\t\t\t\tvalue={visibleValues}\n\t\t\t\tonValueChange={handleValueChange}\n\t\t\t\tinputValue={searchValue}\n\t\t\t\tonInputValueChange={(value, { reason }) => {\n\t\t\t\t\tif (reason === 'item-press') {\n\t\t\t\t\t\tonSearchValueChange('');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonSearchValueChange(value);\n\t\t\t\t}}\n\t\t\t\titemToStringLabel={core.itemToStringLabel}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tfilter={null}\n\t\t\t\tname={name}\n\t\t\t\trequired={required}\n\t\t\t\topen={resolvedOpen}\n\t\t\t\tonOpenChange={(next) => {\n\t\t\t\t\t// In apply-button mode, closing without committing should\n\t\t\t\t\t// revert the draft so the next open starts clean.\n\t\t\t\t\tif (!next && applyButton) setDraftValues(selectedValues);\n\t\t\t\t\tsetOpen(next);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<ComboboxChips\n\t\t\t\t\tref={containerRef}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\tformControlMinHeightClasses[formSize],\n\t\t\t\t\t\tformControlPaddingClasses[formSize],\n\t\t\t\t\t\tformSize === 'sm' ? 'text-pxs' : 'text-sm',\n\t\t\t\t\t\t'bg-transparent !shadow-none',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\tsize={primitiveComboboxSize}\n\t\t\t\t\terror={hasError}\n\t\t\t\t>\n\t\t\t\t\t{visibleValues.map((item) => (\n\t\t\t\t\t\t<ComboboxChip key={getKey(item)}>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\t\t\tsize=\"inherit\"\n\t\t\t\t\t\t\t\tweight=\"medium\"\n\t\t\t\t\t\t\t\tlineHeight=\"tight\"\n\t\t\t\t\t\t\t\tclassName=\"combobox--chip-label text-inherit\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{getItemLabel(item)}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</ComboboxChip>\n\t\t\t\t\t))}\n\t\t\t\t\t<ComboboxChipsInput\n\t\t\t\t\t\tplaceholder={chipsPlaceholder}\n\t\t\t\t\t\taria-invalid={hasError || undefined}\n\t\t\t\t\t\taria-required={required}\n\t\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\t/>\n\t\t\t\t</ComboboxChips>\n\n\t\t\t\t<ComboboxDropdown\n\t\t\t\t\tloading={loading}\n\t\t\t\t\tshowStatus={core.showStatus}\n\t\t\t\t\tshowEmpty={core.showEmpty}\n\t\t\t\t\tsearchValue={searchValue}\n\t\t\t\t\tminSearchLength={minSearchLength}\n\t\t\t\t\titems={core.allItems}\n\t\t\t\t\tgroupedItems={core.groupedItems}\n\t\t\t\t\tcreateOptionItem={core.createOptionItem}\n\t\t\t\t\trenderItemContent={core.renderItemContent}\n\t\t\t\t\tgetItemReactKey={core.getItemReactKey}\n\t\t\t\t\tgetItemDisabled={getItemDisabled}\n\t\t\t\t\trenderGroupLabel={renderGroupLabel}\n\t\t\t\t\tloadingMore={showListContent && !core.showStatus ? loadingMore : false}\n\t\t\t\t\tstrings={core.strings}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tportalContainer={portalContainer}\n\t\t\t\t\tlistRef={core.listRef}\n\t\t\t\t\tanchor={containerRef}\n\t\t\t\t\tapplyFooter={showListContent && applyButton ? {\n\t\t\t\t\t\tapplyLabel: core.strings.apply,\n\t\t\t\t\t\tcancelLabel: core.strings.cancel,\n\t\t\t\t\t\tonApply: handleApply,\n\t\t\t\t\t\tonCancel: handleCancel,\n\t\t\t\t\t} : undefined}\n\t\t\t\t/>\n\t\t\t</BaseCombobox>\n\n\t\t\t<ErrorMessage error={error} size={size} />\n\t\t</Stack>\n\t);\n}\n\nCombobox.displayName = 'Combobox';\nMultiCombobox.displayName = 'MultiCombobox';\n","import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react';\n\nimport { ErrorState } from '../../base/feedback';\nimport { Stack } from '../../base/structure';\nimport { Text } from '../../typography';\nimport { useDebouncedCallback } from '../../../hooks/use-debounced-callback';\nimport { useStrings, type StringsProp } from '../../../lib/strings';\nimport { cn } from '../../../lib/utils';\n\nimport { Combobox } from './combobox';\nimport { defaultComboboxStrings } from './combobox.strings';\nimport { DEFAULT_DEBOUNCE_MS } from './constants';\nimport type { ComboboxSize, ComboboxStrings, ComboboxProps } from './types';\n\nexport interface AsyncResourceComboboxFetcherArgs {\n\tquery: string;\n\tlimit: number;\n\tsignal?: AbortSignal;\n}\n\nexport type AsyncResourceComboboxFetcher<T> = (\n\targs: AsyncResourceComboboxFetcherArgs,\n) => Promise<T[]>;\n\nexport interface AsyncResourceComboboxStrings extends ComboboxStrings {\n\terror: string;\n\tretry: string;\n}\n\nexport const defaultAsyncResourceComboboxStrings: AsyncResourceComboboxStrings = {\n\t...defaultComboboxStrings,\n\terror: 'Unable to load options.',\n\tretry: 'Retry',\n};\n\nexport interface AsyncResourceComboboxRenderOptionContext {\n\tquery: string;\n\tisSelected: boolean;\n}\n\nexport interface AsyncResourceComboboxRenderErrorContext {\n\terror: unknown;\n\tquery: string;\n\tretry: () => void;\n}\n\nexport interface AsyncResourceComboboxProps<T>\n\textends Omit<\n\t\tComboboxProps<T>,\n\t\t| 'items'\n\t\t| 'selectedValue'\n\t\t| 'onSelectedValueChange'\n\t\t| 'clearSearchOnClose'\n\t\t| 'searchValue'\n\t\t| 'onSearchValueChange'\n\t\t| 'getItemLabel'\n\t\t| 'getItemKey'\n\t\t| 'loading'\n\t\t| 'showListContent'\n\t\t| 'renderItem'\n\t\t| 'strings'\n\t\t| 'error'\n\t\t| 'debounceMs'\n\t> {\n\t/**\n\t * Loads options for the current query. This component owns the request\n\t * lifecycle: calls are debounced by `debounceMs`, the previous request is\n\t * aborted through `args.signal`, and out-of-order responses are discarded, so\n\t * the fetcher only needs to resolve or reject.\n\t *\n\t * A rejection clears the fetched list and presents the localized error as an\n\t * exclusive state, suppressing the ordinary no-results row. Honour\n\t * `args.signal` so aborts do not surface as errors.\n\t */\n\tfetcher: AsyncResourceComboboxFetcher<T>;\n\t/** Selected item, for controlled use. Omit entirely to let the component own selection. */\n\tvalue?: T | null;\n\t/** Initial selection for uncontrolled use. Ignored once `value` is passed. */\n\tdefaultValue?: T | null;\n\t/** Fired with the new selection in both controlled and uncontrolled modes. */\n\tonValueChange?: (value: T | null) => void;\n\t/** Fired after a successful fetch with the items received and the request that produced them. */\n\tonAfterFetch?: (items: T[], context: AsyncResourceComboboxFetcherArgs) => void;\n\t/** Fired when the fetcher rejects. Aborted and superseded requests never reach this. */\n\tonError?: (error: unknown, context: AsyncResourceComboboxFetcherArgs) => void;\n\t/** Stable identity for an item. Also decides which option reads as selected. */\n\tgetKey: (item: T) => string;\n\t/** Primary display label for an item. */\n\tgetLabel: (item: T) => string;\n\t/** Secondary text beside the label in the default option row. */\n\tgetDescription?: (item: T) => ReactNode;\n\t/** Tertiary, dimmed text after the description in the default option row. */\n\tgetMeta?: (item: T) => ReactNode;\n\t/**\n\t * Replaces the entire default option row, including the label. When set,\n\t * `getLabel`, `getDescription`, and `getMeta` no longer affect rendering\n\t * (`getLabel` is still used for the input's text value).\n\t */\n\trenderOption?: (item: T, context: AsyncResourceComboboxRenderOptionContext) => ReactNode;\n\t/**\n\t * Page size passed to the fetcher as `args.limit`. Default: `10`.\n\t *\n\t * Advisory only — the component does not truncate the returned array, so the\n\t * fetcher is responsible for honouring it.\n\t */\n\tlimit?: number;\n\t/** Quiet period before a query is issued, in milliseconds. Default: `300`. */\n\tdebounceMs?: number;\n\t/**\n\t * Characters required before a query is issued. Default: `0` here, rather\n\t * than the `3` used by the synchronous comboboxes — resource lookup is\n\t * expected to be browsable from the first keystroke alongside `preload`.\n\t *\n\t * An empty input is governed by `preload`, not by this threshold.\n\t */\n\tminSearchLength?: number;\n\t/**\n\t * Fetches with an empty query so options are available before typing.\n\t * Default: `true`. Set `false` to require a query first.\n\t */\n\tpreload?: boolean;\n\t/** Replaces the default error copy shown when the fetcher rejects. */\n\terrorMessage?: ReactNode;\n\t/** Replaces the package error state while retaining the failed query and retry action. */\n\trenderError?: (context: AsyncResourceComboboxRenderErrorContext) => ReactNode;\n\t/** Overrides the combobox copy, including the async-only `error` message. */\n\tstrings?: StringsProp<AsyncResourceComboboxStrings>;\n\t/** Trigger density. Falls back to `UIProvider.density.defaultScale`, then `md`. */\n\tsize?: ComboboxSize;\n}\n\nfunction isSimpleText(value: ReactNode): value is string | number | bigint {\n\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint';\n}\n\nexport function AsyncResourceCombobox<T>({\n\tfetcher,\n\tvalue,\n\tdefaultValue = null,\n\tonValueChange,\n\tonAfterFetch,\n\tonError,\n\tgetKey,\n\tgetLabel,\n\tgetDescription,\n\tgetMeta,\n\trenderOption,\n\tlimit = 10,\n\tdebounceMs = DEFAULT_DEBOUNCE_MS,\n\tpreload = true,\n\tminSearchLength = 0,\n\terrorMessage,\n\trenderError,\n\tstrings: stringsProp,\n\tdisabled,\n\tsize,\n\t...props\n}: AsyncResourceComboboxProps<T>) {\n\tconst strings = useStrings(defaultAsyncResourceComboboxStrings, stringsProp);\n\tconst isControlled = value !== undefined;\n\tconst [internalValue, setInternalValue] = useState<T | null>(defaultValue);\n\tconst selectedValue = isControlled ? value : internalValue;\n\tconst [searchValue, setSearchValue] = useState('');\n\tconst [items, setItems] = useState<T[]>([]);\n\tconst [isLoading, setIsLoading] = useState(false);\n\tconst [fetchError, setFetchError] = useState<{ error: unknown; query: string } | null>(null);\n\tconst [retryCount, setRetryCount] = useState(0);\n\tconst requestIdRef = useRef(0);\n\tconst trimmedSearch = searchValue.trim();\n\n\tconst handleValueChange = useCallback(\n\t\t(nextValue: T | null) => {\n\t\t\tif (!isControlled) {\n\t\t\t\tsetInternalValue(nextValue);\n\t\t\t}\n\t\t\tonValueChange?.(nextValue);\n\t\t},\n\t\t[isControlled, onValueChange],\n\t);\n\n\t// `fetcher`, `onAfterFetch` and `onError` are almost always inline, so their\n\t// identities change on every render. Listing them in the effect below re-ran\n\t// it every render, and because the fetch sets state that re-render was\n\t// self-sustaining — an unbounded request loop. `useDebouncedCallback` holds\n\t// them in a ref and returns a stable function, so the effect only re-runs on\n\t// a real query change.\n\tconst runFetch = useDebouncedCallback(\n\t\t(requestId: number, context: AsyncResourceComboboxFetcherArgs) => {\n\t\t\tsetIsLoading(true);\n\t\t\tsetFetchError(null);\n\n\t\t\tfetcher(context)\n\t\t\t\t.then((nextItems) => {\n\t\t\t\t\tif (context.signal?.aborted || requestIdRef.current !== requestId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsetItems(nextItems);\n\t\t\t\t\tonAfterFetch?.(nextItems, context);\n\t\t\t\t})\n\t\t\t\t.catch((nextError: unknown) => {\n\t\t\t\t\tif (context.signal?.aborted || requestIdRef.current !== requestId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsetItems([]);\n\t\t\t\t\tsetFetchError({ error: nextError, query: context.query });\n\t\t\t\t\tonError?.(nextError, context);\n\t\t\t\t})\n\t\t\t\t.finally(() => {\n\t\t\t\t\tif (!context.signal?.aborted && requestIdRef.current === requestId) {\n\t\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t},\n\t\tdebounceMs,\n\t);\n\n\tuseEffect(() => {\n\t\tif (disabled) return;\n\n\t\tconst shouldFetch =\n\t\t\ttrimmedSearch.length > 0\n\t\t\t\t? trimmedSearch.length >= minSearchLength\n\t\t\t\t: preload;\n\n\t\tif (!shouldFetch) {\n\t\t\tsetItems([]);\n\t\t\tsetIsLoading(false);\n\t\t\tsetFetchError(null);\n\t\t\treturn;\n\t\t}\n\n\t\tconst requestId = requestIdRef.current + 1;\n\t\trequestIdRef.current = requestId;\n\t\tconst controller = new AbortController();\n\n\t\trunFetch(requestId, {\n\t\t\tquery: trimmedSearch,\n\t\t\tlimit,\n\t\t\tsignal: controller.signal,\n\t\t});\n\n\t\treturn () => {\n\t\t\trunFetch.cancel();\n\t\t\tcontroller.abort();\n\t\t};\n\t}, [\n\t\tdisabled,\n\t\tlimit,\n\t\tminSearchLength,\n\t\tpreload,\n\t\tretryCount,\n\t\trunFetch,\n\t\ttrimmedSearch,\n\t]);\n\n\tconst retry = useCallback(() => {\n\t\tif (!fetchError) return;\n\t\tsetSearchValue(fetchError.query);\n\t\tsetRetryCount((count) => count + 1);\n\t}, [fetchError]);\n\n\tconst renderItem = useCallback(\n\t\t(item: T) => {\n\t\t\tif (renderOption) {\n\t\t\t\treturn renderOption(item, {\n\t\t\t\t\tquery: trimmedSearch,\n\t\t\t\t\tisSelected: selectedValue ? getKey(selectedValue) === getKey(item) : false,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst description = getDescription?.(item);\n\t\t\tconst meta = getMeta?.(item);\n\n\t\t\treturn (\n\t\t\t\t<Stack\n\t\t\t\t\trender={<span />}\n\t\t\t\t\tdirection=\"horizontal\"\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\twrap={false}\n\t\t\t\t\tclassName=\"async-resource-combobox--option leading-tight\"\n\t\t\t\t>\n\t\t\t\t\t<Text\n\t\t\t\t\t\ttag=\"span\"\n\t\t\t\t\t\tsize={size === 'sm' ? 'pxs' : undefined}\n\t\t\t\t\t\tweight=\"medium\"\n\t\t\t\t\t\tclassName=\"min-w-0 shrink truncate\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{getLabel(item)}\n\t\t\t\t\t</Text>\n\t\t\t\t\t{(!!description || !!meta) && (\n\t\t\t\t\t\t<span className=\"inline-flex min-w-0 flex-1 items-center gap-space-sm overflow-hidden text-muted-foreground\">\n\t\t\t\t\t\t\t{!!description && (isSimpleText(description) ? (\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"min-w-0 truncate\">\n\t\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) : description)}\n\t\t\t\t\t\t\t{!!meta && (isSimpleText(meta) ? (\n\t\t\t\t\t\t\t\t<Text tag=\"span\" size=\"xs\" type=\"secondary\" className=\"min-w-0 truncate opacity-75\">\n\t\t\t\t\t\t\t\t\t{meta}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t) : meta)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t</Stack>\n\t\t\t);\n\t\t},\n\t\t[getDescription, getKey, getLabel, getMeta, renderOption, selectedValue, size, trimmedSearch],\n\t);\n\n\tconst resolvedError = useMemo(() => {\n\t\tif (!fetchError) return undefined;\n\t\treturn errorMessage ?? strings.error;\n\t}, [errorMessage, fetchError, strings.error]);\n\tconst hasFetchError = fetchError !== null;\n\tconst errorNode = fetchError\n\t\t? renderError?.({ error: fetchError.error, query: fetchError.query, retry }) ?? (\n\t\t\t<ErrorState\n\t\t\t\tvariant=\"inline\"\n\t\t\t\ttitle={resolvedError}\n\t\t\t\tonRetry={retry}\n\t\t\t\tretryLabel={strings.retry}\n\t\t\t\tclassName=\"async-resource-combobox--error mt-space-sm\"\n\t\t\t/>\n\t\t)\n\t\t: null;\n\n\treturn (\n\t\t<div\n\t\t\tdata-component=\"async-resource-combobox\"\n\t\t\tdata-slot=\"async-resource-combobox\"\n\t\t\tclassName={cn('async-resource-combobox--component', props.className)}\n\t\t>\n\t\t\t<Combobox\n\t\t\t\t{...props}\n\t\t\t\tclassName={undefined}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tsize={size}\n\t\t\t\titems={items}\n\t\t\t\tselectedValue={selectedValue ?? null}\n\t\t\t\tonSelectedValueChange={handleValueChange}\n\t\t\t\tclearSearchOnClose={false}\n\t\t\t\tsearchValue={searchValue}\n\t\t\t\tonSearchValueChange={setSearchValue}\n\t\t\t\tgetItemLabel={getLabel}\n\t\t\t\tgetItemKey={getKey}\n\t\t\t\tloading={!hasFetchError && isLoading}\n\t\t\t\tshowListContent={!hasFetchError}\n\t\t\t\tminSearchLength={minSearchLength}\n\t\t\t\tstrings={strings}\n\t\t\t\trenderItem={renderItem}\n\t\t\t/>\n\t\t\t{errorNode}\n\t\t</div>\n\t);\n}\n\nAsyncResourceCombobox.displayName = 'AsyncResourceCombobox';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAaA,IAAaqC,IAA0C;CACtD,aAAa;CACb,OAAO;CACP,QAAQ;CACR,WAAW;CACX,WAAW;CACX,cAAc;CACd,UAAU;CACV,WAAW;CACX,aAAa;CACb,OAAO;CACP,QAAQ;AACT,GCDaC,IAAuB,OAAO,wBAAwB;AAMnE,SAAgBC,EAAkB,GAAyD;CAC1F,OACC,OAAOC,KAAS,cAChBA,KACAF,KAAyBE;AAE3B;AAEA,SAAgBC,EAAwB,GAAiB;CACxD,IAAI,CAACF,EAAeC,CAAI,GACvB,MAAU,MAAM,6BAA6B;CAE9C,OAAQA,EAA4CF;AACrD;AAEA,SAAgBI,GAAsB,GAAuB;CAC5D,OAAO,GAAGJ,IAAuBK,EAAW;AAC7C;;;AC7BA,SAAgBC,GAAY,EAC3B,YACA,SACA,gBAC+C;CAK/C,OAJKC,IAKJ,kBAAChC,GAAD;EACC,WAAU;EACV,KAAI;EACJ,SAAQ;EACR,MAAM;EACN,WAAWJ,EAAG,2BACb,wDACAqC,CACD;EACA,MAAK;EACL,aAAU;EAVX,UAAA,CAYC,kBAACC,GAAD;GAAS,WAAU;GAA4B,eAAY;EAAQ,CAAA,GACnE,kBAACrC,GAAD;GAAM,KAAI;GAAO,MAAK;GAAK,MAAK;GAAY,WAAU;GACpD,UAAAsC;EACI,CAAA,CACA;MApBA;AAsBT;AAEA,GAAY,cAAc;;;ACvC1B,SAASC,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