@sth87/shadcn-design-system 0.2.3 → 0.2.5

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 (52) hide show
  1. package/AI_README.md +131 -131
  2. package/README.md +547 -547
  3. package/dist/AI_CONTEXT.md +2506 -2506
  4. package/dist/cjs/components/Checkbox/Checkbox.cjs +1 -1
  5. package/dist/cjs/components/DatePicker/DatePicker.cjs +1 -1
  6. package/dist/cjs/components/DatePicker/RangePicker.cjs +1 -1
  7. package/dist/cjs/components/DatePicker/TimePicker.cjs +1 -1
  8. package/dist/cjs/components/Table/TableFilter/data-table-date-filter.cjs +1 -1
  9. package/dist/cjs/components/Table/TableFilter/data-table-filter-popover.cjs +1 -1
  10. package/dist/cjs/components/Table/TableFilter/data-table-slider-filter.cjs +1 -1
  11. package/dist/cjs/components/Table/data-table-pagination.cjs +1 -1
  12. package/dist/cjs/components/Table/data-table-toolbar.cjs +1 -1
  13. package/dist/cjs/components/Table/data-table-view-options.cjs +1 -1
  14. package/dist/cjs/components/Table/data-table.cjs +1 -1
  15. package/dist/cjs/index.cjs +1 -1
  16. package/dist/cjs/node_modules/.pnpm/{@dnd-kit_core@6.3.1_react-dom@19.1.1_react@19.1.1__react@19.1.1 → @dnd-kit_core@6.3.1_react-d_4aa55f773ec51751575225d6fce068db}/node_modules/@dnd-kit/core/dist/core.esm.cjs +1 -1
  17. package/dist/cjs/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@d_3f5c0d7c14b28ec4620c9987407d5443/node_modules/@dnd-kit/sortable/dist/sortable.esm.cjs +1 -0
  18. package/dist/cjs/packages/ui/src/components/table.cjs +1 -1
  19. package/dist/cjs/styles/index.css +1 -1
  20. package/dist/cjs/utils/data-table.cjs +1 -1
  21. package/dist/cjs/utils/parsers.cjs +1 -1
  22. package/dist/esm/components/Checkbox/Checkbox.js +6 -6
  23. package/dist/esm/components/DatePicker/DatePicker.js +13 -13
  24. package/dist/esm/components/DatePicker/RangePicker.js +14 -14
  25. package/dist/esm/components/DatePicker/TimePicker.js +30 -30
  26. package/dist/esm/components/Table/TableFilter/data-table-date-filter.js +2 -2
  27. package/dist/esm/components/Table/TableFilter/data-table-filter-popover.js +12 -12
  28. package/dist/esm/components/Table/TableFilter/data-table-slider-filter.js +11 -11
  29. package/dist/esm/components/Table/data-table-pagination.js +38 -28
  30. package/dist/esm/components/Table/data-table-toolbar.js +1 -1
  31. package/dist/esm/components/Table/data-table-view-options.js +5 -5
  32. package/dist/esm/components/Table/data-table.js +146 -81
  33. package/dist/esm/index.js +248 -248
  34. package/dist/esm/node_modules/.pnpm/{@dnd-kit_core@6.3.1_react-dom@19.1.1_react@19.1.1__react@19.1.1 → @dnd-kit_core@6.3.1_react-d_4aa55f773ec51751575225d6fce068db}/node_modules/@dnd-kit/core/dist/core.esm.js +2 -2
  35. package/dist/esm/node_modules/.pnpm/{@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1 → @dnd-kit_sortable@10.0.0_@d_3f5c0d7c14b28ec4620c9987407d5443}/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +2 -2
  36. package/dist/esm/packages/ui/src/components/table.js +20 -6
  37. package/dist/esm/styles/index.css +1 -1
  38. package/dist/esm/utils/data-table.js +16 -11
  39. package/dist/esm/utils/parsers.js +1 -1
  40. package/dist/types/components/Table/data-table-pagination.d.ts +10 -1
  41. package/dist/types/components/Table/data-table-pagination.d.ts.map +1 -1
  42. package/dist/types/components/Table/data-table.d.ts +45 -2
  43. package/dist/types/components/Table/data-table.d.ts.map +1 -1
  44. package/dist/types/utils/data-table.d.ts.map +1 -1
  45. package/package.json +321 -321
  46. package/dist/cjs/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/@dnd-kit/sortable/dist/sortable.esm.cjs +0 -1
  47. /package/dist/cjs/node_modules/.pnpm/{@dnd-kit_accessibility@3.1.1_react@19.1.1 → @dnd-kit_accessibility@3.1.1_react@19.2.1}/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.cjs +0 -0
  48. /package/dist/cjs/node_modules/.pnpm/{@dnd-kit_utilities@3.2.2_react@19.1.1 → @dnd-kit_utilities@3.2.2_react@19.2.1}/node_modules/@dnd-kit/utilities/dist/utilities.esm.cjs +0 -0
  49. /package/dist/cjs/node_modules/.pnpm/{nuqs@2.8.0_next@15.5.9_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1 → nuqs@2.8.4_next@15.5.23_rea_b8bebf39e603255296dd521522e101e2}/node_modules/nuqs/dist/server.cjs +0 -0
  50. /package/dist/esm/node_modules/.pnpm/{@dnd-kit_accessibility@3.1.1_react@19.1.1 → @dnd-kit_accessibility@3.1.1_react@19.2.1}/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +0 -0
  51. /package/dist/esm/node_modules/.pnpm/{@dnd-kit_utilities@3.2.2_react@19.1.1 → @dnd-kit_utilities@3.2.2_react@19.2.1}/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +0 -0
  52. /package/dist/esm/node_modules/.pnpm/{nuqs@2.8.0_next@15.5.9_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1 → nuqs@2.8.4_next@15.5.23_rea_b8bebf39e603255296dd521522e101e2}/node_modules/nuqs/dist/server.js +0 -0
