@devalok/shilp-sutra 0.34.0 → 0.34.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.
Files changed (172) hide show
  1. package/dist/_chunks/badge-group.js +306 -246
  2. package/dist/_chunks/chat.js +513 -0
  3. package/dist/_chunks/date-picker.js +748 -0
  4. package/dist/_chunks/document-preview.js +109 -90
  5. package/dist/_chunks/file-preview.js +492 -504
  6. package/dist/_chunks/framer.js +5564 -5613
  7. package/dist/_chunks/image-preview.js +127 -88
  8. package/dist/_chunks/keybinding.js +12 -14
  9. package/dist/_chunks/link-context.js +19 -16
  10. package/dist/_chunks/mention-suggestion.js +353 -350
  11. package/dist/_chunks/motion-provider.js +26 -20
  12. package/dist/_chunks/popover.js +127 -0
  13. package/dist/_chunks/primitives.js +7584 -6425
  14. package/dist/_chunks/rich-chat-input.js +2070 -0
  15. package/dist/_chunks/rolldown-runtime.js +21 -0
  16. package/dist/_chunks/shared.js +126 -0
  17. package/dist/_chunks/sonner.js +605 -734
  18. package/dist/_chunks/stat-row.js +418 -440
  19. package/dist/_chunks/tiptap.js +15850 -19964
  20. package/dist/_chunks/tree-view.js +231 -290
  21. package/dist/_chunks/use-calendar.js +161 -208
  22. package/dist/_chunks/vendor-client.js +314 -2199
  23. package/dist/_chunks/vendor-utils.js +1721 -2978
  24. package/dist/ai/ai-command-provider.js +23 -17
  25. package/dist/ai/block-renderer.js +68 -51
  26. package/dist/ai/blocks/index.js +2 -12
  27. package/dist/ai/command-bar.js +470 -519
  28. package/dist/ai/conversation.js +241 -227
  29. package/dist/ai/index.js +181 -167
  30. package/dist/ai/types.js +0 -1
  31. package/dist/composed/activity-feed.js +232 -202
  32. package/dist/composed/avatar-group.js +164 -222
  33. package/dist/composed/bulk-action-bar.js +174 -165
  34. package/dist/composed/command-palette.js +290 -308
  35. package/dist/composed/confirm-dialog.js +28 -48
  36. package/dist/composed/content-card.js +69 -108
  37. package/dist/composed/date-picker/index.js +3 -13
  38. package/dist/composed/deadline-indicator.js +68 -74
  39. package/dist/composed/emoji-picker.js +83 -110
  40. package/dist/composed/empty-state.js +64 -103
  41. package/dist/composed/error-boundary.js +129 -127
  42. package/dist/composed/file-preview.js +2 -12
  43. package/dist/composed/filter-bar.js +98 -130
  44. package/dist/composed/form-section.js +61 -45
  45. package/dist/composed/global-loading.js +34 -47
  46. package/dist/composed/index.js +34 -92
  47. package/dist/composed/inline-edit.js +92 -107
  48. package/dist/composed/lib/string-utils.js +8 -8
  49. package/dist/composed/loading-skeleton.js +103 -171
  50. package/dist/composed/markdown-viewer.js +187 -139
  51. package/dist/composed/master-detail.js +147 -156
  52. package/dist/composed/member-picker.js +46 -49
  53. package/dist/composed/multi-select-popover.js +181 -179
  54. package/dist/composed/page-header.js +54 -76
  55. package/dist/composed/page-skeletons.js +143 -127
  56. package/dist/composed/priority-indicator.js +105 -111
  57. package/dist/composed/responsive-overlay.js +36 -41
  58. package/dist/composed/rich-chat-input.js +2 -1860
  59. package/dist/composed/rich-text-editor.js +561 -424
  60. package/dist/composed/schedule-view.js +134 -185
  61. package/dist/composed/simple-tooltip.js +21 -21
  62. package/dist/composed/status-badge.js +133 -137
  63. package/dist/hooks/index.js +7 -12
  64. package/dist/hooks/use-color-mode.js +28 -25
  65. package/dist/hooks/use-mobile.js +13 -13
  66. package/dist/hooks/use-toast.js +2 -4
  67. package/dist/hooks/use-touch-device.js +9 -11
  68. package/dist/hooks/use-viewport-height.js +14 -14
  69. package/dist/motion/index.js +3 -11
  70. package/dist/motion/primitives-index.js +226 -186
  71. package/dist/shell/app-command-palette.js +203 -234
  72. package/dist/shell/bottom-navbar.js +150 -190
  73. package/dist/shell/command-registry.js +13 -14
  74. package/dist/shell/index.js +10 -20
  75. package/dist/shell/link-context.js +2 -5
  76. package/dist/shell/notification-center.js +238 -259
  77. package/dist/shell/notification-preferences.js +241 -184
  78. package/dist/shell/sidebar.js +251 -281
  79. package/dist/shell/top-bar.js +203 -237
  80. package/dist/tailwind/index.cjs +426 -442
  81. package/dist/tailwind/index.js +2 -4
  82. package/dist/tailwind/preset.js +443 -459
  83. package/dist/ui/accordion.js +52 -60
  84. package/dist/ui/alert-dialog.js +111 -156
  85. package/dist/ui/alert.js +177 -99
  86. package/dist/ui/aspect-ratio.js +13 -16
  87. package/dist/ui/autocomplete.js +112 -148
  88. package/dist/ui/avatar.js +196 -169
  89. package/dist/ui/badge-group.js +2 -7
  90. package/dist/ui/badge-indicator.js +42 -51
  91. package/dist/ui/badge.js +2 -15
  92. package/dist/ui/banner.js +76 -68
  93. package/dist/ui/breadcrumb.js +65 -84
  94. package/dist/ui/button-group.js +109 -102
  95. package/dist/ui/button-processing.js +69 -73
  96. package/dist/ui/button.js +393 -279
  97. package/dist/ui/card.js +151 -157
  98. package/dist/ui/charts/index.js +1002 -1319
  99. package/dist/ui/chat/index.js +2 -11
  100. package/dist/ui/checkbox.js +77 -100
  101. package/dist/ui/code.js +18 -32
  102. package/dist/ui/collapsible.js +21 -29
  103. package/dist/ui/color-input.js +453 -372
  104. package/dist/ui/color-swatch.js +60 -90
  105. package/dist/ui/combobox.js +244 -293
  106. package/dist/ui/container.js +18 -24
  107. package/dist/ui/context-menu.js +154 -203
  108. package/dist/ui/data-table-body.js +116 -213
  109. package/dist/ui/data-table-bulk-actions.js +43 -59
  110. package/dist/ui/data-table-card.js +84 -71
  111. package/dist/ui/data-table-context.js +39 -42
  112. package/dist/ui/data-table-header.js +98 -139
  113. package/dist/ui/data-table-pagination.js +69 -82
  114. package/dist/ui/data-table-toolbar.js +104 -130
  115. package/dist/ui/data-table.js +278 -354
  116. package/dist/ui/devalok-grain.js +77 -66
  117. package/dist/ui/dialog.js +122 -151
  118. package/dist/ui/dropdown-menu.js +152 -203
  119. package/dist/ui/file-upload.js +242 -266
  120. package/dist/ui/form.js +60 -56
  121. package/dist/ui/hover-card.js +54 -54
  122. package/dist/ui/icon-button.js +21 -26
  123. package/dist/ui/icon-context.js +17 -17
  124. package/dist/ui/icon-group.js +22 -29
  125. package/dist/ui/icon.js +201 -121
  126. package/dist/ui/index.js +74 -350
  127. package/dist/ui/input-otp.js +44 -48
  128. package/dist/ui/input.js +92 -169
  129. package/dist/ui/label.js +17 -22
  130. package/dist/ui/lib/date-utils.js +14 -11
  131. package/dist/ui/lib/motion.js +77 -36
  132. package/dist/ui/lib/utils.js +39 -16
  133. package/dist/ui/link.js +13 -24
  134. package/dist/ui/menubar.js +132 -210
  135. package/dist/ui/navigation-menu.js +163 -193
  136. package/dist/ui/number-input.js +72 -95
  137. package/dist/ui/pagination.js +122 -159
  138. package/dist/ui/popover.js +2 -131
  139. package/dist/ui/progress-ring.js +133 -143
  140. package/dist/ui/progress.js +51 -95
  141. package/dist/ui/radio.js +41 -50
  142. package/dist/ui/search-input.js +51 -53
  143. package/dist/ui/segmented-control.js +93 -114
  144. package/dist/ui/select.js +131 -157
  145. package/dist/ui/separator.js +15 -25
  146. package/dist/ui/sheet.js +135 -163
  147. package/dist/ui/sidebar.js +357 -600
  148. package/dist/ui/skeleton.js +179 -231
  149. package/dist/ui/slider.js +24 -34
  150. package/dist/ui/spinner.js +226 -205
  151. package/dist/ui/split-button.js +227 -276
  152. package/dist/ui/stack.js +56 -70
  153. package/dist/ui/stat-card.js +259 -251
  154. package/dist/ui/status-dot.js +67 -63
  155. package/dist/ui/stepper.js +119 -168
  156. package/dist/ui/switch.js +51 -54
  157. package/dist/ui/table.js +57 -90
  158. package/dist/ui/tabs.js +139 -156
  159. package/dist/ui/text.js +52 -59
  160. package/dist/ui/textarea.js +40 -57
  161. package/dist/ui/toast-types.js +0 -1
  162. package/dist/ui/toast.js +554 -536
  163. package/dist/ui/toaster.js +23 -33
  164. package/dist/ui/toggle-group.js +37 -41
  165. package/dist/ui/toggle.js +36 -40
  166. package/dist/ui/tooltip.js +80 -65
  167. package/dist/ui/tree-view/index.js +2 -6
  168. package/dist/ui/visually-hidden.js +12 -10
  169. package/llms-full.txt +1 -1
  170. package/package.json +1 -1
  171. package/dist/_chunks/date-time-picker.js +0 -851
  172. package/dist/_chunks/typing-indicator.js +0 -565
