@easyvision/easyvision-ui 1.7.6 → 1.8.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/index.d.cts CHANGED
@@ -239,6 +239,64 @@ declare const EasyVisionCardDescription: React.ForwardRefExoticComponent<React.H
239
239
  declare const EasyVisionCardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
240
240
  declare const EasyVisionCardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
241
241
 
242
+ /** A single unfoldable question/answer entry for the data-driven API. */
243
+ interface AccordionItem {
244
+ /** Stable key, also used to track open state. */
245
+ id: string;
246
+ /** Header content — a string or any node (e.g. icon + label). */
247
+ question: ReactNode;
248
+ /** Free-format body revealed when the item is expanded. */
249
+ content: ReactNode;
250
+ /** Start expanded (uncontrolled mode only). */
251
+ defaultOpen?: boolean;
252
+ /** Render the trigger as non-interactive. */
253
+ disabled?: boolean;
254
+ }
255
+ /** 'single' = one item open at a time; 'multiple' = items open independently. */
256
+ type AccordionMode = 'single' | 'multiple';
257
+ interface EasyVisionAccordionProps {
258
+ /** Data-driven items. Omit when composing <EasyVisionAccordionItem> children instead. */
259
+ items?: AccordionItem[];
260
+ /** Compound children (alternative to `items`). */
261
+ children?: ReactNode;
262
+ /** Open behaviour. Default: 'single'. */
263
+ mode?: AccordionMode;
264
+ /** Controlled set of open ids. When provided the component is fully controlled. */
265
+ openIds?: string[];
266
+ /** Uncontrolled initial open ids (ignored when `openIds` is set). */
267
+ defaultOpenIds?: string[];
268
+ /** Fired whenever the open set changes, with the next list of open ids. */
269
+ onOpenChange?: (openIds: string[]) => void;
270
+ className?: string;
271
+ }
272
+ interface EasyVisionAccordionItemProps {
273
+ /** Stable key, also used to track open state. */
274
+ id: string;
275
+ /** Header content — a string or any node. */
276
+ question: ReactNode;
277
+ /** Free-format body revealed when expanded. */
278
+ children: ReactNode;
279
+ /** Start expanded (uncontrolled mode only). */
280
+ defaultOpen?: boolean;
281
+ /** Render the trigger as non-interactive. */
282
+ disabled?: boolean;
283
+ className?: string;
284
+ }
285
+
286
+ /**
287
+ * Marker component for the compound API. It renders nothing on its own — the
288
+ * parent <EasyVisionAccordion> reads its props and draws the row. Rendering it
289
+ * outside an accordion is a no-op.
290
+ */
291
+ declare function EasyVisionAccordionItem(_props: EasyVisionAccordionItemProps): React.ReactElement | null;
292
+ declare namespace EasyVisionAccordionItem {
293
+ var displayName: string;
294
+ }
295
+ declare function EasyVisionAccordion({ items, children, mode, openIds, defaultOpenIds, onOpenChange, className, }: EasyVisionAccordionProps): React.ReactElement;
296
+ declare namespace EasyVisionAccordion {
297
+ var displayName: string;
298
+ }
299
+
242
300
  /**
243
301
  * LoopBack adapter for `EasyVisionTable`.
244
302
  *
@@ -690,4 +748,4 @@ declare const getSlice: <K extends SliceKind>(fullId: string) => SliceFor<K> | u
690
748
  */
691
749
  declare const defaultCell: (content: ReactNode, title?: string) => ReactNode;
692
750
 
