@entifix/react-controls 0.1.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (471) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -0
  3. package/dist/i18n/catalog/en.d.ts +10 -0
  4. package/dist/i18n/catalog/en.d.ts.map +1 -0
  5. package/dist/i18n/catalog/en.js +211 -0
  6. package/dist/i18n/catalog/en.js.map +1 -0
  7. package/dist/i18n/catalog/es.d.ts +275 -0
  8. package/dist/i18n/catalog/es.d.ts.map +1 -0
  9. package/dist/i18n/catalog/es.js +261 -0
  10. package/dist/i18n/catalog/es.js.map +1 -0
  11. package/dist/i18n/catalog/index.d.ts +403 -0
  12. package/dist/i18n/catalog/index.d.ts.map +1 -0
  13. package/dist/i18n/catalog/index.js +23 -0
  14. package/dist/i18n/catalog/index.js.map +1 -0
  15. package/dist/i18n/entity-labels.d.ts +29 -0
  16. package/dist/i18n/entity-labels.d.ts.map +1 -0
  17. package/dist/i18n/entity-labels.js +49 -0
  18. package/dist/i18n/entity-labels.js.map +1 -0
  19. package/dist/i18n/fallback-catalogs.d.ts +5 -0
  20. package/dist/i18n/fallback-catalogs.d.ts.map +1 -0
  21. package/dist/i18n/fallback-catalogs.js +34 -0
  22. package/dist/i18n/fallback-catalogs.js.map +1 -0
  23. package/dist/i18n/i18n-context.d.ts +62 -0
  24. package/dist/i18n/i18n-context.d.ts.map +1 -0
  25. package/dist/i18n/i18n-context.js +128 -0
  26. package/dist/i18n/i18n-context.js.map +1 -0
  27. package/dist/i18n/index.d.ts +5 -0
  28. package/dist/i18n/index.d.ts.map +1 -0
  29. package/dist/i18n/index.js +6 -0
  30. package/dist/i18n/index.js.map +1 -0
  31. package/dist/i18n/spec-support/catalogs.d.ts +2 -0
  32. package/dist/i18n/spec-support/catalogs.d.ts.map +1 -0
  33. package/dist/i18n/spec-support/catalogs.js +142 -0
  34. package/dist/i18n/spec-support/catalogs.js.map +1 -0
  35. package/dist/i18next/index.d.ts +20 -0
  36. package/dist/i18next/index.d.ts.map +1 -0
  37. package/dist/i18next/index.js +60 -0
  38. package/dist/i18next/index.js.map +1 -0
  39. package/dist/index.d.ts +46 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +47 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/preferences/index.d.ts +7 -0
  44. package/dist/preferences/index.d.ts.map +1 -0
  45. package/dist/preferences/index.js +8 -0
  46. package/dist/preferences/index.js.map +1 -0
  47. package/dist/preferences/indexeddb-ui-preferences-state.d.ts +16 -0
  48. package/dist/preferences/indexeddb-ui-preferences-state.d.ts.map +1 -0
  49. package/dist/preferences/indexeddb-ui-preferences-state.js +50 -0
  50. package/dist/preferences/indexeddb-ui-preferences-state.js.map +1 -0
  51. package/dist/preferences/local-storage-ui-preferences-state.d.ts +16 -0
  52. package/dist/preferences/local-storage-ui-preferences-state.d.ts.map +1 -0
  53. package/dist/preferences/local-storage-ui-preferences-state.js +51 -0
  54. package/dist/preferences/local-storage-ui-preferences-state.js.map +1 -0
  55. package/dist/preferences/ui-preferences-context.d.ts +16 -0
  56. package/dist/preferences/ui-preferences-context.d.ts.map +1 -0
  57. package/dist/preferences/ui-preferences-context.js +31 -0
  58. package/dist/preferences/ui-preferences-context.js.map +1 -0
  59. package/dist/preferences/ui-preferences-state.d.ts +23 -0
  60. package/dist/preferences/ui-preferences-state.d.ts.map +1 -0
  61. package/dist/preferences/ui-preferences-state.js +5 -0
  62. package/dist/preferences/ui-preferences-state.js.map +1 -0
  63. package/dist/preferences/use-ui-preference.d.ts +20 -0
  64. package/dist/preferences/use-ui-preference.d.ts.map +1 -0
  65. package/dist/preferences/use-ui-preference.js +72 -0
  66. package/dist/preferences/use-ui-preference.js.map +1 -0
  67. package/dist/preferences/use-viewport-mode.d.ts +33 -0
  68. package/dist/preferences/use-viewport-mode.d.ts.map +1 -0
  69. package/dist/preferences/use-viewport-mode.js +53 -0
  70. package/dist/preferences/use-viewport-mode.js.map +1 -0
  71. package/dist/primitives.d.ts +25 -0
  72. package/dist/primitives.d.ts.map +1 -0
  73. package/dist/primitives.js +54 -0
  74. package/dist/primitives.js.map +1 -0
  75. package/dist/theme/index.d.ts +3 -0
  76. package/dist/theme/index.d.ts.map +1 -0
  77. package/dist/theme/index.js +4 -0
  78. package/dist/theme/index.js.map +1 -0
  79. package/dist/theme/theme-context.d.ts +26 -0
  80. package/dist/theme/theme-context.d.ts.map +1 -0
  81. package/dist/theme/theme-context.js +79 -0
  82. package/dist/theme/theme-context.js.map +1 -0
  83. package/dist/theme/types.d.ts +22 -0
  84. package/dist/theme/types.d.ts.map +1 -0
  85. package/dist/theme/types.js +6 -0
  86. package/dist/theme/types.js.map +1 -0
  87. package/dist/ui/actions/action-surfaces.d.ts +59 -0
  88. package/dist/ui/actions/action-surfaces.d.ts.map +1 -0
  89. package/dist/ui/actions/action-surfaces.js +109 -0
  90. package/dist/ui/actions/action-surfaces.js.map +1 -0
  91. package/dist/ui/actions/index.d.ts +2 -0
  92. package/dist/ui/actions/index.d.ts.map +1 -0
  93. package/dist/ui/actions/index.js +3 -0
  94. package/dist/ui/actions/index.js.map +1 -0
  95. package/dist/ui/atoms/button/button-link.d.ts +27 -0
  96. package/dist/ui/atoms/button/button-link.d.ts.map +1 -0
  97. package/dist/ui/atoms/button/button-link.js +23 -0
  98. package/dist/ui/atoms/button/button-link.js.map +1 -0
  99. package/dist/ui/atoms/button/button-recipe.d.ts +19 -0
  100. package/dist/ui/atoms/button/button-recipe.d.ts.map +1 -0
  101. package/dist/ui/atoms/button/button-recipe.js +42 -0
  102. package/dist/ui/atoms/button/button-recipe.js.map +1 -0
  103. package/dist/ui/atoms/button/button.d.ts +7 -0
  104. package/dist/ui/atoms/button/button.d.ts.map +1 -0
  105. package/dist/ui/atoms/button/button.js +22 -0
  106. package/dist/ui/atoms/button/button.js.map +1 -0
  107. package/dist/ui/atoms/button/index.d.ts +4 -0
  108. package/dist/ui/atoms/button/index.d.ts.map +1 -0
  109. package/dist/ui/atoms/button/index.js +5 -0
  110. package/dist/ui/atoms/button/index.js.map +1 -0
  111. package/dist/ui/atoms/cell-value/cell-value.d.ts +12 -0
  112. package/dist/ui/atoms/cell-value/cell-value.d.ts.map +1 -0
  113. package/dist/ui/atoms/cell-value/cell-value.js +101 -0
  114. package/dist/ui/atoms/cell-value/cell-value.js.map +1 -0
  115. package/dist/ui/atoms/cell-value/index.d.ts +2 -0
  116. package/dist/ui/atoms/cell-value/index.d.ts.map +1 -0
  117. package/dist/ui/atoms/cell-value/index.js +3 -0
  118. package/dist/ui/atoms/cell-value/index.js.map +1 -0
  119. package/dist/ui/atoms/field/checkbox.d.ts +35 -0
  120. package/dist/ui/atoms/field/checkbox.d.ts.map +1 -0
  121. package/dist/ui/atoms/field/checkbox.js +46 -0
  122. package/dist/ui/atoms/field/checkbox.js.map +1 -0
  123. package/dist/ui/atoms/field/field.d.ts +4 -0
  124. package/dist/ui/atoms/field/field.d.ts.map +1 -0
  125. package/dist/ui/atoms/field/field.js +29 -0
  126. package/dist/ui/atoms/field/field.js.map +1 -0
  127. package/dist/ui/atoms/field/index.d.ts +3 -0
  128. package/dist/ui/atoms/field/index.d.ts.map +1 -0
  129. package/dist/ui/atoms/field/index.js +4 -0
  130. package/dist/ui/atoms/field/index.js.map +1 -0
  131. package/dist/ui/atoms/field-control/field-control.d.ts +50 -0
  132. package/dist/ui/atoms/field-control/field-control.d.ts.map +1 -0
  133. package/dist/ui/atoms/field-control/field-control.js +82 -0
  134. package/dist/ui/atoms/field-control/field-control.js.map +1 -0
  135. package/dist/ui/atoms/field-control/index.d.ts +2 -0
  136. package/dist/ui/atoms/field-control/index.d.ts.map +1 -0
  137. package/dist/ui/atoms/field-control/index.js +3 -0
  138. package/dist/ui/atoms/field-control/index.js.map +1 -0
  139. package/dist/ui/atoms/skeleton/index.d.ts +2 -0
  140. package/dist/ui/atoms/skeleton/index.d.ts.map +1 -0
  141. package/dist/ui/atoms/skeleton/index.js +3 -0
  142. package/dist/ui/atoms/skeleton/index.js.map +1 -0
  143. package/dist/ui/atoms/skeleton/skeleton.d.ts +21 -0
  144. package/dist/ui/atoms/skeleton/skeleton.d.ts.map +1 -0
  145. package/dist/ui/atoms/skeleton/skeleton.js +33 -0
  146. package/dist/ui/atoms/skeleton/skeleton.js.map +1 -0
  147. package/dist/ui/atoms/table/index.d.ts +2 -0
  148. package/dist/ui/atoms/table/index.d.ts.map +1 -0
  149. package/dist/ui/atoms/table/index.js +3 -0
  150. package/dist/ui/atoms/table/index.js.map +1 -0
  151. package/dist/ui/atoms/table/table.d.ts +30 -0
  152. package/dist/ui/atoms/table/table.d.ts.map +1 -0
  153. package/dist/ui/atoms/table/table.js +84 -0
  154. package/dist/ui/atoms/table/table.js.map +1 -0
  155. package/dist/ui/atoms/text/index.d.ts +2 -0
  156. package/dist/ui/atoms/text/index.d.ts.map +1 -0
  157. package/dist/ui/atoms/text/index.js +3 -0
  158. package/dist/ui/atoms/text/index.js.map +1 -0
  159. package/dist/ui/atoms/text/text.d.ts +86 -0
  160. package/dist/ui/atoms/text/text.d.ts.map +1 -0
  161. package/dist/ui/atoms/text/text.js +221 -0
  162. package/dist/ui/atoms/text/text.js.map +1 -0
  163. package/dist/ui/layout/_demo.d.ts +6 -0
  164. package/dist/ui/layout/_demo.d.ts.map +1 -0
  165. package/dist/ui/layout/_demo.js +11 -0
  166. package/dist/ui/layout/_demo.js.map +1 -0
  167. package/dist/ui/layout/_shared.d.ts +9 -0
  168. package/dist/ui/layout/_shared.d.ts.map +1 -0
  169. package/dist/ui/layout/_shared.js +30 -0
  170. package/dist/ui/layout/_shared.js.map +1 -0
  171. package/dist/ui/layout/box/box.d.ts +10 -0
  172. package/dist/ui/layout/box/box.d.ts.map +1 -0
  173. package/dist/ui/layout/box/box.js +28 -0
  174. package/dist/ui/layout/box/box.js.map +1 -0
  175. package/dist/ui/layout/box/index.d.ts +2 -0
  176. package/dist/ui/layout/box/index.d.ts.map +1 -0
  177. package/dist/ui/layout/box/index.js +3 -0
  178. package/dist/ui/layout/box/index.js.map +1 -0
  179. package/dist/ui/layout/center/center.d.ts +13 -0
  180. package/dist/ui/layout/center/center.d.ts.map +1 -0
  181. package/dist/ui/layout/center/center.js +22 -0
  182. package/dist/ui/layout/center/center.js.map +1 -0
  183. package/dist/ui/layout/center/index.d.ts +2 -0
  184. package/dist/ui/layout/center/index.d.ts.map +1 -0
  185. package/dist/ui/layout/center/index.js +3 -0
  186. package/dist/ui/layout/center/index.js.map +1 -0
  187. package/dist/ui/layout/cluster/cluster.d.ts +11 -0
  188. package/dist/ui/layout/cluster/cluster.d.ts.map +1 -0
  189. package/dist/ui/layout/cluster/cluster.js +19 -0
  190. package/dist/ui/layout/cluster/cluster.js.map +1 -0
  191. package/dist/ui/layout/cluster/index.d.ts +2 -0
  192. package/dist/ui/layout/cluster/index.d.ts.map +1 -0
  193. package/dist/ui/layout/cluster/index.js +3 -0
  194. package/dist/ui/layout/cluster/index.js.map +1 -0
  195. package/dist/ui/layout/cover/cover.d.ts +26 -0
  196. package/dist/ui/layout/cover/cover.d.ts.map +1 -0
  197. package/dist/ui/layout/cover/cover.js +57 -0
  198. package/dist/ui/layout/cover/cover.js.map +1 -0
  199. package/dist/ui/layout/cover/index.d.ts +2 -0
  200. package/dist/ui/layout/cover/index.d.ts.map +1 -0
  201. package/dist/ui/layout/cover/index.js +3 -0
  202. package/dist/ui/layout/cover/index.js.map +1 -0
  203. package/dist/ui/layout/grid/grid.d.ts +14 -0
  204. package/dist/ui/layout/grid/grid.d.ts.map +1 -0
  205. package/dist/ui/layout/grid/grid.js +25 -0
  206. package/dist/ui/layout/grid/grid.js.map +1 -0
  207. package/dist/ui/layout/grid/index.d.ts +2 -0
  208. package/dist/ui/layout/grid/index.d.ts.map +1 -0
  209. package/dist/ui/layout/grid/index.js +3 -0
  210. package/dist/ui/layout/grid/index.js.map +1 -0
  211. package/dist/ui/layout/sidebar/index.d.ts +2 -0
  212. package/dist/ui/layout/sidebar/index.d.ts.map +1 -0
  213. package/dist/ui/layout/sidebar/index.js +3 -0
  214. package/dist/ui/layout/sidebar/index.js.map +1 -0
  215. package/dist/ui/layout/sidebar/sidebar.d.ts +33 -0
  216. package/dist/ui/layout/sidebar/sidebar.d.ts.map +1 -0
  217. package/dist/ui/layout/sidebar/sidebar.js +54 -0
  218. package/dist/ui/layout/sidebar/sidebar.js.map +1 -0
  219. package/dist/ui/layout/switcher/index.d.ts +2 -0
  220. package/dist/ui/layout/switcher/index.d.ts.map +1 -0
  221. package/dist/ui/layout/switcher/index.js +3 -0
  222. package/dist/ui/layout/switcher/index.js.map +1 -0
  223. package/dist/ui/layout/switcher/switcher.d.ts +15 -0
  224. package/dist/ui/layout/switcher/switcher.d.ts.map +1 -0
  225. package/dist/ui/layout/switcher/switcher.js +26 -0
  226. package/dist/ui/layout/switcher/switcher.js.map +1 -0
  227. package/dist/ui/molecules/breadcrumbs/breadcrumbs.d.ts +27 -0
  228. package/dist/ui/molecules/breadcrumbs/breadcrumbs.d.ts.map +1 -0
  229. package/dist/ui/molecules/breadcrumbs/breadcrumbs.js +50 -0
  230. package/dist/ui/molecules/breadcrumbs/breadcrumbs.js.map +1 -0
  231. package/dist/ui/molecules/breadcrumbs/index.d.ts +2 -0
  232. package/dist/ui/molecules/breadcrumbs/index.d.ts.map +1 -0
  233. package/dist/ui/molecules/breadcrumbs/index.js +3 -0
  234. package/dist/ui/molecules/breadcrumbs/index.js.map +1 -0
  235. package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.d.ts +47 -0
  236. package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.d.ts.map +1 -0
  237. package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.js +63 -0
  238. package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.js.map +1 -0
  239. package/dist/ui/molecules/bulk-action-bar/index.d.ts +2 -0
  240. package/dist/ui/molecules/bulk-action-bar/index.d.ts.map +1 -0
  241. package/dist/ui/molecules/bulk-action-bar/index.js +3 -0
  242. package/dist/ui/molecules/bulk-action-bar/index.js.map +1 -0
  243. package/dist/ui/molecules/bulk-result/bulk-result.d.ts +31 -0
  244. package/dist/ui/molecules/bulk-result/bulk-result.d.ts.map +1 -0
  245. package/dist/ui/molecules/bulk-result/bulk-result.js +86 -0
  246. package/dist/ui/molecules/bulk-result/bulk-result.js.map +1 -0
  247. package/dist/ui/molecules/bulk-result/index.d.ts +2 -0
  248. package/dist/ui/molecules/bulk-result/index.d.ts.map +1 -0
  249. package/dist/ui/molecules/bulk-result/index.js +3 -0
  250. package/dist/ui/molecules/bulk-result/index.js.map +1 -0
  251. package/dist/ui/molecules/card/card.d.ts +5 -0
  252. package/dist/ui/molecules/card/card.d.ts.map +1 -0
  253. package/dist/ui/molecules/card/card.js +14 -0
  254. package/dist/ui/molecules/card/card.js.map +1 -0
  255. package/dist/ui/molecules/card/index.d.ts +2 -0
  256. package/dist/ui/molecules/card/index.d.ts.map +1 -0
  257. package/dist/ui/molecules/card/index.js +3 -0
  258. package/dist/ui/molecules/card/index.js.map +1 -0
  259. package/dist/ui/molecules/column-settings/column-settings.d.ts +29 -0
  260. package/dist/ui/molecules/column-settings/column-settings.d.ts.map +1 -0
  261. package/dist/ui/molecules/column-settings/column-settings.js +117 -0
  262. package/dist/ui/molecules/column-settings/column-settings.js.map +1 -0
  263. package/dist/ui/molecules/column-settings/index.d.ts +2 -0
  264. package/dist/ui/molecules/column-settings/index.d.ts.map +1 -0
  265. package/dist/ui/molecules/column-settings/index.js +3 -0
  266. package/dist/ui/molecules/column-settings/index.js.map +1 -0
  267. package/dist/ui/molecules/confirm-dialog/confirm-dialog.d.ts +31 -0
  268. package/dist/ui/molecules/confirm-dialog/confirm-dialog.d.ts.map +1 -0
  269. package/dist/ui/molecules/confirm-dialog/confirm-dialog.js +68 -0
  270. package/dist/ui/molecules/confirm-dialog/confirm-dialog.js.map +1 -0
  271. package/dist/ui/molecules/confirm-dialog/index.d.ts +2 -0
  272. package/dist/ui/molecules/confirm-dialog/index.d.ts.map +1 -0
  273. package/dist/ui/molecules/confirm-dialog/index.js +3 -0
  274. package/dist/ui/molecules/confirm-dialog/index.js.map +1 -0
  275. package/dist/ui/molecules/drawer/drawer.d.ts +25 -0
  276. package/dist/ui/molecules/drawer/drawer.d.ts.map +1 -0
  277. package/dist/ui/molecules/drawer/drawer.js +60 -0
  278. package/dist/ui/molecules/drawer/drawer.js.map +1 -0
  279. package/dist/ui/molecules/drawer/index.d.ts +2 -0
  280. package/dist/ui/molecules/drawer/index.d.ts.map +1 -0
  281. package/dist/ui/molecules/drawer/index.js +3 -0
  282. package/dist/ui/molecules/drawer/index.js.map +1 -0
  283. package/dist/ui/molecules/entity-link-input/entity-link-input.d.ts +36 -0
  284. package/dist/ui/molecules/entity-link-input/entity-link-input.d.ts.map +1 -0
  285. package/dist/ui/molecules/entity-link-input/entity-link-input.js +191 -0
  286. package/dist/ui/molecules/entity-link-input/entity-link-input.js.map +1 -0
  287. package/dist/ui/molecules/entity-link-input/index.d.ts +2 -0
  288. package/dist/ui/molecules/entity-link-input/index.d.ts.map +1 -0
  289. package/dist/ui/molecules/entity-link-input/index.js +3 -0
  290. package/dist/ui/molecules/entity-link-input/index.js.map +1 -0
  291. package/dist/ui/molecules/entity-link-picker/entity-link-picker.d.ts +19 -0
  292. package/dist/ui/molecules/entity-link-picker/entity-link-picker.d.ts.map +1 -0
  293. package/dist/ui/molecules/entity-link-picker/entity-link-picker.js +78 -0
  294. package/dist/ui/molecules/entity-link-picker/entity-link-picker.js.map +1 -0
  295. package/dist/ui/molecules/entity-link-picker/index.d.ts +2 -0
  296. package/dist/ui/molecules/entity-link-picker/index.d.ts.map +1 -0
  297. package/dist/ui/molecules/entity-link-picker/index.js +3 -0
  298. package/dist/ui/molecules/entity-link-picker/index.js.map +1 -0
  299. package/dist/ui/molecules/entity-record-card/entity-record-card.d.ts +30 -0
  300. package/dist/ui/molecules/entity-record-card/entity-record-card.d.ts.map +1 -0
  301. package/dist/ui/molecules/entity-record-card/entity-record-card.js +39 -0
  302. package/dist/ui/molecules/entity-record-card/entity-record-card.js.map +1 -0
  303. package/dist/ui/molecules/entity-record-card/index.d.ts +2 -0
  304. package/dist/ui/molecules/entity-record-card/index.d.ts.map +1 -0
  305. package/dist/ui/molecules/entity-record-card/index.js +3 -0
  306. package/dist/ui/molecules/entity-record-card/index.js.map +1 -0
  307. package/dist/ui/molecules/filter-builder/filter-builder.d.ts +19 -0
  308. package/dist/ui/molecules/filter-builder/filter-builder.d.ts.map +1 -0
  309. package/dist/ui/molecules/filter-builder/filter-builder.js +333 -0
  310. package/dist/ui/molecules/filter-builder/filter-builder.js.map +1 -0
  311. package/dist/ui/molecules/filter-builder/filter-operators.d.ts +20 -0
  312. package/dist/ui/molecules/filter-builder/filter-operators.d.ts.map +1 -0
  313. package/dist/ui/molecules/filter-builder/filter-operators.js +56 -0
  314. package/dist/ui/molecules/filter-builder/filter-operators.js.map +1 -0
  315. package/dist/ui/molecules/filter-builder/index.d.ts +3 -0
  316. package/dist/ui/molecules/filter-builder/index.d.ts.map +1 -0
  317. package/dist/ui/molecules/filter-builder/index.js +4 -0
  318. package/dist/ui/molecules/filter-builder/index.js.map +1 -0
  319. package/dist/ui/molecules/loading-boundary/index.d.ts +2 -0
  320. package/dist/ui/molecules/loading-boundary/index.d.ts.map +1 -0
  321. package/dist/ui/molecules/loading-boundary/index.js +3 -0
  322. package/dist/ui/molecules/loading-boundary/index.js.map +1 -0
  323. package/dist/ui/molecules/loading-boundary/loading-boundary.d.ts +27 -0
  324. package/dist/ui/molecules/loading-boundary/loading-boundary.d.ts.map +1 -0
  325. package/dist/ui/molecules/loading-boundary/loading-boundary.js +42 -0
  326. package/dist/ui/molecules/loading-boundary/loading-boundary.js.map +1 -0
  327. package/dist/ui/molecules/menu/index.d.ts +2 -0
  328. package/dist/ui/molecules/menu/index.d.ts.map +1 -0
  329. package/dist/ui/molecules/menu/index.js +3 -0
  330. package/dist/ui/molecules/menu/index.js.map +1 -0
  331. package/dist/ui/molecules/menu/menu.d.ts +37 -0
  332. package/dist/ui/molecules/menu/menu.d.ts.map +1 -0
  333. package/dist/ui/molecules/menu/menu.js +71 -0
  334. package/dist/ui/molecules/menu/menu.js.map +1 -0
  335. package/dist/ui/molecules/pagination/index.d.ts +2 -0
  336. package/dist/ui/molecules/pagination/index.d.ts.map +1 -0
  337. package/dist/ui/molecules/pagination/index.js +3 -0
  338. package/dist/ui/molecules/pagination/index.js.map +1 -0
  339. package/dist/ui/molecules/pagination/pagination.d.ts +13 -0
  340. package/dist/ui/molecules/pagination/pagination.d.ts.map +1 -0
  341. package/dist/ui/molecules/pagination/pagination.js +68 -0
  342. package/dist/ui/molecules/pagination/pagination.js.map +1 -0
  343. package/dist/ui/molecules/sort-builder/index.d.ts +2 -0
  344. package/dist/ui/molecules/sort-builder/index.d.ts.map +1 -0
  345. package/dist/ui/molecules/sort-builder/index.js +3 -0
  346. package/dist/ui/molecules/sort-builder/index.js.map +1 -0
  347. package/dist/ui/molecules/sort-builder/sort-builder.d.ts +18 -0
  348. package/dist/ui/molecules/sort-builder/sort-builder.d.ts.map +1 -0
  349. package/dist/ui/molecules/sort-builder/sort-builder.js +185 -0
  350. package/dist/ui/molecules/sort-builder/sort-builder.js.map +1 -0
  351. package/dist/ui/molecules/stack/index.d.ts +2 -0
  352. package/dist/ui/molecules/stack/index.d.ts.map +1 -0
  353. package/dist/ui/molecules/stack/index.js +3 -0
  354. package/dist/ui/molecules/stack/index.js.map +1 -0
  355. package/dist/ui/molecules/stack/stack.d.ts +12 -0
  356. package/dist/ui/molecules/stack/stack.d.ts.map +1 -0
  357. package/dist/ui/molecules/stack/stack.js +36 -0
  358. package/dist/ui/molecules/stack/stack.js.map +1 -0
  359. package/dist/ui/molecules/tab-strip/index.d.ts +2 -0
  360. package/dist/ui/molecules/tab-strip/index.d.ts.map +1 -0
  361. package/dist/ui/molecules/tab-strip/index.js +3 -0
  362. package/dist/ui/molecules/tab-strip/index.js.map +1 -0
  363. package/dist/ui/molecules/tab-strip/tab-strip.d.ts +29 -0
  364. package/dist/ui/molecules/tab-strip/tab-strip.d.ts.map +1 -0
  365. package/dist/ui/molecules/tab-strip/tab-strip.js +82 -0
  366. package/dist/ui/molecules/tab-strip/tab-strip.js.map +1 -0
  367. package/dist/ui/molecules/table-toolbar/index.d.ts +2 -0
  368. package/dist/ui/molecules/table-toolbar/index.d.ts.map +1 -0
  369. package/dist/ui/molecules/table-toolbar/index.js +3 -0
  370. package/dist/ui/molecules/table-toolbar/index.js.map +1 -0
  371. package/dist/ui/molecules/table-toolbar/table-toolbar.d.ts +13 -0
  372. package/dist/ui/molecules/table-toolbar/table-toolbar.d.ts.map +1 -0
  373. package/dist/ui/molecules/table-toolbar/table-toolbar.js +28 -0
  374. package/dist/ui/molecules/table-toolbar/table-toolbar.js.map +1 -0
  375. package/dist/ui/molecules/theme-switcher/index.d.ts +2 -0
  376. package/dist/ui/molecules/theme-switcher/index.d.ts.map +1 -0
  377. package/dist/ui/molecules/theme-switcher/index.js +3 -0
  378. package/dist/ui/molecules/theme-switcher/index.js.map +1 -0
  379. package/dist/ui/molecules/theme-switcher/theme-switcher.d.ts +6 -0
  380. package/dist/ui/molecules/theme-switcher/theme-switcher.d.ts.map +1 -0
  381. package/dist/ui/molecules/theme-switcher/theme-switcher.js +24 -0
  382. package/dist/ui/molecules/theme-switcher/theme-switcher.js.map +1 -0
  383. package/dist/ui/organisms/command-palette/command-palette.d.ts +67 -0
  384. package/dist/ui/organisms/command-palette/command-palette.d.ts.map +1 -0
  385. package/dist/ui/organisms/command-palette/command-palette.js +226 -0
  386. package/dist/ui/organisms/command-palette/command-palette.js.map +1 -0
  387. package/dist/ui/organisms/command-palette/index.d.ts +2 -0
  388. package/dist/ui/organisms/command-palette/index.d.ts.map +1 -0
  389. package/dist/ui/organisms/command-palette/index.js +3 -0
  390. package/dist/ui/organisms/command-palette/index.js.map +1 -0
  391. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.d.ts +43 -0
  392. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.d.ts.map +1 -0
  393. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.js +281 -0
  394. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.js.map +1 -0
  395. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.d.ts +49 -0
  396. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.d.ts.map +1 -0
  397. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.js +3 -0
  398. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.types.js.map +1 -0
  399. package/dist/ui/organisms/entity-detail-grid/index.d.ts +3 -0
  400. package/dist/ui/organisms/entity-detail-grid/index.d.ts.map +1 -0
  401. package/dist/ui/organisms/entity-detail-grid/index.js +4 -0
  402. package/dist/ui/organisms/entity-detail-grid/index.js.map +1 -0
  403. package/dist/ui/organisms/entity-form/entity-form-slots.d.ts +53 -0
  404. package/dist/ui/organisms/entity-form/entity-form-slots.d.ts.map +1 -0
  405. package/dist/ui/organisms/entity-form/entity-form-slots.js +44 -0
  406. package/dist/ui/organisms/entity-form/entity-form-slots.js.map +1 -0
  407. package/dist/ui/organisms/entity-form/entity-form.d.ts +4 -0
  408. package/dist/ui/organisms/entity-form/entity-form.d.ts.map +1 -0
  409. package/dist/ui/organisms/entity-form/entity-form.js +494 -0
  410. package/dist/ui/organisms/entity-form/entity-form.js.map +1 -0
  411. package/dist/ui/organisms/entity-form/entity-form.types.d.ts +151 -0
  412. package/dist/ui/organisms/entity-form/entity-form.types.d.ts.map +1 -0
  413. package/dist/ui/organisms/entity-form/entity-form.types.js +3 -0
  414. package/dist/ui/organisms/entity-form/entity-form.types.js.map +1 -0
  415. package/dist/ui/organisms/entity-form/index.d.ts +5 -0
  416. package/dist/ui/organisms/entity-form/index.d.ts.map +1 -0
  417. package/dist/ui/organisms/entity-form/index.js +6 -0
  418. package/dist/ui/organisms/entity-form/index.js.map +1 -0
  419. package/dist/ui/organisms/entity-form/use-entity-form-fields.d.ts +13 -0
  420. package/dist/ui/organisms/entity-form/use-entity-form-fields.d.ts.map +1 -0
  421. package/dist/ui/organisms/entity-form/use-entity-form-fields.js +50 -0
  422. package/dist/ui/organisms/entity-form/use-entity-form-fields.js.map +1 -0
  423. package/dist/ui/organisms/entity-table/entity-table-slots.d.ts +55 -0
  424. package/dist/ui/organisms/entity-table/entity-table-slots.d.ts.map +1 -0
  425. package/dist/ui/organisms/entity-table/entity-table-slots.js +50 -0
  426. package/dist/ui/organisms/entity-table/entity-table-slots.js.map +1 -0
  427. package/dist/ui/organisms/entity-table/entity-table.d.ts +4 -0
  428. package/dist/ui/organisms/entity-table/entity-table.d.ts.map +1 -0
  429. package/dist/ui/organisms/entity-table/entity-table.js +529 -0
  430. package/dist/ui/organisms/entity-table/entity-table.js.map +1 -0
  431. package/dist/ui/organisms/entity-table/entity-table.types.d.ts +126 -0
  432. package/dist/ui/organisms/entity-table/entity-table.types.d.ts.map +1 -0
  433. package/dist/ui/organisms/entity-table/entity-table.types.js +3 -0
  434. package/dist/ui/organisms/entity-table/entity-table.types.js.map +1 -0
  435. package/dist/ui/organisms/entity-table/index.d.ts +5 -0
  436. package/dist/ui/organisms/entity-table/index.d.ts.map +1 -0
  437. package/dist/ui/organisms/entity-table/index.js +6 -0
  438. package/dist/ui/organisms/entity-table/index.js.map +1 -0
  439. package/dist/ui/organisms/entity-table/use-entity-table-columns.d.ts +29 -0
  440. package/dist/ui/organisms/entity-table/use-entity-table-columns.d.ts.map +1 -0
  441. package/dist/ui/organisms/entity-table/use-entity-table-columns.js +103 -0
  442. package/dist/ui/organisms/entity-table/use-entity-table-columns.js.map +1 -0
  443. package/dist/ui/organisms/top-bar/index.d.ts +2 -0
  444. package/dist/ui/organisms/top-bar/index.d.ts.map +1 -0
  445. package/dist/ui/organisms/top-bar/index.js +3 -0
  446. package/dist/ui/organisms/top-bar/index.js.map +1 -0
  447. package/dist/ui/organisms/top-bar/top-bar.d.ts +20 -0
  448. package/dist/ui/organisms/top-bar/top-bar.d.ts.map +1 -0
  449. package/dist/ui/organisms/top-bar/top-bar.js +43 -0
  450. package/dist/ui/organisms/top-bar/top-bar.js.map +1 -0
  451. package/dist/ui/organisms/wizard/index.d.ts +3 -0
  452. package/dist/ui/organisms/wizard/index.d.ts.map +1 -0
  453. package/dist/ui/organisms/wizard/index.js +4 -0
  454. package/dist/ui/organisms/wizard/index.js.map +1 -0
  455. package/dist/ui/organisms/wizard/wizard.d.ts +21 -0
  456. package/dist/ui/organisms/wizard/wizard.d.ts.map +1 -0
  457. package/dist/ui/organisms/wizard/wizard.js +260 -0
  458. package/dist/ui/organisms/wizard/wizard.js.map +1 -0
  459. package/dist/ui/organisms/wizard/wizard.types.d.ts +83 -0
  460. package/dist/ui/organisms/wizard/wizard.types.d.ts.map +1 -0
  461. package/dist/ui/organisms/wizard/wizard.types.js +3 -0
  462. package/dist/ui/organisms/wizard/wizard.types.js.map +1 -0
  463. package/dist/ui/utils/cn.d.ts +4 -0
  464. package/dist/ui/utils/cn.d.ts.map +1 -0
  465. package/dist/ui/utils/cn.js +5 -0
  466. package/dist/ui/utils/cn.js.map +1 -0
  467. package/dist/ui/utils/use-hotkey.d.ts +31 -0
  468. package/dist/ui/utils/use-hotkey.d.ts.map +1 -0
  469. package/dist/ui/utils/use-hotkey.js +69 -0
  470. package/dist/ui/utils/use-hotkey.js.map +1 -0
  471. package/package.json +118 -0
