@sth87/shadcn-design-system 0.2.1 → 0.2.2

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 (27) hide show
  1. package/dist/AI_CONTEXT.md +2 -0
  2. package/dist/cjs/components/Select/Select.cjs +1 -1
  3. package/dist/cjs/components/Table/data-table-column-header.cjs +1 -1
  4. package/dist/cjs/components/Table/data-table.cjs +1 -1
  5. package/dist/cjs/packages/ui/src/components/combobox.cjs +1 -1
  6. package/dist/cjs/packages/ui/src/components/select.cjs +1 -1
  7. package/dist/cjs/packages/ui/src/components/table.cjs +1 -1
  8. package/dist/cjs/styles/index.css +1 -1
  9. package/dist/esm/components/Select/Select.js +86 -80
  10. package/dist/esm/components/Table/data-table-column-header.js +50 -25
  11. package/dist/esm/components/Table/data-table.js +77 -55
  12. package/dist/esm/packages/ui/src/components/combobox.js +52 -47
  13. package/dist/esm/packages/ui/src/components/select.js +121 -116
  14. package/dist/esm/packages/ui/src/components/table.js +23 -14
  15. package/dist/esm/styles/index.css +1 -1
  16. package/dist/types/components/Select/Select.d.ts +4 -0
  17. package/dist/types/components/Select/Select.d.ts.map +1 -1
  18. package/dist/types/components/Table/data-table-column-header.d.ts.map +1 -1
  19. package/dist/types/components/Table/data-table.d.ts +5 -0
  20. package/dist/types/components/Table/data-table.d.ts.map +1 -1
  21. package/dist/types/packages/ui/src/components/combobox.d.ts +3 -1
  22. package/dist/types/packages/ui/src/components/combobox.d.ts.map +1 -1
  23. package/dist/types/packages/ui/src/components/select.d.ts +3 -1
  24. package/dist/types/packages/ui/src/components/select.d.ts.map +1 -1
  25. package/dist/types/packages/ui/src/components/table.d.ts +4 -1
  26. package/dist/types/packages/ui/src/components/table.d.ts.map +1 -1
  27. package/package.json +1 -1
@@ -1,82 +1,84 @@
1
- import { jsx as s, jsxs as m, Fragment as Z } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as m, Fragment as B } from "react/jsx-runtime";
2
2
  import a from "react";