@@ -1,14 +1,14 @@
1
1
  import { jsxs as x, Fragment as G, jsx as n } from "react/jsx-runtime";
2
- import { useSensors as K, useSensor as O, DndContext as $, closestCenter as H, KeyboardSensor as q, PointerSensor as J } from "../../node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.1.1_react@19.1.1__react@19.1.1/node_modules/@dnd-kit/core/dist/core.esm.js";
3
- import { arrayMove as Q, SortableContext as U, verticalListSortingStrategy as W, sortableKeyboardCoordinates as X, useSortable as Y } from "../../node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.1.1_react@19.1.1__react@19.1.1__react@19.1.1/node_modules/@dnd-kit/sortable/dist/sortable.esm.js";
4
- import { CSS as Z } from "../../node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@19.1.1/node_modules/@dnd-kit/utilities/dist/utilities.esm.js";
2
+ import { useSensors as K, useSensor as O, DndContext as $, closestCenter as H, KeyboardSensor as q, PointerSensor as J } from "../../node_modules/.pnpm/@dnd-kit_core@6.3.1_react-d_4aa55f773ec51751575225d6fce068db/node_modules/@dnd-kit/core/dist/core.esm.js";
3
+ import { arrayMove as Q, SortableContext as U, verticalListSortingStrategy as W, sortableKeyboardCoordinates as X, useSortable as Y } from "../../node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@d_3f5c0d7c14b28ec4620c9987407d5443/node_modules/@dnd-kit/sortable/dist/sortable.esm.js";
4
+ import { CSS as Z } from "../../node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@19.2.1/node_modules/@dnd-kit/utilities/dist/utilities.esm.js";
5
5
  import { Check as _, Settings2 as ee, GripVertical as se } from "lucide-react";
6
6
  import * as p from "react";
7
- import P from "../Button/Button.js";
8
- import D from "../Checkbox/Checkbox.js";
9
7
  import te from "../Command/Command.js";
10
8
  import { Popover as ne } from "../Popover/index.js";
11
9
  import { cn as N } from "../../packages/ui/src/lib/utils.js";
