@fuf-stack/megapixels 0.1.0 → 0.2.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.
- package/dist/Filter/index.cjs +2 -2
- package/dist/Filter/index.d.cts +107 -1
- package/dist/Filter/index.d.ts +107 -1
- package/dist/Filter/index.js +1 -1
- package/dist/{chunk-X574WZ6N.js → chunk-3ZL7ZLSU.js} +123 -34
- package/dist/chunk-3ZL7ZLSU.js.map +1 -0
- package/dist/{chunk-XMMMIB2C.cjs → chunk-DHHIGH3H.cjs} +118 -29
- package/dist/chunk-DHHIGH3H.cjs.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-X574WZ6N.js.map +0 -1
- package/dist/chunk-XMMMIB2C.cjs.map +0 -1
package/dist/Filter/index.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkDHHIGH3Hcjs = require('../chunk-DHHIGH3H.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createFilter =
|
|
10
|
+
exports.createFilter = _chunkDHHIGH3Hcjs.createFilter_default; exports.default = _chunkDHHIGH3Hcjs.Filter_default; exports.filters = _chunkDHHIGH3Hcjs.filters;
|
|
11
11
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Filter/index.d.cts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
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';
|
|
2
4
|
import { ReactNode } from 'react';
|
|
3
5
|
|
|
4
6
|
/**
|
|
@@ -131,6 +133,110 @@ type SearchConfiguration = boolean | {
|
|
|
131
133
|
placeholder?: string;
|
|
132
134
|
};
|
|
133
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>;
|
|
134
240
|
interface FilterValues {
|
|
135
241
|
search?: string;
|
|
136
242
|
filter?: string | Record<string, unknown>;
|
|
@@ -157,7 +263,7 @@ interface FilterProps {
|
|
|
157
263
|
/** Optional render-prop that receives the resolved, controlled values */
|
|
158
264
|
children?: FilterChildRenderFn;
|
|
159
265
|
/** CSS class name */
|
|
160
|
-
className?:
|
|
266
|
+
className?: ClassName;
|
|
161
267
|
/** Configuration of the filter */
|
|
162
268
|
config: {
|
|
163
269
|
/**
|
package/dist/Filter/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
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';
|
|
2
4
|
import { ReactNode } from 'react';
|
|
3
5
|
|
|
4
6
|
/**
|
|
@@ -131,6 +133,110 @@ type SearchConfiguration = boolean | {
|
|
|
131
133
|
placeholder?: string;
|
|
132
134
|
};
|
|
133
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>;
|
|
134
240
|
interface FilterValues {
|
|
135
241
|
search?: string;
|
|
136
242
|
filter?: string | Record<string, unknown>;
|
|
@@ -157,7 +263,7 @@ interface FilterProps {
|
|
|
157
263
|
/** Optional render-prop that receives the resolved, controlled values */
|
|
158
264
|
children?: FilterChildRenderFn;
|
|
159
265
|
/** CSS class name */
|
|
160
|
-
className?:
|
|
266
|
+
className?: ClassName;
|
|
161
267
|
/** Configuration of the filter */
|
|
162
268
|
config: {
|
|
163
269
|
/**
|
package/dist/Filter/index.js
CHANGED
|
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
|
|
21
21
|
// src/Filter/Filter.tsx
|
|
22
|
-
import {
|
|
22
|
+
import { tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
23
23
|
import Form from "@fuf-stack/uniform/Form";
|
|
24
24
|
|
|
25
25
|
// src/Filter/hooks/useFilterValidation.ts
|
|
@@ -117,7 +117,7 @@ var FiltersContextProvider = ({
|
|
|
117
117
|
]);
|
|
118
118
|
const activeFilters = useMemo2(() => {
|
|
119
119
|
return config3.filter((f) => {
|
|
120
|
-
return Object.hasOwn(filterValue
|
|
120
|
+
return Object.hasOwn(filterValue != null ? filterValue : {}, f.name);
|
|
121
121
|
}).map((f) => {
|
|
122
122
|
return f.name;
|
|
123
123
|
});
|
|
@@ -211,7 +211,7 @@ var useFilters = () => {
|
|
|
211
211
|
|
|
212
212
|
// src/Filter/Subcomponents/ActiveFilters.tsx
|
|
213
213
|
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
214
|
-
var ActiveFilters = () => {
|
|
214
|
+
var ActiveFilters = ({ className = void 0 }) => {
|
|
215
215
|
const {
|
|
216
216
|
activeFilters,
|
|
217
217
|
getFilterValueByName,
|
|
@@ -230,12 +230,12 @@ var ActiveFilters = () => {
|
|
|
230
230
|
"aria-label": `Open ${name} filter`,
|
|
231
231
|
type: "button",
|
|
232
232
|
onClick: () => {
|
|
233
|
-
|
|
233
|
+
showFilterModal(name);
|
|
234
234
|
},
|
|
235
235
|
children: /* @__PURE__ */ jsxs(
|
|
236
236
|
Label,
|
|
237
237
|
{
|
|
238
|
-
className
|
|
238
|
+
className,
|
|
239
239
|
color: hasError(name) ? "danger" : "primary",
|
|
240
240
|
variant: "flat",
|
|
241
241
|
onClose: () => {
|
|
@@ -243,7 +243,7 @@ var ActiveFilters = () => {
|
|
|
243
243
|
},
|
|
244
244
|
children: [
|
|
245
245
|
instance.icon,
|
|
246
|
-
|
|
246
|
+
/* @__PURE__ */ jsx2(DisplayComponent, { config: instance.config, value })
|
|
247
247
|
]
|
|
248
248
|
}
|
|
249
249
|
)
|
|
@@ -256,10 +256,9 @@ var ActiveFilters_default = ActiveFilters;
|
|
|
256
256
|
|
|
257
257
|
// src/Filter/Subcomponents/AddFilterMenu.tsx
|
|
258
258
|
import { FaSliders } from "react-icons/fa6";
|
|
259
|
-
import { cn } from "@fuf-stack/pixel-utils";
|
|
260
259
|
import Menu from "@fuf-stack/pixels/Menu";
|
|
261
260
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
262
|
-
var AddFilterMenu = ({
|
|
261
|
+
var AddFilterMenu = ({ classNames = {} }) => {
|
|
263
262
|
const { unusedFilters, addFilter, getFilterInstanceByName } = useFilters();
|
|
264
263
|
const menuItems = unusedFilters.map((name) => {
|
|
265
264
|
var _a;
|
|
@@ -278,12 +277,16 @@ var AddFilterMenu = ({ className = void 0 }) => {
|
|
|
278
277
|
return /* @__PURE__ */ jsxs2(
|
|
279
278
|
Menu,
|
|
280
279
|
{
|
|
281
|
-
className: cn(className),
|
|
282
280
|
isDisabled: !menuItems.length,
|
|
283
281
|
items: menuItems,
|
|
284
282
|
placement: "bottom-start",
|
|
283
|
+
className: {
|
|
284
|
+
item: classNames.addFilterMenuItem,
|
|
285
|
+
trigger: classNames.addFilterMenuButton
|
|
286
|
+
},
|
|
285
287
|
triggerButtonProps: {
|
|
286
288
|
"aria-label": "Add Filter",
|
|
289
|
+
disableRipple: true,
|
|
287
290
|
size: "sm",
|
|
288
291
|
variant: "bordered"
|
|
289
292
|
},
|
|
@@ -303,7 +306,7 @@ import Button from "@fuf-stack/pixels/Button";
|
|
|
303
306
|
import Modal from "@fuf-stack/pixels/Modal";
|
|
304
307
|
import SubmitButton from "@fuf-stack/uniform/SubmitButton";
|
|
305
308
|
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
306
|
-
var FilterModal = () => {
|
|
309
|
+
var FilterModal = ({ classNames = {} }) => {
|
|
307
310
|
var _a, _b;
|
|
308
311
|
const {
|
|
309
312
|
closeFilterModal,
|
|
@@ -324,8 +327,9 @@ var FilterModal = () => {
|
|
|
324
327
|
isOpen: true,
|
|
325
328
|
onClose: closeFilterModal,
|
|
326
329
|
className: {
|
|
327
|
-
|
|
328
|
-
|
|
330
|
+
body: classNames.body,
|
|
331
|
+
footer: classNames.footer,
|
|
332
|
+
header: classNames.header
|
|
329
333
|
},
|
|
330
334
|
footer: /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
331
335
|
/* @__PURE__ */ jsx4(
|
|
@@ -361,23 +365,23 @@ var FilterModal_default = FilterModal;
|
|
|
361
365
|
import { useState as useState2 } from "react";
|
|
362
366
|
import { FaSearch } from "react-icons/fa";
|
|
363
367
|
import { motion } from "@fuf-stack/pixel-motion";
|
|
364
|
-
import { cn as cn2 } from "@fuf-stack/pixel-utils";
|
|
365
368
|
import Button2 from "@fuf-stack/pixels/Button";
|
|
366
369
|
import { useFormContext as useFormContext2 } from "@fuf-stack/uniform/hooks";
|
|
367
370
|
import Input from "@fuf-stack/uniform/Input";
|
|
368
371
|
import SubmitButton2 from "@fuf-stack/uniform/SubmitButton";
|
|
369
372
|
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
370
|
-
var SearchInput = ({
|
|
373
|
+
var SearchInput = ({ classNames = {}, config: config3 }) => {
|
|
371
374
|
var _a;
|
|
372
375
|
const { formState, setFocus, triggerSubmit } = useFormContext2();
|
|
373
376
|
const isInitiallyVisible = !!((_a = formState == null ? void 0 : formState.defaultValues) == null ? void 0 : _a.search);
|
|
374
377
|
const [isVisible, setIsVisible] = useState2(isInitiallyVisible);
|
|
375
378
|
const placeholder = typeof config3 === "object" ? config3.placeholder : void 0;
|
|
376
|
-
return /* @__PURE__ */ jsxs4("div", { className:
|
|
379
|
+
return /* @__PURE__ */ jsxs4("div", { className: classNames.searchWrapper, children: [
|
|
377
380
|
!isVisible && /* @__PURE__ */ jsx5(
|
|
378
381
|
Button2,
|
|
379
382
|
{
|
|
380
|
-
|
|
383
|
+
ariaLabel: "Show search input",
|
|
384
|
+
className: classNames.searchShowButton,
|
|
381
385
|
icon: /* @__PURE__ */ jsx5(FaSearch, {}),
|
|
382
386
|
size: "sm",
|
|
383
387
|
variant: "bordered",
|
|
@@ -390,7 +394,7 @@ var SearchInput = ({ className = void 0, config: config3 }) => {
|
|
|
390
394
|
motion.div,
|
|
391
395
|
{
|
|
392
396
|
animate: { opacity: 1 },
|
|
393
|
-
className:
|
|
397
|
+
className: classNames.searchMotionDiv,
|
|
394
398
|
initial: { opacity: 0.5 },
|
|
395
399
|
onAnimationComplete: () => {
|
|
396
400
|
if (!isInitiallyVisible) {
|
|
@@ -411,6 +415,10 @@ var SearchInput = ({ className = void 0, config: config3 }) => {
|
|
|
411
415
|
name: "search",
|
|
412
416
|
placeholder,
|
|
413
417
|
size: "sm",
|
|
418
|
+
className: {
|
|
419
|
+
input: classNames.searchInput,
|
|
420
|
+
inputWrapper: classNames.searchInputWrapper
|
|
421
|
+
},
|
|
414
422
|
onClear: () => {
|
|
415
423
|
triggerSubmit();
|
|
416
424
|
}
|
|
@@ -419,7 +427,9 @@ var SearchInput = ({ className = void 0, config: config3 }) => {
|
|
|
419
427
|
/* @__PURE__ */ jsx5(
|
|
420
428
|
SubmitButton2,
|
|
421
429
|
{
|
|
430
|
+
ariaLabel: "Trigger search",
|
|
422
431
|
children: null,
|
|
432
|
+
className: classNames.searchSubmitButton,
|
|
423
433
|
color: "primary",
|
|
424
434
|
icon: /* @__PURE__ */ jsx5(FaSearch, {}),
|
|
425
435
|
size: "sm"
|
|
@@ -434,7 +444,39 @@ var SearchInput = ({ className = void 0, config: config3 }) => {
|
|
|
434
444
|
var SearchInput_default = SearchInput;
|
|
435
445
|
|
|
436
446
|
// src/Filter/Filter.tsx
|
|
437
|
-
import {
|
|
447
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
448
|
+
var filterVariants = tv({
|
|
449
|
+
slots: {
|
|
450
|
+
// outer wrapper
|
|
451
|
+
base: "",
|
|
452
|
+
// add filter menu trigger button
|
|
453
|
+
addFilterMenuButton: "",
|
|
454
|
+
// add filter menu item
|
|
455
|
+
addFilterMenuItem: "",
|
|
456
|
+
// active filter label
|
|
457
|
+
activeFilterLabel: "dark:text-foreground h-8 cursor-pointer rounded-md",
|
|
458
|
+
// filter modal body
|
|
459
|
+
filterModalBody: "",
|
|
460
|
+
// filter modal header
|
|
461
|
+
filterModalHeader: "text-default-700 flex items-center gap-3",
|
|
462
|
+
// filter modal footer
|
|
463
|
+
filterModalFooter: "justify-between",
|
|
464
|
+
// form element
|
|
465
|
+
form: "mb-3 flex flex-wrap gap-3",
|
|
466
|
+
// search input field
|
|
467
|
+
searchInput: "",
|
|
468
|
+
// search input wrapper (inner control)
|
|
469
|
+
searchInputWrapper: "",
|
|
470
|
+
// search motion container
|
|
471
|
+
searchMotionDiv: "flex w-72 gap-2",
|
|
472
|
+
// search show button
|
|
473
|
+
searchShowButton: "",
|
|
474
|
+
// search submit button
|
|
475
|
+
searchSubmitButton: "",
|
|
476
|
+
// search wrapper
|
|
477
|
+
searchWrapper: "flex items-center"
|
|
478
|
+
}
|
|
479
|
+
});
|
|
438
480
|
var Filter = ({
|
|
439
481
|
children = void 0,
|
|
440
482
|
className = void 0,
|
|
@@ -451,22 +493,54 @@ var Filter = ({
|
|
|
451
493
|
Boolean(config3.search)
|
|
452
494
|
);
|
|
453
495
|
const { data: valuesValidated } = validation.validate(values);
|
|
454
|
-
|
|
496
|
+
const variants = filterVariants();
|
|
497
|
+
const classNames = variantsToClassNames(variants, className, "base");
|
|
498
|
+
return /* @__PURE__ */ jsxs5("div", { className: classNames.base, children: [
|
|
455
499
|
/* @__PURE__ */ jsxs5(
|
|
456
500
|
Form,
|
|
457
501
|
{
|
|
458
|
-
className:
|
|
502
|
+
className: classNames.form,
|
|
459
503
|
debug: { disable: true },
|
|
460
504
|
initialValues: valuesValidated != null ? valuesValidated : {},
|
|
461
505
|
name: formName,
|
|
462
506
|
onSubmit: handleSubmit,
|
|
463
507
|
validation,
|
|
464
508
|
children: [
|
|
465
|
-
config3.search ? /* @__PURE__ */ jsx6(
|
|
509
|
+
config3.search ? /* @__PURE__ */ jsx6(
|
|
510
|
+
SearchInput_default,
|
|
511
|
+
{
|
|
512
|
+
config: config3.search,
|
|
513
|
+
classNames: {
|
|
514
|
+
searchInput: classNames.searchInput,
|
|
515
|
+
searchInputWrapper: classNames.searchInputWrapper,
|
|
516
|
+
searchMotionDiv: classNames.searchMotionDiv,
|
|
517
|
+
searchShowButton: classNames.searchShowButton,
|
|
518
|
+
searchSubmitButton: classNames.searchSubmitButton,
|
|
519
|
+
searchWrapper: classNames.searchWrapper
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
) : null,
|
|
466
523
|
/* @__PURE__ */ jsxs5(FiltersContextProvider, { config: config3.filters, children: [
|
|
467
|
-
/* @__PURE__ */ jsx6(ActiveFilters_default, {}),
|
|
468
|
-
/* @__PURE__ */ jsx6(
|
|
469
|
-
|
|
524
|
+
/* @__PURE__ */ jsx6(ActiveFilters_default, { className: classNames.activeFilterLabel }),
|
|
525
|
+
/* @__PURE__ */ jsx6(
|
|
526
|
+
AddFilterMenu_default,
|
|
527
|
+
{
|
|
528
|
+
classNames: {
|
|
529
|
+
addFilterMenuButton: classNames.addFilterMenuButton,
|
|
530
|
+
addFilterMenuItem: classNames.addFilterMenuItem
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
),
|
|
534
|
+
/* @__PURE__ */ jsx6(
|
|
535
|
+
FilterModal_default,
|
|
536
|
+
{
|
|
537
|
+
classNames: {
|
|
538
|
+
body: classNames.filterModalBody,
|
|
539
|
+
footer: classNames.filterModalFooter,
|
|
540
|
+
header: classNames.filterModalHeader
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
)
|
|
470
544
|
] })
|
|
471
545
|
]
|
|
472
546
|
}
|
|
@@ -492,19 +566,19 @@ var createFilter = (definition) => {
|
|
|
492
566
|
var createFilter_default = createFilter;
|
|
493
567
|
|
|
494
568
|
// src/Filter/filters/boolean/Display.tsx
|
|
495
|
-
import { Fragment as
|
|
569
|
+
import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
496
570
|
var Display = ({
|
|
497
571
|
value,
|
|
498
572
|
config: { text, textPrefix, textNoWord }
|
|
499
573
|
}) => {
|
|
500
574
|
if (typeof value === "boolean") {
|
|
501
|
-
return /* @__PURE__ */ jsxs6(
|
|
575
|
+
return /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
502
576
|
value ? textPrefix : `${textPrefix} ${textNoWord != null ? textNoWord : "no"}`,
|
|
503
577
|
" ",
|
|
504
578
|
text
|
|
505
579
|
] });
|
|
506
580
|
}
|
|
507
|
-
return /* @__PURE__ */ jsx7(
|
|
581
|
+
return /* @__PURE__ */ jsx7(Fragment3, { children: `${text}...` });
|
|
508
582
|
};
|
|
509
583
|
var Display_default = Display;
|
|
510
584
|
|
|
@@ -522,11 +596,20 @@ var Form_default = Form2;
|
|
|
522
596
|
// src/Filter/filters/boolean/schema.ts
|
|
523
597
|
import { boolean, object as object2, string as string2 } from "@fuf-stack/veto";
|
|
524
598
|
var config = object2({
|
|
525
|
-
/**
|
|
599
|
+
/**
|
|
600
|
+
* Human‑readable label used in the UI (e.g. in the chip and modal header).
|
|
601
|
+
* Examples: "Magical", "Haunted"
|
|
602
|
+
*/
|
|
526
603
|
text: string2(),
|
|
527
|
-
/**
|
|
604
|
+
/**
|
|
605
|
+
* Optional word shown before the label when building sentence‑like chips.
|
|
606
|
+
* Examples: "is" → "is Magical"
|
|
607
|
+
*/
|
|
528
608
|
textPrefix: string2().optional(),
|
|
529
|
-
/**
|
|
609
|
+
/**
|
|
610
|
+
* Optional negation word used when a boolean value is false.
|
|
611
|
+
* Examples: "not" → "is not Magical"
|
|
612
|
+
*/
|
|
530
613
|
textNoWord: string2().optional()
|
|
531
614
|
});
|
|
532
615
|
var validate = (_config) => {
|
|
@@ -554,7 +637,7 @@ var Display2 = ({
|
|
|
554
637
|
return (_b = (_a = options.find((op) => {
|
|
555
638
|
return op.value === val;
|
|
556
639
|
})) == null ? void 0 : _a.label) != null ? _b : val;
|
|
557
|
-
}).join("
|
|
640
|
+
}).join(" ");
|
|
558
641
|
return `${text} is ${labels}`;
|
|
559
642
|
}
|
|
560
643
|
return `${text} is ...`;
|
|
@@ -572,9 +655,15 @@ var Form_default2 = Form3;
|
|
|
572
655
|
// src/Filter/filters/checkboxgroup/schema.ts
|
|
573
656
|
import { array, object as object3, refineArray, string as string3 } from "@fuf-stack/veto";
|
|
574
657
|
var config2 = object3({
|
|
575
|
-
/**
|
|
658
|
+
/**
|
|
659
|
+
* Human‑readable label used in the UI (e.g. label and modal header).
|
|
660
|
+
* Example: "Snacks", "Mood"
|
|
661
|
+
*/
|
|
576
662
|
text: string3(),
|
|
577
|
-
/**
|
|
663
|
+
/**
|
|
664
|
+
* Options rendered as multiple checkboxes. Each option needs a `label`
|
|
665
|
+
* (what the user sees) and a `value` (what is written into the form state).
|
|
666
|
+
*/
|
|
578
667
|
options: array(object3({ label: string3(), value: string3() }))
|
|
579
668
|
});
|
|
580
669
|
var validate2 = (cfg) => {
|
|
@@ -617,4 +706,4 @@ export {
|
|
|
617
706
|
filters,
|
|
618
707
|
Filter_default2 as Filter_default
|
|
619
708
|
};
|
|
620
|
-
//# sourceMappingURL=chunk-
|
|
709
|
+
//# sourceMappingURL=chunk-3ZL7ZLSU.js.map
|