693
- export { type ApiFetchParams, type ApiFetchResult, type BaseStatefulProps, type CreateLoopbackTableFetcherOptions, type CustomFieldDef, type DateRangeFieldDef, type DateRangeValue, EasyVisionCard, EasyVisionCardContent, EasyVisionCardDescription, EasyVisionCardFooter, EasyVisionCardHeader, EasyVisionCardTitle, type EasyVisionColumn, EasyVisionInput, type EasyVisionInputProps, EasyVisionMultifilter, type EasyVisionMultifilterProps, EasyVisionSelector, type EasyVisionSelectorProps, EasyVisionTable, type EasyVisionTableProps, type FieldDef, type LoopbackCountResponse, type LoopbackFilter, type LoopbackWhereValue, type MultiSelectFieldDef, type MultifilterConfig, type MultifilterFieldDef, type MultifilterHandle, type MultifilterLabels, type MultifilterQuery, type MultifilterSnapshot, type NumberRangeFieldDef, type NumberRangeValue, type SelectionChange, type SelectorFieldDef, type SelectorOption, type TableLabels, type TableMode, type TextFieldDef, createLoopbackTableFetcher, defaultCell, easyVisionRegistry, getSlice, matchLoopbackWhere };
751
+ export { type AccordionItem, type AccordionMode, type ApiFetchParams, type ApiFetchResult, type BaseStatefulProps, type CreateLoopbackTableFetcherOptions, type CustomFieldDef, type DateRangeFieldDef, type DateRangeValue, EasyVisionAccordion, EasyVisionAccordionItem, type EasyVisionAccordionItemProps, type EasyVisionAccordionProps, EasyVisionCard, EasyVisionCardContent, EasyVisionCardDescription, EasyVisionCardFooter, EasyVisionCardHeader, EasyVisionCardTitle, type EasyVisionColumn, EasyVisionInput, type EasyVisionInputProps, EasyVisionMultifilter, type EasyVisionMultifilterProps, EasyVisionSelector, type EasyVisionSelectorProps, EasyVisionTable, type EasyVisionTableProps, type FieldDef, type LoopbackCountResponse, type LoopbackFilter, type LoopbackWhereValue, type MultiSelectFieldDef, type MultifilterConfig, type MultifilterFieldDef, type MultifilterHandle, type MultifilterLabels, type MultifilterQuery, type MultifilterSnapshot, type NumberRangeFieldDef, type NumberRangeValue, type SelectionChange, type SelectorFieldDef, type SelectorOption, type TableLabels, type TableMode, type TextFieldDef, createLoopbackTableFetcher, defaultCell, easyVisionRegistry, getSlice, matchLoopbackWhere };
package/dist/index.d.ts CHANGED
@@ -239,6 +239,64 @@ declare const EasyVisionCardDescription: React.ForwardRefExoticComponent<React.H
239
239
  declare const EasyVisionCardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
240
240
  declare const EasyVisionCardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
241
241
 
242
+ /** A single unfoldable question/answer entry for the data-driven API. */
243
+ interface AccordionItem {
244
+ /** Stable key, also used to track open state. */
245
+ id: string;
246
+ /** Header content — a string or any node (e.g. icon + label). */
247
+ question: ReactNode;
248
+ /** Free-format body revealed when the item is expanded. */
249
+ content: ReactNode;
250
+ /** Start expanded (uncontrolled mode only). */
251
+ defaultOpen?: boolean;
252
+ /** Render the trigger as non-interactive. */
253
+ disabled?: boolean;
254
+ }
255
+ /** 'single' = one item open at a time; 'multiple' = items open independently. */
256
+ type AccordionMode = 'single' | 'multiple';
257
+ interface EasyVisionAccordionProps {
258
+ /** Data-driven items. Omit when composing <EasyVisionAccordionItem> children instead. */
259
+ items?: AccordionItem[];
260
+ /** Compound children (alternative to `items`). */
261
+ children?: ReactNode;
262
+ /** Open behaviour. Default: 'single'. */
263
+ mode?: AccordionMode;
264
+ /** Controlled set of open ids. When provided the component is fully controlled. */
265
+ openIds?: string[];
266
+ /** Uncontrolled initial open ids (ignored when `openIds` is set). */
267
+ defaultOpenIds?: string[];
268
+ /** Fired whenever the open set changes, with the next list of open ids. */
269
+ onOpenChange?: (openIds: string[]) => void;
270
+ className?: string;
271
+ }
272
+ interface EasyVisionAccordionItemProps {
273
+ /** Stable key, also used to track open state. */
274
+ id: string;
275
+ /** Header content — a string or any node. */
276
+ question: ReactNode;
277
+ /** Free-format body revealed when expanded. */
278
+ children: ReactNode;
279
+ /** Start expanded (uncontrolled mode only). */
280
+ defaultOpen?: boolean;
281
+ /** Render the trigger as non-interactive. */
282
+ disabled?: boolean;
283
+ className?: string;
284
+ }
285
+
286
+ /**
287
+ * Marker component for the compound API. It renders nothing on its own — the
288
+ * parent <EasyVisionAccordion> reads its props and draws the row. Rendering it
289
+ * outside an accordion is a no-op.
290
+ */
291
+ declare function EasyVisionAccordionItem(_props: EasyVisionAccordionItemProps): React.ReactElement | null;
292
+ declare namespace EasyVisionAccordionItem {
293
+ var displayName: string;
294
+ }
295
+ declare function EasyVisionAccordion({ items, children, mode, openIds, defaultOpenIds, onOpenChange, className, }: EasyVisionAccordionProps): React.ReactElement;
296
+ declare namespace EasyVisionAccordion {
297
+ var displayName: string;
298
+ }
299
+
242
300
  /**
243
301
  * LoopBack adapter for `EasyVisionTable`.
244
302
  *
@@ -690,4 +748,4 @@ declare const getSlice: <K extends SliceKind>(fullId: string) => SliceFor<K> | u
690
748
  */
