@timmbr/ui 1.13.1 → 1.14.0

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 (37) hide show
  1. package/dist/components/AttributeValueField/AttributeValueField.d.ts +20 -0
  2. package/dist/components/AttributeValueField/AttributeValueField.d.ts.map +1 -0
  3. package/dist/components/AttributeValueField/AttributeValueField.js +130 -0
  4. package/dist/components/AttributeValueField/index.d.ts +2 -0
  5. package/dist/components/AttributeValueField/index.d.ts.map +1 -0
  6. package/dist/components/Checkbox/Checkbox.js +1 -1
  7. package/dist/components/DataTable/DataTable.d.ts +10 -0
  8. package/dist/components/DataTable/DataTable.d.ts.map +1 -0
  9. package/dist/components/DataTable/DataTable.js +177 -0
  10. package/dist/components/DataTable/DataTable.types.d.ts +42 -0
  11. package/dist/components/DataTable/DataTable.types.d.ts.map +1 -0
  12. package/dist/components/DataTable/index.d.ts +3 -0
  13. package/dist/components/DataTable/index.d.ts.map +1 -0
  14. package/dist/components/Dialog/Dialog.js +1 -1
  15. package/dist/components/Drawer/Drawer.js +1 -1
  16. package/dist/components/FormField/FormField.js +1 -1
  17. package/dist/components/ImageUpload/ImageUpload.js +4 -4
  18. package/dist/components/ImageUpload/subcomponents/ImageUploadDropzone.js +3 -3
  19. package/dist/components/ImageUpload/subcomponents/ImageUploadModal.js +1 -1
  20. package/dist/components/Input/Input.js +3 -3
  21. package/dist/components/Radio/Radio.js +1 -1
  22. package/dist/components/Select/Select.js +2 -2
  23. package/dist/components/Switch/Switch.js +1 -1
  24. package/dist/components/Table/Table.d.ts.map +1 -1
  25. package/dist/components/Table/Table.js +14 -7
  26. package/dist/components/Table/Table.styles.js +2 -2
  27. package/dist/components/Table/Table.types.d.ts +1 -0
  28. package/dist/components/Table/Table.types.d.ts.map +1 -1
  29. package/dist/components/Table/TablePagination.js +3 -3
  30. package/dist/components/Textarea/Textarea.js +2 -2
  31. package/dist/components/Toast/Toast.js +1 -1
  32. package/dist/index.d.ts +2 -0
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +3 -0
  35. package/dist/node_modules/.pnpm/@tanstack_react-table@8.21._59ea1c5c486c125464e3b5e1938c78d1/node_modules/@tanstack/react-table/build/lib/index.js +74 -0
  36. package/dist/node_modules/.pnpm/@tanstack_table-core@8.21.3/node_modules/@tanstack/table-core/build/lib/index.js +3027 -0
  37. package/package.json +5 -3
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ export type AttributeValueFieldType = "STRING" | "INTEGER" | "DECIMAL" | "LIST" | "BOOLEAN";
3
+ export interface AttributeValueFieldOption {
4
+ label: string;
5
+ slug: string;
6
+ swatchHex?: string | null;
7
+ }
8
+ export interface AttributeValueFieldProps {
9
+ type: AttributeValueFieldType;
10
+ value: unknown;
11
+ onChange: (value: unknown) => void;
12
+ options?: AttributeValueFieldOption[];
13
+ unit?: string | null;
14
+ disabled?: boolean;
15
+ size?: "sm" | "md";
16
+ className?: string;
17
+ id?: string;
18
+ }
19
+ export declare const AttributeValueField: React.FC<AttributeValueFieldProps>;
20
+ //# sourceMappingURL=AttributeValueField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttributeValueField.d.ts","sourceRoot":"","sources":["../../../src/components/AttributeValueField/AttributeValueField.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,MAAM,uBAAuB,GAC/B,QAAQ,GACR,SAAS,GACT,SAAS,GACT,MAAM,GACN,SAAS,CAAC;AAEd,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,OAAO,CAAC,EAAE,yBAAyB,EAAE,CAAC;IACtC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAiIlE,CAAC"}
@@ -0,0 +1,130 @@
1
+ "use client";
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import { cn } from '@timmbr/utils';
4
+ import { Switch } from '../Switch/Switch.js';
5
+ import { Inline } from '../Inline/Inline.js';
6
+ import { Input } from '../Input/Input.js';
7
+ import { Text } from '../Text/Text.js';
8
+ import { Stack } from '../Stack/Stack.js';
9
+ import { Checkbox } from '../Checkbox/Checkbox.js';
10
+ import { Select } from '../Select/Select.js';
11
+
12
+ const AttributeValueField = ({
13
+ type,
14
+ value,
15
+ onChange,
16
+ options = [],
17
+ unit,
18
+ disabled,
19
+ size = "sm",
20
+ className,
21
+ id
22
+ }) => {
23
+ const inputSize = size === "sm" ? "sm" : "md";
24
+ if (type === "BOOLEAN") {
25
+ const checked = value === true || value === "true";
26
+ return /* @__PURE__ */ jsx(
27
+ Switch,
28
+ {
29
+ id,
30
+ checked,
31
+ onCheckedChange: (next) => onChange(next),
32
+ disabled,
33
+ className
34
+ }
35
+ );
36
+ }
37
+ if (type === "INTEGER" || type === "DECIMAL") {
38
+ return /* @__PURE__ */ jsxs(Inline, { gap: 2, align: "center", className: cn("w-full", className), children: [
39
+ /* @__PURE__ */ jsx(
40
+ Input,
41
+ {
42
+ id,
43
+ type: "number",
44
+ size: inputSize,
45
+ step: type === "INTEGER" ? 1 : "any",
46
+ value: value === void 0 || value === null ? "" : String(value),
47
+ onChange: (e) => {
48
+ const raw = e.target.value;
49
+ if (raw === "") {
50
+ onChange("");
51
+ return;
52
+ }
53
+ onChange(type === "INTEGER" ? parseInt(raw, 10) : parseFloat(raw));
54
+ },
55
+ disabled,
56
+ className: "flex-1"
57
+ }
58
+ ),
59
+ unit ? /* @__PURE__ */ jsx(Text, { variant: "caption", foreground: "muted", className: "shrink-0", children: unit }) : null
60
+ ] });
61
+ }
62
+ if (type === "LIST" && options.length > 0) {
63
+ const selected = Array.isArray(value) ? value : value ? [String(value)] : [];
64
+ return /* @__PURE__ */ jsx(Stack, { gap: 2, className, children: options.map((opt) => {
65
+ const optValue = opt.slug || opt.label;
66
+ const isChecked = selected.includes(optValue);
67
+ return /* @__PURE__ */ jsxs(Inline, { gap: 2, align: "center", children: [
68
+ /* @__PURE__ */ jsx(
69
+ Checkbox,
70
+ {
71
+ id: id ? `${id}-${opt.slug}` : void 0,
72
+ checked: isChecked,
73
+ disabled,
74
+ onCheckedChange: (checked) => {
75
+ if (checked) {
76
+ onChange([...selected, optValue]);
77
+ } else {
78
+ onChange(selected.filter((v) => v !== optValue));
79
+ }
80
+ }
81
+ }
82
+ ),
83
+ opt.swatchHex ? /* @__PURE__ */ jsx(
84
+ "span",
85
+ {
86
+ className: "size-4 rounded-sm border border-border shrink-0",
87
+ style: { backgroundColor: opt.swatchHex }
88
+ }
89
+ ) : null,
90
+ /* @__PURE__ */ jsx(Text, { variant: "body-2", children: opt.label })
91
+ ] }, opt.slug);
92
+ }) });
93
+ }
94
+ if (type === "LIST" || type === "STRING") {
95
+ if (options.length > 0) {
96
+ const selectValue = value === void 0 || value === null ? "" : String(value);
97
+ return /* @__PURE__ */ jsx(
98
+ Select,
99
+ {
100
+ id,
101
+ size: inputSize,
102
+ value: selectValue,
103
+ onValueChange: (v) => onChange(v),
104
+ disabled,
105
+ className,
106
+ options: [
107
+ { value: "", label: "Select…" },
108
+ ...options.map((o) => ({
109
+ value: o.slug || o.label,
110
+ label: o.label
111
+ }))
112
+ ]
113
+ }
114
+ );
115
+ }
116
+ }
117
+ return /* @__PURE__ */ jsx(
118
+ Input,
119
+ {
120
+ id,
121
+ size: inputSize,
122
+ value: value === void 0 || value === null ? "" : String(value),
123
+ onChange: (e) => onChange(e.target.value),
124
+ disabled,
125
+ className
126
+ }
127
+ );
128
+ };
129
+
130
+ export { AttributeValueField };
@@ -0,0 +1,2 @@
1
+ export { AttributeValueField, type AttributeValueFieldProps, type AttributeValueFieldType, type AttributeValueFieldOption, } from "./AttributeValueField";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AttributeValueField/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,GAC/B,MAAM,uBAAuB,CAAC"}
@@ -83,7 +83,7 @@ const Checkbox = React.forwardRef(
83
83
  children: label
84
84
  }
