gladvn 0.2.17 → 0.2.19
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/bin/cli.js +9 -6
- package/dist/components/macro/accordion-preset.d.ts.map +1 -1
- package/dist/components/macro/alert-dialog-preset.d.ts.map +1 -1
- package/dist/components/macro/alert-preset.d.ts.map +1 -1
- package/dist/components/macro/avatar-preset.d.ts.map +1 -1
- package/dist/components/macro/breadcrumb-preset.d.ts.map +1 -1
- package/dist/components/macro/card-preset.d.ts.map +1 -1
- package/dist/components/macro/carousel-preset.d.ts.map +1 -1
- package/dist/components/macro/checkbox-preset.d.ts.map +1 -1
- package/dist/components/macro/combobox-preset.d.ts.map +1 -1
- package/dist/components/macro/command-preset.d.ts +1 -1
- package/dist/components/macro/command-preset.d.ts.map +1 -1
- package/dist/components/macro/date-picker.d.ts.map +1 -1
- package/dist/components/macro/dialog-preset.d.ts.map +1 -1
- package/dist/components/macro/empty-preset.d.ts.map +1 -1
- package/dist/components/macro/field-preset.d.ts.map +1 -1
- package/dist/components/macro/input-otp-preset.d.ts +6 -0
- package/dist/components/macro/input-otp-preset.d.ts.map +1 -1
- package/dist/components/macro/input-preset.d.ts +1 -1
- package/dist/components/macro/input-preset.d.ts.map +1 -1
- package/dist/components/macro/pagination-preset.d.ts.map +1 -1
- package/dist/components/macro/progress-preset.d.ts.map +1 -1
- package/dist/components/macro/radio-group-preset.d.ts.map +1 -1
- package/dist/components/macro/select-preset.d.ts.map +1 -1
- package/dist/components/macro/slider-preset.d.ts.map +1 -1
- package/dist/components/macro/switch-preset.d.ts.map +1 -1
- package/dist/components/macro/tabs-preset.d.ts +1 -1
- package/dist/components/macro/tabs-preset.d.ts.map +1 -1
- package/dist/components/macro/textarea-preset.d.ts +1 -1
- package/dist/components/macro/textarea-preset.d.ts.map +1 -1
- package/dist/components/micro/accordion.d.ts +7 -0
- package/dist/components/micro/accordion.d.ts.map +1 -1
- package/dist/components/micro/alert-dialog.d.ts.map +1 -1
- package/dist/components/micro/alert.d.ts +7 -0
- package/dist/components/micro/alert.d.ts.map +1 -1
- package/dist/components/micro/aspect-ratio.d.ts +7 -0
- package/dist/components/micro/aspect-ratio.d.ts.map +1 -1
- package/dist/components/micro/avatar.d.ts.map +1 -1
- package/dist/components/micro/badge.d.ts +8 -1
- package/dist/components/micro/badge.d.ts.map +1 -1
- package/dist/components/micro/breadcrumb.d.ts +7 -0
- package/dist/components/micro/breadcrumb.d.ts.map +1 -1
- package/dist/components/micro/button.d.ts +8 -1
- package/dist/components/micro/button.d.ts.map +1 -1
- package/dist/components/micro/calendar.d.ts +2 -2
- package/dist/components/micro/calendar.d.ts.map +1 -1
- package/dist/components/micro/carousel.d.ts.map +1 -1
- package/dist/components/micro/chart.d.ts.map +1 -1
- package/dist/components/micro/checkbox.d.ts.map +1 -1
- package/dist/components/micro/collapsible.d.ts.map +1 -1
- package/dist/components/micro/combobox.d.ts.map +1 -1
- package/dist/components/micro/command.d.ts.map +1 -1
- package/dist/components/micro/context-menu.d.ts.map +1 -1
- package/dist/components/micro/dialog.d.ts.map +1 -1
- package/dist/components/micro/drawer.d.ts.map +1 -1
- package/dist/components/micro/dropdown-menu.d.ts.map +1 -1
- package/dist/components/micro/empty.d.ts +7 -0
- package/dist/components/micro/empty.d.ts.map +1 -1
- package/dist/components/micro/field.d.ts.map +1 -1
- package/dist/components/micro/hover-card.d.ts +1 -1
- package/dist/components/micro/hover-card.d.ts.map +1 -1
- package/dist/components/micro/input-group.d.ts.map +1 -1
- package/dist/components/micro/input-otp.d.ts.map +1 -1
- package/dist/components/micro/input.d.ts +7 -0
- package/dist/components/micro/input.d.ts.map +1 -1
- package/dist/components/micro/item.d.ts.map +1 -1
- package/dist/components/micro/label.d.ts.map +1 -1
- package/dist/components/micro/menubar.d.ts.map +1 -1
- package/dist/components/micro/navigation-menu.d.ts +8 -1
- package/dist/components/micro/navigation-menu.d.ts.map +1 -1
- package/dist/components/micro/pagination.d.ts.map +1 -1
- package/dist/components/micro/popover.d.ts.map +1 -1
- package/dist/components/micro/progress.d.ts.map +1 -1
- package/dist/components/micro/radio-group.d.ts.map +1 -1
- package/dist/components/micro/select.d.ts +1 -1
- package/dist/components/micro/select.d.ts.map +1 -1
- package/dist/components/micro/sheet.d.ts.map +1 -1
- package/dist/components/micro/sidebar.d.ts.map +1 -1
- package/dist/components/micro/skeleton.d.ts +7 -0
- package/dist/components/micro/skeleton.d.ts.map +1 -1
- package/dist/components/micro/slider.d.ts +7 -0
- package/dist/components/micro/slider.d.ts.map +1 -1
- package/dist/components/micro/sonner.d.ts.map +1 -1
- package/dist/components/micro/spinner.d.ts.map +1 -1
- package/dist/components/micro/switch.d.ts.map +1 -1
- package/dist/components/micro/table.d.ts.map +1 -1
- package/dist/components/micro/tabs.d.ts +1 -1
- package/dist/components/micro/tabs.d.ts.map +1 -1
- package/dist/components/micro/textarea.d.ts +7 -0
- package/dist/components/micro/textarea.d.ts.map +1 -1
- package/dist/components/micro/toggle-group.d.ts.map +1 -1
- package/dist/components/micro/toggle.d.ts.map +1 -1
- package/dist/components/micro/tooltip.d.ts +1 -1
- package/dist/components/micro/tooltip.d.ts.map +1 -1
- package/dist/dev/App.d.ts.map +1 -1
- package/dist/dev/components/code-highlighter.d.ts.map +1 -1
- package/dist/dev/components/dev-context.d.ts.map +1 -1
- package/dist/dev/components/showcase.d.ts +1 -1
- package/dist/dev/components/showcase.d.ts.map +1 -1
- package/dist/dev/data.d.ts.map +1 -1
- package/dist/dev/main.d.ts.map +1 -1
- package/dist/dev/sections/buttons.d.ts.map +1 -1
- package/dist/dev/sections/feedback.d.ts.map +1 -1
- package/dist/dev/sections/overview.d.ts.map +1 -1
- package/dist/dev/showcase/accordion.d.ts.map +1 -1
- package/dist/dev/showcase/alert-dialog.d.ts.map +1 -1
- package/dist/dev/showcase/alert.d.ts.map +1 -1
- package/dist/dev/showcase/aspect-ratio.d.ts.map +1 -1
- package/dist/dev/showcase/avatar.d.ts.map +1 -1
- package/dist/dev/showcase/breadcrumb.d.ts.map +1 -1
- package/dist/dev/showcase/button.d.ts.map +1 -1
- package/dist/dev/showcase/calendar.d.ts.map +1 -1
- package/dist/dev/showcase/card.d.ts.map +1 -1
- package/dist/dev/showcase/carousel.d.ts.map +1 -1
- package/dist/dev/showcase/chart.d.ts.map +1 -1
- package/dist/dev/showcase/checkbox.d.ts.map +1 -1
- package/dist/dev/showcase/collapsible.d.ts.map +1 -1
- package/dist/dev/showcase/combobox.d.ts.map +1 -1
- package/dist/dev/showcase/command.d.ts.map +1 -1
- package/dist/dev/showcase/context-menu.d.ts.map +1 -1
- package/dist/dev/showcase/dialog.d.ts.map +1 -1
- package/dist/dev/showcase/drawer.d.ts.map +1 -1
- package/dist/dev/showcase/dropdown-menu.d.ts.map +1 -1
- package/dist/dev/showcase/empty.d.ts.map +1 -1
- package/dist/dev/showcase/hover-card.d.ts.map +1 -1
- package/dist/dev/showcase/input-group.d.ts.map +1 -1
- package/dist/dev/showcase/input-otp.d.ts.map +1 -1
- package/dist/dev/showcase/input.d.ts.map +1 -1
- package/dist/dev/showcase/item.d.ts.map +1 -1
- package/dist/dev/showcase/kbd.d.ts.map +1 -1
- package/dist/dev/showcase/label.d.ts.map +1 -1
- package/dist/dev/showcase/menubar.d.ts.map +1 -1
- package/dist/dev/showcase/navigation-menu.d.ts.map +1 -1
- package/dist/dev/showcase/overview.d.ts.map +1 -1
- package/dist/dev/showcase/pagination.d.ts.map +1 -1
- package/dist/dev/showcase/popover.d.ts.map +1 -1
- package/dist/dev/showcase/progress.d.ts.map +1 -1
- package/dist/dev/showcase/radio-group.d.ts.map +1 -1
- package/dist/dev/showcase/resizable.d.ts.map +1 -1
- package/dist/dev/showcase/scroll-area.d.ts.map +1 -1
- package/dist/dev/showcase/select.d.ts.map +1 -1
- package/dist/dev/showcase/separator.d.ts.map +1 -1
- package/dist/dev/showcase/sheet.d.ts.map +1 -1
- package/dist/dev/showcase/sidebar.d.ts.map +1 -1
- package/dist/dev/showcase/skeleton.d.ts.map +1 -1
- package/dist/dev/showcase/slider.d.ts.map +1 -1
- package/dist/dev/showcase/sonner.d.ts.map +1 -1
- package/dist/dev/showcase/spinner.d.ts.map +1 -1
- package/dist/dev/showcase/switch.d.ts.map +1 -1
- package/dist/dev/showcase/table.d.ts.map +1 -1
- package/dist/dev/showcase/tabs.d.ts.map +1 -1
- package/dist/dev/showcase/textarea.d.ts.map +1 -1
- package/dist/dev/showcase/theme-provider.d.ts.map +1 -1
- package/dist/dev/showcase/toast.d.ts.map +1 -1
- package/dist/dev/showcase/toggle-group.d.ts.map +1 -1
- package/dist/dev/showcase/toggle.d.ts.map +1 -1
- package/dist/dev/showcase/tooltip.d.ts.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/package.json +3 -1
- package/scripts/format-codestrings.ts +87 -0
- package/scripts/organize-imports.ts +21 -0
- package/scripts/regex-format.cjs +67 -0
- package/scripts/tmp.tsx +25 -0
- package/src/components/macro/accordion-preset.test.tsx +1 -0
- package/src/components/macro/accordion-preset.tsx +2 -1
- package/src/components/macro/alert-dialog-preset.tsx +44 -43
- package/src/components/macro/alert-preset.tsx +7 -3
- package/src/components/macro/avatar-preset.tsx +2 -1
- package/src/components/macro/breadcrumb-preset.tsx +2 -1
- package/src/components/macro/card-preset.tsx +2 -1
- package/src/components/macro/carousel-preset.tsx +5 -2
- package/src/components/macro/checkbox-preset.test.tsx +1 -0
- package/src/components/macro/checkbox-preset.tsx +6 -2
- package/src/components/macro/combobox-preset.tsx +6 -3
- package/src/components/macro/command-preset.tsx +7 -3
- package/src/components/macro/date-picker.tsx +77 -59
- package/src/components/macro/dialog-preset.tsx +42 -38
- package/src/components/macro/empty-preset.tsx +2 -1
- package/src/components/macro/field-preset.test.tsx +1 -0
- package/src/components/macro/field-preset.tsx +2 -1
- package/src/components/macro/input-otp-preset.tsx +6 -2
- package/src/components/macro/input-preset.test.tsx +1 -0
- package/src/components/macro/input-preset.tsx +4 -2
- package/src/components/macro/pagination-preset.tsx +3 -1
- package/src/components/macro/progress-preset.test.tsx +1 -0
- package/src/components/macro/progress-preset.tsx +2 -1
- package/src/components/macro/radio-group-preset.tsx +4 -1
- package/src/components/macro/select-preset.tsx +35 -30
- package/src/components/macro/slider-preset.test.tsx +1 -0
- package/src/components/macro/slider-preset.tsx +4 -1
- package/src/components/macro/switch-preset.test.tsx +1 -0
- package/src/components/macro/switch-preset.tsx +4 -1
- package/src/components/macro/tabs-preset.test.tsx +1 -0
- package/src/components/macro/tabs-preset.tsx +4 -2
- package/src/components/macro/textarea-preset.test.tsx +1 -0
- package/src/components/macro/textarea-preset.tsx +4 -1
- package/src/components/micro/accordion.tsx +3 -2
- package/src/components/micro/alert-dialog.tsx +2 -1
- package/src/components/micro/alert.tsx +3 -2
- package/src/components/micro/aspect-ratio.tsx +2 -1
- package/src/components/micro/avatar.tsx +2 -1
- package/src/components/micro/badge.tsx +3 -3
- package/src/components/micro/breadcrumb.tsx +3 -2
- package/src/components/micro/button.test.tsx +1 -0
- package/src/components/micro/button.tsx +3 -3
- package/src/components/micro/calendar.tsx +10 -9
- package/src/components/micro/carousel.tsx +3 -2
- package/src/components/micro/chart.tsx +1 -0
- package/src/components/micro/checkbox.tsx +2 -2
- package/src/components/micro/collapsible.tsx +4 -2
- package/src/components/micro/combobox.tsx +41 -29
- package/src/components/micro/command.tsx +23 -16
- package/src/components/micro/context-menu.tsx +3 -2
- package/src/components/micro/dialog.tsx +2 -1
- package/src/components/micro/drawer.tsx +2 -1
- package/src/components/micro/dropdown-menu.tsx +3 -2
- package/src/components/micro/empty.tsx +2 -1
- package/src/components/micro/field.tsx +4 -3
- package/src/components/micro/hover-card.tsx +20 -19
- package/src/components/micro/input-group.tsx +2 -1
- package/src/components/micro/input-otp.tsx +3 -2
- package/src/components/micro/input.tsx +3 -2
- package/src/components/micro/item.tsx +1 -0
- package/src/components/micro/label.tsx +2 -1
- package/src/components/micro/menubar.tsx +2 -1
- package/src/components/micro/navigation-menu.tsx +18 -17
- package/src/components/micro/pagination.tsx +2 -1
- package/src/components/micro/popover.tsx +2 -1
- package/src/components/micro/progress.tsx +2 -1
- package/src/components/micro/radio-group.tsx +3 -3
- package/src/components/micro/select.tsx +5 -4
- package/src/components/micro/sheet.tsx +2 -1
- package/src/components/micro/sidebar.tsx +4 -1
- package/src/components/micro/skeleton.tsx +2 -1
- package/src/components/micro/slider.tsx +4 -1
- package/src/components/micro/sonner.tsx +2 -1
- package/src/components/micro/spinner.tsx +1 -2
- package/src/components/micro/switch.tsx +2 -2
- package/src/components/micro/table.tsx +2 -1
- package/src/components/micro/tabs.tsx +4 -3
- package/src/components/micro/textarea.tsx +2 -1
- package/src/components/micro/toggle-group.tsx +1 -0
- package/src/components/micro/toggle.tsx +1 -3
- package/src/components/micro/tooltip.tsx +9 -3
- package/src/dev/App.tsx +66 -41
- package/src/dev/components/code-highlighter.tsx +2 -1
- package/src/dev/components/dev-context.tsx +1 -0
- package/src/dev/components/showcase.tsx +13 -14
- package/src/dev/data.ts +206 -52
- package/src/dev/main.tsx +4 -4
- package/src/dev/sections/buttons.tsx +14 -12
- package/src/dev/sections/feedback.tsx +7 -2
- package/src/dev/sections/forms.tsx +11 -11
- package/src/dev/sections/overview.tsx +2 -1
- package/src/dev/showcase/accordion.tsx +399 -314
- package/src/dev/showcase/alert-dialog.tsx +387 -384
- package/src/dev/showcase/alert.tsx +271 -258
- package/src/dev/showcase/aspect-ratio.tsx +102 -105
- package/src/dev/showcase/avatar.tsx +216 -145
- package/src/dev/showcase/badge.tsx +78 -50
- package/src/dev/showcase/breadcrumb.tsx +88 -85
- package/src/dev/showcase/button.tsx +72 -96
- package/src/dev/showcase/calendar.tsx +41 -39
- package/src/dev/showcase/card.tsx +170 -148
- package/src/dev/showcase/carousel.tsx +239 -77
- package/src/dev/showcase/chart.tsx +5 -4
- package/src/dev/showcase/checkbox.tsx +206 -140
- package/src/dev/showcase/collapsible.tsx +108 -84
- package/src/dev/showcase/combobox.tsx +272 -199
- package/src/dev/showcase/command.tsx +31 -28
- package/src/dev/showcase/context-menu.tsx +94 -77
- package/src/dev/showcase/dialog.tsx +445 -424
- package/src/dev/showcase/drawer.tsx +142 -135
- package/src/dev/showcase/dropdown-menu.tsx +165 -161
- package/src/dev/showcase/empty.tsx +173 -158
- package/src/dev/showcase/hover-card.tsx +92 -52
- package/src/dev/showcase/input-group.tsx +193 -160
- package/src/dev/showcase/input-otp.tsx +109 -99
- package/src/dev/showcase/input.tsx +78 -42
- package/src/dev/showcase/item.tsx +101 -98
- package/src/dev/showcase/kbd.tsx +78 -62
- package/src/dev/showcase/label.tsx +16 -23
- package/src/dev/showcase/menubar.tsx +274 -251
- package/src/dev/showcase/navigation-menu.tsx +175 -170
- package/src/dev/showcase/overview.tsx +164 -148
- package/src/dev/showcase/pagination.tsx +101 -69
- package/src/dev/showcase/popover.tsx +113 -86
- package/src/dev/showcase/progress.tsx +99 -69
- package/src/dev/showcase/radio-group.tsx +217 -134
- package/src/dev/showcase/resizable.tsx +65 -55
- package/src/dev/showcase/scroll-area.tsx +32 -22
- package/src/dev/showcase/select.tsx +192 -136
- package/src/dev/showcase/separator.tsx +28 -24
- package/src/dev/showcase/sheet.tsx +182 -134
- package/src/dev/showcase/sidebar.tsx +9 -5
- package/src/dev/showcase/skeleton.tsx +54 -59
- package/src/dev/showcase/slider.tsx +158 -129
- package/src/dev/showcase/sonner.tsx +3 -5
- package/src/dev/showcase/spinner.tsx +22 -18
- package/src/dev/showcase/switch.tsx +207 -110
- package/src/dev/showcase/table.tsx +44 -32
- package/src/dev/showcase/tabs.tsx +272 -267
- package/src/dev/showcase/textarea.tsx +162 -116
- package/src/dev/showcase/theme-provider.tsx +596 -534
- package/src/dev/showcase/toast.tsx +37 -38
- package/src/dev/showcase/toggle-group.tsx +87 -39
- package/src/dev/showcase/toggle.tsx +36 -27
- package/src/dev/showcase/tooltip.tsx +154 -119
- package/src/lib/utils.test.ts +1 -0
- package/src/lib/utils.ts +1 -1
- package/src/styles/gladvn.css +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
3
5
|
import { cva } from "class-variance-authority";
|
|
4
6
|
import { CalendarIcon } from "lucide-react";
|
|
5
|
-
import * as React from "react";
|
|
6
7
|
import { type DateRange, type Locale, type Matcher } from "react-day-picker";
|
|
7
8
|
|
|
8
9
|
import { Button } from "../../components/micro/button";
|
|
@@ -10,8 +11,8 @@ import { Calendar } from "../../components/micro/calendar";
|
|
|
10
11
|
import {
|
|
11
12
|
Popover,
|
|
12
13
|
PopoverContent,
|
|
13
|
-
PopoverTrigger,
|
|
14
14
|
PopoverPortal,
|
|
15
|
+
PopoverTrigger,
|
|
15
16
|
} from "../../components/micro/popover";
|
|
16
17
|
import { ThemeWrapper } from "../../components/micro/theme-provider";
|
|
17
18
|
import { type Size } from "../../lib/types";
|
|
@@ -106,8 +107,11 @@ const triggerVariants = cva(
|
|
|
106
107
|
// Helpers
|
|
107
108
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
108
109
|
|
|
109
|
-
const fmt = (
|
|
110
|
-
|
|
110
|
+
const fmt = (
|
|
111
|
+
date: Date,
|
|
112
|
+
opts: Intl.DateTimeFormatOptions,
|
|
113
|
+
localeCode?: string,
|
|
114
|
+
) => new Intl.DateTimeFormat(localeCode ?? "en-US", opts).format(date);
|
|
111
115
|
|
|
112
116
|
function formatTriggerLabel(
|
|
113
117
|
mode: "single" | "range",
|
|
@@ -118,13 +122,25 @@ function formatTriggerLabel(
|
|
|
118
122
|
): string {
|
|
119
123
|
if (mode === "single") {
|
|
120
124
|
return value
|
|
121
|
-
? fmt(
|
|
125
|
+
? fmt(
|
|
126
|
+
value,
|
|
127
|
+
{ month: "short", day: "numeric", year: "numeric" },
|
|
128
|
+
localeCode,
|
|
129
|
+
)
|
|
122
130
|
: placeholder;
|
|
123
131
|
}
|
|
124
132
|
if (!rangeValue?.from) return placeholder;
|
|
125
|
-
const fromStr = fmt(
|
|
133
|
+
const fromStr = fmt(
|
|
134
|
+
rangeValue.from,
|
|
135
|
+
{ month: "short", day: "numeric" },
|
|
136
|
+
localeCode,
|
|
137
|
+
);
|
|
126
138
|
if (!rangeValue.to) return `${fromStr} – ...`;
|
|
127
|
-
const toStr = fmt(
|
|
139
|
+
const toStr = fmt(
|
|
140
|
+
rangeValue.to,
|
|
141
|
+
{ month: "short", day: "numeric", year: "numeric" },
|
|
142
|
+
localeCode,
|
|
143
|
+
);
|
|
128
144
|
return `${fromStr} – ${toStr}`;
|
|
129
145
|
}
|
|
130
146
|
|
|
@@ -214,7 +230,9 @@ const DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(
|
|
|
214
230
|
)}
|
|
215
231
|
>
|
|
216
232
|
<CalendarIcon />
|
|
217
|
-
<span className="flex-1 truncate text-left min-w-0">
|
|
233
|
+
<span className="flex-1 truncate text-left min-w-0">
|
|
234
|
+
{triggerLabel}
|
|
235
|
+
</span>
|
|
218
236
|
</PopoverTrigger>
|
|
219
237
|
<PopoverPortal>
|
|
220
238
|
<ThemeWrapper>
|
|
@@ -224,57 +242,57 @@ const DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(
|
|
|
224
242
|
sideOffset={4}
|
|
225
243
|
className="p-0 w-auto"
|
|
226
244
|
>
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
245
|
+
{mode === "single" ? (
|
|
246
|
+
<Calendar
|
|
247
|
+
mode="single"
|
|
248
|
+
size={size}
|
|
249
|
+
locale={locale}
|
|
250
|
+
numberOfMonths={numberOfMonths}
|
|
251
|
+
captionLayout={captionLayout}
|
|
252
|
+
disabled={disabledDates}
|
|
253
|
+
startMonth={startMonth}
|
|
254
|
+
endMonth={endMonth}
|
|
255
|
+
defaultMonth={defaultMonth ?? value}
|
|
256
|
+
selected={tempValue}
|
|
257
|
+
onSelect={setTempValue}
|
|
258
|
+
/>
|
|
259
|
+
) : (
|
|
260
|
+
<Calendar
|
|
261
|
+
mode="range"
|
|
262
|
+
size={size}
|
|
263
|
+
locale={locale}
|
|
264
|
+
numberOfMonths={numberOfMonths ?? 1}
|
|
265
|
+
captionLayout={captionLayout}
|
|
266
|
+
disabled={disabledDates}
|
|
267
|
+
startMonth={startMonth}
|
|
268
|
+
endMonth={endMonth}
|
|
269
|
+
defaultMonth={defaultMonth ?? rangeValue?.from}
|
|
270
|
+
selected={tempRangeValue}
|
|
271
|
+
onSelect={setTempRangeValue}
|
|
272
|
+
/>
|
|
273
|
+
)}
|
|
274
|
+
<div className="flex items-center justify-end gap-2 px-3 pb-3 pt-1">
|
|
275
|
+
<Button
|
|
276
|
+
variant="outline"
|
|
277
|
+
size={size}
|
|
278
|
+
onClick={() => setOpen(false)}
|
|
279
|
+
>
|
|
280
|
+
Huỷ
|
|
281
|
+
</Button>
|
|
282
|
+
<Button
|
|
283
|
+
size={size}
|
|
284
|
+
onClick={() => {
|
|
285
|
+
if (mode === "single") {
|
|
286
|
+
onValueChange?.(tempValue);
|
|
287
|
+
} else {
|
|
288
|
+
onRangeChange?.(tempRangeValue);
|
|
289
|
+
}
|
|
290
|
+
setOpen(false);
|
|
291
|
+
}}
|
|
292
|
+
>
|
|
293
|
+
Xác nhận
|
|
294
|
+
</Button>
|
|
295
|
+
</div>
|
|
278
296
|
</PopoverContent>
|
|
279
297
|
</ThemeWrapper>
|
|
280
298
|
</PopoverPortal>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
import { XIcon } from "lucide-react";
|
|
6
|
+
|
|
3
7
|
import { Button } from "../../components/micro/button";
|
|
4
8
|
import {
|
|
5
9
|
Dialog,
|
|
@@ -8,15 +12,13 @@ import {
|
|
|
8
12
|
DialogDescription,
|
|
9
13
|
DialogFooter,
|
|
10
14
|
DialogHeader,
|
|
15
|
+
DialogPortal,
|
|
11
16
|
DialogTitle,
|
|
12
17
|
DialogTrigger,
|
|
13
|
-
DialogPortal,
|
|
14
18
|
} from "../../components/micro/dialog";
|
|
15
19
|
import { ThemeWrapper } from "../../components/micro/theme-provider";
|
|
16
20
|
import { type Size } from "../../lib/types";
|
|
17
21
|
import { cn } from "../../lib/utils";
|
|
18
|
-
import { XIcon } from "lucide-react";
|
|
19
|
-
import * as React from "react";
|
|
20
22
|
|
|
21
23
|
type DialogPresetProps = Omit<
|
|
22
24
|
React.ComponentProps<typeof Dialog>,
|
|
@@ -52,45 +54,47 @@ const DialogPreset = React.forwardRef<HTMLDivElement, DialogPresetProps>(
|
|
|
52
54
|
<ThemeWrapper>
|
|
53
55
|
<DialogContent
|
|
54
56
|
ref={ref}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
className={cn(
|
|
58
|
+
size === "sm" && "sm:max-w-md",
|
|
59
|
+
size === "md" && "sm:max-w-lg",
|
|
60
|
+
size === "lg" && "sm:max-w-xl",
|
|
61
|
+
"flex flex-col gap-0 p-0 overflow-hidden",
|
|
62
|
+
)}
|
|
63
|
+
>
|
|
64
|
+
{(title || description) && (
|
|
65
|
+
<DialogHeader className="shrink-0 p-4 pb-0">
|
|
66
|
+
{title && <DialogTitle>{title}</DialogTitle>}
|
|
67
|
+
{description && (
|
|
68
|
+
<DialogDescription>{description}</DialogDescription>
|
|
69
|
+
)}
|
|
70
|
+
</DialogHeader>
|
|
67
71
|
)}
|
|
68
|
-
</DialogHeader>
|
|
69
|
-
)}
|
|
70
72
|
|
|
71
|
-
|
|
73
|
+
<div className="flex-1 min-h-0 overflow-y-auto p-4">
|
|
74
|
+
{children}
|
|
75
|
+
</div>
|
|
72
76
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
{footer && (
|
|
78
|
+
<DialogFooter className="shrink-0 rounded-b-xl border-t border-t-border bg-muted/50 p-4">
|
|
79
|
+
{footer}
|
|
80
|
+
</DialogFooter>
|
|
81
|
+
)}
|
|
78
82
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
83
|
+
{showCloseButton && (
|
|
84
|
+
<DialogClose
|
|
85
|
+
render={
|
|
86
|
+
<Button
|
|
87
|
+
variant="ghost"
|
|
88
|
+
className="absolute top-2 right-2"
|
|
89
|
+
size="sm"
|
|
90
|
+
iconOnly
|
|
91
|
+
/>
|
|
92
|
+
}
|
|
93
|
+
>
|
|
94
|
+
<XIcon />
|
|
95
|
+
<span className="sr-only">Close</span>
|
|
96
|
+
</DialogClose>
|
|
97
|
+
)}
|
|
94
98
|
</DialogContent>
|
|
95
99
|
</ThemeWrapper>
|
|
96
100
|
</DialogPortal>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
Empty,
|
|
3
5
|
EmptyAction,
|
|
@@ -8,7 +10,6 @@ import {
|
|
|
8
10
|
EmptyTitle,
|
|
9
11
|
} from "../../components/micro/empty";
|
|
10
12
|
import { cn } from "../../lib/utils";
|
|
11
|
-
import * as React from "react";
|
|
12
13
|
|
|
13
14
|
type EmptyPresetProps = {
|
|
14
15
|
icon?: React.ReactNode;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
Field,
|
|
3
5
|
FieldContent,
|
|
@@ -6,7 +8,6 @@ import {
|
|
|
6
8
|
FieldLabel,
|
|
7
9
|
} from "../../components/micro/field";
|
|
8
10
|
import { type Size } from "../../lib/types";
|
|
9
|
-
import * as React from "react";
|
|
10
11
|
|
|
11
12
|
export type FieldPresetProps = Omit<
|
|
12
13
|
React.ComponentProps<typeof Field>,
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* ✅ STABLE
|
|
3
5
|
* - Full Utilization of Micro Components
|
|
4
6
|
* - Custom Layout & Groups
|
|
5
7
|
* - Form Control Integration
|
|
6
8
|
*/
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
|
|
11
|
+
import { MinusIcon } from "lucide-react";
|
|
12
|
+
|
|
7
13
|
import {
|
|
8
14
|
InputOTP,
|
|
9
15
|
InputOTPGroup,
|
|
10
16
|
InputOTPSeparator,
|
|
11
17
|
InputOTPSlot,
|
|
12
18
|
} from "../../components/micro/input-otp";
|
|
13
|
-
import { MinusIcon } from "lucide-react";
|
|
14
|
-
import * as React from "react";
|
|
15
19
|
import { FieldPreset } from "./field-preset";
|
|
16
20
|
|
|
17
21
|
export type InputOTPPresetProps = Omit<
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
|
|
5
|
+
import { EyeIcon, EyeOffIcon } from "lucide-react";
|
|
6
|
+
|
|
3
7
|
import { Input, InputProps } from "../../components/micro/input";
|
|
4
8
|
import {
|
|
5
9
|
InputGroup,
|
|
@@ -8,8 +12,6 @@ import {
|
|
|
8
12
|
InputGroupInput,
|
|
9
13
|
InputGroupText,
|
|
10
14
|
} from "../../components/micro/input-group";
|
|
11
|
-
import { EyeIcon, EyeOffIcon } from "lucide-react";
|
|
12
|
-
import React, { useState } from "react";
|
|
13
15
|
import { FieldPreset } from "./field-preset";
|
|
14
16
|
|
|
15
17
|
export type InputPresetProps = Omit<InputProps, "className"> & {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
|
|
3
5
|
import {
|
|
@@ -9,8 +11,8 @@ import {
|
|
|
9
11
|
PaginationNext,
|
|
10
12
|
PaginationPrevious,
|
|
11
13
|
} from "../../components/micro/pagination";
|
|
12
|
-
import { cn } from "../../lib/utils";
|
|
13
14
|
import type { Size } from "../../lib/types";
|
|
15
|
+
import { cn } from "../../lib/utils";
|
|
14
16
|
|
|
15
17
|
export type PaginationPresetProps = React.ComponentProps<typeof Pagination> & {
|
|
16
18
|
currentPage: number;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
Progress,
|
|
3
5
|
ProgressIndicator,
|
|
@@ -5,7 +7,6 @@ import {
|
|
|
5
7
|
ProgressTrack,
|
|
6
8
|
ProgressValue,
|
|
7
9
|
} from "../../components/micro/progress";
|
|
8
|
-
import * as React from "react";
|
|
9
10
|
|
|
10
11
|
export type ProgressPresetProps = Omit<
|
|
11
12
|
React.ComponentProps<typeof Progress>,
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
1
5
|
import { Label } from "../../components/micro/label";
|
|
2
6
|
import { RadioGroup, RadioGroupItem } from "../../components/micro/radio-group";
|
|
3
7
|
import { type Size } from "../../lib/types";
|
|
4
8
|
import { cn } from "../../lib/utils";
|
|
5
|
-
import * as React from "react";
|
|
6
9
|
import { FieldPreset } from "./field-preset";
|
|
7
10
|
|
|
8
11
|
export interface RadioGroupOption {
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
1
5
|
import {
|
|
2
6
|
Select,
|
|
3
7
|
SelectContent,
|
|
4
8
|
SelectGroup,
|
|
5
9
|
SelectItem,
|
|
6
10
|
SelectLabel,
|
|
11
|
+
SelectPortal,
|
|
7
12
|
SelectTrigger,
|
|
8
13
|
SelectValue,
|
|
9
|
-
SelectPortal,
|
|
10
14
|
} from "../../components/micro/select";
|
|
11
15
|
import { ThemeWrapper } from "../../components/micro/theme-provider";
|
|
12
16
|
import { type Size } from "../../lib/types";
|
|
13
|
-
import * as React from "react";
|
|
14
17
|
import { FieldPreset } from "./field-preset";
|
|
15
18
|
|
|
16
19
|
interface SelectPresetOption {
|
|
@@ -125,34 +128,36 @@ const SelectPreset = React.forwardRef<
|
|
|
125
128
|
groups.get(key)!.push(opt);
|
|
126
129
|
});
|
|
127
130
|
|
|
128
|
-
return Array.from(groups.entries()).map(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
<
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
131
|
+
return Array.from(groups.entries()).map(
|
|
132
|
+
([groupLabel, opts]) => {
|
|
133
|
+
if (groupLabel) {
|
|
134
|
+
return (
|
|
135
|
+
<SelectGroup key={groupLabel}>
|
|
136
|
+
<SelectLabel>{groupLabel}</SelectLabel>
|
|
137
|
+
{opts.map((opt) => (
|
|
138
|
+
<SelectItem
|
|
139
|
+
key={opt.value}
|
|
140
|
+
value={opt.value}
|
|
141
|
+
disabled={opt.disabled}
|
|
142
|
+
>
|
|
143
|
+
{opt.dropdownLabel || opt.label}
|
|
144
|
+
</SelectItem>
|
|
145
|
+
))}
|
|
146
|
+
</SelectGroup>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
// Items without a group
|
|
150
|
+
return opts.map((opt) => (
|
|
151
|
+
<SelectItem
|
|
152
|
+
key={opt.value}
|
|
153
|
+
value={opt.value}
|
|
154
|
+
disabled={opt.disabled}
|
|
155
|
+
>
|
|
156
|
+
{opt.dropdownLabel || opt.label}
|
|
157
|
+
</SelectItem>
|
|
158
|
+
));
|
|
159
|
+
},
|
|
160
|
+
);
|
|
156
161
|
})()}
|
|
157
162
|
</SelectContent>
|
|
158
163
|
</ThemeWrapper>
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
1
5
|
import {
|
|
2
6
|
Slider,
|
|
3
7
|
SliderControl,
|
|
@@ -5,7 +9,6 @@ import {
|
|
|
5
9
|
SliderThumb,
|
|
6
10
|
SliderTrack,
|
|
7
11
|
} from "../../components/micro/slider";
|
|
8
|
-
import * as React from "react";
|
|
9
12
|
import { FieldPreset } from "./field-preset";
|
|
10
13
|
|
|
11
14
|
export type SliderPresetProps = Omit<
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
1
5
|
import {
|
|
2
6
|
Field,
|
|
3
7
|
FieldDescription,
|
|
@@ -6,7 +10,6 @@ import {
|
|
|
6
10
|
} from "../../components/micro/field";
|
|
7
11
|
import { Switch, SwitchThumb } from "../../components/micro/switch";
|
|
8
12
|
import { cn } from "../../lib/utils";
|
|
9
|
-
import * as React from "react";
|
|
10
13
|
|
|
11
14
|
export type SwitchPresetProps = Omit<
|
|
12
15
|
React.ComponentProps<typeof Switch>,
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
|
|
1
5
|
import {
|
|
2
6
|
Tabs,
|
|
3
7
|
TabsContent,
|
|
@@ -5,8 +9,6 @@ import {
|
|
|
5
9
|
TabsTrigger,
|
|
6
10
|
type tabsListVariants,
|
|
7
11
|
} from "../../components/micro/tabs";
|
|
8
|
-
import { type VariantProps } from "class-variance-authority";
|
|
9
|
-
import * as React from "react";
|
|
10
12
|
|
|
11
13
|
export interface TabsPresetItem {
|
|
12
14
|
value: string;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
2
3
|
import React from "react";
|
|
4
|
+
|
|
5
|
+
import { Textarea, TextareaProps } from "../../components/micro/textarea";
|
|
3
6
|
import { FieldPreset } from "./field-preset";
|
|
4
7
|
|
|
5
8
|
export type TextareaPresetProps = Omit<TextareaProps, "className"> & {
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
* - Form Control Parity
|
|
6
6
|
* - CSS Delegated Logic
|
|
7
7
|
*/
|
|
8
|
-
import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion";
|
|
9
8
|
import * as React from "react";
|
|
10
9
|
|
|
11
|
-
import {
|
|
10
|
+
import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion";
|
|
12
11
|
import { ChevronDownIcon } from "lucide-react";
|
|
13
12
|
|
|
13
|
+
import { cn } from "../../lib/utils";
|
|
14
|
+
|
|
14
15
|
const Accordion = React.forwardRef<
|
|
15
16
|
React.ComponentRef<typeof AccordionPrimitive.Root>,
|
|
16
17
|
AccordionPrimitive.Root.Props
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
4
3
|
import * as React from "react";
|
|
5
4
|
|
|
5
|
+
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
6
|
+
|
|
6
7
|
import { Button } from "../../components/micro/button";
|
|
7
8
|
import { type Size } from "../../lib/types";
|
|
8
9
|
import { cn } from "../../lib/utils";
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* - Form Control Parity
|
|
6
6
|
* - CSS Delegated Logic
|
|
7
7
|
*/
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
|
|
8
10
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
9
11
|
import { useRender } from "@base-ui/react/use-render";
|
|
10
|
-
import {
|
|
11
|
-
import * as React from "react";
|
|
12
|
+
import { type VariantProps, cva } from "class-variance-authority";
|
|
12
13
|
|
|
13
14
|
import { cn } from "../../lib/utils";
|
|
14
15
|
|