@fuf-stack/megapixels 0.7.3 → 0.9.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.
@@ -1,13 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+ const require_Filter = require('../Filter-Bc0LWCnZ.cjs');
2
3
 
3
-
4
-
5
-
6
- var _chunkKHENACVHcjs = require('../chunk-KHENACVH.cjs');
7
-
8
-
9
-
10
-
11
-
12
- exports.createFilter = _chunkKHENACVHcjs.createFilter_default; exports.default = _chunkKHENACVHcjs.Filter_default; exports.filterVariants = _chunkKHENACVHcjs.filterVariants; exports.filters = _chunkKHENACVHcjs.filters;
13
- //# sourceMappingURL=index.cjs.map
4
+ exports.createFilter = require_Filter.createFilter_default;
5
+ exports.default = require_Filter.Filter_default;
6
+ exports.filterVariants = require_Filter.filterVariants;
7
+ exports.filters = require_Filter.filters;
@@ -1,328 +1,2 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as tailwind_variants from 'tailwind-variants';
3
- import { TVClassName } from '@fuf-stack/pixel-utils';
4
- import { ReactNode } from 'react';
5
-
6
- /**
7
- * FilterDefinition
8
- *
9
- * Declarative description of a filter. A FilterDefinition is not used
10
- * directly by the UI. Instead, it is passed to `createFilter` to produce a
11
- * concrete, runtime `FilterInstance` for a specific usage (with name/icon and
12
- * optional config overrides).
13
- *
14
- * @typeParam Config - The configuration object shape for this filter
15
- * @typeParam Value - The runtime value type produced/consumed by this filter
16
- */
17
- interface FilterDefinition<Config, Value> {
18
- components: {
19
- /**
20
- * Display component rendered inside the filter chip. Receives the current
21
- * filter `value` and the merged `config`.
22
- */
23
- Display: (props: {
24
- value: Value;
25
- config: Config;
26
- }) => ReactNode;
27
- /**
28
- * Form component rendered inside the modal. Receives the fully-qualified
29
- * field name and the merged, validated `config`.
30
- */
31
- Form: (props: {
32
- fieldName: string;
33
- config: Config;
34
- }) => ReactNode;
35
- };
36
- defaults: {
37
- /** Baseline configuration for the filter; can be overridden per usage */
38
- config: Config;
39
- /** Initial form value seeded when a filter is added */
40
- value: Value;
41
- };
42
- /**
43
- * Validation factory returning an ex-validator schema for the value shape.
44
- * Receives the (merged) `config` so the schema can depend on configuration.
45
- */
46
- validation: (config?: Config) => unknown;
47
- }
48
- /**
49
- * FilterFactory
50
- *
51
- * A filter exports a factory that, given name/icon and optional config
52
- * overrides, returns a concrete FilterInstance with merged config and a
53
- * computed defaultValue.
54
- *
55
- * @typeParam Config - Configuration object shape for the filter
56
- * @typeParam Value - Runtime value type for the filter
57
- */
58
- type FilterFactory<Config, Value> = (args: {
59
- /** Per-usage configuration overrides merged with `defaults.config` */
60
- config?: Partial<Config>;
61
- /** Optional icon element shown in menus/labels */
62
- icon?: ReactNode;
63
- /** Logical field name under `filter.{name}` */
64
- name: string;
65
- }) => FilterInstance<Config, Value>;
66
- /**
67
- * FilterInstance
68
- *
69
- * Runtime instance created by merging a filter's defaults with usage
70
- * overrides and attaching name/icon for UI.
71
- *
72
- * This is the only shape used by the rendering layer and context.
73
- *
74
- * @typeParam Config - Effective configuration object shape
75
- * @typeParam Value - Effective value type for the filter
76
- */
77
- interface FilterInstance<Config, Value> {
78
- /** UI components (Form/Display) provided by the filter */
79
- components: FilterDefinition<Config, Value>['components'];
80
- /** Merged configuration (`defaults.config` overlaid with per-usage overrides) */
81
- config: Config;
82
- /** Initial form value to seed when adding this filter */
83
- defaultValue: Value;
84
- /** Optional icon element used in menus/labels */
85
- icon?: ReactNode;
86
- /** Logical field name under `filter.{name}` */
87
- name: string;
88
- /** ex-validator schema factory for the value; typically closure over config */
89
- validation: (config?: Config) => unknown;
90
- }
91
- /**
92
- * FiltersConfiguration
93
- *
94
- * Top-level collection of instantiated filters used by the Filter component
95
- * and FiltersContext. Each entry is a concrete FilterInstance (already created
96
- * via a filter factory), carrying its merged config, default value, UI
97
- * components, and validate function.
98
- */
99
- type FiltersConfiguration = FilterInstance<any, any>[];
100
- /**
101
- * FilterDisplayProps
102
- *
103
- * Props provided to a filter's Display component. Derived from an active
104
- * FilterInstance at runtime.
105
- *
106
- * @typeParam Config - Effective configuration type for the instance
107
- * @typeParam Value - Effective value type for the instance
108
- */
109
- interface FilterDisplayProps<Config, Value> {
110
- /** Merged configuration for the filter instance */
111
- config: Config;
112
- /** Current (possibly partial) value for the filter instance */
113
- value: Value;
114
- }
115
- /**
116
- * FilterFormProps
117
- *
118
- * Props provided to a filter's Form component. The `fieldName` is the
119
- * fully-qualified path in the host form, and the `config` is the instance's
120
- * merged configuration.
121
- *
122
- * @typeParam Config - Effective configuration type for the instance
123
- */
124
- interface FilterFormProps<Config> {
125
- /** Merged configuration for the filter instance */
126
- config: Config;
127
- /** Fully-qualified form field path (e.g., `filter.status`) */
128
- fieldName: string;
129
- }
130
-
131
- type SearchConfiguration = boolean | {
132
- /** Placeholder shown in the search input */
133
- placeholder?: string;
134
- };
135
-
136
- declare const filterVariants: tailwind_variants.TVReturnType<{
137
- [key: string]: {
138
- [key: string]: tailwind_variants.ClassValue | {
139
- base?: tailwind_variants.ClassValue;
140
- form?: tailwind_variants.ClassValue;
141
- searchWrapper?: tailwind_variants.ClassValue;
142
- searchShowButton?: tailwind_variants.ClassValue;
143
- searchMotionDiv?: tailwind_variants.ClassValue;
144
- searchInput?: tailwind_variants.ClassValue;
145
- searchInputWrapper?: tailwind_variants.ClassValue;
146
- searchSubmitButton?: tailwind_variants.ClassValue;
147
- addFilterMenuItem?: tailwind_variants.ClassValue;
148
- addFilterMenuButton?: tailwind_variants.ClassValue;
149
- activeFilterLabel?: tailwind_variants.ClassValue;
150
- filterModalBody?: tailwind_variants.ClassValue;
151
- filterModalHeader?: tailwind_variants.ClassValue;
152
- filterModalFooter?: tailwind_variants.ClassValue;
153
- };
154
- };
155
- } | {
156
- [x: string]: {
157
- [x: string]: tailwind_variants.ClassValue | {
158
- base?: tailwind_variants.ClassValue;
159
- form?: tailwind_variants.ClassValue;
160
- searchWrapper?: tailwind_variants.ClassValue;
161
- searchShowButton?: tailwind_variants.ClassValue;
162
- searchMotionDiv?: tailwind_variants.ClassValue;
163
- searchInput?: tailwind_variants.ClassValue;
164
- searchInputWrapper?: tailwind_variants.ClassValue;
165
- searchSubmitButton?: tailwind_variants.ClassValue;
166
- addFilterMenuItem?: tailwind_variants.ClassValue;
167
- addFilterMenuButton?: tailwind_variants.ClassValue;
168
- activeFilterLabel?: tailwind_variants.ClassValue;
169
- filterModalBody?: tailwind_variants.ClassValue;
170
- filterModalHeader?: tailwind_variants.ClassValue;
171
- filterModalFooter?: tailwind_variants.ClassValue;
172
- };
173
- };
174
- } | {}, {
175
- base: string;
176
- addFilterMenuButton: string;
177
- addFilterMenuItem: string;
178
- activeFilterLabel: string;
179
- filterModalBody: string;
180
- filterModalHeader: string;
181
- filterModalFooter: string;
182
- form: string;
183
- searchInput: string;
184
- searchInputWrapper: string;
185
- searchMotionDiv: string;
186
- searchShowButton: string;
187
- searchSubmitButton: string;
188
- searchWrapper: string;
189
- }, undefined, {
190
- [key: string]: {
191
- [key: string]: tailwind_variants.ClassValue | {
192
- base?: tailwind_variants.ClassValue;
193
- form?: tailwind_variants.ClassValue;
194
- searchWrapper?: tailwind_variants.ClassValue;
195
- searchShowButton?: tailwind_variants.ClassValue;
196
- searchMotionDiv?: tailwind_variants.ClassValue;
197
- searchInput?: tailwind_variants.ClassValue;
198
- searchInputWrapper?: tailwind_variants.ClassValue;
199
- searchSubmitButton?: tailwind_variants.ClassValue;
200
- addFilterMenuItem?: tailwind_variants.ClassValue;
201
- addFilterMenuButton?: tailwind_variants.ClassValue;
202
- activeFilterLabel?: tailwind_variants.ClassValue;
203
- filterModalBody?: tailwind_variants.ClassValue;
204
- filterModalHeader?: tailwind_variants.ClassValue;
205
- filterModalFooter?: tailwind_variants.ClassValue;
206
- };
207
- };
208
- } | {}, {
209
- base: string;
210
- addFilterMenuButton: string;
211
- addFilterMenuItem: string;
212
- activeFilterLabel: string;
213
- filterModalBody: string;
214
- filterModalHeader: string;
215
- filterModalFooter: string;
216
- form: string;
217
- searchInput: string;
218
- searchInputWrapper: string;
219
- searchMotionDiv: string;
220
- searchShowButton: string;
221
- searchSubmitButton: string;
222
- searchWrapper: string;
223
- }, tailwind_variants.TVReturnType<unknown, {
224
- base: string;
225
- addFilterMenuButton: string;
226
- addFilterMenuItem: string;
227
- activeFilterLabel: string;
228
- filterModalBody: string;
229
- filterModalHeader: string;
230
- filterModalFooter: string;
231
- form: string;
232
- searchInput: string;
233
- searchInputWrapper: string;
234
- searchMotionDiv: string;
235
- searchShowButton: string;
236
- searchSubmitButton: string;
237
- searchWrapper: string;
238
- }, undefined, unknown, unknown, undefined>>;
239
- type ClassName = TVClassName<typeof filterVariants>;
240
- interface FilterValues {
241
- search?: string;
242
- filter?: string | Record<string, unknown> | null;
243
- }
244
- type FilterChildRenderFn = (values: {
245
- search?: string;
246
- filter?: Record<string, unknown>;
247
- }) => ReactNode;
248
- /**
249
- * Filter
250
- *
251
- * Controlled, form-driven filter UI.
252
- *
253
- * Responsibilities
254
- * - Derives initial form values from the controlled `values` prop
255
- * - Builds a composite validation schema from the filter registry (and optional search)
256
- * - Exposes ergonomic UI: active filters list, add/remove actions, and per-filter modal
257
- * - Commits changes by invoking the controlled `onChange` callback on submit
258
- *
259
- * Structure
260
- * - Owns an ex-forms `Form` that wraps the entire filter experience
261
- * - Optionally renders a search input bound to the `search` field
262
- * - Renders ActiveFilters, AddFilterMenu, and FilterModal inside a shared context
263
- * - Optionally renders children as a render-prop with the resolved `values`
264
- */
265
- interface FilterProps {
266
- /** Optional render-prop that receives the resolved, controlled values */
267
- children?: FilterChildRenderFn;
268
- /** CSS class name */
269
- className?: ClassName;
270
- /** Configuration of the filter */
271
- config: {
272
- /**
273
- * Declarative filter configuration. Each entry ties a logical name to a
274
- * registry filter type and (optionally) per-usage config overrides.
275
- */
276
- filters: FiltersConfiguration;
277
- /** Optional configuration for search field */
278
- search?: SearchConfiguration;
279
- };
280
- /** ex-forms form instance name. Defaults to "filterComponentForm". */
281
- formName?: string;
282
- /** Controlled setter invoked on submit with the next canonical values */
283
- onChange: (nextValues: FilterValues) => void;
284
- /** Controlled committed state: the canonical `search` and `filter` values */
285
- values: FilterValues;
286
- }
287
- /**
288
- * Renders the filter UI bound to a single ex-forms `Form`.
289
- * The form is the source of truth during user interaction; the committed
290
- * state is controlled by the parent via `values`/`onChange`.
291
- */
292
- declare const Filter: ({ children, className, config, formName, onChange, values, }: FilterProps) => react_jsx_runtime.JSX.Element;
293
-
294
- /**
295
- * createFilter
296
- *
297
- * Builds a filter factory from a static FilterDefinition. The returned factory
298
- * accepts a usage descriptor (name/icon and optional partial config) and
299
- * produces a concrete FilterInstance with:
300
- * - merged config (shallow: definition.defaults.config overlaid by overrides)
301
- * - Form/Display components
302
- * - validate function (forwarded from the definition)
303
- * - defaultValue (forwarded from the definition)
304
- * - name and icon for UI integration
305
- *
306
- * @typeParam Config - Configuration object shape for the filter
307
- * @typeParam Value - Runtime value type for the filter
308
- * @param definition - Static description of the filter (components, defaults, validate)
309
- * @returns FilterFactory that creates FilterInstance<Config, Value>
310
- */
311
- declare const createFilter: <Config, Value>(definition: FilterDefinition<Config, Value>) => FilterFactory<Config, Value>;
312
-
313
- declare const filters: {
314
- boolean: FilterFactory<{
315
- text: string;
316
- textPrefix?: string | undefined;
317
- textNoWord?: string | undefined;
318
- }, boolean | undefined>;
319
- checkboxes: FilterFactory<{
320
- text: string;
321
- options: {
322
- value: string;
323
- label: string;
324
- }[];
325
- }, string[]>;
326
- };
327
-
328
- export { type FilterChildRenderFn, type FilterDefinition, type FilterDisplayProps, type FilterFactory, type FilterFormProps, type FilterInstance, type FilterProps, type FilterValues, type FiltersConfiguration, createFilter, Filter as default, filterVariants, filters };
1
+ import { a as FilterProps, c as FilterDefinition, d as FilterFormProps, f as FilterInstance, i as FilterChildRenderFn, l as FilterDisplayProps, n as createFilter, o as FilterValues, p as FiltersConfiguration, r as Filter, s as filterVariants, t as filters, u as FilterFactory } from "../index-_lmq8laN.cjs";
2
+ export { FilterChildRenderFn, FilterDefinition, FilterDisplayProps, FilterFactory, FilterFormProps, FilterInstance, FilterProps, FilterValues, FiltersConfiguration, createFilter, Filter as default, filterVariants, filters };
@@ -1,328 +1,2 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as tailwind_variants from 'tailwind-variants';
3
- import { TVClassName } from '@fuf-stack/pixel-utils';
4
- import { ReactNode } from 'react';
5
-
6
- /**
7
- * FilterDefinition
8
- *
9
- * Declarative description of a filter. A FilterDefinition is not used
10
- * directly by the UI. Instead, it is passed to `createFilter` to produce a
11
- * concrete, runtime `FilterInstance` for a specific usage (with name/icon and
12
- * optional config overrides).
13
- *
14
- * @typeParam Config - The configuration object shape for this filter
15
- * @typeParam Value - The runtime value type produced/consumed by this filter
16
- */
17
- interface FilterDefinition<Config, Value> {
18
- components: {
19
- /**
20
- * Display component rendered inside the filter chip. Receives the current
21
- * filter `value` and the merged `config`.
22
- */
23
- Display: (props: {
24
- value: Value;
25
- config: Config;
26
- }) => ReactNode;
27
- /**
28
- * Form component rendered inside the modal. Receives the fully-qualified
29
- * field name and the merged, validated `config`.
30
- */
31
- Form: (props: {
32
- fieldName: string;
33
- config: Config;
34
- }) => ReactNode;
35
- };
36
- defaults: {
37
- /** Baseline configuration for the filter; can be overridden per usage */
38
- config: Config;
39
- /** Initial form value seeded when a filter is added */
40
- value: Value;
41
- };
42
- /**
43
- * Validation factory returning an ex-validator schema for the value shape.
44
- * Receives the (merged) `config` so the schema can depend on configuration.
45
- */
46
- validation: (config?: Config) => unknown;
47
- }
48
- /**
49
- * FilterFactory
50
- *
51
- * A filter exports a factory that, given name/icon and optional config
52
- * overrides, returns a concrete FilterInstance with merged config and a
53
- * computed defaultValue.
54
- *
55
- * @typeParam Config - Configuration object shape for the filter
56
- * @typeParam Value - Runtime value type for the filter
57
- */
58
- type FilterFactory<Config, Value> = (args: {
59
- /** Per-usage configuration overrides merged with `defaults.config` */
60
- config?: Partial<Config>;
61
- /** Optional icon element shown in menus/labels */
62
- icon?: ReactNode;
63
- /** Logical field name under `filter.{name}` */
64
- name: string;
65
- }) => FilterInstance<Config, Value>;
66
- /**
67
- * FilterInstance
68
- *
69
- * Runtime instance created by merging a filter's defaults with usage
70
- * overrides and attaching name/icon for UI.
71
- *
72
- * This is the only shape used by the rendering layer and context.
73
- *
74
- * @typeParam Config - Effective configuration object shape
75
- * @typeParam Value - Effective value type for the filter
76
- */
77
- interface FilterInstance<Config, Value> {
78
- /** UI components (Form/Display) provided by the filter */
79
- components: FilterDefinition<Config, Value>['components'];
80
- /** Merged configuration (`defaults.config` overlaid with per-usage overrides) */
81
- config: Config;
82
- /** Initial form value to seed when adding this filter */
83
- defaultValue: Value;
84
- /** Optional icon element used in menus/labels */
85
- icon?: ReactNode;
86
- /** Logical field name under `filter.{name}` */
87
- name: string;
88
- /** ex-validator schema factory for the value; typically closure over config */
89
- validation: (config?: Config) => unknown;
90
- }
91
- /**
92
- * FiltersConfiguration
93
- *
94
- * Top-level collection of instantiated filters used by the Filter component
95
- * and FiltersContext. Each entry is a concrete FilterInstance (already created
96
- * via a filter factory), carrying its merged config, default value, UI
97
- * components, and validate function.
98
- */
99
- type FiltersConfiguration = FilterInstance<any, any>[];
100
- /**
101
- * FilterDisplayProps
102
- *
103
- * Props provided to a filter's Display component. Derived from an active
104
- * FilterInstance at runtime.
105
- *
106
- * @typeParam Config - Effective configuration type for the instance
107
- * @typeParam Value - Effective value type for the instance
108
- */
109
- interface FilterDisplayProps<Config, Value> {
110
- /** Merged configuration for the filter instance */
111
- config: Config;
112
- /** Current (possibly partial) value for the filter instance */
113
- value: Value;
114
- }
115
- /**
116
- * FilterFormProps
117
- *
118
- * Props provided to a filter's Form component. The `fieldName` is the
119
- * fully-qualified path in the host form, and the `config` is the instance's
120
- * merged configuration.
121
- *
122
- * @typeParam Config - Effective configuration type for the instance
123
- */
124
- interface FilterFormProps<Config> {
125
- /** Merged configuration for the filter instance */
126
- config: Config;
127
- /** Fully-qualified form field path (e.g., `filter.status`) */
128
- fieldName: string;
129
- }
130
-
131
- type SearchConfiguration = boolean | {
132
- /** Placeholder shown in the search input */
133
- placeholder?: string;
134
- };
135
-
136
- declare const filterVariants: tailwind_variants.TVReturnType<{
137
- [key: string]: {
138
- [key: string]: tailwind_variants.ClassValue | {
139
- base?: tailwind_variants.ClassValue;
140
- form?: tailwind_variants.ClassValue;
141
- searchWrapper?: tailwind_variants.ClassValue;
142
- searchShowButton?: tailwind_variants.ClassValue;
143
- searchMotionDiv?: tailwind_variants.ClassValue;
144
- searchInput?: tailwind_variants.ClassValue;
145
- searchInputWrapper?: tailwind_variants.ClassValue;
146
- searchSubmitButton?: tailwind_variants.ClassValue;
147
- addFilterMenuItem?: tailwind_variants.ClassValue;
148
- addFilterMenuButton?: tailwind_variants.ClassValue;
149
- activeFilterLabel?: tailwind_variants.ClassValue;
150
- filterModalBody?: tailwind_variants.ClassValue;
151
- filterModalHeader?: tailwind_variants.ClassValue;
152
- filterModalFooter?: tailwind_variants.ClassValue;
153
- };
154
- };
155
- } | {
156
- [x: string]: {
157
- [x: string]: tailwind_variants.ClassValue | {
158
- base?: tailwind_variants.ClassValue;
159
- form?: tailwind_variants.ClassValue;
160
- searchWrapper?: tailwind_variants.ClassValue;
161
- searchShowButton?: tailwind_variants.ClassValue;
162
- searchMotionDiv?: tailwind_variants.ClassValue;
163
- searchInput?: tailwind_variants.ClassValue;
164
- searchInputWrapper?: tailwind_variants.ClassValue;
165
- searchSubmitButton?: tailwind_variants.ClassValue;
166
- addFilterMenuItem?: tailwind_variants.ClassValue;
167
- addFilterMenuButton?: tailwind_variants.ClassValue;
168
- activeFilterLabel?: tailwind_variants.ClassValue;
169
- filterModalBody?: tailwind_variants.ClassValue;
170
- filterModalHeader?: tailwind_variants.ClassValue;
171
- filterModalFooter?: tailwind_variants.ClassValue;
172
- };
173
- };
174
- } | {}, {
175
- base: string;
176
- addFilterMenuButton: string;
177
- addFilterMenuItem: string;
178
- activeFilterLabel: string;
179
- filterModalBody: string;
180
- filterModalHeader: string;
181
- filterModalFooter: string;
182
- form: string;
183
- searchInput: string;
184
- searchInputWrapper: string;
185
- searchMotionDiv: string;
186
- searchShowButton: string;
187
- searchSubmitButton: string;
188
- searchWrapper: string;
189
- }, undefined, {
190
- [key: string]: {
191
- [key: string]: tailwind_variants.ClassValue | {
192
- base?: tailwind_variants.ClassValue;
193
- form?: tailwind_variants.ClassValue;
194
- searchWrapper?: tailwind_variants.ClassValue;
195
- searchShowButton?: tailwind_variants.ClassValue;
196
- searchMotionDiv?: tailwind_variants.ClassValue;
197
- searchInput?: tailwind_variants.ClassValue;
198
- searchInputWrapper?: tailwind_variants.ClassValue;
199
- searchSubmitButton?: tailwind_variants.ClassValue;
200
- addFilterMenuItem?: tailwind_variants.ClassValue;
201
- addFilterMenuButton?: tailwind_variants.ClassValue;
202
- activeFilterLabel?: tailwind_variants.ClassValue;
203
- filterModalBody?: tailwind_variants.ClassValue;
204
- filterModalHeader?: tailwind_variants.ClassValue;
205
- filterModalFooter?: tailwind_variants.ClassValue;
206
- };
207
- };
208
- } | {}, {
209
- base: string;
210
- addFilterMenuButton: string;
211
- addFilterMenuItem: string;
212
- activeFilterLabel: string;
213
- filterModalBody: string;
214
- filterModalHeader: string;
215
- filterModalFooter: string;
216
- form: string;
217
- searchInput: string;
218
- searchInputWrapper: string;
219
- searchMotionDiv: string;
220
- searchShowButton: string;
221
- searchSubmitButton: string;
222
- searchWrapper: string;
223
- }, tailwind_variants.TVReturnType<unknown, {
224
- base: string;
225
- addFilterMenuButton: string;
226
- addFilterMenuItem: string;
227
- activeFilterLabel: string;
228
- filterModalBody: string;
229
- filterModalHeader: string;
230
- filterModalFooter: string;
231
- form: string;
232
- searchInput: string;
233
- searchInputWrapper: string;
234
- searchMotionDiv: string;
235
- searchShowButton: string;
236
- searchSubmitButton: string;
237
- searchWrapper: string;
238
- }, undefined, unknown, unknown, undefined>>;
239
- type ClassName = TVClassName<typeof filterVariants>;
240
- interface FilterValues {
241
- search?: string;
242
- filter?: string | Record<string, unknown> | null;
243
- }
244
- type FilterChildRenderFn = (values: {
245
- search?: string;
246
- filter?: Record<string, unknown>;
247
- }) => ReactNode;
248
- /**
249
- * Filter
250
- *
251
- * Controlled, form-driven filter UI.
252
- *
253
- * Responsibilities
254
- * - Derives initial form values from the controlled `values` prop
255
- * - Builds a composite validation schema from the filter registry (and optional search)
256
- * - Exposes ergonomic UI: active filters list, add/remove actions, and per-filter modal
257
- * - Commits changes by invoking the controlled `onChange` callback on submit
258
- *
259
- * Structure
260
- * - Owns an ex-forms `Form` that wraps the entire filter experience
261
- * - Optionally renders a search input bound to the `search` field
262
- * - Renders ActiveFilters, AddFilterMenu, and FilterModal inside a shared context
263
- * - Optionally renders children as a render-prop with the resolved `values`
264
- */
265
- interface FilterProps {
266
- /** Optional render-prop that receives the resolved, controlled values */
267
- children?: FilterChildRenderFn;
268
- /** CSS class name */
269
- className?: ClassName;
270
- /** Configuration of the filter */
271
- config: {
272
- /**
273
- * Declarative filter configuration. Each entry ties a logical name to a
274
- * registry filter type and (optionally) per-usage config overrides.
275
- */
276
- filters: FiltersConfiguration;
277
- /** Optional configuration for search field */
278
- search?: SearchConfiguration;
279
- };
280
- /** ex-forms form instance name. Defaults to "filterComponentForm". */
281
- formName?: string;
282
- /** Controlled setter invoked on submit with the next canonical values */
283
- onChange: (nextValues: FilterValues) => void;
284
- /** Controlled committed state: the canonical `search` and `filter` values */
285
- values: FilterValues;
286
- }
287
- /**
288
- * Renders the filter UI bound to a single ex-forms `Form`.
289
- * The form is the source of truth during user interaction; the committed
290
- * state is controlled by the parent via `values`/`onChange`.
291
- */
292
- declare const Filter: ({ children, className, config, formName, onChange, values, }: FilterProps) => react_jsx_runtime.JSX.Element;
293
-
294
- /**
295
- * createFilter
296
- *
297
- * Builds a filter factory from a static FilterDefinition. The returned factory
298
- * accepts a usage descriptor (name/icon and optional partial config) and
299
- * produces a concrete FilterInstance with:
300
- * - merged config (shallow: definition.defaults.config overlaid by overrides)
301
- * - Form/Display components
302
- * - validate function (forwarded from the definition)
303
- * - defaultValue (forwarded from the definition)
304
- * - name and icon for UI integration
305
- *
306
- * @typeParam Config - Configuration object shape for the filter
307
- * @typeParam Value - Runtime value type for the filter
308
- * @param definition - Static description of the filter (components, defaults, validate)
309
- * @returns FilterFactory that creates FilterInstance<Config, Value>
310
- */
311
- declare const createFilter: <Config, Value>(definition: FilterDefinition<Config, Value>) => FilterFactory<Config, Value>;
312
-
313
- declare const filters: {
314
- boolean: FilterFactory<{
315
- text: string;
316
- textPrefix?: string | undefined;
317
- textNoWord?: string | undefined;
318
- }, boolean | undefined>;
319
- checkboxes: FilterFactory<{
320
- text: string;
321
- options: {
322
- value: string;
323
- label: string;
324
- }[];
325
- }, string[]>;
326
- };
327
-
328
- export { type FilterChildRenderFn, type FilterDefinition, type FilterDisplayProps, type FilterFactory, type FilterFormProps, type FilterInstance, type FilterProps, type FilterValues, type FiltersConfiguration, createFilter, Filter as default, filterVariants, filters };
1
+ import { a as FilterProps, c as FilterDefinition, d as FilterFormProps, f as FilterInstance, i as FilterChildRenderFn, l as FilterDisplayProps, n as createFilter, o as FilterValues, p as FiltersConfiguration, r as Filter, s as filterVariants, t as filters, u as FilterFactory } from "../index-BYqvJZ2C.js";
2
+ export { FilterChildRenderFn, FilterDefinition, FilterDisplayProps, FilterFactory, FilterFormProps, FilterInstance, FilterProps, FilterValues, FiltersConfiguration, createFilter, Filter as default, filterVariants, filters };
@@ -1,13 +1,3 @@
1
- import {
2
- Filter_default,
3
- createFilter_default,
4
- filterVariants,
5
- filters
6
- } from "../chunk-YX3ABWOU.js";
7
- export {
8
- createFilter_default as createFilter,
9
- Filter_default as default,
10
- filterVariants,
11
- filters
12
- };
13
- //# sourceMappingURL=index.js.map
1
+ import { i as filterVariants, n as filters, r as createFilter_default, t as Filter_default } from "../Filter-nSuQco2t.js";
2
+
3
+ export { createFilter_default as createFilter, Filter_default as default, filterVariants, filters };