@ai-matrx/design-system 0.18.3 → 0.18.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 (61) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +22 -0
  3. package/dist/content-transfer.cjs +20 -7
  4. package/dist/content-transfer.cjs.map +1 -1
  5. package/dist/content-transfer.d.cts +6 -0
  6. package/dist/content-transfer.d.ts +6 -0
  7. package/dist/content-transfer.js +20 -7
  8. package/dist/content-transfer.js.map +1 -1
  9. package/dist/data-table/copy-helpers.cjs +53 -0
  10. package/dist/data-table/copy-helpers.cjs.map +1 -1
  11. package/dist/data-table/copy-helpers.d.cts +13 -2
  12. package/dist/data-table/copy-helpers.d.ts +13 -2
  13. package/dist/data-table/copy-helpers.js +55 -0
  14. package/dist/data-table/copy-helpers.js.map +1 -1
  15. package/dist/data-table/copy-types.cjs.map +1 -1
  16. package/dist/data-table/copy-types.d.cts +4 -0
  17. package/dist/data-table/copy-types.d.ts +4 -0
  18. package/dist/data-table/data-row-inspector.cjs +78 -52
  19. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  20. package/dist/data-table/data-row-inspector.js +78 -52
  21. package/dist/data-table/data-row-inspector.js.map +1 -1
  22. package/dist/data-table/data-row-window.cjs +78 -52
  23. package/dist/data-table/data-row-window.cjs.map +1 -1
  24. package/dist/data-table/data-row-window.js +78 -52
  25. package/dist/data-table/data-row-window.js.map +1 -1
  26. package/dist/data-table/filter-engine.d.cts +1 -1
  27. package/dist/data-table/filter-engine.d.ts +1 -1
  28. package/dist/data-table/index.cjs +1587 -1277
  29. package/dist/data-table/index.cjs.map +1 -1
  30. package/dist/data-table/index.d.cts +23 -3
  31. package/dist/data-table/index.d.ts +23 -3
  32. package/dist/data-table/index.js +1574 -1262
  33. package/dist/data-table/index.js.map +1 -1
  34. package/dist/data-table/infer-filter.d.cts +1 -1
  35. package/dist/data-table/infer-filter.d.ts +1 -1
  36. package/dist/data-table/layered-filters.d.cts +1 -1
  37. package/dist/data-table/layered-filters.d.ts +1 -1
  38. package/dist/data-table/pagination.cjs +149 -91
  39. package/dist/data-table/pagination.cjs.map +1 -1
  40. package/dist/data-table/pagination.js +144 -86
  41. package/dist/data-table/pagination.js.map +1 -1
  42. package/dist/data-table/query-control.d.cts +1 -1
  43. package/dist/data-table/query-control.d.ts +1 -1
  44. package/dist/data-table/types.cjs.map +1 -1
  45. package/dist/data-table/types.d.cts +1 -1
  46. package/dist/data-table/types.d.ts +1 -1
  47. package/dist/data-table/url-state.d.cts +1 -1
  48. package/dist/data-table/url-state.d.ts +1 -1
  49. package/dist/data-table/uuid-cell.cjs +58 -45
  50. package/dist/data-table/uuid-cell.cjs.map +1 -1
  51. package/dist/data-table/uuid-cell.js +58 -45
  52. package/dist/data-table/uuid-cell.js.map +1 -1
  53. package/dist/data-table/xlsx.d.cts +1 -1
  54. package/dist/data-table/xlsx.d.ts +1 -1
  55. package/dist/index.cjs +2 -2
  56. package/dist/index.cjs.map +1 -1
  57. package/dist/index.js +2 -2
  58. package/dist/index.js.map +1 -1
  59. package/dist/{types-CD4xGL5Z.d.cts → types-0CNCWvdK.d.cts} +4 -2
  60. package/dist/{types-BhSkeZQ_.d.ts → types-cH8oLqUx.d.ts} +4 -2
  61. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { M as MatrxColumnDef, e as ColumnFilterKind } from '../types-CD4xGL5Z.cjs';