85
85
  ),
86
- description && /* @__PURE__ */ jsx("p", { className: "text-body-3 text-muted leading-normal mt-0.5", children: description })
86
+ description && /* @__PURE__ */ jsx("p", { className: "text-body-3 text-muted-foreground leading-normal mt-0.5", children: description })
87
87
  ] })
88
88
  ] }),
89
89
  errorMessage && /* @__PURE__ */ jsx("p", { className: "text-body-3 text-destructive font-medium pl-7", children: errorMessage })
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { flexRender, type ColumnDef } from '@tanstack/react-table';
3
+ import type { DataTableProps } from './DataTable.types';
4
+ export declare function DataTable<TData, TValue = unknown>({ data, columns, sorting, onSortingChange, rowSelection, onRowSelectionChange, className, containerClassName, bordered, variant, size, emptyMessage, isLoading, getRowId, onRowClick, stickyHeader, showScrollIndicator, motion: motionProp, }: DataTableProps<TData, TValue>): React.JSX.Element;
5
+ export declare namespace DataTable {
6
+ var displayName: string;
7
+ }
8
+ export { flexRender };
9
+ export type { ColumnDef };
10
+ //# sourceMappingURL=DataTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,UAAU,EAGV,KAAK,SAAS,EACf,MAAM,uBAAuB,CAAC;AAc/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,EACjD,IAAI,EACJ,OAAO,EACP,OAAO,EACP,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,YAAkC,EAClC,SAAiB,EACjB,QAAQ,EACR,UAAU,EACV,YAAmB,EACnB,mBAA0B,EAC1B,MAAM,EAAE,UAAU,GACnB,EAAE,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,qBA+L/B;yBAlNe,SAAS;;;AAsNzB,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,177 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+ import { useReactTable, getSortedRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
5
+ export { flexRender } from '@tanstack/react-table';
6
+ import { ChevronUp, ChevronDown, ChevronsUpDown } from '@timmbr/icons';
7
+ import { cn } from '@timmbr/utils';
8
+ import { motion } from '@timmbr/motion';
9
+ import { resolveMotion } from '../../types/motion.js';
10
+ import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from '../Table/Table.js';
11
+ import { useGlobalAnimation } from '../../providers/AnimationProvider.js';
12
+
13
+ function DataTable({
14
+ data,
15
+ columns,
16
+ sorting,
17
+ onSortingChange,
18
+ rowSelection,
19
+ onRowSelectionChange,
20
+ className,
21
+ containerClassName,
22
+ bordered,
23
+ variant,
24
+ size,
25
+ emptyMessage = "No results found.",
26
+ isLoading = false,
27
+ getRowId,
28
+ onRowClick,
29
+ stickyHeader = true,
30
+ showScrollIndicator = true,
31
+ motion: motionProp
32
+ }) {
33
+ const [internalSorting, setInternalSorting] = React.useState([]);
34
+ const [internalRowSelection, setInternalRowSelection] = React.useState({});
35
+ const scrollContainerRef = React.useRef(null);
36
+ const globalMotion = useGlobalAnimation();
37
+ const { shouldAnimate } = resolveMotion(motionProp, globalMotion);
38
+ const [scrollProgress, setScrollProgress] = React.useState(0);
39
+ React.useEffect(() => {
40
+ const el = scrollContainerRef.current;
41
+ if (!el) return;
42
+ const updateProgress = () => {
43
+ const maxScroll = el.scrollHeight - el.clientHeight;
44
+ setScrollProgress(maxScroll > 0 ? el.scrollTop / maxScroll : 0);
45
+ };
46
+ updateProgress();
47
+ el.addEventListener("scroll", updateProgress, { passive: true });
48
+ const resizeObserver = new ResizeObserver(updateProgress);
49
+ resizeObserver.observe(el);
50
+ return () => {
51
+ el.removeEventListener("scroll", updateProgress);
52
+ resizeObserver.disconnect();
53
+ };
54
+ }, [data]);
55
+ React.useEffect(() => {
56
+ if (typeof scrollContainerRef.current?.scrollTo === "function") {
57
+ scrollContainerRef.current.scrollTo({ top: 0, behavior: "smooth" });
58
+ }
59
+ }, [data]);
60
+ const table = useReactTable({
61
+ data,
62
+ columns,
63
+ state: {
64
+ sorting: sorting !== void 0 ? sorting : internalSorting,
65
+ rowSelection: rowSelection !== void 0 ? rowSelection : internalRowSelection
66
+ },
67
+ onSortingChange: onSortingChange ?? setInternalSorting,
68
+ onRowSelectionChange: onRowSelectionChange ?? setInternalRowSelection,
69
+ getCoreRowModel: getCoreRowModel(),
70
+ getSortedRowModel: getSortedRowModel(),
71
+ enableRowSelection: true,
72
+ getRowId
73
+ });
74
+ const resolvedContainerClassName = cn(
75
+ stickyHeader && "min-h-0 h-full",
76
+ containerClassName
77
+ );
78
+ return /* @__PURE__ */ jsxs(
79
+ Table,
80
+ {
81
+ className: cn(stickyHeader && "border-separate border-spacing-0", className),
82
+ containerClassName: resolvedContainerClassName,
83
+ containerRef: scrollContainerRef,
84
+ bordered,
85
+ variant,
86
+ size,
87
+ children: [
88
+ showScrollIndicator && shouldAnimate && /* @__PURE__ */ jsx("caption", { className: "p-0 caption-top", children: /* @__PURE__ */ jsx(
89
+ motion.div,
90
+ {
91
+ style: { scaleX: scrollProgress },
92
+ className: "sticky top-0 z-30 h-0.5 w-full bg-primary origin-left pointer-events-none transition-transform duration-150 ease-out"
93
+ }
94
+ ) }),
95
+ /* @__PURE__ */ jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, { className: "border-b border-border hover:bg-transparent", children: headerGroup.headers.map((header) => {
96
+ const canSort = header.column.getCanSort();
97
+ const isSorted = header.column.getIsSorted();
98
+ return /* @__PURE__ */ jsx(
99
+ TableHead,
100
+ {
101
+ colSpan: header.colSpan,
102
+ className: cn(
103
+ stickyHeader ? "sticky top-0 z-20 bg-card border-b border-border" : "static shadow-none",
104
+ canSort && "cursor-pointer select-none"
105
+ ),
106
+ onClick: canSort ? header.column.getToggleSortingHandler() : void 0,
107
+ children: header.isPlaceholder ? null : /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
108
+ /* @__PURE__ */ jsx("span", { children: flexRender(
109
+ header.column.columnDef.header,
110
+ header.getContext()
111
+ ) }),
112
+ canSort && /* @__PURE__ */ jsx("span", { className: "inline-flex items-center text-muted-foreground", children: isSorted === "asc" ? /* @__PURE__ */ jsx(ChevronUp, { className: "size-3.5 text-foreground" }) : isSorted === "desc" ? /* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ jsx(ChevronsUpDown, { className: "size-3.5 opacity-40 hover:opacity-100 transition-opacity" }) })
113
+ ] })
114
+ },
115
+ header.id
116
+ );
117
+ }) }, headerGroup.id)) }),
118
+ /* @__PURE__ */ jsx(TableBody, { children: isLoading ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(
119
+ TableCell,
120
+ {
121
+ colSpan: columns.length,
122
+ className: "h-28 text-center text-muted-foreground",
123
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2", children: [
124
+ /* @__PURE__ */ jsx("span", { className: "inline-block size-4 border-2 border-primary border-t-transparent rounded-full animate-spin" }),
125
+ /* @__PURE__ */ jsx("span", { children: "Loading..." })
126
+ ] })
127
+ }
128
+ ) }) : table.getRowModel().rows.length > 0 ? table.getRowModel().rows.map((row, index) => {
129
+ const isSelected = row.getIsSelected();
130
+ const cells = row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id));
131
+ if (shouldAnimate) {
132
+ return /* @__PURE__ */ jsx(
133
+ motion.tr,
134
+ {
135
+ "data-state": isSelected ? "selected" : void 0,
136
+ initial: { opacity: 0, y: 4 },
137
+ animate: { opacity: 1, y: 0 },
138
+ transition: {
139
+ duration: 0.2,
140
+ ease: [0.16, 1, 0.3, 1],
141
+ delay: Math.min(index * 0.015, 0.15)
142
+ },
143
+ className: cn(
144
+ "border-b border-grey-200 dark:border-grey-800 transition-colors data-[state=selected]:bg-primary/5 hover:bg-grey-50/80 dark:hover:bg-grey-900/60",
145
+ onRowClick && "cursor-pointer"
146
+ ),
147
+ onClick: () => onRowClick?.(row),
148
+ children: cells
149
+ },
150
+ row.id
151
+ );
152
+ }
153
+ return /* @__PURE__ */ jsx(
154
+ TableRow,
155
+ {
156
+ "data-state": isSelected ? "selected" : void 0,
157
+ className: cn(onRowClick && "cursor-pointer"),
158
+ onClick: () => onRowClick?.(row),
159
+ children: cells
160
+ },
161
+ row.id
162
+ );
163
+ }) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(
164
+ TableCell,
165
+ {
166
+ colSpan: columns.length,
167
+ className: "h-28 text-center text-muted-foreground",
168
+ children: emptyMessage
169
+ }
170
+ ) }) })
171
+ ]
172
+ }
173
+ );
174
+ }
175
+ DataTable.displayName = "DataTable";
176
+
177
+ export { DataTable };
@@ -0,0 +1,42 @@
1
+ import type * as React from 'react';
2
+ import type { ColumnDef, HeaderContext, CellContext, SortingState, RowSelectionState, OnChangeFn, Row, Table as ReactTableInstance } from '@tanstack/react-table';
3
+ import type { TableProps } from '../Table/Table.types';
4
+ import type { MotionProps } from '../../types/motion';
5
+ export type { ColumnDef, HeaderContext, CellContext, SortingState, RowSelectionState, OnChangeFn, Row, ReactTableInstance, };
6
+ export interface DataTableProps<TData, TValue = unknown> extends MotionProps {
7
+ /** The data to display in the table. */
8
+ data: TData[];
9
+ /** Column definitions conforming to TanStack Table's ColumnDef specification. */
10
+ columns: ColumnDef<TData, TValue>[];
11
+ /** Controlled sorting state. */
12
+ sorting?: SortingState;
13
+ /** Callback fired when sorting changes. */
14
+ onSortingChange?: OnChangeFn<SortingState>;
15
+ /** Controlled row selection state (mapping rowId to boolean). */
16
+ rowSelection?: RowSelectionState;
17
+ /** Callback fired when row selection changes. */
18
+ onRowSelectionChange?: OnChangeFn<RowSelectionState>;
19
+ /** Additional CSS class names for the table element. */
20
+ className?: string;
21
+ /** Additional CSS class names for the table container. */
22
+ containerClassName?: string;
23
+ /** Whether the table should render with borders. */
24
+ bordered?: boolean;
25
+ /** Table visual variant: 'default' | 'striped' | 'bordered'. */
26
+ variant?: TableProps['variant'];
27
+ /** Table row density: 'sm' | 'default'. */
28
+ size?: TableProps['size'];
29
+ /** Custom content to display when there are no records. */
30
+ emptyMessage?: React.ReactNode;
31
+ /** Whether data is loading (renders skeleton or loading indicator). */
32
+ isLoading?: boolean;
33
+ /** Optional function to determine unique ID for each row. */
34
+ getRowId?: (originalRow: TData, index: number, parent?: Row<TData>) => string;
35
+ /** Optional click handler for table rows. */
36
+ onRowClick?: (row: Row<TData>) => void;
37
+ /** Whether the table header remains sticky while scrolling rows. @default true */
38
+ stickyHeader?: boolean;
39
+ /** Whether to render a smooth motion spring scroll progress indicator. @default true */
40
+ showScrollIndicator?: boolean;
41
+ }
42
+ //# sourceMappingURL=DataTable.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTable.types.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,GAAG,EACH,KAAK,IAAI,kBAAkB,EAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,YAAY,EACV,SAAS,EACT,aAAa,EACb,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,GAAG,EACH,kBAAkB,GACnB,CAAC;AAEF,MAAM,WAAW,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAE,SAAQ,WAAW;IAC1E,wCAAwC;IACxC,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,iFAAiF;IACjF,OAAO,EAAE,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC;IACpC,gCAAgC;IAChC,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,2CAA2C;IAC3C,eAAe,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IAC3C,iEAAiE;IACjE,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,iDAAiD;IACjD,oBAAoB,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC;IACrD,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAChC,2CAA2C;IAC3C,IAAI,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAC1B,2DAA2D;IAC3D,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC;IAC9E,6CAA6C;IAC7C,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IACvC,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,wFAAwF;IACxF,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B"}
@@ -0,0 +1,3 @@
1
+ export * from './DataTable';
2
+ export * from './DataTable.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC"}
@@ -45,7 +45,7 @@ const DialogContent = React.forwardRef(({ className, children, motion, ...props
45
45
  DialogPrimitive.Close,
46
46
  {
47
47
  "data-slot": "dialog-close",
48
- className: "absolute right-3 top-3 z-20 flex items-center justify-center min-w-[44px] min-h-[44px] rounded-sm text-muted hover:text-foreground opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus-visible:ring-2 focus-visible:ring-primary cursor-pointer",
48
+ className: "absolute right-3 top-3 z-20 flex items-center justify-center min-w-[44px] min-h-[44px] rounded-sm text-muted-foreground hover:text-foreground opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus-visible:ring-2 focus-visible:ring-primary cursor-pointer",
49
49
  children: [
50
50
  /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
51
51
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
@@ -53,7 +53,7 @@ const DrawerContent = React.forwardRef(({ className, children, side = "right", s
53
53
  DialogPrimitive.Close,
54
54
  {
55
55
  "data-slot": "drawer-close",
56
- className: "absolute right-3 top-3 flex items-center justify-center min-w-[44px] min-h-[44px] rounded-sm text-muted hover:text-foreground opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus-visible:ring-2 focus-visible:ring-primary cursor-pointer",
56
+ className: "absolute right-3 top-3 flex items-center justify-center min-w-[44px] min-h-[44px] rounded-sm text-muted-foreground hover:text-foreground opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus-visible:ring-2 focus-visible:ring-primary cursor-pointer",
57
57
  children: [
58
58
  /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
59
59
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
@@ -40,7 +40,7 @@ const FormField = React.forwardRef(
40
40
  id: `${id}-desc`,
41
41
  className: cn(
42
42
  "text-body-3 mt-1 flex items-center gap-1.5",
43
- isError ? "text-destructive font-medium" : "text-muted"
43
+ isError ? "text-destructive font-medium" : "text-muted-foreground"
44
44
  ),
45
45
  children: [
46
46
  isError ? /* @__PURE__ */ jsx(AlertCircle, { className: "w-3.5 h-3.5 shrink-0", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Info, { className: "w-3.5 h-3.5 shrink-0", "aria-hidden": "true" }),
@@ -203,13 +203,13 @@ const ImageUpload = React.forwardRef(
203
203
  (label || maxFiles || minFiles) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 select-none", children: [
204
204
  label && /* @__PURE__ */ jsxs("label", { className: "text-body-3 font-semibold text-foreground tracking-wide flex items-center gap-1.5", children: [
205
205
  /* @__PURE__ */ jsx("span", { children: label }),
206
- minFiles && minFiles > 0 && /* @__PURE__ */ jsxs("span", { className: "text-caption-lg text-muted font-normal", children: [
206
+ minFiles && minFiles > 0 && /* @__PURE__ */ jsxs("span", { className: "text-caption-lg text-muted-foreground font-normal", children: [
207
207
  "(Min ",
208
208
  minFiles,
209
209
  ")"
210
210
  ] })
211
211
  ] }),
212
- multiple && /* @__PURE__ */ jsxs("span", { className: "text-caption-lg font-medium text-muted", children: [
212
+ multiple && /* @__PURE__ */ jsxs("span", { className: "text-caption-lg font-medium text-muted-foreground", children: [
213
213
  items.length,
214
214
  maxFiles ? ` / ${maxFiles}` : "",
215
215
  " uploaded"
@@ -284,7 +284,7 @@ const ImageUpload = React.forwardRef(
284
284
  onDragLeave: handleDragLeave,
285
285
  onDrop: handleDrop
286
286
  }
287
- ) : /* @__PURE__ */ jsxs("div", { className: "w-full rounded-xl border border-dashed border-grey-300 dark:border-grey-700 bg-grey-50/50 dark:bg-grey-900/30 p-3 text-center text-body-3 text-muted", children: [
287
+ ) : /* @__PURE__ */ jsxs("div", { className: "w-full rounded-xl border border-dashed border-grey-300 dark:border-grey-700 bg-grey-50/50 dark:bg-grey-900/30 p-3 text-center text-body-3 text-muted-foreground", children: [
288
288
  "Maximum upload limit reached (",
289
289
  maxFiles,
290
290
  "/",
@@ -335,7 +335,7 @@ const ImageUpload = React.forwardRef(
335
335
  {
336
336
  className: cn(
337
337
  "text-body-3 mt-1 flex items-center gap-1.5 leading-normal",
338
- isError ? "text-destructive font-medium" : minFilesWarning ? "text-warning dark:text-warning font-medium" : "text-muted"
338
+ isError ? "text-destructive font-medium" : minFilesWarning ? "text-warning dark:text-warning font-medium" : "text-muted-foreground"
339
339
  ),
340
340
  children: [
341
341
  (isError || minFilesWarning) && /* @__PURE__ */ jsx(AlertCircle, { className: "size-3.5 shrink-0", "aria-hidden": "true" }),
@@ -73,7 +73,7 @@ const ImageUploadDropzone = ({
73
73
  " ",
74
74
  "or drag & drop"
75
75
  ] }),
76
- /* @__PURE__ */ jsxs("span", { className: "text-caption-lg text-muted", children: [
76
+ /* @__PURE__ */ jsxs("span", { className: "text-caption-lg text-muted-foreground", children: [
77
77
  mediaType === "video" ? `MP4, WEBM, MOV (Max ${maxMb}MB)` : mediaType === "all" ? `Images & Videos (Max ${maxMb}MB each)` : `PNG, JPG, WEBP (Max ${maxMb}MB each)`,
78
78
  maxFiles && ` • Up to ${maxFiles} items`
79
79
  ] })
@@ -82,7 +82,7 @@ const ImageUploadDropzone = ({
82
82
  /* @__PURE__ */ jsx("div", { className: "size-8 rounded-lg bg-grey-50 dark:bg-grey-800 border border-grey-200 dark:border-grey-700 shadow-xs flex items-center justify-center text-primary", children: isDragging ? /* @__PURE__ */ jsx(UploadCloudIcon, { className: "size-4 text-primary animate-bounce" }) : /* @__PURE__ */ jsx(ImageIcon, { className: "size-4 text-primary" }) }),
83
83
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
84
84
  /* @__PURE__ */ jsx("span", { className: "text-body-3 font-semibold text-primary underline", children: "Upload" }),
85
- /* @__PURE__ */ jsxs("span", { className: "text-caption text-muted", children: [
85
+ /* @__PURE__ */ jsxs("span", { className: "text-caption text-muted-foreground", children: [
86
86
  "Max ",
87
87
  maxMb,
88
88
  "MB"
@@ -95,7 +95,7 @@ const ImageUploadDropzone = ({
95
95
  /* @__PURE__ */ jsx("span", { className: "text-primary underline font-semibold", children: "Click to upload" }),
96
96
  " or drag and drop"
97
97
  ] }),
98
- /* @__PURE__ */ jsx("span", { className: "text-caption-lg text-muted", children: mediaType === "video" ? `MP4, WEBM, MOV (Max ${maxMb}MB)` : mediaType === "all" ? `PNG, JPG, WEBP, MP4 (Max ${maxMb}MB)` : `PNG, JPG, or WEBP (Max ${maxMb}MB)` })
98
+ /* @__PURE__ */ jsx("span", { className: "text-caption-lg text-muted-foreground", children: mediaType === "video" ? `MP4, WEBM, MOV (Max ${maxMb}MB)` : mediaType === "all" ? `PNG, JPG, WEBP, MP4 (Max ${maxMb}MB)` : `PNG, JPG, or WEBP (Max ${maxMb}MB)` })
99
99
  ] })
100
100
  ] })
101
101
  }
@@ -58,7 +58,7 @@ const ImageUploadModal = ({
58
58
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
59
59
  /* @__PURE__ */ jsx("span", { className: "text-body-3 font-semibold text-foreground tracking-wide truncate max-w-xs sm:max-w-md", children: activeItem.name || `Media Item #${activeIndex + 1}` }),
60
60
  activeIndex === 0 && /* @__PURE__ */ jsx("span", { className: "bg-success/10 text-success dark:text-success border border-success/20 text-caption font-semibold px-2 py-0.5 rounded-full", children: "Cover" }),
61
- /* @__PURE__ */ jsxs("span", { className: "text-caption-lg text-muted", children: [
61
+ /* @__PURE__ */ jsxs("span", { className: "text-caption-lg text-muted-foreground", children: [
62
62
  "(",
63
63
  activeIndex + 1,
64
64
  " of ",
@@ -151,7 +151,7 @@ const Input = React.forwardRef(
151
151
  type: "button",
152
152
  tabIndex: -1,
153
153
  onClick: handleClear,
154
- className: "flex items-center justify-center ml-1.5 p-1 rounded-sm text-muted hover:text-foreground hover:bg-grey-100 dark:hover:bg-grey-800 transition-colors cursor-pointer active:scale-95",
154
+ className: "flex items-center justify-center ml-1.5 p-1 rounded-sm text-muted-foreground hover:text-foreground hover:bg-grey-100 dark:hover:bg-grey-800 transition-colors cursor-pointer active:scale-95",
155
155
  "aria-label": "Clear input",
156
156
  children: /* @__PURE__ */ jsx(X, { className: "w-3.5 h-3.5" })
157
157
  }
@@ -162,12 +162,12 @@ const Input = React.forwardRef(
162
162
  type: "button",
163
163
  tabIndex: -1,
164
164
  onClick: () => setShowPassword((prev) => !prev),
165
- className: "flex items-center justify-center ml-1.5 p-1 rounded-sm text-muted hover:text-foreground hover:bg-grey-100 dark:hover:bg-grey-800 transition-colors cursor-pointer active:scale-95",
165
+ className: "flex items-center justify-center ml-1.5 p-1 rounded-sm text-muted-foreground hover:text-foreground hover:bg-grey-100 dark:hover:bg-grey-800 transition-colors cursor-pointer active:scale-95",
166
166
  "aria-label": showPassword ? "Hide password" : "Show password",
167
167
  children: showPassword ? /* @__PURE__ */ jsx(EyeOff, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx(Eye, { className: "w-4 h-4" })
168
168
  }
169
169
  ),
170
- rightAdornment && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center ml-2 text-muted shrink-0", children: rightAdornment })
170
+ rightAdornment && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center ml-2 text-muted-foreground shrink-0", children: rightAdornment })
171
171
  ]
172
172
  }
173
173
  ),
@@ -111,7 +111,7 @@ const RadioGroup = React.forwardRef(
111
111
  {
112
112
  className: cn(
113
113
  "text-body-3 mt-1 flex items-center gap-1.5",
114
- isError ? "text-destructive font-medium" : "text-muted"
114
+ isError ? "text-destructive font-medium" : "text-muted-foreground"
115
115
  ),
116
116
  children: [
117
117
  isError ? /* @__PURE__ */ jsx(AlertCircle, { className: "w-3.5 h-3.5 shrink-0", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Info, { className: "w-3.5 h-3.5 shrink-0", "aria-hidden": "true" }),
@@ -79,7 +79,7 @@ const Select = React.forwardRef(
79
79
  ),
80
80
  children: [
81
81
  /* @__PURE__ */ jsx(SelectPrimitive.Value, { placeholder }),
82
- /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-muted opacity-60 transition-transform duration-200" }) })
82
+ /* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-muted-foreground opacity-60 transition-transform duration-200" }) })
83
83
  ]
84
84
  }
85
85
  ),
@@ -115,7 +115,7 @@ const Select = React.forwardRef(
115
115
  {
116
116
  className: cn(
117
117
  "text-body-3 mt-1 flex items-center gap-1.5",
118
- isError ? "text-destructive font-medium" : "text-muted"
118
+ isError ? "text-destructive font-medium" : "text-muted-foreground"
119
119
  ),
120
120
  children: [
121
121
  isError ? /* @__PURE__ */ jsx(AlertCircle, { className: "w-3.5 h-3.5 shrink-0", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Info, { className: "w-3.5 h-3.5 shrink-0", "aria-hidden": "true" }),
@@ -74,7 +74,7 @@ const Switch = React.forwardRef(
74
74
  children: label
75
75
  }
76
76
  ),
77
- description && /* @__PURE__ */ jsx("p", { className: "text-body-3 text-muted leading-normal mt-0.5", children: description })
77
+ description && /* @__PURE__ */ jsx("p", { className: "text-body-3 text-muted-foreground leading-normal mt-0.5", children: description })
78
78
  ] }),
79
79
  /* @__PURE__ */ jsx("div", { className: "shrink-0 pt-0.5", children: switchElement })
80
80
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,KAAK,qFAWjB,CAAC;AAGF,eAAO,MAAM,WAAW,kGASvB,CAAC;AAGF,eAAO,MAAM,SAAS,gGASrB,CAAC;AAGF,eAAO,MAAM,WAAW,kGASvB,CAAC;AAGF,eAAO,MAAM,QAAQ,2FASpB,CAAC;AAGF,eAAO,MAAM,SAAS,6FASrB,CAAC;AAGF,eAAO,MAAM,SAAS,6FASrB,CAAC;AAGF,eAAO,MAAM,YAAY,mGASxB,CAAC;AAGF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/Table/Table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,KAAK,qFAcjB,CAAC;AAGF,eAAO,MAAM,WAAW,kGASvB,CAAC;AAGF,eAAO,MAAM,SAAS,gGASrB,CAAC;AAGF,eAAO,MAAM,WAAW,kGASvB,CAAC;AAGF,eAAO,MAAM,QAAQ,2FASpB,CAAC;AAGF,eAAO,MAAM,SAAS,6FASrB,CAAC;AAGF,eAAO,MAAM,SAAS,6FASrB,CAAC;AAGF,eAAO,MAAM,YAAY,mGASxB,CAAC;AAGF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
@@ -5,15 +5,22 @@ import { cn } from '@timmbr/utils';
5
5
  import { tableVariants, tableContainerVariants, tableCellVariants, tableFooterVariants, tableHeadVariants, tableRowVariants } from './Table.styles.js';
6
6
 
7
7
  const Table = React.forwardRef(
8
- ({ className, containerClassName, variant, size, bordered, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: cn(tableContainerVariants({ bordered }), containerClassName), children: /* @__PURE__ */ jsx(
9
- "table",
8
+ ({ className, containerClassName, containerRef, variant, size, bordered, ...props }, ref) => /* @__PURE__ */ jsx(
9
+ "div",
10
10
  {
11
- ref,
12
- "data-slot": "table",
13
- className: cn(tableVariants({ variant, size }), className),
14
- ...props
11
+ ref: containerRef,
12
+ className: cn(tableContainerVariants({ bordered }), containerClassName),
13
+ children: /* @__PURE__ */ jsx(
14
+ "table",
15
+ {
16
+ ref,
17
+ "data-slot": "table",
18
+ className: cn(tableVariants({ variant, size }), className),
19
+ ...props
20
+ }
21
+ )
15
22
  }
16
- ) })
23
+ )
17
24
  );
18
25
  Table.displayName = "Table";
19
26
  const TableHeader = React.forwardRef(