691
749
  declare const defaultCell: (content: ReactNode, title?: string) => ReactNode;
692
750
 
693
- export { type ApiFetchParams, type ApiFetchResult, type BaseStatefulProps, type CreateLoopbackTableFetcherOptions, type CustomFieldDef, type DateRangeFieldDef, type DateRangeValue, EasyVisionCard, EasyVisionCardContent, EasyVisionCardDescription, EasyVisionCardFooter, EasyVisionCardHeader, EasyVisionCardTitle, type EasyVisionColumn, EasyVisionInput, type EasyVisionInputProps, EasyVisionMultifilter, type EasyVisionMultifilterProps, EasyVisionSelector, type EasyVisionSelectorProps, EasyVisionTable, type EasyVisionTableProps, type FieldDef, type LoopbackCountResponse, type LoopbackFilter, type LoopbackWhereValue, type MultiSelectFieldDef, type MultifilterConfig, type MultifilterFieldDef, type MultifilterHandle, type MultifilterLabels, type MultifilterQuery, type MultifilterSnapshot, type NumberRangeFieldDef, type NumberRangeValue, type SelectionChange, type SelectorFieldDef, type SelectorOption, type TableLabels, type TableMode, type TextFieldDef, createLoopbackTableFetcher, defaultCell, easyVisionRegistry, getSlice, matchLoopbackWhere };
751
+ export { type AccordionItem, type AccordionMode, type ApiFetchParams, type ApiFetchResult, type BaseStatefulProps, type CreateLoopbackTableFetcherOptions, type CustomFieldDef, type DateRangeFieldDef, type DateRangeValue, EasyVisionAccordion, EasyVisionAccordionItem, type EasyVisionAccordionItemProps, type EasyVisionAccordionProps, EasyVisionCard, EasyVisionCardContent, EasyVisionCardDescription, EasyVisionCardFooter, EasyVisionCardHeader, EasyVisionCardTitle, type EasyVisionColumn, EasyVisionInput, type EasyVisionInputProps, EasyVisionMultifilter, type EasyVisionMultifilterProps, EasyVisionSelector, type EasyVisionSelectorProps, EasyVisionTable, type EasyVisionTableProps, type FieldDef, type LoopbackCountResponse, type LoopbackFilter, type LoopbackWhereValue, type MultiSelectFieldDef, type MultifilterConfig, type MultifilterFieldDef, type MultifilterHandle, type MultifilterLabels, type MultifilterQuery, type MultifilterSnapshot, type NumberRangeFieldDef, type NumberRangeValue, type SelectionChange, type SelectorFieldDef, type SelectorOption, type TableLabels, type TableMode, type TextFieldDef, createLoopbackTableFetcher, defaultCell, easyVisionRegistry, getSlice, matchLoopbackWhere };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import './easyvision.css';
2
2
  import './EasyVisionTable.css';