1
+ import { M as MatrxColumnDef, e as ColumnFilterKind } from '../types-0CNCWvdK.cjs';
2
2
  import 'react';
3
3
  import './copy-types.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { M as MatrxColumnDef, e as ColumnFilterKind } from '../types-BhSkeZQ_.js';
1
+ import { M as MatrxColumnDef, e as ColumnFilterKind } from '../types-cH8oLqUx.js';
2
2
  import 'react';
3
3
  import './copy-types.js';
4
4
 
@@ -1,3 +1,3 @@
1
- export { z as LAYERED_FILTER_OPERATORS, B as LAYERED_FILTER_OPERATOR_LABELS, D as LayeredFilterField, E as LayeredFilterOperator, L as LayeredFilterRule, F as columnFiltersToLayeredRules, G as completeLayeredFilterRules, H as decodeLayeredFilterRules, I as encodeLayeredFilterRules, J as isCompleteLayeredFilterRule, K as isLayeredFilterOperator, N as layeredFilterMatchesValue, O as layeredFilterNeedsValue, P as layeredFilterRuleSummary, Q as operatorsForLayeredField } from '../types-CD4xGL5Z.cjs';
1
+ export { z as LAYERED_FILTER_OPERATORS, B as LAYERED_FILTER_OPERATOR_LABELS, D as LayeredFilterField, E as LayeredFilterOperator, L as LayeredFilterRule, F as columnFiltersToLayeredRules, G as completeLayeredFilterRules, H as decodeLayeredFilterRules, I as encodeLayeredFilterRules, J as isCompleteLayeredFilterRule, K as isLayeredFilterOperator, N as layeredFilterMatchesValue, O as layeredFilterNeedsValue, P as layeredFilterRuleSummary, Q as operatorsForLayeredField } from '../types-0CNCWvdK.cjs';
2
2
  import 'react';
3
3
  import './copy-types.cjs';
@@ -1,3 +1,3 @@
1
- export { z as LAYERED_FILTER_OPERATORS, B as LAYERED_FILTER_OPERATOR_LABELS, D as LayeredFilterField, E as LayeredFilterOperator, L as LayeredFilterRule, F as columnFiltersToLayeredRules, G as completeLayeredFilterRules, H as decodeLayeredFilterRules, I as encodeLayeredFilterRules, J as isCompleteLayeredFilterRule, K as isLayeredFilterOperator, N as layeredFilterMatchesValue, O as layeredFilterNeedsValue, P as layeredFilterRuleSummary, Q as operatorsForLayeredField } from '../types-BhSkeZQ_.js';
1
+ export { z as LAYERED_FILTER_OPERATORS, B as LAYERED_FILTER_OPERATOR_LABELS, D as LayeredFilterField, E as LayeredFilterOperator, L as LayeredFilterRule, F as columnFiltersToLayeredRules, G as completeLayeredFilterRules, H as decodeLayeredFilterRules, I as encodeLayeredFilterRules, J as isCompleteLayeredFilterRule, K as isLayeredFilterOperator, N as layeredFilterMatchesValue, O as layeredFilterNeedsValue, P as layeredFilterRuleSummary, Q as operatorsForLayeredField } from '../types-cH8oLqUx.js';
2
2
  import 'react';
3
3
  import './copy-types.js';
@@ -116,19 +116,8 @@ var Button = React.forwardRef(
116
116
  );
117
117
  Button.displayName = "Button";
118
118
 
119
- // src/data-table/icons.tsx
120
- var import_jsx_runtime2 = require("react/jsx-runtime");
121
- function Icon({ children, ...props }) {
122
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", ...props, children });
123
- }
124
- var ChevronLeft = (p) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { ...p, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "m15 18-6-6 6-6" }) });
125
- var ChevronRight = (p) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { ...p, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "m9 18 6-6-6-6" }) });
126
- var ChevronsLeft = (p) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { ...p, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "m11 18-6-6 6-6m8 12-6-6 6-6" }) });
127
- var ChevronsRight = (p) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { ...p, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "m5 18 6-6-6-6m8 12 6-6-6-6" }) });
128
-
129
- // src/select.tsx
130
- var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
131
- var import_class_variance_authority2 = require("class-variance-authority");
119
+ // src/tooltip.tsx
120
+ var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
132
121
  var React3 = __toESM(require("react"), 1);
