@fuf-stack/megapixels 0.11.24 → 0.11.26

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 (34) hide show
  1. package/dist/Filter/index.cjs +1 -1
  2. package/dist/Filter/index.d.cts +1 -1
  3. package/dist/Filter/index.d.ts +1 -1
  4. package/dist/Filter/index.js +1 -1
  5. package/dist/{Filter-BVwu1kNx.cjs → Filter-B_YqTFA5.cjs} +23 -29
  6. package/dist/Filter-B_YqTFA5.cjs.map +1 -0
  7. package/dist/{Filter-MoxrK8MI.js → Filter-DHNzbevz.js} +23 -23
  8. package/dist/{Filter-MoxrK8MI.js.map → Filter-DHNzbevz.js.map} +1 -1
  9. package/dist/Notification/index.cjs +1 -1
  10. package/dist/Notification/index.d.cts +1 -1
  11. package/dist/Notification/index.d.ts +1 -1
  12. package/dist/Notification/index.js +1 -1
  13. package/dist/{Notification-B-G4OVD2.js → Notification-5tyFF-87.js} +1 -1
  14. package/dist/{Notification-B-G4OVD2.js.map → Notification-5tyFF-87.js.map} +1 -1
  15. package/dist/{Notification-BjftuLye.cjs → Notification-ClLRWj0j.cjs} +1 -2
  16. package/dist/{Notification-BjftuLye.cjs.map → Notification-ClLRWj0j.cjs.map} +1 -1
  17. package/dist/index-BkliAQ5x.d.cts +2060 -0
  18. package/dist/index-BkliAQ5x.d.cts.map +1 -0
  19. package/dist/index-DNAyXW3U.d.ts +2060 -0
  20. package/dist/index-DNAyXW3U.d.ts.map +1 -0
  21. package/dist/{index-DMd9TyqF.d.cts → index-DRyBPfQT.d.cts} +1 -1
  22. package/dist/{index-DMd9TyqF.d.cts.map → index-DRyBPfQT.d.cts.map} +1 -1
  23. package/dist/{index-DaLo1TQx.d.ts → index-DRyBPfQT.d.ts} +1 -1
  24. package/dist/{index-DaLo1TQx.d.ts.map → index-DRyBPfQT.d.ts.map} +1 -1
  25. package/dist/index.cjs +2 -2
  26. package/dist/index.d.cts +2 -2
  27. package/dist/index.d.ts +2 -2
  28. package/dist/index.js +2 -2
  29. package/package.json +7 -7
  30. package/dist/Filter-BVwu1kNx.cjs.map +0 -1
  31. package/dist/index-DU-9vg7q.d.ts +0 -354
  32. package/dist/index-DU-9vg7q.d.ts.map +0 -1
  33. package/dist/index-Dpm2SIC2.d.cts +0 -354
  34. package/dist/index-Dpm2SIC2.d.cts.map +0 -1
