tembro 5.0.0 → 6.0.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/CHANGELOG.md +20 -0
- package/dist/components/charts/progress-circle.d.ts +12 -3
- package/dist/components/data-table/data-table.d.ts +2 -2
- package/dist/components/feedback/index.d.ts +0 -2
- package/dist/components/layout/section.d.ts +1 -8
- package/dist/components/ui/number-field/index.cjs +1 -0
- package/dist/components/ui/number-field/index.d.ts +18 -0
- package/dist/components/ui/number-field/index.js +1 -0
- package/dist/components/ui/toggle-group/index.cjs +1 -0
- package/dist/components/ui/toggle-group/index.d.ts +13 -0
- package/dist/components/ui/toggle-group/index.js +1 -0
- package/dist/components/ui/toolbar/index.cjs +1 -0
- package/dist/components/ui/toolbar/index.d.ts +14 -0
- package/dist/components/ui/toolbar/index.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/src/components/charts/progress-circle.cjs +1 -1
- package/dist/src/components/charts/progress-circle.js +57 -3
- package/dist/src/components/data-table/data-table.cjs +1 -1
- package/dist/src/components/data-table/data-table.js +102 -100
- package/dist/src/components/feedback/index.cjs +1 -1
- package/dist/src/components/feedback/index.js +2 -4
- package/dist/src/components/layout/index.cjs +1 -1
- package/dist/src/components/layout/index.js +3 -3
- package/dist/src/components/layout/public.cjs +1 -1
- package/dist/src/components/layout/public.js +3 -3
- package/dist/src/components/layout/section.cjs +1 -1
- package/dist/src/components/layout/section.js +2 -26
- package/dist/src/components/ui/number-field/index.cjs +1 -0
- package/dist/src/components/ui/number-field/index.js +73 -0
- package/dist/src/components/ui/toggle-group/index.cjs +1 -0
- package/dist/src/components/ui/toggle-group/index.js +32 -0
- package/dist/src/components/ui/toolbar/index.cjs +1 -0
- package/dist/src/components/ui/toolbar/index.js +50 -0
- package/dist/src/index.cjs +1 -1
- package/dist/src/index.js +92 -91
- package/dist/src/public-component-surface.cjs +1 -1
- package/dist/src/public-component-surface.js +15 -0
- package/package.json +13 -9
- package/packages/cli/dist/index.cjs +72 -72
- package/packages/cli/vendor/src/components/charts/progress-circle.tsx +78 -3
- package/packages/cli/vendor/src/components/data-table/data-table.tsx +4 -4
- package/packages/cli/vendor/src/components/feedback/index.ts +0 -2
- package/packages/cli/vendor/src/components/layout/section.tsx +1 -28
- package/packages/cli/vendor/src/components/ui/number-field/index.tsx +89 -0
- package/packages/cli/vendor/src/components/ui/toggle-group/index.tsx +72 -0
- package/packages/cli/vendor/src/components/ui/toolbar/index.tsx +67 -0
- package/packages/cli/vendor/src/index.ts +6 -3
- package/packages/cli/vendor/src/public-component-surface.ts +3 -0
- package/packages/cli/vendor/templates/showcase/src/showcase/data/registry.ts +4 -2
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/HeroSection.tsx +2 -2
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/WorkbenchSidebar.tsx +1 -1
- package/packages/cli/vendor/templates/showcase/src/showcase/sections/ComponentLivePreview.tsx +2 -2
- package/packages/cli/vendor/templates/showcase/src/showcase/sections/FormsSection.tsx +2 -2
- package/packages/cli/vendor/templates/styles/globals.css +5 -5
- package/registry.json +962 -431
- package/dist/components/charts/progress-ring.cjs +0 -1
- package/dist/components/charts/progress-ring.d.ts +0 -13
- package/dist/components/charts/progress-ring.js +0 -1
- package/dist/components/feedback/loading-state.cjs +0 -1
- package/dist/components/feedback/loading-state.d.ts +0 -9
- package/dist/components/feedback/loading-state.js +0 -1
- package/dist/components/feedback/page-state.cjs +0 -1
- package/dist/components/feedback/page-state.d.ts +0 -18
- package/dist/components/feedback/page-state.js +0 -1
- package/dist/components/layout/page-container.cjs +0 -1
- package/dist/components/layout/page-container.d.ts +0 -7
- package/dist/components/layout/page-container.js +0 -1
- package/dist/components/layout/page-header.cjs +0 -1
- package/dist/components/layout/page-header.d.ts +0 -23
- package/dist/components/layout/page-header.js +0 -1
- package/dist/components/layout/section-header.cjs +0 -1
- package/dist/components/layout/section-header.d.ts +0 -14
- package/dist/components/layout/section-header.js +0 -1
- package/dist/components/layout/sidebar-nav.cjs +0 -1
- package/dist/components/layout/sidebar-nav.d.ts +0 -37
- package/dist/components/layout/sidebar-nav.js +0 -1
- package/dist/components/layout/sticky-footer-bar.cjs +0 -1
- package/dist/components/layout/sticky-footer-bar.d.ts +0 -7
- package/dist/components/layout/sticky-footer-bar.js +0 -1
- package/dist/src/components/charts/progress-ring.cjs +0 -1
- package/dist/src/components/charts/progress-ring.js +0 -57
- package/dist/src/components/feedback/loading-state.cjs +0 -1
- package/dist/src/components/feedback/loading-state.js +0 -15
- package/dist/src/components/feedback/page-state.cjs +0 -1
- package/dist/src/components/feedback/page-state.js +0 -28
- package/dist/src/components/layout/page-container.cjs +0 -1
- package/dist/src/components/layout/page-container.js +0 -21
- package/dist/src/components/layout/page-header.cjs +0 -1
- package/dist/src/components/layout/page-header.js +0 -92
- package/dist/src/components/layout/section-header.cjs +0 -1
- package/dist/src/components/layout/section-header.js +0 -44
- package/dist/src/components/layout/sidebar-nav.cjs +0 -1
- package/dist/src/components/layout/sidebar-nav.js +0 -220
- package/dist/src/components/layout/sticky-footer-bar.cjs +0 -1
- package/dist/src/components/layout/sticky-footer-bar.js +0 -20
- package/packages/cli/vendor/src/components/charts/progress-ring.tsx +0 -56
- package/packages/cli/vendor/src/components/feedback/loading-state.tsx +0 -15
- package/packages/cli/vendor/src/components/feedback/page-state.tsx +0 -29
- package/packages/cli/vendor/src/components/layout/page-container.tsx +0 -30
- package/packages/cli/vendor/src/components/layout/page-header.tsx +0 -104
- package/packages/cli/vendor/src/components/layout/section-header.tsx +0 -56
- package/packages/cli/vendor/src/components/layout/sidebar-nav.tsx +0 -377
- package/packages/cli/vendor/src/components/layout/sticky-footer-bar.tsx +0 -23
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
3
|
import { Button as t } from "../ui/button/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import { StateView as n } from "../feedback/state-view.js";
|
|
5
|
+
import { Input as r } from "../ui/input/index.js";
|
|
6
|
+
import { createDataTableActionsColumn as i } from "./data-table-actions-column.js";
|
|
7
|
+
import { DataTableBulkActions as ee } from "./data-table-bulk-actions.js";
|
|
8
|
+
import { DataTableColumnVisibilityMenu as te } from "./data-table-column-visibility-menu.js";
|
|
9
|
+
import { DataTablePagination as ne } from "./data-table-pagination.js";
|
|
10
|
+
import { DataTableToolbar as re } from "./data-table-toolbar.js";
|
|
11
|
+
import { useVirtualizer as ie } from "../../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
|
|
11
12
|
import { DataState as a } from "../display/data-state.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import { flexRender as f, getCoreRowModel as ue, getExpandedRowModel as de, getPaginationRowModel as fe, useReactTable as pe } from "@tanstack/react-table";
|
|
13
|
+
import { useIsMobile as ae } from "../../hooks/use-is-mobile.js";
|
|
14
|
+
import { Table as oe, TableBody as se, TableCell as o, TableHead as ce, TableHeader as le, TableRow as s } from "../ui/table/index.js";
|
|
15
|
+
import * as c from "react";
|
|
16
|
+
import { Fragment as ue, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
17
|
+
import { flexRender as d, getCoreRowModel as de, getExpandedRowModel as fe, getPaginationRowModel as pe, useReactTable as me } from "@tanstack/react-table";
|
|
18
18
|
//#region src/components/data-table/data-table.tsx
|
|
19
|
-
var
|
|
19
|
+
var he = {
|
|
20
20
|
compact: "h-8 px-2 py-1.5",
|
|
21
21
|
default: "h-10 px-2 py-2",
|
|
22
22
|
comfortable: "h-12 px-3 py-3"
|
|
23
|
-
},
|
|
23
|
+
}, ge = {
|
|
24
24
|
compact: "px-2 py-1.5",
|
|
25
25
|
default: "p-2",
|
|
26
26
|
comfortable: "px-3 py-3"
|
|
27
27
|
};
|
|
28
|
-
function ge(e, t) {
|
|
29
|
-
return typeof t == "function" ? t(e) : t;
|
|
30
|
-
}
|
|
31
28
|
function _e(e, t) {
|
|
32
29
|
return typeof t == "function" ? t(e) : t;
|
|
33
30
|
}
|
|
34
31
|
function ve(e, t) {
|
|
35
32
|
return typeof t == "function" ? t(e) : t;
|
|
36
33
|
}
|
|
37
|
-
function ye(e) {
|
|
38
|
-
return
|
|
34
|
+
function ye(e, t) {
|
|
35
|
+
return typeof t == "function" ? t(e) : t;
|
|
39
36
|
}
|
|
40
37
|
function be(e) {
|
|
38
|
+
return e == null || e === "";
|
|
39
|
+
}
|
|
40
|
+
function xe(e) {
|
|
41
41
|
let t = e.column.columnDef.header;
|
|
42
42
|
return typeof t == "string" ? t : typeof t == "number" ? String(t) : e.column.id === "actions" ? "Actions" : e.column.id;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
let nt =
|
|
46
|
-
let e =
|
|
47
|
-
return !
|
|
44
|
+
function Se({ className: Se, columns: Ce, data: f, title: p, description: m, features: h, search: g, filters: _, summary: v, toolbarActions: y, rowActions: b, bulkActions: we, onRefresh: x, onExport: S, refreshLabel: Te = "Refresh", exportLabel: Ee = "Export", getRowId: De, isLoading: C = !1, isError: Oe = !1, emptyState: ke, errorState: Ae, loadingState: w, loadingVariant: je = "skeleton", toolbar: T, toolbarProps: E, pagination: D, sorting: Me, onSortingChange: Ne, columnVisibility: Pe, onColumnVisibilityChange: Fe, rowSelection: Ie, onRowSelectionChange: Le, enableRowSelection: Re, renderMobileCard: O, mobileLayout: ze = "auto", onRowClick: k, onRowDoubleClick: Be, getRowDisabled: A, density: j = "default", striped: M = !1, bordered: N = !1, stickyHeader: P = !1, skeletonRows: Ve = 6, skeletonCellClassName: He, cellFallback: F = "-", tableClassName: Ue, tableWrapperClassName: We, headerCellClassName: Ge, cellClassName: Ke, rowClassName: qe, renderExpandedRow: Je, expanded: Ye, onExpandedChange: Xe, getRowCanExpand: Ze, columnPinning: Qe, onColumnPinningChange: $e, virtualization: et, ...tt }) {
|
|
45
|
+
let nt = c.useMemo(() => {
|
|
46
|
+
let e = Ce;
|
|
47
|
+
return !b || h?.rowActions === !1 ? e : [...e, i({ getActions: b })];
|
|
48
48
|
}, [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
Ce,
|
|
50
|
+
h?.rowActions,
|
|
51
|
+
b
|
|
52
52
|
]), I = D === !1 ? void 0 : D, rt = I ? {
|
|
53
53
|
pageIndex: I.pageIndex,
|
|
54
54
|
pageSize: I.pageSize
|
|
55
|
-
} : void 0, it = !!(I && I.manual !== !1), at = Ie ?? {}, L =
|
|
56
|
-
data:
|
|
55
|
+
} : void 0, it = !!(I && I.manual !== !1), at = Ie ?? {}, L = me({
|
|
56
|
+
data: f,
|
|
57
57
|
columns: nt,
|
|
58
58
|
getRowId: De,
|
|
59
|
-
getCoreRowModel:
|
|
60
|
-
getPaginationRowModel: I && !it ?
|
|
59
|
+
getCoreRowModel: de(),
|
|
60
|
+
getPaginationRowModel: I && !it ? pe() : void 0,
|
|
61
61
|
manualPagination: it,
|
|
62
62
|
pageCount: I?.pageCount,
|
|
63
63
|
state: {
|
|
@@ -75,8 +75,8 @@ function xe({ className: xe, columns: Se, data: p, title: m, description: h, fea
|
|
|
75
75
|
onColumnPinningChange: $e,
|
|
76
76
|
enableRowSelection: Re,
|
|
77
77
|
getRowCanExpand: Ze,
|
|
78
|
-
getExpandedRowModel:
|
|
79
|
-
}), R = L.getRowModel().rows, ot =
|
|
78
|
+
getExpandedRowModel: fe()
|
|
79
|
+
}), R = L.getRowModel().rows, ot = c.useRef(null), z = et === !1 ? void 0 : et, B = !!(z && z.enabled !== !1 && R.length > 0), V = z?.height ?? 480, st = z?.onRangeChange, H = ie({
|
|
80
80
|
count: B ? R.length : 0,
|
|
81
81
|
getScrollElement: () => ot.current,
|
|
82
82
|
estimateSize: () => z?.estimateRowHeight ?? 48,
|
|
@@ -101,90 +101,91 @@ function xe({ className: xe, columns: Se, data: p, title: m, description: h, fea
|
|
|
101
101
|
end: (t + 1) * U,
|
|
102
102
|
size: U,
|
|
103
103
|
lane: 0
|
|
104
|
-
})), ut = W[0]?.start ?? 0, dt = W.length ? Math.max(H.getTotalSize() - W[W.length - 1].end, 0) : 0, G = L.getSelectedRowModel().rows.map((e) => e.original), ft = G.length, K =
|
|
104
|
+
})), ut = W[0]?.start ?? 0, dt = W.length ? Math.max(H.getTotalSize() - W[W.length - 1].end, 0) : 0, G = L.getSelectedRowModel().rows.map((e) => e.original), ft = G.length, K = c.useMemo(() => ({
|
|
105
105
|
table: L,
|
|
106
|
-
data:
|
|
106
|
+
data: f,
|
|
107
107
|
selectedRows: G
|
|
108
108
|
}), [
|
|
109
|
-
|
|
109
|
+
f,
|
|
110
110
|
G,
|
|
111
111
|
L
|
|
112
|
-
]), pt = L.getVisibleLeafColumns(), mt = Math.max(pt.length, 1), ht = typeof T == "function" ? T(L) : T, gt = typeof E == "function" ? E(L) : E, q = typeof
|
|
112
|
+
]), pt = L.getVisibleLeafColumns(), mt = Math.max(pt.length, 1), ht = typeof T == "function" ? T(L) : T, gt = typeof E == "function" ? E(L) : E, q = typeof _ == "function" ? _(K) : _, J = typeof v == "function" ? v(K) : v, _t = !!(g && h?.search !== !1), vt = !!(h?.columnVisibility && L.getAllLeafColumns().some((e) => e.getCanHide())), Y = !!(h?.refresh && x), X = !!(h?.export && S), yt = !!(h?.bulkActions !== !1 && we?.length), bt = vt && !!(p || m || g || q || J || y || Y || X), xt = _t && g ? /* @__PURE__ */ l(r, {
|
|
113
113
|
type: "search",
|
|
114
|
-
value:
|
|
115
|
-
onValueChange:
|
|
116
|
-
placeholder:
|
|
117
|
-
wrapperClassName:
|
|
118
|
-
inputClassName:
|
|
119
|
-
disabled:
|
|
120
|
-
clearable:
|
|
121
|
-
clearLabel:
|
|
122
|
-
searchIcon:
|
|
123
|
-
}) : void 0, St = /* @__PURE__ */
|
|
124
|
-
typeof
|
|
125
|
-
bt && /* @__PURE__ */
|
|
126
|
-
Y && /* @__PURE__ */
|
|
114
|
+
value: g.value,
|
|
115
|
+
onValueChange: g.onValueChange,
|
|
116
|
+
placeholder: g.placeholder ?? "Search...",
|
|
117
|
+
wrapperClassName: g.wrapperClassName ?? g.className,
|
|
118
|
+
inputClassName: g.inputClassName,
|
|
119
|
+
disabled: g.disabled,
|
|
120
|
+
clearable: g.clearable,
|
|
121
|
+
clearLabel: g.clearLabel,
|
|
122
|
+
searchIcon: g.searchIcon
|
|
123
|
+
}) : void 0, St = /* @__PURE__ */ u(ue, { children: [
|
|
124
|
+
typeof y == "function" ? y(K) : y,
|
|
125
|
+
bt && /* @__PURE__ */ l(te, { table: L }),
|
|
126
|
+
Y && /* @__PURE__ */ l(t, {
|
|
127
127
|
type: "button",
|
|
128
128
|
variant: "outline",
|
|
129
129
|
size: "sm",
|
|
130
130
|
disabled: C,
|
|
131
|
-
onClick: () =>
|
|
131
|
+
onClick: () => x?.(K),
|
|
132
132
|
children: Te
|
|
133
133
|
}),
|
|
134
|
-
X && /* @__PURE__ */
|
|
134
|
+
X && /* @__PURE__ */ l(t, {
|
|
135
135
|
type: "button",
|
|
136
136
|
variant: "outline",
|
|
137
137
|
size: "sm",
|
|
138
138
|
onClick: () => S?.(K),
|
|
139
139
|
children: Ee
|
|
140
140
|
})
|
|
141
|
-
] }), Ct = yt ? /* @__PURE__ */
|
|
141
|
+
] }), Ct = yt ? /* @__PURE__ */ l(ee, {
|
|
142
142
|
rows: G,
|
|
143
|
-
actions:
|
|
143
|
+
actions: we ?? [],
|
|
144
144
|
selectedLabel: () => "Actions",
|
|
145
145
|
clearLabel: null,
|
|
146
146
|
onClearSelection: () => L.resetRowSelection(),
|
|
147
147
|
hideWhenEmpty: !1
|
|
148
|
-
}) : void 0, wt = !!(ht || gt ||
|
|
148
|
+
}) : void 0, wt = !!(ht || gt || p || m || xt || q || J || y || bt || Y || X || Ct), Tt = !!(I && !I.hidden), Z = C && je === "skeleton", Et = ae(), Q = ze !== "scroll" && Et, Dt = (e, t) => t > 0 ? /* @__PURE__ */ l(s, {
|
|
149
149
|
"aria-hidden": "true",
|
|
150
150
|
className: "pointer-events-none border-0 hover:bg-transparent",
|
|
151
|
-
children: /* @__PURE__ */
|
|
151
|
+
children: /* @__PURE__ */ l(o, {
|
|
152
152
|
colSpan: mt,
|
|
153
153
|
className: "border-0 p-0",
|
|
154
154
|
style: { height: t }
|
|
155
155
|
})
|
|
156
|
-
}, e) : null, Ot = (e) => /* @__PURE__ */
|
|
156
|
+
}, e) : null, Ot = (e) => /* @__PURE__ */ l(s, { children: /* @__PURE__ */ l(o, {
|
|
157
157
|
colSpan: mt,
|
|
158
158
|
className: "p-0",
|
|
159
159
|
children: e
|
|
160
|
-
}) }), kt = () => Array.from({ length: Math.max(Ve, 1) }, (t, n) => /* @__PURE__ */
|
|
160
|
+
}) }), kt = () => Array.from({ length: Math.max(Ve, 1) }, (t, n) => /* @__PURE__ */ l(s, {
|
|
161
161
|
"aria-hidden": "true",
|
|
162
|
-
children: pt.map((t) => /* @__PURE__ */
|
|
163
|
-
className: e(
|
|
164
|
-
children: /* @__PURE__ */
|
|
162
|
+
children: pt.map((t) => /* @__PURE__ */ l(o, {
|
|
163
|
+
className: e(ge[j], N && "border-r last:border-r-0"),
|
|
164
|
+
children: /* @__PURE__ */ l("div", { className: e("h-4 w-full max-w-40 animate-pulse rounded-md bg-muted", n % 3 == 1 && "max-w-24", n % 3 == 2 && "max-w-32", He) })
|
|
165
165
|
}, `${t.id}-${n}`))
|
|
166
|
-
}, `skeleton-${n}`)), $ = Z ? null : C ? /* @__PURE__ */
|
|
167
|
-
|
|
166
|
+
}, `skeleton-${n}`)), $ = Z ? null : C ? /* @__PURE__ */ l(n, {
|
|
167
|
+
status: "loading",
|
|
168
|
+
title: "Loading data...",
|
|
168
169
|
...w
|
|
169
|
-
}) : Oe ? /* @__PURE__ */
|
|
170
|
+
}) : Oe ? /* @__PURE__ */ l(a, {
|
|
170
171
|
status: "error",
|
|
171
172
|
title: "Could not load data",
|
|
172
173
|
description: "Please try again.",
|
|
173
174
|
variant: "plain",
|
|
174
175
|
...Ae
|
|
175
|
-
}) : R.length === 0 ? /* @__PURE__ */
|
|
176
|
+
}) : R.length === 0 ? /* @__PURE__ */ l(a, {
|
|
176
177
|
status: "empty",
|
|
177
178
|
variant: "plain",
|
|
178
179
|
...ke
|
|
179
180
|
}) : null, At = (t, n, r) => {
|
|
180
181
|
let i = A?.(t) ?? !1;
|
|
181
|
-
return /* @__PURE__ */
|
|
182
|
+
return /* @__PURE__ */ u(c.Fragment, { children: [/* @__PURE__ */ l(s, {
|
|
182
183
|
ref: r && z?.measureRows !== !1 ? H.measureElement : void 0,
|
|
183
184
|
"data-index": r?.index,
|
|
184
185
|
"data-state": t.getIsSelected() ? "selected" : void 0,
|
|
185
186
|
"data-striped": M && n % 2 == 1 ? "true" : void 0,
|
|
186
187
|
"data-disabled": i || void 0,
|
|
187
|
-
className: e(k && !i && "cursor-pointer", !i && "transition-colors hover:bg-[color:color-mix(in_oklch,var(--primary),transparent_96%)] data-[state=selected]:bg-[color:color-mix(in_oklch,var(--primary),transparent_90%)]", i && "pointer-events-none opacity-55",
|
|
188
|
+
className: e(k && !i && "cursor-pointer", !i && "transition-colors hover:bg-[color:color-mix(in_oklch,var(--primary),transparent_96%)] data-[state=selected]:bg-[color:color-mix(in_oklch,var(--primary),transparent_90%)]", i && "pointer-events-none opacity-55", _e(t, qe)),
|
|
188
189
|
onClick: () => {
|
|
189
190
|
i || k?.(t);
|
|
190
191
|
},
|
|
@@ -192,8 +193,8 @@ function xe({ className: xe, columns: Se, data: p, title: m, description: h, fea
|
|
|
192
193
|
i || Be?.(t);
|
|
193
194
|
},
|
|
194
195
|
children: t.getVisibleCells().map((t) => {
|
|
195
|
-
let n =
|
|
196
|
-
return /* @__PURE__ */
|
|
196
|
+
let n = d(t.column.columnDef.cell, t.getContext());
|
|
197
|
+
return /* @__PURE__ */ l(o, {
|
|
197
198
|
style: {
|
|
198
199
|
...t.column.getIsPinned() === "left" ? {
|
|
199
200
|
left: `${t.column.getStart("left")}px`,
|
|
@@ -206,24 +207,24 @@ function xe({ className: xe, columns: Se, data: p, title: m, description: h, fea
|
|
|
206
207
|
zIndex: 10
|
|
207
208
|
} : {}
|
|
208
209
|
},
|
|
209
|
-
className: e(
|
|
210
|
-
children:
|
|
210
|
+
className: e(ge[j], t.column.getIsPinned() && "bg-card shadow-[1px_0_0_var(--border)]", N && "border-r last:border-r-0", ye(t, Ke)),
|
|
211
|
+
children: be(n) ? F : n
|
|
211
212
|
}, t.id);
|
|
212
213
|
})
|
|
213
|
-
}), t.getIsExpanded() && Je ? /* @__PURE__ */
|
|
214
|
+
}), t.getIsExpanded() && Je ? /* @__PURE__ */ l(s, {
|
|
214
215
|
className: "bg-muted/50 hover:bg-muted/50",
|
|
215
|
-
children: /* @__PURE__ */
|
|
216
|
+
children: /* @__PURE__ */ l(o, {
|
|
216
217
|
colSpan: t.getVisibleCells().length,
|
|
217
218
|
children: Je(t)
|
|
218
219
|
})
|
|
219
220
|
}) : null] }, t.id);
|
|
220
221
|
}, jt = (t) => {
|
|
221
222
|
let n = A?.(t) ?? !1, r = t.getVisibleCells();
|
|
222
|
-
return /* @__PURE__ */
|
|
223
|
+
return /* @__PURE__ */ l("article", {
|
|
223
224
|
"data-slot": "data-table-mobile-card",
|
|
224
225
|
"data-state": t.getIsSelected() ? "selected" : void 0,
|
|
225
226
|
"data-disabled": n || void 0,
|
|
226
|
-
className: e("grid gap-3 rounded-[var(--aui-card-radius,var(--radius-lg))] border border-[color:var(--aui-card-border,var(--border))] bg-card p-3 shadow-[var(--aui-card-shadow,0_10px_24px_rgba(15,23,42,0.07))]", k && !n && "cursor-pointer transition-colors hover:bg-[color:color-mix(in_oklch,var(--primary),transparent_96%)]", n && "pointer-events-none opacity-55",
|
|
227
|
+
className: e("grid gap-3 rounded-[var(--aui-card-radius,var(--radius-lg))] border border-[color:var(--aui-card-border,var(--border))] bg-card p-3 shadow-[var(--aui-card-shadow,0_10px_24px_rgba(15,23,42,0.07))]", k && !n && "cursor-pointer transition-colors hover:bg-[color:color-mix(in_oklch,var(--primary),transparent_96%)]", n && "pointer-events-none opacity-55", _e(t, qe)),
|
|
227
228
|
role: k && !n ? "button" : void 0,
|
|
228
229
|
tabIndex: k && !n ? 0 : void 0,
|
|
229
230
|
onClick: () => {
|
|
@@ -233,54 +234,55 @@ function xe({ className: xe, columns: Se, data: p, title: m, description: h, fea
|
|
|
233
234
|
e.target !== e.currentTarget || n || !k || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), k(t));
|
|
234
235
|
},
|
|
235
236
|
children: r.map((e) => {
|
|
236
|
-
let t =
|
|
237
|
-
return /* @__PURE__ */
|
|
237
|
+
let t = d(e.column.columnDef.cell, e.getContext());
|
|
238
|
+
return /* @__PURE__ */ u("div", {
|
|
238
239
|
"data-slot": "data-table-mobile-cell",
|
|
239
240
|
className: "grid grid-cols-[minmax(7rem,0.42fr)_minmax(0,1fr)] items-start gap-3 text-sm",
|
|
240
|
-
children: [/* @__PURE__ */
|
|
241
|
+
children: [/* @__PURE__ */ l("span", {
|
|
241
242
|
className: "min-w-0 text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
242
|
-
children:
|
|
243
|
-
}), /* @__PURE__ */
|
|
243
|
+
children: xe(e)
|
|
244
|
+
}), /* @__PURE__ */ l("div", {
|
|
244
245
|
className: "min-w-0 text-right text-foreground/92 [&>*]:ml-auto",
|
|
245
|
-
children:
|
|
246
|
+
children: be(t) ? F : t
|
|
246
247
|
})]
|
|
247
248
|
}, e.id);
|
|
248
249
|
})
|
|
249
250
|
}, t.id);
|
|
250
251
|
};
|
|
251
|
-
return /* @__PURE__ */
|
|
252
|
+
return /* @__PURE__ */ u("div", {
|
|
252
253
|
"data-slot": "data-table",
|
|
253
|
-
className: e("grid gap-3",
|
|
254
|
+
className: e("grid gap-3", Se),
|
|
254
255
|
...tt,
|
|
255
256
|
children: [
|
|
256
|
-
wt && (ht ?? /* @__PURE__ */
|
|
257
|
-
title:
|
|
258
|
-
description:
|
|
257
|
+
wt && (ht ?? /* @__PURE__ */ l(re, {
|
|
258
|
+
title: p,
|
|
259
|
+
description: m,
|
|
259
260
|
search: xt,
|
|
260
261
|
filters: q,
|
|
261
262
|
summary: J,
|
|
262
263
|
actions: St,
|
|
263
264
|
selectionActions: Ct,
|
|
264
265
|
selectedCount: ft,
|
|
265
|
-
totalCount: I ? I.rowCount ??
|
|
266
|
+
totalCount: I ? I.rowCount ?? f.length : f.length,
|
|
266
267
|
variant: "plain",
|
|
267
268
|
...gt
|
|
268
269
|
})),
|
|
269
|
-
Q && /* @__PURE__ */
|
|
270
|
+
Q && /* @__PURE__ */ l("div", {
|
|
270
271
|
className: "grid gap-3",
|
|
271
|
-
children: $ ?? (Z ? /* @__PURE__ */
|
|
272
|
-
|
|
272
|
+
children: $ ?? (Z ? /* @__PURE__ */ l(n, {
|
|
273
|
+
status: "loading",
|
|
274
|
+
title: "Loading data...",
|
|
273
275
|
...w
|
|
274
|
-
}) : R.map((e) => /* @__PURE__ */
|
|
276
|
+
}) : R.map((e) => /* @__PURE__ */ l(c.Fragment, { children: O ? O(e) : jt(e) }, e.id)))
|
|
275
277
|
}),
|
|
276
|
-
!Q && /* @__PURE__ */
|
|
278
|
+
!Q && /* @__PURE__ */ u("div", {
|
|
277
279
|
"data-slot": "data-table-wrapper",
|
|
278
280
|
"data-density": j,
|
|
279
281
|
"data-striped": M || void 0,
|
|
280
282
|
"data-bordered": N || void 0,
|
|
281
283
|
"data-virtualized": B || void 0,
|
|
282
284
|
className: e("overflow-hidden rounded-[var(--aui-card-radius,var(--radius-lg))] border border-[color:var(--aui-card-border,var(--border))] bg-card shadow-[var(--aui-card-shadow,0_10px_24px_rgba(15,23,42,0.07))] backdrop-blur", We),
|
|
283
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ u(oe, {
|
|
284
286
|
containerRef: ot,
|
|
285
287
|
containerStyle: B ? {
|
|
286
288
|
height: V,
|
|
@@ -289,9 +291,9 @@ function xe({ className: xe, columns: Se, data: p, title: m, description: h, fea
|
|
|
289
291
|
containerClassName: e("rounded-none border-0 bg-transparent shadow-none ring-0", B && "overflow-auto"),
|
|
290
292
|
className: e("text-[0.95rem]", Ue),
|
|
291
293
|
"aria-rowcount": R.length,
|
|
292
|
-
children: [/* @__PURE__ */
|
|
294
|
+
children: [/* @__PURE__ */ l(le, {
|
|
293
295
|
className: e((P || B) && "sticky top-0 z-10 shadow-sm backdrop-blur"),
|
|
294
|
-
children: L.getHeaderGroups().map((t) => /* @__PURE__ */
|
|
296
|
+
children: L.getHeaderGroups().map((t) => /* @__PURE__ */ l(s, { children: t.headers.map((t) => /* @__PURE__ */ l(ce, {
|
|
295
297
|
style: {
|
|
296
298
|
width: t.getSize(),
|
|
297
299
|
...t.column.getIsPinned() === "left" ? {
|
|
@@ -305,15 +307,15 @@ function xe({ className: xe, columns: Se, data: p, title: m, description: h, fea
|
|
|
305
307
|
zIndex: P ? 20 : 11
|
|
306
308
|
} : {}
|
|
307
309
|
},
|
|
308
|
-
className: e(
|
|
309
|
-
children: t.isPlaceholder ? null :
|
|
310
|
+
className: e(he[j], "bg-[color:color-mix(in_oklch,var(--card),var(--background)_10%)] text-muted-foreground", (P || B) && "bg-[color:color-mix(in_oklch,var(--card),transparent_12%)] backdrop-blur", t.column.getIsPinned() && "bg-card shadow-[1px_0_0_var(--border)]", N && "border-r last:border-r-0", ve(t, Ge)),
|
|
311
|
+
children: t.isPlaceholder ? null : d(t.column.columnDef.header, t.getContext())
|
|
310
312
|
}, t.id)) }, t.id))
|
|
311
|
-
}), /* @__PURE__ */
|
|
313
|
+
}), /* @__PURE__ */ l(se, { children: $ ? Ot($) : Z ? kt() : B ? [
|
|
312
314
|
Dt("virtual-top", ut),
|
|
313
315
|
...W.map((e) => At(R[e.index], e.index, e)),
|
|
314
316
|
Dt("virtual-bottom", dt)
|
|
315
317
|
] : R.map((e, t) => At(e, t)) })]
|
|
316
|
-
}), Tt && I && /* @__PURE__ */
|
|
318
|
+
}), Tt && I && /* @__PURE__ */ l(ne, {
|
|
317
319
|
pageIndex: I.pageIndex,
|
|
318
320
|
pageSize: I.pageSize,
|
|
319
321
|
pageCount: I.pageCount,
|
|
@@ -330,4 +332,4 @@ function xe({ className: xe, columns: Se, data: p, title: m, description: h, fea
|
|
|
330
332
|
});
|
|
331
333
|
}
|
|
332
334
|
//#endregion
|
|
333
|
-
export {
|
|
335
|
+
export { Se as DataTable };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./state-view.cjs"),t=require("./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./state-view.cjs"),t=require("./alert.cjs");exports.Alert=t.Alert,exports.StateView=e.StateView;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { StateView as e } from "./state-view.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { InlineState as r, PageState as i } from "./page-state.js";
|
|
5
|
-
export { n as Alert, r as InlineState, t as LoadingState, i as PageState, e as StateView };
|
|
2
|
+
import { Alert as t } from "./alert.js";
|
|
3
|
+
export { t as Alert, e as StateView };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./breadcrumbs.cjs"),t=require("./workspace-header.cjs"),n=require("./sidebar-context.cjs"),r=require("./sidebar.cjs"),i=require("./section.cjs"),a=require("./workspace-layout.cjs");exports.Breadcrumbs=e.Breadcrumbs,exports.Section=i.Section,exports.Sidebar=r.Sidebar,exports.SidebarInset=r.SidebarInset,exports.SidebarProvider=n.SidebarProvider,exports.SidebarTrigger=n.SidebarTrigger,exports.SplitLayout=i.SplitLayout,exports.
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./breadcrumbs.cjs"),t=require("./workspace-header.cjs"),n=require("./sidebar-context.cjs"),r=require("./sidebar.cjs"),i=require("./section.cjs"),a=require("./workspace-layout.cjs");exports.Breadcrumbs=e.Breadcrumbs,exports.Section=i.Section,exports.Sidebar=r.Sidebar,exports.SidebarInset=r.SidebarInset,exports.SidebarProvider=n.SidebarProvider,exports.SidebarTrigger=n.SidebarTrigger,exports.SplitLayout=i.SplitLayout,exports.WorkspaceContent=a.WorkspaceContent,exports.WorkspaceHeader=t.WorkspaceHeader,exports.WorkspaceLayout=a.WorkspaceLayout,exports.WorkspaceMain=a.WorkspaceMain,exports.useSidebar=n.useSidebar;
|
|
@@ -2,6 +2,6 @@ import { Breadcrumbs as e } from "./breadcrumbs.js";
|
|
|
2
2
|
import { WorkspaceHeader as t } from "./workspace-header.js";
|
|
3
3
|
import { SidebarProvider as n, SidebarTrigger as r, useSidebar as i } from "./sidebar-context.js";
|
|
4
4
|
import { Sidebar as a, SidebarInset as o } from "./sidebar.js";
|
|
5
|
-
import { Section as s, SplitLayout as c
|
|
6
|
-
import { WorkspaceContent as
|
|
7
|
-
export { e as Breadcrumbs, s as Section, a as Sidebar, o as SidebarInset, n as SidebarProvider, r as SidebarTrigger, c as SplitLayout, l as
|
|
5
|
+
import { Section as s, SplitLayout as c } from "./section.js";
|
|
6
|
+
import { WorkspaceContent as l, WorkspaceLayout as u, WorkspaceMain as d } from "./workspace-layout.js";
|
|
7
|
+
export { e as Breadcrumbs, s as Section, a as Sidebar, o as SidebarInset, n as SidebarProvider, r as SidebarTrigger, c as SplitLayout, l as WorkspaceContent, t as WorkspaceHeader, u as WorkspaceLayout, d as WorkspaceMain, i as useSidebar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./breadcrumbs.cjs"),t=require("./workspace-header.cjs"),n=require("./sidebar-context.cjs"),r=require("./sidebar.cjs"),i=require("./section.cjs"),a=require("./workspace-layout.cjs");exports.Breadcrumbs=e.Breadcrumbs,exports.Section=i.Section,exports.Sidebar=r.Sidebar,exports.SidebarInset=r.SidebarInset,exports.SidebarProvider=n.SidebarProvider,exports.SidebarTrigger=n.SidebarTrigger,exports.SplitLayout=i.SplitLayout,exports.
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./breadcrumbs.cjs"),t=require("./workspace-header.cjs"),n=require("./sidebar-context.cjs"),r=require("./sidebar.cjs"),i=require("./section.cjs"),a=require("./workspace-layout.cjs");exports.Breadcrumbs=e.Breadcrumbs,exports.Section=i.Section,exports.Sidebar=r.Sidebar,exports.SidebarInset=r.SidebarInset,exports.SidebarProvider=n.SidebarProvider,exports.SidebarTrigger=n.SidebarTrigger,exports.SplitLayout=i.SplitLayout,exports.WorkspaceContent=a.WorkspaceContent,exports.WorkspaceHeader=t.WorkspaceHeader,exports.WorkspaceLayout=a.WorkspaceLayout,exports.WorkspaceMain=a.WorkspaceMain,exports.useSidebar=n.useSidebar;
|
|
@@ -2,6 +2,6 @@ import { Breadcrumbs as e } from "./breadcrumbs.js";
|
|
|
2
2
|
import { WorkspaceHeader as t } from "./workspace-header.js";
|
|
3
3
|
import { SidebarProvider as n, SidebarTrigger as r, useSidebar as i } from "./sidebar-context.js";
|
|
4
4
|
import { Sidebar as a, SidebarInset as o } from "./sidebar.js";
|
|
5
|
-
import { Section as s, SplitLayout as c
|
|
6
|
-
import { WorkspaceContent as
|
|
7
|
-
export { e as Breadcrumbs, s as Section, a as Sidebar, o as SidebarInset, n as SidebarProvider, r as SidebarTrigger, c as SplitLayout, l as
|
|
5
|
+
import { Section as s, SplitLayout as c } from "./section.js";
|
|
6
|
+
import { WorkspaceContent as l, WorkspaceLayout as u, WorkspaceMain as d } from "./workspace-layout.js";
|
|
7
|
+
export { e as Breadcrumbs, s as Section, a as Sidebar, o as SidebarInset, n as SidebarProvider, r as SidebarTrigger, c as SplitLayout, l as WorkspaceContent, t as WorkspaceHeader, u as WorkspaceLayout, d as WorkspaceMain, i as useSidebar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");var i={compact:`gap-2`,default:`gap-4`,comfortable:`gap-6`},a={compact:`p-3`,default:`p-4`,comfortable:`p-6`};function o({title:e,description:n,actions:o,padded:s=!0,bordered:c=!1,variant:l=c?`panel`:`plain`,density:u=`default`,headerClassName:d,bodyClassName:f,className:p,children:m,...h}){let g=l===`panel`;return(0,r.jsxs)(`section`,{"data-slot":`section`,"data-variant":l,"data-density":u,className:t.cn(`grid min-w-0`,i[u],g&&`rounded-[var(--aui-card-radius,var(--radius-lg))] border border-[color:var(--aui-card-border,var(--border))] bg-card text-card-foreground shadow-[var(--aui-card-shadow,var(--aui-shadow-xs))]`,s&&g&&a[u],p),...h,children:[(e||n||o)&&(0,r.jsxs)(`div`,{"data-slot":`section-header`,className:t.cn(`flex flex-wrap items-start justify-between gap-3`,d),children:[(0,r.jsxs)(`div`,{className:`grid gap-1`,children:[e&&(0,r.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight text-foreground`,children:e}),n&&(0,r.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n})]}),o&&(0,r.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),(0,r.jsx)(`div`,{"data-slot":`section-content`,className:f,children:m})]})}function s({
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");var i={compact:`gap-2`,default:`gap-4`,comfortable:`gap-6`},a={compact:`p-3`,default:`p-4`,comfortable:`p-6`};function o({title:e,description:n,actions:o,padded:s=!0,bordered:c=!1,variant:l=c?`panel`:`plain`,density:u=`default`,headerClassName:d,bodyClassName:f,className:p,children:m,...h}){let g=l===`panel`;return(0,r.jsxs)(`section`,{"data-slot":`section`,"data-variant":l,"data-density":u,className:t.cn(`grid min-w-0`,i[u],g&&`rounded-[var(--aui-card-radius,var(--radius-lg))] border border-[color:var(--aui-card-border,var(--border))] bg-card text-card-foreground shadow-[var(--aui-card-shadow,var(--aui-shadow-xs))]`,s&&g&&a[u],p),...h,children:[(e||n||o)&&(0,r.jsxs)(`div`,{"data-slot":`section-header`,className:t.cn(`flex flex-wrap items-start justify-between gap-3`,d),children:[(0,r.jsxs)(`div`,{className:`grid gap-1`,children:[e&&(0,r.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight text-foreground`,children:e}),n&&(0,r.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n})]}),o&&(0,r.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),(0,r.jsx)(`div`,{"data-slot":`section-content`,className:f,children:m})]})}function s({aside:e,asidePosition:n=`end`,asideClassName:i,contentClassName:a,asideWidth:o=`20rem`,className:s,children:c,style:l,...u}){let d=(0,r.jsx)(`aside`,{"data-slot":`split-layout-aside`,className:t.cn(`min-w-0`,i),children:e}),f=(0,r.jsx)(`main`,{"data-slot":`split-layout-content`,className:t.cn(`min-w-0`,a),children:c});return(0,r.jsxs)(`div`,{"data-slot":`split-layout`,className:t.cn(`grid gap-4 lg:grid-cols-[minmax(0,1fr)_var(--split-aside-width)]`,n===`start`&&`lg:grid-cols-[var(--split-aside-width)_minmax(0,1fr)]`,s),style:{"--split-aside-width":o,...l},...u,children:[n===`start`?d:f,n===`start`?f:d]})}exports.Section=o,exports.SplitLayout=s;
|
|
@@ -42,31 +42,7 @@ function a({ title: a, description: o, actions: s, padded: c = !0, bordered: l =
|
|
|
42
42
|
})]
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
function o({
|
|
46
|
-
return /* @__PURE__ */ n("div", {
|
|
47
|
-
"data-slot": "toolbar",
|
|
48
|
-
className: e("flex flex-wrap items-center justify-between gap-3", s),
|
|
49
|
-
...l,
|
|
50
|
-
children: [
|
|
51
|
-
(r || i) && /* @__PURE__ */ n("div", {
|
|
52
|
-
className: "grid gap-0.5",
|
|
53
|
-
children: [r && /* @__PURE__ */ t("div", {
|
|
54
|
-
className: "font-medium text-foreground",
|
|
55
|
-
children: r
|
|
56
|
-
}), i && /* @__PURE__ */ t("div", {
|
|
57
|
-
className: "text-sm text-muted-foreground",
|
|
58
|
-
children: i
|
|
59
|
-
})]
|
|
60
|
-
}),
|
|
61
|
-
c,
|
|
62
|
-
(a || o) && /* @__PURE__ */ n("div", {
|
|
63
|
-
className: "flex flex-wrap items-center gap-2",
|
|
64
|
-
children: [a, o]
|
|
65
|
-
})
|
|
66
|
-
]
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
function s({ aside: r, asidePosition: i = "end", asideClassName: a, contentClassName: o, asideWidth: s = "20rem", className: c, children: l, style: u, ...d }) {
|
|
45
|
+
function o({ aside: r, asidePosition: i = "end", asideClassName: a, contentClassName: o, asideWidth: s = "20rem", className: c, children: l, style: u, ...d }) {
|
|
70
46
|
let f = /* @__PURE__ */ t("aside", {
|
|
71
47
|
"data-slot": "split-layout-aside",
|
|
72
48
|
className: e("min-w-0", a),
|
|
@@ -88,4 +64,4 @@ function s({ aside: r, asidePosition: i = "end", asideClassName: a, contentClass
|
|
|
88
64
|
});
|
|
89
65
|
}
|
|
90
66
|
//#endregion
|
|
91
|
-
export { a as Section,
|
|
67
|
+
export { a as Section, o as SplitLayout };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("lucide-react"),i=require("react/jsx-runtime"),a=require("@base-ui/react/number-field");function o({className:e,...n}){return(0,i.jsx)(a.NumberField.Root,{"data-slot":`number-field`,className:t.cn(`grid gap-2`,e),...n})}function s({className:e,...n}){return(0,i.jsx)(a.NumberField.Group,{"data-slot":`number-field-group`,className:t.cn(`flex min-h-10 w-full overflow-hidden rounded-[var(--radius-md)] border border-input bg-background text-foreground shadow-xs transition-[border-color,box-shadow] focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/35 has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50`,e),...n})}function c({className:e,...n}){return(0,i.jsx)(a.NumberField.Input,{"data-slot":`number-field-input`,className:t.cn(`min-w-0 flex-1 bg-transparent px-3 py-2 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed`,e),...n})}function l({className:e,children:n,...o}){return(0,i.jsx)(a.NumberField.Increment,{"data-slot":`number-field-increment`,className:t.cn(`flex h-5 w-8 items-center justify-center border-l border-border text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-40`,e),...o,children:n??(0,i.jsx)(r.ChevronUpIcon,{"aria-hidden":`true`,className:`size-3.5`})})}function u({className:e,children:n,...o}){return(0,i.jsx)(a.NumberField.Decrement,{"data-slot":`number-field-decrement`,className:t.cn(`flex h-5 w-8 items-center justify-center border-l border-t border-border text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-40`,e),...o,children:n??(0,i.jsx)(r.ChevronDownIcon,{"aria-hidden":`true`,className:`size-3.5`})})}function d({className:e,...n}){return(0,i.jsx)(`div`,{"data-slot":`number-field-stepper`,className:t.cn(`grid shrink-0 grid-rows-2`,e),...n})}function f({className:e,...n}){return(0,i.jsx)(a.NumberField.ScrubArea,{"data-slot":`number-field-scrub-area`,className:t.cn(`cursor-ew-resize select-none`,e),...n})}function p({className:e,...n}){return(0,i.jsx)(a.NumberField.ScrubAreaCursor,{"data-slot":`number-field-scrub-area-cursor`,className:t.cn(`fixed z-50 rounded bg-foreground px-2 py-1 text-xs text-background shadow-lg`,e),...n})}exports.NumberField=o,exports.NumberFieldDecrement=u,exports.NumberFieldGroup=s,exports.NumberFieldIncrement=l,exports.NumberFieldInput=c,exports.NumberFieldScrubArea=f,exports.NumberFieldScrubAreaCursor=p,exports.NumberFieldStepper=d;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { ChevronDownIcon as t, ChevronUpIcon as n } from "lucide-react";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
import { NumberField as i } from "@base-ui/react/number-field";
|
|
7
|
+
//#region src/components/ui/number-field/index.tsx
|
|
8
|
+
function a({ className: t, ...n }) {
|
|
9
|
+
return /* @__PURE__ */ r(i.Root, {
|
|
10
|
+
"data-slot": "number-field",
|
|
11
|
+
className: e("grid gap-2", t),
|
|
12
|
+
...n
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function o({ className: t, ...n }) {
|
|
16
|
+
return /* @__PURE__ */ r(i.Group, {
|
|
17
|
+
"data-slot": "number-field-group",
|
|
18
|
+
className: e("flex min-h-10 w-full overflow-hidden rounded-[var(--radius-md)] border border-input bg-background text-foreground shadow-xs transition-[border-color,box-shadow] focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/35 has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50", t),
|
|
19
|
+
...n
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function s({ className: t, ...n }) {
|
|
23
|
+
return /* @__PURE__ */ r(i.Input, {
|
|
24
|
+
"data-slot": "number-field-input",
|
|
25
|
+
className: e("min-w-0 flex-1 bg-transparent px-3 py-2 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed", t),
|
|
26
|
+
...n
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function c({ className: t, children: a, ...o }) {
|
|
30
|
+
return /* @__PURE__ */ r(i.Increment, {
|
|
31
|
+
"data-slot": "number-field-increment",
|
|
32
|
+
className: e("flex h-5 w-8 items-center justify-center border-l border-border text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-40", t),
|
|
33
|
+
...o,
|
|
34
|
+
children: a ?? /* @__PURE__ */ r(n, {
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
className: "size-3.5"
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function l({ className: n, children: a, ...o }) {
|
|
41
|
+
return /* @__PURE__ */ r(i.Decrement, {
|
|
42
|
+
"data-slot": "number-field-decrement",
|
|
43
|
+
className: e("flex h-5 w-8 items-center justify-center border-l border-t border-border text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-40", n),
|
|
44
|
+
...o,
|
|
45
|
+
children: a ?? /* @__PURE__ */ r(t, {
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
className: "size-3.5"
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function u({ className: t, ...n }) {
|
|
52
|
+
return /* @__PURE__ */ r("div", {
|
|
53
|
+
"data-slot": "number-field-stepper",
|
|
54
|
+
className: e("grid shrink-0 grid-rows-2", t),
|
|
55
|
+
...n
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function d({ className: t, ...n }) {
|
|
59
|
+
return /* @__PURE__ */ r(i.ScrubArea, {
|
|
60
|
+
"data-slot": "number-field-scrub-area",
|
|
61
|
+
className: e("cursor-ew-resize select-none", t),
|
|
62
|
+
...n
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function f({ className: t, ...n }) {
|
|
66
|
+
return /* @__PURE__ */ r(i.ScrubAreaCursor, {
|
|
67
|
+
"data-slot": "number-field-scrub-area-cursor",
|
|
68
|
+
className: e("fixed z-50 rounded bg-foreground px-2 py-1 text-xs text-background shadow-lg", t),
|
|
69
|
+
...n
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
export { a as NumberField, l as NumberFieldDecrement, o as NumberFieldGroup, c as NumberFieldIncrement, s as NumberFieldInput, d as NumberFieldScrubArea, f as NumberFieldScrubAreaCursor, u as NumberFieldStepper };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../lib/utils.cjs");let t=require("react/jsx-runtime"),n=require("@base-ui/react/toggle"),r=require("@base-ui/react/toggle-group");var i={sm:`h-8 min-w-8 px-2 text-xs`,md:`h-9 min-w-9 px-3 text-sm`,lg:`h-10 min-w-10 px-3.5 text-sm`};function a({className:n,variant:i=`default`,size:a=`md`,orientation:o=`horizontal`,...s}){return(0,t.jsx)(r.ToggleGroup,{"data-slot":`toggle-group`,"data-variant":i,"data-size":a,orientation:o,className:e.cn(`inline-flex items-center gap-1 rounded-[var(--radius-lg)]`,i==="default"&&`border border-border bg-muted/60 p-1`,i===`outline`&&`gap-0 overflow-hidden rounded-[var(--radius-lg)] border border-border`,o===`vertical`&&`flex-col items-stretch`,n),...s})}function o({className:r,variant:a=`default`,size:o=`md`,...s}){return(0,t.jsx)(n.Toggle,{"data-slot":`toggle-group-item`,"data-variant":a,"data-size":o,className:e.cn(`inline-flex items-center justify-center gap-1.5 whitespace-nowrap font-medium outline-none transition-[background-color,color,border-color,box-shadow] disabled:pointer-events-none disabled:opacity-50 data-[pressed]:text-foreground focus-visible:ring-2 focus-visible:ring-ring [&_svg]:size-4 [&_svg]:shrink-0`,i[o],a==="default"&&`rounded-[calc(var(--radius-md)-1px)] text-muted-foreground hover:bg-background/70 data-[pressed]:bg-background data-[pressed]:shadow-sm`,a===`outline`&&`-m-px border border-border text-muted-foreground hover:bg-muted/60 data-[pressed]:bg-muted data-[pressed]:shadow-inner first:rounded-l-[var(--radius-md)] last:rounded-r-[var(--radius-md)]`,a===`ghost`&&`rounded-[var(--radius-md)] text-muted-foreground hover:bg-muted/70 data-[pressed]:bg-muted`,r),...s})}exports.ToggleGroup=a,exports.ToggleGroupItem=o;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import { Toggle as n } from "@base-ui/react/toggle";
|
|
5
|
+
import { ToggleGroup as r } from "@base-ui/react/toggle-group";
|
|
6
|
+
//#region src/components/ui/toggle-group/index.tsx
|
|
7
|
+
var i = {
|
|
8
|
+
sm: "h-8 min-w-8 px-2 text-xs",
|
|
9
|
+
md: "h-9 min-w-9 px-3 text-sm",
|
|
10
|
+
lg: "h-10 min-w-10 px-3.5 text-sm"
|
|
11
|
+
};
|
|
12
|
+
function a({ className: n, variant: i = "default", size: a = "md", orientation: o = "horizontal", ...s }) {
|
|
13
|
+
return /* @__PURE__ */ t(r, {
|
|
14
|
+
"data-slot": "toggle-group",
|
|
15
|
+
"data-variant": i,
|
|
16
|
+
"data-size": a,
|
|
17
|
+
orientation: o,
|
|
18
|
+
className: e("inline-flex items-center gap-1 rounded-[var(--radius-lg)]", i === "default" && "border border-border bg-muted/60 p-1", i === "outline" && "gap-0 overflow-hidden rounded-[var(--radius-lg)] border border-border", o === "vertical" && "flex-col items-stretch", n),
|
|
19
|
+
...s
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function o({ className: r, variant: a = "default", size: o = "md", ...s }) {
|
|
23
|
+
return /* @__PURE__ */ t(n, {
|
|
24
|
+
"data-slot": "toggle-group-item",
|
|
25
|
+
"data-variant": a,
|
|
26
|
+
"data-size": o,
|
|
27
|
+
className: e("inline-flex items-center justify-center gap-1.5 whitespace-nowrap font-medium outline-none transition-[background-color,color,border-color,box-shadow] disabled:pointer-events-none disabled:opacity-50 data-[pressed]:text-foreground focus-visible:ring-2 focus-visible:ring-ring [&_svg]:size-4 [&_svg]:shrink-0", i[o], a === "default" && "rounded-[calc(var(--radius-md)-1px)] text-muted-foreground hover:bg-background/70 data-[pressed]:bg-background data-[pressed]:shadow-sm", a === "outline" && "-m-px border border-border text-muted-foreground hover:bg-muted/60 data-[pressed]:bg-muted data-[pressed]:shadow-inner first:rounded-l-[var(--radius-md)] last:rounded-r-[var(--radius-md)]", a === "ghost" && "rounded-[var(--radius-md)] text-muted-foreground hover:bg-muted/70 data-[pressed]:bg-muted", r),
|
|
28
|
+
...s
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { a as ToggleGroup, o as ToggleGroupItem };
|