@@ -1,48 +1,45 @@
1
1
  "use client";
2
- import { jsx as o } from "react/jsx-runtime";
3
- import a from "react";
4
- function f(e) {
5
- if (!e) return "";
6
- const t = [];
7
- return e.align === "right" && t.push("text-right tabular-nums"), e.align === "center" && t.push("text-center"), e.hideBelow === "sm" && t.push("hidden sm:table-cell"), e.hideBelow === "md" && t.push("hidden md:table-cell"), e.hideBelow === "lg" && t.push("hidden lg:table-cell"), t.join(" ");
2
+ import e from "react";
3
+ import { jsx as t } from "react/jsx-runtime";
4
+ //#region src/ui/data-table-context.tsx
5
+ function n(e) {
6
+ if (!e) return "";
7
+ let t = [];
8
+ return e.align === "right" && t.push("text-right tabular-nums"), e.align === "center" && t.push("text-center"), e.hideBelow === "sm" && t.push("hidden sm:table-cell"), e.hideBelow === "md" && t.push("hidden md:table-cell"), e.hideBelow === "lg" && t.push("hidden lg:table-cell"), t.join(" ");
8
9
  }
9
- const d = {
10
- compact: "py-ds-02",
11
- standard: "py-ds-05",
12
- comfortable: "py-ds-07"
13
- }, b = 'button, a, input, select, textarea, [role="checkbox"]', i = a.createContext(null);
14
- function h({
15
- children: e,
16
- value: t
17
- }) {
18
- return /* @__PURE__ */ o(i.Provider, { value: t, children: e });
10
+ var r = {
11
+ compact: "py-ds-02",
12
+ standard: "py-ds-05",
13
+ comfortable: "py-ds-07"
14
+ }, i = "button, a, input, select, textarea, [role=\"checkbox\"]", a = e.createContext(null);
15
+ function o({ children: e, value: n }) {
16
+ return /* @__PURE__ */ t(a.Provider, {
17
+ value: n,
18
+ children: e
19
+ });
19
20
  }
20
- function x() {
21
- const e = a.useContext(i);
22
- if (!e) throw new Error("useDataTableContext must be used within DataTableProvider");
23
- return e;
21
+ function s() {
22
+ let t = e.useContext(a);
23
+ if (!t) throw Error("useDataTableContext must be used within DataTableProvider");
24
+ return t;
24
25
  }
25
- function g(e, t) {
26
- const { left: s = [], right: n = [] } = t, r = s.indexOf(e), l = n.indexOf(e);
27
- return r !== -1 ? {
28
- className: "sticky bg-surface-base z-raised",
29
- style: { left: 0 }
30
- } : l !== -1 ? {
31
- className: "sticky bg-surface-base z-raised",
32
- style: { right: 0 }
33
- } : { className: "", style: {} };
26
+ function c(e, t) {
27
+ let { left: n = [], right: r = [] } = t, i = n.indexOf(e), a = r.indexOf(e);
28
+ return i === -1 ? a === -1 ? {
29
+ className: "",
30
+ style: {}
31
+ } : {
32
+ className: "sticky bg-surface-base z-raised",
33
+ style: { right: 0 }
34
+ } : {
35
+ className: "sticky bg-surface-base z-raised",
36
+ style: { left: 0 }
37
+ };
34
38
  }
35
- function p(e, t, s) {
36
- if (!t || e === "_select" || e === "_expand") return !1;
37
- const n = s.getColumn(e);
38
- return !(!n || n.columnDef.meta?.enableEditing === !1);
39
+ function l(e, t, n) {
40
+ if (!t || e === "_select" || e === "_expand") return !1;
41
+ let r = n.getColumn(e);
42
+ return !(!r || r.columnDef.meta?.enableEditing === !1);
39
43
  }
40
- export {
41
- h as DataTableProvider,
42
- b as INTERACTIVE_SELECTOR,
43
- d as densityPaddingMap,
44
- f as getColumnMetaClasses,
45
- g as getPinnedCellStyle,
46
- p as isColumnEditable,
47
- x as useDataTableContext
48
- };
44
+ //#endregion
45
+ export { o as DataTableProvider, i as INTERACTIVE_SELECTOR, r as densityPaddingMap, n as getColumnMetaClasses, c as getPinnedCellStyle, l as isColumnEditable, s as useDataTableContext };
@@ -1,141 +1,100 @@
1
1
  "use client";
2
- import { jsxs as u, jsx as t } from "react/jsx-runtime";
3
- import { flexRender as d } from "@tanstack/react-table";
4
- import { IconArrowUp as D, IconArrowDown as N, IconArrowsSort as C } from "@tabler/icons-react";
5
- import { Icon as s } from "./icon.js";
6
- import { TableHeader as S, TableRow as p, TableHead as f } from "./table.js";
7
- import { cn as a } from "./lib/utils.js";
8
- import { springs as i } from "./lib/motion.js";
9
- import { useDataTableContext as w, getPinnedCellStyle as H, getColumnMetaClasses as T } from "./data-table-context.js";
10
- import { A as I, m as c } from "../_chunks/framer.js";
11
- function R({ stickyHeader: g }) {
12
- const { table: r, sortable: b, filterable: x, columnPinningState: y } = w();
13
- return /* @__PURE__ */ u(
14
- S,
15
- {
16
- className: a(
17
- g && "sticky top-0 z-10 bg-surface-base"
18
- ),
19
- children: [
20
- r.getHeaderGroups().map((n) => /* @__PURE__ */ t(p, { children: n.headers.map((e) => {
21
- const o = b && e.column.getCanSort(), l = e.column.getIsSorted(), m = H(
22
- e.column.id,
23
- y
24
- );
25
- return /* @__PURE__ */ t(
26
- f,
27
- {
28
- className: a(
29
- m.className,
30
- T(
31
- e.column.columnDef.meta
32
- )
33
- ),
34
- style: m.style,
35
- "aria-sort": o ? l === "asc" ? "ascending" : l === "desc" ? "descending" : "none" : void 0,
36
- children: e.isPlaceholder ? null : o ? /* @__PURE__ */ u(
37
- "button",
38
- {
39
- type: "button",
40
- className: a(
41
- "flex items-center gap-ds-01 font-medium",
42
- "cursor-pointer select-none",
43
- "-ml-ds-01 rounded-ds-sm px-ds-01 py-ds-01",
44
- "hover:bg-surface-raised transition-colors"
45
- ),
46
- onClick: e.column.getToggleSortingHandler(),
47
- "aria-label": `Sort by ${typeof e.column.columnDef.header == "string" ? e.column.columnDef.header : e.column.id}`,
48
- children: [
49
- d(
50
- e.column.columnDef.header,
51
- e.getContext()
52
- ),
53
- /* @__PURE__ */ t(I, { mode: "wait", initial: !1, children: l === "asc" ? /* @__PURE__ */ t(
54
- c.span,
55
- {
56
- initial: { opacity: 0, rotate: 90 },
57
- animate: { opacity: 1, rotate: 0 },
58
- exit: { opacity: 0, rotate: -90 },
59
- transition: i.snappy,
60
- className: "inline-flex",
61
- children: /* @__PURE__ */ t(
62
- s,
63
- {
64
- icon: D,
65
- size: "sm",
66
- className: "text-surface-fg-muted"
67
- }
68
- )
69
- },
70
- "asc"
71
- ) : l === "desc" ? /* @__PURE__ */ t(
72
- c.span,
73
- {
74
- initial: { opacity: 0, rotate: -90 },
75
- animate: { opacity: 1, rotate: 0 },
76
- exit: { opacity: 0, rotate: 90 },
77
- transition: i.snappy,
78
- className: "inline-flex",
79
- children: /* @__PURE__ */ t(
80
- s,
81
- {
82
- icon: N,
83
- size: "sm",
84
- className: "text-surface-fg-muted"
85
- }
86
- )
87
- },
88
- "desc"
89
- ) : /* @__PURE__ */ t(
90
- c.span,
91
- {
92
- initial: { opacity: 0 },
93
- animate: { opacity: 1 },
94
- exit: { opacity: 0 },
95
- transition: i.snappy,
96
- className: "inline-flex",
97
- children: /* @__PURE__ */ t(
98
- s,
99
- {
100
- icon: C,
101
- size: "sm",
102
- className: "text-surface-fg-subtle"
103
- }
104
- )
105
- },
106
- "unsorted"
107
- ) })
108
- ]
109
- }
110
- ) : d(
111
- e.column.columnDef.header,
112
- e.getContext()
113
- )
114
- },
115
- e.id
116
- );
117
- }) }, n.id)),
118
- x && r.getHeaderGroups().map((n) => /* @__PURE__ */ t(p, { children: n.headers.map((e) => /* @__PURE__ */ t(f, { className: "py-ds-01", children: e.isPlaceholder || e.column.columnDef.enableColumnFilter === !1 ? null : /* @__PURE__ */ t(
119
- "input",
120
- {
121
- type: "text",
122
- value: e.column.getFilterValue() ?? "",
123
- onChange: (o) => e.column.setFilterValue(o.target.value),
124
- placeholder: `Filter ${typeof e.column.columnDef.header == "string" ? e.column.columnDef.header : ""}...`,
125
- "aria-label": `Filter ${typeof e.column.columnDef.header == "string" ? e.column.columnDef.header : e.column.id}`,
126
- className: a(
127
- "h-ds-xs-plus w-full rounded-ds-md",
128
- "border border-surface-border-strong bg-surface-raised-hover",
129
- "px-ds-02 text-ds-sm",
130
- "text-surface-fg placeholder:text-surface-fg-subtle",
131
- "outline-hidden focus:border-accent-7"
132
- )
133
- }
134
- ) }, `${e.id}-filter`)) }, `${n.id}-filters`))
135
- ]
136
- }
137
- );
2
+ import { a as e, c as t } from "../_chunks/framer.js";
3
+ import { springs as n } from "./lib/motion.js";
4
+ import { cn as r } from "./lib/utils.js";
5
+ import { Icon as i } from "./icon.js";
6
+ import { TableHead as a, TableHeader as o, TableRow as s } from "./table.js";
7
+ import { getColumnMetaClasses as c, getPinnedCellStyle as l, useDataTableContext as u } from "./data-table-context.js";
8
+ import "react";
9
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
10
+ import { IconArrowDown as p, IconArrowUp as m, IconArrowsSort as h } from "@tabler/icons-react";
11
+ import { flexRender as g } from "@tanstack/react-table";
12
+ //#region src/ui/data-table-header.tsx
13
+ function _({ stickyHeader: _ }) {
14
+ let { table: v, sortable: y, filterable: b, columnPinningState: x } = u();
15
+ return /* @__PURE__ */ f(o, {
16
+ className: r(_ && "sticky top-0 z-10 bg-surface-base"),
17
+ children: [v.getHeaderGroups().map((o) => /* @__PURE__ */ d(s, { children: o.headers.map((o) => {
18
+ let s = y && o.column.getCanSort(), u = o.column.getIsSorted(), _ = l(o.column.id, x);
19
+ return /* @__PURE__ */ d(a, {
20
+ className: r(_.className, c(o.column.columnDef.meta)),
21
+ style: _.style,
22
+ "aria-sort": s ? u === "asc" ? "ascending" : u === "desc" ? "descending" : "none" : void 0,
23
+ children: o.isPlaceholder ? null : s ? /* @__PURE__ */ f("button", {
24
+ type: "button",
25
+ className: r("flex items-center gap-ds-01 font-medium", "cursor-pointer select-none", "-ml-ds-01 rounded-ds-sm px-ds-01 py-ds-01", "hover:bg-surface-raised transition-colors"),
26
+ onClick: o.column.getToggleSortingHandler(),
27
+ "aria-label": `Sort by ${typeof o.column.columnDef.header == "string" ? o.column.columnDef.header : o.column.id}`,
28
+ children: [g(o.column.columnDef.header, o.getContext()), /* @__PURE__ */ d(t, {
29
+ mode: "wait",
30
+ initial: !1,
31
+ children: u === "asc" ? /* @__PURE__ */ d(e.span, {
32
+ initial: {
33
+ opacity: 0,
34
+ rotate: 90
35
+ },
36
+ animate: {
37
+ opacity: 1,
38
+ rotate: 0
39
+ },
40
+ exit: {
41
+ opacity: 0,
42
+ rotate: -90
43
+ },
44
+ transition: n.snappy,
45
+ className: "inline-flex",
46
+ children: /* @__PURE__ */ d(i, {
47
+ icon: m,
48
+ size: "sm",
49
+ className: "text-surface-fg-muted"
50
+ })
51
+ }, "asc") : u === "desc" ? /* @__PURE__ */ d(e.span, {
52
+ initial: {
53
+ opacity: 0,
54
+ rotate: -90
55
+ },
56
+ animate: {
57
+ opacity: 1,
58
+ rotate: 0
59
+ },
60
+ exit: {
61
+ opacity: 0,
62
+ rotate: 90
63
+ },
64
+ transition: n.snappy,
65
+ className: "inline-flex",
66
+ children: /* @__PURE__ */ d(i, {
67
+ icon: p,
68
+ size: "sm",
69
+ className: "text-surface-fg-muted"
70
+ })
71
+ }, "desc") : /* @__PURE__ */ d(e.span, {
72
+ initial: { opacity: 0 },
73
+ animate: { opacity: 1 },
74
+ exit: { opacity: 0 },
75
+ transition: n.snappy,
76
+ className: "inline-flex",
77
+ children: /* @__PURE__ */ d(i, {
78
+ icon: h,
79
+ size: "sm",
80
+ className: "text-surface-fg-subtle"
81
+ })
82
+ }, "unsorted")
83
+ })]
84
+ }) : g(o.column.columnDef.header, o.getContext())
85
+ }, o.id);
86
+ }) }, o.id)), b && v.getHeaderGroups().map((e) => /* @__PURE__ */ d(s, { children: e.headers.map((e) => /* @__PURE__ */ d(a, {
87
+ className: "py-ds-01",
88
+ children: e.isPlaceholder || e.column.columnDef.enableColumnFilter === !1 ? null : /* @__PURE__ */ d("input", {
89
+ type: "text",
90
+ value: e.column.getFilterValue() ?? "",
91
+ onChange: (t) => e.column.setFilterValue(t.target.value),
92
+ placeholder: `Filter ${typeof e.column.columnDef.header == "string" ? e.column.columnDef.header : ""}...`,
93
+ "aria-label": `Filter ${typeof e.column.columnDef.header == "string" ? e.column.columnDef.header : e.column.id}`,
94
+ className: r("h-ds-xs-plus w-full rounded-ds-md", "border border-surface-border-strong bg-surface-raised-hover", "px-ds-02 text-ds-sm", "text-surface-fg placeholder:text-surface-fg-subtle", "outline-hidden focus:border-accent-7")
95
+ })
96
+ }, `${e.id}-filter`)) }, `${e.id}-filters`))]
97
+ });
138
98
  }
139
- export {
140
- R as DataTableHeader
141
- };
99
+ //#endregion
100
+ export { _ as DataTableHeader };
@@ -1,84 +1,71 @@
1
1
  "use client";
2
- import { jsxs as s, jsx as a } from "react/jsx-runtime";
3
- import { IconChevronLeft as c, IconChevronRight as l } from "@tabler/icons-react";
4
- import { Icon as o } from "./icon.js";
5
- import { cn as t } from "./lib/utils.js";
6
- function f({
7
- table: e,
8
- totalRowCount: d,
9
- useServerPagination: n,
10
- pageSizeOptions: i
11
- }) {
12
- return /* @__PURE__ */ s("div", { className: "flex items-center justify-between px-ds-03 py-ds-04 border-t border-surface-border", children: [
13
- /* @__PURE__ */ s("span", { className: "text-ds-sm text-surface-fg-muted", children: [
14
- d,
15
- " total rows"
16
- ] }),
17
- /* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03", children: [
18
- !n && /* @__PURE__ */ a(
19
- "select",
20
- {
21
- value: e.getState().pagination.pageSize,
22
- onChange: (r) => {
23
- e.setPageSize(Number(r.target.value));
24
- },
25
- "aria-label": "Rows per page",
26
- className: t(
27
- "h-ds-sm rounded-ds-md",
28
- "border border-surface-border-strong bg-surface-raised-hover",
29
- "px-ds-03 text-ds-sm",
30
- "text-surface-fg"
31
- ),
32
- children: (i ?? [10, 20, 50, 100]).map((r) => /* @__PURE__ */ s("option", { value: r, children: [
33
- r,
34
- " rows"
35
- ] }, r))
36
- }
37
- ),
38
- /* @__PURE__ */ a(
39
- "button",
40
- {
41
- type: "button",
42
- disabled: !e.getCanPreviousPage(),
43
- onClick: () => e.previousPage(),
44
- "aria-label": "Previous page",
45
- className: t(
46
- "h-ds-sm w-ds-sm flex items-center justify-center",
47
- "rounded-ds-md border border-surface-border-strong",
48
- "enabled:hover:bg-surface-raised",
49
- "disabled:opacity-action-disabled disabled:cursor-not-allowed",
50
- "transition-colors"
51
- ),
52
- children: /* @__PURE__ */ a(o, { icon: c, size: "sm" })
53
- }
54
- ),
55
- /* @__PURE__ */ s("span", { className: "text-ds-sm text-surface-fg-muted", children: [
56
- "Page ",
57
- e.getState().pagination.pageIndex + 1,
58
- " of",
59
- " ",
60
- e.getPageCount()
61
- ] }),
62
- /* @__PURE__ */ a(
63
- "button",
64
- {
65
- type: "button",
66
- disabled: !e.getCanNextPage(),
67
- onClick: () => e.nextPage(),
68
- "aria-label": "Next page",
69
- className: t(
70
- "h-ds-sm w-ds-sm flex items-center justify-center",
71
- "rounded-ds-md border border-surface-border-strong",
72
- "enabled:hover:bg-surface-raised",
73
- "disabled:opacity-action-disabled disabled:cursor-not-allowed",
74
- "transition-colors"
75
- ),
76
- children: /* @__PURE__ */ a(o, { icon: l, size: "sm" })
77
- }
78
- )
79
- ] })
80
- ] });
2
+ import { cn as e } from "./lib/utils.js";
3
+ import { Icon as t } from "./icon.js";
4
+ import "react";
5
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
6
+ import { IconChevronLeft as i, IconChevronRight as a } from "@tabler/icons-react";
7
+ //#region src/ui/data-table-pagination.tsx
8
+ function o({ table: o, totalRowCount: s, useServerPagination: c, pageSizeOptions: l }) {
9
+ return /* @__PURE__ */ r("div", {
10
+ className: "flex items-center justify-between px-ds-03 py-ds-04 border-t border-surface-border",
11
+ children: [/* @__PURE__ */ r("span", {
12
+ className: "text-ds-sm text-surface-fg-muted",
13
+ children: [s, " total rows"]
14
+ }), /* @__PURE__ */ r("div", {
15
+ className: "flex items-center gap-ds-03",
16
+ children: [
17
+ !c && /* @__PURE__ */ n("select", {
18
+ value: o.getState().pagination.pageSize,
19
+ onChange: (e) => {
20
+ o.setPageSize(Number(e.target.value));
21
+ },
22
+ "aria-label": "Rows per page",
23
+ className: e("h-ds-sm rounded-ds-md", "border border-surface-border-strong bg-surface-raised-hover", "px-ds-03 text-ds-sm", "text-surface-fg"),
24
+ children: (l ?? [
25
+ 10,
26
+ 20,
27
+ 50,
28
+ 100
29
+ ]).map((e) => /* @__PURE__ */ r("option", {
30
+ value: e,
31
+ children: [e, " rows"]
32
+ }, e))
33
+ }),
34
+ /* @__PURE__ */ n("button", {
35
+ type: "button",
36
+ disabled: !o.getCanPreviousPage(),
37
+ onClick: () => o.previousPage(),
38
+ "aria-label": "Previous page",
39
+ className: e("h-ds-sm w-ds-sm flex items-center justify-center", "rounded-ds-md border border-surface-border-strong", "enabled:hover:bg-surface-raised", "disabled:opacity-action-disabled disabled:cursor-not-allowed", "transition-colors"),
40
+ children: /* @__PURE__ */ n(t, {
41
+ icon: i,
42
+ size: "sm"
43
+ })
44
+ }),
45
+ /* @__PURE__ */ r("span", {
46
+ className: "text-ds-sm text-surface-fg-muted",
47
+ children: [
48
+ "Page ",
49
+ o.getState().pagination.pageIndex + 1,
50
+ " of",
51
+ " ",
52
+ o.getPageCount()
53
+ ]
54
+ }),
55
+ /* @__PURE__ */ n("button", {
56
+ type: "button",
57
+ disabled: !o.getCanNextPage(),
58
+ onClick: () => o.nextPage(),
59
+ "aria-label": "Next page",
60
+ className: e("h-ds-sm w-ds-sm flex items-center justify-center", "rounded-ds-md border border-surface-border-strong", "enabled:hover:bg-surface-raised", "disabled:opacity-action-disabled disabled:cursor-not-allowed", "transition-colors"),
61
+ children: /* @__PURE__ */ n(t, {
62
+ icon: a,
63
+ size: "sm"
64
+ })
65
+ })
66
+ ]
67
+ })]
68
+ });
81
69
  }
82
- export {
83
- f as DataTablePagination
84
- };
70
+ //#endregion
71
+ export { o as DataTablePagination };