133
122
 
134
123
  // src/motion.ts
@@ -156,8 +145,61 @@ var ALL_MOTION_CLASSES = [
156
145
  MOTION_SPIN
157
146
  ];
158
147
 
159
- // src/icons.tsx
148
+ // src/portal-container.tsx
149
+ var React2 = __toESM(require("react"), 1);
150
+ var import_jsx_runtime2 = require("react/jsx-runtime");
151
+ var CONTEXT_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.portal-container-context");
152
+ var contextRegistry = globalThis;
153
+ var PortalContainerContext = contextRegistry[CONTEXT_SLOT] ??= React2.createContext(void 0);
154
+ function usePortalContainer(explicit) {
155
+ const injected = React2.useContext(PortalContainerContext);
156
+ if (explicit !== void 0) {
157
+ return explicit ?? void 0;
158
+ }
159
+ return injected ?? void 0;
160
+ }
161
+
162
+ // src/tooltip.tsx
160
163
  var import_jsx_runtime3 = require("react/jsx-runtime");
164
+ var TooltipProvider = TooltipPrimitive.Provider;
165
+ var Tooltip = TooltipPrimitive.Root;
166
+ var TooltipTrigger = TooltipPrimitive.Trigger;
167
+ var TooltipContent = React3.forwardRef(({ className, sideOffset = 4, container, animated = true, ...props }, ref) => {
168
+ const resolved = usePortalContainer(container);
169
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipPrimitive.Portal, { container: resolved ?? null, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
170
+ TooltipPrimitive.Content,
171
+ {
172
+ ref,
173
+ "data-slot": "tooltip-content",
174
+ sideOffset,
175
+ className: cn(
176
+ "z-[10001] overflow-hidden rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md",
177
+ animated && MOTION_POPPER,
178
+ className
179
+ ),
180
+ ...props
181
+ }
182
+ ) });
183
+ });
184
+ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
185
+
186
+ // src/data-table/icons.tsx
187
+ var import_jsx_runtime4 = require("react/jsx-runtime");
188
+ function Icon({ children, ...props }) {
189
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", ...props, children });
190
+ }
191
+ var ChevronLeft = (p) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { ...p, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m15 18-6-6 6-6" }) });
192
+ var ChevronRight = (p) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { ...p, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m9 18 6-6-6-6" }) });
193
+ var ChevronsLeft = (p) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { ...p, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m11 18-6-6 6-6m8 12-6-6 6-6" }) });
194
+ var ChevronsRight = (p) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { ...p, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m5 18 6-6-6-6m8 12 6-6-6-6" }) });
195
+
196
+ // src/select.tsx
197
+ var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
198
+ var import_class_variance_authority2 = require("class-variance-authority");
199
+ var React4 = __toESM(require("react"), 1);
200
+
201
+ // src/icons.tsx
202
+ var import_jsx_runtime5 = require("react/jsx-runtime");
161
203
  function radixProps(props) {
162
204
  return {
163
205
  xmlns: "http://www.w3.org/2000/svg",
@@ -170,7 +212,7 @@ function radixProps(props) {
170
212
  };
171
213
  }
172
214
  function CheckIcon(props) {
173
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...radixProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
215
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { ...radixProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
174
216
  "path",
175
217
  {
176
218
  d: "M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",
@@ -181,7 +223,7 @@ function CheckIcon(props) {
181
223
  ) });
182
224
  }
183
225
  function RadixChevronDownIcon(props) {
184
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...radixProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
226
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { ...radixProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
185
227
  "path",
186
228
  {
187
229
  d: "M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",
@@ -192,7 +234,7 @@ function RadixChevronDownIcon(props) {
192
234
  ) });
193
235
  }
194
236
  function RadixChevronUpIcon(props) {
195
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { ...radixProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
237
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { ...radixProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
196
238
  "path",
197
239
  {
198
240
  d: "M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",
@@ -203,26 +245,12 @@ function RadixChevronUpIcon(props) {
203
245
  ) });
204
246
  }
205
247
 
206
- // src/portal-container.tsx
207
- var React2 = __toESM(require("react"), 1);
208
- var import_jsx_runtime4 = require("react/jsx-runtime");
209
- var CONTEXT_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.portal-container-context");
210
- var contextRegistry = globalThis;
211
- var PortalContainerContext = contextRegistry[CONTEXT_SLOT] ??= React2.createContext(void 0);
212
- function usePortalContainer(explicit) {
213
- const injected = React2.useContext(PortalContainerContext);
214
- if (explicit !== void 0) {
215
- return explicit ?? void 0;
216
- }
217
- return injected ?? void 0;
218
- }
219
-
220
248
  // src/select.tsx
221
- var import_jsx_runtime5 = require("react/jsx-runtime");
249
+ var import_jsx_runtime6 = require("react/jsx-runtime");
222
250
  var Select = SelectPrimitive.Root;
223
251
  var SelectValue = SelectPrimitive.Value;
224
252
  var selectTriggerVariants = (0, import_class_variance_authority2.cva)(
225
- "flex w-full items-center justify-between whitespace-nowrap rounded-md border border-border bg-card text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground transition-colors hover:bg-accent hover:border-accent-foreground/20 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
253
+ "flex w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border border-border bg-card text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground transition-colors hover:bg-accent hover:border-accent-foreground/20 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:min-w-0 [&>span]:line-clamp-1",
226
254
  {
227
255
  variants: {
228
256
  size: {
@@ -236,7 +264,7 @@ var selectTriggerVariants = (0, import_class_variance_authority2.cva)(
236
264
  }
237
265
  }
238
266
  );
239
- var SelectTrigger = React3.forwardRef(({ className, children, hideArrow = false, size, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
267
+ var SelectTrigger = React4.forwardRef(({ className, children, hideArrow = false, size, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
240
268
  SelectPrimitive.Trigger,
241
269
  {
242
270
  ref,
@@ -244,12 +272,12 @@ var SelectTrigger = React3.forwardRef(({ className, children, hideArrow = false,
244
272
  ...props,
245
273
  children: [
246
274
  children,
247
- !hideArrow && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RadixChevronDownIcon, { className: "h-4 w-4 opacity-50" }) })
275
+ !hideArrow && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RadixChevronDownIcon, { className: "h-4 w-4 shrink-0 opacity-50" }) })
248
276
  ]
249
277
  }
250
278
  ));
251
279
  SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
252
- var SelectScrollUpButton = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
280
+ var SelectScrollUpButton = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
253
281
  SelectPrimitive.ScrollUpButton,
254
282
  {
255
283
  ref,
@@ -258,11 +286,11 @@ var SelectScrollUpButton = React3.forwardRef(({ className, ...props }, ref) => /
258
286
  className
259
287
  ),
260
288
  ...props,
261
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RadixChevronUpIcon, {})
289
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RadixChevronUpIcon, {})
262
290
  }
263
291
  ));
264
292
  SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
265
- var SelectScrollDownButton = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
293
+ var SelectScrollDownButton = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
266
294
  SelectPrimitive.ScrollDownButton,
267
295
  {
268
296
  ref,
@@ -271,11 +299,11 @@ var SelectScrollDownButton = React3.forwardRef(({ className, ...props }, ref) =>
271
299
  className
272
300
  ),
273
301
  ...props,
274
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RadixChevronDownIcon, {})
302
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RadixChevronDownIcon, {})
275
303
  }
276
304
  ));
277
305
  SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
278
- var SelectContent = React3.forwardRef(
306
+ var SelectContent = React4.forwardRef(
279
307
  ({
280
308
  className,
281
309
  children,
@@ -285,7 +313,7 @@ var SelectContent = React3.forwardRef(
285
313
  ...props
286
314
  }, ref) => {
287
315
  const portalContainer = usePortalContainer(container);
288
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
316
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
289
317
  SelectPrimitive.Content,
290
318
  {
291
319
  ref,
@@ -303,8 +331,8 @@ var SelectContent = React3.forwardRef(
303
331
  position,
304
332
  ...props,
305
333
  children: [
306
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectScrollUpButton, {}),
307
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
334
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectScrollUpButton, {}),
335
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
308
336
  SelectPrimitive.Viewport,
309
337
  {
310
338
  className: cn(
@@ -314,14 +342,14 @@ var SelectContent = React3.forwardRef(
314
342
  children
315
343
  }
316
344
  ),
317
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectScrollDownButton, {})
345
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectScrollDownButton, {})
318
346
  ]
319
347
  }
320
348
  ) });
