@nocoo/basalt 2.1.2 → 2.1.7

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 (68) hide show
  1. package/ai/INTEGRATION.md +17 -1
  2. package/ai/USAGE.md +1 -1
  3. package/ai/registry.json +75 -75
  4. package/dist/charts/charts.d.ts +1 -1
  5. package/dist/charts/charts.js +3 -16
  6. package/dist/charts/charts.js.map +1 -1
  7. package/dist/charts/custom-chart.d.ts +1 -1
  8. package/dist/charts/custom-chart.js +3 -16
  9. package/dist/charts/custom-chart.js.map +1 -1
  10. package/dist/charts/grouped-bar.d.ts +1 -1
  11. package/dist/charts/grouped-bar.js +11 -48
  12. package/dist/charts/grouped-bar.js.map +1 -1
  13. package/dist/charts/heatmap-calendar.js +80 -136
  14. package/dist/charts/heatmap-calendar.js.map +1 -1
  15. package/dist/charts/slot-bar.js +2 -12
  16. package/dist/charts/slot-bar.js.map +1 -1
  17. package/dist/charts/stat-card.js +2 -7
  18. package/dist/charts/stat-card.js.map +1 -1
  19. package/dist/charts/timeseries.d.ts +1 -1
  20. package/dist/charts/timeseries.js +3 -16
  21. package/dist/charts/timeseries.js.map +1 -1
  22. package/dist/charts/tooltip.js +13 -51
  23. package/dist/charts/tooltip.js.map +1 -1
  24. package/dist/components/autocomplete.d.ts +1 -1
  25. package/dist/components/autocomplete.js +3 -16
  26. package/dist/components/autocomplete.js.map +1 -1
  27. package/dist/components/banner.js +28 -28
  28. package/dist/components/banner.js.map +1 -1
  29. package/dist/components/button.js +6 -7
  30. package/dist/components/button.js.map +1 -1
  31. package/dist/components/chat-composer.js +1 -2
  32. package/dist/components/chat-composer.js.map +1 -1
  33. package/dist/components/checkbox.js +50 -82
  34. package/dist/components/checkbox.js.map +1 -1
  35. package/dist/components/code.js +1 -1
  36. package/dist/components/code.js.map +1 -1
  37. package/dist/components/combobox.d.ts +1 -1
  38. package/dist/components/combobox.js +3 -16
  39. package/dist/components/combobox.js.map +1 -1
  40. package/dist/components/context-menu.d.ts +1 -67
  41. package/dist/components/context-menu.js.map +1 -1
  42. package/dist/components/data-table.js +111 -123
  43. package/dist/components/data-table.js.map +1 -1
  44. package/dist/components/date-picker.js +236 -245
  45. package/dist/components/date-picker.js.map +1 -1
  46. package/dist/components/dock.js +15 -16
  47. package/dist/components/dock.js.map +1 -1
  48. package/dist/components/field.js +20 -23
  49. package/dist/components/field.js.map +1 -1
  50. package/dist/components/layer-card.d.ts +1 -1
  51. package/dist/components/layer-card.js +44 -51
  52. package/dist/components/layer-card.js.map +1 -1
  53. package/dist/components/skeleton-line.d.ts +2 -2
  54. package/dist/components/skeleton-line.js +1 -1
  55. package/dist/components/skeleton-line.js.map +1 -1
  56. package/dist/components/switch.js +46 -78
  57. package/dist/components/switch.js.map +1 -1
  58. package/dist/providers/accent.js +89 -198
  59. package/dist/providers/accent.js.map +1 -1
  60. package/dist/providers/theme.js +46 -144
  61. package/dist/providers/theme.js.map +1 -1
  62. package/dist/utils/preference-store.d.ts +16 -0
  63. package/dist/utils/preference-store.js +106 -0
  64. package/dist/utils/preference-store.js.map +1 -0
  65. package/dist/utils/use-checkable-group.d.ts +19 -0
  66. package/dist/utils/use-checkable-group.js +61 -0
  67. package/dist/utils/use-checkable-group.js.map +1 -0
  68. package/package.json +1 -2
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.js","names":[],"sources":["../../src/components/combobox.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from \"react\";\nimport type { InputSize } from \"./input\";\nimport { TypeaheadField, type TypeaheadItem } from \"./typeahead-field\";\n\nexport type ComboboxItem = TypeaheadItem;\n\nexport type ComboboxProps = Omit<\n\tComponentPropsWithoutRef<\"div\">,\n\t\"children\" | \"defaultValue\" | \"onChange\"\n> & {\n\t/**\n\t * Options shown in the list. Selection must match one of these values.\n\t */\n\titems: ComboboxItem[];\n\t/**\n\t * The controlled selected value.\n\t */\n\tvalue?: string;\n\t/**\n\t * The uncontrolled initial value.\n\t */\n\tdefaultValue?: string;\n\t/**\n\t * Called when the selected value changes.\n\t */\n\tonValueChange?: (value: string) => void;\n\t/**\n\t * Native form field name.\n\t */\n\tname?: string;\n\t/**\n\t * Placeholder shown when the field is empty.\n\t * @default Select…\n\t */\n\tplaceholder?: string;\n\t/**\n\t * Disable the field.\n\t * @default false\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Disable the field and mark it busy.\n\t * @default false\n\t */\n\tloading?: boolean;\n\t/**\n\t * The visual size of the field.\n\t * @default default\n\t */\n\tsize?: InputSize;\n};\n\nexport function Combobox({\n\titems,\n\tvalue,\n\tdefaultValue,\n\tonValueChange,\n\tname,\n\tplaceholder = \"Select…\",\n\tdisabled,\n\tloading,\n\tsize,\n\tclassName,\n\tid,\n\t\"aria-label\": ariaLabel,\n\t\"aria-describedby\": ariaDescribedBy,\n\t\"aria-invalid\": ariaInvalid,\n\t...rest\n}: ComboboxProps) {\n\treturn (\n\t\t<TypeaheadField\n\t\t\titems={items}\n\t\t\tvalue={value}\n\t\t\tdefaultValue={defaultValue}\n\t\t\tonValueChange={onValueChange}\n\t\t\tname={name}\n\t\t\tplaceholder={placeholder}\n\t\t\tdisabled={disabled}\n\t\t\tloading={loading}\n\t\t\tsize={size}\n\t\t\tclassName={className}\n\t\t\tid={id}\n\t\t\tallowFreeform={false}\n\t\t\taria-label={ariaLabel}\n\t\t\taria-describedby={ariaDescribedBy}\n\t\t\taria-invalid={ariaInvalid}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;AAoDA,SAAgB,EAAS,EACxB,UACA,UACA,iBACA,kBACA,SACA,iBAAc,WACd,aACA,YACA,SACA,cACA,OACA,cAAc,GACd,oBAAoB,GACpB,gBAAgB,GAChB,GAAG,KACc;CACjB,OACC,kBAAC,GAAD;EACQ;EACA;EACO;EACC;EACT;EACO;EACH;EACD;EACH;EACK;EACP;EACJ,eAAe;EACf,cAAY;EACZ,oBAAkB;EAClB,gBAAc;EACd,GAAI;CACJ,CAAA;AAEH"}
1
+ {"version":3,"file":"combobox.js","names":[],"sources":["../../src/components/combobox.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from \"react\";\nimport type { InputSize } from \"./input\";\nimport { TypeaheadField, type TypeaheadItem } from \"./typeahead-field\";\n\nexport type ComboboxItem = TypeaheadItem;\n\nexport type ComboboxProps = Omit<\n\tComponentPropsWithoutRef<\"div\">,\n\t\"children\" | \"defaultValue\" | \"onChange\"\n> & {\n\t/**\n\t * Options shown in the list. Selection must match one of these values.\n\t */\n\titems: ComboboxItem[];\n\t/**\n\t * The controlled selected value.\n\t */\n\tvalue?: string;\n\t/**\n\t * The uncontrolled initial value.\n\t */\n\tdefaultValue?: string;\n\t/**\n\t * Called when the selected value changes.\n\t */\n\tonValueChange?: (value: string) => void;\n\t/**\n\t * Native form field name.\n\t */\n\tname?: string;\n\t/**\n\t * Placeholder shown when the field is empty.\n\t * @default Select…\n\t */\n\tplaceholder?: string;\n\t/**\n\t * Disable the field.\n\t * @default false\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Disable the field and mark it busy.\n\t * @default false\n\t */\n\tloading?: boolean;\n\t/**\n\t * The visual size of the field.\n\t * @default default\n\t */\n\tsize?: InputSize;\n};\n\nexport function Combobox({ placeholder = \"Select…\", ...rest }: ComboboxProps) {\n\treturn <TypeaheadField placeholder={placeholder} allowFreeform={false} {...rest} />;\n}\n"],"mappings":";;;;AAoDA,SAAgB,EAAS,EAAE,iBAAc,WAAW,GAAG,KAAuB;CAC7E,OAAO,kBAAC,GAAD;EAA6B;EAAa,eAAe;EAAO,GAAI;CAAO,CAAA;AACnF"}
@@ -136,47 +136,7 @@ export interface ContextMenuItemProps extends Omit<RadixContextMenuItemProps, "d
136
136
  asChild?: RadixContextMenuItemProps["asChild"];
