@btst/components 0.0.0-stage → 1.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/LICENSE.md +17 -0
- package/dist/_private/ui/styles/markdown-editor.css +31 -0
- package/dist/auto-form/index.cjs +8 -0
- package/dist/auto-form/index.d.cts +26 -0
- package/dist/auto-form/index.d.mts +26 -0
- package/dist/auto-form/index.d.ts +26 -0
- package/dist/auto-form/index.mjs +1 -0
- package/dist/empty/index.cjs +12 -0
- package/dist/empty/index.d.cts +15 -0
- package/dist/empty/index.d.mts +15 -0
- package/dist/empty/index.d.ts +15 -0
- package/dist/empty/index.mjs +1 -0
- package/dist/form-builder/index.cjs +16 -0
- package/dist/form-builder/index.d.cts +395 -0
- package/dist/form-builder/index.d.mts +395 -0
- package/dist/form-builder/index.d.ts +395 -0
- package/dist/form-builder/index.mjs +4 -0
- package/dist/markdown/index.cjs +9 -0
- package/dist/markdown/index.d.cts +46 -0
- package/dist/markdown/index.d.mts +46 -0
- package/dist/markdown/index.d.ts +46 -0
- package/dist/markdown/index.mjs +2 -0
- package/dist/multi-select/index.cjs +7 -0
- package/dist/multi-select/index.d.cts +78 -0
- package/dist/multi-select/index.d.mts +78 -0
- package/dist/multi-select/index.d.ts +78 -0
- package/dist/multi-select/index.mjs +1 -0
- package/dist/search-select/index.cjs +7 -0
- package/dist/search-select/index.d.cts +16 -0
- package/dist/search-select/index.d.mts +16 -0
- package/dist/search-select/index.d.ts +16 -0
- package/dist/search-select/index.mjs +1 -0
- package/dist/shared/components.BdvBiegH.d.cts +291 -0
- package/dist/shared/components.BdvBiegH.d.mts +291 -0
- package/dist/shared/components.BdvBiegH.d.ts +291 -0
- package/dist/shared/components.CZMWR72v.d.cts +10 -0
- package/dist/shared/components.CZMWR72v.d.mts +10 -0
- package/dist/shared/components.CZMWR72v.d.ts +10 -0
- package/dist/stepped-auto-form/index.cjs +7 -0
- package/dist/stepped-auto-form/index.d.cts +37 -0
- package/dist/stepped-auto-form/index.d.mts +37 -0
- package/dist/stepped-auto-form/index.d.ts +37 -0
- package/dist/stepped-auto-form/index.mjs +1 -0
- package/dist/style.css +440 -0
- package/dist/ui/src/components/accordion.cjs +81 -0
- package/dist/ui/src/components/accordion.mjs +62 -0
- package/dist/ui/src/components/auto-form/common/label.cjs +18 -0
- package/dist/ui/src/components/auto-form/common/label.mjs +16 -0
- package/dist/ui/src/components/auto-form/common/tooltip.cjs +9 -0
- package/dist/ui/src/components/auto-form/common/tooltip.mjs +7 -0
- package/dist/ui/src/components/auto-form/config.cjs +40 -0
- package/dist/ui/src/components/auto-form/config.mjs +37 -0
- package/dist/ui/src/components/auto-form/dependencies.cjs +48 -0
- package/dist/ui/src/components/auto-form/dependencies.mjs +46 -0
- package/dist/ui/src/components/auto-form/fields/array.cjs +266 -0
- package/dist/ui/src/components/auto-form/fields/array.mjs +264 -0
- package/dist/ui/src/components/auto-form/fields/checkbox.cjs +38 -0
- package/dist/ui/src/components/auto-form/fields/checkbox.mjs +36 -0
- package/dist/ui/src/components/auto-form/fields/date.cjs +67 -0
- package/dist/ui/src/components/auto-form/fields/date.mjs +65 -0
- package/dist/ui/src/components/auto-form/fields/enum.cjs +73 -0
- package/dist/ui/src/components/auto-form/fields/enum.mjs +71 -0
- package/dist/ui/src/components/auto-form/fields/input.cjs +32 -0
- package/dist/ui/src/components/auto-form/fields/input.mjs +30 -0
- package/dist/ui/src/components/auto-form/fields/number.cjs +31 -0
- package/dist/ui/src/components/auto-form/fields/number.mjs +29 -0
- package/dist/ui/src/components/auto-form/fields/object.cjs +233 -0
- package/dist/ui/src/components/auto-form/fields/object.mjs +217 -0
- package/dist/ui/src/components/auto-form/fields/radio-group.cjs +67 -0
- package/dist/ui/src/components/auto-form/fields/radio-group.mjs +65 -0
- package/dist/ui/src/components/auto-form/fields/switch.cjs +38 -0
- package/dist/ui/src/components/auto-form/fields/switch.mjs +36 -0
- package/dist/ui/src/components/auto-form/fields/textarea.cjs +31 -0
- package/dist/ui/src/components/auto-form/fields/textarea.mjs +29 -0
- package/dist/ui/src/components/auto-form/helpers.cjs +270 -0
- package/dist/ui/src/components/auto-form/helpers.mjs +259 -0
- package/dist/ui/src/components/auto-form/index.cjs +102 -0
- package/dist/ui/src/components/auto-form/index.mjs +93 -0
- package/dist/ui/src/components/auto-form/stepped-auto-form.cjs +374 -0
- package/dist/ui/src/components/auto-form/stepped-auto-form.mjs +368 -0
- package/dist/ui/src/components/auto-form/types.cjs +11 -0
- package/dist/ui/src/components/auto-form/types.mjs +9 -0
- package/dist/ui/src/components/badge.cjs +42 -0
- package/dist/ui/src/components/badge.mjs +39 -0
- package/dist/ui/src/components/button.cjs +56 -0
- package/dist/ui/src/components/button.mjs +53 -0
- package/dist/ui/src/components/calendar.cjs +207 -0
- package/dist/ui/src/components/calendar.mjs +190 -0
- package/dist/ui/src/components/checkbox.cjs +48 -0
- package/dist/ui/src/components/checkbox.mjs +32 -0
- package/dist/ui/src/components/command.cjs +118 -0
- package/dist/ui/src/components/command.mjs +111 -0
- package/dist/ui/src/components/date-picker.cjs +41 -0
- package/dist/ui/src/components/date-picker.mjs +39 -0
- package/dist/ui/src/components/dialog.cjs +141 -0
- package/dist/ui/src/components/dialog.mjs +118 -0
- package/dist/ui/src/components/empty.cjs +104 -0
- package/dist/ui/src/components/empty.mjs +97 -0
- package/dist/ui/src/components/form-builder/canvas.cjs +111 -0
- package/dist/ui/src/components/form-builder/canvas.mjs +109 -0
- package/dist/ui/src/components/form-builder/components/index.cjs +571 -0
- package/dist/ui/src/components/form-builder/components/index.mjs +554 -0
- package/dist/ui/src/components/form-builder/edit-field-dialog.cjs +131 -0
- package/dist/ui/src/components/form-builder/edit-field-dialog.mjs +129 -0
- package/dist/ui/src/components/form-builder/form-preview.cjs +73 -0
- package/dist/ui/src/components/form-builder/form-preview.mjs +71 -0
- package/dist/ui/src/components/form-builder/index.cjs +350 -0
- package/dist/ui/src/components/form-builder/index.mjs +344 -0
- package/dist/ui/src/components/form-builder/nested-field-editor-dialog.cjs +263 -0
- package/dist/ui/src/components/form-builder/nested-field-editor-dialog.mjs +261 -0
- package/dist/ui/src/components/form-builder/palette.cjs +52 -0
- package/dist/ui/src/components/form-builder/palette.mjs +49 -0
- package/dist/ui/src/components/form-builder/schema-utils.cjs +128 -0
- package/dist/ui/src/components/form-builder/schema-utils.mjs +122 -0
- package/dist/ui/src/components/form-builder/sortable-field.cjs +151 -0
- package/dist/ui/src/components/form-builder/sortable-field.mjs +148 -0
- package/dist/ui/src/components/form-builder/step-tabs.cjs +180 -0
- package/dist/ui/src/components/form-builder/step-tabs.mjs +178 -0
- package/dist/ui/src/components/form-builder/types.cjs +7 -0
- package/dist/ui/src/components/form-builder/types.mjs +5 -0
- package/dist/ui/src/components/form-builder/validation-schemas.cjs +67 -0
- package/dist/ui/src/components/form-builder/validation-schemas.mjs +56 -0
- package/dist/ui/src/components/form.cjs +120 -0
- package/dist/ui/src/components/form.mjs +98 -0
- package/dist/ui/src/components/input.cjs +23 -0
- package/dist/ui/src/components/input.mjs +21 -0
- package/dist/ui/src/components/label.cjs +39 -0
- package/dist/ui/src/components/label.mjs +23 -0
- package/dist/ui/src/components/markdown-content.cjs +334 -0
- package/dist/ui/src/components/markdown-content.mjs +325 -0
- package/dist/ui/src/components/markdown-editor.cjs +180 -0
- package/dist/ui/src/components/markdown-editor.mjs +178 -0
- package/dist/ui/src/components/multi-select.cjs +555 -0
- package/dist/ui/src/components/multi-select.mjs +540 -0
- package/dist/ui/src/components/popover.cjs +60 -0
- package/dist/ui/src/components/popover.mjs +42 -0
- package/dist/ui/src/components/radio-group.cjs +62 -0
- package/dist/ui/src/components/radio-group.mjs +45 -0
- package/dist/ui/src/components/search-select.cjs +99 -0
- package/dist/ui/src/components/search-select.mjs +83 -0
- package/dist/ui/src/components/select.cjs +161 -0
- package/dist/ui/src/components/select.mjs +139 -0
- package/dist/ui/src/components/separator.cjs +43 -0
- package/dist/ui/src/components/separator.mjs +27 -0
- package/dist/ui/src/components/switch.cjs +48 -0
- package/dist/ui/src/components/switch.mjs +32 -0
- package/dist/ui/src/components/tabs.cjs +84 -0
- package/dist/ui/src/components/tabs.mjs +65 -0
- package/dist/ui/src/components/textarea.cjs +20 -0
- package/dist/ui/src/components/textarea.mjs +18 -0
- package/dist/ui/src/hooks/use-debounce.cjs +16 -0
- package/dist/ui/src/hooks/use-debounce.mjs +14 -0
- package/dist/ui/src/lib/schema-converter.cjs +94 -0
- package/dist/ui/src/lib/schema-converter.mjs +92 -0
- package/dist/ui/src/lib/throttle.cjs +56 -0
- package/dist/ui/src/lib/throttle.mjs +54 -0
- package/dist/ui/src/lib/utils.cjs +10 -0
- package/dist/ui/src/lib/utils.mjs +8 -0
- package/dist/ui.css +131 -0
- package/package.json +176 -3
- package/README.md +0 -3
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { Command as Command$1 } from 'cmdk';
|
|
4
|
+
import { SearchIcon } from 'lucide-react';
|
|
5
|
+
import { cn } from '../lib/utils.mjs';
|
|
6
|
+
import '@radix-ui/react-dialog';
|
|
7
|
+
|
|
8
|
+
function Command({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
Command$1,
|
|
14
|
+
{
|
|
15
|
+
"data-slot": "command",
|
|
16
|
+
className: cn(
|
|
17
|
+
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
|
|
18
|
+
className
|
|
19
|
+
),
|
|
20
|
+
...props
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function CommandInput({
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}) {
|
|
28
|
+
return /* @__PURE__ */ jsxs(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
"data-slot": "command-input-wrapper",
|
|
32
|
+
className: "pointer-events-auto flex h-9 items-center gap-2 border-b px-3",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
Command$1.Input,
|
|
37
|
+
{
|
|
38
|
+
"data-slot": "command-input",
|
|
39
|
+
className: cn(
|
|
40
|
+
"pointer-events-auto placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
41
|
+
className
|
|
42
|
+
),
|
|
43
|
+
...props
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
function CommandList({
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}) {
|
|
54
|
+
return /* @__PURE__ */ jsx(
|
|
55
|
+
Command$1.List,
|
|
56
|
+
{
|
|
57
|
+
"data-slot": "command-list",
|
|
58
|
+
className: cn(
|
|
59
|
+
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
60
|
+
className
|
|
61
|
+
),
|
|
62
|
+
...props
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
function CommandEmpty({
|
|
67
|
+
...props
|
|
68
|
+
}) {
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
Command$1.Empty,
|
|
71
|
+
{
|
|
72
|
+
"data-slot": "command-empty",
|
|
73
|
+
className: "py-6 text-center text-sm",
|
|
74
|
+
...props
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function CommandGroup({
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
}) {
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
Command$1.Group,
|
|
84
|
+
{
|
|
85
|
+
"data-slot": "command-group",
|
|
86
|
+
className: cn(
|
|
87
|
+
"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
|
|
88
|
+
className
|
|
89
|
+
),
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function CommandItem({
|
|
95
|
+
className,
|
|
96
|
+
...props
|
|
97
|
+
}) {
|
|
98
|
+
return /* @__PURE__ */ jsx(
|
|
99
|
+
Command$1.Item,
|
|
100
|
+
{
|
|
101
|
+
"data-slot": "command-item",
|
|
102
|
+
className: cn(
|
|
103
|
+
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground pointer-events-auto relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
104
|
+
className
|
|
105
|
+
),
|
|
106
|
+
...props
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
const dateFns = require('date-fns');
|
|
6
|
+
const lucideReact = require('lucide-react');
|
|
7
|
+
const utils = require('../lib/utils.cjs');
|
|
8
|
+
const button = require('./button.cjs');
|
|
9
|
+
const calendar = require('./calendar.cjs');
|
|
10
|
+
const popover = require('./popover.cjs');
|
|
11
|
+
const React = require('react');
|
|
12
|
+
|
|
13
|
+
const DatePicker = React.forwardRef(function DatePickerCmp({ date, setDate }, ref) {
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(popover.Popover, { children: [
|
|
15
|
+
/* @__PURE__ */ jsxRuntime.jsx(popover.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16
|
+
button.Button,
|
|
17
|
+
{
|
|
18
|
+
variant: "outline",
|
|
19
|
+
className: utils.cn(
|
|
20
|
+
"w-full justify-start text-left font-normal",
|
|
21
|
+
!date && "text-muted-foreground"
|
|
22
|
+
),
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Calendar, { className: "mr-2 h-4 w-4" }),
|
|
25
|
+
date ? dateFns.format(date, "PPP") : /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Pick a date" })
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
) }),
|
|
29
|
+
/* @__PURE__ */ jsxRuntime.jsx(popover.PopoverContent, { className: "w-auto p-0", ref, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
|
+
calendar.Calendar,
|
|
31
|
+
{
|
|
32
|
+
mode: "single",
|
|
33
|
+
selected: date,
|
|
34
|
+
onSelect: setDate,
|
|
35
|
+
autoFocus: true
|
|
36
|
+
}
|
|
37
|
+
) })
|
|
38
|
+
] });
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
exports.DatePicker = DatePicker;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { format } from 'date-fns';
|
|
4
|
+
import { Calendar } from 'lucide-react';
|
|
5
|
+
import { cn } from '../lib/utils.mjs';
|
|
6
|
+
import { Button } from './button.mjs';
|
|
7
|
+
import { Calendar as Calendar$1 } from './calendar.mjs';
|
|
8
|
+
import { Popover, PopoverTrigger, PopoverContent } from './popover.mjs';
|
|
9
|
+
import { forwardRef } from 'react';
|
|
10
|
+
|
|
11
|
+
const DatePicker = forwardRef(function DatePickerCmp({ date, setDate }, ref) {
|
|
12
|
+
return /* @__PURE__ */ jsxs(Popover, { children: [
|
|
13
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
14
|
+
Button,
|
|
15
|
+
{
|
|
16
|
+
variant: "outline",
|
|
17
|
+
className: cn(
|
|
18
|
+
"w-full justify-start text-left font-normal",
|
|
19
|
+
!date && "text-muted-foreground"
|
|
20
|
+
),
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ jsx(Calendar, { className: "mr-2 h-4 w-4" }),
|
|
23
|
+
date ? format(date, "PPP") : /* @__PURE__ */ jsx("span", { children: "Pick a date" })
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
) }),
|
|
27
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: "w-auto p-0", ref, children: /* @__PURE__ */ jsx(
|
|
28
|
+
Calendar$1,
|
|
29
|
+
{
|
|
30
|
+
mode: "single",
|
|
31
|
+
selected: date,
|
|
32
|
+
onSelect: setDate,
|
|
33
|
+
autoFocus: true
|
|
34
|
+
}
|
|
35
|
+
) })
|
|
36
|
+
] });
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export { DatePicker };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
const DialogPrimitive = require('@radix-ui/react-dialog');
|
|
6
|
+
const lucideReact = require('lucide-react');
|
|
7
|
+
const utils = require('../lib/utils.cjs');
|
|
8
|
+
|
|
9
|
+
function _interopNamespaceCompat(e) {
|
|
10
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
11
|
+
const n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
for (const k in e) {
|
|
14
|
+
n[k] = e[k];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
n.default = e;
|
|
18
|
+
return n;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const DialogPrimitive__namespace = /*#__PURE__*/_interopNamespaceCompat(DialogPrimitive);
|
|
22
|
+
|
|
23
|
+
function Dialog({
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
|
|
27
|
+
}
|
|
28
|
+
function DialogPortal({
|
|
29
|
+
...props
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
|
|
32
|
+
}
|
|
33
|
+
function DialogOverlay({
|
|
34
|
+
className,
|
|
35
|
+
...props
|
|
36
|
+
}) {
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
+
DialogPrimitive__namespace.Overlay,
|
|
39
|
+
{
|
|
40
|
+
"data-slot": "dialog-overlay",
|
|
41
|
+
className: utils.cn(
|
|
42
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
...props
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
function DialogContent({
|
|
50
|
+
className,
|
|
51
|
+
children,
|
|
52
|
+
showCloseButton = true,
|
|
53
|
+
...props
|
|
54
|
+
}) {
|
|
55
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
56
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
57
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
58
|
+
DialogPrimitive__namespace.Content,
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "dialog-content",
|
|
61
|
+
className: utils.cn(
|
|
62
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
|
|
63
|
+
className
|
|
64
|
+
),
|
|
65
|
+
...props,
|
|
66
|
+
children: [
|
|
67
|
+
children,
|
|
68
|
+
showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
69
|
+
DialogPrimitive__namespace.Close,
|
|
70
|
+
{
|
|
71
|
+
"data-slot": "dialog-close",
|
|
72
|
+
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
|
|
75
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] });
|
|
83
|
+
}
|
|
84
|
+
function DialogHeader({ className, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
"data-slot": "dialog-header",
|
|
89
|
+
className: utils.cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function DialogFooter({ className, ...props }) {
|
|
95
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
96
|
+
"div",
|
|
97
|
+
{
|
|
98
|
+
"data-slot": "dialog-footer",
|
|
99
|
+
className: utils.cn(
|
|
100
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
101
|
+
className
|
|
102
|
+
),
|
|
103
|
+
...props
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
function DialogTitle({
|
|
108
|
+
className,
|
|
109
|
+
...props
|
|
110
|
+
}) {
|
|
111
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
112
|
+
DialogPrimitive__namespace.Title,
|
|
113
|
+
{
|
|
114
|
+
"data-slot": "dialog-title",
|
|
115
|
+
className: utils.cn("text-lg leading-none font-semibold", className),
|
|
116
|
+
...props
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
function DialogDescription({
|
|
121
|
+
className,
|
|
122
|
+
...props
|
|
123
|
+
}) {
|
|
124
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
125
|
+
DialogPrimitive__namespace.Description,
|
|
126
|
+
{
|
|
127
|
+
"data-slot": "dialog-description",
|
|
128
|
+
className: utils.cn("text-muted-foreground text-sm", className),
|
|
129
|
+
...props
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
exports.Dialog = Dialog;
|
|
135
|
+
exports.DialogContent = DialogContent;
|
|
136
|
+
exports.DialogDescription = DialogDescription;
|
|
137
|
+
exports.DialogFooter = DialogFooter;
|
|
138
|
+
exports.DialogHeader = DialogHeader;
|
|
139
|
+
exports.DialogOverlay = DialogOverlay;
|
|
140
|
+
exports.DialogPortal = DialogPortal;
|
|
141
|
+
exports.DialogTitle = DialogTitle;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
|
+
import { XIcon } from 'lucide-react';
|
|
5
|
+
import { cn } from '../lib/utils.mjs';
|
|
6
|
+
|
|
7
|
+
function Dialog({
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
11
|
+
}
|
|
12
|
+
function DialogPortal({
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
16
|
+
}
|
|
17
|
+
function DialogOverlay({
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
DialogPrimitive.Overlay,
|
|
23
|
+
{
|
|
24
|
+
"data-slot": "dialog-overlay",
|
|
25
|
+
className: cn(
|
|
26
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
27
|
+
className
|
|
28
|
+
),
|
|
29
|
+
...props
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function DialogContent({
|
|
34
|
+
className,
|
|
35
|
+
children,
|
|
36
|
+
showCloseButton = true,
|
|
37
|
+
...props
|
|
38
|
+
}) {
|
|
39
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
40
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
41
|
+
/* @__PURE__ */ jsxs(
|
|
42
|
+
DialogPrimitive.Content,
|
|
43
|
+
{
|
|
44
|
+
"data-slot": "dialog-content",
|
|
45
|
+
className: cn(
|
|
46
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
|
|
47
|
+
className
|
|
48
|
+
),
|
|
49
|
+
...props,
|
|
50
|
+
children: [
|
|
51
|
+
children,
|
|
52
|
+
showCloseButton && /* @__PURE__ */ jsxs(
|
|
53
|
+
DialogPrimitive.Close,
|
|
54
|
+
{
|
|
55
|
+
"data-slot": "dialog-close",
|
|
56
|
+
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsx(XIcon, {}),
|
|
59
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
function DialogHeader({ className, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
"data-slot": "dialog-header",
|
|
73
|
+
className: cn("flex flex-col gap-2 text-center sm:text-left", className),
|
|
74
|
+
...props
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function DialogFooter({ className, ...props }) {
|
|
79
|
+
return /* @__PURE__ */ jsx(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
"data-slot": "dialog-footer",
|
|
83
|
+
className: cn(
|
|
84
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
85
|
+
className
|
|
86
|
+
),
|
|
87
|
+
...props
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
function DialogTitle({
|
|
92
|
+
className,
|
|
93
|
+
...props
|
|
94
|
+
}) {
|
|
95
|
+
return /* @__PURE__ */ jsx(
|
|
96
|
+
DialogPrimitive.Title,
|
|
97
|
+
{
|
|
98
|
+
"data-slot": "dialog-title",
|
|
99
|
+
className: cn("text-lg leading-none font-semibold", className),
|
|
100
|
+
...props
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function DialogDescription({
|
|
105
|
+
className,
|
|
106
|
+
...props
|
|
107
|
+
}) {
|
|
108
|
+
return /* @__PURE__ */ jsx(
|
|
109
|
+
DialogPrimitive.Description,
|
|
110
|
+
{
|
|
111
|
+
"data-slot": "dialog-description",
|
|
112
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
113
|
+
...props
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
const classVarianceAuthority = require('class-variance-authority');
|
|
5
|
+
const utils = require('../lib/utils.cjs');
|
|
6
|
+
|
|
7
|
+
function Empty({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
"data-slot": "empty",
|
|
12
|
+
className: utils.cn(
|
|
13
|
+
"flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",
|
|
14
|
+
className
|
|
15
|
+
),
|
|
16
|
+
...props
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
function EmptyHeader({ className, ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
"data-slot": "empty-header",
|
|
25
|
+
className: utils.cn(
|
|
26
|
+
"flex max-w-sm flex-col items-center gap-2 text-center",
|
|
27
|
+
className
|
|
28
|
+
),
|
|
29
|
+
...props
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
const emptyMediaVariants = classVarianceAuthority.cva(
|
|
34
|
+
"flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
35
|
+
{
|
|
36
|
+
variants: {
|
|
37
|
+
variant: {
|
|
38
|
+
default: "bg-transparent",
|
|
39
|
+
icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
variant: "default"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
function EmptyMedia({
|
|
48
|
+
className,
|
|
49
|
+
variant = "default",
|
|
50
|
+
...props
|
|
51
|
+
}) {
|
|
52
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
"data-slot": "empty-icon",
|
|
56
|
+
"data-variant": variant,
|
|
57
|
+
className: utils.cn(emptyMediaVariants({ variant, className })),
|
|
58
|
+
...props
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
function EmptyTitle({ className, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
"data-slot": "empty-title",
|
|
67
|
+
className: utils.cn("text-lg font-medium tracking-tight", className),
|
|
68
|
+
...props
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
function EmptyDescription({ className, ...props }) {
|
|
73
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
"data-slot": "empty-description",
|
|
77
|
+
className: utils.cn(
|
|
78
|
+
"text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",
|
|
79
|
+
className
|
|
80
|
+
),
|
|
81
|
+
...props
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
function EmptyContent({ className, ...props }) {
|
|
86
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
"data-slot": "empty-content",
|
|
90
|
+
className: utils.cn(
|
|
91
|
+
"flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",
|
|
92
|
+
className
|
|
93
|
+
),
|
|
94
|
+
...props
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
exports.Empty = Empty;
|
|
100
|
+
exports.EmptyContent = EmptyContent;
|
|
101
|
+
exports.EmptyDescription = EmptyDescription;
|
|
102
|
+
exports.EmptyHeader = EmptyHeader;
|
|
103
|
+
exports.EmptyMedia = EmptyMedia;
|
|
104
|
+
exports.EmptyTitle = EmptyTitle;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { cn } from '../lib/utils.mjs';
|
|
4
|
+
|
|
5
|
+
function Empty({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
"data-slot": "empty",
|
|
10
|
+
className: cn(
|
|
11
|
+
"flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",
|
|
12
|
+
className
|
|
13
|
+
),
|
|
14
|
+
...props
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
function EmptyHeader({ className, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
"data-slot": "empty-header",
|
|
23
|
+
className: cn(
|
|
24
|
+
"flex max-w-sm flex-col items-center gap-2 text-center",
|
|
25
|
+
className
|
|
26
|
+
),
|
|
27
|
+
...props
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
const emptyMediaVariants = cva(
|
|
32
|
+
"flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
33
|
+
{
|
|
34
|
+
variants: {
|
|
35
|
+
variant: {
|
|
36
|
+
default: "bg-transparent",
|
|
37
|
+
icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
variant: "default"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
function EmptyMedia({
|
|
46
|
+
className,
|
|
47
|
+
variant = "default",
|
|
48
|
+
...props
|
|
49
|
+
}) {
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "empty-icon",
|
|
54
|
+
"data-variant": variant,
|
|
55
|
+
className: cn(emptyMediaVariants({ variant, className })),
|
|
56
|
+
...props
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
function EmptyTitle({ className, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ jsx(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
"data-slot": "empty-title",
|
|
65
|
+
className: cn("text-lg font-medium tracking-tight", className),
|
|
66
|
+
...props
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
function EmptyDescription({ className, ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsx(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
"data-slot": "empty-description",
|
|
75
|
+
className: cn(
|
|
76
|
+
"text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",
|
|
77
|
+
className
|
|
78
|
+
),
|
|
79
|
+
...props
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
function EmptyContent({ className, ...props }) {
|
|
84
|
+
return /* @__PURE__ */ jsx(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
"data-slot": "empty-content",
|
|
88
|
+
className: cn(
|
|
89
|
+
"flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",
|
|
90
|
+
className
|
|
91
|
+
),
|
|
92
|
+
...props
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|