tembro 4.2.1 → 5.0.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.
- package/CHANGELOG.md +15 -0
- package/dist/components/patterns/index.d.ts +0 -8
- package/dist/components/patterns/public.d.ts +0 -8
- package/dist/components/ui/hover-card/index.cjs +1 -0
- package/dist/components/ui/hover-card/index.d.ts +11 -0
- package/dist/components/ui/hover-card/index.js +1 -0
- package/dist/components/ui/menubar/index.cjs +1 -0
- package/dist/components/ui/menubar/index.d.ts +42 -0
- package/dist/components/ui/menubar/index.js +1 -0
- package/dist/components/ui/navigation-menu/index.cjs +1 -0
- package/dist/components/ui/navigation-menu/index.d.ts +20 -0
- package/dist/components/ui/navigation-menu/index.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/src/components/patterns/index.cjs +1 -1
- package/dist/src/components/patterns/index.js +2 -10
- package/dist/src/components/patterns/public.cjs +1 -1
- package/dist/src/components/patterns/public.js +2 -10
- package/dist/src/components/ui/hover-card/index.cjs +1 -0
- package/dist/src/components/ui/hover-card/index.js +50 -0
- package/dist/src/components/ui/menubar/index.cjs +1 -0
- package/dist/src/components/ui/menubar/index.js +132 -0
- package/dist/src/components/ui/navigation-menu/index.cjs +1 -0
- package/dist/src/components/ui/navigation-menu/index.js +73 -0
- package/dist/src/index.cjs +1 -1
- package/dist/src/index.js +25 -29
- package/dist/src/public-component-surface.cjs +1 -1
- package/dist/src/public-component-surface.js +16 -42
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +100 -100
- package/packages/cli/vendor/src/components/patterns/index.ts +0 -8
- package/packages/cli/vendor/src/components/patterns/public.ts +0 -8
- package/packages/cli/vendor/src/components/ui/hover-card/index.tsx +72 -0
- package/packages/cli/vendor/src/components/ui/menubar/index.tsx +140 -0
- package/packages/cli/vendor/src/components/ui/navigation-menu/index.tsx +100 -0
- package/packages/cli/vendor/src/index.ts +6 -2
- package/packages/cli/vendor/src/public-component-surface.ts +4 -10
- package/packages/cli/vendor/templates/showcase/src/showcase/data/registry.ts +10 -10
- 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/registry.json +2124 -258
- package/dist/components/patterns/bulk-action-bar.cjs +0 -1
- package/dist/components/patterns/bulk-action-bar.d.ts +0 -10
- package/dist/components/patterns/bulk-action-bar.js +0 -1
- package/dist/components/patterns/data-view.cjs +0 -1
- package/dist/components/patterns/data-view.d.ts +0 -17
- package/dist/components/patterns/data-view.js +0 -1
- package/dist/components/patterns/detail-layout.cjs +0 -1
- package/dist/components/patterns/detail-layout.d.ts +0 -16
- package/dist/components/patterns/detail-layout.js +0 -1
- package/dist/components/patterns/form-builder.cjs +0 -1
- package/dist/components/patterns/form-builder.d.ts +0 -110
- package/dist/components/patterns/form-builder.js +0 -1
- package/dist/components/patterns/page-toolbar.cjs +0 -1
- package/dist/components/patterns/page-toolbar.d.ts +0 -11
- package/dist/components/patterns/page-toolbar.js +0 -1
- package/dist/components/patterns/resource-detail-page.cjs +0 -1
- package/dist/components/patterns/resource-detail-page.d.ts +0 -39
- package/dist/components/patterns/resource-detail-page.js +0 -1
- package/dist/components/patterns/resource-page.cjs +0 -1
- package/dist/components/patterns/resource-page.d.ts +0 -30
- package/dist/components/patterns/resource-page.js +0 -1
- package/dist/components/patterns/settings-page.cjs +0 -1
- package/dist/components/patterns/settings-page.d.ts +0 -21
- package/dist/components/patterns/settings-page.js +0 -1
- package/dist/src/components/patterns/bulk-action-bar.cjs +0 -1
- package/dist/src/components/patterns/bulk-action-bar.js +0 -34
- package/dist/src/components/patterns/data-view.cjs +0 -1
- package/dist/src/components/patterns/data-view.js +0 -47
- package/dist/src/components/patterns/detail-layout.cjs +0 -1
- package/dist/src/components/patterns/detail-layout.js +0 -65
- package/dist/src/components/patterns/form-builder.cjs +0 -1
- package/dist/src/components/patterns/form-builder.js +0 -263
- package/dist/src/components/patterns/page-toolbar.cjs +0 -1
- package/dist/src/components/patterns/page-toolbar.js +0 -41
- package/dist/src/components/patterns/resource-detail-page.cjs +0 -1
- package/dist/src/components/patterns/resource-detail-page.js +0 -100
- package/dist/src/components/patterns/resource-page.cjs +0 -1
- package/dist/src/components/patterns/resource-page.js +0 -88
- package/dist/src/components/patterns/settings-page.cjs +0 -1
- package/dist/src/components/patterns/settings-page.js +0 -64
- package/packages/cli/vendor/src/components/patterns/bulk-action-bar.tsx +0 -53
- package/packages/cli/vendor/src/components/patterns/data-view.tsx +0 -64
- package/packages/cli/vendor/src/components/patterns/detail-layout.tsx +0 -75
- package/packages/cli/vendor/src/components/patterns/form-builder.tsx +0 -472
- package/packages/cli/vendor/src/components/patterns/page-toolbar.tsx +0 -61
- package/packages/cli/vendor/src/components/patterns/resource-detail-page.tsx +0 -164
- package/packages/cli/vendor/src/components/patterns/resource-page.tsx +0 -149
- package/packages/cli/vendor/src/components/patterns/settings-page.tsx +0 -84
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import { Button as t } from "../ui/button/index.js";
|
|
3
|
-
import { FormDateRangeInput as n } from "../form/form-date-range-input.js";
|
|
4
|
-
import { FormInput as r } from "../form/form-input.js";
|
|
5
|
-
import { FormSelect as i } from "../form/form-select.js";
|
|
6
|
-
import { FormSwitch as a } from "../form/form-switch.js";
|
|
7
|
-
import { FormTextarea as o } from "../form/form-textarea.js";
|
|
8
|
-
import * as s from "react";
|
|
9
|
-
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
-
//#region src/components/patterns/form-builder.tsx
|
|
11
|
-
var d = {
|
|
12
|
-
compact: "gap-3",
|
|
13
|
-
default: "gap-4",
|
|
14
|
-
comfortable: "gap-6"
|
|
15
|
-
}, f = {
|
|
16
|
-
1: "grid-cols-1",
|
|
17
|
-
2: "grid-cols-1 md:grid-cols-2",
|
|
18
|
-
3: "grid-cols-1 md:grid-cols-2 xl:grid-cols-3",
|
|
19
|
-
4: "grid-cols-1 md:grid-cols-2 xl:grid-cols-4"
|
|
20
|
-
}, p = {
|
|
21
|
-
1: "col-span-1",
|
|
22
|
-
2: "md:col-span-2",
|
|
23
|
-
3: "xl:col-span-3",
|
|
24
|
-
4: "xl:col-span-4",
|
|
25
|
-
full: "col-span-full"
|
|
26
|
-
};
|
|
27
|
-
function m(e) {
|
|
28
|
-
let { id: t, hidden: n, className: r, colSpan: i, props: a } = e;
|
|
29
|
-
return {
|
|
30
|
-
base: {
|
|
31
|
-
id: t,
|
|
32
|
-
hidden: n,
|
|
33
|
-
className: r,
|
|
34
|
-
colSpan: i
|
|
35
|
-
},
|
|
36
|
-
props: a
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function h(e) {
|
|
40
|
-
let { base: t, props: n } = m(e);
|
|
41
|
-
return {
|
|
42
|
-
...t,
|
|
43
|
-
type: "input",
|
|
44
|
-
props: n
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function g(e) {
|
|
48
|
-
let { base: t, props: n } = m(e);
|
|
49
|
-
return {
|
|
50
|
-
...t,
|
|
51
|
-
type: "textarea",
|
|
52
|
-
props: n
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function _(e) {
|
|
56
|
-
let { base: t, props: n } = m(e);
|
|
57
|
-
return {
|
|
58
|
-
...t,
|
|
59
|
-
type: "select",
|
|
60
|
-
props: n
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
function v(e) {
|
|
64
|
-
let { base: t, props: n } = m(e);
|
|
65
|
-
return {
|
|
66
|
-
...t,
|
|
67
|
-
type: "async-select",
|
|
68
|
-
props: n
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function y(e) {
|
|
72
|
-
let { base: t, props: n } = m(e);
|
|
73
|
-
return {
|
|
74
|
-
...t,
|
|
75
|
-
type: "switch",
|
|
76
|
-
props: n
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
function b(e) {
|
|
80
|
-
let { base: t, props: n } = m(e);
|
|
81
|
-
return {
|
|
82
|
-
...t,
|
|
83
|
-
type: "number",
|
|
84
|
-
props: n
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
function x(e) {
|
|
88
|
-
let { base: t, props: n } = m(e);
|
|
89
|
-
return {
|
|
90
|
-
...t,
|
|
91
|
-
type: "phone",
|
|
92
|
-
props: n
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
function S(e) {
|
|
96
|
-
let { base: t, props: n } = m(e);
|
|
97
|
-
return {
|
|
98
|
-
...t,
|
|
99
|
-
type: "date",
|
|
100
|
-
props: n
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
function C(e) {
|
|
104
|
-
let { base: t, props: n } = m(e);
|
|
105
|
-
return {
|
|
106
|
-
...t,
|
|
107
|
-
type: "date-range",
|
|
108
|
-
props: n
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function w(e) {
|
|
112
|
-
let { id: t, hidden: n, className: r, colSpan: i, render: a } = e;
|
|
113
|
-
return {
|
|
114
|
-
id: t,
|
|
115
|
-
hidden: n,
|
|
116
|
-
className: r,
|
|
117
|
-
colSpan: i,
|
|
118
|
-
type: "custom",
|
|
119
|
-
render: a
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
function T(e) {
|
|
123
|
-
return e;
|
|
124
|
-
}
|
|
125
|
-
function E(e, t) {
|
|
126
|
-
let c = r, l = i, u = o, d = a, f = n;
|
|
127
|
-
switch (e.type) {
|
|
128
|
-
case "custom": return e.render(t);
|
|
129
|
-
case "input": return s.createElement(c, {
|
|
130
|
-
control: t.control,
|
|
131
|
-
disabled: t.disabled,
|
|
132
|
-
readOnly: t.readOnly,
|
|
133
|
-
...e.props
|
|
134
|
-
});
|
|
135
|
-
case "textarea": return s.createElement(u, {
|
|
136
|
-
control: t.control,
|
|
137
|
-
disabled: t.disabled,
|
|
138
|
-
readOnly: t.readOnly,
|
|
139
|
-
...e.props
|
|
140
|
-
});
|
|
141
|
-
case "select": return s.createElement(l, {
|
|
142
|
-
control: t.control,
|
|
143
|
-
disabled: t.disabled,
|
|
144
|
-
...e.props
|
|
145
|
-
});
|
|
146
|
-
case "async-select": return s.createElement(l, {
|
|
147
|
-
control: t.control,
|
|
148
|
-
disabled: t.disabled,
|
|
149
|
-
kind: "async",
|
|
150
|
-
...e.props
|
|
151
|
-
});
|
|
152
|
-
case "switch": return s.createElement(d, {
|
|
153
|
-
control: t.control,
|
|
154
|
-
disabled: t.disabled,
|
|
155
|
-
...e.props
|
|
156
|
-
});
|
|
157
|
-
case "number": return s.createElement(c, {
|
|
158
|
-
control: t.control,
|
|
159
|
-
disabled: t.disabled,
|
|
160
|
-
readOnly: t.readOnly,
|
|
161
|
-
kind: "number",
|
|
162
|
-
...e.props
|
|
163
|
-
});
|
|
164
|
-
case "phone": return s.createElement(c, {
|
|
165
|
-
control: t.control,
|
|
166
|
-
disabled: t.disabled,
|
|
167
|
-
readOnly: t.readOnly,
|
|
168
|
-
kind: "phone",
|
|
169
|
-
...e.props
|
|
170
|
-
});
|
|
171
|
-
case "date": return s.createElement(c, {
|
|
172
|
-
control: t.control,
|
|
173
|
-
disabled: t.disabled,
|
|
174
|
-
readOnly: t.readOnly,
|
|
175
|
-
kind: "date",
|
|
176
|
-
...e.props
|
|
177
|
-
});
|
|
178
|
-
case "date-range": return s.createElement(f, {
|
|
179
|
-
control: t.control,
|
|
180
|
-
fromInputProps: {
|
|
181
|
-
disabled: t.disabled,
|
|
182
|
-
readOnly: t.readOnly
|
|
183
|
-
},
|
|
184
|
-
toInputProps: {
|
|
185
|
-
disabled: t.disabled,
|
|
186
|
-
readOnly: t.readOnly
|
|
187
|
-
},
|
|
188
|
-
...e.props
|
|
189
|
-
});
|
|
190
|
-
default: return null;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
function D({ fields: e, sections: t }) {
|
|
194
|
-
return t?.length ? t : [{
|
|
195
|
-
id: "default",
|
|
196
|
-
fields: e ?? []
|
|
197
|
-
}];
|
|
198
|
-
}
|
|
199
|
-
function O({ className: n, control: r, fields: i, sections: a, layout: o = "grid", density: m = "default", columns: h = 2, disabled: g, readOnly: _, footer: v, submitLabel: y, resetLabel: b, onResetClick: x, isSubmitting: S, sectionClassName: C, fieldClassName: w, footerClassName: T, ...O }) {
|
|
200
|
-
let k = D({
|
|
201
|
-
fields: i,
|
|
202
|
-
sections: a
|
|
203
|
-
}), A = s.useMemo(() => ({
|
|
204
|
-
control: r,
|
|
205
|
-
disabled: g,
|
|
206
|
-
readOnly: _
|
|
207
|
-
}), [
|
|
208
|
-
r,
|
|
209
|
-
g,
|
|
210
|
-
_
|
|
211
|
-
]);
|
|
212
|
-
return /* @__PURE__ */ u("form", {
|
|
213
|
-
"data-slot": "form-builder",
|
|
214
|
-
className: e("grid", d[m], n),
|
|
215
|
-
...O,
|
|
216
|
-
children: [k.filter((e) => !e.hidden).map((t) => /* @__PURE__ */ u("section", {
|
|
217
|
-
"data-slot": "form-builder-section",
|
|
218
|
-
className: e("grid gap-4", t.className, C),
|
|
219
|
-
children: [(t.title || t.description || t.actions) && /* @__PURE__ */ u("div", {
|
|
220
|
-
"data-slot": "form-builder-section-header",
|
|
221
|
-
className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
222
|
-
children: [/* @__PURE__ */ u("div", {
|
|
223
|
-
className: "min-w-0 space-y-1",
|
|
224
|
-
children: [t.title && /* @__PURE__ */ l("h2", {
|
|
225
|
-
className: "text-base font-semibold leading-none tracking-tight",
|
|
226
|
-
children: t.title
|
|
227
|
-
}), t.description && /* @__PURE__ */ l("p", {
|
|
228
|
-
className: "text-sm text-muted-foreground",
|
|
229
|
-
children: t.description
|
|
230
|
-
})]
|
|
231
|
-
}), t.actions && /* @__PURE__ */ l("div", {
|
|
232
|
-
className: "flex shrink-0 flex-wrap items-center gap-2",
|
|
233
|
-
children: t.actions
|
|
234
|
-
})]
|
|
235
|
-
}), /* @__PURE__ */ l("div", {
|
|
236
|
-
"data-slot": "form-builder-fields",
|
|
237
|
-
"data-layout": o,
|
|
238
|
-
className: e("grid", d[m], o === "grid" ? f[h] : "grid-cols-1"),
|
|
239
|
-
children: t.fields.filter((e) => !e.hidden).map((t) => /* @__PURE__ */ l("div", {
|
|
240
|
-
"data-slot": "form-builder-field",
|
|
241
|
-
className: e(t.colSpan && p[t.colSpan], t.className, w),
|
|
242
|
-
children: E(t, A)
|
|
243
|
-
}, t.id))
|
|
244
|
-
})]
|
|
245
|
-
}, t.id)), (v || y || b) && /* @__PURE__ */ l("div", {
|
|
246
|
-
"data-slot": "form-builder-footer",
|
|
247
|
-
className: e("flex flex-wrap items-center justify-end gap-2", T),
|
|
248
|
-
children: v ?? /* @__PURE__ */ u(c, { children: [b && /* @__PURE__ */ l(t, {
|
|
249
|
-
type: "button",
|
|
250
|
-
variant: "outline",
|
|
251
|
-
disabled: g || S,
|
|
252
|
-
onClick: x,
|
|
253
|
-
children: b
|
|
254
|
-
}), y && /* @__PURE__ */ l(t, {
|
|
255
|
-
type: "submit",
|
|
256
|
-
disabled: g || S,
|
|
257
|
-
children: y
|
|
258
|
-
})] })
|
|
259
|
-
})]
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
//#endregion
|
|
263
|
-
export { O as FormBuilder, v as asyncSelectField, w as customField, S as dateField, C as dateRangeField, T as formSection, h as inputField, b as numberField, x as phoneField, E as renderFormBuilderField, _ as selectField, y as switchField, g as textareaField };
|
|
@@ -1 +0,0 @@
|
|
|
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");function i({className:e,search:n,filters:i,viewOptions:a,actions:o,summary:s,sticky:c=!1,children:l,...u}){let d=!!(n||i||l),f=!!(s||a||o);return!d&&!f?null:(0,r.jsx)(`div`,{"data-slot":`page-toolbar`,"data-sticky":c||void 0,className:t.cn(`flex flex-col gap-3 rounded-xl border bg-card p-3 shadow-sm`,c&&`sticky top-0 z-10`,e),...u,children:(0,r.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between`,children:[d&&(0,r.jsxs)(`div`,{"data-slot":`page-toolbar-primary`,className:`flex min-w-0 flex-1 flex-col gap-2 sm:flex-row sm:items-center`,children:[n&&(0,r.jsx)(`div`,{className:`min-w-0 flex-1`,children:n}),i,l]}),f&&(0,r.jsxs)(`div`,{"data-slot":`page-toolbar-secondary`,className:`flex shrink-0 flex-wrap items-center gap-2`,children:[s&&(0,r.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:s}),a,o]})]})})}exports.PageToolbar=i;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/patterns/page-toolbar.tsx
|
|
5
|
-
function r({ className: r, search: i, filters: a, viewOptions: o, actions: s, summary: c, sticky: l = !1, children: u, ...d }) {
|
|
6
|
-
let f = !!(i || a || u), p = !!(c || o || s);
|
|
7
|
-
return !f && !p ? null : /* @__PURE__ */ t("div", {
|
|
8
|
-
"data-slot": "page-toolbar",
|
|
9
|
-
"data-sticky": l || void 0,
|
|
10
|
-
className: e("flex flex-col gap-3 rounded-xl border bg-card p-3 shadow-sm", l && "sticky top-0 z-10", r),
|
|
11
|
-
...d,
|
|
12
|
-
children: /* @__PURE__ */ n("div", {
|
|
13
|
-
className: "flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",
|
|
14
|
-
children: [f && /* @__PURE__ */ n("div", {
|
|
15
|
-
"data-slot": "page-toolbar-primary",
|
|
16
|
-
className: "flex min-w-0 flex-1 flex-col gap-2 sm:flex-row sm:items-center",
|
|
17
|
-
children: [
|
|
18
|
-
i && /* @__PURE__ */ t("div", {
|
|
19
|
-
className: "min-w-0 flex-1",
|
|
20
|
-
children: i
|
|
21
|
-
}),
|
|
22
|
-
a,
|
|
23
|
-
u
|
|
24
|
-
]
|
|
25
|
-
}), p && /* @__PURE__ */ n("div", {
|
|
26
|
-
"data-slot": "page-toolbar-secondary",
|
|
27
|
-
className: "flex shrink-0 flex-wrap items-center gap-2",
|
|
28
|
-
children: [
|
|
29
|
-
c && /* @__PURE__ */ t("div", {
|
|
30
|
-
className: "text-sm text-muted-foreground",
|
|
31
|
-
children: c
|
|
32
|
-
}),
|
|
33
|
-
o,
|
|
34
|
-
s
|
|
35
|
-
]
|
|
36
|
-
})]
|
|
37
|
-
})
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
export { r as PageToolbar };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("../display/description-list.cjs"),i=require("../layout/page-header.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s={compact:`gap-3`,default:`gap-4`,comfortable:`gap-6`};function c({className:e,title:a,description:c,eyebrow:l,actions:u,breadcrumbs:d,status:f,summary:p,meta:m,sections:h,children:g,aside:_,footer:v,backLabel:y=`Back`,onBack:b,headerProps:x,density:S=`default`,pageHeaderClassName:C,contentClassName:w,asideClassName:T,sectionClassName:E,...D}){let O=h?.filter(e=>!e.hidden)??[],k=!!(a||c||l||u||b),A=b||u?(0,o.jsxs)(o.Fragment,{children:[b&&(0,o.jsx)(n.Button,{type:`button`,variant:`outline`,onClick:b,children:y}),u]}):void 0,j=!!(g||O.length>0);return(0,o.jsxs)(`div`,{"data-slot":`resource-detail-page`,"data-density":S,className:t.cn(`grid min-w-0`,s[S],e),...D,children:[d&&(0,o.jsx)(`div`,{"data-slot":`resource-detail-page-breadcrumbs`,children:d}),k&&(0,o.jsx)(i.PageHeader,{"data-slot":`resource-detail-page-header`,eyebrow:l,title:a,description:c,actions:A,className:C,...x}),(f||p||m)&&(0,o.jsxs)(`div`,{"data-slot":`resource-detail-page-summary`,className:`grid gap-3 lg:grid-cols-[minmax(0,1fr)_auto]`,children:[(0,o.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[f&&(0,o.jsx)(`div`,{"data-slot":`resource-detail-page-status`,children:f}),p&&(0,o.jsx)(`div`,{"data-slot":`resource-detail-page-summary-content`,children:p})]}),m&&(0,o.jsx)(`div`,{"data-slot":`resource-detail-page-meta`,className:`min-w-0 lg:w-80`,children:m})]}),(j||_)&&(0,o.jsxs)(`div`,{"data-slot":`resource-detail-page-content`,className:t.cn(`grid min-w-0 gap-4`,_&&`xl:grid-cols-[minmax(0,1fr)_20rem]`,w),children:[(0,o.jsxs)(`div`,{"data-slot":`resource-detail-page-main`,className:`grid min-w-0 gap-4`,children:[g,O.map(e=>(0,o.jsxs)(`section`,{"data-slot":`resource-detail-page-section`,className:t.cn(`rounded-xl border bg-card text-card-foreground shadow-sm`,e.className,E),children:[(e.title||e.description||e.actions)&&(0,o.jsxs)(`div`,{className:`flex flex-col gap-3 border-b p-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,o.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[e.title&&(0,o.jsx)(`h2`,{className:`text-base font-semibold leading-none tracking-tight`,children:e.title}),e.description&&(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description})]}),e.actions&&(0,o.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:e.actions})]}),(0,o.jsx)(`div`,{className:t.cn(`p-4`,e.bodyClassName),children:e.children??(e.items?(0,o.jsx)(r.DescriptionList,{items:e.items}):null)})]},e.id))]}),_&&(0,o.jsx)(`aside`,{"data-slot":`resource-detail-page-aside`,className:t.cn(`min-w-0`,T),children:_})]}),v&&(0,o.jsx)(`div`,{"data-slot":`resource-detail-page-footer`,children:v})]})}exports.ResourceDetailPage=c;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import { Button as t } from "../ui/button/index.js";
|
|
3
|
-
import { DescriptionList as n } from "../display/description-list.js";
|
|
4
|
-
import { PageHeader as r } from "../layout/page-header.js";
|
|
5
|
-
import "react";
|
|
6
|
-
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
//#region src/components/patterns/resource-detail-page.tsx
|
|
8
|
-
var s = {
|
|
9
|
-
compact: "gap-3",
|
|
10
|
-
default: "gap-4",
|
|
11
|
-
comfortable: "gap-6"
|
|
12
|
-
};
|
|
13
|
-
function c({ className: c, title: l, description: u, eyebrow: d, actions: f, breadcrumbs: p, status: m, summary: h, meta: g, sections: _, children: v, aside: y, footer: b, backLabel: x = "Back", onBack: S, headerProps: C, density: w = "default", pageHeaderClassName: T, contentClassName: E, asideClassName: D, sectionClassName: O, ...k }) {
|
|
14
|
-
let A = _?.filter((e) => !e.hidden) ?? [], j = !!(l || u || d || f || S), M = S || f ? /* @__PURE__ */ o(i, { children: [S && /* @__PURE__ */ a(t, {
|
|
15
|
-
type: "button",
|
|
16
|
-
variant: "outline",
|
|
17
|
-
onClick: S,
|
|
18
|
-
children: x
|
|
19
|
-
}), f] }) : void 0, N = !!(v || A.length > 0);
|
|
20
|
-
return /* @__PURE__ */ o("div", {
|
|
21
|
-
"data-slot": "resource-detail-page",
|
|
22
|
-
"data-density": w,
|
|
23
|
-
className: e("grid min-w-0", s[w], c),
|
|
24
|
-
...k,
|
|
25
|
-
children: [
|
|
26
|
-
p && /* @__PURE__ */ a("div", {
|
|
27
|
-
"data-slot": "resource-detail-page-breadcrumbs",
|
|
28
|
-
children: p
|
|
29
|
-
}),
|
|
30
|
-
j && /* @__PURE__ */ a(r, {
|
|
31
|
-
"data-slot": "resource-detail-page-header",
|
|
32
|
-
eyebrow: d,
|
|
33
|
-
title: l,
|
|
34
|
-
description: u,
|
|
35
|
-
actions: M,
|
|
36
|
-
className: T,
|
|
37
|
-
...C
|
|
38
|
-
}),
|
|
39
|
-
(m || h || g) && /* @__PURE__ */ o("div", {
|
|
40
|
-
"data-slot": "resource-detail-page-summary",
|
|
41
|
-
className: "grid gap-3 lg:grid-cols-[minmax(0,1fr)_auto]",
|
|
42
|
-
children: [/* @__PURE__ */ o("div", {
|
|
43
|
-
className: "grid min-w-0 gap-3",
|
|
44
|
-
children: [m && /* @__PURE__ */ a("div", {
|
|
45
|
-
"data-slot": "resource-detail-page-status",
|
|
46
|
-
children: m
|
|
47
|
-
}), h && /* @__PURE__ */ a("div", {
|
|
48
|
-
"data-slot": "resource-detail-page-summary-content",
|
|
49
|
-
children: h
|
|
50
|
-
})]
|
|
51
|
-
}), g && /* @__PURE__ */ a("div", {
|
|
52
|
-
"data-slot": "resource-detail-page-meta",
|
|
53
|
-
className: "min-w-0 lg:w-80",
|
|
54
|
-
children: g
|
|
55
|
-
})]
|
|
56
|
-
}),
|
|
57
|
-
(N || y) && /* @__PURE__ */ o("div", {
|
|
58
|
-
"data-slot": "resource-detail-page-content",
|
|
59
|
-
className: e("grid min-w-0 gap-4", y && "xl:grid-cols-[minmax(0,1fr)_20rem]", E),
|
|
60
|
-
children: [/* @__PURE__ */ o("div", {
|
|
61
|
-
"data-slot": "resource-detail-page-main",
|
|
62
|
-
className: "grid min-w-0 gap-4",
|
|
63
|
-
children: [v, A.map((t) => /* @__PURE__ */ o("section", {
|
|
64
|
-
"data-slot": "resource-detail-page-section",
|
|
65
|
-
className: e("rounded-xl border bg-card text-card-foreground shadow-sm", t.className, O),
|
|
66
|
-
children: [(t.title || t.description || t.actions) && /* @__PURE__ */ o("div", {
|
|
67
|
-
className: "flex flex-col gap-3 border-b p-4 sm:flex-row sm:items-start sm:justify-between",
|
|
68
|
-
children: [/* @__PURE__ */ o("div", {
|
|
69
|
-
className: "min-w-0 space-y-1",
|
|
70
|
-
children: [t.title && /* @__PURE__ */ a("h2", {
|
|
71
|
-
className: "text-base font-semibold leading-none tracking-tight",
|
|
72
|
-
children: t.title
|
|
73
|
-
}), t.description && /* @__PURE__ */ a("p", {
|
|
74
|
-
className: "text-sm text-muted-foreground",
|
|
75
|
-
children: t.description
|
|
76
|
-
})]
|
|
77
|
-
}), t.actions && /* @__PURE__ */ a("div", {
|
|
78
|
-
className: "flex shrink-0 flex-wrap items-center gap-2",
|
|
79
|
-
children: t.actions
|
|
80
|
-
})]
|
|
81
|
-
}), /* @__PURE__ */ a("div", {
|
|
82
|
-
className: e("p-4", t.bodyClassName),
|
|
83
|
-
children: t.children ?? (t.items ? /* @__PURE__ */ a(n, { items: t.items }) : null)
|
|
84
|
-
})]
|
|
85
|
-
}, t.id))]
|
|
86
|
-
}), y && /* @__PURE__ */ a("aside", {
|
|
87
|
-
"data-slot": "resource-detail-page-aside",
|
|
88
|
-
className: e("min-w-0", D),
|
|
89
|
-
children: y
|
|
90
|
-
})]
|
|
91
|
-
}),
|
|
92
|
-
b && /* @__PURE__ */ a("div", {
|
|
93
|
-
"data-slot": "resource-detail-page-footer",
|
|
94
|
-
children: b
|
|
95
|
-
})
|
|
96
|
-
]
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
//#endregion
|
|
100
|
-
export { c as ResourceDetailPage };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../data-table/data-table.cjs"),r=require("../layout/section.cjs"),i=require("../layout/page-header.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("react/jsx-runtime");function s({className:e,title:t,description:n,actions:i,headerClassName:a,bodyClassName:s,children:c,...l}){return(0,o.jsx)(r.Section,{"data-slot":`resource-page-section`,variant:`panel`,title:t,description:n,actions:i,headerClassName:a,bodyClassName:s,className:e,...l,children:c})}var c={compact:`gap-3`,default:`gap-4`,comfortable:`gap-6`};function l({className:e,title:r,description:a,eyebrow:s,actions:l,breadcrumbs:u,stats:d,filters:f,tabs:p,table:m,children:h,aside:g,footer:_,headerProps:v,density:y=`default`,pageHeaderClassName:b,toolbarClassName:x,contentClassName:S,asideClassName:C,asideWidth:w=`20rem`,style:T,...E}){let D=!!(r||a||s||l),O=!!(f||p),k=!!(h||m);return(0,o.jsxs)(`div`,{"data-slot":`resource-page`,"data-density":y,className:t.cn(`grid min-w-0`,c[y],e),style:{"--resource-aside-width":w,...T},...E,children:[u&&(0,o.jsx)(`div`,{"data-slot":`resource-page-breadcrumbs`,children:u}),D&&(0,o.jsx)(i.PageHeader,{"data-slot":`resource-page-header`,eyebrow:s,title:r,description:a,actions:l,className:b,...v}),d&&(0,o.jsx)(`div`,{"data-slot":`resource-page-stats`,children:d}),O&&(0,o.jsxs)(`div`,{"data-slot":`resource-page-toolbar`,className:t.cn(`grid gap-3`,x),children:[p&&(0,o.jsx)(`div`,{"data-slot":`resource-page-tabs`,children:p}),f&&(0,o.jsx)(`div`,{"data-slot":`resource-page-filters`,children:f})]}),(k||g)&&(0,o.jsxs)(`div`,{"data-slot":`resource-page-content`,className:t.cn(`grid min-w-0 gap-4`,g&&`xl:grid-cols-[minmax(0,1fr)_var(--resource-aside-width)]`,S),children:[(0,o.jsxs)(`div`,{"data-slot":`resource-page-main`,className:`grid min-w-0 gap-4`,children:[h,m&&(0,o.jsx)(n.DataTable,{...m})]}),g&&(0,o.jsx)(`aside`,{"data-slot":`resource-page-aside`,className:t.cn(`min-w-0`,C),children:g})]}),_&&(0,o.jsx)(`div`,{"data-slot":`resource-page-footer`,children:_})]})}exports.ResourcePage=l,exports.ResourcePageSection=s;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import { DataTable as t } from "../data-table/data-table.js";
|
|
3
|
-
import { Section as n } from "../layout/section.js";
|
|
4
|
-
import { PageHeader as r } from "../layout/page-header.js";
|
|
5
|
-
import "react";
|
|
6
|
-
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
|
-
//#region src/components/patterns/resource-page.tsx
|
|
8
|
-
function o({ className: e, title: t, description: r, actions: a, headerClassName: o, bodyClassName: s, children: c, ...l }) {
|
|
9
|
-
return /* @__PURE__ */ i(n, {
|
|
10
|
-
"data-slot": "resource-page-section",
|
|
11
|
-
variant: "panel",
|
|
12
|
-
title: t,
|
|
13
|
-
description: r,
|
|
14
|
-
actions: a,
|
|
15
|
-
headerClassName: o,
|
|
16
|
-
bodyClassName: s,
|
|
17
|
-
className: e,
|
|
18
|
-
...l,
|
|
19
|
-
children: c
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
var s = {
|
|
23
|
-
compact: "gap-3",
|
|
24
|
-
default: "gap-4",
|
|
25
|
-
comfortable: "gap-6"
|
|
26
|
-
};
|
|
27
|
-
function c({ className: n, title: o, description: c, eyebrow: l, actions: u, breadcrumbs: d, stats: f, filters: p, tabs: m, table: h, children: g, aside: _, footer: v, headerProps: y, density: b = "default", pageHeaderClassName: x, toolbarClassName: S, contentClassName: C, asideClassName: w, asideWidth: T = "20rem", style: E, ...D }) {
|
|
28
|
-
let O = !!(o || c || l || u), k = !!(p || m), A = !!(g || h);
|
|
29
|
-
return /* @__PURE__ */ a("div", {
|
|
30
|
-
"data-slot": "resource-page",
|
|
31
|
-
"data-density": b,
|
|
32
|
-
className: e("grid min-w-0", s[b], n),
|
|
33
|
-
style: {
|
|
34
|
-
"--resource-aside-width": T,
|
|
35
|
-
...E
|
|
36
|
-
},
|
|
37
|
-
...D,
|
|
38
|
-
children: [
|
|
39
|
-
d && /* @__PURE__ */ i("div", {
|
|
40
|
-
"data-slot": "resource-page-breadcrumbs",
|
|
41
|
-
children: d
|
|
42
|
-
}),
|
|
43
|
-
O && /* @__PURE__ */ i(r, {
|
|
44
|
-
"data-slot": "resource-page-header",
|
|
45
|
-
eyebrow: l,
|
|
46
|
-
title: o,
|
|
47
|
-
description: c,
|
|
48
|
-
actions: u,
|
|
49
|
-
className: x,
|
|
50
|
-
...y
|
|
51
|
-
}),
|
|
52
|
-
f && /* @__PURE__ */ i("div", {
|
|
53
|
-
"data-slot": "resource-page-stats",
|
|
54
|
-
children: f
|
|
55
|
-
}),
|
|
56
|
-
k && /* @__PURE__ */ a("div", {
|
|
57
|
-
"data-slot": "resource-page-toolbar",
|
|
58
|
-
className: e("grid gap-3", S),
|
|
59
|
-
children: [m && /* @__PURE__ */ i("div", {
|
|
60
|
-
"data-slot": "resource-page-tabs",
|
|
61
|
-
children: m
|
|
62
|
-
}), p && /* @__PURE__ */ i("div", {
|
|
63
|
-
"data-slot": "resource-page-filters",
|
|
64
|
-
children: p
|
|
65
|
-
})]
|
|
66
|
-
}),
|
|
67
|
-
(A || _) && /* @__PURE__ */ a("div", {
|
|
68
|
-
"data-slot": "resource-page-content",
|
|
69
|
-
className: e("grid min-w-0 gap-4", _ && "xl:grid-cols-[minmax(0,1fr)_var(--resource-aside-width)]", C),
|
|
70
|
-
children: [/* @__PURE__ */ a("div", {
|
|
71
|
-
"data-slot": "resource-page-main",
|
|
72
|
-
className: "grid min-w-0 gap-4",
|
|
73
|
-
children: [g, h && /* @__PURE__ */ i(t, { ...h })]
|
|
74
|
-
}), _ && /* @__PURE__ */ i("aside", {
|
|
75
|
-
"data-slot": "resource-page-aside",
|
|
76
|
-
className: e("min-w-0", w),
|
|
77
|
-
children: _
|
|
78
|
-
})]
|
|
79
|
-
}),
|
|
80
|
-
v && /* @__PURE__ */ i("div", {
|
|
81
|
-
"data-slot": "resource-page-footer",
|
|
82
|
-
children: v
|
|
83
|
-
})
|
|
84
|
-
]
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
//#endregion
|
|
88
|
-
export { c as ResourcePage, o as ResourcePageSection };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/tabs/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");function a({className:e,title:r,description:a,actions:o,sections:s,defaultValue:c,value:l,onValueChange:u,navClassName:d,contentClassName:f,...p}){let m=s.find(e=>!e.disabled),h=c??m?.value,g=!!(r||a||o);return(0,i.jsxs)(`div`,{"data-slot":`settings-page`,className:t.cn(`grid min-w-0 gap-5`,e),...p,children:[g&&(0,i.jsxs)(`div`,{"data-slot":`settings-page-header`,className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,i.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[r&&(0,i.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:r}),a&&(0,i.jsx)(`p`,{className:`max-w-3xl text-sm leading-6 text-muted-foreground`,children:a})]}),o&&(0,i.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:o})]}),(0,i.jsx)(n.Tabs,{value:l,defaultValue:h,onValueChange:u,children:(0,i.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[16rem_minmax(0,1fr)]`,children:[(0,i.jsx)(n.TabsList,{className:t.cn(`h-auto w-full flex-col items-stretch justify-start gap-1 p-1`,d),children:s.map(e=>(0,i.jsx)(n.TabsTrigger,{value:e.value,disabled:e.disabled,className:`w-full justify-start`,children:(0,i.jsxs)(`span`,{className:`grid min-w-0 gap-0.5 text-left`,children:[(0,i.jsx)(`span`,{className:`truncate`,children:e.label}),e.description&&(0,i.jsx)(`span`,{className:`truncate text-xs font-normal text-muted-foreground`,children:e.description})]})},e.value))}),(0,i.jsx)(`div`,{"data-slot":`settings-page-content`,className:t.cn(`min-w-0`,f),children:s.map(e=>(0,i.jsx)(n.TabsContent,{value:e.value,children:e.content},e.value))})]})})]})}exports.SettingsPage=a;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import { Tabs as t, TabsContent as n, TabsList as r, TabsTrigger as i } from "../ui/tabs/index.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/patterns/settings-page.tsx
|
|
6
|
-
function s({ className: s, title: c, description: l, actions: u, sections: d, defaultValue: f, value: p, onValueChange: m, navClassName: h, contentClassName: g, ..._ }) {
|
|
7
|
-
let v = d.find((e) => !e.disabled), y = f ?? v?.value, b = !!(c || l || u);
|
|
8
|
-
return /* @__PURE__ */ o("div", {
|
|
9
|
-
"data-slot": "settings-page",
|
|
10
|
-
className: e("grid min-w-0 gap-5", s),
|
|
11
|
-
..._,
|
|
12
|
-
children: [b && /* @__PURE__ */ o("div", {
|
|
13
|
-
"data-slot": "settings-page-header",
|
|
14
|
-
className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
15
|
-
children: [/* @__PURE__ */ o("div", {
|
|
16
|
-
className: "grid min-w-0 gap-1",
|
|
17
|
-
children: [c && /* @__PURE__ */ a("h1", {
|
|
18
|
-
className: "text-2xl font-semibold tracking-tight",
|
|
19
|
-
children: c
|
|
20
|
-
}), l && /* @__PURE__ */ a("p", {
|
|
21
|
-
className: "max-w-3xl text-sm leading-6 text-muted-foreground",
|
|
22
|
-
children: l
|
|
23
|
-
})]
|
|
24
|
-
}), u && /* @__PURE__ */ a("div", {
|
|
25
|
-
className: "flex shrink-0 flex-wrap items-center gap-2",
|
|
26
|
-
children: u
|
|
27
|
-
})]
|
|
28
|
-
}), /* @__PURE__ */ a(t, {
|
|
29
|
-
value: p,
|
|
30
|
-
defaultValue: y,
|
|
31
|
-
onValueChange: m,
|
|
32
|
-
children: /* @__PURE__ */ o("div", {
|
|
33
|
-
className: "grid gap-4 lg:grid-cols-[16rem_minmax(0,1fr)]",
|
|
34
|
-
children: [/* @__PURE__ */ a(r, {
|
|
35
|
-
className: e("h-auto w-full flex-col items-stretch justify-start gap-1 p-1", h),
|
|
36
|
-
children: d.map((e) => /* @__PURE__ */ a(i, {
|
|
37
|
-
value: e.value,
|
|
38
|
-
disabled: e.disabled,
|
|
39
|
-
className: "w-full justify-start",
|
|
40
|
-
children: /* @__PURE__ */ o("span", {
|
|
41
|
-
className: "grid min-w-0 gap-0.5 text-left",
|
|
42
|
-
children: [/* @__PURE__ */ a("span", {
|
|
43
|
-
className: "truncate",
|
|
44
|
-
children: e.label
|
|
45
|
-
}), e.description && /* @__PURE__ */ a("span", {
|
|
46
|
-
className: "truncate text-xs font-normal text-muted-foreground",
|
|
47
|
-
children: e.description
|
|
48
|
-
})]
|
|
49
|
-
})
|
|
50
|
-
}, e.value))
|
|
51
|
-
}), /* @__PURE__ */ a("div", {
|
|
52
|
-
"data-slot": "settings-page-content",
|
|
53
|
-
className: e("min-w-0", g),
|
|
54
|
-
children: d.map((e) => /* @__PURE__ */ a(n, {
|
|
55
|
-
value: e.value,
|
|
56
|
-
children: e.content
|
|
57
|
-
}, e.value))
|
|
58
|
-
})]
|
|
59
|
-
})
|
|
60
|
-
})]
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
//#endregion
|
|
64
|
-
export { s as SettingsPage };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { XIcon } from "lucide-react"
|
|
3
|
-
|
|
4
|
-
import { Button } from "@/components/ui/button"
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
6
|
-
|
|
7
|
-
export type BulkActionBarProps = React.ComponentProps<"div"> & {
|
|
8
|
-
selectedCount: number
|
|
9
|
-
selectedLabel?: (count: number) => React.ReactNode
|
|
10
|
-
actions?: React.ReactNode
|
|
11
|
-
clearLabel?: React.ReactNode
|
|
12
|
-
onClear?: () => void
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function BulkActionBar({
|
|
16
|
-
className,
|
|
17
|
-
selectedCount,
|
|
18
|
-
selectedLabel = (count) => `${count} selected`,
|
|
19
|
-
actions,
|
|
20
|
-
clearLabel = "Clear",
|
|
21
|
-
onClear,
|
|
22
|
-
children,
|
|
23
|
-
...props
|
|
24
|
-
}: BulkActionBarProps) {
|
|
25
|
-
if (selectedCount <= 0) return null
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<div
|
|
29
|
-
data-slot="bulk-action-bar"
|
|
30
|
-
className={cn(
|
|
31
|
-
"flex flex-col gap-3 rounded-xl border bg-card p-3 shadow-sm sm:flex-row sm:items-center sm:justify-between",
|
|
32
|
-
className
|
|
33
|
-
)}
|
|
34
|
-
{...props}
|
|
35
|
-
>
|
|
36
|
-
<div data-slot="bulk-action-bar-count" className="text-sm font-medium">
|
|
37
|
-
{selectedLabel(selectedCount)}
|
|
38
|
-
</div>
|
|
39
|
-
<div data-slot="bulk-action-bar-actions" className="flex flex-wrap items-center gap-2">
|
|
40
|
-
{children}
|
|
41
|
-
{actions}
|
|
42
|
-
{onClear && (
|
|
43
|
-
<Button type="button" variant="ghost" size="sm" onClick={onClear}>
|
|
44
|
-
<XIcon data-icon="inline-start" />
|
|
45
|
-
{clearLabel}
|
|
46
|
-
</Button>
|
|
47
|
-
)}
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export { BulkActionBar }
|