@kumix/ui 0.3.7 → 0.3.9

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 (186) hide show
  1. package/README.md +26 -25
  2. package/dist/cascader-types-BnH6wYD-.d.ts +183 -0
  3. package/dist/cascader-types-BnH6wYD-.d.ts.map +1 -0
  4. package/dist/components/agents/ai-sidebar.js +3 -5
  5. package/dist/components/agents/ai-sidebar.js.map +1 -1
  6. package/dist/components/motion/animated-sidebar.d.ts.map +1 -1
  7. package/dist/components/motion/animated-sidebar.js +12 -3
  8. package/dist/components/motion/animated-sidebar.js.map +1 -1
  9. package/dist/components/motion/attachment-upload.d.ts.map +1 -1
  10. package/dist/components/motion/attachment-upload.js +9 -5
  11. package/dist/components/motion/attachment-upload.js.map +1 -1
  12. package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
  13. package/dist/components/motion/bottom-sheet.js +77 -74
  14. package/dist/components/motion/bottom-sheet.js.map +1 -1
  15. package/dist/components/motion/center-morph-modal.d.ts.map +1 -1
  16. package/dist/components/motion/center-morph-modal.js +82 -88
  17. package/dist/components/motion/center-morph-modal.js.map +1 -1
  18. package/dist/components/motion/combobox/content.js +1 -1
  19. package/dist/components/motion/combobox/context.d.ts +6 -0
  20. package/dist/components/motion/combobox/context.d.ts.map +1 -1
  21. package/dist/components/motion/combobox/context.js +1 -233
  22. package/dist/components/motion/combobox/list.js +1 -1
  23. package/dist/components/motion/combobox/trigger.js +7 -8
  24. package/dist/components/motion/combobox/trigger.js.map +1 -1
  25. package/dist/components/motion/combobox.js +1 -1
  26. package/dist/components/motion/command-palette.d.ts.map +1 -1
  27. package/dist/components/motion/command-palette.js +62 -45
  28. package/dist/components/motion/command-palette.js.map +1 -1
  29. package/dist/components/motion/drawer.d.ts.map +1 -1
  30. package/dist/components/motion/drawer.js +30 -30
  31. package/dist/components/motion/drawer.js.map +1 -1
  32. package/dist/components/motion/loader.js +20 -22
  33. package/dist/components/motion/loader.js.map +1 -1
  34. package/dist/components/motion/morphing-modal.d.ts.map +1 -1
  35. package/dist/components/motion/morphing-modal.js +83 -83
  36. package/dist/components/motion/morphing-modal.js.map +1 -1
  37. package/dist/components/motion/morphing-search.d.ts +28 -0
  38. package/dist/components/motion/morphing-search.d.ts.map +1 -0
  39. package/dist/components/motion/morphing-search.js +422 -0
  40. package/dist/components/motion/morphing-search.js.map +1 -0
  41. package/dist/components/motion/project-folder.js +20 -20
  42. package/dist/components/motion/project-folder.js.map +1 -1
  43. package/dist/components/reui/alert.d.ts +1 -1
  44. package/dist/components/reui/badge.d.ts +1 -1
  45. package/dist/components/reui/cascader/cascader-async.d.ts +90 -0
  46. package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -0
  47. package/dist/components/reui/cascader/cascader-async.js +549 -0
  48. package/dist/components/reui/cascader/cascader-async.js.map +1 -0
  49. package/dist/components/reui/cascader/cascader-columns.d.ts +29 -0
  50. package/dist/components/reui/cascader/cascader-columns.d.ts.map +1 -0
  51. package/dist/components/reui/cascader/cascader-columns.js +135 -0
  52. package/dist/components/reui/cascader/cascader-columns.js.map +1 -0
  53. package/dist/components/reui/cascader/cascader-context.d.ts +193 -0
  54. package/dist/components/reui/cascader/cascader-context.d.ts.map +1 -0
  55. package/dist/components/reui/cascader/cascader-context.js +59 -0
  56. package/dist/components/reui/cascader/cascader-context.js.map +1 -0
  57. package/dist/components/reui/cascader/cascader-footer.d.ts +85 -0
  58. package/dist/components/reui/cascader/cascader-footer.d.ts.map +1 -0
  59. package/dist/components/reui/cascader/cascader-footer.js +456 -0
  60. package/dist/components/reui/cascader/cascader-footer.js.map +1 -0
  61. package/dist/components/reui/cascader/cascader-i18n.d.ts +17 -0
  62. package/dist/components/reui/cascader/cascader-i18n.d.ts.map +1 -0
  63. package/dist/components/reui/cascader/cascader-i18n.js +68 -0
  64. package/dist/components/reui/cascader/cascader-i18n.js.map +1 -0
  65. package/dist/components/reui/cascader/cascader-item.d.ts +115 -0
  66. package/dist/components/reui/cascader/cascader-item.d.ts.map +1 -0
  67. package/dist/components/reui/cascader/cascader-item.js +530 -0
  68. package/dist/components/reui/cascader/cascader-item.js.map +1 -0
  69. package/dist/components/reui/cascader/cascader-lib.d.ts +141 -0
  70. package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -0
  71. package/dist/components/reui/cascader/cascader-lib.js +576 -0
  72. package/dist/components/reui/cascader/cascader-lib.js.map +1 -0
  73. package/dist/components/reui/cascader/cascader-nav.d.ts +59 -0
  74. package/dist/components/reui/cascader/cascader-nav.d.ts.map +1 -0
  75. package/dist/components/reui/cascader/cascader-nav.js +312 -0
  76. package/dist/components/reui/cascader/cascader-nav.js.map +1 -0
  77. package/dist/components/reui/cascader/cascader-types.d.ts +2 -0
  78. package/dist/components/reui/cascader/cascader-types.js +2 -0
  79. package/dist/components/reui/cascader/cascader-virtual.d.ts +65 -0
  80. package/dist/components/reui/cascader/cascader-virtual.d.ts.map +1 -0
  81. package/dist/components/reui/cascader/cascader-virtual.js +240 -0
  82. package/dist/components/reui/cascader/cascader-virtual.js.map +1 -0
  83. package/dist/components/reui/cascader/cascader.d.ts +322 -0
  84. package/dist/components/reui/cascader/cascader.d.ts.map +1 -0
  85. package/dist/components/reui/cascader/cascader.js +1459 -0
  86. package/dist/components/reui/cascader/cascader.js.map +1 -0
  87. package/dist/components/reui/event-calendar/event-calendar-event.d.ts +28 -47
  88. package/dist/components/reui/event-calendar/event-calendar-event.d.ts.map +1 -1
  89. package/dist/components/reui/event-calendar/event-calendar-event.js +26 -44
  90. package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
  91. package/dist/components/reui/event-calendar/event-calendar-nav.js +1 -1
  92. package/dist/components/reui/event-calendar/event-calendar-types.d.ts +19 -57
  93. package/dist/components/reui/event-calendar/event-calendar-types.d.ts.map +1 -1
  94. package/dist/components/reui/filters/filters-advanced.d.ts +52 -0
  95. package/dist/components/reui/filters/filters-advanced.d.ts.map +1 -0
  96. package/dist/components/reui/filters/filters-advanced.js +1191 -0
  97. package/dist/components/reui/filters/filters-advanced.js.map +1 -0
  98. package/dist/components/reui/filters/filters-builder.d.ts +43 -0
  99. package/dist/components/reui/filters/filters-builder.d.ts.map +1 -0
  100. package/dist/components/reui/filters/filters-builder.js +152 -0
  101. package/dist/components/reui/filters/filters-builder.js.map +1 -0
  102. package/dist/components/reui/filters/filters-chip.d.ts +79 -0
  103. package/dist/components/reui/filters/filters-chip.d.ts.map +1 -0
  104. package/dist/components/reui/filters/filters-chip.js +553 -0
  105. package/dist/components/reui/filters/filters-chip.js.map +1 -0
  106. package/dist/components/reui/filters/filters-context.d.ts +290 -0
  107. package/dist/components/reui/filters/filters-context.d.ts.map +1 -0
  108. package/dist/components/reui/filters/filters-context.js +277 -0
  109. package/dist/components/reui/filters/filters-context.js.map +1 -0
  110. package/dist/components/reui/filters/filters-date.d.ts +43 -0
  111. package/dist/components/reui/filters/filters-date.d.ts.map +1 -0
  112. package/dist/components/reui/filters/filters-date.js +143 -0
  113. package/dist/components/reui/filters/filters-date.js.map +1 -0
  114. package/dist/components/reui/filters/filters-dnd.d.ts +101 -0
  115. package/dist/components/reui/filters/filters-dnd.d.ts.map +1 -0
  116. package/dist/components/reui/filters/filters-dnd.js +454 -0
  117. package/dist/components/reui/filters/filters-dnd.js.map +1 -0
  118. package/dist/components/reui/filters/filters-draft.d.ts +2 -0
  119. package/dist/components/reui/filters/filters-draft.js +128 -0
  120. package/dist/components/reui/filters/filters-draft.js.map +1 -0
  121. package/dist/components/reui/filters/filters-editors.d.ts +91 -0
  122. package/dist/components/reui/filters/filters-editors.d.ts.map +1 -0
  123. package/dist/components/reui/filters/filters-editors.js +773 -0
  124. package/dist/components/reui/filters/filters-editors.js.map +1 -0
  125. package/dist/components/reui/filters/filters-i18n.d.ts +24 -0
  126. package/dist/components/reui/filters/filters-i18n.d.ts.map +1 -0
  127. package/dist/components/reui/filters/filters-i18n.js +127 -0
  128. package/dist/components/reui/filters/filters-i18n.js.map +1 -0
  129. package/dist/components/reui/filters/filters-lib.d.ts +171 -0
  130. package/dist/components/reui/filters/filters-lib.d.ts.map +1 -0
  131. package/dist/components/reui/filters/filters-lib.js +336 -0
  132. package/dist/components/reui/filters/filters-lib.js.map +1 -0
  133. package/dist/components/reui/filters/filters-operators.d.ts +49 -0
  134. package/dist/components/reui/filters/filters-operators.d.ts.map +1 -0
  135. package/dist/components/reui/filters/filters-operators.js +300 -0
  136. package/dist/components/reui/filters/filters-operators.js.map +1 -0
  137. package/dist/components/reui/filters/filters-query.d.ts +132 -0
  138. package/dist/components/reui/filters/filters-query.d.ts.map +1 -0
  139. package/dist/components/reui/filters/filters-query.js +476 -0
  140. package/dist/components/reui/filters/filters-query.js.map +1 -0
  141. package/dist/components/reui/filters/filters-types.d.ts +452 -0
  142. package/dist/components/reui/filters/filters-types.d.ts.map +1 -0
  143. package/dist/components/reui/filters/filters-types.js +2 -0
  144. package/dist/components/reui/filters/filters.d.ts +114 -0
  145. package/dist/components/reui/filters/filters.d.ts.map +1 -0
  146. package/dist/components/reui/filters/filters.js +638 -0
  147. package/dist/components/reui/filters/filters.js.map +1 -0
  148. package/dist/components/reui/gantt/gantt-bar.js +1 -1
  149. package/dist/components/reui/gantt/gantt-nav.js +1 -1
  150. package/dist/components/reui/gantt/gantt-types.d.ts +25 -71
  151. package/dist/components/reui/gantt/gantt-types.d.ts.map +1 -1
  152. package/dist/components/reui/gantt/gantt-view.js +1 -1
  153. package/dist/components/ui/button.d.ts +1 -1
  154. package/dist/components/ui/checkbox.js +1 -1
  155. package/dist/components/ui/checkbox.js.map +1 -1
  156. package/dist/components/ui/field.js +2 -2
  157. package/dist/components/ui/field.js.map +1 -1
  158. package/dist/components/ui/radio-group.js +1 -1
  159. package/dist/components/ui/radio-group.js.map +1 -1
  160. package/dist/components/ui/sidebar.js +1 -1
  161. package/dist/components/ui/switch.js +1 -1
  162. package/dist/components/ui/switch.js.map +1 -1
  163. package/dist/context-BizvUNZv.js +298 -0
  164. package/dist/context-BizvUNZv.js.map +1 -0
  165. package/dist/filters-draft-DEAl3TO-.d.ts +70 -0
  166. package/dist/filters-draft-DEAl3TO-.d.ts.map +1 -0
  167. package/dist/hooks/use-on-open.d.ts +18 -0
  168. package/dist/hooks/use-on-open.d.ts.map +1 -0
  169. package/dist/hooks/use-on-open.js +27 -0
  170. package/dist/hooks/use-on-open.js.map +1 -0
  171. package/dist/hooks/use-row-cursor.d.ts +39 -0
  172. package/dist/hooks/use-row-cursor.d.ts.map +1 -0
  173. package/dist/hooks/use-row-cursor.js +77 -0
  174. package/dist/hooks/use-row-cursor.js.map +1 -0
  175. package/dist/lib/text-shimmer.d.ts +2 -2
  176. package/dist/lib/text-shimmer.d.ts.map +1 -1
  177. package/dist/lib/text-shimmer.js +2 -2
  178. package/dist/lib/text-shimmer.js.map +1 -1
  179. package/dist/presence-gate-BekdC4Bo.js +24 -0
  180. package/dist/presence-gate-BekdC4Bo.js.map +1 -0
  181. package/package.json +11 -11
  182. package/dist/components/motion/combobox/context.js.map +0 -1
  183. package/dist/components/reui/filters.d.ts +0 -176
  184. package/dist/components/reui/filters.d.ts.map +0 -1
  185. package/dist/components/reui/filters.js +0 -1223
  186. package/dist/components/reui/filters.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters-editors.js","names":["React"],"sources":["../../../../src/components/reui/filters/filters-editors.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { CheckIcon, XIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Button } from \"../../ui/button\";\nimport { ButtonGroup } from \"../../ui/button-group\";\nimport { Input } from \"../../ui/input\";\nimport type { CascaderItemState, CascaderProps } from \"../cascader/cascader\";\nimport {\n Cascader,\n CascaderEmpty,\n CascaderList,\n CascaderPanel,\n CascaderStatus,\n} from \"../cascader/cascader\";\nimport { useCascaderActions, useCascaderHighlight } from \"../cascader/cascader-context\";\nimport { CascaderFooter } from \"../cascader/cascader-footer\";\nimport { CascaderItems } from \"../cascader/cascader-item\";\nimport { CascaderInput, CascaderNav } from \"../cascader/cascader-nav\";\nimport type { CascaderActionItem, CascaderNode } from \"../cascader/cascader-types\";\nimport {\n FilterActionsContext,\n type FilterResolutionStore,\n filterControlSizes,\n} from \"./filters-context\";\nimport {\n applyFilterExclusiveSelection,\n filterFilterOptions,\n joinFilterPath,\n normalizeFilterQuery,\n warnFilterOnce,\n} from \"./filters-lib\";\nimport type {\n AnyFilterEditor,\n FilterEditorProps,\n FilterEditorRegistry,\n FilterField,\n FilterIndex,\n FilterLabels,\n FilterLoadResult,\n FilterOperator,\n FilterOption,\n FilterOptionsState,\n} from \"./filters-types\";\n\n/* -------------------------------------------------------------------------- */\n/* The options service */\n/* -------------------------------------------------------------------------- */\n\ninterface OptionsInternalState<O> {\n items: FilterOption<O>[];\n loading: boolean;\n error: boolean;\n hasMore: boolean;\n cursor?: string;\n}\n\nconst IDLE: OptionsInternalState<never> = {\n items: [],\n loading: false,\n error: false,\n hasMore: false,\n};\n\n/** Stable no-op subscription, for a hook running outside a `Filters` root. */\nconst emptySubscribe = () => () => {};\nconst zeroVersion = () => 0;\n\n/**\n * The joined path of a field, from the schema index. Keyed by PATH, not field\n * identity, so labels survive a schema rebuild; an unknown field uses its id.\n */\nfunction filterFieldKey<V, O>(\n field: FilterField<V, O> | undefined,\n index: FilterIndex | undefined,\n): string | null {\n if (!field) return null;\n if (index) {\n for (const entry of index.all) {\n if ((entry.field as unknown) === (field as unknown)) {\n return joinFilterPath(entry.path);\n }\n }\n }\n return `#${field.id}`;\n}\n\n/**\n * The shared option service every option-backed editor receives: debouncing,\n * aborting, cursor paging and value-to-label resolution. A deliberate fork of\n * the cascader's async machinery. Resolution is two-tier: a ref cache written\n * in an EFFECT, plus the root's `FilterResolutionStore`, without which a\n * `loadOptions`-only field showed its raw id once the menu closed.\n */\nexport function useFilterOptions<V, O>(\n field: FilterField<V, O> | undefined,\n enabled: boolean,\n debounceMs = 250,\n): FilterOptionsState<O> {\n const [query, setQueryState] = React.useState(\"\");\n const [state, setState] = React.useState<OptionsInternalState<O>>(\n IDLE as OptionsInternalState<O>,\n );\n\n const cache = React.useRef(new Map<string, FilterOption<O>>());\n const requestId = React.useRef(0);\n const abortRef = React.useRef<AbortController | null>(null);\n\n // Read directly, so this degrades outside a `Filters` root instead of throwing.\n const actionsContext = React.useContext(FilterActionsContext);\n const shared: FilterResolutionStore | null = actionsContext?.resolution ?? null;\n const sharedKey = filterFieldKey(field, actionsContext?.index);\n\n // Re-render when a label lands ANYWHERE under this root, not just here.\n React.useSyncExternalStore(\n shared ? shared.subscribe : emptySubscribe,\n shared ? shared.getVersion : zeroVersion,\n shared ? shared.getVersion : zeroVersion,\n );\n\n const staticOptions = field?.options;\n const loadOptions = field?.loadOptions;\n const isAsync = Boolean(loadOptions);\n\n // Seeded in an effect, not during render, so the render stays pure.\n React.useEffect(() => {\n if (!staticOptions) return;\n for (const option of staticOptions) cache.current.set(option.value, option);\n if (shared && sharedKey) shared.set(sharedKey, staticOptions);\n }, [staticOptions, shared, sharedKey]);\n\n React.useEffect(() => {\n for (const option of state.items) cache.current.set(option.value, option);\n if (shared && sharedKey && state.items.length) {\n shared.set(sharedKey, state.items);\n }\n }, [state.items, shared, sharedKey]);\n\n const run = React.useCallback(\n async (nextQuery: string, cursor: string | undefined, append: boolean) => {\n if (!loadOptions) return;\n\n abortRef.current?.abort();\n const controller = new AbortController();\n abortRef.current = controller;\n const id = ++requestId.current;\n\n setState((previous) => ({\n ...previous,\n loading: true,\n error: false,\n items: append ? previous.items : [],\n }));\n\n try {\n const result = await loadOptions(nextQuery, {\n signal: controller.signal,\n cursor,\n });\n // A superseded request must not write; the id, not the abort, decides.\n if (id !== requestId.current) return;\n\n const normalized: FilterLoadResult<O> = Array.isArray(result) ? { items: result } : result;\n\n setState((previous) => ({\n items: append ? [...previous.items, ...normalized.items] : normalized.items,\n loading: false,\n error: false,\n hasMore: normalized.hasMore ?? Boolean(normalized.nextCursor),\n cursor: normalized.nextCursor,\n }));\n } catch (error) {\n if (id !== requestId.current) return;\n if ((error as Error)?.name === \"AbortError\") return;\n setState((previous) => ({\n ...previous,\n loading: false,\n error: true,\n hasMore: false,\n }));\n }\n },\n [loadOptions],\n );\n\n React.useEffect(() => {\n if (!enabled || !isAsync) return;\n const timer = setTimeout(() => void run(query, undefined, false), debounceMs);\n return () => clearTimeout(timer);\n }, [enabled, isAsync, query, debounceMs, run]);\n\n React.useEffect(() => {\n return () => abortRef.current?.abort();\n }, []);\n\n const normalizedQuery = normalizeFilterQuery(query);\n\n // Async results are server-filtered; re-filtering hides what the label omits.\n const items = React.useMemo(() => {\n if (isAsync) return state.items;\n return filterFilterOptions(staticOptions ?? [], normalizedQuery);\n }, [isAsync, state.items, staticOptions, normalizedQuery]);\n\n const setQuery = React.useCallback((next: string) => setQueryState(next), []);\n\n const loadMore = React.useCallback(() => {\n if (!state.hasMore || state.loading) return;\n void run(query, state.cursor, true);\n }, [state.hasMore, state.loading, state.cursor, query, run]);\n\n const retry = React.useCallback(() => {\n void run(query, undefined, false);\n }, [query, run]);\n\n const resolve = React.useCallback(\n (value: string) => {\n // The ref cache cannot be the only tier: a ref write triggers no render,\n // so the chip would paint the raw value and never repaint. The shared\n // store holds other instances' pages and re-renders this one on a gain.\n const declared = staticOptions?.find((option) => option.value === value);\n if (declared) return declared;\n const fromShared = shared && sharedKey ? shared.get(sharedKey, value) : undefined;\n if (fromShared) return fromShared as FilterOption<O>;\n return cache.current.get(value);\n },\n [staticOptions, shared, sharedKey],\n );\n\n return {\n items,\n loading: state.loading,\n error: state.error,\n hasMore: state.hasMore,\n query,\n setQuery,\n loadMore,\n retry,\n resolve,\n };\n}\n\n/**\n * Resolves committed values no loaded page covered, through `resolveValues`: a\n * restored saved view holds ids the loader never returned. The claim set marks\n * an omitted id asked, so only a REJECTED resolve lets a later mount retry.\n */\nexport function useFilterValueResolution<V, O>(\n field: FilterField<V, O> | undefined,\n values: readonly unknown[],\n): void {\n const actionsContext = React.useContext(FilterActionsContext);\n const shared: FilterResolutionStore | null = actionsContext?.resolution ?? null;\n const sharedKey = filterFieldKey(field, actionsContext?.index);\n const resolveValues = field?.resolveValues;\n const staticOptions = field?.options;\n // Keyed by CONTENT; NUL cannot occur inside a real stored value.\n const valuesKey = values.map((entry) => String(entry)).join(\"\\u0000\");\n\n React.useEffect(() => {\n if (!resolveValues || !shared || !sharedKey || valuesKey === \"\") return;\n const missing = valuesKey.split(\"\\u0000\").filter((value) => {\n if (staticOptions?.some((option) => option.value === value)) return false;\n return shared.get(sharedKey, value) === undefined;\n });\n const wanted = shared.claim(sharedKey, missing);\n if (wanted.length === 0) return;\n\n // No unmount guard: the store outlives the component.\n void Promise.resolve(resolveValues(wanted)).then(\n (options) => shared.set(sharedKey, options),\n () => shared.release(sharedKey, wanted),\n );\n }, [resolveValues, shared, sharedKey, valuesKey, staticOptions]);\n}\n\n/* -------------------------------------------------------------------------- */\n/* Shared chrome */\n/* -------------------------------------------------------------------------- */\n\n/**\n * The panel every editor renders into. A plain flex column, NOT a combobox: an\n * editor inside a Base UI composite would inherit its `aria-activedescendant`\n * and arrow keys, which is hostile to a colour picker or a slider.\n */\nfunction EditorPanel({ children, className }: { children: React.ReactNode; className?: string }) {\n return (\n <div\n data-slot=\"filter-editor\"\n className={cn(\n \"flex w-full flex-col gap-2 p-2\",\n /* The list height cap as a VARIABLE, not the `maxHeight` prop, which\n becomes an inline style no consumer class can beat. 16rem is the\n 256px the menu has always used. */\n \"[--cascader-max-height:16rem]\",\n className,\n )}\n >\n {children}\n </div>\n );\n}\n\nfunction EditorFooter({\n onCancel,\n onCommit,\n labels,\n host,\n}: Pick<FilterEditorProps, \"labels\" | \"host\"> & {\n onCancel: () => void;\n onCommit: () => void;\n}) {\n // The ONE ladder, not a hardcoded rung: `size=\"sm\"` here measured 4px short\n // of the bar's own controls at `size=\"default\"` in all eight styles.\n const actions = React.useContext(FilterActionsContext);\n const sizes = filterControlSizes({ size: actions?.size ?? \"default\" });\n\n // The create host advances on commit and has Back; amend must offer discard.\n if (host === \"create\") return null;\n return (\n <div className=\"flex items-center justify-end gap-1.5 pt-1\">\n <Button variant=\"ghost\" size={sizes.button} onClick={onCancel}>\n {labels.discard}\n </Button>\n <Button size={sizes.button} onClick={onCommit}>\n {labels.apply}\n </Button>\n </div>\n );\n}\n\n/**\n * `w-full` because `ButtonGroup` is `w-fit`, which collapses inside this\n * fixed-width panel. Sera is an underline style, so its direct children flatten\n * to one bottom-only edge - `border-b-input`, not transparent, since the\n * buttons are the trailing edge and the rule would stop mid-panel.\n */\nconst EDITOR_FIELD_GROUP = \"w-full\";\n\n/**\n * Confirm and cancel, an OUTLINE pair FUSED onto the field's trailing edge.\n * Returns a FRAGMENT: `ButtonGroup` fuses with selectors matching DIRECT\n * children only, so a wrapper div renders three separate boxes. `size=\"icon\"`\n * because every style's icon button at that size is exactly its input's height.\n */\nfunction EditorCommitButtons({\n onCancel,\n onCommit,\n labels,\n}: Pick<FilterEditorProps, \"labels\"> & {\n onCancel: () => void;\n onCommit: () => void;\n}) {\n return (\n <>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon\"\n aria-label={labels.apply}\n onClick={onCommit}\n >\n <CheckIcon aria-hidden=\"true\" />\n </Button>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon\"\n aria-label={labels.discard}\n onClick={onCancel}\n >\n <XIcon aria-hidden=\"true\" />\n </Button>\n </>\n );\n}\n\nfunction useCommitKeys(commit: () => void, cancel: () => void) {\n return React.useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === \"Enter\" && !event.nativeEvent.isComposing) {\n event.preventDefault();\n commit();\n return;\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n // Stop here so a surrounding dialog does not also close.\n event.stopPropagation();\n cancel();\n }\n },\n [commit, cancel],\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Text / number */\n/* -------------------------------------------------------------------------- */\n\nexport function FilterTextEditor<V, O>({\n value,\n onValueChange,\n commit,\n cancel,\n autoFocusProps,\n labels,\n host,\n field,\n}: FilterEditorProps<V, O>) {\n const onKeyDown = useCommitKeys(() => commit(), cancel);\n return (\n // A width, not shrink-to-fit: the popover is `w-auto`, so an unsized box\n // changes width between the hosts. `w-72` is measured - it holds about 23\n // characters in sera and 27 in nova; `w-64` held about eighteen, too short\n // for an email, and `w-80` was the widest control in a bar of compact\n // chips. Capped at the viewport because `w-80` is 320px and a 360px phone\n // has 40px to spare. A `w-*` on the field wins.\n <EditorPanel className={cn(\"w-72 min-w-0 max-w-[calc(100vw-2rem)]\", field.className)}>\n <ButtonGroup className={EDITOR_FIELD_GROUP}>\n <Input\n {...autoFocusProps}\n value={(value as string) ?? \"\"}\n placeholder={field.placeholder ?? labels.valuePlaceholder}\n aria-label={field.label}\n onChange={(event) => onValueChange(event.target.value as V)}\n onKeyDown={onKeyDown}\n />\n {/*\n A lone input still belongs in the group: the per-style sheets re-round\n the LAST child, so a group with nothing fused draws the bare field.\n */}\n {host === \"create\" ? null : (\n <EditorCommitButtons labels={labels} onCancel={cancel} onCommit={() => commit()} />\n )}\n </ButtonGroup>\n </EditorPanel>\n );\n}\n\nexport function FilterNumberEditor<V, O>({\n value,\n onValueChange,\n commit,\n cancel,\n autoFocusProps,\n labels,\n host,\n field,\n}: FilterEditorProps<V, O>) {\n const onKeyDown = useCommitKeys(() => commit(), cancel);\n return (\n // Deliberately not the text editor's `w-72`: number values are short by\n // construction, and a wide box around \"42\" is the opposite defect.\n <EditorPanel className={cn(\"w-56 min-w-0\", field.className)}>\n <ButtonGroup className={EDITOR_FIELD_GROUP}>\n <Input\n {...autoFocusProps}\n type=\"number\"\n value={value === undefined || value === null ? \"\" : String(value)}\n placeholder={field.placeholder}\n aria-label={field.label}\n onChange={(event) => {\n const raw = event.target.value;\n onValueChange((raw === \"\" ? undefined : Number(raw)) as V);\n }}\n onKeyDown={onKeyDown}\n />\n {host === \"create\" ? null : (\n <EditorCommitButtons labels={labels} onCancel={cancel} onCommit={() => commit()} />\n )}\n </ButtonGroup>\n </EditorPanel>\n );\n}\n\nexport function FilterRangeEditor<V, O>({\n value,\n onValueChange,\n commit,\n cancel,\n autoFocusProps,\n labels,\n host,\n field,\n}: FilterEditorProps<V, O>) {\n const tuple = (Array.isArray(value) ? value : []) as unknown[];\n const onKeyDown = useCommitKeys(() => commit(), cancel);\n\n const update = (index: 0 | 1, raw: string) => {\n const next = [tuple[0], tuple[1]];\n next[index] = raw === \"\" ? undefined : Number(raw);\n onValueChange(next as V);\n };\n\n return (\n <EditorPanel>\n <div className=\"flex items-center gap-1.5\">\n <Input\n {...autoFocusProps}\n type=\"number\"\n value={tuple[0] === undefined ? \"\" : String(tuple[0])}\n aria-label={labels.rangeFrom(field.label)}\n onChange={(event) => update(0, event.target.value)}\n onKeyDown={onKeyDown}\n />\n <span className=\"text-muted-foreground text-xs\">{labels.rangeSeparator}</span>\n <Input\n type=\"number\"\n value={tuple[1] === undefined ? \"\" : String(tuple[1])}\n aria-label={labels.rangeTo(field.label)}\n onChange={(event) => update(1, event.target.value)}\n onKeyDown={onKeyDown}\n />\n </div>\n <EditorFooter host={host} labels={labels} onCancel={cancel} onCommit={() => commit()} />\n </EditorPanel>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* The menu */\n/* -------------------------------------------------------------------------- */\n\n/** One row. The shape both the operator menu and the option editors hand over. */\nexport interface FilterListItem {\n value: string;\n label: string;\n icon?: React.ReactNode;\n description?: string;\n keywords?: string[];\n disabled?: boolean;\n /**\n * A None row, from `FilterOption.exclusive`. LAYOUT only: what a pick DOES is\n * `applyFilterExclusiveSelection`, in the option editor's handler. A consumer\n * composing `FilterMenu` into an editor of their own owns the same call.\n */\n exclusive?: boolean;\n}\n\n/**\n * Beyond the cascader's own fields: one divider flag, on the first row of a\n * group that is not the first, because grouping happens out here. A separator\n * NODE would join the option ring, and `[data-selected] + :not([data-selected])`\n * reads the LIVE selection, so unticking a pinned row drew a second line.\n */\ninterface FilterMenuMeta {\n divider?: boolean;\n /**\n * Carries `FilterListItem.exclusive` down to the row. The rule above it is\n * `aria-hidden`, so the row's accessible name is the only channel arriving\n * before the press, and `renderItem` receives the node and nothing else.\n *\n * `[data-slot=filter-menu-exclusive-hint]` is also the handle a consumer\n * styles the row through: the cascader's row element takes no attribute of\n * ours, so `:has([data-slot=filter-menu-exclusive-hint])` selects it.\n */\n exclusive?: boolean;\n}\n\n/** Joins a selection into one comparable key; NUL cannot occur in a value. */\nconst PIN_SEPARATOR = \"\\u0000\";\n\n/** A bound on a race: each attempt costs one task and stops on success. */\nconst MAX_PIN_RESTORE_ATTEMPTS = 4;\n\ninterface PendingPinRestore {\n /** The row the user was on when the rows moved. Tracked by VALUE, never index. */\n value: string;\n /** The index it sat at, which is the half of the signature Base UI keeps. */\n index: number;\n /** The order the rows landed in, so the target's new position is known. */\n order: string[];\n attempts: number;\n}\n\n/**\n * Carries the HIGHLIGHT across a live re-pin. Base UI holds it as an INDEX and\n * a keyed reorder MOVES the DOM node rather than remounting it, so the index\n * map only rebuilds when the `MutationObserver` fires: until then, ticking a\n * row moves the highlight down one. So this ARMS in the layout effect, where\n * the map still reads the OLD order, and fires on the signature (SAME index,\n * DIFFERENT row) from a TASK, re-trying because the store event and the re-sort\n * are unordered. A synthetic `mousemove`, since Base UI exposes no setter.\n */\nfunction FilterMenuPinKeeper({\n order,\n items,\n}: {\n order: string[];\n /** The data the order was derived from, by identity. */\n items: FilterListItem[];\n}) {\n const { baseId } = useCascaderActions();\n const highlight = useCascaderHighlight();\n const previousRef = React.useRef<{\n order: string[];\n items: FilterListItem[];\n } | null>(null);\n const pendingRef = React.useRef<PendingPinRestore | null>(null);\n const timerRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n\n // From the render: on the reordering commit a ref still holds the OLD row.\n const highlightedValue = highlight.value;\n const highlightedIndex = highlight.index;\n\n const stop = React.useCallback(() => {\n pendingRef.current = null;\n if (timerRef.current === null) return;\n clearTimeout(timerRef.current);\n timerRef.current = null;\n }, []);\n\n const startRestore = React.useCallback(() => {\n const attempt = () => {\n timerRef.current = null;\n const pending = pendingRef.current;\n if (!pending) return;\n\n const target = pending.order.indexOf(pending.value);\n const rows = document\n .getElementById(`${baseId}-column-0`)\n ?.querySelectorAll<HTMLElement>('[data-slot=\"cascader-item\"]');\n // A WINDOWED list renders a subset, so row N is not order[N]. Leave it.\n if (target < 0 || !rows || rows.length !== pending.order.length) {\n stop();\n return;\n }\n\n rows[target]?.dispatchEvent(new MouseEvent(\"mousemove\", { bubbles: true }));\n\n pending.attempts += 1;\n if (pending.attempts >= MAX_PIN_RESTORE_ATTEMPTS) {\n stop();\n return;\n }\n timerRef.current = setTimeout(attempt, 0);\n };\n\n timerRef.current = setTimeout(attempt, 0);\n }, [baseId, stop]);\n\n // No dependency list: the arm must run on the commit that reorders the rows.\n React.useLayoutEffect(() => {\n const previous = previousRef.current;\n previousRef.current = { order, items };\n\n if (!previous || previous.order === order) return;\n // New DATA (a page, a query) is Base UI's to highlight; only a re-pin is ours.\n if (previous.items !== items) return;\n if (!highlightedValue) return;\n // Content, not identity: a re-pin can leave the rows in the same order.\n if (isSameOrder(previous.order, order)) return;\n\n pendingRef.current = {\n value: highlightedValue,\n index: highlightedIndex,\n order,\n attempts: 0,\n };\n });\n\n React.useEffect(() => {\n const pending = pendingRef.current;\n if (!pending) return;\n\n // Back where it belongs, or moved by the user: either way the arm is spent.\n if (highlightedValue === pending.value || highlightedIndex !== pending.index) {\n stop();\n return;\n }\n // Already chasing this one; a second chain would double every dispatch.\n if (pending.attempts > 0 || timerRef.current !== null) return;\n startRestore();\n }, [highlightedValue, highlightedIndex, startRestore, stop]);\n\n React.useEffect(() => stop, [stop]);\n\n return null;\n}\n\n/** Element-wise, because the arrays are rebuilt on every selection change. */\nfunction isSameOrder(a: string[], b: string[]) {\n if (a.length !== b.length) return false;\n for (let index = 0; index < a.length; index += 1) {\n if (a[index] !== b[index]) return false;\n }\n return true;\n}\n\nexport interface FilterMenuProps {\n items: FilterListItem[];\n /** Committed values. Drives the check mark and the pinned group. */\n selected: string[];\n multiple?: boolean;\n /** Receives the FULL next selection, so no caller re-derives it. */\n onSelectionChange: (values: string[]) => void;\n labels: FilterLabels;\n ariaLabel: string;\n searchPlaceholder?: string;\n /** Whether the search field is VISIBLE. It is always rendered regardless. */\n searchable?: boolean;\n /**\n * Viewport height before the list scrolls, in pixels. Omitted on purpose by\n * the option editors: it becomes an inline style a consumer's `className`\n * cannot outrank, so the panel publishes `--cascader-max-height` instead.\n */\n maxHeight?: number;\n /**\n * Pin selected rows above the rest, with a full-bleed rule between them. Off\n * by default; the option editors read `FilterField.pinSelected` per field.\n */\n pinSelected?: boolean;\n /**\n * Order INSIDE each group, plus WHEN the partition is taken. Declaration\n * order by default, so the partition is stable rather than a re-sort.\n */\n sortSelected?: \"none\" | \"label\" | \"snapshot\";\n /** The caller already filtered `items`, so the cascader must not re-filter. */\n preFiltered?: boolean;\n autoFocusProps?: FilterEditorProps[\"autoFocusProps\"];\n /** Controlled query. Pair it with `onQueryChange` to filter outside. */\n query?: string;\n onQueryChange?: (query: string) => void;\n state?: Pick<FilterOptionsState<unknown>, \"loading\" | \"error\" | \"hasMore\" | \"loadMore\" | \"retry\">;\n}\n\n/**\n * One accessible list, shared by the operator menu and every option editor. It\n * is the CASCADER configured flat, not a list this file implements, which\n * brings the typeahead, RTL handling and live region with it. Only the pinning\n * and the paging affordance stay out here.\n */\nexport function FilterMenu({\n items,\n selected,\n multiple = false,\n onSelectionChange,\n labels,\n ariaLabel,\n searchPlaceholder,\n searchable = true,\n maxHeight,\n pinSelected = false,\n sortSelected = \"none\",\n preFiltered = false,\n autoFocusProps,\n query,\n onQueryChange,\n state,\n}: FilterMenuProps) {\n /**\n * The pin set as a KEY, not an array: `selected` is a fresh array on most\n * renders, so a memo depending on it re-partitions every render.\n */\n const liveKey = pinSelected ? selected.join(PIN_SEPARATOR) : \"\";\n\n /**\n * The same set, frozen at OPEN, for `sortSelected: \"snapshot\"`. LIVE is the\n * default: \"your picks, then the rest\" is about the CURRENT selection, and\n * `FilterMenuPinKeeper` pays for rows moving under the pointer.\n */\n const [snapshotKey] = React.useState(() => liveKey);\n // `pinSelected` re-checked here, not just through `liveKey`: `snapshotKey` is\n // frozen at MOUNT, so a menu that lost the prop would keep partitioning.\n const pinnedKey = !pinSelected ? \"\" : sortSelected === \"snapshot\" ? snapshotKey : liveKey;\n\n // Uncontrolled unless the caller owns the query, as an option service does.\n const [ownQuery, setOwnQuery] = React.useState(\"\");\n const currentQuery = query ?? ownQuery;\n const setQuery = onQueryChange ?? setOwnQuery;\n\n /**\n * Memoized on the SELECTION, not the query: folding the query in re-sorted\n * 4,000 rows on every keystroke, for a one pixel rule.\n */\n const partitioned = React.useMemo(() => {\n const pinned = new Set(pinnedKey ? pinnedKey.split(PIN_SEPARATOR) : []);\n\n /*\n Exclusive rows come out BEFORE the pin partition; their position is fixed.\n Pinning is by SELECTION, so a ticked None row would lift itself above the\n very rule drawn to set it apart and drop back on untick. Grouping by ROLE\n means the pinned group counts ordinary picks only, which is also why\n picking None draws no pin rule: it clears every other pick.\n */\n const exclusive = items.filter((item) => item.exclusive);\n const values = exclusive.length ? items.filter((item) => !item.exclusive) : items;\n\n const chosen = pinned.size ? values.filter((item) => pinned.has(item.value)) : [];\n const rest = pinned.size ? values.filter((item) => !pinned.has(item.value)) : values;\n\n // The SCHEMA's order inside each group unless the field asks otherwise:\n // option order is usually semantic.\n const ordered =\n sortSelected === \"label\"\n ? [\n [...chosen].sort((a, b) => a.label.localeCompare(b.label)),\n [...rest].sort((a, b) => a.label.localeCompare(b.label)),\n [...exclusive].sort((a, b) => a.label.localeCompare(b.label)),\n ]\n : [chosen, rest, exclusive];\n\n const rows = [...ordered[0], ...ordered[1], ...ordered[2]];\n\n return {\n chosenCount: chosen.length,\n /** Index of the first exclusive row, or -1 when the list has none. */\n exclusiveAt: exclusive.length ? rows.length - exclusive.length : -1,\n // The render order alone, so a REORDER is an identity compare.\n order: rows.map((item) => item.value),\n nodes: rows.map<CascaderNode<FilterMenuMeta>>((item) => ({\n value: item.value,\n label: item.label,\n icon: item.icon,\n description: item.description,\n keywords: item.keywords,\n disabled: item.disabled,\n // Only exclusive rows carry `data`, so the ordinary 4,000 keep theirs.\n data: item.exclusive ? { exclusive: true } : undefined,\n })),\n };\n }, [items, pinnedKey, sortSelected]);\n\n // No rule under a query: \"your picks, then the rest\" is about the WHOLE list.\n const dividerAt = partitioned.chosenCount && !currentQuery.trim() ? partitioned.chosenCount : -1;\n\n // Survives a search, unlike the pin rule: it is a fact about the row.\n const exclusiveDividerAt = partitioned.exclusiveAt;\n\n const nodes = React.useMemo<CascaderNode<FilterMenuMeta>[]>(() => {\n const total = partitioned.nodes.length;\n // Only a boundary with rows on BOTH sides is one: a rule on row 0 would\n // be a line above the top of the list.\n const marks = [dividerAt, exclusiveDividerAt].filter((index) => index > 0 && index < total);\n if (marks.length === 0) return partitioned.nodes;\n // Rows rewritten, not rebuilt: copying 4,000 objects would undo the split.\n const next = partitioned.nodes.slice();\n for (const index of marks) {\n // MERGED, never replaced: the two boundaries usually fall on one row, and\n // overwriting `data` dropped the flag the accessible name is built from.\n next[index] = {\n ...next[index],\n data: { ...next[index].data, divider: true },\n };\n }\n return next;\n }, [partitioned, dividerAt, exclusiveDividerAt]);\n\n const renderItem = React.useCallback(\n (node: CascaderNode<FilterMenuMeta>, itemState: CascaderItemState<FilterMenuMeta>) => (\n <>\n {node.data?.divider ? (\n <span\n data-slot=\"filter-menu-divider\"\n aria-hidden=\"true\"\n /* Full bleed, over the per-style `--cascader-list-pad` the shell\n publishes: a rule stopping at the row's inset box reads as a gap.\n Centred in the 8px the row gives back above itself, not `top-0`. */\n className=\"absolute inset-x-[calc(var(--cascader-list-pad,4px)*-1)] -top-1 h-px bg-border\"\n />\n ) : null}\n\n {node.icon ? (\n <span\n data-slot=\"filter-menu-icon\"\n className=\"flex shrink-0 items-center justify-center text-muted-foreground\"\n >\n {node.icon}\n </span>\n ) : null}\n\n <span className=\"flex min-w-0 flex-1 flex-col items-start gap-0.5\">\n <span className=\"w-full truncate text-start\">{node.label}</span>\n {node.description ? (\n <span className=\"w-full truncate text-start text-muted-foreground text-xs\">\n {node.description}\n </span>\n ) : null}\n </span>\n\n {/*\n What the aria-hidden rule says, for the people it does not reach.\n Inside the option element so it joins the row's accessible NAME, not\n an `aria-describedby`: a description is announced late or not at all,\n and this has to arrive before the press. The cascader's `srDetails`\n cannot either: `renderItem` replaces the row body. Empty copy renders\n nothing, so `labels.exclusiveHint` of \"\" silences it.\n */}\n {node.data?.exclusive && labels.exclusiveHint ? (\n <span data-slot=\"filter-menu-exclusive-hint\" className=\"sr-only\">\n {`, ${labels.exclusiveHint}`}\n </span>\n ) : null}\n\n {/* A check mark in both modes, never the cascader's default box. */}\n {itemState.selected ? (\n <span\n data-slot=\"filter-menu-check\"\n /* The gutter every style already reserves, on the cascader's own\n logical inset. `end-*` rather than `right-2`, so RTL mirrors. */\n className=\"pointer-events-none absolute end-(--cascader-row-inset,8px)! flex size-4 items-center justify-center rtl:right-auto!\"\n >\n <CheckIcon className=\"text-foreground! **:text-foreground!\" />\n </span>\n ) : null}\n </>\n ),\n [labels.exclusiveHint],\n );\n\n const cascaderLabels = React.useMemo(\n () => ({\n search: searchPlaceholder ?? labels.searchOptions,\n empty: labels.empty,\n loading: labels.loading,\n loadingMore: labels.loadingMore,\n loadMore: labels.loadMore,\n error: labels.error,\n retry: labels.retry,\n // Named after the field, not the cascader's own \"Top level\" wording.\n rootLevel: ariaLabel,\n panelLabel: ariaLabel,\n // Run FLAT, so the default hint would teach branch keys that do not exist.\n keyboardHint: () => \"\",\n // From `FilterLabels`, so the menu ships no English of its own.\n resultsAnnouncement: labels.resultsAnnouncement,\n actionsLabel: labels.actionsLabel,\n }),\n [labels, ariaLabel, searchPlaceholder],\n );\n\n /**\n * Paging and retry in the pinned footer, never a row: a row would join the\n * option ring, where arrows land on it and a query filters it away mid-page.\n */\n const actions = React.useMemo<CascaderActionItem[]>(() => {\n if (state?.error) {\n return [{ value: \"retry\", label: labels.retry, onSelect: state.retry }];\n }\n if (state?.hasMore) {\n return [\n {\n value: \"load-more\",\n label: state.loading ? labels.loadingMore : labels.loadMore,\n disabled: state.loading,\n onSelect: state.loadMore,\n },\n ];\n }\n return [];\n }, [state, labels]);\n\n const shared = {\n // Inline and pinned open with a no-op handler, so the unconditional\n // `setOpen(false)` of a single-select commit cannot dismiss the popover.\n inline: true,\n open: true,\n onOpenChange: () => {},\n items: nodes,\n inputValue: currentQuery,\n onInputValueChange: setQuery,\n maxHeight,\n renderItem,\n labels: cascaderLabels,\n actions,\n // The option service is the ONE filter when it owns the query.\n ...(preFiltered ? { filter: () => true } : null),\n };\n\n const cascaderProps: CascaderProps<FilterMenuMeta> = multiple\n ? {\n ...shared,\n multiple: true,\n value: selected,\n onValueChange: (values: string[]) => onSelectionChange(values),\n }\n : {\n ...shared,\n value: selected[0] ?? \"\",\n onValueChange: (value: string) => onSelectionChange(value ? [value] : []),\n };\n\n return (\n <Cascader {...cascaderProps}>\n <CascaderPanel>\n {/*\n `searchable: false` hides the FIELD, never removes it: the input owns\n focus and `aria-activedescendant`, so a menu without one has no\n keyboard. The class goes on the nav so the strip's border goes too.\n */}\n <CascaderNav\n className={cn(\n /* The nav's divider is `border-border/60` and the group separator\n is a full-opacity `bg-border`; two strengths read as a mistake. */\n \"border-border\",\n !searchable && \"sr-only\",\n )}\n >\n <CascaderInput\n {...(autoFocusProps ?? {})}\n placeholder={searchPlaceholder ?? labels.searchOptions}\n aria-label={ariaLabel}\n />\n </CascaderNav>\n <CascaderEmpty>\n {state?.error ? labels.error : state?.loading ? labels.loading : labels.empty}\n </CascaderEmpty>\n {/*\n Plain rows, DELIBERATELY not `CascaderVirtualItems`: windowing stands\n `FilterMenuPinKeeper` down. The long lists are async and PAGE 25.\n */}\n <CascaderList\n /**\n * Real layout space around the group rule, which is absolutely\n * positioned and adds no height. `renderItem` cannot reach the row's\n * own box, and a spacer NODE would join the option ring.\n *\n * `:has()` is affordable here: scoped to this one list, a compound\n * whose descendant exists on at most ONE row, and these menus render\n * tens of rows rather than thousands.\n */\n className=\"[&>[data-slot=cascader-item]:has([data-slot=filter-menu-divider])]:mt-2\"\n >\n <CascaderItems />\n </CascaderList>\n <CascaderFooter />\n <CascaderStatus />\n {/*\n Last, so its layout effect reads the reordered DOM after every row has\n registered. Not mounted at all for a menu that cannot reorder.\n */}\n {pinSelected && sortSelected !== \"snapshot\" ? (\n <FilterMenuPinKeeper order={partitioned.order} items={items} />\n ) : null}\n </CascaderPanel>\n </Cascader>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Option based editors */\n/* -------------------------------------------------------------------------- */\n\nfunction OptionEditor<V, O>(props: FilterEditorProps<V, O> & { multiple: boolean }) {\n const { multiple, options, labels, autoFocusProps, commit, cancel, onValueChange, value, field } =\n props;\n\n const selected = React.useMemo(() => {\n if (value === undefined || value === null) return [];\n return (Array.isArray(value) ? value : [value]) as string[];\n }, [value]);\n\n const announce = React.useContext(FilterActionsContext)?.announce;\n\n return (\n /*\n A DELIBERATELY narrow default: 12rem holds around 22 characters at every\n style's row size. `field.className` lands LAST, so a consumer's `w-*` wins.\n */\n <EditorPanel className={cn(\"w-48 min-w-0 gap-0 p-0\", field.className)}>\n <FilterMenu\n items={options.items}\n selected={selected}\n multiple={multiple}\n onSelectionChange={(raw) => {\n /*\n The ONE place the None rule is applied: every route into a selection\n arrives here, so click and keyboard cannot disagree, and only the\n editor can ANSWER it - `options.resolve` sees the schema and every\n loaded page, where the menu holds only the rows on screen.\n */\n const values = applyFilterExclusiveSelection(raw, selected, (value) =>\n Boolean(options.resolve(value)?.exclusive),\n );\n\n /*\n Identity is the test: the rule hands back `raw` itself unless it\n intervened. Announced because nothing else reports it: focus never\n moved, and nobody is on the rows that lost their check marks.\n */\n if (values !== raw && announce) {\n const arrived = values.find((entry) => !selected.includes(entry));\n const cleared = raw.length - values.length;\n if (arrived !== undefined && cleared > 0) {\n announce(\n labels.exclusiveAnnouncement(options.resolve(arrived)?.label ?? arrived, cleared),\n );\n }\n } else if (values === raw && raw.length > 1) {\n /*\n The hole in the rule, made LOUD. An unresolvable value is treated\n as ordinary and cannot be told from an id whose label has not\n arrived, so this warns rather than acts. Needs a SEEN None row.\n */\n const hasNoneRow =\n options.items.some((item) => item.exclusive) ||\n Boolean(field.options?.some((option) => option.exclusive));\n const unresolved = hasNoneRow\n ? raw.find((entry) => options.resolve(entry) === undefined)\n : undefined;\n if (unresolved !== undefined) {\n warnFilterOnce(\n `exclusive-unresolved:${field.id}`,\n `field \"${field.id}\" has an exclusive option, but the value ` +\n `\"${unresolved}\" resolves to no option, so the None rule ` +\n `cannot tell whether it is the exclusive one and has left ` +\n `it in place. Declare the exclusive option in the field's ` +\n `\\`options\\` even when the rest of the list is async, or ` +\n `cover stored values with \\`resolveValues\\`.`,\n );\n }\n }\n\n if (!multiple) {\n const next = values[0];\n // Base UI deselects the committed row; an empty filter is no gain.\n if (next === undefined) {\n cancel();\n return;\n }\n onValueChange(next as V);\n commit(next as V);\n return;\n }\n onValueChange(values as V);\n // Every toggle commits with the popover open: several picks, one gesture.\n commit(values as V, { close: false });\n }}\n labels={labels}\n ariaLabel={field.label}\n searchable={field.searchable ?? true}\n // Not a composed `Search ${label}...`: hardcoded English no `labels`\n // override could reach, and lowercasing a label is locale-hostile.\n searchPlaceholder={field.placeholder}\n pinSelected={field.pinSelected ?? false}\n sortSelected={field.sortSelected}\n // `useFilterOptions` already applied the query, locally or server side.\n preFiltered\n query={options.query}\n onQueryChange={options.setQuery}\n state={options}\n autoFocusProps={autoFocusProps}\n />\n </EditorPanel>\n );\n}\n\nexport function FilterSelectEditor<V, O>(props: FilterEditorProps<V, O>) {\n return <OptionEditor {...props} multiple={false} />;\n}\n\nexport function FilterMultiSelectEditor<V, O>(props: FilterEditorProps<V, O>) {\n return <OptionEditor {...props} multiple />;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Boolean */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Module level, so the menu's index is not rebuilt on every render. Not in\n * `FilterLabels`: the chip's own display spells the same two words out.\n */\nconst BOOLEAN_ITEMS: FilterListItem[] = [\n { value: \"true\", label: \"True\" },\n { value: \"false\", label: \"False\" },\n];\n\nexport function FilterBooleanEditor<V, O>({\n value,\n onValueChange,\n commit,\n labels,\n autoFocusProps,\n field,\n}: FilterEditorProps<V, O>) {\n return (\n // Two words, and `field.className` lands last so a consumer's `w-*` wins.\n <EditorPanel className={cn(\"w-40 min-w-0 gap-0 p-0\", field.className)}>\n <FilterMenu\n items={BOOLEAN_ITEMS}\n selected={value === true ? [\"true\"] : value === false ? [\"false\"] : []}\n onSelectionChange={(values) => {\n /* Deselecting the committed row leaves nothing to filter on, so it is\n a no-op rather than a commit of `false`. */\n if (values.length === 0) return;\n const next = (values[0] === \"true\") as V;\n onValueChange(next);\n commit(next);\n }}\n labels={labels}\n ariaLabel={field.label}\n /* Two rows: a search over them is more chrome than list, but the\n field is still rendered, hidden, because it owns the keyboard. */\n searchable={false}\n autoFocusProps={autoFocusProps}\n />\n </EditorPanel>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Resolution */\n/* -------------------------------------------------------------------------- */\n\nexport type {\n AnyFilterEditor,\n FilterEditorRegistry,\n} from \"./filters-types\";\n\nexport const DEFAULT_FILTER_EDITORS: FilterEditorRegistry = {\n text: FilterTextEditor,\n number: FilterNumberEditor,\n range: FilterRangeEditor,\n select: FilterSelectEditor,\n multiselect: FilterMultiSelectEditor,\n boolean: FilterBooleanEditor,\n};\n\n/**\n * Picks the editor for a (field, operator) pair: the field's own `editor`, then\n * the operator's ARITY, then the field's `type`. Arity outranks type because\n * \"between\" wants two boxes whatever the field said.\n */\nexport function resolveFilterEditor<V, O>(\n field: FilterField<V, O>,\n operator: FilterOperator | undefined,\n editors: FilterEditorRegistry,\n): AnyFilterEditor | undefined {\n if (typeof field.editor === \"function\") {\n // The one place a consumer's typed editor meets the erased registry.\n return field.editor as unknown as AnyFilterEditor;\n }\n if (typeof field.editor === \"string\") {\n const named = editors[field.editor];\n if (named) return named;\n }\n\n const arity = operator?.arity ?? \"one\";\n if (arity === \"none\") return undefined;\n if (arity === \"range\") return editors.range;\n if (arity === \"many\") {\n // An option-backed field gets checkboxes; anything else receives an array.\n if (field.options || field.loadOptions) return editors.multiselect;\n }\n\n return editors[field.type ?? \"text\"] ?? editors.text;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA2DA,MAAM,OAAoC;CACxC,OAAO,CAAC;CACR,SAAS;CACT,OAAO;CACP,SAAS;AACX;;AAGA,MAAM,6BAA6B,CAAC;AACpC,MAAM,oBAAoB;;;;;AAM1B,SAAS,eACP,OACA,OACe;CACf,IAAI,CAAC,OAAO,OAAO;CACnB,IAAI,OACG;OAAA,MAAM,SAAS,MAAM,KACxB,IAAK,MAAM,UAAuB,OAChC,OAAO,eAAe,MAAM,IAAI;CAAA;CAItC,OAAO,IAAI,MAAM;AACnB;;;;;;;;AASA,SAAgB,iBACd,OACA,SACA,aAAa,KACU;CACvB,MAAM,CAAC,OAAO,iBAAiBA,QAAM,SAAS,EAAE;CAChD,MAAM,CAAC,OAAO,YAAYA,QAAM,SAC9B,IACF;CAEA,MAAM,QAAQA,QAAM,uBAAO,IAAI,IAA6B,CAAC;CAC7D,MAAM,YAAYA,QAAM,OAAO,CAAC;CAChC,MAAM,WAAWA,QAAM,OAA+B,IAAI;CAG1D,MAAM,iBAAiBA,QAAM,WAAW,oBAAoB;CAC5D,MAAM,SAAuC,gBAAgB,cAAc;CAC3E,MAAM,YAAY,eAAe,OAAO,gBAAgB,KAAK;CAG7D,QAAM,qBACJ,SAAS,OAAO,YAAY,gBAC5B,SAAS,OAAO,aAAa,aAC7B,SAAS,OAAO,aAAa,WAC/B;CAEA,MAAM,gBAAgB,OAAO;CAC7B,MAAM,cAAc,OAAO;CAC3B,MAAM,UAAU,QAAQ,WAAW;CAGnC,QAAM,gBAAgB;EACpB,IAAI,CAAC,eAAe;EACpB,KAAK,MAAM,UAAU,eAAe,MAAM,QAAQ,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;AAAO,GAC/B;CAAE,OAAO;CAAS,OAAO;AAAQ,CACnC;AAEA,SAAgB,oBAA0B,EACxC,OACA,eACA,QACA,QACA,gBACA,SAC0B;CAC1B,OAEE,oBAAC,aAAD;EAAa,WAAW,GAAG,0BAA0B,MAAM,SAAS;EAClE,UAAA,oBAAC,YAAD;GACE,OAAO;GACP,UAAU,UAAU,OAAO,CAAC,MAAM,IAAI,UAAU,QAAQ,CAAC,OAAO,IAAI,CAAC;GACrE,oBAAoB,WAAW;IAG7B,IAAI,OAAO,WAAW,GAAG;IACzB,MAAM,OAAQ,OAAO,OAAO;IAC5B,cAAc,IAAI;IAClB,OAAO,IAAI;GACb;GACQ;GACR,WAAW,MAAM;GAGjB,YAAY;GACI;EACjB,CAAA;CACU,CAAA;AAEjB;AAWA,MAAa,yBAA+C;CAC1D,MAAM;CACN,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,aAAa;CACb,SAAS;AACX;;;;;;AAOA,SAAgB,oBACd,OACA,UACA,SAC6B;CAC7B,IAAI,OAAO,MAAM,WAAW,YAE1B,OAAO,MAAM;CAEf,IAAI,OAAO,MAAM,WAAW,UAAU;EACpC,MAAM,QAAQ,QAAQ,MAAM;EAC5B,IAAI,OAAO,OAAO;CACpB;CAEA,MAAM,QAAQ,UAAU,SAAS;CACjC,IAAI,UAAU,QAAQ,OAAO,KAAA;CAC7B,IAAI,UAAU,SAAS,OAAO,QAAQ;CACtC,IAAI,UAAU,QAER;MAAA,MAAM,WAAW,MAAM,aAAa,OAAO,QAAQ;CAAA;CAGzD,OAAO,QAAQ,MAAM,QAAQ,WAAW,QAAQ;AAClD"}