321
349
  }
322
350
  );
323
351
  SelectContent.displayName = SelectPrimitive.Content.displayName;
324
- var SelectLabel = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
352
+ var SelectLabel = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
325
353
  SelectPrimitive.Label,
326
354
  {
327
355
  ref,
@@ -330,7 +358,7 @@ var SelectLabel = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE
330
358
  }
331
359
  ));
332
360
  SelectLabel.displayName = SelectPrimitive.Label.displayName;
333
- var SelectItem = React3.forwardRef(({ className, children, description, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
361
+ var SelectItem = React4.forwardRef(({ className, children, description, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
334
362
  SelectPrimitive.Item,
335
363
  {
336
364
  ref,
@@ -341,14 +369,14 @@ var SelectItem = React3.forwardRef(({ className, children, description, ...props
341
369
  ),
342
370
  ...props,
343
371
  children: [
344
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CheckIcon, { className: "h-4 w-4" }) }) }),
345
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectPrimitive.ItemText, { children }),
346
- description ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "block text-xs leading-snug text-muted-foreground", children: description }) : null
372
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CheckIcon, { className: "h-4 w-4" }) }) }),
373
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectPrimitive.ItemText, { children }),
374
+ description ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "block text-xs leading-snug text-muted-foreground", children: description }) : null
347
375
  ]