137
137
  }
138
138
  export declare const ContextMenuItem: React.ForwardRefExoticComponent<ContextMenuItemProps & React.RefAttributes<HTMLDivElement>>;
139
- export interface ContextMenuPanelProps extends Omit<React.ComponentProps<typeof ContextMenuPrimitive.Content>, "loop" | "alignOffset" | "avoidCollisions" | "collisionBoundary" | "collisionPadding" | "arrowPadding" | "sticky" | "hideWhenDetached" | "forceMount" | "asChild" | "onCloseAutoFocus" | "onEscapeKeyDown" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside"> {
140
- /**
141
- * Whether keyboard navigation should loop around item boundaries.
142
- * @default false
143
- */
144
- loop?: RadixContextMenuContentProps["loop"];
145
- /**
146
- * Offset in pixels from the start or end alignment position.
147
- * @default 0
148
- */
149
- alignOffset?: RadixContextMenuContentProps["alignOffset"];
150
- /**
151
- * Whether to reposition content to avoid viewport boundary collisions.
152
- * @default true
153
- */
154
- avoidCollisions?: RadixContextMenuContentProps["avoidCollisions"];
155
- /**
156
- * Element or elements bounding boundary collision calculations.
157
- * @default []
158
- */
159
- collisionBoundary?: RadixContextMenuContentProps["collisionBoundary"];
160
- /**
161
- * Virtual padding from collision boundaries in pixels.
162
- * @default 0
163
- */
164
- collisionPadding?: RadixContextMenuContentProps["collisionPadding"];
165
- /**
166
- * Padding in pixels between popper arrow and floating panel edge.
167
- * @default 0
168
- */
169
- arrowPadding?: RadixContextMenuContentProps["arrowPadding"];
170
- /**
171
- * Sticky positioning behavior along the align axis when overflowing.
172
- * @default "partial"
173
- */
174
- sticky?: RadixContextMenuContentProps["sticky"];
175
- /**
176
- * Whether to hide content completely when trigger is fully occluded.
177
- * @default false
178
- */
179
- hideWhenDetached?: RadixContextMenuContentProps["hideWhenDetached"];
139
+ export interface ContextMenuPanelProps extends Omit<ContextMenuContentProps, "forceMount">, Pick<React.ComponentProps<typeof ContextMenuPrimitive.Content>, "ref"> {
180
140
  /**
181
141
  * Force mounting content in DOM for external animation controls.
182
142
  * When forceMount is true, the content remains mounted even when closed.
@@ -184,32 +144,6 @@ export interface ContextMenuPanelProps extends Omit<React.ComponentProps<typeof
184
144
  * Note: Keeping modal content forceMounted may isolate background interactions until unmounted.
185
145
  */
186
146
  forceMount?: true;
187
- /**
188
- * Change the default rendered div element to the child element, merging props and behavior.
189
- * Content forwards ref to HTMLDivElement and inherits native div attributes.
190
- * @default false
191
- */
192
- asChild?: RadixContextMenuContentProps["asChild"];
193
- /**
194
- * Callback fired when auto-focusing on close. Can be prevented.
195
- */
196
- onCloseAutoFocus?: RadixContextMenuContentProps["onCloseAutoFocus"];
197
- /**
198
- * Callback fired when the Escape key is down on the dismissable layer. Can be prevented.
199
- */
200
- onEscapeKeyDown?: RadixContextMenuContentProps["onEscapeKeyDown"];
201
- /**
202
- * Callback fired when a pointerdown event happens outside the bounds of the dismissable layer. Can be prevented.
203
- */
204
- onPointerDownOutside?: RadixContextMenuContentProps["onPointerDownOutside"];
205
- /**
206
- * Callback fired when focus moves outside the bounds of the dismissable layer. Can be prevented.
207
- */
208
- onFocusOutside?: RadixContextMenuContentProps["onFocusOutside"];
209
- /**
210
- * Callback fired when an interaction (pointerdown or focus) happens outside the bounds of the dismissable layer. Can be prevented.
211
- */
212
- onInteractOutside?: RadixContextMenuContentProps["onInteractOutside"];
213
147
  }
214
148
  export declare function ContextMenuPanel({ className, ...props }: ContextMenuPanelProps): React.JSX.Element;
