sodtrack-web-ui 0.8.0 → 0.9.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.
package/dist/alert.mjs CHANGED
@@ -1,5 +1,5 @@
1
- export { Alert } from './chunk-EFMITOLW.mjs';
2
- import './chunk-GY2JBRY6.mjs';
1
+ export { Alert } from './chunk-XDQ2Y2UR.mjs';
3
2
  import './chunk-P3UP2HUA.mjs';
4
3
  import './chunk-2MWIFYP3.mjs';
4
+ import './chunk-ERH7LWVL.mjs';
5
5
  import './chunk-PLJ6ZHAI.mjs';
package/dist/button.d.mts CHANGED
@@ -8,7 +8,7 @@ type ButtonProps = {
8
8
  } & React__default.DetailedHTMLProps<React__default.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> & VariantProps<typeof button>;
9
9
  declare const Button: FC<ButtonProps>;
10
10
  declare const button: (props?: ({
11
- size?: "large" | "medium" | "small" | undefined;
11
+ size?: "small" | "large" | "medium" | undefined;
12
12
  variant?: "link" | "contained" | "outlined" | "ghost" | "standard" | undefined;
13
13
  loading?: boolean | undefined;
14
14
  } & ({
package/dist/button.mjs CHANGED
@@ -1,5 +1,5 @@
1
- export { Button } from './chunk-QQLQXUJA.mjs';
2
- import './chunk-GY2JBRY6.mjs';
1
+ export { Button } from './chunk-4YE5CU7E.mjs';
3
2
  import './chunk-P3UP2HUA.mjs';
4
3
  import './chunk-2MWIFYP3.mjs';
4
+ import './chunk-ERH7LWVL.mjs';
5
5
  import './chunk-PLJ6ZHAI.mjs';
@@ -3,7 +3,7 @@ import { FC, HTMLAttributes } from 'react';
3
3
 
4
4
  declare const chipStatus: (props?: ({
5
5
  variant?: "success" | "info" | "warning" | "error" | undefined;
6
- size?: "sm" | "md" | "xs" | undefined;
6
+ size?: "xs" | "sm" | "md" | undefined;
7
7
  } & ({
8
8
  class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
9
9
  [x: string]: any;
@@ -1,6 +1,6 @@
1
- import { LoaderCircleIcon } from './chunk-GY2JBRY6.mjs';
2
1
  import { cn } from './chunk-P3UP2HUA.mjs';
3
2
  import { require_jsx_runtime } from './chunk-2MWIFYP3.mjs';
3
+ import { LoaderCircleIcon } from './chunk-ERH7LWVL.mjs';
4
4
  import { __toESM, require_react } from './chunk-PLJ6ZHAI.mjs';
5
5
  import { cva } from 'cva';
6
6
 
@@ -76,6 +76,16 @@ var ChevronDown = createLucideIcon("ChevronDown", [
76
76
  ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
77
77
  ]);
78
78
 
79
+ // node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-left.js
80
+ var ChevronLeft = createLucideIcon("ChevronLeft", [
81
+ ["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
82
+ ]);
83
+
84
+ // node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-right.js
85
+ var ChevronRight = createLucideIcon("ChevronRight", [
86
+ ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
87
+ ]);
88
+
79
89
  // node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/circle-check.js
80
90
  var CircleCheck = createLucideIcon("CircleCheck", [
81
91
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
@@ -128,6 +138,8 @@ var CloseIcon = X;
128
138
  var InfoIcon = Info;
129
139
  var TriangleAlertIcon = TriangleAlert;
130
140
  var ChevronDownIcon = ChevronDown;
141
+ var ChevronRightIcon = ChevronRight;
142
+ var ChevronLeftIcon = ChevronLeft;
131
143
  /*! Bundled license information:
132
144
 
133
145
  lucide-react/dist/esm/shared/src/utils.js:
@@ -170,6 +182,22 @@ lucide-react/dist/esm/icons/chevron-down.js:
170
182
  * See the LICENSE file in the root directory of this source tree.
171
183
  *)
172
184
 
185
+ lucide-react/dist/esm/icons/chevron-left.js:
186
+ (**
187
+ * @license lucide-react v0.379.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ *)
192
+
193
+ lucide-react/dist/esm/icons/chevron-right.js:
194
+ (**
195
+ * @license lucide-react v0.379.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ *)
200
+
173
201
  lucide-react/dist/esm/icons/circle-check.js:
174
202
  (**
175
203
  * @license lucide-react v0.379.0 - ISC
@@ -227,4 +255,4 @@ lucide-react/dist/esm/lucide-react.js:
227
255
  *)
228
256
  */
229
257
 
230
- export { ChevronDownIcon, CircleCheckIcon, CircleXIcon, CloseIcon, InfoIcon, LoaderCircleIcon, TriangleAlertIcon };
258
+ export { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, CircleCheckIcon, CircleXIcon, CloseIcon, InfoIcon, LoaderCircleIcon, TriangleAlertIcon };
@@ -1,6 +1,6 @@
1
- import { ChevronDownIcon } from './chunk-GY2JBRY6.mjs';
2
1
  import { cn } from './chunk-P3UP2HUA.mjs';
3
2
  import { require_jsx_runtime } from './chunk-2MWIFYP3.mjs';
3
+ import { ChevronDownIcon } from './chunk-ERH7LWVL.mjs';
4
4
  import { __toESM, require_react } from './chunk-PLJ6ZHAI.mjs';
5
5
  import { Label } from '@radix-ui/react-label';
6
6
 
@@ -0,0 +1,143 @@
1
+ import { cn } from './chunk-P3UP2HUA.mjs';
2
+ import { require_jsx_runtime } from './chunk-2MWIFYP3.mjs';
3
+ import { ChevronDownIcon } from './chunk-ERH7LWVL.mjs';
4
+ import { __toESM, require_react } from './chunk-PLJ6ZHAI.mjs';
5
+ import { useFloating, autoUpdate, offset, flip, size, useClick, useDismiss, useRole, useListNavigation, useTypeahead, useInteractions, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
6
+
7
+ // src/components/rows-per-page-select.tsx
8
+ var React = __toESM(require_react());
9
+ var import_jsx_runtime = __toESM(require_jsx_runtime());
10
+ var options = ["10", "25", "50"];
11
+ var RowsPerPageSelect = ({
12
+ value,
13
+ onRowsPerPageChange
14
+ }) => {
15
+ const [isOpen, setIsOpen] = React.useState(false);
16
+ const [activeIndex, setActiveIndex] = React.useState(null);
17
+ const [selectedIndex, setSelectedIndex] = React.useState(
18
+ options.findIndex((option) => option === value)
19
+ );
20
+ const { refs, floatingStyles, context } = useFloating({
21
+ placement: "bottom-start",
22
+ open: isOpen,
23
+ onOpenChange: setIsOpen,
24
+ whileElementsMounted: autoUpdate,
25
+ middleware: [
26
+ offset(5),
27
+ flip({ padding: 10 }),
28
+ size({
29
+ apply({ rects, elements, availableHeight }) {
30
+ Object.assign(elements.floating.style, {
31
+ maxHeight: `${availableHeight}px`,
32
+ minWidth: `${rects.reference.width}px`
33
+ });
34
+ },
35
+ padding: 10
36
+ })
37
+ ]
38
+ });
39
+ const listRef = React.useRef([]);
40
+ const listContentRef = React.useRef(options);
41
+ const isTypingRef = React.useRef(false);
42
+ const click = useClick(context, { event: "mousedown" });
43
+ const dismiss = useDismiss(context);
44
+ const role = useRole(context, { role: "listbox" });
45
+ const listNav = useListNavigation(context, {
46
+ listRef,
47
+ activeIndex,
48
+ selectedIndex,
49
+ onNavigate: setActiveIndex,
50
+ // This is a large list, allow looping.
51
+ loop: true
52
+ });
53
+ const typeahead = useTypeahead(context, {
54
+ listRef: listContentRef,
55
+ activeIndex,
56
+ selectedIndex,
57
+ onMatch: isOpen ? setActiveIndex : setSelectedIndex,
58
+ onTypingChange(isTyping) {
59
+ isTypingRef.current = isTyping;
60
+ }
61
+ });
62
+ const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions(
63
+ [dismiss, role, listNav, typeahead, click]
64
+ );
65
+ const handleSelect = (index) => {
66
+ onRowsPerPageChange(options[index]);
67
+ setSelectedIndex(index);
68
+ setIsOpen(false);
69
+ };
70
+ const selectedItemLabel = selectedIndex !== null ? options[selectedIndex] : void 0;
71
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { minWidth: "40px" }, children: [
72
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
73
+ "div",
74
+ {
75
+ tabIndex: 0,
76
+ ref: refs.setReference,
77
+ "aria-labelledby": "select-label",
78
+ "aria-autocomplete": "none",
79
+ ...getReferenceProps(),
80
+ className: "flex cursor-pointer items-center gap-1 text-sm leading-[120%] text-neutral-900",
81
+ children: [
82
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: selectedItemLabel }),
83
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
84
+ ChevronDownIcon,
85
+ {
86
+ width: "18px",
87
+ height: "18px",
88
+ className: "h-[1.125rem] w-[1.125rem] text-neutral-900"
89
+ }
90
+ )
91
+ ]
92
+ }
93
+ ),
94
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingFocusManager, { context, modal: false, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
95
+ "div",
96
+ {
97
+ ref: refs.setFloating,
98
+ className: "overflow-y-auto rounded-lg bg-neutral-100 text-sm font-semibold leading-[120%] text-neutral-900 outline-none",
99
+ style: {
100
+ ...floatingStyles
101
+ },
102
+ ...getFloatingProps(),
103
+ children: options.map((value2, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
104
+ "div",
105
+ {
106
+ ref: (node) => {
107
+ listRef.current[i] = node;
108
+ },
109
+ role: "option",
110
+ tabIndex: i === activeIndex ? 0 : -1,
111
+ "aria-selected": i === selectedIndex && i === activeIndex,
112
+ className: cn(
113
+ "cursor-default p-[0.625rem]",
114
+ i === activeIndex && "bg-neutral-200"
115
+ ),
116
+ ...getItemProps({
117
+ // Handle pointer select.
118
+ onClick() {
119
+ handleSelect(i);
120
+ },
121
+ // Handle keyboard select.
122
+ onKeyDown(event) {
123
+ if (event.key === "Enter") {
124
+ event.preventDefault();
125
+ handleSelect(i);
126
+ }
127
+ if (event.key === " " && !isTypingRef.current) {
128
+ event.preventDefault();
129
+ handleSelect(i);
130
+ }
131
+ }
132
+ }),
133
+ children: value2
134
+ },
135
+ value2
136
+ ))
137
+ }
138
+ ) }) })
139
+ ] });
140
+ };
141
+ var rows_per_page_select_default = RowsPerPageSelect;
142
+
143
+ export { rows_per_page_select_default };
@@ -0,0 +1,192 @@
1
+ import { rows_per_page_select_default } from './chunk-O5QOPJOD.mjs';
2
+ import { ScrollArea, ScrollBar } from './chunk-ZVOUAD54.mjs';
3
+ import { cn } from './chunk-P3UP2HUA.mjs';
4
+ import { require_jsx_runtime } from './chunk-2MWIFYP3.mjs';
5
+ import { ChevronLeftIcon, ChevronRightIcon } from './chunk-ERH7LWVL.mjs';
6
+ import { __toESM } from './chunk-PLJ6ZHAI.mjs';
7
+ import { useReactTable, getCoreRowModel, getPaginationRowModel, flexRender } from '@tanstack/react-table';
8
+
9
+ var import_jsx_runtime = __toESM(require_jsx_runtime());
10
+ function DataTable({
11
+ columns,
12
+ data,
13
+ rowsCount,
14
+ pagination,
15
+ onPaginationChange,
16
+ noResults,
17
+ rowsPerPageText = "Rows per page",
18
+ ofText = "of",
19
+ className,
20
+ ...props
21
+ }) {
22
+ const table = useReactTable({
23
+ data,
24
+ columns,
25
+ rowCount: rowsCount,
26
+ state: { pagination },
27
+ onPaginationChange,
28
+ manualPagination: true,
29
+ getCoreRowModel: getCoreRowModel(),
30
+ getPaginationRowModel: getPaginationRowModel()
31
+ });
32
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
33
+ "div",
34
+ {
35
+ className: cn(
36
+ "flex flex-col overflow-hidden rounded-2xl border border-neutral-200 bg-neutral-50",
37
+ className
38
+ ),
39
+ ...props,
40
+ children: [
41
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ScrollArea, { children: [
42
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollBar, { orientation: "horizontal" }),
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
44
+ "table",
45
+ {
46
+ cellPadding: 0,
47
+ cellSpacing: 0,
48
+ className: "w-full table-auto overflow-hidden text-neutral-900",
49
+ children: [
50
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("colgroup", { children: table.getHeaderGroups()[0].headers.map((header) => {
51
+ const width = header.column.getSize() / table.getHeaderGroups()[0].headers.reduce((acc, curr) => acc + curr.getSize(), 0) * 100;
52
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
53
+ "col",
54
+ {
55
+ span: 1,
56
+ style: {
57
+ width: `${width}%`
58
+ }
59
+ },
60
+ header.id
61
+ );
62
+ }) }),
63
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { className: "bg-neutral-100", children: headerGroup.headers.map((header) => {
64
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
+ "th",
66
+ {
67
+ className: "h-14 px-4 py-3 text-left text-sm font-semibold uppercase leading-[120%] tracking-sm",
68
+ children: header.isPlaceholder ? null : flexRender(
69
+ header.column.columnDef.header,
70
+ header.getContext()
71
+ )
72
+ },
73
+ header.id
74
+ );
75
+ }) }, headerGroup.id)) }),
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
77
+ "tr",
78
+ {
79
+ "data-state": row.getIsSelected() && "selected",
80
+ className: "text-base font-normal leading-[130%] tracking-body",
81
+ children: row.getVisibleCells().map((cell) => {
82
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { className: cn("p-4"), children: flexRender(
83
+ cell.column.columnDef.cell,
84
+ cell.getContext()
85
+ ) }, cell.id);
86
+ })
87
+ },
88
+ row.id
89
+ )) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { colSpan: columns.length, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
90
+ "div",
91
+ {
92
+ className: "flex flex-col items-center justify-center px-10 pb-12 pt-10 font-normal leading-[120%] tracking-body-lg text-neutral-500",
93
+ children: [
94
+ noResults.icon,
95
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "mt-2 text-lg text-neutral-500", children: noResults.title }),
96
+ noResults.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm text-neutral-500", children: noResults.description })
97
+ ]
98
+ }
99
+ ) }) }) })
100
+ ]
101
+ }
102
+ )
103
+ ] }),
104
+ pagination && onPaginationChange && !!rowsCount && data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
105
+ "div",
106
+ {
107
+ className: "mx-6 ml-auto flex h-8 items-center justify-end gap-6 border-t-1 border-t-neutral-200",
108
+ children: [
109
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center", children: [
110
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
111
+ "span",
112
+ {
113
+ className: "mr-2 text-sm font-semibold leading-[120%] tracking-sm text-neutral-700",
114
+ children: `${rowsPerPageText}:`
115
+ }
116
+ ),
117
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
118
+ rows_per_page_select_default,
119
+ {
120
+ value: "10",
121
+ onRowsPerPageChange: (value) => {
122
+ table.setPageSize(Number(value));
123
+ table.setPageIndex(0);
124
+ }
125
+ }
126
+ )
127
+ ] }),
128
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
129
+ "span",
130
+ {
131
+ className: "text-sm font-normal leading-[120%] tracking-sm text-neutral-900",
132
+ children: `${pagination?.pageIndex * pagination.pageSize + 1}-${rowsCount > pagination?.pageIndex * pagination.pageSize + pagination.pageSize ? pagination?.pageIndex * pagination.pageSize + pagination.pageSize : rowsCount} ${ofText} ${rowsCount}`
133
+ }
134
+ ),
135
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center", children: [
136
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
137
+ "div",
138
+ {
139
+ className: cn(
140
+ "flex h-8 items-center px-3",
141
+ table.getCanPreviousPage() ? "cursor-pointer" : "cursor-not-allowed"
142
+ ),
143
+ onClick: () => {
144
+ if (table.getCanPreviousPage()) {
145
+ table.previousPage();
146
+ }
147
+ },
148
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
149
+ ChevronLeftIcon,
150
+ {
151
+ className: cn(
152
+ "h-[1.125rem] w-[1.125rem]",
153
+ table.getCanPreviousPage() ? "text-neutral-900" : "text-neutral-500"
154
+ )
155
+ }
156
+ )
157
+ }
158
+ ),
159
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
160
+ "div",
161
+ {
162
+ className: cn(
163
+ "flex h-8 items-center px-3",
164
+ table.getCanNextPage() ? "cursor-pointer" : "cursor-not-allowed"
165
+ ),
166
+ onClick: () => {
167
+ if (table.getCanNextPage()) {
168
+ table.nextPage();
169
+ }
170
+ },
171
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
172
+ ChevronRightIcon,
173
+ {
174
+ className: cn(
175
+ "h-[1.125rem] w-[1.125rem]",
176
+ table.getCanNextPage() ? "text-neutral-900" : "text-neutral-500"
177
+ )
178
+ }
179
+ )
180
+ }
181
+ )
182
+ ] })
183
+ ]
184
+ }
185
+ )
186
+ ]
187
+ }
188
+ );
189
+ }
190
+ var data_table_default = DataTable;
191
+
192
+ export { DataTable, data_table_default };
@@ -1,6 +1,6 @@
1
- import { TriangleAlertIcon, CircleCheckIcon, CircleXIcon, InfoIcon, CloseIcon } from './chunk-GY2JBRY6.mjs';
2
1
  import { cn } from './chunk-P3UP2HUA.mjs';
