@aircall/ds 0.36.0 → 0.37.1

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.
@@ -77,7 +77,96 @@ function cn(...inputs) {
77
77
  return twMerge(clsx(inputs));
78
78
  }
79
79
  //#endregion
80
+ //#region \0@oxc-project+runtime@0.143.0/helpers/esm/objectWithoutPropertiesLoose.js
81
+ function _objectWithoutPropertiesLoose(r, e) {
82
+ if (null == r) return {};
83
+ var t = {};
84
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
85
+ if (e.includes(n)) continue;
86
+ t[n] = r[n];
87
+ }
88
+ return t;
89
+ }
90
+ //#endregion
91
+ //#region \0@oxc-project+runtime@0.143.0/helpers/esm/objectWithoutProperties.js
92
+ function _objectWithoutProperties(e, t) {
93
+ if (null == e) return {};
94
+ var o, r, i = _objectWithoutPropertiesLoose(e, t);
95
+ if (Object.getOwnPropertySymbols) {
96
+ var s = Object.getOwnPropertySymbols(e);
97
+ for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
98
+ }
99
+ return i;
100
+ }
101
+ //#endregion
102
+ //#region \0@oxc-project+runtime@0.143.0/helpers/esm/typeof.js
103
+ function _typeof(o) {
104
+ "@babel/helpers - typeof";
105
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
106
+ return typeof o;
107
+ } : function(o) {
108
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
109
+ }, _typeof(o);
110
+ }
111
+ //#endregion
112
+ //#region \0@oxc-project+runtime@0.143.0/helpers/esm/toPrimitive.js
113
+ function toPrimitive(t, r) {
114
+ if ("object" != _typeof(t) || !t) return t;
115
+ var e = t[Symbol.toPrimitive];
116
+ if (void 0 !== e) {
117
+ var i = e.call(t, r || "default");
118
+ if ("object" != _typeof(i)) return i;
119
+ throw new TypeError("@@toPrimitive must return a primitive value.");
120
+ }
121
+ return ("string" === r ? String : Number)(t);
122
+ }
123
+ //#endregion
124
+ //#region \0@oxc-project+runtime@0.143.0/helpers/esm/toPropertyKey.js
125
+ function toPropertyKey(t) {
126
+ var i = toPrimitive(t, "string");
127
+ return "symbol" == _typeof(i) ? i : i + "";
128
+ }
129
+ //#endregion
130
+ //#region \0@oxc-project+runtime@0.143.0/helpers/esm/defineProperty.js
131
+ function _defineProperty(e, r, t) {
132
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
133
+ value: t,
134
+ enumerable: !0,
135
+ configurable: !0,
136
+ writable: !0
137
+ }) : e[r] = t, e;
138
+ }
139
+ //#endregion
140
+ //#region \0@oxc-project+runtime@0.143.0/helpers/esm/objectSpread2.js
141
+ function ownKeys(e, r) {
142
+ var t = Object.keys(e);
143
+ if (Object.getOwnPropertySymbols) {
144
+ var o = Object.getOwnPropertySymbols(e);
145
+ r && (o = o.filter(function(r) {
146
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
147
+ })), t.push.apply(t, o);
148
+ }
149
+ return t;
150
+ }
151
+ function _objectSpread2(e) {
152
+ for (var r = 1; r < arguments.length; r++) {
153
+ var t = null != arguments[r] ? arguments[r] : {};
154
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
155
+ _defineProperty(e, r, t[r]);
156
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
157
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
158
+ });
159
+ }
160
+ return e;
161
+ }
162
+ //#endregion
80
163
  //#region src/components/button.tsx
164
+ const _excluded$5 = [
165
+ "className",
166
+ "variant",
167
+ "size",
168
+ "block"
169
+ ];
81
170
  /** Tailwind class string for link-styled buttons and anchors (primary color, underlined). */
82
171
  const linkStyle = "text-primary underline underline-offset-4";
83
172
  /** `cva` variant definitions for {@link Button} — resolves `variant`, `size`, and `block` into class names. */