3
- import * as React8 from 'react';
3
+ import * as React9 from 'react';
4
4
  import { createContext, forwardRef, useMemo, useSyncExternalStore, useRef, useEffect, useCallback, useImperativeHandle, useContext, useState, createElement } from 'react';
5
5
  import { ChevronDown, ChevronUp, Check, Search, X, Plus, ChevronRight, Circle, Calendar as Calendar$1, ChevronLeft, ChevronsUpDown, Loader2, ArrowUp, ArrowDown, ArrowUpDown, Settings2 } from 'lucide-react';
6
6
  import { clsx } from 'clsx';
@@ -24,7 +24,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
24
24
  function cn(...inputs) {
25
25
  return twMerge(clsx(inputs));
26
26
  }
27
- var Input = React8.forwardRef(
27
+ var Input = React9.forwardRef(
28
28
  ({ className, type, ...props }, ref) => {
29
29
  return /* @__PURE__ */ jsx(
30
30
  "input",
@@ -232,7 +232,7 @@ function EasyVisionInput({
232
232
  }
233
233
  var Select = SelectPrimitive.Root;
234
234
  var SelectValue = SelectPrimitive.Value;
235
- var SelectTrigger = React8.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
235
+ var SelectTrigger = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
236
236
  SelectPrimitive.Trigger,
237
237
  {
238
238
  ref,
@@ -245,7 +245,7 @@ var SelectTrigger = React8.forwardRef(({ className, children, ...props }, ref) =
245
245
  }
246
246
  ));
247
247
  SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
248
- var SelectScrollUpButton = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
248
+ var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
249
249
  SelectPrimitive.ScrollUpButton,
250
250
  {
251
251
  ref,
@@ -255,7 +255,7 @@ var SelectScrollUpButton = React8.forwardRef(({ className, ...props }, ref) => /
255
255
  }
256
256
  ));
257
257
  SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
258
- var SelectScrollDownButton = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
258
+ var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
259
259
  SelectPrimitive.ScrollDownButton,
260
260
  {
261
261
  ref,
@@ -265,7 +265,7 @@ var SelectScrollDownButton = React8.forwardRef(({ className, ...props }, ref) =>
265
265
  }
266
266
  ));
267
267
  SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
268
- var SelectContent = React8.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
268
+ var SelectContent = React9.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
269
269
  SelectPrimitive.Content,
270
270
  {
271
271
  ref,
@@ -289,7 +289,7 @@ var SelectContent = React8.forwardRef(({ className, children, position = "popper
289
289
  }
290
290
  ) }));
291
291
  SelectContent.displayName = SelectPrimitive.Content.displayName;
292
- var SelectLabel = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
292
+ var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
293
293
  SelectPrimitive.Label,
294
294
  {
295
295
  ref,
@@ -298,7 +298,7 @@ var SelectLabel = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE
298
298
  }
299
299
  ));
300
300
  SelectLabel.displayName = SelectPrimitive.Label.displayName;
301
- var SelectItem = React8.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
301
+ var SelectItem = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
302
302
  SelectPrimitive.Item,
303
303
  {
304
304
  ref,
@@ -311,7 +311,7 @@ var SelectItem = React8.forwardRef(({ className, children, ...props }, ref) => /
311
311
  }
312
312
  ));
313
313
  SelectItem.displayName = SelectPrimitive.Item.displayName;
314
- var SelectSeparator = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
314
+ var SelectSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
315
315
  SelectPrimitive.Separator,
316
316
  {
317
317
  ref,
@@ -342,7 +342,7 @@ var buttonVariants = cva("ev-btn", {
342
342
  size: "default"
343
343
  }
344
344
  });
