@refinn/core-ui 0.1.1 → 0.1.3
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/index.d.mts +49 -20
- package/dist/index.d.ts +49 -20
- package/dist/index.js +726 -472
- package/dist/index.mjs +721 -473
- package/dist/theme.css +648 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -38,29 +38,6 @@ import {
|
|
|
38
38
|
useState
|
|
39
39
|
} from "react";
|
|
40
40
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
41
|
-
var sizeClasses = {
|
|
42
|
-
small: {
|
|
43
|
-
trigger: "px-3 py-2.5",
|
|
44
|
-
title: "text-sm leading-5",
|
|
45
|
-
subtitle: "text-xs leading-4",
|
|
46
|
-
content: "px-3 pb-3 text-sm leading-5",
|
|
47
|
-
icon: "h-4 w-4"
|
|
48
|
-
},
|
|
49
|
-
medium: {
|
|
50
|
-
trigger: "px-4 py-3",
|
|
51
|
-
title: "text-base leading-6",
|
|
52
|
-
subtitle: "text-sm leading-5",
|
|
53
|
-
content: "px-4 pb-4 text-sm leading-5",
|
|
54
|
-
icon: "h-5 w-5"
|
|
55
|
-
},
|
|
56
|
-
large: {
|
|
57
|
-
trigger: "px-5 py-4",
|
|
58
|
-
title: "text-lg leading-7",
|
|
59
|
-
subtitle: "text-sm leading-5",
|
|
60
|
-
content: "px-5 pb-5 text-base leading-6",
|
|
61
|
-
icon: "h-5 w-5"
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
41
|
function ChevronIcon({ className }) {
|
|
65
42
|
return /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
|
|
66
43
|
"path",
|
|
@@ -73,26 +50,16 @@ function ChevronIcon({ className }) {
|
|
|
73
50
|
}
|
|
74
51
|
) });
|
|
75
52
|
}
|
|
76
|
-
function AccordionItem({ item,
|
|
77
|
-
const sz = sizeClasses[size];
|
|
53
|
+
function AccordionItem({ item, isOpen, onToggle, generatedId }) {
|
|
78
54
|
const triggerId = `${generatedId}-trigger`;
|
|
79
55
|
const panelId = `${generatedId}-panel`;
|
|
80
|
-
const triggerClasses = [
|
|
81
|
-
"flex w-full items-center justify-between gap-2 text-left font-sans font-medium",
|
|
82
|
-
"transition-colors duration-150",
|
|
83
|
-
"outline-none",
|
|
84
|
-
sz.trigger,
|
|
85
|
-
sz.title,
|
|
86
|
-
item.disabled ? "cursor-not-allowed text-accordion-text-disabled" : "cursor-pointer text-accordion-text hover:bg-accordion-bg-hover active:bg-accordion-bg-active focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accordion-border-focus"
|
|
87
|
-
].join(" ");
|
|
88
56
|
const iconClasses = [
|
|
89
|
-
|
|
90
|
-
"shrink-0 transition-transform duration-200",
|
|
57
|
+
"shrink-0 transition-transform duration-200 text-accordion-icon h-28 w-28 p-4 my-8 mx-12 lg:h-40 lg:w-40 lg:p-8 lg:mx-12 lg:my-8",
|
|
91
58
|
isOpen ? "rotate-180" : "",
|
|
92
|
-
item.disabled ? "text-
|
|
59
|
+
item.disabled ? "text-static-icon-disabled" : "text-static-icon-primary"
|
|
93
60
|
].join(" ");
|
|
94
61
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
95
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ jsxs(
|
|
96
63
|
"button",
|
|
97
64
|
{
|
|
98
65
|
id: triggerId,
|
|
@@ -100,21 +67,31 @@ function AccordionItem({ item, size, isOpen, onToggle, generatedId }) {
|
|
|
100
67
|
"aria-expanded": isOpen,
|
|
101
68
|
"aria-controls": panelId,
|
|
102
69
|
disabled: item.disabled,
|
|
103
|
-
className:
|
|
70
|
+
className: "flex flex-row items-center justify-between w-full pl-16 pr-8 py-8 lg:pl-24 lg:py-16 lg:pr-12",
|
|
104
71
|
onClick: onToggle,
|
|
105
72
|
children: [
|
|
106
|
-
/* @__PURE__ */ jsxs("span", { className:
|
|
107
|
-
/* @__PURE__ */ jsx(
|
|
73
|
+
/* @__PURE__ */ jsxs("span", { className: `flex flex-col`, children: [
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
"span",
|
|
76
|
+
{
|
|
77
|
+
className: `
|
|
78
|
+
text-label-large
|
|
79
|
+
text-start
|
|
80
|
+
lg:text-heading-3
|
|
81
|
+
${item.disabled ? "text-accordion-text-disabled" : "text-accordion-text-primary"}
|
|
82
|
+
`,
|
|
83
|
+
children: item.title
|
|
84
|
+
}
|
|
85
|
+
),
|
|
108
86
|
item.subtitle && /* @__PURE__ */ jsx("span", { className: [
|
|
109
|
-
|
|
110
|
-
"font-normal",
|
|
87
|
+
"text-body-small",
|
|
111
88
|
item.disabled ? "text-accordion-text-disabled" : "text-accordion-text-secondary"
|
|
112
89
|
].join(" "), children: item.subtitle })
|
|
113
90
|
] }),
|
|
114
91
|
/* @__PURE__ */ jsx(ChevronIcon, { className: iconClasses })
|
|
115
92
|
]
|
|
116
93
|
}
|
|
117
|
-
)
|
|
94
|
+
),
|
|
118
95
|
/* @__PURE__ */ jsx(
|
|
119
96
|
"div",
|
|
120
97
|
{
|
|
@@ -123,7 +100,7 @@ function AccordionItem({ item, size, isOpen, onToggle, generatedId }) {
|
|
|
123
100
|
"aria-labelledby": triggerId,
|
|
124
101
|
className: "overflow-hidden transition-[grid-template-rows] duration-200",
|
|
125
102
|
style: { display: "grid", gridTemplateRows: isOpen ? "1fr" : "0fr" },
|
|
126
|
-
children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx("div", { className:
|
|
103
|
+
children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: `text-accordion-text-secondary text-body-small pt-8 pb-16 px-16 lg:text-body-regular lg:pl-24 lg:pr-64 lg:pb-24 lg:pt-12`, children: item.content }) })
|
|
127
104
|
}
|
|
128
105
|
)
|
|
129
106
|
] });
|
|
@@ -132,13 +109,11 @@ var Accordion = forwardRef(
|
|
|
132
109
|
(_a, ref) => {
|
|
133
110
|
var _b = _a, {
|
|
134
111
|
items,
|
|
135
|
-
size = "medium",
|
|
136
112
|
multiple = false,
|
|
137
113
|
loading = false,
|
|
138
114
|
className = ""
|
|
139
115
|
} = _b, rest = __objRest(_b, [
|
|
140
116
|
"items",
|
|
141
|
-
"size",
|
|
142
117
|
"multiple",
|
|
143
118
|
"loading",
|
|
144
119
|
"className"
|
|
@@ -173,10 +148,9 @@ var Accordion = forwardRef(
|
|
|
173
148
|
className
|
|
174
149
|
].filter(Boolean).join(" ");
|
|
175
150
|
if (loading) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
/* @__PURE__ */ jsx(
|
|
179
|
-
/* @__PURE__ */ jsx(ChevronIcon, { className: `${sz.icon} shrink-0 text-accordion-icon` })
|
|
151
|
+
return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ jsxs("div", { className: `flex items-center justify-between gap-8 pl-16 pr-8 py-8`, children: [
|
|
152
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 flex flex-col gap-4", children: /* @__PURE__ */ jsx("div", { className: "h-16 w-3/4 rounded bg-gray-200 animate-pulse" }) }),
|
|
153
|
+
/* @__PURE__ */ jsx(ChevronIcon, { className: `shrink-0 text-accordion-icon w-20 h-20 my-8 mx-12` })
|
|
180
154
|
] }) }));
|
|
181
155
|
}
|
|
182
156
|
return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: items.map((item, i) => {
|
|
@@ -186,7 +160,6 @@ var Accordion = forwardRef(
|
|
|
186
160
|
AccordionItem,
|
|
187
161
|
{
|
|
188
162
|
item,
|
|
189
|
-
size,
|
|
190
163
|
isOpen: openItems.has(itemId),
|
|
191
164
|
onToggle: () => handleToggle(itemId),
|
|
192
165
|
generatedId: `${baseId}-${itemId}`
|
|
@@ -200,27 +173,41 @@ Accordion.displayName = "Accordion";
|
|
|
200
173
|
|
|
201
174
|
// src/components/AlertBanner/AlertBanner.tsx
|
|
202
175
|
import { forwardRef as forwardRef2 } from "react";
|
|
203
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
204
|
-
var inlineClasses = {
|
|
205
|
-
info: "bg-alert-inline-info-bg border-alert-inline-info-border text-alert-text-primary",
|
|
206
|
-
success: "bg-alert-inline-success-bg border-alert-inline-success-border text-alert-text-primary",
|
|
207
|
-
warning: "bg-alert-inline-warning-bg border-alert-inline-warning-border text-alert-text-primary",
|
|
208
|
-
danger: "bg-alert-inline-danger-bg border-alert-inline-danger-border text-alert-text-primary",
|
|
209
|
-
common: "bg-alert-inline-common-bg border-alert-inline-common-border text-alert-text-primary"
|
|
210
|
-
};
|
|
176
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
211
177
|
var pageClasses = {
|
|
212
178
|
info: "bg-alert-page-info-bg text-alert-text-primary-inverse",
|
|
213
179
|
success: "bg-alert-page-success-bg text-alert-text-primary-inverse",
|
|
214
180
|
warning: "bg-alert-page-warning-bg text-alert-text-primary-inverse",
|
|
215
181
|
danger: "bg-alert-page-danger-bg text-alert-text-primary-inverse",
|
|
216
|
-
|
|
182
|
+
none: "bg-alert-page-common-bg text-alert-text-primary-inverse"
|
|
183
|
+
};
|
|
184
|
+
var SectionClasses = {
|
|
185
|
+
info: "bg-alert-banner-background-info-subtle text-alert-text-primary",
|
|
186
|
+
success: "bg-alert-banner-background-success-subtle text-alert-text-primary",
|
|
187
|
+
warning: "bg-alert-banner-background-warning-subtle text-alert-text-primary",
|
|
188
|
+
danger: "bg-alert-banner-background-danger-subtle text-alert-text-primary",
|
|
189
|
+
none: "bg-alert-banner-background-common-subtle text-alert-text-primary"
|
|
190
|
+
};
|
|
191
|
+
var inlineClasses = {
|
|
192
|
+
info: "bg-alert-banner-background-transparent text-alert-text-primary",
|
|
193
|
+
success: "bg-alert-banner-background-transparent text-alert-text-primary",
|
|
194
|
+
warning: "bg-alert-banner-background-transparent text-alert-text-primary",
|
|
195
|
+
danger: "bg-alert-banner-background-transparent text-alert-text-primary",
|
|
196
|
+
none: "bg-alert-banner-background-transparent text-alert-text-primary"
|
|
197
|
+
};
|
|
198
|
+
var actionsPageClasses = {
|
|
199
|
+
info: "text-enabled-inverse",
|
|
200
|
+
success: "text-enabled-inverse",
|
|
201
|
+
warning: "text-enabled-dark",
|
|
202
|
+
danger: "text-enabled-inverse",
|
|
203
|
+
none: "text-enabled-inverse"
|
|
217
204
|
};
|
|
218
205
|
var inlineIconClasses = {
|
|
219
206
|
info: "text-alert-inline-info-icon",
|
|
220
207
|
success: "text-alert-inline-success-icon",
|
|
221
208
|
warning: "text-alert-inline-warning-icon",
|
|
222
209
|
danger: "text-alert-inline-danger-icon",
|
|
223
|
-
|
|
210
|
+
none: "text-alert-inline-common-icon"
|
|
224
211
|
};
|
|
225
212
|
function InfoIcon({ className }) {
|
|
226
213
|
return /* @__PURE__ */ jsx2("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx2("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM10 6h.01M9 10h1v4h1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
@@ -237,8 +224,8 @@ function WarningIcon({ className }) {
|
|
|
237
224
|
function DangerIcon({ className }) {
|
|
238
225
|
return /* @__PURE__ */ jsx2("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx2("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM12.5 7.5l-5 5M7.5 7.5l5 5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
239
226
|
}
|
|
240
|
-
function
|
|
241
|
-
return /* @__PURE__ */ jsx2(
|
|
227
|
+
function NoneIcon({ className }) {
|
|
228
|
+
return /* @__PURE__ */ jsx2(Fragment, {});
|
|
242
229
|
}
|
|
243
230
|
function CloseIcon({ className }) {
|
|
244
231
|
return /* @__PURE__ */ jsx2("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx2("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
@@ -248,7 +235,7 @@ var defaultIcons = {
|
|
|
248
235
|
success: SuccessIcon,
|
|
249
236
|
warning: WarningIcon,
|
|
250
237
|
danger: DangerIcon,
|
|
251
|
-
|
|
238
|
+
none: NoneIcon
|
|
252
239
|
};
|
|
253
240
|
var AlertBanner = forwardRef2(
|
|
254
241
|
(_a, ref) => {
|
|
@@ -257,6 +244,7 @@ var AlertBanner = forwardRef2(
|
|
|
257
244
|
mode = "inline",
|
|
258
245
|
title,
|
|
259
246
|
description,
|
|
247
|
+
action,
|
|
260
248
|
icon,
|
|
261
249
|
onClose,
|
|
262
250
|
className = "",
|
|
@@ -266,40 +254,48 @@ var AlertBanner = forwardRef2(
|
|
|
266
254
|
"mode",
|
|
267
255
|
"title",
|
|
268
256
|
"description",
|
|
257
|
+
"action",
|
|
269
258
|
"icon",
|
|
270
259
|
"onClose",
|
|
271
260
|
"className",
|
|
272
261
|
"children"
|
|
273
262
|
]);
|
|
274
263
|
const isPage = mode === "page";
|
|
275
|
-
const
|
|
264
|
+
const isSection = mode === "section";
|
|
265
|
+
const variantClass = isPage ? pageClasses[variant] : isSection ? SectionClasses[variant] : inlineClasses[variant];
|
|
266
|
+
const actionClass = isPage ? actionsPageClasses[variant] : "text-enabled";
|
|
276
267
|
const DefaultIcon = defaultIcons[variant];
|
|
277
268
|
const iconColorClass = isPage ? "" : inlineIconClasses[variant];
|
|
278
269
|
const descColorClass = isPage ? "text-alert-text-secondary-inverse" : "text-alert-text-secondary";
|
|
279
270
|
const closeColorClass = isPage ? "text-alert-close-inverse hover:text-alert-close-inverse-hover" : "text-alert-close hover:text-alert-close-hover";
|
|
280
271
|
const classes = [
|
|
281
|
-
"flex items-start gap-
|
|
282
|
-
isPage ? "
|
|
272
|
+
"flex items-start gap-24 font-sans justify-between",
|
|
273
|
+
isPage ? "p-12" : isSection ? "p-12 rounded-md" : "p-0",
|
|
283
274
|
variantClass,
|
|
284
275
|
className
|
|
285
276
|
].filter(Boolean).join(" ");
|
|
286
277
|
return /* @__PURE__ */ jsxs2("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
287
|
-
/* @__PURE__ */
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
278
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-8", children: [
|
|
279
|
+
icon != null ? icon : /* @__PURE__ */ jsx2(DefaultIcon, { className: `h-20 w-20 ${iconColorClass}` }),
|
|
280
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex-1 min-w-0 flex flex-col", children: [
|
|
281
|
+
title && /* @__PURE__ */ jsx2("p", { className: "text-label-medium", children: title }),
|
|
282
|
+
description && /* @__PURE__ */ jsx2("p", { className: `text-body-small ${descColorClass} ${title ? "mt-2" : ""} ${children ? "mb-8" : ""}`, children: description }),
|
|
283
|
+
children
|
|
284
|
+
] })
|
|
292
285
|
] }),
|
|
293
|
-
|
|
294
|
-
"
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
286
|
+
/* @__PURE__ */ jsxs2("div", { className: `flex ${children ? "items-start" : "self-center"} gap-24`, children: [
|
|
287
|
+
(action == null ? void 0 : action[0]) && /* @__PURE__ */ jsx2("a", { className: `${actionClass} underline text-sm font-medium`, href: action[1], children: action[0] }),
|
|
288
|
+
onClose && /* @__PURE__ */ jsx2(
|
|
289
|
+
"button",
|
|
290
|
+
{
|
|
291
|
+
type: "button",
|
|
292
|
+
onClick: onClose,
|
|
293
|
+
className: `shrink-0 p-2 rounded transition-colors ${closeColorClass}`,
|
|
294
|
+
"aria-label": "Close",
|
|
295
|
+
children: /* @__PURE__ */ jsx2(CloseIcon, { className: "h-16 w-16" })
|
|
296
|
+
}
|
|
297
|
+
)
|
|
298
|
+
] })
|
|
303
299
|
] }));
|
|
304
300
|
}
|
|
305
301
|
);
|
|
@@ -308,18 +304,17 @@ AlertBanner.displayName = "AlertBanner";
|
|
|
308
304
|
// src/components/Avatar/Avatar.tsx
|
|
309
305
|
import { forwardRef as forwardRef3 } from "react";
|
|
310
306
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
311
|
-
var
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
xl: { container: "h-14 w-14", text: "text-lg", status: "h-4 w-4", statusRing: "ring-2" },
|
|
317
|
-
"2xl": { container: "h-16 w-16", text: "text-xl", status: "h-4 w-4", statusRing: "ring-2" }
|
|
307
|
+
var sizeClasses = {
|
|
308
|
+
sm: { container: "h-24 w-24", text: "text-sm", status: "h-6 w-6", statusRing: "ring-1" },
|
|
309
|
+
md: { container: "h-32 w-32", text: "text-base", status: "h-8 w-8", statusRing: "ring-[1.5px]" },
|
|
310
|
+
lg: { container: "h-40 w-40", text: "text-lg", status: "h-10 w-10", statusRing: "ring-2" },
|
|
311
|
+
xl: { container: "h-48 w-48", text: "text-xl", status: "h-12 w-12", statusRing: "ring-2" }
|
|
318
312
|
};
|
|
319
313
|
var statusColorClasses = {
|
|
320
314
|
online: "bg-avatar-status-online",
|
|
321
315
|
offline: "bg-avatar-status-offline",
|
|
322
|
-
busy: "bg-avatar-status-busy"
|
|
316
|
+
busy: "bg-avatar-status-busy",
|
|
317
|
+
"": ""
|
|
323
318
|
};
|
|
324
319
|
function getInitials(name) {
|
|
325
320
|
const parts = name.trim().split(/\s+/);
|
|
@@ -333,7 +328,6 @@ var Avatar = forwardRef3(
|
|
|
333
328
|
(_a, ref) => {
|
|
334
329
|
var _b = _a, {
|
|
335
330
|
size = "md",
|
|
336
|
-
shape = "circle",
|
|
337
331
|
src,
|
|
338
332
|
alt = "",
|
|
339
333
|
name,
|
|
@@ -342,7 +336,6 @@ var Avatar = forwardRef3(
|
|
|
342
336
|
className = ""
|
|
343
337
|
} = _b, rest = __objRest(_b, [
|
|
344
338
|
"size",
|
|
345
|
-
"shape",
|
|
346
339
|
"src",
|
|
347
340
|
"alt",
|
|
348
341
|
"name",
|
|
@@ -350,15 +343,13 @@ var Avatar = forwardRef3(
|
|
|
350
343
|
"status",
|
|
351
344
|
"className"
|
|
352
345
|
]);
|
|
353
|
-
const sz =
|
|
354
|
-
const roundedClass = shape === "circle" ? "rounded-full" : "rounded-lg";
|
|
346
|
+
const sz = sizeClasses[size];
|
|
355
347
|
const containerClasses = [
|
|
356
|
-
"relative inline-flex items-center justify-center shrink-0",
|
|
348
|
+
"relative inline-flex items-center justify-center shrink-0 rounded-full",
|
|
357
349
|
"bg-avatar-bg text-avatar-text font-medium font-sans",
|
|
358
350
|
"transition-colors duration-150",
|
|
359
351
|
"select-none",
|
|
360
352
|
sz.container,
|
|
361
|
-
roundedClass,
|
|
362
353
|
className
|
|
363
354
|
].filter(Boolean).join(" ");
|
|
364
355
|
let content;
|
|
@@ -368,7 +359,7 @@ var Avatar = forwardRef3(
|
|
|
368
359
|
{
|
|
369
360
|
src,
|
|
370
361
|
alt: alt || name || "",
|
|
371
|
-
className:
|
|
362
|
+
className: "h-full w-full object-cover rounded-full"
|
|
372
363
|
}
|
|
373
364
|
);
|
|
374
365
|
} else if (icon) {
|
|
@@ -400,83 +391,45 @@ Avatar.displayName = "Avatar";
|
|
|
400
391
|
// src/components/Badge/Badge.tsx
|
|
401
392
|
import { forwardRef as forwardRef4 } from "react";
|
|
402
393
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
403
|
-
var
|
|
404
|
-
sm: "h-
|
|
405
|
-
md: "h-
|
|
406
|
-
lg: "h-
|
|
394
|
+
var sizeClasses2 = {
|
|
395
|
+
sm: "h-20 px-8 py-2 text-label-small gap-4",
|
|
396
|
+
md: "h-28 px-10 py-4 text-label-medium gap-4",
|
|
397
|
+
lg: "h-32 px-14 py-6 text-label-large gap-6"
|
|
407
398
|
};
|
|
408
399
|
var iconSizeClasses = {
|
|
409
|
-
sm: "h-
|
|
410
|
-
md: "h-
|
|
411
|
-
lg: "h-
|
|
412
|
-
};
|
|
413
|
-
var dotSizeClasses = {
|
|
414
|
-
sm: "h-1.5 w-1.5",
|
|
415
|
-
md: "h-1.5 w-1.5",
|
|
416
|
-
lg: "h-2 w-2"
|
|
417
|
-
};
|
|
418
|
-
var shapeClasses = {
|
|
419
|
-
round: "rounded-full",
|
|
420
|
-
square: "rounded"
|
|
400
|
+
sm: "h-16 w-16",
|
|
401
|
+
md: "h-20 w-20",
|
|
402
|
+
lg: "h-24 w-24"
|
|
421
403
|
};
|
|
422
404
|
var minimalClasses = {
|
|
423
|
-
common: "bg-transparent border border-
|
|
424
|
-
success: "bg-transparent border border-
|
|
425
|
-
warning: "bg-transparent border border-
|
|
426
|
-
info: "bg-transparent border border-
|
|
427
|
-
brand: "bg-transparent border border-
|
|
428
|
-
danger: "bg-transparent border border-
|
|
429
|
-
};
|
|
430
|
-
var minimalDotClasses = {
|
|
431
|
-
common: "bg-badge-minimal-common-dot",
|
|
432
|
-
success: "bg-badge-minimal-success-dot",
|
|
433
|
-
warning: "bg-badge-minimal-warning-dot",
|
|
434
|
-
info: "bg-badge-minimal-info-dot",
|
|
435
|
-
brand: "bg-badge-minimal-brand-dot",
|
|
436
|
-
danger: "bg-badge-minimal-danger-dot"
|
|
405
|
+
common: "bg-transparent border border-badges-border-primary text-badges-text-primary",
|
|
406
|
+
success: "bg-transparent border border-badges-border-success text-badges-text-success",
|
|
407
|
+
warning: "bg-transparent border border-badges-border-warning text-badges-text-warning",
|
|
408
|
+
info: "bg-transparent border border-badges-border-info text-badges-text-info",
|
|
409
|
+
brand: "bg-transparent border border-badges-border-brand text-badges-text-brand",
|
|
410
|
+
danger: "bg-transparent border border-badges-border-danger text-badges-text-danger"
|
|
437
411
|
};
|
|
438
412
|
var subtleClasses = {
|
|
439
|
-
common: "bg-
|
|
440
|
-
success: "bg-
|
|
441
|
-
warning: "bg-
|
|
442
|
-
info: "bg-
|
|
443
|
-
brand: "bg-
|
|
444
|
-
danger: "bg-
|
|
445
|
-
};
|
|
446
|
-
var subtleDotClasses = {
|
|
447
|
-
common: "bg-badge-subtle-common-dot",
|
|
448
|
-
success: "bg-badge-subtle-success-dot",
|
|
449
|
-
warning: "bg-badge-subtle-warning-dot",
|
|
450
|
-
info: "bg-badge-subtle-info-dot",
|
|
451
|
-
brand: "bg-badge-subtle-brand-dot",
|
|
452
|
-
danger: "bg-badge-subtle-danger-dot"
|
|
413
|
+
common: "bg-badges-background-common-subtle text-badges-text-primary",
|
|
414
|
+
success: "bg-badges-background-success-subtle text-badges-text-success",
|
|
415
|
+
warning: "bg-badges-background-warning-subtle text-badges-text-warning",
|
|
416
|
+
info: "bg-badges-background-info-subtle text-badges-text-info",
|
|
417
|
+
brand: "bg-badges-background-brand-subtle text-badges-text-brand",
|
|
418
|
+
danger: "bg-badges-background-danger-subtle text-badges-text-danger"
|
|
453
419
|
};
|
|
454
420
|
var boldClasses = {
|
|
455
|
-
common: "bg-
|
|
456
|
-
success: "bg-
|
|
457
|
-
warning: "bg-
|
|
458
|
-
info: "bg-
|
|
459
|
-
brand: "bg-
|
|
460
|
-
danger: "bg-
|
|
461
|
-
};
|
|
462
|
-
var boldDotClasses = {
|
|
463
|
-
common: "bg-badge-bold-common-dot",
|
|
464
|
-
success: "bg-badge-bold-success-dot",
|
|
465
|
-
warning: "bg-badge-bold-warning-dot",
|
|
466
|
-
info: "bg-badge-bold-info-dot",
|
|
467
|
-
brand: "bg-badge-bold-brand-dot",
|
|
468
|
-
danger: "bg-badge-bold-danger-dot"
|
|
421
|
+
common: "bg-badges-background-common text-badges-text-inverse",
|
|
422
|
+
success: "bg-badges-background-success text-badges-text-inverse",
|
|
423
|
+
warning: "bg-badges-background-warning text-badges-text-primary",
|
|
424
|
+
info: "bg-badges-background-info text-badges-text-inverse",
|
|
425
|
+
brand: "bg-badges-background-brand text-badges-text-inverse",
|
|
426
|
+
danger: "bg-badges-background-danger text-badges-text-inverse"
|
|
469
427
|
};
|
|
470
428
|
var styleMap = {
|
|
471
429
|
minimal: minimalClasses,
|
|
472
430
|
subtle: subtleClasses,
|
|
473
431
|
bold: boldClasses
|
|
474
432
|
};
|
|
475
|
-
var dotStyleMap = {
|
|
476
|
-
minimal: minimalDotClasses,
|
|
477
|
-
subtle: subtleDotClasses,
|
|
478
|
-
bold: boldDotClasses
|
|
479
|
-
};
|
|
480
433
|
var Badge = forwardRef4(
|
|
481
434
|
(_a, ref) => {
|
|
482
435
|
var _b = _a, {
|
|
@@ -485,7 +438,6 @@ var Badge = forwardRef4(
|
|
|
485
438
|
size = "md",
|
|
486
439
|
shape = "round",
|
|
487
440
|
icon,
|
|
488
|
-
dot = false,
|
|
489
441
|
children,
|
|
490
442
|
className = ""
|
|
491
443
|
} = _b, rest = __objRest(_b, [
|
|
@@ -494,21 +446,19 @@ var Badge = forwardRef4(
|
|
|
494
446
|
"size",
|
|
495
447
|
"shape",
|
|
496
448
|
"icon",
|
|
497
|
-
"dot",
|
|
498
449
|
"children",
|
|
499
450
|
"className"
|
|
500
451
|
]);
|
|
501
452
|
const classes = [
|
|
502
453
|
"inline-flex items-center justify-center font-medium font-sans",
|
|
503
454
|
"whitespace-nowrap select-none",
|
|
504
|
-
|
|
505
|
-
|
|
455
|
+
sizeClasses2[size],
|
|
456
|
+
shape === "round" ? "rounded-full" : `rounded-${size}`,
|
|
506
457
|
styleMap[badgeStyle][status],
|
|
507
458
|
className
|
|
508
459
|
].filter(Boolean).join(" ");
|
|
509
460
|
return /* @__PURE__ */ jsxs4("span", __spreadProps(__spreadValues({ ref, className: classes }, rest), { children: [
|
|
510
|
-
|
|
511
|
-
!dot && icon && /* @__PURE__ */ jsx4("span", { className: `shrink-0 ${iconSizeClasses[size]}`, children: icon }),
|
|
461
|
+
icon && /* @__PURE__ */ jsx4("span", { className: `shrink-0 ${iconSizeClasses[size]}`, children: icon }),
|
|
512
462
|
children
|
|
513
463
|
] }));
|
|
514
464
|
}
|
|
@@ -516,77 +466,119 @@ var Badge = forwardRef4(
|
|
|
516
466
|
Badge.displayName = "Badge";
|
|
517
467
|
|
|
518
468
|
// src/components/Button/Button.tsx
|
|
469
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
470
|
+
|
|
471
|
+
// src/components/Loading/Loading.tsx
|
|
519
472
|
import { forwardRef as forwardRef5 } from "react";
|
|
520
473
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
474
|
+
var Loading = forwardRef5(
|
|
475
|
+
(_a, ref) => {
|
|
476
|
+
var _b = _a, { size = "sm", isDark = false, className = "" } = _b, rest = __objRest(_b, ["size", "isDark", "className"]);
|
|
477
|
+
const containerClasses = [
|
|
478
|
+
isDark ? "text-white-100" : "text-blue-600",
|
|
479
|
+
className
|
|
480
|
+
].filter(Boolean).join(" ");
|
|
481
|
+
return size === "sm" && !isDark ? /* @__PURE__ */ jsx5("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ jsxs5(
|
|
482
|
+
"svg",
|
|
483
|
+
{
|
|
484
|
+
className: "animate-spin",
|
|
485
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
486
|
+
width: "18",
|
|
487
|
+
height: "18",
|
|
488
|
+
viewBox: "0 0 18 18",
|
|
489
|
+
fill: "none",
|
|
490
|
+
children: [
|
|
491
|
+
/* @__PURE__ */ jsx5(
|
|
492
|
+
"path",
|
|
493
|
+
{
|
|
494
|
+
d: "M1 9C1 6.87827 1.84286 4.84344 3.34315 3.34315C4.84344 1.84285 6.87827 1 9 1C11.1217 1 13.1566 1.84286 14.6569 3.34315C16.1571 4.84344 17 6.87827 17 9C17 11.1217 16.1571 13.1566 14.6569 14.6569C13.1566 16.1571 11.1217 17 9 17C6.87827 17 4.84344 16.1571 3.34315 14.6569C1.84285 13.1566 1 11.1217 1 9L1 9Z",
|
|
495
|
+
stroke: "#F3F4F6",
|
|
496
|
+
"stroke-width": "2"
|
|
497
|
+
}
|
|
498
|
+
),
|
|
499
|
+
/* @__PURE__ */ jsx5(
|
|
500
|
+
"path",
|
|
501
|
+
{
|
|
502
|
+
d: "M1 9C1 7.31057 1.53484 5.6645 2.52786 4.29772C3.52089 2.93094 4.92112 1.91361 6.52787 1.39155C8.13461 0.869484 9.86539 0.869484 11.4721 1.39155C13.0789 1.91361 14.4791 2.93094 15.4721 4.29772",
|
|
503
|
+
stroke: "#0193D7",
|
|
504
|
+
"stroke-width": "2"
|
|
505
|
+
}
|
|
506
|
+
)
|
|
507
|
+
]
|
|
508
|
+
}
|
|
509
|
+
) })) : /* @__PURE__ */ jsx5("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ jsx5(
|
|
510
|
+
"svg",
|
|
511
|
+
{
|
|
512
|
+
className: "animate-spin",
|
|
513
|
+
width: size === "sm" ? 18 : 88,
|
|
514
|
+
height: size === "sm" ? 18 : 88,
|
|
515
|
+
viewBox: "0 0 20 20",
|
|
516
|
+
fill: "none",
|
|
517
|
+
children: /* @__PURE__ */ jsx5(
|
|
518
|
+
"path",
|
|
519
|
+
{
|
|
520
|
+
d: "M10 2.5a7.5 7.5 0 1 0 7.5 7.5",
|
|
521
|
+
stroke: "currentColor",
|
|
522
|
+
strokeWidth: size === "sm" ? 2 : 1,
|
|
523
|
+
strokeLinecap: "round"
|
|
524
|
+
}
|
|
525
|
+
)
|
|
526
|
+
}
|
|
527
|
+
) }));
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
Loading.displayName = "Loading";
|
|
531
|
+
|
|
532
|
+
// src/components/Button/Button.tsx
|
|
533
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
521
534
|
var variantClasses = {
|
|
522
535
|
primary: [
|
|
523
|
-
"bg-
|
|
524
|
-
"hover:bg-
|
|
525
|
-
"active:bg-
|
|
526
|
-
"focus-visible:ring-2 focus-visible:ring-
|
|
527
|
-
"disabled:bg-
|
|
536
|
+
"bg-blue-600 text-white-100",
|
|
537
|
+
"hover:bg-blue-700",
|
|
538
|
+
"active:bg-blue-800",
|
|
539
|
+
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
540
|
+
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
528
541
|
].join(" "),
|
|
529
542
|
secondary: [
|
|
530
|
-
"bg-
|
|
531
|
-
"hover:bg-
|
|
532
|
-
"active:bg-
|
|
533
|
-
"focus-visible:ring-2 focus-visible:ring-
|
|
534
|
-
"disabled:bg-
|
|
543
|
+
"bg-gray-100 text-gray-900",
|
|
544
|
+
"hover:bg-gray-200",
|
|
545
|
+
"active:bg-gray-300",
|
|
546
|
+
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
547
|
+
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
535
548
|
].join(" "),
|
|
536
549
|
tertiary: [
|
|
537
|
-
"bg-
|
|
538
|
-
"hover:bg-
|
|
539
|
-
"active:bg-
|
|
540
|
-
"focus-visible:ring-2 focus-visible:ring-
|
|
541
|
-
"disabled:bg-
|
|
550
|
+
"bg-black-0 text-gray-900",
|
|
551
|
+
"hover:bg-gray-200",
|
|
552
|
+
"active:bg-gray-300",
|
|
553
|
+
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
554
|
+
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
542
555
|
].join(" "),
|
|
543
556
|
contrast: [
|
|
544
|
-
"bg-
|
|
545
|
-
"hover:bg-
|
|
546
|
-
"active:bg-
|
|
547
|
-
"focus-visible:ring-2 focus-visible:ring-
|
|
548
|
-
"disabled:bg-
|
|
557
|
+
"bg-white-100 text-blue-600",
|
|
558
|
+
"hover:bg-white-90",
|
|
559
|
+
"active:bg-white-80",
|
|
560
|
+
"focus-visible:ring-2 focus-visible:ring-white-100 focus-visible:ring-offset-2",
|
|
561
|
+
"disabled:bg-gray-50 disabled:text-gray-400"
|
|
549
562
|
].join(" "),
|
|
550
563
|
transparent: [
|
|
551
|
-
"bg-
|
|
552
|
-
"hover:bg-
|
|
553
|
-
"active:bg-
|
|
554
|
-
"focus-visible:ring-2 focus-visible:ring-
|
|
555
|
-
"disabled:bg-
|
|
564
|
+
"bg-black-0 text-white-100",
|
|
565
|
+
"hover:bg-white-20",
|
|
566
|
+
"active:bg-white-30",
|
|
567
|
+
"focus-visible:ring-2 focus-visible:ring-white-100 focus-visible:bg-black-0 focus-visible:ring-offset-2",
|
|
568
|
+
"disabled:bg-black-0 disabled:text-white-40"
|
|
556
569
|
].join(" ")
|
|
557
570
|
};
|
|
558
|
-
var
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
571
|
+
var sizeClasses3 = {
|
|
572
|
+
sm: "px-16 py-6 text-label-medium",
|
|
573
|
+
md: "px-20 py-8 text-label-large",
|
|
574
|
+
lg: "px-24 py-12 text-label-large",
|
|
575
|
+
xl: "px-32 py-16 text-label-large"
|
|
563
576
|
};
|
|
564
|
-
|
|
565
|
-
return /* @__PURE__ */ jsx5(
|
|
566
|
-
"svg",
|
|
567
|
-
{
|
|
568
|
-
className,
|
|
569
|
-
width: "1em",
|
|
570
|
-
height: "1em",
|
|
571
|
-
viewBox: "0 0 20 20",
|
|
572
|
-
fill: "none",
|
|
573
|
-
children: /* @__PURE__ */ jsx5(
|
|
574
|
-
"path",
|
|
575
|
-
{
|
|
576
|
-
d: "M10 2.5a7.5 7.5 0 1 0 7.5 7.5",
|
|
577
|
-
stroke: "currentColor",
|
|
578
|
-
strokeWidth: "2",
|
|
579
|
-
strokeLinecap: "round"
|
|
580
|
-
}
|
|
581
|
-
)
|
|
582
|
-
}
|
|
583
|
-
);
|
|
584
|
-
}
|
|
585
|
-
var Button = forwardRef5(
|
|
577
|
+
var Button = forwardRef6(
|
|
586
578
|
(_a, ref) => {
|
|
587
579
|
var _b = _a, {
|
|
588
580
|
variant = "primary",
|
|
589
|
-
size = "
|
|
581
|
+
size = "md",
|
|
590
582
|
rounded = false,
|
|
591
583
|
loading = false,
|
|
592
584
|
disabled = false,
|
|
@@ -605,164 +597,299 @@ var Button = forwardRef5(
|
|
|
605
597
|
"children",
|
|
606
598
|
"className"
|
|
607
599
|
]);
|
|
608
|
-
const isDisabled = disabled
|
|
600
|
+
const isDisabled = disabled;
|
|
609
601
|
const classes = [
|
|
610
|
-
"inline-flex items-center justify-center
|
|
602
|
+
"inline-flex items-center justify-center gap-8",
|
|
611
603
|
"transition-colors duration-150",
|
|
612
604
|
"outline-none",
|
|
613
605
|
"disabled:cursor-not-allowed",
|
|
614
|
-
|
|
606
|
+
loading ? "pointer-events-none" : "cursor-pointer",
|
|
607
|
+
sizeClasses3[size],
|
|
615
608
|
variantClasses[variant],
|
|
616
|
-
rounded ? "rounded-full" : "rounded-
|
|
609
|
+
rounded ? "rounded-full" : size === "sm" ? "rounded-6" : size === "xl" ? "rounded-12" : "rounded-8",
|
|
617
610
|
className
|
|
618
611
|
].filter(Boolean).join(" ");
|
|
619
|
-
return /* @__PURE__ */
|
|
620
|
-
"
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
className: classes
|
|
625
|
-
}, rest), {
|
|
626
|
-
children: [
|
|
627
|
-
loading ? /* @__PURE__ */ jsx5(Spinner, { className: "animate-spin" }) : startIcon,
|
|
628
|
-
children,
|
|
629
|
-
!loading && endIcon
|
|
630
|
-
]
|
|
631
|
-
})
|
|
632
|
-
);
|
|
612
|
+
return /* @__PURE__ */ jsxs6("button", __spreadProps(__spreadValues({ ref, disabled: isDisabled, className: classes }, rest), { children: [
|
|
613
|
+
loading ? /* @__PURE__ */ jsx6(Loading, { size: "sm", isDark: variant === "primary" || variant === "transparent" }) : startIcon,
|
|
614
|
+
children,
|
|
615
|
+
!loading && endIcon
|
|
616
|
+
] }));
|
|
633
617
|
}
|
|
634
618
|
);
|
|
635
619
|
Button.displayName = "Button";
|
|
636
620
|
|
|
621
|
+
// src/components/BottomSheet/BottomSheet.tsx
|
|
622
|
+
import React, { useEffect, useState as useState2, useCallback as useCallback2, forwardRef as forwardRef7 } from "react";
|
|
623
|
+
import { createPortal } from "react-dom";
|
|
624
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
625
|
+
var BottomSheet = forwardRef7(
|
|
626
|
+
(_a, ref) => {
|
|
627
|
+
var _b = _a, {
|
|
628
|
+
isForceOpen = false,
|
|
629
|
+
setIsForceOpen,
|
|
630
|
+
isClosedAble = true,
|
|
631
|
+
children,
|
|
632
|
+
startModalBtn,
|
|
633
|
+
stopModalBtn,
|
|
634
|
+
afterStopBtn,
|
|
635
|
+
size = "md",
|
|
636
|
+
modalTitle = "\u0E2B\u0E31\u0E27\u0E02\u0E49\u0E2D",
|
|
637
|
+
modalDesc = "\u0E04\u0E33\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22",
|
|
638
|
+
className = ""
|
|
639
|
+
} = _b, rest = __objRest(_b, [
|
|
640
|
+
"isForceOpen",
|
|
641
|
+
"setIsForceOpen",
|
|
642
|
+
"isClosedAble",
|
|
643
|
+
"children",
|
|
644
|
+
"startModalBtn",
|
|
645
|
+
"stopModalBtn",
|
|
646
|
+
"afterStopBtn",
|
|
647
|
+
"size",
|
|
648
|
+
"modalTitle",
|
|
649
|
+
"modalDesc",
|
|
650
|
+
"className"
|
|
651
|
+
]);
|
|
652
|
+
const [isOpen, setIsOpen] = useState2(false);
|
|
653
|
+
const [shouldRender, setShouldRender] = useState2(false);
|
|
654
|
+
const [animate, setAnimate] = useState2(false);
|
|
655
|
+
useEffect(() => {
|
|
656
|
+
if (isOpen) {
|
|
657
|
+
setShouldRender(true);
|
|
658
|
+
setTimeout(() => setAnimate(true), 10);
|
|
659
|
+
} else {
|
|
660
|
+
setAnimate(false);
|
|
661
|
+
const timer = setTimeout(() => setShouldRender(false), 300);
|
|
662
|
+
return () => clearTimeout(timer);
|
|
663
|
+
}
|
|
664
|
+
}, [isOpen]);
|
|
665
|
+
useEffect(() => {
|
|
666
|
+
if (isForceOpen) {
|
|
667
|
+
setIsOpen(true);
|
|
668
|
+
} else {
|
|
669
|
+
setIsOpen(false);
|
|
670
|
+
}
|
|
671
|
+
}, [isForceOpen]);
|
|
672
|
+
const handleStartClick = useCallback2(
|
|
673
|
+
(e) => {
|
|
674
|
+
var _a2, _b2;
|
|
675
|
+
(_b2 = startModalBtn == null ? void 0 : (_a2 = startModalBtn.props).onClick) == null ? void 0 : _b2.call(_a2, e);
|
|
676
|
+
setIsForceOpen == null ? void 0 : setIsForceOpen(true);
|
|
677
|
+
setIsOpen(true);
|
|
678
|
+
},
|
|
679
|
+
[startModalBtn]
|
|
680
|
+
);
|
|
681
|
+
const handleStopClick = useCallback2(
|
|
682
|
+
(e) => {
|
|
683
|
+
var _a2, _b2;
|
|
684
|
+
(_b2 = stopModalBtn == null ? void 0 : (_a2 = stopModalBtn.props).onClick) == null ? void 0 : _b2.call(_a2, e);
|
|
685
|
+
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
686
|
+
setIsOpen(false);
|
|
687
|
+
},
|
|
688
|
+
[stopModalBtn]
|
|
689
|
+
);
|
|
690
|
+
const handleCloseClick = () => {
|
|
691
|
+
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
692
|
+
setIsOpen(false);
|
|
693
|
+
};
|
|
694
|
+
return /* @__PURE__ */ jsxs7("span", { ref, style: { display: "contents" }, children: [
|
|
695
|
+
startModalBtn && React.cloneElement(startModalBtn, {
|
|
696
|
+
onClick: handleStartClick
|
|
697
|
+
}),
|
|
698
|
+
shouldRender && createPortal(
|
|
699
|
+
/* @__PURE__ */ jsxs7(
|
|
700
|
+
"div",
|
|
701
|
+
{
|
|
702
|
+
className: `fixed inset-0 z-50 flex items-end justify-center transition-opacity duration-300 ${animate ? "opacity-100" : "opacity-0"}`,
|
|
703
|
+
"aria-modal": "true",
|
|
704
|
+
role: "dialog",
|
|
705
|
+
children: [
|
|
706
|
+
/* @__PURE__ */ jsx7(
|
|
707
|
+
"div",
|
|
708
|
+
{
|
|
709
|
+
className: "absolute inset-0 bg-black/40",
|
|
710
|
+
onClick: () => isClosedAble ? handleCloseClick() : null,
|
|
711
|
+
"aria-label": "Close modal"
|
|
712
|
+
}
|
|
713
|
+
),
|
|
714
|
+
/* @__PURE__ */ jsxs7(
|
|
715
|
+
"div",
|
|
716
|
+
{
|
|
717
|
+
className: `flex flex-col z-10 w-full rounded-t-xl bg-white pt-8 pb-16 px-16 shadow-lg transform transition-all duration-300
|
|
718
|
+
${size === "sm" ? "h-auto max-h-auto" : size === "md" ? "h-full max-h-[85vh]" : "h-full max-h-screen rounded-t-none!"}
|
|
719
|
+
${animate ? "scale-100 translate-y-0" : "scale-95 translate-y-full"}`,
|
|
720
|
+
children: [
|
|
721
|
+
/* @__PURE__ */ jsxs7("div", { className: "w-full flex flex-row relative items-center pt-8 pb-16", children: [
|
|
722
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col px-8 max-w-225", children: [
|
|
723
|
+
/* @__PURE__ */ jsx7("p", { className: "text-heading-3 text-button-sheet-text-primary", children: modalTitle }),
|
|
724
|
+
/* @__PURE__ */ jsx7("p", { className: "text-body-small text-button-sheet-text-secondary", children: modalDesc })
|
|
725
|
+
] }),
|
|
726
|
+
/* @__PURE__ */ jsx7(
|
|
727
|
+
"i",
|
|
728
|
+
{
|
|
729
|
+
className: "fi fi-br-cross-small flex text-xl text-gray-600 w-44 h-44 absolute top-0 right-0 p-12",
|
|
730
|
+
onClick: () => handleCloseClick()
|
|
731
|
+
}
|
|
732
|
+
),
|
|
733
|
+
/* @__PURE__ */ jsx7(
|
|
734
|
+
"div",
|
|
735
|
+
{
|
|
736
|
+
className: "text-gray-600 text-xl absolute top-0 right-0 p-12",
|
|
737
|
+
onClick: () => handleCloseClick(),
|
|
738
|
+
children: "x"
|
|
739
|
+
}
|
|
740
|
+
)
|
|
741
|
+
] }),
|
|
742
|
+
/* @__PURE__ */ jsxs7("div", { className: "w-full h-full grow overflow-y-auto overflow-x-visible", children: [
|
|
743
|
+
children,
|
|
744
|
+
stopModalBtn && React.cloneElement(stopModalBtn, {
|
|
745
|
+
onClick: handleStopClick
|
|
746
|
+
}),
|
|
747
|
+
afterStopBtn && afterStopBtn
|
|
748
|
+
] })
|
|
749
|
+
]
|
|
750
|
+
}
|
|
751
|
+
)
|
|
752
|
+
]
|
|
753
|
+
}
|
|
754
|
+
),
|
|
755
|
+
document.body
|
|
756
|
+
)
|
|
757
|
+
] });
|
|
758
|
+
}
|
|
759
|
+
);
|
|
760
|
+
BottomSheet.displayName = "BottomSheet";
|
|
761
|
+
|
|
637
762
|
// src/components/Checkbox/Checkbox.tsx
|
|
638
763
|
import {
|
|
639
|
-
forwardRef as
|
|
640
|
-
useId as useId2
|
|
764
|
+
forwardRef as forwardRef8,
|
|
765
|
+
useId as useId2,
|
|
766
|
+
useState as useState3
|
|
641
767
|
} from "react";
|
|
642
|
-
import { jsx as
|
|
643
|
-
var sizeClasses5 = {
|
|
644
|
-
small: {
|
|
645
|
-
box: "h-4 w-4",
|
|
646
|
-
icon: "h-3 w-3",
|
|
647
|
-
label: "text-sm leading-5",
|
|
648
|
-
description: "text-xs leading-4",
|
|
649
|
-
gap: "gap-2"
|
|
650
|
-
},
|
|
651
|
-
medium: {
|
|
652
|
-
box: "h-5 w-5",
|
|
653
|
-
icon: "h-3.5 w-3.5",
|
|
654
|
-
label: "text-base leading-6",
|
|
655
|
-
description: "text-sm leading-5",
|
|
656
|
-
gap: "gap-2.5"
|
|
657
|
-
}
|
|
658
|
-
};
|
|
768
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
659
769
|
function CheckIcon({ className }) {
|
|
660
|
-
return /* @__PURE__ */
|
|
661
|
-
"
|
|
770
|
+
return /* @__PURE__ */ jsx8(
|
|
771
|
+
"svg",
|
|
662
772
|
{
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
773
|
+
className,
|
|
774
|
+
viewBox: "0 0 16 16",
|
|
775
|
+
fill: "none",
|
|
776
|
+
"aria-hidden": "true",
|
|
777
|
+
children: /* @__PURE__ */ jsx8(
|
|
778
|
+
"path",
|
|
779
|
+
{
|
|
780
|
+
d: "M13.333 4.667 6 12l-3.333-3.333",
|
|
781
|
+
stroke: "currentColor",
|
|
782
|
+
strokeWidth: "2",
|
|
783
|
+
strokeLinecap: "round",
|
|
784
|
+
strokeLinejoin: "round"
|
|
785
|
+
}
|
|
786
|
+
)
|
|
668
787
|
}
|
|
669
|
-
)
|
|
788
|
+
);
|
|
670
789
|
}
|
|
671
790
|
function IndeterminateIcon({ className }) {
|
|
672
|
-
return /* @__PURE__ */
|
|
673
|
-
"
|
|
791
|
+
return /* @__PURE__ */ jsx8(
|
|
792
|
+
"svg",
|
|
674
793
|
{
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
794
|
+
className,
|
|
795
|
+
viewBox: "0 0 16 16",
|
|
796
|
+
fill: "none",
|
|
797
|
+
"aria-hidden": "true",
|
|
798
|
+
children: /* @__PURE__ */ jsx8(
|
|
799
|
+
"path",
|
|
800
|
+
{
|
|
801
|
+
d: "M3.333 8h9.334",
|
|
802
|
+
stroke: "currentColor",
|
|
803
|
+
strokeWidth: "2",
|
|
804
|
+
strokeLinecap: "round"
|
|
805
|
+
}
|
|
806
|
+
)
|
|
679
807
|
}
|
|
680
|
-
)
|
|
808
|
+
);
|
|
681
809
|
}
|
|
682
|
-
var Checkbox =
|
|
810
|
+
var Checkbox = forwardRef8(
|
|
683
811
|
(_a, ref) => {
|
|
684
812
|
var _b = _a, {
|
|
685
|
-
size = "medium",
|
|
686
813
|
label,
|
|
687
814
|
description,
|
|
688
|
-
indeterminate = false,
|
|
689
815
|
error = false,
|
|
690
816
|
contrast = false,
|
|
691
|
-
|
|
692
|
-
defaultChecked,
|
|
817
|
+
indeterminate = false,
|
|
693
818
|
disabled = false,
|
|
694
819
|
className = "",
|
|
695
|
-
id
|
|
820
|
+
id,
|
|
821
|
+
defaultChecked
|
|
696
822
|
} = _b, rest = __objRest(_b, [
|
|
697
|
-
"size",
|
|
698
823
|
"label",
|
|
699
824
|
"description",
|
|
700
|
-
"indeterminate",
|
|
701
825
|
"error",
|
|
702
826
|
"contrast",
|
|
703
|
-
"
|
|
704
|
-
"defaultChecked",
|
|
827
|
+
"indeterminate",
|
|
705
828
|
"disabled",
|
|
706
829
|
"className",
|
|
707
|
-
"id"
|
|
830
|
+
"id",
|
|
831
|
+
"defaultChecked"
|
|
708
832
|
]);
|
|
709
833
|
const reactId = useId2();
|
|
710
834
|
const inputId = id != null ? id : reactId;
|
|
711
|
-
const
|
|
712
|
-
|
|
713
|
-
const boxBase = [
|
|
714
|
-
"relative inline-flex items-center justify-center shrink-0",
|
|
715
|
-
"rounded",
|
|
716
|
-
"border",
|
|
717
|
-
"transition-colors duration-150",
|
|
718
|
-
sz.box
|
|
719
|
-
].join(" ");
|
|
720
|
-
let boxState;
|
|
721
|
-
if (disabled) {
|
|
722
|
-
boxState = isActive ? "bg-checkbox-disabled-checked-bg border-checkbox-disabled-border text-checkbox-disabled-icon" : "bg-checkbox-disabled-bg border-checkbox-disabled-border";
|
|
723
|
-
} else if (contrast) {
|
|
724
|
-
boxState = isActive ? "bg-checkbox-contrast-checked-bg border-checkbox-contrast-checked-bg text-checkbox-contrast-checked-icon" : "bg-checkbox-contrast-bg border-checkbox-contrast-border text-transparent";
|
|
725
|
-
} else if (error) {
|
|
726
|
-
boxState = isActive ? "bg-checkbox-checked-bg border-checkbox-error-border text-checkbox-checked-icon" : "bg-checkbox-error-bg border-checkbox-error-border text-transparent";
|
|
727
|
-
} else if (isActive) {
|
|
728
|
-
boxState = "bg-checkbox-checked-bg border-checkbox-checked-border text-checkbox-checked-icon";
|
|
729
|
-
} else {
|
|
730
|
-
boxState = "bg-checkbox-bg border-checkbox-border text-transparent hover:border-checkbox-hover-border";
|
|
731
|
-
}
|
|
732
|
-
const ringColor = error ? "peer-focus-visible:ring-checkbox-error-ring" : contrast ? "peer-focus-visible:ring-checkbox-contrast-ring" : "peer-focus-visible:ring-checkbox-ring";
|
|
733
|
-
const ringClasses = `peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 ${ringColor}`;
|
|
734
|
-
const labelColor = disabled ? "text-checkbox-label-disabled" : contrast ? "text-checkbox-contrast-label" : error ? "text-checkbox-label-error" : "text-checkbox-label";
|
|
735
|
-
const descriptionColor = disabled ? "text-checkbox-label-disabled" : contrast ? "text-checkbox-contrast-description" : "text-checkbox-description";
|
|
736
|
-
return /* @__PURE__ */ jsxs6(
|
|
835
|
+
const [isChecked, setIsChecked] = useState3(defaultChecked != null ? defaultChecked : false);
|
|
836
|
+
return /* @__PURE__ */ jsxs8(
|
|
737
837
|
"label",
|
|
738
838
|
{
|
|
739
839
|
htmlFor: inputId,
|
|
740
|
-
className:
|
|
741
|
-
"inline-flex items-start font-sans",
|
|
742
|
-
sz.gap,
|
|
743
|
-
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
744
|
-
className
|
|
745
|
-
].filter(Boolean).join(" "),
|
|
840
|
+
className: `flex select-none font-sans ${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
746
841
|
children: [
|
|
747
|
-
/* @__PURE__ */
|
|
748
|
-
/* @__PURE__ */
|
|
842
|
+
/* @__PURE__ */ jsxs8("div", { className: "relative mr-16", children: [
|
|
843
|
+
/* @__PURE__ */ jsx8(
|
|
749
844
|
"input",
|
|
750
845
|
__spreadValues({
|
|
751
846
|
ref,
|
|
752
847
|
id: inputId,
|
|
753
848
|
type: "checkbox",
|
|
754
|
-
checked,
|
|
755
849
|
defaultChecked,
|
|
850
|
+
onChange: (e) => {
|
|
851
|
+
var _a2;
|
|
852
|
+
setIsChecked(e.target.checked);
|
|
853
|
+
(_a2 = rest.onChange) == null ? void 0 : _a2.call(rest, e);
|
|
854
|
+
},
|
|
756
855
|
disabled,
|
|
757
|
-
"aria-checked": indeterminate ? "mixed" :
|
|
758
|
-
className: "
|
|
856
|
+
"aria-checked": indeterminate ? "mixed" : isChecked,
|
|
857
|
+
className: "sr-only"
|
|
759
858
|
}, rest)
|
|
760
859
|
),
|
|
761
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ jsx8(
|
|
861
|
+
"div",
|
|
862
|
+
{
|
|
863
|
+
className: `box m-6 flex h-20 w-20 rounded-md items-center justify-center border ${contrast ? isChecked || indeterminate ? "border-white bg-white" : "border-white" : isChecked || indeterminate ? "bg-static-icon-brand border-static-icon-brand" : "border-static-icon-primary"}`,
|
|
864
|
+
children: isChecked ? /* @__PURE__ */ jsx8(
|
|
865
|
+
CheckIcon,
|
|
866
|
+
{
|
|
867
|
+
className: `h-20 ${contrast ? "text-static-icon-brand" : "text-white"}`
|
|
868
|
+
}
|
|
869
|
+
) : indeterminate ? /* @__PURE__ */ jsx8(
|
|
870
|
+
IndeterminateIcon,
|
|
871
|
+
{
|
|
872
|
+
className: `h-20 ${contrast ? "text-static-icon-brand" : "text-white"}`
|
|
873
|
+
}
|
|
874
|
+
) : null
|
|
875
|
+
}
|
|
876
|
+
)
|
|
762
877
|
] }),
|
|
763
|
-
(label || description) && /* @__PURE__ */
|
|
764
|
-
label && /* @__PURE__ */
|
|
765
|
-
|
|
878
|
+
(label || description) && /* @__PURE__ */ jsxs8("span", { className: "flex flex-col", children: [
|
|
879
|
+
label && /* @__PURE__ */ jsx8(
|
|
880
|
+
"span",
|
|
881
|
+
{
|
|
882
|
+
className: `text-label-large ${disabled ? "text-checkbox-text-disabled" : contrast ? "text-checkbox-text-primary-inverse" : "text-checkbox-text-primary"}`,
|
|
883
|
+
children: label
|
|
884
|
+
}
|
|
885
|
+
),
|
|
886
|
+
description && /* @__PURE__ */ jsx8(
|
|
887
|
+
"span",
|
|
888
|
+
{
|
|
889
|
+
className: `text-body-small ${error ? "text-checkbox-text-danger" : disabled ? "text-checkbox-text-disabled" : contrast ? "text-checkbox-text-primary-inverse" : "text-checkbox-text-secondary"}`,
|
|
890
|
+
children: description
|
|
891
|
+
}
|
|
892
|
+
)
|
|
766
893
|
] })
|
|
767
894
|
]
|
|
768
895
|
}
|
|
@@ -771,10 +898,138 @@ var Checkbox = forwardRef6(
|
|
|
771
898
|
);
|
|
772
899
|
Checkbox.displayName = "Checkbox";
|
|
773
900
|
|
|
901
|
+
// src/components/Dialog/Dialog.tsx
|
|
902
|
+
import React2, {
|
|
903
|
+
useEffect as useEffect2,
|
|
904
|
+
useState as useState4,
|
|
905
|
+
useCallback as useCallback3,
|
|
906
|
+
forwardRef as forwardRef9
|
|
907
|
+
} from "react";
|
|
908
|
+
import { createPortal as createPortal2 } from "react-dom";
|
|
909
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
910
|
+
var Dialog = forwardRef9(
|
|
911
|
+
({
|
|
912
|
+
isForceOpen = false,
|
|
913
|
+
setIsForceOpen,
|
|
914
|
+
isClosedAble = true,
|
|
915
|
+
isCloseIcon = true,
|
|
916
|
+
children,
|
|
917
|
+
startModalBtn,
|
|
918
|
+
stopModalBtn,
|
|
919
|
+
afterStopBtn,
|
|
920
|
+
p = "20"
|
|
921
|
+
}, ref) => {
|
|
922
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
923
|
+
const [isRender, setIsRender] = useState4(false);
|
|
924
|
+
const [animate, setAnimate] = useState4(false);
|
|
925
|
+
useEffect2(() => {
|
|
926
|
+
if (isOpen) {
|
|
927
|
+
setIsRender(true);
|
|
928
|
+
setTimeout(() => setAnimate(true), 10);
|
|
929
|
+
} else {
|
|
930
|
+
setAnimate(false);
|
|
931
|
+
const timer = setTimeout(() => setIsRender(false), 300);
|
|
932
|
+
return () => clearTimeout(timer);
|
|
933
|
+
}
|
|
934
|
+
}, [isOpen]);
|
|
935
|
+
useEffect2(() => {
|
|
936
|
+
if (isForceOpen) {
|
|
937
|
+
setIsOpen(true);
|
|
938
|
+
} else {
|
|
939
|
+
setIsOpen(false);
|
|
940
|
+
}
|
|
941
|
+
}, [isForceOpen]);
|
|
942
|
+
const handleStartClick = useCallback3(
|
|
943
|
+
(e) => {
|
|
944
|
+
var _a, _b;
|
|
945
|
+
(_b = startModalBtn == null ? void 0 : (_a = startModalBtn.props).onClick) == null ? void 0 : _b.call(_a, e);
|
|
946
|
+
setIsForceOpen == null ? void 0 : setIsForceOpen(true);
|
|
947
|
+
setIsOpen(true);
|
|
948
|
+
},
|
|
949
|
+
[startModalBtn]
|
|
950
|
+
);
|
|
951
|
+
const handleStopClick = useCallback3(
|
|
952
|
+
(e) => {
|
|
953
|
+
var _a, _b;
|
|
954
|
+
(_b = stopModalBtn == null ? void 0 : (_a = stopModalBtn.props).onClick) == null ? void 0 : _b.call(_a, e);
|
|
955
|
+
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
956
|
+
setIsOpen(false);
|
|
957
|
+
},
|
|
958
|
+
[stopModalBtn]
|
|
959
|
+
);
|
|
960
|
+
const handleCloseClick = () => {
|
|
961
|
+
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
962
|
+
setIsOpen(false);
|
|
963
|
+
};
|
|
964
|
+
return /* @__PURE__ */ jsxs9("span", { ref, style: { display: "contents" }, children: [
|
|
965
|
+
startModalBtn && React2.cloneElement(startModalBtn, {
|
|
966
|
+
onClick: handleStartClick
|
|
967
|
+
}),
|
|
968
|
+
isRender && createPortal2(
|
|
969
|
+
/* @__PURE__ */ jsxs9(
|
|
970
|
+
"div",
|
|
971
|
+
{
|
|
972
|
+
className: `fixed inset-0 z-50 flex items-center justify-center transition-opacity duration-300 ${animate ? "opacity-100" : "opacity-0"}`,
|
|
973
|
+
"aria-modal": "true",
|
|
974
|
+
role: "dialog",
|
|
975
|
+
children: [
|
|
976
|
+
/* @__PURE__ */ jsx9(
|
|
977
|
+
"div",
|
|
978
|
+
{
|
|
979
|
+
className: "absolute inset-0 bg-black/40",
|
|
980
|
+
onClick: () => isClosedAble ? handleCloseClick() : null,
|
|
981
|
+
"aria-label": "Close modal"
|
|
982
|
+
}
|
|
983
|
+
),
|
|
984
|
+
/* @__PURE__ */ jsxs9(
|
|
985
|
+
"div",
|
|
986
|
+
{
|
|
987
|
+
className: `relative z-10 w-[calc(100%-40px)] max-w-md rounded-xl bg-white p-${p || "20"} shadow-lg transform transition-all duration-300 ${animate ? "scale-100 opacity-100" : "scale-95 opacity-0"}`,
|
|
988
|
+
children: [
|
|
989
|
+
isCloseIcon && /* @__PURE__ */ jsx9(
|
|
990
|
+
"svg",
|
|
991
|
+
{
|
|
992
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
993
|
+
width: "20",
|
|
994
|
+
height: "20",
|
|
995
|
+
viewBox: "0 0 20 20",
|
|
996
|
+
fill: "none",
|
|
997
|
+
className: "text-gray-900 flex h-20 w-20 items-center justify-center absolute right-16 top-16 cursor-pointer",
|
|
998
|
+
onMouseDown: (e) => {
|
|
999
|
+
e.preventDefault();
|
|
1000
|
+
handleCloseClick();
|
|
1001
|
+
},
|
|
1002
|
+
children: /* @__PURE__ */ jsx9(
|
|
1003
|
+
"path",
|
|
1004
|
+
{
|
|
1005
|
+
d: "M14.7119 6.0625L10.7744 10L14.7119 13.9375L13.9375 14.7119L10 10.7744L6.0625 14.7119L5.28809 13.9375L9.22559 10L5.28809 6.0625L6.0625 5.28809L10 9.22559L13.9375 5.28809L14.7119 6.0625Z",
|
|
1006
|
+
fill: "#111827"
|
|
1007
|
+
}
|
|
1008
|
+
)
|
|
1009
|
+
}
|
|
1010
|
+
),
|
|
1011
|
+
children,
|
|
1012
|
+
stopModalBtn && React2.cloneElement(stopModalBtn, {
|
|
1013
|
+
onClick: handleStopClick
|
|
1014
|
+
}),
|
|
1015
|
+
afterStopBtn && afterStopBtn
|
|
1016
|
+
]
|
|
1017
|
+
}
|
|
1018
|
+
)
|
|
1019
|
+
]
|
|
1020
|
+
}
|
|
1021
|
+
),
|
|
1022
|
+
document.body
|
|
1023
|
+
)
|
|
1024
|
+
] });
|
|
1025
|
+
}
|
|
1026
|
+
);
|
|
1027
|
+
Dialog.displayName = "Dialog";
|
|
1028
|
+
|
|
774
1029
|
// src/components/Icon/Icon.tsx
|
|
775
|
-
import { forwardRef as
|
|
776
|
-
import { jsx as
|
|
777
|
-
var Icon =
|
|
1030
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
1031
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1032
|
+
var Icon = forwardRef10(
|
|
778
1033
|
(_a, ref) => {
|
|
779
1034
|
var _b = _a, {
|
|
780
1035
|
name,
|
|
@@ -802,7 +1057,7 @@ var Icon = forwardRef7(
|
|
|
802
1057
|
"material-symbols-outlined select-none shrink-0 inline-block leading-none",
|
|
803
1058
|
className
|
|
804
1059
|
].filter(Boolean).join(" ");
|
|
805
|
-
return /* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ jsx10(
|
|
806
1061
|
"span",
|
|
807
1062
|
__spreadProps(__spreadValues({
|
|
808
1063
|
ref,
|
|
@@ -826,116 +1081,107 @@ Icon.displayName = "Icon";
|
|
|
826
1081
|
|
|
827
1082
|
// src/components/Radio/Radio.tsx
|
|
828
1083
|
import {
|
|
829
|
-
forwardRef as
|
|
1084
|
+
forwardRef as forwardRef11,
|
|
830
1085
|
useId as useId3
|
|
831
1086
|
} from "react";
|
|
832
|
-
import { jsx as
|
|
833
|
-
var
|
|
834
|
-
small: {
|
|
835
|
-
box: "h-4 w-4",
|
|
836
|
-
dot: "h-1.5 w-1.5",
|
|
837
|
-
label: "text-sm leading-5",
|
|
838
|
-
description: "text-xs leading-4",
|
|
839
|
-
gap: "gap-2"
|
|
840
|
-
},
|
|
841
|
-
medium: {
|
|
842
|
-
box: "h-5 w-5",
|
|
843
|
-
dot: "h-2 w-2",
|
|
844
|
-
label: "text-base leading-6",
|
|
845
|
-
description: "text-sm leading-5",
|
|
846
|
-
gap: "gap-2.5"
|
|
847
|
-
}
|
|
848
|
-
};
|
|
849
|
-
var Radio = forwardRef8(
|
|
1087
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1088
|
+
var Radio = forwardRef11(
|
|
850
1089
|
(_a, ref) => {
|
|
851
1090
|
var _b = _a, {
|
|
852
|
-
size = "
|
|
1091
|
+
size = "sm",
|
|
853
1092
|
label,
|
|
854
1093
|
description,
|
|
855
1094
|
error = false,
|
|
856
|
-
contrast = false,
|
|
857
1095
|
checked,
|
|
858
1096
|
defaultChecked,
|
|
859
1097
|
disabled = false,
|
|
860
1098
|
className = "",
|
|
861
|
-
id
|
|
1099
|
+
id,
|
|
1100
|
+
name
|
|
862
1101
|
} = _b, rest = __objRest(_b, [
|
|
863
1102
|
"size",
|
|
864
1103
|
"label",
|
|
865
1104
|
"description",
|
|
866
1105
|
"error",
|
|
867
|
-
"contrast",
|
|
868
1106
|
"checked",
|
|
869
1107
|
"defaultChecked",
|
|
870
1108
|
"disabled",
|
|
871
1109
|
"className",
|
|
872
|
-
"id"
|
|
1110
|
+
"id",
|
|
1111
|
+
"name"
|
|
873
1112
|
]);
|
|
874
1113
|
const reactId = useId3();
|
|
875
1114
|
const inputId = id != null ? id : reactId;
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
"relative inline-flex items-center justify-center shrink-0",
|
|
879
|
-
"rounded-full",
|
|
880
|
-
"border",
|
|
881
|
-
"transition-colors duration-150",
|
|
882
|
-
sz.box
|
|
883
|
-
].join(" ");
|
|
884
|
-
let circleState;
|
|
885
|
-
if (disabled) {
|
|
886
|
-
circleState = checked ? "bg-radio-disabled-selected-bg border-radio-disabled-border" : "bg-radio-disabled-bg border-radio-disabled-border";
|
|
887
|
-
} else if (contrast) {
|
|
888
|
-
circleState = checked ? "bg-radio-contrast-selected-bg border-radio-contrast-selected-bg" : "bg-radio-contrast-bg border-radio-contrast-border";
|
|
889
|
-
} else if (error) {
|
|
890
|
-
circleState = checked ? "bg-radio-selected-bg border-radio-error-border" : "bg-radio-error-bg border-radio-error-border";
|
|
891
|
-
} else if (checked) {
|
|
892
|
-
circleState = "bg-radio-selected-bg border-radio-selected-border";
|
|
893
|
-
} else {
|
|
894
|
-
circleState = "bg-radio-bg border-radio-border hover:border-radio-hover-border";
|
|
895
|
-
}
|
|
896
|
-
const ringColor = error ? "peer-focus-visible:ring-radio-error-ring" : contrast ? "peer-focus-visible:ring-radio-contrast-ring" : "peer-focus-visible:ring-radio-ring";
|
|
897
|
-
const ringClasses = `peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 ${ringColor}`;
|
|
898
|
-
let dotColor;
|
|
899
|
-
if (disabled) {
|
|
900
|
-
dotColor = "bg-radio-disabled-dot";
|
|
901
|
-
} else if (contrast) {
|
|
902
|
-
dotColor = "bg-radio-contrast-selected-dot";
|
|
903
|
-
} else {
|
|
904
|
-
dotColor = "bg-radio-selected-dot";
|
|
905
|
-
}
|
|
906
|
-
const labelColor = disabled ? "text-radio-label-disabled" : contrast ? "text-radio-contrast-label" : error ? "text-radio-label-error" : "text-radio-label";
|
|
907
|
-
const descriptionColor = disabled ? "text-radio-label-disabled" : contrast ? "text-radio-contrast-description" : "text-radio-description";
|
|
908
|
-
return /* @__PURE__ */ jsxs7(
|
|
909
|
-
"label",
|
|
1115
|
+
return /* @__PURE__ */ jsx11(
|
|
1116
|
+
"div",
|
|
910
1117
|
{
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
"
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1118
|
+
className: `${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
1119
|
+
children: /* @__PURE__ */ jsxs10(
|
|
1120
|
+
"label",
|
|
1121
|
+
{
|
|
1122
|
+
htmlFor: inputId,
|
|
1123
|
+
className: `flex gap-4 ${disabled ? "pointer-events-none text-gray-400" : "text-gray-900 cursor-pointer"}`,
|
|
1124
|
+
children: [
|
|
1125
|
+
/* @__PURE__ */ jsxs10("div", { children: [
|
|
1126
|
+
/* @__PURE__ */ jsx11(
|
|
1127
|
+
"input",
|
|
1128
|
+
__spreadValues({
|
|
1129
|
+
ref,
|
|
1130
|
+
id: inputId,
|
|
1131
|
+
type: "radio",
|
|
1132
|
+
className: "sr-only peer",
|
|
1133
|
+
checked,
|
|
1134
|
+
defaultChecked,
|
|
1135
|
+
disabled,
|
|
1136
|
+
name
|
|
1137
|
+
}, rest)
|
|
1138
|
+
),
|
|
1139
|
+
/* @__PURE__ */ jsx11(
|
|
1140
|
+
"div",
|
|
1141
|
+
{
|
|
1142
|
+
className: `relative box flex items-center justify-center rounded-full border-2 group bg-white
|
|
1143
|
+
${size === "sm" ? "h-16 w-16 my-4 ml-3 mr-3" : "m-3 h-20 w-20 text-label-large"}
|
|
1144
|
+
${error ? "border-red-500" : "border-gray-600 peer-checked:border-blue-600 peer-disabled:border-gray-400!"}
|
|
1145
|
+
`,
|
|
1146
|
+
children: /* @__PURE__ */ jsx11(
|
|
1147
|
+
"span",
|
|
1148
|
+
{
|
|
1149
|
+
className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2
|
|
1150
|
+
${size === "sm" ? "h-8 w-8" : "h-10 w-10"}
|
|
1151
|
+
rounded-full bg-white group-peer-checked:bg-blue-600 group-peer-disabled:bg-white`
|
|
1152
|
+
}
|
|
1153
|
+
)
|
|
1154
|
+
}
|
|
1155
|
+
)
|
|
1156
|
+
] }),
|
|
1157
|
+
/* @__PURE__ */ jsxs10(
|
|
1158
|
+
"div",
|
|
1159
|
+
{
|
|
1160
|
+
className: `flex flex-col gap-1 ${size === "sm" ? "mt-2" : "mt-4"}`,
|
|
1161
|
+
children: [
|
|
1162
|
+
/* @__PURE__ */ jsx11(
|
|
1163
|
+
"p",
|
|
1164
|
+
{
|
|
1165
|
+
className: `
|
|
1166
|
+
${size === "sm" ? "text-label-medium" : "text-label-large"}
|
|
1167
|
+
${disabled ? "text-gray-400" : "text-gray-900"}
|
|
1168
|
+
`,
|
|
1169
|
+
children: label
|
|
1170
|
+
}
|
|
1171
|
+
),
|
|
1172
|
+
/* @__PURE__ */ jsx11(
|
|
1173
|
+
"p",
|
|
1174
|
+
{
|
|
1175
|
+
className: `text-caption-caption ${disabled ? "text-gray-400" : error ? "text-red-600" : "text-gray-600"}`,
|
|
1176
|
+
children: description
|
|
1177
|
+
}
|
|
1178
|
+
)
|
|
1179
|
+
]
|
|
1180
|
+
}
|
|
1181
|
+
)
|
|
1182
|
+
]
|
|
1183
|
+
}
|
|
1184
|
+
)
|
|
939
1185
|
}
|
|
940
1186
|
);
|
|
941
1187
|
}
|
|
@@ -944,43 +1190,43 @@ Radio.displayName = "Radio";
|
|
|
944
1190
|
|
|
945
1191
|
// src/components/Slider/Slider.tsx
|
|
946
1192
|
import {
|
|
947
|
-
forwardRef as
|
|
948
|
-
useCallback as
|
|
1193
|
+
forwardRef as forwardRef12,
|
|
1194
|
+
useCallback as useCallback4,
|
|
949
1195
|
useId as useId4,
|
|
950
|
-
useState as
|
|
1196
|
+
useState as useState5
|
|
951
1197
|
} from "react";
|
|
952
|
-
import { jsx as
|
|
1198
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
953
1199
|
var sizeConfig = {
|
|
954
1200
|
small: {
|
|
955
|
-
trackH: "h-
|
|
1201
|
+
trackH: "h-4",
|
|
956
1202
|
thumbPx: 24,
|
|
957
|
-
thumbClass: "h-
|
|
1203
|
+
thumbClass: "h-24 w-24",
|
|
958
1204
|
iconPx: 12,
|
|
959
|
-
containerH: "h-
|
|
960
|
-
label: "text-sm leading-
|
|
961
|
-
description: "text-xs leading-
|
|
1205
|
+
containerH: "h-24",
|
|
1206
|
+
label: "text-sm leading-20",
|
|
1207
|
+
description: "text-xs leading-16"
|
|
962
1208
|
},
|
|
963
1209
|
medium: {
|
|
964
|
-
trackH: "h-
|
|
1210
|
+
trackH: "h-6",
|
|
965
1211
|
thumbPx: 28,
|
|
966
|
-
thumbClass: "h-
|
|
1212
|
+
thumbClass: "h-28 w-28",
|
|
967
1213
|
iconPx: 14,
|
|
968
|
-
containerH: "h-
|
|
969
|
-
label: "text-base leading-
|
|
970
|
-
description: "text-sm leading-
|
|
1214
|
+
containerH: "h-28",
|
|
1215
|
+
label: "text-base leading-24",
|
|
1216
|
+
description: "text-sm leading-20"
|
|
971
1217
|
},
|
|
972
1218
|
large: {
|
|
973
|
-
trackH: "h-
|
|
1219
|
+
trackH: "h-8",
|
|
974
1220
|
thumbPx: 32,
|
|
975
|
-
thumbClass: "h-
|
|
1221
|
+
thumbClass: "h-32 w-32",
|
|
976
1222
|
iconPx: 16,
|
|
977
|
-
containerH: "h-
|
|
978
|
-
label: "text-base leading-
|
|
979
|
-
description: "text-sm leading-
|
|
1223
|
+
containerH: "h-32",
|
|
1224
|
+
label: "text-base leading-24",
|
|
1225
|
+
description: "text-sm leading-20"
|
|
980
1226
|
}
|
|
981
1227
|
};
|
|
982
1228
|
function ChevronGlyphs({ size, color }) {
|
|
983
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ jsxs11(
|
|
984
1230
|
"svg",
|
|
985
1231
|
{
|
|
986
1232
|
width: size,
|
|
@@ -990,7 +1236,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
990
1236
|
xmlns: "http://www.w3.org/2000/svg",
|
|
991
1237
|
"aria-hidden": "true",
|
|
992
1238
|
children: [
|
|
993
|
-
/* @__PURE__ */
|
|
1239
|
+
/* @__PURE__ */ jsx12(
|
|
994
1240
|
"path",
|
|
995
1241
|
{
|
|
996
1242
|
d: "M4.75 3.25L2.25 6L4.75 8.75",
|
|
@@ -1000,7 +1246,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1000
1246
|
strokeLinejoin: "round"
|
|
1001
1247
|
}
|
|
1002
1248
|
),
|
|
1003
|
-
/* @__PURE__ */
|
|
1249
|
+
/* @__PURE__ */ jsx12(
|
|
1004
1250
|
"path",
|
|
1005
1251
|
{
|
|
1006
1252
|
d: "M7.25 3.25L9.75 6L7.25 8.75",
|
|
@@ -1014,7 +1260,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1014
1260
|
}
|
|
1015
1261
|
);
|
|
1016
1262
|
}
|
|
1017
|
-
var Slider =
|
|
1263
|
+
var Slider = forwardRef12(
|
|
1018
1264
|
(_a, ref) => {
|
|
1019
1265
|
var _b = _a, {
|
|
1020
1266
|
size = "medium",
|
|
@@ -1055,9 +1301,9 @@ var Slider = forwardRef9(
|
|
|
1055
1301
|
const ariaLabel = ariaLabelProp != null ? ariaLabelProp : typeof label === "string" ? void 0 : "Slider";
|
|
1056
1302
|
const ariaDescriptionId = description ? `${inputId}-description` : void 0;
|
|
1057
1303
|
const isControlled = controlledValue !== void 0;
|
|
1058
|
-
const [internalValue, setInternalValue] =
|
|
1304
|
+
const [internalValue, setInternalValue] = useState5(defaultValue != null ? defaultValue : min);
|
|
1059
1305
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
1060
|
-
const handleChange =
|
|
1306
|
+
const handleChange = useCallback4(
|
|
1061
1307
|
(e) => {
|
|
1062
1308
|
const val = Number(e.target.value);
|
|
1063
1309
|
if (!isControlled) {
|
|
@@ -1077,13 +1323,13 @@ var Slider = forwardRef9(
|
|
|
1077
1323
|
const descriptionColor = disabled ? "text-slider-label-disabled" : "text-slider-description";
|
|
1078
1324
|
const thumbOffset = percent * sz.thumbPx / 100;
|
|
1079
1325
|
const fillOffset = sz.thumbPx / 2 - thumbOffset;
|
|
1080
|
-
return /* @__PURE__ */
|
|
1326
|
+
return /* @__PURE__ */ jsxs11(
|
|
1081
1327
|
"div",
|
|
1082
1328
|
{
|
|
1083
|
-
className: ["flex w-full flex-col gap-
|
|
1329
|
+
className: ["flex w-full flex-col gap-8 font-sans", className].filter(Boolean).join(" "),
|
|
1084
1330
|
children: [
|
|
1085
|
-
(label || showValue && !disabled) && /* @__PURE__ */
|
|
1086
|
-
label && /* @__PURE__ */
|
|
1331
|
+
(label || showValue && !disabled) && /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between", children: [
|
|
1332
|
+
label && /* @__PURE__ */ jsx12(
|
|
1087
1333
|
"label",
|
|
1088
1334
|
{
|
|
1089
1335
|
htmlFor: inputId,
|
|
@@ -1096,7 +1342,7 @@ var Slider = forwardRef9(
|
|
|
1096
1342
|
children: label
|
|
1097
1343
|
}
|
|
1098
1344
|
),
|
|
1099
|
-
showValue && /* @__PURE__ */
|
|
1345
|
+
showValue && /* @__PURE__ */ jsx12(
|
|
1100
1346
|
"span",
|
|
1101
1347
|
{
|
|
1102
1348
|
className: [sz.description, "tabular-nums", labelColor].join(" "),
|
|
@@ -1104,7 +1350,7 @@ var Slider = forwardRef9(
|
|
|
1104
1350
|
}
|
|
1105
1351
|
)
|
|
1106
1352
|
] }),
|
|
1107
|
-
/* @__PURE__ */
|
|
1353
|
+
/* @__PURE__ */ jsxs11(
|
|
1108
1354
|
"div",
|
|
1109
1355
|
{
|
|
1110
1356
|
className: [
|
|
@@ -1113,7 +1359,7 @@ var Slider = forwardRef9(
|
|
|
1113
1359
|
disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
1114
1360
|
].join(" "),
|
|
1115
1361
|
children: [
|
|
1116
|
-
/* @__PURE__ */
|
|
1362
|
+
/* @__PURE__ */ jsx12(
|
|
1117
1363
|
"div",
|
|
1118
1364
|
{
|
|
1119
1365
|
className: [
|
|
@@ -1123,14 +1369,14 @@ var Slider = forwardRef9(
|
|
|
1123
1369
|
].join(" ")
|
|
1124
1370
|
}
|
|
1125
1371
|
),
|
|
1126
|
-
/* @__PURE__ */
|
|
1372
|
+
/* @__PURE__ */ jsx12(
|
|
1127
1373
|
"div",
|
|
1128
1374
|
{
|
|
1129
1375
|
className: ["absolute left-0 rounded-full", sz.trackH, fillBg].join(" "),
|
|
1130
1376
|
style: { width: `calc(${percent}% + ${fillOffset}px)` }
|
|
1131
1377
|
}
|
|
1132
1378
|
),
|
|
1133
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ jsx12(
|
|
1134
1380
|
"input",
|
|
1135
1381
|
__spreadValues({
|
|
1136
1382
|
ref,
|
|
@@ -1151,7 +1397,7 @@ var Slider = forwardRef9(
|
|
|
1151
1397
|
].join(" ")
|
|
1152
1398
|
}, rest)
|
|
1153
1399
|
),
|
|
1154
|
-
/* @__PURE__ */
|
|
1400
|
+
/* @__PURE__ */ jsx12(
|
|
1155
1401
|
"div",
|
|
1156
1402
|
{
|
|
1157
1403
|
className: [
|
|
@@ -1164,13 +1410,13 @@ var Slider = forwardRef9(
|
|
|
1164
1410
|
!disabled && "peer-hover:shadow-medium"
|
|
1165
1411
|
].filter(Boolean).join(" "),
|
|
1166
1412
|
style: { left: `calc(${percent}% - ${thumbOffset}px)` },
|
|
1167
|
-
children: /* @__PURE__ */
|
|
1413
|
+
children: /* @__PURE__ */ jsx12(ChevronGlyphs, { size: sz.iconPx, color: iconColor })
|
|
1168
1414
|
}
|
|
1169
1415
|
)
|
|
1170
1416
|
]
|
|
1171
1417
|
}
|
|
1172
1418
|
),
|
|
1173
|
-
description && /* @__PURE__ */
|
|
1419
|
+
description && /* @__PURE__ */ jsx12(
|
|
1174
1420
|
"span",
|
|
1175
1421
|
{
|
|
1176
1422
|
id: ariaDescriptionId,
|
|
@@ -1186,28 +1432,28 @@ var Slider = forwardRef9(
|
|
|
1186
1432
|
Slider.displayName = "Slider";
|
|
1187
1433
|
|
|
1188
1434
|
// src/components/Toast/Toast.tsx
|
|
1189
|
-
import { forwardRef as
|
|
1190
|
-
import { jsx as
|
|
1435
|
+
import { forwardRef as forwardRef13 } from "react";
|
|
1436
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1191
1437
|
function CheckCircleIcon({ className }) {
|
|
1192
|
-
return /* @__PURE__ */
|
|
1193
|
-
/* @__PURE__ */
|
|
1194
|
-
/* @__PURE__ */
|
|
1438
|
+
return /* @__PURE__ */ jsxs12("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1439
|
+
/* @__PURE__ */ jsx13("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1440
|
+
/* @__PURE__ */ jsx13("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1195
1441
|
] });
|
|
1196
1442
|
}
|
|
1197
1443
|
function ProgressIcon({ className }) {
|
|
1198
|
-
return /* @__PURE__ */
|
|
1199
|
-
/* @__PURE__ */
|
|
1200
|
-
/* @__PURE__ */
|
|
1444
|
+
return /* @__PURE__ */ jsxs12("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1445
|
+
/* @__PURE__ */ jsx13("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5", opacity: "0.3" }),
|
|
1446
|
+
/* @__PURE__ */ jsx13("path", { d: "M10 2a8 8 0 0 1 8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: /* @__PURE__ */ jsx13("animateTransform", { attributeName: "transform", type: "rotate", from: "0 10 10", to: "360 10 10", dur: "1s", repeatCount: "indefinite" }) })
|
|
1201
1447
|
] });
|
|
1202
1448
|
}
|
|
1203
1449
|
function ErrorIcon({ className }) {
|
|
1204
|
-
return /* @__PURE__ */
|
|
1205
|
-
/* @__PURE__ */
|
|
1206
|
-
/* @__PURE__ */
|
|
1450
|
+
return /* @__PURE__ */ jsxs12("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1451
|
+
/* @__PURE__ */ jsx13("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1452
|
+
/* @__PURE__ */ jsx13("path", { d: "M10 6.5v4M10 13.5h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
1207
1453
|
] });
|
|
1208
1454
|
}
|
|
1209
1455
|
function CloseIcon2({ className }) {
|
|
1210
|
-
return /* @__PURE__ */
|
|
1456
|
+
return /* @__PURE__ */ jsx13("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1211
1457
|
}
|
|
1212
1458
|
var defaultIcons2 = {
|
|
1213
1459
|
default: CheckCircleIcon,
|
|
@@ -1224,7 +1470,7 @@ var iconColorClasses = {
|
|
|
1224
1470
|
progress: "text-toast-progress-icon",
|
|
1225
1471
|
error: "text-toast-error-icon"
|
|
1226
1472
|
};
|
|
1227
|
-
var Toast =
|
|
1473
|
+
var Toast = forwardRef13(
|
|
1228
1474
|
(_a, ref) => {
|
|
1229
1475
|
var _b = _a, {
|
|
1230
1476
|
type = "default",
|
|
@@ -1245,33 +1491,33 @@ var Toast = forwardRef10(
|
|
|
1245
1491
|
]);
|
|
1246
1492
|
const DefaultIcon = defaultIcons2[type];
|
|
1247
1493
|
const classes = [
|
|
1248
|
-
"inline-flex items-center gap-
|
|
1249
|
-
"rounded-xl px-
|
|
1494
|
+
"inline-flex items-center gap-12 font-sans",
|
|
1495
|
+
"rounded-xl px-16 py-12",
|
|
1250
1496
|
"min-w-[320px] max-w-[480px]",
|
|
1251
1497
|
"shadow-large",
|
|
1252
1498
|
typeClasses[type],
|
|
1253
1499
|
className
|
|
1254
1500
|
].filter(Boolean).join(" ");
|
|
1255
|
-
return /* @__PURE__ */
|
|
1256
|
-
icon && /* @__PURE__ */
|
|
1257
|
-
/* @__PURE__ */
|
|
1258
|
-
actionLabel && onAction && /* @__PURE__ */
|
|
1501
|
+
return /* @__PURE__ */ jsxs12("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
1502
|
+
icon && /* @__PURE__ */ jsx13("span", { className: `shrink-0 ${iconColorClasses[type]}`, children: /* @__PURE__ */ jsx13(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
1503
|
+
/* @__PURE__ */ jsx13("span", { className: "flex-1 text-sm font-medium leading-20 truncate", children }),
|
|
1504
|
+
actionLabel && onAction && /* @__PURE__ */ jsx13(
|
|
1259
1505
|
"button",
|
|
1260
1506
|
{
|
|
1261
1507
|
type: "button",
|
|
1262
1508
|
onClick: onAction,
|
|
1263
|
-
className: "shrink-0 text-sm font-medium text-toast-action-text hover:bg-toast-action-bg-hover rounded-md px-
|
|
1509
|
+
className: "shrink-0 text-sm font-medium text-toast-action-text hover:bg-toast-action-bg-hover rounded-md px-8 py-4 transition-colors",
|
|
1264
1510
|
children: actionLabel
|
|
1265
1511
|
}
|
|
1266
1512
|
),
|
|
1267
|
-
onDismiss && /* @__PURE__ */
|
|
1513
|
+
onDismiss && /* @__PURE__ */ jsx13(
|
|
1268
1514
|
"button",
|
|
1269
1515
|
{
|
|
1270
1516
|
type: "button",
|
|
1271
1517
|
onClick: onDismiss,
|
|
1272
|
-
className: "shrink-0 p-
|
|
1518
|
+
className: "shrink-0 p-4 rounded-md text-toast-dismiss hover:text-toast-dismiss-hover transition-colors",
|
|
1273
1519
|
"aria-label": "Dismiss",
|
|
1274
|
-
children: /* @__PURE__ */
|
|
1520
|
+
children: /* @__PURE__ */ jsx13(CloseIcon2, { className: "h-16 w-16" })
|
|
1275
1521
|
}
|
|
1276
1522
|
)
|
|
1277
1523
|
] }));
|
|
@@ -1283,8 +1529,10 @@ export {
|
|
|
1283
1529
|
AlertBanner,
|
|
1284
1530
|
Avatar,
|
|
1285
1531
|
Badge,
|
|
1532
|
+
BottomSheet,
|
|
1286
1533
|
Button,
|
|
1287
1534
|
Checkbox,
|
|
1535
|
+
Dialog,
|
|
1288
1536
|
Icon,
|
|
1289
1537
|
Radio,
|
|
1290
1538
|
Slider,
|