348
376
  }
349
377
  ));
350
378
  SelectItem.displayName = SelectPrimitive.Item.displayName;
351
- var SelectSeparator = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
379
+ var SelectSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
352
380
  SelectPrimitive.Separator,
353
381
  {
354
382
  ref,
@@ -359,7 +387,37 @@ var SelectSeparator = React3.forwardRef(({ className, ...props }, ref) => /* @__
359
387
  SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
360
388
 
361
389
  // src/data-table/pagination.tsx
362
- var import_jsx_runtime6 = require("react/jsx-runtime");
390
+ var import_jsx_runtime7 = require("react/jsx-runtime");
391
+ function PageNavigationControl({
392
+ label,
393
+ disabledHint,
394
+ visibilityClassName = "inline-flex",
395
+ disabled,
396
+ className,
397
+ ...props
398
+ }) {
399
+ const button = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
400
+ Button,
401
+ {
402
+ ...props,
403
+ disabled,
404
+ "aria-label": label,
405
+ className: cn(visibilityClassName, className)
406
+ }
407
+ );
408
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Tooltip, { children: [
409
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
410
+ "span",
411
+ {
412
+ className: cn(visibilityClassName, "rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring"),
413
+ tabIndex: 0,
414
+ "aria-label": `${label} \u2014 ${disabledHint.toLowerCase()}`,
415
+ children: button
416
+ }
417
+ ) : button }),
418
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipContent, { children: disabled ? disabledHint : label })
419
+ ] });
420
+ }
363
421
  function GenericTablePagination({
364
422
  totalItems,
365
423
  itemsPerPage,
@@ -418,8 +476,8 @@ function GenericTablePagination({
418
476
  className,
419
477
  containerClassName
420
478
  );
421
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { "data-matrx-table-footer": true, className: containerClass, children: [
422
- showItemsPerPageSelect && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
479
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { "data-matrx-table-footer": true, className: containerClass, children: [
480
+ showItemsPerPageSelect && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
423
481
  "div",
424
482
  {
425
483
  className: cn(
@@ -427,13 +485,13 @@ function GenericTablePagination({
427
485
  !compact && "sm:p-1",
428
486
  selectContainerClassName
429
487
  ),
430
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
488
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
431
489
  Select,
432
490
  {
433
491
  value: itemsPerPage.toString(),
434
492
  onValueChange: (value) => onItemsPerPageChange(parseInt(value)),
435
493
  children: [
436
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
494
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
437
495
  SelectTrigger,
438
496
  {
439
497
  "aria-label": "Rows per page",
@@ -441,31 +499,31 @@ function GenericTablePagination({
441
499
  "focus:ring-0",
442
500
  compact ? "relative isolate h-11 w-14 border-0 bg-transparent px-2 text-xs before:absolute before:inset-x-1 before:inset-y-1.5 before:z-0 before:rounded-md before:border before:border-border before:bg-card before:content-[''] hover:before:bg-accent [&>*]:relative [&>*]:z-10 lg:h-7 lg:min-h-7 lg:w-16 lg:border lg:border-input lg:bg-background lg:px-2 lg:before:hidden" : "h-8 w-[3.75rem] text-xs sm:w-36 sm:text-sm"
443
501
  ),
444
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectValue, { placeholder: itemsPerPage.toString() })
502
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SelectValue, { placeholder: itemsPerPage.toString() })
445
503
  }
446
504
  ),
447
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(SelectContent, { children: [
448
- availablePageSizes.map((size) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectItem, { value: size.toString(), children: size }, size)),
449
- showAllOption ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectItem, { value: allValue.toString(), children: allOptionLabel }) : null
505
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(SelectContent, { children: [
506
+ availablePageSizes.map((size) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SelectItem, { value: size.toString(), children: size }, size)),
507
+ showAllOption ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SelectItem, { value: allValue.toString(), children: allOptionLabel }) : null
450
508
  ] })
451
509
  ]
452
510
  }
453
511
  )
454
512
  }
455
513
  ),
456
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
514
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
457
515
  "div",
458
516
  {
459
517
  className: cn("flex min-w-0 justify-center", infoContainerClassName),
460
- children: showPageInfo && !hideEntriesInfo && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
461
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "truncate text-[10px] tabular-nums text-muted-foreground sm:hidden", children: [
518
+ children: showPageInfo && !hideEntriesInfo && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
519
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "truncate text-[10px] tabular-nums text-muted-foreground sm:hidden", children: [
462
520
  startItem,
463
521
  "-",
464
522
  endItem,
465
523
  " / ",
466
524
  totalItems
467
525
  ] }),
468
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
526
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
469
527
  "span",
470
528
  {
471
529
  className: `hidden whitespace-nowrap ${compact ? "text-xs" : "text-sm"} text-muted-foreground sm:inline`,
@@ -475,7 +533,7 @@ function GenericTablePagination({
475
533
  ] })
476
534
  }
477
535
  ),
478
- showPageControls && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
536
+ showPageControls && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
479
537
  "div",
480
538
  {
481
539
  className: cn(
@@ -484,40 +542,40 @@ function GenericTablePagination({
484
542
  controlsContainerClassName
485
543
  ),
486
544
  children: [
487
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
488
- Button,
545
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
546
+ PageNavigationControl,
489
547
  {
490
548
  variant: "outline",
491
549
  size: buttonSize,
492
- "aria-label": "First page",
493
- title: "First page",
550
+ visibilityClassName: "hidden sm:inline-flex",
551
+ label: "First page",
552
+ disabledHint: "Already on the first page",
494
553
  onClick: () => onPageChange(1),
495
554
  disabled: isFirstPageDisabled,
496
555
  className: cn(
497
- "hidden sm:inline-flex",
498
556
  compact ? compactButtonClass : "h-8 w-8 p-0",
499
557
  navButtonClassName
500
558
  ),
501
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChevronsLeft, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
559
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ChevronsLeft, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
502
560
  }
503
561
  ),
504
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
505
- Button,
562
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
563
+ PageNavigationControl,
506
564
  {
507
565
  variant: "outline",
508
566
  size: buttonSize,
509
- "aria-label": "Previous page",
510
- title: "Previous page",
567
+ label: "Previous page",
568
+ disabledHint: "Already on the first page",
511
569
  onClick: () => onPageChange(currentPage - 1),
512
570
  disabled: isFirstPageDisabled,
513
571
  className: cn(
514
572
  compact ? compactButtonClass : "h-8 w-8 p-0",
515
573
  navButtonClassName
516
574
  ),
517
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChevronLeft, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
575
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ChevronLeft, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
518
576
  }
519
577
  ),
520
- getPageNumbers(3).map((page) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
578
+ getPageNumbers(3).map((page) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
521
579
  Button,
522
580
  {
523
581
  variant: currentPage === page ? "default" : "outline",
@@ -532,11 +590,11 @@ function GenericTablePagination({
532
590
  compact && page === currentPage && compactActiveButtonClass,
533
591
  page === currentPage ? pageActiveButtonClassName : pageButtonClassName
534
592
  ),
535
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "relative z-10", children: page })
593
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "relative z-10", children: page })
536
594
  },
537
595
  `mobile-${page}`
538
596
  )),
539
- getPageNumbers().map((page) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
597
+ getPageNumbers().map((page) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
540
598
  Button,
541
599
  {
542
600
  variant: currentPage === page ? "default" : "outline",
@@ -550,46 +608,46 @@ function GenericTablePagination({
550
608
  compact && page === currentPage && compactActiveButtonClass,
551
609
  currentPage === page ? pageActiveButtonClassName : pageButtonClassName
552
610
  ),
553
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "relative z-10", children: page })
611
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "relative z-10", children: page })
554
612
  },
555
613
  `desktop-${page}`
556
614
  )),
557
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
558
- Button,
615
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
616
+ PageNavigationControl,
559
617
  {
560
618
  variant: "outline",
561
619
  size: buttonSize,
562
- "aria-label": "Next page",
563
- title: "Next page",
620
+ label: "Next page",
621
+ disabledHint: "Already on the last page",
564
622
  onClick: () => onPageChange(currentPage + 1),
565
623
  disabled: isLastPageDisabled,
566
624
  className: cn(
567
625
  compact ? compactButtonClass : "h-8 w-8 p-0",
568
626
  navButtonClassName
569
627
  ),
570
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChevronRight, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
628
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ChevronRight, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
571
629
  }
572
630
  ),
573
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
574
- Button,
631
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
632
+ PageNavigationControl,
575
633
  {
576
634
  variant: "outline",
577
635
  size: buttonSize,
578
- "aria-label": "Last page",
579
- title: "Last page",
636
+ visibilityClassName: "hidden sm:inline-flex",
637
+ label: "Last page",
638
+ disabledHint: "Already on the last page",
580
639
  onClick: () => onPageChange(totalPages),
581
640
  disabled: isLastPageDisabled,
582
641
  className: cn(
583
- "hidden sm:inline-flex",
584
642
  compact ? compactButtonClass : "h-8 w-8 p-0",
585
643
  navButtonClassName
586
644
  ),
587
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChevronsRight, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
645
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ChevronsRight, { className: compact ? "h-3.5 w-3.5" : "h-4 w-4" })
588
646
  }
589
647
  )
590
648
  ]
591
649
  }
592
650
  )
593
- ] });
651
+ ] }) });
594
652
  }
595
653
  //# sourceMappingURL=pagination.cjs.map