215
149
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"context-menu.js","names":[],"sources":["../../src/components/context-menu.tsx"],"sourcesContent":["import * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { overlayItemClass, overlayPanelClass } from \"./overlay\";\n\ntype RadixContextMenuProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Root>;\ntype RadixContextMenuTriggerProps = React.ComponentPropsWithoutRef<\n\ttypeof ContextMenuPrimitive.Trigger\n>;\ntype RadixContextMenuContentProps = React.ComponentPropsWithoutRef<\n\ttypeof ContextMenuPrimitive.Content\n>;\ntype RadixContextMenuItemProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item>;\n\nexport interface ContextMenuProps\n\textends Omit<RadixContextMenuProps, \"open\" | \"onOpenChange\" | \"dir\" | \"modal\"> {\n\t/**\n\t * Controlled open state of the context menu.\n\t * When set to true before pointer trigger interaction, positions at the top-left of the viewport.\n\t */\n\topen?: RadixContextMenuProps[\"open\"];\n\t/**\n\t * Callback invoked when open state changes.\n\t */\n\tonOpenChange?: RadixContextMenuProps[\"onOpenChange\"];\n\t/**\n\t * The reading direction of the context menu.\n\t * @default \"ltr\"\n\t */\n\tdir?: RadixContextMenuProps[\"dir\"];\n\t/**\n\t * Whether the context menu is modal, preventing outside interactions.\n\t * @default true\n\t */\n\tmodal?: RadixContextMenuProps[\"modal\"];\n}\n\nexport const ContextMenu = ContextMenuPrimitive.Root;\n\nexport interface ContextMenuTriggerProps\n\textends Omit<RadixContextMenuTriggerProps, \"disabled\" | \"asChild\"> {\n\t/**\n\t * Disable the context menu trigger from opening on right-click.\n\t * @default false\n\t */\n\tdisabled?: RadixContextMenuTriggerProps[\"disabled\"];\n\t/**\n\t * Change the default rendered span element to the child element, merging props and behavior.\n\t * Trigger forwards ref to HTMLSpanElement and inherits native span attributes.\n\t * @default false\n\t */\n\tasChild?: RadixContextMenuTriggerProps[\"asChild\"];\n}\n\nexport const ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\nexport interface ContextMenuContentProps\n\textends Omit<\n\t\tRadixContextMenuContentProps,\n\t\t| \"loop\"\n\t\t| \"alignOffset\"\n\t\t| \"avoidCollisions\"\n\t\t| \"collisionBoundary\"\n\t\t| \"collisionPadding\"\n\t\t| \"arrowPadding\"\n\t\t| \"sticky\"\n\t\t| \"hideWhenDetached\"\n\t\t| \"forceMount\"\n\t\t| \"asChild\"\n\t\t| \"onCloseAutoFocus\"\n\t\t| \"onEscapeKeyDown\"\n\t\t| \"onPointerDownOutside\"\n\t\t| \"onFocusOutside\"\n\t\t| \"onInteractOutside\"\n\t> {\n\t/**\n\t * Whether keyboard navigation should loop around item boundaries.\n\t * @default false\n\t */\n\tloop?: RadixContextMenuContentProps[\"loop\"];\n\t/**\n\t * Offset in pixels from the start or end alignment position.\n\t * @default 0\n\t */\n\talignOffset?: RadixContextMenuContentProps[\"alignOffset\"];\n\t/**\n\t * Whether to reposition content to avoid viewport boundary collisions.\n\t * @default true\n\t */\n\tavoidCollisions?: RadixContextMenuContentProps[\"avoidCollisions\"];\n\t/**\n\t * Element or elements bounding boundary collision calculations.\n\t * @default []\n\t */\n\tcollisionBoundary?: RadixContextMenuContentProps[\"collisionBoundary\"];\n\t/**\n\t * Virtual padding from collision boundaries in pixels.\n\t * @default 0\n\t */\n\tcollisionPadding?: RadixContextMenuContentProps[\"collisionPadding\"];\n\t/**\n\t * Padding in pixels between popper arrow and floating panel edge.\n\t * @default 0\n\t */\n\tarrowPadding?: RadixContextMenuContentProps[\"arrowPadding\"];\n\t/**\n\t * Sticky positioning behavior along the align axis when overflowing.\n\t * @default \"partial\"\n\t */\n\tsticky?: RadixContextMenuContentProps[\"sticky\"];\n\t/**\n\t * Whether to hide content completely when trigger is fully occluded.\n\t * @default false\n\t */\n\thideWhenDetached?: RadixContextMenuContentProps[\"hideWhenDetached\"];\n\t/**\n\t * Force mounting content in DOM for external animation controls.\n\t * Note: Bare ContextMenuContent mounts directly without a built-in Portal wrapper.\n\t */\n\tforceMount?: true;\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Content forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixContextMenuContentProps[\"asChild\"];\n\t/**\n\t * Callback fired when auto-focusing on close. Can be prevented.\n\t */\n\tonCloseAutoFocus?: RadixContextMenuContentProps[\"onCloseAutoFocus\"];\n\t/**\n\t * Callback fired when the Escape key is down on the dismissable layer. Can be prevented.\n\t */\n\tonEscapeKeyDown?: RadixContextMenuContentProps[\"onEscapeKeyDown\"];\n\t/**\n\t * Callback fired when a pointerdown event happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonPointerDownOutside?: RadixContextMenuContentProps[\"onPointerDownOutside\"];\n\t/**\n\t * Callback fired when focus moves outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonFocusOutside?: RadixContextMenuContentProps[\"onFocusOutside\"];\n\t/**\n\t * Callback fired when an interaction (pointerdown or focus) happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonInteractOutside?: RadixContextMenuContentProps[\"onInteractOutside\"];\n}\n\nexport const ContextMenuContent = ContextMenuPrimitive.Content;\n\nexport interface ContextMenuItemProps\n\textends Omit<RadixContextMenuItemProps, \"disabled\" | \"onSelect\" | \"textValue\" | \"asChild\"> {\n\t/**\n\t * Disable the context menu item.\n\t * @default false\n\t */\n\tdisabled?: RadixContextMenuItemProps[\"disabled\"];\n\t/**\n\t * Event handler called when the context menu item is selected (via click or keyboard).\n\t */\n\tonSelect?: RadixContextMenuItemProps[\"onSelect\"];\n\t/**\n\t * Optional text used for typeahead navigation. By default typeahead uses item text content.\n\t */\n\ttextValue?: RadixContextMenuItemProps[\"textValue\"];\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Item forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixContextMenuItemProps[\"asChild\"];\n}\n\nexport const ContextMenuItem = React.forwardRef<\n\tReact.ElementRef<typeof ContextMenuPrimitive.Item>,\n\tContextMenuItemProps\n>(({ className, ...props }, ref) => (\n\t<ContextMenuPrimitive.Item\n\t\tref={ref}\n\t\tclassName={overlayItemClass(\n\t\t\tcn(\n\t\t\t\t\"relative outline-hidden focus:bg-basalt-accent data-disabled:pointer-events-none data-disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t)}\n\t\t{...props}\n\t/>\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nexport interface ContextMenuPanelProps\n\textends Omit<\n\t\tReact.ComponentProps<typeof ContextMenuPrimitive.Content>,\n\t\t| \"loop\"\n\t\t| \"alignOffset\"\n\t\t| \"avoidCollisions\"\n\t\t| \"collisionBoundary\"\n\t\t| \"collisionPadding\"\n\t\t| \"arrowPadding\"\n\t\t| \"sticky\"\n\t\t| \"hideWhenDetached\"\n\t\t| \"forceMount\"\n\t\t| \"asChild\"\n\t\t| \"onCloseAutoFocus\"\n\t\t| \"onEscapeKeyDown\"\n\t\t| \"onPointerDownOutside\"\n\t\t| \"onFocusOutside\"\n\t\t| \"onInteractOutside\"\n\t> {\n\t/**\n\t * Whether keyboard navigation should loop around item boundaries.\n\t * @default false\n\t */\n\tloop?: RadixContextMenuContentProps[\"loop\"];\n\t/**\n\t * Offset in pixels from the start or end alignment position.\n\t * @default 0\n\t */\n\talignOffset?: RadixContextMenuContentProps[\"alignOffset\"];\n\t/**\n\t * Whether to reposition content to avoid viewport boundary collisions.\n\t * @default true\n\t */\n\tavoidCollisions?: RadixContextMenuContentProps[\"avoidCollisions\"];\n\t/**\n\t * Element or elements bounding boundary collision calculations.\n\t * @default []\n\t */\n\tcollisionBoundary?: RadixContextMenuContentProps[\"collisionBoundary\"];\n\t/**\n\t * Virtual padding from collision boundaries in pixels.\n\t * @default 0\n\t */\n\tcollisionPadding?: RadixContextMenuContentProps[\"collisionPadding\"];\n\t/**\n\t * Padding in pixels between popper arrow and floating panel edge.\n\t * @default 0\n\t */\n\tarrowPadding?: RadixContextMenuContentProps[\"arrowPadding\"];\n\t/**\n\t * Sticky positioning behavior along the align axis when overflowing.\n\t * @default \"partial\"\n\t */\n\tsticky?: RadixContextMenuContentProps[\"sticky\"];\n\t/**\n\t * Whether to hide content completely when trigger is fully occluded.\n\t * @default false\n\t */\n\thideWhenDetached?: RadixContextMenuContentProps[\"hideWhenDetached\"];\n\t/**\n\t * Force mounting content in DOM for external animation controls.\n\t * When forceMount is true, the content remains mounted even when closed.\n\t * The caller is responsible for visibility transitions and unmounting after animation completes.\n\t * Note: Keeping modal content forceMounted may isolate background interactions until unmounted.\n\t */\n\tforceMount?: true;\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Content forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixContextMenuContentProps[\"asChild\"];\n\t/**\n\t * Callback fired when auto-focusing on close. Can be prevented.\n\t */\n\tonCloseAutoFocus?: RadixContextMenuContentProps[\"onCloseAutoFocus\"];\n\t/**\n\t * Callback fired when the Escape key is down on the dismissable layer. Can be prevented.\n\t */\n\tonEscapeKeyDown?: RadixContextMenuContentProps[\"onEscapeKeyDown\"];\n\t/**\n\t * Callback fired when a pointerdown event happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonPointerDownOutside?: RadixContextMenuContentProps[\"onPointerDownOutside\"];\n\t/**\n\t * Callback fired when focus moves outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonFocusOutside?: RadixContextMenuContentProps[\"onFocusOutside\"];\n\t/**\n\t * Callback fired when an interaction (pointerdown or focus) happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonInteractOutside?: RadixContextMenuContentProps[\"onInteractOutside\"];\n}\n\nexport function ContextMenuPanel({ className, ...props }: ContextMenuPanelProps) {\n\treturn (\n\t\t<ContextMenuPrimitive.Portal forceMount={props.forceMount}>\n\t\t\t<ContextMenuPrimitive.Content\n\t\t\t\tclassName={overlayPanelClass(cn(\"min-w-40\", className))}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</ContextMenuPrimitive.Portal>\n\t);\n}\n"],"mappings":";;;;;;;AAqCA,IAAa,IAAc,EAAqB,MAiBnC,IAAqB,EAAqB,SA8F1C,IAAqB,EAAqB,SAyB1C,IAAkB,EAAM,YAGlC,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAqB,MAAtB;CACM;CACL,WAAW,EACV,EACC,6GACA,CACD,CACD;CACA,GAAI;AACJ,CAAA,CACD;AACD,EAAgB,cAAc,EAAqB,KAAK;AAgGxD,SAAgB,EAAiB,EAAE,cAAW,GAAG,KAAgC;CAChF,OACC,kBAAC,EAAqB,QAAtB;EAA6B,YAAY,EAAM;EAC9C,UAAA,kBAAC,EAAqB,SAAtB;GACC,WAAW,EAAkB,EAAG,YAAY,CAAS,CAAC;GACtD,GAAI;EACJ,CAAA;CAC2B,CAAA;AAE/B"}
1
+ {"version":3,"file":"context-menu.js","names":[],"sources":["../../src/components/context-menu.tsx"],"sourcesContent":["import * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { overlayItemClass, overlayPanelClass } from \"./overlay\";\n\ntype RadixContextMenuProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Root>;\ntype RadixContextMenuTriggerProps = React.ComponentPropsWithoutRef<\n\ttypeof ContextMenuPrimitive.Trigger\n>;\ntype RadixContextMenuContentProps = React.ComponentPropsWithoutRef<\n\ttypeof ContextMenuPrimitive.Content\n>;\ntype RadixContextMenuItemProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item>;\n\nexport interface ContextMenuProps\n\textends Omit<RadixContextMenuProps, \"open\" | \"onOpenChange\" | \"dir\" | \"modal\"> {\n\t/**\n\t * Controlled open state of the context menu.\n\t * When set to true before pointer trigger interaction, positions at the top-left of the viewport.\n\t */\n\topen?: RadixContextMenuProps[\"open\"];\n\t/**\n\t * Callback invoked when open state changes.\n\t */\n\tonOpenChange?: RadixContextMenuProps[\"onOpenChange\"];\n\t/**\n\t * The reading direction of the context menu.\n\t * @default \"ltr\"\n\t */\n\tdir?: RadixContextMenuProps[\"dir\"];\n\t/**\n\t * Whether the context menu is modal, preventing outside interactions.\n\t * @default true\n\t */\n\tmodal?: RadixContextMenuProps[\"modal\"];\n}\n\nexport const ContextMenu = ContextMenuPrimitive.Root;\n\nexport interface ContextMenuTriggerProps\n\textends Omit<RadixContextMenuTriggerProps, \"disabled\" | \"asChild\"> {\n\t/**\n\t * Disable the context menu trigger from opening on right-click.\n\t * @default false\n\t */\n\tdisabled?: RadixContextMenuTriggerProps[\"disabled\"];\n\t/**\n\t * Change the default rendered span element to the child element, merging props and behavior.\n\t * Trigger forwards ref to HTMLSpanElement and inherits native span attributes.\n\t * @default false\n\t */\n\tasChild?: RadixContextMenuTriggerProps[\"asChild\"];\n}\n\nexport const ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\nexport interface ContextMenuContentProps\n\textends Omit<\n\t\tRadixContextMenuContentProps,\n\t\t| \"loop\"\n\t\t| \"alignOffset\"\n\t\t| \"avoidCollisions\"\n\t\t| \"collisionBoundary\"\n\t\t| \"collisionPadding\"\n\t\t| \"arrowPadding\"\n\t\t| \"sticky\"\n\t\t| \"hideWhenDetached\"\n\t\t| \"forceMount\"\n\t\t| \"asChild\"\n\t\t| \"onCloseAutoFocus\"\n\t\t| \"onEscapeKeyDown\"\n\t\t| \"onPointerDownOutside\"\n\t\t| \"onFocusOutside\"\n\t\t| \"onInteractOutside\"\n\t> {\n\t/**\n\t * Whether keyboard navigation should loop around item boundaries.\n\t * @default false\n\t */\n\tloop?: RadixContextMenuContentProps[\"loop\"];\n\t/**\n\t * Offset in pixels from the start or end alignment position.\n\t * @default 0\n\t */\n\talignOffset?: RadixContextMenuContentProps[\"alignOffset\"];\n\t/**\n\t * Whether to reposition content to avoid viewport boundary collisions.\n\t * @default true\n\t */\n\tavoidCollisions?: RadixContextMenuContentProps[\"avoidCollisions\"];\n\t/**\n\t * Element or elements bounding boundary collision calculations.\n\t * @default []\n\t */\n\tcollisionBoundary?: RadixContextMenuContentProps[\"collisionBoundary\"];\n\t/**\n\t * Virtual padding from collision boundaries in pixels.\n\t * @default 0\n\t */\n\tcollisionPadding?: RadixContextMenuContentProps[\"collisionPadding\"];\n\t/**\n\t * Padding in pixels between popper arrow and floating panel edge.\n\t * @default 0\n\t */\n\tarrowPadding?: RadixContextMenuContentProps[\"arrowPadding\"];\n\t/**\n\t * Sticky positioning behavior along the align axis when overflowing.\n\t * @default \"partial\"\n\t */\n\tsticky?: RadixContextMenuContentProps[\"sticky\"];\n\t/**\n\t * Whether to hide content completely when trigger is fully occluded.\n\t * @default false\n\t */\n\thideWhenDetached?: RadixContextMenuContentProps[\"hideWhenDetached\"];\n\t/**\n\t * Force mounting content in DOM for external animation controls.\n\t * Note: Bare ContextMenuContent mounts directly without a built-in Portal wrapper.\n\t */\n\tforceMount?: true;\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Content forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixContextMenuContentProps[\"asChild\"];\n\t/**\n\t * Callback fired when auto-focusing on close. Can be prevented.\n\t */\n\tonCloseAutoFocus?: RadixContextMenuContentProps[\"onCloseAutoFocus\"];\n\t/**\n\t * Callback fired when the Escape key is down on the dismissable layer. Can be prevented.\n\t */\n\tonEscapeKeyDown?: RadixContextMenuContentProps[\"onEscapeKeyDown\"];\n\t/**\n\t * Callback fired when a pointerdown event happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonPointerDownOutside?: RadixContextMenuContentProps[\"onPointerDownOutside\"];\n\t/**\n\t * Callback fired when focus moves outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonFocusOutside?: RadixContextMenuContentProps[\"onFocusOutside\"];\n\t/**\n\t * Callback fired when an interaction (pointerdown or focus) happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonInteractOutside?: RadixContextMenuContentProps[\"onInteractOutside\"];\n}\n\nexport const ContextMenuContent = ContextMenuPrimitive.Content;\n\nexport interface ContextMenuItemProps\n\textends Omit<RadixContextMenuItemProps, \"disabled\" | \"onSelect\" | \"textValue\" | \"asChild\"> {\n\t/**\n\t * Disable the context menu item.\n\t * @default false\n\t */\n\tdisabled?: RadixContextMenuItemProps[\"disabled\"];\n\t/**\n\t * Event handler called when the context menu item is selected (via click or keyboard).\n\t */\n\tonSelect?: RadixContextMenuItemProps[\"onSelect\"];\n\t/**\n\t * Optional text used for typeahead navigation. By default typeahead uses item text content.\n\t */\n\ttextValue?: RadixContextMenuItemProps[\"textValue\"];\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Item forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixContextMenuItemProps[\"asChild\"];\n}\n\nexport const ContextMenuItem = React.forwardRef<\n\tReact.ElementRef<typeof ContextMenuPrimitive.Item>,\n\tContextMenuItemProps\n>(({ className, ...props }, ref) => (\n\t<ContextMenuPrimitive.Item\n\t\tref={ref}\n\t\tclassName={overlayItemClass(\n\t\t\tcn(\n\t\t\t\t\"relative outline-hidden focus:bg-basalt-accent data-disabled:pointer-events-none data-disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t)}\n\t\t{...props}\n\t/>\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nexport interface ContextMenuPanelProps\n\textends Omit<ContextMenuContentProps, \"forceMount\">,\n\t\tPick<React.ComponentProps<typeof ContextMenuPrimitive.Content>, \"ref\"> {\n\t/**\n\t * Force mounting content in DOM for external animation controls.\n\t * When forceMount is true, the content remains mounted even when closed.\n\t * The caller is responsible for visibility transitions and unmounting after animation completes.\n\t * Note: Keeping modal content forceMounted may isolate background interactions until unmounted.\n\t */\n\tforceMount?: true;\n}\n\nexport function ContextMenuPanel({ className, ...props }: ContextMenuPanelProps) {\n\treturn (\n\t\t<ContextMenuPrimitive.Portal forceMount={props.forceMount}>\n\t\t\t<ContextMenuPrimitive.Content\n\t\t\t\tclassName={overlayPanelClass(cn(\"min-w-40\", className))}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</ContextMenuPrimitive.Portal>\n\t);\n}\n"],"mappings":";;;;;;;AAqCA,IAAa,IAAc,EAAqB,MAiBnC,IAAqB,EAAqB,SA8F1C,IAAqB,EAAqB,SAyB1C,IAAkB,EAAM,YAGlC,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAqB,MAAtB;CACM;CACL,WAAW,EACV,EACC,6GACA,CACD,CACD;CACA,GAAI;AACJ,CAAA,CACD;AACD,EAAgB,cAAc,EAAqB,KAAK;AAcxD,SAAgB,EAAiB,EAAE,cAAW,GAAG,KAAgC;CAChF,OACC,kBAAC,EAAqB,QAAtB;EAA6B,YAAY,EAAM;EAC9C,UAAA,kBAAC,EAAqB,SAAtB;GACC,WAAW,EAAkB,EAAG,YAAY,CAAS,CAAC;GACtD,GAAI;EACJ,CAAA;CAC2B,CAAA;AAE/B"}
@@ -4,31 +4,23 @@ import { Button as t } from "./button.js";
4
4
  import { SkeletonLine as n } from "./skeleton-line.js";