@@ -117,8 +206,8 @@ const buttonVariants = cva("group/button inline-flex shrink-0 items-center justi
117
206
  * ```
118
207
  */
119
208
  const Button$1 = React.forwardRef((componentProps, forwardRef) => {
120
- const { className, variant = "default", size = "default", block = false, ...props } = componentProps;
121
- return /* @__PURE__ */ jsx(Button, {
209
+ const { className, variant = "default", size = "default", block = false } = componentProps, props = _objectWithoutProperties(componentProps, _excluded$5);
210
+ return /* @__PURE__ */ jsx(Button, _objectSpread2({
122
211
  ref: forwardRef,
123
212
  "data-slot": "button",
124
213
  "data-variant": variant,
@@ -127,9 +216,8 @@ const Button$1 = React.forwardRef((componentProps, forwardRef) => {
127
216
  size,
128
217
  block,
129
218
  className
130
- })),
131
- ...props
132
- });
219
+ }))
220
+ }, props));
133
221
  });
134
222
  Button$1.displayName = "Button";
135
223
  //#endregion
@@ -436,13 +524,20 @@ function getLanguageSnapshot() {
436
524
  function useDsTranslation(ns) {
437
525
  "use no memo";
438
526
  const language = useSyncExternalStore(subscribe, getLanguageSnapshot, getLanguageSnapshot);
439
- return useCallback((key, opts) => dsI18n.t(key, {
440
- ns,
441
- ...opts
442
- }), [ns, language]);
527
+ return useCallback((key, opts) => dsI18n.t(key, _objectSpread2({ ns }, opts)), [ns, language]);
443
528
  }
444
529
  //#endregion
445
530
  //#region src/components/action-bar.tsx
531
+ const _excluded$4 = ["size"];
532
+ const _excluded2$1 = [
533
+ "className",
534
+ "count",
535
+ "onClear",
536
+ "children",
537
+ "label",
538
+ "clearLabel",
539
+ "style"
540
+ ];
446
541
  /** Fixed height of the ActionBar (px). Single source of truth — the bar uses it
447
542
  * for its own height and consumers (e.g. DataTable) reserve space with it. */
448
543
  const ActionBarHeight = 48;
@@ -454,13 +549,12 @@ const ActionBarHeight = 48;
454
549
  */
455
550
  const ActionBarContext = React.createContext(null);
456
551
  const ActionBarButton = React.forwardRef((componentProps, forwardRef) => {
457
- const { size = "default", ...props } = componentProps;
458
- return /* @__PURE__ */ jsx(Button$1, {
552
+ const { size = "default" } = componentProps, props = _objectWithoutProperties(componentProps, _excluded$4);
553
+ return /* @__PURE__ */ jsx(Button$1, _objectSpread2({
459
554
  ref: forwardRef,
460
555
  variant: "ghost",
461
- size,
462
- ...props
463
- });
556
+ size
557
+ }, props));
464
558
  });
465
559
  ActionBarButton.displayName = "ActionBarButton";
466
560
  /**
@@ -476,44 +570,41 @@ ActionBarButton.displayName = "ActionBarButton";
476
570
  * ```
477
571
  */
478
572
  const ActionBar = React.forwardRef((componentProps, forwardRef) => {
479
- const { className, count, onClear, children, label, clearLabel, style, ...props } = componentProps;
573
+ var _ref;
574
+ const { className, count, onClear, children, label, clearLabel, style } = componentProps, props = _objectWithoutProperties(componentProps, _excluded2$1);
480
575
  const t = useDsTranslation("ds");
481
576
  const ctx = React.useContext(ActionBarContext);
482
- const resolvedCount = count ?? ctx?.count ?? 0;
483
- const resolvedOnClear = onClear ?? ctx?.onClear;
484
- const resolvedClearLabel = clearLabel ?? t("actionBar.clearSelection");
485
- return /* @__PURE__ */ jsxs("div", {
577
+ const resolvedCount = (_ref = count !== null && count !== void 0 ? count : ctx === null || ctx === void 0 ? void 0 : ctx.count) !== null && _ref !== void 0 ? _ref : 0;
578
+ const resolvedOnClear = onClear !== null && onClear !== void 0 ? onClear : ctx === null || ctx === void 0 ? void 0 : ctx.onClear;
579
+ const resolvedClearLabel = clearLabel !== null && clearLabel !== void 0 ? clearLabel : t("actionBar.clearSelection");
580
+ return /* @__PURE__ */ jsxs("div", _objectSpread2(_objectSpread2({
486
581
  ref: forwardRef,
487
582
  role: "toolbar",
488
583
  "aria-label": t("actionBar.selectionActions"),
489
584
  "data-slot": "action-bar",
490
585
  className: cn("relative flex w-full items-center gap-2 rounded-md border border-border bg-popover px-2 text-popover-foreground shadow-lg", className),
491
- style: {
492
- ...style,
493
- height: 48
494
- },
495
- ...props,
496
- children: [
497
- resolvedOnClear ? /* @__PURE__ */ jsx(ActionBarButton, {
498
- size: "icon",
499
- onClick: resolvedOnClear,
500
- "aria-label": resolvedClearLabel,
501
- children: /* @__PURE__ */ jsx(XIcon, {})
502
- }) : null,
503
- /* @__PURE__ */ jsx("span", {
504
- className: "flex-1 truncate text-sm",
505
- children: label ? label(resolvedCount) : t("actionBar.itemsSelected", { count: resolvedCount })
506
- }),
507
- children ? /* @__PURE__ */ jsx("div", {
508
- className: "flex shrink-0 items-center gap-2",
509
- children
510
- }) : null
511
- ]
512
- });
586
+ style: _objectSpread2(_objectSpread2({}, style), {}, { height: 48 })
587
+ }, props), {}, { children: [
588
+ resolvedOnClear ? /* @__PURE__ */ jsx(ActionBarButton, {
589
+ size: "icon",
590
+ onClick: resolvedOnClear,
591
+ "aria-label": resolvedClearLabel,
592
+ children: /* @__PURE__ */ jsx(XIcon, {})
593
+ }) : null,
594
+ /* @__PURE__ */ jsx("span", {
595
+ className: "flex-1 truncate text-sm",
596
+ children: label ? label(resolvedCount) : t("actionBar.itemsSelected", { count: resolvedCount })
597
+ }),
598
+ children ? /* @__PURE__ */ jsx("div", {
599
+ className: "flex shrink-0 items-center gap-2",
600
+ children
601
+ }) : null
602
+ ] }));
513
603
  });
514
604
  ActionBar.displayName = "ActionBar";
515
605
  //#endregion
516
606
  //#region src/components/spinner.tsx
607
+ const _excluded$3 = ["className", "size"];
517
608
  /** Class variants for `Spinner`, controlling its `size` (`default`, `sm`, `lg`, `xl`). */
518
609
  const spinnerVariants = cva("animate-spin text-current", {
519
610
  variants: { size: {
@@ -534,20 +625,20 @@ const spinnerVariants = cva("animate-spin text-current", {
534
625
  * ```
535
626
  */
536
627
  const Spinner = React.forwardRef((componentProps, forwardRef) => {
537
- const { className, size, ...props } = componentProps;
628
+ const { className, size } = componentProps, props = _objectWithoutProperties(componentProps, _excluded$3);
538
629
  const t = useDsTranslation("ds");
539
- return /* @__PURE__ */ jsx(Loader2Icon, {
630
+ return /* @__PURE__ */ jsx(Loader2Icon, _objectSpread2({
540
631
  ref: forwardRef,
541
632
  "data-slot": "spinner",
542
633
  role: "status",
543
634
  "aria-label": t("spinner.loading"),
544
- className: cn(spinnerVariants({ size }), className),
545
- ...props
546
- });
635
+ className: cn(spinnerVariants({ size }), className)
636
+ }, props));
547
637
  });
548
638
  Spinner.displayName = "Spinner";
549
639
  //#endregion
550
640
  //#region src/components/checkbox.tsx
641
+ const _excluded$2 = ["className"];
551
642
  /**
552
643
  * A checkbox for toggling a single value, wrapping Base UI's `Checkbox.Root`.
553
644
  * Renders a `<button role="checkbox">` containing a check (checked) or minus
@@ -559,23 +650,22 @@ Spinner.displayName = "Spinner";
559
650
  * ```
560
651
  */
561
652
  const Checkbox$1 = React.forwardRef((componentProps, forwardRef) => {
562
- const { className, ...props } = componentProps;
563
- return /* @__PURE__ */ jsx(Checkbox.Root, {
653
+ const { className } = componentProps, props = _objectWithoutProperties(componentProps, _excluded$2);
654
+ return /* @__PURE__ */ jsx(Checkbox.Root, _objectSpread2(_objectSpread2({
564
655
  ref: forwardRef,
565
656
  "data-slot": "checkbox",
566
- className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-[color,box-shadow,opacity] outline-none active:opacity-60 group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 data-disabled:cursor-not-allowed data-disabled:bg-input/50 data-disabled:opacity-50 dark:data-disabled:bg-input/80 aria-invalid:border-destructive focus-visible:aria-invalid:ring-3 focus-visible:aria-invalid:ring-destructive/20 hover:aria-invalid:data-unchecked:bg-destructive-background focus-visible:aria-invalid:data-unchecked:bg-destructive-background bg-background dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:focus-visible:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground aria-invalid:data-checked:border-destructive aria-invalid:data-checked:bg-destructive aria-invalid:data-indeterminate:border-destructive aria-invalid:data-indeterminate:bg-destructive dark:data-checked:bg-primary dark:data-indeterminate:bg-primary", className),
567
- ...props,
568
- children: /* @__PURE__ */ jsxs(Checkbox.Indicator, {
569
- "data-slot": "checkbox-indicator",
570
- keepMounted: true,
571
- className: "group/indicator grid place-content-center text-current transition-none [&>svg]:size-3.5",
572
- children: [/* @__PURE__ */ jsx(CheckIcon, { className: "hidden group-data-[checked]/indicator:block" }), /* @__PURE__ */ jsx(MinusIcon, { className: "hidden group-data-[indeterminate]/indicator:block" })]
573
- })
574
- });
657
+ className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-[color,box-shadow,opacity] outline-none active:opacity-60 group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 data-disabled:cursor-not-allowed data-disabled:bg-input/50 data-disabled:opacity-50 dark:data-disabled:bg-input/80 aria-invalid:border-destructive focus-visible:aria-invalid:ring-3 focus-visible:aria-invalid:ring-destructive/20 hover:aria-invalid:data-unchecked:bg-destructive-background focus-visible:aria-invalid:data-unchecked:bg-destructive-background bg-background dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:focus-visible:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground aria-invalid:data-checked:border-destructive aria-invalid:data-checked:bg-destructive aria-invalid:data-indeterminate:border-destructive aria-invalid:data-indeterminate:bg-destructive dark:data-checked:bg-primary dark:data-indeterminate:bg-primary", className)
658
+ }, props), {}, { children: /* @__PURE__ */ jsxs(Checkbox.Indicator, {
659
+ "data-slot": "checkbox-indicator",
660
+ keepMounted: true,
661
+ className: "group/indicator grid place-content-center text-current transition-none [&>svg]:size-3.5",
662
+ children: [/* @__PURE__ */ jsx(CheckIcon, { className: "hidden group-data-[checked]/indicator:block" }), /* @__PURE__ */ jsx(MinusIcon, { className: "hidden group-data-[indeterminate]/indicator:block" })]
663
+ }) }));
575
664
  });
576
665
  Checkbox$1.displayName = "Checkbox";
577
666
  //#endregion
578
667
  //#region src/components/skeleton.tsx
668
+ const _excluded$1 = ["className"];
579
669
  /**
580
670
  * Pulsing placeholder shown while content is loading. Renders a `<div>`;
581
671
  * set its dimensions via `className` to match the content it stands in for.
@@ -586,13 +676,12 @@ Checkbox$1.displayName = "Checkbox";
586
676
  * ```
587
677
  */
588
678
  const Skeleton = React.forwardRef((componentProps, forwardRef) => {
589
- const { className, ...props } = componentProps;
590
- return /* @__PURE__ */ jsx("div", {
679
+ const { className } = componentProps, props = _objectWithoutProperties(componentProps, _excluded$1);
680
+ return /* @__PURE__ */ jsx("div", _objectSpread2({
591
681
  ref: forwardRef,
592
682
  "data-slot": "skeleton",
593
- className: cn("animate-pulse rounded-md bg-muted", className),
594
- ...props
595
- });
683
+ className: cn("animate-pulse rounded-md bg-muted", className)
684
+ }, props));
596
685
  });
597
686
  Skeleton.displayName = "Skeleton";
598
687
  //#endregion
@@ -633,16 +722,19 @@ function useFetchMoreSentinel(onFetchMore, getRoot, resetKey) {
633
722
  const nodeRef = React.useRef(null);
634
723
  const armedRef = React.useRef(true);
635
724
  const observe = React.useCallback(() => {
636
- observerRef.current?.disconnect();
725
+ var _observerRef$current;
726
+ (_observerRef$current = observerRef.current) === null || _observerRef$current === void 0 || _observerRef$current.disconnect();
637
727
  observerRef.current = null;
638
728
  const node = nodeRef.current;
639
729
  if (!node) return;
640
730
  const root = getRootRef.current(node);
641
731
  const observer = new IntersectionObserver((entries) => {
642
- if (entries[entries.length - 1]?.isIntersecting) {
732
+ var _entries;
733
+ if ((_entries = entries[entries.length - 1]) === null || _entries === void 0 ? void 0 : _entries.isIntersecting) {
643
734
  if (armedRef.current) {
735
+ var _onFetchMoreRef$curre;
644
736
  armedRef.current = false;
645
- onFetchMoreRef.current?.();
737
+ (_onFetchMoreRef$curre = onFetchMoreRef.current) === null || _onFetchMoreRef$curre === void 0 || _onFetchMoreRef$curre.call(onFetchMoreRef);
646
738
  }
647
739
  } else armedRef.current = true;
648
740
  }, {
@@ -663,6 +755,18 @@ function useFetchMoreSentinel(onFetchMore, getRoot, resetKey) {
663
755
  }
664
756
  //#endregion
665
757
  //#region src/components/table.tsx
758
+ const _excluded = [
759
+ "className",
760
+ "containerClassName",
761
+ "containerStyle",
762
+ "containerRef"
763
+ ];
764
+ const _excluded2 = ["className"];
765
+ const _excluded3 = ["className"];
766
+ const _excluded4 = ["className"];
767
+ const _excluded5 = ["className"];
768
+ const _excluded6 = ["className"];
769
+ const _excluded7 = ["className"];
666
770
  /**
667
771
  * Root data table. Renders a `<table>` inside a scrollable, bordered `<div>` container.
668
772
  *
@@ -683,85 +787,78 @@ function useFetchMoreSentinel(onFetchMore, getRoot, resetKey) {
683
787
  * ```
684
788
  */
685
789
  const Table = React.forwardRef((componentProps, forwardRef) => {
686
- const { className, containerClassName, containerStyle, containerRef, ...props } = componentProps;
790
+ const { className, containerClassName, containerStyle, containerRef } = componentProps, props = _objectWithoutProperties(componentProps, _excluded);
687
791
  return /* @__PURE__ */ jsx("div", {
688
792
  ref: containerRef,
689
793
  "data-slot": "table-container",
690
794
  style: containerStyle,
691
795
  className: cn("relative w-full overflow-x-auto rounded-lg border border-border", containerClassName),
692
- children: /* @__PURE__ */ jsx("table", {
796
+ children: /* @__PURE__ */ jsx("table", _objectSpread2({
693
797
  ref: forwardRef,
694
798
  "data-slot": "table",
695
- className: cn("w-full caption-bottom text-sm text-foreground bg-background [&_tbody_tr:last-child]:border-b-0", className),
696
- ...props
697
- })
799
+ className: cn("w-full caption-bottom text-sm text-foreground bg-background [&_tbody_tr:last-child]:border-b-0", className)
800
+ }, props))
698
801
  });
699
802
  });
700
803
  Table.displayName = "Table";
701
804
  /** Table header section. Renders a `<thead>`; place `TableRow`/`TableHead` inside it. */
702
805
  const TableHeader = React.forwardRef((componentProps, forwardRef) => {
703
- const { className, ...props } = componentProps;
704
- return /* @__PURE__ */ jsx("thead", {
806
+ const { className } = componentProps, props = _objectWithoutProperties(componentProps, _excluded2);
807
+ return /* @__PURE__ */ jsx("thead", _objectSpread2({
705
808
  ref: forwardRef,
706
809
  "data-slot": "table-header",
707
- className: cn("bg-background [&_tr]:border-b [&_tr]:hover:bg-transparent", className),
708
- ...props
709
- });
810
+ className: cn("bg-background [&_tr]:border-b [&_tr]:hover:bg-transparent", className)
811
+ }, props));
710
812
  });
711
813
  TableHeader.displayName = "TableHeader";
712
814
  /** Table body section. Renders a `<tbody>` holding the data `TableRow`s. */
713
815
  const TableBody = React.forwardRef((componentProps, forwardRef) => {
714
- const { className, ...props } = componentProps;
715
- return /* @__PURE__ */ jsx("tbody", {
816
+ const { className } = componentProps, props = _objectWithoutProperties(componentProps, _excluded3);
817
+ return /* @__PURE__ */ jsx("tbody", _objectSpread2({
716
818
  ref: forwardRef,
717
819
  "data-slot": "table-body",
718
- className: cn("bg-background [&_tr:last-child]:border-0", className),
719
- ...props
720
- });
820
+ className: cn("bg-background [&_tr:last-child]:border-0", className)
821
+ }, props));
721
822
  });
722
823
  TableBody.displayName = "TableBody";
723
824
  /** Table footer section. Renders a muted `<tfoot>`, e.g. for totals or summary rows. */
724
825
  const TableFooter = React.forwardRef((componentProps, forwardRef) => {
725
- const { className, ...props } = componentProps;
726
- return /* @__PURE__ */ jsx("tfoot", {
826
+ const { className } = componentProps, props = _objectWithoutProperties(componentProps, _excluded4);
827
+ return /* @__PURE__ */ jsx("tfoot", _objectSpread2({
727
828
  ref: forwardRef,
728
829
  "data-slot": "table-footer",
729
- className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0 [&>tr]:hover:bg-transparent", className),
730
- ...props
731
- });
830
+ className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0 [&>tr]:hover:bg-transparent", className)
831
+ }, props));
732
832
  });
733
833
  TableFooter.displayName = "TableFooter";
734
834
  /** A single table row. Renders a `<tr>`; highlights on hover and when `data-state="selected"`. */
735
835
  const TableRow = React.forwardRef((componentProps, forwardRef) => {
736
- const { className, ...props } = componentProps;
737
- return /* @__PURE__ */ jsx("tr", {
836
+ const { className } = componentProps, props = _objectWithoutProperties(componentProps, _excluded5);
837
+ return /* @__PURE__ */ jsx("tr", _objectSpread2({
738
838
  ref: forwardRef,
739
839
  "data-slot": "table-row",
740
- className: cn("border-b transition-colors hover:bg-accent/30 data-[state=selected]:bg-accent/50", className),
741
- ...props
742
- });
840
+ className: cn("border-b transition-colors hover:bg-accent/30 data-[state=selected]:bg-accent/50", className)
841
+ }, props));
743
842
  });
744
843
  TableRow.displayName = "TableRow";
745
844
  /** A header cell. Renders a `<th>` with medium-weight, left-aligned text. */
746
845
  const TableHead = React.forwardRef((componentProps, forwardRef) => {
747
- const { className, ...props } = componentProps;
748
- return /* @__PURE__ */ jsx("th", {
846
+ const { className } = componentProps, props = _objectWithoutProperties(componentProps, _excluded6);
847
+ return /* @__PURE__ */ jsx("th", _objectSpread2({
749
848
  ref: forwardRef,
750
849
  "data-slot": "table-head",
751
- className: cn("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0", className),
752
- ...props
753
- });
850
+ className: cn("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0", className)
851
+ }, props));
754
852
  });
755
853
  TableHead.displayName = "TableHead";
756
854
  /** A data cell. Renders a `<td>` with middle-aligned content. */
757
855
  const TableCell = React.forwardRef((componentProps, forwardRef) => {
758
- const { className, ...props } = componentProps;
759
- return /* @__PURE__ */ jsx("td", {
856
+ const { className } = componentProps, props = _objectWithoutProperties(componentProps, _excluded7);
857
+ return /* @__PURE__ */ jsx("td", _objectSpread2({
760
858
  ref: forwardRef,
761
859
  "data-slot": "table-cell",
762
- className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className),
763
- ...props
764
- });
860
+ className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className)
861
+ }, props));
765
862
  });
766
863
  TableCell.displayName = "TableCell";
767
864
  //#endregion
@@ -779,6 +876,7 @@ function useHorizontalScrollEdges(containerRef, enabled, contentSizeKey) {
779
876
  const [atLeftEdge, setAtLeftEdge] = React.useState(true);
780
877
  const [atRightEdge, setAtRightEdge] = React.useState(true);
781
878
  React.useEffect(() => {
879
+ var _el$querySelector;
782
880
  if (!enabled) {
783
881
  setAtLeftEdge(true);
784
882
  setAtRightEdge(true);
@@ -795,13 +893,13 @@ function useHorizontalScrollEdges(containerRef, enabled, contentSizeKey) {
795
893
  el.addEventListener("scroll", update, { passive: true });
796
894
  window.addEventListener("resize", update);
797
895
  const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(update) : null;
798
- ro?.observe(el);
799
- const content = el.querySelector("[data-slot=\"table\"]") ?? el.firstElementChild;
800
- if (content instanceof HTMLElement && content !== el) ro?.observe(content);
896
+ ro === null || ro === void 0 || ro.observe(el);
897
+ const content = (_el$querySelector = el.querySelector("[data-slot=\"table\"]")) !== null && _el$querySelector !== void 0 ? _el$querySelector : el.firstElementChild;
898
+ if (content instanceof HTMLElement && content !== el) ro === null || ro === void 0 || ro.observe(content);
801
899
  return () => {
802
900
  el.removeEventListener("scroll", update);
803
901
  window.removeEventListener("resize", update);
804
- ro?.disconnect();
902
+ ro === null || ro === void 0 || ro.disconnect();
805
903
  };
806
904
  }, [
807
905
  containerRef,
@@ -825,7 +923,7 @@ const EMPTY_COLUMN_PINNING = {
825
923
  /**
826
924
  * Data grid built on TanStack Table. Renders a `<div>` wrapper around a DS
827
925
  * `<Table>` (`<table>`), driven by `columns` + `data`, with opt-in sorting,
828
- * row selection, column resizing, column pinning (`meta.pin`), virtualization,
926
+ * row selection, column resizing, column pinning (`columnPinning`), virtualization,
829
927
  * infinite scroll, a floating action bar, and loading/empty states.
830
928
  *
831
929
  * @example
@@ -838,30 +936,38 @@ const EMPTY_COLUMN_PINNING = {
838
936
  * ```
839
937
  */
840
938
  function DataTable(componentProps) {
841
- const { columns, data, getRowId, loadingState = "idle", skeletonCount = DEFAULT_SKELETON_COUNT, emptyState, sorting, onSortingChange, columnVisibility, selectionMode = "none", selectedKeys, defaultSelectedKeys, onSelectionChange, disabledKeys, disabledBehavior = "all", actionBar, onFetchMore, hasMore = false, enableColumnResizing = false, fillHeight = false, fixedLayout = false, onRowClick, className } = componentProps;
939
+ var _columnPinning$left$l, _columnPinning$left, _columnPinning$right$, _columnPinning$right, _resolvedColumnPinnin, _resolvedColumnPinnin2, _resolvedColumnPinnin3, _resolvedColumnPinnin4, _componentProps$virtu;
940
+ const { columns, data, getRowId, loadingState = "idle", skeletonCount = DEFAULT_SKELETON_COUNT, emptyState, sorting, onSortingChange, columnVisibility, columnPinning, selectionMode = "none", selectedKeys, defaultSelectedKeys, onSelectionChange, disabledKeys, disabledBehavior = "all", actionBar, onFetchMore, hasMore = false, enableColumnResizing = false, fillHeight = false, fixedLayout = false, onRowClick, className } = componentProps;
842
941
  const sortingEnabled = !!onSortingChange;
843
942
  const selectionEnabled = selectionMode !== "none";
844
943
  const multiSelect = selectionMode === "multiple";
845
- const disabledKeySet = disabledKeys ?? EMPTY_KEYS;
846
- const userColumnPinning = React.useMemo(() => deriveColumnPinning(columns), [columns]);
847
- const hasUserPinnedColumns = (userColumnPinning.left?.length ?? 0) > 0 || (userColumnPinning.right?.length ?? 0) > 0;
944
+ const disabledKeySet = disabledKeys !== null && disabledKeys !== void 0 ? disabledKeys : EMPTY_KEYS;
945
+ const hasUserPinnedColumns = ((_columnPinning$left$l = columnPinning === null || columnPinning === void 0 || (_columnPinning$left = columnPinning.left) === null || _columnPinning$left === void 0 ? void 0 : _columnPinning$left.length) !== null && _columnPinning$left$l !== void 0 ? _columnPinning$left$l : 0) > 0 || ((_columnPinning$right$ = columnPinning === null || columnPinning === void 0 || (_columnPinning$right = columnPinning.right) === null || _columnPinning$right === void 0 ? void 0 : _columnPinning$right.length) !== null && _columnPinning$right$ !== void 0 ? _columnPinning$right$ : 0) > 0;
848
946
  const finalColumns = React.useMemo(() => {
849
947
  if (!selectionEnabled) return columns;
850
- return [makeSelectColumn(multiSelect, { pin: hasUserPinnedColumns }), ...columns];
948
+ return [makeSelectColumn(multiSelect), ...columns];
851
949
  }, [
852
950
  columns,
853
951
  selectionEnabled,
854
- multiSelect,
855
- hasUserPinnedColumns
952
+ multiSelect
856
953
  ]);
857
- const columnPinning = React.useMemo(() => deriveColumnPinning(finalColumns), [finalColumns]);
858
- const hasPinnedColumns = (columnPinning.left?.length ?? 0) > 0 || (columnPinning.right?.length ?? 0) > 0;
954
+ const resolvedColumnPinning = React.useMemo(() => {
955
+ var _columnPinning$left2;
956
+ if (!hasUserPinnedColumns) return EMPTY_COLUMN_PINNING;
957
+ if (!selectionEnabled) return columnPinning !== null && columnPinning !== void 0 ? columnPinning : EMPTY_COLUMN_PINNING;
958
+ return _objectSpread2(_objectSpread2({}, columnPinning), {}, { left: [SELECT_COLUMN_ID, ...(_columnPinning$left2 = columnPinning === null || columnPinning === void 0 ? void 0 : columnPinning.left) !== null && _columnPinning$left2 !== void 0 ? _columnPinning$left2 : []] });
959
+ }, [
960
+ columnPinning,
961
+ hasUserPinnedColumns,
962
+ selectionEnabled
963
+ ]);
964
+ const hasPinnedColumns = ((_resolvedColumnPinnin = (_resolvedColumnPinnin2 = resolvedColumnPinning.left) === null || _resolvedColumnPinnin2 === void 0 ? void 0 : _resolvedColumnPinnin2.length) !== null && _resolvedColumnPinnin !== void 0 ? _resolvedColumnPinnin : 0) > 0 || ((_resolvedColumnPinnin3 = (_resolvedColumnPinnin4 = resolvedColumnPinning.right) === null || _resolvedColumnPinnin4 === void 0 ? void 0 : _resolvedColumnPinnin4.length) !== null && _resolvedColumnPinnin3 !== void 0 ? _resolvedColumnPinnin3 : 0) > 0;
859
965
  const [selectionSet, setSelectionSet] = useControllableState({
860
966
  prop: selectedKeys,
861
967
  defaultProp: defaultSelectedKeys,
862
968
  onChange: onSelectionChange
863
969
  });
864
- const selection = selectionSet ?? EMPTY_KEYS;
970
+ const selection = selectionSet !== null && selectionSet !== void 0 ? selectionSet : EMPTY_KEYS;
865
971
  const rowSelection = React.useMemo(() => {
866
972
  const record = {};
867
973
  for (const key of selection) record[key] = true;
@@ -885,12 +991,7 @@ function DataTable(componentProps) {
885
991
  columnResizeMode: "onChange",
886
992
  onSortingChange,
887
993
  onRowSelectionChange: handleRowSelectionChange,
888
- state: {
889
- ...sorting !== void 0 && { sorting },
890
- rowSelection,
891
- ...hasPinnedColumns && { columnPinning },
892
- ...columnVisibility !== void 0 && { columnVisibility }
893
- }
994
+ state: _objectSpread2(_objectSpread2(_objectSpread2({}, sorting !== void 0 && { sorting }), {}, { rowSelection }, hasPinnedColumns && { columnPinning: resolvedColumnPinning }), columnVisibility !== void 0 && { columnVisibility })
894
995
  });
895
996
  const rows = table.getRowModel().rows;
896
997
  const selectedCount = table.getSelectedRowModel().rows.length;
@@ -909,7 +1010,7 @@ function DataTable(componentProps) {
909
1010
  if (row.getCanSelect()) row.toggleSelected();
910
1011
  } else if (onRowClick) onRowClick(row.original);
911
1012
  };
912
- const virtualizeRows = (componentProps.virtualizeRows ?? false) && fillHeight;
1013
+ const virtualizeRows = ((_componentProps$virtu = componentProps.virtualizeRows) !== null && _componentProps$virtu !== void 0 ? _componentProps$virtu : false) && fillHeight;
913
1014
  const pinWidths = enableColumnResizing || virtualizeRows || fixedLayout || hasPinnedColumns;
914
1015
  const containerRef = React.useRef(null);
915
1016
  const { atLeftEdge, atRightEdge } = useHorizontalScrollEdges(containerRef, hasPinnedColumns, table.getTotalSize());
@@ -924,7 +1025,7 @@ function DataTable(componentProps) {
924
1025
  count: virtualizeRows ? rows.length : 0,
925
1026
  getScrollElement: () => virtualizeRows ? containerRef.current : null,
926
1027
  estimateSize: () => 48,
927
- measureElement: typeof window !== "undefined" && navigator.userAgent.indexOf("Firefox") === -1 ? (el) => el?.getBoundingClientRect().height : void 0,
1028
+ measureElement: typeof window !== "undefined" && navigator.userAgent.indexOf("Firefox") === -1 ? (el) => el === null || el === void 0 ? void 0 : el.getBoundingClientRect().height : void 0,
928
1029
  overscan: 5
929
1030
  });
930
1031
  const virtualItems = virtualizeRows ? rowVirtualizer.getVirtualItems() : null;
@@ -1107,7 +1208,7 @@ function SelectRowCell({ row }) {
1107
1208
  })
1108
1209
  });
1109
1210
  }
1110
- function makeSelectColumn(multiSelect, options) {
1211
+ function makeSelectColumn(multiSelect) {
1111
1212
  return {
1112
1213
  id: SELECT_COLUMN_ID,
1113
1214
  header: multiSelect ? ({ table }) => /* @__PURE__ */ jsx(SelectAllHeader, { table }) : () => null,
@@ -1115,8 +1216,7 @@ function makeSelectColumn(multiSelect, options) {
1115
1216
  enableSorting: false,
1116
1217
  enableHiding: false,
1117
1218
  enableResizing: false,
1118
- size: 40,
1119
- ...options?.pin ? { meta: { pin: "left" } } : {}
1219
+ size: 40
1120
1220
  };
1121
1221
  }
1122
1222
  function ResizeHandle({ header }) {
@@ -1144,37 +1244,6 @@ function SortableHeader({ header }) {
1144
1244
  });
1145
1245
  }
1146
1246
  /**
1147
- * Resolves a TanStack column id the same way the table does
1148
- * (`id` → `accessorKey` → string `header`). See `@tanstack/table-core`
1149
- * `createColumn`.
1150
- */
1151
- function getColumnDefId(col) {
1152
- if (col.id != null) return col.id;
1153
- if ("accessorKey" in col && typeof col.accessorKey === "string") return col.accessorKey.replace(/\./g, "_");
1154
- if (typeof col.header === "string") return col.header;
1155
- }
1156
- /** Builds TanStack `columnPinning` state from declarative `meta.pin` on column defs. */
1157
- function deriveColumnPinning(columns) {
1158
- const left = [];
1159
- const right = [];
1160
- for (const col of columns) {
1161
- const pin = col.meta?.pin;
1162
- if (!pin) continue;
1163
- const id = getColumnDefId(col);
1164
- if (!id) {
1165
- console.warn("[DataTable] Column with `meta.pin` has no resolvable id. Set `id`, a string `accessorKey`, or a string `header` so pinning can apply.");
1166
- continue;
1167
- }
1168
- if (pin === "left") left.push(id);
1169
- else right.push(id);
1170
- }
1171
- if (left.length === 0 && right.length === 0) return EMPTY_COLUMN_PINNING;
1172
- return {
1173
- left,
1174
- right
1175
- };
1176
- }
1177
- /**
1178
1247
  * Position/size/shadow props for a pinned (or width-pinned) cell. Uses CSS
1179
1248
  * `position: sticky` under the hood (TanStack column-pinning pattern). Edge
1180
1249
  * inset shadows only render on the outermost pinned column per side, and only
@@ -1217,4 +1286,4 @@ function SkeletonRows({ columns, count, getCellPinProps, groupRows }) {
1217
1286
  }, `skeleton-${i}`)) });
1218
1287
  }
1219
1288
  //#endregion
1220
- export { Button$1 as C, cn as E, registerI18nNamespace as S, linkStyle as T, ActionBarHeight as _, TableFooter as a, detectInitialLanguage as b, TableRow as c, Checkbox$1 as d, Spinner as f, ActionBarContext as g, ActionBarButton as h, TableCell as i, useFetchMoreSentinel as l, ActionBar as m, Table as n, TableHead as o, spinnerVariants as p, TableBody as r, TableHeader as s, DataTable as t, Skeleton as u, useDsTranslation as v, buttonVariants as w, dsI18n as x, SUPPORTED_LANGUAGES as y };
1289
+ export { Button$1 as C, _objectWithoutProperties as D, _objectSpread2 as E, cn as O, registerI18nNamespace as S, linkStyle as T, ActionBarHeight as _, TableFooter as a, detectInitialLanguage as b, TableRow as c, Checkbox$1 as d, Spinner as f, ActionBarContext as g, ActionBarButton as h, TableCell as i, useFetchMoreSentinel as l, ActionBar as m, Table as n, TableHead as o, spinnerVariants as p, TableBody as r, TableHeader as s, DataTable as t, Skeleton as u, useDsTranslation as v, buttonVariants as w, dsI18n as x, SUPPORTED_LANGUAGES as y };