345
- var Button = React8.forwardRef(
345
+ var Button = React9.forwardRef(
346
346
  ({ className, variant, size, asChild = false, ...props }, ref) => {
347
347
  const Comp = asChild ? Slot : "button";
348
348
  return /* @__PURE__ */ jsx(
@@ -358,7 +358,7 @@ var Button = React8.forwardRef(
358
358
  Button.displayName = "Button";
359
359
  var Popover = PopoverPrimitive.Root;
360
360
  var PopoverTrigger = PopoverPrimitive.Trigger;
361
- var PopoverContent = React8.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
361
+ var PopoverContent = React9.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
362
362
  PopoverPrimitive.Content,
363
363
  {
364
364
  ref,
@@ -369,7 +369,7 @@ var PopoverContent = React8.forwardRef(({ className, align = "center", sideOffse
369
369
  }
370
370
  ) }));
371
371
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
372
- var Command = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
372
+ var Command = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
373
373
  Command$1,
374
374
  {
375
375
  ref,
@@ -378,7 +378,7 @@ var Command = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
378
378
  }
379
379
  ));
380
380
  Command.displayName = Command$1.displayName;
381
- var CommandInput = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "ev-cmd-input-wrapper", "cmdk-input-wrapper": "", children: [
381
+ var CommandInput = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "ev-cmd-input-wrapper", "cmdk-input-wrapper": "", children: [
382
382
  /* @__PURE__ */ jsx(MagnifyingGlassIcon, { className: "ev-cmd-input-icon" }),
383
383
  /* @__PURE__ */ jsx(
384
384
  Command$1.Input,
@@ -390,7 +390,7 @@ var CommandInput = React8.forwardRef(({ className, ...props }, ref) => /* @__PUR
390
390
  )
391
391
  ] }));
392
392
  CommandInput.displayName = Command$1.Input.displayName;
393
- var CommandList = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
393
+ var CommandList = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
394
394
  Command$1.List,
395
395
  {
396
396
  ref,
@@ -399,7 +399,7 @@ var CommandList = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE
399
399
  }
400
400
  ));
401
401
  CommandList.displayName = Command$1.List.displayName;
402
- var CommandEmpty = React8.forwardRef((props, ref) => /* @__PURE__ */ jsx(
402
+ var CommandEmpty = React9.forwardRef((props, ref) => /* @__PURE__ */ jsx(
403
403
  Command$1.Empty,
404
404
  {
405
405
  ref,
@@ -408,7 +408,7 @@ var CommandEmpty = React8.forwardRef((props, ref) => /* @__PURE__ */ jsx(
408
408
  }
409
409
  ));
410
410
  CommandEmpty.displayName = Command$1.Empty.displayName;
411
- var CommandGroup = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
411
+ var CommandGroup = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
412
412
  Command$1.Group,
413
413
  {
414
414
  ref,
@@ -417,7 +417,7 @@ var CommandGroup = React8.forwardRef(({ className, ...props }, ref) => /* @__PUR
417
417
  }
418
418
  ));
419
419
  CommandGroup.displayName = Command$1.Group.displayName;
420
- var CommandSeparator = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
420
+ var CommandSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
421
421
  Command$1.Separator,
422
422
  {
423
423
  ref,
@@ -426,7 +426,7 @@ var CommandSeparator = React8.forwardRef(({ className, ...props }, ref) => /* @_
426
426
  }
427
427
  ));
428
428
  CommandSeparator.displayName = Command$1.Separator.displayName;
429
- var CommandItem = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
429
+ var CommandItem = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
430
430
  Command$1.Item,
431
431
  {
432
432
  ref,
@@ -649,7 +649,7 @@ function SelectorWidget({ definition, value, onChange, onRemove }) {
649
649
  )
650
650
  ] });
651
651
  }
652
- var Checkbox = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
652
+ var Checkbox = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
653
653
  CheckboxPrimitive.Root,
654
654
  {
655
655
  ref,
@@ -1603,33 +1603,143 @@ function buildChildQueryDirect(field, values) {
1603
1603
  return Object.keys(where).length > 0 ? { where } : {};
1604
1604
  }
1605
1605
  var join = (...parts) => parts.filter(Boolean).join(" ");
1606
- var EasyVisionCard = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: join("ev-card", className), ...props }));
1606
+ var EasyVisionCard = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: join("ev-card", className), ...props }));
1607
1607
  EasyVisionCard.displayName = "EasyVisionCard";
1608
- var EasyVisionCardHeader = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: join("ev-card-header", className), ...props }));
1608
+ var EasyVisionCardHeader = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: join("ev-card-header", className), ...props }));
1609
1609
  EasyVisionCardHeader.displayName = "EasyVisionCardHeader";
1610
- var EasyVisionCardTitle = React8.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("h3", { ref, className: join("ev-card-title", className), ...props, children }));
1610
+ var EasyVisionCardTitle = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("h3", { ref, className: join("ev-card-title", className), ...props, children }));
1611
1611
  EasyVisionCardTitle.displayName = "EasyVisionCardTitle";
1612
- var EasyVisionCardDescription = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: join("ev-card-description", className), ...props }));
1612
+ var EasyVisionCardDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: join("ev-card-description", className), ...props }));
1613
1613
  EasyVisionCardDescription.displayName = "EasyVisionCardDescription";
1614
- var EasyVisionCardContent = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: join("ev-card-content", className), ...props }));
1614
+ var EasyVisionCardContent = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: join("ev-card-content", className), ...props }));
1615
1615
  EasyVisionCardContent.displayName = "EasyVisionCardContent";
1616
- var EasyVisionCardFooter = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: join("ev-card-footer", className), ...props }));
1616
+ var EasyVisionCardFooter = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: join("ev-card-footer", className), ...props }));
1617
1617
  EasyVisionCardFooter.displayName = "EasyVisionCardFooter";
1618
- var Table = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("table", { ref, className: cn("ev-table", className), ...props }));
1618
+ var join2 = (...parts) => parts.filter(Boolean).join(" ");
1619
+ function EasyVisionAccordionItem(_props) {
1620
+ return null;
1621
+ }
1622
+ EasyVisionAccordionItem.displayName = "EasyVisionAccordionItem";
1623
+ function normalizeFromChildren(children) {
1624
+ const out = [];
1625
+ React9.Children.forEach(children, (child) => {
1626
+ if (!React9.isValidElement(child)) return;
1627
+ if (child.type !== EasyVisionAccordionItem) return;
1628
+ const p = child.props;
1629
+ out.push({
1630
+ id: p.id,
1631
+ question: p.question,
1632
+ content: p.children,
1633
+ defaultOpen: p.defaultOpen,
1634
+ disabled: p.disabled,
1635
+ className: p.className
1636
+ });
1637
+ });
1638
+ return out;
1639
+ }
1640
+ function normalizeFromItems(items) {
1641
+ return items.map((it) => ({
1642
+ id: it.id,
1643
+ question: it.question,
1644
+ content: it.content,
1645
+ defaultOpen: it.defaultOpen,
1646
+ disabled: it.disabled
1647
+ }));
1648
+ }
1649
+ function AccordionRow({ item, open, onToggle }) {
1650
+ const panelId = `ev-accordion-panel-${item.id}`;
1651
+ const triggerId = `ev-accordion-trigger-${item.id}`;
1652
+ return /* @__PURE__ */ jsxs("div", { className: join2("ev-accordion-item", item.className), children: [
1653
+ /* @__PURE__ */ jsxs(
1654
+ "button",
1655
+ {
1656
+ type: "button",
1657
+ id: triggerId,
1658
+ className: join2("ev-accordion-trigger", open && "ev-accordion-trigger-open"),
1659
+ "aria-expanded": open,
1660
+ "aria-controls": panelId,
1661
+ disabled: item.disabled,
1662
+ onClick: () => onToggle(item.id),
1663
+ children: [
1664
+ /* @__PURE__ */ jsx("span", { className: "ev-accordion-question", children: item.question }),
1665
+ /* @__PURE__ */ jsx(ChevronDown, { className: "ev-accordion-icon", "aria-hidden": "true" })
1666
+ ]
1667
+ }
1668
+ ),
1669
+ open && /* @__PURE__ */ jsx(
1670
+ "div",
1671
+ {
1672
+ id: panelId,
1673
+ role: "region",
1674
+ "aria-labelledby": triggerId,
1675
+ className: "ev-accordion-panel",
1676
+ children: item.content
1677
+ }
1678
+ )
1679
+ ] });
1680
+ }
1681
+ function EasyVisionAccordion({
1682
+ items,
1683
+ children,
1684
+ mode = "single",
1685
+ openIds,
1686
+ defaultOpenIds,
1687
+ onOpenChange,
1688
+ className
1689
+ }) {
1690
+ const normalized = React9.useMemo(
1691
+ () => items ? normalizeFromItems(items) : normalizeFromChildren(children),
1692
+ [items, children]
1693
+ );
1694
+ const isControlled = openIds !== void 0;
1695
+ const [internalOpen, setInternalOpen] = React9.useState(() => {
1696
+ if (defaultOpenIds) return new Set(defaultOpenIds);
1697
+ return new Set(normalized.filter((it) => it.defaultOpen).map((it) => it.id));
1698
+ });
1699
+ const openSet = React9.useMemo(
1700
+ () => isControlled ? new Set(openIds) : internalOpen,
1701
+ [isControlled, openIds, internalOpen]
1702
+ );
1703
+ const handleToggle = React9.useCallback(
1704
+ (id) => {
1705
+ const next = new Set(openSet);
1706
+ if (next.has(id)) {
1707
+ next.delete(id);
1708
+ } else {
1709
+ if (mode === "single") next.clear();
1710
+ next.add(id);
1711
+ }
1712
+ if (!isControlled) setInternalOpen(next);
1713
+ onOpenChange?.(Array.from(next));
1714
+ },
1715
+ [openSet, mode, isControlled, onOpenChange]
1716
+ );
1717
+ return /* @__PURE__ */ jsx("div", { className: join2("ev-accordion", className), children: normalized.map((item) => /* @__PURE__ */ jsx(
1718
+ AccordionRow,
1719
+ {
1720
+ item,
1721
+ open: openSet.has(item.id),
1722
+ onToggle: handleToggle
1723
+ },
1724
+ item.id
1725
+ )) });
1726
+ }
1727
+ EasyVisionAccordion.displayName = "EasyVisionAccordion";
1728
+ var Table = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("table", { ref, className: cn("ev-table", className), ...props }));
1619
1729
  Table.displayName = "Table";
1620
- var TableHeader = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className, ...props }));
1730
+ var TableHeader = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className, ...props }));
1621
1731
  TableHeader.displayName = "TableHeader";
1622
- var TableBody = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className, ...props }));
1732
+ var TableBody = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className, ...props }));
1623
1733
  TableBody.displayName = "TableBody";