5
5
  import { Pagination as r } from "./pagination.js";
6
6
  import { Table as i, TableBody as a, TableCell as o, TableHead as s, TableHeader as c, TableRow as l } from "./table.js";
7
- import { useCallback as u, useEffect as d, useLayoutEffect as f, useMemo as ee, useRef as p, useState as m } from "react";
8
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
7
+ import { useCallback as u, useEffect as d, useLayoutEffect as ee, useMemo as te, useRef as f, useState as p } from "react";
8
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
9
  //#region src/components/data-table.tsx
10
- function _(e) {
11
- return typeof e == "bigint" ? e : typeof e == "number" && Number.isFinite(e) && Number.isInteger(e) ? BigInt(e) : null;
12
- }
13
- function v(e, t) {
14
- let n = BigInt(Math.trunc(e));
15
- return n < t ? -1 : n > t || e > Number(n) ? 1 : -1;
16
- }
17
- function y(e) {
10
+ function g(e) {
18
11
  return e === -Infinity ? 0 : typeof e == "bigint" || typeof e == "number" && Number.isFinite(e) ? 1 : e === Infinity ? 2 : typeof e == "number" ? 3 : typeof e == "string" ? 4 : 5;
19
12
  }
20
- function te(e, t) {
21
- let n = y(e), r = y(t);
13
+ function ne(e, t) {
14
+ let n = g(e), r = g(t);
22
15
  if (n !== r) return n - r;
23
16
  if (n === 1) {
24
- if (typeof e == "bigint" && typeof t == "bigint") return e < t ? -1 : +(e > t);
25
- let n = _(e), r = _(t);
26
- return n !== null && r !== null ? n < r ? -1 : +(n > r) : typeof e == "number" && typeof t == "bigint" ? v(e, t) : typeof e == "bigint" && typeof t == "number" ? -v(t, e) : e - t;
17
+ let n = e, r = t;
18
+ return n < r ? -1 : +(n > r);
27
19
  }
28
20
  let i = String(e), a = String(t);
29
21
  return i < a ? -1 : +(i > a);
30
22
  }
31
- function ne(e, t, n, r) {
23
+ function re(e, t, n, r) {
32
24
  if (e === null) return "prim:null";
33
25
  if (e === void 0) return "prim:undefined";
34
26
  if (typeof e == "symbol") {
@@ -38,225 +30,221 @@ function ne(e, t, n, r) {
38
30
  let i = typeof e;
39
31
  return i === "number" ? Object.is(e, -0) ? "prim:number:-0" : `prim:number:${String(e)}` : i === "string" || i === "bigint" || i === "boolean" ? `prim:${i}:${String(e)}` : `prim:${t}`;
40
32
  }
41
- function re(e) {
33
+ function _(e) {
42
34
  return e.startsWith("dup:") || e.startsWith("gen:");
43
35
  }
44
- function ie(e) {
45
- return e.startsWith("id:") || e.startsWith("get:");
46
- }
47
- function b(e) {
36
+ function v(e) {
48
37
  return typeof e == "function" || typeof e == "object" && !!e;
49
38
  }
50
- function ae(e, t) {
39
+ function ie(e, t) {
51
40
  if (e.filterValue) return String(e.filterValue(t));
52
41
  if (e.sortValue) return String(e.sortValue(t));
53
42
  let n = e.accessor(t);
54
43
  return typeof n == "string" || typeof n == "number" || typeof n == "bigint" ? String(n) : "";
55
44
  }
56
- function x(e, t, n, r) {
45
+ function y(e, t, n, r) {
57
46
  let i = r?.(e, t);
58
- return i === void 0 ? b(e) && "id" in e && e.id != null ? String(e.id) : n : i;
47
+ return i === void 0 ? v(e) && "id" in e && e.id != null ? String(e.id) : n : i;
59
48
  }
60
- function S({ data: _, columns: v, filter: y = "", loading: S = !1, empty: oe = "No results", selected: C, defaultSelected: w, onSelectedChange: T, multiple: se = !1, page: E, defaultPage: ce = 1, pageSize: D, onPageChange: le, getRowId: O, className: ue, sort: k, defaultSort: de = null, onSortChange: fe, manualSorting: A = !1, manualPagination: j = !1, manualFiltering: M = !1, total: N, error: P, onRetry: F, retryLabel: pe = "Try again", "aria-label": I = "Data table", "aria-describedby": me }) {
61
- let [he, ge] = m(de), L = k === void 0 ? he : k, _e = (e) => {
62
- k === void 0 && ge(e), fe?.(e);
63
- }, [ve, ye] = m(w ?? []), [R, be] = m(ce), xe = p(/* @__PURE__ */ new WeakMap()), z = p(0), B = p(/* @__PURE__ */ new WeakMap()), Se = p(/* @__PURE__ */ new Map()), V = p(/* @__PURE__ */ new Map()), H = p(/* @__PURE__ */ new Map()), U = p(/* @__PURE__ */ new Map()), Ce = p(/* @__PURE__ */ new Map()), W = y.trim().toLowerCase(), G = ee(() => {
49
+ function b({ data: g, columns: b, filter: ae = "", loading: x = !1, empty: oe = "No results", selected: S, defaultSelected: C, onSelectedChange: w, multiple: se = !1, page: T, defaultPage: ce = 1, pageSize: E, onPageChange: le, getRowId: D, className: ue, sort: O, defaultSort: de = null, onSortChange: fe, manualSorting: k = !1, manualPagination: A = !1, manualFiltering: j = !1, total: M, error: N, onRetry: P, retryLabel: pe = "Try again", "aria-label": F = "Data table", "aria-describedby": me }) {
50
+ let [he, ge] = p(de), I = O === void 0 ? he : O, _e = (e) => {
51
+ O === void 0 && ge(e), fe?.(e);
52
+ }, [ve, ye] = p(C ?? []), [L, be] = p(ce), R = f(/* @__PURE__ */ new WeakMap()), z = f(0), B = f(/* @__PURE__ */ new WeakMap()), V = f(/* @__PURE__ */ new Map()), H = f(/* @__PURE__ */ new Map()), U = f(/* @__PURE__ */ new Map()), xe = f(/* @__PURE__ */ new Map()), W = ae.trim().toLowerCase(), G = te(() => {
64
53
  let e = (e) => {
65
- let t = xe.current.get(e);
66
- return t || (t = `basalt-row-${z.current++}`, xe.current.set(e, t)), t;
54
+ let t = R.current.get(e);
55
+ return t || (t = `basalt-row-${z.current++}`, R.current.set(e, t)), t;
67
56
  }, t = (e, t) => {
68
- let n = O?.(e, t);
57
+ let n = D?.(e, t);
69
58
  if (n !== void 0) return `get:${n}`;
70
- if (b(e) && "id" in e) {
59
+ if (v(e) && "id" in e) {
71
60
  let t = e.id;
72
61
  if (t != null) return `id:${String(t)}`;
73
62
  }
74
- }, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = (e, n, c, l) => {
75
- if (!l) return;
76
- let u = a.get(l) ?? [];
77
- u.push(c), a.set(l, u), o.set(c, l), ie(c) && s.set(c, l);
78
- let d = t(e, n);
79
- if (d && (r.set(d, c), re(c))) {
80
- let e = i.get(d) ?? [];
81
- e.push(c), i.set(d, e);
63
+ }, n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = (e, n, s, c) => {
64
+ if (!c) return;
65
+ let l = a.get(c) ?? [];
66
+ l.push(s), a.set(c, l), o.set(s, c);
67
+ let u = t(e, n);
68
+ if (u && (r.set(u, s), _(s))) {
69
+ let e = i.get(u) ?? [];
70
+ e.push(s), i.set(u, e);
82
71
  }
83
- }, l = /* @__PURE__ */ new WeakMap(), u = _.map((e, t) => {
84
- let n = b(e) ? e : null, r = n ? l.get(n) ?? 0 : 0;
85
- return n && l.set(n, r + 1), {
72
+ }, c = /* @__PURE__ */ new WeakMap(), l = g.map((e, t) => {
73
+ let n = v(e) ? e : null, r = n ? c.get(n) ?? 0 : 0;
74
+ return n && c.set(n, r + 1), {
86
75
  row: e,
87
76
  index: t,
88
77
  occurrence: r,
89
78
  key: void 0
90
79
  };
91
80
  });
92
- for (let e of u) {
93
- let t = b(e.row) ? e.row : null;
81
+ for (let e of l) {
82
+ let t = v(e.row) ? e.row : null;
94
83
  if (!t) continue;
95
84
  let r = B.current.get(t)?.[e.occurrence];
96
85
  !r || n.has(r) || V.current.get(r) === t && (e.key = r, n.add(r));
97
86
  }
98
- let d = u.map(({ row: r, index: i, occurrence: a, key: o }) => {
99
- let s = b(r) ? r : null;
100
- if (o) return c(r, i, o, s), {
87
+ let u = l.map(({ row: r, index: i, occurrence: a, key: o }) => {
88
+ let c = v(r) ? r : null;
89
+ if (o) return s(r, i, o, c), {
101
90
  row: r,
102
91
  key: o,
103
- selectId: x(r, i, o, O)
92
+ selectId: y(r, i, o, D)
104
93
  };
105
94
  let l = a > 0, u, d = t(r, i);
106
- if (d && (u = d), s) {
107
- let t = e(s);
95
+ if (d && (u = d), c) {
96
+ let t = e(c);
108
97
  if (!u) u = l ? `gen:${t}#${a}` : `gen:${t}`;
109
98
  else if (n.has(u) || l) u = (U.current.get(u) ?? []).find((e) => !n.has(e)) ?? (l ? `dup:${t}#${a}` : `dup:${t}`);
110
99
  else {
111
100
  let e = H.current.get(u);
112
- e && !n.has(e) && re(e) && (u = e);
101
+ e && !n.has(e) && _(e) && (u = e);
113
102
  }
114
103
  }
115
- if (u ??= ne(r, i, Ce.current, z), n.has(u)) {
104
+ if (u ??= re(r, i, xe.current, z), n.has(u)) {
116
105
  let e = 0, t = `occ:${u}#${e}`;
117
106
  for (; n.has(t);) e += 1, t = `occ:${u}#${e}`;
118
107
  u = t;
119
108
  }
120
- return n.add(u), c(r, i, u, s), {
109
+ return n.add(u), s(r, i, u, c), {
121
110
  row: r,
122
111
  key: u,
123
- selectId: x(r, i, u, O)
112
+ selectId: y(r, i, u, D)
124
113
  };
125
- }), f = W && !M ? d.filter(({ row: e }) => v.some((t) => ae(t, e).toLowerCase().includes(W))) : d;
114
+ }), d = W && !j ? u.filter(({ row: e }) => b.some((t) => ie(t, e).toLowerCase().includes(W))) : u;
126
115
  return {
127
116
  rows: (() => {
128
- if (!L || A) return f;
129
- let e = v.find((e) => e.id === L.id);
130
- return e ? [...f].sort((t, n) => {
131
- let r = te(e.sortValue?.(t.row) ?? e.accessor(t.row), e.sortValue?.(n.row) ?? e.accessor(n.row));
132
- return L.dir === "asc" ? r : -r;
133
- }) : f;
117
+ if (!I || k) return d;
118
+ let e = b.find((e) => e.id === I.id);
119
+ return e ? [...d].sort((t, n) => {
120
+ let r = ne(e.sortValue?.(t.row) ?? e.accessor(t.row), e.sortValue?.(n.row) ?? e.accessor(n.row));
121
+ return I.dir === "asc" ? r : -r;
122
+ }) : d;
134
123
  })(),
135
124
  assigned: a,
136
125
  owner: o,
137
- canonical: s,
138
126
  lastKey: r,
139
127
  dups: i
140
128
  };
141
129
  }, [
142
- v,
143
- _,
144
- O,
130
+ b,
131
+ g,
132
+ D,
145
133
  W,
146
- L,
147
- M,
148
- A
134
+ I,
135
+ j,
136
+ k
149
137
  ]);
150
- f(() => {
138
+ ee(() => {
151
139
  for (let [e, t] of G.assigned) B.current.set(e, t);
152
- V.current = G.owner, Se.current = G.canonical, H.current = G.lastKey, U.current = G.dups;
140
+ V.current = G.owner, H.current = G.lastKey, U.current = G.dups;
153
141
  }, [G]);
154
- let K = C !== void 0 || w !== void 0 || T !== void 0, q = C ?? ve, J = u((e) => {
155
- C === void 0 && ye(e), T?.(e);
156
- }, [T, C]), we = j && N !== void 0 ? Math.max(0, N) : G.rows.length, Te = D && D > 0 ? Math.max(1, Math.ceil(we / D)) : 1, Y = Math.min(Te, Math.max(1, E ?? R)), X = u((e) => {
157
- E === void 0 && be(e), le?.(e);
158
- }, [le, E]), Z = p(null);
142
+ let K = S !== void 0 || C !== void 0 || w !== void 0, q = S ?? ve, J = u((e) => {
143
+ S === void 0 && ye(e), w?.(e);
144
+ }, [w, S]), Se = A && M !== void 0 ? Math.max(0, M) : G.rows.length, Y = E && E > 0 ? Math.max(1, Math.ceil(Se / E)) : 1, X = Math.min(Y, Math.max(1, T ?? L)), Z = u((e) => {
145
+ T === void 0 && be(e), le?.(e);
146
+ }, [le, T]), Q = f(null);
159
147
  d(() => {
160
- let e = E ?? R;
161
- if (e === Y || S) {
162
- Z.current = null;
148
+ let e = T ?? L;
149
+ if (e === X || x) {
150
+ Q.current = null;
163
151
  return;
164
152
  }
165
- let t = `${e}:${Y}`;
166
- Z.current !== t && (Z.current = t, X(Y));
153
+ let t = `${e}:${X}`;
154
+ Q.current !== t && (Q.current = t, Z(X));
167
155
  }, [
168
- E,
169
- R,
170
- Y,
171
- S,
172
- X
156
+ T,
157
+ L,
158
+ X,
159
+ x,
160
+ Z
173
161
  ]);
174
- let Q = !j && D && D > 0 ? G.rows.slice((Y - 1) * D, Y * D) : G.rows, $ = v.length + +!!K, Ee = (e) => {
162
+ let Ce = !A && E && E > 0 ? G.rows.slice((X - 1) * E, X * E) : G.rows, $ = b.length + +!!K, we = (e) => {
175
163
  if (se) {
176
164
  J(q.includes(e) ? q.filter((t) => t !== e) : [...q, e]);
177
165
  return;
178
166
  }
179
167
  J(q.includes(e) ? [] : [e]);
180
168
  };
181
- return /* @__PURE__ */ g("div", {
169
+ return /* @__PURE__ */ h("div", {
182
170
  className: "flex min-w-0 flex-col gap-3",
183
- children: [/* @__PURE__ */ h("div", {
171
+ children: [/* @__PURE__ */ m("div", {
184
172
  role: "region",
185
- "aria-label": `${I} scroll area`,
173
+ "aria-label": `${F} scroll area`,
186
174
  tabIndex: 0,
187
175
  className: "min-w-0 overflow-x-auto rounded-basalt-md focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-basalt-primary",
188
- children: /* @__PURE__ */ g(i, {
176
+ children: /* @__PURE__ */ h(i, {
189
177
  className: e("w-full", ue),
190
- "aria-label": I,
178
+ "aria-label": F,
191
179
  "aria-describedby": me,
192
- "aria-busy": S || void 0,
193
- children: [/* @__PURE__ */ h(c, { children: /* @__PURE__ */ g(l, { children: [K ? /* @__PURE__ */ h(s, { children: /* @__PURE__ */ h("span", {
180
+ "aria-busy": x || void 0,
181
+ children: [/* @__PURE__ */ m(c, { children: /* @__PURE__ */ h(l, { children: [K ? /* @__PURE__ */ m(s, { children: /* @__PURE__ */ m("span", {
194
182
  className: "sr-only",
195
183
  children: "Select"
196
- }) }) : null, v.map((e) => /* @__PURE__ */ h(s, {
184
+ }) }) : null, b.map((e) => /* @__PURE__ */ m(s, {
197
185
  className: e.headerClassName,
198
186
  style: { width: e.width },
199
187
  scope: "col",
200
- "aria-sort": e.sortable === !1 ? void 0 : L?.id === e.id ? L.dir === "asc" ? "ascending" : "descending" : "none",
201
- children: e.sortable === !1 ? e.headerContent ?? e.header : /* @__PURE__ */ g("button", {
188
+ "aria-sort": e.sortable === !1 ? void 0 : I?.id === e.id ? I.dir === "asc" ? "ascending" : "descending" : "none",
189
+ children: e.sortable === !1 ? e.headerContent ?? e.header : /* @__PURE__ */ h("button", {
202
190
  type: "button",
203
191
  "aria-label": e.header,
204
192
  className: "appearance-none border-0 bg-transparent p-0 font-inherit text-inherit font-medium cursor-pointer rounded-sm focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-basalt-primary",
205
- onClick: () => _e(L?.id === e.id && L.dir === "asc" ? {
193
+ onClick: () => _e(I?.id === e.id && I.dir === "asc" ? {
206
194
  id: e.id,
207
195
  dir: "desc"
208
196
  } : {
209
197
  id: e.id,
210
198
  dir: "asc"
211
199
  }),
212
- children: [e.headerContent ?? e.header, L?.id === e.id ? L.dir === "asc" ? " ↑" : " ↓" : ""]
200
+ children: [e.headerContent ?? e.header, I?.id === e.id ? I.dir === "asc" ? " ↑" : " ↓" : ""]
213
201
  })
214
- }, e.id))] }) }), /* @__PURE__ */ h(a, { children: S ? /* @__PURE__ */ h(l, { children: /* @__PURE__ */ h(o, {
202
+ }, e.id))] }) }), /* @__PURE__ */ m(a, { children: x ? /* @__PURE__ */ m(l, { children: /* @__PURE__ */ m(o, {
215
203
  colSpan: $,
216
- children: /* @__PURE__ */ g("div", {
204
+ children: /* @__PURE__ */ h("div", {
217
205
  role: "status",
218
206
  className: "flex flex-col gap-2 py-2",
219
207
  children: [
220
- /* @__PURE__ */ h("span", {
208
+ /* @__PURE__ */ m("span", {
221
209
  className: "sr-only",
222
210
  children: "Loading"
223
211
  }),
224
- /* @__PURE__ */ h(n, {}),
225
- /* @__PURE__ */ h(n, {}),
226
- /* @__PURE__ */ h(n, {})
212
+ /* @__PURE__ */ m(n, {}),
213
+ /* @__PURE__ */ m(n, {}),
214
+ /* @__PURE__ */ m(n, {})
227
215
  ]
228
216
  })
229
- }) }) : P != null && P !== !1 ? /* @__PURE__ */ h(l, { children: /* @__PURE__ */ h(o, {
217
+ }) }) : N != null && N !== !1 ? /* @__PURE__ */ m(l, { children: /* @__PURE__ */ m(o, {
230
218
  colSpan: $,
231
- children: /* @__PURE__ */ g("div", {
219
+ children: /* @__PURE__ */ h("div", {
232
220
  role: "alert",
233
221
  className: "flex flex-wrap items-center justify-between gap-3 py-6",
234
- children: [/* @__PURE__ */ h("div", { children: P }), F ? /* @__PURE__ */ h(t, {
222
+ children: [/* @__PURE__ */ m("div", { children: N }), P ? /* @__PURE__ */ m(t, {
235
223
  variant: "outline",
236
224
  size: "sm",
237
- onClick: F,
225
+ onClick: P,
238
226
  children: pe
239
227
  }) : null]
240
228
  })
241
- }) }) : Q.length === 0 ? /* @__PURE__ */ h(l, { children: /* @__PURE__ */ h(o, {
229
+ }) }) : Ce.length === 0 ? /* @__PURE__ */ m(l, { children: /* @__PURE__ */ m(o, {
242
230
  colSpan: $,
243
- children: /* @__PURE__ */ h("div", {
231
+ children: /* @__PURE__ */ m("div", {
244
232
  role: "status",
245
233
  children: oe
246
234
  })
247
- }) }) : Q.map(({ row: e, key: t, selectId: n }) => {
235
+ }) }) : Ce.map(({ row: e, key: t, selectId: n }) => {
248
236
  let r = q.includes(n);
249
- return /* @__PURE__ */ g(l, {
237
+ return /* @__PURE__ */ h(l, {
250
238
  variant: r ? "selected" : "default",
251
239
  "aria-selected": K ? r : void 0,
252
- children: [K ? /* @__PURE__ */ h(o, { children: /* @__PURE__ */ h("input", {
240
+ children: [K ? /* @__PURE__ */ m(o, { children: /* @__PURE__ */ m("input", {
253
241
  type: "checkbox",
254
242
  checked: r,
255
243
  "aria-label": `Select ${n}`,
256
- onChange: () => Ee(n)
257
- }) }) : null, v.map((t) => {
244
+ onChange: () => we(n)
245
+ }) }) : null, b.map((t) => {
258
246
  let n = t.accessor(e);
259
- return /* @__PURE__ */ h(o, {
247
+ return /* @__PURE__ */ m(o, {
260
248
  className: t.cellClassName,
261
249
  children: typeof n == "bigint" ? String(n) : n
262
250
  }, t.id);
@@ -264,15 +252,15 @@ function S({ data: _, columns: v, filter: y = "", loading: S = !1, empty: oe = "
264
252
  }, t);
265
253
  }) })]
266
254
  })
267
- }), D && D > 0 ? /* @__PURE__ */ h(r, {
268
- page: Y,
269
- pageCount: Te,
270
- disabled: S,
271
- onPageChange: X
255
+ }), E && E > 0 ? /* @__PURE__ */ m(r, {
256
+ page: X,
257
+ pageCount: Y,
258
+ disabled: x,
259
+ onPageChange: Z
272
260
  }) : null]
273
261
  });
274
262
  }
275
263
  //#endregion
276
- export { S as DataTable };
264
+ export { b as DataTable };
277
265
 
278
266
  //# sourceMappingURL=data-table.js.map