themelia-react-ui 2.0.6 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (912) hide show
  1. package/CHANGELOG.md +250 -0
  2. package/MIGRATION.md +746 -7
  3. package/README.md +27 -23
  4. package/dist/{accordion-0tQUZ20r.js → accordion-DNVqwEIC.js} +36 -36
  5. package/dist/accordion-DNVqwEIC.js.map +1 -0
  6. package/dist/action-menu-D5343RwT.js +286 -0
  7. package/dist/action-menu-D5343RwT.js.map +1 -0
  8. package/dist/ai-artifact-otrz9ZwS.js +1214 -0
  9. package/dist/ai-artifact-otrz9ZwS.js.map +1 -0
  10. package/dist/anchored-positioning-1U_eBFNx.js +9 -0
  11. package/dist/anchored-positioning-1U_eBFNx.js.map +1 -0
  12. package/dist/app-shell-CPN30Nb1.js +372 -0
  13. package/dist/app-shell-CPN30Nb1.js.map +1 -0
  14. package/dist/{attachment-BCpA4e7i.js → attachment-D2-fpfmv.js} +15 -15
  15. package/dist/{attachment-BCpA4e7i.js.map → attachment-D2-fpfmv.js.map} +1 -1
  16. package/dist/{auth-B0girIk_.js → auth-g_oUTDDC.js} +234 -241
  17. package/dist/auth-g_oUTDDC.js.map +1 -0
  18. package/dist/{avatar-B9Jnp-T-.js → avatar-Ca3Ihrq4.js} +4 -4
  19. package/dist/{avatar-B9Jnp-T-.js.map → avatar-Ca3Ihrq4.js.map} +1 -1
  20. package/dist/{badge-wWauMgAt.js → badge-oGiXblW7.js} +8 -9
  21. package/dist/badge-oGiXblW7.js.map +1 -0
  22. package/dist/base/accordion.js +1 -1
  23. package/dist/base/action-menu.js +1 -1
  24. package/dist/base/attachment.js +1 -1
  25. package/dist/base/avatar.js +1 -1
  26. package/dist/base/badge.js +1 -1
  27. package/dist/base/batch-action-bar.js +1 -1
  28. package/dist/base/buttons.js +2 -2
  29. package/dist/base/cards.js +3 -3
  30. package/dist/base/carousel.js +11 -11
  31. package/dist/base/carousel.js.map +1 -1
  32. package/dist/base/cascader.js +1 -1
  33. package/dist/base/chart.js +1 -1
  34. package/dist/base/choice-inputs.js +2 -2
  35. package/dist/base/code-block.js +1 -1
  36. package/dist/base/combobox.js +1 -1
  37. package/dist/base/command.js +1 -1
  38. package/dist/base/copyable.js +1 -1
  39. package/dist/base/date-pickers.js +2 -2
  40. package/dist/base/display.js +7 -7
  41. package/dist/base/feedback.js +4 -4
  42. package/dist/base/forms-numeric.js +2 -2
  43. package/dist/base/forms.js +2 -2
  44. package/dist/base/inline-edit.js +13 -13
  45. package/dist/base/inline-edit.js.map +1 -1
  46. package/dist/base/item.js +1 -1
  47. package/dist/base/media-gallery.js +203 -2
  48. package/dist/base/media-gallery.js.map +1 -0
  49. package/dist/base/metadata-list.js +1 -1
  50. package/dist/base/navigation.js +7 -7
  51. package/dist/base/popover-menu.js +1 -1
  52. package/dist/base/popover.js +1 -1
  53. package/dist/base/qr-code.js +32 -22
  54. package/dist/base/qr-code.js.map +1 -1
  55. package/dist/base/repeaters.js +91 -88
  56. package/dist/base/repeaters.js.map +1 -1
  57. package/dist/base/sidebar.js +2 -2
  58. package/dist/base/signature-pad.js +14 -14
  59. package/dist/base/signature-pad.js.map +1 -1
  60. package/dist/base/skeleton.js +1 -1
  61. package/dist/base/spinner.js +6 -12
  62. package/dist/base/spinner.js.map +1 -1
  63. package/dist/base/structure.js +1 -1
  64. package/dist/base/table.js +1 -1
  65. package/dist/base/text-inputs.js +3 -3
  66. package/dist/base/toaster.js +2 -2
  67. package/dist/base/tree.js +2 -2
  68. package/dist/base/upload-queue.js +303 -2
  69. package/dist/base/upload-queue.js.map +1 -0
  70. package/dist/base/upload.js +3 -4
  71. package/dist/base/value-inputs.js +1 -1
  72. package/dist/{batch-action-bar-BoqWIIpV.js → batch-action-bar-D6MZQNnC.js} +10 -10
  73. package/dist/{batch-action-bar-BoqWIIpV.js.map → batch-action-bar-D6MZQNnC.js.map} +1 -1
  74. package/dist/blocks/admin.js +242 -228
  75. package/dist/blocks/admin.js.map +1 -1
  76. package/dist/blocks/ai.js +395 -357
  77. package/dist/blocks/ai.js.map +1 -1
  78. package/dist/blocks/analytics/charts.js +1022 -0
  79. package/dist/blocks/analytics/charts.js.map +1 -0
  80. package/dist/blocks/analytics/usage-card.js +1 -1
  81. package/dist/blocks/analytics.js +171 -1365
  82. package/dist/blocks/analytics.js.map +1 -1
  83. package/dist/blocks/collaboration.js +1 -1
  84. package/dist/blocks/commerce/receipt.js +1 -1
  85. package/dist/blocks/commerce.js +1487 -1358
  86. package/dist/blocks/commerce.js.map +1 -1
  87. package/dist/blocks/data-display.js +2 -3
  88. package/dist/blocks/onboarding.js +91 -82
  89. package/dist/blocks/onboarding.js.map +1 -1
  90. package/dist/blocks/planning.js +25 -25
  91. package/dist/blocks/planning.js.map +1 -1
  92. package/dist/blocks/timelines.js +2 -2
  93. package/dist/{breadcrumbs-Bp9Ke7kd.js → breadcrumbs-CQ9JSlez.js} +52 -45
  94. package/dist/breadcrumbs-CQ9JSlez.js.map +1 -0
  95. package/dist/{button-ChBovTx0.js → button-rd6FiHfQ.js} +12 -8
  96. package/dist/button-rd6FiHfQ.js.map +1 -0
  97. package/dist/{buttons-DeW0bQeK.js → buttons-pZVgPTZn.js} +230 -246
  98. package/dist/buttons-pZVgPTZn.js.map +1 -0
  99. package/dist/{cards-CNXnmvV5.js → cards-CgWyqvgZ.js} +25 -22
  100. package/dist/{cards-CNXnmvV5.js.map → cards-CgWyqvgZ.js.map} +1 -1
  101. package/dist/cascader-Cf05pwaq.js +444 -0
  102. package/dist/cascader-Cf05pwaq.js.map +1 -0
  103. package/dist/{chart-I7ROnsl8.js → chart-CygRCyIZ.js} +5 -5
  104. package/dist/{chart-I7ROnsl8.js.map → chart-CygRCyIZ.js.map} +1 -1
  105. package/dist/{checkbox-MoyHIAPs.js → checkbox-Dy5_XBMZ.js} +4 -4
  106. package/dist/{checkbox-MoyHIAPs.js.map → checkbox-Dy5_XBMZ.js.map} +1 -1
  107. package/dist/{choice-inputs-DHGtx0QV.js → choice-inputs-oJEsrb5Y.js} +113 -114
  108. package/dist/choice-inputs-oJEsrb5Y.js.map +1 -0
  109. package/dist/{code-block-BSJyq9e-.js → code-block-BrLD7mCi.js} +44 -60
  110. package/dist/code-block-BrLD7mCi.js.map +1 -0
  111. package/dist/collapsible-CRCCg_bO.js +80 -0
  112. package/dist/collapsible-CRCCg_bO.js.map +1 -0
  113. package/dist/{collection-content-CSnwtOTH.js → collection-content-D7SoDlYd.js} +3 -3
  114. package/dist/{collection-content-CSnwtOTH.js.map → collection-content-D7SoDlYd.js.map} +1 -1
  115. package/dist/combobox-Dl6f6kHz.js +362 -0
  116. package/dist/combobox-Dl6f6kHz.js.map +1 -0
  117. package/dist/combobox-DrDXtSSt.js +929 -0
  118. package/dist/combobox-DrDXtSSt.js.map +1 -0
  119. package/dist/command-CjZ2VzKC.js +432 -0
  120. package/dist/command-CjZ2VzKC.js.map +1 -0
  121. package/dist/comments-C2MZyRmh.js +1214 -0
  122. package/dist/comments-C2MZyRmh.js.map +1 -0
  123. package/dist/components/base/accordion/accordion.d.ts +11 -3
  124. package/dist/components/base/action-menu/action-menu.d.ts +11 -3
  125. package/dist/components/base/buttons/button.d.ts +2 -2
  126. package/dist/components/base/buttons/index.d.ts +1 -1
  127. package/dist/components/base/buttons/loader-button.d.ts +6 -15
  128. package/dist/components/base/cards/index.d.ts +1 -1
  129. package/dist/components/base/cards/partials/card-body-context.d.ts +6 -0
  130. package/dist/components/base/cards/smart-card.d.ts +0 -2
  131. package/dist/components/base/cards/smart-card.types.d.ts +12 -10
  132. package/dist/components/base/cascader/cascader.d.ts +8 -2
  133. package/dist/components/base/cascader/cascader.types.d.ts +24 -2
  134. package/dist/components/base/cascader/index.d.ts +1 -1
  135. package/dist/components/base/choice-inputs/switch.d.ts +1 -1
  136. package/dist/components/base/code-block/use-code-copy.d.ts +2 -6
  137. package/dist/components/base/command/command.d.ts +1 -1
  138. package/dist/components/base/date-pickers/datepicker.types.d.ts +1 -3
  139. package/dist/components/base/display/dialog.d.ts +3 -9
  140. package/dist/components/base/display/index.d.ts +2 -3
  141. package/dist/components/base/display/separator.d.ts +1 -1
  142. package/dist/components/base/feedback/alert.d.ts +2 -1
  143. package/dist/components/base/feedback/empty.d.ts +10 -2
  144. package/dist/components/base/forms/workflow.d.ts +2 -2
  145. package/dist/components/base/forms-numeric/dimensions-input.d.ts +9 -17
  146. package/dist/components/base/forms-numeric/index.d.ts +3 -3
  147. package/dist/components/base/item/item.types.d.ts +6 -2
  148. package/dist/components/base/metadata-list/index.d.ts +1 -3
  149. package/dist/components/base/metadata-list/metadata-list.d.ts +4 -1
  150. package/dist/components/base/navigation/index.d.ts +2 -2
  151. package/dist/components/base/navigation/language-switcher.d.ts +7 -6
  152. package/dist/components/base/navigation/navigation-tabs.d.ts +8 -1
  153. package/dist/components/base/navigation/page-header/index.d.ts +1 -1
  154. package/dist/components/base/navigation/page-header/page-header.d.ts +13 -17
  155. package/dist/components/base/navigation/pagination.d.ts +5 -5
  156. package/dist/components/base/popover/popover.recipes.d.ts +0 -1
  157. package/dist/components/base/qr-code/qr-code.d.ts +4 -0
  158. package/dist/components/base/repeaters/index.d.ts +1 -1
  159. package/dist/components/base/repeaters/key-value-editor.d.ts +4 -0
  160. package/dist/components/base/sheet/sheet.d.ts +6 -15
  161. package/dist/components/base/sidebar/index.d.ts +1 -6
  162. package/dist/components/base/sidebar/sidebar.d.ts +38 -10
  163. package/dist/components/base/skeleton/skeleton.d.ts +1 -1
  164. package/dist/components/base/structure/structure.types.d.ts +11 -2
  165. package/dist/components/base/text-inputs/index.d.ts +1 -1
  166. package/dist/components/base/tree/index.d.ts +1 -0
  167. package/dist/components/base/tree/tree.d.ts +2 -2
  168. package/dist/components/base/tree/tree.types.d.ts +7 -1
  169. package/dist/components/base/upload/file-upload.validation.d.ts +37 -1
  170. package/dist/components/base/upload/image-upload.d.ts +2 -0
  171. package/dist/components/base/upload/index.d.ts +3 -9
  172. package/dist/components/base/value-inputs/date-time-input.d.ts +4 -0
  173. package/dist/components/base/value-inputs/slider.d.ts +5 -2
  174. package/dist/components/blocks/admin/action-surfaces/index.d.ts +17 -4
  175. package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +9 -3
  176. package/dist/components/blocks/admin/index.d.ts +1 -1
  177. package/dist/components/blocks/ai/ai-artifact/ai-artifact.d.ts +1 -1
  178. package/dist/components/blocks/ai/ai-artifact/types.d.ts +9 -4
  179. package/dist/components/blocks/ai/ai-chain-of-thought/ai-chain-of-thought.d.ts +1 -1
  180. package/dist/components/blocks/ai/ai-chain-of-thought/types.d.ts +11 -1
  181. package/dist/components/blocks/ai/ai-citation/ai-citation.d.ts +1 -1
  182. package/dist/components/blocks/ai/ai-citation/types.d.ts +6 -0
  183. package/dist/components/blocks/ai/ai-confirmation/ai-confirmation.d.ts +1 -1
  184. package/dist/components/blocks/ai/ai-confirmation/types.d.ts +21 -5
  185. package/dist/components/blocks/ai/ai-feedback/types.d.ts +7 -2
  186. package/dist/components/blocks/ai/ai-inline-citation/types.d.ts +9 -3
  187. package/dist/components/blocks/ai/ai-package-info/ai-package-info.d.ts +1 -1
  188. package/dist/components/blocks/ai/ai-package-info/types.d.ts +6 -0
  189. package/dist/components/blocks/ai/ai-sources/ai-sources.d.ts +1 -1
  190. package/dist/components/blocks/ai/ai-sources/types.d.ts +8 -2
  191. package/dist/components/blocks/ai/ai-task/ai-task.d.ts +1 -1
  192. package/dist/components/blocks/ai/ai-task/types.d.ts +10 -1
  193. package/dist/components/blocks/ai/ai-tool-call/ai-tool-call.d.ts +1 -1
  194. package/dist/components/blocks/ai/ai-tool-call/types.d.ts +6 -0
  195. package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
  196. package/dist/components/blocks/analytics/activity-heatmap/types.d.ts +1 -1
  197. package/dist/components/blocks/analytics/analytics.strings.d.ts +2 -0
  198. package/dist/components/blocks/analytics/atoms/metric-trend-chip.d.ts +11 -1
  199. package/dist/components/blocks/analytics/chart-card/chart-card.d.ts +7 -5
  200. package/dist/components/blocks/analytics/charts/index.d.ts +27 -0
  201. package/dist/components/blocks/analytics/index.d.ts +17 -24
  202. package/dist/components/blocks/analytics/metric/metric.d.ts +5 -5
  203. package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +2 -2
  204. package/dist/components/blocks/analytics/types.d.ts +12 -3
  205. package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
  206. package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
  207. package/dist/components/blocks/commerce/address-card/types.d.ts +5 -16
  208. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +2 -2
  209. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +6 -4
  210. package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +0 -2
  211. package/dist/components/blocks/commerce/cart-summary/index.d.ts +2 -2
  212. package/dist/components/blocks/commerce/cart-summary/types.d.ts +9 -11
  213. package/dist/components/blocks/commerce/coupon-input/coupon-input.d.ts +1 -1
  214. package/dist/components/blocks/commerce/coupon-input/types.d.ts +7 -3
  215. package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +0 -2
  216. package/dist/components/blocks/commerce/discount-stack/index.d.ts +2 -2
  217. package/dist/components/blocks/commerce/discount-stack/types.d.ts +4 -6
  218. package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
  219. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +2 -0
  220. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-balance.d.ts +18 -0
  221. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-compact.d.ts +1 -1
  222. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-copy-button.d.ts +0 -1
  223. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-dark.d.ts +1 -1
  224. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-full.d.ts +1 -1
  225. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-illustrated.d.ts +1 -1
  226. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-minimal.d.ts +1 -1
  227. package/dist/components/blocks/commerce/giftcard-card/types.d.ts +16 -5
  228. package/dist/components/blocks/commerce/index.d.ts +8 -8
  229. package/dist/components/blocks/commerce/inventory-level/inventory-level.strings.d.ts +2 -0
  230. package/dist/components/blocks/commerce/inventory-level/types.d.ts +1 -1
  231. package/dist/components/blocks/commerce/inventory-section/types.d.ts +0 -5
  232. package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +6 -3
  233. package/dist/components/blocks/commerce/loyalty-points/loyalty-points.d.ts +1 -1
  234. package/dist/components/blocks/commerce/loyalty-points/types.d.ts +11 -5
  235. package/dist/components/blocks/commerce/order-status/order-status.d.ts +1 -1
  236. package/dist/components/blocks/commerce/order-status/types.d.ts +8 -8
  237. package/dist/components/blocks/commerce/order-timeline/order-timeline.d.ts +1 -1
  238. package/dist/components/blocks/commerce/order-timeline/types.d.ts +3 -1
  239. package/dist/components/blocks/commerce/payment-method/index.d.ts +2 -2
  240. package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +0 -8
  241. package/dist/components/blocks/commerce/payment-method/types.d.ts +0 -2
  242. package/dist/components/blocks/commerce/receipt/index.d.ts +1 -1
  243. package/dist/components/blocks/commerce/receipt/receipt-items.d.ts +1 -1
  244. package/dist/components/blocks/commerce/receipt/types.d.ts +10 -0
  245. package/dist/components/blocks/commerce/refund-status/index.d.ts +2 -2
  246. package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +0 -2
  247. package/dist/components/blocks/commerce/refund-status/types.d.ts +0 -2
  248. package/dist/components/blocks/commerce/seo-listing/types.d.ts +7 -0
  249. package/dist/components/blocks/commerce/shared/code-entry.d.ts +39 -0
  250. package/dist/components/blocks/commerce/shared/order-status.d.ts +1 -1
  251. package/dist/components/blocks/commerce/subscription-summary/subscription-summary.d.ts +1 -1
  252. package/dist/components/blocks/commerce/subscription-summary/types.d.ts +10 -1
  253. package/dist/components/blocks/commerce/upcoming-booking/index.d.ts +2 -1
  254. package/dist/components/blocks/commerce/upcoming-booking/types.d.ts +8 -0
  255. package/dist/components/blocks/commerce/upcoming-booking/upcoming-booking.d.ts +2 -2
  256. package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -5
  257. package/dist/components/blocks/commerce/voucher-entry/types.d.ts +6 -3
  258. package/dist/components/blocks/commerce/voucher-entry/voucher-entry.d.ts +1 -1
  259. package/dist/components/blocks/content-block-hooks.d.ts +22 -0
  260. package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +5 -1
  261. package/dist/components/blocks/data-display/dense-info-card/helpers.d.ts +3 -1
  262. package/dist/components/blocks/data-display/dense-info-card/index.d.ts +1 -1
  263. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-classification.d.ts +1 -1
  264. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-dashboard.d.ts +1 -1
  265. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-financial.d.ts +1 -1
  266. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-project.d.ts +1 -1
  267. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-score.d.ts +1 -1
  268. package/dist/components/blocks/data-display/dense-info-card/types.d.ts +12 -5
  269. package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +6 -0
  270. package/dist/components/blocks/data-display/index.d.ts +0 -1
  271. package/dist/components/blocks/data-display/relationship-card-frame.d.ts +1 -1
  272. package/dist/components/blocks/onboarding/checklist/checklist.types.d.ts +5 -3
  273. package/dist/components/blocks/planning/task-card.types.d.ts +7 -3
  274. package/dist/components/blocks/timelines/changelog/types.d.ts +2 -2
  275. package/dist/components/blocks/timelines/index.d.ts +2 -2
  276. package/dist/components/blocks/timelines/milestones/types.d.ts +2 -2
  277. package/dist/components/blocks/timelines/shared/timeline.d.ts +6 -0
  278. package/dist/components/blocks/timelines/steps-card/index.d.ts +2 -1
  279. package/dist/components/blocks/timelines/steps-card/steps-card.d.ts +2 -2
  280. package/dist/components/blocks/timelines/steps-card/types.d.ts +13 -1
  281. package/dist/components/features/activities/activities.strings.d.ts +5 -3
  282. package/dist/components/features/activities/activities.types.d.ts +28 -11
  283. package/dist/components/features/activities/hooks/use-activity-feed.d.ts +6 -0
  284. package/dist/components/features/activities/index.d.ts +1 -1
  285. package/dist/components/features/activities/partials/activity-headline.d.ts +5 -0
  286. package/dist/components/features/activities/partials/activity-row.d.ts +12 -13
  287. package/dist/components/features/activities/partials/row-layers.d.ts +7 -0
  288. package/dist/components/features/activities/relative-time.d.ts +18 -0
  289. package/dist/components/features/ai-chat/ai-chat.d.ts +6 -2
  290. package/dist/components/features/ai-chat/ai-chat.strings.d.ts +41 -2
  291. package/dist/components/features/ai-chat/ai-chat.types.d.ts +6 -0
  292. package/dist/components/features/ai-chat/partials/ai-chat-attachments-strip.d.ts +5 -1
  293. package/dist/components/features/ai-chat/partials/ai-chat-prompt-input.d.ts +2 -2
  294. package/dist/components/features/ai-chat/partials/ai-chat-queue.d.ts +3 -1
  295. package/dist/components/features/ai-chat/partials/ai-chat-suggestions-row.d.ts +6 -1
  296. package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
  297. package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +19 -5
  298. package/dist/components/features/appointment-calendar/index.d.ts +1 -1
  299. package/dist/components/features/appointment-calendar/partials/appointment-agenda.d.ts +18 -10
  300. package/dist/components/features/async-preview/async-preview.d.ts +2 -2
  301. package/dist/components/features/async-preview/async-preview.types.d.ts +30 -1
  302. package/dist/components/features/async-preview/preview-trigger-cell.d.ts +7 -2
  303. package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
  304. package/dist/components/features/combobox/combobox.d.ts +12 -3
  305. package/dist/components/features/combobox/components/error-message.d.ts +3 -1
  306. package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +2 -2
  307. package/dist/components/features/combobox/index.d.ts +1 -1
  308. package/dist/components/features/combobox/types.d.ts +47 -45
  309. package/dist/components/features/comments/comments.strings.d.ts +6 -5
  310. package/dist/components/features/comments/comments.types.d.ts +40 -26
  311. package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -1
  312. package/dist/components/features/comments/hooks/use-comments.d.ts +8 -1
  313. package/dist/components/features/data-view/data-view.strings.d.ts +9 -2
  314. package/dist/components/features/data-view/data-view.types.d.ts +15 -2
  315. package/dist/components/features/email-composer/email-html.d.ts +5 -0
  316. package/dist/components/features/email-composer/http.d.ts +2 -0
  317. package/dist/components/features/email-composer/strings.d.ts +17 -2
  318. package/dist/components/features/email-composer/types.d.ts +17 -2
  319. package/dist/components/features/email-composer/use-composer.d.ts +2 -78
  320. package/dist/components/features/event-calendar/event-calendar-day-cell.d.ts +1 -1
  321. package/dist/components/features/event-calendar/event-calendar-event-badge.d.ts +1 -1
  322. package/dist/components/features/event-calendar/event-calendar-header.d.ts +1 -1
  323. package/dist/components/features/event-calendar/event-calendar-legend.d.ts +2 -2
  324. package/dist/components/features/event-calendar/event-calendar.d.ts +1 -1
  325. package/dist/components/features/event-calendar/event-calendar.types.d.ts +126 -21
  326. package/dist/components/features/filters/facets/range-facet.d.ts +13 -8
  327. package/dist/components/features/filters/filter-context.d.ts +9 -0
  328. package/dist/components/features/filters/filters.strings.d.ts +36 -3
  329. package/dist/components/features/filters/filters.types.d.ts +72 -5
  330. package/dist/components/features/filters/hooks/use-filter-draft.d.ts +1 -0
  331. package/dist/components/features/filters/index.d.ts +2 -2
  332. package/dist/components/features/filters/operator-options.d.ts +25 -2
  333. package/dist/components/features/filters/partials/active-filter-item.d.ts +0 -13
  334. package/dist/components/features/filters/partials/async-options-status.d.ts +32 -0
  335. package/dist/components/features/filters/partials/filter-draft-footer.d.ts +11 -0
  336. package/dist/components/features/filters/partials/filter-operator-select.d.ts +4 -2
  337. package/dist/components/features/filters/partials/filter-pill.d.ts +5 -1
  338. package/dist/components/features/filters/partials/filter-tabs.d.ts +2 -1
  339. package/dist/components/features/filters/partials/regular-filter-content.d.ts +1 -1
  340. package/dist/components/features/filters/utils/filter-utils.d.ts +29 -4
  341. package/dist/components/features/global-search/global-search-dialog.d.ts +7 -1
  342. package/dist/components/features/global-search/global-search.d.ts +7 -1
  343. package/dist/components/features/global-search/global-search.strings.d.ts +19 -3
  344. package/dist/components/features/global-search/global-search.types.d.ts +30 -6
  345. package/dist/components/features/global-search/index.d.ts +1 -1
  346. package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +6 -1
  347. package/dist/components/features/global-search/partials/global-search-input.d.ts +2 -0
  348. package/dist/components/features/kanban/index.d.ts +2 -2
  349. package/dist/components/features/kanban/kanban-context.d.ts +4 -0
  350. package/dist/components/features/kanban/kanban-keyboard.d.ts +7 -2
  351. package/dist/components/features/kanban/kanban.d.ts +10 -1
  352. package/dist/components/features/kanban/kanban.strings.d.ts +11 -2
  353. package/dist/components/features/kanban/kanban.types.d.ts +26 -0
  354. package/dist/components/features/map/map.d.ts +4 -0
  355. package/dist/components/features/map/place-autocomplete.d.ts +10 -1
  356. package/dist/components/features/media-library/hooks/use-media-library.d.ts +3 -1
  357. package/dist/components/features/media-library/media-library.d.ts +1 -1
  358. package/dist/components/features/media-library/media-library.strings.d.ts +33 -3
  359. package/dist/components/features/media-library/media-library.types.d.ts +47 -2
  360. package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
  361. package/dist/components/features/mentions/hooks/use-mentions-search.d.ts +7 -0
  362. package/dist/components/features/mentions/index.d.ts +1 -1
  363. package/dist/components/features/mentions/mentions.strings.d.ts +10 -2
  364. package/dist/components/features/mentions/partials/mention-chip.d.ts +1 -0
  365. package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +8 -1
  366. package/dist/components/features/mentions/partials/mention-picker.d.ts +8 -1
  367. package/dist/components/features/mentions/partials/mention-search-error.d.ts +6 -0
  368. package/dist/components/features/mentions/utils/index.d.ts +0 -1
  369. package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
  370. package/dist/components/features/overlays/dialog.d.ts +1 -1
  371. package/dist/components/features/overlays/drawer.d.ts +1 -1
  372. package/dist/components/features/overlays/index.d.ts +2 -2
  373. package/dist/components/features/overlays/overlays.strings.d.ts +2 -1
  374. package/dist/components/features/overlays/overlays.types.d.ts +27 -10
  375. package/dist/components/features/products/components/index.d.ts +0 -10
  376. package/dist/components/features/products/components/product-contract-overview.d.ts +1 -1
  377. package/dist/components/features/products/components/product-details-card.d.ts +1 -1
  378. package/dist/components/features/products/components/product-operations-card.d.ts +1 -1
  379. package/dist/components/features/products/components/product-option-action-menu.d.ts +1 -1
  380. package/dist/components/features/products/components/product-options-summary.d.ts +1 -1
  381. package/dist/components/features/products/components/product-policies-card.d.ts +1 -1
  382. package/dist/components/features/products/components/product-quote-preview-card.d.ts +1 -1
  383. package/dist/components/features/products/components/product-readiness-card.d.ts +1 -1
  384. package/dist/components/features/products/components/product-structure-card.d.ts +1 -1
  385. package/dist/components/features/products/components/product-variant-action-menu.d.ts +1 -1
  386. package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
  387. package/dist/components/features/products/components/product-variants-table.d.ts +1 -1
  388. package/dist/components/features/products/partials/product-surface.d.ts +15 -0
  389. package/dist/components/features/products/products.strings.d.ts +8 -0
  390. package/dist/components/features/products/products.types.d.ts +25 -7
  391. package/dist/components/features/questionnaire/questionnaire.types.d.ts +6 -4
  392. package/dist/components/features/resource/index.d.ts +2 -3
  393. package/dist/components/features/resource/resource.d.ts +2 -10
  394. package/dist/components/features/resource/resource.types.d.ts +7 -149
  395. package/dist/components/features/resource-assignment/partials/assignment-surface.d.ts +15 -0
  396. package/dist/components/features/resource-assignment/resource-assignment.strings.d.ts +6 -1
  397. package/dist/components/features/resource-assignment/resource-assignment.types.d.ts +6 -0
  398. package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +5 -7
  399. package/dist/components/features/rich-text-editor/partials/html-helpers.d.ts +2 -3
  400. package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +6 -2
  401. package/dist/components/features/rich-text-editor/partials/index.d.ts +2 -3
  402. package/dist/components/features/rich-text-editor/partials/rich-text-editor-tiptap.d.ts +0 -1
  403. package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +2 -3
  404. package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +13 -1
  405. package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +5 -0
  406. package/dist/components/features/schema-form/schema-form.d.ts +1 -1
  407. package/dist/components/features/schema-form/schema-form.types.d.ts +13 -5
  408. package/dist/components/features/suggestions/suggestions.strings.d.ts +14 -0
  409. package/dist/components/features/suggestions/suggestions.types.d.ts +12 -4
  410. package/dist/components/features/table/data-table.d.ts +1 -1
  411. package/dist/components/features/table/filter-bar.d.ts +1 -1
  412. package/dist/components/features/table/pagination.d.ts +1 -1
  413. package/dist/components/features/table/partials/cell-value.d.ts +1 -1
  414. package/dist/components/features/table/table-body.d.ts +1 -1
  415. package/dist/components/features/table/table-header.d.ts +1 -1
  416. package/dist/components/features/table/table-helpers.d.ts +31 -9
  417. package/dist/components/features/table/table-region.recipes.d.ts +11 -0
  418. package/dist/components/features/table/table-toolbar.d.ts +1 -1
  419. package/dist/components/features/table/table.strings.d.ts +1 -0
  420. package/dist/components/features/table/table.types.d.ts +74 -48
  421. package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +4 -0
  422. package/dist/components/features/theme-tweaker/theme-tweaker.strings.d.ts +10 -7
  423. package/dist/components/features/theme-tweaker/theme-tweaker.utils.d.ts +17 -0
  424. package/dist/components/layout/app-shell/app-shell.types.d.ts +46 -49
  425. package/dist/components/layout/app-shell/index.d.ts +2 -2
  426. package/dist/components/layout/app-shell/shell-regions.d.ts +9 -0
  427. package/dist/components/layout/app-shell/shell-skip-link.d.ts +9 -0
  428. package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
  429. package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
  430. package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
  431. package/dist/components/layout/auth/auth-shell.d.ts +1 -1
  432. package/dist/components/layout/auth/auth.types.d.ts +0 -5
  433. package/dist/components/layout/containers/inline-gutter-context.d.ts +7 -0
  434. package/dist/components/layout/containers/main-landmark-context.d.ts +6 -0
  435. package/dist/components/layout/header/header.types.d.ts +16 -6
  436. package/dist/components/layout/header/partials/header-global-search-trigger.d.ts +1 -1
  437. package/dist/components/layout/header/partials/header-notifications.d.ts +1 -1
  438. package/dist/components/layout/header/partials/header-search.d.ts +1 -1
  439. package/dist/components/layout/hooks/use-command-shortcut.d.ts +10 -1
  440. package/dist/components/layout/layout.types.d.ts +2 -2
  441. package/dist/components/layout/navigation/breadcrumb-progress/breadcrumb-progress.d.ts +1 -1
  442. package/dist/components/layout/navigation/breadcrumb-progress/types.d.ts +9 -0
  443. package/dist/components/layout/navigation/section-nav/section-nav.d.ts +8 -1
  444. package/dist/components/layout/page/index.d.ts +2 -3
  445. package/dist/components/layout/page/page.strings.d.ts +12 -0
  446. package/dist/components/layout/page/page.types.d.ts +7 -110
  447. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  448. package/dist/components/layout/settings/index.d.ts +1 -1
  449. package/dist/components/layout/settings/settings.d.ts +3 -5
  450. package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
  451. package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
  452. package/dist/components/layout/sidebar/components/sidebar-navigation-footer.d.ts +1 -1
  453. package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
  454. package/dist/components/layout/sidebar/index.d.ts +1 -1
  455. package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +15 -7
  456. package/dist/components/layout/sidebar/sidebar.types.d.ts +10 -12
  457. package/dist/components/layout/sidebar/sidebar.utils.d.ts +4 -0
  458. package/dist/components/layout/workspace/workspace.strings.d.ts +2 -2
  459. package/dist/components/layout/workspace/workspace.types.d.ts +13 -7
  460. package/dist/components/primitives/date.d.ts +22 -3
  461. package/dist/components/primitives/file-size.d.ts +8 -2
  462. package/dist/components/primitives/index.d.ts +1 -1
  463. package/dist/components/primitives/initials.d.ts +3 -1
  464. package/dist/components/primitives/link.d.ts +8 -1
  465. package/dist/components/primitives/money.d.ts +1 -1
  466. package/dist/components/primitives/number.d.ts +2 -1
  467. package/dist/components/typography/heading.d.ts +9 -3
  468. package/dist/components/typography/index.d.ts +1 -1
  469. package/dist/components/typography/text-link.d.ts +10 -3
  470. package/dist/components/ui/badge.d.ts +2 -4
  471. package/dist/components/ui/breadcrumb.d.ts +2 -3
  472. package/dist/components/ui/button.d.ts +8 -2
  473. package/dist/components/ui/collapsible.d.ts +1 -4
  474. package/dist/components/ui/command.d.ts +20 -18
  475. package/dist/components/ui/dialog.d.ts +3 -9
  476. package/dist/components/ui/empty.d.ts +2 -2
  477. package/dist/components/ui/input-group.d.ts +3 -3
  478. package/dist/components/ui/item.d.ts +3 -3
  479. package/dist/components/ui/popover.d.ts +3 -7
  480. package/dist/components/ui/sheet.d.ts +4 -12
  481. package/dist/components/ui/sidebar-state.d.ts +6 -1
  482. package/dist/components/ui/sidebar.d.ts +7 -4
  483. package/dist/components/ui/tabs.d.ts +2 -2
  484. package/dist/components/ui/toggle-group.d.ts +3 -3
  485. package/dist/components/ui/toggle.d.ts +2 -2
  486. package/dist/components/ui/tooltip.d.ts +1 -3
  487. package/dist/{containers-CSdc32h9.js → containers-BdfLTP4w.js} +37 -32
  488. package/dist/containers-BdfLTP4w.js.map +1 -0
  489. package/dist/content-block-hooks-Z3iKjqd1.js +17 -0
  490. package/dist/content-block-hooks-Z3iKjqd1.js.map +1 -0
  491. package/dist/{copyable-3fdHfMR3.js → copyable-Bmr14W0d.js} +6 -6
  492. package/dist/{copyable-3fdHfMR3.js.map → copyable-Bmr14W0d.js.map} +1 -1
  493. package/dist/{data-display-Cmj-xZYl.js → data-display-CWe9SOYh.js} +264 -251
  494. package/dist/data-display-CWe9SOYh.js.map +1 -0
  495. package/dist/date-3qsCE1ID.js +209 -0
  496. package/dist/date-3qsCE1ID.js.map +1 -0
  497. package/dist/{date-picker-CyQlFYsP.js → date-picker-D1keJQIG.js} +129 -129
  498. package/dist/date-picker-D1keJQIG.js.map +1 -0
  499. package/dist/date-pickers-D8aJoeHc.js +185 -0
  500. package/dist/date-pickers-D8aJoeHc.js.map +1 -0
  501. package/dist/disclosure-panel-B0HFNZ9x.js.map +1 -1
  502. package/dist/{display-CT_N2a3w.js → display-VlmP1I0i.js} +23 -46
  503. package/dist/display-VlmP1I0i.js.map +1 -0
  504. package/dist/{dropdown-menu-C08iIugv.js → dropdown-menu-B8hjvbkS.js} +9 -9
  505. package/dist/{dropdown-menu-C08iIugv.js.map → dropdown-menu-B8hjvbkS.js.map} +1 -1
  506. package/dist/dropzone-CHBNK3de.js +116 -0
  507. package/dist/dropzone-CHBNK3de.js.map +1 -0
  508. package/dist/features/activities.js +682 -628
  509. package/dist/features/activities.js.map +1 -1
  510. package/dist/features/ai-chat.js +258 -226
  511. package/dist/features/ai-chat.js.map +1 -1
  512. package/dist/features/appointment-calendar.js +436 -340
  513. package/dist/features/appointment-calendar.js.map +1 -1
  514. package/dist/features/async-preview.js +351 -265
  515. package/dist/features/async-preview.js.map +1 -1
  516. package/dist/features/combobox.js +2 -2
  517. package/dist/features/comments.js +1 -1
  518. package/dist/features/data-view.js +212 -151
  519. package/dist/features/data-view.js.map +1 -1
  520. package/dist/features/email-composer/engine.js +1 -1
  521. package/dist/features/email-composer.js +344 -315
  522. package/dist/features/email-composer.js.map +1 -1
  523. package/dist/features/event-calendar.js +504 -355
  524. package/dist/features/event-calendar.js.map +1 -1
  525. package/dist/features/filters.js +2 -2
  526. package/dist/features/global-search.js +250 -206
  527. package/dist/features/global-search.js.map +1 -1
  528. package/dist/features/kanban.js +269 -189
  529. package/dist/features/kanban.js.map +1 -1
  530. package/dist/features/map.js +385 -371
  531. package/dist/features/map.js.map +1 -1
  532. package/dist/features/media-library.js +1571 -1199
  533. package/dist/features/media-library.js.map +1 -1
  534. package/dist/features/mentions.js +2 -2
  535. package/dist/features/overlays.js +2 -2
  536. package/dist/features/products.js +1780 -1691
  537. package/dist/features/products.js.map +1 -1
  538. package/dist/features/questionnaire.js +165 -152
  539. package/dist/features/questionnaire.js.map +1 -1
  540. package/dist/features/resource-assignment.js +223 -191
  541. package/dist/features/resource-assignment.js.map +1 -1
  542. package/dist/features/resource.js +55 -220
  543. package/dist/features/resource.js.map +1 -1
  544. package/dist/features/rich-text-editor.js +3 -3
  545. package/dist/features/schema-form.js +280 -228
  546. package/dist/features/schema-form.js.map +1 -1
  547. package/dist/features/suggestions.js +48 -39
  548. package/dist/features/suggestions.js.map +1 -1
  549. package/dist/features/table.js +2 -2
  550. package/dist/features/theme-tweaker.js +723 -633
  551. package/dist/features/theme-tweaker.js.map +1 -1
  552. package/dist/feedback-DmqmXKLn.js +254 -0
  553. package/dist/feedback-DmqmXKLn.js.map +1 -0
  554. package/dist/{field-affordance-recipes-D6H7tVJi.js → field-affordance-recipes-DfbMadot.js} +13 -9
  555. package/dist/field-affordance-recipes-DfbMadot.js.map +1 -0
  556. package/dist/{field-state-recipes-7sza8QbC.js → field-state-recipes-EtCxpEy3.js} +6 -2
  557. package/dist/field-state-recipes-EtCxpEy3.js.map +1 -0
  558. package/dist/filters-BviMRMLS.js +2692 -0
  559. package/dist/filters-BviMRMLS.js.map +1 -0
  560. package/dist/{focus-recipes-B653VaLq.js → focus-recipes-DSkiUvUp.js} +3 -3
  561. package/dist/focus-recipes-DSkiUvUp.js.map +1 -0
  562. package/dist/{form-field-CAPdwdnZ.js → form-field-BdfCwSoQ.js} +5 -5
  563. package/dist/{form-field-CAPdwdnZ.js.map → form-field-BdfCwSoQ.js.map} +1 -1
  564. package/dist/{form-sizing-CgcrUbLU.js → form-sizing-DE_dZw32.js} +3 -3
  565. package/dist/{form-sizing-CgcrUbLU.js.map → form-sizing-DE_dZw32.js.map} +1 -1
  566. package/dist/{forms-B3W8CH7-.js → forms-B8DzJnBN.js} +35 -35
  567. package/dist/forms-B8DzJnBN.js.map +1 -0
  568. package/dist/forms-numeric-DOBswjKj.js +992 -0
  569. package/dist/forms-numeric-DOBswjKj.js.map +1 -0
  570. package/dist/{header-ZIIsRKxP.js → header-Cq3G0ZRP.js} +100 -95
  571. package/dist/header-Cq3G0ZRP.js.map +1 -0
  572. package/dist/{hooks-BitHSh-Y.js → hooks-DHfeSMAO.js} +34 -14
  573. package/dist/hooks-DHfeSMAO.js.map +1 -0
  574. package/dist/{http-D_6rOnzU.js → http-Cu-GPpss.js} +61 -35
  575. package/dist/http-Cu-GPpss.js.map +1 -0
  576. package/dist/{icon-badge-npxF1SLX.js → icon-badge-B0Kq7wom.js} +3 -3
  577. package/dist/{icon-badge-npxF1SLX.js.map → icon-badge-B0Kq7wom.js.map} +1 -1
  578. package/dist/index.js +6 -6
  579. package/dist/inline-gutter-context-CSqmrMFZ.js +11 -0
  580. package/dist/inline-gutter-context-CSqmrMFZ.js.map +1 -0
  581. package/dist/{input-DIREVYHs.js → input-2YrgTUrz.js} +3 -3
  582. package/dist/{input-DIREVYHs.js.map → input-2YrgTUrz.js.map} +1 -1
  583. package/dist/{input-7KAc7XQL.js → input-DfJyrjoR.js} +6 -6
  584. package/dist/{input-7KAc7XQL.js.map → input-DfJyrjoR.js.map} +1 -1
  585. package/dist/{interaction-recipes-4wZ2tvfb.js → interaction-recipes-DmuS1ase.js} +2 -2
  586. package/dist/{interaction-recipes-4wZ2tvfb.js.map → interaction-recipes-DmuS1ase.js.map} +1 -1
  587. package/dist/item-GJ9mvCcg.js +279 -0
  588. package/dist/item-GJ9mvCcg.js.map +1 -0
  589. package/dist/layout/app-shell.js +1 -1
  590. package/dist/layout/auth.js +1 -1
  591. package/dist/layout/containers.js +1 -1
  592. package/dist/layout/header.js +1 -1
  593. package/dist/layout/hooks.js +1 -1
  594. package/dist/layout/navigation.js +1 -1
  595. package/dist/layout/page.js +2 -2
  596. package/dist/layout/settings.js +2 -2
  597. package/dist/layout/sidebar.js +3 -3
  598. package/dist/layout/workspace.js +1 -1
  599. package/dist/layout.js +12 -12
  600. package/dist/{layout.types-E_GAApzO.js → layout.types-DbtnyAtd.js} +11 -8
  601. package/dist/layout.types-DbtnyAtd.js.map +1 -0
  602. package/dist/lib/anchored-positioning.d.ts +11 -0
  603. package/dist/lib/field-affordance-recipes.d.ts +10 -0
  604. package/dist/lib/field-state-recipes.d.ts +6 -0
  605. package/dist/lib/focus-recipes.d.ts +7 -0
  606. package/dist/lib/format.d.ts +25 -0
  607. package/dist/lib/money-format.d.ts +6 -0
  608. package/dist/lib/motion-recipes.d.ts +6 -0
  609. package/dist/lib/surface-recipes.d.ts +32 -2
  610. package/dist/lib/theme-scope.d.ts +17 -1
  611. package/dist/lib/token-merge.generated.d.ts +13 -19
  612. package/dist/lib/ui-provider/index.d.ts +1 -1
  613. package/dist/lib/ui-provider/types.d.ts +5 -0
  614. package/dist/lib/use-controllable-state.d.ts +16 -0
  615. package/dist/lib/use-copy-feedback.d.ts +15 -0
  616. package/dist/lib/utils.js +1 -1
  617. package/dist/lib/variant-props.d.ts +9 -0
  618. package/dist/main-landmark-context-BAsyqp2I.js +11 -0
  619. package/dist/main-landmark-context-BAsyqp2I.js.map +1 -0
  620. package/dist/mentions-zz0ewNIq.js +670 -0
  621. package/dist/mentions-zz0ewNIq.js.map +1 -0
  622. package/dist/{message-BJHnn43M.js → message-BiiVrRrm.js} +10 -7
  623. package/dist/{message-BJHnn43M.js.map → message-BiiVrRrm.js.map} +1 -1
  624. package/dist/{metadata-list-XkqZ_UXH.js → metadata-list-G85roWjS.js} +13 -12
  625. package/dist/metadata-list-G85roWjS.js.map +1 -0
  626. package/dist/{motion-recipes-DitYv6P2.js → motion-recipes-CUc_aHuG.js} +7 -4
  627. package/dist/motion-recipes-CUc_aHuG.js.map +1 -0
  628. package/dist/navigation-C0Be5C3i.js +304 -0
  629. package/dist/navigation-C0Be5C3i.js.map +1 -0
  630. package/dist/{navigation-Bt-v7rWP.js → navigation-CmqaQR_G.js} +99 -103
  631. package/dist/navigation-CmqaQR_G.js.map +1 -0
  632. package/dist/number-NFWKIoiK.js +340 -0
  633. package/dist/number-NFWKIoiK.js.map +1 -0
  634. package/dist/{overflow-tab-bar-BQCA2Zn2.js → overflow-tab-bar-DV7HE_3t.js} +8 -8
  635. package/dist/{overflow-tab-bar-BQCA2Zn2.js.map → overflow-tab-bar-DV7HE_3t.js.map} +1 -1
  636. package/dist/overlays-D-gAIfPF.js +1018 -0
  637. package/dist/overlays-D-gAIfPF.js.map +1 -0
  638. package/dist/page-D4pQhgSq.js +216 -0
  639. package/dist/page-D4pQhgSq.js.map +1 -0
  640. package/dist/{page-header-commands-DIKspJfx.js → page-header-commands-elelNOfd.js} +29 -29
  641. package/dist/{page-header-commands-DIKspJfx.js.map → page-header-commands-elelNOfd.js.map} +1 -1
  642. package/dist/{pagination-Br8TdV9A.js → pagination-BuSWw1US.js} +22 -23
  643. package/dist/pagination-BuSWw1US.js.map +1 -0
  644. package/dist/{popover-k8TdUcAt.js → popover-BpMxbqEK.js} +73 -69
  645. package/dist/popover-BpMxbqEK.js.map +1 -0
  646. package/dist/{popover-menu-yn-o0kyA.js → popover-menu-CO-_iiuz.js} +7 -7
  647. package/dist/{popover-menu-yn-o0kyA.js.map → popover-menu-CO-_iiuz.js.map} +1 -1
  648. package/dist/{popover.recipes-DJ0AkUan.js → popover.recipes-BqkdvlZn.js} +3 -4
  649. package/dist/{popover.recipes-DJ0AkUan.js.map → popover.recipes-BqkdvlZn.js.map} +1 -1
  650. package/dist/{portal-recipes-DyUXqUtD.js → portal-recipes-BPeS4rGB.js} +2 -2
  651. package/dist/{portal-recipes-DyUXqUtD.js.map → portal-recipes-BPeS4rGB.js.map} +1 -1
  652. package/dist/primitives-BlC1lXBr.js +447 -0
  653. package/dist/primitives-BlC1lXBr.js.map +1 -0
  654. package/dist/primitives.js +4 -4
  655. package/dist/{progress-DZFXXzPs.js → progress-RARK8AjB.js} +5 -5
  656. package/dist/{progress-DZFXXzPs.js.map → progress-RARK8AjB.js.map} +1 -1
  657. package/dist/receipt-CUf2Vegp.js +114 -0
  658. package/dist/receipt-CUf2Vegp.js.map +1 -0
  659. package/dist/{rich-text-BnTzZjIo.js → rich-text-Cypm9__d.js} +7 -8
  660. package/dist/{rich-text-BnTzZjIo.js.map → rich-text-Cypm9__d.js.map} +1 -1
  661. package/dist/rich-text-editor-Z6cQepsA.js +919 -0
  662. package/dist/rich-text-editor-Z6cQepsA.js.map +1 -0
  663. package/dist/rich-text-editor-toolbar-DYbRJARB.js +100 -0
  664. package/dist/rich-text-editor-toolbar-DYbRJARB.js.map +1 -0
  665. package/dist/rich-text-tree-DdKHIJx4.js +154 -0
  666. package/dist/rich-text-tree-DdKHIJx4.js.map +1 -0
  667. package/dist/safe-image-src-C6kQSMBZ.js +17 -0
  668. package/dist/safe-image-src-C6kQSMBZ.js.map +1 -0
  669. package/dist/{scroll-area-Bj6CRUif.js → scroll-area-B9HKbji0.js} +3 -3
  670. package/dist/{scroll-area-Bj6CRUif.js.map → scroll-area-B9HKbji0.js.map} +1 -1
  671. package/dist/{separator-DM6gs2vu.js → separator-DaDe26sf.js} +3 -3
  672. package/dist/separator-DaDe26sf.js.map +1 -0
  673. package/dist/{separator-B9ewiCGO.js → separator-KGsNXt2J.js} +2 -2
  674. package/dist/{separator-B9ewiCGO.js.map → separator-KGsNXt2J.js.map} +1 -1
  675. package/dist/services/actions/action-adapters.d.ts +5 -2
  676. package/dist/services/actions/index.d.ts +1 -1
  677. package/dist/services/actions.js +2 -2
  678. package/dist/services/actions.js.map +1 -1
  679. package/dist/settings-D5j_RJvT.js +160 -0
  680. package/dist/settings-D5j_RJvT.js.map +1 -0
  681. package/dist/sheet-B6j_BE9O.js +241 -0
  682. package/dist/sheet-B6j_BE9O.js.map +1 -0
  683. package/dist/{sidebar-CmD6a-HK.js → sidebar-C-iQ_TJP.js} +377 -351
  684. package/dist/sidebar-C-iQ_TJP.js.map +1 -0
  685. package/dist/sidebar-D5VO2W8S.js +715 -0
  686. package/dist/sidebar-D5VO2W8S.js.map +1 -0
  687. package/dist/{skeleton-DDgdhmu9.js → skeleton-Cab_KgVo.js} +12 -12
  688. package/dist/skeleton-Cab_KgVo.js.map +1 -0
  689. package/dist/{smart-card-B6vLxqa_.js → smart-card-C59z6KFO.js} +217 -210
  690. package/dist/smart-card-C59z6KFO.js.map +1 -0
  691. package/dist/{structure-DZJ2wbAU.js → structure-DElaQwwN.js} +2 -2
  692. package/dist/{structure-DZJ2wbAU.js.map → structure-DElaQwwN.js.map} +1 -1
  693. package/dist/style.css +1 -1
  694. package/dist/{surface-recipes-C8mNycaY.js → surface-recipes-DV6rrOFq.js} +10 -2
  695. package/dist/surface-recipes-DV6rrOFq.js.map +1 -0
  696. package/dist/{table-CXSPHH25.js → table-CSRUgpdK.js} +62 -61
  697. package/dist/table-CSRUgpdK.js.map +1 -0
  698. package/dist/table-DdXDBsR_.js +1657 -0
  699. package/dist/table-DdXDBsR_.js.map +1 -0
  700. package/dist/{tabs-C4Kr_hCr.js → tabs-WnHfV2pM.js} +27 -27
  701. package/dist/tabs-WnHfV2pM.js.map +1 -0
  702. package/dist/{text-inputs-jdkS3ReG.js → text-inputs-ljyBYaCd.js} +112 -112
  703. package/dist/text-inputs-ljyBYaCd.js.map +1 -0
  704. package/dist/theme.css +21 -5
  705. package/dist/timelines-mOmS9Eh3.js +479 -0
  706. package/dist/timelines-mOmS9Eh3.js.map +1 -0
  707. package/dist/tooltip-yjX-Uv-p.js +112 -0
  708. package/dist/tooltip-yjX-Uv-p.js.map +1 -0
  709. package/dist/{tree-CeYVzdFE.js → tree-YpkxUG2Z.js} +80 -72
  710. package/dist/tree-YpkxUG2Z.js.map +1 -0
  711. package/dist/typography/rich-text.js +1 -1
  712. package/dist/{typography-C7-YMW1S.js → typography-C0dELqYV.js} +46 -40
  713. package/dist/typography-C0dELqYV.js.map +1 -0
  714. package/dist/typography.js +1 -1
  715. package/dist/{ui-provider-C-74NVLc.js → ui-provider-Bu1S-o96.js} +4 -3
  716. package/dist/ui-provider-Bu1S-o96.js.map +1 -0
  717. package/dist/ui-provider.js +2 -2
  718. package/dist/{upload-Hdm5gObf.js → upload-DMuMYJFT.js} +276 -268
  719. package/dist/upload-DMuMYJFT.js.map +1 -0
  720. package/dist/{usage-card-9s8hLDfn.js → usage-card-DDPki5P1.js} +57 -54
  721. package/dist/usage-card-DDPki5P1.js.map +1 -0
  722. package/dist/use-controllable-state-BlP8SyBI.js +13 -0
  723. package/dist/use-controllable-state-BlP8SyBI.js.map +1 -0
  724. package/dist/use-copy-feedback-CzcaqlLf.js +28 -0
  725. package/dist/use-copy-feedback-CzcaqlLf.js.map +1 -0
  726. package/dist/use-metric-format-options-Dk4rC1NO.js +251 -0
  727. package/dist/use-metric-format-options-Dk4rC1NO.js.map +1 -0
  728. package/dist/{utils-DhuoqFy4.js → utils-BVbAG2J6.js} +98 -76
  729. package/dist/utils-BVbAG2J6.js.map +1 -0
  730. package/dist/value-inputs-h5MwjGCo.js +982 -0
  731. package/dist/value-inputs-h5MwjGCo.js.map +1 -0
  732. package/dist/value-typography-D15uwfj-.js +154 -0
  733. package/dist/value-typography-D15uwfj-.js.map +1 -0
  734. package/dist/workspace-DIryPqBt.js +400 -0
  735. package/dist/workspace-DIryPqBt.js.map +1 -0
  736. package/docs/consumer-skill/SKILL.md +7 -0
  737. package/docs/consumer-skill/agents/themelia-ui-designer.md +11 -2
  738. package/docs/consumer-skill/examples/analytics.tsx +1 -1
  739. package/docs/consumer-skill/examples/app-layout.tsx +3 -3
  740. package/docs/consumer-skill/examples/commerce-lines.tsx +7 -5
  741. package/docs/consumer-skill/examples/detail.tsx +3 -2
  742. package/docs/consumer-skill/examples/email-composer.tsx +1 -1
  743. package/docs/consumer-skill/examples/index-table.tsx +2 -2
  744. package/docs/consumer-skill/examples/scoped-directory.tsx +7 -6
  745. package/docs/consumer-skill/references/agents-md.md +20 -16
  746. package/docs/consumer-skill/references/analytics.md +20 -6
  747. package/docs/consumer-skill/references/building-views.md +213 -0
  748. package/docs/consumer-skill/references/catalogue.md +617 -0
  749. package/docs/consumer-skill/references/component-contracts.json +10202 -18084
  750. package/docs/consumer-skill/references/composition.md +21 -17
  751. package/docs/consumer-skill/references/discovery.md +8 -5
  752. package/docs/consumer-skill/references/installation.md +10 -4
  753. package/docs/consumer-skill/references/integration.md +5 -5
  754. package/docs/consumer-skill/references/product-composition.md +2 -2
  755. package/docs/consumer-skill/references/public-api.json +580 -633
  756. package/docs/consumer-skill/references/review.md +6 -4
  757. package/docs/consumer-skill/references/screen-archetypes.md +2 -2
  758. package/docs/consumer-skill/references/theming.md +1 -1
  759. package/docs/consumer-skill/references/tokens.json +4 -4
  760. package/docs/consumer-skill/references/workflows.md +7 -7
  761. package/docs/consumer-skill/scripts/composition-policy.mjs +40 -20
  762. package/docs/consumer-skill/scripts/composition.mjs +4 -1
  763. package/docs/consumer-skill/scripts/discovery.mjs +3 -1
  764. package/docs/consumer-skill/scripts/setup-skills.mjs +31 -4
  765. package/docs/consumer-skills/themelia-components/SKILL.md +8 -4
  766. package/docs/consumer-skills/themelia-composition/SKILL.md +7 -3
  767. package/docs/consumer-skills/themelia-design/SKILL.md +7 -1
  768. package/docs/consumer-skills/themelia-tokenization/SKILL.md +1 -1
  769. package/package.json +9 -12
  770. package/templates/README.md +3 -2
  771. package/templates/admin-shell-template.tsx +49 -9
  772. package/templates/analytics-operations-template.tsx +20 -24
  773. package/templates/customers-template.tsx +12 -9
  774. package/templates/index.ts +2 -8
  775. package/templates/orders-template.tsx +28 -24
  776. package/templates/products-template.tsx +14 -4
  777. package/templates/user-permissions-template.tsx +11 -14
  778. package/dist/accordion-0tQUZ20r.js.map +0 -1
  779. package/dist/action-menu-C0gjzLyE.js +0 -284
  780. package/dist/action-menu-C0gjzLyE.js.map +0 -1
  781. package/dist/ai-artifact-CGGpQryR.js +0 -1200
  782. package/dist/ai-artifact-CGGpQryR.js.map +0 -1
  783. package/dist/anchored-positioning-DPnKTvNs.js +0 -6
  784. package/dist/anchored-positioning-DPnKTvNs.js.map +0 -1
  785. package/dist/app-shell-EHuuRDGy.js +0 -321
  786. package/dist/app-shell-EHuuRDGy.js.map +0 -1
  787. package/dist/auth-B0girIk_.js.map +0 -1
  788. package/dist/badge-wWauMgAt.js.map +0 -1
  789. package/dist/base/sheet.js +0 -3
  790. package/dist/breadcrumbs-Bp9Ke7kd.js.map +0 -1
  791. package/dist/button-ChBovTx0.js.map +0 -1
  792. package/dist/buttons-DeW0bQeK.js.map +0 -1
  793. package/dist/cascader-CrAl9zD5.js +0 -439
  794. package/dist/cascader-CrAl9zD5.js.map +0 -1
  795. package/dist/choice-inputs-DHGtx0QV.js.map +0 -1
  796. package/dist/code-block-BSJyq9e-.js.map +0 -1
  797. package/dist/collapsible-BzJ91LUG.js +0 -81
  798. package/dist/collapsible-BzJ91LUG.js.map +0 -1
  799. package/dist/combobox-Bcvu5J8O.js +0 -363
  800. package/dist/combobox-Bcvu5J8O.js.map +0 -1
  801. package/dist/combobox-C2JiSQPc.js +0 -915
  802. package/dist/combobox-C2JiSQPc.js.map +0 -1
  803. package/dist/command-9e52NPgK.js +0 -425
  804. package/dist/command-9e52NPgK.js.map +0 -1
  805. package/dist/comments-BsgErEqd.js +0 -1174
  806. package/dist/comments-BsgErEqd.js.map +0 -1
  807. package/dist/components/base/buttons/tooltip-button.d.ts +0 -7
  808. package/dist/components/base/display/content-block.d.ts +0 -75
  809. package/dist/components/base/display/content-block.strings.d.ts +0 -5
  810. package/dist/components/base/sheet/index.d.ts +0 -29
  811. package/dist/components/blocks/ai/use-copy-feedback.d.ts +0 -6
  812. package/dist/components/blocks/data-display/metadata/index.d.ts +0 -30
  813. package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +0 -10
  814. package/dist/components/features/resource/resource.strings.d.ts +0 -12
  815. package/dist/components/features/rich-text-editor/partials/rich-text-editor-fallback.d.ts +0 -8
  816. package/dist/components/features/sync/index.d.ts +0 -26
  817. package/dist/components/features/sync/sync-range-dialog-form.d.ts +0 -5
  818. package/dist/components/features/sync/sync.strings.d.ts +0 -18
  819. package/dist/components/features/sync/sync.types.d.ts +0 -44
  820. package/dist/components/layout/page/partials/page-actions.d.ts +0 -3
  821. package/dist/components/ui/slot.d.ts +0 -6
  822. package/dist/containers-CSdc32h9.js.map +0 -1
  823. package/dist/data-display-Cmj-xZYl.js.map +0 -1
  824. package/dist/date-Br0FicVv.js +0 -144
  825. package/dist/date-Br0FicVv.js.map +0 -1
  826. package/dist/date-picker-CyQlFYsP.js.map +0 -1
  827. package/dist/date-pickers-tj2MXmXd.js +0 -185
  828. package/dist/date-pickers-tj2MXmXd.js.map +0 -1
  829. package/dist/display-CT_N2a3w.js.map +0 -1
  830. package/dist/features/sync.js +0 -142
  831. package/dist/features/sync.js.map +0 -1
  832. package/dist/feedback-Dzo1xtAU.js +0 -246
  833. package/dist/feedback-Dzo1xtAU.js.map +0 -1
  834. package/dist/field-affordance-recipes-D6H7tVJi.js.map +0 -1
  835. package/dist/field-state-recipes-7sza8QbC.js.map +0 -1
  836. package/dist/filters-Dl80yYtN.js +0 -2415
  837. package/dist/filters-Dl80yYtN.js.map +0 -1
  838. package/dist/focus-recipes-B653VaLq.js.map +0 -1
  839. package/dist/forms-B3W8CH7-.js.map +0 -1
  840. package/dist/forms-numeric-CwjQJe-O.js +0 -991
  841. package/dist/forms-numeric-CwjQJe-O.js.map +0 -1
  842. package/dist/header-ZIIsRKxP.js.map +0 -1
  843. package/dist/hooks-BitHSh-Y.js.map +0 -1
  844. package/dist/http-D_6rOnzU.js.map +0 -1
  845. package/dist/item-FfWnaYST.js +0 -278
  846. package/dist/item-FfWnaYST.js.map +0 -1
  847. package/dist/layout.types-E_GAApzO.js.map +0 -1
  848. package/dist/media-gallery-C81DAnKI.js +0 -203
  849. package/dist/media-gallery-C81DAnKI.js.map +0 -1
  850. package/dist/mentions-qOnedSt4.js +0 -639
  851. package/dist/mentions-qOnedSt4.js.map +0 -1
  852. package/dist/metadata-list-XkqZ_UXH.js.map +0 -1
  853. package/dist/motion-recipes-DitYv6P2.js.map +0 -1
  854. package/dist/navigation-BgtPJAhi.js +0 -288
  855. package/dist/navigation-BgtPJAhi.js.map +0 -1
  856. package/dist/navigation-Bt-v7rWP.js.map +0 -1
  857. package/dist/number-CYqBcrSj.js +0 -346
  858. package/dist/number-CYqBcrSj.js.map +0 -1
  859. package/dist/overlays-CC8zI3Du.js +0 -1017
  860. package/dist/overlays-CC8zI3Du.js.map +0 -1
  861. package/dist/page-BoQ1VaFJ.js +0 -331
  862. package/dist/page-BoQ1VaFJ.js.map +0 -1
  863. package/dist/pagination-Br8TdV9A.js.map +0 -1
  864. package/dist/popover-k8TdUcAt.js.map +0 -1
  865. package/dist/primitives-BkkQjYl7.js +0 -385
  866. package/dist/primitives-BkkQjYl7.js.map +0 -1
  867. package/dist/receipt-C7LhOg7Q.js +0 -116
  868. package/dist/receipt-C7LhOg7Q.js.map +0 -1
  869. package/dist/rich-text-editor-CAurDwT5.js +0 -1273
  870. package/dist/rich-text-editor-CAurDwT5.js.map +0 -1
  871. package/dist/rich-text-editor-toolbar-DbXig7Jk.js +0 -99
  872. package/dist/rich-text-editor-toolbar-DbXig7Jk.js.map +0 -1
  873. package/dist/rich-text-tree-BqyQ_7-R.js +0 -66
  874. package/dist/rich-text-tree-BqyQ_7-R.js.map +0 -1
  875. package/dist/sanitize-html-BWkH4dLM.js +0 -105
  876. package/dist/sanitize-html-BWkH4dLM.js.map +0 -1
  877. package/dist/separator-DM6gs2vu.js.map +0 -1
  878. package/dist/settings-DZPHgpx4.js +0 -155
  879. package/dist/settings-DZPHgpx4.js.map +0 -1
  880. package/dist/sheet-C4DHsgLk.js +0 -250
  881. package/dist/sheet-C4DHsgLk.js.map +0 -1
  882. package/dist/sidebar-C8BnDwTH.js +0 -709
  883. package/dist/sidebar-C8BnDwTH.js.map +0 -1
  884. package/dist/sidebar-CmD6a-HK.js.map +0 -1
  885. package/dist/skeleton-DDgdhmu9.js.map +0 -1
  886. package/dist/slot-CLF9kLrS.js +0 -16
  887. package/dist/slot-CLF9kLrS.js.map +0 -1
  888. package/dist/smart-card-B6vLxqa_.js.map +0 -1
  889. package/dist/surface-recipes-C8mNycaY.js.map +0 -1
  890. package/dist/table-CBonSdTp.js +0 -1584
  891. package/dist/table-CBonSdTp.js.map +0 -1
  892. package/dist/table-CXSPHH25.js.map +0 -1
  893. package/dist/tabs-C4Kr_hCr.js.map +0 -1
  894. package/dist/text-inputs-jdkS3ReG.js.map +0 -1
  895. package/dist/timelines-CoPwdJP0.js +0 -458
  896. package/dist/timelines-CoPwdJP0.js.map +0 -1
  897. package/dist/tooltip-31NwIpTo.js +0 -113
  898. package/dist/tooltip-31NwIpTo.js.map +0 -1
  899. package/dist/tree-CeYVzdFE.js.map +0 -1
  900. package/dist/typography-C7-YMW1S.js.map +0 -1
  901. package/dist/ui-provider-C-74NVLc.js.map +0 -1
  902. package/dist/upload-Hdm5gObf.js.map +0 -1
  903. package/dist/upload-queue-D0sYPuqo.js +0 -409
  904. package/dist/upload-queue-D0sYPuqo.js.map +0 -1
  905. package/dist/usage-card-9s8hLDfn.js.map +0 -1
  906. package/dist/utils-DhuoqFy4.js.map +0 -1
  907. package/dist/value-inputs-D3aPgq9H.js +0 -980
  908. package/dist/value-inputs-D3aPgq9H.js.map +0 -1
  909. package/dist/value-typography-uSzzG9Gf.js +0 -122
  910. package/dist/value-typography-uSzzG9Gf.js.map +0 -1
  911. package/dist/workspace-CC8Vchiu.js +0 -411
  912. package/dist/workspace-CC8Vchiu.js.map +0 -1