3
2
  import { require_jsx_runtime } from './chunk-2MWIFYP3.mjs';
3
+ import { TriangleAlertIcon, CircleCheckIcon, CircleXIcon, InfoIcon, CloseIcon } from './chunk-ERH7LWVL.mjs';
4
4
  import { __toESM, require_react } from './chunk-PLJ6ZHAI.mjs';
5
5
  import { cva } from 'cva';
6
6
 
@@ -1,5 +1,5 @@
1
- import { LoaderCircleIcon } from './chunk-GY2JBRY6.mjs';
2
1
  import { require_jsx_runtime } from './chunk-2MWIFYP3.mjs';
2
+ import { LoaderCircleIcon } from './chunk-ERH7LWVL.mjs';
3
3
  import { __toESM } from './chunk-PLJ6ZHAI.mjs';
4
4
  import { cva } from 'cva';
5
5
 
@@ -0,0 +1,49 @@
1
+ import { cn } from './chunk-P3UP2HUA.mjs';
2
+ import { require_jsx_runtime } from './chunk-2MWIFYP3.mjs';
3
+ import { __toESM, require_react } from './chunk-PLJ6ZHAI.mjs';
4
+ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
5
+
6
+ // src/components/scrollarea.tsx
7
+ var React = __toESM(require_react());
8
+ var import_jsx_runtime = __toESM(require_jsx_runtime());
9
+ var ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
10
+ ScrollAreaPrimitive.Root,
11
+ {
12
+ ref,
13
+ className: cn("relative h-full overflow-hidden", className),
14
+ ...props,
15
+ children: [
16
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit] [&>div]:!flex [&>div]:h-full [&>div]:flex-col", children }),
17
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollBar, {}),
18
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaPrimitive.Corner, {})
19
+ ]
20
+ }
21
+ ));
22
+ ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
23
+ var ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
24
+ ScrollAreaPrimitive.ScrollAreaScrollbar,
25
+ {
26
+ ref,
27
+ orientation,
28
+ className: cn(
29
+ "flex touch-none select-none bg-neutral-200 transition-colors",
30
+ orientation === "vertical" && "h-full w-4 py-2",
31
+ orientation === "horizontal" && "h-4 flex-col px-2",
32
+ className
33
+ ),
34
+ ...props,
35
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
36
+ ScrollAreaPrimitive.ScrollAreaThumb,
37
+ {
38
+ className: cn(
39
+ "relative flex-1 rounded bg-primary-500",
40
+ orientation === "vertical" && "mx-1 w-2",
41
+ orientation === "horizontal" && "my-1 h-2"
42
+ )
43
+ }
44
+ )
45
+ }
46
+ ));
47
+ ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
48
+
49
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,24 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default, { HTMLAttributes } from 'react';
3
+ import { ColumnDef, OnChangeFn, PaginationState } from '@tanstack/react-table';
4
+
5
+ interface DataTableProps<TData, TValue> extends HTMLAttributes<HTMLDivElement> {
6
+ columns: ColumnDef<TData, TValue>[];
7
+ data: TData[];
8
+ rowsCount?: number;
9
+ pagination?: {
10
+ pageIndex: number;
11
+ pageSize: number;
12
+ };
13
+ onPaginationChange?: OnChangeFn<PaginationState>;
14
+ noResults: {
15
+ icon: React__default.ReactNode;
16
+ title: string;
17
+ description?: string;
18
+ };
19
+ rowsPerPageText?: string;
20
+ ofText?: string;
21
+ }
22
+ declare function DataTable<TData, TValue>({ columns, data, rowsCount, pagination, onPaginationChange, noResults, rowsPerPageText, ofText, className, ...props }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
23
+
24
+ export { DataTable, DataTable as default };
@@ -0,0 +1,7 @@
1
+ export { DataTable, data_table_default as default } from './chunk-V2LMCQ4I.mjs';
2
+ import './chunk-O5QOPJOD.mjs';
3
+ import './chunk-ZVOUAD54.mjs';
4
+ import './chunk-P3UP2HUA.mjs';
5
+ import './chunk-2MWIFYP3.mjs';
6
+ import './chunk-ERH7LWVL.mjs';
7
+ import './chunk-PLJ6ZHAI.mjs';
@@ -6,7 +6,7 @@ type IconButtonProps = {
6
6
  } & VariantProps<typeof iconButton> & React__default.DetailedHTMLProps<React__default.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
7
7
  declare const iconButton: (props?: ({
8
8
  variant?: "contained" | "outlined" | "ghost" | "standard" | undefined;
9
- size?: "large" | "medium" | "small" | undefined;
9
+ size?: "small" | "large" | "medium" | undefined;
10
10
  } & ({
11
11
  class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
12
12
  [x: string]: any;
package/dist/icons.d.mts CHANGED
@@ -8,5 +8,7 @@ declare const CloseIcon: React.ForwardRefExoticComponent<Omit<lucide_react.Lucid
8
8
  declare const InfoIcon: React.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
9
9
  declare const TriangleAlertIcon: React.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
10
10
  declare const ChevronDownIcon: React.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
11
+ declare const ChevronRightIcon: React.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
12
+ declare const ChevronLeftIcon: React.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
11
13
 
12
- export { ChevronDownIcon, CircleCheckIcon, CircleXIcon, CloseIcon, InfoIcon, LoaderCircleIcon, TriangleAlertIcon };
14
+ export { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, CircleCheckIcon, CircleXIcon, CloseIcon, InfoIcon, LoaderCircleIcon, TriangleAlertIcon };
package/dist/icons.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { ChevronDownIcon, CircleCheckIcon, CircleXIcon, CloseIcon, InfoIcon, LoaderCircleIcon, TriangleAlertIcon } from './chunk-GY2JBRY6.mjs';
1
+ export { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, CircleCheckIcon, CircleXIcon, CloseIcon, InfoIcon, LoaderCircleIcon, TriangleAlertIcon } from './chunk-ERH7LWVL.mjs';
2
2
  import './chunk-PLJ6ZHAI.mjs';
package/dist/index.css CHANGED
@@ -369,6 +369,10 @@ video {
369
369
  margin-left: 1rem;
370
370
  margin-right: 1rem;
371
371
  }
372
+ .mx-6 {
373
+ margin-left: 1.5rem;
374
+ margin-right: 1.5rem;
375
+ }
372
376
  .my-1 {
373
377
  margin-top: 0.25rem;
374
378
  margin-bottom: 0.25rem;
@@ -385,6 +389,9 @@ video {
385
389
  .ml-4 {
386
390
  margin-left: 1rem;
387
391
  }
392
+ .ml-auto {
393
+ margin-left: auto;
394
+ }
388
395
  .mr-2 {
389
396
  margin-right: 0.5rem;
390
397
  }
@@ -394,9 +401,15 @@ video {
394
401
  .mt-1 {
395
402
  margin-top: 0.25rem;
396
403
  }
404
+ .mt-2 {
405
+ margin-top: 0.5rem;
406
+ }
397
407
  .flex {
398
408
  display: flex;
399
409
  }
410
+ .table {
411
+ display: table;
412
+ }
400
413
  .hidden {
401
414
  display: none;
402
415
  }
@@ -421,6 +434,9 @@ video {
421
434
  .h-8 {
422
435
  height: 2rem;
423
436
  }
437
+ .h-\[1\.125rem\] {
438
+ height: 1.125rem;
439
+ }
424
440
  .h-\[1\.375rem\] {
425
441
  height: 1.375rem;
426
442
  }
@@ -454,12 +470,18 @@ video {
454
470
  .w-8 {
455
471
  width: 2rem;
456
472
  }
473
+ .w-\[1\.125rem\] {
474
+ width: 1.125rem;
475
+ }
457
476
  .w-\[1\.375rem\] {
458
477
  width: 1.375rem;
459
478
  }
460
479
  .w-\[20rem\] {
461
480
  width: 20rem;
462
481
  }
482
+ .w-\[40rem\] {
483
+ width: 40rem;
484
+ }
463
485
  .w-fit {
464
486
  width: -moz-fit-content;
465
487
  width: fit-content;
@@ -479,6 +501,9 @@ video {
479
501
  .shrink-0 {
480
502
  flex-shrink: 0;
481
503
  }
504
+ .table-auto {
505
+ table-layout: auto;
506
+ }
482
507
  @keyframes spin {
483
508
  to {
484
509
  transform: rotate(360deg);
@@ -487,6 +512,12 @@ video {
487
512
  .animate-spin {
488
513
  animation: spin 1s linear infinite;
489
514
  }
515
+ .cursor-default {
516
+ cursor: default;
517
+ }
518
+ .cursor-not-allowed {
519
+ cursor: not-allowed;
520
+ }
490
521
  .cursor-pointer {
491
522
  cursor: pointer;
492
523
  }
@@ -504,6 +535,9 @@ video {
504
535
  .items-center {
505
536
  align-items: center;
506
537
  }
538
+ .justify-end {
539
+ justify-content: flex-end;
540
+ }
507
541
  .justify-center {
508
542
  justify-content: center;
509
543
  }
@@ -516,9 +550,15 @@ video {
516
550
  .gap-2 {
517
551
  gap: 0.5rem;
518
552
  }
553
+ .gap-6 {
554
+ gap: 1.5rem;
555
+ }
519
556
  .overflow-hidden {
520
557
  overflow: hidden;
521
558
  }
559
+ .overflow-y-auto {
560
+ overflow-y: auto;
561
+ }
522
562
  .rounded {
523
563
  border-radius: 0.25rem;
524
564
  }
@@ -543,10 +583,21 @@ video {
543
583
  .border-b-1 {
544
584
  border-bottom-width: 1px;
545
585
  }
586
+ .border-t-1 {
587
+ border-top-width: 1px;
588
+ }
589
+ .border-neutral-200 {
590
+ --tw-border-opacity: 1;
591
+ border-color: rgb(225 231 230 / var(--tw-border-opacity));
592
+ }
546
593
  .border-neutral-600 {
547
594
  --tw-border-opacity: 1;
548
595
  border-color: rgb(126 138 134 / var(--tw-border-opacity));
549
596
  }
597
+ .border-t-neutral-200 {
598
+ --tw-border-opacity: 1;
599
+ border-top-color: rgb(225 231 230 / var(--tw-border-opacity));
600
+ }
550
601
  .bg-error-100 {
551
602
  --tw-bg-opacity: 1;
552
603
  background-color: rgb(255 231 216 / var(--tw-bg-opacity));
@@ -555,6 +606,10 @@ video {
555
606
  --tw-bg-opacity: 1;
556
607
  background-color: rgb(207 235 254 / var(--tw-bg-opacity));
557
608
  }
609
+ .bg-neutral-100 {
610
+ --tw-bg-opacity: 1;
611
+ background-color: rgb(243 246 245 / var(--tw-bg-opacity));
612
+ }
558
613
  .bg-neutral-200 {
559
614
  --tw-bg-opacity: 1;
560
615
  background-color: rgb(225 231 230 / var(--tw-bg-opacity));
@@ -599,10 +654,17 @@ video {
599
654
  .p-4 {
600
655
  padding: 1rem;
601
656
  }
657
+ .p-\[0\.625rem\] {
658
+ padding: 0.625rem;
659
+ }
602
660
  .px-1 {
603
661
  padding-left: 0.25rem;
604
662
  padding-right: 0.25rem;
605
663
  }
664
+ .px-10 {
665
+ padding-left: 2.5rem;
666
+ padding-right: 2.5rem;
667
+ }
606
668
  .px-2 {
607
669
  padding-left: 0.5rem;
608
670
  padding-right: 0.5rem;
@@ -631,12 +693,25 @@ video {
631
693
  padding-top: 0.5rem;
632
694
  padding-bottom: 0.5rem;
633
695
  }
696
+ .py-3 {
697
+ padding-top: 0.75rem;
698
+ padding-bottom: 0.75rem;
699
+ }
700
+ .pb-12 {
701
+ padding-bottom: 3rem;
702
+ }
634
703
  .pl-4 {
635
704
  padding-left: 1rem;
636
705
  }
637
706
  .pr-2 {
638
707
  padding-right: 0.5rem;
639
708
  }
709
+ .pt-10 {
710
+ padding-top: 2.5rem;
711
+ }
712
+ .text-left {
713
+ text-align: left;
714
+ }
640
715
  .text-start {
641
716
  text-align: start;
642
717
  }
@@ -647,6 +722,10 @@ video {
647
722
  font-size: 1rem;
648
723
  line-height: 1.5rem;
649
724
  }
725
+ .text-lg {
726
+ font-size: 1.125rem;
727
+ line-height: 1.75rem;
728
+ }
650
729
  .text-sm {
651
730
  font-size: 0.875rem;
652
731
  line-height: 1.25rem;
@@ -658,9 +737,15 @@ video {
658
737
  .font-medium {
659
738
  font-weight: 500;
660
739
  }
740
+ .font-normal {
741
+ font-weight: 400;
742
+ }
661
743
  .font-semibold {
662
744
  font-weight: 600;
663
745
  }
746
+ .uppercase {
747
+ text-transform: uppercase;
748
+ }
664
749
  .leading-\[110\%\] {
665
750
  line-height: 110%;
666
751
  }
@@ -673,6 +758,15 @@ video {
673
758
  .leading-none {
674
759
  line-height: 1;
675
760
  }
761
+ .tracking-body {
762
+ letter-spacing: 0.32px;
763
+ }
764
+ .tracking-body-lg {
765
+ letter-spacing: 0.36px;
766
+ }
767
+ .tracking-sm {
768
+ letter-spacing: 0.28px;
769
+ }
676
770
  .text-error-500 {
677
771
  --tw-text-opacity: 1;
678
772
  color: rgb(241 96 89 / var(--tw-text-opacity));
@@ -772,6 +866,10 @@ video {
772
866
  .caret-neutral-900 {
773
867
  caret-color: #283331;
774
868
  }
869
+ .outline-none {
870
+ outline: 2px solid transparent;
871
+ outline-offset: 2px;
872
+ }
775
873
  .outline-0 {
776
874
  outline-width: 0px;
777
875
  }
package/dist/index.d.mts CHANGED
@@ -7,8 +7,13 @@ export { TextField } from './text-field.mjs';
7
7
  export { Spinner } from './spinner.mjs';
8
8
  export { ChipForm } from './chip-form.mjs';
9
9
  export { ChipStatus } from './chip-status.mjs';
10
+ export { ScrollArea, ScrollBar } from './scrollarea.mjs';
11
+ export { default as DataTable } from './data-table.mjs';
10
12
  import 'react';
11
13
  import 'cva';
12
14
  import '@radix-ui/react-tooltip';
13
15
  import '@radix-ui/react-tabs';
14
16
  import 'lucide-react';
17
+ import '@radix-ui/react-scroll-area';
18
+ import 'react/jsx-runtime';
19
+ import '@tanstack/react-table';
package/dist/index.mjs CHANGED
@@ -1,13 +1,16 @@
1
- export { Spinner } from './chunk-RLA4I2X2.mjs';
1
+ export { Spinner } from './chunk-YXXI2T2N.mjs';
2
2
  export { Tabs, TabsContent, TabsList, TabsTrigger } from './chunk-2OWGGXTX.mjs';
3
- export { TextField } from './chunk-FULNSEPZ.mjs';
3
+ export { TextField } from './chunk-KY2KI4AD.mjs';
4
4
  export { Tooltip, TooltipProvider } from './chunk-FRPPC3Z5.mjs';
5
- export { Alert } from './chunk-EFMITOLW.mjs';
6
- export { Button } from './chunk-QQLQXUJA.mjs';
5
+ export { Alert } from './chunk-XDQ2Y2UR.mjs';
6
+ export { Button } from './chunk-4YE5CU7E.mjs';
7
7
  export { ChipForm } from './chunk-RZ2JP5UH.mjs';
8
8
  export { ChipStatus } from './chunk-WSAW6L2X.mjs';
9
- export { IconButton } from './chunk-JVSF3AX2.mjs';
10
- import './chunk-GY2JBRY6.mjs';
9
+ export { DataTable } from './chunk-V2LMCQ4I.mjs';
10
+ import './chunk-O5QOPJOD.mjs';
11
+ export { ScrollArea, ScrollBar } from './chunk-ZVOUAD54.mjs';
11
12
  import './chunk-P3UP2HUA.mjs';
13
+ export { IconButton } from './chunk-JVSF3AX2.mjs';
12
14
  import './chunk-2MWIFYP3.mjs';
15
+ import './chunk-ERH7LWVL.mjs';
13
16
  import './chunk-PLJ6ZHAI.mjs';
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+
3
+ declare const options: readonly ["10", "25", "50"];
4
+ type RowsPerPageSelectProps = {
5
+ value: (typeof options)[number];
6
+ onRowsPerPageChange: (value: (typeof options)[number]) => void;
7
+ };
8
+ declare const RowsPerPageSelect: FC<RowsPerPageSelectProps>;
9
+
10
+ export { RowsPerPageSelect as default };
@@ -0,0 +1,5 @@
1
+ export { rows_per_page_select_default as default } from './chunk-O5QOPJOD.mjs';
2
+ import './chunk-P3UP2HUA.mjs';
3
+ import './chunk-2MWIFYP3.mjs';
4
+ import './chunk-ERH7LWVL.mjs';
5
+ import './chunk-PLJ6ZHAI.mjs';
@@ -1,49 +1,4 @@
1
- import { cn } from './chunk-P3UP2HUA.mjs';
2
- import { require_jsx_runtime } from './chunk-2MWIFYP3.mjs';
3
- import { __toESM, require_react } from './chunk-PLJ6ZHAI.mjs';
4
- import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
5
-
6
- // src/components/scrollarea.tsx
7
- var React = __toESM(require_react());
8
- var import_jsx_runtime = __toESM(require_jsx_runtime());
9
- var ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
10
- ScrollAreaPrimitive.Root,
11
- {
12
- ref,
13
- className: cn("relative h-full overflow-hidden", className),
14
- ...props,
15
- children: [
16
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit] [&>div]:!flex [&>div]:h-full [&>div]:flex-col", children }),
17
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollBar, {}),
18
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollAreaPrimitive.Corner, {})
19
- ]
20
- }
21
- ));
22
- ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
23
- var ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
24
- ScrollAreaPrimitive.ScrollAreaScrollbar,
25
- {
26
- ref,
27
- orientation,
28
- className: cn(
29
- "flex touch-none select-none bg-neutral-200 transition-colors",
30
- orientation === "vertical" && "h-full w-4 py-2",
31
- orientation === "horizontal" && "h-4 flex-col px-2",
32
- className
33
- ),
34
- ...props,
35
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
36
- ScrollAreaPrimitive.ScrollAreaThumb,
37
- {
38
- className: cn(
39
- "relative flex-1 rounded bg-primary-500",
40
- orientation === "vertical" && "mx-1 w-2",
41
- orientation === "horizontal" && "my-1 h-2"
42
- )
43
- }
44
- )
45
- }
46
- ));
47
- ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
48
-
49
- export { ScrollArea, ScrollBar };
1
+ export { ScrollArea, ScrollBar } from './chunk-ZVOUAD54.mjs';
2
+ import './chunk-P3UP2HUA.mjs';
3
+ import './chunk-2MWIFYP3.mjs';
4
+ import './chunk-PLJ6ZHAI.mjs';
package/dist/spinner.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { Spinner } from './chunk-RLA4I2X2.mjs';
2
- import './chunk-GY2JBRY6.mjs';
1
+ export { Spinner } from './chunk-YXXI2T2N.mjs';
3
2
  import './chunk-2MWIFYP3.mjs';
3
+ import './chunk-ERH7LWVL.mjs';
4
4
  import './chunk-PLJ6ZHAI.mjs';
@@ -1,5 +1,5 @@
1
- export { TextField } from './chunk-FULNSEPZ.mjs';
2
- import './chunk-GY2JBRY6.mjs';
1
+ export { TextField } from './chunk-KY2KI4AD.mjs';
3
2
  import './chunk-P3UP2HUA.mjs';
4
3
  import './chunk-2MWIFYP3.mjs';
4
+ import './chunk-ERH7LWVL.mjs';
5
5
  import './chunk-PLJ6ZHAI.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sodtrack-web-ui",
3
- "version": "0.8.0",
3
+ "version": "0.9.1",
4
4
  "description": "UI components for Sodtrack Web",
5
5
  "exports": {
6
6
  "./dist/index.css": "./dist/index.css",
@@ -45,10 +45,12 @@
45
45
  "typescript": "^5.4.5"
46
46
  },
47
47
  "dependencies": {
48
+ "@floating-ui/react": "^0.26.16",
48
49
  "@radix-ui/react-label": "^2.0.2",
49
50
  "@radix-ui/react-scroll-area": "^1.0.5",
50
51
  "@radix-ui/react-tabs": "^1.0.4",
51
52
  "@radix-ui/react-tooltip": "^1.0.7",
53
+ "@tanstack/react-table": "^8.17.3",
52
54
  "cva": "1.0.0-beta.1"
53
55
  },
54
56
  "scripts": {