3
- import { MultiSelect as $, MultiSelectTrigger as B, MultiSelectValue as R, MultiSelectContent as q, MultiSelectGroup as F, MultiSelectItem as T, MultiSelectSeparator as z } from "../../packages/ui/src/components/select.js";
4
- import { Combobox as L } from "../../packages/ui/src/components/combobox.js";
5
- import { cn as o } from "../../packages/ui/src/lib/utils.js";
6
- import { FloatingLabel as A } from "../FloatLabel.js";
7
- import { Info as ee } from "lucide-react";
8
- import { Tooltip as se } from "../Tooltip/Tooltip.js";
9
- import { Label as de } from "../../packages/ui/src/components/label.js";
10
- const re = a.forwardRef(
3
+ import { MultiSelect as R, MultiSelectTrigger as q, MultiSelectValue as F, MultiSelectContent as z, MultiSelectGroup as L, MultiSelectItem as J, MultiSelectSeparator as ee } from "../../packages/ui/src/components/select.js";
4
+ import { Combobox as se } from "../../packages/ui/src/components/combobox.js";
5
+ import { cn as f } from "../../packages/ui/src/lib/utils.js";
6
+ import { FloatingLabel as K } from "../FloatLabel.js";
7
+ import { Info as re } from "lucide-react";
8
+ import { Tooltip as de } from "../Tooltip/Tooltip.js";
9
+ import { Label as le } from "../../packages/ui/src/components/label.js";
10
+ const te = a.forwardRef(
11
11
  ({
12
12
  className: N,
13
13
  label: x,
14
14
  helperText: w,
15
15
  state: u = "default",
16
- size: r = "normal",
16
+ size: d = "normal",
17
17
  isFloatLabel: t,
18
- infoTooltip: f,
18
+ infoTooltip: o,
19
19
  clearable: y = !1,
20
20
  placeholder: b = "",
21
21
  options: g = [],
22
22
  tagRender: n,
23
23
  multiple: S = !1,
24
24
  value: c,
25
- defaultValue: D,
25
+ defaultValue: P,
26
26
  onValueChange: I,
27
- values: J,
27
+ values: Q,
28
28
  defaultValues: v,
29
29
  onValuesChange: j,
30
30
  search: p,
31
31
  onSearchChange: k,
32
32
  shouldFilter: C,
33
- clickToRemove: K = !0,
34
- overflowBehavior: P = "wrap-when-open",
35
- disabled: E,
33
+ loading: E = !1,
34
+ loadingText: V,
35
+ clickToRemove: T = !0,
36
+ overflowBehavior: U = "wrap-when-open",
37
+ disabled: _,
36
38
  onChange: h,
37
- onFocus: V,
38
- onBlur: _,
39
+ onFocus: G,
40
+ onBlur: H,
39
41
  required: M
40
- }, Q) => {
41
- const i = a.useId(), [G, H] = a.useState(
42
- c ?? D ?? ""
42
+ }, W) => {
43
+ const i = a.useId(), [O, A] = a.useState(
44
+ c ?? P ?? ""
43
45
  );
44
46
  a.useEffect(() => {
45
- !S && c !== void 0 && H(c);
47
+ !S && c !== void 0 && A(c);
46
48
  }, [S, c]);
47
- const U = a.useCallback(
48
- (d) => {
49
- const l = d || "";
50
- c === void 0 && H(l), I?.(l), h?.(l);
49
+ const X = a.useCallback(
50
+ (r) => {
51
+ const l = r || "";
52
+ c === void 0 && A(l), I?.(l), h?.(l);
51
53
  },
52
54
  [I, h, c]
53
- ), W = a.useCallback(
54
- (d) => {
55
- j?.(d), h?.(d);
55
+ ), Y = a.useCallback(
56
+ (r) => {
57
+ j?.(r), h?.(r);
56
58
  },
57
59
  [j, h]
58
- ), X = {
60
+ ), Z = {
59
61
  default: "ds:text-muted-foreground",
60
62
  success: "ds:text-success",
61
63
  warning: "ds:text-warning",
62
64
  error: "ds:text-error"
63
- }, O = t ? r === "xl" || r === "lg" ? r : "xl" : r, Y = a.useMemo(() => {
64
- const d = /* @__PURE__ */ new Map();
65
+ }, D = t ? d === "xl" || d === "lg" ? d : "xl" : d, $ = a.useMemo(() => {
66
+ const r = /* @__PURE__ */ new Map();
65
67
  return g.forEach((l) => {
66
68
  const e = l.group;
67
- d.has(e) || d.set(e, []), d.get(e).push(l);
68
- }), d;
69
+ r.has(e) || r.set(e, []), r.get(e).push(l);
70
+ }), r;
69
71
  }, [g]);
70
72
  return /* @__PURE__ */ s("div", { className: N, children: /* @__PURE__ */ m(
71
73
  "div",
72
74
  {
73
- ref: Q,
74
- className: o("ds:flex ds:flex-col ds:gap-1.5 ds:relative", {
75
+ ref: W,
76
+ className: f("ds:flex ds:flex-col ds:gap-1.5 ds:relative", {
75
77
  "ds:floating-label ds:relative": t
76
78
  }),
77
79
  children: [
78
80
  !t && x && /* @__PURE__ */ m(
79
- de,
81
+ le,
80
82
  {
81
83
  htmlFor: i,
82
84
  className: "ds:flex ds:gap-2 ds:text-sm ds:font-medium ds:leading-none ds:peer-disabled:cursor-not-allowed ds:peer-disabled:opacity-70",
@@ -85,63 +87,65 @@ const re = a.forwardRef(
85
87
  x,
86
88
  M && /* @__PURE__ */ s("span", { className: "ds:text-error ds:ml-0.5", children: "*" })
87
89
  ] }),
88
- f && /* @__PURE__ */ s(se, { content: f, children: /* @__PURE__ */ s(ee, { className: "ds:size-3.5 ds:min-w-3.5" }) })
90
+ o && /* @__PURE__ */ s(de, { content: o, children: /* @__PURE__ */ s(re, { className: "ds:size-3.5 ds:min-w-3.5" }) })
89
91
  ]
90
92
  }
91
93
  ),
92
94
  /* @__PURE__ */ s("div", { className: "ds:relative", children: S ? (
93
95
  // Multi Mode
94
96
  /* @__PURE__ */ m(
95
- $,
97
+ R,
96
98
  {
97
- values: J,
99
+ values: Q,
98
100
  defaultValues: typeof v == "string" ? [v] : v,
99
- onValuesChange: W,
101
+ onValuesChange: Y,
100
102
  children: [
101
103
  /* @__PURE__ */ s(
102
- B,
104
+ q,
103
105
  {
104
106
  id: i,
105
- disabled: E,
106
- className: o(
107
+ disabled: _,
108
+ className: f(
107
109
  "ds:peer ds:w-full",
108
110
  {
109
- "ds:pt-5 ds:pb-1": t && r !== "lg"
111
+ "ds:pt-5 ds:pb-1": t && d !== "lg"
110
112
  },
111
113
  N
112
114
  ),
113
- size: O,
115
+ size: D,
114
116
  state: u,
115
- onFocus: V,
116
- onBlur: _,
117
+ onFocus: G,
118
+ onBlur: H,
117
119
  children: /* @__PURE__ */ s(
118
- R,
120
+ F,
119
121
  {
120
122
  placeholder: b,
121
- clickToRemove: K && y,
122
- overflowBehavior: P
123
+ clickToRemove: T && y,
124
+ overflowBehavior: U
123
125
  }
124
126
  )
125
127
  }
126
128
  ),
127
129
  t && /* @__PURE__ */ s(
128
- A,
130
+ K,
129
131
  {
130
132
  htmlFor: i,
131
- size: r,
132
- infoTooltip: f,
133
+ size: d,
134
+ infoTooltip: o,
133
135
  required: M
134
136
  }
135
137
  ),
136
138
  /* @__PURE__ */ s(
137
- q,
139
+ z,
138
140
  {
139
141
  search: p,
140
142
  onSearchChange: k,
141
143
  shouldFilter: C,
142
- children: [...Y.entries()].map(([d, l]) => d ? /* @__PURE__ */ m(a.Fragment, { children: [
143
- /* @__PURE__ */ s(F, { heading: d, children: l.map((e) => /* @__PURE__ */ s(
144
- T,
144
+ loading: E,
145
+ loadingText: V,
146
+ children: [...$.entries()].map(([r, l]) => r ? /* @__PURE__ */ m(a.Fragment, { children: [
147
+ /* @__PURE__ */ s(L, { heading: r, children: l.map((e) => /* @__PURE__ */ s(
148
+ J,
145
149
  {
146
150
  value: e.value,
147
151
  disabled: e?.disabled,
@@ -151,9 +155,9 @@ const re = a.forwardRef(
151
155
  },
152
156
  e.value
153
157
  )) }),
154
- /* @__PURE__ */ s(z, {})
155
- ] }, d) : l.map((e) => /* @__PURE__ */ s(
156
- T,
158
+ /* @__PURE__ */ s(ee, {})
159
+ ] }, r) : l.map((e) => /* @__PURE__ */ s(
160
+ J,
157
161
  {
158
162
  value: e.value,
159
163
  disabled: e?.disabled,
@@ -170,46 +174,48 @@ const re = a.forwardRef(
170
174
  )
171
175
  ) : (
172
176
  // Single Mode
173
- /* @__PURE__ */ m(Z, { children: [
177
+ /* @__PURE__ */ m(B, { children: [
174
178
  /* @__PURE__ */ s(
175
- L,
179
+ se,
176
180
  {
177
- value: c ?? G,
181
+ value: c ?? O,
178
182
  options: g,
179
183
  placeHolder: b,
180
184
  emptyText: typeof p == "object" ? p.emptyMessage : "No results found",
181
- onChange: U,
185
+ onChange: X,
182
186
  clearable: y,
183
- disabled: E,
187
+ disabled: _,
184
188
  id: i,
185
- className: o(
189
+ className: f(
186
190
  "ds:peer ds:w-full ds:justify-start",
187
191
  {
188
- "ds:pt-5 ds:pb-1": t && r !== "lg"
192
+ "ds:pt-5 ds:pb-1": t && d !== "lg"
189
193
  }
190
194
  // className,
191
195
  ),
192
- size: O,
196
+ size: D,
193
197
  state: u,
194
- dropdownClassName: o("ds:opacity-40", {
195
- "ds:translate-y-[-8px]": t && r !== "lg"
198
+ dropdownClassName: f("ds:opacity-40", {
199
+ "ds:translate-y-[-8px]": t && d !== "lg"
196
200
  }),
197
201
  searchable: !!p,
198
202
  onSearchChange: k,
199
203
  shouldFilter: C,
204
+ loading: E,
205
+ loadingText: V,
200
206
  tagRender: n,
201
- onFocus: V,
202
- onBlur: _
207
+ onFocus: G,
208
+ onBlur: H
203
209
  }
204
210
  ),
205
211
  t && /* @__PURE__ */ s(
206
- A,
212
+ K,
207
213
  {
208
214
  htmlFor: i,
209
- size: r,
210
- infoTooltip: f,
215
+ size: d,
216
+ infoTooltip: o,
211
217
  required: M,
212
- shouldFloat: !!(c ?? G),
218
+ shouldFloat: !!(c ?? O),
213
219
  className: "ds:pointer-events-none",
214
220
  children: x
215
221
  }
@@ -219,7 +225,7 @@ const re = a.forwardRef(
219
225
  w && /* @__PURE__ */ s(
220
226
  "p",
221
227
  {
222
- className: o("ds:text-xs", u ? X[u] : ""),
228
+ className: f("ds:text-xs", u ? Z[u] : ""),
223
229
  children: w
224
230
  }
225
231
  )
@@ -228,7 +234,7 @@ const re = a.forwardRef(
228
234
  ) });
229
235
  }
230
236
  );
231
- re.displayName = "Select";
237
+ te.displayName = "Select";
232
238
  export {
233
- re as default
239
+ te as default
234
240
  };
@@ -1,22 +1,22 @@
1
- import { jsx as s, jsxs as a } from "react/jsx-runtime";
2
- import { ChevronDown as o, ChevronUp as n, ChevronsUpDown as p, Filter as f, X as h, EyeOff as v } from "lucide-react";
1
+ import { jsx as s, jsxs as n } from "react/jsx-runtime";
2
+ import { ChevronDown as o, ChevronUp as g, ChevronsUpDown as h, Filter as v, X as k, EyeOff as u, Pin as l, PinOff as y } from "lucide-react";
3
3
  import { cn as r } from "../../packages/ui/src/lib/utils.js";
4
- import m from "../DropdownMenu/DropdownMenu.js";
5
- import { DataTableFilterPopover as u } from "./TableFilter/data-table-filter-popover.js";
4
+ import C from "../DropdownMenu/DropdownMenu.js";
5
+ import { DataTableFilterPopover as m } from "./TableFilter/data-table-filter-popover.js";
6
6
  import b from "../Button/Button.js";
7
- function _({
7
+ function F({
8
8
  column: e,
9
- label: g,
9
+ label: p,
10
10
  className: d
11
11
  }) {
12
- const i = g || (typeof e.columnDef.header == "string" ? e.columnDef.header : null);
13
- if (!(e.getCanSort() || e.getCanHide() || e.getCanFilter()))
14
- return /* @__PURE__ */ s("div", { className: r(d), children: i });
15
- const l = /* @__PURE__ */ a("button", { className: "ds:-ml-1.5 ds:flex ds:h-8 ds:items-center ds:gap-1.5 ds:rounded-md ds:px-2 ds:py-1.5 ds:hover:bg-accent ds:focus:outline-none ds:focus:ring-1 ds:focus:ring-ring ds:data-[state=open]:bg-accent ds:[&_svg]:size-4 ds:[&_svg]:shrink-0 ds:[&_svg]:text-muted-foreground", children: [
16
- i,
17
- e.getCanSort() && (e.getIsSorted() === "desc" ? /* @__PURE__ */ s(o, {}) : e.getIsSorted() === "asc" ? /* @__PURE__ */ s(n, {}) : /* @__PURE__ */ s(p, {}))
18
- ] }), c = e.getCanFilter() && e.columnDef.meta?.variant ? /* @__PURE__ */ s(
19
- u,
12
+ const a = p || (typeof e.columnDef.header == "string" ? e.columnDef.header : null);
13
+ if (!(e.getCanSort() || e.getCanHide() || e.getCanFilter() || e.getCanPin()))
14
+ return /* @__PURE__ */ s("div", { className: r(d), children: a });
15
+ const c = /* @__PURE__ */ n("button", { className: "ds:-ml-1.5 ds:flex ds:h-8 ds:items-center ds:gap-1.5 ds:rounded-md ds:px-2 ds:py-1.5 ds:hover:bg-accent ds:focus:outline-none ds:focus:ring-1 ds:focus:ring-ring ds:data-[state=open]:bg-accent ds:[&_svg]:size-4 ds:[&_svg]:shrink-0 ds:[&_svg]:text-muted-foreground", children: [
16
+ a,
17
+ e.getCanSort() && (e.getIsSorted() === "desc" ? /* @__PURE__ */ s(o, {}) : e.getIsSorted() === "asc" ? /* @__PURE__ */ s(g, {}) : /* @__PURE__ */ s(h, {}))
18
+ ] }), f = e.getCanFilter() && e.columnDef.meta?.variant ? /* @__PURE__ */ s(
19
+ m,
20
20
  {
21
21
  column: e,
22
22
  trigger: /* @__PURE__ */ s(
@@ -27,16 +27,16 @@ function _({
27
27
  "ds:hover:bg-accent ds:rounded ds:p-1",
28
28
  e.getFilterValue() ? "ds:text-primary" : ""
29
29
  ),
30
- children: /* @__PURE__ */ s(f, { className: "ds:size-4" })
30
+ children: /* @__PURE__ */ s(v, { className: "ds:size-4" })
31
31
  }
32
32
  )
33
33
  }
34
34
  ) : null, t = [];
35
- return e.getCanSort() && (t.push({
35
+ if (e.getCanSort() && (t.push({
36
36
  key: "asc",
37
37
  type: "checkbox",
38
38
  label: "Asc",
39
- icon: /* @__PURE__ */ s(n, {}),
39
+ icon: /* @__PURE__ */ s(g, {}),
40
40
  checked: e.getIsSorted() === "asc",
41
41
  onClick: () => e.toggleSorting(!1),
42
42
  className: "ds:relative ds:pr-8 ds:pl-2 ds:[&>span:first-child]:right-2 ds:[&>span:first-child]:left-auto ds:[&_svg]:text-muted-foreground"
@@ -52,30 +52,55 @@ function _({
52
52
  key: "reset",
53
53
  type: "item",
54
54
  label: "Reset",
55
- icon: /* @__PURE__ */ s(h, {}),
55
+ icon: /* @__PURE__ */ s(k, {}),
56
56
  onClick: () => e.clearSorting(),
57
57
  className: "ds:pl-2 ds:[&_svg]:text-muted-foreground"
58
58
  })), e.getCanHide() && t.push({
59
59
  key: "hide",
60
60
  type: "checkbox",
61
61
  label: "Hide",
62
- icon: /* @__PURE__ */ s(v, {}),
62
+ icon: /* @__PURE__ */ s(u, {}),
63
63
  checked: !e.getIsVisible(),
64
64
  onClick: () => e.toggleVisibility(!1),
65
65
  className: "ds:relative ds:pr-8 ds:pl-2 ds:[&>span:first-child]:right-2 ds:[&>span:first-child]:left-auto ds:[&_svg]:text-muted-foreground"
66
- }), /* @__PURE__ */ a("div", { className: r("ds:flex ds:items-center ds:gap-1.5", d), children: [
66
+ }), e.getCanPin()) {
67
+ const i = e.getIsPinned();
68
+ t.length > 0 && t.push({ key: "pin-separator", type: "separator" }), i !== "left" && t.push({
69
+ key: "pin-left",
70
+ type: "item",
71
+ label: "Pin left",
72
+ icon: /* @__PURE__ */ s(l, {}),
73
+ onClick: () => e.pin("left"),
74
+ className: "ds:pl-2 ds:[&_svg]:text-muted-foreground"
75
+ }), i !== "right" && t.push({
76
+ key: "pin-right",
77
+ type: "item",
78
+ label: "Pin right",
79
+ icon: /* @__PURE__ */ s(l, {}),
80
+ onClick: () => e.pin("right"),
81
+ className: "ds:pl-2 ds:[&_svg]:text-muted-foreground"
82
+ }), i && t.push({
83
+ key: "unpin",
84
+ type: "item",
85
+ label: "Unpin",
86
+ icon: /* @__PURE__ */ s(y, {}),
87
+ onClick: () => e.pin(!1),
88
+ className: "ds:pl-2 ds:[&_svg]:text-muted-foreground"
89
+ });
90
+ }
91
+ return /* @__PURE__ */ n("div", { className: r("ds:flex ds:items-center ds:gap-1.5", d), children: [
67
92
  /* @__PURE__ */ s(
68
- m,
93
+ C,
69
94
  {
70
- trigger: l,
95
+ trigger: c,
71
96
  items: t,
72
97
  align: "start",
73
- contentClassName: "ds:w-28"
98
+ contentClassName: "ds:w-36"
74
99
  }
75
100
  ),
76
- c
101
+ f
77
102
  ] });
78
103
  }
79
104
  export {
80
- _ as DataTableColumnHeader
105
+ F as DataTableColumnHeader
81
106
  };
@@ -1,100 +1,122 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { flexRender as a } from "@tanstack/react-table";
1
+ import { jsxs as c, jsx as l } from "react/jsx-runtime";
2
+ import { flexRender as f } from "@tanstack/react-table";
3
3
  import { DataTablePagination as x } from "./data-table-pagination.js";
4
- import { cn as u } from "../../packages/ui/src/lib/utils.js";
5
- import { Table as b, TableHeader as w, TableRow as n, TableHead as T, TableBody as C, TableCell as t } from "../../packages/ui/src/components/table.js";
6
- import { getCommonPinningStyles as f } from "../../utils/data-table.js";
7
- import { DataTableColumnHeader as y } from "./data-table-column-header.js";
8
- function k({
4
+ import { cn as b } from "../../packages/ui/src/lib/utils.js";
5
+ import { Table as S, TableHeader as v, TableRow as s, TableHead as C, TableBody as T, TableCell as i } from "../../packages/ui/src/components/table.js";
6
+ import { getCommonPinningStyles as g } from "../../utils/data-table.js";
7
+ import { DataTableColumnHeader as k } from "./data-table-column-header.js";
8
+ function I({
9
9
  table: o,
10
- actionBar: c,
11
- children: g,
10
+ actionBar: a,
11
+ children: h,
12
12
  className: p,
13
- pagination: s = !0,
14
- sticky: D,
15
- bordered: S,
13
+ pagination: n = !0,
14
+ sticky: d = !0,
15
+ bordered: H,
16
16
  loading: m,
17
- footer: i,
18
- ...h
17
+ footer: u,
18
+ ...w
19
19
  }) {
20
- return /* @__PURE__ */ r(
20
+ const t = d ? {
21
+ offsetHeader: typeof d == "object" ? d.offsetHeader ?? 0 : 0,
22
+ offsetScroll: typeof d == "object" ? d.offsetScroll : void 0
23
+ } : null;
24
+ return /* @__PURE__ */ c(
21
25
  "div",
22
26
  {
23
- className: u(
27
+ className: b(
24
28
  "ds:flex ds:w-full ds:flex-col ds:gap-2.5 ds:relative",
25
29
  p
26
30
  ),
27
- ...h,
31
+ ...w,
28
32
  children: [
29
- g,
30
- m && /* @__PURE__ */ e("div", { className: "ds:absolute ds:inset-0 ds:bg-background/50 ds:flex ds:items-center ds:justify-center ds:z-20", children: "Loading..." }),
31
- /* @__PURE__ */ e(
32
- "div",
33
+ h,
34
+ m && /* @__PURE__ */ l("div", { className: "ds:absolute ds:inset-0 ds:bg-background/50 ds:flex ds:items-center ds:justify-center ds:z-20", children: "Loading..." }),
35
+ /* @__PURE__ */ c(
36
+ S,
33
37
  {
34
- className: u(
35
- "ds:overflow-auto ds:rounded-md ds:border ds:border-border",
38
+ containerClassName: b(
39
+ "ds:rounded-md ds:border ds:border-border",
40
+ // Thin, unobtrusive scrollbar that darkens only when hovering the thumb itself
41
+ "ds:[scrollbar-width:thin] ds:[scrollbar-color:var(--border)_transparent]",
42
+ "ds:[&::-webkit-scrollbar]:h-1.5 ds:[&::-webkit-scrollbar]:w-1.5",
43
+ "ds:[&::-webkit-scrollbar-track]:bg-transparent",
44
+ "ds:[&::-webkit-scrollbar-thumb]:rounded-full ds:[&::-webkit-scrollbar-thumb]:bg-border",
45
+ "ds:[&::-webkit-scrollbar-thumb:hover]:bg-muted-foreground",
36
46
  m && "ds:blur-sm"
37
47
  ),
38
- children: /* @__PURE__ */ r(b, { children: [
39
- /* @__PURE__ */ e(w, { children: o.getHeaderGroups().map((d) => /* @__PURE__ */ e(n, { children: d.headers.map((l) => /* @__PURE__ */ e(
40
- T,
48
+ containerStyle: t ? {
49
+ maxHeight: `calc(100vh - ${t.offsetScroll ?? 0}px)`
50
+ } : void 0,
51
+ children: [
52
+ /* @__PURE__ */ l(v, { children: o.getHeaderGroups().map((r) => /* @__PURE__ */ l(s, { children: r.headers.map((e) => /* @__PURE__ */ l(
53
+ C,
41
54
  {
42
- colSpan: l.colSpan,
55
+ colSpan: e.colSpan,
43
56
  style: {
44
- ...f({ column: l.column })
57
+ ...g({
58
+ column: e.column,
59
+ withBorder: !0
60
+ }),
61
+ ...t && {
62
+ position: "sticky",
63
+ top: t.offsetHeader,
64
+ zIndex: e.column.getIsPinned() ? 3 : 2,
65
+ background: "var(--background)"
66
+ }
45
67
  },
46
- children: l.isPlaceholder ? null : l.column.columnDef.header ? typeof l.column.columnDef.header == "function" ? a(
47
- l.column.columnDef.header,
48
- l.getContext()
49
- ) : /* @__PURE__ */ e(y, { column: l.column }) : null
68
+ children: e.isPlaceholder ? null : e.column.columnDef.header ? typeof e.column.columnDef.header == "function" ? f(
69
+ e.column.columnDef.header,
70
+ e.getContext()
71
+ ) : /* @__PURE__ */ l(k, { column: e.column }) : null
50
72
  },
51
- l.id
52
- )) }, d.id)) }),
53
- /* @__PURE__ */ e(C, { children: o.getRowModel().rows?.length ? o.getRowModel().rows.map((d) => /* @__PURE__ */ e(
54
- n,
73
+ e.id
74
+ )) }, r.id)) }),
75
+ /* @__PURE__ */ l(T, { children: o.getRowModel().rows?.length ? o.getRowModel().rows.map((r) => /* @__PURE__ */ l(
76
+ s,
55
77
  {
56
- "data-state": d.getIsSelected() && "selected",
57
- children: d.getVisibleCells().map((l) => /* @__PURE__ */ e(
58
- t,
78
+ "data-state": r.getIsSelected() && "selected",
79
+ children: r.getVisibleCells().map((e) => /* @__PURE__ */ l(
80
+ i,
59
81
  {
60
82
  style: {
61
- ...f({ column: l.column })
83
+ ...g({
84
+ column: e.column,
85
+ withBorder: !0
86
+ })
62
87
  },
63
- children: a(
64
- l.column.columnDef.cell,
65
- l.getContext()
66
- )
88
+ children: f(e.column.columnDef.cell, e.getContext())
67
89
  },
68
- l.id
90
+ e.id
69
91
  ))
70
92
  },
71
- d.id
72
- )) : /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(
73
- t,
93
+ r.id
94
+ )) : /* @__PURE__ */ l(s, { children: /* @__PURE__ */ l(
95
+ i,
74
96
  {
75
97
  colSpan: o.getAllColumns().length,
76
98
  className: "ds:h-24 ds:text-center",
77
99
  children: "No results."
78
100
  }
79
101
  ) }) }),
80
- i && /* @__PURE__ */ e("tfoot", { children: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(t, { colSpan: o.getAllColumns().length, children: i(o.getRowModel().rows.map((d) => d.original)) }) }) })
81
- ] })
102
+ u && /* @__PURE__ */ l("tfoot", { children: /* @__PURE__ */ l(s, { children: /* @__PURE__ */ l(i, { colSpan: o.getAllColumns().length, children: u(o.getRowModel().rows.map((r) => r.original)) }) }) })
103
+ ]
82
104
  }
83
105
  ),
84
- /* @__PURE__ */ r("div", { className: "ds:flex ds:flex-col ds:gap-2.5", children: [
85
- s && /* @__PURE__ */ e(
106
+ /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-2.5", children: [
107
+ n && /* @__PURE__ */ l(
86
108
  x,
87
109
  {
88
110
  table: o,
89
- ...s === !0 ? {} : s
111
+ ...n === !0 ? {} : n
90
112
  }
91
113
  ),
92
- c && o.getFilteredSelectedRowModel().rows.length > 0 && c
114
+ a && o.getFilteredSelectedRowModel().rows.length > 0 && a
93
115
  ] })
94
116
  ]
95
117
  }
96
118
  );
97
119
  }
98
120
  export {
99
- k as DataTable
121
+ I as DataTable
100
122
  };