@@ -0,0 +1,333 @@
1
+ 'use client';
2
+ import { _ as _extends } from "@swc/helpers/_/_extends";
3
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
4
+ import { useCallback, useId, useState } from 'react';
5
+ import { useEnumLabel, useT } from '../../../i18n/index.js';
6
+ import { Button } from '../../atoms/button/index.js';
7
+ import { Select, TextInput } from '../../atoms/field/index.js';
8
+ import { Text } from '../../atoms/text/index.js';
9
+ import { operatorArity, operatorLabelKey, operatorsForType } from './filter-operators.js';
10
+ function coerce(raw, type) {
11
+ if (raw === '') return undefined;
12
+ switch(type){
13
+ case 'number':
14
+ return Number(raw);
15
+ case 'boolean':
16
+ return raw === 'true';
17
+ case 'date':
18
+ return new Date(raw);
19
+ default:
20
+ return raw;
21
+ }
22
+ }
23
+ /**
24
+ * Converts a draft row into the wire filter, or `undefined` while the row is
25
+ * still incomplete — a half-typed row must not reach the load request.
26
+ */ function toFilter(draft, descriptor) {
27
+ const property = descriptor.key;
28
+ switch(operatorArity(draft.operator)){
29
+ case 'none':
30
+ return {
31
+ property,
32
+ operator: draft.operator
33
+ };
34
+ case 'list':
35
+ {
36
+ const values = draft.value.split(',').map((entry)=>entry.trim()).filter((entry)=>entry !== '').map((entry)=>coerce(entry, descriptor.type));
37
+ return values.length === 0 ? undefined : {
38
+ property,
39
+ operator: draft.operator,
40
+ values
41
+ };
42
+ }
43
+ case 'range':
44
+ {
45
+ const start = coerce(draft.value, descriptor.type);
46
+ const end = coerce(draft.end, descriptor.type);
47
+ return start === undefined || end === undefined ? undefined : {
48
+ property,
49
+ operator: draft.operator,
50
+ start,
51
+ end
52
+ };
53
+ }
54
+ default:
55
+ {
56
+ const value = coerce(draft.value, descriptor.type);
57
+ return value === undefined ? undefined : {
58
+ property,
59
+ operator: draft.operator,
60
+ value
61
+ };
62
+ }
63
+ }
64
+ }
65
+ /**
66
+ * Rebuilds the editable rows from an already-applied filter, so reopening the
67
+ * panel shows what is actually in effect rather than an empty form. Only the
68
+ * flat rows this builder can express are restored — a group nested by some
69
+ * other means is left to the caller to re-enter.
70
+ */ function toDrafts(filtering, idPrefix) {
71
+ if (!filtering) return [];
72
+ return filtering.values.flatMap((node, index)=>{
73
+ var _filter_start;
74
+ if (!('property' in node)) return [];
75
+ const filter = node;
76
+ const text = (value)=>value instanceof Date ? value.toISOString().slice(0, 10) : value === undefined ? '' : String(value);
77
+ return [
78
+ {
79
+ key: `${idPrefix}-applied-${index}`,
80
+ property: String(filter.property),
81
+ operator: filter.operator,
82
+ value: filter.values ? filter.values.map(text).join(', ') : text((_filter_start = filter.start) != null ? _filter_start : filter.value),
83
+ end: text(filter.end)
84
+ }
85
+ ];
86
+ });
87
+ }
88
+ /**
89
+ * Builds an `EntityFiltering` value from entity metadata: the member list, the
90
+ * operators offered and the shape of the value control all come from each
91
+ * member's descriptor, so no per-entity filter UI has to be written.
92
+ *
93
+ * Editing is a draft. `onChange` fires only on **Apply**, because the value
94
+ * feeds a load request: emitting per keystroke would put one HTTP request on
95
+ * the wire per character typed.
96
+ */ export function FilterBuilder({ descriptors, value: applied, onChange }) {
97
+ var _ref;
98
+ const t = useT();
99
+ const idPrefix = useId();
100
+ const [logic, setLogic] = useState((_ref = applied == null ? void 0 : applied.operator) != null ? _ref : 'and');
101
+ const [drafts, setDrafts] = useState(()=>toDrafts(applied, idPrefix));
102
+ const descriptorFor = useCallback((name)=>descriptors.find((entry)=>entry.name === name), [
103
+ descriptors
104
+ ]);
105
+ const apply = useCallback((nextDrafts, nextLogic)=>{
106
+ const values = nextDrafts.map((draft)=>{
107
+ const descriptor = descriptorFor(draft.property);
108
+ return descriptor ? toFilter(draft, descriptor) : undefined;
109
+ }).filter((filter)=>filter !== undefined);
110
+ onChange({
111
+ operator: nextLogic,
112
+ values
113
+ });
114
+ }, [
115
+ descriptorFor,
116
+ onChange
117
+ ]);
118
+ /** Edits the draft only — nothing reaches the caller until Apply. */ const update = (nextDrafts)=>setDrafts(nextDrafts);
119
+ const addRow = ()=>{
120
+ const first = descriptors[0];
121
+ // Defence in depth: the component returns early for an empty descriptor
122
+ // list, so this button does not exist without a first member.
123
+ /* v8 ignore next */ if (!first) return;
124
+ update([
125
+ ...drafts,
126
+ {
127
+ key: `${idPrefix}-${drafts.length}-${Date.now()}`,
128
+ property: first.name,
129
+ operator: operatorsForType(first.type)[0],
130
+ value: '',
131
+ end: ''
132
+ }
133
+ ]);
134
+ };
135
+ const patch = (key, changes)=>update(drafts.map((draft)=>draft.key === key ? _extends({}, draft, changes) : draft));
136
+ if (descriptors.length === 0) {
137
+ return /*#__PURE__*/ _jsx(Text, {
138
+ step: -1,
139
+ tone: "muted",
140
+ children: t('filter.none')
141
+ });
142
+ }
143
+ return /*#__PURE__*/ _jsxs("div", {
144
+ className: "flex flex-col gap-2xs",
145
+ children: [
146
+ /*#__PURE__*/ _jsxs("div", {
147
+ className: "flex items-center gap-2xs",
148
+ children: [
149
+ /*#__PURE__*/ _jsx(Text, {
150
+ step: -2,
151
+ tone: "muted",
152
+ children: t('filter.match')
153
+ }),
154
+ /*#__PURE__*/ _jsxs(Select, {
155
+ "aria-label": t('filter.matchAria'),
156
+ value: logic,
157
+ onChange: (event)=>{
158
+ setLogic(event.target.value);
159
+ },
160
+ children: [
161
+ /*#__PURE__*/ _jsx("option", {
162
+ value: "and",
163
+ children: t('filter.all')
164
+ }),
165
+ /*#__PURE__*/ _jsx("option", {
166
+ value: "or",
167
+ children: t('filter.any')
168
+ })
169
+ ]
170
+ })
171
+ ]
172
+ }),
173
+ drafts.map((draft)=>{
174
+ const descriptor = descriptorFor(draft.property);
175
+ if (!descriptor) return null;
176
+ const arity = operatorArity(draft.operator);
177
+ return /*#__PURE__*/ _jsxs("div", {
178
+ className: "flex flex-wrap items-center gap-2xs",
179
+ children: [
180
+ /*#__PURE__*/ _jsx(Select, {
181
+ "aria-label": t('filter.member'),
182
+ value: draft.property,
183
+ onChange: (event)=>{
184
+ const next = descriptorFor(event.target.value);
185
+ // Defence in depth: the options are built from `descriptors`,
186
+ // so a chosen value always resolves.
187
+ /* v8 ignore next */ if (!next) return;
188
+ patch(draft.key, {
189
+ property: next.name,
190
+ // The previous operator may not exist for the new type.
191
+ operator: operatorsForType(next.type)[0],
192
+ value: '',
193
+ end: ''
194
+ });
195
+ },
196
+ children: descriptors.map((entry)=>/*#__PURE__*/ _jsx("option", {
197
+ value: entry.name,
198
+ children: entry.label
199
+ }, entry.name))
200
+ }),
201
+ /*#__PURE__*/ _jsx(Select, {
202
+ "aria-label": t('filter.operator'),
203
+ value: draft.operator,
204
+ onChange: (event)=>patch(draft.key, {
205
+ operator: event.target.value
206
+ }),
207
+ children: operatorsForType(descriptor.type).map((operator)=>/*#__PURE__*/ _jsx("option", {
208
+ value: operator,
209
+ children: t(operatorLabelKey(operator))
210
+ }, operator))
211
+ }),
212
+ arity !== 'none' && /*#__PURE__*/ _jsx(FilterValueInput, {
213
+ descriptor: descriptor,
214
+ arity: arity,
215
+ value: draft.value,
216
+ end: draft.end,
217
+ onValueChange: (value)=>patch(draft.key, {
218
+ value
219
+ }),
220
+ onEndChange: (end)=>patch(draft.key, {
221
+ end
222
+ })
223
+ }),
224
+ /*#__PURE__*/ _jsx(Button, {
225
+ type: "button",
226
+ variant: "ghost",
227
+ size: "sm",
228
+ "aria-label": t('filter.remove'),
229
+ onClick: ()=>update(drafts.filter((entry)=>entry.key !== draft.key)),
230
+ children: "✕"
231
+ })
232
+ ]
233
+ }, draft.key);
234
+ }),
235
+ /*#__PURE__*/ _jsxs("div", {
236
+ className: "flex flex-wrap items-center gap-2xs",
237
+ children: [
238
+ /*#__PURE__*/ _jsx(Button, {
239
+ type: "button",
240
+ variant: "secondary",
241
+ size: "sm",
242
+ onClick: addRow,
243
+ children: t('filter.add')
244
+ }),
245
+ /*#__PURE__*/ _jsx(Button, {
246
+ type: "button",
247
+ variant: "primary",
248
+ size: "sm",
249
+ "aria-label": t('filter.applyAria'),
250
+ onClick: ()=>apply(drafts, logic),
251
+ children: t('filter.apply')
252
+ }),
253
+ /*#__PURE__*/ _jsx(Button, {
254
+ type: "button",
255
+ variant: "ghost",
256
+ size: "sm",
257
+ "aria-label": t('filter.clearAria'),
258
+ onClick: ()=>{
259
+ setDrafts([]);
260
+ setLogic('and');
261
+ // Applying the emptied form is what actually clears the listing;
262
+ // dropping the rows alone would leave the old filter in effect.
263
+ apply([], 'and');
264
+ },
265
+ children: t('filter.clear')
266
+ })
267
+ ]
268
+ })
269
+ ]
270
+ });
271
+ }
272
+ /** The value control the member's type calls for. */ function FilterValueInput({ descriptor, arity, value, end, onValueChange, onEndChange }) {
273
+ const t = useT();
274
+ const enumLabel = useEnumLabel();
275
+ if (descriptor.type === 'boolean') {
276
+ return /*#__PURE__*/ _jsxs(Select, {
277
+ "aria-label": t('filter.value'),
278
+ value: value,
279
+ onChange: (event)=>onValueChange(event.target.value),
280
+ children: [
281
+ /*#__PURE__*/ _jsx("option", {
282
+ value: "",
283
+ children: "—"
284
+ }),
285
+ /*#__PURE__*/ _jsx("option", {
286
+ value: "true",
287
+ children: t('value.yes')
288
+ }),
289
+ /*#__PURE__*/ _jsx("option", {
290
+ value: "false",
291
+ children: t('value.no')
292
+ })
293
+ ]
294
+ });
295
+ }
296
+ if (descriptor.type === 'enum' && descriptor.enumValues && arity !== 'list') {
297
+ return /*#__PURE__*/ _jsxs(Select, {
298
+ "aria-label": t('filter.value'),
299
+ value: value,
300
+ onChange: (event)=>onValueChange(event.target.value),
301
+ children: [
302
+ /*#__PURE__*/ _jsx("option", {
303
+ value: "",
304
+ children: "—"
305
+ }),
306
+ descriptor.enumValues.map((option)=>/*#__PURE__*/ _jsx("option", {
307
+ value: option,
308
+ children: enumLabel(descriptor, option)
309
+ }, option))
310
+ ]
311
+ });
312
+ }
313
+ const inputType = descriptor.type === 'number' ? 'number' : descriptor.type === 'date' ? 'date' : 'text';
314
+ return /*#__PURE__*/ _jsxs(_Fragment, {
315
+ children: [
316
+ /*#__PURE__*/ _jsx(TextInput, {
317
+ "aria-label": t('filter.value'),
318
+ type: arity === 'list' ? 'text' : inputType,
319
+ placeholder: arity === 'list' ? t('filter.listPlaceholder') : undefined,
320
+ value: value,
321
+ onChange: (event)=>onValueChange(event.target.value)
322
+ }),
323
+ arity === 'range' && /*#__PURE__*/ _jsx(TextInput, {
324
+ "aria-label": t('filter.rangeEnd'),
325
+ type: inputType,
326
+ value: end,
327
+ onChange: (event)=>onEndChange(event.target.value)
328
+ })
329
+ ]
330
+ });
331
+ }
332
+
333
+ //# sourceMappingURL=filter-builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/molecules/filter-builder/filter-builder.tsx"],"sourcesContent":["'use client';\n\nimport type {\n Entity,\n EntityFieldDescriptor,\n EntityFilter,\n FilterGroup,\n LogicOperator,\n MetaAccessorType,\n} from '@entifix/core';\nimport { useCallback, useId, useState } from 'react';\n\nimport { useEnumLabel, useT } from '../../../i18n/index.js';\nimport { Button } from '../../atoms/button/index.js';\nimport { Select, TextInput } from '../../atoms/field/index.js';\nimport { Text } from '../../atoms/text/index.js';\nimport {\n type EntityFilterOperator,\n operatorArity,\n operatorLabelKey,\n operatorsForType,\n} from './filter-operators.js';\n\n/**\n * One in-progress filter row. Values are held as strings because that is what\n * the inputs produce; they are coerced to the member's type only when the row\n * is converted into an {@link EntityFilter}.\n */\ninterface FilterDraft {\n key: string;\n property: string;\n operator: EntityFilterOperator;\n value: string;\n end: string;\n}\n\nfunction coerce(raw: string, type: MetaAccessorType): unknown {\n if (raw === '') return undefined;\n switch (type) {\n case 'number':\n return Number(raw);\n case 'boolean':\n return raw === 'true';\n case 'date':\n return new Date(raw);\n default:\n return raw;\n }\n}\n\n/**\n * Converts a draft row into the wire filter, or `undefined` while the row is\n * still incomplete — a half-typed row must not reach the load request.\n */\nfunction toFilter<TEntity extends Entity>(\n draft: FilterDraft,\n descriptor: EntityFieldDescriptor,\n): EntityFilter<TEntity> | undefined {\n const property = descriptor.key as keyof TEntity;\n\n switch (operatorArity(draft.operator)) {\n case 'none':\n return { property, operator: draft.operator } as EntityFilter<TEntity>;\n case 'list': {\n const values = draft.value\n .split(',')\n .map(entry => entry.trim())\n .filter(entry => entry !== '')\n .map(entry => coerce(entry, descriptor.type));\n return values.length === 0\n ? undefined\n : ({\n property,\n operator: draft.operator,\n values,\n } as EntityFilter<TEntity>);\n }\n case 'range': {\n const start = coerce(draft.value, descriptor.type);\n const end = coerce(draft.end, descriptor.type);\n return start === undefined || end === undefined\n ? undefined\n : ({\n property,\n operator: draft.operator,\n start,\n end,\n } as EntityFilter<TEntity>);\n }\n default: {\n const value = coerce(draft.value, descriptor.type);\n return value === undefined\n ? undefined\n : ({\n property,\n operator: draft.operator,\n value,\n } as EntityFilter<TEntity>);\n }\n }\n}\n\n/**\n * Rebuilds the editable rows from an already-applied filter, so reopening the\n * panel shows what is actually in effect rather than an empty form. Only the\n * flat rows this builder can express are restored — a group nested by some\n * other means is left to the caller to re-enter.\n */\nfunction toDrafts<TEntity extends Entity>(\n filtering: FilterGroup<TEntity> | undefined,\n idPrefix: string,\n): FilterDraft[] {\n if (!filtering) return [];\n\n return filtering.values.flatMap((node, index) => {\n if (!('property' in node)) return [];\n const filter = node as {\n property: unknown;\n operator: EntityFilterOperator;\n value?: unknown;\n values?: unknown[];\n start?: unknown;\n end?: unknown;\n };\n const text = (value: unknown) =>\n value instanceof Date\n ? value.toISOString().slice(0, 10)\n : value === undefined\n ? ''\n : String(value);\n\n return [\n {\n key: `${idPrefix}-applied-${index}`,\n property: String(filter.property),\n operator: filter.operator,\n value: filter.values\n ? filter.values.map(text).join(', ')\n : text(filter.start ?? filter.value),\n end: text(filter.end),\n },\n ];\n });\n}\n\nexport interface FilterBuilderProps<TEntity extends Entity> {\n /** Filterable members, already resolved from the entity metadata. */\n descriptors: readonly EntityFieldDescriptor[];\n /** The filtering currently applied, used to seed the rows. */\n value?: FilterGroup<TEntity>;\n onChange: (filtering: FilterGroup<TEntity>) => void;\n}\n\n/**\n * Builds an `EntityFiltering` value from entity metadata: the member list, the\n * operators offered and the shape of the value control all come from each\n * member's descriptor, so no per-entity filter UI has to be written.\n *\n * Editing is a draft. `onChange` fires only on **Apply**, because the value\n * feeds a load request: emitting per keystroke would put one HTTP request on\n * the wire per character typed.\n */\nexport function FilterBuilder<TEntity extends Entity>({\n descriptors,\n value: applied,\n onChange,\n}: FilterBuilderProps<TEntity>) {\n const t = useT();\n const idPrefix = useId();\n const [logic, setLogic] = useState<LogicOperator>(applied?.operator ?? 'and');\n const [drafts, setDrafts] = useState<FilterDraft[]>(() =>\n toDrafts(applied, idPrefix),\n );\n\n const descriptorFor = useCallback(\n (name: string) => descriptors.find(entry => entry.name === name),\n [descriptors],\n );\n\n const apply = useCallback(\n (nextDrafts: FilterDraft[], nextLogic: LogicOperator) => {\n const values = nextDrafts\n .map(draft => {\n const descriptor = descriptorFor(draft.property);\n return descriptor ? toFilter<TEntity>(draft, descriptor) : undefined;\n })\n .filter(\n (filter): filter is EntityFilter<TEntity> => filter !== undefined,\n );\n\n onChange({ operator: nextLogic, values });\n },\n [descriptorFor, onChange],\n );\n\n /** Edits the draft only — nothing reaches the caller until Apply. */\n const update = (nextDrafts: FilterDraft[]) => setDrafts(nextDrafts);\n\n const addRow = () => {\n const first = descriptors[0];\n // Defence in depth: the component returns early for an empty descriptor\n // list, so this button does not exist without a first member.\n /* v8 ignore next */\n if (!first) return;\n update([\n ...drafts,\n {\n key: `${idPrefix}-${drafts.length}-${Date.now()}`,\n property: first.name,\n operator: operatorsForType(first.type)[0],\n value: '',\n end: '',\n },\n ]);\n };\n\n const patch = (key: string, changes: Partial<FilterDraft>) =>\n update(\n drafts.map(draft =>\n draft.key === key ? { ...draft, ...changes } : draft,\n ),\n );\n\n if (descriptors.length === 0) {\n return (\n <Text step={-1} tone=\"muted\">\n {t('filter.none')}\n </Text>\n );\n }\n\n return (\n <div className=\"flex flex-col gap-2xs\">\n <div className=\"flex items-center gap-2xs\">\n <Text step={-2} tone=\"muted\">\n {t('filter.match')}\n </Text>\n <Select\n aria-label={t('filter.matchAria')}\n value={logic}\n onChange={event => {\n setLogic(event.target.value as LogicOperator);\n }}\n >\n <option value=\"and\">{t('filter.all')}</option>\n <option value=\"or\">{t('filter.any')}</option>\n </Select>\n </div>\n\n {drafts.map(draft => {\n const descriptor = descriptorFor(draft.property);\n if (!descriptor) return null;\n const arity = operatorArity(draft.operator);\n\n return (\n <div key={draft.key} className=\"flex flex-wrap items-center gap-2xs\">\n <Select\n aria-label={t('filter.member')}\n value={draft.property}\n onChange={event => {\n const next = descriptorFor(event.target.value);\n // Defence in depth: the options are built from `descriptors`,\n // so a chosen value always resolves.\n /* v8 ignore next */\n if (!next) return;\n patch(draft.key, {\n property: next.name,\n // The previous operator may not exist for the new type.\n operator: operatorsForType(next.type)[0],\n value: '',\n end: '',\n });\n }}\n >\n {descriptors.map(entry => (\n <option key={entry.name} value={entry.name}>\n {entry.label}\n </option>\n ))}\n </Select>\n\n <Select\n aria-label={t('filter.operator')}\n value={draft.operator}\n onChange={event =>\n patch(draft.key, {\n operator: event.target.value as EntityFilterOperator,\n })\n }\n >\n {operatorsForType(descriptor.type).map(operator => (\n <option key={operator} value={operator}>\n {t(operatorLabelKey(operator))}\n </option>\n ))}\n </Select>\n\n {arity !== 'none' && (\n <FilterValueInput\n descriptor={descriptor}\n arity={arity}\n value={draft.value}\n end={draft.end}\n onValueChange={value => patch(draft.key, { value })}\n onEndChange={end => patch(draft.key, { end })}\n />\n )}\n\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n aria-label={t('filter.remove')}\n onClick={() =>\n update(drafts.filter(entry => entry.key !== draft.key))\n }\n >\n ✕\n </Button>\n </div>\n );\n })}\n\n <div className=\"flex flex-wrap items-center gap-2xs\">\n <Button type=\"button\" variant=\"secondary\" size=\"sm\" onClick={addRow}>\n {t('filter.add')}\n </Button>\n <Button\n type=\"button\"\n variant=\"primary\"\n size=\"sm\"\n aria-label={t('filter.applyAria')}\n onClick={() => apply(drafts, logic)}\n >\n {t('filter.apply')}\n </Button>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n aria-label={t('filter.clearAria')}\n onClick={() => {\n setDrafts([]);\n setLogic('and');\n // Applying the emptied form is what actually clears the listing;\n // dropping the rows alone would leave the old filter in effect.\n apply([], 'and');\n }}\n >\n {t('filter.clear')}\n </Button>\n </div>\n </div>\n );\n}\n\ninterface FilterValueInputProps {\n descriptor: EntityFieldDescriptor;\n arity: ReturnType<typeof operatorArity>;\n value: string;\n end: string;\n onValueChange: (value: string) => void;\n onEndChange: (end: string) => void;\n}\n\n/** The value control the member's type calls for. */\nfunction FilterValueInput({\n descriptor,\n arity,\n value,\n end,\n onValueChange,\n onEndChange,\n}: FilterValueInputProps) {\n const t = useT();\n const enumLabel = useEnumLabel();\n\n if (descriptor.type === 'boolean') {\n return (\n <Select\n aria-label={t('filter.value')}\n value={value}\n onChange={event => onValueChange(event.target.value)}\n >\n <option value=\"\">—</option>\n <option value=\"true\">{t('value.yes')}</option>\n <option value=\"false\">{t('value.no')}</option>\n </Select>\n );\n }\n\n if (descriptor.type === 'enum' && descriptor.enumValues && arity !== 'list') {\n return (\n <Select\n aria-label={t('filter.value')}\n value={value}\n onChange={event => onValueChange(event.target.value)}\n >\n <option value=\"\">—</option>\n {descriptor.enumValues.map(option => (\n <option key={option} value={option}>\n {enumLabel(descriptor, option)}\n </option>\n ))}\n </Select>\n );\n }\n\n const inputType =\n descriptor.type === 'number'\n ? 'number'\n : descriptor.type === 'date'\n ? 'date'\n : 'text';\n\n return (\n <>\n <TextInput\n aria-label={t('filter.value')}\n type={arity === 'list' ? 'text' : inputType}\n placeholder={arity === 'list' ? t('filter.listPlaceholder') : undefined}\n value={value}\n onChange={event => onValueChange(event.target.value)}\n />\n {arity === 'range' && (\n <TextInput\n aria-label={t('filter.rangeEnd')}\n type={inputType}\n value={end}\n onChange={event => onEndChange(event.target.value)}\n />\n )}\n </>\n );\n}\n"],"names":["useCallback","useId","useState","useEnumLabel","useT","Button","Select","TextInput","Text","operatorArity","operatorLabelKey","operatorsForType","coerce","raw","type","undefined","Number","Date","toFilter","draft","descriptor","property","key","operator","values","value","split","map","entry","trim","filter","length","start","end","toDrafts","filtering","idPrefix","flatMap","node","index","text","toISOString","slice","String","join","FilterBuilder","descriptors","applied","onChange","t","logic","setLogic","drafts","setDrafts","descriptorFor","name","find","apply","nextDrafts","nextLogic","update","addRow","first","now","patch","changes","step","tone","div","className","aria-label","event","target","option","arity","next","label","FilterValueInput","onValueChange","onEndChange","variant","size","onClick","enumLabel","enumValues","inputType","placeholder"],"mappings":"AAAA;;;AA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cAAYrB,EAAE;YACdxB,OAAOA;YACPuB,UAAUuB,CAAAA,QAASO,cAAcP,MAAMC,MAAM,CAAC/C,KAAK;;8BAEnD,KAACgD;oBAAOhD,OAAM;8BAAG;;8BACjB,KAACgD;oBAAOhD,OAAM;8BAAQwB,EAAE;;8BACxB,KAACwB;oBAAOhD,OAAM;8BAASwB,EAAE;;;;IAG/B;IAEA,IAAI7B,WAAWN,IAAI,KAAK,UAAUM,WAAWgE,UAAU,IAAIV,UAAU,QAAQ;QAC3E,qBACE,MAACpE;YACCgE,cAAYrB,EAAE;YACdxB,OAAOA;YACPuB,UAAUuB,CAAAA,QAASO,cAAcP,MAAMC,MAAM,CAAC/C,KAAK;;8BAEnD,KAACgD;oBAAOhD,OAAM;8BAAG;;gBAChBL,WAAWgE,UAAU,CAACzD,GAAG,CAAC8C,CAAAA,uBACzB,KAACA;wBAAoBhD,OAAOgD;kCACzBU,UAAU/D,YAAYqD;uBADZA;;;IAMrB;IAEA,MAAMY,YACJjE,WAAWN,IAAI,KAAK,WAChB,WACAM,WAAWN,IAAI,KAAK,SAClB,SACA;IAER,qBACE;;0BACE,KAACP;gBACC+D,cAAYrB,EAAE;gBACdnC,MAAM4D,UAAU,SAAS,SAASW;gBAClCC,aAAaZ,UAAU,SAASzB,EAAE,4BAA4BlC;gBAC9DU,OAAOA;gBACPuB,UAAUuB,CAAAA,QAASO,cAAcP,MAAMC,MAAM,CAAC/C,KAAK;;YAEpDiD,UAAU,yBACT,KAACnE;gBACC+D,cAAYrB,EAAE;gBACdnC,MAAMuE;gBACN5D,OAAOQ;gBACPe,UAAUuB,CAAAA,QAASQ,YAAYR,MAAMC,MAAM,CAAC/C,KAAK;;;;AAK3D"}
@@ -0,0 +1,20 @@
1
+ import { EntityFilterArrayOperators, EntityFilterBinaryOperators, EntityFilterNullOperators, EntityFilterRangeOperators, EntityFilterStringOperators, type MetaAccessorType } from '@entifix/core';
2
+ export type EntityFilterOperator = (typeof EntityFilterBinaryOperators)[number] | (typeof EntityFilterArrayOperators)[number] | (typeof EntityFilterRangeOperators)[number] | (typeof EntityFilterStringOperators)[number] | (typeof EntityFilterNullOperators)[number];
3
+ /**
4
+ * The catalog key for an operator's user-facing name. The operator token and the
5
+ * key share a shape by construction, so adding an operator cannot leave a label
6
+ * behind: `controls.operator` is typed, and a missing entry fails to compile.
7
+ *
8
+ * Not to be confused with `RSQL_TOKENS` in `@entifix/core` — those are wire
9
+ * tokens (`==`, `=gt=`) and are never translated.
10
+ */
11
+ export declare function operatorLabelKey(operator: EntityFilterOperator): `operator.${EntityFilterOperator}`;
12
+ /**
13
+ * Operators a user can pick for a given member type. Ordering comparisons make
14
+ * no sense for a boolean, and substring matching makes none for a number — the
15
+ * type is what keeps the control from offering nonsense.
16
+ */
17
+ export declare function operatorsForType(type: MetaAccessorType): readonly EntityFilterOperator[];
18
+ /** Range operators take two bounds; array operators take a list; null ops none. */
19
+ export declare function operatorArity(operator: EntityFilterOperator): 'none' | 'single' | 'list' | 'range';
20
+ //# sourceMappingURL=filter-operators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-operators.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/filter-builder/filter-operators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,oBAAoB,GAC5B,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,GAC5C,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,GAC3C,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,GAC3C,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,GAC5C,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,oBAAoB,GAC7B,YAAY,oBAAoB,EAAE,CAEpC;AAOD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,gBAAgB,GACrB,SAAS,oBAAoB,EAAE,CAsBjC;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,oBAAoB,GAC7B,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAQtC"}
@@ -0,0 +1,56 @@
1
+ import { EntityFilterArrayOperators, EntityFilterBinaryOperators, EntityFilterNullOperators, EntityFilterRangeOperators, EntityFilterStringOperators } from '@entifix/core';
2
+ /**
3
+ * The catalog key for an operator's user-facing name. The operator token and the
4
+ * key share a shape by construction, so adding an operator cannot leave a label
5
+ * behind: `controls.operator` is typed, and a missing entry fails to compile.
6
+ *
7
+ * Not to be confused with `RSQL_TOKENS` in `@entifix/core` — those are wire
8
+ * tokens (`==`, `=gt=`) and are never translated.
9
+ */ export function operatorLabelKey(operator) {
10
+ return `operator.${operator}`;
11
+ }
12
+ const ORDERED = [
13
+ ...EntityFilterBinaryOperators,
14
+ ...EntityFilterRangeOperators
15
+ ];
16
+ /**
17
+ * Operators a user can pick for a given member type. Ordering comparisons make
18
+ * no sense for a boolean, and substring matching makes none for a number — the
19
+ * type is what keeps the control from offering nonsense.
20
+ */ export function operatorsForType(type) {
21
+ switch(type){
22
+ case 'number':
23
+ case 'date':
24
+ return [
25
+ ...ORDERED,
26
+ ...EntityFilterNullOperators
27
+ ];
28
+ case 'boolean':
29
+ return [
30
+ 'eq',
31
+ 'ne'
32
+ ];
33
+ case 'enum':
34
+ return [
35
+ 'eq',
36
+ 'ne',
37
+ ...EntityFilterArrayOperators,
38
+ ...EntityFilterNullOperators
39
+ ];
40
+ default:
41
+ return [
42
+ ...EntityFilterStringOperators,
43
+ 'eq',
44
+ 'ne',
45
+ ...EntityFilterNullOperators
46
+ ];
47
+ }
48
+ }
49
+ /** Range operators take two bounds; array operators take a list; null ops none. */ export function operatorArity(operator) {
50
+ if (EntityFilterNullOperators.includes(operator)) return 'none';
51
+ if (EntityFilterRangeOperators.includes(operator)) return 'range';
52
+ if (EntityFilterArrayOperators.includes(operator)) return 'list';
53
+ return 'single';
54
+ }
55
+
56
+ //# sourceMappingURL=filter-operators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/molecules/filter-builder/filter-operators.ts"],"sourcesContent":["import {\n EntityFilterArrayOperators,\n EntityFilterBinaryOperators,\n EntityFilterNullOperators,\n EntityFilterRangeOperators,\n EntityFilterStringOperators,\n type MetaAccessorType,\n} from '@entifix/core';\n\nexport type EntityFilterOperator =\n | (typeof EntityFilterBinaryOperators)[number]\n | (typeof EntityFilterArrayOperators)[number]\n | (typeof EntityFilterRangeOperators)[number]\n | (typeof EntityFilterStringOperators)[number]\n | (typeof EntityFilterNullOperators)[number];\n\n/**\n * The catalog key for an operator's user-facing name. The operator token and the\n * key share a shape by construction, so adding an operator cannot leave a label\n * behind: `controls.operator` is typed, and a missing entry fails to compile.\n *\n * Not to be confused with `RSQL_TOKENS` in `@entifix/core` — those are wire\n * tokens (`==`, `=gt=`) and are never translated.\n */\nexport function operatorLabelKey(\n operator: EntityFilterOperator,\n): `operator.${EntityFilterOperator}` {\n return `operator.${operator}`;\n}\n\nconst ORDERED: readonly EntityFilterOperator[] = [\n ...EntityFilterBinaryOperators,\n ...EntityFilterRangeOperators,\n];\n\n/**\n * Operators a user can pick for a given member type. Ordering comparisons make\n * no sense for a boolean, and substring matching makes none for a number — the\n * type is what keeps the control from offering nonsense.\n */\nexport function operatorsForType(\n type: MetaAccessorType,\n): readonly EntityFilterOperator[] {\n switch (type) {\n case 'number':\n case 'date':\n return [...ORDERED, ...EntityFilterNullOperators];\n case 'boolean':\n return ['eq', 'ne'];\n case 'enum':\n return [\n 'eq',\n 'ne',\n ...EntityFilterArrayOperators,\n ...EntityFilterNullOperators,\n ];\n default:\n return [\n ...EntityFilterStringOperators,\n 'eq',\n 'ne',\n ...EntityFilterNullOperators,\n ];\n }\n}\n\n/** Range operators take two bounds; array operators take a list; null ops none. */\nexport function operatorArity(\n operator: EntityFilterOperator,\n): 'none' | 'single' | 'list' | 'range' {\n if ((EntityFilterNullOperators as readonly string[]).includes(operator))\n return 'none';\n if ((EntityFilterRangeOperators as readonly string[]).includes(operator))\n return 'range';\n if ((EntityFilterArrayOperators as readonly string[]).includes(operator))\n return 'list';\n return 'single';\n}\n"],"names":["EntityFilterArrayOperators","EntityFilterBinaryOperators","EntityFilterNullOperators","EntityFilterRangeOperators","EntityFilterStringOperators","operatorLabelKey","operator","ORDERED","operatorsForType","type","operatorArity","includes"],"mappings":"AAAA,SACEA,0BAA0B,EAC1BC,2BAA2B,EAC3BC,yBAAyB,EACzBC,0BAA0B,EAC1BC,2BAA2B,QAEtB,gBAAgB;AASvB;;;;;;;CAOC,GACD,OAAO,SAASC,iBACdC,QAA8B;IAE9B,OAAO,CAAC,SAAS,EAAEA,UAAU;AAC/B;AAEA,MAAMC,UAA2C;OAC5CN;OACAE;CACJ;AAED;;;;CAIC,GACD,OAAO,SAASK,iBACdC,IAAsB;IAEtB,OAAQA;QACN,KAAK;QACL,KAAK;YACH,OAAO;mBAAIF;mBAAYL;aAA0B;QACnD,KAAK;YACH,OAAO;gBAAC;gBAAM;aAAK;QACrB,KAAK;YACH,OAAO;gBACL;gBACA;mBACGF;mBACAE;aACJ;QACH;YACE,OAAO;mBACFE;gBACH;gBACA;mBACGF;aACJ;IACL;AACF;AAEA,iFAAiF,GACjF,OAAO,SAASQ,cACdJ,QAA8B;IAE9B,IAAI,AAACJ,0BAAgDS,QAAQ,CAACL,WAC5D,OAAO;IACT,IAAI,AAACH,2BAAiDQ,QAAQ,CAACL,WAC7D,OAAO;IACT,IAAI,AAACN,2BAAiDW,QAAQ,CAACL,WAC7D,OAAO;IACT,OAAO;AACT"}
@@ -0,0 +1,3 @@
1
+ export * from './filter-builder.js';
2
+ export * from './filter-operators.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/filter-builder/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './filter-builder.js';
2
+ export * from './filter-operators.js';
3
+
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/molecules/filter-builder/index.ts"],"sourcesContent":["export * from './filter-builder.js';\nexport * from './filter-operators.js';\n"],"names":[],"mappings":"AAAA,cAAc,sBAAsB;AACpC,cAAc,wBAAwB"}
@@ -0,0 +1,2 @@
1
+ export * from './loading-boundary.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/loading-boundary/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './loading-boundary.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/molecules/loading-boundary/index.ts"],"sourcesContent":["export * from './loading-boundary.js';\n"],"names":[],"mappings":"AAAA,cAAc,wBAAwB"}
@@ -0,0 +1,27 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface LoadingBoundaryProps {
3
+ isLoading: boolean;
4
+ children: ReactNode;
5
+ /** What to show while loading. Defaults to a shape-matched skeleton. */
6
+ fallback?: ReactNode;
7
+ /** Lines for the default text fallback. `0` renders a single block instead. */
8
+ lines?: number;
9
+ className?: string;
10
+ /** Announced to assistive tech; a catalog key resolved by the caller. */
11
+ label?: string;
12
+ }
13
+ /**
14
+ * Holds a region's shape while its content is still arriving.
15
+ *
16
+ * Presentational and copy-free: it renders a skeleton, not the word "Loading",
17
+ * because a placeholder that matches the real geometry causes no layout shift
18
+ * when the content lands and needs no translation. The optional {@link label} is
19
+ * for screen readers only — the visual skeleton is `aria-hidden`, so without it
20
+ * a non-sighted caller is told nothing at all while a region is pending.
21
+ *
22
+ * It is not an error boundary and does not catch anything. Rendering actions
23
+ * became asynchronous when affordances moved behind `$metadata` (ADR 0026);
24
+ * this is where that wait is shown.
25
+ */
26
+ export declare function LoadingBoundary({ isLoading, children, fallback, lines, className, label, }: LoadingBoundaryProps): import("react").JSX.Element;
27
+ //# sourceMappingURL=loading-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loading-boundary.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/loading-boundary/loading-boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,KAAS,EACT,SAAS,EACT,KAAK,GACN,EAAE,oBAAoB,+BAsBtB"}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Skeleton, SkeletonText } from '../../atoms/skeleton/index.js';
3
+ import { cn } from '../../utils/cn.js';
4
+ /**
5
+ * Holds a region's shape while its content is still arriving.
6
+ *
7
+ * Presentational and copy-free: it renders a skeleton, not the word "Loading",
8
+ * because a placeholder that matches the real geometry causes no layout shift
9
+ * when the content lands and needs no translation. The optional {@link label} is
10
+ * for screen readers only — the visual skeleton is `aria-hidden`, so without it
11
+ * a non-sighted caller is told nothing at all while a region is pending.
12
+ *
13
+ * It is not an error boundary and does not catch anything. Rendering actions
14
+ * became asynchronous when affordances moved behind `$metadata` (ADR 0026);
15
+ * this is where that wait is shown.
16
+ */ export function LoadingBoundary({ isLoading, children, fallback, lines = 3, className, label }) {
17
+ if (!isLoading) {
18
+ return /*#__PURE__*/ _jsx(_Fragment, {
19
+ children: children
20
+ });
21
+ }
22
+ return /*#__PURE__*/ _jsxs("div", {
23
+ "data-testid": "loading-boundary",
24
+ className: cn(className),
25
+ role: "status",
26
+ "aria-busy": "true",
27
+ "aria-live": "polite",
28
+ children: [
29
+ label && /*#__PURE__*/ _jsx("span", {
30
+ className: "sr-only",
31
+ children: label
32
+ }),
33
+ fallback != null ? fallback : lines === 0 ? /*#__PURE__*/ _jsx(Skeleton, {
34
+ className: "h-8 w-full"
35
+ }) : /*#__PURE__*/ _jsx(SkeletonText, {
36
+ lines: lines
37
+ })
38
+ ]
39
+ });
40
+ }
41
+
42
+ //# sourceMappingURL=loading-boundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/molecules/loading-boundary/loading-boundary.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { Skeleton, SkeletonText } from '../../atoms/skeleton/index.js';\nimport { cn } from '../../utils/cn.js';\n\nexport interface LoadingBoundaryProps {\n isLoading: boolean;\n children: ReactNode;\n /** What to show while loading. Defaults to a shape-matched skeleton. */\n fallback?: ReactNode;\n /** Lines for the default text fallback. `0` renders a single block instead. */\n lines?: number;\n className?: string;\n /** Announced to assistive tech; a catalog key resolved by the caller. */\n label?: string;\n}\n\n/**\n * Holds a region's shape while its content is still arriving.\n *\n * Presentational and copy-free: it renders a skeleton, not the word \"Loading\",\n * because a placeholder that matches the real geometry causes no layout shift\n * when the content lands and needs no translation. The optional {@link label} is\n * for screen readers only — the visual skeleton is `aria-hidden`, so without it\n * a non-sighted caller is told nothing at all while a region is pending.\n *\n * It is not an error boundary and does not catch anything. Rendering actions\n * became asynchronous when affordances moved behind `$metadata` (ADR 0026);\n * this is where that wait is shown.\n */\nexport function LoadingBoundary({\n isLoading,\n children,\n fallback,\n lines = 3,\n className,\n label,\n}: LoadingBoundaryProps) {\n if (!isLoading) {\n return <>{children}</>;\n }\n\n return (\n <div\n data-testid=\"loading-boundary\"\n className={cn(className)}\n role=\"status\"\n aria-busy=\"true\"\n aria-live=\"polite\"\n >\n {label && <span className=\"sr-only\">{label}</span>}\n {fallback ??\n (lines === 0 ? (\n <Skeleton className=\"h-8 w-full\" />\n ) : (\n <SkeletonText lines={lines} />\n ))}\n </div>\n );\n}\n"],"names":["Skeleton","SkeletonText","cn","LoadingBoundary","isLoading","children","fallback","lines","className","label","div","data-testid","role","aria-busy","aria-live","span"],"mappings":";AAEA,SAASA,QAAQ,EAAEC,YAAY,QAAQ,gCAAgC;AACvE,SAASC,EAAE,QAAQ,oBAAoB;AAcvC;;;;;;;;;;;;CAYC,GACD,OAAO,SAASC,gBAAgB,EAC9BC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,CAAC,EACTC,SAAS,EACTC,KAAK,EACgB;IACrB,IAAI,CAACL,WAAW;QACd,qBAAO;sBAAGC;;IACZ;IAEA,qBACE,MAACK;QACCC,eAAY;QACZH,WAAWN,GAAGM;QACdI,MAAK;QACLC,aAAU;QACVC,aAAU;;YAETL,uBAAS,KAACM;gBAAKP,WAAU;0BAAWC;;YACpCH,mBAAAA,WACEC,UAAU,kBACT,KAACP;gBAASQ,WAAU;+BAEpB,KAACP;gBAAaM,OAAOA;;;;AAI/B"}
@@ -0,0 +1,2 @@
1
+ export * from './menu.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/menu/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './menu.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/molecules/menu/index.ts"],"sourcesContent":["export * from './menu.js';\n"],"names":[],"mappings":"AAAA,cAAc,YAAY"}