@persona/design-system 0.1.7 → 0.1.8

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 (796) hide show
  1. package/CHANGELOG.md +343 -221
  2. package/dist/{Action-DkNqzc2X.d.mts → Action-CVtzREhU.d.mts} +3 -3
  3. package/dist/{Action-z1rV4qON.d.cts → Action-E90Wvqmc.d.cts} +3 -3
  4. package/dist/Action.d.cts +1 -1
  5. package/dist/Action.d.mts +1 -1
  6. package/dist/AdvancedFilterRuleRow.d.mts +37 -0
  7. package/dist/AdvancedFilterRulesPopover.d.mts +62 -0
  8. package/dist/ArrayValueControl.d.mts +38 -0
  9. package/dist/Attribute.d.mts +4 -4
  10. package/dist/AttributeGrid.d.mts +1 -1
  11. package/dist/{Badge-DAGPU4-e.cjs → Badge-ADPloFsd.cjs} +2 -2
  12. package/dist/{Badge-DAGPU4-e.cjs.map → Badge-ADPloFsd.cjs.map} +1 -1
  13. package/dist/{Badge-DRn_r6is.mjs → Badge-DortWowZ.mjs} +2 -2
  14. package/dist/{Badge-DRn_r6is.mjs.map → Badge-DortWowZ.mjs.map} +1 -1
  15. package/dist/Banner.d.mts +1 -1
  16. package/dist/BooleanValueControl.d.mts +20 -0
  17. package/dist/{Breadcrumb-BOxfam3E.d.cts → Breadcrumb-VH-Mwo-M.d.cts} +15 -2
  18. package/dist/{Breadcrumb-On7pOpgt.d.mts → Breadcrumb-lziQ1FX9.d.mts} +15 -2
  19. package/dist/Breadcrumb.d.cts +2 -2
  20. package/dist/Breadcrumb.d.mts +2 -2
  21. package/dist/Breadcrumbs-BBREROrw.d.cts +26 -0
  22. package/dist/Breadcrumbs-CDZ_Mrcg.mjs +288 -0
  23. package/dist/Breadcrumbs-CDZ_Mrcg.mjs.map +1 -0
  24. package/dist/Breadcrumbs-DJ5qqqRD.d.mts +26 -0
  25. package/dist/Breadcrumbs-tR49JqAS.cjs +295 -0
  26. package/dist/Breadcrumbs-tR49JqAS.cjs.map +1 -0
  27. package/dist/Breadcrumbs.d.cts +2 -20
  28. package/dist/Breadcrumbs.d.mts +2 -20
  29. package/dist/{Button-DXsYU5qU.d.mts → Button-9p469xA1.d.mts} +3 -3
  30. package/dist/Button.d.mts +1 -1
  31. package/dist/ButtonGroup.d.mts +1 -1
  32. package/dist/Calendar.d.mts +1 -1
  33. package/dist/CalendarBase.d.mts +1 -1
  34. package/dist/{Card-CLTkZLKr.mjs → Card-BMCB9eFC.mjs} +4 -4
  35. package/dist/{Card-CLTkZLKr.mjs.map → Card-BMCB9eFC.mjs.map} +1 -1
  36. package/dist/{Card-DnmrsQWi.d.cts → Card-CJPEmUvg.d.cts} +2 -2
  37. package/dist/{Card-IOBCsfke.d.mts → Card-CqnG--CU.d.mts} +4 -4
  38. package/dist/{Card-CaOItkgL.cjs → Card-Csz-PxX0.cjs} +4 -4
  39. package/dist/{Card-CaOItkgL.cjs.map → Card-Csz-PxX0.cjs.map} +1 -1
  40. package/dist/Card.d.cts +1 -1
  41. package/dist/Card.d.mts +1 -1
  42. package/dist/Card2.d.cts +1 -1
  43. package/dist/Card2.d.mts +1 -1
  44. package/dist/CardV2-C9z0Hr-c.mjs +411 -0
  45. package/dist/CardV2-C9z0Hr-c.mjs.map +1 -0
  46. package/dist/CardV2-DJXgFomd.cjs +419 -0
  47. package/dist/CardV2-DJXgFomd.cjs.map +1 -0
  48. package/dist/{Checkbox-BghGF-iW.mjs → Checkbox-B0bjZbji.mjs} +5 -5
  49. package/dist/{Checkbox-BghGF-iW.mjs.map → Checkbox-B0bjZbji.mjs.map} +1 -1
  50. package/dist/{Checkbox-MUC37dLY.d.mts → Checkbox-Bm8exUfH.d.mts} +1 -1
  51. package/dist/{Checkbox-DhxpxzGp.cjs → Checkbox-CmCujC1W.cjs} +5 -5
  52. package/dist/{Checkbox-DhxpxzGp.cjs.map → Checkbox-CmCujC1W.cjs.map} +1 -1
  53. package/dist/{Checkbox-DfI0Xp3y.d.cts → Checkbox-Cr8ifm10.d.cts} +1 -1
  54. package/dist/Checkbox.d.cts +1 -1
  55. package/dist/Checkbox.d.mts +1 -1
  56. package/dist/CheckboxGroupField.d.cts +1 -1
  57. package/dist/CheckboxGroupField.d.mts +2 -2
  58. package/dist/ChoicesValueControl.d.mts +35 -0
  59. package/dist/{Combobox-CeKMrlxy.mjs → Combobox-BdqU5WLG.mjs} +254 -70
  60. package/dist/Combobox-BdqU5WLG.mjs.map +1 -0
  61. package/dist/{Combobox-Bedo_GIj.d.mts → Combobox-C99xluaM.d.mts} +3 -3
  62. package/dist/{Combobox-4Bi9-N1p.cjs → Combobox-COXvmxlM.cjs} +247 -63
  63. package/dist/Combobox-COXvmxlM.cjs.map +1 -0
  64. package/dist/{Combobox-5rAFq_52.d.cts → Combobox-DBWMHwUt.d.cts} +3 -3
  65. package/dist/Combobox.d.cts +2 -2
  66. package/dist/Combobox.d.mts +2 -2
  67. package/dist/{ComboboxBase-DGZUdsQa.d.mts → ComboboxBase-BsY7CYoB.d.mts} +48 -8
  68. package/dist/{ComboboxBase-BoR9DVwe.d.cts → ComboboxBase-zZ3tE-dH.d.cts} +45 -5
  69. package/dist/ComboboxBase.d.cts +2 -2
  70. package/dist/ComboboxBase.d.mts +2 -2
  71. package/dist/{ComboboxMultiSelect-DMWPiBrE.d.mts → ComboboxMultiSelect-dNuETspL.d.mts} +2 -2
  72. package/dist/{ComboboxMultiSelect-CnI6sFAF.d.cts → ComboboxMultiSelect-ioB4Jx7_.d.cts} +2 -2
  73. package/dist/ComboboxMultiSelect.d.cts +1 -1
  74. package/dist/ComboboxMultiSelect.d.mts +1 -1
  75. package/dist/{ComboboxSingleSelect-CcppU_hq.d.mts → ComboboxSingleSelect-C8KvIJ43.d.mts} +4 -4
  76. package/dist/{ComboboxSingleSelect-Japejm0g.d.cts → ComboboxSingleSelect-Fn80tdhz.d.cts} +4 -4
  77. package/dist/ComboboxSingleSelect.d.cts +1 -1
  78. package/dist/ComboboxSingleSelect.d.mts +1 -1
  79. package/dist/{CompactBar-DTsGo1zU.d.cts → CompactBar-BEAK55kh.d.cts} +3 -3
  80. package/dist/{CompactBar-2cpJD7qg.d.mts → CompactBar-CXqlVKy7.d.mts} +3 -3
  81. package/dist/CompactBar.d.cts +1 -1
  82. package/dist/CompactBar.d.mts +1 -1
  83. package/dist/{ConfigFormGroup-DVRhkS2L.cjs → ConfigFormGroup-m5YdVa9n.cjs} +3 -3
  84. package/dist/{ConfigFormGroup-DVRhkS2L.cjs.map → ConfigFormGroup-m5YdVa9n.cjs.map} +1 -1
  85. package/dist/{ConfigFormGroup-DISUwz5j.mjs → ConfigFormGroup-yhb2jldT.mjs} +3 -3
  86. package/dist/{ConfigFormGroup-DISUwz5j.mjs.map → ConfigFormGroup-yhb2jldT.mjs.map} +1 -1
  87. package/dist/{ControlBar-DXyl1gjc.d.mts → ControlBar-D8CirAyZ.d.cts} +2 -2
  88. package/dist/{ControlBar-BGmXymCB.d.cts → ControlBar-tOCQnbAl.d.mts} +2 -2
  89. package/dist/ControlBar.d.cts +1 -1
  90. package/dist/ControlBar.d.mts +1 -1
  91. package/dist/DataTable.d.cts +3 -3
  92. package/dist/DataTable.d.mts +4 -4
  93. package/dist/DateField.d.cts +1 -1
  94. package/dist/DateField.d.mts +1 -1
  95. package/dist/DatePicker-BlCgFb7g.cjs +948 -0
  96. package/dist/DatePicker-BlCgFb7g.cjs.map +1 -0
  97. package/dist/DatePicker-DY1YA_Fu.mjs +922 -0
  98. package/dist/DatePicker-DY1YA_Fu.mjs.map +1 -0
  99. package/dist/DatePicker.d.cts +1 -1
  100. package/dist/DatePicker.d.mts +1 -1
  101. package/dist/DateRangePicker.d.cts +1 -1
  102. package/dist/DateRangePicker.d.mts +1 -1
  103. package/dist/DateValueControl.d.mts +26 -0
  104. package/dist/{DropdownButton-B397h6ka.mjs → DropdownButton-DKLjJylQ.mjs} +3 -3
  105. package/dist/{DropdownButton-B397h6ka.mjs.map → DropdownButton-DKLjJylQ.mjs.map} +1 -1
  106. package/dist/{DropdownButton-Du6dwZVL.cjs → DropdownButton-Dl7IEzAc.cjs} +3 -3
  107. package/dist/{DropdownButton-Du6dwZVL.cjs.map → DropdownButton-Dl7IEzAc.cjs.map} +1 -1
  108. package/dist/DropdownButton.d.cts +1 -1
  109. package/dist/DropdownButton.d.mts +2 -2
  110. package/dist/{DropdownMenu-5qIgQ14A.d.mts → DropdownMenu-CVPanvKA.d.mts} +3 -3
  111. package/dist/{DropdownMenu-cnkoGc7C.mjs → DropdownMenu-DGYexb7s.mjs} +3 -3
  112. package/dist/{DropdownMenu-cnkoGc7C.mjs.map → DropdownMenu-DGYexb7s.mjs.map} +1 -1
  113. package/dist/{DropdownMenu-CfJxgWN5.cjs → DropdownMenu-DnlQqTjs.cjs} +3 -3
  114. package/dist/{DropdownMenu-CfJxgWN5.cjs.map → DropdownMenu-DnlQqTjs.cjs.map} +1 -1
  115. package/dist/{DropdownMenu-FIYz6oAo.d.cts → DropdownMenu-FkiManPP.d.cts} +2 -2
  116. package/dist/DropdownMenu.d.cts +1 -1
  117. package/dist/DropdownMenu.d.mts +1 -1
  118. package/dist/{ErrorProps-BosuK6zJ.d.cts → ErrorProps-CN2XjaOX.d.mts} +1 -1
  119. package/dist/{ErrorProps-iEj4BIVA.d.mts → ErrorProps-Dxqb4gw_.d.cts} +1 -1
  120. package/dist/ErrorProps.d.cts +1 -1
  121. package/dist/ErrorProps.d.mts +1 -1
  122. package/dist/FieldRegistry-OX60T3hr.d.cts +122 -0
  123. package/dist/FieldRegistry-rqSkjchY.d.mts +122 -0
  124. package/dist/FieldRegistry.d.cts +2 -0
  125. package/dist/FieldRegistry.d.mts +2 -0
  126. package/dist/FilterBar-D3LiIy1-.d.mts +103 -0
  127. package/dist/FilterBar-YzOh02f9.d.cts +103 -0
  128. package/dist/FilterBar.d.cts +2 -0
  129. package/dist/FilterBar.d.mts +2 -0
  130. package/dist/FilterPickerMenu.d.mts +84 -0
  131. package/dist/FilterPill.d.mts +60 -0
  132. package/dist/FilterPopover.d.mts +87 -0
  133. package/dist/FloatValueControl.d.mts +40 -0
  134. package/dist/{FormControl-ArDcvmir.mjs → FormControl-B28qa7aQ.mjs} +6 -6
  135. package/dist/{FormControl-ArDcvmir.mjs.map → FormControl-B28qa7aQ.mjs.map} +1 -1
  136. package/dist/{FormControl-BrsML00L.d.cts → FormControl-DFp_qcW1.d.cts} +2 -2
  137. package/dist/{FormControl-DnsC4vTX.d.mts → FormControl-DH3bgqaB.d.mts} +3 -3
  138. package/dist/{FormControl-Czt95h2L.cjs → FormControl-MkBXuUF6.cjs} +6 -6
  139. package/dist/{FormControl-Czt95h2L.cjs.map → FormControl-MkBXuUF6.cjs.map} +1 -1
  140. package/dist/FormControl.d.cts +1 -1
  141. package/dist/FormControl.d.mts +1 -1
  142. package/dist/FormControlLabel.d.mts +1 -1
  143. package/dist/{FormField-BddCs6P0.d.mts → FormField-BugkBvN4.d.mts} +2 -2
  144. package/dist/FormField-D3XhxTMg.cjs +550 -0
  145. package/dist/FormField-D3XhxTMg.cjs.map +1 -0
  146. package/dist/FormField-PeYYRO4s.mjs +471 -0
  147. package/dist/FormField-PeYYRO4s.mjs.map +1 -0
  148. package/dist/{FormField-DoSXvnJ3.d.cts → FormField-idNLw5PW.d.cts} +2 -2
  149. package/dist/FormField.d.cts +1 -1
  150. package/dist/FormField.d.mts +1 -1
  151. package/dist/{Header-CkZvzbzL.d.cts → Header-C-WhPOin.d.cts} +3 -3
  152. package/dist/{Header-B-Us54dR.d.mts → Header-CDTYK1XJ.d.mts} +2 -2
  153. package/dist/Header.d.cts +1 -1
  154. package/dist/Header.d.mts +1 -1
  155. package/dist/{HelperTooltip-CofPKyZh.d.mts → HelperTooltip-B7Ysh8B3.d.mts} +3 -3
  156. package/dist/{HelperTooltip-C1CYMpJP.d.cts → HelperTooltip-T-sTGGLD.d.cts} +2 -2
  157. package/dist/HelperTooltip.d.cts +1 -1
  158. package/dist/HelperTooltip.d.mts +1 -1
  159. package/dist/{HoverCopyableField-B_WNB7Qp.cjs → HoverCopyableField-CRkM7o4B.cjs} +6 -6
  160. package/dist/{HoverCopyableField-B_WNB7Qp.cjs.map → HoverCopyableField-CRkM7o4B.cjs.map} +1 -1
  161. package/dist/{HoverCopyableField-DR575ayC.mjs → HoverCopyableField-ClXBg_ld.mjs} +6 -6
  162. package/dist/{HoverCopyableField-DR575ayC.mjs.map → HoverCopyableField-ClXBg_ld.mjs.map} +1 -1
  163. package/dist/HoverCopyableField.d.mts +1 -1
  164. package/dist/{IconButton-Dnnlf9uO.d.mts → IconButton-BSES_-6g.d.mts} +2 -2
  165. package/dist/{IconButton-DC4rh6ow.mjs → IconButton-CIWiEsS-.mjs} +5 -5
  166. package/dist/{IconButton-DC4rh6ow.mjs.map → IconButton-CIWiEsS-.mjs.map} +1 -1
  167. package/dist/{IconButton-DNy7g5zh.cjs → IconButton-nlgjJQCS.cjs} +4 -4
  168. package/dist/{IconButton-DNy7g5zh.cjs.map → IconButton-nlgjJQCS.cjs.map} +1 -1
  169. package/dist/IconButton.d.mts +1 -1
  170. package/dist/ImageTile.d.cts +1 -1
  171. package/dist/ImageTile.d.mts +2 -2
  172. package/dist/InlineCombobox.d.mts +2 -2
  173. package/dist/InlineInput.d.mts +1 -1
  174. package/dist/{Input-PWfwMSJ7.mjs → Input-BFI_e7aU.mjs} +5 -5
  175. package/dist/{Input-PWfwMSJ7.mjs.map → Input-BFI_e7aU.mjs.map} +1 -1
  176. package/dist/{Input-CEcTvtX2.d.cts → Input-BM0DzWEf.d.cts} +2 -2
  177. package/dist/{Input-4KeYlOWM.d.mts → Input-BPClVzwD.d.mts} +4 -4
  178. package/dist/{Input-BDLUq-pK.cjs → Input-OJPQ07TW.cjs} +5 -5
  179. package/dist/{Input-BDLUq-pK.cjs.map → Input-OJPQ07TW.cjs.map} +1 -1
  180. package/dist/Input.d.cts +1 -1
  181. package/dist/Input.d.mts +1 -1
  182. package/dist/{InputProps-DNlik5IZ.d.cts → InputProps-BnjxrdWQ.d.mts} +2 -2
  183. package/dist/{InputProps-CTLG2Tr0.d.mts → InputProps-CoVNpQSj.d.cts} +2 -2
  184. package/dist/InputProps.d.cts +1 -1
  185. package/dist/InputProps.d.mts +1 -1
  186. package/dist/IntegerValueControl.d.mts +39 -0
  187. package/dist/LayoutLoadingShimmer.d.cts +20 -0
  188. package/dist/LayoutLoadingShimmer.d.mts +20 -0
  189. package/dist/Link.d.mts +1 -1
  190. package/dist/{ListBox-BCscLcYL.cjs → ListBox-BP1eaG7L.cjs} +83 -14
  191. package/dist/ListBox-BP1eaG7L.cjs.map +1 -0
  192. package/dist/{ListBox-CDNOJmvz.mjs → ListBox-BwID8jpk.mjs} +83 -14
  193. package/dist/ListBox-BwID8jpk.mjs.map +1 -0
  194. package/dist/{ListBox-WyZvseo5.d.cts → ListBox-QaeRQBSC.d.cts} +2 -2
  195. package/dist/{ListBox-DZIAlPbc.d.mts → ListBox-_fcSPynx.d.mts} +5 -5
  196. package/dist/ListBox.d.cts +1 -1
  197. package/dist/ListBox.d.mts +1 -1
  198. package/dist/ListBoxField.d.cts +2 -2
  199. package/dist/ListBoxField.d.mts +3 -3
  200. package/dist/{LoadingShimmer-Bu6KtQ06.mjs → LoadingShimmer-Dsc_RCCf.mjs} +1 -1
  201. package/dist/{LoadingShimmer-Bu6KtQ06.mjs.map → LoadingShimmer-Dsc_RCCf.mjs.map} +1 -1
  202. package/dist/{LoadingShimmer-CUjbAqGd.cjs → LoadingShimmer-Dx6ncVUV.cjs} +1 -1
  203. package/dist/{LoadingShimmer-CUjbAqGd.cjs.map → LoadingShimmer-Dx6ncVUV.cjs.map} +1 -1
  204. package/dist/LoadingShimmer.d.mts +2 -2
  205. package/dist/LogicRow-BtCKGX_j.d.mts +40 -0
  206. package/dist/LogicRow-C6lrFIq0.d.cts +40 -0
  207. package/dist/LogicRow.d.cts +2 -0
  208. package/dist/LogicRow.d.mts +2 -0
  209. package/dist/MaskedInput.d.cts +2 -2
  210. package/dist/MaskedInput.d.mts +1 -1
  211. package/dist/{Menu-CVuFAxl2.mjs → Menu-CPYXo61N.mjs} +5 -5
  212. package/dist/{Menu-CVuFAxl2.mjs.map → Menu-CPYXo61N.mjs.map} +1 -1
  213. package/dist/{Menu-BJ5c7HGD.d.mts → Menu-CUp_9HgC.d.mts} +4 -4
  214. package/dist/{Menu-BKMxOXkj.d.cts → Menu-fUnbIYr5.d.cts} +3 -3
  215. package/dist/{Menu-BXic-30n.cjs → Menu-t2q8NrV0.cjs} +5 -5
  216. package/dist/{Menu-BXic-30n.cjs.map → Menu-t2q8NrV0.cjs.map} +1 -1
  217. package/dist/Menu.d.cts +1 -1
  218. package/dist/Menu.d.mts +1 -1
  219. package/dist/{MiddleTruncatedText-BIzKECv9.cjs → MiddleTruncatedText-CO76xIqP.cjs} +2 -2
  220. package/dist/{MiddleTruncatedText-BIzKECv9.cjs.map → MiddleTruncatedText-CO76xIqP.cjs.map} +1 -1
  221. package/dist/{MiddleTruncatedText-Bzpg3zAU.mjs → MiddleTruncatedText-GXI-CPvs.mjs} +3 -3
  222. package/dist/{MiddleTruncatedText-Bzpg3zAU.mjs.map → MiddleTruncatedText-GXI-CPvs.mjs.map} +1 -1
  223. package/dist/Modal.d.mts +3 -3
  224. package/dist/PageHeader-CUDnarkt.cjs +77 -0
  225. package/dist/PageHeader-CUDnarkt.cjs.map +1 -0
  226. package/dist/PageHeader-D-6W61E_.mjs +64 -0
  227. package/dist/PageHeader-D-6W61E_.mjs.map +1 -0
  228. package/dist/PageHeader.d.cts +11 -2
  229. package/dist/PageHeader.d.mts +12 -3
  230. package/dist/{PageSelector-DoROR_Uh.d.cts → PageSelector-CNnVp3Al.d.cts} +3 -3
  231. package/dist/{PageSelector-CMoV-cHa.d.mts → PageSelector-vay4jpMp.d.mts} +3 -3
  232. package/dist/PageSelector.d.cts +1 -1
  233. package/dist/PageSelector.d.mts +1 -1
  234. package/dist/PageSizeSelector.d.mts +7 -1
  235. package/dist/{Pagination-D4IVVj3S.cjs → Pagination-2Yo1vRJZ.cjs} +12 -9
  236. package/dist/Pagination-2Yo1vRJZ.cjs.map +1 -0
  237. package/dist/{Pagination-B97xQ-Wk.d.cts → Pagination-D04tn-tf.d.cts} +9 -3
  238. package/dist/{Pagination-QWNK_hH7.d.mts → Pagination-ygLutOst.d.mts} +9 -3
  239. package/dist/{Pagination-Cj08JRG9.mjs → Pagination-ztqhywAP.mjs} +13 -10
  240. package/dist/Pagination-ztqhywAP.mjs.map +1 -0
  241. package/dist/Pagination.d.cts +1 -1
  242. package/dist/Pagination.d.mts +1 -1
  243. package/dist/{Pii-D-Ry7L0t.cjs → Pii-DHTb3ewO.cjs} +2 -2
  244. package/dist/{Pii-D-Ry7L0t.cjs.map → Pii-DHTb3ewO.cjs.map} +1 -1
  245. package/dist/{Pii-Bxh6_R4T.mjs → Pii-DrrtEz7U.mjs} +2 -2
  246. package/dist/{Pii-Bxh6_R4T.mjs.map → Pii-DrrtEz7U.mjs.map} +1 -1
  247. package/dist/Pii.d.mts +1 -1
  248. package/dist/PillShell.d.mts +85 -0
  249. package/dist/{Popover-D0QY5f-J.mjs → Popover-BkDpDdaO.mjs} +5 -5
  250. package/dist/{Popover-D0QY5f-J.mjs.map → Popover-BkDpDdaO.mjs.map} +1 -1
  251. package/dist/{Popover-BAv7BujW.cjs → Popover-BzgMAhsX.cjs} +4 -4
  252. package/dist/{Popover-BAv7BujW.cjs.map → Popover-BzgMAhsX.cjs.map} +1 -1
  253. package/dist/Popover.d.mts +1 -1
  254. package/dist/ProgressBar.d.mts +1 -1
  255. package/dist/ProgressIndicator.d.mts +1 -1
  256. package/dist/{PseudoClassProps-ySXCGUEQ.d.mts → PseudoClassProps-DLxPxo7T.d.mts} +1 -1
  257. package/dist/PseudoClassProps.d.mts +1 -1
  258. package/dist/{Radio-nw846eRv.cjs → Radio-BrTzy7-C.cjs} +3 -3
  259. package/dist/{Radio-nw846eRv.cjs.map → Radio-BrTzy7-C.cjs.map} +1 -1
  260. package/dist/{Radio-C9DevagH.mjs → Radio-CSX2eO-O.mjs} +3 -3
  261. package/dist/{Radio-C9DevagH.mjs.map → Radio-CSX2eO-O.mjs.map} +1 -1
  262. package/dist/{RadioGroup-B3hRbIWF.mjs → RadioGroup-CnK0opBd.mjs} +3 -3
  263. package/dist/{RadioGroup-B3hRbIWF.mjs.map → RadioGroup-CnK0opBd.mjs.map} +1 -1
  264. package/dist/{RadioGroup-DmGVJCgT.cjs → RadioGroup-CriF2InQ.cjs} +3 -3
  265. package/dist/{RadioGroup-DmGVJCgT.cjs.map → RadioGroup-CriF2InQ.cjs.map} +1 -1
  266. package/dist/{RadioGroup-D_H1B7JV.d.cts → RadioGroup-DKqbSfju.d.mts} +1 -1
  267. package/dist/{RadioGroup-nhMXEbCx.d.mts → RadioGroup-XYWjprsv.d.cts} +1 -1
  268. package/dist/RadioGroup.d.cts +1 -1
  269. package/dist/RadioGroup.d.mts +1 -1
  270. package/dist/RangeCalendar.d.mts +1 -1
  271. package/dist/RangeCalendarPresets.d.mts +1 -1
  272. package/dist/RuleEditorFields.d.mts +37 -0
  273. package/dist/RulesPill.d.mts +65 -0
  274. package/dist/{SearchInput-s6qGC2WZ.d.mts → SearchInput-Bp2yjaE1.d.mts} +3 -3
  275. package/dist/{SearchInput-CAHYPQVX.d.cts → SearchInput-CTI59-NW.d.cts} +2 -2
  276. package/dist/SearchInput.d.cts +1 -1
  277. package/dist/SearchInput.d.mts +1 -1
  278. package/dist/Section.d.mts +1 -1
  279. package/dist/{SectionHeading-CDBQ4m9E.d.mts → SectionHeading-C6hjGdK-.d.cts} +2 -2
  280. package/dist/{SectionHeading-D-L4uPoX.d.cts → SectionHeading-Q-rx2LEd.d.mts} +2 -2
  281. package/dist/SectionHeading.d.cts +1 -1
  282. package/dist/SectionHeading.d.mts +1 -1
  283. package/dist/{SegmentedControl-CIJz0oxY.cjs → SegmentedControl-C2XZF0ys.cjs} +8 -7
  284. package/dist/SegmentedControl-C2XZF0ys.cjs.map +1 -0
  285. package/dist/{SegmentedControl-B1ZLgu61.mjs → SegmentedControl-CgDQIVll.mjs} +8 -7
  286. package/dist/SegmentedControl-CgDQIVll.mjs.map +1 -0
  287. package/dist/{SegmentedControl-BYuXohIp.d.cts → SegmentedControl-DrjdUOU9.d.mts} +2 -2
  288. package/dist/{SegmentedControl-CE845gnm.d.mts → SegmentedControl-nHIK1ZvR.d.cts} +1 -1
  289. package/dist/SegmentedControl.d.cts +1 -1
  290. package/dist/SegmentedControl.d.mts +1 -1
  291. package/dist/{Select-NcaURrGZ.d.cts → Select-2KbtKawr.d.mts} +11 -5
  292. package/dist/{Select-BMEwCfbv.d.mts → Select-BH3hXMxp.d.cts} +11 -5
  293. package/dist/{Select-C65bfYeT.cjs → Select-BurtT6bN.cjs} +13 -10
  294. package/dist/Select-BurtT6bN.cjs.map +1 -0
  295. package/dist/{Select-ByTgXOlU.mjs → Select-cPEORy70.mjs} +14 -11
  296. package/dist/Select-cPEORy70.mjs.map +1 -0
  297. package/dist/Select.d.cts +1 -1
  298. package/dist/Select.d.mts +1 -1
  299. package/dist/Slider.d.mts +1 -1
  300. package/dist/SliderRHF.d.mts +1 -1
  301. package/dist/SliderThumb.d.mts +1 -1
  302. package/dist/{Spacer-GYHbk-dS.cjs → Spacer-B2CerL6e.cjs} +1 -1
  303. package/dist/{Spacer-GYHbk-dS.cjs.map → Spacer-B2CerL6e.cjs.map} +1 -1
  304. package/dist/{Spacer-Ln3KChb5.mjs → Spacer-CJp0lwkL.mjs} +1 -1
  305. package/dist/{Spacer-Ln3KChb5.mjs.map → Spacer-CJp0lwkL.mjs.map} +1 -1
  306. package/dist/{Stack-ckRN7LrP.mjs → Stack-Bl54WmhY.mjs} +1 -1
  307. package/dist/{Stack-ckRN7LrP.mjs.map → Stack-Bl54WmhY.mjs.map} +1 -1
  308. package/dist/{Stack-D979gYU9.d.cts → Stack-BzVkf3cz.d.cts} +1 -1
  309. package/dist/{Stack-UMhJ6F_3.d.mts → Stack-CkV7k7TE.d.mts} +2 -2
  310. package/dist/{Stack-BF-9YjA1.cjs → Stack-UeifHn3c.cjs} +1 -1
  311. package/dist/{Stack-BF-9YjA1.cjs.map → Stack-UeifHn3c.cjs.map} +1 -1
  312. package/dist/Stack.d.cts +1 -1
  313. package/dist/Stack.d.mts +1 -1
  314. package/dist/StatusIndicator.d.cts +31 -3
  315. package/dist/StatusIndicator.d.mts +32 -4
  316. package/dist/{Sticker-DjF9VJQB.d.mts → Sticker-Bs25ISz7.d.mts} +5 -5
  317. package/dist/{Sticker-N8XZnv7M.d.cts → Sticker-CI-XxUmM.d.cts} +3 -3
  318. package/dist/{Sticker-D0jIU2Dt.cjs → Sticker-CIoseh9f.cjs} +3 -3
  319. package/dist/{Sticker-D0jIU2Dt.cjs.map → Sticker-CIoseh9f.cjs.map} +1 -1
  320. package/dist/{Sticker-B0TbkV4o.mjs → Sticker-DbqKLe33.mjs} +3 -3
  321. package/dist/{Sticker-B0TbkV4o.mjs.map → Sticker-DbqKLe33.mjs.map} +1 -1
  322. package/dist/Sticker.d.cts +1 -1
  323. package/dist/Sticker.d.mts +1 -1
  324. package/dist/StringValueControl.d.mts +39 -0
  325. package/dist/SwatchPicker.d.mts +1 -1
  326. package/dist/Tab.d.mts +2 -2
  327. package/dist/{TabBar-BpHMYvNb.cjs → TabBar-PFaDNRw0.cjs} +4 -4
  328. package/dist/{TabBar-BpHMYvNb.cjs.map → TabBar-PFaDNRw0.cjs.map} +1 -1
  329. package/dist/{TabBar-ByusqAXF.mjs → TabBar-zSA8kyE6.mjs} +4 -4
  330. package/dist/{TabBar-ByusqAXF.mjs.map → TabBar-zSA8kyE6.mjs.map} +1 -1
  331. package/dist/TabBarIconButton.d.mts +1 -1
  332. package/dist/{Table-DJZtluW3.d.cts → Table-BNScLj9g.d.mts} +1 -1
  333. package/dist/{Table-CNs8p8hL.mjs → Table-D8IcpACv.mjs} +5 -5
  334. package/dist/{Table-CNs8p8hL.mjs.map → Table-D8IcpACv.mjs.map} +1 -1
  335. package/dist/{Table-D3nyiZt0.d.mts → Table-DXqyNohc.d.cts} +1 -1
  336. package/dist/{Table-C9rjUVpn.cjs → Table-DxLvJYWK.cjs} +5 -5
  337. package/dist/{Table-C9rjUVpn.cjs.map → Table-DxLvJYWK.cjs.map} +1 -1
  338. package/dist/Table.d.cts +1 -1
  339. package/dist/Table.d.mts +1 -1
  340. package/dist/{TableBody-BFPF07n4.d.cts → TableBody-CrDNMyT8.d.mts} +1 -1
  341. package/dist/{TableBody-DpRjZgzU.d.mts → TableBody-CxwHmdNb.d.cts} +1 -1
  342. package/dist/TableBody.d.cts +1 -1
  343. package/dist/TableBody.d.mts +1 -1
  344. package/dist/{TableBox-DO-yToJk.cjs → TableBox-CiuXCXyv.cjs} +11 -11
  345. package/dist/{TableBox-DO-yToJk.cjs.map → TableBox-CiuXCXyv.cjs.map} +1 -1
  346. package/dist/{TableBox-DIJffyts.mjs → TableBox-luasMC73.mjs} +11 -11
  347. package/dist/{TableBox-DIJffyts.mjs.map → TableBox-luasMC73.mjs.map} +1 -1
  348. package/dist/TableBox.d.cts +2 -2
  349. package/dist/TableBox.d.mts +2 -2
  350. package/dist/{TableBoxCell-D1bjYv7b.d.mts → TableBoxCell-By1xE6_Q.d.mts} +7 -7
  351. package/dist/{TableBoxCell-DOQ8PnAT.d.cts → TableBoxCell-DIMenSwX.d.cts} +6 -6
  352. package/dist/TableBoxCell.d.cts +1 -1
  353. package/dist/TableBoxCell.d.mts +1 -1
  354. package/dist/TableBoxField.d.cts +3 -3
  355. package/dist/TableBoxField.d.mts +4 -4
  356. package/dist/{TableBoxRow-CTR14HJF.d.mts → TableBoxRow-CsRPRPQ-.d.mts} +4 -4
  357. package/dist/{TableBoxRow-BUK5RjRA.d.cts → TableBoxRow-RNQ6wJLh.d.cts} +3 -3
  358. package/dist/TableBoxRow.d.cts +1 -1
  359. package/dist/TableBoxRow.d.mts +1 -1
  360. package/dist/{TableBoxRowActions-CKgUEH38.d.cts → TableBoxRowActions-CYpoPhYZ.d.cts} +2 -2
  361. package/dist/{TableBoxRowActions-BoMt5d0b.d.mts → TableBoxRowActions-DMYOI8Do.d.mts} +2 -2
  362. package/dist/TableBoxRowActions.d.cts +1 -1
  363. package/dist/TableBoxRowActions.d.mts +1 -1
  364. package/dist/TableCell.d.cts +1 -1
  365. package/dist/TableCell.d.mts +1 -1
  366. package/dist/{TableControls-BZyiqk9V.d.mts → TableControls-BehR7CKS.d.mts} +4 -4
  367. package/dist/TableControls-BtXK7Ils.cjs +3995 -0
  368. package/dist/TableControls-BtXK7Ils.cjs.map +1 -0
  369. package/dist/{TableControls-Bkd3jhC1.d.cts → TableControls-CLNF0AJG.d.cts} +3 -3
  370. package/dist/TableControls-DHMs7o58.mjs +3859 -0
  371. package/dist/TableControls-DHMs7o58.mjs.map +1 -0
  372. package/dist/TableControls.d.cts +1 -1
  373. package/dist/TableControls.d.mts +1 -1
  374. package/dist/{TableControlsContext-D6XpuRVw.d.cts → TableControlsContext-DAZx6Rrj.d.cts} +2 -2
  375. package/dist/{TableControlsContext-CleTWT7z.d.mts → TableControlsContext-D_SBFZN1.d.mts} +2 -2
  376. package/dist/TableControlsContext.d.cts +1 -1
  377. package/dist/TableControlsContext.d.mts +1 -1
  378. package/dist/{TableHead-CTsZNRJm.d.cts → TableHead-Ch4Ho3LW.d.cts} +1 -1
  379. package/dist/{TableHead-wl78HqPT.d.mts → TableHead-LxvG0e9k.d.mts} +1 -1
  380. package/dist/TableHead.d.cts +1 -1
  381. package/dist/TableHead.d.mts +1 -1
  382. package/dist/{TableHeaderCell-UoY92mzR.d.cts → TableHeaderCell-Br8ZE3Xe.d.mts} +1 -1
  383. package/dist/{TableHeaderCell-B2yiOw4w.d.mts → TableHeaderCell-Crsa2R2g.d.cts} +1 -1
  384. package/dist/TableHeaderCell.d.cts +1 -1
  385. package/dist/TableHeaderCell.d.mts +1 -1
  386. package/dist/{TableLayout-GyRS-Awa.d.cts → TableLayout-Ct0kepcA.d.cts} +1 -1
  387. package/dist/{TableLayout-_TWUnffx.d.mts → TableLayout-nwy094C_.d.mts} +1 -1
  388. package/dist/TableLayout.d.cts +1 -1
  389. package/dist/TableLayout.d.mts +1 -1
  390. package/dist/{TableRow-C-faHbkL.d.mts → TableRow-BvS4yjo6.d.mts} +2 -2
  391. package/dist/{TableRow-BVzduO4G.d.cts → TableRow-DVTPqT4w.d.cts} +1 -1
  392. package/dist/TableRow.d.cts +1 -1
  393. package/dist/TableRow.d.mts +1 -1
  394. package/dist/TableTH.d.cts +1 -1
  395. package/dist/TableTH.d.mts +1 -1
  396. package/dist/{TableViewConfigurationDropdown-D2TM2wCv.d.mts → TableViewConfigurationDropdown-BYPh4dIP.d.mts} +2 -2
  397. package/dist/{TableViewConfigurationDropdown-u3-prEHJ.d.cts → TableViewConfigurationDropdown-CaiOGyrU.d.cts} +2 -2
  398. package/dist/TableViewConfigurationDropdown.d.cts +1 -1
  399. package/dist/TableViewConfigurationDropdown.d.mts +1 -1
  400. package/dist/TechnicalSticker.d.mts +1 -1
  401. package/dist/{Text-D3FXEnG6.d.mts → Text-DNPbAuUG.d.mts} +3 -3
  402. package/dist/{Text-CzN0DOXV.cjs → Text-G9QmYf0P.cjs} +1 -1
  403. package/dist/{Text-CzN0DOXV.cjs.map → Text-G9QmYf0P.cjs.map} +1 -1
  404. package/dist/{Text-hEoPeOc9.mjs → Text-RcEfNFLx.mjs} +1 -1
  405. package/dist/{Text-hEoPeOc9.mjs.map → Text-RcEfNFLx.mjs.map} +1 -1
  406. package/dist/Text.d.mts +1 -1
  407. package/dist/{TextArea-KpDoXg-5.d.cts → TextArea-B89wtTsF.d.mts} +2 -2
  408. package/dist/{TextArea-DVHi0K7M.cjs → TextArea-BNiipQDb.cjs} +3 -3
  409. package/dist/{TextArea-DVHi0K7M.cjs.map → TextArea-BNiipQDb.cjs.map} +1 -1
  410. package/dist/{TextArea-weASn4Hq.d.mts → TextArea-CHW9FKM4.d.cts} +2 -2
  411. package/dist/{TextArea-DIPeBLkr.mjs → TextArea-NCLsW-03.mjs} +3 -3
  412. package/dist/{TextArea-DIPeBLkr.mjs.map → TextArea-NCLsW-03.mjs.map} +1 -1
  413. package/dist/TextArea.d.cts +1 -1
  414. package/dist/TextArea.d.mts +1 -1
  415. package/dist/{TextUnderlineTooltip-Cep5cgEQ.d.mts → TextUnderlineTooltip-5-0D8s4z.d.mts} +3 -3
  416. package/dist/{TextUnderlineTooltip-cSMjZOuB.d.cts → TextUnderlineTooltip-DMEyOu8C.d.cts} +2 -2
  417. package/dist/TextUnderlineTooltip.d.cts +1 -1
  418. package/dist/TextUnderlineTooltip.d.mts +1 -1
  419. package/dist/Tile.d.cts +1 -1
  420. package/dist/Tile.d.mts +2 -2
  421. package/dist/Toast.d.cts +1 -1
  422. package/dist/Toast.d.mts +1 -1
  423. package/dist/{Toggle-CfjUQlcK.mjs → Toggle-Bie9zCem.mjs} +5 -5
  424. package/dist/{Toggle-CfjUQlcK.mjs.map → Toggle-Bie9zCem.mjs.map} +1 -1
  425. package/dist/{Toggle-CTtrhzsV.cjs → Toggle-Ce-rF8Xp.cjs} +5 -5
  426. package/dist/{Toggle-CTtrhzsV.cjs.map → Toggle-Ce-rF8Xp.cjs.map} +1 -1
  427. package/dist/{Toggle-BQCOJZjZ.d.mts → Toggle-DzYLgxGk.d.mts} +1 -1
  428. package/dist/{Toggle-CYQE1Nk_.d.cts → Toggle-tbIebQWC.d.cts} +1 -1
  429. package/dist/Toggle.d.cts +1 -1
  430. package/dist/Toggle.d.mts +1 -1
  431. package/dist/{Tooltip-BhGRP9QA.d.cts → Tooltip--eDrrk2r.d.cts} +2 -2
  432. package/dist/{Tooltip-CDvOu1UN.mjs → Tooltip-C6AR1xT-.mjs} +3 -3
  433. package/dist/{Tooltip-CDvOu1UN.mjs.map → Tooltip-C6AR1xT-.mjs.map} +1 -1
  434. package/dist/{Tooltip-DRgufW3i.d.mts → Tooltip-CUC-JuRL.d.mts} +3 -3
  435. package/dist/{Tooltip-vylydKVv.cjs → Tooltip-olP3rdUO.cjs} +3 -3
  436. package/dist/{Tooltip-vylydKVv.cjs.map → Tooltip-olP3rdUO.cjs.map} +1 -1
  437. package/dist/Tooltip.d.cts +1 -1
  438. package/dist/Tooltip.d.mts +1 -1
  439. package/dist/{TruncatedText-Cy8NpHzm.d.mts → TruncatedText-BJnowVTx.d.mts} +1 -1
  440. package/dist/{TruncatedText-D8f3AiBL.d.cts → TruncatedText-Dit2NJI6.d.cts} +1 -1
  441. package/dist/components/Attribute/index.cjs +6 -6
  442. package/dist/components/Attribute/index.mjs +10 -10
  443. package/dist/components/Attribute/index.mjs.map +1 -1
  444. package/dist/components/Badge/index.cjs +1 -1
  445. package/dist/components/Badge/index.mjs +1 -1
  446. package/dist/components/Banner/index.cjs +1 -1
  447. package/dist/components/Banner/index.mjs +1 -1
  448. package/dist/components/Breadcrumbs/index.cjs +3 -271
  449. package/dist/components/Breadcrumbs/index.d.cts +2 -2
  450. package/dist/components/Breadcrumbs/index.d.mts +2 -2
  451. package/dist/components/Breadcrumbs/index.mjs +1 -267
  452. package/dist/components/Button/index.cjs +1 -1
  453. package/dist/components/Button/index.d.mts +2 -2
  454. package/dist/components/Button/index.mjs +1 -1
  455. package/dist/components/ButtonGroup/index.cjs +3 -3
  456. package/dist/components/ButtonGroup/index.mjs +3 -3
  457. package/dist/components/Card/index.cjs +1 -1
  458. package/dist/components/Card/index.d.cts +2 -2
  459. package/dist/components/Card/index.d.mts +2 -2
  460. package/dist/components/Card/index.mjs +1 -1
  461. package/dist/components/CardV2/index.cjs +3 -415
  462. package/dist/components/CardV2/index.d.cts +1 -1
  463. package/dist/components/CardV2/index.d.mts +1 -1
  464. package/dist/components/CardV2/index.mjs +1 -410
  465. package/dist/components/Checkbox/index.cjs +1 -1
  466. package/dist/components/Checkbox/index.d.cts +1 -1
  467. package/dist/components/Checkbox/index.d.mts +1 -1
  468. package/dist/components/Checkbox/index.mjs +1 -1
  469. package/dist/components/Combobox/index.cjs +1 -1
  470. package/dist/components/Combobox/index.d.cts +2 -2
  471. package/dist/components/Combobox/index.d.mts +2 -2
  472. package/dist/components/Combobox/index.mjs +1 -1
  473. package/dist/components/ConfigFormGroup/index.cjs +2 -2
  474. package/dist/components/ConfigFormGroup/index.mjs +2 -2
  475. package/dist/components/DataTable/TableControls/index.cjs +15 -1
  476. package/dist/components/DataTable/TableControls/index.d.cts +16 -6
  477. package/dist/components/DataTable/TableControls/index.d.mts +16 -6
  478. package/dist/components/DataTable/TableControls/index.mjs +2 -2
  479. package/dist/components/DataTable/index.cjs +14 -14
  480. package/dist/components/DataTable/index.mjs +24 -24
  481. package/dist/components/DataTable/index.mjs.map +1 -1
  482. package/dist/components/DataTable/types.d.cts +2 -2
  483. package/dist/components/DataTable/types.d.mts +2 -2
  484. package/dist/components/DatePicker/index.cjs +6 -929
  485. package/dist/components/DatePicker/index.mjs +1 -921
  486. package/dist/components/DropdownButton/index.cjs +1 -1
  487. package/dist/components/DropdownButton/index.mjs +1 -1
  488. package/dist/components/DropdownMenu/index.cjs +1 -1
  489. package/dist/components/DropdownMenu/index.d.cts +1 -1
  490. package/dist/components/DropdownMenu/index.d.mts +1 -1
  491. package/dist/components/DropdownMenu/index.mjs +1 -1
  492. package/dist/components/FormControl/index.cjs +2 -2
  493. package/dist/components/FormControl/index.d.cts +2 -2
  494. package/dist/components/FormControl/index.d.mts +2 -2
  495. package/dist/components/FormControl/index.mjs +2 -2
  496. package/dist/components/FormField/index.cjs +15 -486
  497. package/dist/components/FormField/index.d.cts +1 -1
  498. package/dist/components/FormField/index.d.mts +1 -1
  499. package/dist/components/FormField/index.mjs +1 -470
  500. package/dist/components/HoverCopyableField/index.cjs +1 -1
  501. package/dist/components/HoverCopyableField/index.mjs +1 -1
  502. package/dist/components/ImageTile/index.cjs +8 -8
  503. package/dist/components/ImageTile/index.mjs +8 -8
  504. package/dist/components/Input/index.cjs +1 -1
  505. package/dist/components/Input/index.d.cts +1 -1
  506. package/dist/components/Input/index.d.mts +1 -1
  507. package/dist/components/Input/index.mjs +1 -1
  508. package/dist/components/Link/index.cjs +1 -1
  509. package/dist/components/Link/index.mjs +1 -1
  510. package/dist/components/ListBox/index.cjs +1 -1
  511. package/dist/components/ListBox/index.d.cts +4 -2
  512. package/dist/components/ListBox/index.d.mts +4 -2
  513. package/dist/components/ListBox/index.mjs +1 -1
  514. package/dist/components/LoadingShimmer/index.cjs +1 -1
  515. package/dist/components/LoadingShimmer/index.mjs +1 -1
  516. package/dist/components/MaskedInput/index.cjs +2 -2
  517. package/dist/components/MaskedInput/index.mjs +2 -2
  518. package/dist/components/Menu/index.cjs +1 -1
  519. package/dist/components/Menu/index.d.cts +1 -1
  520. package/dist/components/Menu/index.d.mts +1 -1
  521. package/dist/components/Menu/index.mjs +1 -1
  522. package/dist/components/Modal/index.cjs +7 -7
  523. package/dist/components/Modal/index.mjs +7 -7
  524. package/dist/components/PageHeader/index.cjs +3 -67
  525. package/dist/components/PageHeader/index.mjs +1 -63
  526. package/dist/components/Pagination/index.cjs +1 -1
  527. package/dist/components/Pagination/index.d.cts +3 -3
  528. package/dist/components/Pagination/index.d.mts +3 -3
  529. package/dist/components/Pagination/index.mjs +1 -1
  530. package/dist/components/Pii/index.cjs +1 -1
  531. package/dist/components/Pii/index.mjs +1 -1
  532. package/dist/components/Popover/index.cjs +1 -1
  533. package/dist/components/Popover/index.mjs +1 -1
  534. package/dist/components/ProgressBar/index.cjs +1 -1
  535. package/dist/components/ProgressBar/index.mjs +1 -1
  536. package/dist/components/Radio/index.cjs +1 -1
  537. package/dist/components/Radio/index.mjs +1 -1
  538. package/dist/components/RadioGroup/index.cjs +1 -1
  539. package/dist/components/RadioGroup/index.d.cts +1 -1
  540. package/dist/components/RadioGroup/index.d.mts +1 -1
  541. package/dist/components/RadioGroup/index.mjs +1 -1
  542. package/dist/components/SegmentedControl/index.cjs +1 -1
  543. package/dist/components/SegmentedControl/index.d.cts +1 -1
  544. package/dist/components/SegmentedControl/index.d.mts +1 -1
  545. package/dist/components/SegmentedControl/index.mjs +1 -1
  546. package/dist/components/Select/index.cjs +1 -1
  547. package/dist/components/Select/index.d.cts +1 -1
  548. package/dist/components/Select/index.d.mts +1 -1
  549. package/dist/components/Select/index.mjs +1 -1
  550. package/dist/components/Slider/index.cjs +2 -2
  551. package/dist/components/Slider/index.mjs +2 -2
  552. package/dist/components/Spacer/index.cjs +1 -1
  553. package/dist/components/Spacer/index.mjs +1 -1
  554. package/dist/components/Stack/index.cjs +1 -1
  555. package/dist/components/Stack/index.d.cts +1 -1
  556. package/dist/components/Stack/index.d.mts +1 -1
  557. package/dist/components/Stack/index.mjs +1 -1
  558. package/dist/components/StatusIndicator/index.cjs +60 -10
  559. package/dist/components/StatusIndicator/index.cjs.map +1 -1
  560. package/dist/components/StatusIndicator/index.d.cts +2 -2
  561. package/dist/components/StatusIndicator/index.d.mts +2 -2
  562. package/dist/components/StatusIndicator/index.mjs +61 -12
  563. package/dist/components/StatusIndicator/index.mjs.map +1 -1
  564. package/dist/components/Sticker/index.cjs +1 -1
  565. package/dist/components/Sticker/index.d.cts +1 -1
  566. package/dist/components/Sticker/index.d.mts +1 -1
  567. package/dist/components/Sticker/index.mjs +1 -1
  568. package/dist/components/TabBar/index.cjs +1 -1
  569. package/dist/components/TabBar/index.mjs +1 -1
  570. package/dist/components/Table/index.cjs +1 -1
  571. package/dist/components/Table/index.d.cts +7 -7
  572. package/dist/components/Table/index.d.mts +7 -7
  573. package/dist/components/Table/index.mjs +1 -1
  574. package/dist/components/TableBox/index.cjs +1 -1
  575. package/dist/components/TableBox/index.d.cts +2 -2
  576. package/dist/components/TableBox/index.d.mts +2 -2
  577. package/dist/components/TableBox/index.mjs +1 -1
  578. package/dist/components/TechnicalSticker/index.cjs +4 -4
  579. package/dist/components/TechnicalSticker/index.mjs +4 -4
  580. package/dist/components/Text/index.cjs +1 -1
  581. package/dist/components/Text/index.d.mts +1 -1
  582. package/dist/components/Text/index.mjs +1 -1
  583. package/dist/components/TextArea/index.cjs +1 -1
  584. package/dist/components/TextArea/index.d.cts +1 -1
  585. package/dist/components/TextArea/index.d.mts +1 -1
  586. package/dist/components/TextArea/index.mjs +1 -1
  587. package/dist/components/Tile/index.cjs +4 -4
  588. package/dist/components/Tile/index.mjs +4 -4
  589. package/dist/components/Toast/index.cjs +1 -1
  590. package/dist/components/Toast/index.mjs +1 -1
  591. package/dist/components/Toggle/index.cjs +1 -1
  592. package/dist/components/Toggle/index.d.cts +1 -1
  593. package/dist/components/Toggle/index.d.mts +1 -1
  594. package/dist/components/Toggle/index.mjs +1 -1
  595. package/dist/components/Tooltip/index.cjs +1 -1
  596. package/dist/components/Tooltip/index.d.cts +3 -3
  597. package/dist/components/Tooltip/index.d.mts +3 -3
  598. package/dist/components/Tooltip/index.mjs +1 -1
  599. package/dist/compound-expression.d.mts +9 -0
  600. package/dist/{constants-kwVsjw8O.d.cts → constants-B6c8S033.d.cts} +1 -1
  601. package/dist/{constants-DVwPpTt5.d.mts → constants-BASogfT_.d.mts} +1 -1
  602. package/dist/constants.d.cts +1 -1
  603. package/dist/constants.d.mts +1 -1
  604. package/dist/containers.d.mts +8 -0
  605. package/dist/display.d.mts +8 -0
  606. package/dist/fieldPickerOptions.d.mts +29 -0
  607. package/dist/filter-size-context-Blw6Sd69.d.mts +52 -0
  608. package/dist/filter-size-context-CIw0Zi6r.d.cts +52 -0
  609. package/dist/filter-size-context.d.cts +2 -0
  610. package/dist/filter-size-context.d.mts +2 -0
  611. package/dist/helpers.d.cts +1 -1
  612. package/dist/helpers.d.mts +1 -1
  613. package/dist/index-4_B2yRzD.d.mts +7 -0
  614. package/dist/{index-_tQRydn9.d.cts → index-Bw8QVu_o.d.cts} +3 -3
  615. package/dist/index-C9EIpBh8.d.cts +7 -0
  616. package/dist/index-D34XP8vp.d.cts +54 -0
  617. package/dist/{index-BPnJP0jZ.d.mts → index-DDbjWdk0.d.mts} +4 -4
  618. package/dist/index-IlwGkCAe2.d.mts +54 -0
  619. package/dist/index-sQecLSpR.d.cts +1 -0
  620. package/dist/index-sViox9YW.d.mts +1 -0
  621. package/dist/index.d.cts +1 -1
  622. package/dist/index.d.mts +1 -1
  623. package/dist/index2.d.cts +1 -1
  624. package/dist/index2.d.mts +1 -1
  625. package/dist/index3.d.cts +4 -1
  626. package/dist/index3.d.mts +4 -1
  627. package/dist/index4.d.cts +11 -0
  628. package/dist/index4.d.mts +11 -0
  629. package/dist/index5.d.cts +1 -0
  630. package/dist/index5.d.mts +2 -0
  631. package/dist/index6.d.mts +1 -0
  632. package/dist/{input-DrG6mA0V.d.mts → input-Bv5fKt5J.d.mts} +3 -3
  633. package/dist/{input-BkzqXwn7.d.cts → input-DPB0cX2m.d.cts} +2 -2
  634. package/dist/inputFields.d.cts +10 -10
  635. package/dist/inputFields.d.mts +11 -11
  636. package/dist/{intersperse-Gxwgpbk8.cjs → intersperse-_0nQM5Rb.cjs} +1 -1
  637. package/dist/{intersperse-Gxwgpbk8.cjs.map → intersperse-_0nQM5Rb.cjs.map} +1 -1
  638. package/dist/{intersperse-yd3oMrQl.mjs → intersperse-vOYvFOfF.mjs} +1 -1
  639. package/dist/{intersperse-yd3oMrQl.mjs.map → intersperse-vOYvFOfF.mjs.map} +1 -1
  640. package/dist/layouts/LayoutLoadingShimmer/index.cjs +139 -0
  641. package/dist/layouts/LayoutLoadingShimmer/index.cjs.map +1 -0
  642. package/dist/layouts/LayoutLoadingShimmer/index.d.cts +2 -0
  643. package/dist/layouts/LayoutLoadingShimmer/index.d.mts +2 -0
  644. package/dist/layouts/LayoutLoadingShimmer/index.mjs +133 -0
  645. package/dist/layouts/LayoutLoadingShimmer/index.mjs.map +1 -0
  646. package/dist/lib/MiddleTruncatedText.cjs +1 -1
  647. package/dist/lib/MiddleTruncatedText.mjs +1 -1
  648. package/dist/lib/PDSProvider.d.mts +1 -1
  649. package/dist/lib/TruncatedText.cjs +1 -1
  650. package/dist/lib/TruncatedText.d.cts +1 -1
  651. package/dist/lib/TruncatedText.d.mts +1 -1
  652. package/dist/lib/TruncatedText.mjs +1 -1
  653. package/dist/lib/TruncatedTextWithTooltip.cjs +2 -2
  654. package/dist/lib/TruncatedTextWithTooltip.d.cts +1 -1
  655. package/dist/lib/TruncatedTextWithTooltip.d.mts +1 -1
  656. package/dist/lib/TruncatedTextWithTooltip.mjs +2 -2
  657. package/dist/lib/message.d.cts +1 -1
  658. package/dist/lib/message.d.mts +1 -1
  659. package/dist/lib/pseudoClass.d.mts +1 -1
  660. package/dist/{message-C2286H-r.d.cts → message-BEgtEjQC.d.cts} +1 -1
  661. package/dist/{message-BfJ87aIU.d.mts → message-CMHvlPGn.d.mts} +1 -1
  662. package/dist/mixins/focus.d.mts +1 -1
  663. package/dist/mixins/hoverable.d.mts +2 -2
  664. package/dist/mixins/input.d.cts +1 -1
  665. package/dist/mixins/input.d.mts +1 -1
  666. package/dist/mixins/menuItem.d.mts +2 -2
  667. package/dist/mixins/text.d.mts +1 -1
  668. package/dist/operators-1qE2GpC7.d.cts +43 -0
  669. package/dist/operators-Bo31xlc2.d.mts +43 -0
  670. package/dist/operators.d.cts +2 -0
  671. package/dist/operators.d.mts +2 -0
  672. package/dist/{text-CtoDqqAO.d.mts → text-B21s9mRZ.d.mts} +1 -1
  673. package/dist/{theme-Bx2sn3Lt.d.mts → theme-BzBpJXhO.d.mts} +1 -1
  674. package/dist/theme.d.mts +1 -1
  675. package/dist/types-B_HHNlia.d.cts +158 -0
  676. package/dist/types-CCvc590y.d.cts +45 -0
  677. package/dist/{types-CuCT-YnX.d.cts → types-CkiXVJeR.d.cts} +1 -1
  678. package/dist/types-D58IoRx6.d.mts +158 -0
  679. package/dist/types-D7ppqnNj.d.mts +45 -0
  680. package/dist/{types-B34lbI2k.d.mts → types-DEh_pXgS.d.mts} +1 -1
  681. package/dist/{types-C_AUGurs.d.cts → types-SYSKcZKW.d.cts} +1 -1
  682. package/dist/{types-DTak9UTv.d.mts → types-TV9nVfSe.d.mts} +1 -1
  683. package/dist/types.d.cts +1 -1
  684. package/dist/types.d.mts +1 -1
  685. package/dist/types2.d.cts +2 -2
  686. package/dist/types2.d.mts +2 -2
  687. package/dist/types3.d.cts +2 -0
  688. package/dist/types3.d.mts +2 -0
  689. package/dist/types4.d.cts +2 -0
  690. package/dist/types4.d.mts +2 -0
  691. package/dist/use-rules-popover-selection.d.mts +19 -0
  692. package/dist/useComboboxFooterAction.d.mts +47 -0
  693. package/dist/useFilterStateV2-DCQghouq.d.mts +93 -0
  694. package/dist/useFilterStateV2-DbPwX5N1.d.cts +93 -0
  695. package/dist/useFilterStateV2.d.cts +2 -0
  696. package/dist/useFilterStateV2.d.mts +2 -0
  697. package/dist/{useFormField-CaIdE7JQ.d.cts → useFormField--Q8ZdpW5.d.cts} +2 -2
  698. package/dist/{useFormField-B98dmreO.cjs → useFormField-BZlArnsI.cjs} +2 -2
  699. package/dist/{useFormField-B98dmreO.cjs.map → useFormField-BZlArnsI.cjs.map} +1 -1
  700. package/dist/{useFormField-BE0rTBF1.d.mts → useFormField-D8mLsiQc.d.mts} +2 -2
  701. package/dist/{useFormField-eftOPiXj.mjs → useFormField-DhYd6bNn.mjs} +2 -2
  702. package/dist/{useFormField-eftOPiXj.mjs.map → useFormField-DhYd6bNn.mjs.map} +1 -1
  703. package/dist/useFormField.d.cts +1 -1
  704. package/dist/useFormField.d.mts +1 -1
  705. package/dist/{useFormGroup-BE7v9eAj.cjs → useFormGroup-Bmnzgq0S.cjs} +1 -1
  706. package/dist/{useFormGroup-BE7v9eAj.cjs.map → useFormGroup-Bmnzgq0S.cjs.map} +1 -1
  707. package/dist/{useFormGroup-BMukAMAd.mjs → useFormGroup-DWVW7A9f.mjs} +1 -1
  708. package/dist/{useFormGroup-BMukAMAd.mjs.map → useFormGroup-DWVW7A9f.mjs.map} +1 -1
  709. package/dist/{useTableBoxDragAndDrop--QBq2FQh.d.cts → useTableBoxDragAndDrop-BMo-iaUF.d.mts} +1 -1
  710. package/dist/{useTableBoxDragAndDrop-BTtv9PEt.d.mts → useTableBoxDragAndDrop-DnbUToce.d.cts} +1 -1
  711. package/dist/useTableBoxDragAndDrop.d.cts +1 -1
  712. package/dist/useTableBoxDragAndDrop.d.mts +1 -1
  713. package/dist/{useToggle-3k3EkV8V.mjs → useToggle-Bo3yd14Y.mjs} +1 -1
  714. package/dist/{useToggle-3k3EkV8V.mjs.map → useToggle-Bo3yd14Y.mjs.map} +1 -1
  715. package/dist/{useToggle-CSkZWXtQ.cjs → useToggle-DARO917w.cjs} +1 -1
  716. package/dist/{useToggle-CSkZWXtQ.cjs.map → useToggle-DARO917w.cjs.map} +1 -1
  717. package/dist/useTruncation.d.mts +1 -1
  718. package/dist/{utilities-DqO6Sh94.d.cts → utilities-BO_95qFA.d.mts} +1 -1
  719. package/dist/{utilities-SMbDe8oK.d.mts → utilities-mSlaTrjB.d.cts} +1 -1
  720. package/dist/utilities.d.cts +1 -1
  721. package/dist/utilities.d.mts +1 -1
  722. package/dist/utils/storybook.cjs +1 -1
  723. package/dist/utils/storybook.mjs +1 -1
  724. package/dist/utils/testing.cjs +1 -1
  725. package/dist/utils/testing.d.mts +1 -1
  726. package/dist/utils/testing.mjs +1 -1
  727. package/dist/utils.d.mts +22 -5
  728. package/dist/utils2.d.mts +9 -0
  729. package/dist/validation-CJymv6JE.d.cts +51 -0
  730. package/dist/validation-vLh3t2dk.d.mts +51 -0
  731. package/dist/validation.d.cts +2 -0
  732. package/dist/validation.d.mts +2 -0
  733. package/dist/value-control-resolver-B9p25q3G.d.cts +46 -0
  734. package/dist/value-control-resolver-CE-bqdAl.d.mts +46 -0
  735. package/dist/value-control-resolver.d.cts +2 -0
  736. package/dist/value-control-resolver.d.mts +2 -0
  737. package/package.json +12 -3
  738. package/dist/Combobox-4Bi9-N1p.cjs.map +0 -1
  739. package/dist/Combobox-CeKMrlxy.mjs.map +0 -1
  740. package/dist/ListBox-BCscLcYL.cjs.map +0 -1
  741. package/dist/ListBox-CDNOJmvz.mjs.map +0 -1
  742. package/dist/Pagination-Cj08JRG9.mjs.map +0 -1
  743. package/dist/Pagination-D4IVVj3S.cjs.map +0 -1
  744. package/dist/SegmentedControl-B1ZLgu61.mjs.map +0 -1
  745. package/dist/SegmentedControl-CIJz0oxY.cjs.map +0 -1
  746. package/dist/Select-ByTgXOlU.mjs.map +0 -1
  747. package/dist/Select-C65bfYeT.cjs.map +0 -1
  748. package/dist/TableControls-BkdSeQvt.mjs +0 -1029
  749. package/dist/TableControls-BkdSeQvt.mjs.map +0 -1
  750. package/dist/TableControls-DcbnNqeK.cjs +0 -1080
  751. package/dist/TableControls-DcbnNqeK.cjs.map +0 -1
  752. package/dist/components/Breadcrumbs/index.cjs.map +0 -1
  753. package/dist/components/Breadcrumbs/index.mjs.map +0 -1
  754. package/dist/components/CardV2/index.cjs.map +0 -1
  755. package/dist/components/CardV2/index.mjs.map +0 -1
  756. package/dist/components/DatePicker/index.cjs.map +0 -1
  757. package/dist/components/DatePicker/index.mjs.map +0 -1
  758. package/dist/components/FormField/index.cjs.map +0 -1
  759. package/dist/components/FormField/index.mjs.map +0 -1
  760. package/dist/components/PageHeader/index.cjs.map +0 -1
  761. package/dist/components/PageHeader/index.mjs.map +0 -1
  762. /package/dist/{index-8SLBz2NH.d.mts → index--p6oQT9I.d.mts} +0 -0
  763. /package/dist/{index-B2KLYYkM.d.cts → index-BIAn8oQh.d.cts} +0 -0
  764. /package/dist/{index-B5cbLMbC2.d.cts → index-BL32-cvv.d.cts} +0 -0
  765. /package/dist/{index-BCsiC0tv.d.cts → index-BXpMZvwA.d.cts} +0 -0
  766. /package/dist/{index-BPiqSRRl.d.mts → index-BYd3Btr1.d.mts} +0 -0
  767. /package/dist/{index-BSVhZrWN.d.mts → index-BhY1qu3m.d.cts} +0 -0
  768. /package/dist/{index-BTImeehL2.d.mts → index-BlwcRiXv.d.cts} +0 -0
  769. /package/dist/{index-C3kE54DD.d.mts → index-C1ihAKnV.d.cts} +0 -0
  770. /package/dist/{index-C6yvNuzO.d.cts → index-CDAfh8Ew.d.cts} +0 -0
  771. /package/dist/{index-C8k_zgEm.d.cts → index-CDGG7lCB.d.mts} +0 -0
  772. /package/dist/{index-CEqOS-7M.d.mts → index-CFG0_wK4.d.cts} +0 -0
  773. /package/dist/{index-CROz1VSV.d.mts → index-CKKoxA9V.d.mts} +0 -0
  774. /package/dist/{index-CWt1yJ75.d.cts → index-CMuRFTR3.d.mts} +0 -0
  775. /package/dist/{index-CmCelmEL.d.cts → index-CNxS4Tlu.d.mts} +0 -0
  776. /package/dist/{index-CmUzJ4E-2.d.cts → index-CQ25UCod.d.cts} +0 -0
  777. /package/dist/{index-CsuikFeJ.d.mts → index-CWB6exYm.d.mts} +0 -0
  778. /package/dist/{index-CtCMUyZA.d.cts → index-Cv0jeUQf2.d.cts} +0 -0
  779. /package/dist/{index-Cz6N-KeS.d.cts → index-CwSIy_W-.d.cts} +0 -0
  780. /package/dist/{index-D2HUTZ-d.d.cts → index-CzItj62a.d.mts} +0 -0
  781. /package/dist/{index-D8dPsry7.d.mts → index-D4DUvwPf.d.mts} +0 -0
  782. /package/dist/{index-DeEmP3Jc.d.cts → index-D6CnpA_r.d.cts} +0 -0
  783. /package/dist/{index-DeVKzGce.d.mts → index-D9IqtUDs.d.cts} +0 -0
  784. /package/dist/{index-DrZ2Dh-H.d.cts → index-DFKoAoY2.d.cts} +0 -0
  785. /package/dist/{index-DxSM7VXJ.d.cts → index-DGsJdI5l.d.mts} +0 -0
  786. /package/dist/{index-FtE8MXJ_.d.mts → index-DM6vVDZD.d.mts} +0 -0
  787. /package/dist/{index-JuxZj_Qp2.d.mts → index-DWfPppPU.d.mts} +0 -0
  788. /package/dist/{index-LhFpnU-f.d.mts → index-DXJd7-2Z.d.mts} +0 -0
  789. /package/dist/{index-N-OgGgfF.d.mts → index-DkrC-i1D.d.mts} +0 -0
  790. /package/dist/{index-NKYLt_R9.d.mts → index-DpEKQcoR.d.cts} +0 -0
  791. /package/dist/{index-VWno75SQ.d.mts → index-DvuJXuAN.d.mts} +0 -0
  792. /package/dist/{index-c55Utzva.d.mts → index-Iujpc9_6.d.mts} +0 -0
  793. /package/dist/{index-gpCH5158.d.mts → index-PWQavSPf.d.mts} +0 -0
  794. /package/dist/{index-lQ_hGQ08.d.cts → index-dC-i2r_u.d.cts} +0 -0
  795. /package/dist/{index-luywJTzJ.d.mts → index-e6k85DKM.d.mts} +0 -0
  796. /package/dist/{index-zO0Ly4bS.d.cts → index-lIMqGGJz.d.mts} +0 -0