1624
- var TableFooter = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tfoot", { ref, className, ...props }));
1734
+ var TableFooter = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tfoot", { ref, className, ...props }));
1625
1735
  TableFooter.displayName = "TableFooter";
1626
- var TableRow = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tr", { ref, className, ...props }));
1736
+ var TableRow = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tr", { ref, className, ...props }));
1627
1737
  TableRow.displayName = "TableRow";
1628
- var TableHead = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("th", { ref, className, ...props }));
1738
+ var TableHead = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("th", { ref, className, ...props }));
1629
1739
  TableHead.displayName = "TableHead";
1630
- var TableCell = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("td", { ref, className, ...props }));
1740
+ var TableCell = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("td", { ref, className, ...props }));
1631
1741
  TableCell.displayName = "TableCell";
1632
- var TableCaption = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", { ref, className, ...props }));
1742
+ var TableCaption = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", { ref, className, ...props }));
1633
1743
  TableCaption.displayName = "TableCaption";
1634
1744
  var isNestedField = (field) => field.includes(".");
1635
1745
  var resolvePath = (obj, path) => path.split(".").reduce(
@@ -1759,7 +1869,7 @@ function useTableData({
1759
1869
  var DropdownMenu = DropdownMenuPrimitive.Root;
1760
1870
  var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
1761
1871
  var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
1762
- var DropdownMenuSubTrigger = React8.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
1872
+ var DropdownMenuSubTrigger = React9.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
1763
1873
  DropdownMenuPrimitive.SubTrigger,
1764
1874
  {
1765
1875
  ref,
@@ -1776,7 +1886,7 @@ var DropdownMenuSubTrigger = React8.forwardRef(({ className, inset, children, ..
1776
1886
  }
1777
1887
  ));
1778
1888
  DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
1779
- var DropdownMenuSubContent = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1889
+ var DropdownMenuSubContent = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1780
1890
  DropdownMenuPrimitive.SubContent,
1781
1891
  {
1782
1892
  ref,
@@ -1785,7 +1895,7 @@ var DropdownMenuSubContent = React8.forwardRef(({ className, ...props }, ref) =>
1785
1895
  }
1786
1896
  ));
1787
1897
  DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
1788
- var DropdownMenuContent = React8.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
1898
+ var DropdownMenuContent = React9.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
1789
1899
  DropdownMenuPrimitive.Content,
1790
1900
  {
1791
1901
  ref,
@@ -1795,7 +1905,7 @@ var DropdownMenuContent = React8.forwardRef(({ className, sideOffset = 4, ...pro
1795
1905
  }
1796
1906
  ) }));
1797
1907
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
1798
- var DropdownMenuItem = React8.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
1908
+ var DropdownMenuItem = React9.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
1799
1909
  DropdownMenuPrimitive.Item,
1800
1910
  {
1801
1911
  ref,
@@ -1808,7 +1918,7 @@ var DropdownMenuItem = React8.forwardRef(({ className, inset, ...props }, ref) =
1808
1918
  }
1809
1919
  ));
1810
1920
  DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
1811
- var DropdownMenuCheckboxItem = React8.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
1921
+ var DropdownMenuCheckboxItem = React9.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
1812
1922
  DropdownMenuPrimitive.CheckboxItem,
1813
1923
  {
1814
1924
  ref,
@@ -1822,7 +1932,7 @@ var DropdownMenuCheckboxItem = React8.forwardRef(({ className, children, checked
1822
1932
  }
1823
1933
  ));
1824
1934
  DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
1825
- var DropdownMenuRadioItem = React8.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
1935
+ var DropdownMenuRadioItem = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
1826
1936
  DropdownMenuPrimitive.RadioItem,
1827
1937
  {
1828
1938
  ref,
@@ -1835,7 +1945,7 @@ var DropdownMenuRadioItem = React8.forwardRef(({ className, children, ...props }
1835
1945
  }
1836
1946
  ));
1837
1947
  DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
1838
- var DropdownMenuLabel = React8.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
1948
+ var DropdownMenuLabel = React9.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
1839
1949
  DropdownMenuPrimitive.Label,
1840
1950
  {
1841
1951
  ref,
@@ -1848,7 +1958,7 @@ var DropdownMenuLabel = React8.forwardRef(({ className, inset, ...props }, ref)
1848
1958
  }
1849
1959
  ));
1850
1960
  DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
1851
- var DropdownMenuSeparator = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1961
+ var DropdownMenuSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1852
1962
  DropdownMenuPrimitive.Separator,
1853
1963
  {
1854
1964
  ref,
@@ -2862,6 +2972,6 @@ function EasyVisionTable(props) {
2862
2972
  }
2863
2973
  var defaultCell = (content, title) => /* @__PURE__ */ jsx("span", { className: "text-sm text-foreground", title, children: content });
2864
2974
 
2865
- export { EasyVisionCard, EasyVisionCardContent, EasyVisionCardDescription, EasyVisionCardFooter, EasyVisionCardHeader, EasyVisionCardTitle, EasyVisionInput, EasyVisionMultifilter, EasyVisionSelector, EasyVisionTable, createLoopbackTableFetcher, defaultCell, easyVisionRegistry, getSlice, matchLoopbackWhere };
2975
+ export { EasyVisionAccordion, EasyVisionAccordionItem, EasyVisionCard, EasyVisionCardContent, EasyVisionCardDescription, EasyVisionCardFooter, EasyVisionCardHeader, EasyVisionCardTitle, EasyVisionInput, EasyVisionMultifilter, EasyVisionSelector, EasyVisionTable, createLoopbackTableFetcher, defaultCell, easyVisionRegistry, getSlice, matchLoopbackWhere };
2866
2976
  //# sourceMappingURL=index.js.map
2867
2977
  //# sourceMappingURL=index.js.map