tembro 2.0.2 → 2.0.4
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 +6 -0
- package/dist/components/calendar/calendar.cjs +1 -1
- package/dist/components/calendar/calendar.js +5 -5
- package/dist/components/display/index.cjs +1 -1
- package/dist/components/display/index.d.ts +0 -5
- package/dist/components/display/index.js +22 -27
- package/dist/components/form/demo.cjs +1 -1
- package/dist/components/form/demo.js +1 -2
- package/dist/components/form/index.cjs +1 -1
- package/dist/components/form/index.d.ts +0 -1
- package/dist/components/form/index.js +8 -9
- package/dist/components/form/public.cjs +1 -1
- package/dist/components/form/public.d.ts +0 -1
- package/dist/components/form/public.js +8 -9
- package/dist/components/inputs/clearable-input.cjs +1 -1
- package/dist/components/inputs/clearable-input.js +1 -1
- package/dist/components/inputs/index.cjs +1 -1
- package/dist/components/inputs/index.d.ts +0 -2
- package/dist/components/inputs/index.js +3 -5
- package/dist/components/inputs/input-chrome.cjs +1 -1
- package/dist/components/inputs/input-chrome.js +1 -1
- package/dist/components/inputs/public.cjs +1 -1
- package/dist/components/inputs/public.d.ts +0 -2
- package/dist/components/inputs/public.js +3 -5
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.d.ts +0 -1
- package/dist/components/layout/index.js +4 -5
- package/dist/components/layout/public.cjs +1 -1
- package/dist/components/layout/public.d.ts +0 -1
- package/dist/components/layout/public.js +2 -3
- package/dist/components/modern/index.cjs +1 -1
- package/dist/components/modern/index.d.ts +0 -4
- package/dist/components/modern/index.js +12 -16
- package/dist/components/ui/button/index.cjs +1 -1
- package/dist/components/ui/button/index.js +2 -2
- package/dist/components/ui/input/primitive.cjs +1 -1
- package/dist/components/ui/input/primitive.js +1 -1
- package/dist/components/ui/select/index.cjs +1 -1
- package/dist/components/ui/select/index.js +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +117 -130
- package/dist/public-component-surface.cjs +1 -1
- package/dist/public-component-surface.js +0 -65
- package/dist/showcase/fallback.cjs +3 -3
- package/dist/showcase/fallback.js +140 -314
- package/dist/showcase/package-meta.cjs +1 -1
- package/dist/showcase/package-meta.d.ts +2 -2
- package/dist/showcase/package-meta.js +1 -1
- package/dist/showcase/premium/index.cjs +1 -1
- package/dist/showcase/premium/index.js +431 -497
- package/dist/showcase/registry-quality.cjs +1 -1
- package/dist/showcase/registry-quality.js +0 -1
- package/dist/showcase/site-data.cjs +1 -1
- package/dist/showcase/site-data.js +1 -1
- package/dist/showcase/tembro-registry.json.cjs +1 -1
- package/dist/showcase/tembro-registry.json.js +3 -11
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +7 -7
- package/packages/cli/vendor/src/components/calendar/calendar.tsx +5 -5
- package/packages/cli/vendor/src/components/display/index.ts +0 -5
- package/packages/cli/vendor/src/components/form/demo.tsx +0 -1
- package/packages/cli/vendor/src/components/form/index.ts +0 -1
- package/packages/cli/vendor/src/components/form/public.ts +0 -2
- package/packages/cli/vendor/src/components/inputs/clearable-input.tsx +1 -1
- package/packages/cli/vendor/src/components/inputs/index.ts +0 -2
- package/packages/cli/vendor/src/components/inputs/input-chrome.tsx +1 -1
- package/packages/cli/vendor/src/components/inputs/public.ts +0 -2
- package/packages/cli/vendor/src/components/layout/index.ts +0 -1
- package/packages/cli/vendor/src/components/layout/public.ts +0 -1
- package/packages/cli/vendor/src/components/modern/index.ts +1 -5
- package/packages/cli/vendor/src/components/ui/button/index.tsx +2 -2
- package/packages/cli/vendor/src/components/ui/input/primitive.tsx +1 -1
- package/packages/cli/vendor/src/components/ui/select/index.tsx +3 -3
- package/packages/cli/vendor/src/public-component-surface.ts +0 -13
- package/packages/cli/vendor/src/showcase/fallback.tsx +3 -164
- package/packages/cli/vendor/src/showcase/package-meta.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/index.ts +0 -22
- package/packages/cli/vendor/src/showcase/registry-quality.ts +0 -2
- package/packages/cli/vendor/src/showcase/tembro-registry.json +224 -251
- package/packages/cli/vendor/templates/styles/globals.css +5 -5
- package/registry.json +296 -324
- package/dist/components/display/aspect-ratio.cjs +0 -1
- package/dist/components/display/aspect-ratio.d.ts +0 -6
- package/dist/components/display/aspect-ratio.js +0 -21
- package/dist/components/display/float-button.cjs +0 -1
- package/dist/components/display/float-button.d.ts +0 -6
- package/dist/components/display/float-button.js +0 -20
- package/dist/components/display/key-value-card.cjs +0 -1
- package/dist/components/display/key-value-card.d.ts +0 -16
- package/dist/components/display/key-value-card.js +0 -35
- package/dist/components/display/keyboard-shortcut.cjs +0 -1
- package/dist/components/display/keyboard-shortcut.d.ts +0 -7
- package/dist/components/display/keyboard-shortcut.js +0 -18
- package/dist/components/display/skeleton-form.cjs +0 -1
- package/dist/components/display/skeleton-form.d.ts +0 -9
- package/dist/components/display/skeleton-form.js +0 -31
- package/dist/components/display/skeleton-table.cjs +0 -1
- package/dist/components/display/skeleton-table.d.ts +0 -9
- package/dist/components/display/skeleton-table.js +0 -42
- package/dist/components/display/tag-list.cjs +0 -1
- package/dist/components/display/tag-list.d.ts +0 -17
- package/dist/components/display/tag-list.js +0 -30
- package/dist/components/display/watermark.cjs +0 -1
- package/dist/components/display/watermark.d.ts +0 -6
- package/dist/components/display/watermark.js +0 -23
- package/dist/components/form/repeater-field.cjs +0 -1
- package/dist/components/form/repeater-field.d.ts +0 -16
- package/dist/components/form/repeater-field.js +0 -48
- package/dist/components/inputs/cascader.cjs +0 -1
- package/dist/components/inputs/cascader.d.ts +0 -13
- package/dist/components/inputs/cascader.js +0 -58
- package/dist/components/inputs/mention-input.cjs +0 -1
- package/dist/components/inputs/mention-input.d.ts +0 -18
- package/dist/components/inputs/mention-input.js +0 -96
- package/dist/components/layout/stack.cjs +0 -1
- package/dist/components/layout/stack.d.ts +0 -23
- package/dist/components/layout/stack.js +0 -57
- package/dist/components/modern/affix.cjs +0 -1
- package/dist/components/modern/affix.d.ts +0 -7
- package/dist/components/modern/affix.js +0 -18
- package/dist/showcase/premium/affix/index.cjs +0 -1
- package/dist/showcase/premium/affix/index.d.ts +0 -2
- package/dist/showcase/premium/affix/index.js +0 -3
- package/dist/showcase/premium/affix/mock.cjs +0 -12
- package/dist/showcase/premium/affix/mock.d.ts +0 -2
- package/dist/showcase/premium/affix/mock.js +0 -15
- package/dist/showcase/premium/affix/showcase.cjs +0 -1
- package/dist/showcase/premium/affix/showcase.d.ts +0 -2
- package/dist/showcase/premium/affix/showcase.js +0 -64
- package/dist/showcase/premium/aspect-ratio/index.cjs +0 -1
- package/dist/showcase/premium/aspect-ratio/index.d.ts +0 -2
- package/dist/showcase/premium/aspect-ratio/index.js +0 -3
- package/dist/showcase/premium/aspect-ratio/mock.cjs +0 -11
- package/dist/showcase/premium/aspect-ratio/mock.d.ts +0 -2
- package/dist/showcase/premium/aspect-ratio/mock.js +0 -26
- package/dist/showcase/premium/aspect-ratio/showcase.cjs +0 -1
- package/dist/showcase/premium/aspect-ratio/showcase.d.ts +0 -2
- package/dist/showcase/premium/aspect-ratio/showcase.js +0 -53
- package/dist/showcase/premium/cascader/index.cjs +0 -1
- package/dist/showcase/premium/cascader/index.d.ts +0 -2
- package/dist/showcase/premium/cascader/index.js +0 -3
- package/dist/showcase/premium/cascader/mock.cjs +0 -9
- package/dist/showcase/premium/cascader/mock.d.ts +0 -2
- package/dist/showcase/premium/cascader/mock.js +0 -19
- package/dist/showcase/premium/cascader/showcase.cjs +0 -1
- package/dist/showcase/premium/cascader/showcase.d.ts +0 -2
- package/dist/showcase/premium/cascader/showcase.js +0 -43
- package/dist/showcase/premium/float-button/index.cjs +0 -1
- package/dist/showcase/premium/float-button/index.d.ts +0 -2
- package/dist/showcase/premium/float-button/index.js +0 -3
- package/dist/showcase/premium/float-button/mock.cjs +0 -10
- package/dist/showcase/premium/float-button/mock.d.ts +0 -2
- package/dist/showcase/premium/float-button/mock.js +0 -15
- package/dist/showcase/premium/float-button/showcase.cjs +0 -1
- package/dist/showcase/premium/float-button/showcase.d.ts +0 -2
- package/dist/showcase/premium/float-button/showcase.js +0 -28
- package/dist/showcase/premium/keyboard-shortcut/index.cjs +0 -1
- package/dist/showcase/premium/keyboard-shortcut/index.d.ts +0 -2
- package/dist/showcase/premium/keyboard-shortcut/index.js +0 -3
- package/dist/showcase/premium/keyboard-shortcut/mock.cjs +0 -5
- package/dist/showcase/premium/keyboard-shortcut/mock.d.ts +0 -2
- package/dist/showcase/premium/keyboard-shortcut/mock.js +0 -26
- package/dist/showcase/premium/keyboard-shortcut/showcase.cjs +0 -1
- package/dist/showcase/premium/keyboard-shortcut/showcase.d.ts +0 -1
- package/dist/showcase/premium/keyboard-shortcut/showcase.js +0 -64
- package/dist/showcase/premium/mention-input/index.cjs +0 -1
- package/dist/showcase/premium/mention-input/index.d.ts +0 -2
- package/dist/showcase/premium/mention-input/index.js +0 -3
- package/dist/showcase/premium/mention-input/mock.cjs +0 -11
- package/dist/showcase/premium/mention-input/mock.d.ts +0 -2
- package/dist/showcase/premium/mention-input/mock.js +0 -19
- package/dist/showcase/premium/mention-input/showcase.cjs +0 -1
- package/dist/showcase/premium/mention-input/showcase.d.ts +0 -2
- package/dist/showcase/premium/mention-input/showcase.js +0 -35
- package/dist/showcase/premium/skeleton-form/index.cjs +0 -1
- package/dist/showcase/premium/skeleton-form/index.d.ts +0 -2
- package/dist/showcase/premium/skeleton-form/index.js +0 -3
- package/dist/showcase/premium/skeleton-form/mock.cjs +0 -5
- package/dist/showcase/premium/skeleton-form/mock.d.ts +0 -2
- package/dist/showcase/premium/skeleton-form/mock.js +0 -19
- package/dist/showcase/premium/skeleton-form/showcase.cjs +0 -1
- package/dist/showcase/premium/skeleton-form/showcase.d.ts +0 -2
- package/dist/showcase/premium/skeleton-form/showcase.js +0 -52
- package/dist/showcase/premium/skeleton-table/index.cjs +0 -1
- package/dist/showcase/premium/skeleton-table/index.d.ts +0 -2
- package/dist/showcase/premium/skeleton-table/index.js +0 -3
- package/dist/showcase/premium/skeleton-table/mock.cjs +0 -5
- package/dist/showcase/premium/skeleton-table/mock.d.ts +0 -2
- package/dist/showcase/premium/skeleton-table/mock.js +0 -19
- package/dist/showcase/premium/skeleton-table/showcase.cjs +0 -1
- package/dist/showcase/premium/skeleton-table/showcase.d.ts +0 -2
- package/dist/showcase/premium/skeleton-table/showcase.js +0 -59
- package/dist/showcase/premium/stack/index.cjs +0 -1
- package/dist/showcase/premium/stack/index.d.ts +0 -2
- package/dist/showcase/premium/stack/index.js +0 -3
- package/dist/showcase/premium/stack/mock.cjs +0 -10
- package/dist/showcase/premium/stack/mock.d.ts +0 -2
- package/dist/showcase/premium/stack/mock.js +0 -26
- package/dist/showcase/premium/stack/showcase.cjs +0 -1
- package/dist/showcase/premium/stack/showcase.d.ts +0 -1
- package/dist/showcase/premium/stack/showcase.js +0 -47
- package/dist/showcase/premium/tag-list/index.cjs +0 -1
- package/dist/showcase/premium/tag-list/index.d.ts +0 -2
- package/dist/showcase/premium/tag-list/index.js +0 -3
- package/dist/showcase/premium/tag-list/mock.cjs +0 -12
- package/dist/showcase/premium/tag-list/mock.d.ts +0 -2
- package/dist/showcase/premium/tag-list/mock.js +0 -26
- package/dist/showcase/premium/tag-list/showcase.cjs +0 -1
- package/dist/showcase/premium/tag-list/showcase.d.ts +0 -2
- package/dist/showcase/premium/tag-list/showcase.js +0 -83
- package/dist/showcase/premium/watermark/index.cjs +0 -1
- package/dist/showcase/premium/watermark/index.d.ts +0 -2
- package/dist/showcase/premium/watermark/index.js +0 -3
- package/dist/showcase/premium/watermark/mock.cjs +0 -11
- package/dist/showcase/premium/watermark/mock.d.ts +0 -2
- package/dist/showcase/premium/watermark/mock.js +0 -26
- package/dist/showcase/premium/watermark/showcase.cjs +0 -1
- package/dist/showcase/premium/watermark/showcase.d.ts +0 -2
- package/dist/showcase/premium/watermark/showcase.js +0 -34
- package/packages/cli/vendor/src/components/display/aspect-ratio.tsx +0 -22
- package/packages/cli/vendor/src/components/display/float-button.tsx +0 -27
- package/packages/cli/vendor/src/components/display/key-value-card.tsx +0 -50
- package/packages/cli/vendor/src/components/display/keyboard-shortcut.tsx +0 -31
- package/packages/cli/vendor/src/components/display/skeleton-form.tsx +0 -51
- package/packages/cli/vendor/src/components/display/skeleton-table.tsx +0 -59
- package/packages/cli/vendor/src/components/display/tag-list.tsx +0 -52
- package/packages/cli/vendor/src/components/display/watermark.tsx +0 -20
- package/packages/cli/vendor/src/components/form/repeater-field.tsx +0 -93
- package/packages/cli/vendor/src/components/inputs/cascader.tsx +0 -41
- package/packages/cli/vendor/src/components/inputs/mention-input.tsx +0 -162
- package/packages/cli/vendor/src/components/layout/stack.tsx +0 -106
- package/packages/cli/vendor/src/components/modern/affix.tsx +0 -21
- package/packages/cli/vendor/src/showcase/premium/affix/index.ts +0 -3
- package/packages/cli/vendor/src/showcase/premium/affix/mock.ts +0 -26
- package/packages/cli/vendor/src/showcase/premium/affix/showcase.tsx +0 -37
- package/packages/cli/vendor/src/showcase/premium/aspect-ratio/index.ts +0 -2
- package/packages/cli/vendor/src/showcase/premium/aspect-ratio/mock.ts +0 -26
- package/packages/cli/vendor/src/showcase/premium/aspect-ratio/showcase.tsx +0 -37
- package/packages/cli/vendor/src/showcase/premium/cascader/index.ts +0 -3
- package/packages/cli/vendor/src/showcase/premium/cascader/mock.ts +0 -24
- package/packages/cli/vendor/src/showcase/premium/cascader/showcase.tsx +0 -20
- package/packages/cli/vendor/src/showcase/premium/float-button/index.ts +0 -3
- package/packages/cli/vendor/src/showcase/premium/float-button/mock.ts +0 -24
- package/packages/cli/vendor/src/showcase/premium/float-button/showcase.tsx +0 -21
- package/packages/cli/vendor/src/showcase/premium/keyboard-shortcut/index.ts +0 -2
- package/packages/cli/vendor/src/showcase/premium/keyboard-shortcut/mock.ts +0 -20
- package/packages/cli/vendor/src/showcase/premium/keyboard-shortcut/showcase.tsx +0 -42
- package/packages/cli/vendor/src/showcase/premium/mention-input/index.ts +0 -3
- package/packages/cli/vendor/src/showcase/premium/mention-input/mock.ts +0 -26
- package/packages/cli/vendor/src/showcase/premium/mention-input/showcase.tsx +0 -27
- package/packages/cli/vendor/src/showcase/premium/skeleton-form/index.ts +0 -3
- package/packages/cli/vendor/src/showcase/premium/skeleton-form/mock.ts +0 -20
- package/packages/cli/vendor/src/showcase/premium/skeleton-form/showcase.tsx +0 -34
- package/packages/cli/vendor/src/showcase/premium/skeleton-table/index.ts +0 -3
- package/packages/cli/vendor/src/showcase/premium/skeleton-table/mock.ts +0 -20
- package/packages/cli/vendor/src/showcase/premium/skeleton-table/showcase.tsx +0 -37
- package/packages/cli/vendor/src/showcase/premium/stack/index.ts +0 -2
- package/packages/cli/vendor/src/showcase/premium/stack/mock.ts +0 -25
- package/packages/cli/vendor/src/showcase/premium/stack/showcase.tsx +0 -22
- package/packages/cli/vendor/src/showcase/premium/tag-list/index.ts +0 -2
- package/packages/cli/vendor/src/showcase/premium/tag-list/mock.ts +0 -27
- package/packages/cli/vendor/src/showcase/premium/tag-list/showcase.tsx +0 -55
- package/packages/cli/vendor/src/showcase/premium/watermark/index.ts +0 -2
- package/packages/cli/vendor/src/showcase/premium/watermark/mock.ts +0 -26
- package/packages/cli/vendor/src/showcase/premium/watermark/showcase.tsx +0 -26
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { TagList as e } from "../../../components/display/tag-list.js";
|
|
2
|
-
import * as t from "react";
|
|
3
|
-
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
//#region src/showcase/premium/tag-list/showcase.tsx
|
|
5
|
-
var i = "border-t border-[color:var(--aui-divider)] py-6", a = [
|
|
6
|
-
{
|
|
7
|
-
key: "react",
|
|
8
|
-
label: "React"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
key: "typescript",
|
|
12
|
-
label: "TypeScript"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
key: "dashboard",
|
|
16
|
-
label: "Dashboard"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
key: "design-system",
|
|
20
|
-
label: "Design system"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
key: "release",
|
|
24
|
-
label: "Release"
|
|
25
|
-
}
|
|
26
|
-
];
|
|
27
|
-
function o() {
|
|
28
|
-
let [o, s] = t.useState(a);
|
|
29
|
-
return /* @__PURE__ */ r("div", {
|
|
30
|
-
className: "space-y-0",
|
|
31
|
-
children: [/* @__PURE__ */ r("section", {
|
|
32
|
-
className: "pb-6",
|
|
33
|
-
children: [
|
|
34
|
-
/* @__PURE__ */ n("p", {
|
|
35
|
-
className: "text-xs font-semibold uppercase tracking-[0.24em] aui-text-muted",
|
|
36
|
-
children: "Installed display primitive"
|
|
37
|
-
}),
|
|
38
|
-
/* @__PURE__ */ n("h3", {
|
|
39
|
-
className: "mt-3 text-2xl font-semibold tracking-tight aui-text-strong",
|
|
40
|
-
children: "TagList shows existing labels, not text entry"
|
|
41
|
-
}),
|
|
42
|
-
/* @__PURE__ */ n("p", {
|
|
43
|
-
className: "mt-3 max-w-2xl text-sm leading-6 aui-text-muted",
|
|
44
|
-
children: "Use TagList to display or lightly edit known labels. If the user must type new values, move to TagInput instead."
|
|
45
|
-
})
|
|
46
|
-
]
|
|
47
|
-
}), /* @__PURE__ */ n("section", {
|
|
48
|
-
className: i,
|
|
49
|
-
children: /* @__PURE__ */ r("div", {
|
|
50
|
-
className: "grid gap-6 xl:grid-cols-[1fr_360px]",
|
|
51
|
-
children: [/* @__PURE__ */ r("div", { children: [
|
|
52
|
-
/* @__PURE__ */ n("p", {
|
|
53
|
-
className: "text-lg font-semibold aui-text-strong",
|
|
54
|
-
children: "Editable metadata chips"
|
|
55
|
-
}),
|
|
56
|
-
/* @__PURE__ */ n("p", {
|
|
57
|
-
className: "mt-2 max-w-xl text-sm leading-6 aui-text-muted",
|
|
58
|
-
children: "Remove actions should stay small and secondary so the tags remain readable as content first."
|
|
59
|
-
}),
|
|
60
|
-
/* @__PURE__ */ n("div", {
|
|
61
|
-
className: "mt-5 rounded-xl border border-[color:var(--aui-divider)] bg-[color:var(--aui-page-bg-alt)] p-4",
|
|
62
|
-
children: /* @__PURE__ */ n(e, {
|
|
63
|
-
items: o,
|
|
64
|
-
removable: !0,
|
|
65
|
-
onRemove: (e) => s((t) => t.filter((t) => t.key !== e.key))
|
|
66
|
-
})
|
|
67
|
-
})
|
|
68
|
-
] }), /* @__PURE__ */ r("div", {
|
|
69
|
-
className: "rounded-xl border border-[color:var(--aui-divider)] p-4",
|
|
70
|
-
children: [/* @__PURE__ */ n("p", {
|
|
71
|
-
className: "text-sm font-semibold aui-text-strong",
|
|
72
|
-
children: "Guidance"
|
|
73
|
-
}), /* @__PURE__ */ r("div", {
|
|
74
|
-
className: "mt-3 space-y-3 text-sm leading-6 aui-text-muted",
|
|
75
|
-
children: [/* @__PURE__ */ n("p", { children: "TagList is display-first. It should not impersonate a full input when creation is not available." }), /* @__PURE__ */ n("p", { children: "Use `max` when pages need a condensed summary and overflow should collapse into a count chip." })]
|
|
76
|
-
})]
|
|
77
|
-
})]
|
|
78
|
-
})
|
|
79
|
-
})]
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
//#endregion
|
|
83
|
-
export { o as TagListShowcase };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./mock.cjs"),t=require("./showcase.cjs");exports.WatermarkShowcase=t.WatermarkShowcase,exports.watermarkMock=e.watermarkMock;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e={code:`import { Watermark } from "@/index"
|
|
2
|
-
|
|
3
|
-
export function Example() {
|
|
4
|
-
return (
|
|
5
|
-
<Watermark text="PRIVATE BETA">
|
|
6
|
-
<div className="grid h-28 place-items-center rounded-xl border bg-card">
|
|
7
|
-
Document surface
|
|
8
|
-
</div>
|
|
9
|
-
</Watermark>
|
|
10
|
-
)
|
|
11
|
-
}`,cliCommand:`npx tembro add watermark`,highlights:[`Optional watermark for document and export previews`,`Works on any container content`,`Configurable watermark text and overlay style`],scenarios:[{title:`Confidential docs`,description:`Show usage watermark without blocking interaction.`},{title:`Design previews`,description:`Brand mark on generated screenshots.`},{title:`Shared exports`,description:`Visual indicator for internal staging artifacts.`}]};exports.watermarkMock=e;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
//#region src/showcase/premium/watermark/mock.ts
|
|
2
|
-
var e = {
|
|
3
|
-
code: "import { Watermark } from \"@/index\"\n\nexport function Example() {\n return (\n <Watermark text=\"PRIVATE BETA\">\n <div className=\"grid h-28 place-items-center rounded-xl border bg-card\">\n Document surface\n </div>\n </Watermark>\n )\n}",
|
|
4
|
-
cliCommand: "npx tembro add watermark",
|
|
5
|
-
highlights: [
|
|
6
|
-
"Optional watermark for document and export previews",
|
|
7
|
-
"Works on any container content",
|
|
8
|
-
"Configurable watermark text and overlay style"
|
|
9
|
-
],
|
|
10
|
-
scenarios: [
|
|
11
|
-
{
|
|
12
|
-
title: "Confidential docs",
|
|
13
|
-
description: "Show usage watermark without blocking interaction."
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
title: "Design previews",
|
|
17
|
-
description: "Brand mark on generated screenshots."
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
title: "Shared exports",
|
|
21
|
-
description: "Visual indicator for internal staging artifacts."
|
|
22
|
-
}
|
|
23
|
-
]
|
|
24
|
-
};
|
|
25
|
-
//#endregion
|
|
26
|
-
export { e as watermarkMock };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../components/ui/button/index.cjs"),n=require("../../../components/display/watermark.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=[`tembro`,`STAGING`,`DRAFT`,`PRIVATE BETA`];function o(){let[e,o]=r.useState(a[0]);return(0,i.jsxs)(`div`,{className:`space-y-4`,children:[(0,i.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:a.map(n=>(0,i.jsx)(t.Button,{size:`sm`,variant:e===n?`default`:`outline`,onClick:()=>o(n),children:n},n))}),(0,i.jsx)(n.Watermark,{text:e,children:(0,i.jsx)(`div`,{className:`grid h-36 place-items-center rounded-xl border bg-card p-5 text-sm text-muted-foreground`,children:`This content keeps full interaction while visually marking environment.`})})]})}exports.WatermarkShowcase=o;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Button as e } from "../../../components/ui/button/index.js";
|
|
2
|
-
import { Watermark as t } from "../../../components/display/watermark.js";
|
|
3
|
-
import * as n from "react";
|
|
4
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
-
//#region src/showcase/premium/watermark/showcase.tsx
|
|
6
|
-
var a = [
|
|
7
|
-
"tembro",
|
|
8
|
-
"STAGING",
|
|
9
|
-
"DRAFT",
|
|
10
|
-
"PRIVATE BETA"
|
|
11
|
-
];
|
|
12
|
-
function o() {
|
|
13
|
-
let [o, s] = n.useState(a[0]);
|
|
14
|
-
return /* @__PURE__ */ i("div", {
|
|
15
|
-
className: "space-y-4",
|
|
16
|
-
children: [/* @__PURE__ */ r("div", {
|
|
17
|
-
className: "flex flex-wrap gap-2",
|
|
18
|
-
children: a.map((t) => /* @__PURE__ */ r(e, {
|
|
19
|
-
size: "sm",
|
|
20
|
-
variant: o === t ? "default" : "outline",
|
|
21
|
-
onClick: () => s(t),
|
|
22
|
-
children: t
|
|
23
|
-
}, t))
|
|
24
|
-
}), /* @__PURE__ */ r(t, {
|
|
25
|
-
text: o,
|
|
26
|
-
children: /* @__PURE__ */ r("div", {
|
|
27
|
-
className: "grid h-36 place-items-center rounded-xl border bg-card p-5 text-sm text-muted-foreground",
|
|
28
|
-
children: "This content keeps full interaction while visually marking environment."
|
|
29
|
-
})
|
|
30
|
-
})]
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
export { o as WatermarkShowcase };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils"
|
|
4
|
-
|
|
5
|
-
export type AspectRatioProps = React.ComponentProps<"div"> & {
|
|
6
|
-
ratio?: number
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function AspectRatio({ ratio = 16 / 9, className, style, children, ...props }: AspectRatioProps) {
|
|
10
|
-
return (
|
|
11
|
-
<div
|
|
12
|
-
data-slot="aspect-ratio"
|
|
13
|
-
className={cn("relative w-full overflow-hidden", className)}
|
|
14
|
-
style={{ aspectRatio: String(ratio), ...style }}
|
|
15
|
-
{...props}
|
|
16
|
-
>
|
|
17
|
-
<div className="absolute inset-0">{children}</div>
|
|
18
|
-
</div>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { AspectRatio }
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils"
|
|
4
|
-
|
|
5
|
-
export type FloatButtonProps = React.ComponentProps<"button"> & {
|
|
6
|
-
placement?: "bottom-right" | "bottom-left" | "top-right" | "top-left"
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const placementClassName = {
|
|
10
|
-
"bottom-right": "bottom-6 right-6",
|
|
11
|
-
"bottom-left": "bottom-6 left-6",
|
|
12
|
-
"top-right": "right-6 top-6",
|
|
13
|
-
"top-left": "left-6 top-6",
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function FloatButton({ placement = "bottom-right", className, ...props }: FloatButtonProps) {
|
|
17
|
-
return (
|
|
18
|
-
<button
|
|
19
|
-
type="button"
|
|
20
|
-
data-slot="float-button"
|
|
21
|
-
className={cn("fixed z-50 inline-flex size-12 items-center justify-center rounded-full border bg-primary text-primary-foreground shadow-lg transition hover:opacity-90", placementClassName[placement], className)}
|
|
22
|
-
{...props}
|
|
23
|
-
/>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export { FloatButton }
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle, type CardProps } from "@/components/ui/card"
|
|
4
|
-
import { cn } from "@/lib/utils"
|
|
5
|
-
|
|
6
|
-
export type KeyValueCardItem = {
|
|
7
|
-
key: string
|
|
8
|
-
label: React.ReactNode
|
|
9
|
-
value: React.ReactNode
|
|
10
|
-
description?: React.ReactNode
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type KeyValueCardProps = Omit<CardProps, "children"> & {
|
|
14
|
-
title?: React.ReactNode
|
|
15
|
-
description?: React.ReactNode
|
|
16
|
-
items: KeyValueCardItem[]
|
|
17
|
-
columns?: 1 | 2
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function KeyValueCard({ title, description, items, columns = 1, className, ...props }: KeyValueCardProps) {
|
|
21
|
-
return (
|
|
22
|
-
<Card data-slot="key-value-card" className={className} {...props}>
|
|
23
|
-
{(title || description) && (
|
|
24
|
-
<CardHeader>
|
|
25
|
-
{title && <CardTitle>{title}</CardTitle>}
|
|
26
|
-
{description && <CardDescription>{description}</CardDescription>}
|
|
27
|
-
</CardHeader>
|
|
28
|
-
)}
|
|
29
|
-
<CardContent>
|
|
30
|
-
<dl
|
|
31
|
-
className={cn(
|
|
32
|
-
"grid gap-3",
|
|
33
|
-
columns === 1 && "grid-cols-1",
|
|
34
|
-
columns === 2 && "grid-cols-1 sm:grid-cols-2"
|
|
35
|
-
)}
|
|
36
|
-
>
|
|
37
|
-
{items.map((item) => (
|
|
38
|
-
<div key={item.key} data-slot="key-value-card-item" className="min-w-0 rounded-lg border bg-muted/25 p-3">
|
|
39
|
-
<dt className="text-xs font-medium uppercase tracking-wide text-muted-foreground">{item.label}</dt>
|
|
40
|
-
<dd className="mt-1 break-words text-sm font-semibold text-foreground">{item.value}</dd>
|
|
41
|
-
{item.description && <dd className="mt-1 text-xs leading-5 text-muted-foreground">{item.description}</dd>}
|
|
42
|
-
</div>
|
|
43
|
-
))}
|
|
44
|
-
</dl>
|
|
45
|
-
</CardContent>
|
|
46
|
-
</Card>
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { KeyValueCard }
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils"
|
|
4
|
-
|
|
5
|
-
export type KeyboardShortcutProps = React.ComponentProps<"kbd"> & {
|
|
6
|
-
keys?: React.ReactNode[]
|
|
7
|
-
separator?: React.ReactNode
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function KeyboardShortcut({ keys, separator = "+", className, children, ...props }: KeyboardShortcutProps) {
|
|
11
|
-
const content = keys?.length
|
|
12
|
-
? keys.map((key, index) => (
|
|
13
|
-
<React.Fragment key={index}>
|
|
14
|
-
{index > 0 && <span className="text-muted-foreground">{separator}</span>}
|
|
15
|
-
<span>{key}</span>
|
|
16
|
-
</React.Fragment>
|
|
17
|
-
))
|
|
18
|
-
: children
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<kbd
|
|
22
|
-
data-slot="keyboard-shortcut"
|
|
23
|
-
className={cn("inline-flex items-center gap-1 rounded border bg-muted px-1.5 py-0.5 font-mono text-[11px] font-medium text-muted-foreground", className)}
|
|
24
|
-
{...props}
|
|
25
|
-
>
|
|
26
|
-
{content}
|
|
27
|
-
</kbd>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { KeyboardShortcut }
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Skeleton } from "@/components/ui/skeleton"
|
|
3
|
-
import { cn } from "@/lib/utils"
|
|
4
|
-
|
|
5
|
-
export type SkeletonFormProps = React.ComponentProps<"div"> & {
|
|
6
|
-
fields?: number
|
|
7
|
-
showTitle?: boolean
|
|
8
|
-
showActions?: boolean
|
|
9
|
-
columns?: 1 | 2
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function SkeletonForm({
|
|
13
|
-
fields = 4,
|
|
14
|
-
showTitle = true,
|
|
15
|
-
showActions = true,
|
|
16
|
-
columns = 1,
|
|
17
|
-
className,
|
|
18
|
-
...props
|
|
19
|
-
}: SkeletonFormProps) {
|
|
20
|
-
return (
|
|
21
|
-
<div data-slot="skeleton-form" className={cn("w-full space-y-6", className)} {...props}>
|
|
22
|
-
{showTitle && (
|
|
23
|
-
<div className="space-y-2 border-b pb-4">
|
|
24
|
-
<Skeleton className="h-6 w-1/3" />
|
|
25
|
-
<Skeleton className="h-4 w-1/2" />
|
|
26
|
-
</div>
|
|
27
|
-
)}
|
|
28
|
-
|
|
29
|
-
<div className={cn(
|
|
30
|
-
"grid gap-6",
|
|
31
|
-
columns === 2 && "sm:grid-cols-2"
|
|
32
|
-
)}>
|
|
33
|
-
{Array.from({ length: fields }).map((_, i) => (
|
|
34
|
-
<div key={i} className="space-y-2">
|
|
35
|
-
<Skeleton className="h-4 w-20" />
|
|
36
|
-
<Skeleton className="h-10 w-full" />
|
|
37
|
-
</div>
|
|
38
|
-
))}
|
|
39
|
-
</div>
|
|
40
|
-
|
|
41
|
-
{showActions && (
|
|
42
|
-
<div className="flex justify-end gap-2 pt-4">
|
|
43
|
-
<Skeleton className="h-10 w-24" />
|
|
44
|
-
<Skeleton className="h-10 w-24" />
|
|
45
|
-
</div>
|
|
46
|
-
)}
|
|
47
|
-
</div>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export { SkeletonForm }
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Skeleton } from "@/components/ui/skeleton"
|
|
3
|
-
import { cn } from "@/lib/utils"
|
|
4
|
-
|
|
5
|
-
export type SkeletonTableProps = React.ComponentProps<"div"> & {
|
|
6
|
-
rows?: number
|
|
7
|
-
columns?: number
|
|
8
|
-
showHeader?: boolean
|
|
9
|
-
showToolbar?: boolean
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function SkeletonTable({
|
|
13
|
-
rows = 5,
|
|
14
|
-
columns = 4,
|
|
15
|
-
showHeader = true,
|
|
16
|
-
showToolbar = false,
|
|
17
|
-
className,
|
|
18
|
-
...props
|
|
19
|
-
}: SkeletonTableProps) {
|
|
20
|
-
return (
|
|
21
|
-
<div data-slot="skeleton-table" className={cn("w-full space-y-4", className)} {...props}>
|
|
22
|
-
{showToolbar && (
|
|
23
|
-
<div className="flex items-center justify-between">
|
|
24
|
-
<Skeleton className="h-8 w-[250px]" />
|
|
25
|
-
<div className="flex items-center gap-2">
|
|
26
|
-
<Skeleton className="h-8 w-[100px]" />
|
|
27
|
-
<Skeleton className="h-8 w-[80px]" />
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
)}
|
|
31
|
-
<div className="rounded-md border">
|
|
32
|
-
{showHeader && (
|
|
33
|
-
<div className="border-b bg-muted/50">
|
|
34
|
-
<div className="flex px-4 py-3">
|
|
35
|
-
{Array.from({ length: columns }).map((_, i) => (
|
|
36
|
-
<div key={i} className="flex-1 pr-4">
|
|
37
|
-
<Skeleton className="h-4 w-24" />
|
|
38
|
-
</div>
|
|
39
|
-
))}
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
)}
|
|
43
|
-
<div className="divide-y">
|
|
44
|
-
{Array.from({ length: rows }).map((_, rowIndex) => (
|
|
45
|
-
<div key={rowIndex} className="flex px-4 py-3">
|
|
46
|
-
{Array.from({ length: columns }).map((_, colIndex) => (
|
|
47
|
-
<div key={colIndex} className="flex-1 pr-4">
|
|
48
|
-
<Skeleton className={cn("h-4", colIndex === 0 ? "w-full max-w-[200px]" : "w-1/2")} />
|
|
49
|
-
</div>
|
|
50
|
-
))}
|
|
51
|
-
</div>
|
|
52
|
-
))}
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export { SkeletonTable }
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { XIcon } from "lucide-react"
|
|
3
|
-
|
|
4
|
-
import { Badge } from "@/components/ui/badge"
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
6
|
-
|
|
7
|
-
export type TagListItem = {
|
|
8
|
-
key: string
|
|
9
|
-
label: React.ReactNode
|
|
10
|
-
variant?: React.ComponentProps<typeof Badge>["variant"]
|
|
11
|
-
disabled?: boolean
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type TagListProps = React.ComponentProps<"div"> & {
|
|
15
|
-
items: TagListItem[]
|
|
16
|
-
max?: number
|
|
17
|
-
removable?: boolean
|
|
18
|
-
onRemove?: (item: TagListItem) => void
|
|
19
|
-
overflowLabel?: (count: number) => React.ReactNode
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function TagList({ items, max, removable = false, onRemove, overflowLabel = (count) => `+${count}`, className, ...props }: TagListProps) {
|
|
23
|
-
const visibleItems = typeof max === "number" ? items.slice(0, max) : items
|
|
24
|
-
const overflowCount = typeof max === "number" ? Math.max(items.length - max, 0) : 0
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<div data-slot="tag-list" className={cn("flex flex-wrap items-center gap-1.5", className)} {...props}>
|
|
28
|
-
{visibleItems.map((item) => (
|
|
29
|
-
<Badge
|
|
30
|
-
key={item.key}
|
|
31
|
-
variant={item.variant}
|
|
32
|
-
className={cn("gap-1", item.disabled && "opacity-55")}
|
|
33
|
-
>
|
|
34
|
-
<span>{item.label}</span>
|
|
35
|
-
{removable && !item.disabled && (
|
|
36
|
-
<button
|
|
37
|
-
type="button"
|
|
38
|
-
aria-label="Remove tag"
|
|
39
|
-
className="rounded-sm text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
40
|
-
onClick={() => onRemove?.(item)}
|
|
41
|
-
>
|
|
42
|
-
<XIcon className="size-3" />
|
|
43
|
-
</button>
|
|
44
|
-
)}
|
|
45
|
-
</Badge>
|
|
46
|
-
))}
|
|
47
|
-
{overflowCount > 0 && <Badge variant="outline">{overflowLabel(overflowCount)}</Badge>}
|
|
48
|
-
</div>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export { TagList }
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils"
|
|
4
|
-
|
|
5
|
-
export type WatermarkProps = React.ComponentProps<"div"> & {
|
|
6
|
-
text?: string
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function Watermark({ text = "Azamat UI", className, children, ...props }: WatermarkProps) {
|
|
10
|
-
return (
|
|
11
|
-
<div data-slot="watermark" className={cn("relative overflow-hidden", className)} {...props}>
|
|
12
|
-
<div className="pointer-events-none absolute inset-0 z-0 grid place-items-center opacity-10">
|
|
13
|
-
<span className="rotate-[-24deg] select-none text-4xl font-bold tracking-widest text-muted-foreground">{text}</span>
|
|
14
|
-
</div>
|
|
15
|
-
<div className="relative z-10">{children}</div>
|
|
16
|
-
</div>
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { Watermark }
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { PlusIcon, Trash2Icon } from "lucide-react"
|
|
3
|
-
|
|
4
|
-
import { Button } from "@/components/ui/button"
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
6
|
-
|
|
7
|
-
export type RepeaterFieldProps<T> = Omit<React.ComponentProps<"div">, "value" | "onChange"> & {
|
|
8
|
-
value: T[]
|
|
9
|
-
onValueChange: (value: T[]) => void
|
|
10
|
-
renderItem: (item: T, index: number, helpers: { remove: () => void; update: (item: T) => void }) => React.ReactNode
|
|
11
|
-
createItem: () => T
|
|
12
|
-
addLabel?: React.ReactNode
|
|
13
|
-
max?: number
|
|
14
|
-
min?: number
|
|
15
|
-
disabled?: boolean
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function RepeaterField<T>({
|
|
19
|
-
value,
|
|
20
|
-
onValueChange,
|
|
21
|
-
renderItem,
|
|
22
|
-
createItem,
|
|
23
|
-
addLabel = "Add item",
|
|
24
|
-
max = Infinity,
|
|
25
|
-
min = 0,
|
|
26
|
-
disabled = false,
|
|
27
|
-
className,
|
|
28
|
-
...props
|
|
29
|
-
}: RepeaterFieldProps<T>) {
|
|
30
|
-
const handleAdd = () => {
|
|
31
|
-
if (value.length < max) {
|
|
32
|
-
onValueChange([...value, createItem()])
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const handleRemove = (indexToRemove: number) => {
|
|
37
|
-
if (value.length > min) {
|
|
38
|
-
onValueChange(value.filter((_, index) => index !== indexToRemove))
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const handleUpdate = (indexToUpdate: number, newItem: T) => {
|
|
43
|
-
const newItems = [...value]
|
|
44
|
-
newItems[indexToUpdate] = newItem
|
|
45
|
-
onValueChange(newItems)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const canAdd = value.length < max && !disabled
|
|
49
|
-
const canRemove = value.length > min && !disabled
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<div data-slot="repeater-field" className={cn("flex flex-col gap-4", className)} {...props}>
|
|
53
|
-
{value.map((item, index) => (
|
|
54
|
-
<div key={index} className="flex items-start gap-2">
|
|
55
|
-
<div className="flex-1 min-w-0">
|
|
56
|
-
{renderItem(item, index, {
|
|
57
|
-
remove: () => handleRemove(index),
|
|
58
|
-
update: (newItem: T) => handleUpdate(index, newItem),
|
|
59
|
-
})}
|
|
60
|
-
</div>
|
|
61
|
-
{canRemove && (
|
|
62
|
-
<Button
|
|
63
|
-
type="button"
|
|
64
|
-
variant="outline"
|
|
65
|
-
size="icon"
|
|
66
|
-
className="shrink-0 text-muted-foreground hover:text-destructive"
|
|
67
|
-
onClick={() => handleRemove(index)}
|
|
68
|
-
aria-label="Remove item"
|
|
69
|
-
>
|
|
70
|
-
<Trash2Icon className="size-4" />
|
|
71
|
-
</Button>
|
|
72
|
-
)}
|
|
73
|
-
</div>
|
|
74
|
-
))}
|
|
75
|
-
{canAdd && (
|
|
76
|
-
<div>
|
|
77
|
-
<Button
|
|
78
|
-
type="button"
|
|
79
|
-
variant="outline"
|
|
80
|
-
size="sm"
|
|
81
|
-
onClick={handleAdd}
|
|
82
|
-
className="w-full sm:w-auto"
|
|
83
|
-
>
|
|
84
|
-
<PlusIcon className="mr-2 size-4" />
|
|
85
|
-
{addLabel}
|
|
86
|
-
</Button>
|
|
87
|
-
</div>
|
|
88
|
-
)}
|
|
89
|
-
</div>
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export { RepeaterField }
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils"
|
|
4
|
-
|
|
5
|
-
export type CascaderOption = {
|
|
6
|
-
label: React.ReactNode
|
|
7
|
-
value: string
|
|
8
|
-
children?: CascaderOption[]
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type CascaderProps = React.ComponentProps<"div"> & {
|
|
12
|
-
options: CascaderOption[]
|
|
13
|
-
value?: string[]
|
|
14
|
-
onValueChange?: (value: string[]) => void
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function Cascader({ options, value = [], onValueChange, className, ...props }: CascaderProps) {
|
|
18
|
-
const firstValue = value[0] ?? ""
|
|
19
|
-
const secondOptions = options.find((item) => item.value === firstValue)?.children ?? []
|
|
20
|
-
const secondValue = value[1] ?? ""
|
|
21
|
-
const thirdOptions = secondOptions.find((item) => item.value === secondValue)?.children ?? []
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<div data-slot="cascader" className={cn("grid gap-2 sm:grid-cols-3", className)} {...props}>
|
|
25
|
-
<select className="h-10 rounded-md border bg-background px-3 text-sm" value={firstValue} onChange={(event) => onValueChange?.([event.target.value])}>
|
|
26
|
-
<option value="">Select</option>
|
|
27
|
-
{options.map((option) => <option key={option.value} value={option.value}>{option.label}</option>)}
|
|
28
|
-
</select>
|
|
29
|
-
<select className="h-10 rounded-md border bg-background px-3 text-sm" value={secondValue} disabled={!secondOptions.length} onChange={(event) => onValueChange?.([firstValue, event.target.value])}>
|
|
30
|
-
<option value="">Select</option>
|
|
31
|
-
{secondOptions.map((option) => <option key={option.value} value={option.value}>{option.label}</option>)}
|
|
32
|
-
</select>
|
|
33
|
-
<select className="h-10 rounded-md border bg-background px-3 text-sm" value={value[2] ?? ""} disabled={!thirdOptions.length} onChange={(event) => onValueChange?.([firstValue, secondValue, event.target.value])}>
|
|
34
|
-
<option value="">Select</option>
|
|
35
|
-
{thirdOptions.map((option) => <option key={option.value} value={option.value}>{option.label}</option>)}
|
|
36
|
-
</select>
|
|
37
|
-
</div>
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { Cascader }
|