@@ -0,0 +1,3995 @@
1
+ const require_chunk = require("./chunk-CKQMccvm.cjs");
2
+ const require_lib_pseudoClass = require("./lib/pseudoClass.cjs");
3
+ const require_mixins_focus = require("./mixins/focus.cjs");
4
+ require("./variables/transitions.cjs");
5
+ const require_mixins_text = require("./mixins/text.cjs");
6
+ const require_Stack = require("./Stack-UeifHn3c.cjs");
7
+ const require_lib_TruncatedText = require("./lib/TruncatedText.cjs");
8
+ const require_Card = require("./Card-Csz-PxX0.cjs");
9
+ const require_Spacer = require("./Spacer-B2CerL6e.cjs");
10
+ const require_Text = require("./Text-G9QmYf0P.cjs");
11
+ const require_Tooltip = require("./Tooltip-olP3rdUO.cjs");
12
+ const require_lib_useScrollOverflow = require("./lib/useScrollOverflow.cjs");
13
+ const require_lib_zindex = require("./lib/zindex.cjs");
14
+ const require_IconButton = require("./IconButton-nlgjJQCS.cjs");
15
+ const require_Menu = require("./Menu-t2q8NrV0.cjs");
16
+ const require_DropdownMenu = require("./DropdownMenu-DnlQqTjs.cjs");
17
+ const require_Input = require("./Input-OJPQ07TW.cjs");
18
+ const require_components_Input_index = require("./components/Input/index.cjs");
19
+ const require_Combobox = require("./Combobox-COXvmxlM.cjs");
20
+ const require_Popover = require("./Popover-BzgMAhsX.cjs");
21
+ const require_TabBar = require("./TabBar-PFaDNRw0.cjs");
22
+ const require_Toggle = require("./Toggle-Ce-rF8Xp.cjs");
23
+ const require_ListBox = require("./ListBox-BP1eaG7L.cjs");
24
+ const require_FormField = require("./FormField-D3XhxTMg.cjs");
25
+ const require_DatePicker = require("./DatePicker-BlCgFb7g.cjs");
26
+ let _persona_design_tokens = require("@persona/design-tokens");
27
+ let styled_components = require("styled-components");
28
+ let styled_components$1 = require_chunk.__toESM(styled_components, 1);
29
+ styled_components = require_chunk.__toESM(styled_components);
30
+ let react_jsx_runtime = require("react/jsx-runtime");
31
+ let react = require("react");
32
+ let _persona_icons = require("@persona/icons");
33
+ let _persona_icons_12px = require("@persona/icons/12px");
34
+ let lodash_fp_js = require("lodash/fp.js");
35
+ let react_aria = require("react-aria");
36
+ let _persona_icons_24px = require("@persona/icons/24px");
37
+ let lodash = require("lodash");
38
+ let fuse_js = require("fuse.js");
39
+ fuse_js = require_chunk.__toESM(fuse_js);
40
+ let _radix_ui_react_popover = require("@radix-ui/react-popover");
41
+ _radix_ui_react_popover = require_chunk.__toESM(_radix_ui_react_popover, 1);
42
+ let _hello_pangea_dnd = require("@hello-pangea/dnd");
43
+ let _internationalized_date = require("@internationalized/date");
44
+ let uuid = require("uuid");
45
+ //#region components/DataTable/FormControlLabel/FormControlLabel.ts
46
+ const FormControlLabel = (0, styled_components$1.default)(require_Text.Label).attrs(() => ({
47
+ size: "md",
48
+ weight: "bold"
49
+ }))`
50
+ margin-bottom: ${_persona_design_tokens.Spacing[2]};
51
+ transition: ${"200ms"};
52
+ display: inline-block;
53
+
54
+ ${({ theme, isDisabled }) => styled_components$1.css`
55
+ color: ${isDisabled ? theme.color.text.disabled : theme.color.text.primary};
56
+ `}
57
+ `;
58
+ //#endregion
59
+ //#region components/DataTable/SearchInput/SearchInput.tsx
60
+ const SearchBar = styled_components.default.div``;
61
+ const StyledInput = (0, styled_components.default)(require_components_Input_index.default)`
62
+ ${({ theme, flattenDisplay }) => flattenDisplay && styled_components.css`
63
+ border-width: 0px;
64
+
65
+ &${require_lib_pseudoClass.isActive}, &${require_lib_pseudoClass.isFocused}, &${require_lib_pseudoClass.isHovered}&${require_lib_pseudoClass.isNotDisabled}, &${require_lib_pseudoClass.isHovered}&${require_lib_pseudoClass.isFocused} {
66
+ border-color: ${theme.color.border.input};
67
+ box-shadow: none;
68
+ }
69
+ `}
70
+ `;
71
+ const SearchInput = ({ className, title = "Search", handleInput, handleOnFocus = lodash.noop, onBlur = lodash.noop, id, value, placeholder, dataTest, autoFocus, useClearIcon = false, disabled = false, disabledTooltip, size = "md", leftIcon = size === "sm" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons_12px.SearchIcon, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.SearchIcon, {}), flattenDisplay = false, maxLength }) => {
72
+ const [innerValue, setInnerValue] = (0, react.useState)(value);
73
+ const handleChange = (0, react.useCallback)(({ target }) => {
74
+ setInnerValue(target.value);
75
+ handleInput(target.value);
76
+ }, [handleInput, setInnerValue]);
77
+ (0, react.useEffect)(() => {
78
+ setInnerValue(value);
79
+ }, [value]);
80
+ const inputRef = (0, react.useRef)(null);
81
+ const handleClear = (0, react.useCallback)(() => {
82
+ setInnerValue("");
83
+ handleInput("");
84
+ handleOnFocus();
85
+ inputRef.current?.focus();
86
+ }, [
87
+ handleInput,
88
+ handleOnFocus,
89
+ inputRef,
90
+ setInnerValue
91
+ ]);
92
+ const searchBar = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SearchBar, {
93
+ className,
94
+ "data-test": dataTest,
95
+ children: [title != null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FormControlLabel, {
96
+ htmlFor: id,
97
+ children: title
98
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Input.InputGroup, {
99
+ leftIcon,
100
+ onClear: useClearIcon && !!innerValue ? (e) => {
101
+ e.preventDefault();
102
+ e.stopPropagation();
103
+ handleClear();
104
+ } : void 0,
105
+ size,
106
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledInput, {
107
+ id,
108
+ onChange: handleChange,
109
+ placeholder,
110
+ value: innerValue,
111
+ autoFocus,
112
+ ref: inputRef,
113
+ onFocus: handleOnFocus,
114
+ onBlur,
115
+ disabled,
116
+ maxLength,
117
+ flattenDisplay
118
+ })
119
+ })]
120
+ });
121
+ return disabled && disabledTooltip ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Tooltip.Tooltip, {
122
+ trigger: searchBar,
123
+ side: "top",
124
+ children: disabledTooltip
125
+ }) : searchBar;
126
+ };
127
+ //#endregion
128
+ //#region components/DataTable/TableControls/CompactBar.tsx
129
+ const DataTableCompactBar = (0, styled_components.default)(require_Stack.HStack)`
130
+ border-bottom: 1px solid ${({ theme }) => theme.color.border.secondary};
131
+ padding-bottom: ${_persona_design_tokens.Spacing[1]};
132
+ `;
133
+ const CompactSearchInput = (0, styled_components.default)(SearchInput)`
134
+ width: ${({ $autoExpand }) => $autoExpand ? "100%" : "240px"};
135
+ margin-right: ${_persona_design_tokens.Spacing[1]};
136
+ `;
137
+ /**
138
+ * Compact variant of the ControlBar.
139
+ * Not intended to be used by itself.
140
+ *
141
+ * Tested using the ControlBar specs.
142
+ *
143
+ * @see ControlBar.tsx
144
+ * @see ControlBar.spec.tsx
145
+ */
146
+ const CompactBar = ({ title, searchProps, showFilters, setShowFilters, filtersId, isLoading, propertiesButton, tableActions, "data-tour-target": dataTourTarget, filterPanel }) => {
147
+ const autoExpandSearch = !title;
148
+ const [showSearch, setShowSearch] = (0, react.useState)(autoExpandSearch);
149
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DataTableCompactBar, {
150
+ "data-tour-target": dataTourTarget,
151
+ justify: "space-between",
152
+ align: "center",
153
+ children: [title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Paragraph, {
154
+ size: "md",
155
+ weight: "bold",
156
+ color: "primary",
157
+ children: title
158
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.HStack, {
159
+ spacing: _persona_design_tokens.Spacing[1],
160
+ align: "center",
161
+ justify: "right",
162
+ style: autoExpandSearch ? { width: "100%" } : { marginLeft: "auto" },
163
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.HStack, {
164
+ spacing: _persona_design_tokens.Spacing[1],
165
+ align: "center",
166
+ style: { width: "100%" },
167
+ children: [
168
+ searchProps && (showSearch ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CompactSearchInput, {
169
+ title: null,
170
+ size: "sm",
171
+ $autoExpand: autoExpandSearch,
172
+ autoFocus: !autoExpandSearch,
173
+ onBlur: autoExpandSearch ? void 0 : () => {
174
+ if (!searchProps.value) setShowSearch(false);
175
+ },
176
+ useClearIcon: true,
177
+ ...searchProps
178
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconButton.Button, {
179
+ id: "table-controls__compact-search-toggle",
180
+ variant: "text",
181
+ width: "icon",
182
+ size: "sm",
183
+ "aria-label": "Show search bar",
184
+ onClick: () => setShowSearch(true),
185
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.SearchIcon, {})
186
+ })),
187
+ setShowFilters && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconButton.Button, {
188
+ id: "table-controls__view-tab-filters",
189
+ variant: "text",
190
+ onClick: () => setShowFilters?.(!showFilters),
191
+ "aria-label": showFilters ? "Hide filters" : "Show filters",
192
+ "aria-expanded": showFilters,
193
+ "aria-controls": filtersId,
194
+ disabled: isLoading,
195
+ active: showFilters,
196
+ width: "icon",
197
+ size: "sm",
198
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.FilterIcon, {})
199
+ }),
200
+ propertiesButton
201
+ ]
202
+ }), tableActions && Array.isArray(tableActions) ? tableActions.map((action) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconButton.Button, {
203
+ id: `table-controls__compact-action-${action.label.toLowerCase().replace(/\s+/g, "-")}`,
204
+ variant: "basic",
205
+ size: "sm",
206
+ width: "auto",
207
+ onClick: action.onClick,
208
+ children: action.label
209
+ }, action.label)) : tableActions]
210
+ })]
211
+ }), showFilters && filterPanel] });
212
+ };
213
+ //#endregion
214
+ //#region components/DataTable/TableControls/utils/positioning.ts
215
+ /**
216
+ * Check if a child rect is contained within a parent rect.
217
+ * @param parent - The parent rect.
218
+ * @param child - The child rect.
219
+ * @returns True if the child rect is contained within the parent rect, false otherwise.
220
+ */
221
+ const rectContainsRect = (parent, child) => {
222
+ return child.top >= parent.top && child.bottom <= parent.bottom && child.left >= parent.left && child.right <= parent.right;
223
+ };
224
+ //#endregion
225
+ //#region components/DataTable/TableControls/ControlBar.tsx
226
+ const TAB_ID_PREFIX = "table-controls__view-tab_";
227
+ const OVERFLOW_TAB_ID_PREFIX = "table-controls__view-tab-overflow_";
228
+ function enterProxiesClick(e) {
229
+ if (e.key === "Enter") e.target.dispatchEvent(new Event("click", { bubbles: true }));
230
+ }
231
+ const AddViewButton = (0, styled_components.default)(require_IconButton.IconButton)`
232
+ color: ${({ theme }) => theme.color.text.secondary};
233
+ `;
234
+ const LockedTab = (0, styled_components.default)(require_TabBar.Tab)`
235
+ svg {
236
+ height: 12px;
237
+ width: 12px;
238
+ }
239
+ `;
240
+ const OverflowMenuList = (0, styled_components.default)(require_Menu.MenuList)`
241
+ max-height: 300px;
242
+ overflow: auto;
243
+ `;
244
+ const ExpandedSearchInput = (0, styled_components.default)(SearchInput)`
245
+ flex-basis: 440px;
246
+ flex-grow: 1;
247
+ `;
248
+ const ViewsBar = (0, styled_components.default)(require_TabBar.TabBar)`
249
+ ${AddViewButton} {
250
+ /* Shows button when view is in progress of being added */
251
+ opacity: ${({ $isAddingView }) => $isAddingView ? 1 : 0};
252
+ }
253
+
254
+ &:hover,
255
+ &:hover:focus,
256
+ &:focus-within {
257
+ ${AddViewButton} {
258
+ opacity: 1;
259
+ }
260
+ }
261
+ `;
262
+ const TabOverflowContainer = styled_components.default.div`
263
+ display: flex;
264
+ align-items: center;
265
+ gap: ${_persona_design_tokens.Spacing[2]};
266
+ position: absolute;
267
+ height: 32px;
268
+ `;
269
+ const SavedViewTab = ({ view, selected, tabIdPrefix = TAB_ID_PREFIX, canEditViews, handleNameChange, onDuplicateView, onDeleteView, onSelectView, onResetCurrentView, onSaveView, isViewDirty, showTabContextMenu, setShowTabContextMenu, className, ...rest }) => {
270
+ const inputRef = (0, react.useRef)(null);
271
+ const tab = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TabBar.StyledTab, {
272
+ id: `${tabIdPrefix}${view.id}`,
273
+ selected,
274
+ "aria-selected": selected,
275
+ role: "tab",
276
+ onClick: !selected ? () => onSelectView?.(view.id) : void 0,
277
+ suffixIcon: selected && canEditViews ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.MoreIcon, {}) : void 0,
278
+ className,
279
+ ...rest,
280
+ children: view.name
281
+ });
282
+ if (canEditViews && selected) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Popover.Popover_default, {
283
+ trigger: tab,
284
+ open: showTabContextMenu,
285
+ onOpenChange: (open) => {
286
+ if (selected) setShowTabContextMenu(open);
287
+ if (!open && inputRef.current) handleNameChange?.(view, inputRef.current.value);
288
+ },
289
+ contentProps: {
290
+ align: "start",
291
+ padding: _persona_design_tokens.Spacing[2]
292
+ },
293
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.Stack, {
294
+ spacing: _persona_design_tokens.Spacing[3],
295
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Input_index.default, {
296
+ defaultValue: view.name,
297
+ onBlur: (e) => handleNameChange?.(view, e.currentTarget.value),
298
+ onKeyDown: (e) => {
299
+ if (e.key === "Enter") handleNameChange?.(view, e.currentTarget.value);
300
+ },
301
+ disabled: !handleNameChange,
302
+ ref: inputRef
303
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Menu.MenuList, {
304
+ padding: _persona_design_tokens.Spacing[0],
305
+ children: [
306
+ onDuplicateView && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Menu.MenuItem, {
307
+ id: "table-controls__view__menu-duplicate",
308
+ prefixIcon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.CopyIcon, {}),
309
+ onClick: async () => {
310
+ const newTableView = await onDuplicateView(view.id);
311
+ if (newTableView) {
312
+ const { id } = newTableView;
313
+ if (view.id !== id) {
314
+ onSelectView?.(id);
315
+ setShowTabContextMenu(true);
316
+ }
317
+ }
318
+ },
319
+ onKeyDown: enterProxiesClick,
320
+ children: "Duplicate"
321
+ }),
322
+ canEditViews && onResetCurrentView && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Menu.MenuItem, {
323
+ id: "table-controls__view__menu-reset",
324
+ prefixIcon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.RotateCcwIcon, {}),
325
+ onClick: onResetCurrentView,
326
+ onKeyDown: enterProxiesClick,
327
+ children: "Reset"
328
+ }),
329
+ canEditViews && onSaveView && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Menu.MenuItem, {
330
+ id: "table-controls__view__menu-save",
331
+ prefixIcon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.SaveIcon, {}),
332
+ disabled: !isViewDirty,
333
+ onClick: () => {
334
+ onSaveView();
335
+ setShowTabContextMenu(false);
336
+ },
337
+ onKeyDown: enterProxiesClick,
338
+ children: "Save"
339
+ }),
340
+ onDeleteView && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Menu.MenuItem, {
341
+ id: "table-controls__view__menu-delete",
342
+ prefixIcon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.TrashIcon, {}),
343
+ onClick: async () => {
344
+ await onDeleteView(view.id);
345
+ setShowTabContextMenu(false);
346
+ },
347
+ onKeyDown: enterProxiesClick,
348
+ children: "Delete"
349
+ })
350
+ ]
351
+ })]
352
+ })
353
+ });
354
+ return tab;
355
+ };
356
+ /**
357
+ * A tab that is locked and does not support editing or actions.
358
+ */
359
+ const LockedViewTab = ({ id, selected, onClick, children, ...props }) => {
360
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LockedTab, {
361
+ id,
362
+ selected,
363
+ onClick: selected ? void 0 : onClick,
364
+ suffixIcon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons_12px.LockedIcon, {}),
365
+ ...props,
366
+ children
367
+ });
368
+ };
369
+ const OverflowSavedViewTab = (0, styled_components.default)(SavedViewTab)`
370
+ margin-left: ${_persona_design_tokens.Spacing[2]};
371
+ `;
372
+ const TabOverflow = (0, react.forwardRef)(function TabOverflow({ hiddenViews, currentView: currentViewId, handleAddView, onSelectView, canEditViews, lastVisibleViewElement, ...rest }, ref) {
373
+ const [filter, setFilter] = (0, react.useState)("");
374
+ const [openPopover, setOpenPopover] = (0, react.useState)(false);
375
+ const currentView = (0, react.useMemo)(() => {
376
+ return hiddenViews.find((view) => view.id === currentViewId);
377
+ }, [currentViewId, hiddenViews]);
378
+ const filteredViews = (0, react.useMemo)(() => hiddenViews.filter((view) => view.name.toLowerCase().includes(filter.toLowerCase()) && view.id !== currentView?.id), [
379
+ hiddenViews,
380
+ filter,
381
+ currentView
382
+ ]);
383
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TabOverflowContainer, {
384
+ ref,
385
+ style: (0, react.useMemo)(() => {
386
+ if (!lastVisibleViewElement) return;
387
+ return { left: lastVisibleViewElement.offsetLeft + lastVisibleViewElement.offsetWidth + 8 };
388
+ }, [lastVisibleViewElement]),
389
+ children: [
390
+ currentView && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OverflowSavedViewTab, {
391
+ view: currentView,
392
+ canEditViews,
393
+ selected: true,
394
+ tabIdPrefix: OVERFLOW_TAB_ID_PREFIX,
395
+ ...rest
396
+ }),
397
+ hiddenViews.length === 1 && currentView && hiddenViews[0].id !== currentView.id ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Popover.Popover_default, {
398
+ trigger: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_IconButton.Button, {
399
+ variant: "basic",
400
+ size: "sm",
401
+ width: "auto",
402
+ children: [currentView ? hiddenViews.length - 1 : hiddenViews.length, " more…"]
403
+ }),
404
+ contentProps: {
405
+ align: "start",
406
+ padding: _persona_design_tokens.Spacing[2]
407
+ },
408
+ open: openPopover,
409
+ onOpenChange: (open) => {
410
+ if (!open) setFilter("");
411
+ setOpenPopover(open);
412
+ },
413
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Input_index.default, {
414
+ value: filter,
415
+ onChange: (e) => setFilter(e.target.value),
416
+ placeholder: "Search for a view..."
417
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OverflowMenuList, {
418
+ padding: _persona_design_tokens.Spacing[0],
419
+ children: filteredViews.map((view) => {
420
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Menu.MenuItem, {
421
+ id: `${OVERFLOW_TAB_ID_PREFIX}${view.id}`,
422
+ onClick: () => {
423
+ onSelectView?.(view.id);
424
+ setOpenPopover(false);
425
+ },
426
+ onKeyDown: enterProxiesClick,
427
+ children: view.name
428
+ }, view.id);
429
+ })
430
+ })]
431
+ }),
432
+ canEditViews && handleAddView && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AddViewButton, {
433
+ id: `${OVERFLOW_TAB_ID_PREFIX}overflow-new`,
434
+ onClick: handleAddView,
435
+ size: "md",
436
+ "aria-label": "Add new view",
437
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.CirclePlusIcon, {})
438
+ })
439
+ ]
440
+ });
441
+ });
442
+ /**
443
+ * Force the add button to be visible when the product tour is active
444
+ */
445
+ const ProductTourStyles = styled_components.createGlobalStyle`
446
+ body:has(#react-joyride-portal) {
447
+ [data-tour-target='saved-views-add-button'] {
448
+ opacity: 1;
449
+ }
450
+ }
451
+ `;
452
+ const ControlBar = ({ presetViews, currentView, onSelectView, views, onAddView, onDuplicateView, onDeleteView, onViewNameChange, onSaveView, isViewDirty, canEditViews, showFilters, setShowFilters, searchProps, filtersId, propertiesButton, tableActions, isLoading, showViews, selectedRows = [], bulkActions, onResetCurrentView, onClearSelection, title, "data-tour-target": dataTourTarget, compact, onError, filterPanel }) => {
453
+ const tabListRef = (0, react.useRef)(null);
454
+ const tabOverflowRef = (0, react.useRef)(null);
455
+ const [hiddenViews, setHiddenViews] = (0, react.useState)([]);
456
+ const [showTabContextMenu, setShowTabContextMenu] = (0, react.useState)(false);
457
+ const [isAddingView, setIsAddingView] = (0, react.useState)(false);
458
+ const [lastVisibleViewElement, setLastVisibleViewElement] = (0, react.useState)(null);
459
+ const [tabOverflowWidth, setTabOverflowWidth] = (0, react.useState)(null);
460
+ const onResize = (0, react.useCallback)(() => {
461
+ if (!tabListRef.current) return;
462
+ const containerRect = tabListRef.current.getBoundingClientRect();
463
+ const tabListContainer = tabListRef.current;
464
+ const tabElements = Array.from(tabListContainer.querySelectorAll("[data-tab-view]"));
465
+ if (tabElements.length === 0 || rectContainsRect(containerRect, tabElements[tabElements.length - 1].getBoundingClientRect())) {
466
+ setHiddenViews([]);
467
+ return;
468
+ }
469
+ const firstHiddenIndex = tabElements.findIndex((el) => !rectContainsRect(containerRect, el.getBoundingClientRect()));
470
+ if (firstHiddenIndex === -1) setLastVisibleViewElement(null);
471
+ else {
472
+ const lastVisibleViewElement = tabElements[firstHiddenIndex - 1];
473
+ if (lastVisibleViewElement) setLastVisibleViewElement(lastVisibleViewElement);
474
+ }
475
+ setHiddenViews((firstHiddenIndex === -1 ? [] : views?.slice(firstHiddenIndex)) || []);
476
+ const tabOverflowWidth = tabOverflowRef.current?.getBoundingClientRect().width;
477
+ if (tabOverflowWidth) setTabOverflowWidth(tabOverflowWidth);
478
+ }, [setHiddenViews, views]);
479
+ (0, react.useLayoutEffect)(() => {
480
+ if (!showViews || !tabListRef.current) return;
481
+ const resizeObserver = new ResizeObserver(() => {
482
+ onResize();
483
+ });
484
+ resizeObserver.observe(tabListRef.current);
485
+ return () => {
486
+ resizeObserver.disconnect();
487
+ };
488
+ }, [onResize, showViews]);
489
+ (0, react.useLayoutEffect)(() => {
490
+ if (showViews) onResize();
491
+ }, [
492
+ onResize,
493
+ showViews,
494
+ views
495
+ ]);
496
+ const currentViewHidden = (0, react.useMemo)(() => {
497
+ if (currentView) return !!hiddenViews.find((view) => view.id === currentView);
498
+ return false;
499
+ }, [currentView, hiddenViews]);
500
+ const handleAddView = async () => {
501
+ try {
502
+ setIsAddingView(true);
503
+ if (onAddView) {
504
+ const view = await onAddView();
505
+ if (!view || !view.id) return;
506
+ if (currentView !== view.id) onSelectView?.(view.id);
507
+ setShowTabContextMenu(true);
508
+ }
509
+ } catch {
510
+ onError?.(/* @__PURE__ */ new Error("Error adding view"));
511
+ } finally {
512
+ setIsAddingView(false);
513
+ }
514
+ };
515
+ const handleNameChange = (view, newName) => {
516
+ if (canEditViews && view.name !== newName) onViewNameChange?.(view.id, newName);
517
+ };
518
+ if (compact) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CompactBar, {
519
+ "data-tour-target": dataTourTarget,
520
+ title,
521
+ searchProps,
522
+ showFilters,
523
+ setShowFilters,
524
+ filtersId,
525
+ isLoading,
526
+ propertiesButton,
527
+ tableActions,
528
+ filterPanel
529
+ });
530
+ const bulkActionButtons = bulkActions?.map((action, index) => {
531
+ const key = "label" in action ? action.label : `action-${index}`;
532
+ const isDisabled = selectedRows.length === 0 || action.disabled === true;
533
+ const selectedCount = selectedRows.length;
534
+ const clearSelection = () => {
535
+ onClearSelection?.();
536
+ };
537
+ if ("icon" in action && "aria-label" in action) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconButton.IconButton, {
538
+ size: "sm",
539
+ "aria-label": action["aria-label"],
540
+ onClick: async () => {
541
+ await action.onClick(selectedRows, clearSelection);
542
+ },
543
+ disabled: isDisabled,
544
+ children: action.icon
545
+ }, key);
546
+ const displayLabel = "label" in action && selectedCount > 0 ? `${action.label} (${selectedCount})` : "label" in action ? action.label : "";
547
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconButton.Button, {
548
+ id: `table-controls__view-tab-bulk-action-${index}`,
549
+ variant: "basic",
550
+ size: "sm",
551
+ width: "auto",
552
+ onClick: async () => {
553
+ await action.onClick(selectedRows, clearSelection);
554
+ },
555
+ disabled: isDisabled,
556
+ children: displayLabel
557
+ }, key);
558
+ });
559
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
560
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProductTourStyles, {}),
561
+ (title || showViews || canEditViews && onSaveView || tableActions || bulkActions) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ViewsBar, {
562
+ ref: tabListRef,
563
+ title,
564
+ maxTabChars: 25,
565
+ $isAddingView: isAddingView,
566
+ "data-tour-target": dataTourTarget,
567
+ actions: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.HStack, {
568
+ spacing: _persona_design_tokens.Spacing[3],
569
+ align: "center",
570
+ style: tabOverflowWidth ? { paddingLeft: `${tabOverflowWidth + 16}px` } : void 0,
571
+ children: [
572
+ canEditViews && onSaveView && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconButton.Button, {
573
+ id: "table-controls__view-tab-save",
574
+ onClick: onSaveView,
575
+ "aria-label": "Save current view",
576
+ disabled: !isViewDirty || isLoading,
577
+ size: "sm",
578
+ variant: "basic",
579
+ width: "auto",
580
+ "data-tour-target": "saved-views-save-button",
581
+ children: "Save view"
582
+ }),
583
+ bulkActionButtons,
584
+ tableActions
585
+ ]
586
+ }),
587
+ children: showViews && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
588
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LockedViewTab, {
589
+ id: `${TAB_ID_PREFIX}default`,
590
+ selected: !currentView,
591
+ onClick: () => onSelectView?.(null),
592
+ "data-tour-target": "saved-views-default-view",
593
+ children: "Default view"
594
+ }),
595
+ presetViews?.map((view) => {
596
+ const selected = view.id === currentView;
597
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LockedViewTab, {
598
+ id: `${TAB_ID_PREFIX}preset-${view.id}`,
599
+ selected,
600
+ onClick: () => onSelectView?.(view.id),
601
+ children: view.name
602
+ }, view.id);
603
+ }),
604
+ views?.map((view) => {
605
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SavedViewTab, {
606
+ view,
607
+ canEditViews: canEditViews ?? false,
608
+ handleNameChange,
609
+ onDuplicateView,
610
+ onDeleteView,
611
+ onSelectView,
612
+ onResetCurrentView,
613
+ onSaveView,
614
+ isViewDirty: isViewDirty ?? false,
615
+ selected: view.id === currentView,
616
+ showTabContextMenu: showTabContextMenu && !currentViewHidden,
617
+ setShowTabContextMenu,
618
+ "data-tab-view": true
619
+ }, view.id);
620
+ }),
621
+ canEditViews && onAddView && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AddViewButton, {
622
+ id: "table-controls__view-tab-new",
623
+ size: "md",
624
+ onClick: handleAddView,
625
+ "aria-label": "Add new view",
626
+ "data-tour-target": "saved-views-add-button",
627
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.CirclePlusIcon, {})
628
+ }),
629
+ hiddenViews.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TabOverflow, {
630
+ ref: tabOverflowRef,
631
+ hiddenViews,
632
+ currentView,
633
+ onSelectView,
634
+ canEditViews: canEditViews ?? false,
635
+ handleAddView: onAddView ? handleAddView : null,
636
+ handleNameChange,
637
+ onDuplicateView,
638
+ onDeleteView,
639
+ onResetCurrentView,
640
+ onSaveView,
641
+ isViewDirty: isViewDirty ?? false,
642
+ showTabContextMenu: showTabContextMenu && currentViewHidden,
643
+ setShowTabContextMenu,
644
+ lastVisibleViewElement
645
+ })
646
+ ] })
647
+ }),
648
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Stack.HStack, {
649
+ align: "center",
650
+ spacing: _persona_design_tokens.Spacing[2],
651
+ justify: "right",
652
+ children: [
653
+ searchProps && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExpandedSearchInput, {
654
+ title: null,
655
+ useClearIcon: true,
656
+ ...searchProps,
657
+ size: "md"
658
+ }),
659
+ setShowFilters && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconButton.Button, {
660
+ id: "table-controls__view-tab-filters",
661
+ variant: "basic",
662
+ onClick: () => setShowFilters?.(!showFilters),
663
+ "aria-label": showFilters ? "Hide filters" : "Show filters",
664
+ "aria-expanded": showFilters,
665
+ "aria-controls": filtersId,
666
+ disabled: isLoading,
667
+ active: showFilters,
668
+ width: "icon",
669
+ size: "md",
670
+ "data-tour-target": "table-filters-toggle-button",
671
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.FilterIcon, {})
672
+ }),
673
+ propertiesButton
674
+ ]
675
+ }),
676
+ showFilters && filterPanel
677
+ ] });
678
+ };
679
+ //#endregion
680
+ //#region components/DataTable/TableControls/TableControls.tsx
681
+ const TableControls = ({ filterPanel, searchProps, defaultShowFilters, showFilters: controlledShowFilters, setShowFilters: controlledSetShowFilters, className, tableActions, propertiesButton, isLoading, showViews, canEditViews, onSelectView, views, currentView, onAddView, onViewNameChange, onDuplicateView, onDeleteView, onSaveView, isViewDirty, selectedRows, bulkActions, onClearSelection, title, presetViews, compact, columnConfigurationProps, showFiltersAlways = false, onError, "data-tour-target": dataTourTarget }) => {
682
+ const filtersId = (0, react_aria.useId)();
683
+ const [internalShowFilters, internalSetShowFilters] = (0, react.useState)(defaultShowFilters ?? false);
684
+ const showFilters = controlledShowFilters != null ? controlledShowFilters : internalShowFilters;
685
+ const setShowFilters = controlledSetShowFilters != null ? controlledSetShowFilters : internalSetShowFilters;
686
+ const enhancedPropertiesButton = (0, react.useMemo)(() => {
687
+ if (!columnConfigurationProps && !propertiesButton) return;
688
+ const elements = [];
689
+ if (propertiesButton) elements.push(propertiesButton);
690
+ if (columnConfigurationProps) elements.push(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableViewConfigurationDropdown, {
691
+ disabled: false,
692
+ ...columnConfigurationProps
693
+ }, "column-config"));
694
+ if (elements.length === 1) return elements[0];
695
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledEnhancedPropertiesButton, { children: elements });
696
+ }, [columnConfigurationProps, propertiesButton]);
697
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container, {
698
+ className,
699
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ControlBar, {
700
+ showViews: compact ? false : showViews,
701
+ views: compact ? void 0 : views,
702
+ onSelectView: compact ? void 0 : onSelectView,
703
+ currentView: compact ? void 0 : currentView,
704
+ onAddView: compact ? void 0 : onAddView,
705
+ onDeleteView: compact ? void 0 : onDeleteView,
706
+ onDuplicateView: compact ? void 0 : onDuplicateView,
707
+ onViewNameChange: compact ? void 0 : onViewNameChange,
708
+ onSaveView: compact ? void 0 : onSaveView,
709
+ isViewDirty,
710
+ canEditViews: compact ? false : canEditViews,
711
+ showFilters,
712
+ setShowFilters: filterPanel != null && !showFiltersAlways ? setShowFilters : void 0,
713
+ filtersId,
714
+ searchProps,
715
+ propertiesButton: enhancedPropertiesButton,
716
+ tableActions,
717
+ isLoading,
718
+ selectedRows,
719
+ bulkActions,
720
+ onClearSelection,
721
+ title,
722
+ "data-tour-target": dataTourTarget,
723
+ presetViews: compact ? void 0 : presetViews,
724
+ compact,
725
+ onError,
726
+ filterPanel
727
+ })
728
+ });
729
+ };
730
+ const Container = (0, styled_components.default)(require_Stack.Stack)`
731
+ margin-bottom: ${_persona_design_tokens.Spacing[2]};
732
+ `;
733
+ const StyledEnhancedPropertiesButton = styled_components.default.div`
734
+ display: flex;
735
+ gap: ${_persona_design_tokens.Spacing[1]};
736
+ `;
737
+ //#endregion
738
+ //#region components/DataTable/dnd/StyledIconDrag.tsx
739
+ const StyledIconDrag = (0, styled_components$1.default)(_persona_icons_24px.DragIcon)`
740
+ display: ${({ $shouldHide = false }) => $shouldHide ? "none" : "inline"};
741
+
742
+ ${({ $horizontal = false }) => $horizontal ? styled_components$1.css`
743
+ transform: rotate(90deg);
744
+ ` : ""}
745
+
746
+ ${({ $active = false, $hover = false }) => $active ? styled_components$1.css`
747
+ cursor: grabbing;
748
+ opacity: 1;
749
+ ` : $hover ? styled_components$1.css`
750
+ cursor: grab;
751
+ opacity: 1;
752
+ ` : styled_components$1.css`
753
+ cursor: normal;
754
+ opacity: 0.4;
755
+ `}
756
+
757
+ transition: opacity 0.2s ease-in-out;
758
+
759
+ path {
760
+ stroke: ${_persona_design_tokens.Color.CoreSlate1000};
761
+ stroke-width: 1px;
762
+ }
763
+ `;
764
+ //#endregion
765
+ //#region components/DataTable/dnd/utils.ts
766
+ /**
767
+ * reorder returns a reordered version of the inputed list by swapping the element
768
+ * at startIndex with the one at endIndex
769
+ */
770
+ function reorder(list, startIndex, endIndex) {
771
+ const result = Array.from(list);
772
+ const [removed] = result.splice(startIndex, 1);
773
+ result.splice(endIndex, 0, removed);
774
+ return result;
775
+ }
776
+ //#endregion
777
+ //#region components/DataTable/TableControls/TableViewConfigurationDropdown.tsx
778
+ const DndSection = (0, styled_components.default)("div")`
779
+ max-height: 400px;
780
+
781
+ overflow: scroll;
782
+ ::-webkit-scrollbar {
783
+ display: none;
784
+ }
785
+ `;
786
+ const DndItemWrapper = (0, styled_components.default)("div")`
787
+ background: white;
788
+ width: 100%;
789
+ border-bottom: 1px solid ${({ theme }) => theme.color.border.secondary};
790
+ padding: ${_persona_design_tokens.Spacing[2]} ${_persona_design_tokens.Spacing[2]};
791
+
792
+ display: flex;
793
+ flex-direction: row;
794
+ align-items: center;
795
+ justify-content: left;
796
+ `;
797
+ const SuffixContainer = (0, styled_components.default)("div")`
798
+ padding-left: ${_persona_design_tokens.Spacing[2]};
799
+ margin-left: auto;
800
+ align-self: center;
801
+ `;
802
+ const SearchContainer = styled_components.default.div`
803
+ display: flex;
804
+ `;
805
+ const StyledSearchInput = (0, styled_components.default)(SearchInput)`
806
+ width: 100%;
807
+ `;
808
+ const PopoverCard$1 = (0, styled_components.default)(require_Card.Card_default)`
809
+ width: 300px;
810
+ padding: ${_persona_design_tokens.Spacing[4]};
811
+ `;
812
+ const TriggerIconButton = (0, react.forwardRef)(function TriggerIconButton({ disabled, ...elemProps }, ref) {
813
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconButton.Button, {
814
+ disabled,
815
+ width: "icon",
816
+ variant: "basic",
817
+ size: "md",
818
+ ...elemProps,
819
+ ref,
820
+ "data-tour-target": "table-properties-button",
821
+ "aria-label": "Table Properties",
822
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.SettingsIcon, {})
823
+ });
824
+ });
825
+ const TooltipButtonWrapper = (0, styled_components.default)("div")`
826
+ display: inline-block;
827
+ `;
828
+ const TableViewConfigurationDropdown = ({ disabled = false, disabledTooltipMessage = "Your role does not have permission to configure the view.", size = "md", variant = "basic", ...props }) => {
829
+ return disabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Tooltip.Tooltip, {
830
+ trigger: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TooltipButtonWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TriggerIconButton, {
831
+ disabled: true,
832
+ size,
833
+ variant
834
+ }) }),
835
+ children: disabledTooltipMessage
836
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Popover.Popover_default, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Popover.Popover_default.Trigger, {
837
+ asChild: true,
838
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TriggerIconButton, {
839
+ disabled: false,
840
+ size,
841
+ variant
842
+ })
843
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Popover.Popover_default.Content, {
844
+ style: { zIndex: require_lib_zindex.Z_INDICES.dropdown },
845
+ sideOffset: 8,
846
+ side: "bottom",
847
+ align: "end",
848
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverCard$1, {
849
+ elevated: true,
850
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableViewConfiguration, { ...props })
851
+ })
852
+ })] });
853
+ };
854
+ const TableViewConfiguration = ({ columnConfiguration, attributeOptions, updateColumnConfiguration, getColumnDisabled }) => {
855
+ const [searchTerm, setSearchTerm] = (0, react.useState)("");
856
+ const fuse = (0, react.useMemo)(() => {
857
+ return new fuse_js.default(attributeOptions, {
858
+ shouldSort: false,
859
+ threshold: .4,
860
+ location: 0,
861
+ distance: 100,
862
+ minMatchCharLength: 1,
863
+ keys: [{
864
+ name: "label",
865
+ weight: 1
866
+ }]
867
+ });
868
+ }, [attributeOptions]);
869
+ const allOptions = (0, react.useMemo)(() => (0, lodash_fp_js.union)(attributeOptions, columnConfiguration), [attributeOptions, columnConfiguration]);
870
+ const filteredSearchOptions = searchTerm === "" ? allOptions : fuse.search(searchTerm).map(({ item }) => item);
871
+ const hiddenAttributes = (0, react.useMemo)(() => {
872
+ return filteredSearchOptions.filter((attribute) => {
873
+ return !columnConfiguration.map((c) => c.key).includes(attribute.key);
874
+ });
875
+ }, [columnConfiguration, filteredSearchOptions]);
876
+ const filteredShownAttributes = (0, react.useMemo)(() => {
877
+ return columnConfiguration.filter((column) => filteredSearchOptions.map((o) => o.key).includes(column.key));
878
+ }, [columnConfiguration, filteredSearchOptions]);
879
+ const handleDragEnd = (result, _provided) => {
880
+ const { destination, source } = result;
881
+ if (!destination || destination.droppableId === source.droppableId && destination.index === source.index) return;
882
+ updateColumnConfiguration(reorder(columnConfiguration, source.index, destination.index));
883
+ };
884
+ const generateShownAttributesToggle = (column) => () => {
885
+ updateColumnConfiguration(columnConfiguration.filter((a) => a.key !== column.key));
886
+ };
887
+ const generateHiddenAttributesToggle = (column) => () => {
888
+ updateColumnConfiguration(columnConfiguration.concat(column));
889
+ };
890
+ const shownColumnIds = (0, react.useMemo)(() => {
891
+ return columnConfiguration.map((c) => c.key);
892
+ }, [columnConfiguration]);
893
+ const shownDndItemProps = filteredShownAttributes.map((column, index) => {
894
+ const isDisabledByDefault = columnConfiguration.length === 1;
895
+ const isDisabledByCustom = getColumnDisabled?.(column.key, shownColumnIds) ?? false;
896
+ const shouldDisableDragForColumn = isDisabledByCustom && index === filteredShownAttributes.length - 1;
897
+ return {
898
+ column,
899
+ index,
900
+ isDisabled: isDisabledByDefault || isDisabledByCustom,
901
+ isToggled: true,
902
+ shouldDisableDrag: shouldDisableDragForColumn,
903
+ handleToggle: generateShownAttributesToggle(column)
904
+ };
905
+ });
906
+ const hiddenDndItemProps = hiddenAttributes.map((column, index) => {
907
+ return {
908
+ column,
909
+ index,
910
+ isToggled: false,
911
+ shouldDisableDrag: true,
912
+ handleToggle: generateHiddenAttributesToggle(column)
913
+ };
914
+ });
915
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
916
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Label, {
917
+ size: "lg",
918
+ weight: "bold",
919
+ children: "Configure columns"
920
+ }),
921
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Spacer.Spacer_default, { height: 2 }),
922
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchContainer, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledSearchInput, {
923
+ title: null,
924
+ value: searchTerm,
925
+ handleInput: setSearchTerm,
926
+ size: "md",
927
+ placeholder: "Search by item...",
928
+ dataTest: "checklist-item-panel-item-table__search"
929
+ }) }),
930
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Spacer.Spacer_default, { height: 2 }),
931
+ shownDndItemProps.length > 0 || hiddenDndItemProps.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DndSection, { children: [
932
+ shownDndItemProps.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Paragraph, { children: "Shown attributes" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hello_pangea_dnd.DragDropContext, {
933
+ onDragEnd: handleDragEnd,
934
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hello_pangea_dnd.Droppable, {
935
+ droppableId: "cases-view__configure-shown-columns",
936
+ renderClone: (provided, _snapshot, rubric) => {
937
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
938
+ ...provided.draggableProps,
939
+ ...provided.dragHandleProps,
940
+ ref: provided.innerRef,
941
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AttributeDnd, { ...shownDndItemProps[rubric.source.index] })
942
+ });
943
+ },
944
+ children: (provided) => {
945
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
946
+ ref: provided.innerRef,
947
+ ...provided.droppableProps,
948
+ children: [shownDndItemProps.map((props, idx) => {
949
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hello_pangea_dnd.Draggable, {
950
+ draggableId: props.column.key,
951
+ index: idx,
952
+ isDragDisabled: props.shouldDisableDrag,
953
+ children: (provided) => {
954
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
955
+ ref: provided.innerRef,
956
+ ...provided.draggableProps,
957
+ ...provided.dragHandleProps,
958
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AttributeDnd, { ...props })
959
+ });
960
+ }
961
+ }, `${props.column.key}`);
962
+ }), provided.placeholder]
963
+ });
964
+ }
965
+ })
966
+ })] }),
967
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Spacer.Spacer_default, { height: 2 }),
968
+ hiddenDndItemProps.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Paragraph, { children: "Hidden attributes" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hello_pangea_dnd.DragDropContext, {
969
+ onDragEnd: handleDragEnd,
970
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hello_pangea_dnd.Droppable, {
971
+ droppableId: "cases-view__configure-hidden-columns",
972
+ renderClone: (provided, _snapshot, rubric) => {
973
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
974
+ ...provided.draggableProps,
975
+ ...provided.dragHandleProps,
976
+ ref: provided.innerRef,
977
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AttributeDnd, { ...hiddenDndItemProps[rubric.source.index] })
978
+ });
979
+ },
980
+ children: (provided) => {
981
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
982
+ ref: provided.innerRef,
983
+ ...provided.droppableProps,
984
+ children: [hiddenDndItemProps.map((props, idx) => {
985
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hello_pangea_dnd.Draggable, {
986
+ draggableId: props.column.key,
987
+ index: idx,
988
+ isDragDisabled: props.shouldDisableDrag,
989
+ children: (provided) => {
990
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
991
+ ref: provided.innerRef,
992
+ ...provided.draggableProps,
993
+ ...provided.dragHandleProps,
994
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AttributeDnd, { ...props })
995
+ });
996
+ }
997
+ }, `${props.column.key}`);
998
+ }), provided.placeholder]
999
+ });
1000
+ }
1001
+ })
1002
+ })] })
1003
+ ] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Paragraph, { children: "No matching attributes" }) })
1004
+ ] });
1005
+ };
1006
+ const OverflowText = (0, styled_components.default)("div")`
1007
+ max-width: 160px;
1008
+ flex-wrap: wrap;
1009
+ display: flex;
1010
+ `;
1011
+ const AttributeDnd = ({ column, index, isDisabled = false, isToggled, shouldDisableDrag, handleToggle }) => {
1012
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DndItemWrapper, { children: [
1013
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIconDrag, {
1014
+ $active: true,
1015
+ $shouldHide: shouldDisableDrag
1016
+ }),
1017
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OverflowText, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Paragraph, {
1018
+ color: "primary",
1019
+ size: "sm",
1020
+ children: column.label
1021
+ }) }),
1022
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SuffixContainer, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Toggle.Toggle, {
1023
+ value: isToggled,
1024
+ disabled: isDisabled,
1025
+ onChange: handleToggle,
1026
+ "aria-label": isToggled ? `Hide ${column.label}` : `Show ${column.label}`
1027
+ }) })
1028
+ ] }, `${column.key}-${index}`);
1029
+ };
1030
+ //#endregion
1031
+ //#region components/DataTable/TableControls/TableControlsContext.ts
1032
+ const TableControlsContext = (0, react.createContext)({
1033
+ filters: [],
1034
+ activeFilters: [],
1035
+ setActiveFilters: () => {}
1036
+ });
1037
+ function useTableControls() {
1038
+ return (0, react.useContext)(TableControlsContext);
1039
+ }
1040
+ function TableControlsProvider({ children, ...value }) {
1041
+ return (0, react.createElement)(TableControlsContext.Provider, { value }, children);
1042
+ }
1043
+ //#endregion
1044
+ //#region components/DataTable/TableControls/FiltersV2/operators.ts
1045
+ /**
1046
+ * Operator vocabulary per field type. The UI uses this to populate the
1047
+ * operator dropdown in the Filter popover and to gate which operators are
1048
+ * reachable for a given field. `is_empty` / `is_not_empty` apply broadly;
1049
+ * everything else is type-specific.
1050
+ *
1051
+ * The first entry for each type is the default operator selected when a
1052
+ * pill is created from the picker.
1053
+ */
1054
+ const OPERATORS_BY_TYPE = {
1055
+ string: [
1056
+ "is",
1057
+ "is_not",
1058
+ "contains",
1059
+ "does_not_contain",
1060
+ "is_empty",
1061
+ "is_not_empty"
1062
+ ],
1063
+ email: [
1064
+ "is",
1065
+ "is_not",
1066
+ "contains",
1067
+ "does_not_contain",
1068
+ "is_empty",
1069
+ "is_not_empty"
1070
+ ],
1071
+ choices: [
1072
+ "is",
1073
+ "is_not",
1074
+ "is_empty",
1075
+ "is_not_empty"
1076
+ ],
1077
+ multi_choices: [
1078
+ "is",
1079
+ "is_not",
1080
+ "is_empty",
1081
+ "is_not_empty"
1082
+ ],
1083
+ boolean: ["is"],
1084
+ integer: [
1085
+ "is",
1086
+ "is_not",
1087
+ "is_empty",
1088
+ "is_not_empty"
1089
+ ],
1090
+ float: [
1091
+ "is",
1092
+ "is_not",
1093
+ "is_empty",
1094
+ "is_not_empty"
1095
+ ],
1096
+ date: [
1097
+ "is",
1098
+ "before",
1099
+ "after",
1100
+ "is_empty",
1101
+ "is_not_empty"
1102
+ ],
1103
+ array: [
1104
+ "contains",
1105
+ "does_not_contain",
1106
+ "is_empty",
1107
+ "is_not_empty"
1108
+ ],
1109
+ tags_conditions: ["is"],
1110
+ date_range: ["is"]
1111
+ };
1112
+ /** Operators that have no value control (the operator itself is the predicate). */
1113
+ const VALUELESS_OPERATORS = new Set(["is_empty", "is_not_empty"]);
1114
+ function getOperatorsForType(type) {
1115
+ return OPERATORS_BY_TYPE[type] ?? [];
1116
+ }
1117
+ /**
1118
+ * Effective operator vocabulary for a concrete field: its `allowedOperators`
1119
+ * allow-list, or the field type's full vocabulary when the allow-list is
1120
+ * absent or empty. An empty allow-list means "unconstrained" rather than
1121
+ * "no operators" — the latter would leave the field selectable in the picker
1122
+ * but incapable of producing a rule that passes validation.
1123
+ *
1124
+ * Prefer this over {@link getOperatorsForType} anywhere a real field is in
1125
+ * hand — the popover's operator dropdown, `FieldRegistry`, validation — so a
1126
+ * field can never surface an operator the host application can't serialize.
1127
+ */
1128
+ function getOperatorsForField(field) {
1129
+ const { allowedOperators } = field;
1130
+ if (allowedOperators == null || allowedOperators.length === 0) return getOperatorsForType(field.type);
1131
+ return allowedOperators;
1132
+ }
1133
+ function getDefaultOperatorForType(type) {
1134
+ const list = OPERATORS_BY_TYPE[type];
1135
+ if (list.length === 0) throw new Error(`No operators defined for field type "${type}"`);
1136
+ return list[0];
1137
+ }
1138
+ function isValuelessOperator(operator) {
1139
+ return VALUELESS_OPERATORS.has(operator);
1140
+ }
1141
+ /**
1142
+ * Whether a concrete field's operator selector should be shown. A field
1143
+ * pinned to one operator renders it as static text rather than a caret that
1144
+ * opens a one-item menu.
1145
+ */
1146
+ function fieldHasMultipleOperators(field) {
1147
+ return getOperatorsForField(field).length > 1;
1148
+ }
1149
+ /**
1150
+ * Human-readable operator labels for the operator dropdown and filled pill.
1151
+ */
1152
+ const OPERATOR_LABELS = {
1153
+ is: "is",
1154
+ is_not: "is not",
1155
+ contains: "contains",
1156
+ does_not_contain: "does not contain",
1157
+ is_empty: "is empty",
1158
+ is_not_empty: "is not empty",
1159
+ is_true: "is true",
1160
+ is_false: "is false",
1161
+ before: "before",
1162
+ after: "after"
1163
+ };
1164
+ /**
1165
+ * Field-type-specific label overrides. The operator vocabulary itself
1166
+ * stays unchanged (operator tokens are `is` / `is_not` across types), but
1167
+ * labels can be more specific where the generic label is ambiguous.
1168
+ *
1169
+ * Only present for `(fieldType, operator)` pairs that diverge from the
1170
+ * generic label; everything else falls through to `OPERATOR_LABELS`.
1171
+ */
1172
+ const OPERATOR_LABELS_BY_TYPE = { multi_choices: {
1173
+ is: "is any of",
1174
+ is_not: "is none of"
1175
+ } };
1176
+ function getOperatorLabel(operator, fieldType) {
1177
+ if (fieldType) {
1178
+ const override = OPERATOR_LABELS_BY_TYPE[fieldType]?.[operator];
1179
+ if (override) return override;
1180
+ }
1181
+ return OPERATOR_LABELS[operator];
1182
+ }
1183
+ /**
1184
+ * Empty-but-present value seeded when a rule switches from a valueless operator
1185
+ * (`is_empty`) to one that requires a value. Non-null on purpose: a `null` value
1186
+ * reads as a removal and drops the pill mid-edit.
1187
+ */
1188
+ function emptyValueForFieldType(type) {
1189
+ switch (type) {
1190
+ case "multi_choices":
1191
+ case "tags_conditions": return [];
1192
+ default: return "";
1193
+ }
1194
+ }
1195
+ //#endregion
1196
+ //#region components/DataTable/TableControls/FiltersV2/AdvancedFilterRulesPopover/display.ts
1197
+ function valueDisplayString(value, optionLabels) {
1198
+ if (value == null) return;
1199
+ const display = (raw) => optionLabels?.[raw] ?? raw;
1200
+ if (Array.isArray(value)) {
1201
+ if (value.length === 0) return;
1202
+ if (value.length === 1) return display(String(value[0]));
1203
+ return `${display(String(value[0]))} +${value.length - 1}`;
1204
+ }
1205
+ if (typeof value === "boolean") return value ? "true" : "false";
1206
+ if (typeof value === "number") return String(value);
1207
+ if (typeof value === "string") return value.length > 0 ? display(value) : void 0;
1208
+ }
1209
+ function draftValueFor(field, operator) {
1210
+ if (isValuelessOperator(operator)) return null;
1211
+ if (field.type === "boolean") return true;
1212
+ if (field.type === "multi_choices") return [];
1213
+ return "";
1214
+ }
1215
+ //#endregion
1216
+ //#region components/DataTable/TableControls/FiltersV2/fieldPickerOptions.ts
1217
+ const FIELDS_SUBMENU_LABEL = "Fields";
1218
+ function newNode() {
1219
+ return {
1220
+ leaves: [],
1221
+ groups: /* @__PURE__ */ new Map(),
1222
+ parents: /* @__PURE__ */ new Set()
1223
+ };
1224
+ }
1225
+ /**
1226
+ * The leaf `value` stays the full field id even when nested, so selection,
1227
+ * serialization, and persisted filter state are unaffected by the grouping.
1228
+ */
1229
+ function insertField(root, field, description) {
1230
+ const path = field.path && field.path.length > 1 ? field.path : null;
1231
+ if (!path) {
1232
+ root.leaves.push({
1233
+ label: field.label,
1234
+ value: field.id,
1235
+ description
1236
+ });
1237
+ return;
1238
+ }
1239
+ let node = root;
1240
+ for (const segment of path.slice(0, -1)) {
1241
+ let child = node.groups.get(segment);
1242
+ if (!child) {
1243
+ child = newNode();
1244
+ node.groups.set(segment, child);
1245
+ }
1246
+ if (description != null) child.parents.add(description);
1247
+ node = child;
1248
+ }
1249
+ node.leaves.push({
1250
+ label: (0, lodash.startCase)(path[path.length - 1]),
1251
+ value: field.id,
1252
+ description
1253
+ });
1254
+ }
1255
+ /**
1256
+ * A group gets a parent-record-type sublabel only when every field beneath it
1257
+ * shares one — a segment reused across templates has no single owner to name.
1258
+ */
1259
+ function nodeToOptions(node) {
1260
+ const groups = [];
1261
+ for (const [segment, child] of node.groups) {
1262
+ const [onlyParent] = child.parents;
1263
+ groups.push({
1264
+ label: (0, lodash.startCase)(segment),
1265
+ description: child.parents.size === 1 ? onlyParent : void 0,
1266
+ nested: true,
1267
+ options: nodeToOptions(child)
1268
+ });
1269
+ }
1270
+ return [...node.leaves, ...groups];
1271
+ }
1272
+ /**
1273
+ * Build the field-picker option tree shared by the `⊕ Filter` pill picker
1274
+ * (`FilterPickerMenu`) and the advanced-rules field dropdown
1275
+ * (`RuleEditorFields`) so both surface custom fields identically.
1276
+ *
1277
+ * System fields are top-level leaves; every custom field lives behind a
1278
+ * single `nested: true` "Fields" group, with its parent record type rendered
1279
+ * as the leaf's `description` sublabel. Hash subfields (fields whose backend
1280
+ * `path` has more than one segment, e.g. `address.city`) nest one level
1281
+ * deeper, behind their parent segment (`address`). The `nested`
1282
+ * flag is what makes the single-select Combobox render a group as an
1283
+ * expandable submenu — leaf selections commit via `onChange`, group descents
1284
+ * only navigate.
1285
+ *
1286
+ * `visibleCustomFieldParents`, when provided, narrows the Fields submenu to
1287
+ * only the listed parent record-type labels; passing an empty array hides the
1288
+ * submenu entirely. Omit it (or pass `undefined`) to show every group.
1289
+ *
1290
+ * `excludeFieldIds`, when provided, drops those fields from the tree.
1291
+ */
1292
+ function buildFieldPickerOptions(registry, visibleCustomFieldParents, excludeFieldIds) {
1293
+ const systemFields = registry.systemFieldsList();
1294
+ const customGroups = registry.customFieldGroups();
1295
+ const excluded = excludeFieldIds == null ? null : new Set(excludeFieldIds);
1296
+ const tree = systemFields.filter((field) => excluded == null || !excluded.has(field.id)).map((field) => ({
1297
+ label: field.label,
1298
+ value: field.id
1299
+ }));
1300
+ const allowedParents = visibleCustomFieldParents == null ? null : new Set(visibleCustomFieldParents);
1301
+ const customRoot = newNode();
1302
+ for (const group of customGroups) {
1303
+ if (allowedParents != null && !allowedParents.has(group.parent)) continue;
1304
+ const description = group.parent !== "" ? group.parent : void 0;
1305
+ for (const field of group.fields) {
1306
+ if (excluded != null && excluded.has(field.id)) continue;
1307
+ insertField(customRoot, field, description);
1308
+ }
1309
+ }
1310
+ const customOptions = nodeToOptions(customRoot);
1311
+ if (customOptions.length > 0) tree.push({
1312
+ label: FIELDS_SUBMENU_LABEL,
1313
+ nested: true,
1314
+ options: customOptions
1315
+ });
1316
+ return tree;
1317
+ }
1318
+ //#endregion
1319
+ //#region components/DataTable/TableControls/FiltersV2/AdvancedFilterRulesPopover/RuleEditorFields.tsx
1320
+ function RuleEditorFields({ registry, field, groupIndex, ruleIndex, rule, size, operators, operatorConfigurable, onFieldChange, onOperatorChange, onValueChange, renderValueControl }) {
1321
+ const fieldOptions = (0, react.useMemo)(() => buildFieldPickerOptions(registry), [registry]);
1322
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
1323
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FormField.ComboboxField, {
1324
+ label: "Value",
1325
+ labelProps: { size },
1326
+ "aria-label": `Field for rule ${ruleIndex + 1} in group ${groupIndex + 1}`,
1327
+ size,
1328
+ options: fieldOptions,
1329
+ value: rule.fieldId,
1330
+ onChange: (next) => {
1331
+ if (typeof next === "string") onFieldChange(groupIndex, ruleIndex, next);
1332
+ },
1333
+ placeholder: "Select field",
1334
+ portal: false
1335
+ }),
1336
+ operatorConfigurable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FormField.ComboboxField, {
1337
+ label: "Operator",
1338
+ labelProps: { size },
1339
+ "aria-label": `Operator for rule ${ruleIndex + 1} in group ${groupIndex + 1}`,
1340
+ size,
1341
+ options: operators.map((op) => ({
1342
+ label: getOperatorLabel(op, field?.type),
1343
+ value: op
1344
+ })),
1345
+ value: rule.operator,
1346
+ onChange: (next) => {
1347
+ if (typeof next === "string") onOperatorChange(groupIndex, ruleIndex, next);
1348
+ },
1349
+ portal: false
1350
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FormField.FormField, {
1351
+ label: "Operator",
1352
+ labelProps: { size },
1353
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Input_index.default, {
1354
+ size,
1355
+ "aria-label": `Operator for rule ${ruleIndex + 1} in group ${groupIndex + 1}`,
1356
+ value: getOperatorLabel(rule.operator, field?.type),
1357
+ disabled: true,
1358
+ readOnly: true
1359
+ })
1360
+ }),
1361
+ field && !isValuelessOperator(rule.operator) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FormField.FormField, {
1362
+ label: "Value",
1363
+ labelProps: { size },
1364
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: renderValueControl(field, rule.operator, rule.value, (next) => onValueChange(groupIndex, ruleIndex, next)) })
1365
+ }) : null
1366
+ ] });
1367
+ }
1368
+ //#endregion
1369
+ //#region components/DataTable/TableControls/FiltersV2/AdvancedFilterRulesPopover/AdvancedFilterRuleRow.tsx
1370
+ function AdvancedFilterRuleRow({ registry, groupIndex, ruleIndex, rule, size, isOpen, onClose, onDelete, onFieldChange, onOperatorChange, onValueChange, renderValueControl }) {
1371
+ const field = registry.get(rule.fieldId);
1372
+ const operators = field ? getOperatorsForField(field) : [];
1373
+ const operatorConfigurable = field ? fieldHasMultipleOperators(field) : true;
1374
+ const condition = ruleIndex === 0 ? "If" : "And";
1375
+ const rowId = `${groupIndex}-${ruleIndex}`;
1376
+ const valueDisplay = isValuelessOperator(rule.operator) ? void 0 : valueDisplayString(rule.value, registry.optionLabelsFor(rule.fieldId));
1377
+ const textValue = [
1378
+ condition,
1379
+ field?.label ?? rule.fieldId,
1380
+ getOperatorLabel(rule.operator, field?.type),
1381
+ valueDisplay
1382
+ ].filter(Boolean).join(" ");
1383
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ListBox.ListBox.LogicRow, {
1384
+ id: rowId,
1385
+ condition,
1386
+ hideCondition: true,
1387
+ attributeName: field?.label ?? rule.fieldId,
1388
+ operator: getOperatorLabel(rule.operator, field?.type),
1389
+ matchLevelName: valueDisplay,
1390
+ textValue,
1391
+ size,
1392
+ onClick: () => {
1393
+ if (isOpen) onClose();
1394
+ },
1395
+ onDelete,
1396
+ dropdownHeadingText: `Edit \u2018${condition}\u2019 statement`,
1397
+ dropdownFormFields: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RuleEditorFields, {
1398
+ registry,
1399
+ field,
1400
+ groupIndex,
1401
+ ruleIndex,
1402
+ rule,
1403
+ size,
1404
+ operators,
1405
+ operatorConfigurable,
1406
+ onFieldChange,
1407
+ onOperatorChange,
1408
+ onValueChange,
1409
+ renderValueControl
1410
+ })
1411
+ });
1412
+ }
1413
+ //#endregion
1414
+ //#region components/DataTable/TableControls/FiltersV2/AdvancedFilterRulesPopover/compound-expression.ts
1415
+ function withGroup(compound, index, group) {
1416
+ const groups = [...compound.groups];
1417
+ groups[index] = group;
1418
+ return { groups };
1419
+ }
1420
+ function addRuleToGroup(compound, groupIndex, rule) {
1421
+ const groups = [...compound.groups];
1422
+ while (groups.length <= groupIndex) groups.push({ rules: [] });
1423
+ groups[groupIndex] = { rules: [...groups[groupIndex].rules, rule] };
1424
+ return { groups };
1425
+ }
1426
+ function setRuleInGroup(compound, groupIndex, ruleIndex, rule) {
1427
+ const group = compound.groups[groupIndex];
1428
+ if (!group || ruleIndex < 0 || ruleIndex >= group.rules.length) return compound;
1429
+ const rules = [...group.rules];
1430
+ rules[ruleIndex] = rule;
1431
+ return withGroup(compound, groupIndex, { rules });
1432
+ }
1433
+ function removeRuleFromGroup(compound, groupIndex, ruleIndex) {
1434
+ const group = compound.groups[groupIndex];
1435
+ if (!group || ruleIndex < 0 || ruleIndex >= group.rules.length) return compound;
1436
+ const rules = group.rules.filter((_, i) => i !== ruleIndex);
1437
+ if (rules.length === 0) return { groups: compound.groups.filter((_, i) => i !== groupIndex) };
1438
+ return withGroup(compound, groupIndex, { rules });
1439
+ }
1440
+ //#endregion
1441
+ //#region components/DataTable/TableControls/FiltersV2/AdvancedFilterRulesPopover/use-rules-popover-selection.ts
1442
+ function useRulesPopoverSelection({ isOpen }) {
1443
+ const [selectedRowKey, setSelectedRowKey] = (0, react.useState)(null);
1444
+ const popoverContentRef = (0, react.useRef)(null);
1445
+ const lastPointerDownTargetRef = (0, react.useRef)(null);
1446
+ (0, react.useEffect)(() => {
1447
+ if (!isOpen && selectedRowKey != null) setSelectedRowKey(null);
1448
+ }, [isOpen, selectedRowKey]);
1449
+ (0, react.useEffect)(() => {
1450
+ const onPointerDown = (event) => {
1451
+ lastPointerDownTargetRef.current = event.target;
1452
+ };
1453
+ document.addEventListener("mousedown", onPointerDown, true);
1454
+ return () => document.removeEventListener("mousedown", onPointerDown, true);
1455
+ }, []);
1456
+ const closeSelectedRow = () => setSelectedRowKey(null);
1457
+ const handleGroupSelectionChange = (keys) => {
1458
+ const next = keys instanceof Set ? Array.from(keys)[0] ?? null : null;
1459
+ if (next == null) {
1460
+ const target = lastPointerDownTargetRef.current;
1461
+ if (target && popoverContentRef.current?.contains(target)) closeSelectedRow();
1462
+ return;
1463
+ }
1464
+ setSelectedRowKey(next);
1465
+ };
1466
+ const selectedKeysForGroup = (groupIndex) => {
1467
+ return selectedRowKey != null && selectedRowKey.startsWith(`${groupIndex}-`) ? new Set([selectedRowKey]) : /* @__PURE__ */ new Set();
1468
+ };
1469
+ return {
1470
+ selectedRowKey,
1471
+ setSelectedRowKey,
1472
+ closeSelectedRow,
1473
+ popoverContentRef,
1474
+ handleGroupSelectionChange,
1475
+ selectedKeysForGroup
1476
+ };
1477
+ }
1478
+ //#endregion
1479
+ //#region components/DataTable/TableControls/FiltersV2/filter-size-context.ts
1480
+ /**
1481
+ * Context for FilterBar-wide rendering settings. It currently carries
1482
+ * only `size`, but the object shape leaves room for future bar-level
1483
+ * settings without introducing another provider.
1484
+ */
1485
+ const FilterBarContext = (0, react.createContext)({ size: "sm" });
1486
+ /**
1487
+ * Resolve the active filter-bar size, honoring an explicit prop
1488
+ * override before falling back to the surrounding `FilterBarContext`.
1489
+ * Pattern is the same as the design-system FormControl size hook —
1490
+ * components accept an optional `size` prop that wins, otherwise
1491
+ * follow the ambient context.
1492
+ */
1493
+ function useFilterBarSize(override) {
1494
+ const { size } = (0, react.useContext)(FilterBarContext);
1495
+ return override ?? size;
1496
+ }
1497
+ const FILTER_SIZE_TOKENS = {
1498
+ sm: {
1499
+ controlHeight: "24px",
1500
+ chipHeight: "18px",
1501
+ fontSize: "12px",
1502
+ lineHeight: "18px",
1503
+ iconSize: "12px"
1504
+ },
1505
+ md: {
1506
+ controlHeight: "32px",
1507
+ chipHeight: "24px",
1508
+ fontSize: "14px",
1509
+ lineHeight: "22px",
1510
+ iconSize: "16px"
1511
+ }
1512
+ };
1513
+ //#endregion
1514
+ //#region components/DataTable/TableControls/FiltersV2/AdvancedFilterRulesPopover/AdvancedFilterRulesPopover.tsx
1515
+ const PopoverContent = (0, styled_components$1.default)(_radix_ui_react_popover.Content)`
1516
+ z-index: ${require_lib_zindex.Z_INDICES.modalDropdown};
1517
+ `;
1518
+ const PopoverCard = (0, styled_components$1.default)(require_Card.Card_default)`
1519
+ width: 384px;
1520
+ max-width: calc(100vw - ${_persona_design_tokens.Spacing[4]});
1521
+ margin-bottom: 0;
1522
+ `;
1523
+ const Header = styled_components$1.default.div`
1524
+ display: flex;
1525
+ align-items: center;
1526
+ justify-content: space-between;
1527
+ padding: ${_persona_design_tokens.Spacing[3]};
1528
+ `;
1529
+ const Body = styled_components$1.default.div`
1530
+ display: flex;
1531
+ flex-direction: column;
1532
+ gap: ${_persona_design_tokens.Spacing[2]};
1533
+ padding: 0 ${_persona_design_tokens.Spacing[3]} ${_persona_design_tokens.Spacing[3]};
1534
+ max-height: 60vh;
1535
+ overflow-y: auto;
1536
+ `;
1537
+ /**
1538
+ * Bordered container that wraps a single AndGroup. Visually mirrors the
1539
+ * `TableBox` shell (1px BorderDivider + BorderRadius.Md) but is built
1540
+ * standalone here because the rows inside are `LogicRow`s, which depend
1541
+ * on a parent `ListBox` rather than `TableBox`. Each group owns its
1542
+ * "If" / "Or" title and rule actions in the card header.
1543
+ */
1544
+ const GroupCard = styled_components$1.default.div`
1545
+ display: flex;
1546
+ flex-direction: column;
1547
+ border: 1px solid ${_persona_design_tokens.Color.BorderDivider};
1548
+ border-radius: ${_persona_design_tokens.BorderRadius.Md};
1549
+ background-color: ${_persona_design_tokens.Color.BackgroundPrimary};
1550
+ overflow: hidden;
1551
+ `;
1552
+ const GroupHeader = styled_components$1.default.div`
1553
+ display: flex;
1554
+ align-items: center;
1555
+ justify-content: space-between;
1556
+ padding: ${_persona_design_tokens.Spacing[1]} ${_persona_design_tokens.Spacing[2]};
1557
+ border-bottom: 1px solid ${_persona_design_tokens.Color.BorderDivider};
1558
+ background-color: ${_persona_design_tokens.Color.BackgroundSecondary};
1559
+ `;
1560
+ const GroupTitle = styled_components$1.default.span`
1561
+ font-size: ${({ $size }) => FILTER_SIZE_TOKENS[$size].fontSize};
1562
+ line-height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].lineHeight};
1563
+ color: ${_persona_design_tokens.Color.TextPrimary};
1564
+ `;
1565
+ const GroupHeaderActions = styled_components$1.default.div`
1566
+ display: inline-flex;
1567
+ align-items: center;
1568
+ gap: ${_persona_design_tokens.Spacing[1]};
1569
+ `;
1570
+ /**
1571
+ * A focused-down `ListBox` for the rules in one AndGroup. Strips the
1572
+ * default 204px width AND the standalone border (the parent `GroupCard`
1573
+ * supplies the border now). Removes the per-listbox padding so the row
1574
+ * cells sit flush against the card.
1575
+ */
1576
+ const RulesListBox = (0, styled_components$1.default)(require_ListBox.ListBox)`
1577
+ width: 100%;
1578
+ border: 0;
1579
+ border-radius: 0;
1580
+ padding: 0;
1581
+ `;
1582
+ /**
1583
+ * "Or group" affordance that appears between consecutive groups and at
1584
+ * the bottom of the popover. Adds a new empty `AndGroup` at the end of
1585
+ * `compound.groups` when clicked.
1586
+ */
1587
+ const OrGroupRow = styled_components$1.default.div`
1588
+ display: flex;
1589
+ `;
1590
+ function groupsForRender(compound) {
1591
+ if (compound.groups.length === 0) return [{
1592
+ rules: [],
1593
+ synthetic: true
1594
+ }];
1595
+ return compound.groups.map((g) => ({
1596
+ rules: g.rules,
1597
+ synthetic: false
1598
+ }));
1599
+ }
1600
+ /**
1601
+ * DNF (OR-of-AND) editor popover for the compound expression owned by the
1602
+ * Rules pill.
1603
+ *
1604
+ * The popover is fully controlled by `compound` + `onChange` — it never
1605
+ * holds compound state internally so parents can persist edits incrementally
1606
+ * (URL state, saved-view dual-write, etc.). `open` / `onOpenChange` are
1607
+ * optional; when omitted the popover manages its own open state and is
1608
+ * opened by clicking the parent-supplied trigger.
1609
+ *
1610
+ * Each AndGroup's rules are rendered as a `<ListBox>` of `<LogicRow>` items.
1611
+ * The collapsed row reads `[If/And] [field-sticker] [operator] [value-sticker]`
1612
+ * inline; clicking a row reveals the field/operator/value editor inside the
1613
+ * row's dropdown popover.
1614
+ */
1615
+ const AdvancedFilterRulesPopover = ({ registry, compound, onChange, trigger, open, onOpenChange, renderValueControl, size }) => {
1616
+ const resolvedSize = useFilterBarSize(size);
1617
+ const subtleIconSize = resolvedSize === "sm" ? "xs" : "sm";
1618
+ const [internalOpen, setInternalOpen] = (0, react.useState)(false);
1619
+ const isControlled = open != null;
1620
+ const isOpen = isControlled ? open : internalOpen;
1621
+ const { selectedRowKey, setSelectedRowKey, closeSelectedRow, popoverContentRef, handleGroupSelectionChange, selectedKeysForGroup } = useRulesPopoverSelection({ isOpen });
1622
+ const handleOpenChange = (0, react.useCallback)((next) => {
1623
+ if (!isControlled) setInternalOpen(next);
1624
+ onOpenChange?.(next);
1625
+ }, [isControlled, onOpenChange]);
1626
+ const baseId = (0, react.useMemo)(() => (0, lodash.uniqueId)("advanced-filter-rules__"), []);
1627
+ const fields = registry.all();
1628
+ const handleAddOrGroup = (0, react.useCallback)(() => {
1629
+ const firstField = fields[0];
1630
+ if (!firstField) return;
1631
+ const operator = registry.reconcileOperator(firstField.id, "is");
1632
+ const groupIndex = compound.groups.length;
1633
+ onChange(addRuleToGroup(compound, groupIndex, {
1634
+ fieldId: firstField.id,
1635
+ operator,
1636
+ value: draftValueFor(firstField, operator)
1637
+ }));
1638
+ setSelectedRowKey(`${groupIndex}-0`);
1639
+ }, [
1640
+ compound,
1641
+ fields,
1642
+ onChange,
1643
+ registry
1644
+ ]);
1645
+ const handleAddRuleToGroup = (0, react.useCallback)((groupIndex) => {
1646
+ const firstField = fields[0];
1647
+ if (!firstField) return;
1648
+ const operator = registry.reconcileOperator(firstField.id, "is");
1649
+ const newRowId = `${groupIndex}-${compound.groups[groupIndex]?.rules.length ?? 0}`;
1650
+ onChange(addRuleToGroup(compound, groupIndex, {
1651
+ fieldId: firstField.id,
1652
+ operator,
1653
+ value: draftValueFor(firstField, operator)
1654
+ }));
1655
+ setSelectedRowKey(newRowId);
1656
+ }, [
1657
+ compound,
1658
+ fields,
1659
+ onChange,
1660
+ registry
1661
+ ]);
1662
+ const applyCompoundChange = (0, react.useCallback)((next) => {
1663
+ onChange(next);
1664
+ }, [onChange]);
1665
+ const handleRemoveRule = (0, react.useCallback)((groupIndex, ruleIndex) => {
1666
+ applyCompoundChange(removeRuleFromGroup(compound, groupIndex, ruleIndex));
1667
+ }, [compound, applyCompoundChange]);
1668
+ const handleFieldChange = (0, react.useCallback)((groupIndex, ruleIndex, nextFieldId) => {
1669
+ const field = registry.get(nextFieldId);
1670
+ if (!field) return;
1671
+ const prev = compound.groups[groupIndex]?.rules[ruleIndex];
1672
+ if (!prev) return;
1673
+ const operator = registry.reconcileOperator(field.id, prev.operator);
1674
+ onChange(setRuleInGroup(compound, groupIndex, ruleIndex, {
1675
+ fieldId: nextFieldId,
1676
+ operator,
1677
+ value: draftValueFor(field, operator)
1678
+ }));
1679
+ }, [
1680
+ compound,
1681
+ onChange,
1682
+ registry
1683
+ ]);
1684
+ const handleOperatorChange = (0, react.useCallback)((groupIndex, ruleIndex, nextOperator) => {
1685
+ const prev = compound.groups[groupIndex]?.rules[ruleIndex];
1686
+ if (!prev) return;
1687
+ onChange(setRuleInGroup(compound, groupIndex, ruleIndex, {
1688
+ fieldId: prev.fieldId,
1689
+ operator: nextOperator,
1690
+ value: isValuelessOperator(nextOperator) ? null : prev.value
1691
+ }));
1692
+ }, [compound, onChange]);
1693
+ const handleValueChange = (0, react.useCallback)((groupIndex, ruleIndex, nextValue) => {
1694
+ const prev = compound.groups[groupIndex]?.rules[ruleIndex];
1695
+ if (!prev) return;
1696
+ onChange(setRuleInGroup(compound, groupIndex, ruleIndex, {
1697
+ fieldId: prev.fieldId,
1698
+ operator: prev.operator,
1699
+ value: nextValue
1700
+ }));
1701
+ }, [compound, onChange]);
1702
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_react_popover.Root, {
1703
+ open: isOpen,
1704
+ onOpenChange: handleOpenChange,
1705
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_popover.Trigger, {
1706
+ asChild: true,
1707
+ children: trigger
1708
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_popover.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverContent, {
1709
+ align: "start",
1710
+ sideOffset: 8,
1711
+ collisionPadding: 8,
1712
+ role: "dialog",
1713
+ "aria-label": "Advanced filter rules",
1714
+ id: baseId,
1715
+ ref: popoverContentRef,
1716
+ tabIndex: -1,
1717
+ onKeyDown: (event) => {
1718
+ if (event.key !== "Enter") return;
1719
+ if (selectedRowKey != null) {
1720
+ event.preventDefault();
1721
+ closeSelectedRow();
1722
+ requestAnimationFrame(() => {
1723
+ popoverContentRef.current?.focus();
1724
+ });
1725
+ return;
1726
+ }
1727
+ if (event.target !== popoverContentRef.current) return;
1728
+ event.preventDefault();
1729
+ handleOpenChange(false);
1730
+ },
1731
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(PopoverCard, {
1732
+ elevated: true,
1733
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Header, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Paragraph, {
1734
+ size: resolvedSize,
1735
+ color: "secondary",
1736
+ children: "Advanced filter rules"
1737
+ }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Body, { children: [groupsForRender(compound).map((group, groupIndex, renderableGroups) => {
1738
+ const groupTitle = groupIndex === 0 ? "If" : "Or";
1739
+ const isSynthetic = group.synthetic;
1740
+ const isOnlyGroup = renderableGroups.length === 1;
1741
+ const isEmptyGroup = group.rules.length === 0;
1742
+ const hideGroupMenu = isOnlyGroup && isEmptyGroup;
1743
+ const deleteGroupLabel = isOnlyGroup && !isEmptyGroup ? "Clear all" : "Delete group";
1744
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Fragment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(GroupCard, {
1745
+ "data-test": `advanced-filter-rules__group-${groupIndex}`,
1746
+ role: "group",
1747
+ "aria-label": `Filter group ${groupIndex + 1}`,
1748
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(GroupHeader, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupTitle, {
1749
+ $size: resolvedSize,
1750
+ children: groupTitle
1751
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(GroupHeaderActions, { children: [hideGroupMenu ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DropdownMenu.DropdownMenu_default, {
1752
+ trigger: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconButton.IconButton, {
1753
+ size: subtleIconSize,
1754
+ "aria-label": `More actions for filter group ${groupIndex + 1}`,
1755
+ "data-test": `advanced-filter-rules__group-more-${groupIndex}`,
1756
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons_12px.MoreIcon, {})
1757
+ }),
1758
+ align: "end",
1759
+ portal: true,
1760
+ zIndex: require_lib_zindex.Z_INDICES.modalDropdown,
1761
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DropdownMenu.DropdownMenu_default.Item, {
1762
+ size: resolvedSize,
1763
+ onClick: () => {
1764
+ if (isSynthetic) {
1765
+ handleOpenChange(false);
1766
+ return;
1767
+ }
1768
+ applyCompoundChange({ groups: compound.groups.filter((_, i) => i !== groupIndex) });
1769
+ },
1770
+ "data-test": `advanced-filter-rules__delete-group-${groupIndex}`,
1771
+ children: deleteGroupLabel
1772
+ })
1773
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconButton.IconButton, {
1774
+ size: subtleIconSize,
1775
+ onClick: () => handleAddRuleToGroup(groupIndex),
1776
+ "aria-label": `Add rule to filter group ${groupIndex + 1}`,
1777
+ "data-test": `advanced-filter-rules__add-rule-${groupIndex}`,
1778
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons_12px.PlusIcon, {})
1779
+ })] })] }), group.rules.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Paragraph, {
1780
+ size: resolvedSize,
1781
+ color: "secondary",
1782
+ style: { padding: _persona_design_tokens.Spacing[2] },
1783
+ children: "No rules yet"
1784
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RulesListBox, {
1785
+ "aria-label": `Rules in group ${groupIndex + 1}`,
1786
+ selectionMode: "single",
1787
+ size: resolvedSize,
1788
+ fullWidth: true,
1789
+ selectedKeys: selectedKeysForGroup(groupIndex),
1790
+ onSelectionChange: handleGroupSelectionChange,
1791
+ children: group.rules.map((rule, ruleIndex) => {
1792
+ const rowId = `${groupIndex}-${ruleIndex}`;
1793
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AdvancedFilterRuleRow, {
1794
+ registry,
1795
+ groupIndex,
1796
+ ruleIndex,
1797
+ rule,
1798
+ size: resolvedSize,
1799
+ isOpen: selectedRowKey === rowId,
1800
+ onClose: closeSelectedRow,
1801
+ onDelete: () => handleRemoveRule(groupIndex, ruleIndex),
1802
+ onFieldChange: handleFieldChange,
1803
+ onOperatorChange: handleOperatorChange,
1804
+ onValueChange: handleValueChange,
1805
+ renderValueControl
1806
+ }, rowId);
1807
+ })
1808
+ })]
1809
+ }) }, `${baseId}__group-${groupIndex}`);
1810
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OrGroupRow, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconButton.Button, {
1811
+ variant: "basic",
1812
+ size: resolvedSize,
1813
+ width: "auto",
1814
+ prefixIcon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.PlusIcon, {}),
1815
+ onClick: handleAddOrGroup,
1816
+ "data-test": "advanced-filter-rules__add-or-group",
1817
+ children: "Or group"
1818
+ }) })] })]
1819
+ })
1820
+ }) })]
1821
+ });
1822
+ };
1823
+ //#endregion
1824
+ //#region components/DataTable/TableControls/FiltersV2/value-controls/ArrayValueControl/ArrayValueControl.tsx
1825
+ const stringDisplayValue = (value) => {
1826
+ if (typeof value === "string") return value;
1827
+ if (typeof value === "number" && Number.isFinite(value)) return String(value);
1828
+ return "";
1829
+ };
1830
+ const stringValue = (value) => {
1831
+ if (typeof value === "string" && value !== "") return value;
1832
+ if (typeof value === "number" && Number.isFinite(value)) return String(value);
1833
+ return null;
1834
+ };
1835
+ /**
1836
+ * Array-typed value control for the Filter UI v2 popover.
1837
+ *
1838
+ * Used for `array` fields with operators `contains` / `does_not_contain`.
1839
+ * The popover renders nothing when the operator is valueless
1840
+ * (`is_empty` / `is_not_empty`).
1841
+ *
1842
+ * The rendered control depends on the inner item type advertised by the
1843
+ * field's `itemType`:
1844
+ *
1845
+ * - `'choices'` → single-select Combobox sourced from `field.options`.
1846
+ * - `'string'` or unset → free-text input (a single value to test for
1847
+ * membership against the array column).
1848
+ *
1849
+ * Output value is always a single string; an empty text input emits `''`, not
1850
+ * `null`, because the pill lifecycle reads a `null` value on a value-requiring
1851
+ * operator as a removal and drops the pill. `''` keeps the pill as a visible
1852
+ * draft; the serialize boundary is what filters incomplete values out of the
1853
+ * request. The predicate is "does this array contain (or not contain) this
1854
+ * scalar?", so we never produce an array-of-values from this control.
1855
+ */
1856
+ const ArrayValueControl = ({ field, operator, value, onChange, onCommit, ariaLabel, layout = "popover" }) => {
1857
+ const size = useFilterBarSize();
1858
+ const [localValue, setLocalValue] = (0, react.useState)(() => stringDisplayValue(value));
1859
+ (0, react.useEffect)(() => {
1860
+ setLocalValue(stringDisplayValue(value));
1861
+ }, [value]);
1862
+ const handleTextChange = (0, react.useCallback)((raw) => {
1863
+ setLocalValue(raw);
1864
+ onChange(raw);
1865
+ }, [onChange]);
1866
+ const handleComboboxChange = (0, react.useCallback)((next) => {
1867
+ onChange(next ?? null);
1868
+ onCommit?.();
1869
+ }, [onChange, onCommit]);
1870
+ if (isValuelessOperator(operator)) return null;
1871
+ const label = ariaLabel ?? `${field.label} value`;
1872
+ if ((field.itemType ?? "string") === "choices") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Combobox.Combobox, {
1873
+ "aria-label": label,
1874
+ options: (field.options ?? []).map((opt) => ({
1875
+ label: opt.label,
1876
+ value: opt.value
1877
+ })),
1878
+ value: stringValue(value),
1879
+ onChange: handleComboboxChange,
1880
+ placeholder: "Select an option",
1881
+ size,
1882
+ embedded: layout === "popover"
1883
+ });
1884
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Input_index.default, {
1885
+ type: "text",
1886
+ size,
1887
+ placeholder: "Enter a value",
1888
+ "aria-label": label,
1889
+ value: localValue,
1890
+ onChange: (e) => handleTextChange(e.target.value)
1891
+ });
1892
+ };
1893
+ //#endregion
1894
+ //#region components/DataTable/TableControls/FiltersV2/value-controls/BooleanValueControl/BooleanValueControl.tsx
1895
+ const OPTIONS = [{
1896
+ label: "True",
1897
+ value: true
1898
+ }, {
1899
+ label: "False",
1900
+ value: false
1901
+ }];
1902
+ const Row = styled_components$1.default.button`
1903
+ ${_persona_design_tokens.Typography.TextSmall};
1904
+ display: flex;
1905
+ align-items: center;
1906
+ justify-content: space-between;
1907
+ box-sizing: border-box;
1908
+ width: 100%;
1909
+ margin: 0;
1910
+ padding: ${_persona_design_tokens.Spacing[1]} ${_persona_design_tokens.Spacing[2]};
1911
+ border: none;
1912
+ appearance: none;
1913
+ border-radius: ${_persona_design_tokens.BorderRadius.Sm};
1914
+ background: ${({ $selected }) => $selected ? _persona_design_tokens.Color.CorePurple100 : "transparent"};
1915
+ color: ${({ $selected }) => $selected ? _persona_design_tokens.Color.TextActive : _persona_design_tokens.Color.TextPrimary};
1916
+ font-family: inherit;
1917
+ text-align: left;
1918
+ cursor: pointer;
1919
+
1920
+ &:hover {
1921
+ background: ${({ $selected }) => $selected ? _persona_design_tokens.Color.CorePurple100 : _persona_design_tokens.Color.BackgroundSecondary};
1922
+ }
1923
+
1924
+ &:focus-visible {
1925
+ outline: 2px solid ${_persona_design_tokens.Color.BorderFocus};
1926
+ outline-offset: 1px;
1927
+ }
1928
+
1929
+ svg {
1930
+ flex-shrink: 0;
1931
+ color: inherit;
1932
+ }
1933
+ `;
1934
+ const Root = styled_components$1.default.div`
1935
+ display: flex;
1936
+ flex-direction: column;
1937
+ gap: ${_persona_design_tokens.Spacing[0]};
1938
+ `;
1939
+ /**
1940
+ * Filter UI v2 — boolean value picker for `boolean`-typed fields with `is` /
1941
+ * `is_not` operators. Renders two rows (True / False); the selected row uses
1942
+ * the same purple treatment as other filter value selections. Renders nothing
1943
+ * for valueless operators (`is_empty`, `is_not_empty`).
1944
+ */
1945
+ function BooleanValueControl({ operator, value, onChange, ariaLabel }) {
1946
+ if (isValuelessOperator(operator)) return null;
1947
+ const selected = typeof value === "boolean" ? value : null;
1948
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Root, {
1949
+ role: "radiogroup",
1950
+ "aria-label": ariaLabel ?? "Boolean value",
1951
+ children: OPTIONS.map((opt) => {
1952
+ const isSelected = selected === opt.value;
1953
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Row, {
1954
+ type: "button",
1955
+ role: "radio",
1956
+ "aria-checked": isSelected,
1957
+ $selected: isSelected,
1958
+ onClick: () => onChange(opt.value),
1959
+ children: [opt.label, isSelected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.CheckIcon, { "aria-hidden": true }) : null]
1960
+ }, String(opt.value));
1961
+ })
1962
+ });
1963
+ }
1964
+ //#endregion
1965
+ //#region components/DataTable/TableControls/FiltersV2/value-controls/ChoicesValueControl/ChoicesValueControl.tsx
1966
+ const EMPTY_OPTIONS = [];
1967
+ const EMPTY_VALUES = [];
1968
+ /**
1969
+ * Filter UI v2 — value control for `choices` / `multi_choices`-typed fields.
1970
+ *
1971
+ * Backed by the design-system `Combobox`. In single-select mode the value is a
1972
+ * string; in `multiple` mode it is an array of strings. Options come from
1973
+ * `field.options` (populated by `FieldRegistry` from the backend's
1974
+ * `field_key_to_info` payload). Renders nothing when the active operator is
1975
+ * valueless (e.g. `is_empty`).
1976
+ */
1977
+ function ChoicesValueControl({ field, operator, value, onChange, onCommit, ariaLabel, trigger, layout = "popover", multiple = false }) {
1978
+ const generatedId = (0, react.useMemo)(() => (0, lodash.uniqueId)(multiple ? "filter_v2_multi_choices_" : "filter_v2_choices_"), [multiple]);
1979
+ const size = useFilterBarSize();
1980
+ const options = field.options ?? EMPTY_OPTIONS;
1981
+ const values = (0, react.useMemo)(() => Array.isArray(value) ? [...value] : EMPTY_VALUES, [value]);
1982
+ if (isValuelessOperator(operator)) return null;
1983
+ const useEmbeddedCombobox = layout === "popover" && trigger == null;
1984
+ if (multiple) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Combobox.Combobox, {
1985
+ id: generatedId,
1986
+ size,
1987
+ "aria-label": ariaLabel ?? field.label,
1988
+ placeholder: field.label,
1989
+ searchPlaceholder: "Search",
1990
+ emptyStateMessage: "No matches",
1991
+ options,
1992
+ values,
1993
+ trigger,
1994
+ onValuesChange: onChange,
1995
+ embedded: useEmbeddedCombobox,
1996
+ multiple: true,
1997
+ truncate: true,
1998
+ stableOptionOrder: true
1999
+ });
2000
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Combobox.Combobox, {
2001
+ id: generatedId,
2002
+ size,
2003
+ "aria-label": ariaLabel ?? field.label,
2004
+ placeholder: field.label,
2005
+ options,
2006
+ value: typeof value === "string" ? value : null,
2007
+ trigger,
2008
+ onChange: (next) => {
2009
+ onChange(next ?? null);
2010
+ onCommit?.();
2011
+ },
2012
+ embedded: useEmbeddedCombobox
2013
+ });
2014
+ }
2015
+ //#endregion
2016
+ //#region components/DataTable/TableControls/FiltersV2/value-controls/DateValueControl/DateValueControl.tsx
2017
+ const parseIsoDate = (value) => {
2018
+ if (typeof value !== "string") return null;
2019
+ try {
2020
+ return (0, _internationalized_date.parseDate)(value);
2021
+ } catch {
2022
+ return null;
2023
+ }
2024
+ };
2025
+ /**
2026
+ * Single-date value control for the Filter UI v2 popover.
2027
+ *
2028
+ * Used for `date` fields with operators `is` / `before` / `after`. The
2029
+ * popover renders nothing when the selected operator is valueless
2030
+ * (`is_empty` / `is_not_empty`) — those operators are themselves the
2031
+ * predicate and need no companion value.
2032
+ *
2033
+ * Output value is always a `YYYY-MM-DD` ISO date string (or `null` when
2034
+ * cleared).
2035
+ */
2036
+ const DateValueControl = ({ field, operator, value, onChange, ariaLabel }) => {
2037
+ const size = useFilterBarSize();
2038
+ const handleChange = (0, react.useCallback)((nextDate) => {
2039
+ onChange(nextDate ? nextDate.toString() : null);
2040
+ }, [onChange]);
2041
+ if (isValuelessOperator(operator)) return null;
2042
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DatePicker.DatePicker, {
2043
+ value: parseIsoDate(value),
2044
+ size,
2045
+ "aria-label": ariaLabel ?? `${field.label} value`,
2046
+ onChange: handleChange,
2047
+ useModalZIndex: true
2048
+ });
2049
+ };
2050
+ //#endregion
2051
+ //#region components/DataTable/TableControls/FiltersV2/value-controls/utils.ts
2052
+ /**
2053
+ * Coerce a `FilterRuleValue` into a string suitable for an `<input>`'s
2054
+ * `value` prop. Used by `IntegerValueControl` and `FloatValueControl` so
2055
+ * both share identical display-coercion semantics — without this, drift
2056
+ * (e.g. different handling of `''`) would let the two controls disagree
2057
+ * about how to render the same hydrated rule.
2058
+ *
2059
+ * `Number.isFinite` rules out `NaN` / `±Infinity` (a hydrated state that
2060
+ * round-tripped through JSON should never carry those, but the guard is
2061
+ * cheap defense). Empty strings collapse to `''` rather than falling
2062
+ * through to `'undefined'` / `'null'` if the rule arrives in a malformed
2063
+ * shape.
2064
+ */
2065
+ function numericDisplayValue(value) {
2066
+ if (typeof value === "number" && Number.isFinite(value)) return String(value);
2067
+ if (typeof value === "string" && value !== "") return value;
2068
+ return "";
2069
+ }
2070
+ //#endregion
2071
+ //#region components/DataTable/TableControls/FiltersV2/value-controls/FloatValueControl/FloatValueControl.tsx
2072
+ /**
2073
+ * Float-typed value control for the Filter UI v2 popover.
2074
+ *
2075
+ * Used for `float` fields with operators `is` / `is_not`. The popover
2076
+ * renders nothing when the operator is valueless (`is_empty` /
2077
+ * `is_not_empty`). Range operators are not part of the current numeric
2078
+ * field vocabulary.
2079
+ *
2080
+ * The control accepts decimal input and emits a `number` via `onChange`.
2081
+ * We keep local display state as a string so partial input like `"3."` is
2082
+ * preserved while the user types; the emitted numeric value is only updated
2083
+ * once the input parses to a finite number.
2084
+ *
2085
+ * `isFocused` ref guards the external-value sync effect: typing a
2086
+ * mid-decimal value like `"3."` parses to `3` and emits it, which
2087
+ * round-trips back through the controlled `value` prop. Without the
2088
+ * guard, the sync effect would rewrite the display from `"3."` to
2089
+ * `"3"` and the next keystroke (`"7"`) would land at the wrong cursor
2090
+ * position. The blur handler resyncs the display so any half-typed
2091
+ * string that never parsed (`"-"`, `"."`) renders as whatever the
2092
+ * rule actually carries when focus leaves.
2093
+ *
2094
+ * `onChange` is debounced (300ms) to avoid committing on every keystroke;
2095
+ * the debounce flushes on blur and on unmount so no pending value is lost.
2096
+ */
2097
+ const FloatValueControl = ({ field, operator, value, onChange, ariaLabel }) => {
2098
+ const size = useFilterBarSize();
2099
+ const [localValue, setLocalValue] = (0, react.useState)(() => numericDisplayValue(value));
2100
+ const isFocusedRef = (0, react.useRef)(false);
2101
+ const debouncedOnChange = (0, react.useMemo)(() => (0, lodash_fp_js.debounce)(300, onChange), [onChange]);
2102
+ (0, react.useEffect)(() => {
2103
+ const cancelPendingChange = () => {
2104
+ debouncedOnChange.cancel();
2105
+ };
2106
+ return cancelPendingChange;
2107
+ }, [debouncedOnChange]);
2108
+ (0, react.useEffect)(() => {
2109
+ if (isFocusedRef.current) return;
2110
+ setLocalValue(numericDisplayValue(value));
2111
+ }, [value]);
2112
+ const handleChange = (0, react.useCallback)((raw) => {
2113
+ setLocalValue(raw);
2114
+ if (raw === "" || raw === "-" || raw === ".") {
2115
+ debouncedOnChange(null);
2116
+ return;
2117
+ }
2118
+ const parsed = Number(raw);
2119
+ if (!Number.isFinite(parsed)) return;
2120
+ debouncedOnChange(parsed);
2121
+ }, [debouncedOnChange]);
2122
+ if (isValuelessOperator(operator)) return null;
2123
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Input_index.default, {
2124
+ type: "number",
2125
+ size,
2126
+ step: "any",
2127
+ inputMode: "decimal",
2128
+ placeholder: "Enter a number",
2129
+ "aria-label": ariaLabel ?? `${field.label} value`,
2130
+ value: localValue,
2131
+ onChange: (e) => handleChange(e.target.value),
2132
+ onFocus: () => {
2133
+ isFocusedRef.current = true;
2134
+ },
2135
+ onBlur: () => {
2136
+ isFocusedRef.current = false;
2137
+ debouncedOnChange.flush();
2138
+ setLocalValue(numericDisplayValue(value));
2139
+ }
2140
+ });
2141
+ };
2142
+ //#endregion
2143
+ //#region components/DataTable/TableControls/FiltersV2/value-controls/IntegerValueControl/IntegerValueControl.tsx
2144
+ /**
2145
+ * Integer-typed value control for the Filter UI v2 popover.
2146
+ *
2147
+ * Used for `integer` fields with operators `is` / `is_not`. The popover
2148
+ * renders nothing when the operator is valueless (`is_empty` /
2149
+ * `is_not_empty`). Range operators are not part of the current numeric
2150
+ * field vocabulary.
2151
+ *
2152
+ * The control accepts any numeric input but always emits an integer via
2153
+ * `onChange`. We truncate (rather than round) so that typing `3` -> `3.` -> `3.7`
2154
+ * does not jump to `4` mid-typing; the wire-format value follows `parseInt`
2155
+ * semantics, matching common backend integer-coercion behavior.
2156
+ *
2157
+ * `isFocused` ref guards the external-value sync effect: while the user
2158
+ * is actively typing, an external value change (which we ourselves
2159
+ * triggered by emitting `onChange`) must NOT clobber the local display
2160
+ * string. Without this guard, typing `3` -> emits `3` -> external value
2161
+ * becomes `3` -> the sync effect resets local back to `'3'`, which
2162
+ * looks fine until you type `-` to clear and the sync races against
2163
+ * the user's next keystroke.
2164
+ *
2165
+ * `onChange` is debounced (300ms) to avoid committing on every keystroke;
2166
+ * the debounce flushes on blur and on unmount so no pending value is lost.
2167
+ */
2168
+ const IntegerValueControl = ({ field, operator, value, onChange, ariaLabel }) => {
2169
+ const size = useFilterBarSize();
2170
+ const [localValue, setLocalValue] = (0, react.useState)(() => numericDisplayValue(value));
2171
+ const isFocusedRef = (0, react.useRef)(false);
2172
+ const debouncedOnChange = (0, react.useMemo)(() => (0, lodash_fp_js.debounce)(300, onChange), [onChange]);
2173
+ (0, react.useEffect)(() => {
2174
+ const cancelPendingChange = () => {
2175
+ debouncedOnChange.cancel();
2176
+ };
2177
+ return cancelPendingChange;
2178
+ }, [debouncedOnChange]);
2179
+ (0, react.useEffect)(() => {
2180
+ if (isFocusedRef.current) return;
2181
+ setLocalValue(numericDisplayValue(value));
2182
+ }, [value]);
2183
+ const handleChange = (0, react.useCallback)((raw) => {
2184
+ setLocalValue(raw);
2185
+ if (raw === "" || raw === "-") {
2186
+ debouncedOnChange(null);
2187
+ return;
2188
+ }
2189
+ const parsed = Number(raw);
2190
+ if (!Number.isFinite(parsed)) return;
2191
+ debouncedOnChange(Math.trunc(parsed));
2192
+ }, [debouncedOnChange]);
2193
+ if (isValuelessOperator(operator)) return null;
2194
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Input_index.default, {
2195
+ type: "number",
2196
+ size,
2197
+ step: 1,
2198
+ inputMode: "numeric",
2199
+ placeholder: "Enter a number",
2200
+ "aria-label": ariaLabel ?? `${field.label} value`,
2201
+ value: localValue,
2202
+ onChange: (e) => handleChange(e.target.value),
2203
+ onFocus: () => {
2204
+ isFocusedRef.current = true;
2205
+ },
2206
+ onBlur: () => {
2207
+ isFocusedRef.current = false;
2208
+ debouncedOnChange.flush();
2209
+ setLocalValue(numericDisplayValue(value));
2210
+ }
2211
+ });
2212
+ };
2213
+ //#endregion
2214
+ //#region components/DataTable/TableControls/FiltersV2/value-controls/StringValueControl/StringValueControl.tsx
2215
+ const DEBOUNCE_MS = 300;
2216
+ function StringValueControl({ field, operator, value, onChange, ariaLabel, inputType, placeholder, id }) {
2217
+ const generatedId = (0, react.useMemo)(() => (0, lodash.uniqueId)("filter_v2_string_"), []);
2218
+ const inputId = id ?? generatedId;
2219
+ const resolvedInputType = inputType ?? (field.type === "email" ? "email" : "text");
2220
+ const size = useFilterBarSize();
2221
+ const [localValue, setLocalValue] = (0, react.useState)(typeof value === "string" ? value : "");
2222
+ const debouncedOnChange = (0, react.useMemo)(() => (0, lodash_fp_js.debounce)(DEBOUNCE_MS, onChange), [onChange]);
2223
+ (0, react.useEffect)(() => () => {
2224
+ debouncedOnChange.cancel();
2225
+ }, [debouncedOnChange]);
2226
+ (0, react.useEffect)(() => {
2227
+ setLocalValue(typeof value === "string" ? value : "");
2228
+ }, [value]);
2229
+ if (isValuelessOperator(operator)) return null;
2230
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Input_index.default, {
2231
+ id: inputId,
2232
+ type: resolvedInputType,
2233
+ size,
2234
+ placeholder: placeholder ?? field.label,
2235
+ "aria-label": ariaLabel ?? field.label,
2236
+ value: localValue,
2237
+ onChange: ({ target }) => {
2238
+ setLocalValue(target.value);
2239
+ debouncedOnChange(target.value);
2240
+ },
2241
+ onBlur: () => {
2242
+ debouncedOnChange.flush();
2243
+ },
2244
+ onKeyDown: (event) => {
2245
+ if (event.key === "Enter") debouncedOnChange.flush();
2246
+ }
2247
+ });
2248
+ }
2249
+ //#endregion
2250
+ //#region components/DataTable/TableControls/FiltersV2/FilterBar/value-control-resolver.tsx
2251
+ const RESOLVERS = {
2252
+ string: (opts) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringValueControl, { ...opts }),
2253
+ email: (opts) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StringValueControl, { ...opts }),
2254
+ choices: (opts) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChoicesValueControl, { ...opts }),
2255
+ multi_choices: (opts) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChoicesValueControl, {
2256
+ multiple: true,
2257
+ ...opts
2258
+ }),
2259
+ boolean: (opts) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BooleanValueControl, { ...opts }),
2260
+ date: (opts) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DateValueControl, { ...opts }),
2261
+ integer: (opts) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IntegerValueControl, { ...opts }),
2262
+ float: (opts) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FloatValueControl, { ...opts }),
2263
+ array: (opts) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ArrayValueControl, { ...opts })
2264
+ };
2265
+ function resolveValueControl(opts, hostResolver) {
2266
+ const hostControl = hostResolver?.(opts);
2267
+ if (hostControl != null) return hostControl;
2268
+ const renderer = RESOLVERS[opts.field.type];
2269
+ if (!renderer) return null;
2270
+ return renderer(opts);
2271
+ }
2272
+ //#endregion
2273
+ //#region components/DataTable/TableControls/FiltersV2/FilterPickerMenu/FilterPickerMenu.tsx
2274
+ const TriggerWrapper = styled_components$1.default.span`
2275
+ display: inline-flex;
2276
+
2277
+ & button {
2278
+ background-color: transparent;
2279
+ color: ${({ theme }) => theme.color.text.secondary};
2280
+ }
2281
+
2282
+ & button:hover,
2283
+ & button:active {
2284
+ background-color: transparent;
2285
+ color: ${({ theme }) => theme.color.text.primary};
2286
+ }
2287
+
2288
+ ${({ $isOpen, theme }) => $isOpen && styled_components$1.css`
2289
+ & button {
2290
+ background-color: transparent;
2291
+ color: ${theme.color.text.primary};
2292
+ }
2293
+ `}
2294
+ `;
2295
+ const FilterPickerMenu = ({ registry, onPickField, triggerLabel = "Filter", compact = false, disabled = false, visibleCustomFieldParents, excludeFieldIds, size, ...rest }) => {
2296
+ const resolvedSize = useFilterBarSize(size);
2297
+ const unfilteredOptions = (0, react.useMemo)(() => buildFieldPickerOptions(registry, visibleCustomFieldParents), [registry, visibleCustomFieldParents]);
2298
+ const options = (0, react.useMemo)(() => excludeFieldIds == null || excludeFieldIds.length === 0 ? unfilteredOptions : buildFieldPickerOptions(registry, visibleCustomFieldParents, excludeFieldIds), [
2299
+ registry,
2300
+ visibleCustomFieldParents,
2301
+ excludeFieldIds,
2302
+ unfilteredOptions
2303
+ ]);
2304
+ const handleChange = (0, react.useCallback)((value) => {
2305
+ if (value == null) return;
2306
+ const field = registry.get(value);
2307
+ if (!field) return;
2308
+ onPickField(field);
2309
+ }, [registry, onPickField]);
2310
+ if (options.length === 0 && unfilteredOptions.length > 0) return null;
2311
+ const trigger = compact ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconButton.IconButton, {
2312
+ size: resolvedSize,
2313
+ disabled,
2314
+ "aria-label": triggerLabel,
2315
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.CirclePlusIcon, {})
2316
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconButton.Button, {
2317
+ variant: "text",
2318
+ size: resolvedSize,
2319
+ width: "auto",
2320
+ prefixIcon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_persona_icons.CirclePlusIcon, {}),
2321
+ disabled,
2322
+ children: triggerLabel
2323
+ });
2324
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TriggerWrapper, {
2325
+ ...rest,
2326
+ $isOpen: false,
2327
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Combobox.Combobox, {
2328
+ options,
2329
+ value: null,
2330
+ onChange: handleChange,
2331
+ size: resolvedSize,
2332
+ "aria-label": "Filter field picker",
2333
+ trigger
2334
+ })
2335
+ });
2336
+ };
2337
+ //#endregion
2338
+ //#region components/DataTable/TableControls/FiltersV2/PillShell/PillShell.tsx
2339
+ const PillRoot = styled_components.default.span`
2340
+ display: inline-flex;
2341
+ align-items: center;
2342
+ height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].controlHeight};
2343
+ padding: 0 ${_persona_design_tokens.Spacing[1]} 0 ${_persona_design_tokens.Spacing[2]};
2344
+ gap: 2px;
2345
+ border-radius: ${_persona_design_tokens.BorderRadius.Md};
2346
+ ${({ $size }) => $size === "sm" ? _persona_design_tokens.Typography.TextSmall : _persona_design_tokens.Typography.TextMedium};
2347
+ line-height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].lineHeight};
2348
+ max-width: 100%;
2349
+ cursor: pointer;
2350
+ user-select: none;
2351
+ transition: background-color ${"150ms"} ease-out;
2352
+
2353
+ /* Keyboard focus lands on the inner body button, so the visible focus
2354
+ ring is drawn on the whole pill via :focus-within. */
2355
+ ${require_mixins_focus.focusWithinOutline};
2356
+
2357
+ ${({ $variant }) => $variant === "active" ? styled_components.css`
2358
+ background-color: ${_persona_design_tokens.Color.CorePurple100};
2359
+ color: ${_persona_design_tokens.Color.TextActive};
2360
+ ` : styled_components.css`
2361
+ background-color: ${_persona_design_tokens.Color.BackgroundSecondary};
2362
+ color: ${_persona_design_tokens.Color.TextPrimary};
2363
+
2364
+ &:hover {
2365
+ background-color: ${_persona_design_tokens.Color.BackgroundLabelGrey};
2366
+ }
2367
+ `}
2368
+ `;
2369
+ /**
2370
+ * The clickable body of the pill. Suppresses its own focus outline
2371
+ * (the parent `PillRoot` carries the visible focus ring via
2372
+ * `:focus-within`) and is otherwise a transparent wrapper that
2373
+ * inherits the pill's typography + color.
2374
+ */
2375
+ const PillBody = styled_components.default.button`
2376
+ display: inline-flex;
2377
+ align-items: center;
2378
+ gap: ${_persona_design_tokens.Spacing[1]};
2379
+ height: 100%;
2380
+ background: transparent;
2381
+ border: 0;
2382
+ padding: 0;
2383
+ margin: 0;
2384
+ appearance: none;
2385
+ color: inherit;
2386
+ font: inherit;
2387
+ cursor: pointer;
2388
+ min-width: 0;
2389
+ max-width: 100%;
2390
+
2391
+ &:focus-visible {
2392
+ outline: none;
2393
+ }
2394
+
2395
+ ${PillRoot}:focus-within & {
2396
+ outline: none;
2397
+ }
2398
+ `;
2399
+ /**
2400
+ * Square slot containing the trailing caret or dismiss glyph. Slot
2401
+ * size scales with the pill (`sm` = 16x16 / 12px glyph; `md` = 20x20
2402
+ * / 16px glyph) so the visual weight stays proportional to the pill
2403
+ * height.
2404
+ */
2405
+ const actionSlotStyles = styled_components.css`
2406
+ display: inline-flex;
2407
+ align-items: center;
2408
+ justify-content: center;
2409
+ width: ${({ $size }) => $size === "sm" ? "16px" : "20px"};
2410
+ height: ${({ $size }) => $size === "sm" ? "16px" : "20px"};
2411
+ flex: 0 0 auto;
2412
+ border-radius: ${_persona_design_tokens.BorderRadius.Sm};
2413
+ color: inherit;
2414
+
2415
+ svg {
2416
+ width: ${({ $size }) => FILTER_SIZE_TOKENS[$size].iconSize};
2417
+ height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].iconSize};
2418
+ }
2419
+ `;
2420
+ const ActionSlot = styled_components.default.span`
2421
+ ${actionSlotStyles};
2422
+ `;
2423
+ const DismissibleCaretWrapper = (0, styled_components.default)(ActionSlot)`
2424
+ ${PillRoot}:hover &,
2425
+ ${PillRoot}[data-variant='active'] & {
2426
+ display: none;
2427
+ }
2428
+ `;
2429
+ const DismissButton = styled_components.default.button`
2430
+ ${actionSlotStyles};
2431
+ display: none; /* see :hover / [data-variant='active'] overrides below */
2432
+ padding: 0;
2433
+ margin: 0;
2434
+ border: 0;
2435
+ appearance: none;
2436
+ background: transparent;
2437
+ color: inherit;
2438
+ font: inherit;
2439
+ cursor: pointer;
2440
+
2441
+ &:hover {
2442
+ background-color: ${_persona_design_tokens.Color.BackgroundButtonTextHover};
2443
+ }
2444
+
2445
+ ${require_mixins_focus.focusOutline};
2446
+
2447
+ ${PillRoot}:hover &,
2448
+ ${PillRoot}[data-variant='active'] & {
2449
+ display: inline-flex;
2450
+ }
2451
+
2452
+ ${PillRoot}[data-variant='active'] &:hover {
2453
+ background-color: ${_persona_design_tokens.Color.CorePurple200};
2454
+ }
2455
+ `;
2456
+ const PillShell = (0, react.forwardRef)(function PillShell({ variant, children, bodyAriaLabel, onBodyClick, onDismiss, dismissAriaLabel, size, ...rest }, ref) {
2457
+ const ariaExpanded = rest["aria-expanded"];
2458
+ const resolvedSize = useFilterBarSize(size);
2459
+ const CaretIcon = resolvedSize === "sm" ? _persona_icons_12px.CaretDownIcon : _persona_icons.CaretDownIcon;
2460
+ const DismissIcon = resolvedSize === "sm" ? _persona_icons_12px.XIcon : _persona_icons.XIcon;
2461
+ const handleDismissClick = (event) => {
2462
+ event.stopPropagation();
2463
+ onDismiss?.();
2464
+ };
2465
+ const handleBodyKeyDown = (event) => {
2466
+ if (event.key === "Enter" || event.key === " ") event.stopPropagation();
2467
+ };
2468
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(PillRoot, {
2469
+ ref,
2470
+ $variant: variant,
2471
+ $size: resolvedSize,
2472
+ "data-variant": variant,
2473
+ onClick: onBodyClick,
2474
+ ...rest,
2475
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillBody, {
2476
+ type: "button",
2477
+ onKeyDown: handleBodyKeyDown,
2478
+ "aria-label": bodyAriaLabel,
2479
+ "aria-haspopup": "dialog",
2480
+ "aria-expanded": ariaExpanded,
2481
+ children
2482
+ }), onDismiss ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DismissibleCaretWrapper, {
2483
+ "aria-hidden": "true",
2484
+ $size: resolvedSize,
2485
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CaretIcon, {})
2486
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DismissButton, {
2487
+ $size: resolvedSize,
2488
+ type: "button",
2489
+ onClick: handleDismissClick,
2490
+ "aria-label": dismissAriaLabel,
2491
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DismissIcon, {})
2492
+ })] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActionSlot, {
2493
+ "aria-hidden": "true",
2494
+ $size: resolvedSize,
2495
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CaretIcon, {})
2496
+ })]
2497
+ });
2498
+ });
2499
+ //#endregion
2500
+ //#region components/DataTable/TableControls/FiltersV2/FilterPill/FilterPill.tsx
2501
+ const FieldLabel = styled_components$1.default.span`
2502
+ max-width: 120px;
2503
+ flex: 0 1 auto;
2504
+ `;
2505
+ const OperatorLabel = styled_components$1.default.span`
2506
+ color: inherit;
2507
+ white-space: nowrap;
2508
+ flex: 0 0 auto;
2509
+ `;
2510
+ const ValueChipGroup = styled_components$1.default.span`
2511
+ display: inline-flex;
2512
+ align-items: center;
2513
+ gap: 2px;
2514
+ flex: 0 1 auto;
2515
+ `;
2516
+ const ValueChip = styled_components$1.default.span`
2517
+ display: inline-flex;
2518
+ align-items: center;
2519
+ justify-content: center;
2520
+ height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].chipHeight};
2521
+ min-width: ${({ $size }) => FILTER_SIZE_TOKENS[$size].chipHeight};
2522
+ max-width: 120px;
2523
+ padding: 0 ${_persona_design_tokens.Spacing[1]};
2524
+ border-radius: 3px;
2525
+ font-size: ${({ $size }) => FILTER_SIZE_TOKENS[$size].fontSize};
2526
+ line-height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].lineHeight};
2527
+
2528
+ background-color: ${({ $variant }) => $variant === "active" ? _persona_design_tokens.Color.CorePurple200 : _persona_design_tokens.Color.CoreSlate200};
2529
+ color: ${({ $variant }) => $variant === "active" ? _persona_design_tokens.Color.TextActive : _persona_design_tokens.Color.TextPrimary};
2530
+ `;
2531
+ const OverflowChip = (0, styled_components$1.default)(ValueChip)`
2532
+ flex: 0 0 auto;
2533
+ `;
2534
+ const OverflowTooltipList = (0, styled_components$1.default)(require_Stack.Stack).attrs({
2535
+ as: "ul",
2536
+ spacing: _persona_design_tokens.Spacing[1]
2537
+ })`
2538
+ margin: 0;
2539
+ padding: 0;
2540
+ list-style: none;
2541
+
2542
+ & > li {
2543
+ margin: 0;
2544
+ padding: 0;
2545
+ }
2546
+ `;
2547
+ /**
2548
+ * Normalize a `FilterRuleValue` to a list of display strings, applying the
2549
+ * `optionLabels` lookup so the pill renders human-readable option labels
2550
+ * instead of raw option ids. Null / undefined collapses to an empty list.
2551
+ */
2552
+ function normalizeValueToDisplay(value, optionLabels) {
2553
+ if (value == null) return [];
2554
+ const lookup = (raw) => optionLabels?.[raw] ?? raw;
2555
+ if (Array.isArray(value)) {
2556
+ if (value.length > 0 && Array.isArray(value[0])) return [`${value.length} group${value.length === 1 ? "" : "s"}`];
2557
+ return value.map((entry) => lookup(String(entry)));
2558
+ }
2559
+ if (typeof value === "object") {
2560
+ const record = value;
2561
+ if (record.startDate && record.endDate) return [`${record.startDate} – ${record.endDate}`];
2562
+ if (record.startDate || record.endDate) return [record.startDate ?? record.endDate ?? ""];
2563
+ }
2564
+ if (typeof value === "boolean") return [value ? "True" : "False"];
2565
+ if (typeof value === "number") return [String(value)];
2566
+ return [lookup(value)];
2567
+ }
2568
+ /**
2569
+ * Accessible name builder used both for the pill body's `aria-label` and the
2570
+ * dismiss button's `aria-label`. We assemble a human sentence rather than
2571
+ * relying on child text nodes because the chip components don't always read
2572
+ * cleanly when concatenated by the AT.
2573
+ */
2574
+ function buildAccessibleName(field, rule, displayedValues) {
2575
+ if (rule == null) return field.label;
2576
+ if (!isValuelessOperator(rule.operator) && displayedValues.length === 0) return field.label;
2577
+ const operatorLabel = getOperatorLabel(rule.operator, field.type);
2578
+ if (isValuelessOperator(rule.operator)) return `${field.label} ${operatorLabel}`;
2579
+ return `${field.label} ${operatorLabel} ${displayedValues.join(", ")}`;
2580
+ }
2581
+ const FilterPill = (0, react.forwardRef)(function FilterPill({ field, rule, onClick, onDismiss, variant = "default", optionLabels, size, ...rest }, ref) {
2582
+ const reactId = (0, react.useMemo)(() => (0, lodash_fp_js.uniqueId)("filter-pill-"), []);
2583
+ const resolvedSize = useFilterBarSize(size);
2584
+ const displayedValues = (0, react.useMemo)(() => rule && !isValuelessOperator(rule.operator) ? normalizeValueToDisplay(rule.value, optionLabels) : [], [rule, optionLabels]);
2585
+ const accessibleName = buildAccessibleName(field, rule, displayedValues);
2586
+ const hasRule = rule != null;
2587
+ const isComplete = hasRule && (isValuelessOperator(rule.operator) || displayedValues.length > 0);
2588
+ const firstValue = displayedValues[0];
2589
+ const overflowValues = displayedValues.slice(1);
2590
+ const overflowTooltipId = `${reactId}-overflow`;
2591
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(PillShell, {
2592
+ ref,
2593
+ variant,
2594
+ size: resolvedSize,
2595
+ bodyAriaLabel: `Edit filter: ${accessibleName}`,
2596
+ onBodyClick: onClick,
2597
+ onDismiss,
2598
+ dismissAriaLabel: `Remove filter: ${accessibleName}`,
2599
+ ...rest,
2600
+ children: [
2601
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldLabel, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_TruncatedText.TruncatedText, { children: field.label }) }),
2602
+ isComplete && hasRule && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OperatorLabel, { children: getOperatorLabel(rule.operator, field.type) }),
2603
+ isComplete && hasRule && !isValuelessOperator(rule.operator) && firstValue != null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ValueChipGroup, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueChip, {
2604
+ $variant: variant,
2605
+ $size: resolvedSize,
2606
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_TruncatedText.TruncatedText, { children: firstValue })
2607
+ }), overflowValues.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Tooltip.Tooltip, {
2608
+ trigger: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OverflowChip, {
2609
+ $variant: variant,
2610
+ $size: resolvedSize,
2611
+ "aria-describedby": overflowTooltipId,
2612
+ children: `+${overflowValues.length}`
2613
+ }),
2614
+ side: "bottom",
2615
+ hideArrow: true,
2616
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(OverflowTooltipList, {
2617
+ id: overflowTooltipId,
2618
+ "aria-label": "Additional values",
2619
+ children: overflowValues.map((entry, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: entry }, `${entry}-${index}`))
2620
+ })
2621
+ })] })
2622
+ ]
2623
+ });
2624
+ });
2625
+ //#endregion
2626
+ //#region components/DataTable/TableControls/FiltersV2/FilterPopover/FilterPopover.tsx
2627
+ const PopoverPanel = (0, styled_components$1.default)(require_Stack.Stack).attrs({ spacing: _persona_design_tokens.Spacing[0] })`
2628
+ min-width: ${"196px"};
2629
+ max-width: ${"320px"};
2630
+ /* The design-system Popover.Card already supplies bg, border, shadow,
2631
+ and 6px corner radius — we just constrain the inner content. */
2632
+ `;
2633
+ const Main = (0, styled_components$1.default)(require_Stack.Stack).attrs({ spacing: _persona_design_tokens.Spacing[1] })`
2634
+ /* Valueless operators have no input below the header — symmetric padding
2635
+ keeps the popover tight. Valued operators keep extra bottom padding so
2636
+ the control's baseline has breathing room before the edge or footer. */
2637
+ padding: ${({ $valueless }) => $valueless ? _persona_design_tokens.Spacing[2] : `${_persona_design_tokens.Spacing[2]} ${_persona_design_tokens.Spacing[2]} ${_persona_design_tokens.Spacing[3]}`};
2638
+ `;
2639
+ const HeaderRow = (0, styled_components$1.default)(require_Stack.HStack).attrs({
2640
+ align: "center",
2641
+ spacing: _persona_design_tokens.Spacing[1]
2642
+ })`
2643
+ height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].lineHeight};
2644
+ padding: 0 ${_persona_design_tokens.Spacing[1]};
2645
+ font-size: ${({ $size }) => FILTER_SIZE_TOKENS[$size].fontSize};
2646
+ line-height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].lineHeight};
2647
+ color: ${_persona_design_tokens.Color.TextSecondary};
2648
+ white-space: nowrap;
2649
+ `;
2650
+ const FieldTypeLabel = styled_components$1.default.span`
2651
+ font-size: ${({ $size }) => FILTER_SIZE_TOKENS[$size].fontSize};
2652
+ line-height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].lineHeight};
2653
+ color: ${_persona_design_tokens.Color.TextSecondary};
2654
+ white-space: nowrap;
2655
+ flex: 0 1 auto;
2656
+ min-width: 0;
2657
+ `;
2658
+ /**
2659
+ * Inline operator picker — a text button (sized to the resolved
2660
+ * filter-bar size) with a trailing caret that opens a `DropdownMenu`
2661
+ * of operator options. Uses `DropdownMenu` rather than the design-system
2662
+ * `Select` so the menu auto-sizes to the longest operator label
2663
+ * (`is_not_empty` etc.) instead of inheriting the trigger's narrow
2664
+ * width, which clipped labels to "is e..." in the previous styling.
2665
+ */
2666
+ const InlineOperatorTrigger = styled_components$1.default.button`
2667
+ display: inline-flex;
2668
+ align-items: center;
2669
+ gap: 2px;
2670
+ height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].lineHeight};
2671
+ padding: 0 ${_persona_design_tokens.Spacing[1]};
2672
+ margin: 0;
2673
+ border: 0;
2674
+ border-radius: ${_persona_design_tokens.BorderRadius.Sm};
2675
+ appearance: none;
2676
+ background: transparent;
2677
+ color: ${_persona_design_tokens.Color.TextPrimary};
2678
+ font-family: inherit;
2679
+ font-size: ${({ $size }) => FILTER_SIZE_TOKENS[$size].fontSize};
2680
+ line-height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].lineHeight};
2681
+ cursor: pointer;
2682
+
2683
+ &:hover {
2684
+ background: ${_persona_design_tokens.Color.BackgroundSecondary};
2685
+ }
2686
+
2687
+ &[data-state='open'] {
2688
+ background: ${_persona_design_tokens.Color.BackgroundLabelGrey};
2689
+ }
2690
+
2691
+ &:focus-visible {
2692
+ outline: 2px solid ${_persona_design_tokens.Color.BorderFocus};
2693
+ outline-offset: 1px;
2694
+ }
2695
+
2696
+ svg {
2697
+ width: ${({ $size }) => FILTER_SIZE_TOKENS[$size].iconSize};
2698
+ height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].iconSize};
2699
+ flex-shrink: 0;
2700
+ }
2701
+ `;
2702
+ const ValueSlot = styled_components$1.default.div`
2703
+ padding: 0 ${_persona_design_tokens.Spacing[1]};
2704
+ `;
2705
+ const Footer = (0, styled_components$1.default)(require_Stack.HStack).attrs({
2706
+ align: "center",
2707
+ spacing: _persona_design_tokens.Spacing[1]
2708
+ })`
2709
+ padding: 6px ${_persona_design_tokens.Spacing[2]};
2710
+ border-top: 1px solid ${_persona_design_tokens.Color.BorderDivider};
2711
+ color: ${_persona_design_tokens.Color.TextSecondary};
2712
+ ${require_mixins_text.paragraphMixins.xs};
2713
+
2714
+ svg {
2715
+ flex-shrink: 0;
2716
+ }
2717
+ `;
2718
+ /**
2719
+ * The single-rule editor popover. Renders a Radix `Popover` anchored on
2720
+ * `trigger`, with a `Popover.Card` body that stacks:
2721
+ *
2722
+ * 1. Inline header — "[Field name] [operator ▾]" on one line.
2723
+ * 2. Parent-supplied value control.
2724
+ * 3. Custom-field footer (`ⓘ [label] is a field on [parentRecordType]`).
2725
+ *
2726
+ * The popover stays purely presentational. Rule state lives in the parent's
2727
+ * `useFilterStateV2()` hook; this component just routes operator changes
2728
+ * back through `onChangeOperator` and forwards open/close transitions
2729
+ * through Radix's controlled props.
2730
+ */
2731
+ const FilterPopover = ({ field, operator, onChangeOperator, valueControlSlot, onClose, trigger, open, onOpenChange, size }) => {
2732
+ const resolvedSize = useFilterBarSize(size);
2733
+ const valueless = isValuelessOperator(operator);
2734
+ const CaretIcon = resolvedSize === "sm" ? _persona_icons_12px.CaretDownIcon : _persona_icons.CaretDownIcon;
2735
+ const InfoIcon = resolvedSize === "sm" ? _persona_icons_12px.CircleInfoIcon : _persona_icons.CircleInfoIcon;
2736
+ const showOperatorSelector = fieldHasMultipleOperators(field);
2737
+ const operatorOptions = (0, react.useMemo)(() => getOperatorsForField(field), [field]);
2738
+ const handleOpenChange = (0, react.useCallback)((next) => {
2739
+ onOpenChange?.(next);
2740
+ if (!next) onClose();
2741
+ }, [onOpenChange, onClose]);
2742
+ const valueSlotRef = (0, react.useRef)(null);
2743
+ (0, react.useEffect)(() => {
2744
+ if (open !== true || valueless) return;
2745
+ const handle = requestAnimationFrame(() => {
2746
+ const root = valueSlotRef.current;
2747
+ if (!root) return;
2748
+ root.querySelector("input:not([disabled]), [contenteditable=\"true\"], [tabindex]:not([tabindex=\"-1\"])")?.focus();
2749
+ });
2750
+ return () => cancelAnimationFrame(handle);
2751
+ }, [
2752
+ open,
2753
+ field.id,
2754
+ valueless
2755
+ ]);
2756
+ const handleKeyDown = (event) => {
2757
+ if (event.key !== "Enter") return;
2758
+ const target = event.target;
2759
+ if (!target || target.tagName !== "INPUT") return;
2760
+ const input = target;
2761
+ if (input.type === "checkbox" || input.type === "radio") return;
2762
+ if (input.getAttribute("role") === "combobox") return;
2763
+ event.preventDefault();
2764
+ handleOpenChange(false);
2765
+ };
2766
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Popover.Popover_default, {
2767
+ open,
2768
+ onOpenChange: handleOpenChange,
2769
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Popover.Popover_default.Trigger, {
2770
+ asChild: true,
2771
+ children: trigger
2772
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Popover.Popover_default.Card, {
2773
+ align: "start",
2774
+ sideOffset: 4,
2775
+ "aria-label": `Edit filter for ${field.label}`,
2776
+ noPadding: true,
2777
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(PopoverPanel, {
2778
+ onKeyDown: handleKeyDown,
2779
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Main, {
2780
+ $valueless: valueless,
2781
+ "data-test": "filter-popover__main",
2782
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HeaderRow, {
2783
+ $size: resolvedSize,
2784
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldTypeLabel, {
2785
+ $size: resolvedSize,
2786
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_TruncatedText.TruncatedText, { children: field.label })
2787
+ }), showOperatorSelector ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DropdownMenu.DropdownMenu_default, {
2788
+ trigger: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(InlineOperatorTrigger, {
2789
+ type: "button",
2790
+ "aria-label": "Operator",
2791
+ $size: resolvedSize,
2792
+ children: [getOperatorLabel(operator, field.type), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CaretIcon, { "aria-hidden": "true" })]
2793
+ }),
2794
+ align: "start",
2795
+ portal: true,
2796
+ children: operatorOptions.map((op) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DropdownMenu.DropdownMenu_default.Item, {
2797
+ size: resolvedSize,
2798
+ onClick: () => onChangeOperator(op),
2799
+ children: getOperatorLabel(op, field.type)
2800
+ }, op))
2801
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: getOperatorLabel(operator, field.type) })]
2802
+ }), !valueless ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueSlot, {
2803
+ ref: valueSlotRef,
2804
+ children: valueControlSlot
2805
+ }) : null]
2806
+ }), field.source === "custom" && field.parentRecordType != null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Footer, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoIcon, { "aria-hidden": "true" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_lib_TruncatedText.TruncatedText, { children: [
2807
+ field.label,
2808
+ " is a field on ",
2809
+ field.parentRecordType
2810
+ ] })] })]
2811
+ })
2812
+ })]
2813
+ });
2814
+ };
2815
+ //#endregion
2816
+ //#region components/DataTable/TableControls/FiltersV2/RulesPill/RulesPill.tsx
2817
+ /**
2818
+ * Total rule count across every AndGroup in the compound expression.
2819
+ *
2820
+ * Empty groups contribute zero (they're pruned at adapter serialization time
2821
+ * anyway). The number drives the count chip's visibility.
2822
+ */
2823
+ function countRules(compound) {
2824
+ let n = 0;
2825
+ for (const group of compound.groups) n += group.rules.length;
2826
+ return n;
2827
+ }
2828
+ const Label = styled_components$1.default.span`
2829
+ flex: 0 0 auto;
2830
+ `;
2831
+ const CountChip = styled_components$1.default.span`
2832
+ display: inline-flex;
2833
+ align-items: center;
2834
+ justify-content: center;
2835
+ height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].chipHeight};
2836
+ min-width: ${({ $size }) => FILTER_SIZE_TOKENS[$size].chipHeight};
2837
+ padding: 0 ${_persona_design_tokens.Spacing[1]};
2838
+ border-radius: 3px;
2839
+ font-size: ${({ $size }) => FILTER_SIZE_TOKENS[$size].fontSize};
2840
+ line-height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].lineHeight};
2841
+ flex: 0 0 auto;
2842
+
2843
+ background-color: ${({ $variant }) => $variant === "active" ? _persona_design_tokens.Color.CorePurple200 : _persona_design_tokens.Color.CoreSlate200};
2844
+ color: ${({ $variant }) => $variant === "active" ? _persona_design_tokens.Color.TextActive : _persona_design_tokens.Color.TextPrimary};
2845
+ `;
2846
+ /**
2847
+ * Always-visible filter pill that owns the entire compound (DNF) expression.
2848
+ *
2849
+ * Composes `PillShell` for the rounded variant-aware container, the
2850
+ * `:focus-within` outline, and the trailing caret↔dismiss swap that's
2851
+ * identical to `FilterPill`. The pill-specific body content is just
2852
+ * the "Rules" label + an optional count chip.
2853
+ *
2854
+ * Visual states:
2855
+ * - `enabled === false` → renders `null` (the owning view has opted out of
2856
+ * Advanced Filter Rules).
2857
+ * - resting (no popover, no rules) → gray pill, label `Rules`, caret `▾`.
2858
+ * - resting (no popover, N rules) → gray pill, label `Rules` + `[N]` chip,
2859
+ * caret `▾`.
2860
+ * - hover (no popover) → gray-hover bg, caret stays visible.
2861
+ * - active (popover open) → "ube" purple pill, `TextActive` color, purple
2862
+ * `[N]` chip when N > 0, caret stays visible.
2863
+ *
2864
+ * The pill itself owns no popover state — parents place it inside an
2865
+ * `AdvancedFilterRulesPopover` (or any other popover container) and wire
2866
+ * `onClick` / `isOpen` themselves.
2867
+ *
2868
+ * RulesPill does not expose a dismiss action; clicking the pill toggles
2869
+ * the popover.
2870
+ */
2871
+ const RulesPill = (0, react.forwardRef)(function RulesPill({ compound, enabled, onClick, isOpen = false, "aria-label": ariaLabel, "data-test": dataTest, size, ...rest }, ref) {
2872
+ const resolvedSize = useFilterBarSize(size);
2873
+ if (!enabled) return null;
2874
+ const count = countRules(compound);
2875
+ const hasCount = count > 0;
2876
+ const variant = isOpen ? "active" : "default";
2877
+ const accessibleName = hasCount ? `Rules ${count}` : "Rules";
2878
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(PillShell, {
2879
+ ref,
2880
+ variant,
2881
+ size: resolvedSize,
2882
+ bodyAriaLabel: ariaLabel ?? accessibleName,
2883
+ onBodyClick: onClick,
2884
+ "data-test": dataTest ?? "rules-pill__trigger",
2885
+ "aria-expanded": isOpen,
2886
+ ...rest,
2887
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, { children: "Rules" }), hasCount && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CountChip, {
2888
+ $variant: variant,
2889
+ $size: resolvedSize,
2890
+ "data-test": "rules-pill__count",
2891
+ children: count
2892
+ })]
2893
+ });
2894
+ });
2895
+ //#endregion
2896
+ //#region components/DataTable/TableControls/FiltersV2/types.ts
2897
+ /** The empty state — no filters applied. */
2898
+ const EMPTY_FILTER_STATE = Object.freeze({
2899
+ topLevelRules: [],
2900
+ compound: Object.freeze({ groups: [] })
2901
+ });
2902
+ //#endregion
2903
+ //#region components/DataTable/TableControls/FiltersV2/validation.ts
2904
+ /**
2905
+ * Shared runtime validators for `FilterStateV2`, consumed by the URL
2906
+ * codec, the saved-view dual-write helpers, and `useFilterStateV2`.
2907
+ *
2908
+ * Validation is defense-in-depth: the type system prevents bad shapes
2909
+ * in code we control, but URL state and saved-view blobs are external
2910
+ * input — corrupted bookmarks, bad clipboard pastes, future-build
2911
+ * rules rolled back to an older build, attacker-crafted params — and
2912
+ * the validators are the last line of defense before anything reaches
2913
+ * the hook, the bar, or the adapter.
2914
+ */
2915
+ const OPERATOR_SET = new Set([
2916
+ "is",
2917
+ "is_not",
2918
+ "contains",
2919
+ "does_not_contain",
2920
+ "is_empty",
2921
+ "is_not_empty",
2922
+ "is_true",
2923
+ "is_false",
2924
+ "before",
2925
+ "after"
2926
+ ]);
2927
+ /**
2928
+ * Returns `true` when `value` is a structurally-valid `FilterStateV2`,
2929
+ * including per-rule content validation. A `topLevelRules` element
2930
+ * with a non-string `fieldId`, an operator not in the known
2931
+ * vocabulary, or a value of an unsupported type is rejected — a
2932
+ * shallow shape sniff would let those reach the adapter.
2933
+ */
2934
+ function isFilterStateV2(value) {
2935
+ if (typeof value !== "object" || value == null) return false;
2936
+ const v = value;
2937
+ if (!Array.isArray(v.topLevelRules)) return false;
2938
+ if (!v.topLevelRules.every(isTopLevelFilterRule)) return false;
2939
+ if (typeof v.compound !== "object" || v.compound == null) return false;
2940
+ const compound = v.compound;
2941
+ if (!Array.isArray(compound.groups)) return false;
2942
+ if (!compound.groups.every(isAndGroup)) return false;
2943
+ return true;
2944
+ }
2945
+ function isAndGroup(value) {
2946
+ if (typeof value !== "object" || value == null) return false;
2947
+ const v = value;
2948
+ if (!Array.isArray(v.rules)) return false;
2949
+ return v.rules.every(isFilterRule);
2950
+ }
2951
+ function isFilterRule(value) {
2952
+ if (typeof value !== "object" || value == null) return false;
2953
+ const v = value;
2954
+ if (typeof v.fieldId !== "string" || v.fieldId.length === 0) return false;
2955
+ if (typeof v.operator !== "string" || !OPERATOR_SET.has(v.operator)) return false;
2956
+ if (!isFilterRuleValue(v.value)) return false;
2957
+ return true;
2958
+ }
2959
+ function isTopLevelFilterRule(value) {
2960
+ if (!isFilterRule(value)) return false;
2961
+ const v = value;
2962
+ return typeof v.id === "string" && v.id.length > 0;
2963
+ }
2964
+ function isFilterRuleValue(value) {
2965
+ if (value == null) return true;
2966
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return true;
2967
+ if (Array.isArray(value)) {
2968
+ if (value.length === 0) return true;
2969
+ if (value.every((entry) => typeof entry === "string")) return true;
2970
+ return value.every((group) => Array.isArray(group) && group.every((entry) => typeof entry === "object" && entry != null && !Array.isArray(entry)));
2971
+ }
2972
+ if (typeof value === "object") {
2973
+ const record = value;
2974
+ if ("startDate" in record || "endDate" in record) {
2975
+ const { startDate, endDate } = record;
2976
+ return (startDate == null || typeof startDate === "string") && (endDate == null || typeof endDate === "string");
2977
+ }
2978
+ }
2979
+ return false;
2980
+ }
2981
+ /**
2982
+ * Strip rules referencing unregistered `fieldId`s from a decoded state.
2983
+ * Pairs with `isFilterStateV2` for defense-in-depth: even after the
2984
+ * shape guard passes, a rule with a `fieldId` that doesn't exist in the
2985
+ * current resource's registry would silently render nothing in the UI
2986
+ * but still reach the adapter and ship to the backend. Pruning closes
2987
+ * that gap.
2988
+ *
2989
+ * Empty AND-groups created by pruning are also dropped, since the
2990
+ * adapter prunes them on serialize anyway and the editor UI hides
2991
+ * empty groups too.
2992
+ *
2993
+ * Skips its own work and returns the input unchanged when `registry`
2994
+ * is `undefined` — useful for callers that hydrate before the registry
2995
+ * is built.
2996
+ *
2997
+ * For valueless operators (`is_empty`, etc.) the value contract is
2998
+ * `null`. Non-valueless operators keep in-progress draft values (an empty
2999
+ * string / empty array) so a pill the user is mid-editing survives the
3000
+ * report/hydrate round-trip and stays visible — top-level and compound
3001
+ * rules are treated alike here, and the serialize boundary
3002
+ * (`hasCompleteValue`) is what drops incomplete rules from the request.
3003
+ */
3004
+ function pruneToRegistry(state, registry) {
3005
+ if (!registry) return state;
3006
+ const coerced = coerceBooleanRules(state, registry);
3007
+ return {
3008
+ topLevelRules: coerced.topLevelRules.filter((rule) => isRuleAllowed(rule, registry, { allowDraftValues: true })),
3009
+ compound: { groups: coerced.compound.groups.map((group) => ({ rules: group.rules.filter((rule) => isRuleAllowed(rule, registry, { allowDraftValues: true })) })).filter((group) => group.rules.length > 0) }
3010
+ };
3011
+ }
3012
+ /**
3013
+ * Normalizes boolean-field rules into the in-memory contract the new UI
3014
+ * and adapter expect — `is` / `is_not` + a real boolean `value`. Two
3015
+ * legacy shapes are coerced, both only for rules whose registered field
3016
+ * type is `boolean`:
3017
+ *
3018
+ * - Pre–value-control rules using the `is_true` / `is_false` operators
3019
+ * (from saved views) become `is` + boolean `value` so they survive
3020
+ * operator-vocabulary pruning and render in the new UI.
3021
+ * - v1-URL bookmarks hydrate query params as strings, so
3022
+ * `filter[custom][active]=true` arrives as `{ operator: 'is', value:
3023
+ * 'true' }`. The string is coerced back to a boolean so the adapter
3024
+ * emits the legacy `is_true` / `is_false` wire operator instead of
3025
+ * shipping the raw string (which would break old boolean bookmarks).
3026
+ * Non-`'true'`/`'false'` strings are left as-is and dropped later by
3027
+ * `isRuleAllowed`.
3028
+ */
3029
+ function coerceBooleanRule(rule, registry) {
3030
+ const field = registry.get(rule.fieldId);
3031
+ if (!field || field.type !== "boolean") return rule;
3032
+ if (rule.operator === "is_true") return {
3033
+ ...rule,
3034
+ operator: "is",
3035
+ value: true
3036
+ };
3037
+ if (rule.operator === "is_false") return {
3038
+ ...rule,
3039
+ operator: "is",
3040
+ value: false
3041
+ };
3042
+ if (rule.operator === "is" || rule.operator === "is_not") {
3043
+ if (rule.value === "true") return {
3044
+ ...rule,
3045
+ value: true
3046
+ };
3047
+ if (rule.value === "false") return {
3048
+ ...rule,
3049
+ value: false
3050
+ };
3051
+ }
3052
+ return rule;
3053
+ }
3054
+ function coerceBooleanRules(state, registry) {
3055
+ return {
3056
+ topLevelRules: state.topLevelRules.map((r) => coerceBooleanRule(r, registry)),
3057
+ compound: { groups: state.compound.groups.map((g) => ({ rules: g.rules.map((r) => coerceBooleanRule(r, registry)) })) }
3058
+ };
3059
+ }
3060
+ function isDraftRuleValue(rule, registry) {
3061
+ if (isValuelessOperator(rule.operator)) return false;
3062
+ const field = registry.get(rule.fieldId);
3063
+ if (!field) return false;
3064
+ switch (field.type) {
3065
+ case "multi_choices":
3066
+ case "tags_conditions": return Array.isArray(rule.value) && rule.value.length === 0;
3067
+ case "date": return rule.value === "" || rule.value == null;
3068
+ case "date_range": return false;
3069
+ case "boolean": return false;
3070
+ default: return rule.value === "" || rule.value == null;
3071
+ }
3072
+ }
3073
+ function isRuleAllowed(rule, registry, options = { allowDraftValues: false }) {
3074
+ if (!registry.has(rule.fieldId)) return false;
3075
+ if (!registry.operatorsFor(rule.fieldId).includes(rule.operator)) return false;
3076
+ if (isValuelessOperator(rule.operator)) return rule.value == null;
3077
+ if (options.allowDraftValues && isDraftRuleValue(rule, registry)) return true;
3078
+ if (registry.get(rule.fieldId)?.type === "boolean") return typeof rule.value === "boolean";
3079
+ if (registry.get(rule.fieldId)?.type === "date") return typeof rule.value === "string" && rule.value.length > 0;
3080
+ if (registry.get(rule.fieldId)?.type === "multi_choices") {
3081
+ if (Array.isArray(rule.value)) return rule.value.length > 0;
3082
+ return typeof rule.value === "string" && rule.value.length > 0;
3083
+ }
3084
+ if (registry.get(rule.fieldId)?.type === "date_range") {
3085
+ const value = rule.value;
3086
+ if (value == null || typeof value !== "object" || Array.isArray(value)) return false;
3087
+ const { startDate, endDate } = value;
3088
+ return typeof startDate === "string" && startDate.length > 0 && typeof endDate === "string" && endDate.length > 0;
3089
+ }
3090
+ if (registry.get(rule.fieldId)?.type === "tags_conditions") return Array.isArray(rule.value) && rule.value.length > 0;
3091
+ return rule.value != null && typeof rule.value !== "boolean";
3092
+ }
3093
+ /**
3094
+ * Whether `rule` carries a complete value for its field type — the
3095
+ * serialize-boundary predicate `pruneEmptyRulesForSerialize` uses to drop
3096
+ * half-edited rules from the request (a value-requiring operator like
3097
+ * `is_not` with no value yet makes the backend reject the whole request).
3098
+ *
3099
+ * Deliberately stricter than `isRuleAllowed`'s hydration policy, which keeps
3100
+ * an empty string so an in-progress pill survives the state round-trip and
3101
+ * stays visible for the user to finish. Checks value completeness only — it
3102
+ * does not gate operator vocabulary or registry membership.
3103
+ */
3104
+ function hasCompleteValue(rule, registry) {
3105
+ if (isValuelessOperator(rule.operator)) return rule.value == null;
3106
+ const { value } = rule;
3107
+ if (value == null) return false;
3108
+ switch (registry.get(rule.fieldId)?.type) {
3109
+ case "boolean": return typeof value === "boolean";
3110
+ case "date": return typeof value === "string" && value.length > 0;
3111
+ case "multi_choices": return Array.isArray(value) ? value.length > 0 : typeof value === "string" && value.length > 0;
3112
+ case "tags_conditions": return Array.isArray(value) && value.length > 0;
3113
+ case "date_range": {
3114
+ if (typeof value !== "object" || Array.isArray(value)) return false;
3115
+ const { startDate, endDate } = value;
3116
+ return typeof startDate === "string" && startDate.length > 0 && typeof endDate === "string" && endDate.length > 0;
3117
+ }
3118
+ default:
3119
+ if (typeof value === "string") return value.length > 0;
3120
+ if (Array.isArray(value)) return value.length > 0;
3121
+ return typeof value !== "boolean";
3122
+ }
3123
+ }
3124
+ //#endregion
3125
+ //#region components/DataTable/TableControls/FiltersV2/useFilterStateV2.ts
3126
+ const nextRuleId = () => `top-rule-${(0, uuid.v4)()}`;
3127
+ /**
3128
+ * Owns `FilterStateV2` for a filter surface and exposes a small mutator API.
3129
+ *
3130
+ * When `advancedRulesEnabled` is false, `compound.groups` is forced to
3131
+ * `[]`.
3132
+ *
3133
+ * Putting that invariant here (rather than in the components) keeps
3134
+ * `TableControls/FiltersV2` callers from accidentally leaking compound state when
3135
+ * the owning view has opted out.
3136
+ *
3137
+ * The mutator surface is deliberately small: top-level rules get
3138
+ * upsert/remove, the compound expression gets whole-value writes. That
3139
+ * matches how the UI emits changes — simple pills mutate one rule at a
3140
+ * time; the rules popover always emits a full compound expression as
3141
+ * one `onChange`.
3142
+ *
3143
+ * A pill the user has picked but not yet valued is held by the bar rather
3144
+ * than committed. Which pills those are is recorded when the picker mints
3145
+ * them rather than inferred: they are never reported, so incoming state never
3146
+ * describes one and hydration has nothing to reconcile against them. They
3147
+ * stay in the same row as the committed pills, so giving one a value doesn't
3148
+ * move it.
3149
+ */
3150
+ function useFilterStateV2(options) {
3151
+ const { initialState = EMPTY_FILTER_STATE, advancedRulesEnabled = true, registry } = options;
3152
+ const [internal, setInternal] = (0, react.useState)(() => ({
3153
+ all: pruneToRegistry(initialState, registry),
3154
+ heldIds: /* @__PURE__ */ new Set()
3155
+ }));
3156
+ const { all, heldIds } = internal;
3157
+ const lastHydratedState = (0, react.useRef)(all);
3158
+ (0, react.useEffect)(() => {
3159
+ const nextHydratedState = pruneToRegistry(initialState, registry);
3160
+ const hydrate = !(0, lodash.isEqual)(nextHydratedState, lastHydratedState.current);
3161
+ if (hydrate) lastHydratedState.current = nextHydratedState;
3162
+ setInternal((prev) => {
3163
+ const pruned = pruneHeldRules(prev, registry);
3164
+ return hydrate ? withHeldRules(nextHydratedState, pruned) : pruned;
3165
+ });
3166
+ }, [initialState, registry]);
3167
+ const state = (0, react.useMemo)(() => enforceAdvancedRulesEnabled(all, advancedRulesEnabled), [all, advancedRulesEnabled]);
3168
+ return {
3169
+ state,
3170
+ committedState: (0, react.useMemo)(() => heldIds.size === 0 ? state : {
3171
+ ...state,
3172
+ topLevelRules: state.topLevelRules.filter((rule) => !heldIds.has(rule.id))
3173
+ }, [state, heldIds]),
3174
+ advancedRulesEnabled,
3175
+ setState: (0, react.useCallback)((next) => {
3176
+ setInternal({
3177
+ all: pruneToRegistry(next, registry),
3178
+ heldIds: /* @__PURE__ */ new Set()
3179
+ });
3180
+ }, [registry]),
3181
+ setCompound: (0, react.useCallback)((compound) => {
3182
+ setInternal((prev) => ({
3183
+ ...prev,
3184
+ all: {
3185
+ ...prev.all,
3186
+ compound
3187
+ }
3188
+ }));
3189
+ }, []),
3190
+ reset: (0, react.useCallback)(() => {
3191
+ setInternal({
3192
+ all: {
3193
+ topLevelRules: [],
3194
+ compound: { groups: [] }
3195
+ },
3196
+ heldIds: /* @__PURE__ */ new Set()
3197
+ });
3198
+ }, []),
3199
+ addTopLevelRule: (0, react.useCallback)((rule) => {
3200
+ const id = nextRuleId();
3201
+ const added = {
3202
+ ...rule,
3203
+ id
3204
+ };
3205
+ setInternal((prev) => ({
3206
+ all: {
3207
+ ...prev.all,
3208
+ topLevelRules: [...prev.all.topLevelRules, added]
3209
+ },
3210
+ heldIds: isHeldRule(added) ? withId(prev.heldIds, id) : prev.heldIds
3211
+ }));
3212
+ return id;
3213
+ }, []),
3214
+ updateTopLevelRule: (0, react.useCallback)((id, rule) => {
3215
+ setInternal((prev) => {
3216
+ const idx = prev.all.topLevelRules.findIndex((r) => r.id === id);
3217
+ if (idx < 0) return prev;
3218
+ const topLevelRules = [...prev.all.topLevelRules];
3219
+ topLevelRules[idx] = {
3220
+ ...rule,
3221
+ id
3222
+ };
3223
+ const heldIds = isHeldRule(rule) ? withId(prev.heldIds, id) : withoutId(prev.heldIds, id);
3224
+ return {
3225
+ all: {
3226
+ ...prev.all,
3227
+ topLevelRules
3228
+ },
3229
+ heldIds
3230
+ };
3231
+ });
3232
+ }, []),
3233
+ removeTopLevelRule: (0, react.useCallback)((id) => {
3234
+ setInternal((prev) => {
3235
+ const topLevelRules = prev.all.topLevelRules.filter((r) => r.id !== id);
3236
+ if (topLevelRules.length === prev.all.topLevelRules.length) return prev;
3237
+ return {
3238
+ all: {
3239
+ ...prev.all,
3240
+ topLevelRules
3241
+ },
3242
+ heldIds: prev.heldIds.has(id) ? withoutId(prev.heldIds, id) : prev.heldIds
3243
+ };
3244
+ });
3245
+ }, [])
3246
+ };
3247
+ }
3248
+ /**
3249
+ * A pill the picker minted that has no value yet. `null` and not "empty":
3250
+ * `''` and `[]` are values a user can choose, and a filter cleared to one is
3251
+ * still a filter.
3252
+ */
3253
+ function isHeldRule(rule) {
3254
+ return !isValuelessOperator(rule.operator) && rule.value == null;
3255
+ }
3256
+ function heldRulesOf(state) {
3257
+ return state.heldIds.size === 0 ? [] : state.all.topLevelRules.filter((rule) => state.heldIds.has(rule.id));
3258
+ }
3259
+ /**
3260
+ * Lays incoming committed rules into the row, keeping the held pills where the
3261
+ * user left them: a held pill goes back after however many committed rules
3262
+ * preceded it before. An id the incoming state now uses is the parent's, so the
3263
+ * held pill of that id gives way rather than duplicating it.
3264
+ */
3265
+ function withHeldRules(committed, prev) {
3266
+ if (prev.heldIds.size === 0) return {
3267
+ all: committed,
3268
+ heldIds: prev.heldIds
3269
+ };
3270
+ const incoming = committed.topLevelRules;
3271
+ const incomingIds = new Set(incoming.map((rule) => rule.id));
3272
+ const topLevelRules = [];
3273
+ const heldIds = /* @__PURE__ */ new Set();
3274
+ let taken = 0;
3275
+ let committedBefore = 0;
3276
+ prev.all.topLevelRules.forEach((rule) => {
3277
+ if (!prev.heldIds.has(rule.id)) {
3278
+ committedBefore += 1;
3279
+ return;
3280
+ }
3281
+ if (incomingIds.has(rule.id)) return;
3282
+ while (taken < committedBefore && taken < incoming.length) {
3283
+ topLevelRules.push(incoming[taken]);
3284
+ taken += 1;
3285
+ }
3286
+ topLevelRules.push(rule);
3287
+ heldIds.add(rule.id);
3288
+ });
3289
+ if (heldIds.size === 0) return {
3290
+ all: committed,
3291
+ heldIds
3292
+ };
3293
+ while (taken < incoming.length) {
3294
+ topLevelRules.push(incoming[taken]);
3295
+ taken += 1;
3296
+ }
3297
+ return {
3298
+ all: {
3299
+ ...committed,
3300
+ topLevelRules
3301
+ },
3302
+ heldIds
3303
+ };
3304
+ }
3305
+ /**
3306
+ * Drops held pills whose field or operator the registry no longer supports,
3307
+ * preserving the state's identity when there are none so an unchanged registry
3308
+ * can't loop the effect.
3309
+ */
3310
+ function pruneHeldRules(state, registry) {
3311
+ const droppedIds = new Set(heldRulesOf(state).filter((rule) => !registry.has(rule.fieldId) || !registry.operatorsFor(rule.fieldId).includes(rule.operator)).map((rule) => rule.id));
3312
+ if (droppedIds.size === 0) return state;
3313
+ const heldIds = new Set(state.heldIds);
3314
+ droppedIds.forEach((id) => heldIds.delete(id));
3315
+ return {
3316
+ all: {
3317
+ ...state.all,
3318
+ topLevelRules: state.all.topLevelRules.filter((rule) => !droppedIds.has(rule.id))
3319
+ },
3320
+ heldIds
3321
+ };
3322
+ }
3323
+ function withId(ids, id) {
3324
+ return ids.has(id) ? ids : new Set(ids).add(id);
3325
+ }
3326
+ function withoutId(ids, id) {
3327
+ if (!ids.has(id)) return ids;
3328
+ const next = new Set(ids);
3329
+ next.delete(id);
3330
+ return next;
3331
+ }
3332
+ function enforceAdvancedRulesEnabled(state, advancedRulesEnabled) {
3333
+ if (advancedRulesEnabled) return state;
3334
+ if (state.compound.groups.length === 0) return state;
3335
+ return {
3336
+ ...state,
3337
+ compound: { groups: [] }
3338
+ };
3339
+ }
3340
+ //#endregion
3341
+ //#region components/DataTable/TableControls/FiltersV2/FilterBar/FilterBar.tsx
3342
+ const Bar = styled_components$1.default.div`
3343
+ display: flex;
3344
+ align-items: center;
3345
+ gap: ${_persona_design_tokens.Spacing[2]};
3346
+ flex-wrap: nowrap;
3347
+ min-width: 0;
3348
+ padding: ${_persona_design_tokens.Spacing[2]} 0;
3349
+ `;
3350
+ const SCROLL_FADE_WIDTH = 48;
3351
+ const SCROLL_SETTLE_FALLBACK_MS = 400;
3352
+ const POPOVER_CLOSE_BUFFER_PX = 8;
3353
+ const PILL_FOCUS_RING_SPACE = 3;
3354
+ /**
3355
+ * Builds the `mask-image` gradient that fades the scroll track's edges.
3356
+ *
3357
+ * A `mask-image` (rather than a same-colored overlay painted on top) fades
3358
+ * the track's *entire rendered output* — pill backgrounds, borders, and any
3359
+ * focus ring that bleeds into the padding above — because masking
3360
+ * composites against the real pixels the element paints, instead of
3361
+ * relying on an opaque sibling layer to visually cover them. An overlay
3362
+ * approach only hides whatever happens to sit below it in paint order;
3363
+ * a mask fades everything, including outlines.
3364
+ */
3365
+ const buildEdgeMaskImage = (showLeftFade, showRightFade) => {
3366
+ return `linear-gradient(to right, ${showLeftFade ? `transparent 0, black ${SCROLL_FADE_WIDTH}px` : "black 0"}, ${showRightFade ? `black calc(100% - ${SCROLL_FADE_WIDTH}px), transparent 100%` : "black 100%"})`;
3367
+ };
3368
+ const PillsScrollRegion = styled_components$1.default.div`
3369
+ display: flex;
3370
+ align-items: center;
3371
+ gap: ${_persona_design_tokens.Spacing[1]};
3372
+ flex: 0 1 auto;
3373
+ min-width: 0;
3374
+ width: max-content;
3375
+ max-width: 100%;
3376
+ `;
3377
+ const PillsScrollTrack = styled_components$1.default.div`
3378
+ display: flex;
3379
+ align-items: center;
3380
+ flex: 1 1 auto;
3381
+ min-width: 0;
3382
+ flex-wrap: nowrap;
3383
+ gap: ${_persona_design_tokens.Spacing[1]};
3384
+ overflow-x: auto;
3385
+ overflow-y: hidden;
3386
+ -webkit-overflow-scrolling: touch;
3387
+ scrollbar-width: none;
3388
+ padding: ${PILL_FOCUS_RING_SPACE}px;
3389
+ margin: -${PILL_FOCUS_RING_SPACE}px;
3390
+ -webkit-mask-image: ${({ $showLeftFade, $showRightFade }) => buildEdgeMaskImage($showLeftFade, $showRightFade)};
3391
+ mask-image: ${({ $showLeftFade, $showRightFade }) => buildEdgeMaskImage($showLeftFade, $showRightFade)};
3392
+ transition:
3393
+ -webkit-mask-image ${"200ms"} ease-out,
3394
+ mask-image ${"200ms"} ease-out;
3395
+
3396
+ & > * {
3397
+ flex: 0 0 auto;
3398
+ }
3399
+
3400
+ &::-webkit-scrollbar {
3401
+ display: none;
3402
+ }
3403
+ `;
3404
+ const Divider = styled_components$1.default.div`
3405
+ width: 1px;
3406
+ height: ${({ $size }) => FILTER_SIZE_TOKENS[$size].controlHeight};
3407
+ background: ${_persona_design_tokens.Color.BorderDivider};
3408
+ flex: 0 0 auto;
3409
+ margin: 0 ${({ $flush }) => $flush ? 0 : _persona_design_tokens.Spacing[1]};
3410
+ `;
3411
+ const PickerSlot = styled_components$1.default.div`
3412
+ flex: 0 0 auto;
3413
+ `;
3414
+ const EmptyTrailingGroup = styled_components$1.default.div`
3415
+ display: flex;
3416
+ align-items: center;
3417
+ gap: ${_persona_design_tokens.Spacing[1]};
3418
+ flex: 0 0 auto;
3419
+ `;
3420
+ /**
3421
+ * Returns the previous array whenever its contents still match, so the field
3422
+ * ids can be derived on every render without giving the picker a new array to
3423
+ * rebuild its whole option tree from. Editing a pill's value rewrites the
3424
+ * rules while leaving the fields in use unchanged.
3425
+ */
3426
+ function useStableFieldIds(fieldIds) {
3427
+ const stable = (0, react.useRef)(fieldIds);
3428
+ const previous = stable.current;
3429
+ if (previous == null || fieldIds == null || previous.length !== fieldIds.length || fieldIds.some((id, index) => previous[index] !== id)) stable.current = fieldIds;
3430
+ return stable.current;
3431
+ }
3432
+ function FilterBar({ registry, initialState, onChange, advancedRulesEnabled = true, singleUseFields = false, size = "md", valueControlResolver }) {
3433
+ const filterState = useFilterStateV2({
3434
+ registry,
3435
+ initialState,
3436
+ advancedRulesEnabled
3437
+ });
3438
+ const [editingRuleId, setEditingRuleId] = (0, react.useState)(null);
3439
+ const [rulesPopoverOpen, setRulesPopoverOpen] = (0, react.useState)(false);
3440
+ const pillNodesRef = (0, react.useRef)(/* @__PURE__ */ new Map());
3441
+ const onChangeRef = (0, react.useRef)(onChange);
3442
+ (0, react.useEffect)(() => {
3443
+ onChangeRef.current = onChange;
3444
+ }, [onChange]);
3445
+ const { committedState } = filterState;
3446
+ const lastReportedState = (0, react.useRef)(committedState);
3447
+ (0, react.useEffect)(() => {
3448
+ if ((0, lodash.isEqual)(lastReportedState.current, committedState)) return;
3449
+ lastReportedState.current = committedState;
3450
+ onChangeRef.current?.(committedState);
3451
+ }, [committedState]);
3452
+ const pendingEditRuleIdRef = (0, react.useRef)(null);
3453
+ const openedViaScrollIntoViewRef = (0, react.useRef)(false);
3454
+ const handlePickField = (field) => {
3455
+ pendingEditRuleIdRef.current = filterState.addTopLevelRule({
3456
+ fieldId: field.id,
3457
+ operator: registry.defaultOperatorFor(field.id),
3458
+ value: null
3459
+ });
3460
+ };
3461
+ const hasPills = filterState.state.topLevelRules.length > 0;
3462
+ const excludeFieldIds = useStableFieldIds(singleUseFields ? filterState.state.topLevelRules.map((rule) => rule.fieldId) : void 0);
3463
+ const pillsScrollRef = (0, react.useRef)(null);
3464
+ const { hasHorizontalOverflow, hasMoreScrollLeft, hasMoreScrollRight } = require_lib_useScrollOverflow.useScrollOverflow(pillsScrollRef, { enabled: hasPills });
3465
+ const ruleCount = filterState.state.topLevelRules.length;
3466
+ const previousRuleCountRef = (0, react.useRef)(ruleCount);
3467
+ (0, react.useEffect)(() => {
3468
+ const grew = ruleCount > previousRuleCountRef.current;
3469
+ previousRuleCountRef.current = ruleCount;
3470
+ if (!grew || pendingEditRuleIdRef.current == null) return;
3471
+ const openPendingRule = () => {
3472
+ openedViaScrollIntoViewRef.current = true;
3473
+ setEditingRuleId(pendingEditRuleIdRef.current);
3474
+ pendingEditRuleIdRef.current = null;
3475
+ };
3476
+ const track = pillsScrollRef.current;
3477
+ if (!track || !track.scrollTo) {
3478
+ openPendingRule();
3479
+ return;
3480
+ }
3481
+ const maxScrollLeft = Math.max(track.scrollWidth - track.clientWidth, 0);
3482
+ if (Math.abs(track.scrollLeft - maxScrollLeft) <= 1) {
3483
+ openPendingRule();
3484
+ return;
3485
+ }
3486
+ let settled = false;
3487
+ const finish = () => {
3488
+ if (settled) return;
3489
+ settled = true;
3490
+ track.removeEventListener("scrollend", finish);
3491
+ window.clearTimeout(fallbackTimer);
3492
+ openPendingRule();
3493
+ };
3494
+ track.addEventListener("scrollend", finish, { once: true });
3495
+ const fallbackTimer = window.setTimeout(finish, SCROLL_SETTLE_FALLBACK_MS);
3496
+ track.scrollTo({
3497
+ left: track.scrollWidth,
3498
+ behavior: "smooth"
3499
+ });
3500
+ return () => {
3501
+ track.removeEventListener("scrollend", finish);
3502
+ window.clearTimeout(fallbackTimer);
3503
+ };
3504
+ }, [ruleCount]);
3505
+ (0, react.useEffect)(() => {
3506
+ if (editingRuleId == null) return;
3507
+ const root = pillsScrollRef.current;
3508
+ const target = pillNodesRef.current.get(editingRuleId);
3509
+ if (!root || !target || typeof IntersectionObserver === "undefined") return;
3510
+ let skipInitialReport = openedViaScrollIntoViewRef.current;
3511
+ openedViaScrollIntoViewRef.current = false;
3512
+ const observer = new IntersectionObserver(([entry]) => {
3513
+ if (skipInitialReport) {
3514
+ skipInitialReport = false;
3515
+ return;
3516
+ }
3517
+ if (entry && entry.intersectionRatio < 1) setEditingRuleId(null);
3518
+ }, {
3519
+ root,
3520
+ threshold: 1,
3521
+ rootMargin: `0px ${POPOVER_CLOSE_BUFFER_PX}px 0px ${POPOVER_CLOSE_BUFFER_PX}px`
3522
+ });
3523
+ observer.observe(target);
3524
+ return () => observer.disconnect();
3525
+ }, [editingRuleId]);
3526
+ (0, react.useLayoutEffect)(() => {
3527
+ if (editingRuleId == null) return;
3528
+ pillNodesRef.current.get(editingRuleId)?.scrollIntoView?.({
3529
+ block: "nearest",
3530
+ inline: "nearest"
3531
+ });
3532
+ }, [editingRuleId, (0, react.useMemo)(() => editingRuleId == null ? null : filterState.state.topLevelRules.find((rule) => rule.id === editingRuleId)?.value ?? null, [editingRuleId, filterState.state.topLevelRules])]);
3533
+ const visibleCustomFieldParents = (0, react.useMemo)(() => deriveVisibleCustomFieldParents(registry, filterState.state.topLevelRules), [registry, filterState.state.topLevelRules]);
3534
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterBarContext.Provider, {
3535
+ value: { size },
3536
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Bar, {
3537
+ role: "toolbar",
3538
+ "aria-label": "Filter bar",
3539
+ children: [filterState.advancedRulesEnabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AdvancedFilterRulesPopover, {
3540
+ registry,
3541
+ compound: filterState.state.compound,
3542
+ open: rulesPopoverOpen,
3543
+ onOpenChange: setRulesPopoverOpen,
3544
+ onChange: (compound) => {
3545
+ filterState.setCompound(compound);
3546
+ },
3547
+ renderValueControl: (field, operator, value, onChange) => resolveValueControl({
3548
+ field,
3549
+ operator,
3550
+ value,
3551
+ onChange,
3552
+ layout: "inline"
3553
+ }, valueControlResolver),
3554
+ trigger: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RulesPill, {
3555
+ compound: filterState.state.compound,
3556
+ enabled: true,
3557
+ isOpen: rulesPopoverOpen
3558
+ })
3559
+ }) : null, hasPills ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [filterState.advancedRulesEnabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Divider, {
3560
+ "aria-hidden": "true",
3561
+ $size: size
3562
+ }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(PillsScrollRegion, {
3563
+ "data-test": "filter-bar-pills-scroll-region",
3564
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PillsScrollTrack, {
3565
+ ref: pillsScrollRef,
3566
+ "data-test": "filter-bar-pills-scroll-track",
3567
+ $showLeftFade: hasMoreScrollLeft,
3568
+ $showRightFade: hasHorizontalOverflow && hasMoreScrollRight,
3569
+ children: filterState.state.topLevelRules.map((rule) => {
3570
+ const field = registry.get(rule.fieldId);
3571
+ if (!field) return null;
3572
+ const optionLabels = registry.optionLabelsFor(field.id);
3573
+ const isOpen = editingRuleId === rule.id;
3574
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterPopover, {
3575
+ field,
3576
+ operator: rule.operator,
3577
+ onChangeOperator: (op) => {
3578
+ filterState.updateTopLevelRule(rule.id, {
3579
+ ...rule,
3580
+ operator: op,
3581
+ value: isValuelessOperator(op) ? null : rule.value ?? emptyValueForFieldType(field.type)
3582
+ });
3583
+ },
3584
+ valueControlSlot: resolveValueControl({
3585
+ field,
3586
+ operator: rule.operator,
3587
+ value: rule.value,
3588
+ onChange: (value) => filterState.updateTopLevelRule(rule.id, {
3589
+ ...rule,
3590
+ value
3591
+ }),
3592
+ onCommit: () => setEditingRuleId(null)
3593
+ }, valueControlResolver),
3594
+ onClose: () => setEditingRuleId(null),
3595
+ open: isOpen,
3596
+ onOpenChange: (open) => setEditingRuleId(open ? rule.id : null),
3597
+ trigger: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterPill, {
3598
+ ref: (node) => {
3599
+ if (node) pillNodesRef.current.set(rule.id, node);
3600
+ else pillNodesRef.current.delete(rule.id);
3601
+ },
3602
+ field,
3603
+ rule,
3604
+ variant: isOpen ? "active" : "default",
3605
+ optionLabels,
3606
+ onDismiss: () => filterState.removeTopLevelRule(rule.id)
3607
+ })
3608
+ }, rule.id);
3609
+ })
3610
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PickerSlot, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterPickerMenu, {
3611
+ registry,
3612
+ onPickField: handlePickField,
3613
+ compact: true,
3614
+ visibleCustomFieldParents,
3615
+ excludeFieldIds
3616
+ }) })]
3617
+ })] }) : filterState.advancedRulesEnabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(EmptyTrailingGroup, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Divider, {
3618
+ "aria-hidden": "true",
3619
+ $size: size,
3620
+ $flush: true
3621
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PickerSlot, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterPickerMenu, {
3622
+ registry,
3623
+ onPickField: handlePickField,
3624
+ visibleCustomFieldParents,
3625
+ excludeFieldIds
3626
+ }) })] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PickerSlot, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterPickerMenu, {
3627
+ registry,
3628
+ onPickField: handlePickField,
3629
+ visibleCustomFieldParents,
3630
+ excludeFieldIds
3631
+ }) })]
3632
+ })
3633
+ });
3634
+ }
3635
+ /**
3636
+ * The parent labels the picker's Fields submenu should keep visible,
3637
+ * derived from active `is` pills on scoping selector fields
3638
+ * ({@link FieldRegistry.narrowingSelectorFields}). Each selected option
3639
+ * value is a backend record-type/template id, resolved to its parent
3640
+ * label via {@link FieldRegistry.parentRecordLabelForId}.
3641
+ *
3642
+ * Returns `undefined` only when no `is` selector pill is active (show
3643
+ * everything). An active pill always returns an array, possibly empty:
3644
+ * selecting a scope with no custom fields narrows to *nothing*, not to
3645
+ * everything — conflating the two would leak other scopes' fields in.
3646
+ *
3647
+ * Only `is` narrows; multiple pills union their parents.
3648
+ */
3649
+ function deriveVisibleCustomFieldParents(registry, topLevelRules) {
3650
+ const selectorFields = registry.narrowingSelectorFields();
3651
+ if (selectorFields.length === 0 || topLevelRules.length === 0) return;
3652
+ const selectorIds = new Set(selectorFields.map((f) => f.id));
3653
+ const allowedParents = /* @__PURE__ */ new Set();
3654
+ let hasActiveSelectorRule = false;
3655
+ for (const rule of topLevelRules) {
3656
+ if (!selectorIds.has(rule.fieldId)) continue;
3657
+ if (rule.operator !== "is") continue;
3658
+ hasActiveSelectorRule = true;
3659
+ const values = Array.isArray(rule.value) ? rule.value : [rule.value];
3660
+ for (const value of values) {
3661
+ if (typeof value !== "string") continue;
3662
+ const parentLabel = registry.parentRecordLabelForId(value);
3663
+ if (parentLabel != null) allowedParents.add(parentLabel);
3664
+ }
3665
+ }
3666
+ return hasActiveSelectorRule ? Array.from(allowedParents) : void 0;
3667
+ }
3668
+ //#endregion
3669
+ //#region components/DataTable/TableControls/FiltersV2/FilterBar/index.ts
3670
+ var FilterBar_default = FilterBar;
3671
+ //#endregion
3672
+ //#region components/DataTable/TableControls/FiltersV2/FieldRegistry.ts
3673
+ /**
3674
+ * Per-resource field registry.
3675
+ *
3676
+ * Built from the backend's `field_key_to_info` payload (extended in v2 to
3677
+ * include `type`, `options`, `item_type`, and a `source`/`parent_record_type`
3678
+ * pair for custom fields). The registry is the single place the UI looks up
3679
+ * "what field is this and what can the user do with it" — value control
3680
+ * rendering, operator vocabulary, picker grouping, and popover footer text
3681
+ * all route through here.
3682
+ *
3683
+ * Construction is tolerant of partial metadata: if `type` is missing the
3684
+ * field falls back to `'string'`.
3685
+ */
3686
+ var FieldRegistry = class {
3687
+ constructor(resource, fields) {
3688
+ this.optionLabelCache = /* @__PURE__ */ new Map();
3689
+ this.resource = resource;
3690
+ this.byId = /* @__PURE__ */ new Map();
3691
+ this.customByParent = /* @__PURE__ */ new Map();
3692
+ this.parentLabelByRecordId = /* @__PURE__ */ new Map();
3693
+ this.systemFields = [];
3694
+ const parentRecordIds = /* @__PURE__ */ new Set();
3695
+ for (const field of fields) {
3696
+ this.byId.set(field.id, field);
3697
+ if (field.source === "custom") {
3698
+ const parent = field.parentRecordType ?? "";
3699
+ const bucket = this.customByParent.get(parent) ?? [];
3700
+ bucket.push(field);
3701
+ this.customByParent.set(parent, bucket);
3702
+ if (field.parentRecordId) {
3703
+ parentRecordIds.add(field.parentRecordId);
3704
+ if (field.parentRecordType) this.parentLabelByRecordId.set(field.parentRecordId, field.parentRecordType);
3705
+ }
3706
+ } else this.systemFields.push(field);
3707
+ }
3708
+ this.narrowingSelectors = [];
3709
+ if (parentRecordIds.size > 0) for (const field of fields) {
3710
+ if (!field.options || field.options.length === 0) continue;
3711
+ if (field.options.some((opt) => parentRecordIds.has(opt.value))) this.narrowingSelectors.push(field);
3712
+ }
3713
+ }
3714
+ parentRecordLabelForId(recordId) {
3715
+ return this.parentLabelByRecordId.get(recordId);
3716
+ }
3717
+ has(fieldId) {
3718
+ return this.byId.has(fieldId);
3719
+ }
3720
+ get(fieldId) {
3721
+ return this.byId.get(fieldId);
3722
+ }
3723
+ /**
3724
+ * Get a field by id, throwing if it isn't registered. Use this when the
3725
+ * fieldId came from state we own (e.g. an existing `FilterRule`) and a
3726
+ * missing field is a programming error rather than user input.
3727
+ */
3728
+ getOrThrow(fieldId) {
3729
+ const field = this.byId.get(fieldId);
3730
+ if (!field) throw new Error(`FieldRegistry(${this.resource}): unknown fieldId "${fieldId}"`);
3731
+ return field;
3732
+ }
3733
+ /** All registered fields, in insertion order. */
3734
+ all() {
3735
+ return Array.from(this.byId.values());
3736
+ }
3737
+ /** System / built-in fields, used as the top section of the `⊕ Filter` menu. */
3738
+ systemFieldsList() {
3739
+ return this.systemFields;
3740
+ }
3741
+ /** Custom fields grouped by parent record type for the picker submenu. */
3742
+ customFieldGroups() {
3743
+ return Array.from(this.customByParent.entries()).map(([parent, fields]) => ({
3744
+ parent,
3745
+ fields
3746
+ }));
3747
+ }
3748
+ /**
3749
+ * Fields that drive the picker's field-narrowing. A field is inferred
3750
+ * as a scoping selector (e.g. `account_type`, `case_template`) when its
3751
+ * `options[].value` set intersects the registry's custom-field
3752
+ * `parentRecordId`s — matching on the backend id, not the display label,
3753
+ * so a suffixed or colliding label (`"KYC Standard (CAS)"`) still
3754
+ * narrows correctly. `FilterBar` turns an active `is` pill on such a
3755
+ * field into the visible parent labels via {@link parentRecordLabelForId}.
3756
+ *
3757
+ * A coincidental id collision would falsely tag a field as a selector —
3758
+ * benign (it just narrows too); layer on a backend flag if ever needed.
3759
+ */
3760
+ narrowingSelectorFields() {
3761
+ return this.narrowingSelectors;
3762
+ }
3763
+ /** Operator vocabulary for a registered field, gated by its `allowedOperators` then type. */
3764
+ operatorsFor(fieldId) {
3765
+ return getOperatorsForField(this.getOrThrow(fieldId));
3766
+ }
3767
+ /** Default operator for a registered field. Used when creating a new pill. */
3768
+ defaultOperatorFor(fieldId) {
3769
+ const [defaultOperator] = getOperatorsForField(this.getOrThrow(fieldId));
3770
+ if (defaultOperator == null) throw new Error(`FieldRegistry: no operators available for field "${fieldId}"`);
3771
+ return defaultOperator;
3772
+ }
3773
+ /**
3774
+ * Pick the operator to use for a rule after a field swap. If the
3775
+ * previous operator is still in the new field's vocabulary, keep it
3776
+ * (the user's intent likely carries over — e.g. `is_empty` stays
3777
+ * `is_empty` regardless of field type). Otherwise fall back to the
3778
+ * field's default operator.
3779
+ *
3780
+ * Lives on the registry rather than as a free helper because the
3781
+ * answer is entirely a function of registry-owned data (operator
3782
+ * vocabulary per type) — and centralizing it keeps the field-swap
3783
+ * semantics consistent across `FilterBar.handlePickField`,
3784
+ * `AdvancedFilterRulesPopover.handleFieldChange`, and any future
3785
+ * caller.
3786
+ */
3787
+ reconcileOperator(fieldId, prevOperator) {
3788
+ return this.operatorsFor(fieldId).includes(prevOperator) ? prevOperator : this.defaultOperatorFor(fieldId);
3789
+ }
3790
+ /**
3791
+ * Build a `value → label` lookup for a `choices` / `multi_choices`
3792
+ * field, suitable for translating raw option ids into the human
3793
+ * labels rendered by `FilterPill` chips and value-control headers.
3794
+ * Returns `undefined` when the field has no options so callers can
3795
+ * skip the lookup entirely.
3796
+ *
3797
+ * Memoized per-field so repeated reads from render loops don't
3798
+ * rebuild the same map. Field options are immutable for the lifetime
3799
+ * of a `FieldRegistry`, so the cache never needs invalidation.
3800
+ */
3801
+ optionLabelsFor(fieldId) {
3802
+ const cached = this.optionLabelCache.get(fieldId);
3803
+ if (cached != null) return cached === EMPTY_OPTION_LABELS ? void 0 : cached;
3804
+ const field = this.byId.get(fieldId);
3805
+ if (!field?.options || field.options.length === 0) {
3806
+ this.optionLabelCache.set(fieldId, EMPTY_OPTION_LABELS);
3807
+ return;
3808
+ }
3809
+ const map = {};
3810
+ for (const opt of field.options) map[opt.value] = opt.label;
3811
+ this.optionLabelCache.set(fieldId, map);
3812
+ return map;
3813
+ }
3814
+ };
3815
+ const EMPTY_OPTION_LABELS = Object.freeze({});
3816
+ /**
3817
+ * Build a registry from a `field_key_to_info` map. Forgiving by design — any
3818
+ * key whose `type` is missing or unrecognized falls back to `'string'`, and
3819
+ * `source` defaults to `'custom'` (current `customFilters` are all custom).
3820
+ */
3821
+ function buildFieldRegistry(resource, fieldKeyToInfo, options) {
3822
+ const apiFields = Object.entries(fieldKeyToInfo).map(([id, raw]) => rawFieldInfoToFilterField(id, raw));
3823
+ return new FieldRegistry(resource, [...options?.systemFields ?? [], ...apiFields]);
3824
+ }
3825
+ function rawFieldInfoToFilterField(id, raw) {
3826
+ const type = normalizeFieldType(raw.type);
3827
+ const itemType = raw.item_type ? normalizeFieldType(raw.item_type) : void 0;
3828
+ const source = normalizeFieldSource(raw.source);
3829
+ return {
3830
+ id,
3831
+ label: raw.label,
3832
+ type,
3833
+ source,
3834
+ options: raw.options,
3835
+ itemType,
3836
+ parentRecordType: raw.parent_record_type,
3837
+ parentRecordId: raw.parent_record_id,
3838
+ path: raw.path
3839
+ };
3840
+ }
3841
+ const KNOWN_TYPES = new Set([
3842
+ "string",
3843
+ "email",
3844
+ "choices",
3845
+ "multi_choices",
3846
+ "boolean",
3847
+ "integer",
3848
+ "float",
3849
+ "date",
3850
+ "array",
3851
+ "tags_conditions",
3852
+ "date_range"
3853
+ ]);
3854
+ function normalizeFieldType(raw) {
3855
+ if (raw && KNOWN_TYPES.has(raw)) return raw;
3856
+ return "string";
3857
+ }
3858
+ function normalizeFieldSource(raw) {
3859
+ return raw === "system" ? "system" : "custom";
3860
+ }
3861
+ //#endregion
3862
+ Object.defineProperty(exports, "ControlBar", {
3863
+ enumerable: true,
3864
+ get: function() {
3865
+ return ControlBar;
3866
+ }
3867
+ });
3868
+ Object.defineProperty(exports, "DataTableCompactBar", {
3869
+ enumerable: true,
3870
+ get: function() {
3871
+ return DataTableCompactBar;
3872
+ }
3873
+ });
3874
+ Object.defineProperty(exports, "EMPTY_FILTER_STATE", {
3875
+ enumerable: true,
3876
+ get: function() {
3877
+ return EMPTY_FILTER_STATE;
3878
+ }
3879
+ });
3880
+ Object.defineProperty(exports, "FieldRegistry", {
3881
+ enumerable: true,
3882
+ get: function() {
3883
+ return FieldRegistry;
3884
+ }
3885
+ });
3886
+ Object.defineProperty(exports, "FilterBar_default", {
3887
+ enumerable: true,
3888
+ get: function() {
3889
+ return FilterBar_default;
3890
+ }
3891
+ });
3892
+ Object.defineProperty(exports, "TableControls", {
3893
+ enumerable: true,
3894
+ get: function() {
3895
+ return TableControls;
3896
+ }
3897
+ });
3898
+ Object.defineProperty(exports, "TableControlsContext", {
3899
+ enumerable: true,
3900
+ get: function() {
3901
+ return TableControlsContext;
3902
+ }
3903
+ });
3904
+ Object.defineProperty(exports, "TableControlsProvider", {
3905
+ enumerable: true,
3906
+ get: function() {
3907
+ return TableControlsProvider;
3908
+ }
3909
+ });
3910
+ Object.defineProperty(exports, "TableViewConfiguration", {
3911
+ enumerable: true,
3912
+ get: function() {
3913
+ return TableViewConfiguration;
3914
+ }
3915
+ });
3916
+ Object.defineProperty(exports, "TableViewConfigurationDropdown", {
3917
+ enumerable: true,
3918
+ get: function() {
3919
+ return TableViewConfigurationDropdown;
3920
+ }
3921
+ });
3922
+ Object.defineProperty(exports, "buildFieldRegistry", {
3923
+ enumerable: true,
3924
+ get: function() {
3925
+ return buildFieldRegistry;
3926
+ }
3927
+ });
3928
+ Object.defineProperty(exports, "getDefaultOperatorForType", {
3929
+ enumerable: true,
3930
+ get: function() {
3931
+ return getDefaultOperatorForType;
3932
+ }
3933
+ });
3934
+ Object.defineProperty(exports, "getOperatorsForField", {
3935
+ enumerable: true,
3936
+ get: function() {
3937
+ return getOperatorsForField;
3938
+ }
3939
+ });
3940
+ Object.defineProperty(exports, "getOperatorsForType", {
3941
+ enumerable: true,
3942
+ get: function() {
3943
+ return getOperatorsForType;
3944
+ }
3945
+ });
3946
+ Object.defineProperty(exports, "hasCompleteValue", {
3947
+ enumerable: true,
3948
+ get: function() {
3949
+ return hasCompleteValue;
3950
+ }
3951
+ });
3952
+ Object.defineProperty(exports, "isFilterStateV2", {
3953
+ enumerable: true,
3954
+ get: function() {
3955
+ return isFilterStateV2;
3956
+ }
3957
+ });
3958
+ Object.defineProperty(exports, "isValuelessOperator", {
3959
+ enumerable: true,
3960
+ get: function() {
3961
+ return isValuelessOperator;
3962
+ }
3963
+ });
3964
+ Object.defineProperty(exports, "pruneToRegistry", {
3965
+ enumerable: true,
3966
+ get: function() {
3967
+ return pruneToRegistry;
3968
+ }
3969
+ });
3970
+ Object.defineProperty(exports, "resolveValueControl", {
3971
+ enumerable: true,
3972
+ get: function() {
3973
+ return resolveValueControl;
3974
+ }
3975
+ });
3976
+ Object.defineProperty(exports, "useFilterBarSize", {
3977
+ enumerable: true,
3978
+ get: function() {
3979
+ return useFilterBarSize;
3980
+ }
3981
+ });
3982
+ Object.defineProperty(exports, "useFilterStateV2", {
3983
+ enumerable: true,
3984
+ get: function() {
3985
+ return useFilterStateV2;
3986
+ }
3987
+ });
3988
+ Object.defineProperty(exports, "useTableControls", {
3989
+ enumerable: true,
3990
+ get: function() {
3991
+ return useTableControls;
3992
+ }
3993
+ });
3994
+
3995
+ //# sourceMappingURL=TableControls-BtXK7Ils.cjs.map