@btst/components 0.0.0-stage → 1.0.0-beta.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,207 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
const React = require('react');
|
|
6
|
+
const lucideReact = require('lucide-react');
|
|
7
|
+
const reactDayPicker = require('react-day-picker');
|
|
8
|
+
const utils = require('../lib/utils.cjs');
|
|
9
|
+
const button = require('./button.cjs');
|
|
10
|
+
|
|
11
|
+
function _interopNamespaceCompat(e) {
|
|
12
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
13
|
+
const n = Object.create(null);
|
|
14
|
+
if (e) {
|
|
15
|
+
for (const k in e) {
|
|
16
|
+
n[k] = e[k];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
24
|
+
|
|
25
|
+
function Calendar({
|
|
26
|
+
className,
|
|
27
|
+
classNames,
|
|
28
|
+
showOutsideDays = true,
|
|
29
|
+
captionLayout = "label",
|
|
30
|
+
buttonVariant = "ghost",
|
|
31
|
+
formatters,
|
|
32
|
+
components,
|
|
33
|
+
...props
|
|
34
|
+
}) {
|
|
35
|
+
const defaultClassNames = reactDayPicker.getDefaultClassNames();
|
|
36
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
|
+
reactDayPicker.DayPicker,
|
|
38
|
+
{
|
|
39
|
+
showOutsideDays,
|
|
40
|
+
className: utils.cn(
|
|
41
|
+
"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
42
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
43
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
44
|
+
className
|
|
45
|
+
),
|
|
46
|
+
captionLayout,
|
|
47
|
+
formatters: {
|
|
48
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
49
|
+
...formatters
|
|
50
|
+
},
|
|
51
|
+
classNames: {
|
|
52
|
+
root: utils.cn("w-fit", defaultClassNames.root),
|
|
53
|
+
months: utils.cn(
|
|
54
|
+
"flex gap-4 flex-col md:flex-row relative",
|
|
55
|
+
defaultClassNames.months
|
|
56
|
+
),
|
|
57
|
+
month: utils.cn("flex flex-col w-full gap-4", defaultClassNames.month),
|
|
58
|
+
nav: utils.cn(
|
|
59
|
+
"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
|
|
60
|
+
defaultClassNames.nav
|
|
61
|
+
),
|
|
62
|
+
button_previous: utils.cn(
|
|
63
|
+
button.buttonVariants({ variant: buttonVariant }),
|
|
64
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
65
|
+
defaultClassNames.button_previous
|
|
66
|
+
),
|
|
67
|
+
button_next: utils.cn(
|
|
68
|
+
button.buttonVariants({ variant: buttonVariant }),
|
|
69
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
70
|
+
defaultClassNames.button_next
|
|
71
|
+
),
|
|
72
|
+
month_caption: utils.cn(
|
|
73
|
+
"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
|
|
74
|
+
defaultClassNames.month_caption
|
|
75
|
+
),
|
|
76
|
+
dropdowns: utils.cn(
|
|
77
|
+
"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
|
|
78
|
+
defaultClassNames.dropdowns
|
|
79
|
+
),
|
|
80
|
+
dropdown_root: utils.cn(
|
|
81
|
+
"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
|
|
82
|
+
defaultClassNames.dropdown_root
|
|
83
|
+
),
|
|
84
|
+
dropdown: utils.cn(
|
|
85
|
+
"absolute bg-popover inset-0 opacity-0",
|
|
86
|
+
defaultClassNames.dropdown
|
|
87
|
+
),
|
|
88
|
+
caption_label: utils.cn(
|
|
89
|
+
"select-none font-medium",
|
|
90
|
+
captionLayout === "label" ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
|
|
91
|
+
defaultClassNames.caption_label
|
|
92
|
+
),
|
|
93
|
+
month_grid: utils.cn(
|
|
94
|
+
"w-full border-collapse",
|
|
95
|
+
defaultClassNames.month_grid
|
|
96
|
+
),
|
|
97
|
+
weekdays: utils.cn("flex", defaultClassNames.weekdays),
|
|
98
|
+
weekday: utils.cn(
|
|
99
|
+
"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
|
|
100
|
+
defaultClassNames.weekday
|
|
101
|
+
),
|
|
102
|
+
week: utils.cn("flex w-full mt-2", defaultClassNames.week),
|
|
103
|
+
week_number_header: utils.cn(
|
|
104
|
+
"select-none w-(--cell-size)",
|
|
105
|
+
defaultClassNames.week_number_header
|
|
106
|
+
),
|
|
107
|
+
week_number: utils.cn(
|
|
108
|
+
"text-[0.8rem] select-none text-muted-foreground",
|
|
109
|
+
defaultClassNames.week_number
|
|
110
|
+
),
|
|
111
|
+
day: utils.cn(
|
|
112
|
+
"relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
|
|
113
|
+
props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md",
|
|
114
|
+
defaultClassNames.day
|
|
115
|
+
),
|
|
116
|
+
range_start: utils.cn(
|
|
117
|
+
"rounded-l-md bg-accent",
|
|
118
|
+
defaultClassNames.range_start
|
|
119
|
+
),
|
|
120
|
+
range_middle: utils.cn("rounded-none", defaultClassNames.range_middle),
|
|
121
|
+
range_end: utils.cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
122
|
+
today: utils.cn(
|
|
123
|
+
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
124
|
+
defaultClassNames.today
|
|
125
|
+
),
|
|
126
|
+
outside: utils.cn(
|
|
127
|
+
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
128
|
+
defaultClassNames.outside
|
|
129
|
+
),
|
|
130
|
+
disabled: utils.cn(
|
|
131
|
+
"text-muted-foreground opacity-50",
|
|
132
|
+
defaultClassNames.disabled
|
|
133
|
+
),
|
|
134
|
+
hidden: utils.cn("invisible", defaultClassNames.hidden),
|
|
135
|
+
...classNames
|
|
136
|
+
},
|
|
137
|
+
components: {
|
|
138
|
+
Root: ({ className: className2, rootRef, ...props2 }) => {
|
|
139
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
140
|
+
"div",
|
|
141
|
+
{
|
|
142
|
+
"data-slot": "calendar",
|
|
143
|
+
ref: rootRef,
|
|
144
|
+
className: utils.cn(className2),
|
|
145
|
+
...props2
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
},
|
|
149
|
+
Chevron: ({ className: className2, orientation, ...props2 }) => {
|
|
150
|
+
if (orientation === "left") {
|
|
151
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, { className: utils.cn("size-4", className2), ...props2 });
|
|
152
|
+
}
|
|
153
|
+
if (orientation === "right") {
|
|
154
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
155
|
+
lucideReact.ChevronRightIcon,
|
|
156
|
+
{
|
|
157
|
+
className: utils.cn("size-4", className2),
|
|
158
|
+
...props2
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: utils.cn("size-4", className2), ...props2 });
|
|
163
|
+
},
|
|
164
|
+
DayButton: CalendarDayButton,
|
|
165
|
+
WeekNumber: ({ children, ...props2 }) => {
|
|
166
|
+
return /* @__PURE__ */ jsxRuntime.jsx("td", { ...props2, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
|
|
167
|
+
},
|
|
168
|
+
...components
|
|
169
|
+
},
|
|
170
|
+
...props
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
function CalendarDayButton({
|
|
175
|
+
className,
|
|
176
|
+
day,
|
|
177
|
+
modifiers,
|
|
178
|
+
...props
|
|
179
|
+
}) {
|
|
180
|
+
const defaultClassNames = reactDayPicker.getDefaultClassNames();
|
|
181
|
+
const ref = React__namespace.useRef(null);
|
|
182
|
+
React__namespace.useEffect(() => {
|
|
183
|
+
if (modifiers.focused) ref.current?.focus();
|
|
184
|
+
}, [modifiers.focused]);
|
|
185
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
186
|
+
button.Button,
|
|
187
|
+
{
|
|
188
|
+
ref,
|
|
189
|
+
variant: "ghost",
|
|
190
|
+
size: "icon",
|
|
191
|
+
"data-day": day.date.toLocaleDateString(),
|
|
192
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
193
|
+
"data-range-start": modifiers.range_start,
|
|
194
|
+
"data-range-end": modifiers.range_end,
|
|
195
|
+
"data-range-middle": modifiers.range_middle,
|
|
196
|
+
className: utils.cn(
|
|
197
|
+
"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
|
|
198
|
+
defaultClassNames.day,
|
|
199
|
+
className
|
|
200
|
+
),
|
|
201
|
+
...props
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
exports.Calendar = Calendar;
|
|
207
|
+
exports.CalendarDayButton = CalendarDayButton;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from 'lucide-react';
|
|
5
|
+
import { getDefaultClassNames, DayPicker } from 'react-day-picker';
|
|
6
|
+
import { cn } from '../lib/utils.mjs';
|
|
7
|
+
import { buttonVariants, Button } from './button.mjs';
|
|
8
|
+
|
|
9
|
+
function Calendar({
|
|
10
|
+
className,
|
|
11
|
+
classNames,
|
|
12
|
+
showOutsideDays = true,
|
|
13
|
+
captionLayout = "label",
|
|
14
|
+
buttonVariant = "ghost",
|
|
15
|
+
formatters,
|
|
16
|
+
components,
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
const defaultClassNames = getDefaultClassNames();
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
DayPicker,
|
|
22
|
+
{
|
|
23
|
+
showOutsideDays,
|
|
24
|
+
className: cn(
|
|
25
|
+
"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
26
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
27
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
captionLayout,
|
|
31
|
+
formatters: {
|
|
32
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
33
|
+
...formatters
|
|
34
|
+
},
|
|
35
|
+
classNames: {
|
|
36
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
37
|
+
months: cn(
|
|
38
|
+
"flex gap-4 flex-col md:flex-row relative",
|
|
39
|
+
defaultClassNames.months
|
|
40
|
+
),
|
|
41
|
+
month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
|
|
42
|
+
nav: cn(
|
|
43
|
+
"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
|
|
44
|
+
defaultClassNames.nav
|
|
45
|
+
),
|
|
46
|
+
button_previous: cn(
|
|
47
|
+
buttonVariants({ variant: buttonVariant }),
|
|
48
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
49
|
+
defaultClassNames.button_previous
|
|
50
|
+
),
|
|
51
|
+
button_next: cn(
|
|
52
|
+
buttonVariants({ variant: buttonVariant }),
|
|
53
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
54
|
+
defaultClassNames.button_next
|
|
55
|
+
),
|
|
56
|
+
month_caption: cn(
|
|
57
|
+
"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
|
|
58
|
+
defaultClassNames.month_caption
|
|
59
|
+
),
|
|
60
|
+
dropdowns: cn(
|
|
61
|
+
"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
|
|
62
|
+
defaultClassNames.dropdowns
|
|
63
|
+
),
|
|
64
|
+
dropdown_root: cn(
|
|
65
|
+
"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
|
|
66
|
+
defaultClassNames.dropdown_root
|
|
67
|
+
),
|
|
68
|
+
dropdown: cn(
|
|
69
|
+
"absolute bg-popover inset-0 opacity-0",
|
|
70
|
+
defaultClassNames.dropdown
|
|
71
|
+
),
|
|
72
|
+
caption_label: cn(
|
|
73
|
+
"select-none font-medium",
|
|
74
|
+
captionLayout === "label" ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
|
|
75
|
+
defaultClassNames.caption_label
|
|
76
|
+
),
|
|
77
|
+
month_grid: cn(
|
|
78
|
+
"w-full border-collapse",
|
|
79
|
+
defaultClassNames.month_grid
|
|
80
|
+
),
|
|
81
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
82
|
+
weekday: cn(
|
|
83
|
+
"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
|
|
84
|
+
defaultClassNames.weekday
|
|
85
|
+
),
|
|
86
|
+
week: cn("flex w-full mt-2", defaultClassNames.week),
|
|
87
|
+
week_number_header: cn(
|
|
88
|
+
"select-none w-(--cell-size)",
|
|
89
|
+
defaultClassNames.week_number_header
|
|
90
|
+
),
|
|
91
|
+
week_number: cn(
|
|
92
|
+
"text-[0.8rem] select-none text-muted-foreground",
|
|
93
|
+
defaultClassNames.week_number
|
|
94
|
+
),
|
|
95
|
+
day: cn(
|
|
96
|
+
"relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
|
|
97
|
+
props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md",
|
|
98
|
+
defaultClassNames.day
|
|
99
|
+
),
|
|
100
|
+
range_start: cn(
|
|
101
|
+
"rounded-l-md bg-accent",
|
|
102
|
+
defaultClassNames.range_start
|
|
103
|
+
),
|
|
104
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
105
|
+
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
106
|
+
today: cn(
|
|
107
|
+
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
108
|
+
defaultClassNames.today
|
|
109
|
+
),
|
|
110
|
+
outside: cn(
|
|
111
|
+
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
112
|
+
defaultClassNames.outside
|
|
113
|
+
),
|
|
114
|
+
disabled: cn(
|
|
115
|
+
"text-muted-foreground opacity-50",
|
|
116
|
+
defaultClassNames.disabled
|
|
117
|
+
),
|
|
118
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
119
|
+
...classNames
|
|
120
|
+
},
|
|
121
|
+
components: {
|
|
122
|
+
Root: ({ className: className2, rootRef, ...props2 }) => {
|
|
123
|
+
return /* @__PURE__ */ jsx(
|
|
124
|
+
"div",
|
|
125
|
+
{
|
|
126
|
+
"data-slot": "calendar",
|
|
127
|
+
ref: rootRef,
|
|
128
|
+
className: cn(className2),
|
|
129
|
+
...props2
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
},
|
|
133
|
+
Chevron: ({ className: className2, orientation, ...props2 }) => {
|
|
134
|
+
if (orientation === "left") {
|
|
135
|
+
return /* @__PURE__ */ jsx(ChevronLeftIcon, { className: cn("size-4", className2), ...props2 });
|
|
136
|
+
}
|
|
137
|
+
if (orientation === "right") {
|
|
138
|
+
return /* @__PURE__ */ jsx(
|
|
139
|
+
ChevronRightIcon,
|
|
140
|
+
{
|
|
141
|
+
className: cn("size-4", className2),
|
|
142
|
+
...props2
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
return /* @__PURE__ */ jsx(ChevronDownIcon, { className: cn("size-4", className2), ...props2 });
|
|
147
|
+
},
|
|
148
|
+
DayButton: CalendarDayButton,
|
|
149
|
+
WeekNumber: ({ children, ...props2 }) => {
|
|
150
|
+
return /* @__PURE__ */ jsx("td", { ...props2, children: /* @__PURE__ */ jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
|
|
151
|
+
},
|
|
152
|
+
...components
|
|
153
|
+
},
|
|
154
|
+
...props
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
function CalendarDayButton({
|
|
159
|
+
className,
|
|
160
|
+
day,
|
|
161
|
+
modifiers,
|
|
162
|
+
...props
|
|
163
|
+
}) {
|
|
164
|
+
const defaultClassNames = getDefaultClassNames();
|
|
165
|
+
const ref = React.useRef(null);
|
|
166
|
+
React.useEffect(() => {
|
|
167
|
+
if (modifiers.focused) ref.current?.focus();
|
|
168
|
+
}, [modifiers.focused]);
|
|
169
|
+
return /* @__PURE__ */ jsx(
|
|
170
|
+
Button,
|
|
171
|
+
{
|
|
172
|
+
ref,
|
|
173
|
+
variant: "ghost",
|
|
174
|
+
size: "icon",
|
|
175
|
+
"data-day": day.date.toLocaleDateString(),
|
|
176
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
177
|
+
"data-range-start": modifiers.range_start,
|
|
178
|
+
"data-range-end": modifiers.range_end,
|
|
179
|
+
"data-range-middle": modifiers.range_middle,
|
|
180
|
+
className: cn(
|
|
181
|
+
"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
|
|
182
|
+
defaultClassNames.day,
|
|
183
|
+
className
|
|
184
|
+
),
|
|
185
|
+
...props
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
const CheckboxPrimitive = require('@radix-ui/react-checkbox');
|
|
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 CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespaceCompat(CheckboxPrimitive);
|
|
22
|
+
|
|
23
|
+
function Checkbox({
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}) {
|
|
27
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
28
|
+
CheckboxPrimitive__namespace.Root,
|
|
29
|
+
{
|
|
30
|
+
"data-slot": "checkbox",
|
|
31
|
+
className: utils.cn(
|
|
32
|
+
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
33
|
+
className
|
|
34
|
+
),
|
|
35
|
+
...props,
|
|
36
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
|
+
CheckboxPrimitive__namespace.Indicator,
|
|
38
|
+
{
|
|
39
|
+
"data-slot": "checkbox-indicator",
|
|
40
|
+
className: "grid place-content-center text-current transition-none",
|
|
41
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-3.5" })
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
exports.Checkbox = Checkbox;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
4
|
+
import { CheckIcon } from 'lucide-react';
|
|
5
|
+
import { cn } from '../lib/utils.mjs';
|
|
6
|
+
|
|
7
|
+
function Checkbox({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
CheckboxPrimitive.Root,
|
|
13
|
+
{
|
|
14
|
+
"data-slot": "checkbox",
|
|
15
|
+
className: cn(
|
|
16
|
+
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
...props,
|
|
20
|
+
children: /* @__PURE__ */ jsx(
|
|
21
|
+
CheckboxPrimitive.Indicator,
|
|
22
|
+
{
|
|
23
|
+
"data-slot": "checkbox-indicator",
|
|
24
|
+
className: "grid place-content-center text-current transition-none",
|
|
25
|
+
children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5" })
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { Checkbox };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
const cmdk = require('cmdk');
|
|
6
|
+
const lucideReact = require('lucide-react');
|
|
7
|
+
const utils = require('../lib/utils.cjs');
|
|
8
|
+
require('@radix-ui/react-dialog');
|
|
9
|
+
|
|
10
|
+
function Command({
|
|
11
|
+
className,
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15
|
+
cmdk.Command,
|
|
16
|
+
{
|
|
17
|
+
"data-slot": "command",
|
|
18
|
+
className: utils.cn(
|
|
19
|
+
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
|
|
20
|
+
className
|
|
21
|
+
),
|
|
22
|
+
...props
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function CommandInput({
|
|
27
|
+
className,
|
|
28
|
+
...props
|
|
29
|
+
}) {
|
|
30
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
"data-slot": "command-input-wrapper",
|
|
34
|
+
className: "pointer-events-auto flex h-9 items-center gap-2 border-b px-3",
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
37
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
+
cmdk.Command.Input,
|
|
39
|
+
{
|
|
40
|
+
"data-slot": "command-input",
|
|
41
|
+
className: utils.cn(
|
|
42
|
+
"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",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
...props
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
function CommandList({
|
|
53
|
+
className,
|
|
54
|
+
...props
|
|
55
|
+
}) {
|
|
56
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
57
|
+
cmdk.Command.List,
|
|
58
|
+
{
|
|
59
|
+
"data-slot": "command-list",
|
|
60
|
+
className: utils.cn(
|
|
61
|
+
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
...props
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function CommandEmpty({
|
|
69
|
+
...props
|
|
70
|
+
}) {
|
|
71
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
cmdk.Command.Empty,
|
|
73
|
+
{
|
|
74
|
+
"data-slot": "command-empty",
|
|
75
|
+
className: "py-6 text-center text-sm",
|
|
76
|
+
...props
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
function CommandGroup({
|
|
81
|
+
className,
|
|
82
|
+
...props
|
|
83
|
+
}) {
|
|
84
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
85
|
+
cmdk.Command.Group,
|
|
86
|
+
{
|
|
87
|
+
"data-slot": "command-group",
|
|
88
|
+
className: utils.cn(
|
|
89
|
+
"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",
|
|
90
|
+
className
|
|
91
|
+
),
|
|
92
|
+
...props
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
function CommandItem({
|
|
97
|
+
className,
|
|
98
|
+
...props
|
|
99
|
+
}) {
|
|
100
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
101
|
+
cmdk.Command.Item,
|
|
102
|
+
{
|
|
103
|
+
"data-slot": "command-item",
|
|
104
|
+
className: utils.cn(
|
|
105
|
+
"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",
|
|
106
|
+
className
|
|
107
|
+
),
|
|
108
|
+
...props
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
exports.Command = Command;
|
|
114
|
+
exports.CommandEmpty = CommandEmpty;
|
|
115
|
+
exports.CommandGroup = CommandGroup;
|
|
116
|
+
exports.CommandInput = CommandInput;
|
|
117
|
+
exports.CommandItem = CommandItem;
|
|
118
|
+
exports.CommandList = CommandList;
|