@epilot/zenith-react 0.2.0-next.0 → 0.2.0-next.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/dist/components/accordion/accordion.js +57 -48
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.js +120 -92
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/avatar/avatar-group.js +38 -35
- package/dist/components/avatar/avatar-group.js.map +1 -1
- package/dist/components/avatar/avatar.js +78 -71
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/badge/badge.js +60 -55
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +99 -54
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/button/button.js +87 -77
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button-group/button-group.js +36 -32
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/callout/callout.js +105 -98
- package/dist/components/callout/callout.js.map +1 -1
- package/dist/components/card/card.js +62 -52
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +22 -19
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/code-block/code-block.js +135 -123
- package/dist/components/code-block/code-block.js.map +1 -1
- package/dist/components/code-editor/code-editor.js +276 -260
- package/dist/components/code-editor/code-editor.js.map +1 -1
- package/dist/components/collapsible-sidebar/collapsible-sidebar.js +62 -56
- package/dist/components/collapsible-sidebar/collapsible-sidebar.js.map +1 -1
- package/dist/components/command/command.js +116 -105
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/data-table/data-table-body.js +38 -34
- package/dist/components/data-table/data-table-body.js.map +1 -1
- package/dist/components/data-table/data-table-column-header.js +30 -26
- package/dist/components/data-table/data-table-column-header.js.map +1 -1
- package/dist/components/data-table/data-table-column-order.js +79 -73
- package/dist/components/data-table/data-table-column-order.js.map +1 -1
- package/dist/components/data-table/data-table-column-visibility.js +25 -22
- package/dist/components/data-table/data-table-column-visibility.js.map +1 -1
- package/dist/components/data-table/data-table-content.js +47 -44
- package/dist/components/data-table/data-table-content.js.map +1 -1
- package/dist/components/data-table/data-table-error.js +36 -32
- package/dist/components/data-table/data-table-error.js.map +1 -1
- package/dist/components/data-table/data-table-footer.js +10 -8
- package/dist/components/data-table/data-table-footer.js.map +1 -1
- package/dist/components/data-table/data-table-header-draggable.js +40 -36
- package/dist/components/data-table/data-table-header-draggable.js.map +1 -1
- package/dist/components/data-table/data-table-loading.js +21 -18
- package/dist/components/data-table/data-table-loading.js.map +1 -1
- package/dist/components/data-table/data-table-resize-handle.js +13 -11
- package/dist/components/data-table/data-table-resize-handle.js.map +1 -1
- package/dist/components/data-table/data-table-row.js +47 -44
- package/dist/components/data-table/data-table-row.js.map +1 -1
- package/dist/components/data-table/data-table-toolbar.js +9 -7
- package/dist/components/data-table/data-table-toolbar.js.map +1 -1
- package/dist/components/data-table/data-table.js +48 -46
- package/dist/components/data-table/data-table.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +173 -164
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/date-range-picker/range-calendar.js +36 -34
- package/dist/components/date-range-picker/range-calendar.js.map +1 -1
- package/dist/components/date-time-picker/calendar.js +290 -272
- package/dist/components/date-time-picker/calendar.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-input.js +22 -20
- package/dist/components/date-time-picker/date-time-picker-input.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-panel.js +126 -120
- package/dist/components/date-time-picker/date-time-picker-panel.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker.js +42 -40
- package/dist/components/date-time-picker/date-time-picker.js.map +1 -1
- package/dist/components/date-time-picker/time-picker.js +95 -87
- package/dist/components/date-time-picker/time-picker.js.map +1 -1
- package/dist/components/dialog/dialog.js +115 -95
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/drawer/drawer.js +144 -109
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +141 -112
- package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/field/field-combobox.js +196 -176
- package/dist/components/field/field-combobox.js.map +1 -1
- package/dist/components/field/field.js +137 -126
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/list/list.js +237 -219
- package/dist/components/list/list.js.map +1 -1
- package/dist/components/option-card/option-card.js +129 -116
- package/dist/components/option-card/option-card.js.map +1 -1
- package/dist/components/pill/pill.js +55 -51
- package/dist/components/pill/pill.js.map +1 -1
- package/dist/components/popover/popover.js +53 -36
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/radio/radio.js +38 -34
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.js +38 -35
- package/dist/components/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/scroll-overflow/scroll-overflow.js +166 -151
- package/dist/components/scroll-overflow/scroll-overflow.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +93 -85
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/select/select.js +149 -128
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/separator/separator.js +19 -16
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/skeleton/skeleton.js +34 -30
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/spinner/spinner.js +22 -17
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/surface/surface.js +25 -22
- package/dist/components/surface/surface.js.map +1 -1
- package/dist/components/switch/switch.js +66 -57
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/table-pagination.js +139 -129
- package/dist/components/table/table-pagination.js.map +1 -1
- package/dist/components/table/table.js +104 -90
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/tabs/tabs.js +206 -128
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/toast/toast.js +112 -100
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toggle/toggle.js +32 -30
- package/dist/components/toggle/toggle.js.map +1 -1
- package/dist/components/tooltip/tooltip.js +59 -46
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/lib/clear-button.js +18 -17
- package/dist/lib/clear-button.js.map +1 -1
- package/dist/styles/host-reset.js +47 -0
- package/dist/styles/host-reset.js.map +1 -0
- package/dist/styles/overlay-layer.js +5 -0
- package/dist/styles/overlay-layer.js.map +1 -0
- package/dist/tokens.json +1 -1
- package/package.json +8 -7
- package/scripts/migration-diagnostics.mjs +42 -7
- package/scripts/migration-sweep.mjs +9 -1
|
@@ -1,33 +1,39 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
1
|
+
import { jsx as i, jsxs as w } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
|
-
import { Root as
|
|
4
|
-
import { SLOT_ATTR as a, mergeClasses as
|
|
5
|
-
import { makeZenithStyles as
|
|
6
|
-
import {
|
|
7
|
-
|
|
3
|
+
import { Root as b, Content as y, Item as A, Header as S, Trigger as v } from "../../vendor/.bun/@radix-ui_react-accordion@1.2.12_2b23df507bdda662/vendor/@radix-ui/react-accordion/dist/index.js";
|
|
4
|
+
import { SLOT_ATTR as a, mergeClasses as f, shorthands as l } from "@epilot/zenith-runtime/v1";
|
|
5
|
+
import { makeZenithStyles as C } from "../../styles/make-styles.js";
|
|
6
|
+
import { boxModel as m, nativeControl as T } from "../../styles/host-reset.js";
|
|
7
|
+
import { spacingElement2 as R, spacingElement1 as I, spacingElement3 as g, leadingSm as p, textSm as u, grayA11 as k, grayA3 as z, fontWeightMedium as E, radiusMd as N, accentA8 as q } from "../../tokens/index.js";
|
|
8
|
+
const h = C({
|
|
8
9
|
header: {
|
|
10
|
+
// Radix renders the header as an `<h3>`, whose UA margin and type would otherwise show.
|
|
11
|
+
...l.margin(0),
|
|
12
|
+
fontSize: "inherit",
|
|
13
|
+
fontWeight: "inherit",
|
|
9
14
|
display: "flex"
|
|
10
15
|
},
|
|
11
16
|
trigger: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
...T,
|
|
18
|
+
outlineColor: q,
|
|
19
|
+
...l.paddingInline(g),
|
|
20
|
+
...l.paddingBlock("1rem"),
|
|
15
21
|
cursor: "pointer",
|
|
16
22
|
display: "flex",
|
|
17
23
|
flexGrow: 1,
|
|
18
24
|
flexShrink: 1,
|
|
19
25
|
flexBasis: "0%",
|
|
20
26
|
alignItems: "flex-start",
|
|
21
|
-
gap:
|
|
22
|
-
borderRadius:
|
|
27
|
+
gap: g,
|
|
28
|
+
borderRadius: N,
|
|
23
29
|
textAlign: "left",
|
|
24
30
|
fontSize: u,
|
|
25
|
-
lineHeight:
|
|
26
|
-
fontWeight:
|
|
31
|
+
lineHeight: p,
|
|
32
|
+
fontWeight: E,
|
|
27
33
|
transitionProperty: "all",
|
|
28
34
|
transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
29
35
|
transitionDuration: "150ms",
|
|
30
|
-
":hover": { backgroundColor:
|
|
36
|
+
":hover": { backgroundColor: z },
|
|
31
37
|
":focus-visible": {
|
|
32
38
|
outlineOffset: "2px",
|
|
33
39
|
outlineWidth: "2px",
|
|
@@ -48,9 +54,10 @@ const g = S({
|
|
|
48
54
|
justifyContent: "space-between"
|
|
49
55
|
},
|
|
50
56
|
icon: {
|
|
57
|
+
...m,
|
|
51
58
|
width: "1.25rem",
|
|
52
59
|
height: "1.25rem",
|
|
53
|
-
color:
|
|
60
|
+
color: k,
|
|
54
61
|
pointerEvents: "none",
|
|
55
62
|
flexShrink: 0,
|
|
56
63
|
transform: "translateY(0)",
|
|
@@ -59,12 +66,13 @@ const g = S({
|
|
|
59
66
|
transitionDuration: "150ms"
|
|
60
67
|
},
|
|
61
68
|
panel: {
|
|
69
|
+
...m,
|
|
62
70
|
overflow: "hidden",
|
|
63
71
|
fontSize: u,
|
|
64
|
-
lineHeight:
|
|
65
|
-
paddingInline:
|
|
66
|
-
paddingBlockStart:
|
|
67
|
-
paddingBlockEnd:
|
|
72
|
+
lineHeight: p,
|
|
73
|
+
paddingInline: g,
|
|
74
|
+
paddingBlockStart: I,
|
|
75
|
+
paddingBlockEnd: R,
|
|
68
76
|
"&[data-state='open']": {
|
|
69
77
|
animationName: {
|
|
70
78
|
from: { height: "0" },
|
|
@@ -83,86 +91,87 @@ const g = S({
|
|
|
83
91
|
}
|
|
84
92
|
},
|
|
85
93
|
inner: {
|
|
94
|
+
...m,
|
|
86
95
|
paddingInline: "0",
|
|
87
96
|
paddingBlock: "0"
|
|
88
97
|
}
|
|
89
|
-
}),
|
|
98
|
+
}), H = r.forwardRef(function({ className: n, ...t }, o) {
|
|
90
99
|
return /* @__PURE__ */ i(
|
|
91
|
-
|
|
100
|
+
b,
|
|
92
101
|
{
|
|
93
102
|
ref: o,
|
|
94
103
|
"data-slot": "accordion",
|
|
95
104
|
[a]: "accordion",
|
|
96
|
-
className:
|
|
97
|
-
...
|
|
105
|
+
className: n,
|
|
106
|
+
...t
|
|
98
107
|
}
|
|
99
108
|
);
|
|
100
|
-
}),
|
|
109
|
+
}), L = r.forwardRef(function({ className: n, ...t }, o) {
|
|
101
110
|
return /* @__PURE__ */ i(
|
|
102
|
-
|
|
111
|
+
A,
|
|
103
112
|
{
|
|
104
113
|
ref: o,
|
|
105
114
|
"data-slot": "accordion-item",
|
|
106
115
|
[a]: "accordion-item",
|
|
107
|
-
className:
|
|
108
|
-
...
|
|
116
|
+
className: n,
|
|
117
|
+
...t
|
|
109
118
|
}
|
|
110
119
|
);
|
|
111
|
-
}),
|
|
112
|
-
const e =
|
|
120
|
+
}), x = r.forwardRef(function({ className: n, ...t }, o) {
|
|
121
|
+
const e = h();
|
|
113
122
|
return /* @__PURE__ */ i(
|
|
114
123
|
"svg",
|
|
115
124
|
{
|
|
116
125
|
ref: o,
|
|
117
126
|
"data-slot": "accordion-icon",
|
|
118
127
|
[a]: "accordion-icon",
|
|
119
|
-
className:
|
|
128
|
+
className: f(e.icon, n),
|
|
120
129
|
xmlns: "http://www.w3.org/2000/svg",
|
|
121
130
|
viewBox: "0 -960 960 960",
|
|
122
131
|
fill: "currentColor",
|
|
123
|
-
...
|
|
132
|
+
...t,
|
|
124
133
|
children: /* @__PURE__ */ i("path", { d: "M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z" })
|
|
125
134
|
}
|
|
126
135
|
);
|
|
127
|
-
}),
|
|
128
|
-
const d =
|
|
129
|
-
return /* @__PURE__ */ i(
|
|
130
|
-
|
|
136
|
+
}), O = r.forwardRef(function({ className: n, align: t = "end", children: o, ...e }, s) {
|
|
137
|
+
const d = h();
|
|
138
|
+
return /* @__PURE__ */ i(S, { className: d.header, children: /* @__PURE__ */ w(
|
|
139
|
+
v,
|
|
131
140
|
{
|
|
132
141
|
ref: s,
|
|
133
142
|
"data-slot": "accordion-trigger",
|
|
134
143
|
[a]: "accordion-trigger",
|
|
135
|
-
className:
|
|
144
|
+
className: f(
|
|
136
145
|
d.trigger,
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
t === "start" ? d.alignStart : d.alignEnd,
|
|
147
|
+
n
|
|
139
148
|
),
|
|
140
149
|
...e,
|
|
141
150
|
children: [
|
|
142
|
-
|
|
151
|
+
t === "start" && /* @__PURE__ */ i(x, {}),
|
|
143
152
|
o,
|
|
144
|
-
|
|
153
|
+
t === "end" && /* @__PURE__ */ i(x, {})
|
|
145
154
|
]
|
|
146
155
|
}
|
|
147
156
|
) });
|
|
148
|
-
}),
|
|
149
|
-
const s =
|
|
157
|
+
}), P = r.forwardRef(function({ className: n, children: t, ...o }, e) {
|
|
158
|
+
const s = h();
|
|
150
159
|
return /* @__PURE__ */ i(
|
|
151
|
-
|
|
160
|
+
y,
|
|
152
161
|
{
|
|
153
162
|
ref: e,
|
|
154
163
|
"data-slot": "accordion-content",
|
|
155
164
|
[a]: "accordion-content",
|
|
156
165
|
className: s.panel,
|
|
157
166
|
...o,
|
|
158
|
-
children: /* @__PURE__ */ i("div", { className:
|
|
167
|
+
children: /* @__PURE__ */ i("div", { className: f(s.inner, n), children: t })
|
|
159
168
|
}
|
|
160
169
|
);
|
|
161
170
|
});
|
|
162
171
|
export {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
172
|
+
H as Accordion,
|
|
173
|
+
P as AccordionContent,
|
|
174
|
+
L as AccordionItem,
|
|
175
|
+
O as AccordionTrigger
|
|
167
176
|
};
|
|
168
177
|
//# sourceMappingURL=accordion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","sources":["../../../src/components/accordion/accordion.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\"\nimport { mergeClasses } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport * as tokens from \"../../tokens\"\n\nconst useStyles = makeZenithStyles({\n header: {\n display: \"flex\",\n },\n trigger: {\n outlineColor: tokens.accentA8,\n paddingInline: tokens.spacingElement3,\n paddingBlock: \"1rem\",\n cursor: \"pointer\",\n display: \"flex\",\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: \"0%\",\n alignItems: \"flex-start\",\n gap: tokens.spacingElement3,\n borderRadius: tokens.radiusMd,\n textAlign: \"left\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n fontWeight: tokens.fontWeightMedium,\n transitionProperty: \"all\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n transitionDuration: \"150ms\",\n \":hover\": { backgroundColor: tokens.grayA3 },\n \":focus-visible\": {\n outlineOffset: \"2px\",\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n },\n \":disabled, &[data-disabled]\": {\n pointerEvents: \"none\",\n opacity: 0.5,\n },\n \"&[data-state='open'] > [data-zenith-slot='accordion-icon']\": {\n transform: \"rotate(180deg)\",\n },\n },\n alignStart: {\n justifyContent: \"flex-start\",\n },\n alignEnd: {\n justifyContent: \"space-between\",\n },\n icon: {\n width: \"1.25rem\",\n height: \"1.25rem\",\n color: tokens.grayA11,\n pointerEvents: \"none\",\n flexShrink: 0,\n transform: \"translateY(0)\",\n transitionProperty: \"transform\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n transitionDuration: \"150ms\",\n },\n panel: {\n overflow: \"hidden\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n paddingInline: tokens.spacingElement3,\n paddingBlockStart: tokens.spacingElement1,\n paddingBlockEnd: tokens.spacingElement2,\n \"&[data-state='open']\": {\n animationName: {\n from: { height: \"0\" },\n to: { height: \"var(--radix-accordion-content-height)\" },\n },\n animationDuration: \"200ms\",\n animationTimingFunction: \"cubic-bezier(0, 0, 0.2, 1)\",\n },\n \"&[data-state='closed']\": {\n animationName: {\n from: { height: \"var(--radix-accordion-content-height)\" },\n to: { height: \"0\" },\n },\n animationDuration: \"200ms\",\n animationTimingFunction: \"cubic-bezier(0, 0, 0.2, 1)\",\n },\n },\n inner: {\n paddingInline: \"0\",\n paddingBlock: \"0\",\n },\n})\n\nexport type AccordionType = \"single\" | \"multiple\"\nexport type AccordionAlign = \"start\" | \"end\"\n\nexport type AccordionProps = React.ComponentProps<\n typeof AccordionPrimitive.Root\n>\n\nexport type AccordionItemProps = React.ComponentProps<\n typeof AccordionPrimitive.Item\n>\n\nexport type AccordionTriggerProps = React.ComponentProps<\n typeof AccordionPrimitive.Trigger\n> & {\n align?: AccordionAlign\n}\n\nexport type AccordionContentProps = React.ComponentProps<\n typeof AccordionPrimitive.Content\n>\n\nexport const Accordion = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Root>,\n AccordionProps\n>(function Accordion({ className, ...props }, ref) {\n return (\n <AccordionPrimitive.Root\n ref={ref}\n data-slot=\"accordion\"\n {...{ [SLOT_ATTR]: \"accordion\" }}\n className={className}\n {...props}\n />\n )\n})\n\nexport const AccordionItem = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Item>,\n AccordionItemProps\n>(function AccordionItem({ className, ...props }, ref) {\n return (\n <AccordionPrimitive.Item\n ref={ref}\n data-slot=\"accordion-item\"\n {...{ [SLOT_ATTR]: \"accordion-item\" }}\n className={className}\n {...props}\n />\n )\n})\n\nconst AccordionDownIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function AccordionDownIcon({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <svg\n ref={ref}\n data-slot=\"accordion-icon\"\n {...{ [SLOT_ATTR]: \"accordion-icon\" }}\n className={mergeClasses(styles.icon, className)}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 -960 960 960\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z\" />\n </svg>\n )\n})\n\nexport const AccordionTrigger = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Trigger>,\n AccordionTriggerProps\n>(function AccordionTrigger(\n { className, align = \"end\", children, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <AccordionPrimitive.Header className={styles.header}>\n <AccordionPrimitive.Trigger\n ref={ref}\n data-slot=\"accordion-trigger\"\n {...{ [SLOT_ATTR]: \"accordion-trigger\" }}\n className={mergeClasses(\n styles.trigger,\n align === \"start\" ? styles.alignStart : styles.alignEnd,\n className\n )}\n {...props}\n >\n {align === \"start\" && <AccordionDownIcon />}\n {children}\n {align === \"end\" && <AccordionDownIcon />}\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n )\n})\n\nexport const AccordionContent = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Content>,\n AccordionContentProps\n>(function AccordionContent({ className, children, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <AccordionPrimitive.Content\n ref={ref}\n data-slot=\"accordion-content\"\n {...{ [SLOT_ATTR]: \"accordion-content\" }}\n className={styles.panel}\n {...props}\n >\n <div className={mergeClasses(styles.inner, className)}>{children}</div>\n </AccordionPrimitive.Content>\n )\n})\n"],"names":["useStyles","makeZenithStyles","tokens.accentA8","tokens.spacingElement3","tokens.radiusMd","tokens.textSm","tokens.leadingSm","tokens.fontWeightMedium","tokens.grayA3","tokens.grayA11","tokens.spacingElement1","tokens.spacingElement2","Accordion","React","className","props","ref","jsx","AccordionPrimitive.Root","SLOT_ATTR","AccordionItem","AccordionPrimitive.Item","AccordionDownIcon","styles","mergeClasses","AccordionTrigger","align","children","AccordionPrimitive.Header","jsxs","AccordionPrimitive.Trigger","AccordionContent","AccordionPrimitive.Content"],"mappings":";;;;;;AAQA,MAAMA,IAAYC,EAAiB;AAAA,EACjC,QAAQ;AAAA,IACN,SAAS;AAAA,EAAA;AAAA,EAEX,SAAS;AAAA,IACP,cAAcC;AAAAA,IACd,eAAeC;AAAAA,IACf,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,KAAKA;AAAAA,IACL,cAAcC;AAAAA,IACd,WAAW;AAAA,IACX,UAAUC;AAAAA,IACV,YAAYC;AAAAA,IACZ,YAAYC;AAAAA,IACZ,oBAAoB;AAAA,IACpB,0BAA0B;AAAA,IAC1B,oBAAoB;AAAA,IACpB,UAAU,EAAE,iBAAiBC,EAAO;AAAA,IACpC,kBAAkB;AAAA,MAChB,eAAe;AAAA,MACf,cAAc;AAAA,MACd,cAAc;AAAA,IAAA;AAAA,IAEhB,+BAA+B;AAAA,MAC7B,eAAe;AAAA,MACf,SAAS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K,GAAA,CAAA,CAAkB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAE3C;AAEJ,CAAC,GAEYS,IAAmBlB,EAAM,WAGpC,SAA0B,EAAE,WAAAC,GAAW,UAAAa,GAAU,GAAGZ,EAAA,GAASC,GAAK;AAClE,QAAMO,IAASvB,EAAA;AAEf,SACE,gBAAAiB;AAAA,IAACe;AAAAA,IAAA;AAAA,MACC,KAAAhB;AAAA,MACA,aAAU;AAAA,MACJ,CAACG,CAAS,GAAG;AAAA,MACnB,WAAWI,EAAO;AAAA,MACjB,GAAGR;AAAA,MAEJ,UAAA,gBAAAE,EAAC,SAAI,WAAWO,EAAaD,EAAO,OAAOT,CAAS,GAAI,UAAAa,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAGvE,CAAC;"}
|
|
1
|
+
{"version":3,"file":"accordion.js","sources":["../../../src/components/accordion/accordion.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\"\nimport { mergeClasses, shorthands } from \"@epilot/zenith-runtime/v1\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeZenithStyles } from \"../../styles/make-styles\"\nimport { boxModel, nativeControl } from \"../../styles/host-reset\"\nimport * as tokens from \"../../tokens\"\n\nconst useStyles = makeZenithStyles({\n header: {\n // Radix renders the header as an `<h3>`, whose UA margin and type would otherwise show.\n ...shorthands.margin(0),\n fontSize: \"inherit\",\n fontWeight: \"inherit\",\n display: \"flex\",\n },\n trigger: {\n ...nativeControl,\n outlineColor: tokens.accentA8,\n ...shorthands.paddingInline(tokens.spacingElement3),\n ...shorthands.paddingBlock(\"1rem\"),\n cursor: \"pointer\",\n display: \"flex\",\n flexGrow: 1,\n flexShrink: 1,\n flexBasis: \"0%\",\n alignItems: \"flex-start\",\n gap: tokens.spacingElement3,\n borderRadius: tokens.radiusMd,\n textAlign: \"left\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n fontWeight: tokens.fontWeightMedium,\n transitionProperty: \"all\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n transitionDuration: \"150ms\",\n \":hover\": { backgroundColor: tokens.grayA3 },\n \":focus-visible\": {\n outlineOffset: \"2px\",\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n },\n \":disabled, &[data-disabled]\": {\n pointerEvents: \"none\",\n opacity: 0.5,\n },\n \"&[data-state='open'] > [data-zenith-slot='accordion-icon']\": {\n transform: \"rotate(180deg)\",\n },\n },\n alignStart: {\n justifyContent: \"flex-start\",\n },\n alignEnd: {\n justifyContent: \"space-between\",\n },\n icon: {\n ...boxModel,\n width: \"1.25rem\",\n height: \"1.25rem\",\n color: tokens.grayA11,\n pointerEvents: \"none\",\n flexShrink: 0,\n transform: \"translateY(0)\",\n transitionProperty: \"transform\",\n transitionTimingFunction: \"cubic-bezier(0.4, 0, 0.2, 1)\",\n transitionDuration: \"150ms\",\n },\n panel: {\n ...boxModel,\n overflow: \"hidden\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n paddingInline: tokens.spacingElement3,\n paddingBlockStart: tokens.spacingElement1,\n paddingBlockEnd: tokens.spacingElement2,\n \"&[data-state='open']\": {\n animationName: {\n from: { height: \"0\" },\n to: { height: \"var(--radix-accordion-content-height)\" },\n },\n animationDuration: \"200ms\",\n animationTimingFunction: \"cubic-bezier(0, 0, 0.2, 1)\",\n },\n \"&[data-state='closed']\": {\n animationName: {\n from: { height: \"var(--radix-accordion-content-height)\" },\n to: { height: \"0\" },\n },\n animationDuration: \"200ms\",\n animationTimingFunction: \"cubic-bezier(0, 0, 0.2, 1)\",\n },\n },\n inner: {\n ...boxModel,\n paddingInline: \"0\",\n paddingBlock: \"0\",\n },\n})\n\nexport type AccordionType = \"single\" | \"multiple\"\nexport type AccordionAlign = \"start\" | \"end\"\n\nexport type AccordionProps = React.ComponentProps<\n typeof AccordionPrimitive.Root\n>\n\nexport type AccordionItemProps = React.ComponentProps<\n typeof AccordionPrimitive.Item\n>\n\nexport type AccordionTriggerProps = React.ComponentProps<\n typeof AccordionPrimitive.Trigger\n> & {\n align?: AccordionAlign\n}\n\nexport type AccordionContentProps = React.ComponentProps<\n typeof AccordionPrimitive.Content\n>\n\nexport const Accordion = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Root>,\n AccordionProps\n>(function Accordion({ className, ...props }, ref) {\n return (\n <AccordionPrimitive.Root\n ref={ref}\n data-slot=\"accordion\"\n {...{ [SLOT_ATTR]: \"accordion\" }}\n className={className}\n {...props}\n />\n )\n})\n\nexport const AccordionItem = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Item>,\n AccordionItemProps\n>(function AccordionItem({ className, ...props }, ref) {\n return (\n <AccordionPrimitive.Item\n ref={ref}\n data-slot=\"accordion-item\"\n {...{ [SLOT_ATTR]: \"accordion-item\" }}\n className={className}\n {...props}\n />\n )\n})\n\nconst AccordionDownIcon = React.forwardRef<\n SVGSVGElement,\n React.SVGProps<SVGSVGElement>\n>(function AccordionDownIcon({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <svg\n ref={ref}\n data-slot=\"accordion-icon\"\n {...{ [SLOT_ATTR]: \"accordion-icon\" }}\n className={mergeClasses(styles.icon, className)}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 -960 960 960\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z\" />\n </svg>\n )\n})\n\nexport const AccordionTrigger = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Trigger>,\n AccordionTriggerProps\n>(function AccordionTrigger(\n { className, align = \"end\", children, ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <AccordionPrimitive.Header className={styles.header}>\n <AccordionPrimitive.Trigger\n ref={ref}\n data-slot=\"accordion-trigger\"\n {...{ [SLOT_ATTR]: \"accordion-trigger\" }}\n className={mergeClasses(\n styles.trigger,\n align === \"start\" ? styles.alignStart : styles.alignEnd,\n className\n )}\n {...props}\n >\n {align === \"start\" && <AccordionDownIcon />}\n {children}\n {align === \"end\" && <AccordionDownIcon />}\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n )\n})\n\nexport const AccordionContent = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Content>,\n AccordionContentProps\n>(function AccordionContent({ className, children, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <AccordionPrimitive.Content\n ref={ref}\n data-slot=\"accordion-content\"\n {...{ [SLOT_ATTR]: \"accordion-content\" }}\n className={styles.panel}\n {...props}\n >\n <div className={mergeClasses(styles.inner, className)}>{children}</div>\n </AccordionPrimitive.Content>\n )\n})\n"],"names":["useStyles","makeZenithStyles","shorthands","nativeControl","tokens.accentA8","tokens.spacingElement3","tokens.radiusMd","tokens.textSm","tokens.leadingSm","tokens.fontWeightMedium","tokens.grayA3","boxModel","tokens.grayA11","tokens.spacingElement1","tokens.spacingElement2","Accordion","React","className","props","ref","jsx","AccordionPrimitive.Root","SLOT_ATTR","AccordionItem","AccordionPrimitive.Item","AccordionDownIcon","styles","mergeClasses","AccordionTrigger","align","children","AccordionPrimitive.Header","jsxs","AccordionPrimitive.Trigger","AccordionContent","AccordionPrimitive.Content"],"mappings":";;;;;;;AASA,MAAMA,IAAYC,EAAiB;AAAA,EACjC,QAAQ;AAAA;AAAA,IAEN,GAAGC,EAAW,OAAO,CAAC;AAAA,IACtB,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,SAAS;AAAA,EAAA;AAAA,EAEX,SAAS;AAAA,IACP,GAAGC;AAAA,IACH,cAAcC;AAAAA,IACd,GAAGF,EAAW,cAAcG,CAAsB;AAAA,IAClD,GAAGH,EAAW,aAAa,MAAM;AAAA,IACjC,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,UAAU;AAAA,IACV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AAC,GAAU,GAAGZ,EAAA,GACzCC,GACA;AACA,QAAMO,IAAS1B,EAAA;AAEf,2BACG+B,GAAA,EAA0B,WAAWL,EAAO,QAC3C,UAAA,gBAAAM;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,KAAAd;AAAA,MACA,aAAU;AAAA,MACJ,CAACG,CAAS,GAAG;AAAA,MACnB,WAAWK;AAAA,QACTD,EAAO;AAAA,QACPG,MAAU,UAAUH,EAAO,aAAaA,EAAO;AAAA,QAC/CT;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,MAEH,UAAA;AAAA,QAAAW,MAAU,6BAAYJ,GAAA,CAAA,CAAkB;AAAA,QACxCK;AAAA,QACAD,MAAU,SAAS,gBAAAT,EAACK,GAAA,CAAA,CAAkB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAE3C;AAEJ,CAAC,GAEYS,IAAmBlB,EAAM,WAGpC,SAA0B,EAAE,WAAAC,GAAW,UAAAa,GAAU,GAAGZ,EAAA,GAASC,GAAK;AAClE,QAAMO,IAAS1B,EAAA;AAEf,SACE,gBAAAoB;AAAA,IAACe;AAAAA,IAAA;AAAA,MACC,KAAAhB;AAAA,MACA,aAAU;AAAA,MACJ,CAACG,CAAS,GAAG;AAAA,MACnB,WAAWI,EAAO;AAAA,MACjB,GAAGR;AAAA,MAEJ,UAAA,gBAAAE,EAAC,SAAI,WAAWO,EAAaD,EAAO,OAAOT,CAAS,GAAI,UAAAa,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAGvE,CAAC;"}
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as b, Fragment as R } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "react";
|
|
3
|
-
import { Root as
|
|
4
|
-
import { SLOT_ATTR as
|
|
5
|
-
import { useAppearanceAttributes as
|
|
6
|
-
import { useDensity as
|
|
7
|
-
import { makeZenithStyles as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
3
|
+
import { Root as T, Action as C, Cancel as v, Content as w, Description as N, Overlay as S, Portal as z, Title as F, Trigger as W } from "../../vendor/.bun/@radix-ui_react-alert-dialog@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-alert-dialog/dist/index.js";
|
|
4
|
+
import { SLOT_ATTR as l, mergeClasses as d, shorthands as s } from "@epilot/zenith-runtime/v1";
|
|
5
|
+
import { useAppearanceAttributes as A } from "../appearance-boundary/appearance-boundary.js";
|
|
6
|
+
import { useDensity as O } from "../density-provider/density-provider.js";
|
|
7
|
+
import { makeZenithStyles as X } from "../../styles/make-styles.js";
|
|
8
|
+
import { boxModel as f, nativeControl as _ } from "../../styles/host-reset.js";
|
|
9
|
+
import { OVERLAY_Z_INDEX as u } from "../../styles/overlay-layer.js";
|
|
10
|
+
import { grayA11 as H, leadingSm as I, textSm as P, grayA12 as j, fontWeightSemibold as k, leadingXl as E, textXl as L, containerXl as M, containerLg as Z, containerMd as B, containerSm as G, body as V, spacingElement2 as y, spacingGroup2 as D, grayA1 as Y, radiusXl as q } from "../../tokens/index.js";
|
|
11
|
+
import { Button as x } from "../button/button.js";
|
|
12
|
+
const m = X({
|
|
13
|
+
// For the bare native `<button>` a Trigger/Close renders. Not applied under `asChild`, where the
|
|
14
|
+
// child owns its own element and two atom sets would race for the same properties.
|
|
15
|
+
nativeTrigger: {
|
|
16
|
+
..._
|
|
17
|
+
},
|
|
11
18
|
overlay: {
|
|
12
19
|
position: "fixed",
|
|
13
20
|
top: 0,
|
|
14
21
|
right: 0,
|
|
15
22
|
bottom: 0,
|
|
16
23
|
left: 0,
|
|
17
|
-
zIndex:
|
|
24
|
+
zIndex: u,
|
|
18
25
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
19
26
|
"&[data-state='open']": {
|
|
20
27
|
animationName: {
|
|
@@ -34,22 +41,33 @@ const m = W({
|
|
|
34
41
|
}
|
|
35
42
|
},
|
|
36
43
|
content: {
|
|
37
|
-
|
|
44
|
+
...f,
|
|
45
|
+
backgroundColor: V,
|
|
38
46
|
position: "fixed",
|
|
39
47
|
top: "50%",
|
|
40
48
|
left: "50%",
|
|
41
49
|
transform: "translate(-50%, -50%)",
|
|
42
|
-
zIndex:
|
|
50
|
+
zIndex: u,
|
|
43
51
|
display: "grid",
|
|
44
52
|
width: "100%",
|
|
45
53
|
maxWidth: "calc(100% - 2rem)",
|
|
46
|
-
...
|
|
47
|
-
...
|
|
48
|
-
...
|
|
49
|
-
...
|
|
54
|
+
...s.gap(D),
|
|
55
|
+
...s.borderRadius(q),
|
|
56
|
+
...s.border("1px", "solid", Y),
|
|
57
|
+
...s.padding(D),
|
|
50
58
|
// v1 shadow-lg
|
|
51
59
|
boxShadow: "0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a",
|
|
52
60
|
outlineStyle: "none",
|
|
61
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
62
|
+
animationDuration: "0.01ms",
|
|
63
|
+
animationIterationCount: "1",
|
|
64
|
+
"&[data-state='open']": {
|
|
65
|
+
animationDuration: "0.01ms"
|
|
66
|
+
},
|
|
67
|
+
"&[data-state='closed']": {
|
|
68
|
+
animationDuration: "0.01ms"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
53
71
|
"&[data-state='open']": {
|
|
54
72
|
animationName: {
|
|
55
73
|
from: {
|
|
@@ -80,196 +98,206 @@ const m = W({
|
|
|
80
98
|
}
|
|
81
99
|
},
|
|
82
100
|
sm: {
|
|
83
|
-
|
|
101
|
+
...f,
|
|
102
|
+
maxWidth: G
|
|
84
103
|
},
|
|
85
104
|
md: {
|
|
105
|
+
...f,
|
|
86
106
|
maxWidth: B
|
|
87
107
|
},
|
|
88
108
|
lg: {
|
|
89
|
-
|
|
109
|
+
...f,
|
|
110
|
+
maxWidth: Z
|
|
90
111
|
},
|
|
91
112
|
xl: {
|
|
113
|
+
...f,
|
|
92
114
|
"@media (min-width: 640px)": {
|
|
93
|
-
maxWidth:
|
|
115
|
+
maxWidth: M
|
|
94
116
|
}
|
|
95
117
|
},
|
|
96
118
|
header: {
|
|
97
119
|
display: "flex",
|
|
98
120
|
flexDirection: "column",
|
|
99
|
-
...
|
|
121
|
+
...s.gap(y),
|
|
100
122
|
textAlign: "left"
|
|
101
123
|
},
|
|
102
124
|
footer: {
|
|
103
125
|
display: "flex",
|
|
104
|
-
...
|
|
126
|
+
...s.gap(y),
|
|
105
127
|
justifyContent: "flex-end"
|
|
106
128
|
},
|
|
107
129
|
title: {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
130
|
+
...s.margin(0),
|
|
131
|
+
fontSize: L,
|
|
132
|
+
lineHeight: E,
|
|
133
|
+
fontWeight: k,
|
|
134
|
+
color: j
|
|
112
135
|
},
|
|
113
136
|
description: {
|
|
137
|
+
...s.margin(0),
|
|
114
138
|
fontSize: P,
|
|
115
|
-
lineHeight:
|
|
116
|
-
color:
|
|
139
|
+
lineHeight: I,
|
|
140
|
+
color: H
|
|
117
141
|
}
|
|
118
|
-
}),
|
|
142
|
+
}), nt = i.forwardRef(
|
|
119
143
|
function(t, a) {
|
|
120
|
-
return /* @__PURE__ */ r(
|
|
144
|
+
return /* @__PURE__ */ r(T, { "data-slot": "alert-dialog", ...t });
|
|
121
145
|
}
|
|
122
|
-
),
|
|
146
|
+
), lt = i.forwardRef(function({ className: t, ...a }, o) {
|
|
147
|
+
const e = m();
|
|
123
148
|
return /* @__PURE__ */ r(
|
|
124
|
-
|
|
149
|
+
W,
|
|
125
150
|
{
|
|
126
151
|
ref: o,
|
|
127
152
|
"data-slot": "alert-dialog-trigger",
|
|
128
|
-
[
|
|
129
|
-
className:
|
|
153
|
+
[l]: "alert-dialog-trigger",
|
|
154
|
+
className: d(
|
|
155
|
+
!a.asChild && e.nativeTrigger,
|
|
156
|
+
t
|
|
157
|
+
),
|
|
130
158
|
...a
|
|
131
159
|
}
|
|
132
160
|
);
|
|
133
|
-
}),
|
|
161
|
+
}), st = i.forwardRef(function(t, a) {
|
|
134
162
|
return /* @__PURE__ */ r(
|
|
135
|
-
|
|
163
|
+
z,
|
|
136
164
|
{
|
|
137
165
|
"data-slot": "alert-dialog-portal",
|
|
138
|
-
[
|
|
166
|
+
[l]: "alert-dialog-portal",
|
|
139
167
|
...t
|
|
140
168
|
}
|
|
141
169
|
);
|
|
142
|
-
}),
|
|
143
|
-
const e = m(),
|
|
170
|
+
}), J = i.forwardRef(function({ className: t, ...a }, o) {
|
|
171
|
+
const e = m(), c = A();
|
|
144
172
|
return /* @__PURE__ */ r(
|
|
145
|
-
|
|
173
|
+
S,
|
|
146
174
|
{
|
|
147
175
|
ref: o,
|
|
148
176
|
"data-slot": "alert-dialog-overlay",
|
|
149
|
-
[
|
|
150
|
-
...
|
|
151
|
-
className:
|
|
177
|
+
[l]: "alert-dialog-overlay",
|
|
178
|
+
...c,
|
|
179
|
+
className: d(e.overlay, t),
|
|
152
180
|
...a
|
|
153
181
|
}
|
|
154
182
|
);
|
|
155
|
-
}),
|
|
156
|
-
const
|
|
157
|
-
return /* @__PURE__ */
|
|
158
|
-
/* @__PURE__ */ r(
|
|
183
|
+
}), ct = i.forwardRef(function({ className: t, size: a = "xl", children: o, ...e }, c) {
|
|
184
|
+
const g = m(), p = O(), h = A();
|
|
185
|
+
return /* @__PURE__ */ b(R, { children: [
|
|
186
|
+
/* @__PURE__ */ r(J, {}),
|
|
159
187
|
/* @__PURE__ */ r(
|
|
160
188
|
w,
|
|
161
189
|
{
|
|
162
|
-
ref:
|
|
190
|
+
ref: c,
|
|
163
191
|
"data-slot": "alert-dialog-content",
|
|
164
|
-
[
|
|
165
|
-
...
|
|
166
|
-
...
|
|
167
|
-
className: g
|
|
192
|
+
[l]: "alert-dialog-content",
|
|
193
|
+
...p !== void 0 ? { "data-density": p } : {},
|
|
194
|
+
...h,
|
|
195
|
+
className: d(g.content, g[a], t),
|
|
168
196
|
...e,
|
|
169
197
|
children: o
|
|
170
198
|
}
|
|
171
199
|
)
|
|
172
200
|
] });
|
|
173
|
-
}),
|
|
201
|
+
}), dt = i.forwardRef(function({ className: t, ...a }, o) {
|
|
174
202
|
const e = m();
|
|
175
203
|
return /* @__PURE__ */ r(
|
|
176
204
|
"div",
|
|
177
205
|
{
|
|
178
206
|
ref: o,
|
|
179
207
|
"data-slot": "alert-dialog-header",
|
|
180
|
-
[
|
|
181
|
-
className:
|
|
208
|
+
[l]: "alert-dialog-header",
|
|
209
|
+
className: d(e.header, t),
|
|
182
210
|
...a
|
|
183
211
|
}
|
|
184
212
|
);
|
|
185
|
-
}),
|
|
213
|
+
}), mt = i.forwardRef(function({ className: t, ...a }, o) {
|
|
186
214
|
const e = m();
|
|
187
215
|
return /* @__PURE__ */ r(
|
|
188
216
|
"div",
|
|
189
217
|
{
|
|
190
218
|
ref: o,
|
|
191
219
|
"data-slot": "alert-dialog-footer",
|
|
192
|
-
[
|
|
193
|
-
className:
|
|
220
|
+
[l]: "alert-dialog-footer",
|
|
221
|
+
className: d(e.footer, t),
|
|
194
222
|
...a
|
|
195
223
|
}
|
|
196
224
|
);
|
|
197
|
-
}),
|
|
225
|
+
}), gt = i.forwardRef(function({ className: t, ...a }, o) {
|
|
198
226
|
const e = m();
|
|
199
227
|
return /* @__PURE__ */ r(
|
|
200
|
-
|
|
228
|
+
F,
|
|
201
229
|
{
|
|
202
230
|
ref: o,
|
|
203
231
|
"data-slot": "alert-dialog-title",
|
|
204
|
-
[
|
|
205
|
-
className:
|
|
232
|
+
[l]: "alert-dialog-title",
|
|
233
|
+
className: d(e.title, t),
|
|
206
234
|
...a
|
|
207
235
|
}
|
|
208
236
|
);
|
|
209
|
-
}),
|
|
237
|
+
}), ft = i.forwardRef(function({ className: t, ...a }, o) {
|
|
210
238
|
const e = m();
|
|
211
239
|
return /* @__PURE__ */ r(
|
|
212
|
-
|
|
240
|
+
N,
|
|
213
241
|
{
|
|
214
242
|
ref: o,
|
|
215
243
|
"data-slot": "alert-dialog-description",
|
|
216
|
-
[
|
|
217
|
-
className:
|
|
244
|
+
[l]: "alert-dialog-description",
|
|
245
|
+
className: d(e.description, t),
|
|
218
246
|
...a
|
|
219
247
|
}
|
|
220
248
|
);
|
|
221
|
-
}),
|
|
249
|
+
}), pt = i.forwardRef(function({
|
|
222
250
|
variant: t = "primary",
|
|
223
251
|
size: a = "base",
|
|
224
252
|
destructive: o = !1,
|
|
225
253
|
className: e,
|
|
226
|
-
...
|
|
227
|
-
},
|
|
228
|
-
return /* @__PURE__ */ r(
|
|
229
|
-
|
|
254
|
+
...c
|
|
255
|
+
}, g) {
|
|
256
|
+
return /* @__PURE__ */ r(C, { asChild: !0, children: /* @__PURE__ */ r(
|
|
257
|
+
x,
|
|
230
258
|
{
|
|
231
|
-
ref:
|
|
259
|
+
ref: g,
|
|
232
260
|
"data-slot": "alert-dialog-action",
|
|
233
|
-
[
|
|
261
|
+
[l]: "alert-dialog-action",
|
|
234
262
|
variant: t,
|
|
235
263
|
size: a,
|
|
236
264
|
destructive: o,
|
|
237
265
|
className: e,
|
|
238
|
-
...
|
|
266
|
+
...c
|
|
239
267
|
}
|
|
240
268
|
) });
|
|
241
|
-
}),
|
|
269
|
+
}), ut = i.forwardRef(function({
|
|
242
270
|
variant: t = "secondary",
|
|
243
271
|
size: a = "base",
|
|
244
272
|
destructive: o = !1,
|
|
245
273
|
className: e,
|
|
246
|
-
...
|
|
247
|
-
},
|
|
248
|
-
return /* @__PURE__ */ r(
|
|
249
|
-
|
|
274
|
+
...c
|
|
275
|
+
}, g) {
|
|
276
|
+
return /* @__PURE__ */ r(v, { asChild: !0, children: /* @__PURE__ */ r(
|
|
277
|
+
x,
|
|
250
278
|
{
|
|
251
|
-
ref:
|
|
279
|
+
ref: g,
|
|
252
280
|
"data-slot": "alert-dialog-cancel",
|
|
253
|
-
[
|
|
281
|
+
[l]: "alert-dialog-cancel",
|
|
254
282
|
variant: t,
|
|
255
283
|
size: a,
|
|
256
284
|
destructive: o,
|
|
257
285
|
className: e,
|
|
258
|
-
...
|
|
286
|
+
...c
|
|
259
287
|
}
|
|
260
288
|
) });
|
|
261
289
|
});
|
|
262
290
|
export {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
291
|
+
nt as AlertDialog,
|
|
292
|
+
pt as AlertDialogAction,
|
|
293
|
+
ut as AlertDialogCancel,
|
|
294
|
+
ct as AlertDialogContent,
|
|
295
|
+
ft as AlertDialogDescription,
|
|
296
|
+
mt as AlertDialogFooter,
|
|
297
|
+
dt as AlertDialogHeader,
|
|
298
|
+
J as AlertDialogOverlay,
|
|
299
|
+
st as AlertDialogPortal,
|
|
300
|
+
gt as AlertDialogTitle,
|
|
301
|
+
lt as AlertDialogTrigger
|
|
274
302
|
};
|
|
275
303
|
//# sourceMappingURL=alert-dialog.js.map
|