@refinn/core-ui 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +109 -2
- package/dist/index.d.ts +109 -2
- package/dist/index.js +1021 -25
- package/dist/index.mjs +1027 -26
- package/dist/theme.css +267 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -49,14 +49,502 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
49
49
|
// src/components/index.ts
|
|
50
50
|
var index_exports = {};
|
|
51
51
|
__export(index_exports, {
|
|
52
|
+
Accordion: () => Accordion,
|
|
53
|
+
AlertBanner: () => AlertBanner,
|
|
54
|
+
Avatar: () => Avatar,
|
|
55
|
+
Badge: () => Badge,
|
|
52
56
|
Button: () => Button,
|
|
53
|
-
Checkbox: () => Checkbox
|
|
57
|
+
Checkbox: () => Checkbox,
|
|
58
|
+
Icon: () => Icon,
|
|
59
|
+
Radio: () => Radio,
|
|
60
|
+
Slider: () => Slider,
|
|
61
|
+
Toast: () => Toast
|
|
54
62
|
});
|
|
55
63
|
module.exports = __toCommonJS(index_exports);
|
|
56
64
|
|
|
57
|
-
// src/components/
|
|
65
|
+
// src/components/Accordion/Accordion.tsx
|
|
58
66
|
var import_react = require("react");
|
|
59
67
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
68
|
+
var sizeClasses = {
|
|
69
|
+
small: {
|
|
70
|
+
trigger: "px-3 py-2.5",
|
|
71
|
+
title: "text-sm leading-5",
|
|
72
|
+
subtitle: "text-xs leading-4",
|
|
73
|
+
content: "px-3 pb-3 text-sm leading-5",
|
|
74
|
+
icon: "h-4 w-4"
|
|
75
|
+
},
|
|
76
|
+
medium: {
|
|
77
|
+
trigger: "px-4 py-3",
|
|
78
|
+
title: "text-base leading-6",
|
|
79
|
+
subtitle: "text-sm leading-5",
|
|
80
|
+
content: "px-4 pb-4 text-sm leading-5",
|
|
81
|
+
icon: "h-5 w-5"
|
|
82
|
+
},
|
|
83
|
+
large: {
|
|
84
|
+
trigger: "px-5 py-4",
|
|
85
|
+
title: "text-lg leading-7",
|
|
86
|
+
subtitle: "text-sm leading-5",
|
|
87
|
+
content: "px-5 pb-5 text-base leading-6",
|
|
88
|
+
icon: "h-5 w-5"
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
function ChevronIcon({ className }) {
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className, viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
93
|
+
"path",
|
|
94
|
+
{
|
|
95
|
+
d: "M5 7.5L10 12.5L15 7.5",
|
|
96
|
+
stroke: "currentColor",
|
|
97
|
+
strokeWidth: "1.67",
|
|
98
|
+
strokeLinecap: "round",
|
|
99
|
+
strokeLinejoin: "round"
|
|
100
|
+
}
|
|
101
|
+
) });
|
|
102
|
+
}
|
|
103
|
+
function AccordionItem({ item, size, isOpen, onToggle, generatedId }) {
|
|
104
|
+
const sz = sizeClasses[size];
|
|
105
|
+
const triggerId = `${generatedId}-trigger`;
|
|
106
|
+
const panelId = `${generatedId}-panel`;
|
|
107
|
+
const triggerClasses = [
|
|
108
|
+
"flex w-full items-center justify-between gap-2 text-left font-sans font-medium",
|
|
109
|
+
"transition-colors duration-150",
|
|
110
|
+
"outline-none",
|
|
111
|
+
sz.trigger,
|
|
112
|
+
sz.title,
|
|
113
|
+
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"
|
|
114
|
+
].join(" ");
|
|
115
|
+
const iconClasses = [
|
|
116
|
+
sz.icon,
|
|
117
|
+
"shrink-0 transition-transform duration-200",
|
|
118
|
+
isOpen ? "rotate-180" : "",
|
|
119
|
+
item.disabled ? "text-accordion-icon-disabled" : "text-accordion-icon"
|
|
120
|
+
].join(" ");
|
|
121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
122
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "m-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
123
|
+
"button",
|
|
124
|
+
{
|
|
125
|
+
id: triggerId,
|
|
126
|
+
type: "button",
|
|
127
|
+
"aria-expanded": isOpen,
|
|
128
|
+
"aria-controls": panelId,
|
|
129
|
+
disabled: item.disabled,
|
|
130
|
+
className: triggerClasses,
|
|
131
|
+
onClick: onToggle,
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex flex-col", children: [
|
|
134
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: item.title }),
|
|
135
|
+
item.subtitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: [
|
|
136
|
+
sz.subtitle,
|
|
137
|
+
"font-normal",
|
|
138
|
+
item.disabled ? "text-accordion-text-disabled" : "text-accordion-text-secondary"
|
|
139
|
+
].join(" "), children: item.subtitle })
|
|
140
|
+
] }),
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronIcon, { className: iconClasses })
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
) }),
|
|
145
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
id: panelId,
|
|
149
|
+
role: "region",
|
|
150
|
+
"aria-labelledby": triggerId,
|
|
151
|
+
className: "overflow-hidden transition-[grid-template-rows] duration-200",
|
|
152
|
+
style: { display: "grid", gridTemplateRows: isOpen ? "1fr" : "0fr" },
|
|
153
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: [sz.content, "text-accordion-text-secondary"].join(" "), children: item.content }) })
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
] });
|
|
157
|
+
}
|
|
158
|
+
var Accordion = (0, import_react.forwardRef)(
|
|
159
|
+
(_a, ref) => {
|
|
160
|
+
var _b = _a, {
|
|
161
|
+
items,
|
|
162
|
+
size = "medium",
|
|
163
|
+
multiple = false,
|
|
164
|
+
loading = false,
|
|
165
|
+
className = ""
|
|
166
|
+
} = _b, rest = __objRest(_b, [
|
|
167
|
+
"items",
|
|
168
|
+
"size",
|
|
169
|
+
"multiple",
|
|
170
|
+
"loading",
|
|
171
|
+
"className"
|
|
172
|
+
]);
|
|
173
|
+
const baseId = (0, import_react.useId)();
|
|
174
|
+
const defaultOpen = () => {
|
|
175
|
+
const set = /* @__PURE__ */ new Set();
|
|
176
|
+
items.forEach((item, i) => {
|
|
177
|
+
var _a2;
|
|
178
|
+
if (item.defaultOpen) set.add((_a2 = item.id) != null ? _a2 : String(i));
|
|
179
|
+
});
|
|
180
|
+
return set;
|
|
181
|
+
};
|
|
182
|
+
const [openItems, setOpenItems] = (0, import_react.useState)(defaultOpen);
|
|
183
|
+
const handleToggle = (0, import_react.useCallback)(
|
|
184
|
+
(itemId) => {
|
|
185
|
+
setOpenItems((prev) => {
|
|
186
|
+
const next = new Set(multiple ? prev : []);
|
|
187
|
+
if (prev.has(itemId)) {
|
|
188
|
+
next.delete(itemId);
|
|
189
|
+
} else {
|
|
190
|
+
next.add(itemId);
|
|
191
|
+
}
|
|
192
|
+
return next;
|
|
193
|
+
});
|
|
194
|
+
},
|
|
195
|
+
[multiple]
|
|
196
|
+
);
|
|
197
|
+
const containerClasses = [
|
|
198
|
+
"rounded-lg border border-accordion-border bg-accordion-bg font-sans",
|
|
199
|
+
"divide-y divide-accordion-border",
|
|
200
|
+
className
|
|
201
|
+
].filter(Boolean).join(" ");
|
|
202
|
+
if (loading) {
|
|
203
|
+
const sz = sizeClasses[size];
|
|
204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `flex items-center justify-between gap-2 ${sz.trigger}`, children: [
|
|
205
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex-1 flex flex-col gap-1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-4 w-3/4 rounded bg-gray-200 animate-pulse" }) }),
|
|
206
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronIcon, { className: `${sz.icon} shrink-0 text-accordion-icon` })
|
|
207
|
+
] }) }));
|
|
208
|
+
}
|
|
209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: items.map((item, i) => {
|
|
210
|
+
var _a2;
|
|
211
|
+
const itemId = (_a2 = item.id) != null ? _a2 : String(i);
|
|
212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
213
|
+
AccordionItem,
|
|
214
|
+
{
|
|
215
|
+
item,
|
|
216
|
+
size,
|
|
217
|
+
isOpen: openItems.has(itemId),
|
|
218
|
+
onToggle: () => handleToggle(itemId),
|
|
219
|
+
generatedId: `${baseId}-${itemId}`
|
|
220
|
+
},
|
|
221
|
+
itemId
|
|
222
|
+
);
|
|
223
|
+
}) }));
|
|
224
|
+
}
|
|
225
|
+
);
|
|
226
|
+
Accordion.displayName = "Accordion";
|
|
227
|
+
|
|
228
|
+
// src/components/AlertBanner/AlertBanner.tsx
|
|
229
|
+
var import_react2 = require("react");
|
|
230
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
231
|
+
var inlineClasses = {
|
|
232
|
+
info: "bg-alert-inline-info-bg border-alert-inline-info-border text-alert-text-primary",
|
|
233
|
+
success: "bg-alert-inline-success-bg border-alert-inline-success-border text-alert-text-primary",
|
|
234
|
+
warning: "bg-alert-inline-warning-bg border-alert-inline-warning-border text-alert-text-primary",
|
|
235
|
+
danger: "bg-alert-inline-danger-bg border-alert-inline-danger-border text-alert-text-primary",
|
|
236
|
+
common: "bg-alert-inline-common-bg border-alert-inline-common-border text-alert-text-primary"
|
|
237
|
+
};
|
|
238
|
+
var pageClasses = {
|
|
239
|
+
info: "bg-alert-page-info-bg text-alert-text-primary-inverse",
|
|
240
|
+
success: "bg-alert-page-success-bg text-alert-text-primary-inverse",
|
|
241
|
+
warning: "bg-alert-page-warning-bg text-alert-text-primary-inverse",
|
|
242
|
+
danger: "bg-alert-page-danger-bg text-alert-text-primary-inverse",
|
|
243
|
+
common: "bg-alert-page-common-bg text-alert-text-primary-inverse"
|
|
244
|
+
};
|
|
245
|
+
var inlineIconClasses = {
|
|
246
|
+
info: "text-alert-inline-info-icon",
|
|
247
|
+
success: "text-alert-inline-success-icon",
|
|
248
|
+
warning: "text-alert-inline-warning-icon",
|
|
249
|
+
danger: "text-alert-inline-danger-icon",
|
|
250
|
+
common: "text-alert-inline-common-icon"
|
|
251
|
+
};
|
|
252
|
+
function InfoIcon({ className }) {
|
|
253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("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" }) });
|
|
254
|
+
}
|
|
255
|
+
function SuccessIcon({ className }) {
|
|
256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
257
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
258
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
259
|
+
] });
|
|
260
|
+
}
|
|
261
|
+
function WarningIcon({ className }) {
|
|
262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M8.57 3.22 1.53 15.5a1.67 1.67 0 0 0 1.43 2.5h14.08a1.67 1.67 0 0 0 1.43-2.5L11.43 3.22a1.67 1.67 0 0 0-2.86 0ZM10 7.5v3.33M10 14.17h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
263
|
+
}
|
|
264
|
+
function DangerIcon({ className }) {
|
|
265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("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" }) });
|
|
266
|
+
}
|
|
267
|
+
function CommonIcon({ className }) {
|
|
268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM10 6v4M10 14h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
269
|
+
}
|
|
270
|
+
function CloseIcon({ className }) {
|
|
271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
272
|
+
}
|
|
273
|
+
var defaultIcons = {
|
|
274
|
+
info: InfoIcon,
|
|
275
|
+
success: SuccessIcon,
|
|
276
|
+
warning: WarningIcon,
|
|
277
|
+
danger: DangerIcon,
|
|
278
|
+
common: CommonIcon
|
|
279
|
+
};
|
|
280
|
+
var AlertBanner = (0, import_react2.forwardRef)(
|
|
281
|
+
(_a, ref) => {
|
|
282
|
+
var _b = _a, {
|
|
283
|
+
variant = "info",
|
|
284
|
+
mode = "inline",
|
|
285
|
+
title,
|
|
286
|
+
description,
|
|
287
|
+
icon,
|
|
288
|
+
onClose,
|
|
289
|
+
className = "",
|
|
290
|
+
children
|
|
291
|
+
} = _b, rest = __objRest(_b, [
|
|
292
|
+
"variant",
|
|
293
|
+
"mode",
|
|
294
|
+
"title",
|
|
295
|
+
"description",
|
|
296
|
+
"icon",
|
|
297
|
+
"onClose",
|
|
298
|
+
"className",
|
|
299
|
+
"children"
|
|
300
|
+
]);
|
|
301
|
+
const isPage = mode === "page";
|
|
302
|
+
const variantClass = isPage ? pageClasses[variant] : inlineClasses[variant];
|
|
303
|
+
const DefaultIcon = defaultIcons[variant];
|
|
304
|
+
const iconColorClass = isPage ? "" : inlineIconClasses[variant];
|
|
305
|
+
const descColorClass = isPage ? "text-alert-text-secondary-inverse" : "text-alert-text-secondary";
|
|
306
|
+
const closeColorClass = isPage ? "text-alert-close-inverse hover:text-alert-close-inverse-hover" : "text-alert-close hover:text-alert-close-hover";
|
|
307
|
+
const classes = [
|
|
308
|
+
"flex items-start gap-3 font-sans",
|
|
309
|
+
isPage ? "px-4 py-3" : "px-4 py-3 border-l-4 rounded-lg",
|
|
310
|
+
variantClass,
|
|
311
|
+
className
|
|
312
|
+
].filter(Boolean).join(" ");
|
|
313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
314
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `shrink-0 mt-0.5 ${iconColorClass}`, children: icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DefaultIcon, { className: "h-5 w-5" }) }),
|
|
315
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
316
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "text-sm font-medium leading-5", children: title }),
|
|
317
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: `text-sm leading-5 ${descColorClass} ${title ? "mt-1" : ""}`, children: description }),
|
|
318
|
+
children
|
|
319
|
+
] }),
|
|
320
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
321
|
+
"button",
|
|
322
|
+
{
|
|
323
|
+
type: "button",
|
|
324
|
+
onClick: onClose,
|
|
325
|
+
className: `shrink-0 p-0.5 rounded transition-colors ${closeColorClass}`,
|
|
326
|
+
"aria-label": "Close",
|
|
327
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CloseIcon, { className: "h-4 w-4" })
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
] }));
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
AlertBanner.displayName = "AlertBanner";
|
|
334
|
+
|
|
335
|
+
// src/components/Avatar/Avatar.tsx
|
|
336
|
+
var import_react3 = require("react");
|
|
337
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
338
|
+
var sizeClasses2 = {
|
|
339
|
+
xs: { container: "h-6 w-6", text: "text-[10px]", status: "h-2 w-2", statusRing: "ring-1" },
|
|
340
|
+
sm: { container: "h-8 w-8", text: "text-xs", status: "h-2.5 w-2.5", statusRing: "ring-[1.5px]" },
|
|
341
|
+
md: { container: "h-10 w-10", text: "text-sm", status: "h-3 w-3", statusRing: "ring-2" },
|
|
342
|
+
lg: { container: "h-12 w-12", text: "text-base", status: "h-3.5 w-3.5", statusRing: "ring-2" },
|
|
343
|
+
xl: { container: "h-14 w-14", text: "text-lg", status: "h-4 w-4", statusRing: "ring-2" },
|
|
344
|
+
"2xl": { container: "h-16 w-16", text: "text-xl", status: "h-4 w-4", statusRing: "ring-2" }
|
|
345
|
+
};
|
|
346
|
+
var statusColorClasses = {
|
|
347
|
+
online: "bg-avatar-status-online",
|
|
348
|
+
offline: "bg-avatar-status-offline",
|
|
349
|
+
busy: "bg-avatar-status-busy"
|
|
350
|
+
};
|
|
351
|
+
function getInitials(name) {
|
|
352
|
+
const parts = name.trim().split(/\s+/);
|
|
353
|
+
if (parts.length === 1) return parts[0][0].toUpperCase();
|
|
354
|
+
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
355
|
+
}
|
|
356
|
+
function PersonIcon({ className }) {
|
|
357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M10 10a3.75 3.75 0 1 0 0-7.5 3.75 3.75 0 0 0 0 7.5ZM3.75 17.5a6.25 6.25 0 0 1 12.5 0" }) });
|
|
358
|
+
}
|
|
359
|
+
var Avatar = (0, import_react3.forwardRef)(
|
|
360
|
+
(_a, ref) => {
|
|
361
|
+
var _b = _a, {
|
|
362
|
+
size = "md",
|
|
363
|
+
shape = "circle",
|
|
364
|
+
src,
|
|
365
|
+
alt = "",
|
|
366
|
+
name,
|
|
367
|
+
icon,
|
|
368
|
+
status,
|
|
369
|
+
className = ""
|
|
370
|
+
} = _b, rest = __objRest(_b, [
|
|
371
|
+
"size",
|
|
372
|
+
"shape",
|
|
373
|
+
"src",
|
|
374
|
+
"alt",
|
|
375
|
+
"name",
|
|
376
|
+
"icon",
|
|
377
|
+
"status",
|
|
378
|
+
"className"
|
|
379
|
+
]);
|
|
380
|
+
const sz = sizeClasses2[size];
|
|
381
|
+
const roundedClass = shape === "circle" ? "rounded-full" : "rounded-lg";
|
|
382
|
+
const containerClasses = [
|
|
383
|
+
"relative inline-flex items-center justify-center shrink-0",
|
|
384
|
+
"bg-avatar-bg text-avatar-text font-medium font-sans",
|
|
385
|
+
"transition-colors duration-150",
|
|
386
|
+
"select-none",
|
|
387
|
+
sz.container,
|
|
388
|
+
roundedClass,
|
|
389
|
+
className
|
|
390
|
+
].filter(Boolean).join(" ");
|
|
391
|
+
let content;
|
|
392
|
+
if (src) {
|
|
393
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
394
|
+
"img",
|
|
395
|
+
{
|
|
396
|
+
src,
|
|
397
|
+
alt: alt || name || "",
|
|
398
|
+
className: `h-full w-full object-cover ${roundedClass}`
|
|
399
|
+
}
|
|
400
|
+
);
|
|
401
|
+
} else if (icon) {
|
|
402
|
+
content = icon;
|
|
403
|
+
} else if (name) {
|
|
404
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: sz.text, children: getInitials(name) });
|
|
405
|
+
} else {
|
|
406
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PersonIcon, { className: `${sz.text} h-[60%] w-[60%]` });
|
|
407
|
+
}
|
|
408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: [
|
|
409
|
+
content,
|
|
410
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
411
|
+
"span",
|
|
412
|
+
{
|
|
413
|
+
className: [
|
|
414
|
+
"absolute bottom-0 right-0 block rounded-full",
|
|
415
|
+
"ring-avatar-status-border",
|
|
416
|
+
sz.status,
|
|
417
|
+
sz.statusRing,
|
|
418
|
+
statusColorClasses[status]
|
|
419
|
+
].join(" ")
|
|
420
|
+
}
|
|
421
|
+
)
|
|
422
|
+
] }));
|
|
423
|
+
}
|
|
424
|
+
);
|
|
425
|
+
Avatar.displayName = "Avatar";
|
|
426
|
+
|
|
427
|
+
// src/components/Badge/Badge.tsx
|
|
428
|
+
var import_react4 = require("react");
|
|
429
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
430
|
+
var sizeClasses3 = {
|
|
431
|
+
sm: "h-5 px-1.5 text-xs gap-1",
|
|
432
|
+
md: "h-6 px-2 text-xs gap-1",
|
|
433
|
+
lg: "h-7 px-2.5 text-sm gap-1.5"
|
|
434
|
+
};
|
|
435
|
+
var iconSizeClasses = {
|
|
436
|
+
sm: "h-3 w-3",
|
|
437
|
+
md: "h-3.5 w-3.5",
|
|
438
|
+
lg: "h-4 w-4"
|
|
439
|
+
};
|
|
440
|
+
var dotSizeClasses = {
|
|
441
|
+
sm: "h-1.5 w-1.5",
|
|
442
|
+
md: "h-1.5 w-1.5",
|
|
443
|
+
lg: "h-2 w-2"
|
|
444
|
+
};
|
|
445
|
+
var shapeClasses = {
|
|
446
|
+
round: "rounded-full",
|
|
447
|
+
square: "rounded"
|
|
448
|
+
};
|
|
449
|
+
var minimalClasses = {
|
|
450
|
+
common: "bg-transparent border border-badge-minimal-common-border text-badge-minimal-common-text",
|
|
451
|
+
success: "bg-transparent border border-badge-minimal-success-border text-badge-minimal-success-text",
|
|
452
|
+
warning: "bg-transparent border border-badge-minimal-warning-border text-badge-minimal-warning-text",
|
|
453
|
+
info: "bg-transparent border border-badge-minimal-info-border text-badge-minimal-info-text",
|
|
454
|
+
brand: "bg-transparent border border-badge-minimal-brand-border text-badge-minimal-brand-text",
|
|
455
|
+
danger: "bg-transparent border border-badge-minimal-danger-border text-badge-minimal-danger-text"
|
|
456
|
+
};
|
|
457
|
+
var minimalDotClasses = {
|
|
458
|
+
common: "bg-badge-minimal-common-dot",
|
|
459
|
+
success: "bg-badge-minimal-success-dot",
|
|
460
|
+
warning: "bg-badge-minimal-warning-dot",
|
|
461
|
+
info: "bg-badge-minimal-info-dot",
|
|
462
|
+
brand: "bg-badge-minimal-brand-dot",
|
|
463
|
+
danger: "bg-badge-minimal-danger-dot"
|
|
464
|
+
};
|
|
465
|
+
var subtleClasses = {
|
|
466
|
+
common: "bg-badge-subtle-common-bg text-badge-subtle-common-text",
|
|
467
|
+
success: "bg-badge-subtle-success-bg text-badge-subtle-success-text",
|
|
468
|
+
warning: "bg-badge-subtle-warning-bg text-badge-subtle-warning-text",
|
|
469
|
+
info: "bg-badge-subtle-info-bg text-badge-subtle-info-text",
|
|
470
|
+
brand: "bg-badge-subtle-brand-bg text-badge-subtle-brand-text",
|
|
471
|
+
danger: "bg-badge-subtle-danger-bg text-badge-subtle-danger-text"
|
|
472
|
+
};
|
|
473
|
+
var subtleDotClasses = {
|
|
474
|
+
common: "bg-badge-subtle-common-dot",
|
|
475
|
+
success: "bg-badge-subtle-success-dot",
|
|
476
|
+
warning: "bg-badge-subtle-warning-dot",
|
|
477
|
+
info: "bg-badge-subtle-info-dot",
|
|
478
|
+
brand: "bg-badge-subtle-brand-dot",
|
|
479
|
+
danger: "bg-badge-subtle-danger-dot"
|
|
480
|
+
};
|
|
481
|
+
var boldClasses = {
|
|
482
|
+
common: "bg-badge-bold-common-bg text-badge-bold-text",
|
|
483
|
+
success: "bg-badge-bold-success-bg text-badge-bold-text",
|
|
484
|
+
warning: "bg-badge-bold-warning-bg text-badge-bold-text",
|
|
485
|
+
info: "bg-badge-bold-info-bg text-badge-bold-text",
|
|
486
|
+
brand: "bg-badge-bold-brand-bg text-badge-bold-text",
|
|
487
|
+
danger: "bg-badge-bold-danger-bg text-badge-bold-text"
|
|
488
|
+
};
|
|
489
|
+
var boldDotClasses = {
|
|
490
|
+
common: "bg-badge-bold-common-dot",
|
|
491
|
+
success: "bg-badge-bold-success-dot",
|
|
492
|
+
warning: "bg-badge-bold-warning-dot",
|
|
493
|
+
info: "bg-badge-bold-info-dot",
|
|
494
|
+
brand: "bg-badge-bold-brand-dot",
|
|
495
|
+
danger: "bg-badge-bold-danger-dot"
|
|
496
|
+
};
|
|
497
|
+
var styleMap = {
|
|
498
|
+
minimal: minimalClasses,
|
|
499
|
+
subtle: subtleClasses,
|
|
500
|
+
bold: boldClasses
|
|
501
|
+
};
|
|
502
|
+
var dotStyleMap = {
|
|
503
|
+
minimal: minimalDotClasses,
|
|
504
|
+
subtle: subtleDotClasses,
|
|
505
|
+
bold: boldDotClasses
|
|
506
|
+
};
|
|
507
|
+
var Badge = (0, import_react4.forwardRef)(
|
|
508
|
+
(_a, ref) => {
|
|
509
|
+
var _b = _a, {
|
|
510
|
+
status = "common",
|
|
511
|
+
badgeStyle = "subtle",
|
|
512
|
+
size = "md",
|
|
513
|
+
shape = "round",
|
|
514
|
+
icon,
|
|
515
|
+
dot = false,
|
|
516
|
+
children,
|
|
517
|
+
className = ""
|
|
518
|
+
} = _b, rest = __objRest(_b, [
|
|
519
|
+
"status",
|
|
520
|
+
"badgeStyle",
|
|
521
|
+
"size",
|
|
522
|
+
"shape",
|
|
523
|
+
"icon",
|
|
524
|
+
"dot",
|
|
525
|
+
"children",
|
|
526
|
+
"className"
|
|
527
|
+
]);
|
|
528
|
+
const classes = [
|
|
529
|
+
"inline-flex items-center justify-center font-medium font-sans",
|
|
530
|
+
"whitespace-nowrap select-none",
|
|
531
|
+
sizeClasses3[size],
|
|
532
|
+
shapeClasses[shape],
|
|
533
|
+
styleMap[badgeStyle][status],
|
|
534
|
+
className
|
|
535
|
+
].filter(Boolean).join(" ");
|
|
536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", __spreadProps(__spreadValues({ ref, className: classes }, rest), { children: [
|
|
537
|
+
dot && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `shrink-0 rounded-full ${dotSizeClasses[size]} ${dotStyleMap[badgeStyle][status]}` }),
|
|
538
|
+
!dot && icon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `shrink-0 ${iconSizeClasses[size]}`, children: icon }),
|
|
539
|
+
children
|
|
540
|
+
] }));
|
|
541
|
+
}
|
|
542
|
+
);
|
|
543
|
+
Badge.displayName = "Badge";
|
|
544
|
+
|
|
545
|
+
// src/components/Button/Button.tsx
|
|
546
|
+
var import_react5 = require("react");
|
|
547
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
60
548
|
var variantClasses = {
|
|
61
549
|
primary: [
|
|
62
550
|
"bg-btn-primary text-btn-primary-text",
|
|
@@ -94,14 +582,14 @@ var variantClasses = {
|
|
|
94
582
|
"disabled:bg-btn-transparent-disabled disabled:text-btn-transparent-text-disabled"
|
|
95
583
|
].join(" ")
|
|
96
584
|
};
|
|
97
|
-
var
|
|
585
|
+
var sizeClasses4 = {
|
|
98
586
|
small: "h-8 px-3 text-sm gap-1",
|
|
99
587
|
medium: "h-10 px-4 text-sm gap-1.5",
|
|
100
588
|
large: "h-12 px-5 text-base gap-2",
|
|
101
589
|
"extra-large": "h-14 px-6 text-lg gap-2"
|
|
102
590
|
};
|
|
103
591
|
function Spinner({ className }) {
|
|
104
|
-
return /* @__PURE__ */ (0,
|
|
592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
105
593
|
"svg",
|
|
106
594
|
{
|
|
107
595
|
className,
|
|
@@ -109,7 +597,7 @@ function Spinner({ className }) {
|
|
|
109
597
|
height: "1em",
|
|
110
598
|
viewBox: "0 0 20 20",
|
|
111
599
|
fill: "none",
|
|
112
|
-
children: /* @__PURE__ */ (0,
|
|
600
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
113
601
|
"path",
|
|
114
602
|
{
|
|
115
603
|
d: "M10 2.5a7.5 7.5 0 1 0 7.5 7.5",
|
|
@@ -121,7 +609,7 @@ function Spinner({ className }) {
|
|
|
121
609
|
}
|
|
122
610
|
);
|
|
123
611
|
}
|
|
124
|
-
var Button = (0,
|
|
612
|
+
var Button = (0, import_react5.forwardRef)(
|
|
125
613
|
(_a, ref) => {
|
|
126
614
|
var _b = _a, {
|
|
127
615
|
variant = "primary",
|
|
@@ -150,12 +638,12 @@ var Button = (0, import_react.forwardRef)(
|
|
|
150
638
|
"transition-colors duration-150",
|
|
151
639
|
"outline-none",
|
|
152
640
|
"disabled:cursor-not-allowed",
|
|
153
|
-
|
|
641
|
+
sizeClasses4[size],
|
|
154
642
|
variantClasses[variant],
|
|
155
643
|
rounded ? "rounded-full" : "rounded-lg",
|
|
156
644
|
className
|
|
157
645
|
].filter(Boolean).join(" ");
|
|
158
|
-
return /* @__PURE__ */ (0,
|
|
646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
159
647
|
"button",
|
|
160
648
|
__spreadProps(__spreadValues({
|
|
161
649
|
ref,
|
|
@@ -163,7 +651,7 @@ var Button = (0, import_react.forwardRef)(
|
|
|
163
651
|
className: classes
|
|
164
652
|
}, rest), {
|
|
165
653
|
children: [
|
|
166
|
-
loading ? /* @__PURE__ */ (0,
|
|
654
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Spinner, { className: "animate-spin" }) : startIcon,
|
|
167
655
|
children,
|
|
168
656
|
!loading && endIcon
|
|
169
657
|
]
|
|
@@ -174,9 +662,9 @@ var Button = (0, import_react.forwardRef)(
|
|
|
174
662
|
Button.displayName = "Button";
|
|
175
663
|
|
|
176
664
|
// src/components/Checkbox/Checkbox.tsx
|
|
177
|
-
var
|
|
178
|
-
var
|
|
179
|
-
var
|
|
665
|
+
var import_react6 = require("react");
|
|
666
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
667
|
+
var sizeClasses5 = {
|
|
180
668
|
small: {
|
|
181
669
|
box: "h-4 w-4",
|
|
182
670
|
icon: "h-3 w-3",
|
|
@@ -193,7 +681,7 @@ var sizeClasses2 = {
|
|
|
193
681
|
}
|
|
194
682
|
};
|
|
195
683
|
function CheckIcon({ className }) {
|
|
196
|
-
return /* @__PURE__ */ (0,
|
|
684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { className, viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
197
685
|
"path",
|
|
198
686
|
{
|
|
199
687
|
d: "M13.333 4.667 6 12l-3.333-3.333",
|
|
@@ -205,7 +693,7 @@ function CheckIcon({ className }) {
|
|
|
205
693
|
) });
|
|
206
694
|
}
|
|
207
695
|
function IndeterminateIcon({ className }) {
|
|
208
|
-
return /* @__PURE__ */ (0,
|
|
696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { className, viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
209
697
|
"path",
|
|
210
698
|
{
|
|
211
699
|
d: "M3.333 8h9.334",
|
|
@@ -215,7 +703,7 @@ function IndeterminateIcon({ className }) {
|
|
|
215
703
|
}
|
|
216
704
|
) });
|
|
217
705
|
}
|
|
218
|
-
var Checkbox = (0,
|
|
706
|
+
var Checkbox = (0, import_react6.forwardRef)(
|
|
219
707
|
(_a, ref) => {
|
|
220
708
|
var _b = _a, {
|
|
221
709
|
size = "medium",
|
|
@@ -242,9 +730,9 @@ var Checkbox = (0, import_react2.forwardRef)(
|
|
|
242
730
|
"className",
|
|
243
731
|
"id"
|
|
244
732
|
]);
|
|
245
|
-
const reactId = (0,
|
|
733
|
+
const reactId = (0, import_react6.useId)();
|
|
246
734
|
const inputId = id != null ? id : reactId;
|
|
247
|
-
const sz =
|
|
735
|
+
const sz = sizeClasses5[size];
|
|
248
736
|
const isActive = checked || indeterminate;
|
|
249
737
|
const boxBase = [
|
|
250
738
|
"relative inline-flex items-center justify-center shrink-0",
|
|
@@ -269,7 +757,7 @@ var Checkbox = (0, import_react2.forwardRef)(
|
|
|
269
757
|
const ringClasses = `peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 ${ringColor}`;
|
|
270
758
|
const labelColor = disabled ? "text-checkbox-label-disabled" : contrast ? "text-checkbox-contrast-label" : error ? "text-checkbox-label-error" : "text-checkbox-label";
|
|
271
759
|
const descriptionColor = disabled ? "text-checkbox-label-disabled" : contrast ? "text-checkbox-contrast-description" : "text-checkbox-description";
|
|
272
|
-
return /* @__PURE__ */ (0,
|
|
760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
273
761
|
"label",
|
|
274
762
|
{
|
|
275
763
|
htmlFor: inputId,
|
|
@@ -280,8 +768,8 @@ var Checkbox = (0, import_react2.forwardRef)(
|
|
|
280
768
|
className
|
|
281
769
|
].filter(Boolean).join(" "),
|
|
282
770
|
children: [
|
|
283
|
-
/* @__PURE__ */ (0,
|
|
284
|
-
/* @__PURE__ */ (0,
|
|
771
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "relative inline-flex", children: [
|
|
772
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
285
773
|
"input",
|
|
286
774
|
__spreadValues({
|
|
287
775
|
ref,
|
|
@@ -294,11 +782,11 @@ var Checkbox = (0, import_react2.forwardRef)(
|
|
|
294
782
|
className: "peer absolute inset-0 h-full w-full cursor-[inherit] opacity-0"
|
|
295
783
|
}, rest)
|
|
296
784
|
),
|
|
297
|
-
/* @__PURE__ */ (0,
|
|
785
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: [boxBase, boxState, ringClasses].join(" "), children: indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IndeterminateIcon, { className: sz.icon }) : checked ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CheckIcon, { className: sz.icon }) : null })
|
|
298
786
|
] }),
|
|
299
|
-
(label || description) && /* @__PURE__ */ (0,
|
|
300
|
-
label && /* @__PURE__ */ (0,
|
|
301
|
-
description && /* @__PURE__ */ (0,
|
|
787
|
+
(label || description) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "flex flex-col", children: [
|
|
788
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `${sz.label} font-medium ${labelColor}`, children: label }),
|
|
789
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: `${sz.description} ${descriptionColor}`, children: description })
|
|
302
790
|
] })
|
|
303
791
|
]
|
|
304
792
|
}
|
|
@@ -306,8 +794,516 @@ var Checkbox = (0, import_react2.forwardRef)(
|
|
|
306
794
|
}
|
|
307
795
|
);
|
|
308
796
|
Checkbox.displayName = "Checkbox";
|
|
797
|
+
|
|
798
|
+
// src/components/Icon/Icon.tsx
|
|
799
|
+
var import_react7 = require("react");
|
|
800
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
801
|
+
var Icon = (0, import_react7.forwardRef)(
|
|
802
|
+
(_a, ref) => {
|
|
803
|
+
var _b = _a, {
|
|
804
|
+
name,
|
|
805
|
+
size = 20,
|
|
806
|
+
weight = 300,
|
|
807
|
+
fill = false,
|
|
808
|
+
grade = 0,
|
|
809
|
+
opticalSize,
|
|
810
|
+
className = "",
|
|
811
|
+
style,
|
|
812
|
+
"aria-label": ariaLabel
|
|
813
|
+
} = _b, rest = __objRest(_b, [
|
|
814
|
+
"name",
|
|
815
|
+
"size",
|
|
816
|
+
"weight",
|
|
817
|
+
"fill",
|
|
818
|
+
"grade",
|
|
819
|
+
"opticalSize",
|
|
820
|
+
"className",
|
|
821
|
+
"style",
|
|
822
|
+
"aria-label"
|
|
823
|
+
]);
|
|
824
|
+
const opsz = opticalSize != null ? opticalSize : size === 16 ? 20 : size === 20 ? 20 : 24;
|
|
825
|
+
const classes = [
|
|
826
|
+
"material-symbols-outlined select-none shrink-0 inline-block leading-none",
|
|
827
|
+
className
|
|
828
|
+
].filter(Boolean).join(" ");
|
|
829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
830
|
+
"span",
|
|
831
|
+
__spreadProps(__spreadValues({
|
|
832
|
+
ref,
|
|
833
|
+
className: classes,
|
|
834
|
+
"aria-hidden": ariaLabel ? void 0 : true,
|
|
835
|
+
"aria-label": ariaLabel,
|
|
836
|
+
role: ariaLabel ? "img" : void 0,
|
|
837
|
+
style: __spreadValues({
|
|
838
|
+
fontSize: `${size}px`,
|
|
839
|
+
width: `${size}px`,
|
|
840
|
+
height: `${size}px`,
|
|
841
|
+
fontVariationSettings: `'FILL' ${fill ? 1 : 0}, 'wght' ${weight}, 'GRAD' ${grade}, 'opsz' ${opsz}`
|
|
842
|
+
}, style)
|
|
843
|
+
}, rest), {
|
|
844
|
+
children: name
|
|
845
|
+
})
|
|
846
|
+
);
|
|
847
|
+
}
|
|
848
|
+
);
|
|
849
|
+
Icon.displayName = "Icon";
|
|
850
|
+
|
|
851
|
+
// src/components/Radio/Radio.tsx
|
|
852
|
+
var import_react8 = require("react");
|
|
853
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
854
|
+
var sizeClasses6 = {
|
|
855
|
+
small: {
|
|
856
|
+
box: "h-4 w-4",
|
|
857
|
+
dot: "h-1.5 w-1.5",
|
|
858
|
+
label: "text-sm leading-5",
|
|
859
|
+
description: "text-xs leading-4",
|
|
860
|
+
gap: "gap-2"
|
|
861
|
+
},
|
|
862
|
+
medium: {
|
|
863
|
+
box: "h-5 w-5",
|
|
864
|
+
dot: "h-2 w-2",
|
|
865
|
+
label: "text-base leading-6",
|
|
866
|
+
description: "text-sm leading-5",
|
|
867
|
+
gap: "gap-2.5"
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
var Radio = (0, import_react8.forwardRef)(
|
|
871
|
+
(_a, ref) => {
|
|
872
|
+
var _b = _a, {
|
|
873
|
+
size = "medium",
|
|
874
|
+
label,
|
|
875
|
+
description,
|
|
876
|
+
error = false,
|
|
877
|
+
contrast = false,
|
|
878
|
+
checked,
|
|
879
|
+
defaultChecked,
|
|
880
|
+
disabled = false,
|
|
881
|
+
className = "",
|
|
882
|
+
id
|
|
883
|
+
} = _b, rest = __objRest(_b, [
|
|
884
|
+
"size",
|
|
885
|
+
"label",
|
|
886
|
+
"description",
|
|
887
|
+
"error",
|
|
888
|
+
"contrast",
|
|
889
|
+
"checked",
|
|
890
|
+
"defaultChecked",
|
|
891
|
+
"disabled",
|
|
892
|
+
"className",
|
|
893
|
+
"id"
|
|
894
|
+
]);
|
|
895
|
+
const reactId = (0, import_react8.useId)();
|
|
896
|
+
const inputId = id != null ? id : reactId;
|
|
897
|
+
const sz = sizeClasses6[size];
|
|
898
|
+
const circleBase = [
|
|
899
|
+
"relative inline-flex items-center justify-center shrink-0",
|
|
900
|
+
"rounded-full",
|
|
901
|
+
"border",
|
|
902
|
+
"transition-colors duration-150",
|
|
903
|
+
sz.box
|
|
904
|
+
].join(" ");
|
|
905
|
+
let circleState;
|
|
906
|
+
if (disabled) {
|
|
907
|
+
circleState = checked ? "bg-radio-disabled-selected-bg border-radio-disabled-border" : "bg-radio-disabled-bg border-radio-disabled-border";
|
|
908
|
+
} else if (contrast) {
|
|
909
|
+
circleState = checked ? "bg-radio-contrast-selected-bg border-radio-contrast-selected-bg" : "bg-radio-contrast-bg border-radio-contrast-border";
|
|
910
|
+
} else if (error) {
|
|
911
|
+
circleState = checked ? "bg-radio-selected-bg border-radio-error-border" : "bg-radio-error-bg border-radio-error-border";
|
|
912
|
+
} else if (checked) {
|
|
913
|
+
circleState = "bg-radio-selected-bg border-radio-selected-border";
|
|
914
|
+
} else {
|
|
915
|
+
circleState = "bg-radio-bg border-radio-border hover:border-radio-hover-border";
|
|
916
|
+
}
|
|
917
|
+
const ringColor = error ? "peer-focus-visible:ring-radio-error-ring" : contrast ? "peer-focus-visible:ring-radio-contrast-ring" : "peer-focus-visible:ring-radio-ring";
|
|
918
|
+
const ringClasses = `peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 ${ringColor}`;
|
|
919
|
+
let dotColor;
|
|
920
|
+
if (disabled) {
|
|
921
|
+
dotColor = "bg-radio-disabled-dot";
|
|
922
|
+
} else if (contrast) {
|
|
923
|
+
dotColor = "bg-radio-contrast-selected-dot";
|
|
924
|
+
} else {
|
|
925
|
+
dotColor = "bg-radio-selected-dot";
|
|
926
|
+
}
|
|
927
|
+
const labelColor = disabled ? "text-radio-label-disabled" : contrast ? "text-radio-contrast-label" : error ? "text-radio-label-error" : "text-radio-label";
|
|
928
|
+
const descriptionColor = disabled ? "text-radio-label-disabled" : contrast ? "text-radio-contrast-description" : "text-radio-description";
|
|
929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
930
|
+
"label",
|
|
931
|
+
{
|
|
932
|
+
htmlFor: inputId,
|
|
933
|
+
className: [
|
|
934
|
+
"inline-flex items-start font-sans",
|
|
935
|
+
sz.gap,
|
|
936
|
+
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
937
|
+
className
|
|
938
|
+
].filter(Boolean).join(" "),
|
|
939
|
+
children: [
|
|
940
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "relative inline-flex", children: [
|
|
941
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
942
|
+
"input",
|
|
943
|
+
__spreadValues({
|
|
944
|
+
ref,
|
|
945
|
+
id: inputId,
|
|
946
|
+
type: "radio",
|
|
947
|
+
checked,
|
|
948
|
+
defaultChecked,
|
|
949
|
+
disabled,
|
|
950
|
+
className: "peer absolute inset-0 h-full w-full cursor-[inherit] opacity-0"
|
|
951
|
+
}, rest)
|
|
952
|
+
),
|
|
953
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: [circleBase, circleState, ringClasses].join(" "), children: checked && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: `rounded-full ${sz.dot} ${dotColor}` }) })
|
|
954
|
+
] }),
|
|
955
|
+
(label || description) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "flex flex-col", children: [
|
|
956
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: `${sz.label} font-medium ${labelColor}`, children: label }),
|
|
957
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: `${sz.description} ${descriptionColor}`, children: description })
|
|
958
|
+
] })
|
|
959
|
+
]
|
|
960
|
+
}
|
|
961
|
+
);
|
|
962
|
+
}
|
|
963
|
+
);
|
|
964
|
+
Radio.displayName = "Radio";
|
|
965
|
+
|
|
966
|
+
// src/components/Slider/Slider.tsx
|
|
967
|
+
var import_react9 = require("react");
|
|
968
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
969
|
+
var sizeConfig = {
|
|
970
|
+
small: {
|
|
971
|
+
trackH: "h-1",
|
|
972
|
+
thumbPx: 24,
|
|
973
|
+
thumbClass: "h-6 w-6",
|
|
974
|
+
iconPx: 12,
|
|
975
|
+
containerH: "h-6",
|
|
976
|
+
label: "text-sm leading-5",
|
|
977
|
+
description: "text-xs leading-4"
|
|
978
|
+
},
|
|
979
|
+
medium: {
|
|
980
|
+
trackH: "h-1.5",
|
|
981
|
+
thumbPx: 28,
|
|
982
|
+
thumbClass: "h-7 w-7",
|
|
983
|
+
iconPx: 14,
|
|
984
|
+
containerH: "h-7",
|
|
985
|
+
label: "text-base leading-6",
|
|
986
|
+
description: "text-sm leading-5"
|
|
987
|
+
},
|
|
988
|
+
large: {
|
|
989
|
+
trackH: "h-2",
|
|
990
|
+
thumbPx: 32,
|
|
991
|
+
thumbClass: "h-8 w-8",
|
|
992
|
+
iconPx: 16,
|
|
993
|
+
containerH: "h-8",
|
|
994
|
+
label: "text-base leading-6",
|
|
995
|
+
description: "text-sm leading-5"
|
|
996
|
+
}
|
|
997
|
+
};
|
|
998
|
+
function ChevronGlyphs({ size, color }) {
|
|
999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1000
|
+
"svg",
|
|
1001
|
+
{
|
|
1002
|
+
width: size,
|
|
1003
|
+
height: size,
|
|
1004
|
+
viewBox: "0 0 12 12",
|
|
1005
|
+
fill: "none",
|
|
1006
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1007
|
+
"aria-hidden": "true",
|
|
1008
|
+
children: [
|
|
1009
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1010
|
+
"path",
|
|
1011
|
+
{
|
|
1012
|
+
d: "M4.75 3.25L2.25 6L4.75 8.75",
|
|
1013
|
+
stroke: color,
|
|
1014
|
+
strokeWidth: "1.25",
|
|
1015
|
+
strokeLinecap: "round",
|
|
1016
|
+
strokeLinejoin: "round"
|
|
1017
|
+
}
|
|
1018
|
+
),
|
|
1019
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1020
|
+
"path",
|
|
1021
|
+
{
|
|
1022
|
+
d: "M7.25 3.25L9.75 6L7.25 8.75",
|
|
1023
|
+
stroke: color,
|
|
1024
|
+
strokeWidth: "1.25",
|
|
1025
|
+
strokeLinecap: "round",
|
|
1026
|
+
strokeLinejoin: "round"
|
|
1027
|
+
}
|
|
1028
|
+
)
|
|
1029
|
+
]
|
|
1030
|
+
}
|
|
1031
|
+
);
|
|
1032
|
+
}
|
|
1033
|
+
var Slider = (0, import_react9.forwardRef)(
|
|
1034
|
+
(_a, ref) => {
|
|
1035
|
+
var _b = _a, {
|
|
1036
|
+
size = "medium",
|
|
1037
|
+
label,
|
|
1038
|
+
description,
|
|
1039
|
+
error = false,
|
|
1040
|
+
showValue = false,
|
|
1041
|
+
min = 0,
|
|
1042
|
+
max = 100,
|
|
1043
|
+
step = 1,
|
|
1044
|
+
value: controlledValue,
|
|
1045
|
+
defaultValue,
|
|
1046
|
+
disabled = false,
|
|
1047
|
+
className = "",
|
|
1048
|
+
id,
|
|
1049
|
+
onChange,
|
|
1050
|
+
"aria-label": ariaLabelProp
|
|
1051
|
+
} = _b, rest = __objRest(_b, [
|
|
1052
|
+
"size",
|
|
1053
|
+
"label",
|
|
1054
|
+
"description",
|
|
1055
|
+
"error",
|
|
1056
|
+
"showValue",
|
|
1057
|
+
"min",
|
|
1058
|
+
"max",
|
|
1059
|
+
"step",
|
|
1060
|
+
"value",
|
|
1061
|
+
"defaultValue",
|
|
1062
|
+
"disabled",
|
|
1063
|
+
"className",
|
|
1064
|
+
"id",
|
|
1065
|
+
"onChange",
|
|
1066
|
+
"aria-label"
|
|
1067
|
+
]);
|
|
1068
|
+
const reactId = (0, import_react9.useId)();
|
|
1069
|
+
const inputId = id != null ? id : reactId;
|
|
1070
|
+
const sz = sizeConfig[size];
|
|
1071
|
+
const ariaLabel = ariaLabelProp != null ? ariaLabelProp : typeof label === "string" ? void 0 : "Slider";
|
|
1072
|
+
const ariaDescriptionId = description ? `${inputId}-description` : void 0;
|
|
1073
|
+
const isControlled = controlledValue !== void 0;
|
|
1074
|
+
const [internalValue, setInternalValue] = (0, import_react9.useState)(defaultValue != null ? defaultValue : min);
|
|
1075
|
+
const currentValue = isControlled ? controlledValue : internalValue;
|
|
1076
|
+
const handleChange = (0, import_react9.useCallback)(
|
|
1077
|
+
(e) => {
|
|
1078
|
+
const val = Number(e.target.value);
|
|
1079
|
+
if (!isControlled) {
|
|
1080
|
+
setInternalValue(val);
|
|
1081
|
+
}
|
|
1082
|
+
onChange == null ? void 0 : onChange(val, e);
|
|
1083
|
+
},
|
|
1084
|
+
[isControlled, onChange]
|
|
1085
|
+
);
|
|
1086
|
+
const percent = (currentValue - min) / (max - min) * 100;
|
|
1087
|
+
const trackBg = disabled ? "bg-slider-track-disabled" : "bg-slider-track";
|
|
1088
|
+
const fillBg = disabled ? "bg-slider-fill-disabled" : error ? "bg-slider-fill-error" : "bg-slider-fill";
|
|
1089
|
+
const thumbBorder = disabled ? "border-slider-thumb-border-disabled" : error ? "border-slider-thumb-border-error" : "border-gray-200";
|
|
1090
|
+
const thumbBg = disabled ? "bg-slider-thumb-disabled" : "bg-slider-thumb";
|
|
1091
|
+
const iconColor = disabled ? "var(--color-gray-400)" : "var(--color-gray-500)";
|
|
1092
|
+
const labelColor = disabled ? "text-slider-label-disabled" : error ? "text-slider-label-error" : "text-slider-label";
|
|
1093
|
+
const descriptionColor = disabled ? "text-slider-label-disabled" : "text-slider-description";
|
|
1094
|
+
const thumbOffset = percent * sz.thumbPx / 100;
|
|
1095
|
+
const fillOffset = sz.thumbPx / 2 - thumbOffset;
|
|
1096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1097
|
+
"div",
|
|
1098
|
+
{
|
|
1099
|
+
className: ["flex w-full flex-col gap-2 font-sans", className].filter(Boolean).join(" "),
|
|
1100
|
+
children: [
|
|
1101
|
+
(label || showValue && !disabled) && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
1102
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1103
|
+
"label",
|
|
1104
|
+
{
|
|
1105
|
+
htmlFor: inputId,
|
|
1106
|
+
className: [
|
|
1107
|
+
sz.label,
|
|
1108
|
+
"font-medium",
|
|
1109
|
+
labelColor,
|
|
1110
|
+
disabled ? "cursor-not-allowed" : "cursor-default"
|
|
1111
|
+
].join(" "),
|
|
1112
|
+
children: label
|
|
1113
|
+
}
|
|
1114
|
+
),
|
|
1115
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1116
|
+
"span",
|
|
1117
|
+
{
|
|
1118
|
+
className: [sz.description, "tabular-nums", labelColor].join(" "),
|
|
1119
|
+
children: currentValue
|
|
1120
|
+
}
|
|
1121
|
+
)
|
|
1122
|
+
] }),
|
|
1123
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1124
|
+
"div",
|
|
1125
|
+
{
|
|
1126
|
+
className: [
|
|
1127
|
+
"relative flex items-center",
|
|
1128
|
+
sz.containerH,
|
|
1129
|
+
disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
1130
|
+
].join(" "),
|
|
1131
|
+
children: [
|
|
1132
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1133
|
+
"div",
|
|
1134
|
+
{
|
|
1135
|
+
className: [
|
|
1136
|
+
"absolute inset-x-0 rounded-full",
|
|
1137
|
+
sz.trackH,
|
|
1138
|
+
trackBg
|
|
1139
|
+
].join(" ")
|
|
1140
|
+
}
|
|
1141
|
+
),
|
|
1142
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1143
|
+
"div",
|
|
1144
|
+
{
|
|
1145
|
+
className: ["absolute left-0 rounded-full", sz.trackH, fillBg].join(" "),
|
|
1146
|
+
style: { width: `calc(${percent}% + ${fillOffset}px)` }
|
|
1147
|
+
}
|
|
1148
|
+
),
|
|
1149
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1150
|
+
"input",
|
|
1151
|
+
__spreadValues({
|
|
1152
|
+
ref,
|
|
1153
|
+
id: inputId,
|
|
1154
|
+
type: "range",
|
|
1155
|
+
min,
|
|
1156
|
+
max,
|
|
1157
|
+
step,
|
|
1158
|
+
value: currentValue,
|
|
1159
|
+
disabled,
|
|
1160
|
+
onChange: handleChange,
|
|
1161
|
+
"aria-label": ariaLabel,
|
|
1162
|
+
"aria-describedby": ariaDescriptionId,
|
|
1163
|
+
className: [
|
|
1164
|
+
"peer absolute inset-0 z-20 w-full appearance-none bg-transparent opacity-0",
|
|
1165
|
+
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
1166
|
+
"focus:outline-none"
|
|
1167
|
+
].join(" ")
|
|
1168
|
+
}, rest)
|
|
1169
|
+
),
|
|
1170
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1171
|
+
"div",
|
|
1172
|
+
{
|
|
1173
|
+
className: [
|
|
1174
|
+
"pointer-events-none absolute z-10 flex items-center justify-center rounded-full border",
|
|
1175
|
+
sz.thumbClass,
|
|
1176
|
+
thumbBg,
|
|
1177
|
+
thumbBorder,
|
|
1178
|
+
disabled ? "" : "shadow-base transition-shadow duration-150",
|
|
1179
|
+
!disabled && (error ? "peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-slider-ring-error" : "peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-slider-ring"),
|
|
1180
|
+
!disabled && "peer-hover:shadow-medium"
|
|
1181
|
+
].filter(Boolean).join(" "),
|
|
1182
|
+
style: { left: `calc(${percent}% - ${thumbOffset}px)` },
|
|
1183
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChevronGlyphs, { size: sz.iconPx, color: iconColor })
|
|
1184
|
+
}
|
|
1185
|
+
)
|
|
1186
|
+
]
|
|
1187
|
+
}
|
|
1188
|
+
),
|
|
1189
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1190
|
+
"span",
|
|
1191
|
+
{
|
|
1192
|
+
id: ariaDescriptionId,
|
|
1193
|
+
className: [sz.description, descriptionColor].join(" "),
|
|
1194
|
+
children: description
|
|
1195
|
+
}
|
|
1196
|
+
)
|
|
1197
|
+
]
|
|
1198
|
+
}
|
|
1199
|
+
);
|
|
1200
|
+
}
|
|
1201
|
+
);
|
|
1202
|
+
Slider.displayName = "Slider";
|
|
1203
|
+
|
|
1204
|
+
// src/components/Toast/Toast.tsx
|
|
1205
|
+
var import_react10 = require("react");
|
|
1206
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1207
|
+
function CheckCircleIcon({ className }) {
|
|
1208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1209
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1210
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1211
|
+
] });
|
|
1212
|
+
}
|
|
1213
|
+
function ProgressIcon({ className }) {
|
|
1214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1215
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5", opacity: "0.3" }),
|
|
1216
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M10 2a8 8 0 0 1 8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("animateTransform", { attributeName: "transform", type: "rotate", from: "0 10 10", to: "360 10 10", dur: "1s", repeatCount: "indefinite" }) })
|
|
1217
|
+
] });
|
|
1218
|
+
}
|
|
1219
|
+
function ErrorIcon({ className }) {
|
|
1220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1221
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1222
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M10 6.5v4M10 13.5h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
1223
|
+
] });
|
|
1224
|
+
}
|
|
1225
|
+
function CloseIcon2({ className }) {
|
|
1226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1227
|
+
}
|
|
1228
|
+
var defaultIcons2 = {
|
|
1229
|
+
default: CheckCircleIcon,
|
|
1230
|
+
progress: ProgressIcon,
|
|
1231
|
+
error: ErrorIcon
|
|
1232
|
+
};
|
|
1233
|
+
var typeClasses = {
|
|
1234
|
+
default: "bg-toast-default-bg text-toast-default-text",
|
|
1235
|
+
progress: "bg-toast-progress-bg text-toast-progress-text",
|
|
1236
|
+
error: "bg-toast-error-bg text-toast-error-text"
|
|
1237
|
+
};
|
|
1238
|
+
var iconColorClasses = {
|
|
1239
|
+
default: "text-toast-default-icon",
|
|
1240
|
+
progress: "text-toast-progress-icon",
|
|
1241
|
+
error: "text-toast-error-icon"
|
|
1242
|
+
};
|
|
1243
|
+
var Toast = (0, import_react10.forwardRef)(
|
|
1244
|
+
(_a, ref) => {
|
|
1245
|
+
var _b = _a, {
|
|
1246
|
+
type = "default",
|
|
1247
|
+
icon = true,
|
|
1248
|
+
actionLabel,
|
|
1249
|
+
onAction,
|
|
1250
|
+
onDismiss,
|
|
1251
|
+
children,
|
|
1252
|
+
className = ""
|
|
1253
|
+
} = _b, rest = __objRest(_b, [
|
|
1254
|
+
"type",
|
|
1255
|
+
"icon",
|
|
1256
|
+
"actionLabel",
|
|
1257
|
+
"onAction",
|
|
1258
|
+
"onDismiss",
|
|
1259
|
+
"children",
|
|
1260
|
+
"className"
|
|
1261
|
+
]);
|
|
1262
|
+
const DefaultIcon = defaultIcons2[type];
|
|
1263
|
+
const classes = [
|
|
1264
|
+
"inline-flex items-center gap-3 font-sans",
|
|
1265
|
+
"rounded-xl px-4 py-3",
|
|
1266
|
+
"min-w-[320px] max-w-[480px]",
|
|
1267
|
+
"shadow-large",
|
|
1268
|
+
typeClasses[type],
|
|
1269
|
+
className
|
|
1270
|
+
].filter(Boolean).join(" ");
|
|
1271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
1272
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: `shrink-0 ${iconColorClasses[type]}`, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DefaultIcon, { className: "h-5 w-5" }) }),
|
|
1273
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex-1 text-sm font-medium leading-5 truncate", children }),
|
|
1274
|
+
actionLabel && onAction && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1275
|
+
"button",
|
|
1276
|
+
{
|
|
1277
|
+
type: "button",
|
|
1278
|
+
onClick: onAction,
|
|
1279
|
+
className: "shrink-0 text-sm font-medium text-toast-action-text hover:bg-toast-action-bg-hover rounded-md px-2 py-1 transition-colors",
|
|
1280
|
+
children: actionLabel
|
|
1281
|
+
}
|
|
1282
|
+
),
|
|
1283
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1284
|
+
"button",
|
|
1285
|
+
{
|
|
1286
|
+
type: "button",
|
|
1287
|
+
onClick: onDismiss,
|
|
1288
|
+
className: "shrink-0 p-1 rounded-md text-toast-dismiss hover:text-toast-dismiss-hover transition-colors",
|
|
1289
|
+
"aria-label": "Dismiss",
|
|
1290
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CloseIcon2, { className: "h-4 w-4" })
|
|
1291
|
+
}
|
|
1292
|
+
)
|
|
1293
|
+
] }));
|
|
1294
|
+
}
|
|
1295
|
+
);
|
|
1296
|
+
Toast.displayName = "Toast";
|
|
309
1297
|
// Annotate the CommonJS export names for ESM import in node:
|
|
310
1298
|
0 && (module.exports = {
|
|
1299
|
+
Accordion,
|
|
1300
|
+
AlertBanner,
|
|
1301
|
+
Avatar,
|
|
1302
|
+
Badge,
|
|
311
1303
|
Button,
|
|
312
|
-
Checkbox
|
|
1304
|
+
Checkbox,
|
|
1305
|
+
Icon,
|
|
1306
|
+
Radio,
|
|
1307
|
+
Slider,
|
|
1308
|
+
Toast
|
|
313
1309
|
});
|