@mila_studios/mycelia-design-system 0.1.1
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/README.md +187 -0
- package/mycelia-ui.css +5545 -0
- package/package.json +127 -0
- package/packages/ui/dist/components/accordion.d.mts +9 -0
- package/packages/ui/dist/components/accordion.js +74 -0
- package/packages/ui/dist/components/accordion.js.map +1 -0
- package/packages/ui/dist/components/alert-dialog.d.mts +22 -0
- package/packages/ui/dist/components/alert-dialog.js +117 -0
- package/packages/ui/dist/components/alert-dialog.js.map +1 -0
- package/packages/ui/dist/components/alert.d.mts +28 -0
- package/packages/ui/dist/components/alert.js +140 -0
- package/packages/ui/dist/components/alert.js.map +1 -0
- package/packages/ui/dist/components/aspect-ratio.d.mts +7 -0
- package/packages/ui/dist/components/aspect-ratio.js +28 -0
- package/packages/ui/dist/components/aspect-ratio.js.map +1 -0
- package/packages/ui/dist/components/avatar-stack.d.mts +16 -0
- package/packages/ui/dist/components/avatar-stack.js +57 -0
- package/packages/ui/dist/components/avatar-stack.js.map +1 -0
- package/packages/ui/dist/components/avatar.d.mts +16 -0
- package/packages/ui/dist/components/avatar.js +108 -0
- package/packages/ui/dist/components/avatar.js.map +1 -0
- package/packages/ui/dist/components/badge.d.mts +16 -0
- package/packages/ui/dist/components/badge.js +61 -0
- package/packages/ui/dist/components/badge.js.map +1 -0
- package/packages/ui/dist/components/breadcrumb.d.mts +22 -0
- package/packages/ui/dist/components/breadcrumb.js +118 -0
- package/packages/ui/dist/components/breadcrumb.js.map +1 -0
- package/packages/ui/dist/components/button.d.mts +36 -0
- package/packages/ui/dist/components/button.js +204 -0
- package/packages/ui/dist/components/button.js.map +1 -0
- package/packages/ui/dist/components/calendar.d.mts +11 -0
- package/packages/ui/dist/components/calendar.js +27 -0
- package/packages/ui/dist/components/calendar.js.map +1 -0
- package/packages/ui/dist/components/card.d.mts +10 -0
- package/packages/ui/dist/components/card.js +84 -0
- package/packages/ui/dist/components/card.js.map +1 -0
- package/packages/ui/dist/components/carousel.d.mts +35 -0
- package/packages/ui/dist/components/carousel.js +362 -0
- package/packages/ui/dist/components/carousel.js.map +1 -0
- package/packages/ui/dist/components/chart.d.mts +88 -0
- package/packages/ui/dist/components/chart.js +249 -0
- package/packages/ui/dist/components/chart.js.map +1 -0
- package/packages/ui/dist/components/checkbox.d.mts +44 -0
- package/packages/ui/dist/components/checkbox.js +161 -0
- package/packages/ui/dist/components/checkbox.js.map +1 -0
- package/packages/ui/dist/components/combobox.d.mts +45 -0
- package/packages/ui/dist/components/combobox.js +148 -0
- package/packages/ui/dist/components/combobox.js.map +1 -0
- package/packages/ui/dist/components/command-menu.d.mts +88 -0
- package/packages/ui/dist/components/command-menu.js +414 -0
- package/packages/ui/dist/components/command-menu.js.map +1 -0
- package/packages/ui/dist/components/command.d.mts +84 -0
- package/packages/ui/dist/components/command.js +125 -0
- package/packages/ui/dist/components/command.js.map +1 -0
- package/packages/ui/dist/components/data-table.d.mts +23 -0
- package/packages/ui/dist/components/data-table.js +377 -0
- package/packages/ui/dist/components/data-table.js.map +1 -0
- package/packages/ui/dist/components/date-picker.d.mts +28 -0
- package/packages/ui/dist/components/date-picker.js +217 -0
- package/packages/ui/dist/components/date-picker.js.map +1 -0
- package/packages/ui/dist/components/dialog.d.mts +19 -0
- package/packages/ui/dist/components/dialog.js +146 -0
- package/packages/ui/dist/components/dialog.js.map +1 -0
- package/packages/ui/dist/components/drawer.d.mts +20 -0
- package/packages/ui/dist/components/drawer.js +159 -0
- package/packages/ui/dist/components/drawer.js.map +1 -0
- package/packages/ui/dist/components/hover-card.d.mts +9 -0
- package/packages/ui/dist/components/hover-card.js +35 -0
- package/packages/ui/dist/components/hover-card.js.map +1 -0
- package/packages/ui/dist/components/icon-button.d.mts +22 -0
- package/packages/ui/dist/components/icon-button.js +169 -0
- package/packages/ui/dist/components/icon-button.js.map +1 -0
- package/packages/ui/dist/components/input-file.d.mts +12 -0
- package/packages/ui/dist/components/input-file.js +209 -0
- package/packages/ui/dist/components/input-file.js.map +1 -0
- package/packages/ui/dist/components/input-otp.d.mts +85 -0
- package/packages/ui/dist/components/input-otp.js +254 -0
- package/packages/ui/dist/components/input-otp.js.map +1 -0
- package/packages/ui/dist/components/input.d.mts +17 -0
- package/packages/ui/dist/components/input.js +116 -0
- package/packages/ui/dist/components/input.js.map +1 -0
- package/packages/ui/dist/components/label.d.mts +14 -0
- package/packages/ui/dist/components/label.js +40 -0
- package/packages/ui/dist/components/label.js.map +1 -0
- package/packages/ui/dist/components/navigation-menu.d.mts +20 -0
- package/packages/ui/dist/components/navigation-menu.js +136 -0
- package/packages/ui/dist/components/navigation-menu.js.map +1 -0
- package/packages/ui/dist/components/pagination.d.mts +27 -0
- package/packages/ui/dist/components/pagination.js +159 -0
- package/packages/ui/dist/components/pagination.js.map +1 -0
- package/packages/ui/dist/components/popover.d.mts +9 -0
- package/packages/ui/dist/components/popover.js +34 -0
- package/packages/ui/dist/components/popover.js.map +1 -0
- package/packages/ui/dist/components/progress.d.mts +13 -0
- package/packages/ui/dist/components/progress.js +44 -0
- package/packages/ui/dist/components/progress.js.map +1 -0
- package/packages/ui/dist/components/radio-group.d.mts +42 -0
- package/packages/ui/dist/components/radio-group.js +125 -0
- package/packages/ui/dist/components/radio-group.js.map +1 -0
- package/packages/ui/dist/components/resizable.d.mts +9 -0
- package/packages/ui/dist/components/resizable.js +70 -0
- package/packages/ui/dist/components/resizable.js.map +1 -0
- package/packages/ui/dist/components/scroll-area.d.mts +15 -0
- package/packages/ui/dist/components/scroll-area.js +70 -0
- package/packages/ui/dist/components/scroll-area.js.map +1 -0
- package/packages/ui/dist/components/separator.d.mts +27 -0
- package/packages/ui/dist/components/separator.js +81 -0
- package/packages/ui/dist/components/separator.js.map +1 -0
- package/packages/ui/dist/components/sheet.d.mts +26 -0
- package/packages/ui/dist/components/sheet.js +158 -0
- package/packages/ui/dist/components/sheet.js.map +1 -0
- package/packages/ui/dist/components/sidebar.d.mts +63 -0
- package/packages/ui/dist/components/sidebar.js +271 -0
- package/packages/ui/dist/components/sidebar.js.map +1 -0
- package/packages/ui/dist/components/skeleton.d.mts +13 -0
- package/packages/ui/dist/components/skeleton.js +34 -0
- package/packages/ui/dist/components/skeleton.js.map +1 -0
- package/packages/ui/dist/components/slider.d.mts +7 -0
- package/packages/ui/dist/components/slider.js +70 -0
- package/packages/ui/dist/components/slider.js.map +1 -0
- package/packages/ui/dist/components/sonner.d.mts +8 -0
- package/packages/ui/dist/components/sonner.js +112 -0
- package/packages/ui/dist/components/sonner.js.map +1 -0
- package/packages/ui/dist/components/spinner.d.mts +6 -0
- package/packages/ui/dist/components/spinner.js +44 -0
- package/packages/ui/dist/components/spinner.js.map +1 -0
- package/packages/ui/dist/components/switch.d.mts +43 -0
- package/packages/ui/dist/components/switch.js +136 -0
- package/packages/ui/dist/components/switch.js.map +1 -0
- package/packages/ui/dist/components/table.d.mts +16 -0
- package/packages/ui/dist/components/table.js +115 -0
- package/packages/ui/dist/components/table.js.map +1 -0
- package/packages/ui/dist/components/tabs.d.mts +17 -0
- package/packages/ui/dist/components/tabs.js +104 -0
- package/packages/ui/dist/components/tabs.js.map +1 -0
- package/packages/ui/dist/components/textarea.d.mts +12 -0
- package/packages/ui/dist/components/textarea.js +76 -0
- package/packages/ui/dist/components/textarea.js.map +1 -0
- package/packages/ui/dist/components/tooltip.d.mts +17 -0
- package/packages/ui/dist/components/tooltip.js +46 -0
- package/packages/ui/dist/components/tooltip.js.map +1 -0
- package/packages/ui/dist/lib/utils.d.mts +5 -0
- package/packages/ui/dist/lib/utils.js +11 -0
- package/packages/ui/dist/lib/utils.js.map +1 -0
- package/packages/ui/dist/mycelia-ui.css +5545 -0
- package/packages/ui/postcss.config.mjs +6 -0
- package/packages/ui/src/styles/bundle-entry.css +2 -0
- package/packages/ui/src/styles/globals.css +651 -0
- package/scripts/prepare-build.mjs +32 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import * as React2 from 'react';
|
|
2
|
+
import { format } from 'date-fns';
|
|
3
|
+
import { ChevronsUpDown, Calendar as Calendar$1 } from 'lucide-react';
|
|
4
|
+
import { DayPicker } from 'react-day-picker';
|
|
5
|
+
import { clsx } from 'clsx';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
7
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
|
+
import { cva } from 'class-variance-authority';
|
|
9
|
+
import { Popover as Popover$1 } from 'radix-ui';
|
|
10
|
+
|
|
11
|
+
function cn(...inputs) {
|
|
12
|
+
return twMerge(clsx(inputs));
|
|
13
|
+
}
|
|
14
|
+
function Calendar({ className, showOutsideDays = true, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
DayPicker,
|
|
17
|
+
{
|
|
18
|
+
showOutsideDays,
|
|
19
|
+
"data-slot": "calendar",
|
|
20
|
+
className: cn(
|
|
21
|
+
"mila-daypicker rounded-lg border border-solid border-[color:var(--mila-combobox-menu-border)] bg-[color:var(--mila-combobox-menu-bg)] p-3 shadow-[var(--mila-combobox-menu-shadow)]",
|
|
22
|
+
className
|
|
23
|
+
),
|
|
24
|
+
...props
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
Calendar.displayName = "Calendar";
|
|
29
|
+
var Popover = Popover$1.Root;
|
|
30
|
+
var PopoverTrigger = Popover$1.Trigger;
|
|
31
|
+
Popover$1.Anchor;
|
|
32
|
+
var PopoverContent = React2.forwardRef(function PopoverContent2({ className, align = "center", sideOffset = 4, collisionPadding = 8, ...props }, ref) {
|
|
33
|
+
return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(
|
|
34
|
+
Popover$1.Content,
|
|
35
|
+
{
|
|
36
|
+
ref,
|
|
37
|
+
"data-slot": "popover-content",
|
|
38
|
+
align,
|
|
39
|
+
sideOffset,
|
|
40
|
+
collisionPadding,
|
|
41
|
+
className: cn(
|
|
42
|
+
"z-50 w-72 rounded-lg border border-solid border-[color:var(--mila-combobox-menu-border)] bg-[color:var(--mila-combobox-menu-bg)] p-4 text-foreground shadow-[var(--mila-combobox-menu-shadow)] outline-none",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
...props
|
|
46
|
+
}
|
|
47
|
+
) });
|
|
48
|
+
});
|
|
49
|
+
PopoverContent.displayName = "PopoverContent";
|
|
50
|
+
var comboboxTriggerVariants = cva(
|
|
51
|
+
[
|
|
52
|
+
"flex w-full min-w-0 cursor-pointer items-center gap-2 border border-solid bg-background text-left font-sans font-medium outline-none",
|
|
53
|
+
"shadow-[0_1px_2px_0_rgba(0,0,0,0.05)] transition-[border-color,box-shadow,color]",
|
|
54
|
+
"border-[color:var(--mila-input-border)]",
|
|
55
|
+
"focus-visible:border-[color:var(--mila-input-border-focus)] focus-visible:ring-[3px] focus-visible:ring-[color:var(--mila-input-ring-focus)]",
|
|
56
|
+
"focus-visible:text-[color:var(--mila-input-text-focus)]",
|
|
57
|
+
"disabled:pointer-events-none disabled:border-[color:var(--mila-input-border)] disabled:bg-[color:var(--mila-input-bg-disabled)] disabled:text-[color:var(--mila-input-text-disabled)] disabled:opacity-50",
|
|
58
|
+
"aria-invalid:border-[color:var(--mila-input-border-error)] aria-invalid:focus-visible:ring-[color:var(--mila-input-ring-error)]"
|
|
59
|
+
],
|
|
60
|
+
{
|
|
61
|
+
variants: {
|
|
62
|
+
size: {
|
|
63
|
+
mini: "min-h-6 gap-1 rounded-[4px] px-1.5 py-0.5",
|
|
64
|
+
sm: "min-h-8 gap-1.5 rounded-lg px-2 py-[5.5px]",
|
|
65
|
+
default: "min-h-9 gap-2 rounded-lg px-3 py-[7.5px]",
|
|
66
|
+
lg: "min-h-10 gap-2 rounded-lg px-4 py-[9.5px]"
|
|
67
|
+
},
|
|
68
|
+
lines: {
|
|
69
|
+
1: "",
|
|
70
|
+
2: ""
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
compoundVariants: [
|
|
74
|
+
{ lines: 2, size: "lg", class: "min-h-[58px] items-start py-2" },
|
|
75
|
+
{ lines: 2, size: "default", class: "min-h-[54px] items-start py-2" },
|
|
76
|
+
{ lines: 2, size: "sm", class: "min-h-[50px] items-start py-1.5" },
|
|
77
|
+
{ lines: 2, size: "mini", class: "min-h-[45px] items-start py-1.5" }
|
|
78
|
+
],
|
|
79
|
+
defaultVariants: {
|
|
80
|
+
size: "default",
|
|
81
|
+
lines: 1
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
var valueTextClass = "truncate text-sm leading-normal tracking-[0.07px] text-[color:var(--mila-input-text-value)]";
|
|
86
|
+
var placeholderTextClass = "truncate text-sm leading-normal tracking-[0.07px] text-[color:var(--mila-input-placeholder)]";
|
|
87
|
+
var descriptionTextClass = "truncate text-xs font-normal leading-normal tracking-[0.18px] text-[color:var(--mila-combobox-item-muted)]";
|
|
88
|
+
var ComboboxTrigger = React2.forwardRef(
|
|
89
|
+
function ComboboxTrigger2({
|
|
90
|
+
className,
|
|
91
|
+
size = "default",
|
|
92
|
+
lines = 1,
|
|
93
|
+
placeholder = "Select an item",
|
|
94
|
+
displayValue,
|
|
95
|
+
prepend,
|
|
96
|
+
leading,
|
|
97
|
+
description,
|
|
98
|
+
invalid,
|
|
99
|
+
disabled,
|
|
100
|
+
type = "button",
|
|
101
|
+
"aria-invalid": ariaInvalidProp,
|
|
102
|
+
children,
|
|
103
|
+
...props
|
|
104
|
+
}, ref) {
|
|
105
|
+
const hasValue = displayValue != null && displayValue !== "" && !(typeof displayValue === "string" && displayValue.trim() === "");
|
|
106
|
+
const ariaInvalid = invalid === true || ariaInvalidProp === true || ariaInvalidProp === "true";
|
|
107
|
+
return /* @__PURE__ */ jsxs(
|
|
108
|
+
"button",
|
|
109
|
+
{
|
|
110
|
+
ref,
|
|
111
|
+
type,
|
|
112
|
+
role: "combobox",
|
|
113
|
+
disabled,
|
|
114
|
+
"data-slot": "combobox-trigger",
|
|
115
|
+
"data-size": size,
|
|
116
|
+
"data-lines": lines,
|
|
117
|
+
"aria-invalid": ariaInvalid || void 0,
|
|
118
|
+
className: cn(comboboxTriggerVariants({ size, lines }), className),
|
|
119
|
+
...props,
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5 text-left", children: [
|
|
122
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
123
|
+
leading ? /* @__PURE__ */ jsx("span", { className: "shrink-0", children: leading }) : null,
|
|
124
|
+
prepend ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-sm font-medium tracking-[0.07px] text-[color:var(--mila-input-placeholder)]", children: prepend }) : null,
|
|
125
|
+
/* @__PURE__ */ jsx("span", { className: cn("min-w-0 flex-1", hasValue ? valueTextClass : placeholderTextClass), children: children ?? (hasValue ? displayValue : placeholder) })
|
|
126
|
+
] }),
|
|
127
|
+
lines === 2 && description ? /* @__PURE__ */ jsx("span", { className: cn(descriptionTextClass, "ps-0"), children: description }) : null
|
|
128
|
+
] }),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
ChevronsUpDown,
|
|
131
|
+
{
|
|
132
|
+
className: cn(
|
|
133
|
+
"size-4 shrink-0 text-[color:var(--mila-input-placeholder)]",
|
|
134
|
+
lines === 2 && "self-center"
|
|
135
|
+
),
|
|
136
|
+
"aria-hidden": true
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
ComboboxTrigger.displayName = "ComboboxTrigger";
|
|
145
|
+
var ComboboxContent = React2.forwardRef(function ComboboxContent2({ className, align = "start", sideOffset = 4, ...props }, ref) {
|
|
146
|
+
return /* @__PURE__ */ jsx(
|
|
147
|
+
PopoverContent,
|
|
148
|
+
{
|
|
149
|
+
ref,
|
|
150
|
+
"data-slot": "combobox-content",
|
|
151
|
+
align,
|
|
152
|
+
sideOffset,
|
|
153
|
+
className: cn(
|
|
154
|
+
"w-[var(--radix-popover-trigger-width)] max-w-[min(100vw-2rem,320px)] min-w-[var(--radix-popover-trigger-width)] p-0",
|
|
155
|
+
className
|
|
156
|
+
),
|
|
157
|
+
...props
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
});
|
|
161
|
+
ComboboxContent.displayName = "ComboboxContent";
|
|
162
|
+
var valueTextClass2 = "truncate text-sm leading-normal tracking-[0.07px] text-[color:var(--mila-input-text-value)]";
|
|
163
|
+
var placeholderTextClass2 = "truncate text-sm leading-normal tracking-[0.07px] text-[color:var(--mila-input-placeholder)]";
|
|
164
|
+
function DatePicker({
|
|
165
|
+
value,
|
|
166
|
+
onChange,
|
|
167
|
+
placeholder = "Pick a date",
|
|
168
|
+
dateFormat = "PPP",
|
|
169
|
+
size = "default",
|
|
170
|
+
disabled,
|
|
171
|
+
invalid,
|
|
172
|
+
className,
|
|
173
|
+
align = "start"
|
|
174
|
+
}) {
|
|
175
|
+
const [open, setOpen] = React2.useState(false);
|
|
176
|
+
const ariaInvalid = invalid === true ? true : void 0;
|
|
177
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
178
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
179
|
+
"button",
|
|
180
|
+
{
|
|
181
|
+
type: "button",
|
|
182
|
+
role: "combobox",
|
|
183
|
+
"aria-expanded": open,
|
|
184
|
+
"aria-invalid": ariaInvalid,
|
|
185
|
+
disabled,
|
|
186
|
+
"data-slot": "date-picker-trigger",
|
|
187
|
+
"data-size": size,
|
|
188
|
+
className: cn(
|
|
189
|
+
comboboxTriggerVariants({ size, lines: 1 }),
|
|
190
|
+
"justify-between",
|
|
191
|
+
className
|
|
192
|
+
),
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ jsx("span", { className: cn("min-w-0 flex-1 text-left", value ? valueTextClass2 : placeholderTextClass2), children: value ? format(value, dateFormat) : placeholder }),
|
|
195
|
+
/* @__PURE__ */ jsx(Calendar$1, { className: "size-4 shrink-0 text-[color:var(--mila-input-placeholder)]", "aria-hidden": true })
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
) }),
|
|
199
|
+
/* @__PURE__ */ jsx(PopoverContent, { align, className: "w-auto p-0", "data-slot": "date-picker-content", children: /* @__PURE__ */ jsx(
|
|
200
|
+
Calendar,
|
|
201
|
+
{
|
|
202
|
+
mode: "single",
|
|
203
|
+
selected: value,
|
|
204
|
+
onSelect: (d) => {
|
|
205
|
+
onChange?.(d);
|
|
206
|
+
setOpen(false);
|
|
207
|
+
},
|
|
208
|
+
defaultMonth: value
|
|
209
|
+
}
|
|
210
|
+
) })
|
|
211
|
+
] });
|
|
212
|
+
}
|
|
213
|
+
DatePicker.displayName = "DatePicker";
|
|
214
|
+
|
|
215
|
+
export { DatePicker };
|
|
216
|
+
//# sourceMappingURL=date-picker.js.map
|
|
217
|
+
//# sourceMappingURL=date-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/calendar.tsx","../../src/components/popover.tsx","../../src/components/combobox.tsx","../../src/components/date-picker.tsx"],"names":["PopoverPrimitive","React","PopoverContent","jsx","ComboboxTrigger","ComboboxContent","valueTextClass","placeholderTextClass","React3","jsxs","CalendarIcon"],"mappings":";;;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACIA,SAAS,SAAS,EAAE,SAAA,EAAW,kBAAkB,IAAA,EAAM,GAAG,OAAM,EAAkB;AAChF,EAAA,uBACE,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,eAAA;AAAA,MACA,WAAA,EAAU,UAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,qLAAA;AAAA,QACA;AAAA,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"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { DayPicker } from \"react-day-picker\"\n\nimport { cn } from \"../lib/utils.js\"\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>\n\nfunction Calendar({ className, showOutsideDays = true, ...props }: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n data-slot=\"calendar\"\n className={cn(\n \"mila-daypicker rounded-lg border border-solid border-[color:var(--mila-combobox-menu-border)] bg-[color:var(--mila-combobox-menu-bg)] p-3 shadow-[var(--mila-combobox-menu-shadow)]\",\n className\n )}\n {...props}\n />\n )\n}\nCalendar.displayName = \"Calendar\"\n\nexport { Calendar }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { Popover as PopoverPrimitive } from \"radix-ui\"\n\nimport { cn } from \"../lib/utils.js\"\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(function PopoverContent(\n { className, align = \"center\", sideOffset = 4, collisionPadding = 8, ...props },\n ref\n) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(\n \"z-50 w-72 rounded-lg border border-solid border-[color:var(--mila-combobox-menu-border)] bg-[color:var(--mila-combobox-menu-bg)] p-4 text-foreground shadow-[var(--mila-combobox-menu-shadow)] outline-none\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n )\n})\nPopoverContent.displayName = \"PopoverContent\"\n\nexport { Popover, PopoverAnchor, PopoverContent, PopoverTrigger }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { ChevronsUpDown } from \"lucide-react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../lib/utils.js\"\n\nimport { PopoverContent } from \"./popover.js\"\n\nconst comboboxTriggerVariants = cva(\n [\n \"flex w-full min-w-0 cursor-pointer items-center gap-2 border border-solid bg-background text-left font-sans font-medium outline-none\",\n \"shadow-[0_1px_2px_0_rgba(0,0,0,0.05)] transition-[border-color,box-shadow,color]\",\n \"border-[color:var(--mila-input-border)]\",\n \"focus-visible:border-[color:var(--mila-input-border-focus)] focus-visible:ring-[3px] focus-visible:ring-[color:var(--mila-input-ring-focus)]\",\n \"focus-visible:text-[color:var(--mila-input-text-focus)]\",\n \"disabled:pointer-events-none disabled:border-[color:var(--mila-input-border)] disabled:bg-[color:var(--mila-input-bg-disabled)] disabled:text-[color:var(--mila-input-text-disabled)] disabled:opacity-50\",\n \"aria-invalid:border-[color:var(--mila-input-border-error)] aria-invalid:focus-visible:ring-[color:var(--mila-input-ring-error)]\",\n ],\n {\n variants: {\n size: {\n mini: \"min-h-6 gap-1 rounded-[4px] px-1.5 py-0.5\",\n sm: \"min-h-8 gap-1.5 rounded-lg px-2 py-[5.5px]\",\n default: \"min-h-9 gap-2 rounded-lg px-3 py-[7.5px]\",\n lg: \"min-h-10 gap-2 rounded-lg px-4 py-[9.5px]\",\n },\n lines: {\n 1: \"\",\n 2: \"\",\n },\n },\n compoundVariants: [\n { lines: 2, size: \"lg\", class: \"min-h-[58px] items-start py-2\" },\n { lines: 2, size: \"default\", class: \"min-h-[54px] items-start py-2\" },\n { lines: 2, size: \"sm\", class: \"min-h-[50px] items-start py-1.5\" },\n { lines: 2, size: \"mini\", class: \"min-h-[45px] items-start py-1.5\" },\n ],\n defaultVariants: {\n size: \"default\",\n lines: 1,\n },\n }\n)\n\nconst valueTextClass =\n \"truncate text-sm leading-normal tracking-[0.07px] text-[color:var(--mila-input-text-value)]\"\n\nconst placeholderTextClass =\n \"truncate text-sm leading-normal tracking-[0.07px] text-[color:var(--mila-input-placeholder)]\"\n\nconst descriptionTextClass =\n \"truncate text-xs font-normal leading-normal tracking-[0.18px] text-[color:var(--mila-combobox-item-muted)]\"\n\nexport type ComboboxTriggerProps = Omit<React.ComponentPropsWithoutRef<\"button\">, \"children\"> &\n VariantProps<typeof comboboxTriggerVariants> & {\n /** Shown when no `displayValue` */\n placeholder?: string\n /** Selected label (string or node). Empty → placeholder styling. */\n displayValue?: React.ReactNode\n /** Muted prefix before the value (Figma “Prepend:”). */\n prepend?: React.ReactNode\n /** Leading decoration (icon, avatar). */\n leading?: React.ReactNode\n /** Second line under the value (Figma 2-line combobox). */\n description?: React.ReactNode\n /** Shorthand for `aria-invalid`. */\n invalid?: boolean\n children?: React.ReactNode\n }\n\nconst ComboboxTrigger = React.forwardRef<HTMLButtonElement, ComboboxTriggerProps>(\n function ComboboxTrigger(\n {\n className,\n size = \"default\",\n lines = 1,\n placeholder = \"Select an item\",\n displayValue,\n prepend,\n leading,\n description,\n invalid,\n disabled,\n type = \"button\",\n \"aria-invalid\": ariaInvalidProp,\n children,\n ...props\n },\n ref\n ) {\n const hasValue =\n displayValue != null &&\n displayValue !== \"\" &&\n !(typeof displayValue === \"string\" && displayValue.trim() === \"\")\n const ariaInvalid = invalid === true || ariaInvalidProp === true || ariaInvalidProp === \"true\"\n\n return (\n <button\n ref={ref}\n type={type}\n role=\"combobox\"\n disabled={disabled}\n data-slot=\"combobox-trigger\"\n data-size={size}\n data-lines={lines}\n aria-invalid={ariaInvalid || undefined}\n className={cn(comboboxTriggerVariants({ size, lines }), className)}\n {...props}\n >\n <span className=\"flex min-w-0 flex-1 flex-col gap-0.5 text-left\">\n <span className=\"flex min-w-0 items-center gap-2\">\n {leading ? <span className=\"shrink-0\">{leading}</span> : null}\n {prepend ? (\n <span className=\"shrink-0 text-sm font-medium tracking-[0.07px] text-[color:var(--mila-input-placeholder)]\">\n {prepend}\n </span>\n ) : null}\n <span className={cn(\"min-w-0 flex-1\", hasValue ? valueTextClass : placeholderTextClass)}>\n {children ?? (hasValue ? displayValue : placeholder)}\n </span>\n </span>\n {lines === 2 && description ? (\n <span className={cn(descriptionTextClass, \"ps-0\")}>{description}</span>\n ) : null}\n </span>\n <ChevronsUpDown\n className={cn(\n \"size-4 shrink-0 text-[color:var(--mila-input-placeholder)]\",\n lines === 2 && \"self-center\"\n )}\n aria-hidden\n />\n </button>\n )\n }\n)\nComboboxTrigger.displayName = \"ComboboxTrigger\"\n\nconst ComboboxContent = React.forwardRef<\n React.ElementRef<typeof PopoverContent>,\n React.ComponentPropsWithoutRef<typeof PopoverContent>\n>(function ComboboxContent({ className, align = \"start\", sideOffset = 4, ...props }, ref) {\n return (\n <PopoverContent\n ref={ref}\n data-slot=\"combobox-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"w-[var(--radix-popover-trigger-width)] max-w-[min(100vw-2rem,320px)] min-w-[var(--radix-popover-trigger-width)] p-0\",\n className\n )}\n {...props}\n />\n )\n})\nComboboxContent.displayName = \"ComboboxContent\"\n\nexport { ComboboxContent, ComboboxTrigger, comboboxTriggerVariants }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { format } from \"date-fns\"\nimport { Calendar as CalendarIcon } from \"lucide-react\"\nimport type { VariantProps } from \"class-variance-authority\"\n\nimport { Calendar } from \"./calendar.js\"\nimport { comboboxTriggerVariants } from \"./combobox.js\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover.js\"\nimport { cn } from \"../lib/utils.js\"\n\nconst valueTextClass =\n \"truncate text-sm leading-normal tracking-[0.07px] text-[color:var(--mila-input-text-value)]\"\n\nconst placeholderTextClass =\n \"truncate text-sm leading-normal tracking-[0.07px] text-[color:var(--mila-input-placeholder)]\"\n\nexport type DatePickerProps = {\n value?: Date\n onChange?: (date: Date | undefined) => void\n placeholder?: string\n /** `date-fns` format string (default `PPP`). */\n dateFormat?: string\n size?: VariantProps<typeof comboboxTriggerVariants>[\"size\"]\n disabled?: boolean\n invalid?: boolean\n className?: string\n /** Popover content `align` (default `start`). */\n align?: React.ComponentProps<typeof PopoverContent>[\"align\"]\n}\n\nfunction DatePicker({\n value,\n onChange,\n placeholder = \"Pick a date\",\n dateFormat = \"PPP\",\n size = \"default\",\n disabled,\n invalid,\n className,\n align = \"start\",\n}: DatePickerProps) {\n const [open, setOpen] = React.useState(false)\n const ariaInvalid =\n invalid === true ? true : undefined\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n role=\"combobox\"\n aria-expanded={open}\n aria-invalid={ariaInvalid}\n disabled={disabled}\n data-slot=\"date-picker-trigger\"\n data-size={size}\n className={cn(\n comboboxTriggerVariants({ size, lines: 1 }),\n \"justify-between\",\n className\n )}\n >\n <span className={cn(\"min-w-0 flex-1 text-left\", value ? valueTextClass : placeholderTextClass)}>\n {value ? format(value, dateFormat) : placeholder}\n </span>\n <CalendarIcon className=\"size-4 shrink-0 text-[color:var(--mila-input-placeholder)]\" aria-hidden />\n </button>\n </PopoverTrigger>\n <PopoverContent align={align} className=\"w-auto p-0\" data-slot=\"date-picker-content\">\n <Calendar\n mode=\"single\"\n selected={value}\n onSelect={(d) => {\n onChange?.(d)\n setOpen(false)\n }}\n defaultMonth={value}\n />\n </PopoverContent>\n </Popover>\n )\n}\n\nDatePicker.displayName = \"DatePicker\"\n\nexport { DatePicker }\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dialog as Dialog$1 } from 'radix-ui';
|
|
3
|
+
|
|
4
|
+
declare const Dialog: React.FC<Dialog$1.DialogProps>;
|
|
5
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<Dialog$1.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const DialogPortal: React.FC<Dialog$1.DialogPortalProps>;
|
|
7
|
+
declare const DialogClose: React.ForwardRefExoticComponent<Dialog$1.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<Dialog$1.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<Dialog$1.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const DialogHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
/** Scrollable body between header and footer (Figma “Scrollable” variants). */
|
|
12
|
+
declare const DialogBody: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const DialogFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<Dialog$1.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
15
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<Dialog$1.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
16
|
+
/** Figma close control: 16px icon, 32px target, focus ring. */
|
|
17
|
+
declare const DialogCloseButton: React.ForwardRefExoticComponent<Omit<Dialog$1.DialogCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
|
|
19
|
+
export { Dialog, DialogBody, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dialog as Dialog$1 } from 'radix-ui';
|
|
3
|
+
import { X } from 'lucide-react';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
function cn(...inputs) {
|
|
9
|
+
return twMerge(clsx(inputs));
|
|
10
|
+
}
|
|
11
|
+
var Dialog = Dialog$1.Root;
|
|
12
|
+
var DialogTrigger = Dialog$1.Trigger;
|
|
13
|
+
var DialogPortal = Dialog$1.Portal;
|
|
14
|
+
var DialogClose = Dialog$1.Close;
|
|
15
|
+
var DialogOverlay = React.forwardRef(function DialogOverlay2({ className, ...props }, ref) {
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
Dialog$1.Overlay,
|
|
18
|
+
{
|
|
19
|
+
ref,
|
|
20
|
+
"data-slot": "dialog-overlay",
|
|
21
|
+
className: cn(
|
|
22
|
+
"fixed inset-0 z-50 bg-[color:var(--mila-dialog-overlay-bg)]",
|
|
23
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
24
|
+
className
|
|
25
|
+
),
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
DialogOverlay.displayName = "DialogOverlay";
|
|
31
|
+
var DialogContent = React.forwardRef(function DialogContent2({ className, children, ...props }, ref) {
|
|
32
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
33
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
Dialog$1.Content,
|
|
36
|
+
{
|
|
37
|
+
ref,
|
|
38
|
+
"data-slot": "dialog-content",
|
|
39
|
+
className: cn(
|
|
40
|
+
"fixed left-[50%] top-[50%] z-50 flex w-[calc(100vw-2rem)] max-w-[640px] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-[8px] bg-[color:var(--mila-dialog-bg)] shadow-[var(--mila-dialog-shadow)] outline-none",
|
|
41
|
+
"focus-visible:ring-[3px] focus-visible:ring-[color:var(--mila-dialog-content-focus-ring)] focus-visible:ring-offset-0",
|
|
42
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
...props,
|
|
46
|
+
children
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] });
|
|
50
|
+
});
|
|
51
|
+
DialogContent.displayName = "DialogContent";
|
|
52
|
+
var DialogHeader = React.forwardRef(
|
|
53
|
+
function DialogHeader2({ className, ...props }, ref) {
|
|
54
|
+
return /* @__PURE__ */ jsx(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
ref,
|
|
58
|
+
"data-slot": "dialog-header",
|
|
59
|
+
className: cn("flex flex-col gap-2 p-4 text-left", className),
|
|
60
|
+
...props
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
DialogHeader.displayName = "DialogHeader";
|
|
66
|
+
var DialogBody = React.forwardRef(
|
|
67
|
+
function DialogBody2({ className, ...props }, ref) {
|
|
68
|
+
return /* @__PURE__ */ jsx(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
ref,
|
|
72
|
+
"data-slot": "dialog-body",
|
|
73
|
+
className: cn("min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-2", className),
|
|
74
|
+
...props
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
DialogBody.displayName = "DialogBody";
|
|
80
|
+
var DialogFooter = React.forwardRef(
|
|
81
|
+
function DialogFooter2({ className, ...props }, ref) {
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
ref,
|
|
86
|
+
"data-slot": "dialog-footer",
|
|
87
|
+
className: cn("flex flex-col-reverse gap-2 p-4 sm:flex-row sm:justify-end", className),
|
|
88
|
+
...props
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
DialogFooter.displayName = "DialogFooter";
|
|
94
|
+
var DialogTitle = React.forwardRef(function DialogTitle2({ className, ...props }, ref) {
|
|
95
|
+
return /* @__PURE__ */ jsx(
|
|
96
|
+
Dialog$1.Title,
|
|
97
|
+
{
|
|
98
|
+
ref,
|
|
99
|
+
"data-slot": "dialog-title",
|
|
100
|
+
className: cn(
|
|
101
|
+
"font-sans text-[20px] font-semibold leading-[1.2] tracking-[-0.4px] text-[color:var(--mila-dialog-title-fg)]",
|
|
102
|
+
className
|
|
103
|
+
),
|
|
104
|
+
...props
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
});
|
|
108
|
+
DialogTitle.displayName = "DialogTitle";
|
|
109
|
+
var DialogDescription = React.forwardRef(function DialogDescription2({ className, ...props }, ref) {
|
|
110
|
+
return /* @__PURE__ */ jsx(
|
|
111
|
+
Dialog$1.Description,
|
|
112
|
+
{
|
|
113
|
+
ref,
|
|
114
|
+
"data-slot": "dialog-description",
|
|
115
|
+
className: cn(
|
|
116
|
+
"font-sans text-sm font-normal leading-normal tracking-[0.07px] text-[color:var(--mila-dialog-description-fg)]",
|
|
117
|
+
className
|
|
118
|
+
),
|
|
119
|
+
...props
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
});
|
|
123
|
+
DialogDescription.displayName = "DialogDescription";
|
|
124
|
+
var DialogCloseButton = React.forwardRef(function DialogCloseButton2({ className, children, ...props }, ref) {
|
|
125
|
+
return /* @__PURE__ */ jsx(
|
|
126
|
+
Dialog$1.Close,
|
|
127
|
+
{
|
|
128
|
+
ref,
|
|
129
|
+
type: "button",
|
|
130
|
+
className: cn(
|
|
131
|
+
"text-[color:var(--mila-dialog-close-fg)] inline-flex size-8 shrink-0 items-center justify-center rounded-sm opacity-70 outline-none transition-opacity",
|
|
132
|
+
"hover:opacity-100",
|
|
133
|
+
"focus-visible:ring-[3px] focus-visible:ring-[color:var(--mila-dialog-close-focus-ring)] focus-visible:ring-offset-0",
|
|
134
|
+
"disabled:pointer-events-none",
|
|
135
|
+
className
|
|
136
|
+
),
|
|
137
|
+
...props,
|
|
138
|
+
children: children ?? /* @__PURE__ */ jsx(X, { className: "size-4", "aria-hidden": true, strokeWidth: 2 })
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
});
|
|
142
|
+
DialogCloseButton.displayName = "DialogCloseButton";
|
|
143
|
+
|
|
144
|
+
export { Dialog, DialogBody, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
145
|
+
//# sourceMappingURL=dialog.js.map
|
|
146
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/dialog.tsx"],"names":["DialogPrimitive","DialogOverlay","DialogContent","DialogHeader","DialogBody","DialogFooter","DialogTitle","DialogDescription","DialogCloseButton"],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACGA,IAAM,SAASA,QAAA,CAAgB;AAE/B,IAAM,gBAAgBA,QAAA,CAAgB;AAEtC,IAAM,eAAeA,QAAA,CAAgB;AAErC,IAAM,cAAcA,QAAA,CAAgB;AAEpC,IAAM,aAAA,GAAsB,iBAG1B,SAASC,cAAAA,CAAc,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,EAAK;AACrD,EAAA,uBACE,GAAA;AAAA,IAACD,QAAA,CAAg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AAA;AAAA,MACA,WAAA,EAAU,oBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,+GAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC;AACD,iBAAA,CAAkB,WAAA,GAAc,mBAAA;AAGhC,IAAM,iBAAA,GAA0B,KAAA,CAAA,UAAA,CAG9B,SAASQ,kBAAAA,CAAkB,EAAE,WAAW,QAAA,EAAU,GAAG,KAAA,EAAM,EAAG,GAAA,EAAK;AACnE,EAAA,uBACE,GAAA;AAAA,IAACR,QAAA,CAAgB,KAAA;AAAA,IAAhB;AAAA,MACC,GAAA;AAAA,MACA,IAAA,EAAK,QAAA;AAAA,MACL,SAAA,EAAW,EAAA;AAAA,QACT,wJAAA;AAAA,QACA,mBAAA;AAAA,QACA,qHAAA;AAAA,QACA,8BAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA,QAAA,wBAAa,CAAA,EAAA,EAAE,SAAA,EAAU,UAAS,aAAA,EAAW,IAAA,EAAC,aAAa,CAAA,EAAG;AAAA;AAAA,GACjE;AAEJ,CAAC;AACD,iBAAA,CAAkB,WAAA,GAAc,mBAAA","file":"dialog.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { Dialog as DialogPrimitive } from \"radix-ui\"\nimport { X } from \"lucide-react\"\n\nimport { cn } from \"../lib/utils.js\"\n\nconst Dialog = DialogPrimitive.Root\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(function DialogOverlay({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Overlay\n ref={ref}\n data-slot=\"dialog-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-[color:var(--mila-dialog-overlay-bg)]\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n )\n})\nDialogOverlay.displayName = \"DialogOverlay\"\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(function DialogContent({ className, children, ...props }, ref) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n data-slot=\"dialog-content\"\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 flex w-[calc(100vw-2rem)] max-w-[640px] translate-x-[-50%] translate-y-[-50%] flex-col overflow-hidden rounded-[8px] bg-[color:var(--mila-dialog-bg)] shadow-[var(--mila-dialog-shadow)] outline-none\",\n \"focus-visible:ring-[3px] focus-visible:ring-[color:var(--mila-dialog-content-focus-ring)] focus-visible:ring-offset-0\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n})\nDialogContent.displayName = \"DialogContent\"\n\nconst DialogHeader = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<\"div\">>(\n function DialogHeader({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 p-4 text-left\", className)}\n {...props}\n />\n )\n }\n)\nDialogHeader.displayName = \"DialogHeader\"\n\n/** Scrollable body between header and footer (Figma “Scrollable” variants). */\nconst DialogBody = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<\"div\">>(\n function DialogBody({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n data-slot=\"dialog-body\"\n className={cn(\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 py-2\", className)}\n {...props}\n />\n )\n }\n)\nDialogBody.displayName = \"DialogBody\"\n\nconst DialogFooter = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<\"div\">>(\n function DialogFooter({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n data-slot=\"dialog-footer\"\n className={cn(\"flex flex-col-reverse gap-2 p-4 sm:flex-row sm:justify-end\", className)}\n {...props}\n />\n )\n }\n)\nDialogFooter.displayName = \"DialogFooter\"\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(function DialogTitle({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Title\n ref={ref}\n data-slot=\"dialog-title\"\n className={cn(\n \"font-sans text-[20px] font-semibold leading-[1.2] tracking-[-0.4px] text-[color:var(--mila-dialog-title-fg)]\",\n className\n )}\n {...props}\n />\n )\n})\nDialogTitle.displayName = \"DialogTitle\"\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(function DialogDescription({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Description\n ref={ref}\n data-slot=\"dialog-description\"\n className={cn(\n \"font-sans text-sm font-normal leading-normal tracking-[0.07px] text-[color:var(--mila-dialog-description-fg)]\",\n className\n )}\n {...props}\n />\n )\n})\nDialogDescription.displayName = \"DialogDescription\"\n\n/** Figma close control: 16px icon, 32px target, focus ring. */\nconst DialogCloseButton = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Close>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>\n>(function DialogCloseButton({ className, children, ...props }, ref) {\n return (\n <DialogPrimitive.Close\n ref={ref}\n type=\"button\"\n className={cn(\n \"text-[color:var(--mila-dialog-close-fg)] inline-flex size-8 shrink-0 items-center justify-center rounded-sm opacity-70 outline-none transition-opacity\",\n \"hover:opacity-100\",\n \"focus-visible:ring-[3px] focus-visible:ring-[color:var(--mila-dialog-close-focus-ring)] focus-visible:ring-offset-0\",\n \"disabled:pointer-events-none\",\n className\n )}\n {...props}\n >\n {children ?? <X className=\"size-4\" aria-hidden strokeWidth={2} />}\n </DialogPrimitive.Close>\n )\n})\nDialogCloseButton.displayName = \"DialogCloseButton\"\n\nexport {\n Dialog,\n DialogBody,\n DialogClose,\n DialogCloseButton,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dialog } from 'radix-ui';
|
|
3
|
+
|
|
4
|
+
/** MILA Drawer (Figma Obra shadcn — node 301:245123): bottom sheet, full width, top radius 10px, dialog shadow, drag handle, default max height 300px. */
|
|
5
|
+
declare const Drawer: React.FC<Dialog.DialogProps>;
|
|
6
|
+
declare const DrawerTrigger: React.ForwardRefExoticComponent<Dialog.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DrawerClose: React.ForwardRefExoticComponent<Dialog.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
declare const DrawerPortal: React.FC<Dialog.DialogPortalProps>;
|
|
9
|
+
declare const DrawerOverlay: React.ForwardRefExoticComponent<Omit<Dialog.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const DrawerHandle: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Dialog.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
12
|
+
showHandle?: boolean;
|
|
13
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const DrawerHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const DrawerBody: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const DrawerFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<Dialog.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
18
|
+
declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<Dialog.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
19
|
+
|
|
20
|
+
export { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHandle, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dialog } from 'radix-ui';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
var Drawer = Dialog.Root;
|
|
11
|
+
var DrawerTrigger = Dialog.Trigger;
|
|
12
|
+
var DrawerClose = Dialog.Close;
|
|
13
|
+
var DrawerPortal = Dialog.Portal;
|
|
14
|
+
var DrawerOverlay = React.forwardRef(function DrawerOverlay2({ className, ...props }, ref) {
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
Dialog.Overlay,
|
|
17
|
+
{
|
|
18
|
+
ref,
|
|
19
|
+
"data-slot": "drawer-overlay",
|
|
20
|
+
className: cn(
|
|
21
|
+
"fixed inset-0 z-50 bg-[color:var(--mila-dialog-overlay-bg)]",
|
|
22
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
23
|
+
className
|
|
24
|
+
),
|
|
25
|
+
...props
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
DrawerOverlay.displayName = "DrawerOverlay";
|
|
30
|
+
var DrawerHandle = React.forwardRef(
|
|
31
|
+
function DrawerHandle2({ className, ...props }, ref) {
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
ref,
|
|
36
|
+
"data-slot": "drawer-handle",
|
|
37
|
+
className: cn(
|
|
38
|
+
"bg-[color:var(--mila-drawer-handle-bg)] pointer-events-none absolute top-2 left-1/2 h-[3px] w-[50px] -translate-x-1/2 rounded-[2px]",
|
|
39
|
+
className
|
|
40
|
+
),
|
|
41
|
+
"aria-hidden": true,
|
|
42
|
+
...props
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
DrawerHandle.displayName = "DrawerHandle";
|
|
48
|
+
var DrawerContent = React.forwardRef(
|
|
49
|
+
function DrawerContent2({ className, children, showHandle = true, ...props }, ref) {
|
|
50
|
+
return /* @__PURE__ */ jsxs(DrawerPortal, { children: [
|
|
51
|
+
/* @__PURE__ */ jsx(DrawerOverlay, {}),
|
|
52
|
+
/* @__PURE__ */ jsxs(
|
|
53
|
+
Dialog.Content,
|
|
54
|
+
{
|
|
55
|
+
ref,
|
|
56
|
+
"data-slot": "drawer-content",
|
|
57
|
+
className: cn(
|
|
58
|
+
"fixed inset-x-0 bottom-0 z-50 flex max-h-[min(300px,90dvh)] w-full flex-col overflow-hidden rounded-t-[10px] bg-[color:var(--mila-dialog-bg)] shadow-[var(--mila-dialog-shadow)] outline-none",
|
|
59
|
+
"focus-visible:ring-[3px] focus-visible:ring-[color:var(--mila-dialog-content-focus-ring)] focus-visible:ring-offset-0",
|
|
60
|
+
"data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
61
|
+
"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
...props,
|
|
65
|
+
children: [
|
|
66
|
+
showHandle ? /* @__PURE__ */ jsx(DrawerHandle, {}) : null,
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
className: cn(
|
|
71
|
+
"relative flex min-h-0 flex-1 flex-col",
|
|
72
|
+
showHandle ? "pt-6" : "pt-4"
|
|
73
|
+
),
|
|
74
|
+
children
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
DrawerContent.displayName = "DrawerContent";
|
|
84
|
+
var DrawerHeader = React.forwardRef(
|
|
85
|
+
function DrawerHeader2({ className, ...props }, ref) {
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
ref,
|
|
90
|
+
"data-slot": "drawer-header",
|
|
91
|
+
className: cn("flex shrink-0 flex-col gap-2 px-6 pt-0 pb-0 text-left", className),
|
|
92
|
+
...props
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
DrawerHeader.displayName = "DrawerHeader";
|
|
98
|
+
var DrawerBody = React.forwardRef(
|
|
99
|
+
function DrawerBody2({ className, ...props }, ref) {
|
|
100
|
+
return /* @__PURE__ */ jsx(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
ref,
|
|
104
|
+
"data-slot": "drawer-body",
|
|
105
|
+
className: cn("min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-4", className),
|
|
106
|
+
...props
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
DrawerBody.displayName = "DrawerBody";
|
|
112
|
+
var DrawerFooter = React.forwardRef(
|
|
113
|
+
function DrawerFooter2({ className, ...props }, ref) {
|
|
114
|
+
return /* @__PURE__ */ jsx(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
ref,
|
|
118
|
+
"data-slot": "drawer-footer",
|
|
119
|
+
className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-2 pb-4 sm:flex-row sm:justify-end", className),
|
|
120
|
+
...props
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
DrawerFooter.displayName = "DrawerFooter";
|
|
126
|
+
var DrawerTitle = React.forwardRef(function DrawerTitle2({ className, ...props }, ref) {
|
|
127
|
+
return /* @__PURE__ */ jsx(
|
|
128
|
+
Dialog.Title,
|
|
129
|
+
{
|
|
130
|
+
ref,
|
|
131
|
+
"data-slot": "drawer-title",
|
|
132
|
+
className: cn(
|
|
133
|
+
"font-sans text-[20px] font-semibold leading-[1.2] tracking-[-0.4px] text-[color:var(--mila-dialog-title-fg)]",
|
|
134
|
+
className
|
|
135
|
+
),
|
|
136
|
+
...props
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
DrawerTitle.displayName = "DrawerTitle";
|
|
141
|
+
var DrawerDescription = React.forwardRef(function DrawerDescription2({ className, ...props }, ref) {
|
|
142
|
+
return /* @__PURE__ */ jsx(
|
|
143
|
+
Dialog.Description,
|
|
144
|
+
{
|
|
145
|
+
ref,
|
|
146
|
+
"data-slot": "drawer-description",
|
|
147
|
+
className: cn(
|
|
148
|
+
"font-sans text-sm font-normal leading-normal tracking-[0.07px] text-[color:var(--mila-dialog-description-fg)]",
|
|
149
|
+
className
|
|
150
|
+
),
|
|
151
|
+
...props
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
});
|
|
155
|
+
DrawerDescription.displayName = "DrawerDescription";
|
|
156
|
+
|
|
157
|
+
export { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHandle, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
|
|
158
|
+
//# sourceMappingURL=drawer.js.map
|
|
159
|
+
//# sourceMappingURL=drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/components/drawer.tsx"],"names":["DrawerPrimitive","DrawerOverlay","DrawerHandle","DrawerContent","DrawerHeader","DrawerBody","DrawerFooter","DrawerTitle","DrawerDescription"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACGA,IAAM,SAASA,MAAA,CAAgB;AAE/B,IAAM,gBAAgBA,MAAA,CAAgB;AAEtC,IAAM,cAAcA,MAAA,CAAgB;AAEpC,IAAM,eAAeA,MAAA,CAAgB;AAErC,IAAM,aAAA,GAAsB,iBAG1B,SAASC,cAAAA,CAAc,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,EAAK;AACrD,EAAA,uBACE,GAAA;AAAA,IAACD,MAAA,CAAgB,OAAA;AAAA,IAAhB;AAAA,MACC,GAAA;AAAA,MACA,WAAA,EAAU,gBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,6DAAA;AAAA,QACA,yHAAA;AAAA,QACA;AAAA,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AA,GAAoB,iBAGxB,SAASC,YAAAA,CAAY,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,EAAK;AACnD,EAAA,uBACE,GAAA;AAAA,IAACP,MAAA,CAAgB,KAAA;AAAA,IAAhB;AAAA,MACC,GAAA;AAAA,MACA,WAAA,EAAU,cAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,8GAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC;AACD,WAAA,CAAY,WAAA,GAAc,aAAA;AAE1B,IAAM,iBAAA,GAA0B,iBAG9B,SAASQ,kBAAAA,CAAkB,EAAE,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,EAAK;AACzD,EAAA,uBACE,GAAA;AAAA,IAACR,MAAA,CAAgB,WAAA;AAAA,IAAhB;AAAA,MACC,GAAA;AAAA,MACA,WAAA,EAAU,oBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,+GAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ,CAAC;AACD,iBAAA,CAAkB,WAAA,GAAc,mBAAA","file":"drawer.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { Dialog as DrawerPrimitive } from \"radix-ui\"\n\nimport { cn } from \"../lib/utils.js\"\n\n/** MILA Drawer (Figma Obra shadcn — node 301:245123): bottom sheet, full width, top radius 10px, dialog shadow, drag handle, default max height 300px. */\nconst Drawer = DrawerPrimitive.Root\n\nconst DrawerTrigger = DrawerPrimitive.Trigger\n\nconst DrawerClose = DrawerPrimitive.Close\n\nconst DrawerPortal = DrawerPrimitive.Portal\n\nconst DrawerOverlay = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(function DrawerOverlay({ className, ...props }, ref) {\n return (\n <DrawerPrimitive.Overlay\n ref={ref}\n data-slot=\"drawer-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-[color:var(--mila-dialog-overlay-bg)]\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n )\n})\nDrawerOverlay.displayName = \"DrawerOverlay\"\n\nconst DrawerHandle = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<\"div\">>(\n function DrawerHandle({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n data-slot=\"drawer-handle\"\n className={cn(\n \"bg-[color:var(--mila-drawer-handle-bg)] pointer-events-none absolute top-2 left-1/2 h-[3px] w-[50px] -translate-x-1/2 rounded-[2px]\",\n className\n )}\n aria-hidden\n {...props}\n />\n )\n }\n)\nDrawerHandle.displayName = \"DrawerHandle\"\n\ntype DrawerContentProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> & {\n showHandle?: boolean\n}\n\nconst DrawerContent = React.forwardRef<React.ElementRef<typeof DrawerPrimitive.Content>, DrawerContentProps>(\n function DrawerContent({ className, children, showHandle = true, ...props }, ref) {\n return (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n ref={ref}\n data-slot=\"drawer-content\"\n className={cn(\n \"fixed inset-x-0 bottom-0 z-50 flex max-h-[min(300px,90dvh)] w-full flex-col overflow-hidden rounded-t-[10px] bg-[color:var(--mila-dialog-bg)] shadow-[var(--mila-dialog-shadow)] outline-none\",\n \"focus-visible:ring-[3px] focus-visible:ring-[color:var(--mila-dialog-content-focus-ring)] focus-visible:ring-offset-0\",\n \"data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n className\n )}\n {...props}\n >\n {showHandle ? <DrawerHandle /> : null}\n <div\n className={cn(\n \"relative flex min-h-0 flex-1 flex-col\",\n showHandle ? \"pt-6\" : \"pt-4\"\n )}\n >\n {children}\n </div>\n </DrawerPrimitive.Content>\n </DrawerPortal>\n )\n }\n)\nDrawerContent.displayName = \"DrawerContent\"\n\nconst DrawerHeader = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<\"div\">>(\n function DrawerHeader({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n data-slot=\"drawer-header\"\n className={cn(\"flex shrink-0 flex-col gap-2 px-6 pt-0 pb-0 text-left\", className)}\n {...props}\n />\n )\n }\n)\nDrawerHeader.displayName = \"DrawerHeader\"\n\nconst DrawerBody = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<\"div\">>(\n function DrawerBody({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n data-slot=\"drawer-body\"\n className={cn(\"min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-4\", className)}\n {...props}\n />\n )\n }\n)\nDrawerBody.displayName = \"DrawerBody\"\n\nconst DrawerFooter = React.forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<\"div\">>(\n function DrawerFooter({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n data-slot=\"drawer-footer\"\n className={cn(\"flex shrink-0 flex-col-reverse gap-2 px-6 pt-2 pb-4 sm:flex-row sm:justify-end\", className)}\n {...props}\n />\n )\n }\n)\nDrawerFooter.displayName = \"DrawerFooter\"\n\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(function DrawerTitle({ className, ...props }, ref) {\n return (\n <DrawerPrimitive.Title\n ref={ref}\n data-slot=\"drawer-title\"\n className={cn(\n \"font-sans text-[20px] font-semibold leading-[1.2] tracking-[-0.4px] text-[color:var(--mila-dialog-title-fg)]\",\n className\n )}\n {...props}\n />\n )\n})\nDrawerTitle.displayName = \"DrawerTitle\"\n\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(function DrawerDescription({ className, ...props }, ref) {\n return (\n <DrawerPrimitive.Description\n ref={ref}\n data-slot=\"drawer-description\"\n className={cn(\n \"font-sans text-sm font-normal leading-normal tracking-[0.07px] text-[color:var(--mila-dialog-description-fg)]\",\n className\n )}\n {...props}\n />\n )\n})\nDrawerDescription.displayName = \"DrawerDescription\"\n\nexport {\n Drawer,\n DrawerBody,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHandle,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n}\n"]}
|