10
+ import D from "../Checkbox/Checkbox.js";
11
+ import P from "../Button/Button.js";
12
12
  function he({
13
13
  table: t,
14
14
  variant: i = "command",
@@ -1,122 +1,187 @@
1
- import { jsxs as c, jsx as l } from "react/jsx-runtime";
2
- import { flexRender as f } from "@tanstack/react-table";
3
- import { DataTablePagination as x } from "./data-table-pagination.js";
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
- table: o,
10
- actionBar: a,
11
- children: h,
12
- className: p,
13
- pagination: n = !0,
14
- sticky: d = !0,
15
- bordered: H,
16
- loading: m,
17
- footer: u,
18
- ...w
1
+ import { jsxs as b, jsx as e } from "react/jsx-runtime";
2
+ import { flexRender as C } from "@tanstack/react-table";
3
+ import { Fragment as k } from "react";
4
+ import { DataTablePagination as F } from "./data-table-pagination.js";
5
+ import { cn as n } from "../../packages/ui/src/lib/utils.js";
6
+ import { Table as B, TableHeader as L, TableRow as i, TableHead as O, TableBody as V, TableCell as f, TableFooter as _ } from "../../packages/ui/src/components/table.js";
7
+ import { getCommonPinningStyles as T } from "../../utils/data-table.js";
8
+ import { DataTableColumnHeader as $ } from "./data-table-column-header.js";
9
+ function W({
10
+ table: d,
11
+ actionBar: g,
12
+ children: H,
13
+ className: R,
14
+ pagination: a = !0,
15
+ sticky: s = !0,
16
+ stickyFooter: D = !1,
17
+ bordered: P = !0,
18
+ loading: p,
19
+ loadingIndicator: I,
20
+ footer: h,
21
+ emptyState: N,
22
+ onRowClick: m,
23
+ rowClassName: u,
24
+ renderRow: w,
25
+ renderCell: x,
26
+ classNames: l,
27
+ showTotalCount: j = !0,
28
+ totalCount: z,
29
+ ...M
19
30
  }) {
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(
31
+ const c = s ? {
32
+ offsetHeader: typeof s == "object" ? s.offsetHeader ?? 0 : 0,
33
+ offsetScroll: typeof s == "object" ? s.offsetScroll : void 0
34
+ } : null, v = d.getVisibleLeafColumns().length;
35
+ return /* @__PURE__ */ b(
25
36
  "div",
26
37
  {
27
- className: b(
38
+ className: n(
28
39
  "ds:flex ds:w-full ds:flex-col ds:gap-2.5 ds:relative",
29
- p
40
+ R
30
41
  ),
31
- ...w,
42
+ ...M,
32
43
  children: [
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,
44
+ H,
45
+ p && /* @__PURE__ */ e(
46
+ "div",
37
47
  {
38
- containerClassName: b(
39
- "ds:rounded-md ds:border ds:border-border",
48
+ className: n(
49
+ "ds:absolute ds:inset-0 ds:bg-background/50 ds:flex ds:items-center ds:justify-center ds:z-20",
50
+ l?.loadingOverlay
51
+ ),
52
+ children: I ?? "Loading..."
53
+ }
54
+ ),
55
+ /* @__PURE__ */ b(
56
+ B,
57
+ {
58
+ className: l?.table,
59
+ containerClassName: n(
60
+ P && "ds:rounded-md ds:border ds:border-border",
40
61
  // Thin, unobtrusive scrollbar that darkens only when hovering the thumb itself
41
62
  "ds:[scrollbar-width:thin] ds:[scrollbar-color:var(--border)_transparent]",
42
63
  "ds:[&::-webkit-scrollbar]:h-1.5 ds:[&::-webkit-scrollbar]:w-1.5",
43
64
  "ds:[&::-webkit-scrollbar-track]:bg-transparent",
44
65
  "ds:[&::-webkit-scrollbar-thumb]:rounded-full ds:[&::-webkit-scrollbar-thumb]:bg-border",
45
66
  "ds:[&::-webkit-scrollbar-thumb:hover]:bg-muted-foreground",
46
- m && "ds:blur-sm"
67
+ p && "ds:blur-sm",
68
+ l?.container
47
69
  ),
48
- containerStyle: t ? {
49
- maxHeight: `calc(100vh - ${t.offsetScroll ?? 0}px)`
70
+ containerStyle: c ? {
71
+ maxHeight: `calc(100vh - ${c.offsetScroll ?? 0}px)`
50
72
  } : void 0,
51
73
  children: [
52
- /* @__PURE__ */ l(v, { children: o.getHeaderGroups().map((r) => /* @__PURE__ */ l(s, { children: r.headers.map((e) => /* @__PURE__ */ l(
53
- C,
74
+ /* @__PURE__ */ e(L, { children: d.getHeaderGroups().map((t) => /* @__PURE__ */ e(i, { className: l?.headerRow, children: t.headers.map((o) => /* @__PURE__ */ e(
75
+ O,
54
76
  {
55
- colSpan: e.colSpan,
77
+ colSpan: o.colSpan,
78
+ className: n(
79
+ l?.headerCell,
80
+ o.column.getIsPinned() && "ds:bg-background"
81
+ ),
56
82
  style: {
57
- ...g({
58
- column: e.column,
83
+ ...T({
84
+ column: o.column,
59
85
  withBorder: !0
60
86
  }),
61
- ...t && {
87
+ ...c && {
62
88
  position: "sticky",
63
- top: t.offsetHeader,
64
- zIndex: e.column.getIsPinned() ? 3 : 2,
89
+ top: c.offsetHeader,
90
+ zIndex: o.column.getIsPinned() ? 3 : 2,
65
91
  background: "var(--background)"
66
92
  }
67
93
  },
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
94
+ children: o.isPlaceholder ? null : o.column.columnDef.header ? typeof o.column.columnDef.header == "function" ? C(
95
+ o.column.columnDef.header,
96
+ o.getContext()
97
+ ) : /* @__PURE__ */ e($, { column: o.column }) : null
72
98
  },
73
- e.id
74
- )) }, r.id)) }),
75
- /* @__PURE__ */ l(T, { children: o.getRowModel().rows?.length ? o.getRowModel().rows.map((r) => /* @__PURE__ */ l(
76
- s,
77
- {
78
- "data-state": r.getIsSelected() && "selected",
79
- children: r.getVisibleCells().map((e) => /* @__PURE__ */ l(
80
- i,
81
- {
82
- style: {
83
- ...g({
84
- column: e.column,
85
- withBorder: !0
86
- })
87
- },
88
- children: f(e.column.columnDef.cell, e.getContext())
89
- },
90
- e.id
91
- ))
92
- },
93
- r.id
94
- )) : /* @__PURE__ */ l(s, { children: /* @__PURE__ */ l(
95
- i,
99
+ o.id
100
+ )) }, t.id)) }),
101
+ /* @__PURE__ */ e(V, { className: l?.body, children: d.getRowModel().rows?.length ? d.getRowModel().rows.map((t) => {
102
+ const o = typeof u == "function" ? u(t) : u, y = /* @__PURE__ */ e(
103
+ i,
104
+ {
105
+ "data-state": t.getIsSelected() && "selected",
106
+ className: n(
107
+ l?.row,
108
+ o,
109
+ m && "ds:cursor-pointer"
110
+ ),
111
+ onClick: m ? (r) => m(t, r) : void 0,
112
+ children: t.getVisibleCells().map((r) => {
113
+ const S = /* @__PURE__ */ e(
114
+ f,
115
+ {
116
+ className: n(
117
+ l?.cell,
118
+ // Static background on purpose — see the comment on
119
+ // getCommonPinningStyles for why pinned cells must
120
+ // not change color on hover/select.
121
+ r.column.getIsPinned() && "ds:bg-background"
122
+ ),
123
+ style: {
124
+ ...T({
125
+ column: r.column,
126
+ withBorder: !0
127
+ })
128
+ },
129
+ children: C(
130
+ r.column.columnDef.cell,
131
+ r.getContext()
132
+ )
133
+ },
134
+ r.id
135
+ );
136
+ return x ? /* @__PURE__ */ e(k, { children: x(r, S) }, r.id) : S;
137
+ })
138
+ },
139
+ t.id
140
+ );
141
+ return w ? /* @__PURE__ */ e(k, { children: w(t, y) }, t.id) : y;
142
+ }) : /* @__PURE__ */ e(i, { className: l?.emptyRow, children: /* @__PURE__ */ e(
143
+ f,
96
144
  {
97
- colSpan: o.getAllColumns().length,
98
- className: "ds:h-24 ds:text-center",
99
- children: "No results."
145
+ colSpan: v,
146
+ className: n("ds:h-24 ds:text-center", l?.emptyCell),
147
+ children: N ?? "No results."
100
148
  }
101
149
  ) }) }),
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)) }) }) })
150
+ h && /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(i, { className: l?.footerRow, children: /* @__PURE__ */ e(
151
+ f,
152
+ {
153
+ colSpan: v,
154
+ className: l?.footerCell,
155
+ style: D ? {
156
+ position: "sticky",
157
+ bottom: 0,
158
+ zIndex: 2
159
+ } : void 0,
160
+ children: h(d.getRowModel().rows.map((t) => t.original))
161
+ }
162
+ ) }) })
103
163
  ]
104
164
  }
105
165
  ),
106
- /* @__PURE__ */ c("div", { className: "ds:flex ds:flex-col ds:gap-2.5", children: [
107
- n && /* @__PURE__ */ l(
108
- x,
166
+ /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-2.5", children: [
167
+ a && /* @__PURE__ */ e(
168
+ F,
109
169
  {
110
- table: o,
111
- ...n === !0 ? {} : n
170
+ showTotalCount: j,
171
+ totalCount: z,
172
+ showPageSizeOptions: !0,
173
+ showRowSelectionCount: !0,
174
+ className: "ds:mt-2.5",
175
+ table: d,
176
+ ...a === !0 ? {} : a
112
177
  }
113
178
  ),
114
- a && o.getFilteredSelectedRowModel().rows.length > 0 && a
179
+ g && d.getFilteredSelectedRowModel().rows.length > 0 && g
115
180
  ] })
116
181
  ]
117
182
  }
118
183
  );
119
184
  }
120
185
  export {
121
- I as DataTable
186
+ W as DataTable
122
187
  };