@@ -0,0 +1,24 @@
1
+ import { FilterDraftStep, FilterIssue, FilterIssueReason, FilterLabels } from "./filters-types.js";
2
+ //#region src/components/reui/filters/filters-i18n.d.ts
3
+ /**
4
+ * The shipped English copy. `stepAnnouncement` (consumer-composed create
5
+ * wizard) and `showRecords` (a consumer's own panel heading) are unread by the
6
+ * shipped chrome and kept on purpose; do not prune them as dead keys.
7
+ */
8
+ declare const DEFAULT_FILTER_LABELS: FilterLabels;
9
+ /**
10
+ * Shallow merge over the defaults, like the cascader's. A deep merge would leak
11
+ * the default back into a replaced function-valued label for the arguments the
12
+ * consumer did not think about.
13
+ */
14
+ declare function resolveFilterLabels(labels?: Partial<FilterLabels>): FilterLabels;
15
+ /**
16
+ * The sentence for one issue. Takes the ISSUE, not just the reason: a field's
17
+ * `validate` supplies its own words, so `custom` has nothing to look up.
18
+ */
19
+ declare function filterIssueLabel(issue: Pick<FilterIssue, "reason" | "message"> | FilterIssueReason, labels: FilterLabels): string;
20
+ /** The search placeholder for a step's panel. */
21
+ declare function stepPlaceholder(step: FilterDraftStep, labels: FilterLabels): string;
22
+ //#endregion
23
+ export { DEFAULT_FILTER_LABELS, filterIssueLabel, resolveFilterLabels, stepPlaceholder };
24
+ //# sourceMappingURL=filters-i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters-i18n.d.ts","names":[],"sources":["../../../../src/components/reui/filters/filters-i18n.tsx"],"mappings":";;;;;;;cAca,uBAAuB;;;;;;iBAuGpB,oBAAoB,SAAS,QAAQ,gBAAgB;;;;;iBASrD,iBACd,OAAO,KAAK,qCAAqC,mBACjD,QAAQ;;iBAYM,gBAAgB,MAAM,iBAAiB,QAAQ"}
@@ -0,0 +1,127 @@
1
+ "use client";
2
+ //#region src/components/reui/filters/filters-i18n.tsx
3
+ /**
4
+ * The shipped English copy. `stepAnnouncement` (consumer-composed create
5
+ * wizard) and `showRecords` (a consumer's own panel heading) are unread by the
6
+ * shipped chrome and kept on purpose; do not prune them as dead keys.
7
+ */
8
+ const DEFAULT_FILTER_LABELS = {
9
+ addFilter: "Add filter",
10
+ advancedFilter: "Advanced filter",
11
+ showRecords: "In this view, show records",
12
+ builderEmpty: "No filters yet",
13
+ builderEmptyHint: "Add a filter to narrow down what you see.",
14
+ addCondition: "Add filter",
15
+ addConditionGroup: "Add group",
16
+ addToGroup: "Add filter to this group",
17
+ removeGroup: "Remove group",
18
+ wrapInGroup: "Wrap in group",
19
+ ungroup: "Ungroup",
20
+ moveToTopLevel: "Move to top",
21
+ moveToGroup: (position) => `Move to group ${position}`,
22
+ reorder: "Reorder",
23
+ reorderHint: "Press Alt with Arrow Up or Arrow Down to reorder",
24
+ groupAll: "All of the following are true...",
25
+ groupAny: "Any of the following are true...",
26
+ groupPlaceholder: "Drag filters here",
27
+ rowLabel: (condition, depth) => `${condition}, level ${depth}`,
28
+ groupLabel: (description, depth) => `${description} level ${depth}`,
29
+ groupAnnouncement: (added) => added ? "Group added" : "Group removed",
30
+ reorderAnnouncement: (label, position, total) => `${label} moved to position ${position} of ${total}`,
31
+ moveAnnouncement: (label, destination, position, total) => `${label} moved into ${destination}, position ${position} of ${total}`,
32
+ clearAll: "Clear all",
33
+ groupMenu: "Group options",
34
+ searchFields: "Search attributes...",
35
+ searchOperators: "Search operators...",
36
+ searchOptions: "Search...",
37
+ back: "Back",
38
+ clear: "Clear",
39
+ apply: "Apply",
40
+ discard: "Discard changes",
41
+ empty: "No results",
42
+ loading: "Loading...",
43
+ loadingMore: "Loading more...",
44
+ loadMore: "Load more",
45
+ error: "Could not load",
46
+ retry: "Retry",
47
+ where: "Where",
48
+ and: "And",
49
+ or: "Or",
50
+ combinator: "Change combinator",
51
+ combinatorLabel: (word) => `${word}, change combinator`,
52
+ duplicate: "Duplicate",
53
+ negate: "Negate",
54
+ convertToAdvanced: "Advanced editor",
55
+ remove: "Remove",
56
+ chipMenu: (fieldLabel) => `${fieldLabel} filter options`,
57
+ filtersLabel: "Filters",
58
+ filterLabel: (condition) => condition,
59
+ readOnly: "Read only. These filters cannot be changed.",
60
+ pathSeparator: " > ",
61
+ valuePlaceholder: "enter text...",
62
+ selectPlaceholder: "Select...",
63
+ noValue: "no value",
64
+ selectCondition: "Select condition",
65
+ incomplete: "incomplete filter",
66
+ branchAffordance: "opens a list",
67
+ exclusiveHint: "cannot be combined with the other options",
68
+ exclusiveAnnouncement: (label, cleared) => cleared === 1 ? `${label} selected. 1 other selection cleared.` : `${label} selected. ${cleared} other selections cleared.`,
69
+ itemCount: (count) => `${count} items`,
70
+ fieldsLabel: "Attributes",
71
+ resultsAnnouncement: (count) => count === 1 ? "1 result" : `${count} results`,
72
+ actionsLabel: "Actions",
73
+ stepAnnouncement: (step, label) => {
74
+ if (step === "field") return `Choose an attribute. ${label}`;
75
+ if (step === "operator") return `Choose a condition for ${label}`;
76
+ return `Enter a value for ${label}`;
77
+ },
78
+ countAnnouncement: (count) => count === 1 ? "1 filter applied" : `${count} filters applied`,
79
+ valueCount: (count) => `${count} selected`,
80
+ valueDetail: (summary, values) => `${summary}: ${values.join(", ")}`,
81
+ valueRange: (from, to) => `${from} to ${to}`,
82
+ rangeFrom: (fieldLabel) => `${fieldLabel} from`,
83
+ rangeTo: (fieldLabel) => `${fieldLabel} to`,
84
+ rangeSeparator: "to",
85
+ negated: (operatorLabel) => `not ${operatorLabel}`,
86
+ issueOperator: "Choose a condition",
87
+ issueValue: "Enter a value",
88
+ issueRange: "Enter both ends of the range",
89
+ issueRangeOrder: "The end of the range comes before its start",
90
+ issueEmptyGroup: "This group has no conditions yet",
91
+ issueSummary: (count) => count === 1 ? "1 row needs attention" : `${count} rows need attention`
92
+ };
93
+ /**
94
+ * Shallow merge over the defaults, like the cascader's. A deep merge would leak
95
+ * the default back into a replaced function-valued label for the arguments the
96
+ * consumer did not think about.
97
+ */
98
+ function resolveFilterLabels(labels) {
99
+ if (!labels) return DEFAULT_FILTER_LABELS;
100
+ return {
101
+ ...DEFAULT_FILTER_LABELS,
102
+ ...labels
103
+ };
104
+ }
105
+ /**
106
+ * The sentence for one issue. Takes the ISSUE, not just the reason: a field's
107
+ * `validate` supplies its own words, so `custom` has nothing to look up.
108
+ */
109
+ function filterIssueLabel(issue, labels) {
110
+ const reason = typeof issue === "string" ? issue : issue.reason;
111
+ if (typeof issue !== "string" && issue.message) return issue.message;
112
+ if (reason === "missing-operator") return labels.issueOperator;
113
+ if (reason === "incomplete-range") return labels.issueRange;
114
+ if (reason === "reversed-range") return labels.issueRangeOrder;
115
+ if (reason === "empty-group") return labels.issueEmptyGroup;
116
+ return labels.issueValue;
117
+ }
118
+ /** The search placeholder for a step's panel. */
119
+ function stepPlaceholder(step, labels) {
120
+ if (step === "field") return labels.searchFields;
121
+ if (step === "operator") return labels.searchOperators;
122
+ return labels.searchOptions;
123
+ }
124
+ //#endregion
125
+ export { DEFAULT_FILTER_LABELS, filterIssueLabel, resolveFilterLabels, stepPlaceholder };
126
+
127
+ //# sourceMappingURL=filters-i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters-i18n.js","names":[],"sources":["../../../../src/components/reui/filters/filters-i18n.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n FilterDraftStep,\n FilterIssue,\n FilterIssueReason,\n FilterLabels,\n} from \"./filters-types\";\n\n/**\n * The shipped English copy. `stepAnnouncement` (consumer-composed create\n * wizard) and `showRecords` (a consumer's own panel heading) are unread by the\n * shipped chrome and kept on purpose; do not prune them as dead keys.\n */\nexport const DEFAULT_FILTER_LABELS: FilterLabels = {\n addFilter: \"Add filter\",\n advancedFilter: \"Advanced filter\",\n showRecords: \"In this view, show records\",\n builderEmpty: \"No filters yet\",\n builderEmptyHint: \"Add a filter to narrow down what you see.\",\n addCondition: \"Add filter\",\n addConditionGroup: \"Add group\",\n addToGroup: \"Add filter to this group\",\n removeGroup: \"Remove group\",\n wrapInGroup: \"Wrap in group\",\n ungroup: \"Ungroup\",\n moveToTopLevel: \"Move to top\",\n moveToGroup: (position) => `Move to group ${position}`,\n reorder: \"Reorder\",\n reorderHint: \"Press Alt with Arrow Up or Arrow Down to reorder\",\n groupAll: \"All of the following are true...\",\n groupAny: \"Any of the following are true...\",\n groupPlaceholder: \"Drag filters here\",\n rowLabel: (condition, depth) => `${condition}, level ${depth}`,\n groupLabel: (description, depth) => `${description} level ${depth}`,\n groupAnnouncement: (added) => (added ? \"Group added\" : \"Group removed\"),\n reorderAnnouncement: (label, position, total) =>\n `${label} moved to position ${position} of ${total}`,\n // Destination FIRST after the verb: it is the half a plain reorder cannot\n // say and the half the user cannot see once the row has stopped moving.\n // Position stays last, so this still ends on the \"of N\" a reorder ends on.\n moveAnnouncement: (label, destination, position, total) =>\n `${label} moved into ${destination}, position ${position} of ${total}`,\n clearAll: \"Clear all\",\n groupMenu: \"Group options\",\n searchFields: \"Search attributes...\",\n searchOperators: \"Search operators...\",\n searchOptions: \"Search...\",\n back: \"Back\",\n clear: \"Clear\",\n apply: \"Apply\",\n discard: \"Discard changes\",\n empty: \"No results\",\n loading: \"Loading...\",\n loadingMore: \"Loading more...\",\n loadMore: \"Load more\",\n error: \"Could not load\",\n retry: \"Retry\",\n where: \"Where\",\n and: \"And\",\n or: \"Or\",\n combinator: \"Change combinator\",\n // The word first: it is what the control SAYS and what a truncated pill\n // stops showing. The action follows, so the name still names an action.\n combinatorLabel: (word) => `${word}, change combinator`,\n duplicate: \"Duplicate\",\n negate: \"Negate\",\n convertToAdvanced: \"Advanced editor\",\n remove: \"Remove\",\n chipMenu: (fieldLabel) => `${fieldLabel} filter options`,\n filtersLabel: \"Filters\",\n filterLabel: (condition) => condition,\n readOnly: \"Read only. These filters cannot be changed.\",\n pathSeparator: \" > \",\n valuePlaceholder: \"enter text...\",\n selectPlaceholder: \"Select...\",\n noValue: \"no value\",\n selectCondition: \"Select condition\",\n incomplete: \"incomplete filter\",\n branchAffordance: \"opens a list\",\n exclusiveHint: \"cannot be combined with the other options\",\n exclusiveAnnouncement: (label, cleared) =>\n cleared === 1\n ? `${label} selected. 1 other selection cleared.`\n : `${label} selected. ${cleared} other selections cleared.`,\n itemCount: (count) => `${count} items`,\n fieldsLabel: \"Attributes\",\n resultsAnnouncement: (count) => (count === 1 ? \"1 result\" : `${count} results`),\n actionsLabel: \"Actions\",\n stepAnnouncement: (step, label) => {\n if (step === \"field\") return `Choose an attribute. ${label}`;\n if (step === \"operator\") return `Choose a condition for ${label}`;\n return `Enter a value for ${label}`;\n },\n countAnnouncement: (count) => (count === 1 ? \"1 filter applied\" : `${count} filters applied`),\n valueCount: (count) => `${count} selected`,\n valueDetail: (summary, values) => `${summary}: ${values.join(\", \")}`,\n valueRange: (from, to) => `${from} to ${to}`,\n rangeFrom: (fieldLabel) => `${fieldLabel} from`,\n rangeTo: (fieldLabel) => `${fieldLabel} to`,\n rangeSeparator: \"to\",\n negated: (operatorLabel) => `not ${operatorLabel}`,\n issueOperator: \"Choose a condition\",\n issueValue: \"Enter a value\",\n issueRange: \"Enter both ends of the range\",\n issueRangeOrder: \"The end of the range comes before its start\",\n issueEmptyGroup: \"This group has no conditions yet\",\n // \"Row\", not \"condition\": an empty GROUP is counted here too and a group is\n // not a condition. Rule and group divs alike carry `data-slot=\"filter-row\"`.\n issueSummary: (count) => (count === 1 ? \"1 row needs attention\" : `${count} rows need attention`),\n};\n\n/**\n * Shallow merge over the defaults, like the cascader's. A deep merge would leak\n * the default back into a replaced function-valued label for the arguments the\n * consumer did not think about.\n */\nexport function resolveFilterLabels(labels?: Partial<FilterLabels>): FilterLabels {\n if (!labels) return DEFAULT_FILTER_LABELS;\n return { ...DEFAULT_FILTER_LABELS, ...labels };\n}\n\n/**\n * The sentence for one issue. Takes the ISSUE, not just the reason: a field's\n * `validate` supplies its own words, so `custom` has nothing to look up.\n */\nexport function filterIssueLabel(\n issue: Pick<FilterIssue, \"reason\" | \"message\"> | FilterIssueReason,\n labels: FilterLabels,\n): string {\n const reason = typeof issue === \"string\" ? issue : issue.reason;\n if (typeof issue !== \"string\" && issue.message) return issue.message;\n if (reason === \"missing-operator\") return labels.issueOperator;\n if (reason === \"incomplete-range\") return labels.issueRange;\n if (reason === \"reversed-range\") return labels.issueRangeOrder;\n if (reason === \"empty-group\") return labels.issueEmptyGroup;\n return labels.issueValue;\n}\n\n/** The search placeholder for a step's panel. */\nexport function stepPlaceholder(step: FilterDraftStep, labels: FilterLabels): string {\n if (step === \"field\") return labels.searchFields;\n if (step === \"operator\") return labels.searchOperators;\n return labels.searchOptions;\n}\n"],"mappings":";;;;;;;AAcA,MAAa,wBAAsC;CACjD,WAAW;CACX,gBAAgB;CAChB,aAAa;CACb,cAAc;CACd,kBAAkB;CAClB,cAAc;CACd,mBAAmB;CACnB,YAAY;CACZ,aAAa;CACb,aAAa;CACb,SAAS;CACT,gBAAgB;CAChB,cAAc,aAAa,iBAAiB;CAC5C,SAAS;CACT,aAAa;CACb,UAAU;CACV,UAAU;CACV,kBAAkB;CAClB,WAAW,WAAW,UAAU,GAAG,UAAU,UAAU;CACvD,aAAa,aAAa,UAAU,GAAG,YAAY,SAAS;CAC5D,oBAAoB,UAAW,QAAQ,gBAAgB;CACvD,sBAAsB,OAAO,UAAU,UACrC,GAAG,MAAM,qBAAqB,SAAS,MAAM;CAI/C,mBAAmB,OAAO,aAAa,UAAU,UAC/C,GAAG,MAAM,cAAc,YAAY,aAAa,SAAS,MAAM;CACjE,UAAU;CACV,WAAW;CACX,cAAc;CACd,iBAAiB;CACjB,eAAe;CACf,MAAM;CACN,OAAO;CACP,OAAO;CACP,SAAS;CACT,OAAO;CACP,SAAS;CACT,aAAa;CACb,UAAU;CACV,OAAO;CACP,OAAO;CACP,OAAO;CACP,KAAK;CACL,IAAI;CACJ,YAAY;CAGZ,kBAAkB,SAAS,GAAG,KAAK;CACnC,WAAW;CACX,QAAQ;CACR,mBAAmB;CACnB,QAAQ;CACR,WAAW,eAAe,GAAG,WAAW;CACxC,cAAc;CACd,cAAc,cAAc;CAC5B,UAAU;CACV,eAAe;CACf,kBAAkB;CAClB,mBAAmB;CACnB,SAAS;CACT,iBAAiB;CACjB,YAAY;CACZ,kBAAkB;CAClB,eAAe;CACf,wBAAwB,OAAO,YAC7B,YAAY,IACR,GAAG,MAAM,yCACT,GAAG,MAAM,aAAa,QAAQ;CACpC,YAAY,UAAU,GAAG,MAAM;CAC/B,aAAa;CACb,sBAAsB,UAAW,UAAU,IAAI,aAAa,GAAG,MAAM;CACrE,cAAc;CACd,mBAAmB,MAAM,UAAU;EACjC,IAAI,SAAS,SAAS,OAAO,wBAAwB;EACrD,IAAI,SAAS,YAAY,OAAO,0BAA0B;EAC1D,OAAO,qBAAqB;CAC9B;CACA,oBAAoB,UAAW,UAAU,IAAI,qBAAqB,GAAG,MAAM;CAC3E,aAAa,UAAU,GAAG,MAAM;CAChC,cAAc,SAAS,WAAW,GAAG,QAAQ,IAAI,OAAO,KAAK,IAAI;CACjE,aAAa,MAAM,OAAO,GAAG,KAAK,MAAM;CACxC,YAAY,eAAe,GAAG,WAAW;CACzC,UAAU,eAAe,GAAG,WAAW;CACvC,gBAAgB;CAChB,UAAU,kBAAkB,OAAO;CACnC,eAAe;CACf,YAAY;CACZ,YAAY;CACZ,iBAAiB;CACjB,iBAAiB;CAGjB,eAAe,UAAW,UAAU,IAAI,0BAA0B,GAAG,MAAM;AAC7E;;;;;;AAOA,SAAgB,oBAAoB,QAA8C;CAChF,IAAI,CAAC,QAAQ,OAAO;CACpB,OAAO;EAAE,GAAG;EAAuB,GAAG;CAAO;AAC/C;;;;;AAMA,SAAgB,iBACd,OACA,QACQ;CACR,MAAM,SAAS,OAAO,UAAU,WAAW,QAAQ,MAAM;CACzD,IAAI,OAAO,UAAU,YAAY,MAAM,SAAS,OAAO,MAAM;CAC7D,IAAI,WAAW,oBAAoB,OAAO,OAAO;CACjD,IAAI,WAAW,oBAAoB,OAAO,OAAO;CACjD,IAAI,WAAW,kBAAkB,OAAO,OAAO;CAC/C,IAAI,WAAW,eAAe,OAAO,OAAO;CAC5C,OAAO,OAAO;AAChB;;AAGA,SAAgB,gBAAgB,MAAuB,QAA8B;CACnF,IAAI,SAAS,SAAS,OAAO,OAAO;CACpC,IAAI,SAAS,YAAY,OAAO,OAAO;CACvC,OAAO,OAAO;AAChB"}
@@ -0,0 +1,171 @@
1
+ import { i as CascaderCollapse } from "../../../cascader-types-BnH6wYD-.js";
2
+ import { FilterField, FilterIndex, FilterOperator, FilterOption } from "./filters-types.js";
3
+ //#region src/components/reui/filters/filters-lib.d.ts
4
+ /**
5
+ * One menu size for the chip's kebab and the builder's three menus, which draw
6
+ * the same rows. `w-max` OVERRIDES the shadcn content width, which pins to the
7
+ * anchor and hides horizontal overflow, so a menu hung off a 28px icon button
8
+ * CUT every longer row. Floor 128px, down from 224px: the rows run about 130px,
9
+ * and five of the eight styles already floor a dropdown there (luma, maia and
10
+ * sera sit at 192px). The 24rem cap stops a pathological label pushing the menu
11
+ * off the side of a phone. Past it a row truncates rather than wraps, since a
12
+ * wrapped row changes HEIGHT and would slide the destructive row under the
13
+ * pointer: `min-w-0` lets a row shrink below its content at all (a flex child's
14
+ * floor is its content otherwise) and the label span carries `truncate`, see
15
+ * `FILTER_MENU_LABEL_CLASS`.
16
+ */
17
+ declare const FILTER_MENU_CLASS = "w-max min-w-32 max-w-[min(24rem,calc(100vw-2rem))] [&_[data-slot=dropdown-menu-item]]:min-w-0";
18
+ /**
19
+ * What a menu row's LABEL wears, and it has to be a real span: `text-overflow`
20
+ * needs a block container, not the anonymous flex item a bare text child is.
21
+ * `min-w-0` so the span can shrink below its own content.
22
+ */
23
+ declare const FILTER_MENU_LABEL_CLASS = "min-w-0 truncate";
24
+ /**
25
+ * The FIELD PICKER's panel, shared by the Add filter popover and the advanced
26
+ * row's attribute cell so one schema is never drawn at two widths. `w-auto`
27
+ * grows to the longest row, so the 224px floor (down from 256px) only decides
28
+ * the reported case: a flat schema of short names in a mostly empty panel.
29
+ * Measured: 224px still clears the search input, the breadcrumb and a leaf
30
+ * row's icon-plus-label.
31
+ */
32
+ declare const FILTER_FIELD_PICKER_CLASS = "w-auto min-w-56 p-0";
33
+ /** Root key for `childrenOf`; a control char cannot collide with a field id. */
34
+ declare const FILTER_ROOT_KEY = "\0root";
35
+ declare function joinFilterPath(path: readonly string[]): string;
36
+ declare function splitFilterPath(key: string): string[];
37
+ /** The joined key of a path's parent, or `FILTER_ROOT_KEY` at the top level. */
38
+ declare function parentFilterKey(path: readonly string[]): string;
39
+ /**
40
+ * A content hash of the schema, used to skip a rebuild. Identity alone is
41
+ * useless: every block and example declares `fields` as an inline literal, so a
42
+ * memo keyed on the array misses on every parent render. Render props (`icon`,
43
+ * `renderValue`, a component-valued `editor`) are hashed by PRESENCE only,
44
+ * because inline JSX recreates them: swapping one's body keeps serving the
45
+ * previous field objects, so change a structural field or give `fields` a
46
+ * stable identity.
47
+ */
48
+ declare function computeFilterSchemaSignature<V, O>(fields: readonly FilterField<V, O>[]): string;
49
+ /**
50
+ * Normalizes a field schema into flat maps. When `previous`'s signature
51
+ * matches, the PREVIOUS OBJECT is returned: an equal-but-new one would leave
52
+ * every downstream memo missing exactly as often as before. Duplicate sibling
53
+ * ids are ignored after the first, as the cascader does for node values, and
54
+ * `findFilterSchemaIssues` reports them in development.
55
+ */
56
+ declare function buildFilterIndex<V = unknown, O = unknown>(fields: readonly FilterField<V, O>[], previous?: FilterIndex<V, O> | null,
57
+ /** A signature the caller already computed, to avoid walking twice. */
58
+ precomputedSignature?: string): FilterIndex<V, O>;
59
+ declare function getFilterField<V, O>(index: FilterIndex<V, O>, path: readonly string[]): FilterField<V, O> | undefined;
60
+ /** The ancestor chain for a path, root first and the field itself last. */
61
+ declare function getFilterFieldChain<V, O>(index: FilterIndex<V, O>, path: readonly string[]): FilterField<V, O>[];
62
+ /** Child fields of a path. Pass an empty path for the root level. */
63
+ declare function getFilterChildren<V, O>(index: FilterIndex<V, O>, path: readonly string[]): FilterField<V, O>[];
64
+ declare function isFilterBranch<V, O>(field: FilterField<V, O>): boolean;
65
+ /**
66
+ * Whether a field DECLARES itself filterable on: leaves always, a branch only
67
+ * with `selectable`. The shipped pickers ignore it, see `isFilterFieldPickable`.
68
+ */
69
+ declare function isFilterFieldSelectable<V, O>(field: FilterField<V, O>): boolean;
70
+ /**
71
+ * Whether the SHIPPED pickers may commit a field: leaves only. A row that both
72
+ * drills in and commits cannot disambiguate a click - its chevron and child
73
+ * count promise "opens a list", so the press that opened it also filtered on
74
+ * the parent and dismissed the picker. `selectable` stays honoured by
75
+ * `isFilterFieldSelectable` for a chrome that separates the two.
76
+ */
77
+ declare function isFilterFieldPickable<V, O>(field: FilterField<V, O>): boolean;
78
+ /** Trailing count for a branch row. */
79
+ declare function getFilterFieldCount<V, O>(field: FilterField<V, O>): number;
80
+ /** Renders a path as "Name > First" using the caller's separator. */
81
+ declare function formatFilterPath<V, O>(index: FilterIndex<V, O>, path: readonly string[], separator: string): string;
82
+ /** How a path is shortened; the cascader's own union, so the two cannot drift. */
83
+ type FilterPathCollapse = CascaderCollapse;
84
+ type FilterPathSegment<V = unknown, O = unknown> = {
85
+ type: "field";
86
+ field: FilterField<V, O>;
87
+ } |
88
+ /** The run that was elided, kept so a host can surface it. */
89
+ {
90
+ type: "ellipsis";
91
+ hidden: FilterField<V, O>[];
92
+ };
93
+ /**
94
+ * Shortens an ancestor chain to at most `maxSegments` names, on the cascader's
95
+ * arithmetic so the chip's path and the builder's attribute cell cannot round
96
+ * differently. The adapter is POSITIONAL because a `FilterField`'s `id` is
97
+ * unique only among its siblings, so the index is the only key that survives a
98
+ * collapser keyed on `value`. Default `"none"`: no upgrade shortens a path.
99
+ */
100
+ declare function collapseFilterPath<V, O>(chain: readonly FilterField<V, O>[], options?: {
101
+ maxSegments?: number;
102
+ collapse?: FilterPathCollapse;
103
+ }): FilterPathSegment<V, O>[];
104
+ type FilterCombinatorSlot = "where" | "toggle" | "echo";
105
+ /**
106
+ * Which of the three forms the combinator slot before rule `index` takes. A
107
+ * group has exactly ONE combinator, so only one slot may be interactive: three
108
+ * editable "and"s down a column would imply three independent choices.
109
+ */
110
+ declare function filterCombinatorSlot(index: number): FilterCombinatorSlot;
111
+ /** `toLocaleLowerCase`, so Turkish dotted and dotless i fold as a reader expects. */
112
+ declare function foldFilterText(text: string): string;
113
+ declare function normalizeFilterQuery(query: string): string;
114
+ /** Whether a field matches a normalized query, by label or keywords. */
115
+ declare function matchesFilterQuery<V, O>(field: FilterField<V, O>, normalizedQuery: string): boolean;
116
+ /**
117
+ * Filters one level, preserving input order. Unused here like
118
+ * `searchFilterDeep`: kept so a consumer's own picker need not re-implement the
119
+ * fold and the keyword matching.
120
+ */
121
+ declare function filterFilterLevel<V, O>(fields: readonly FilterField<V, O>[], normalizedQuery: string): FilterField<V, O>[];
122
+ /**
123
+ * Searches every SELECTABLE field at any depth, because a result the user
124
+ * cannot pick is a dead end. Unused here - the shipped picker is the cascader
125
+ * and delegates deep search to it - but it keeps a consumer's own picker from
126
+ * re-implementing the fold, the keyword matching and the selectable rule.
127
+ */
128
+ declare function searchFilterDeep<V, O>(index: FilterIndex<V, O>, normalizedQuery: string, limit?: number): {
129
+ field: FilterField<V, O>;
130
+ path: string[];
131
+ }[];
132
+ /** Filters an option list by a normalized query, by label or keywords. */
133
+ declare function filterFilterOptions<O>(options: readonly FilterOption<O>[], normalizedQuery: string): FilterOption<O>[];
134
+ /**
135
+ * The None rule, as pure algebra over two selections: pick the `exclusive`
136
+ * option and it is the only pick, pick anything else and it goes. Written
137
+ * against the DELTA, not the result, which is what makes it total: an empty
138
+ * delta is a removal, including UNTICKING the exclusive row; an exclusive
139
+ * arrival is the whole answer; an ordinary arrival drops every exclusive value,
140
+ * restored ones included; both at once gives it to the LAST exclusive.
141
+ * `isExclusive` is a lookup, not an array, because a query hiding the None row
142
+ * while it stays SELECTED would answer "not exclusive" for the value the click
143
+ * must clear. Never applied on read - a saved view is the consumer's data - so
144
+ * it heals on the first ordinary pick, and only while `isExclusive` can ANSWER:
145
+ * a None row on a `loadOptions` field belongs in the static `options`.
146
+ */
147
+ declare function applyFilterExclusiveSelection(next: readonly string[], previous: readonly string[], isExclusive: (value: string) => boolean): string[];
148
+ /**
149
+ * Builds a deterministic id generator. `Date.now()` and `Math.random()`, as the
150
+ * old `createFilter` used, give the server and the client different ids for the
151
+ * same query, so any page shipping default filters hydrated mismatched.
152
+ */
153
+ declare function createFilterIdFactory(seed: string): () => string;
154
+ /** Warns once per key. Never throws, and is a no-op in production. */
155
+ declare function warnFilterOnce(key: string, message: string): void;
156
+ /** Clears the warn-once memory. For tests. */
157
+ declare function resetFilterWarnings(): void;
158
+ interface FilterSchemaIssues {
159
+ /** Ids that are empty, or that collide with a sibling. */
160
+ duplicatePaths: string[];
161
+ emptyIds: string[];
162
+ /** Branches that declare `selectable` but hold no children. */
163
+ emptyBranches: string[];
164
+ /** Fields whose `defaultOperator` is not in their operator list. */
165
+ unknownDefaultOperators: string[];
166
+ }
167
+ /** Reported, never thrown: a bad schema must degrade, not blank the page. */
168
+ declare function findFilterSchemaIssues<V, O>(fields: readonly FilterField<V, O>[], resolveOperators: (field: FilterField<V, O>) => FilterOperator[]): FilterSchemaIssues;
169
+ //#endregion
170
+ export { FILTER_FIELD_PICKER_CLASS, FILTER_MENU_CLASS, FILTER_MENU_LABEL_CLASS, FILTER_ROOT_KEY, FilterCombinatorSlot, FilterPathCollapse, FilterPathSegment, FilterSchemaIssues, applyFilterExclusiveSelection, buildFilterIndex, collapseFilterPath, computeFilterSchemaSignature, createFilterIdFactory, filterCombinatorSlot, filterFilterLevel, filterFilterOptions, findFilterSchemaIssues, foldFilterText, formatFilterPath, getFilterChildren, getFilterField, getFilterFieldChain, getFilterFieldCount, isFilterBranch, isFilterFieldPickable, isFilterFieldSelectable, joinFilterPath, matchesFilterQuery, normalizeFilterQuery, parentFilterKey, resetFilterWarnings, searchFilterDeep, splitFilterPath, warnFilterOnce };
171
+ //# sourceMappingURL=filters-lib.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filters-lib.d.ts","names":[],"sources":["../../../../src/components/reui/filters/filters-lib.tsx"],"mappings":";;;;;;;;;;;;;;;;cAuBa;;;;;;cAQA;;;;;;;;;cAUA;;cAOA;iBAKG,eAAe;iBAIf,gBAAgB;;iBAKhB,gBAAgB;;;;;;;;;;iBAiBhB,6BAA6B,GAAG,GAAG,iBAAiB,YAAY,GAAG;;;;;;;;iBAyEnE,iBAAiB,aAAa,aAC5C,iBAAiB,YAAY,GAAG,MAChC,WAAW,Y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