@@ -1,354 +0,0 @@
1
- import { vInfer } from "@fuf-stack/veto";
2
- import { ReactNode } from "react";
3
- import { TVClassName } from "@fuf-stack/pixel-utils";
4
-
5
- //#region src/Filter/filters/checkboxes/schema.d.ts
6
- /** configuration of the filter */
7
- declare const config$1: import("@fuf-stack/veto").VObjectSchema<{
8
- /**
9
- * Human‑readable label used in the UI (e.g. label and modal header).
10
- * Example: "Snacks", "Mood"
11
- */
12
- text: import("@fuf-stack/veto").ZodString;
13
- /**
14
- * Options rendered as multiple checkboxes. Each option needs a `label`
15
- * (what the user sees) and a `value` (what is written into the form state).
16
- * Label can be a string, React node, or a function that receives mode
17
- * ('form' or 'display') and returns a React node.
18
- */
19
- options: import("@fuf-stack/veto").VArraySchema<import("@fuf-stack/veto").VObjectSchema<{
20
- label: import("@fuf-stack/veto").ZodAny;
21
- value: import("@fuf-stack/veto").ZodString;
22
- }>>;
23
- }>;
24
- /** Type-safe Config that overrides label to support ReactNode or function */
25
- type Config = Omit<vInfer<typeof config$1>, 'options'> & {
26
- options: {
27
- label: ReactNode | ((mode: 'form' | 'display') => ReactNode);
28
- value: string;
29
- }[];
30
- };
31
- //#endregion
32
- //#region src/Filter/filters/types.d.ts
33
- /**
34
- * FilterDefinition
35
- *
36
- * Declarative description of a filter. A FilterDefinition is not used
37
- * directly by the UI. Instead, it is passed to `createFilter` to produce a
38
- * concrete, runtime `FilterInstance` for a specific usage (with name/icon and
39
- * optional config overrides).
40
- *
41
- * @typeParam Config - The configuration object shape for this filter
42
- * @typeParam Value - The runtime value type produced/consumed by this filter
43
- */
44
- interface FilterDefinition<Config, Value> {
45
- components: {
46
- /**
47
- * Display component rendered inside the filter chip. Receives the current
48
- * filter `value` and the merged `config`.
49
- */
50
- Display: (props: {
51
- value: Value;
52
- config: Config;
53
- }) => ReactNode;
54
- /**
55
- * Form component rendered inside the modal. Receives the fully-qualified
56
- * field name and the merged, validated `config`.
57
- */
58
- Form: (props: {
59
- fieldName: string;
60
- config: Config;
61
- }) => ReactNode;
62
- };
63
- defaults: {
64
- /** Baseline configuration for the filter; can be overridden per usage */config: Config; /** Initial form value seeded when a filter is added */
65
- value: Value;
66
- };
67
- /**
68
- * Validation factory returning an ex-validator schema for the value shape.
69
- * Receives the (merged) `config` so the schema can depend on configuration.
70
- */
71
- validation: (config?: Config) => unknown;
72
- }
73
- /**
74
- * FilterFactory
75
- *
76
- * A filter exports a factory that, given name/icon and optional config
77
- * overrides, returns a concrete FilterInstance with merged config and a
78
- * computed defaultValue.
79
- *
80
- * @typeParam Config - Configuration object shape for the filter
81
- * @typeParam Value - Runtime value type for the filter
82
- */
83
- type FilterFactory<Config, Value> = (args: {
84
- /** Per-usage configuration overrides merged with `defaults.config` */config?: Partial<Config>; /** Optional icon element shown in menus/labels */
85
- icon?: ReactNode; /** Logical field name under `filter.{name}` */
86
- name: string;
87
- }) => FilterInstance<Config, Value>;
88
- /**
89
- * FilterInstance
90
- *
91
- * Runtime instance created by merging a filter's defaults with usage
92
- * overrides and attaching name/icon for UI.
93
- *
94
- * This is the only shape used by the rendering layer and context.
95
- *
96
- * @typeParam Config - Effective configuration object shape
97
- * @typeParam Value - Effective value type for the filter
98
- */
99
- interface FilterInstance<Config, Value> {
100
- /** UI components (Form/Display) provided by the filter */
101
- components: FilterDefinition<Config, Value>['components'];
102
- /** Merged configuration (`defaults.config` overlaid with per-usage overrides) */
103
- config: Config;
104
- /** Initial form value to seed when adding this filter */
105
- defaultValue: Value;
106
- /** Optional icon element used in menus/labels */
107
- icon?: ReactNode;
108
- /** Logical field name under `filter.{name}` */
109
- name: string;
110
- /** ex-validator schema factory for the value; typically closure over config */
111
- validation: (config?: Config) => unknown;
112
- }
113
- /**
114
- * FiltersConfiguration
115
- *
116
- * Top-level collection of instantiated filters used by the Filter component
117
- * and FiltersContext. Each entry is a concrete FilterInstance (already created
118
- * via a filter factory), carrying its merged config, default value, UI
119
- * components, and validate function.
120
- */
121
- type FiltersConfiguration = FilterInstance<any, any>[];
122
- /**
123
- * FilterDisplayProps
124
- *
125
- * Props provided to a filter's Display component. Derived from an active
126
- * FilterInstance at runtime.
127
- *
128
- * @typeParam Config - Effective configuration type for the instance
129
- * @typeParam Value - Effective value type for the instance
130
- */
131
- interface FilterDisplayProps<Config, Value> {
132
- /** Merged configuration for the filter instance */
133
- config: Config;
134
- /** Current (possibly partial) value for the filter instance */
135
- value: Value;
136
- }
137
- /**
138
- * FilterFormProps
139
- *
140
- * Props provided to a filter's Form component. The `fieldName` is the
141
- * fully-qualified path in the host form, and the `config` is the instance's
142
- * merged configuration.
143
- *
144
- * @typeParam Config - Effective configuration type for the instance
145
- */
146
- interface FilterFormProps<Config> {
147
- /** Merged configuration for the filter instance */
148
- config: Config;
149
- /** Fully-qualified form field path (e.g., `filter.status`) */
150
- fieldName: string;
151
- }
152
- //#endregion
153
- //#region src/Filter/Subcomponents/SearchInput.d.ts
154
- type SearchConfiguration = boolean | {
155
- /** Placeholder shown in the search input */placeholder?: string;
156
- };
157
- //#endregion
158
- //#region src/Filter/Filter.d.ts
159
- declare const filterVariants: import("tailwind-variants").TVReturnType<{
160
- [key: string]: {
161
- [key: string]: import("tailwind-merge").ClassNameValue | {
162
- base?: import("tailwind-merge").ClassNameValue;
163
- addFilterMenuButton?: import("tailwind-merge").ClassNameValue;
164
- addFilterMenuItem?: import("tailwind-merge").ClassNameValue;
165
- activeFilterLabel?: import("tailwind-merge").ClassNameValue;
166
- filterModalBody?: import("tailwind-merge").ClassNameValue;
167
- filterModalHeader?: import("tailwind-merge").ClassNameValue;
168
- filterModalFooter?: import("tailwind-merge").ClassNameValue;
169
- form?: import("tailwind-merge").ClassNameValue;
170
- searchInput?: import("tailwind-merge").ClassNameValue;
171
- searchInputWrapper?: import("tailwind-merge").ClassNameValue;
172
- searchMotionDiv?: import("tailwind-merge").ClassNameValue;
173
- searchShowButton?: import("tailwind-merge").ClassNameValue;
174
- searchSubmitButton?: import("tailwind-merge").ClassNameValue;
175
- searchWrapper?: import("tailwind-merge").ClassNameValue;
176
- };
177
- };
178
- } | {
179
- [x: string]: {
180
- [x: string]: import("tailwind-merge").ClassNameValue | {
181
- base?: import("tailwind-merge").ClassNameValue;
182
- addFilterMenuButton?: import("tailwind-merge").ClassNameValue;
183
- addFilterMenuItem?: import("tailwind-merge").ClassNameValue;
184
- activeFilterLabel?: import("tailwind-merge").ClassNameValue;
185
- filterModalBody?: import("tailwind-merge").ClassNameValue;
186
- filterModalHeader?: import("tailwind-merge").ClassNameValue;
187
- filterModalFooter?: import("tailwind-merge").ClassNameValue;
188
- form?: import("tailwind-merge").ClassNameValue;
189
- searchInput?: import("tailwind-merge").ClassNameValue;
190
- searchInputWrapper?: import("tailwind-merge").ClassNameValue;
191
- searchMotionDiv?: import("tailwind-merge").ClassNameValue;
192
- searchShowButton?: import("tailwind-merge").ClassNameValue;
193
- searchSubmitButton?: import("tailwind-merge").ClassNameValue;
194
- searchWrapper?: import("tailwind-merge").ClassNameValue;
195
- };
196
- };
197
- } | {}, {
198
- base: string;
199
- addFilterMenuButton: string;
200
- addFilterMenuItem: string;
201
- activeFilterLabel: string;
202
- filterModalBody: string;
203
- filterModalHeader: string;
204
- filterModalFooter: string;
205
- form: string;
206
- searchInput: string;
207
- searchInputWrapper: string;
208
- searchMotionDiv: string;
209
- searchShowButton: string;
210
- searchSubmitButton: string;
211
- searchWrapper: string;
212
- }, undefined, {
213
- [key: string]: {
214
- [key: string]: import("tailwind-merge").ClassNameValue | {
215
- base?: import("tailwind-merge").ClassNameValue;
216
- addFilterMenuButton?: import("tailwind-merge").ClassNameValue;
217
- addFilterMenuItem?: import("tailwind-merge").ClassNameValue;
218
- activeFilterLabel?: import("tailwind-merge").ClassNameValue;
219
- filterModalBody?: import("tailwind-merge").ClassNameValue;
220
- filterModalHeader?: import("tailwind-merge").ClassNameValue;
221
- filterModalFooter?: import("tailwind-merge").ClassNameValue;
222
- form?: import("tailwind-merge").ClassNameValue;
223
- searchInput?: import("tailwind-merge").ClassNameValue;
224
- searchInputWrapper?: import("tailwind-merge").ClassNameValue;
225
- searchMotionDiv?: import("tailwind-merge").ClassNameValue;
226
- searchShowButton?: import("tailwind-merge").ClassNameValue;
227
- searchSubmitButton?: import("tailwind-merge").ClassNameValue;
228
- searchWrapper?: import("tailwind-merge").ClassNameValue;
229
- };
230
- };
231
- } | {}, {
232
- base: string;
233
- addFilterMenuButton: string;
234
- addFilterMenuItem: string;
235
- activeFilterLabel: string;
236
- filterModalBody: string;
237
- filterModalHeader: string;
238
- filterModalFooter: string;
239
- form: string;
240
- searchInput: string;
241
- searchInputWrapper: string;
242
- searchMotionDiv: string;
243
- searchShowButton: string;
244
- searchSubmitButton: string;
245
- searchWrapper: string;
246
- }, import("tailwind-variants").TVReturnType<unknown, {
247
- base: string;
248
- addFilterMenuButton: string;
249
- addFilterMenuItem: string;
250
- activeFilterLabel: string;
251
- filterModalBody: string;
252
- filterModalHeader: string;
253
- filterModalFooter: string;
254
- form: string;
255
- searchInput: string;
256
- searchInputWrapper: string;
257
- searchMotionDiv: string;
258
- searchShowButton: string;
259
- searchSubmitButton: string;
260
- searchWrapper: string;
261
- }, undefined, unknown, unknown, undefined>>;
262
- type ClassName = TVClassName<typeof filterVariants>;
263
- interface FilterValues {
264
- search?: string;
265
- filter?: string | Record<string, unknown> | null;
266
- }
267
- type FilterChildRenderFn = (values: {
268
- search?: string;
269
- filter?: Record<string, unknown>;
270
- }) => ReactNode;
271
- /**
272
- * Filter
273
- *
274
- * Controlled, form-driven filter UI.
275
- *
276
- * Responsibilities
277
- * - Derives initial form values from the controlled `values` prop
278
- * - Builds a composite validation schema from the filter registry (and optional search)
279
- * - Exposes ergonomic UI: active filters list, add/remove actions, and per-filter modal
280
- * - Commits changes by invoking the controlled `onChange` callback on submit
281
- *
282
- * Structure
283
- * - Owns an ex-forms `Form` that wraps the entire filter experience
284
- * - Optionally renders a search input bound to the `search` field
285
- * - Renders ActiveFilters, AddFilterMenu, and FilterModal inside a shared context
286
- * - Optionally renders children as a render-prop with the resolved `values`
287
- */
288
- interface FilterProps {
289
- /** Optional render-prop that receives the resolved, controlled values */
290
- children?: FilterChildRenderFn;
291
- /** CSS class name */
292
- className?: ClassName;
293
- /** Configuration of the filter */
294
- config: {
295
- /**
296
- * Declarative filter configuration. Each entry ties a logical name to a
297
- * registry filter type and (optionally) per-usage config overrides.
298
- */
299
- filters: FiltersConfiguration; /** Optional configuration for search field */
300
- search?: SearchConfiguration;
301
- };
302
- /** ex-forms form instance name. Defaults to "filterComponentForm". */
303
- formName?: string;
304
- /** Controlled setter invoked on submit with the next canonical values */
305
- onChange: (nextValues: FilterValues) => void;
306
- /** Controlled committed state: the canonical `search` and `filter` values */
307
- values: FilterValues;
308
- }
309
- /**
310
- * Renders the filter UI bound to a single ex-forms `Form`.
311
- * The form is the source of truth during user interaction; the committed
312
- * state is controlled by the parent via `values`/`onChange`.
313
- */
314
- declare const Filter: ({
315
- children,
316
- className,
317
- config,
318
- formName,
319
- onChange,
320
- values
321
- }: FilterProps) => import("react/jsx-runtime").JSX.Element;
322
- //#endregion
323
- //#region src/Filter/filters/createFilter.d.ts
324
- /**
325
- * createFilter
326
- *
327
- * Builds a filter factory from a static FilterDefinition. The returned factory
328
- * accepts a usage descriptor (name/icon and optional partial config) and
329
- * produces a concrete FilterInstance with:
330
- * - merged config (shallow: definition.defaults.config overlaid by overrides)
331
- * - Form/Display components
332
- * - validate function (forwarded from the definition)
333
- * - defaultValue (forwarded from the definition)
334
- * - name and icon for UI integration
335
- *
336
- * @typeParam Config - Configuration object shape for the filter
337
- * @typeParam Value - Runtime value type for the filter
338
- * @param definition - Static description of the filter (components, defaults, validate)
339
- * @returns FilterFactory that creates FilterInstance<Config, Value>
340
- */
341
- declare const createFilter: <Config, Value>(definition: FilterDefinition<Config, Value>) => FilterFactory<Config, Value>;
342
- //#endregion
343
- //#region src/Filter/index.d.ts
344
- declare const filters: {
345
- boolean: FilterFactory<{
346
- text: string;
347
- textPrefix?: string | undefined;
348
- textNoWord?: string | undefined;
349
- }, boolean | undefined>;
350
- checkboxes: FilterFactory<Config, string[] | undefined>;
351
- };
352
- //#endregion
353
- export { FilterProps as a, FilterDefinition as c, FilterFormProps as d, FilterInstance as f, FilterChildRenderFn as i, FilterDisplayProps as l, createFilter as n, FilterValues as o, FiltersConfiguration as p, Filter as r, filterVariants as s, filters as t, FilterFactory as u };
354
- //# sourceMappingURL=index-Dpm2SIC2.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-Dpm2SIC2.d.cts","names":[],"sources":["../src/Filter/filters/checkboxes/schema.ts","../src/Filter/filters/types.ts","../src/Filter/Subcomponents/SearchInput.tsx","../src/Filter/Filter.tsx","../src/Filter/filters/createFilter.ts","../src/Filter/index.ts"],"mappings":";;;;;;cAMa,QAAA,4BAAM,aAAA;;AAAnB;;;;EAAmB;;;;;;;;;;;;KAgBP,MAAA,GAAS,IAAA,CAAK,MAAA,QAAc,QAAA;EACtC,OAAA;IACE,KAAA,EAAO,SAAA,KAAc,IAAA,yBAA6B,SAAA;IAClD,KAAA;EAAA;AAAA;;;;;;;AAnBJ;;;;;;;UCOiB,gBAAA;EACf,UAAA;;;;;IAKE,OAAA,GAAU,KAAA;MAAS,KAAA,EAAO,KAAA;MAAO,MAAA,EAAQ,MAAA;IAAA,MAAa,SAAA;IDGxC;;;;ICEd,IAAA,GAAO,KAAA;MAAS,SAAA;MAAmB,MAAA,EAAQ,MAAA;IAAA,MAAa,SAAA;EAAA;EAE1D,QAAA;IDJwB,yECMtB,MAAA,EAAQ,MAAA,EDLV;ICOE,KAAA,EAAO,KAAA;EAAA;EDNc;;;;ECYvB,UAAA,GAAa,MAAA,GAA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