@@ -1,2415 +0,0 @@
1
- "use client";
2
- import { S as e, d as t } from "./ui-provider-C-74NVLc.js";
3
- import { useStrings as n } from "./lib/strings.js";
4
- import { t as r } from "./utils-DhuoqFy4.js";
5
- import { n as i } from "./buttons-DeW0bQeK.js";
6
- import { a, c as o, o as s } from "./typography-C7-YMW1S.js";
7
- import { t as c } from "./focus-recipes-B653VaLq.js";
8
- import { r as l, t as u } from "./structure-DZJ2wbAU.js";
9
- import { i as d } from "./tone-recipes-BPsRAvhu.js";
10
- import { n as f, t as p } from "./feedback-Dzo1xtAU.js";
11
- import { i as m, r as h } from "./popover.recipes-DJ0AkUan.js";
12
- import { _ as g, m as _ } from "./primitives-BkkQjYl7.js";
13
- import { t as v } from "./number-CYqBcrSj.js";
14
- import { n as y, s as b, t as x } from "./date-Br0FicVv.js";
15
- import { t as S } from "./badge-wWauMgAt.js";
16
- import { t as C } from "./layer-recipes-CCpklYME.js";
17
- import { n as w } from "./field-affordance-recipes-D6H7tVJi.js";
18
- import { a as T, i as E, n as D, o as O, r as k, s as A, t as j } from "./command-9e52NPgK.js";
19
- import { d as M, p as N, y as P } from "./form-sizing-CgcrUbLU.js";
20
- import { t as F } from "./input-7KAc7XQL.js";
21
- import { t as I } from "./date-picker-CyQlFYsP.js";
22
- import { a as ee, c as te, i as L, n as R, o as ne, r as z, t as re } from "./popover-k8TdUcAt.js";
23
- import { n as ie, r as ae, t as oe } from "./control-group-recipes-fMuFo0H7.js";
24
- import { i as se, r as ce, t as le } from "./tabs-C4Kr_hCr.js";
25
- import { t as ue } from "./popover-menu-yn-o0kyA.js";
26
- import { t as de } from "./use-debounced-callback-Cx1h-hdv.js";
27
- import { t as fe } from "./use-debounce-DZ_1ZBPa.js";
28
- import { i as pe, n as me, r as he, t as ge } from "./cascader-CrAl9zD5.js";
29
- import B, { Component as _e, createContext as ve, useCallback as V, useContext as ye, useEffect as H, useId as be, useMemo as U, useRef as W, useState as G } from "react";
30
- import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
31
- import { CalendarIcon as xe, Check as Se, ChevronDown as Ce, ChevronLeft as we, ChevronsUpDown as Te, Filter as Ee, Loader2 as De, Plus as Oe, X as ke } from "lucide-react";
32
- import { format as Ae, isValid as je, parse as Me } from "date-fns";
33
- //#region src/components/features/filters/filters.strings.ts
34
- var Ne = {
35
- loading: "Loading",
36
- loadingOptions: "Loading {filterLabel} options...",
37
- addFilter: "Add filter",
38
- clear: "Clear",
39
- confirm: "Confirm",
40
- clearFilters: "Clear filters",
41
- clearAll: "Clear all",
42
- selectDate: "Select date",
43
- selectDateRange: "Select date range",
44
- calendar: {
45
- dateSelected: "Date selected",
46
- notDateSelected: "No date selected",
47
- notDateRangeSelected: "No date range selected",
48
- selectedEndDate: "Select end date",
49
- today: "Today",
50
- yesterday: "Yesterday",
51
- lastSevenDays: "Last 7 days",
52
- lastThirtyDays: "Last 30 days",
53
- thisMonth: "This month",
54
- lastMonth: "Last month",
55
- thisYear: "This year",
56
- lastYear: "Last year",
57
- customRange: "Custom range"
58
- },
59
- selectValues: "Select values",
60
- searchPlaceholder: "Search {filterLabel}...",
61
- noOptionsFound: "No options found",
62
- selected: "{count} {filterLabel} selected",
63
- nothingSelected: "Nothing selected",
64
- enterTag: "Enter tag",
65
- addTag: "Add tag",
66
- removeTag: "Remove",
67
- tag: "tag",
68
- tags: "tags",
69
- enterTags: "Enter tags",
70
- searchFilters: "Search filters...",
71
- noFiltersAvailable: "No filters available",
72
- availableFilters: "Available filters",
73
- activeFilters: "Active filters",
74
- clearSearch: "Clear search",
75
- backToFilters: "Back to filters",
76
- previousLevel: "Back",
77
- selectCurrentLevel: "Select this level",
78
- select: "Select",
79
- options: "options",
80
- operator: "Operator",
81
- operators: {
82
- contains: "contains",
83
- equals: "is",
84
- notContains: "does not contain",
85
- is: "is",
86
- isNot: "is not",
87
- greaterThan: "greater than",
88
- lessThan: "less than",
89
- before: "before",
90
- after: "after",
91
- between: "between",
92
- has: "has",
93
- hasAny: "has any",
94
- hasAll: "has all"
95
- },
96
- min: "Min",
97
- max: "Max",
98
- fetchError: "Failed to load options",
99
- retryFetch: "Retry",
100
- minQueryHint: "Type at least {min} characters...",
101
- searching: "Searching...",
102
- error: {
103
- title: "Filter error",
104
- descriptionWithKey: "There was a problem with \"{filterKey}\" filter.",
105
- generic: "There was a problem loading this filter.",
106
- unknown: "Unknown error"
107
- },
108
- validation: {
109
- required: "This filter is required",
110
- minValue: "Value must be at least {min}",
111
- maxValue: "Value must be at most {max}",
112
- invalidFormat: "Invalid format"
113
- }
114
- };
115
- function Y(e, t) {
116
- return e.replace(/{(\w+)}/g, (e, n) => String(t[n] ?? e)).replace(/:(\w+)/g, (e, n) => t[n] === void 0 ? e : String(t[n]));
117
- }
118
- function Pe(e, t, n) {
119
- let r = t.split("."), i = e;
120
- for (let e of r) {
121
- if (typeof i != "object" || !i) return t;
122
- i = i[e];
123
- }
124
- return typeof i == "string" ? n ? Y(i, n) : i : t;
125
- }
126
- //#endregion
127
- //#region src/components/features/filters/filters.types.ts
128
- var X = {
129
- SELECT: "select",
130
- MULTI_SELECT: "multi_select",
131
- ASYNC_SELECT: "async_select",
132
- SEARCH: "search",
133
- RANGE: "range",
134
- DATE: "date",
135
- TAGS: "tags"
136
- }, Z = {
137
- EQUALS: "equals",
138
- CONTAINS: "contains",
139
- IN: "in",
140
- NOT_IN: "not_in",
141
- NOT: "not",
142
- BEFORE: "before",
143
- AFTER: "after",
144
- BETWEEN: "between",
145
- GT: "gt",
146
- LT: "lt",
147
- GTE: "gte",
148
- LTE: "lte",
149
- HAS: "has",
150
- HAS_ANY: "has_any",
151
- HAS_ALL: "has_all"
152
- };
153
- function Fe(e) {
154
- return e;
155
- }
156
- //#endregion
157
- //#region src/components/features/filters/operator-options.ts
158
- function Ie(e) {
159
- return [
160
- {
161
- label: e.contains,
162
- value: Z.CONTAINS
163
- },
164
- {
165
- label: e.equals,
166
- value: Z.EQUALS
167
- },
168
- {
169
- label: e.notContains,
170
- value: Z.NOT
171
- }
172
- ];
173
- }
174
- function Le(e) {
175
- return [{
176
- label: e.is,
177
- value: Z.EQUALS
178
- }, {
179
- label: e.isNot,
180
- value: Z.NOT
181
- }];
182
- }
183
- function Re(e) {
184
- return [
185
- {
186
- label: e.equals,
187
- value: Z.EQUALS
188
- },
189
- {
190
- label: e.greaterThan,
191
- value: Z.GT
192
- },
193
- {
194
- label: e.lessThan,
195
- value: Z.LT
196
- }
197
- ];
198
- }
199
- function ze(e) {
200
- return [
201
- {
202
- label: e.before,
203
- value: Z.BEFORE
204
- },
205
- {
206
- label: e.after,
207
- value: Z.AFTER
208
- },
209
- {
210
- label: e.between,
211
- value: Z.BETWEEN
212
- }
213
- ];
214
- }
215
- function Be(e) {
216
- return [{
217
- label: e.equals,
218
- value: Z.EQUALS
219
- }];
220
- }
221
- function Ve(e, t) {
222
- switch (e) {
223
- case X.SEARCH: return Ie(t);
224
- case X.TAGS: return [
225
- {
226
- label: t.has,
227
- value: Z.HAS
228
- },
229
- {
230
- label: t.hasAny,
231
- value: Z.HAS_ANY
232
- },
233
- {
234
- label: t.hasAll,
235
- value: Z.HAS_ALL
236
- }
237
- ];
238
- case X.SELECT:
239
- case X.ASYNC_SELECT: return Le(t);
240
- case X.RANGE: return [{
241
- label: t.between,
242
- value: Z.BETWEEN
243
- }];
244
- case X.DATE: return ze(t);
245
- default: return Ie(t);
246
- }
247
- }
248
- function He(e) {
249
- switch (e) {
250
- case X.SEARCH: return Z.CONTAINS;
251
- case X.TAGS: return Z.HAS;
252
- case X.SELECT:
253
- case X.ASYNC_SELECT: return Z.EQUALS;
254
- case X.RANGE: return Z.BETWEEN;
255
- case X.DATE: return Z.BEFORE;
256
- default: return Z.EQUALS;
257
- }
258
- }
259
- //#endregion
260
- //#region src/components/features/filters/utils/filter-utils.ts
261
- function Ue(e, t) {
262
- let n = e[0] ?? "";
263
- return e.length > 1 ? [n, e[1] ?? ""] : t === "lt" ? ["", n] : t === "equals" ? [n, n] : [n, ""];
264
- }
265
- function We(e) {
266
- return e.length === 2 && e.every((e) => e.trim().length > 0);
267
- }
268
- function Ge(e, t) {
269
- if (e) {
270
- if (t) {
271
- let n = Me(e, t, /* @__PURE__ */ new Date());
272
- if (je(n)) return n;
273
- }
274
- return b(e) ?? void 0;
275
- }
276
- }
277
- function Ke(e, t) {
278
- for (let n of e ?? []) {
279
- if (n.value === t) return [n];
280
- let e = Ke(n.children, t);
281
- if (e.length) return [n, ...e];
282
- }
283
- return [];
284
- }
285
- function Q(e) {
286
- return e.replace(/\S+/g, (e) => /^\p{Lu}{2,}/u.test(e) ? e : e.toLowerCase());
287
- }
288
- function qe(e) {
289
- return !!e?.some((e) => !!e.children?.length);
290
- }
291
- function Je(e) {
292
- return e.map((e) => ({
293
- value: e.value,
294
- label: e.label,
295
- description: e.description,
296
- icon: e.icon ?? void 0,
297
- disabled: e.disabled,
298
- ...e.children?.length ? { children: Je(e.children) } : {}
299
- }));
300
- }
301
- function Ye(e, t, n = " / ") {
302
- let r = Ke(e.options, t);
303
- return r.length ? r.map((e) => e.label).join(n) : void 0;
304
- }
305
- function Xe(e, t, n) {
306
- if (e.type === "date" && Array.isArray(t) && t.every((e) => typeof e == "string")) return !0;
307
- if (e.validation?.required && (!t || Array.isArray(t) && t.length === 0)) return n("validation.required");
308
- if (typeof t == "number") {
309
- if (e.validation?.min !== void 0 && t < e.validation.min) return n("validation.minValue").replace("{min}", String(e.validation.min));
310
- if (e.validation?.max !== void 0 && t > e.validation.max) return n("validation.maxValue").replace("{max}", String(e.validation.max));
311
- }
312
- if (e.validation?.pattern && typeof t == "string" && !new RegExp(e.validation.pattern).test(t)) return n("validation.invalidFormat");
313
- if (e.validation?.custom) {
314
- let n = e.validation.custom(t);
315
- if (typeof n == "string" || !n) return n;
316
- }
317
- return !0;
318
- }
319
- //#endregion
320
- //#region src/components/features/filters/filter-context.tsx
321
- var Ze = ve(void 0);
322
- function Qe({ children: e, filters: t, activeFilters: r, onFilterChange: i, navigating: a = !1, strings: o, onError: s }) {
323
- let c = W(t), l = W(i), u = W(s);
324
- u.current = s;
325
- let [d, f] = G(() => /* @__PURE__ */ new Map()), p = V((e) => {
326
- f((t) => {
327
- if (!t.has(e)) return t;
328
- let n = new Map(t);
329
- return n.delete(e), n;
330
- });
331
- }, []), [m, h] = G(0), g = W(/* @__PURE__ */ new Map()), _ = U(() => {
332
- let e = /* @__PURE__ */ new Map();
333
- for (let n of t) {
334
- if (n.type !== X.ASYNC_SELECT) continue;
335
- let t = n.asyncConfig?.fetcher, r = n.asyncConfig?.mapToOption, i = n.asyncConfig?.limit ?? 10, a = g.current.get(n.key), o = a && a.fetcher === t && a.mapToOption === r;
336
- e.set(n.key, o && a.limit === i ? a : {
337
- fetcher: t,
338
- mapToOption: r,
339
- limit: i,
340
- options: o ? a.options : /* @__PURE__ */ new Map()
341
- });
342
- }
343
- return e.size === g.current.size && [...e].every(([e, t]) => g.current.get(e) === t) ? g.current : (g.current = e, e);
344
- }, [t]), v = JSON.stringify(r.filter((e) => _.has(e.key)).map(({ key: e, value: t }) => [e, t])), y = n(Ne, o);
345
- H(() => {
346
- c.current = t;
347
- }, [t]), H(() => {
348
- l.current = i;
349
- }, [i]);
350
- let b = V((e) => {
351
- let t = [...r, e];
352
- l.current(t);
353
- }, [r]), x = V((e) => {
354
- p(r.find((t) => t.id === e)?.key ?? e);
355
- let t = r.filter((t) => t.id !== e && t.key !== e);
356
- l.current(t);
357
- }, [r, p]), S = V((e, t) => {
358
- let n = r.map((n) => n.id === e || n.key === e ? {
359
- ...n,
360
- ...t
361
- } : n);
362
- l.current(n);
363
- }, [r]), C = V(() => {
364
- f(/* @__PURE__ */ new Map()), l.current([]);
365
- }, []), w = V((e) => {
366
- f(/* @__PURE__ */ new Map()), l.current(e);
367
- }, []), T = V((e) => c.current.find((t) => t.key === e), []), E = V((e) => r.find((t) => t.key === e)?.value || [], [r]), D = V((e) => {
368
- let n = r.find((t) => t.key === e), i = t.find((t) => t.key === e);
369
- return i?.type === X.DATE ? d.get(e) ?? n?.operator ?? i.operator ?? i.operators?.[0]?.value ?? He(i.type) : n?.operator ?? "equals";
370
- }, [
371
- r,
372
- d,
373
- t
374
- ]), O = V((e, t) => {
375
- let n = r.find((t) => t.key === e), i = T(e), a = i?.type === X.DATE ? D(e) : void 0;
376
- if (!(a === "between" && t.length > 0 && !We(t))) {
377
- if (t.length === 0) p(e), n && x(e);
378
- else if (a && p(e), n) S(e, a ? {
379
- value: t,
380
- operator: a
381
- } : { value: t });
382
- else {
383
- let n = a ?? i?.operator ?? i?.operators?.[0]?.value ?? (i ? He(i.type) : "equals");
384
- b({
385
- id: e,
386
- key: e,
387
- value: t,
388
- operator: n
389
- });
390
- }
391
- }
392
- }, [
393
- r,
394
- b,
395
- p,
396
- T,
397
- D,
398
- x,
399
- S
400
- ]), k = V((e) => r.some((t) => t.key === e && t.value.length > 0), [r]), A = V((e, t) => {
401
- let n = r.find((t) => t.key === e);
402
- if (T(e)?.type === X.DATE) {
403
- if (!n || t === "between" && !We(n.value)) {
404
- f((n) => new Map(n).set(e, t));
405
- return;
406
- }
407
- p(e);
408
- let r = t === "between" ? n.value : n.value.slice(0, 1);
409
- S(e, {
410
- operator: t,
411
- value: r
412
- });
413
- return;
414
- }
415
- n && S(e, { operator: t });
416
- }, [
417
- r,
418
- p,
419
- T,
420
- S
421
- ]), j = V((e, t) => {
422
- let n = c.current.find((t) => t.key === e);
423
- return n ? Xe(n, t, (e) => Pe(y, e)) : !1;
424
- }, [y]), M = V((e) => c.current.filter((t) => t.dependencies?.some((t) => t.key === e)), []), N = V((e, t) => {
425
- let n = _.get(e)?.options;
426
- if (!n) return;
427
- let r = !1;
428
- for (let e of t) n.get(e.value)?.label !== e.label && (r = !0), n.set(e.value, e);
429
- r && h((e) => e + 1);
430
- }, [_]), P = V((e, t) => _.get(e)?.options.get(t)?.label, [_, m]), F = V((e, t) => {
431
- u.current?.(e, t);
432
- }, []);
433
- H(() => {
434
- let e = new AbortController(), t = (t, n) => {
435
- e.signal.aborted || t && t.name === "AbortError" || u.current?.(t, {
436
- phase: "fetch-options",
437
- filterKey: n
438
- });
439
- }, n = new Map(JSON.parse(v));
440
- for (let [r, i] of _) {
441
- let a = n.get(r);
442
- if (!a || a.length === 0 || a.every((e) => i.options.has(e))) continue;
443
- let { fetcher: o, mapToOption: s, limit: c } = i;
444
- o && s && o({
445
- query: "",
446
- limit: c,
447
- signal: e.signal
448
- }).then((t) => {
449
- e.signal.aborted || N(r, t.map(s));
450
- }).catch((e) => t(e, r));
451
- }
452
- return () => e.abort();
453
- }, [
454
- v,
455
- _,
456
- N
457
- ]);
458
- let I = U(() => ({
459
- activeFilters: r,
460
- filters: t,
461
- addFilter: b,
462
- removeFilter: x,
463
- updateFilter: S,
464
- clearFilters: C,
465
- replaceFilters: w,
466
- getFilterByKey: T,
467
- getFilterValue: E,
468
- setFilterValue: O,
469
- isFilterActive: k,
470
- getFilterOperator: D,
471
- setFilterOperator: A,
472
- validateFilter: j,
473
- getDependentFilters: M,
474
- isNavigating: a,
475
- strings: y,
476
- cacheAsyncOptions: N,
477
- getAsyncOptionLabel: P,
478
- reportError: F
479
- }), [
480
- r,
481
- t,
482
- b,
483
- x,
484
- S,
485
- C,
486
- w,
487
- T,
488
- E,
489
- O,
490
- k,
491
- D,
492
- A,
493
- j,
494
- M,
495
- a,
496
- y,
497
- N,
498
- P,
499
- F
500
- ]);
501
- return /* @__PURE__ */ q(Ze.Provider, {
502
- value: I,
503
- children: e
504
- });
505
- }
506
- function $() {
507
- let e = ye(Ze);
508
- if (!e) throw Error("useFilters must be used within a FilterProvider");
509
- return e;
510
- }
511
- //#endregion
512
- //#region src/components/features/filters/hooks/use-filter-groups.ts
513
- function $e(e = {}) {
514
- let { dynamicFilterOptions: t } = e, { filters: n, isFilterActive: r } = $(), i = U(() => t ? n.map((e) => {
515
- let n = t[e.key];
516
- return Array.isArray(n) ? {
517
- ...e,
518
- options: n
519
- } : e;
520
- }) : n, [n, t]);
521
- return U(() => {
522
- let e = i.filter((e) => e.type === X.SEARCH), t = i.filter((e) => !e.displayConfig?.hidden && e.displayConfig?.display !== "hidden"), n = i.filter((e) => e.type !== X.SEARCH && !e.displayConfig?.hidden && e.displayConfig?.display !== "hidden" && r(e.key)), a = t.filter((e) => e.type !== X.SEARCH && !r(e.key) && e.displayConfig?.display === "always"), o = t.filter((e) => e.type !== X.SEARCH && !r(e.key) && e.displayConfig?.display !== "always"), s = n.map((e) => e.key);
523
- return {
524
- processedFilters: i,
525
- searchFilters: e,
526
- alwaysVisibleFilters: a,
527
- activeRegularFilters: n,
528
- popoverFilters: o,
529
- activeFilterKeys: s,
530
- hasActive: s.length > 0
531
- };
532
- }, [i, r]);
533
- }
534
- //#endregion
535
- //#region src/components/features/filters/partials/filter-operator-select.tsx
536
- function et({ operator: e, operators: t, onOperatorChange: n, segmentResetClass: a }) {
537
- let [c, l] = G(!1), { strings: u } = $(), d = t.find((t) => t.value === e)?.label || e;
538
- return /* @__PURE__ */ q(ue, {
539
- open: c,
540
- onOpenChange: l,
541
- search: !1,
542
- contentLabel: u.operator,
543
- trigger: /* @__PURE__ */ q(i, {
544
- tone: "secondary",
545
- buttonStyle: "ghost",
546
- className: r("filter-operator-select--component", a, "h-full min-h-0 px-control text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
547
- onClick: (e) => {
548
- e.stopPropagation();
549
- },
550
- type: "button",
551
- children: /* @__PURE__ */ q(o, {
552
- tag: "span",
553
- type: "inherit",
554
- children: d
555
- })
556
- }),
557
- header: /* @__PURE__ */ q(s, {
558
- tag: "span",
559
- children: u.operator
560
- }),
561
- contentClassName: m.xs,
562
- items: t.map((t) => ({
563
- value: t.value,
564
- label: t.label,
565
- selected: t.value === e
566
- })),
567
- onSelect: (e) => {
568
- n(e.value), l(!1);
569
- }
570
- });
571
- }
572
- //#endregion
573
- //#region src/components/features/filters/partials/filter-value-display.tsx
574
- function tt({ filter: e, value: t }) {
575
- let { strings: n, getFilterOperator: i } = $();
576
- if (t.length === 0 && e.type !== X.DATE) return /* @__PURE__ */ q(o, {
577
- tag: "span",
578
- type: "secondary",
579
- lineHeight: "none",
580
- className: "filter-value-display--component",
581
- children: n.nothingSelected
582
- });
583
- if (e.type === X.RANGE) {
584
- let [r, a] = Ue(t, i(e.key)), s = r && a ? `${r} – ${a}` : r ? `${n.min} ${r}` : a ? `${n.max} ${a}` : n.nothingSelected;
585
- return /* @__PURE__ */ q(o, {
586
- tag: "span",
587
- type: "inherit",
588
- weight: "semibold",
589
- lineHeight: "none",
590
- className: "filter-value-display--component",
591
- children: s
592
- });
593
- }
594
- return e.type === X.ASYNC_SELECT && !e.options?.length ? /* @__PURE__ */ q(o, {
595
- tag: "span",
596
- type: "inherit",
597
- weight: "semibold",
598
- lineHeight: "none",
599
- className: "filter-value-display--component",
600
- children: rt(e, t, n)
601
- }) : e.options && e.type !== X.DATE ? /* @__PURE__ */ J(u, {
602
- direction: "horizontal",
603
- gap: "xs",
604
- wrap: !1,
605
- className: "filter-value-display--component",
606
- children: [/* @__PURE__ */ J("div", {
607
- className: "relative isolate flex",
608
- children: [t.slice(0, 2).map((t, n) => {
609
- let i = Ke(e.options, t).at(-1);
610
- return i?.icon ? /* @__PURE__ */ q("div", {
611
- className: r("border-background bg-background relative rounded-full border", n > 0 ? "-ml-space-sm z-[1]" : C.raised),
612
- children: i.icon
613
- }, t) : null;
614
- }), t.length > 2 && /* @__PURE__ */ q("div", {
615
- className: "bg-muted border-background relative z-0 -ml-space-sm flex size-icon items-center justify-center rounded-full border",
616
- children: /* @__PURE__ */ J(o, {
617
- tag: "span",
618
- size: "xs",
619
- weight: "medium",
620
- children: ["+", /* @__PURE__ */ q(v, {
621
- value: t.length - 2,
622
- size: "inherit",
623
- align: "center"
624
- })]
625
- })
626
- })]
627
- }), /* @__PURE__ */ q(o, {
628
- tag: "span",
629
- type: "inherit",
630
- weight: "semibold",
631
- lineHeight: "none",
632
- className: "truncate",
633
- children: it(e, t, n)
634
- })]
635
- }) : e.type === X.DATE ? /* @__PURE__ */ J(u, {
636
- direction: "horizontal",
637
- gap: "xs",
638
- wrap: !1,
639
- className: "filter-value-display--component",
640
- children: [/* @__PURE__ */ q(xe, { className: "text-muted-foreground size-icon-sm" }), /* @__PURE__ */ q(o, {
641
- tag: "span",
642
- type: "inherit",
643
- weight: "semibold",
644
- lineHeight: "none",
645
- className: "min-w-0 truncate",
646
- children: nt(e, t, n)
647
- })]
648
- }) : /* @__PURE__ */ q(o, {
649
- tag: "span",
650
- type: "inherit",
651
- weight: "semibold",
652
- lineHeight: "none",
653
- className: "filter-value-display--component truncate",
654
- children: it(e, t, n)
655
- });
656
- }
657
- function nt(e, t, n) {
658
- return t.length === 1 ? at(t[0], e.dateFormat) : t.length === 2 ? ot(t[0], t[1], e.dateFormat) : /* @__PURE__ */ q(g, { children: e.datePickerConfig?.noDatePlaceholder || n.calendar.notDateSelected });
659
- }
660
- function rt(e, t, n) {
661
- return t.length === 0 ? "" : Y(n.selected, {
662
- count: t.length,
663
- filterLabel: Q((t.length > 1 ? e.pluralLabel : e.label) ?? e.label)
664
- });
665
- }
666
- function it(e, t, n) {
667
- return t.length > 1 ? Y(n.selected, {
668
- count: t.length,
669
- filterLabel: Q(e.pluralLabel ?? e.label)
670
- }) : t.map((t) => Ye(e, t) || t).join(", ");
671
- }
672
- function at(e, t) {
673
- let n = Ge(e, t?.param);
674
- return n ? /* @__PURE__ */ q(x, {
675
- value: n,
676
- format: t?.display
677
- }) : /* @__PURE__ */ q(g, { children: e });
678
- }
679
- function ot(e, t, n) {
680
- let r = Ge(e, n?.param), i = Ge(t, n?.param);
681
- return r && i ? /* @__PURE__ */ q(y, {
682
- from: r,
683
- to: i,
684
- format: n?.display
685
- }) : /* @__PURE__ */ J("span", {
686
- className: "inline-flex min-w-0 items-center gap-space-xs",
687
- children: [
688
- at(e, n),
689
- /* @__PURE__ */ q(g, { children: "–" }),
690
- at(t, n)
691
- ]
692
- });
693
- }
694
- //#endregion
695
- //#region src/components/features/filters/partials/active-filter-item.tsx
696
- function st({ filter: n, value: a, active: s, popoverOpen: l, triggerRef: u, operators: d, operator: f, onOperatorChange: p, onFilterClear: m, onFilterClick: h }) {
697
- let { defaultScale: g } = t(), _ = e(void 0, g), { strings: v } = $(), y = B.useId(), b = B.useId(), x = `${ae.joinedItem} !border-0 !rounded-none !shadow-none ${c.inset}`, S = () => /* @__PURE__ */ q("div", {
698
- "aria-hidden": !0,
699
- className: "w-px self-stretch bg-border"
700
- });
701
- return /* @__PURE__ */ J("div", {
702
- role: "group",
703
- "aria-label": n.label,
704
- "data-active": s || void 0,
705
- className: r("active-filter-item--component", ae.joinedFrame, oe[_], "bg-background", n.displayConfig?.className),
706
- children: [
707
- /* @__PURE__ */ J(i, {
708
- type: "button",
709
- tone: "secondary",
710
- buttonStyle: "ghost",
711
- className: r(x, "flex h-full min-h-0 items-center gap-space-sm px-control hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
712
- ref: u,
713
- "aria-haspopup": "dialog",
714
- "aria-expanded": l,
715
- onClick: h,
716
- children: [
717
- !!n.icon && /* @__PURE__ */ q("span", {
718
- className: "flex items-center text-muted-foreground",
719
- children: n.icon
720
- }),
721
- /* @__PURE__ */ q(o, {
722
- id: y,
723
- tag: "span",
724
- type: "inherit",
725
- weight: "semibold",
726
- children: n.label
727
- }),
728
- /* @__PURE__ */ q(Ce, { className: "size-icon-sm" })
729
- ]
730
- }),
731
- /* @__PURE__ */ q(S, {}),
732
- /* @__PURE__ */ q(et, {
733
- operator: f,
734
- operators: d,
735
- onOperatorChange: p,
736
- segmentResetClass: x
737
- }),
738
- /* @__PURE__ */ q(S, {}),
739
- /* @__PURE__ */ q(i, {
740
- type: "button",
741
- tone: "secondary",
742
- buttonStyle: "ghost",
743
- "aria-labelledby": `${y} ${b}`,
744
- "aria-haspopup": "dialog",
745
- "aria-expanded": l,
746
- onClick: h,
747
- className: r(x, "flex h-full min-h-0 min-w-0 flex-1 items-center justify-start px-control hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
748
- children: /* @__PURE__ */ q("span", {
749
- id: b,
750
- className: "min-w-0",
751
- children: /* @__PURE__ */ q(tt, {
752
- filter: n,
753
- value: a
754
- })
755
- })
756
- }),
757
- !!s && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(S, {}), /* @__PURE__ */ J(i, {
758
- type: "button",
759
- tone: "secondary",
760
- buttonStyle: "ghost",
761
- className: r(x, "flex h-full min-h-0 shrink-0 items-center justify-center px-space-sm text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:bg-accent focus-visible:text-accent-foreground"),
762
- onClick: (e) => {
763
- e.stopPropagation(), e.preventDefault(), m();
764
- },
765
- children: [/* @__PURE__ */ q(ke, {
766
- "aria-hidden": "true",
767
- className: "size-icon"
768
- }), /* @__PURE__ */ q(o, {
769
- tag: "span",
770
- className: "sr-only",
771
- children: v.clear
772
- })]
773
- })] })
774
- ]
775
- });
776
- }
777
- //#endregion
778
- //#region src/components/features/filters/hooks/use-async-options.ts
779
- function ct(e, t, n) {
780
- for (let [t, r] of e) Date.now() - r.timestamp > n && e.delete(t);
781
- return e.get(t);
782
- }
783
- function lt(e, t, n, r = {}) {
784
- let { asyncConfig: i } = e, a = i?.fetcher, o = i?.mapToOption, s = U(() => /* @__PURE__ */ new Map(), [
785
- e.key,
786
- a,
787
- o
788
- ]), c = W(r.onError);
789
- c.current = r.onError;
790
- let l = i?.debounceMs ?? e.delay ?? 300, u = (fe(t, l) ?? "").trim(), d = i?.limit ?? 10, f = i?.minQueryLength ?? 0, p = i?.preload ?? !0, m = i?.staleTime ?? 6e4, h = i?.gcTime ?? 3e5, g = u.length === 0 && p, _ = u.length >= f, v = !!i?.fetcher && n && (g || u.length > 0 && _), y = n && !g && u.length > 0 && u.length < f, b = U(() => i?.queryKey ? JSON.stringify(i.queryKey({
791
- query: u,
792
- limit: d
793
- })) : JSON.stringify([
794
- "filter",
795
- e.key,
796
- u,
797
- d
798
- ]), [
799
- i,
800
- e.key,
801
- u,
802
- d
803
- ]), x = V(async (e) => a && o ? (await a({
804
- query: u,
805
- limit: d,
806
- signal: e
807
- })).map(o) : [], [
808
- a,
809
- o,
810
- u,
811
- d
812
- ]), [S, C] = G(() => {
813
- let e = ct(s, b, h);
814
- return {
815
- cache: s,
816
- data: e?.data ?? [],
817
- loading: !1,
818
- fetching: !1,
819
- error: !1
820
- };
821
- }), [w, T] = G(0), E = V(() => T((e) => e + 1), []), D = W(0);
822
- return H(() => {
823
- let t = D.current !== w;
824
- if (D.current = w, !v) return;
825
- let n = ct(s, b, h), r = n !== void 0 && Date.now() - n.timestamp < m, i = new AbortController();
826
- if (r && !t) return C({
827
- cache: s,
828
- data: n.data,
829
- loading: !1,
830
- fetching: !1,
831
- error: !1
832
- }), () => i.abort();
833
- C((e) => ({
834
- cache: s,
835
- data: n?.data ?? (e.cache === s ? e.data : []),
836
- loading: n === void 0,
837
- fetching: !0,
838
- error: !1
839
- }));
840
- let a = !1;
841
- return x(i.signal).then((e) => {
842
- a || (s.set(b, {
843
- timestamp: Date.now(),
844
- data: e
845
- }), C({
846
- cache: s,
847
- data: e,
848
- loading: !1,
849
- fetching: !1,
850
- error: !1
851
- }));
852
- }).catch((t) => {
853
- a || i.signal.aborted || t && t.name === "AbortError" || (C((e) => ({
854
- cache: s,
855
- data: e.cache === s ? e.data : [],
856
- loading: !1,
857
- fetching: !1,
858
- error: !0
859
- })), c.current?.(t, {
860
- phase: "fetch-options",
861
- filterKey: e.key
862
- }));
863
- }), () => {
864
- a = !0, i.abort();
865
- };
866
- }, [
867
- s,
868
- b,
869
- x,
870
- v,
871
- m,
872
- h,
873
- w,
874
- e.key
875
- ]), {
876
- options: v && S.cache === s ? S.data : [],
877
- isLoading: v && S.cache === s && S.loading,
878
- isFetching: v && S.cache === s && S.fetching,
879
- isError: v && S.cache === s && S.error,
880
- refetch: E,
881
- isBelowMinQuery: y,
882
- minQueryLength: f
883
- };
884
- }
885
- //#endregion
886
- //#region src/components/features/filters/partials/filter-editor-header.tsx
887
- function ut({ title: e, description: t, onBack: n }) {
888
- let { strings: r } = $();
889
- return /* @__PURE__ */ J(L, {
890
- start: n ? /* @__PURE__ */ q(i, {
891
- type: "button",
892
- tone: "secondary",
893
- buttonStyle: "ghost",
894
- size: "sm",
895
- iconOnly: !0,
896
- onClick: n,
897
- className: "shrink-0",
898
- "aria-label": r.backToFilters,
899
- children: /* @__PURE__ */ q(we, {
900
- "aria-hidden": "true",
901
- className: "size-icon-sm rtl:rotate-180"
902
- })
903
- }) : void 0,
904
- children: [/* @__PURE__ */ q(ee, { children: e }), t != null && /* @__PURE__ */ q(R, { children: t })]
905
- });
906
- }
907
- //#endregion
908
- //#region src/components/features/filters/partials/async-filter-content.tsx
909
- function dt({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: a, triggerSource: s = "chip" }) {
910
- let { strings: c, cacheAsyncOptions: l, getAsyncOptionLabel: d, reportError: m } = $(), [h, g] = G(""), [_, v] = G(t ?? []), y = W(t);
911
- if (t !== y.current) {
912
- let e = y.current ?? [], n = t ?? [];
913
- y.current = t, (n.length !== e.length || n.some((t, n) => t !== e[n])) && v(n);
914
- }
915
- let { options: b, isLoading: x, isFetching: S, isError: C, refetch: w, isBelowMinQuery: A, minQueryLength: M } = lt(e, h, !0, { onError: m });
916
- H(() => {
917
- b.length > 0 && l(e.key, b);
918
- }, [
919
- l,
920
- e.key,
921
- b
922
- ]);
923
- let N = e.multiple !== !1, P = e.maxSelected, F = s === "toolbar", I = _.length !== t.length || _.some((e) => !t.includes(e)), ee = U(() => {
924
- let t = new Set(_), n = new Set(b.map((e) => e.value)), r = [];
925
- for (let t of _) if (!n.has(t)) {
926
- let n = d(e.key, t);
927
- n && r.push({
928
- value: t,
929
- label: n,
930
- icon: e.icon
931
- });
932
- }
933
- return [...r, ...b].sort((e, n) => +!t.has(e.value) - !t.has(n.value));
934
- }, [
935
- b,
936
- _,
937
- e.key,
938
- e.icon,
939
- d
940
- ]), te = (t) => {
941
- if (N) {
942
- if (_.includes(t)) v(_.filter((e) => e !== t));
943
- else {
944
- if (P && _.length >= P) return;
945
- v([..._, t]);
946
- }
947
- } else v([t]), e.closeOnSelect === !0 && (n([t]), a());
948
- }, L = () => {
949
- n(_), a();
950
- }, R = U(() => x || S ? /* @__PURE__ */ q(f, { label: c.searching }) : C ? /* @__PURE__ */ q(p, {
951
- variant: "inline",
952
- title: c.fetchError,
953
- action: /* @__PURE__ */ q(i, {
954
- tone: "secondary",
955
- buttonStyle: "outline",
956
- size: "sm",
957
- onClick: (e) => {
958
- e.stopPropagation(), w();
959
- },
960
- children: c.retryFetch
961
- })
962
- }) : A ? /* @__PURE__ */ q("div", {
963
- className: "text-muted-foreground flex items-center justify-center py-space-xl",
964
- children: /* @__PURE__ */ q(o, {
965
- tag: "span",
966
- size: "xs",
967
- type: "secondary",
968
- children: Y(c.minQueryHint, { min: M })
969
- })
970
- }) : c.noOptionsFound, [
971
- x,
972
- S,
973
- C,
974
- A,
975
- M,
976
- c,
977
- w
978
- ]);
979
- return /* @__PURE__ */ J(K, { children: [
980
- /* @__PURE__ */ q(ut, {
981
- title: e.label,
982
- description: c.selectValues,
983
- onBack: F ? r : void 0
984
- }),
985
- /* @__PURE__ */ J(j, {
986
- shouldFilter: !1,
987
- inset: "flush",
988
- className: "rounded-none",
989
- children: [/* @__PURE__ */ q(E, {
990
- placeholder: Y(c.searchPlaceholder, { filterLabel: Q(e.label) }),
991
- value: h,
992
- onValueChange: g
993
- }), /* @__PURE__ */ q(O, { children: ee.length === 0 ? /* @__PURE__ */ q(D, { children: R }) : /* @__PURE__ */ J(k, { children: [!(!S || x) && /* @__PURE__ */ J(u, {
994
- direction: "horizontal",
995
- gap: "sm",
996
- wrap: !1,
997
- className: "px-control-sm py-space-xs",
998
- children: [/* @__PURE__ */ q(De, { className: "text-muted-foreground size-icon-sm animate-spin" }), /* @__PURE__ */ q(o, {
999
- tag: "span",
1000
- size: "xs",
1001
- type: "secondary",
1002
- children: c.searching
1003
- })]
1004
- }), ee.map((e) => /* @__PURE__ */ J(T, {
1005
- onSelect: () => te(e.value),
1006
- "data-checked": _.includes(e.value) || void 0,
1007
- disabled: e.disabled || !!P && _.length >= P && !_.includes(e.value),
1008
- className: "flex items-center gap-space-sm",
1009
- children: [e.icon, /* @__PURE__ */ q(o, {
1010
- tag: "span",
1011
- type: "inherit",
1012
- lineHeight: "tight",
1013
- children: e.label
1014
- })]
1015
- }, e.value))] }) })]
1016
- }),
1017
- I && /* @__PURE__ */ q(z, {
1018
- caption: Y(c.selected, {
1019
- count: _.length,
1020
- filterLabel: Q((_.length > 1 ? e.pluralLabel : e.label) ?? e.label)
1021
- }),
1022
- children: /* @__PURE__ */ q(i, {
1023
- tone: "primary",
1024
- size: "sm",
1025
- onClick: L,
1026
- children: c.confirm
1027
- })
1028
- })
1029
- ] });
1030
- }
1031
- //#endregion
1032
- //#region src/components/features/filters/facets/date-facet.tsx
1033
- var ft = [];
1034
- function pt({ filter: e, operator: t, value: n, onValueChange: i, className: a }) {
1035
- let { strings: o } = $(), s = t === void 0 ? e.operators?.some((e) => e.value === "between") || e.operator === "between" || e.key.toLowerCase().includes("range") || e.key.toLowerCase().includes("between") : t === "between", c = e.dateFormat?.param ?? "yyyy-MM-dd", l = e.dateFormat?.display ?? "PPP", u = s ? e.datePickerConfig?.noRangePlaceholder ?? e.placeholder ?? o.calendar.notDateRangeSelected : e.datePickerConfig?.noDatePlaceholder ?? e.placeholder ?? o.calendar.notDateSelected, d = !!e.datePickerConfig?.showConfirmButton, f = e.datePickerConfig?.autoApply ?? !d, p = e.datePickerConfig?.showShortcuts ?? !0, m = s && (n.start || n.end) ? {
1036
- from: n.start,
1037
- to: n.end
1038
- } : void 0, h = !s && n.start && je(n.start) ? n.start : void 0, g = {
1039
- format: c,
1040
- readableFormat: l,
1041
- placeholder: u,
1042
- disablePortal: !0,
1043
- numberOfMonths: 1,
1044
- className: r("date-facet--component", "w-full", a)
1045
- };
1046
- return s ? /* @__PURE__ */ q(I, {
1047
- mode: "range",
1048
- value: m,
1049
- onValueChange: (e) => {
1050
- i({
1051
- start: e.range?.from ?? void 0,
1052
- end: e.range?.to ?? void 0
1053
- });
1054
- },
1055
- withConfirm: d,
1056
- closeOnSelect: f,
1057
- presets: p ? void 0 : ft,
1058
- ...g
1059
- }) : /* @__PURE__ */ q(I, {
1060
- mode: "single",
1061
- value: h,
1062
- onValueChange: (e) => {
1063
- i({
1064
- start: e.date ?? void 0,
1065
- end: void 0
1066
- });
1067
- },
1068
- closeOnSelect: f,
1069
- ...g
1070
- });
1071
- }
1072
- //#endregion
1073
- //#region src/components/features/filters/partials/date-filter-content.tsx
1074
- function mt({ filter: e, operator: t, value: n, onFilterChange: r, onBackToFilterList: i, triggerSource: a = "chip" }) {
1075
- let o = Ge(n[0], e.dateFormat?.param), s = Ge(n[1], e.dateFormat?.param), c = (t) => {
1076
- if (t && je(t)) return Ae(t, e.dateFormat?.param ?? "yyyy-MM-dd");
1077
- }, l = ({ start: e, end: t }) => {
1078
- let n = [], i = c(e), a = c(t);
1079
- i && n.push(i), a && n.push(a), r(n);
1080
- }, u = a === "toolbar", d = {
1081
- start: o,
1082
- end: s
1083
- };
1084
- return /* @__PURE__ */ J("div", {
1085
- className: "flex flex-col",
1086
- children: [/* @__PURE__ */ q(ut, {
1087
- title: e.label,
1088
- onBack: u ? i : void 0
1089
- }), /* @__PURE__ */ q("div", {
1090
- className: h.menuRegion,
1091
- children: /* @__PURE__ */ q(pt, {
1092
- filter: e,
1093
- operator: t,
1094
- value: d,
1095
- onValueChange: l
1096
- })
1097
- })]
1098
- });
1099
- }
1100
- //#endregion
1101
- //#region src/components/features/filters/partials/filter-error-boundary.tsx
1102
- var ht = class extends _e {
1103
- state = {
1104
- hasError: !1,
1105
- error: null
1106
- };
1107
- static getDerivedStateFromError(e) {
1108
- return {
1109
- hasError: !0,
1110
- error: e
1111
- };
1112
- }
1113
- componentDidCatch(e, t) {
1114
- this.props.onError(e, {
1115
- phase: "render",
1116
- filterKey: this.props.filterKey
1117
- });
1118
- }
1119
- handleReset = () => {
1120
- this.setState({
1121
- hasError: !1,
1122
- error: null
1123
- });
1124
- };
1125
- render() {
1126
- if (this.state.hasError) {
1127
- let { fallback: e, filterKey: t, labels: n } = this.props;
1128
- return e ? /* @__PURE__ */ q("div", {
1129
- className: "filter-error-boundary--component contents",
1130
- children: e
1131
- }) : /* @__PURE__ */ J("div", {
1132
- className: r("filter-error-boundary--component rounded-radius border p-surface-xs", d.destructive.edge, d.destructive.wash, d.destructive.ink),
1133
- children: [
1134
- /* @__PURE__ */ J("div", {
1135
- className: "mb-space-xs flex items-center justify-between",
1136
- children: [/* @__PURE__ */ q(o, {
1137
- tag: "span",
1138
- weight: "semibold",
1139
- children: n.title
1140
- }), /* @__PURE__ */ q(i, {
1141
- type: "button",
1142
- tone: "destructive",
1143
- buttonStyle: "ghost",
1144
- size: "sm",
1145
- iconOnly: !0,
1146
- onClick: this.handleReset,
1147
- "aria-label": n.reset,
1148
- children: /* @__PURE__ */ q(ke, { className: "size-icon-sm" })
1149
- })]
1150
- }),
1151
- /* @__PURE__ */ q(o, { children: n.getDescription(t) }),
1152
- /* @__PURE__ */ q(_, {
1153
- size: "xs",
1154
- className: "mt-space-xs text-destructive",
1155
- children: this.state.error?.message || n.unknownError
1156
- })
1157
- ]
1158
- });
1159
- }
1160
- return /* @__PURE__ */ q("div", {
1161
- className: "filter-error-boundary--component contents",
1162
- children: this.props.children
1163
- });
1164
- }
1165
- };
1166
- function gt(e) {
1167
- let { strings: t, reportError: n } = $(), r = U(() => ({
1168
- title: t.error.title,
1169
- reset: t.clear,
1170
- getDescription: (e) => e ? Y(t.error.descriptionWithKey, { filterKey: e }) : t.error.generic,
1171
- unknownError: t.error.unknown
1172
- }), [t]);
1173
- return /* @__PURE__ */ q(ht, {
1174
- ...e,
1175
- labels: r,
1176
- onError: n
1177
- });
1178
- }
1179
- //#endregion
1180
- //#region src/components/features/filters/partials/filter-list-item.tsx
1181
- function _t({ filter: e, onSelect: t }) {
1182
- let { strings: n } = $(), r = e.type === X.DATE ? e.operator === "between" ? n?.selectDateRange : n?.selectDate : e.options ? `${e.options.length} ${n?.options ?? ""}`.trim() : null;
1183
- return /* @__PURE__ */ J(T, {
1184
- onSelect: t,
1185
- children: [!!e.icon && /* @__PURE__ */ q("span", {
1186
- className: "shrink-0 text-muted-foreground [&_svg]:size-icon",
1187
- children: e.icon
1188
- }), /* @__PURE__ */ J("div", {
1189
- className: "flex min-w-0 flex-col gap-dense leading-tight",
1190
- children: [/* @__PURE__ */ q(o, {
1191
- tag: "span",
1192
- type: "inherit",
1193
- lineHeight: "tight",
1194
- weight: "medium",
1195
- className: "truncate",
1196
- children: e.label
1197
- }), !!r && /* @__PURE__ */ q(o, {
1198
- tag: "span",
1199
- lineHeight: "tight",
1200
- size: "xs",
1201
- type: "secondary",
1202
- className: "truncate",
1203
- children: r
1204
- })]
1205
- })]
1206
- }, e.key);
1207
- }
1208
- //#endregion
1209
- //#region src/components/features/filters/partials/filter-list-content.tsx
1210
- function vt({ availableFilters: e, activeFilters: t, onFilterSelect: n }) {
1211
- let { strings: r } = $(), i = (e) => {
1212
- n(e);
1213
- };
1214
- return /* @__PURE__ */ J(j, {
1215
- inset: "compact",
1216
- className: "rounded-none",
1217
- children: [/* @__PURE__ */ q(E, { placeholder: r.searchFilters }), /* @__PURE__ */ J(O, { children: [
1218
- /* @__PURE__ */ q(D, { children: r.noFiltersAvailable }),
1219
- e.length > 0 && /* @__PURE__ */ q(k, {
1220
- heading: r.availableFilters,
1221
- children: e.map((e) => /* @__PURE__ */ q(_t, {
1222
- filter: e,
1223
- onSelect: () => i(e)
1224
- }, e.key))
1225
- }),
1226
- t.length > 0 && /* @__PURE__ */ J(K, { children: [/* @__PURE__ */ q(A, {}), /* @__PURE__ */ q(k, {
1227
- heading: r.activeFilters,
1228
- children: t.map((e) => /* @__PURE__ */ q(_t, {
1229
- filter: e,
1230
- onSelect: () => i(e)
1231
- }, e.key))
1232
- })] })
1233
- ] })]
1234
- });
1235
- }
1236
- //#endregion
1237
- //#region src/components/features/filters/facets/range-facet.tsx
1238
- function yt({ filter: e, value: t, onValueChange: n, className: r }) {
1239
- let [i, a] = G(t.min?.toString() ?? ""), [o, s] = G(t.max?.toString() ?? ""), c = de((e) => {
1240
- (e.min !== t.min || e.max !== t.max) && n(e);
1241
- }, e.delay ?? 300);
1242
- return H(() => (c({
1243
- min: i ? Number(i) : void 0,
1244
- max: o ? Number(o) : void 0
1245
- }), c.cancel), [
1246
- i,
1247
- o,
1248
- c
1249
- ]), /* @__PURE__ */ q(bt, {
1250
- min: i,
1251
- max: o,
1252
- onMinChange: (e) => {
1253
- let t = e.target.value;
1254
- (t === "" || /^\d*\.?\d*$/.test(t)) && a(t);
1255
- },
1256
- onMaxChange: (e) => {
1257
- let t = e.target.value;
1258
- (t === "" || /^\d*\.?\d*$/.test(t)) && s(t);
1259
- },
1260
- className: r
1261
- });
1262
- }
1263
- function bt({ min: e, max: t, onMinChange: n, onMaxChange: i, className: o, invalid: s }) {
1264
- let { strings: c } = $(), d = be();
1265
- return /* @__PURE__ */ q(u, {
1266
- gap: "md",
1267
- className: r("range-facet--component", o),
1268
- children: /* @__PURE__ */ J(l, {
1269
- columns: {
1270
- base: 1,
1271
- sm: 2
1272
- },
1273
- gap: "md",
1274
- children: [/* @__PURE__ */ J(u, {
1275
- gap: "xs",
1276
- children: [/* @__PURE__ */ q(a, {
1277
- htmlFor: `${d}-min`,
1278
- className: "text-inherit",
1279
- children: c.min
1280
- }), /* @__PURE__ */ q(F, {
1281
- id: `${d}-min`,
1282
- type: "text",
1283
- inputMode: "decimal",
1284
- value: e,
1285
- onChange: n,
1286
- "aria-invalid": s || void 0,
1287
- placeholder: c.min,
1288
- className: "w-full"
1289
- })]
1290
- }), /* @__PURE__ */ J(u, {
1291
- gap: "xs",
1292
- children: [/* @__PURE__ */ q(a, {
1293
- htmlFor: `${d}-max`,
1294
- className: "text-inherit",
1295
- children: c.max
1296
- }), /* @__PURE__ */ q(F, {
1297
- id: `${d}-max`,
1298
- type: "text",
1299
- inputMode: "decimal",
1300
- value: t,
1301
- onChange: i,
1302
- "aria-invalid": s || void 0,
1303
- placeholder: c.max,
1304
- className: "w-full"
1305
- })]
1306
- })]
1307
- })
1308
- });
1309
- }
1310
- //#endregion
1311
- //#region src/components/features/filters/partials/range-filter-content.tsx
1312
- function xt(e) {
1313
- let t = e.trim();
1314
- if (!t) return "";
1315
- if (!/^-?(?:\d+\.?\d*|\.\d+)$/.test(t)) return;
1316
- let n = Number(t);
1317
- return Number.isFinite(n) ? t : void 0;
1318
- }
1319
- function St({ filter: e, operator: t, value: n, onFilterChange: r, onBackToFilterList: a, onClose: o, triggerSource: s }) {
1320
- let { strings: c, reportError: l } = $(), [u, d] = Ue(n, t), [f, p] = G(u), [m, g] = G(d);
1321
- H(() => {
1322
- p(u), g(d);
1323
- }, [u, d]);
1324
- let _ = xt(f), v = xt(m), y = _ === void 0 || v === void 0 || !!(_ && v) && Number(_) > Number(v), b = f !== u || m !== d;
1325
- function x() {
1326
- if (!(y || _ === void 0 || v === void 0)) try {
1327
- r(_ || v ? [_, v] : []), o();
1328
- } catch (t) {
1329
- l(t, {
1330
- phase: "apply",
1331
- filterKey: e.key
1332
- });
1333
- }
1334
- }
1335
- return /* @__PURE__ */ J("div", {
1336
- className: "flex flex-col",
1337
- children: [
1338
- /* @__PURE__ */ q(ut, {
1339
- title: e.label,
1340
- onBack: s === "toolbar" ? a : void 0
1341
- }),
1342
- /* @__PURE__ */ q("div", {
1343
- className: h.menuRegion,
1344
- children: /* @__PURE__ */ q(bt, {
1345
- min: f,
1346
- max: m,
1347
- onMinChange: (e) => p(e.target.value),
1348
- onMaxChange: (e) => g(e.target.value),
1349
- invalid: y
1350
- })
1351
- }),
1352
- b && /* @__PURE__ */ q(z, {
1353
- caption: y ? c.validation.invalidFormat : void 0,
1354
- children: /* @__PURE__ */ q(i, {
1355
- tone: "primary",
1356
- size: "sm",
1357
- onClick: x,
1358
- disabled: y,
1359
- children: c.confirm
1360
- })
1361
- })
1362
- ]
1363
- });
1364
- }
1365
- //#endregion
1366
- //#region src/components/features/filters/partials/nested-filter-options.tsx
1367
- function Ct({ filter: e, value: t, multiple: n, onChange: r, header: i }) {
1368
- let { strings: a } = $(), o = U(() => Je(e.options ?? []), [e.options]), s = pe({
1369
- items: o,
1370
- selected: t,
1371
- open: !0,
1372
- multiple: n,
1373
- selectable: e.selectableOptions ?? "leaf",
1374
- strings: {
1375
- ...he,
1376
- root: e.label,
1377
- search: Y(a.searchPlaceholder, { filterLabel: Q(e.label) }),
1378
- empty: a.noOptionsFound,
1379
- back: a.previousLevel,
1380
- selectCurrent: a.selectCurrentLevel
1381
- },
1382
- onChange: (e) => r(e == null ? [] : typeof e == "string" ? [e] : [...e])
1383
- });
1384
- return /* @__PURE__ */ q(me, {
1385
- controller: s,
1386
- header: i,
1387
- rootInPath: !0,
1388
- className: "nested-filter-options--component"
1389
- });
1390
- }
1391
- //#endregion
1392
- //#region src/components/features/filters/partials/regular-filter-content.tsx
1393
- function wt({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: a, triggerSource: s = "chip" }) {
1394
- let { strings: c, reportError: l } = $(), d = e.multiple === !0 || e.type === X.MULTI_SELECT, f = s === "toolbar", [p, m] = G(t || []);
1395
- H(() => {
1396
- m(t || []);
1397
- }, [t]);
1398
- let h = (t) => {
1399
- if (d) {
1400
- let e = p.includes(t) ? p.filter((e) => e !== t) : [...p, t];
1401
- m(e);
1402
- } else m([t]), e.closeOnSelect === !0 && (n([t]), a());
1403
- }, g = (t) => {
1404
- m(t), !d && e.closeOnSelect === !0 && t.length && (n(t), a());
1405
- }, _ = () => {
1406
- try {
1407
- n(p), a();
1408
- } catch (t) {
1409
- l(t, {
1410
- phase: "apply",
1411
- filterKey: e.key
1412
- });
1413
- }
1414
- }, v = /* @__PURE__ */ q(ut, {
1415
- title: e.label,
1416
- onBack: f ? r : void 0
1417
- }), y = JSON.stringify(p.slice().sort()) !== JSON.stringify((t ?? []).slice().sort());
1418
- return /* @__PURE__ */ J("div", {
1419
- className: "flex flex-col",
1420
- children: [qe(e.options) ? /* @__PURE__ */ q(Ct, {
1421
- filter: e,
1422
- value: p,
1423
- multiple: d,
1424
- onChange: g,
1425
- header: v
1426
- }) : /* @__PURE__ */ J(K, { children: [v, /* @__PURE__ */ J(j, {
1427
- inset: "flush",
1428
- className: "rounded-none",
1429
- children: [/* @__PURE__ */ q(E, { placeholder: Y(c.searchPlaceholder, { filterLabel: Q(e.label) }) }), /* @__PURE__ */ J(O, {
1430
- className: "max-h-64",
1431
- children: [/* @__PURE__ */ q(D, { children: /* @__PURE__ */ q(o, {
1432
- type: "secondary",
1433
- align: "center",
1434
- className: "py-space-xl",
1435
- children: c.noOptionsFound
1436
- }) }), /* @__PURE__ */ q(k, { children: e.options?.map((e) => {
1437
- let t = p.includes(e.value);
1438
- return /* @__PURE__ */ J(T, {
1439
- onSelect: () => h(e.value),
1440
- "data-checked": t || void 0,
1441
- disabled: e.disabled,
1442
- className: "data-[checked=true]:**:[svg]:text-primary-accent",
1443
- children: [!!e.icon && /* @__PURE__ */ q("span", {
1444
- className: "shrink-0 text-muted-foreground [&_svg]:size-icon",
1445
- children: e.icon
1446
- }), /* @__PURE__ */ J(u, {
1447
- gap: "dense",
1448
- className: "flex min-w-0 flex-1 flex-col leading-tight",
1449
- children: [/* @__PURE__ */ q(o, {
1450
- tag: "span",
1451
- type: "inherit",
1452
- lineHeight: "tight",
1453
- weight: t ? "medium" : "regular",
1454
- className: "truncate",
1455
- children: e.label
1456
- }), !!e.description && /* @__PURE__ */ q(o, {
1457
- tag: "span",
1458
- size: "xs",
1459
- lineHeight: "tight",
1460
- type: "secondary",
1461
- className: "truncate",
1462
- children: e.description
1463
- })]
1464
- })]
1465
- }, e.value);
1466
- }) })]
1467
- })]
1468
- })] }), !!y && /* @__PURE__ */ q(z, {
1469
- caption: Y(c.selected, {
1470
- count: p.length,
1471
- filterLabel: Q((p.length > 1 ? e.pluralLabel : e.label) ?? e.label)
1472
- }),
1473
- children: /* @__PURE__ */ q(i, {
1474
- tone: "primary",
1475
- size: "sm",
1476
- onClick: _,
1477
- children: c.confirm
1478
- })
1479
- })]
1480
- });
1481
- }
1482
- //#endregion
1483
- //#region src/components/features/filters/facets/tags-facet.tsx
1484
- function Tt({ filter: e, value: n, onValueChange: a, className: s }) {
1485
- let { defaultScale: c } = t(), l = P(void 0, c), { strings: d } = $(), [f, p] = G(""), m = V(() => {
1486
- let e = f.trim();
1487
- e && !n.includes(e) && (a([...n, e]), p(""));
1488
- }, [
1489
- f,
1490
- n,
1491
- a
1492
- ]), h = V((e) => {
1493
- a(n.filter((t) => t !== e));
1494
- }, [n, a]), g = (e) => {
1495
- e.key === "Enter" && (e.preventDefault(), m());
1496
- }, _ = V(() => {
1497
- a([]), p("");
1498
- }, [a]), v = n.length > 0, y = n.length === 1 ? d.tag : d.tags, b = v ? /* @__PURE__ */ J(u, {
1499
- gap: "md",
1500
- className: "tags-facet--summary",
1501
- children: [/* @__PURE__ */ J(u, {
1502
- direction: "horizontal",
1503
- gap: "sm",
1504
- justify: "between",
1505
- wrap: !1,
1506
- children: [/* @__PURE__ */ J(o, {
1507
- tag: "span",
1508
- size: "xs",
1509
- type: "secondary",
1510
- children: [
1511
- n.length,
1512
- " ",
1513
- y
1514
- ]
1515
- }), /* @__PURE__ */ q(i, {
1516
- onClick: _,
1517
- tone: "secondary",
1518
- buttonStyle: "ghost",
1519
- size: "sm",
1520
- className: "text-muted-foreground hover:text-foreground",
1521
- type: "button",
1522
- "aria-label": d.clearAll,
1523
- children: d.clearAll
1524
- })]
1525
- }), /* @__PURE__ */ q(u, {
1526
- direction: "horizontal",
1527
- gap: "md",
1528
- children: n.map((e) => /* @__PURE__ */ J(S, {
1529
- tone: "secondary",
1530
- className: "flex items-center gap-space-sm py-space-2xs pl-space-md pr-space-sm",
1531
- children: [/* @__PURE__ */ q(o, {
1532
- tag: "span",
1533
- size: "xs",
1534
- children: e
1535
- }), /* @__PURE__ */ q("button", {
1536
- onClick: () => h(e),
1537
- className: r(w.target, w.focus, w.toggle),
1538
- type: "button",
1539
- "aria-label": `${d.removeTag} ${e}`,
1540
- children: /* @__PURE__ */ q(ke, {
1541
- className: w.icon,
1542
- "aria-hidden": "true"
1543
- })
1544
- })]
1545
- }, e))
1546
- })]
1547
- }) : null;
1548
- return /* @__PURE__ */ J(u, {
1549
- gap: "lg",
1550
- className: r("tags-facet--component", s),
1551
- children: [/* @__PURE__ */ J(u, {
1552
- direction: "horizontal",
1553
- gap: "md",
1554
- wrap: !1,
1555
- children: [/* @__PURE__ */ q("div", {
1556
- className: "relative flex-1",
1557
- children: /* @__PURE__ */ q(F, {
1558
- type: "text",
1559
- value: f,
1560
- onChange: (e) => p(e.target.value),
1561
- onKeyDown: g,
1562
- placeholder: e.placeholder ?? d.enterTag
1563
- })
1564
- }), /* @__PURE__ */ J(i, {
1565
- tone: "primary",
1566
- onClick: m,
1567
- disabled: !f.trim(),
1568
- size: l,
1569
- iconOnly: !0,
1570
- className: r(M[l], ie[l]),
1571
- type: "button",
1572
- children: [/* @__PURE__ */ q(Oe, { className: "size-icon" }), /* @__PURE__ */ q(o, {
1573
- tag: "span",
1574
- size: "pxs",
1575
- className: "sr-only",
1576
- children: d.addTag
1577
- })]
1578
- })]
1579
- }), b]
1580
- });
1581
- }
1582
- var Et = B.memo(Tt);
1583
- Et.displayName = "TagsFacet";
1584
- //#endregion
1585
- //#region src/components/features/filters/partials/tags-filter-content.tsx
1586
- function Dt({ filter: e, value: t, onFilterChange: n, onBackToFilterList: r, onClose: a, triggerSource: o = "chip" }) {
1587
- let { strings: s, reportError: c } = $(), [l, u] = G(t || []), d = o === "toolbar";
1588
- H(() => {
1589
- u(t || []);
1590
- }, [t]);
1591
- let f = () => {
1592
- try {
1593
- n(l), a();
1594
- } catch (t) {
1595
- c(t, {
1596
- phase: "apply",
1597
- filterKey: e.key
1598
- });
1599
- }
1600
- }, p = JSON.stringify(l.slice().sort()) !== JSON.stringify((t ?? []).slice().sort());
1601
- return /* @__PURE__ */ J("div", {
1602
- className: "flex flex-col",
1603
- children: [
1604
- /* @__PURE__ */ q(ut, {
1605
- title: e.label,
1606
- onBack: d ? r : void 0
1607
- }),
1608
- /* @__PURE__ */ q("div", {
1609
- className: h.menuRegion,
1610
- children: /* @__PURE__ */ q(Et, {
1611
- filter: e,
1612
- value: l,
1613
- onValueChange: u
1614
- })
1615
- }),
1616
- !!p && /* @__PURE__ */ q(z, { children: /* @__PURE__ */ q(i, {
1617
- tone: "primary",
1618
- size: "sm",
1619
- onClick: f,
1620
- children: s.confirm
1621
- }) })
1622
- ]
1623
- });
1624
- }
1625
- //#endregion
1626
- //#region src/components/features/filters/partials/filter-popover-content.tsx
1627
- var Ot = "input:not([type=hidden]):not(:disabled), textarea:not(:disabled), button:not(:disabled), [tabindex]:not([tabindex=\"-1\"])";
1628
- function kt(e) {
1629
- if (!e) return;
1630
- let t = [...e.querySelectorAll(Ot)].filter((e) => !e.closest(".popover-header--component"));
1631
- (t.find((e) => e.matches("input, textarea")) ?? t[0])?.focus({ preventScroll: !0 });
1632
- }
1633
- function At({ activeFilterInPopover: e, operator: t, availableFilters: n, activeFilters: i, getFilterValue: a, setFilterValue: o, onFilterSelect: s, onBackToFilterList: c, onClose: l, triggerSource: u = "chip", finalFocus: d }) {
1634
- let { strings: f, getFilterOperator: p } = $(), h = W(null), g = e?.key ?? null, _ = W(g);
1635
- H(() => {
1636
- if (_.current === g) return;
1637
- _.current = g;
1638
- let e = h.current;
1639
- if (!e?.hasAttribute("data-open")) return;
1640
- kt(e);
1641
- let t = e.ownerDocument.defaultView, n = t?.requestAnimationFrame(() => {
1642
- e.ownerDocument.activeElement === e && kt(e);
1643
- });
1644
- return () => {
1645
- n != null && t?.cancelAnimationFrame(n);
1646
- };
1647
- }, [g]);
1648
- let v = e?.type === X.DATE || e?.type === X.TAGS ? "w-auto min-w-80 gap-0 overflow-hidden" : (e?.type, X.ASYNC_SELECT, r(m.md, "gap-0 overflow-hidden")), y = (e, t) => {
1649
- o(e, t);
1650
- };
1651
- return /* @__PURE__ */ q(re, {
1652
- ref: h,
1653
- finalFocus: d,
1654
- type: "menu",
1655
- "aria-label": e?.label ?? f.addFilter,
1656
- inset: "flush",
1657
- className: r("filter-popover-content--component", v),
1658
- align: "start",
1659
- children: e ? e.type === X.DATE ? /* @__PURE__ */ q(mt, {
1660
- filter: e,
1661
- operator: t ?? p(e.key),
1662
- value: a(e.key),
1663
- onFilterChange: (t) => y(e.key, t),
1664
- onBackToFilterList: c,
1665
- triggerSource: u
1666
- }) : e.type === X.RANGE ? /* @__PURE__ */ q(St, {
1667
- filter: e,
1668
- operator: t ?? p(e.key) ?? "between",
1669
- value: a(e.key),
1670
- onFilterChange: (t) => y(e.key, t),
1671
- onBackToFilterList: c,
1672
- onClose: l,
1673
- triggerSource: u
1674
- }) : e.type === X.TAGS ? /* @__PURE__ */ q(Dt, {
1675
- filter: e,
1676
- value: a(e.key),
1677
- onFilterChange: (t) => y(e.key, t),
1678
- onBackToFilterList: c,
1679
- onClose: l,
1680
- triggerSource: u
1681
- }) : e.type === X.ASYNC_SELECT ? /* @__PURE__ */ q(dt, {
1682
- filter: e,
1683
- value: a(e.key),
1684
- onFilterChange: (t) => y(e.key, t),
1685
- onBackToFilterList: c,
1686
- onClose: l,
1687
- triggerSource: u
1688
- }) : /* @__PURE__ */ q(wt, {
1689
- filter: e,
1690
- value: a(e.key),
1691
- onFilterChange: (t) => y(e.key, t),
1692
- onBackToFilterList: c,
1693
- onClose: l,
1694
- triggerSource: u
1695
- }) : /* @__PURE__ */ q(vt, {
1696
- availableFilters: n,
1697
- activeFilters: i,
1698
- onFilterSelect: s
1699
- })
1700
- });
1701
- }
1702
- //#endregion
1703
- //#region src/components/features/filters/partials/filter-pill.tsx
1704
- function jt({ filter: e, value: t, active: n, operator: r, operators: i, onOperatorChange: a, onValueChange: o, onClear: s, availableFilters: c, activeFilters: l, operatorChangeRef: u }) {
1705
- let d = W(!1), f = u ?? d, [p, m] = G(!1), h = W(null), g = W(null);
1706
- return /* @__PURE__ */ q(gt, {
1707
- filterKey: e.key,
1708
- children: /* @__PURE__ */ J(ne, {
1709
- open: p,
1710
- onOpenChange: (e) => {
1711
- e && f.current || m(e);
1712
- },
1713
- children: [/* @__PURE__ */ J("div", {
1714
- className: "filter-pill--component filter-pill--anchor relative",
1715
- children: [/* @__PURE__ */ q(te, {
1716
- render: /* @__PURE__ */ q("span", {}),
1717
- nativeButton: !1,
1718
- tabIndex: -1,
1719
- "aria-hidden": "true",
1720
- className: "pointer-events-none absolute inset-0"
1721
- }), /* @__PURE__ */ q(st, {
1722
- filter: e,
1723
- popoverOpen: p,
1724
- triggerRef: h,
1725
- value: t,
1726
- active: n,
1727
- operators: i,
1728
- operator: r,
1729
- onOperatorChange: (e) => {
1730
- f.current = !0, a(e), m(!1), setTimeout(() => {
1731
- f.current = !1;
1732
- }, 100);
1733
- },
1734
- onFilterClear: () => {
1735
- m(!1), s(), h.current?.focus();
1736
- },
1737
- onFilterClick: (e) => {
1738
- f.current || (g.current = e?.currentTarget ?? h.current, m(!0));
1739
- }
1740
- })]
1741
- }), /* @__PURE__ */ q(At, {
1742
- finalFocus: g,
1743
- activeFilterInPopover: e,
1744
- operator: r,
1745
- availableFilters: c,
1746
- activeFilters: l,
1747
- getFilterValue: () => t,
1748
- setFilterValue: (e, t) => o(t),
1749
- onFilterSelect: () => {},
1750
- onBackToFilterList: () => {},
1751
- onClose: () => m(!1),
1752
- triggerSource: "chip"
1753
- })]
1754
- })
1755
- });
1756
- }
1757
- jt.displayName = "FilterPill";
1758
- //#endregion
1759
- //#region src/components/features/filters/partials/filters-button.tsx
1760
- function Mt({ triggerRef: e, availableFilters: n, activeFilters: a, activeFilterInPopover: o, getFilterValue: s, setFilterValue: c, setActiveFilterInPopover: l }) {
1761
- let { defaultScale: u } = t(), d = P(void 0, u), [f, p] = G(!1), { strings: m } = $();
1762
- return H(() => {
1763
- f || l(null);
1764
- }, [f, l]), /* @__PURE__ */ J(ne, {
1765
- open: f,
1766
- onOpenChange: p,
1767
- children: [/* @__PURE__ */ q(te, {
1768
- asChild: !0,
1769
- children: /* @__PURE__ */ q(i, {
1770
- ref: e,
1771
- tone: "secondary",
1772
- buttonStyle: "outline",
1773
- size: d,
1774
- iconOnly: !0,
1775
- "aria-label": m.addFilter,
1776
- className: r("filters-button--component shrink-0", M[d], ie[d]),
1777
- children: /* @__PURE__ */ q(Ee, { className: "size-icon-sm" })
1778
- })
1779
- }), /* @__PURE__ */ q(At, {
1780
- activeFilterInPopover: o,
1781
- availableFilters: n,
1782
- activeFilters: a,
1783
- getFilterValue: s,
1784
- setFilterValue: c,
1785
- onFilterSelect: (e) => {
1786
- l(e);
1787
- },
1788
- onBackToFilterList: () => {
1789
- l(null);
1790
- },
1791
- onClose: () => {
1792
- l(null), p(!1);
1793
- },
1794
- triggerSource: "toolbar"
1795
- })]
1796
- });
1797
- }
1798
- //#endregion
1799
- //#region src/components/features/filters/partials/filter-tabs.tsx
1800
- function Nt({ tabs: e }) {
1801
- let { activeFilters: t, filters: n, replaceFilters: r } = $(), i = U(() => t.filter((e) => n.find((t) => t.key === e.key)?.type !== X.SEARCH), [t, n]), a = U(() => t.filter((e) => n.find((t) => t.key === e.key)?.type === X.SEARCH), [t, n]), s = U(() => {
1802
- for (let t of e) {
1803
- if (t.presets.length === 0) {
1804
- if (i.length === 0) return t.id;
1805
- continue;
1806
- }
1807
- if (t.presets.length === i.length && t.presets.every((e) => {
1808
- let t = i.find((t) => t.key === e.key);
1809
- if (!t) return !1;
1810
- let n = [...e.value].sort(), r = [...t.value].sort();
1811
- return !(n.length !== r.length || n.some((e, t) => e !== r[t]) || e.operator && t.operator !== e.operator);
1812
- })) return t.id;
1813
- }
1814
- return null;
1815
- }, [e, i]), c = V((e) => {
1816
- if (e.presets.length === 0) {
1817
- r([...a]);
1818
- return;
1819
- }
1820
- let t = e.presets.map((e) => {
1821
- let t = n.find((t) => t.key === e.key), r = e.operator ?? t?.operator ?? (t ? He(t.type) : "equals");
1822
- return {
1823
- id: e.key,
1824
- key: e.key,
1825
- value: e.value,
1826
- operator: r
1827
- };
1828
- });
1829
- r([...a, ...t]);
1830
- }, [
1831
- n,
1832
- a,
1833
- r
1834
- ]);
1835
- return e.length === 0 ? null : /* @__PURE__ */ q(le, {
1836
- value: s,
1837
- onValueChange: (t) => {
1838
- let n = e.find((e) => e.id === t);
1839
- n && c(n);
1840
- },
1841
- className: "filter-tabs--component",
1842
- children: /* @__PURE__ */ q(ce, {
1843
- variant: "chips",
1844
- role: "group",
1845
- "aria-orientation": void 0,
1846
- activateOnFocus: !0,
1847
- className: "gap-space-md",
1848
- children: e.map((e) => {
1849
- let t = s === e.id;
1850
- return /* @__PURE__ */ J(se, {
1851
- value: e.id,
1852
- role: "button",
1853
- "aria-selected": void 0,
1854
- "aria-controls": void 0,
1855
- "aria-pressed": t,
1856
- className: "filter-tabs--tab",
1857
- children: [/* @__PURE__ */ q(o, {
1858
- tag: "span",
1859
- weight: "medium",
1860
- className: "text-inherit",
1861
- children: e.label
1862
- }), e.count !== void 0 && /* @__PURE__ */ q(o, {
1863
- tag: "span",
1864
- size: "xs",
1865
- type: "secondary",
1866
- className: "tabular-nums",
1867
- children: e.count
1868
- })]
1869
- }, e.id);
1870
- })
1871
- })
1872
- });
1873
- }
1874
- //#endregion
1875
- //#region src/components/features/filters/facets/search-facet.tsx
1876
- var Pt = B.forwardRef(function(e, t) {
1877
- return /* @__PURE__ */ q(De, {
1878
- ...e,
1879
- ref: t,
1880
- className: r("animate-spin", e.className)
1881
- });
1882
- });
1883
- function Ft({ filter: e, value: t, onValueChange: n, className: i }) {
1884
- let { strings: a, isNavigating: o } = $(), [s, c] = G(t[0] || ""), l = W(s);
1885
- H(() => {
1886
- l.current = s;
1887
- }, [s]);
1888
- let u = W(t[0] ?? ""), d = W(!1);
1889
- H(() => {
1890
- if (d.current || o) return;
1891
- let e = l.current;
1892
- if (!t.length || t[0] === "") {
1893
- e !== "" && (c(""), u.current = "");
1894
- return;
1895
- }
1896
- t[0] !== void 0 && t[0] !== e && t[0] !== u.current && (c(t[0]), u.current = t[0]);
1897
- }, [t, o]);
1898
- let f = de((e) => {
1899
- u.current = e, d.current = !1, n([e]);
1900
- }, e.delay ?? 300), p = (e) => {
1901
- if (u.current === e) {
1902
- f.cancel(), d.current = !1;
1903
- return;
1904
- }
1905
- f(e);
1906
- };
1907
- return /* @__PURE__ */ q("div", {
1908
- className: r("search-facet--component", "search-facet relative w-full min-w-0 rounded-radius bg-background", i),
1909
- children: /* @__PURE__ */ q(F, {
1910
- type: "text",
1911
- "aria-label": e.label,
1912
- value: s,
1913
- onChange: (e) => {
1914
- d.current = !0;
1915
- let t = e.target.value;
1916
- c(t), p(t);
1917
- },
1918
- onFocus: () => {
1919
- d.current = !0;
1920
- },
1921
- onBlur: () => {
1922
- setTimeout(() => {
1923
- d.current = !1;
1924
- }, 100);
1925
- },
1926
- placeholder: e.placeholder ?? (() => {
1927
- let t = e.label.trim().toLowerCase();
1928
- return !t || t === "search" ? Y(a.searchPlaceholder, { filterLabel: "" }).replace(/\s+([….?!])/g, "$1").replace(/\s{2,}/g, " ").trim() : Y(a.searchPlaceholder, { filterLabel: t });
1929
- })(),
1930
- clearable: s.trim() !== "" && !o,
1931
- endIcon: o ? Pt : void 0,
1932
- strings: { clear: a.clearSearch }
1933
- })
1934
- });
1935
- }
1936
- var It = B.memo(Ft);
1937
- It.displayName = "SearchFacet";
1938
- //#endregion
1939
- //#region src/components/features/filters/partials/search-filters-list.tsx
1940
- function Lt({ filters: e, getFilterValue: t, setFilterValue: n, className: i }) {
1941
- return /* @__PURE__ */ q(K, { children: e.map((e) => /* @__PURE__ */ J(u, {
1942
- gap: "lg",
1943
- className: r("search-filters-list--component", "w-full min-w-0 sm:w-64 sm:flex-none", e.displayConfig.className, i),
1944
- children: [/* @__PURE__ */ q(It, {
1945
- filter: e,
1946
- value: t(e.key),
1947
- onValueChange: (t) => n(e.key, t)
1948
- }), !!e.description && /* @__PURE__ */ q(o, {
1949
- size: "xs",
1950
- type: "secondary",
1951
- children: e.description
1952
- })]
1953
- }, e.key)) });
1954
- }
1955
- //#endregion
1956
- //#region src/components/features/filters/filter-layout.tsx
1957
- var Rt = {
1958
- compact: "lg",
1959
- default: "xl"
1960
- }, zt = {
1961
- compact: "sm",
1962
- default: "md"
1963
- };
1964
- function Bt({ className: e, dynamicFilterOptions: t = {}, loadingFilters: n = {}, variant: a = "default", showClearFilters: s = !1, tabs: c }) {
1965
- let { getFilterValue: l, setFilterValue: d, isFilterActive: f, clearFilters: p, getFilterOperator: m, setFilterOperator: h, isNavigating: g, strings: _ } = $(), { processedFilters: v, searchFilters: y, alwaysVisibleFilters: b, activeRegularFilters: x, popoverFilters: S, hasActive: C } = $e({ dynamicFilterOptions: t }), [w, T] = G(null), E = v.find((e) => e.key === w) ?? null, D = V((e) => {
1966
- T(e?.key ?? null);
1967
- }, []);
1968
- H(() => {
1969
- w !== null && E === null && T(null);
1970
- }, [w, E]);
1971
- let O = W(null), k = W(null);
1972
- function A(e, t) {
1973
- t.length === 0 && e.displayConfig?.display !== "always" && (k.current = e.key), d(e.key, t);
1974
- }
1975
- H(() => {
1976
- let e = k.current;
1977
- e !== null && !f(e) && (O.current?.focus(), k.current = null);
1978
- }, [f]);
1979
- function j(e) {
1980
- return e.operators && e.operators.length > 0 ? e.operators : Ve(e.type, _.operators);
1981
- }
1982
- function M(e, t) {
1983
- h(e, t);
1984
- }
1985
- return /* @__PURE__ */ J(u, {
1986
- gap: Rt[a],
1987
- className: r("filter-layout--component", e),
1988
- children: [!!c && c.length > 0 && /* @__PURE__ */ q(Nt, { tabs: c }), /* @__PURE__ */ J(u, {
1989
- direction: "horizontal",
1990
- align: "center",
1991
- gap: zt[a],
1992
- children: [/* @__PURE__ */ q(gt, {
1993
- filterKey: "search-filters",
1994
- children: /* @__PURE__ */ q(Lt, {
1995
- filters: y,
1996
- getFilterValue: l,
1997
- setFilterValue: d
1998
- })
1999
- }), /* @__PURE__ */ J("div", {
2000
- className: r("contents", g && "pointer-events-none opacity-60"),
2001
- children: [
2002
- Object.entries(n).filter(([, e]) => e).map(([e]) => {
2003
- let t = v.find((t) => t.key === e)?.label || e;
2004
- return /* @__PURE__ */ J(u, {
2005
- direction: "horizontal",
2006
- gap: "sm",
2007
- wrap: !1,
2008
- className: "rounded-radius bg-muted/50 px-control-sm py-space-xs",
2009
- children: [/* @__PURE__ */ q("div", { className: "border-muted-foreground/30 border-t-primary size-icon-sm animate-spin rounded-full border-2" }), /* @__PURE__ */ q(o, {
2010
- tag: "span",
2011
- type: "secondary",
2012
- children: Y(_.loadingOptions, { filterLabel: t })
2013
- })]
2014
- }, `loading-${e}`);
2015
- }),
2016
- [...b, ...x].map((e) => /* @__PURE__ */ q(jt, {
2017
- filter: e,
2018
- value: l(e.key) ?? [],
2019
- active: f(e.key),
2020
- operator: m(e.key) || "equals",
2021
- operators: j(e),
2022
- onOperatorChange: (t) => M(e.key, t),
2023
- onValueChange: (t) => A(e, t),
2024
- onClear: () => A(e, []),
2025
- availableFilters: S,
2026
- activeFilters: [...x, ...b]
2027
- }, e.key)),
2028
- S.length > 0 && /* @__PURE__ */ q(gt, {
2029
- filterKey: "filters-button",
2030
- children: /* @__PURE__ */ q(Mt, {
2031
- triggerRef: O,
2032
- availableFilters: S,
2033
- activeFilters: x,
2034
- activeFilterInPopover: E,
2035
- getFilterValue: l,
2036
- setFilterValue: d,
2037
- setActiveFilterInPopover: D
2038
- })
2039
- }),
2040
- !!s && C && /* @__PURE__ */ q(i, {
2041
- tone: "secondary",
2042
- buttonStyle: "ghost",
2043
- onClick: p,
2044
- className: "text-muted-foreground ml-auto",
2045
- children: _.clearFilters
2046
- })
2047
- ]
2048
- })]
2049
- })]
2050
- });
2051
- }
2052
- //#endregion
2053
- //#region src/components/features/filters/filter-query.ts
2054
- var Vt = "__op", Ht = ["page"], Ut = new Set(Object.values(Z));
2055
- function Wt(e) {
2056
- let t = {};
2057
- if (!e) return t;
2058
- if (e instanceof URLSearchParams) return e.forEach((e, n) => {
2059
- t[n] = [...t[n] ?? [], e];
2060
- }), t;
2061
- for (let [n, r] of Object.entries(e)) {
2062
- let e = (Array.isArray(r) ? r : [r]).filter((e) => e != null).map((e) => String(e));
2063
- e.some(Boolean) && (t[n] = e);
2064
- }
2065
- return t;
2066
- }
2067
- function Gt(e) {
2068
- let t = {};
2069
- for (let [n, r] of Object.entries(e)) r.length !== 0 && (t[n] = r.length === 1 ? r[0] : r);
2070
- return t;
2071
- }
2072
- function Kt(e, t, n) {
2073
- let r = e[t] ?? [];
2074
- return n === "comma" ? r.flatMap((e) => e.split(",")) : r;
2075
- }
2076
- function qt(e, t) {
2077
- return t.map((e) => e.trim()).filter((e) => e.length > 0).map((t) => {
2078
- if (!e.parse) return t;
2079
- let n = e.parse(t);
2080
- return n == null ? "" : String(n);
2081
- }).filter((e) => e.length > 0);
2082
- }
2083
- function Jt(e, t) {
2084
- return t.map((t) => {
2085
- let n = e.transform ? e.transform(t) : t, r = e.format ? e.format(n) : n;
2086
- return r == null ? "" : String(r);
2087
- }).filter((e) => e.length > 0);
2088
- }
2089
- function Yt(e) {
2090
- return e.operator ?? e.operators?.[0]?.value ?? He(e.type);
2091
- }
2092
- function Xt(e, t, n) {
2093
- let [r] = t[`${e.key}${n}`] ?? [];
2094
- return r && Ut.has(r) ? r : Yt(e);
2095
- }
2096
- function Zt(e, t, n) {
2097
- return e === "always" || e !== "never" && t !== n;
2098
- }
2099
- function Qt(e) {
2100
- return e.type === X.MULTI_SELECT || e.type === X.TAGS || e.multiple === !0;
2101
- }
2102
- function $t(e, t, n = {}) {
2103
- let r = n.operatorSuffix ?? Vt, i = n.arrayFormat ?? "repeat", a = Wt(t);
2104
- return e.flatMap((e) => {
2105
- let t = Kt(a, e.key, i), n = Xt(e, a, r);
2106
- if (e.type === X.RANGE) {
2107
- let i = t.length === 1 && !e.operator && !e.operators?.length && !a[`${e.key}${r}`]?.[0] ? Z.EQUALS : n, o = Ue(t, i).map((t) => qt(e, [t])[0] ?? "");
2108
- return o.some(Boolean) ? [{
2109
- id: e.key,
2110
- key: e.key,
2111
- operator: i,
2112
- value: o
2113
- }] : [];
2114
- }
2115
- let o = qt(e, t);
2116
- if (o.length === 0) return [];
2117
- let s = e.type === X.DATE && n === Z.BETWEEN;
2118
- return s && !We(o) ? [] : [{
2119
- id: e.key,
2120
- key: e.key,
2121
- operator: n,
2122
- value: s || Qt(e) ? o : [o[0]]
2123
- }];
2124
- });
2125
- }
2126
- function en(e, t, n, r = {}) {
2127
- let i = r.operatorSuffix ?? Vt, a = r.arrayFormat ?? "repeat", o = r.preserveUnrelated ?? !0, s = r.includeOperators ?? "changed", c = r.resetPageKeys ?? Ht, l = o ? Wt(n) : {}, u = new Map(e.map((e) => [e.key, e]));
2128
- for (let t of e) delete l[t.key], delete l[`${t.key}${i}`];
2129
- for (let e of c) delete l[e];
2130
- for (let e of t) {
2131
- let t = u.get(e.key);
2132
- if (!t) continue;
2133
- let n = t.type === X.RANGE ? Ue(e.value, e.operator).map((e) => e ? Jt(t, [e])[0] ?? "" : "") : Jt(t, e.value);
2134
- if (!n.some(Boolean) || t.type === X.DATE && e.operator === Z.BETWEEN && !We(n)) continue;
2135
- l[e.key] = a === "comma" ? [n.join(",")] : n;
2136
- let r = Yt(t);
2137
- Zt(s, e.operator, r) && (l[`${e.key}${i}`] = [e.operator]);
2138
- }
2139
- return Gt(l);
2140
- }
2141
- function tn(e, t, n = {}) {
2142
- let r = n.preserveUnrelated ?? !0, i = n.resetPageKeys ?? Ht, a = r ? Wt(e) : {}, o = Wt(t);
2143
- for (let e of i) delete a[e];
2144
- for (let [e, t] of Object.entries(o)) t.length === 0 ? delete a[e] : a[e] = t;
2145
- return Gt(a);
2146
- }
2147
- //#endregion
2148
- //#region src/components/features/filters/facets/select-facet.tsx
2149
- function nn({ filter: e, value: n, onValueChange: a, className: s }) {
2150
- let { defaultScale: c } = t(), l = P(void 0, c), { strings: u } = $(), [d, f] = G(!1), [p, m] = G(""), h = n.length > 0, g = e.options, _ = (t) => {
2151
- e.multiple ? n.includes(t) ? a(n.filter((e) => e !== t)) : a([...n, t]) : (a([t]), e.closeOnSelect !== !1 && f(!1));
2152
- }, v = (t) => Ye(e, t) ?? t, y = U(() => qe(g) ? Je(g ?? []) : null, [g]), b = U(() => (g ?? []).map((e) => ({
2153
- value: e.value,
2154
- label: e.label,
2155
- description: e.description,
2156
- icon: e.icon,
2157
- selected: n.includes(e.value),
2158
- disabled: e.disabled
2159
- })), [g, n]), x = Y(u.searchPlaceholder, { filterLabel: e.label.toLowerCase() }), S = Y(u.selected, {
2160
- count: n.length,
2161
- filterLabel: Q((n.length > 1 ? e.pluralLabel : e.label) ?? e.label)
2162
- });
2163
- return y ? /* @__PURE__ */ q("div", {
2164
- className: r("select-facet--component", "relative", s),
2165
- children: /* @__PURE__ */ q(ge, {
2166
- items: y,
2167
- value: e.multiple ? n : n[0] ?? null,
2168
- multiple: !!e.multiple,
2169
- selectable: e.selectableOptions ?? "leaf",
2170
- size: l,
2171
- "aria-label": e.label,
2172
- strings: {
2173
- placeholder: e.placeholder ?? u.select,
2174
- search: x,
2175
- empty: u.noOptionsFound,
2176
- root: e.label,
2177
- back: u.previousLevel,
2178
- selectCurrent: u.selectCurrentLevel
2179
- },
2180
- renderValue: n.length > 1 ? () => S : void 0,
2181
- onValueChange: (e) => a(e == null ? [] : typeof e == "string" ? [e] : [...e])
2182
- })
2183
- }) : /* @__PURE__ */ q("div", {
2184
- className: r("select-facet--component", "relative", s),
2185
- children: /* @__PURE__ */ q(ue, {
2186
- open: d,
2187
- onOpenChange: f,
2188
- search: !0,
2189
- searchValue: p,
2190
- onSearchChange: m,
2191
- strings: {
2192
- searchPlaceholder: x,
2193
- empty: u.noOptionsFound
2194
- },
2195
- contentClassName: "w-(--anchor-width) min-w-56",
2196
- trigger: /* @__PURE__ */ J(i, {
2197
- tone: "secondary",
2198
- buttonStyle: "outline",
2199
- size: l,
2200
- role: "combobox",
2201
- "aria-expanded": d,
2202
- className: N(l),
2203
- children: [h ? n.length === 1 ? /* @__PURE__ */ q(o, {
2204
- tag: "span",
2205
- weight: "semibold",
2206
- className: "truncate",
2207
- children: v(n[0])
2208
- }) : /* @__PURE__ */ q(o, {
2209
- tag: "span",
2210
- weight: "semibold",
2211
- children: S
2212
- }) : /* @__PURE__ */ q(o, {
2213
- tag: "span",
2214
- type: "secondary",
2215
- children: e.placeholder ?? u.select
2216
- }), /* @__PURE__ */ q(Te, { className: "ml-control-gap-small size-icon-sm shrink-0 opacity-50" })]
2217
- }),
2218
- items: b,
2219
- onSelect: (e) => _(e.value)
2220
- })
2221
- });
2222
- }
2223
- //#endregion
2224
- //#region src/components/features/filters/facets/async-select-facet.tsx
2225
- function rn({ filter: e, value: n, onValueChange: a, className: s }) {
2226
- let { defaultScale: c } = t(), l = P(void 0, c), { strings: d, cacheAsyncOptions: m, getAsyncOptionLabel: h, reportError: g } = $(), [_, v] = G(!1), [y, b] = G(""), x = U(() => /* @__PURE__ */ new Map(), [
2227
- e.key,
2228
- e.asyncConfig?.fetcher,
2229
- e.asyncConfig?.mapToOption
2230
- ]), { options: S, isLoading: C, isFetching: w, isError: A, refetch: M, isBelowMinQuery: F, minQueryLength: I } = lt(e, y, _, { onError: g });
2231
- H(() => {
2232
- if (S.length !== 0) {
2233
- for (let e of S) x.set(e.value, e);
2234
- m(e.key, S);
2235
- }
2236
- }, [
2237
- m,
2238
- e.key,
2239
- x,
2240
- S
2241
- ]);
2242
- let ee = e.multiple !== !1, L = e.maxSelected, R = U(() => e.options ?? [], [e.options]), z = U(() => {
2243
- let t = new Set(n), r = new Set([...R, ...S].map((e) => e.value)), i = [];
2244
- for (let t of n) if (!r.has(t)) {
2245
- let n = x.get(t);
2246
- if (n) i.push(n);
2247
- else {
2248
- let n = R.find((e) => e.value === t);
2249
- if (n) {
2250
- i.push(n);
2251
- continue;
2252
- }
2253
- let r = h(e.key, t);
2254
- r && i.push({
2255
- value: t,
2256
- label: r,
2257
- icon: e.icon
2258
- });
2259
- }
2260
- }
2261
- return [
2262
- ...i,
2263
- ...R,
2264
- ...S
2265
- ].sort((e, n) => +!t.has(e.value) - !t.has(n.value));
2266
- }, [
2267
- R,
2268
- S,
2269
- n,
2270
- e.key,
2271
- e.icon,
2272
- x,
2273
- h
2274
- ]), ie = (t) => {
2275
- if (ee) {
2276
- if (n.includes(t)) a(n.filter((e) => e !== t));
2277
- else {
2278
- if (L && n.length >= L) return;
2279
- a([...n, t]);
2280
- }
2281
- } else a([t]), e.closeOnSelect !== !1 && v(!1);
2282
- }, ae = (t) => {
2283
- let n = S.find((e) => e.value === t);
2284
- if (n) return n.label;
2285
- let r = R.find((e) => e.value === t);
2286
- if (r) return r.label;
2287
- let i = x.get(t);
2288
- return i ? i.label : h(e.key, t) ?? t;
2289
- }, oe = n.length > 0, se = U(() => C || w ? /* @__PURE__ */ q(f, {
2290
- className: "async-select-facet--component",
2291
- label: d.searching
2292
- }) : A ? /* @__PURE__ */ q(p, {
2293
- variant: "inline",
2294
- title: d.fetchError,
2295
- action: /* @__PURE__ */ q(i, {
2296
- tone: "secondary",
2297
- buttonStyle: "outline",
2298
- size: "sm",
2299
- onClick: (e) => {
2300
- e.stopPropagation(), M();
2301
- },
2302
- children: d.retryFetch
2303
- })
2304
- }) : F ? /* @__PURE__ */ q("div", {
2305
- className: "text-muted-foreground flex items-center justify-center py-space-xl",
2306
- children: /* @__PURE__ */ q(o, {
2307
- tag: "span",
2308
- size: "xs",
2309
- type: "secondary",
2310
- children: Y(d.minQueryHint, { min: I })
2311
- })
2312
- }) : /* @__PURE__ */ q(o, {
2313
- tag: "span",
2314
- type: "secondary",
2315
- children: d.noOptionsFound
2316
- }), [
2317
- C,
2318
- w,
2319
- A,
2320
- F,
2321
- I,
2322
- d,
2323
- M
2324
- ]);
2325
- return /* @__PURE__ */ q("div", {
2326
- className: r("async-select-facet--component relative", s),
2327
- children: /* @__PURE__ */ J(ne, {
2328
- open: _,
2329
- onOpenChange: (e) => {
2330
- v(e), e || b("");
2331
- },
2332
- children: [/* @__PURE__ */ q(te, { render: /* @__PURE__ */ J(i, {
2333
- tone: "secondary",
2334
- buttonStyle: "outline",
2335
- size: l,
2336
- role: "combobox",
2337
- "aria-expanded": _,
2338
- className: N(l),
2339
- children: [oe ? n.length === 1 ? /* @__PURE__ */ q(o, {
2340
- tag: "span",
2341
- weight: "semibold",
2342
- className: "truncate",
2343
- children: ae(n[0])
2344
- }) : /* @__PURE__ */ q(o, {
2345
- tag: "span",
2346
- weight: "semibold",
2347
- children: Y(d.selected, {
2348
- count: n.length,
2349
- filterLabel: Q((n.length > 1 ? e.pluralLabel : e.label) ?? e.label)
2350
- })
2351
- }) : /* @__PURE__ */ q(o, {
2352
- tag: "span",
2353
- type: "secondary",
2354
- children: e.placeholder ?? d.select
2355
- }), /* @__PURE__ */ q(Te, { className: "ml-control-gap-small size-icon-sm shrink-0 opacity-50" })]
2356
- }) }), /* @__PURE__ */ q(re, {
2357
- type: "menu",
2358
- inset: "flush",
2359
- className: "w-full min-w-70 gap-0",
2360
- children: /* @__PURE__ */ J(j, {
2361
- shouldFilter: !1,
2362
- inset: "flush",
2363
- className: "rounded-none",
2364
- children: [/* @__PURE__ */ q(E, {
2365
- placeholder: Y(d.searchPlaceholder, { filterLabel: e.label }),
2366
- value: y,
2367
- onValueChange: b
2368
- }), /* @__PURE__ */ q(O, { children: z.length === 0 ? /* @__PURE__ */ q(D, { children: se }) : /* @__PURE__ */ J(k, { children: [!(!w || C) && /* @__PURE__ */ J(u, {
2369
- direction: "horizontal",
2370
- gap: "sm",
2371
- wrap: !1,
2372
- className: "px-control-sm py-space-xs",
2373
- children: [/* @__PURE__ */ q(De, { className: "text-muted-foreground size-icon-sm animate-spin" }), /* @__PURE__ */ q(o, {
2374
- tag: "span",
2375
- size: "xs",
2376
- type: "secondary",
2377
- children: d.searching
2378
- })]
2379
- }), z.map((e) => /* @__PURE__ */ J(T, {
2380
- value: e.value,
2381
- onSelect: () => ie(e.value),
2382
- disabled: e.disabled || !!L && n.length >= L && !n.includes(e.value),
2383
- children: [
2384
- /* @__PURE__ */ q(Se, { className: r("mr-control-gap size-icon-sm", n.includes(e.value) ? "opacity-100" : "opacity-0") }),
2385
- !!e.icon && /* @__PURE__ */ q("span", {
2386
- className: "mr-1.5",
2387
- children: e.icon
2388
- }),
2389
- /* @__PURE__ */ q(o, {
2390
- tag: "span",
2391
- children: e.label
2392
- })
2393
- ]
2394
- }, e.value))] }) })]
2395
- })
2396
- })]
2397
- })
2398
- });
2399
- }
2400
- //#endregion
2401
- //#region src/components/features/filters/validators.ts
2402
- function an(e) {
2403
- return (t) => {
2404
- if (t == null || typeof t == "string" && t.length === 0) return !0;
2405
- let n = e.safeParse(t);
2406
- return n.success ? !0 : n.error?.issues?.[0]?.message ?? n.error?.message ?? !1;
2407
- };
2408
- }
2409
- function on(e, t) {
2410
- return (n) => e(n) ? !0 : t;
2411
- }
2412
- //#endregion
2413
- export { Ve as A, $e as C, ze as D, Be as E, Fe as F, Ne as I, Pe as L, Ie as M, Z as N, He as O, X as P, Y as R, et as S, $ as T, gt as _, tn as a, st as b, Bt as c, Nt as d, Mt as f, yt as g, Et as h, nn as i, Le as j, Re as k, Lt as l, At as m, an as n, $t as o, jt as p, rn as r, en as s, on as t, It as u, pt as v, Qe as w, tt as x, lt as y };
2414
-
2415
- //# sourceMappingURL=filters-Dl80yYtN.js.map