@refinn/core-ui 0.1.1 → 0.1.2
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 +44 -15
- package/dist/index.d.ts +44 -15
- package/dist/index.js +538 -332
- package/dist/index.mjs +534 -334
- 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
|
}
|
|
@@ -555,11 +505,11 @@ var variantClasses = {
|
|
|
555
505
|
"disabled:bg-btn-transparent-disabled disabled:text-btn-transparent-text-disabled"
|
|
556
506
|
].join(" ")
|
|
557
507
|
};
|
|
558
|
-
var
|
|
559
|
-
small: "h-
|
|
560
|
-
medium: "h-
|
|
561
|
-
large: "h-
|
|
562
|
-
"extra-large": "h-
|
|
508
|
+
var sizeClasses3 = {
|
|
509
|
+
small: "h-32 px-12 text-sm gap-4",
|
|
510
|
+
medium: "h-40 px-16 text-sm gap-6",
|
|
511
|
+
large: "h-48 px-20 text-base gap-8",
|
|
512
|
+
"extra-large": "h-56 px-24 text-lg gap-8"
|
|
563
513
|
};
|
|
564
514
|
function Spinner({ className }) {
|
|
565
515
|
return /* @__PURE__ */ jsx5(
|
|
@@ -611,7 +561,7 @@ var Button = forwardRef5(
|
|
|
611
561
|
"transition-colors duration-150",
|
|
612
562
|
"outline-none",
|
|
613
563
|
"disabled:cursor-not-allowed",
|
|
614
|
-
|
|
564
|
+
sizeClasses3[size],
|
|
615
565
|
variantClasses[variant],
|
|
616
566
|
rounded ? "rounded-full" : "rounded-lg",
|
|
617
567
|
className
|
|
@@ -634,135 +584,278 @@ var Button = forwardRef5(
|
|
|
634
584
|
);
|
|
635
585
|
Button.displayName = "Button";
|
|
636
586
|
|
|
587
|
+
// src/components/BottomSheet/BottomSheet.tsx
|
|
588
|
+
import React, { useEffect, useState as useState2, useCallback as useCallback2, forwardRef as forwardRef6 } from "react";
|
|
589
|
+
import { createPortal } from "react-dom";
|
|
590
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
591
|
+
var BottomSheet = forwardRef6(
|
|
592
|
+
(_a, ref) => {
|
|
593
|
+
var _b = _a, {
|
|
594
|
+
isForceOpen = false,
|
|
595
|
+
setIsForceOpen,
|
|
596
|
+
isClosedAble = true,
|
|
597
|
+
children,
|
|
598
|
+
startModalBtn,
|
|
599
|
+
stopModalBtn,
|
|
600
|
+
afterStopBtn,
|
|
601
|
+
size = "md",
|
|
602
|
+
modalTitle = "\u0E2B\u0E31\u0E27\u0E02\u0E49\u0E2D",
|
|
603
|
+
modalDesc = "\u0E04\u0E33\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22",
|
|
604
|
+
className = ""
|
|
605
|
+
} = _b, rest = __objRest(_b, [
|
|
606
|
+
"isForceOpen",
|
|
607
|
+
"setIsForceOpen",
|
|
608
|
+
"isClosedAble",
|
|
609
|
+
"children",
|
|
610
|
+
"startModalBtn",
|
|
611
|
+
"stopModalBtn",
|
|
612
|
+
"afterStopBtn",
|
|
613
|
+
"size",
|
|
614
|
+
"modalTitle",
|
|
615
|
+
"modalDesc",
|
|
616
|
+
"className"
|
|
617
|
+
]);
|
|
618
|
+
const [isOpen, setIsOpen] = useState2(false);
|
|
619
|
+
const [shouldRender, setShouldRender] = useState2(false);
|
|
620
|
+
const [animate, setAnimate] = useState2(false);
|
|
621
|
+
useEffect(() => {
|
|
622
|
+
if (isOpen) {
|
|
623
|
+
setShouldRender(true);
|
|
624
|
+
setTimeout(() => setAnimate(true), 10);
|
|
625
|
+
} else {
|
|
626
|
+
setAnimate(false);
|
|
627
|
+
const timer = setTimeout(() => setShouldRender(false), 300);
|
|
628
|
+
return () => clearTimeout(timer);
|
|
629
|
+
}
|
|
630
|
+
}, [isOpen]);
|
|
631
|
+
useEffect(() => {
|
|
632
|
+
if (isForceOpen) {
|
|
633
|
+
setIsOpen(true);
|
|
634
|
+
} else {
|
|
635
|
+
setIsOpen(false);
|
|
636
|
+
}
|
|
637
|
+
}, [isForceOpen]);
|
|
638
|
+
const handleStartClick = useCallback2(
|
|
639
|
+
(e) => {
|
|
640
|
+
var _a2, _b2;
|
|
641
|
+
(_b2 = startModalBtn == null ? void 0 : (_a2 = startModalBtn.props).onClick) == null ? void 0 : _b2.call(_a2, e);
|
|
642
|
+
setIsForceOpen == null ? void 0 : setIsForceOpen(true);
|
|
643
|
+
setIsOpen(true);
|
|
644
|
+
},
|
|
645
|
+
[startModalBtn]
|
|
646
|
+
);
|
|
647
|
+
const handleStopClick = useCallback2(
|
|
648
|
+
(e) => {
|
|
649
|
+
var _a2, _b2;
|
|
650
|
+
(_b2 = stopModalBtn == null ? void 0 : (_a2 = stopModalBtn.props).onClick) == null ? void 0 : _b2.call(_a2, e);
|
|
651
|
+
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
652
|
+
setIsOpen(false);
|
|
653
|
+
},
|
|
654
|
+
[stopModalBtn]
|
|
655
|
+
);
|
|
656
|
+
const handleCloseClick = () => {
|
|
657
|
+
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
658
|
+
setIsOpen(false);
|
|
659
|
+
};
|
|
660
|
+
return /* @__PURE__ */ jsxs6("span", { ref, style: { display: "contents" }, children: [
|
|
661
|
+
startModalBtn && React.cloneElement(startModalBtn, {
|
|
662
|
+
onClick: handleStartClick
|
|
663
|
+
}),
|
|
664
|
+
shouldRender && createPortal(
|
|
665
|
+
/* @__PURE__ */ jsxs6(
|
|
666
|
+
"div",
|
|
667
|
+
{
|
|
668
|
+
className: `fixed inset-0 z-50 flex items-end justify-center transition-opacity duration-300 ${animate ? "opacity-100" : "opacity-0"}`,
|
|
669
|
+
"aria-modal": "true",
|
|
670
|
+
role: "dialog",
|
|
671
|
+
children: [
|
|
672
|
+
/* @__PURE__ */ jsx6(
|
|
673
|
+
"div",
|
|
674
|
+
{
|
|
675
|
+
className: "absolute inset-0 bg-black/40",
|
|
676
|
+
onClick: () => isClosedAble ? handleCloseClick() : null,
|
|
677
|
+
"aria-label": "Close modal"
|
|
678
|
+
}
|
|
679
|
+
),
|
|
680
|
+
/* @__PURE__ */ jsxs6(
|
|
681
|
+
"div",
|
|
682
|
+
{
|
|
683
|
+
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
|
|
684
|
+
${size === "sm" ? "h-auto max-h-auto" : size === "md" ? "h-full max-h-[85vh]" : "h-full max-h-screen rounded-t-none!"}
|
|
685
|
+
${animate ? "scale-100 translate-y-0" : "scale-95 translate-y-full"}`,
|
|
686
|
+
children: [
|
|
687
|
+
/* @__PURE__ */ jsxs6("div", { className: "w-full flex flex-row relative items-center pt-8 pb-16", children: [
|
|
688
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col px-8 max-w-225", children: [
|
|
689
|
+
/* @__PURE__ */ jsx6("p", { className: "text-heading-3 text-button-sheet-text-primary", children: modalTitle }),
|
|
690
|
+
/* @__PURE__ */ jsx6("p", { className: "text-body-small text-button-sheet-text-secondary", children: modalDesc })
|
|
691
|
+
] }),
|
|
692
|
+
/* @__PURE__ */ jsx6(
|
|
693
|
+
"i",
|
|
694
|
+
{
|
|
695
|
+
className: "fi fi-br-cross-small flex text-xl text-gray-600 w-44 h-44 absolute top-0 right-0 p-12",
|
|
696
|
+
onClick: () => handleCloseClick()
|
|
697
|
+
}
|
|
698
|
+
),
|
|
699
|
+
/* @__PURE__ */ jsx6(
|
|
700
|
+
"div",
|
|
701
|
+
{
|
|
702
|
+
className: "text-gray-600 text-xl absolute top-0 right-0 p-12",
|
|
703
|
+
onClick: () => handleCloseClick(),
|
|
704
|
+
children: "x"
|
|
705
|
+
}
|
|
706
|
+
)
|
|
707
|
+
] }),
|
|
708
|
+
/* @__PURE__ */ jsxs6("div", { className: "w-full h-full grow overflow-y-auto overflow-x-visible", children: [
|
|
709
|
+
children,
|
|
710
|
+
stopModalBtn && React.cloneElement(stopModalBtn, {
|
|
711
|
+
onClick: handleStopClick
|
|
712
|
+
}),
|
|
713
|
+
afterStopBtn && afterStopBtn
|
|
714
|
+
] })
|
|
715
|
+
]
|
|
716
|
+
}
|
|
717
|
+
)
|
|
718
|
+
]
|
|
719
|
+
}
|
|
720
|
+
),
|
|
721
|
+
document.body
|
|
722
|
+
)
|
|
723
|
+
] });
|
|
724
|
+
}
|
|
725
|
+
);
|
|
726
|
+
BottomSheet.displayName = "BottomSheet";
|
|
727
|
+
|
|
637
728
|
// src/components/Checkbox/Checkbox.tsx
|
|
638
729
|
import {
|
|
639
|
-
forwardRef as
|
|
640
|
-
useId as useId2
|
|
730
|
+
forwardRef as forwardRef7,
|
|
731
|
+
useId as useId2,
|
|
732
|
+
useState as useState3
|
|
641
733
|
} 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
|
-
};
|
|
734
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
659
735
|
function CheckIcon({ className }) {
|
|
660
|
-
return /* @__PURE__ */
|
|
661
|
-
"
|
|
736
|
+
return /* @__PURE__ */ jsx7(
|
|
737
|
+
"svg",
|
|
662
738
|
{
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
739
|
+
className,
|
|
740
|
+
viewBox: "0 0 16 16",
|
|
741
|
+
fill: "none",
|
|
742
|
+
"aria-hidden": "true",
|
|
743
|
+
children: /* @__PURE__ */ jsx7(
|
|
744
|
+
"path",
|
|
745
|
+
{
|
|
746
|
+
d: "M13.333 4.667 6 12l-3.333-3.333",
|
|
747
|
+
stroke: "currentColor",
|
|
748
|
+
strokeWidth: "2",
|
|
749
|
+
strokeLinecap: "round",
|
|
750
|
+
strokeLinejoin: "round"
|
|
751
|
+
}
|
|
752
|
+
)
|
|
668
753
|
}
|
|
669
|
-
)
|
|
754
|
+
);
|
|
670
755
|
}
|
|
671
756
|
function IndeterminateIcon({ className }) {
|
|
672
|
-
return /* @__PURE__ */
|
|
673
|
-
"
|
|
757
|
+
return /* @__PURE__ */ jsx7(
|
|
758
|
+
"svg",
|
|
674
759
|
{
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
760
|
+
className,
|
|
761
|
+
viewBox: "0 0 16 16",
|
|
762
|
+
fill: "none",
|
|
763
|
+
"aria-hidden": "true",
|
|
764
|
+
children: /* @__PURE__ */ jsx7(
|
|
765
|
+
"path",
|
|
766
|
+
{
|
|
767
|
+
d: "M3.333 8h9.334",
|
|
768
|
+
stroke: "currentColor",
|
|
769
|
+
strokeWidth: "2",
|
|
770
|
+
strokeLinecap: "round"
|
|
771
|
+
}
|
|
772
|
+
)
|
|
679
773
|
}
|
|
680
|
-
)
|
|
774
|
+
);
|
|
681
775
|
}
|
|
682
|
-
var Checkbox =
|
|
776
|
+
var Checkbox = forwardRef7(
|
|
683
777
|
(_a, ref) => {
|
|
684
778
|
var _b = _a, {
|
|
685
|
-
size = "medium",
|
|
686
779
|
label,
|
|
687
780
|
description,
|
|
688
|
-
indeterminate = false,
|
|
689
781
|
error = false,
|
|
690
782
|
contrast = false,
|
|
691
|
-
|
|
692
|
-
defaultChecked,
|
|
783
|
+
indeterminate = false,
|
|
693
784
|
disabled = false,
|
|
694
785
|
className = "",
|
|
695
|
-
id
|
|
786
|
+
id,
|
|
787
|
+
defaultChecked
|
|
696
788
|
} = _b, rest = __objRest(_b, [
|
|
697
|
-
"size",
|
|
698
789
|
"label",
|
|
699
790
|
"description",
|
|
700
|
-
"indeterminate",
|
|
701
791
|
"error",
|
|
702
792
|
"contrast",
|
|
703
|
-
"
|
|
704
|
-
"defaultChecked",
|
|
793
|
+
"indeterminate",
|
|
705
794
|
"disabled",
|
|
706
795
|
"className",
|
|
707
|
-
"id"
|
|
796
|
+
"id",
|
|
797
|
+
"defaultChecked"
|
|
708
798
|
]);
|
|
709
799
|
const reactId = useId2();
|
|
710
800
|
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(
|
|
801
|
+
const [isChecked, setIsChecked] = useState3(defaultChecked != null ? defaultChecked : false);
|
|
802
|
+
return /* @__PURE__ */ jsxs7(
|
|
737
803
|
"label",
|
|
738
804
|
{
|
|
739
805
|
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(" "),
|
|
806
|
+
className: `flex select-none font-sans ${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
746
807
|
children: [
|
|
747
|
-
/* @__PURE__ */
|
|
748
|
-
/* @__PURE__ */
|
|
808
|
+
/* @__PURE__ */ jsxs7("div", { className: "relative mr-16", children: [
|
|
809
|
+
/* @__PURE__ */ jsx7(
|
|
749
810
|
"input",
|
|
750
811
|
__spreadValues({
|
|
751
812
|
ref,
|
|
752
813
|
id: inputId,
|
|
753
814
|
type: "checkbox",
|
|
754
|
-
checked,
|
|
755
815
|
defaultChecked,
|
|
816
|
+
onChange: (e) => {
|
|
817
|
+
var _a2;
|
|
818
|
+
setIsChecked(e.target.checked);
|
|
819
|
+
(_a2 = rest.onChange) == null ? void 0 : _a2.call(rest, e);
|
|
820
|
+
},
|
|
756
821
|
disabled,
|
|
757
|
-
"aria-checked": indeterminate ? "mixed" :
|
|
758
|
-
className: "
|
|
822
|
+
"aria-checked": indeterminate ? "mixed" : isChecked,
|
|
823
|
+
className: "sr-only"
|
|
759
824
|
}, rest)
|
|
760
825
|
),
|
|
761
|
-
/* @__PURE__ */
|
|
826
|
+
/* @__PURE__ */ jsx7(
|
|
827
|
+
"div",
|
|
828
|
+
{
|
|
829
|
+
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"}`,
|
|
830
|
+
children: isChecked ? /* @__PURE__ */ jsx7(
|
|
831
|
+
CheckIcon,
|
|
832
|
+
{
|
|
833
|
+
className: `h-20 ${contrast ? "text-static-icon-brand" : "text-white"}`
|
|
834
|
+
}
|
|
835
|
+
) : indeterminate ? /* @__PURE__ */ jsx7(
|
|
836
|
+
IndeterminateIcon,
|
|
837
|
+
{
|
|
838
|
+
className: `h-20 ${contrast ? "text-static-icon-brand" : "text-white"}`
|
|
839
|
+
}
|
|
840
|
+
) : null
|
|
841
|
+
}
|
|
842
|
+
)
|
|
762
843
|
] }),
|
|
763
|
-
(label || description) && /* @__PURE__ */
|
|
764
|
-
label && /* @__PURE__ */
|
|
765
|
-
|
|
844
|
+
(label || description) && /* @__PURE__ */ jsxs7("span", { className: "flex flex-col", children: [
|
|
845
|
+
label && /* @__PURE__ */ jsx7(
|
|
846
|
+
"span",
|
|
847
|
+
{
|
|
848
|
+
className: `text-label-large ${disabled ? "text-checkbox-text-disabled" : contrast ? "text-checkbox-text-primary-inverse" : "text-checkbox-text-primary"}`,
|
|
849
|
+
children: label
|
|
850
|
+
}
|
|
851
|
+
),
|
|
852
|
+
description && /* @__PURE__ */ jsx7(
|
|
853
|
+
"span",
|
|
854
|
+
{
|
|
855
|
+
className: `text-body-small ${error ? "text-checkbox-text-danger" : disabled ? "text-checkbox-text-disabled" : contrast ? "text-checkbox-text-primary-inverse" : "text-checkbox-text-secondary"}`,
|
|
856
|
+
children: description
|
|
857
|
+
}
|
|
858
|
+
)
|
|
766
859
|
] })
|
|
767
860
|
]
|
|
768
861
|
}
|
|
@@ -771,10 +864,115 @@ var Checkbox = forwardRef6(
|
|
|
771
864
|
);
|
|
772
865
|
Checkbox.displayName = "Checkbox";
|
|
773
866
|
|
|
867
|
+
// src/components/Dialog/Dialog.tsx
|
|
868
|
+
import React2, {
|
|
869
|
+
useEffect as useEffect2,
|
|
870
|
+
useState as useState4,
|
|
871
|
+
useCallback as useCallback3,
|
|
872
|
+
forwardRef as forwardRef8
|
|
873
|
+
} from "react";
|
|
874
|
+
import { createPortal as createPortal2 } from "react-dom";
|
|
875
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
876
|
+
var Dialog = forwardRef8(
|
|
877
|
+
({
|
|
878
|
+
isForceOpen = false,
|
|
879
|
+
setIsForceOpen,
|
|
880
|
+
isClosedAble = true,
|
|
881
|
+
children,
|
|
882
|
+
startModalBtn,
|
|
883
|
+
stopModalBtn,
|
|
884
|
+
afterStopBtn,
|
|
885
|
+
p = "20"
|
|
886
|
+
}, ref) => {
|
|
887
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
888
|
+
const [shouldRender, setShouldRender] = useState4(false);
|
|
889
|
+
const [animate, setAnimate] = useState4(false);
|
|
890
|
+
useEffect2(() => {
|
|
891
|
+
if (isOpen) {
|
|
892
|
+
setShouldRender(true);
|
|
893
|
+
setTimeout(() => setAnimate(true), 10);
|
|
894
|
+
} else {
|
|
895
|
+
setAnimate(false);
|
|
896
|
+
const timer = setTimeout(() => setShouldRender(false), 300);
|
|
897
|
+
return () => clearTimeout(timer);
|
|
898
|
+
}
|
|
899
|
+
}, [isOpen]);
|
|
900
|
+
useEffect2(() => {
|
|
901
|
+
if (isForceOpen) {
|
|
902
|
+
setIsOpen(true);
|
|
903
|
+
} else {
|
|
904
|
+
setIsOpen(false);
|
|
905
|
+
}
|
|
906
|
+
}, [isForceOpen]);
|
|
907
|
+
const handleStartClick = useCallback3(
|
|
908
|
+
(e) => {
|
|
909
|
+
var _a, _b;
|
|
910
|
+
(_b = startModalBtn == null ? void 0 : (_a = startModalBtn.props).onClick) == null ? void 0 : _b.call(_a, e);
|
|
911
|
+
setIsForceOpen == null ? void 0 : setIsForceOpen(true);
|
|
912
|
+
setIsOpen(true);
|
|
913
|
+
},
|
|
914
|
+
[startModalBtn]
|
|
915
|
+
);
|
|
916
|
+
const handleStopClick = useCallback3(
|
|
917
|
+
(e) => {
|
|
918
|
+
var _a, _b;
|
|
919
|
+
(_b = stopModalBtn == null ? void 0 : (_a = stopModalBtn.props).onClick) == null ? void 0 : _b.call(_a, e);
|
|
920
|
+
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
921
|
+
setIsOpen(false);
|
|
922
|
+
},
|
|
923
|
+
[stopModalBtn]
|
|
924
|
+
);
|
|
925
|
+
const handleCloseClick = () => {
|
|
926
|
+
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
927
|
+
setIsOpen(false);
|
|
928
|
+
};
|
|
929
|
+
return /* @__PURE__ */ jsxs8("span", { ref, style: { display: "contents" }, children: [
|
|
930
|
+
startModalBtn && React2.cloneElement(startModalBtn, {
|
|
931
|
+
onClick: handleStartClick
|
|
932
|
+
}),
|
|
933
|
+
shouldRender && createPortal2(
|
|
934
|
+
/* @__PURE__ */ jsxs8(
|
|
935
|
+
"div",
|
|
936
|
+
{
|
|
937
|
+
className: `fixed inset-0 z-50 flex items-center justify-center transition-opacity duration-300 ${animate ? "opacity-100" : "opacity-0"}`,
|
|
938
|
+
"aria-modal": "true",
|
|
939
|
+
role: "dialog",
|
|
940
|
+
children: [
|
|
941
|
+
/* @__PURE__ */ jsx8(
|
|
942
|
+
"div",
|
|
943
|
+
{
|
|
944
|
+
className: "absolute inset-0 bg-black/40",
|
|
945
|
+
onClick: () => isClosedAble ? handleCloseClick() : null,
|
|
946
|
+
"aria-label": "Close modal"
|
|
947
|
+
}
|
|
948
|
+
),
|
|
949
|
+
/* @__PURE__ */ jsxs8(
|
|
950
|
+
"div",
|
|
951
|
+
{
|
|
952
|
+
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"}`,
|
|
953
|
+
children: [
|
|
954
|
+
children,
|
|
955
|
+
stopModalBtn && React2.cloneElement(stopModalBtn, {
|
|
956
|
+
onClick: handleStopClick
|
|
957
|
+
}),
|
|
958
|
+
afterStopBtn && afterStopBtn
|
|
959
|
+
]
|
|
960
|
+
}
|
|
961
|
+
)
|
|
962
|
+
]
|
|
963
|
+
}
|
|
964
|
+
),
|
|
965
|
+
document.body
|
|
966
|
+
)
|
|
967
|
+
] });
|
|
968
|
+
}
|
|
969
|
+
);
|
|
970
|
+
Dialog.displayName = "Dialog";
|
|
971
|
+
|
|
774
972
|
// src/components/Icon/Icon.tsx
|
|
775
|
-
import { forwardRef as
|
|
776
|
-
import { jsx as
|
|
777
|
-
var Icon =
|
|
973
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
974
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
975
|
+
var Icon = forwardRef9(
|
|
778
976
|
(_a, ref) => {
|
|
779
977
|
var _b = _a, {
|
|
780
978
|
name,
|
|
@@ -802,7 +1000,7 @@ var Icon = forwardRef7(
|
|
|
802
1000
|
"material-symbols-outlined select-none shrink-0 inline-block leading-none",
|
|
803
1001
|
className
|
|
804
1002
|
].filter(Boolean).join(" ");
|
|
805
|
-
return /* @__PURE__ */
|
|
1003
|
+
return /* @__PURE__ */ jsx9(
|
|
806
1004
|
"span",
|
|
807
1005
|
__spreadProps(__spreadValues({
|
|
808
1006
|
ref,
|
|
@@ -826,11 +1024,11 @@ Icon.displayName = "Icon";
|
|
|
826
1024
|
|
|
827
1025
|
// src/components/Radio/Radio.tsx
|
|
828
1026
|
import {
|
|
829
|
-
forwardRef as
|
|
1027
|
+
forwardRef as forwardRef10,
|
|
830
1028
|
useId as useId3
|
|
831
1029
|
} from "react";
|
|
832
|
-
import { jsx as
|
|
833
|
-
var
|
|
1030
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1031
|
+
var sizeClasses4 = {
|
|
834
1032
|
small: {
|
|
835
1033
|
box: "h-4 w-4",
|
|
836
1034
|
dot: "h-1.5 w-1.5",
|
|
@@ -846,7 +1044,7 @@ var sizeClasses6 = {
|
|
|
846
1044
|
gap: "gap-2.5"
|
|
847
1045
|
}
|
|
848
1046
|
};
|
|
849
|
-
var Radio =
|
|
1047
|
+
var Radio = forwardRef10(
|
|
850
1048
|
(_a, ref) => {
|
|
851
1049
|
var _b = _a, {
|
|
852
1050
|
size = "medium",
|
|
@@ -873,7 +1071,7 @@ var Radio = forwardRef8(
|
|
|
873
1071
|
]);
|
|
874
1072
|
const reactId = useId3();
|
|
875
1073
|
const inputId = id != null ? id : reactId;
|
|
876
|
-
const sz =
|
|
1074
|
+
const sz = sizeClasses4[size];
|
|
877
1075
|
const circleBase = [
|
|
878
1076
|
"relative inline-flex items-center justify-center shrink-0",
|
|
879
1077
|
"rounded-full",
|
|
@@ -905,7 +1103,7 @@ var Radio = forwardRef8(
|
|
|
905
1103
|
}
|
|
906
1104
|
const labelColor = disabled ? "text-radio-label-disabled" : contrast ? "text-radio-contrast-label" : error ? "text-radio-label-error" : "text-radio-label";
|
|
907
1105
|
const descriptionColor = disabled ? "text-radio-label-disabled" : contrast ? "text-radio-contrast-description" : "text-radio-description";
|
|
908
|
-
return /* @__PURE__ */
|
|
1106
|
+
return /* @__PURE__ */ jsxs9(
|
|
909
1107
|
"label",
|
|
910
1108
|
{
|
|
911
1109
|
htmlFor: inputId,
|
|
@@ -916,8 +1114,8 @@ var Radio = forwardRef8(
|
|
|
916
1114
|
className
|
|
917
1115
|
].filter(Boolean).join(" "),
|
|
918
1116
|
children: [
|
|
919
|
-
/* @__PURE__ */
|
|
920
|
-
/* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ jsxs9("span", { className: "relative inline-flex", children: [
|
|
1118
|
+
/* @__PURE__ */ jsx10(
|
|
921
1119
|
"input",
|
|
922
1120
|
__spreadValues({
|
|
923
1121
|
ref,
|
|
@@ -929,11 +1127,11 @@ var Radio = forwardRef8(
|
|
|
929
1127
|
className: "peer absolute inset-0 h-full w-full cursor-[inherit] opacity-0"
|
|
930
1128
|
}, rest)
|
|
931
1129
|
),
|
|
932
|
-
/* @__PURE__ */
|
|
1130
|
+
/* @__PURE__ */ jsx10("span", { className: [circleBase, circleState, ringClasses].join(" "), children: checked && /* @__PURE__ */ jsx10("span", { className: `rounded-full ${sz.dot} ${dotColor}` }) })
|
|
933
1131
|
] }),
|
|
934
|
-
(label || description) && /* @__PURE__ */
|
|
935
|
-
label && /* @__PURE__ */
|
|
936
|
-
description && /* @__PURE__ */
|
|
1132
|
+
(label || description) && /* @__PURE__ */ jsxs9("span", { className: "flex flex-col", children: [
|
|
1133
|
+
label && /* @__PURE__ */ jsx10("span", { className: `${sz.label} font-medium ${labelColor}`, children: label }),
|
|
1134
|
+
description && /* @__PURE__ */ jsx10("span", { className: `${sz.description} ${descriptionColor}`, children: description })
|
|
937
1135
|
] })
|
|
938
1136
|
]
|
|
939
1137
|
}
|
|
@@ -944,43 +1142,43 @@ Radio.displayName = "Radio";
|
|
|
944
1142
|
|
|
945
1143
|
// src/components/Slider/Slider.tsx
|
|
946
1144
|
import {
|
|
947
|
-
forwardRef as
|
|
948
|
-
useCallback as
|
|
1145
|
+
forwardRef as forwardRef11,
|
|
1146
|
+
useCallback as useCallback4,
|
|
949
1147
|
useId as useId4,
|
|
950
|
-
useState as
|
|
1148
|
+
useState as useState5
|
|
951
1149
|
} from "react";
|
|
952
|
-
import { jsx as
|
|
1150
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
953
1151
|
var sizeConfig = {
|
|
954
1152
|
small: {
|
|
955
|
-
trackH: "h-
|
|
1153
|
+
trackH: "h-4",
|
|
956
1154
|
thumbPx: 24,
|
|
957
|
-
thumbClass: "h-
|
|
1155
|
+
thumbClass: "h-24 w-24",
|
|
958
1156
|
iconPx: 12,
|
|
959
|
-
containerH: "h-
|
|
960
|
-
label: "text-sm leading-
|
|
961
|
-
description: "text-xs leading-
|
|
1157
|
+
containerH: "h-24",
|
|
1158
|
+
label: "text-sm leading-20",
|
|
1159
|
+
description: "text-xs leading-16"
|
|
962
1160
|
},
|
|
963
1161
|
medium: {
|
|
964
|
-
trackH: "h-
|
|
1162
|
+
trackH: "h-6",
|
|
965
1163
|
thumbPx: 28,
|
|
966
|
-
thumbClass: "h-
|
|
1164
|
+
thumbClass: "h-28 w-28",
|
|
967
1165
|
iconPx: 14,
|
|
968
|
-
containerH: "h-
|
|
969
|
-
label: "text-base leading-
|
|
970
|
-
description: "text-sm leading-
|
|
1166
|
+
containerH: "h-28",
|
|
1167
|
+
label: "text-base leading-24",
|
|
1168
|
+
description: "text-sm leading-20"
|
|
971
1169
|
},
|
|
972
1170
|
large: {
|
|
973
|
-
trackH: "h-
|
|
1171
|
+
trackH: "h-8",
|
|
974
1172
|
thumbPx: 32,
|
|
975
|
-
thumbClass: "h-
|
|
1173
|
+
thumbClass: "h-32 w-32",
|
|
976
1174
|
iconPx: 16,
|
|
977
|
-
containerH: "h-
|
|
978
|
-
label: "text-base leading-
|
|
979
|
-
description: "text-sm leading-
|
|
1175
|
+
containerH: "h-32",
|
|
1176
|
+
label: "text-base leading-24",
|
|
1177
|
+
description: "text-sm leading-20"
|
|
980
1178
|
}
|
|
981
1179
|
};
|
|
982
1180
|
function ChevronGlyphs({ size, color }) {
|
|
983
|
-
return /* @__PURE__ */
|
|
1181
|
+
return /* @__PURE__ */ jsxs10(
|
|
984
1182
|
"svg",
|
|
985
1183
|
{
|
|
986
1184
|
width: size,
|
|
@@ -990,7 +1188,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
990
1188
|
xmlns: "http://www.w3.org/2000/svg",
|
|
991
1189
|
"aria-hidden": "true",
|
|
992
1190
|
children: [
|
|
993
|
-
/* @__PURE__ */
|
|
1191
|
+
/* @__PURE__ */ jsx11(
|
|
994
1192
|
"path",
|
|
995
1193
|
{
|
|
996
1194
|
d: "M4.75 3.25L2.25 6L4.75 8.75",
|
|
@@ -1000,7 +1198,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1000
1198
|
strokeLinejoin: "round"
|
|
1001
1199
|
}
|
|
1002
1200
|
),
|
|
1003
|
-
/* @__PURE__ */
|
|
1201
|
+
/* @__PURE__ */ jsx11(
|
|
1004
1202
|
"path",
|
|
1005
1203
|
{
|
|
1006
1204
|
d: "M7.25 3.25L9.75 6L7.25 8.75",
|
|
@@ -1014,7 +1212,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1014
1212
|
}
|
|
1015
1213
|
);
|
|
1016
1214
|
}
|
|
1017
|
-
var Slider =
|
|
1215
|
+
var Slider = forwardRef11(
|
|
1018
1216
|
(_a, ref) => {
|
|
1019
1217
|
var _b = _a, {
|
|
1020
1218
|
size = "medium",
|
|
@@ -1055,9 +1253,9 @@ var Slider = forwardRef9(
|
|
|
1055
1253
|
const ariaLabel = ariaLabelProp != null ? ariaLabelProp : typeof label === "string" ? void 0 : "Slider";
|
|
1056
1254
|
const ariaDescriptionId = description ? `${inputId}-description` : void 0;
|
|
1057
1255
|
const isControlled = controlledValue !== void 0;
|
|
1058
|
-
const [internalValue, setInternalValue] =
|
|
1256
|
+
const [internalValue, setInternalValue] = useState5(defaultValue != null ? defaultValue : min);
|
|
1059
1257
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
1060
|
-
const handleChange =
|
|
1258
|
+
const handleChange = useCallback4(
|
|
1061
1259
|
(e) => {
|
|
1062
1260
|
const val = Number(e.target.value);
|
|
1063
1261
|
if (!isControlled) {
|
|
@@ -1077,13 +1275,13 @@ var Slider = forwardRef9(
|
|
|
1077
1275
|
const descriptionColor = disabled ? "text-slider-label-disabled" : "text-slider-description";
|
|
1078
1276
|
const thumbOffset = percent * sz.thumbPx / 100;
|
|
1079
1277
|
const fillOffset = sz.thumbPx / 2 - thumbOffset;
|
|
1080
|
-
return /* @__PURE__ */
|
|
1278
|
+
return /* @__PURE__ */ jsxs10(
|
|
1081
1279
|
"div",
|
|
1082
1280
|
{
|
|
1083
|
-
className: ["flex w-full flex-col gap-
|
|
1281
|
+
className: ["flex w-full flex-col gap-8 font-sans", className].filter(Boolean).join(" "),
|
|
1084
1282
|
children: [
|
|
1085
|
-
(label || showValue && !disabled) && /* @__PURE__ */
|
|
1086
|
-
label && /* @__PURE__ */
|
|
1283
|
+
(label || showValue && !disabled) && /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between", children: [
|
|
1284
|
+
label && /* @__PURE__ */ jsx11(
|
|
1087
1285
|
"label",
|
|
1088
1286
|
{
|
|
1089
1287
|
htmlFor: inputId,
|
|
@@ -1096,7 +1294,7 @@ var Slider = forwardRef9(
|
|
|
1096
1294
|
children: label
|
|
1097
1295
|
}
|
|
1098
1296
|
),
|
|
1099
|
-
showValue && /* @__PURE__ */
|
|
1297
|
+
showValue && /* @__PURE__ */ jsx11(
|
|
1100
1298
|
"span",
|
|
1101
1299
|
{
|
|
1102
1300
|
className: [sz.description, "tabular-nums", labelColor].join(" "),
|
|
@@ -1104,7 +1302,7 @@ var Slider = forwardRef9(
|
|
|
1104
1302
|
}
|
|
1105
1303
|
)
|
|
1106
1304
|
] }),
|
|
1107
|
-
/* @__PURE__ */
|
|
1305
|
+
/* @__PURE__ */ jsxs10(
|
|
1108
1306
|
"div",
|
|
1109
1307
|
{
|
|
1110
1308
|
className: [
|
|
@@ -1113,7 +1311,7 @@ var Slider = forwardRef9(
|
|
|
1113
1311
|
disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
1114
1312
|
].join(" "),
|
|
1115
1313
|
children: [
|
|
1116
|
-
/* @__PURE__ */
|
|
1314
|
+
/* @__PURE__ */ jsx11(
|
|
1117
1315
|
"div",
|
|
1118
1316
|
{
|
|
1119
1317
|
className: [
|
|
@@ -1123,14 +1321,14 @@ var Slider = forwardRef9(
|
|
|
1123
1321
|
].join(" ")
|
|
1124
1322
|
}
|
|
1125
1323
|
),
|
|
1126
|
-
/* @__PURE__ */
|
|
1324
|
+
/* @__PURE__ */ jsx11(
|
|
1127
1325
|
"div",
|
|
1128
1326
|
{
|
|
1129
1327
|
className: ["absolute left-0 rounded-full", sz.trackH, fillBg].join(" "),
|
|
1130
1328
|
style: { width: `calc(${percent}% + ${fillOffset}px)` }
|
|
1131
1329
|
}
|
|
1132
1330
|
),
|
|
1133
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ jsx11(
|
|
1134
1332
|
"input",
|
|
1135
1333
|
__spreadValues({
|
|
1136
1334
|
ref,
|
|
@@ -1151,7 +1349,7 @@ var Slider = forwardRef9(
|
|
|
1151
1349
|
].join(" ")
|
|
1152
1350
|
}, rest)
|
|
1153
1351
|
),
|
|
1154
|
-
/* @__PURE__ */
|
|
1352
|
+
/* @__PURE__ */ jsx11(
|
|
1155
1353
|
"div",
|
|
1156
1354
|
{
|
|
1157
1355
|
className: [
|
|
@@ -1164,13 +1362,13 @@ var Slider = forwardRef9(
|
|
|
1164
1362
|
!disabled && "peer-hover:shadow-medium"
|
|
1165
1363
|
].filter(Boolean).join(" "),
|
|
1166
1364
|
style: { left: `calc(${percent}% - ${thumbOffset}px)` },
|
|
1167
|
-
children: /* @__PURE__ */
|
|
1365
|
+
children: /* @__PURE__ */ jsx11(ChevronGlyphs, { size: sz.iconPx, color: iconColor })
|
|
1168
1366
|
}
|
|
1169
1367
|
)
|
|
1170
1368
|
]
|
|
1171
1369
|
}
|
|
1172
1370
|
),
|
|
1173
|
-
description && /* @__PURE__ */
|
|
1371
|
+
description && /* @__PURE__ */ jsx11(
|
|
1174
1372
|
"span",
|
|
1175
1373
|
{
|
|
1176
1374
|
id: ariaDescriptionId,
|
|
@@ -1186,28 +1384,28 @@ var Slider = forwardRef9(
|
|
|
1186
1384
|
Slider.displayName = "Slider";
|
|
1187
1385
|
|
|
1188
1386
|
// src/components/Toast/Toast.tsx
|
|
1189
|
-
import { forwardRef as
|
|
1190
|
-
import { jsx as
|
|
1387
|
+
import { forwardRef as forwardRef12 } from "react";
|
|
1388
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1191
1389
|
function CheckCircleIcon({ className }) {
|
|
1192
|
-
return /* @__PURE__ */
|
|
1193
|
-
/* @__PURE__ */
|
|
1194
|
-
/* @__PURE__ */
|
|
1390
|
+
return /* @__PURE__ */ jsxs11("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1391
|
+
/* @__PURE__ */ jsx12("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1392
|
+
/* @__PURE__ */ jsx12("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1195
1393
|
] });
|
|
1196
1394
|
}
|
|
1197
1395
|
function ProgressIcon({ className }) {
|
|
1198
|
-
return /* @__PURE__ */
|
|
1199
|
-
/* @__PURE__ */
|
|
1200
|
-
/* @__PURE__ */
|
|
1396
|
+
return /* @__PURE__ */ jsxs11("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1397
|
+
/* @__PURE__ */ jsx12("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5", opacity: "0.3" }),
|
|
1398
|
+
/* @__PURE__ */ jsx12("path", { d: "M10 2a8 8 0 0 1 8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: /* @__PURE__ */ jsx12("animateTransform", { attributeName: "transform", type: "rotate", from: "0 10 10", to: "360 10 10", dur: "1s", repeatCount: "indefinite" }) })
|
|
1201
1399
|
] });
|
|
1202
1400
|
}
|
|
1203
1401
|
function ErrorIcon({ className }) {
|
|
1204
|
-
return /* @__PURE__ */
|
|
1205
|
-
/* @__PURE__ */
|
|
1206
|
-
/* @__PURE__ */
|
|
1402
|
+
return /* @__PURE__ */ jsxs11("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1403
|
+
/* @__PURE__ */ jsx12("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1404
|
+
/* @__PURE__ */ jsx12("path", { d: "M10 6.5v4M10 13.5h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
1207
1405
|
] });
|
|
1208
1406
|
}
|
|
1209
1407
|
function CloseIcon2({ className }) {
|
|
1210
|
-
return /* @__PURE__ */
|
|
1408
|
+
return /* @__PURE__ */ jsx12("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx12("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1211
1409
|
}
|
|
1212
1410
|
var defaultIcons2 = {
|
|
1213
1411
|
default: CheckCircleIcon,
|
|
@@ -1224,7 +1422,7 @@ var iconColorClasses = {
|
|
|
1224
1422
|
progress: "text-toast-progress-icon",
|
|
1225
1423
|
error: "text-toast-error-icon"
|
|
1226
1424
|
};
|
|
1227
|
-
var Toast =
|
|
1425
|
+
var Toast = forwardRef12(
|
|
1228
1426
|
(_a, ref) => {
|
|
1229
1427
|
var _b = _a, {
|
|
1230
1428
|
type = "default",
|
|
@@ -1245,33 +1443,33 @@ var Toast = forwardRef10(
|
|
|
1245
1443
|
]);
|
|
1246
1444
|
const DefaultIcon = defaultIcons2[type];
|
|
1247
1445
|
const classes = [
|
|
1248
|
-
"inline-flex items-center gap-
|
|
1249
|
-
"rounded-xl px-
|
|
1446
|
+
"inline-flex items-center gap-12 font-sans",
|
|
1447
|
+
"rounded-xl px-16 py-12",
|
|
1250
1448
|
"min-w-[320px] max-w-[480px]",
|
|
1251
1449
|
"shadow-large",
|
|
1252
1450
|
typeClasses[type],
|
|
1253
1451
|
className
|
|
1254
1452
|
].filter(Boolean).join(" ");
|
|
1255
|
-
return /* @__PURE__ */
|
|
1256
|
-
icon && /* @__PURE__ */
|
|
1257
|
-
/* @__PURE__ */
|
|
1258
|
-
actionLabel && onAction && /* @__PURE__ */
|
|
1453
|
+
return /* @__PURE__ */ jsxs11("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
1454
|
+
icon && /* @__PURE__ */ jsx12("span", { className: `shrink-0 ${iconColorClasses[type]}`, children: /* @__PURE__ */ jsx12(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
1455
|
+
/* @__PURE__ */ jsx12("span", { className: "flex-1 text-sm font-medium leading-20 truncate", children }),
|
|
1456
|
+
actionLabel && onAction && /* @__PURE__ */ jsx12(
|
|
1259
1457
|
"button",
|
|
1260
1458
|
{
|
|
1261
1459
|
type: "button",
|
|
1262
1460
|
onClick: onAction,
|
|
1263
|
-
className: "shrink-0 text-sm font-medium text-toast-action-text hover:bg-toast-action-bg-hover rounded-md px-
|
|
1461
|
+
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
1462
|
children: actionLabel
|
|
1265
1463
|
}
|
|
1266
1464
|
),
|
|
1267
|
-
onDismiss && /* @__PURE__ */
|
|
1465
|
+
onDismiss && /* @__PURE__ */ jsx12(
|
|
1268
1466
|
"button",
|
|
1269
1467
|
{
|
|
1270
1468
|
type: "button",
|
|
1271
1469
|
onClick: onDismiss,
|
|
1272
|
-
className: "shrink-0 p-
|
|
1470
|
+
className: "shrink-0 p-4 rounded-md text-toast-dismiss hover:text-toast-dismiss-hover transition-colors",
|
|
1273
1471
|
"aria-label": "Dismiss",
|
|
1274
|
-
children: /* @__PURE__ */
|
|
1472
|
+
children: /* @__PURE__ */ jsx12(CloseIcon2, { className: "h-16 w-16" })
|
|
1275
1473
|
}
|
|
1276
1474
|
)
|
|
1277
1475
|
] }));
|
|
@@ -1283,8 +1481,10 @@ export {
|
|
|
1283
1481
|
AlertBanner,
|
|
1284
1482
|
Avatar,
|
|
1285
1483
|
Badge,
|
|
1484
|
+
BottomSheet,
|
|
1286
1485
|
Button,
|
|
1287
1486
|
Checkbox,
|
|
1487
|
+
Dialog,
|
|
1288
1488
|
Icon,
|
|
1289
1489
|
Radio,
|
|
1290
1490
|
Slider,
|