@refinn/core-ui 0.1.13 → 0.1.15
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.cjs +942 -743
- package/dist/index.d.mts +50 -21
- package/dist/index.d.ts +50 -21
- package/dist/index.js +950 -745
- package/dist/theme.css +5 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -58,6 +58,7 @@ __export(index_exports, {
|
|
|
58
58
|
Button: () => Button,
|
|
59
59
|
Checkbox: () => Checkbox,
|
|
60
60
|
Chip: () => Chip,
|
|
61
|
+
CurrencyField: () => CurrencyField,
|
|
61
62
|
Dialog: () => Dialog,
|
|
62
63
|
Drawer: () => Drawer,
|
|
63
64
|
Dropdown: () => Dropdown,
|
|
@@ -215,35 +216,271 @@ var Accordion = (0, import_react.forwardRef)(
|
|
|
215
216
|
Accordion.displayName = "Accordion";
|
|
216
217
|
|
|
217
218
|
// src/components/AlertBanner/AlertBanner.tsx
|
|
219
|
+
var import_react5 = require("react");
|
|
220
|
+
|
|
221
|
+
// src/components/Button/Button.tsx
|
|
222
|
+
var import_react3 = require("react");
|
|
223
|
+
|
|
224
|
+
// src/components/Loading/Loading.tsx
|
|
218
225
|
var import_react2 = require("react");
|
|
219
226
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
220
|
-
var
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
227
|
+
var Loading = (0, import_react2.forwardRef)(
|
|
228
|
+
(_a, ref) => {
|
|
229
|
+
var _b = _a, { size = "sm", isDark = false, className = "" } = _b, rest = __objRest(_b, ["size", "isDark", "className"]);
|
|
230
|
+
const containerClasses = [
|
|
231
|
+
isDark ? "text-white-100" : "text-blue-600",
|
|
232
|
+
className
|
|
233
|
+
].filter(Boolean).join(" ");
|
|
234
|
+
return size === "sm" && !isDark ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
235
|
+
"svg",
|
|
236
|
+
{
|
|
237
|
+
className: "animate-spin",
|
|
238
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
239
|
+
width: "18",
|
|
240
|
+
height: "18",
|
|
241
|
+
viewBox: "0 0 18 18",
|
|
242
|
+
fill: "none",
|
|
243
|
+
children: [
|
|
244
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
245
|
+
"path",
|
|
246
|
+
{
|
|
247
|
+
d: "M1 9C1 6.87827 1.84286 4.84344 3.34315 3.34315C4.84344 1.84285 6.87827 1 9 1C11.1217 1 13.1566 1.84286 14.6569 3.34315C16.1571 4.84344 17 6.87827 17 9C17 11.1217 16.1571 13.1566 14.6569 14.6569C13.1566 16.1571 11.1217 17 9 17C6.87827 17 4.84344 16.1571 3.34315 14.6569C1.84285 13.1566 1 11.1217 1 9L1 9Z",
|
|
248
|
+
stroke: "#F3F4F6",
|
|
249
|
+
strokeWidth: "2"
|
|
250
|
+
}
|
|
251
|
+
),
|
|
252
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
253
|
+
"path",
|
|
254
|
+
{
|
|
255
|
+
d: "M1 9C1 7.31057 1.53484 5.6645 2.52786 4.29772C3.52089 2.93094 4.92112 1.91361 6.52787 1.39155C8.13461 0.869484 9.86539 0.869484 11.4721 1.39155C13.0789 1.91361 14.4791 2.93094 15.4721 4.29772",
|
|
256
|
+
stroke: "#0193D7",
|
|
257
|
+
strokeWidth: "2"
|
|
258
|
+
}
|
|
259
|
+
)
|
|
260
|
+
]
|
|
261
|
+
}
|
|
262
|
+
) })) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
263
|
+
"svg",
|
|
264
|
+
{
|
|
265
|
+
className: "animate-spin",
|
|
266
|
+
width: size === "sm" ? 18 : 88,
|
|
267
|
+
height: size === "sm" ? 18 : 88,
|
|
268
|
+
viewBox: "0 0 20 20",
|
|
269
|
+
fill: "none",
|
|
270
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
271
|
+
"path",
|
|
272
|
+
{
|
|
273
|
+
d: "M10 2.5a7.5 7.5 0 1 0 7.5 7.5",
|
|
274
|
+
stroke: "currentColor",
|
|
275
|
+
strokeWidth: size === "sm" ? 2 : 1,
|
|
276
|
+
strokeLinecap: "round"
|
|
277
|
+
}
|
|
278
|
+
)
|
|
279
|
+
}
|
|
280
|
+
) }));
|
|
281
|
+
}
|
|
282
|
+
);
|
|
283
|
+
Loading.displayName = "Loading";
|
|
284
|
+
|
|
285
|
+
// src/components/Button/Button.tsx
|
|
286
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
287
|
+
var variantClasses = {
|
|
288
|
+
primary: [
|
|
289
|
+
"bg-blue-600 text-white-100",
|
|
290
|
+
"hover:bg-blue-700",
|
|
291
|
+
"active:bg-blue-800",
|
|
292
|
+
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
293
|
+
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
294
|
+
].join(" "),
|
|
295
|
+
secondary: [
|
|
296
|
+
"bg-gray-100 text-gray-900",
|
|
297
|
+
"hover:bg-gray-200",
|
|
298
|
+
"active:bg-gray-300",
|
|
299
|
+
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
300
|
+
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
301
|
+
].join(" "),
|
|
302
|
+
tertiary: [
|
|
303
|
+
"bg-black-0 text-gray-900",
|
|
304
|
+
"hover:bg-gray-200",
|
|
305
|
+
"active:bg-gray-300",
|
|
306
|
+
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
307
|
+
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
308
|
+
].join(" "),
|
|
309
|
+
contrast: [
|
|
310
|
+
"bg-white-100 text-blue-600",
|
|
311
|
+
"hover:bg-white-90",
|
|
312
|
+
"active:bg-white-80",
|
|
313
|
+
"focus-visible:ring-2 focus-visible:ring-white-100 focus-visible:ring-offset-2",
|
|
314
|
+
"disabled:bg-gray-50 disabled:text-gray-400"
|
|
315
|
+
].join(" "),
|
|
316
|
+
transparent: [
|
|
317
|
+
"bg-black-0 text-white-100",
|
|
318
|
+
"hover:bg-white-20",
|
|
319
|
+
"active:bg-white-30",
|
|
320
|
+
"focus-visible:ring-2 focus-visible:ring-white-100 focus-visible:bg-black-0 focus-visible:ring-offset-2",
|
|
321
|
+
"disabled:bg-black-0 disabled:text-white-40"
|
|
322
|
+
].join(" ")
|
|
226
323
|
};
|
|
227
|
-
var
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
none: "bg-alert-banner-background-common-subtle text-alert-text-primary"
|
|
324
|
+
var sizeClasses = {
|
|
325
|
+
sm: "px-16 py-6 text-label-medium",
|
|
326
|
+
md: "px-20 py-8 text-label-large",
|
|
327
|
+
lg: "px-24 py-12 text-label-large",
|
|
328
|
+
xl: "px-32 py-16 text-label-large"
|
|
233
329
|
};
|
|
234
|
-
var
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
330
|
+
var Button = (0, import_react3.forwardRef)(
|
|
331
|
+
(_a, ref) => {
|
|
332
|
+
var _b = _a, {
|
|
333
|
+
variant = "primary",
|
|
334
|
+
size = "md",
|
|
335
|
+
rounded = false,
|
|
336
|
+
loading = false,
|
|
337
|
+
disabled = false,
|
|
338
|
+
startIcon,
|
|
339
|
+
endIcon,
|
|
340
|
+
children,
|
|
341
|
+
className = ""
|
|
342
|
+
} = _b, rest = __objRest(_b, [
|
|
343
|
+
"variant",
|
|
344
|
+
"size",
|
|
345
|
+
"rounded",
|
|
346
|
+
"loading",
|
|
347
|
+
"disabled",
|
|
348
|
+
"startIcon",
|
|
349
|
+
"endIcon",
|
|
350
|
+
"children",
|
|
351
|
+
"className"
|
|
352
|
+
]);
|
|
353
|
+
const isDisabled = disabled;
|
|
354
|
+
const classes = [
|
|
355
|
+
"inline-flex items-center justify-center gap-8",
|
|
356
|
+
"transition-colors duration-150",
|
|
357
|
+
"outline-none",
|
|
358
|
+
"disabled:cursor-not-allowed",
|
|
359
|
+
loading ? "pointer-events-none" : "cursor-pointer",
|
|
360
|
+
sizeClasses[size],
|
|
361
|
+
variantClasses[variant],
|
|
362
|
+
rounded ? "rounded-full" : size === "sm" ? "rounded-6" : size === "xl" ? "rounded-12" : "rounded-8",
|
|
363
|
+
className
|
|
364
|
+
].filter(Boolean).join(" ");
|
|
365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("button", __spreadProps(__spreadValues({ ref, disabled: isDisabled, className: classes }, rest), { children: [
|
|
366
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Loading, { size: "sm", isDark: variant === "primary" || variant === "transparent" }) : startIcon,
|
|
367
|
+
children,
|
|
368
|
+
!loading && endIcon
|
|
369
|
+
] }));
|
|
370
|
+
}
|
|
371
|
+
);
|
|
372
|
+
Button.displayName = "Button";
|
|
373
|
+
|
|
374
|
+
// src/components/IconButton/IconButton.tsx
|
|
375
|
+
var import_react4 = require("react");
|
|
376
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
377
|
+
var sizeClasses2 = {
|
|
378
|
+
xs: "h-24 w-24",
|
|
379
|
+
s: "h-32 w-32",
|
|
380
|
+
m: "h-40 w-40",
|
|
381
|
+
l: "h-48 w-48"
|
|
240
382
|
};
|
|
241
|
-
var
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
383
|
+
var iconSizeClasses = {
|
|
384
|
+
xs: "h-16 w-16",
|
|
385
|
+
s: "h-20 w-20",
|
|
386
|
+
m: "h-24 w-24",
|
|
387
|
+
l: "h-24 w-24"
|
|
388
|
+
};
|
|
389
|
+
var surfaceBackgroundClasses = {
|
|
390
|
+
default: {
|
|
391
|
+
enabled: "bg-icon-button-background-enabled",
|
|
392
|
+
hover: "hover:bg-icon-button-background-hover",
|
|
393
|
+
active: "active:bg-icon-button-background-active"
|
|
394
|
+
},
|
|
395
|
+
dark: {
|
|
396
|
+
enabled: "bg-icon-button-background-dark-transparent-enabled",
|
|
397
|
+
hover: "hover:bg-icon-button-background-dark-transparent-hover",
|
|
398
|
+
active: "active:bg-icon-button-background-dark-transparent-active"
|
|
399
|
+
},
|
|
400
|
+
light: {
|
|
401
|
+
enabled: "bg-icon-button-background-light-transparent-enabled",
|
|
402
|
+
hover: "hover:bg-icon-button-background-light-transparent-hover",
|
|
403
|
+
active: "active:bg-icon-button-background-light-transparent-active"
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
var surfaceIconClasses = {
|
|
407
|
+
default: {
|
|
408
|
+
primary: "text-icon-button-icon-primary",
|
|
409
|
+
danger: "text-icon-button-icon-danger",
|
|
410
|
+
disabled: "text-icon-button-icon-disabled"
|
|
411
|
+
},
|
|
412
|
+
dark: {
|
|
413
|
+
primary: "text-icon-button-icon-inverse",
|
|
414
|
+
danger: "text-icon-button-icon-inverse-danger",
|
|
415
|
+
disabled: "text-icon-button-icon-inverse-disabled"
|
|
416
|
+
},
|
|
417
|
+
light: {
|
|
418
|
+
primary: "text-icon-button-icon-inverse",
|
|
419
|
+
danger: "text-icon-button-icon-inverse-danger",
|
|
420
|
+
disabled: "text-icon-button-icon-inverse-disabled"
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
var IconButton = (0, import_react4.forwardRef)(
|
|
424
|
+
(_a, ref) => {
|
|
425
|
+
var _b = _a, {
|
|
426
|
+
icon,
|
|
427
|
+
size = "s",
|
|
428
|
+
surface = "default",
|
|
429
|
+
transparent = false,
|
|
430
|
+
danger = false,
|
|
431
|
+
disabled = false,
|
|
432
|
+
className = ""
|
|
433
|
+
} = _b, rest = __objRest(_b, [
|
|
434
|
+
"icon",
|
|
435
|
+
"size",
|
|
436
|
+
"surface",
|
|
437
|
+
"transparent",
|
|
438
|
+
"danger",
|
|
439
|
+
"disabled",
|
|
440
|
+
"className"
|
|
441
|
+
]);
|
|
442
|
+
const background = surfaceBackgroundClasses[surface];
|
|
443
|
+
const iconColor = surfaceIconClasses[surface];
|
|
444
|
+
const classes = [
|
|
445
|
+
"inline-flex shrink-0 items-center justify-center rounded-full transition-colors",
|
|
446
|
+
"focus-visible:rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-icon-button-border-focus",
|
|
447
|
+
sizeClasses2[size],
|
|
448
|
+
transparent ? "bg-icon-button-background-transparent" : background.enabled,
|
|
449
|
+
disabled ? `cursor-not-allowed ${iconColor.disabled}` : [
|
|
450
|
+
"cursor-pointer",
|
|
451
|
+
background.hover,
|
|
452
|
+
background.active,
|
|
453
|
+
danger ? iconColor.danger : iconColor.primary
|
|
454
|
+
].join(" "),
|
|
455
|
+
className
|
|
456
|
+
].filter(Boolean).join(" ");
|
|
457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", __spreadProps(__spreadValues({ ref, type: "button", disabled, className: classes }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: `shrink-0 flex items-center justify-center ${iconSizeClasses[size]}`, children: icon }) }));
|
|
458
|
+
}
|
|
459
|
+
);
|
|
460
|
+
IconButton.displayName = "IconButton";
|
|
461
|
+
|
|
462
|
+
// src/components/AlertBanner/AlertBanner.tsx
|
|
463
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
464
|
+
var pageBgClasses = {
|
|
465
|
+
info: "bg-alert-page-info-bg",
|
|
466
|
+
success: "bg-alert-page-success-bg",
|
|
467
|
+
warning: "bg-alert-page-warning-bg",
|
|
468
|
+
danger: "bg-alert-page-danger-bg",
|
|
469
|
+
none: "bg-alert-page-common-bg"
|
|
470
|
+
};
|
|
471
|
+
var pageTextIsDark = {
|
|
472
|
+
info: false,
|
|
473
|
+
success: false,
|
|
474
|
+
warning: true,
|
|
475
|
+
danger: false,
|
|
476
|
+
none: false
|
|
477
|
+
};
|
|
478
|
+
var sectionBgClasses = {
|
|
479
|
+
info: "bg-alert-banner-background-info-subtle",
|
|
480
|
+
success: "bg-alert-banner-background-success-subtle",
|
|
481
|
+
warning: "bg-alert-banner-background-warning-subtle",
|
|
482
|
+
danger: "bg-alert-banner-background-danger-subtle",
|
|
483
|
+
none: "bg-alert-banner-background-common-subtle"
|
|
247
484
|
};
|
|
248
485
|
var inlineIconClasses = {
|
|
249
486
|
info: "text-alert-inline-info-icon",
|
|
@@ -253,25 +490,25 @@ var inlineIconClasses = {
|
|
|
253
490
|
none: "text-alert-inline-common-icon"
|
|
254
491
|
};
|
|
255
492
|
function InfoIcon({ className }) {
|
|
256
|
-
return /* @__PURE__ */ (0,
|
|
493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM9 8.5h2V14H9V8.5ZM9 6h2v1.5H9V6Z" }) });
|
|
257
494
|
}
|
|
258
495
|
function SuccessIcon({ className }) {
|
|
259
|
-
return /* @__PURE__ */ (0,
|
|
260
|
-
/* @__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" }),
|
|
261
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
262
|
-
] });
|
|
496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM8.8 13.2 6.3 10.7 7.4 9.6 8.8 11 12.9 6.9 14 8 8.8 13.2Z" }) });
|
|
263
497
|
}
|
|
264
498
|
function WarningIcon({ className }) {
|
|
265
|
-
return /* @__PURE__ */ (0,
|
|
499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10.87 3.2a1 1 0 0 0-1.74 0L1.6 16.5A1 1 0 0 0 2.47 18h15.06a1 1 0 0 0 .87-1.5L10.87 3.2ZM9.1 8h1.8v4.2H9.1V8ZM9.1 13.3h1.8V15H9.1v-1.7Z" }) });
|
|
266
500
|
}
|
|
267
501
|
function DangerIcon({ className }) {
|
|
268
|
-
return /* @__PURE__ */ (0,
|
|
502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM9 5.5h2V11H9V5.5ZM9 13h2v1.5H9V13Z" }) });
|
|
269
503
|
}
|
|
270
|
-
function NoneIcon(
|
|
271
|
-
return
|
|
504
|
+
function NoneIcon() {
|
|
505
|
+
return null;
|
|
272
506
|
}
|
|
273
507
|
function CloseIcon({ className }) {
|
|
274
|
-
return /* @__PURE__ */ (0,
|
|
508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
509
|
+
}
|
|
510
|
+
function ArrowRightIcon({ className }) {
|
|
511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M4 10h12M11 5l5 5-5 5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
275
512
|
}
|
|
276
513
|
var defaultIcons = {
|
|
277
514
|
info: InfoIcon,
|
|
@@ -280,14 +517,15 @@ var defaultIcons = {
|
|
|
280
517
|
danger: DangerIcon,
|
|
281
518
|
none: NoneIcon
|
|
282
519
|
};
|
|
283
|
-
var AlertBanner = (0,
|
|
520
|
+
var AlertBanner = (0, import_react5.forwardRef)(
|
|
284
521
|
(_a, ref) => {
|
|
285
522
|
var _b = _a, {
|
|
286
523
|
variant = "info",
|
|
287
524
|
mode = "inline",
|
|
288
525
|
title,
|
|
289
526
|
description,
|
|
290
|
-
|
|
527
|
+
buttonAction,
|
|
528
|
+
buttonLink,
|
|
291
529
|
icon,
|
|
292
530
|
onClose,
|
|
293
531
|
className = "",
|
|
@@ -297,7 +535,8 @@ var AlertBanner = (0, import_react2.forwardRef)(
|
|
|
297
535
|
"mode",
|
|
298
536
|
"title",
|
|
299
537
|
"description",
|
|
300
|
-
"
|
|
538
|
+
"buttonAction",
|
|
539
|
+
"buttonLink",
|
|
301
540
|
"icon",
|
|
302
541
|
"onClose",
|
|
303
542
|
"className",
|
|
@@ -305,49 +544,73 @@ var AlertBanner = (0, import_react2.forwardRef)(
|
|
|
305
544
|
]);
|
|
306
545
|
const isPage = mode === "page";
|
|
307
546
|
const isSection = mode === "section";
|
|
308
|
-
const
|
|
309
|
-
const
|
|
547
|
+
const isStacked = Boolean(buttonAction);
|
|
548
|
+
const pageIsDark = isPage && pageTextIsDark[variant];
|
|
549
|
+
const bgClass = isPage ? pageBgClasses[variant] : isSection ? sectionBgClasses[variant] : "bg-alert-banner-background-transparent";
|
|
310
550
|
const DefaultIcon = defaultIcons[variant];
|
|
311
|
-
const iconColorClass = isPage ? "" : inlineIconClasses[variant];
|
|
312
|
-
const
|
|
313
|
-
const
|
|
314
|
-
const
|
|
315
|
-
|
|
551
|
+
const iconColorClass = isPage ? pageIsDark ? "text-alert-text-primary" : "text-white-100" : inlineIconClasses[variant];
|
|
552
|
+
const titleColorClass = isPage ? pageIsDark ? "text-alert-text-primary" : "text-alert-text-primary-inverse" : "text-alert-text-primary";
|
|
553
|
+
const descColorClass = isPage ? pageIsDark ? "text-alert-text-secondary" : "text-alert-text-secondary-inverse" : "text-alert-text-secondary";
|
|
554
|
+
const linkColorClass = isPage ? pageIsDark ? "text-alert-text-primary" : "text-white-100" : "text-enabled";
|
|
555
|
+
const closeButtonSurface = isPage ? "dark" : "default";
|
|
556
|
+
const containerClasses = [
|
|
557
|
+
"flex font-sans",
|
|
558
|
+
isStacked ? "flex-col items-start gap-8" : "items-center gap-24",
|
|
316
559
|
isPage ? "p-12" : isSection ? "p-12 rounded-md" : "p-0",
|
|
317
|
-
|
|
560
|
+
bgClass,
|
|
318
561
|
className
|
|
319
562
|
].filter(Boolean).join(" ");
|
|
320
|
-
return /* @__PURE__ */ (0,
|
|
321
|
-
/* @__PURE__ */ (0,
|
|
322
|
-
icon != null ? icon : /* @__PURE__ */ (0,
|
|
323
|
-
/* @__PURE__ */ (0,
|
|
324
|
-
title && /* @__PURE__ */ (0,
|
|
325
|
-
description && /* @__PURE__ */ (0,
|
|
563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", __spreadProps(__spreadValues({ ref, role: "alert", className: containerClasses }, rest), { children: [
|
|
564
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: `flex w-full items-start gap-8 ${isStacked ? "" : "flex-1 min-w-0"}`, children: [
|
|
565
|
+
icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DefaultIcon, { className: `h-20 w-20 shrink-0 ${iconColorClass}` }),
|
|
566
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex-1 min-w-0 flex flex-col gap-2", children: [
|
|
567
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: `text-label-medium ${titleColorClass}`, children: title }),
|
|
568
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: `text-body-small ${descColorClass}`, children: description }),
|
|
326
569
|
children
|
|
327
|
-
] })
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
570
|
+
] }),
|
|
571
|
+
!isStacked && buttonLink && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
572
|
+
"a",
|
|
573
|
+
{
|
|
574
|
+
href: buttonLink.href,
|
|
575
|
+
onClick: buttonLink.onClick,
|
|
576
|
+
className: `shrink-0 self-center text-link-small font-medium underline ${linkColorClass}`,
|
|
577
|
+
children: buttonLink.label
|
|
578
|
+
}
|
|
579
|
+
),
|
|
580
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
581
|
+
IconButton,
|
|
333
582
|
{
|
|
334
|
-
|
|
583
|
+
size: "s",
|
|
584
|
+
surface: closeButtonSurface,
|
|
585
|
+
transparent: true,
|
|
335
586
|
onClick: onClose,
|
|
336
|
-
className:
|
|
337
|
-
"aria-label": "
|
|
338
|
-
|
|
587
|
+
className: "shrink-0",
|
|
588
|
+
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
589
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CloseIcon, { className: "h-16 w-16" })
|
|
339
590
|
}
|
|
340
591
|
)
|
|
341
|
-
] })
|
|
592
|
+
] }),
|
|
593
|
+
isStacked && buttonAction && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex w-full items-start gap-12 pl-28", children: isPage ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Button, { variant: "secondary", size: "sm", onClick: buttonAction.onClick, children: buttonAction.label }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
594
|
+
"a",
|
|
595
|
+
{
|
|
596
|
+
href: buttonAction.href,
|
|
597
|
+
onClick: buttonAction.onClick,
|
|
598
|
+
className: "flex items-center gap-2 text-link-small font-medium text-enabled",
|
|
599
|
+
children: [
|
|
600
|
+
buttonAction.label,
|
|
601
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ArrowRightIcon, { className: "h-20 w-20" })
|
|
602
|
+
]
|
|
603
|
+
}
|
|
604
|
+
) })
|
|
342
605
|
] }));
|
|
343
606
|
}
|
|
344
607
|
);
|
|
345
608
|
AlertBanner.displayName = "AlertBanner";
|
|
346
609
|
|
|
347
610
|
// src/components/Avatar/Avatar.tsx
|
|
348
|
-
var
|
|
349
|
-
var
|
|
350
|
-
var
|
|
611
|
+
var import_react6 = require("react");
|
|
612
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
613
|
+
var sizeClasses3 = {
|
|
351
614
|
sm: { container: "h-24 w-24", text: "text-sm", status: "h-6 w-6", statusRing: "ring-1" },
|
|
352
615
|
md: { container: "h-32 w-32", text: "text-base", status: "h-8 w-8", statusRing: "ring-[1.5px]" },
|
|
353
616
|
lg: { container: "h-40 w-40", text: "text-lg", status: "h-10 w-10", statusRing: "ring-2" },
|
|
@@ -365,9 +628,9 @@ function getInitials(name) {
|
|
|
365
628
|
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
366
629
|
}
|
|
367
630
|
function PersonIcon({ className }) {
|
|
368
|
-
return /* @__PURE__ */ (0,
|
|
631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime6.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" }) });
|
|
369
632
|
}
|
|
370
|
-
var Avatar = (0,
|
|
633
|
+
var Avatar = (0, import_react6.forwardRef)(
|
|
371
634
|
(_a, ref) => {
|
|
372
635
|
var _b = _a, {
|
|
373
636
|
size = "md",
|
|
@@ -386,7 +649,7 @@ var Avatar = (0, import_react3.forwardRef)(
|
|
|
386
649
|
"status",
|
|
387
650
|
"className"
|
|
388
651
|
]);
|
|
389
|
-
const sz =
|
|
652
|
+
const sz = sizeClasses3[size];
|
|
390
653
|
const containerClasses = [
|
|
391
654
|
"relative inline-flex items-center justify-center shrink-0 rounded-full",
|
|
392
655
|
"bg-avatar-bg text-avatar-text font-medium font-sans",
|
|
@@ -397,7 +660,7 @@ var Avatar = (0, import_react3.forwardRef)(
|
|
|
397
660
|
].filter(Boolean).join(" ");
|
|
398
661
|
let content;
|
|
399
662
|
if (src) {
|
|
400
|
-
content = /* @__PURE__ */ (0,
|
|
663
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
401
664
|
"img",
|
|
402
665
|
{
|
|
403
666
|
src,
|
|
@@ -408,13 +671,13 @@ var Avatar = (0, import_react3.forwardRef)(
|
|
|
408
671
|
} else if (icon) {
|
|
409
672
|
content = icon;
|
|
410
673
|
} else if (name) {
|
|
411
|
-
content = /* @__PURE__ */ (0,
|
|
674
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: sz.text, children: getInitials(name) });
|
|
412
675
|
} else {
|
|
413
|
-
content = /* @__PURE__ */ (0,
|
|
676
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PersonIcon, { className: `${sz.text} h-[60%] w-[60%]` });
|
|
414
677
|
}
|
|
415
|
-
return /* @__PURE__ */ (0,
|
|
678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: [
|
|
416
679
|
content,
|
|
417
|
-
status && /* @__PURE__ */ (0,
|
|
680
|
+
status && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
418
681
|
"span",
|
|
419
682
|
{
|
|
420
683
|
className: [
|
|
@@ -432,14 +695,14 @@ var Avatar = (0, import_react3.forwardRef)(
|
|
|
432
695
|
Avatar.displayName = "Avatar";
|
|
433
696
|
|
|
434
697
|
// src/components/Badge/Badge.tsx
|
|
435
|
-
var
|
|
436
|
-
var
|
|
437
|
-
var
|
|
698
|
+
var import_react7 = require("react");
|
|
699
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
700
|
+
var sizeClasses4 = {
|
|
438
701
|
sm: "h-20 px-8 py-2 text-label-small gap-4",
|
|
439
702
|
md: "h-28 px-10 py-4 text-label-medium gap-4",
|
|
440
703
|
lg: "h-32 px-14 py-6 text-label-large gap-6"
|
|
441
704
|
};
|
|
442
|
-
var
|
|
705
|
+
var iconSizeClasses2 = {
|
|
443
706
|
sm: "h-16 w-16",
|
|
444
707
|
md: "h-20 w-20",
|
|
445
708
|
lg: "h-24 w-24"
|
|
@@ -473,7 +736,7 @@ var styleMap = {
|
|
|
473
736
|
subtle: subtleClasses,
|
|
474
737
|
bold: boldClasses
|
|
475
738
|
};
|
|
476
|
-
var Badge = (0,
|
|
739
|
+
var Badge = (0, import_react7.forwardRef)(
|
|
477
740
|
(_a, ref) => {
|
|
478
741
|
var _b = _a, {
|
|
479
742
|
status = "common",
|
|
@@ -495,13 +758,13 @@ var Badge = (0, import_react4.forwardRef)(
|
|
|
495
758
|
const classes = [
|
|
496
759
|
"inline-flex items-center justify-center font-medium font-sans",
|
|
497
760
|
"whitespace-nowrap select-none",
|
|
498
|
-
|
|
761
|
+
sizeClasses4[size],
|
|
499
762
|
shape === "round" ? "rounded-full" : `rounded-${size}`,
|
|
500
763
|
styleMap[badgeStyle][status],
|
|
501
764
|
className
|
|
502
765
|
].filter(Boolean).join(" ");
|
|
503
|
-
return /* @__PURE__ */ (0,
|
|
504
|
-
icon && /* @__PURE__ */ (0,
|
|
766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", __spreadProps(__spreadValues({ ref, className: classes }, rest), { children: [
|
|
767
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: `shrink-0 ${iconSizeClasses2[size]}`, children: icon }),
|
|
505
768
|
children
|
|
506
769
|
] }));
|
|
507
770
|
}
|
|
@@ -509,18 +772,18 @@ var Badge = (0, import_react4.forwardRef)(
|
|
|
509
772
|
Badge.displayName = "Badge";
|
|
510
773
|
|
|
511
774
|
// src/components/Branding/Branding.tsx
|
|
512
|
-
var
|
|
513
|
-
var
|
|
514
|
-
var Branding = (0,
|
|
775
|
+
var import_react8 = require("react");
|
|
776
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
777
|
+
var Branding = (0, import_react8.forwardRef)(
|
|
515
778
|
(_a, ref) => {
|
|
516
779
|
var _b = _a, { type = "brand", className = "" } = _b, rest = __objRest(_b, ["type", "className"]);
|
|
517
|
-
return /* @__PURE__ */ (0,
|
|
780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
518
781
|
"div",
|
|
519
782
|
__spreadProps(__spreadValues({
|
|
520
783
|
ref,
|
|
521
784
|
className: `${type === "black" ? "text-gray-900" : type === "white" ? "text-white-100" : "text-blue-600"} ${className}`
|
|
522
785
|
}, rest), {
|
|
523
|
-
children: /* @__PURE__ */ (0,
|
|
786
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
524
787
|
"svg",
|
|
525
788
|
{
|
|
526
789
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -529,8 +792,8 @@ var Branding = (0, import_react5.forwardRef)(
|
|
|
529
792
|
viewBox: "0 0 89 20",
|
|
530
793
|
fill: "currentColor",
|
|
531
794
|
children: [
|
|
532
|
-
/* @__PURE__ */ (0,
|
|
533
|
-
/* @__PURE__ */ (0,
|
|
795
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("g", { clipPath: "url(#clip0_828_998)", children: [
|
|
796
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
534
797
|
"path",
|
|
535
798
|
{
|
|
536
799
|
fillRule: "evenodd",
|
|
@@ -539,14 +802,14 @@ var Branding = (0, import_react5.forwardRef)(
|
|
|
539
802
|
fill: "currentColor"
|
|
540
803
|
}
|
|
541
804
|
),
|
|
542
|
-
/* @__PURE__ */ (0,
|
|
805
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
543
806
|
"path",
|
|
544
807
|
{
|
|
545
808
|
d: "M30.3851 15.1575C31.5816 13.5 34.0989 15.2805 32.9023 16.9379C31.9828 18.1966 30.3241 19.854 27.2241 19.823C23.6241 19.823 20.5575 16.7195 20.4736 12.6379C20.4671 12.5169 20.4671 12.3957 20.4736 12.2747C20.5621 8.18966 23.6241 5.08966 27.1931 5.08966H27.2241C30.815 5.08966 33.977 8.28162 33.977 12.4563C33.979 12.6584 33.9407 12.8588 33.8643 13.0459C33.7879 13.233 33.6749 13.4029 33.532 13.5458C33.3891 13.6887 33.2192 13.8017 33.0321 13.8781C32.845 13.9545 32.6446 13.9928 32.4425 13.9908H23.7851C24.3046 15.5667 25.6023 16.7494 27.223 16.7494H27.254C28.9736 16.7816 29.8943 15.8621 30.3851 15.1575ZM23.7851 10.9195H30.9115C30.9115 10.1828 29.346 8.16093 27.2333 8.16093C25.6023 8.16093 24.3046 9.34598 23.7851 10.9195Z",
|
|
546
809
|
fill: "currentColor"
|
|
547
810
|
}
|
|
548
811
|
),
|
|
549
|
-
/* @__PURE__ */ (0,
|
|
812
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
550
813
|
"path",
|
|
551
814
|
{
|
|
552
815
|
fillRule: "evenodd",
|
|
@@ -555,7 +818,7 @@ var Branding = (0, import_react5.forwardRef)(
|
|
|
555
818
|
fill: "currentColor"
|
|
556
819
|
}
|
|
557
820
|
),
|
|
558
|
-
/* @__PURE__ */ (0,
|
|
821
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
559
822
|
"path",
|
|
560
823
|
{
|
|
561
824
|
fillRule: "evenodd",
|
|
@@ -564,7 +827,7 @@ var Branding = (0, import_react5.forwardRef)(
|
|
|
564
827
|
fill: "currentColor"
|
|
565
828
|
}
|
|
566
829
|
),
|
|
567
|
-
/* @__PURE__ */ (0,
|
|
830
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
568
831
|
"path",
|
|
569
832
|
{
|
|
570
833
|
fillRule: "evenodd",
|
|
@@ -573,7 +836,7 @@ var Branding = (0, import_react5.forwardRef)(
|
|
|
573
836
|
fill: "currentColor"
|
|
574
837
|
}
|
|
575
838
|
),
|
|
576
|
-
/* @__PURE__ */ (0,
|
|
839
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
577
840
|
"path",
|
|
578
841
|
{
|
|
579
842
|
fillRule: "evenodd",
|
|
@@ -582,7 +845,7 @@ var Branding = (0, import_react5.forwardRef)(
|
|
|
582
845
|
fill: "currentColor"
|
|
583
846
|
}
|
|
584
847
|
),
|
|
585
|
-
/* @__PURE__ */ (0,
|
|
848
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
586
849
|
"path",
|
|
587
850
|
{
|
|
588
851
|
fillRule: "evenodd",
|
|
@@ -592,7 +855,7 @@ var Branding = (0, import_react5.forwardRef)(
|
|
|
592
855
|
}
|
|
593
856
|
)
|
|
594
857
|
] }),
|
|
595
|
-
/* @__PURE__ */ (0,
|
|
858
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("clipPath", { id: "clip0_828_998", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("rect", { width: "88.892", height: "20", fill: "currentColor" }) }) })
|
|
596
859
|
]
|
|
597
860
|
}
|
|
598
861
|
)
|
|
@@ -602,171 +865,18 @@ var Branding = (0, import_react5.forwardRef)(
|
|
|
602
865
|
);
|
|
603
866
|
Branding.displayName = "Branding";
|
|
604
867
|
|
|
605
|
-
// src/components/Button/Button.tsx
|
|
606
|
-
var import_react7 = require("react");
|
|
607
|
-
|
|
608
|
-
// src/components/Loading/Loading.tsx
|
|
609
|
-
var import_react6 = require("react");
|
|
610
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
611
|
-
var Loading = (0, import_react6.forwardRef)(
|
|
612
|
-
(_a, ref) => {
|
|
613
|
-
var _b = _a, { size = "sm", isDark = false, className = "" } = _b, rest = __objRest(_b, ["size", "isDark", "className"]);
|
|
614
|
-
const containerClasses = [
|
|
615
|
-
isDark ? "text-white-100" : "text-blue-600",
|
|
616
|
-
className
|
|
617
|
-
].filter(Boolean).join(" ");
|
|
618
|
-
return size === "sm" && !isDark ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
619
|
-
"svg",
|
|
620
|
-
{
|
|
621
|
-
className: "animate-spin",
|
|
622
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
623
|
-
width: "18",
|
|
624
|
-
height: "18",
|
|
625
|
-
viewBox: "0 0 18 18",
|
|
626
|
-
fill: "none",
|
|
627
|
-
children: [
|
|
628
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
629
|
-
"path",
|
|
630
|
-
{
|
|
631
|
-
d: "M1 9C1 6.87827 1.84286 4.84344 3.34315 3.34315C4.84344 1.84285 6.87827 1 9 1C11.1217 1 13.1566 1.84286 14.6569 3.34315C16.1571 4.84344 17 6.87827 17 9C17 11.1217 16.1571 13.1566 14.6569 14.6569C13.1566 16.1571 11.1217 17 9 17C6.87827 17 4.84344 16.1571 3.34315 14.6569C1.84285 13.1566 1 11.1217 1 9L1 9Z",
|
|
632
|
-
stroke: "#F3F4F6",
|
|
633
|
-
strokeWidth: "2"
|
|
634
|
-
}
|
|
635
|
-
),
|
|
636
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
637
|
-
"path",
|
|
638
|
-
{
|
|
639
|
-
d: "M1 9C1 7.31057 1.53484 5.6645 2.52786 4.29772C3.52089 2.93094 4.92112 1.91361 6.52787 1.39155C8.13461 0.869484 9.86539 0.869484 11.4721 1.39155C13.0789 1.91361 14.4791 2.93094 15.4721 4.29772",
|
|
640
|
-
stroke: "#0193D7",
|
|
641
|
-
strokeWidth: "2"
|
|
642
|
-
}
|
|
643
|
-
)
|
|
644
|
-
]
|
|
645
|
-
}
|
|
646
|
-
) })) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
647
|
-
"svg",
|
|
648
|
-
{
|
|
649
|
-
className: "animate-spin",
|
|
650
|
-
width: size === "sm" ? 18 : 88,
|
|
651
|
-
height: size === "sm" ? 18 : 88,
|
|
652
|
-
viewBox: "0 0 20 20",
|
|
653
|
-
fill: "none",
|
|
654
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
655
|
-
"path",
|
|
656
|
-
{
|
|
657
|
-
d: "M10 2.5a7.5 7.5 0 1 0 7.5 7.5",
|
|
658
|
-
stroke: "currentColor",
|
|
659
|
-
strokeWidth: size === "sm" ? 2 : 1,
|
|
660
|
-
strokeLinecap: "round"
|
|
661
|
-
}
|
|
662
|
-
)
|
|
663
|
-
}
|
|
664
|
-
) }));
|
|
665
|
-
}
|
|
666
|
-
);
|
|
667
|
-
Loading.displayName = "Loading";
|
|
668
|
-
|
|
669
|
-
// src/components/Button/Button.tsx
|
|
670
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
671
|
-
var variantClasses = {
|
|
672
|
-
primary: [
|
|
673
|
-
"bg-blue-600 text-white-100",
|
|
674
|
-
"hover:bg-blue-700",
|
|
675
|
-
"active:bg-blue-800",
|
|
676
|
-
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
677
|
-
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
678
|
-
].join(" "),
|
|
679
|
-
secondary: [
|
|
680
|
-
"bg-gray-100 text-gray-900",
|
|
681
|
-
"hover:bg-gray-200",
|
|
682
|
-
"active:bg-gray-300",
|
|
683
|
-
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
684
|
-
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
685
|
-
].join(" "),
|
|
686
|
-
tertiary: [
|
|
687
|
-
"bg-black-0 text-gray-900",
|
|
688
|
-
"hover:bg-gray-200",
|
|
689
|
-
"active:bg-gray-300",
|
|
690
|
-
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
691
|
-
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
692
|
-
].join(" "),
|
|
693
|
-
contrast: [
|
|
694
|
-
"bg-white-100 text-blue-600",
|
|
695
|
-
"hover:bg-white-90",
|
|
696
|
-
"active:bg-white-80",
|
|
697
|
-
"focus-visible:ring-2 focus-visible:ring-white-100 focus-visible:ring-offset-2",
|
|
698
|
-
"disabled:bg-gray-50 disabled:text-gray-400"
|
|
699
|
-
].join(" "),
|
|
700
|
-
transparent: [
|
|
701
|
-
"bg-black-0 text-white-100",
|
|
702
|
-
"hover:bg-white-20",
|
|
703
|
-
"active:bg-white-30",
|
|
704
|
-
"focus-visible:ring-2 focus-visible:ring-white-100 focus-visible:bg-black-0 focus-visible:ring-offset-2",
|
|
705
|
-
"disabled:bg-black-0 disabled:text-white-40"
|
|
706
|
-
].join(" ")
|
|
707
|
-
};
|
|
708
|
-
var sizeClasses3 = {
|
|
709
|
-
sm: "px-16 py-6 text-label-medium",
|
|
710
|
-
md: "px-20 py-8 text-label-large",
|
|
711
|
-
lg: "px-24 py-12 text-label-large",
|
|
712
|
-
xl: "px-32 py-16 text-label-large"
|
|
713
|
-
};
|
|
714
|
-
var Button = (0, import_react7.forwardRef)(
|
|
715
|
-
(_a, ref) => {
|
|
716
|
-
var _b = _a, {
|
|
717
|
-
variant = "primary",
|
|
718
|
-
size = "md",
|
|
719
|
-
rounded = false,
|
|
720
|
-
loading = false,
|
|
721
|
-
disabled = false,
|
|
722
|
-
startIcon,
|
|
723
|
-
endIcon,
|
|
724
|
-
children,
|
|
725
|
-
className = ""
|
|
726
|
-
} = _b, rest = __objRest(_b, [
|
|
727
|
-
"variant",
|
|
728
|
-
"size",
|
|
729
|
-
"rounded",
|
|
730
|
-
"loading",
|
|
731
|
-
"disabled",
|
|
732
|
-
"startIcon",
|
|
733
|
-
"endIcon",
|
|
734
|
-
"children",
|
|
735
|
-
"className"
|
|
736
|
-
]);
|
|
737
|
-
const isDisabled = disabled;
|
|
738
|
-
const classes = [
|
|
739
|
-
"inline-flex items-center justify-center gap-8",
|
|
740
|
-
"transition-colors duration-150",
|
|
741
|
-
"outline-none",
|
|
742
|
-
"disabled:cursor-not-allowed",
|
|
743
|
-
loading ? "pointer-events-none" : "cursor-pointer",
|
|
744
|
-
sizeClasses3[size],
|
|
745
|
-
variantClasses[variant],
|
|
746
|
-
rounded ? "rounded-full" : size === "sm" ? "rounded-6" : size === "xl" ? "rounded-12" : "rounded-8",
|
|
747
|
-
className
|
|
748
|
-
].filter(Boolean).join(" ");
|
|
749
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", __spreadProps(__spreadValues({ ref, disabled: isDisabled, className: classes }, rest), { children: [
|
|
750
|
-
loading ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Loading, { size: "sm", isDark: variant === "primary" || variant === "transparent" }) : startIcon,
|
|
751
|
-
children,
|
|
752
|
-
!loading && endIcon
|
|
753
|
-
] }));
|
|
754
|
-
}
|
|
755
|
-
);
|
|
756
|
-
Button.displayName = "Button";
|
|
757
|
-
|
|
758
868
|
// src/components/Checkbox/Checkbox.tsx
|
|
759
|
-
var
|
|
760
|
-
var
|
|
869
|
+
var import_react9 = require("react");
|
|
870
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
761
871
|
function CheckIcon({ className }) {
|
|
762
|
-
return /* @__PURE__ */ (0,
|
|
872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
763
873
|
"svg",
|
|
764
874
|
{
|
|
765
875
|
className,
|
|
766
876
|
viewBox: "0 0 16 16",
|
|
767
877
|
fill: "none",
|
|
768
878
|
"aria-hidden": "true",
|
|
769
|
-
children: /* @__PURE__ */ (0,
|
|
879
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
770
880
|
"path",
|
|
771
881
|
{
|
|
772
882
|
d: "M13.333 4.667 6 12l-3.333-3.333",
|
|
@@ -780,14 +890,14 @@ function CheckIcon({ className }) {
|
|
|
780
890
|
);
|
|
781
891
|
}
|
|
782
892
|
function IndeterminateIcon({ className }) {
|
|
783
|
-
return /* @__PURE__ */ (0,
|
|
893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
784
894
|
"svg",
|
|
785
895
|
{
|
|
786
896
|
className,
|
|
787
897
|
viewBox: "0 0 16 16",
|
|
788
898
|
fill: "none",
|
|
789
899
|
"aria-hidden": "true",
|
|
790
|
-
children: /* @__PURE__ */ (0,
|
|
900
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
791
901
|
"path",
|
|
792
902
|
{
|
|
793
903
|
d: "M3.333 8h9.334",
|
|
@@ -811,7 +921,7 @@ var descriptionPaddingClasses = {
|
|
|
811
921
|
s: "pl-24",
|
|
812
922
|
m: "pl-28"
|
|
813
923
|
};
|
|
814
|
-
var Checkbox = (0,
|
|
924
|
+
var Checkbox = (0, import_react9.forwardRef)(
|
|
815
925
|
(_a, ref) => {
|
|
816
926
|
var _b = _a, {
|
|
817
927
|
size = "s",
|
|
@@ -840,10 +950,10 @@ var Checkbox = (0, import_react8.forwardRef)(
|
|
|
840
950
|
"defaultChecked",
|
|
841
951
|
"onChange"
|
|
842
952
|
]);
|
|
843
|
-
const reactId = (0,
|
|
953
|
+
const reactId = (0, import_react9.useId)();
|
|
844
954
|
const inputId = id != null ? id : reactId;
|
|
845
955
|
const isControlled = checked !== void 0;
|
|
846
|
-
const [uncontrolledChecked, setUncontrolledChecked] = (0,
|
|
956
|
+
const [uncontrolledChecked, setUncontrolledChecked] = (0, import_react9.useState)(
|
|
847
957
|
defaultChecked != null ? defaultChecked : false
|
|
848
958
|
);
|
|
849
959
|
const isChecked = isControlled ? checked : uncontrolledChecked;
|
|
@@ -877,15 +987,15 @@ var Checkbox = (0, import_react8.forwardRef)(
|
|
|
877
987
|
const ringClass = error ? "peer-focus-visible:outline-checkbox-error-ring" : contrast ? "peer-focus-visible:outline-checkbox-contrast-ring" : "peer-focus-visible:outline-checkbox-ring";
|
|
878
988
|
const labelColorClass = disabled ? "text-checkbox-label-disabled" : contrast ? "text-checkbox-contrast-label" : "text-checkbox-label";
|
|
879
989
|
const descriptionColorClass = disabled ? "text-checkbox-label-disabled" : error ? "text-checkbox-label-error" : contrast ? "text-checkbox-contrast-description" : "text-checkbox-description";
|
|
880
|
-
return /* @__PURE__ */ (0,
|
|
990
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
881
991
|
"label",
|
|
882
992
|
{
|
|
883
993
|
htmlFor: inputId,
|
|
884
994
|
className: `inline-flex select-none flex-col font-sans ${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
885
995
|
children: [
|
|
886
|
-
/* @__PURE__ */ (0,
|
|
887
|
-
/* @__PURE__ */ (0,
|
|
888
|
-
/* @__PURE__ */ (0,
|
|
996
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
997
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative shrink-0", children: [
|
|
998
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
889
999
|
"input",
|
|
890
1000
|
__spreadValues({
|
|
891
1001
|
ref,
|
|
@@ -902,16 +1012,16 @@ var Checkbox = (0, import_react8.forwardRef)(
|
|
|
902
1012
|
className: "peer sr-only"
|
|
903
1013
|
}, rest)
|
|
904
1014
|
),
|
|
905
|
-
/* @__PURE__ */ (0,
|
|
1015
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
906
1016
|
"div",
|
|
907
1017
|
{
|
|
908
1018
|
className: `flex items-center justify-center rounded-md border transition-colors ${boxSizeClasses[size]} ${bgClass} ${borderClass} ${hoverClass} ${ringClass} peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2`,
|
|
909
|
-
children: isChecked ? /* @__PURE__ */ (0,
|
|
1019
|
+
children: isChecked ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
910
1020
|
CheckIcon,
|
|
911
1021
|
{
|
|
912
1022
|
className: `${boxSizeClasses[size]} ${iconColorClass}`
|
|
913
1023
|
}
|
|
914
|
-
) : indeterminate ? /* @__PURE__ */ (0,
|
|
1024
|
+
) : indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
915
1025
|
IndeterminateIcon,
|
|
916
1026
|
{
|
|
917
1027
|
className: `${boxSizeClasses[size]} ${iconColorClass}`
|
|
@@ -920,9 +1030,9 @@ var Checkbox = (0, import_react8.forwardRef)(
|
|
|
920
1030
|
}
|
|
921
1031
|
)
|
|
922
1032
|
] }),
|
|
923
|
-
label && /* @__PURE__ */ (0,
|
|
1033
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: `${labelTextClasses[size]} ${labelColorClass}`, children: label })
|
|
924
1034
|
] }),
|
|
925
|
-
description && /* @__PURE__ */ (0,
|
|
1035
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
926
1036
|
"span",
|
|
927
1037
|
{
|
|
928
1038
|
className: `text-body-small ${descriptionPaddingClasses[size]} ${descriptionColorClass}`,
|
|
@@ -937,9 +1047,9 @@ var Checkbox = (0, import_react8.forwardRef)(
|
|
|
937
1047
|
Checkbox.displayName = "Checkbox";
|
|
938
1048
|
|
|
939
1049
|
// src/components/Chip/Chip.tsx
|
|
940
|
-
var
|
|
941
|
-
var
|
|
942
|
-
var
|
|
1050
|
+
var import_react10 = require("react");
|
|
1051
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1052
|
+
var sizeClasses5 = {
|
|
943
1053
|
sm: "h-32 text-label-medium px-12 py-6",
|
|
944
1054
|
md: "h-40 text-label-large px-16 py-10",
|
|
945
1055
|
lg: "h-48 text-label-large px-24 py-14"
|
|
@@ -957,7 +1067,7 @@ var isDarkClasses = {
|
|
|
957
1067
|
true: "!bg-chip-background-black-active !text-chip-text-inverse",
|
|
958
1068
|
false: "!bg-chip-background-active !text-chip-text-inverse"
|
|
959
1069
|
};
|
|
960
|
-
var Chip = (0,
|
|
1070
|
+
var Chip = (0, import_react10.forwardRef)(
|
|
961
1071
|
(_a, ref) => {
|
|
962
1072
|
var _b = _a, {
|
|
963
1073
|
size = "md",
|
|
@@ -982,7 +1092,7 @@ var Chip = (0, import_react9.forwardRef)(
|
|
|
982
1092
|
"disabled",
|
|
983
1093
|
"className"
|
|
984
1094
|
]);
|
|
985
|
-
const sz =
|
|
1095
|
+
const sz = sizeClasses5[size];
|
|
986
1096
|
const outlinedClass = isOutlinedClasses[String(isOutlined)];
|
|
987
1097
|
const darkClass = isDarkClasses[String(isDark)];
|
|
988
1098
|
const containerClasses = [
|
|
@@ -993,14 +1103,14 @@ var Chip = (0, import_react9.forwardRef)(
|
|
|
993
1103
|
className,
|
|
994
1104
|
isSelected ? darkClass : ""
|
|
995
1105
|
].filter(Boolean).join(" ");
|
|
996
|
-
return /* @__PURE__ */ (0,
|
|
1106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
997
1107
|
"div",
|
|
998
1108
|
__spreadProps(__spreadValues({
|
|
999
1109
|
ref,
|
|
1000
1110
|
className: containerClasses
|
|
1001
1111
|
}, rest), {
|
|
1002
1112
|
children: [
|
|
1003
|
-
icon ? icon : src && /* @__PURE__ */ (0,
|
|
1113
|
+
icon ? icon : src && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("img", { src, alt, className: `${marginImgClasses[size]} rounded-full` }),
|
|
1004
1114
|
label
|
|
1005
1115
|
]
|
|
1006
1116
|
})
|
|
@@ -1009,52 +1119,332 @@ var Chip = (0, import_react9.forwardRef)(
|
|
|
1009
1119
|
);
|
|
1010
1120
|
Chip.displayName = "Chip";
|
|
1011
1121
|
|
|
1012
|
-
// src/components/
|
|
1122
|
+
// src/components/CurrencyField/CurrencyField.tsx
|
|
1123
|
+
var import_react12 = require("react");
|
|
1124
|
+
|
|
1125
|
+
// src/components/TextField/TextField.tsx
|
|
1013
1126
|
var import_react11 = require("react");
|
|
1014
|
-
var
|
|
1127
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1128
|
+
var TextField = (0, import_react11.forwardRef)(
|
|
1129
|
+
(_a, ref) => {
|
|
1130
|
+
var _b = _a, {
|
|
1131
|
+
size = "md",
|
|
1132
|
+
error,
|
|
1133
|
+
label,
|
|
1134
|
+
placeholder,
|
|
1135
|
+
helperText,
|
|
1136
|
+
prefix,
|
|
1137
|
+
suffix,
|
|
1138
|
+
optional = false,
|
|
1139
|
+
success = false,
|
|
1140
|
+
pending = false,
|
|
1141
|
+
clearable = true,
|
|
1142
|
+
disabled = false,
|
|
1143
|
+
type,
|
|
1144
|
+
value,
|
|
1145
|
+
onChange,
|
|
1146
|
+
onFocus,
|
|
1147
|
+
onBlur,
|
|
1148
|
+
className
|
|
1149
|
+
} = _b, props = __objRest(_b, [
|
|
1150
|
+
"size",
|
|
1151
|
+
"error",
|
|
1152
|
+
"label",
|
|
1153
|
+
"placeholder",
|
|
1154
|
+
"helperText",
|
|
1155
|
+
"prefix",
|
|
1156
|
+
"suffix",
|
|
1157
|
+
"optional",
|
|
1158
|
+
"success",
|
|
1159
|
+
"pending",
|
|
1160
|
+
"clearable",
|
|
1161
|
+
"disabled",
|
|
1162
|
+
"type",
|
|
1163
|
+
"value",
|
|
1164
|
+
"onChange",
|
|
1165
|
+
"onFocus",
|
|
1166
|
+
"onBlur",
|
|
1167
|
+
"className"
|
|
1168
|
+
]);
|
|
1169
|
+
const [isFocused, setIsFocused] = (0, import_react11.useState)(false);
|
|
1170
|
+
const isActive = isFocused && !!value;
|
|
1171
|
+
const iconButtonSize = size === "lg" ? "m" : "s";
|
|
1172
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
1173
|
+
(0, import_react11.useImperativeHandle)(ref, () => inputRef.current);
|
|
1174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
1175
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1176
|
+
"p",
|
|
1177
|
+
{
|
|
1178
|
+
className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`,
|
|
1179
|
+
children: [
|
|
1180
|
+
label,
|
|
1181
|
+
optional && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-text-field-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
1182
|
+
]
|
|
1183
|
+
}
|
|
1184
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, {}),
|
|
1185
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1186
|
+
"div",
|
|
1187
|
+
{
|
|
1188
|
+
className: `flex items-center gap-8 w-full rounded-6 border ${size === "lg" ? "h-48 py-16" : "h-40 py-12"} px-16 ${disabled ? "cursor-not-allowed" : "cursor-text"} ${disabled ? "bg-text-field-background-disabled border-text-field-border-disabled" : error ? `bg-text-field-background-enabled border-text-field-border-danger ${isFocused ? "ring-1 ring-inset ring-text-field-border-danger" : ""}` : isActive ? "bg-text-field-background-enabled border-text-field-border-active ring-1 ring-inset ring-text-field-border-active" : isFocused ? "bg-text-field-background-enabled border-text-field-border-focus ring-1 ring-inset ring-text-field-border-focus" : "bg-text-field-background-enabled border-text-field-border-enabled hover:border-text-field-border-hover"} ${className != null ? className : ""}`,
|
|
1189
|
+
onMouseDown: (e) => {
|
|
1190
|
+
var _a2;
|
|
1191
|
+
if (e.target !== inputRef.current && !disabled) {
|
|
1192
|
+
e.preventDefault();
|
|
1193
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
1194
|
+
}
|
|
1195
|
+
},
|
|
1196
|
+
children: [
|
|
1197
|
+
prefix && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1198
|
+
"span",
|
|
1199
|
+
{
|
|
1200
|
+
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
1201
|
+
children: prefix
|
|
1202
|
+
}
|
|
1203
|
+
),
|
|
1204
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1205
|
+
"input",
|
|
1206
|
+
__spreadValues({
|
|
1207
|
+
ref: inputRef,
|
|
1208
|
+
type: type || "text",
|
|
1209
|
+
placeholder,
|
|
1210
|
+
disabled: disabled || pending,
|
|
1211
|
+
onFocus: (e) => {
|
|
1212
|
+
setIsFocused(true);
|
|
1213
|
+
onFocus == null ? void 0 : onFocus(e);
|
|
1214
|
+
},
|
|
1215
|
+
onBlur: (e) => {
|
|
1216
|
+
setIsFocused(false);
|
|
1217
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
1218
|
+
},
|
|
1219
|
+
value,
|
|
1220
|
+
onChange,
|
|
1221
|
+
className: `w-full min-w-0 text-body-small bg-transparent focus:outline-none placeholder:text-text-field-text-tertiary ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`
|
|
1222
|
+
}, props)
|
|
1223
|
+
),
|
|
1224
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1225
|
+
"span",
|
|
1226
|
+
{
|
|
1227
|
+
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
1228
|
+
children: suffix
|
|
1229
|
+
}
|
|
1230
|
+
),
|
|
1231
|
+
(pending || clearable || success || error) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1232
|
+
"span",
|
|
1233
|
+
{
|
|
1234
|
+
className: `shrink-0 flex items-center justify-center ${size === "lg" ? "h-40 w-40" : "h-32 w-32"}`,
|
|
1235
|
+
children: pending ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Loading, { size: "sm" }) : clearable && isFocused && value ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1236
|
+
IconButton,
|
|
1237
|
+
{
|
|
1238
|
+
size: iconButtonSize,
|
|
1239
|
+
transparent: true,
|
|
1240
|
+
"aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
1241
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1242
|
+
"svg",
|
|
1243
|
+
{
|
|
1244
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1245
|
+
width: "20",
|
|
1246
|
+
height: "20",
|
|
1247
|
+
viewBox: "0 0 20 20",
|
|
1248
|
+
fill: "none",
|
|
1249
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1250
|
+
"path",
|
|
1251
|
+
{
|
|
1252
|
+
d: "M14.7119 6.0625L10.7744 10L14.7119 13.9375L13.9375 14.7119L10 10.7744L6.0625 14.7119L5.28809 13.9375L9.22559 10L5.28809 6.0625L6.0625 5.28809L10 9.22559L13.9375 5.28809L14.7119 6.0625Z",
|
|
1253
|
+
fill: "currentColor"
|
|
1254
|
+
}
|
|
1255
|
+
)
|
|
1256
|
+
}
|
|
1257
|
+
),
|
|
1258
|
+
onMouseDown: (e) => {
|
|
1259
|
+
e.preventDefault();
|
|
1260
|
+
},
|
|
1261
|
+
onClick: () => {
|
|
1262
|
+
onChange == null ? void 0 : onChange({
|
|
1263
|
+
target: { value: "" }
|
|
1264
|
+
});
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
) : success ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1268
|
+
"svg",
|
|
1269
|
+
{
|
|
1270
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1271
|
+
width: "20",
|
|
1272
|
+
height: "20",
|
|
1273
|
+
viewBox: "0 0 20 20",
|
|
1274
|
+
fill: "none",
|
|
1275
|
+
className: "text-accent-success flex h-20 w-20 items-center justify-center",
|
|
1276
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1277
|
+
"path",
|
|
1278
|
+
{
|
|
1279
|
+
fillRule: "evenodd",
|
|
1280
|
+
clipRule: "evenodd",
|
|
1281
|
+
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
1282
|
+
fill: "currentColor"
|
|
1283
|
+
}
|
|
1284
|
+
)
|
|
1285
|
+
}
|
|
1286
|
+
) : error ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1287
|
+
"svg",
|
|
1288
|
+
{
|
|
1289
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1290
|
+
width: "20",
|
|
1291
|
+
height: "20",
|
|
1292
|
+
viewBox: "0 0 20 20",
|
|
1293
|
+
fill: "none",
|
|
1294
|
+
className: "text-text-field-text-danger flex h-20 w-20 items-center justify-center",
|
|
1295
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1296
|
+
"path",
|
|
1297
|
+
{
|
|
1298
|
+
d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
|
|
1299
|
+
fill: "currentColor"
|
|
1300
|
+
}
|
|
1301
|
+
)
|
|
1302
|
+
}
|
|
1303
|
+
) : null
|
|
1304
|
+
}
|
|
1305
|
+
)
|
|
1306
|
+
]
|
|
1307
|
+
}
|
|
1308
|
+
),
|
|
1309
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-caption-caption text-left items-left text-text-field-text-danger", children: error }) : helperText ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1310
|
+
"p",
|
|
1311
|
+
{
|
|
1312
|
+
className: `text-caption-caption text-left items-left ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-secondary"}`,
|
|
1313
|
+
children: helperText
|
|
1314
|
+
}
|
|
1315
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, {})
|
|
1316
|
+
] });
|
|
1317
|
+
}
|
|
1318
|
+
);
|
|
1319
|
+
TextField.displayName = "TextField";
|
|
1015
1320
|
|
|
1016
|
-
// src/components/
|
|
1017
|
-
var
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
m: "h-20 w-20",
|
|
1029
|
-
l: "h-24 w-24"
|
|
1030
|
-
};
|
|
1031
|
-
var IconButton = (0, import_react10.forwardRef)(
|
|
1321
|
+
// src/components/CurrencyField/CurrencyField.tsx
|
|
1322
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1323
|
+
function toDigits(value) {
|
|
1324
|
+
if (value === void 0 || Number.isNaN(value)) return "";
|
|
1325
|
+
return String(Math.trunc(value)).replace(/[^\d]/g, "");
|
|
1326
|
+
}
|
|
1327
|
+
function formatDigits(digits) {
|
|
1328
|
+
if (!digits) return "";
|
|
1329
|
+
const normalized = digits.replace(/^0+(?=\d)/, "");
|
|
1330
|
+
return Number(normalized).toLocaleString("en-US");
|
|
1331
|
+
}
|
|
1332
|
+
var CurrencyField = (0, import_react12.forwardRef)(
|
|
1032
1333
|
(_a, ref) => {
|
|
1033
|
-
var _b = _a, {
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1334
|
+
var _b = _a, {
|
|
1335
|
+
value,
|
|
1336
|
+
onChange,
|
|
1337
|
+
min,
|
|
1338
|
+
minErrorText,
|
|
1339
|
+
max,
|
|
1340
|
+
maxErrorText,
|
|
1341
|
+
currencyIcon,
|
|
1342
|
+
error,
|
|
1343
|
+
onBlur,
|
|
1039
1344
|
className
|
|
1040
|
-
|
|
1041
|
-
|
|
1345
|
+
} = _b, props = __objRest(_b, [
|
|
1346
|
+
"value",
|
|
1347
|
+
"onChange",
|
|
1348
|
+
"min",
|
|
1349
|
+
"minErrorText",
|
|
1350
|
+
"max",
|
|
1351
|
+
"maxErrorText",
|
|
1352
|
+
"currencyIcon",
|
|
1353
|
+
"error",
|
|
1354
|
+
"onBlur",
|
|
1355
|
+
"className"
|
|
1356
|
+
]);
|
|
1357
|
+
const inputRef = (0, import_react12.useRef)(null);
|
|
1358
|
+
(0, import_react12.useImperativeHandle)(ref, () => inputRef.current);
|
|
1359
|
+
const [displayValue, setDisplayValue] = (0, import_react12.useState)(
|
|
1360
|
+
() => formatDigits(toDigits(value))
|
|
1361
|
+
);
|
|
1362
|
+
const [touched, setTouched] = (0, import_react12.useState)(false);
|
|
1363
|
+
const pendingCursorRef = (0, import_react12.useRef)(null);
|
|
1364
|
+
(0, import_react12.useEffect)(() => {
|
|
1365
|
+
const externalDigits = toDigits(value);
|
|
1366
|
+
const currentDigits = displayValue.replace(/[^\d]/g, "");
|
|
1367
|
+
if (externalDigits !== currentDigits) {
|
|
1368
|
+
setDisplayValue(formatDigits(externalDigits));
|
|
1369
|
+
}
|
|
1370
|
+
}, [value]);
|
|
1371
|
+
(0, import_react12.useLayoutEffect)(() => {
|
|
1372
|
+
if (pendingCursorRef.current !== null && inputRef.current) {
|
|
1373
|
+
inputRef.current.setSelectionRange(
|
|
1374
|
+
pendingCursorRef.current,
|
|
1375
|
+
pendingCursorRef.current
|
|
1376
|
+
);
|
|
1377
|
+
pendingCursorRef.current = null;
|
|
1378
|
+
}
|
|
1379
|
+
}, [displayValue]);
|
|
1380
|
+
const handleChange = (event) => {
|
|
1381
|
+
var _a2;
|
|
1382
|
+
const input = event.target;
|
|
1383
|
+
const raw = input.value;
|
|
1384
|
+
const cursorPos = (_a2 = input.selectionStart) != null ? _a2 : raw.length;
|
|
1385
|
+
const digitsBeforeCursor = raw.slice(0, cursorPos).replace(/[^\d]/g, "").length;
|
|
1386
|
+
const digits2 = raw.replace(/[^\d]/g, "");
|
|
1387
|
+
const formatted = formatDigits(digits2);
|
|
1388
|
+
let newCursor = formatted.length;
|
|
1389
|
+
if (digitsBeforeCursor === 0) {
|
|
1390
|
+
newCursor = 0;
|
|
1391
|
+
} else {
|
|
1392
|
+
let count = 0;
|
|
1393
|
+
for (let i = 0; i < formatted.length; i += 1) {
|
|
1394
|
+
if (/\d/.test(formatted[i])) {
|
|
1395
|
+
count += 1;
|
|
1396
|
+
if (count === digitsBeforeCursor) {
|
|
1397
|
+
newCursor = i + 1;
|
|
1398
|
+
break;
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
pendingCursorRef.current = newCursor;
|
|
1404
|
+
setDisplayValue(formatted);
|
|
1405
|
+
const normalized = digits2.replace(/^0+(?=\d)/, "");
|
|
1406
|
+
onChange == null ? void 0 : onChange(normalized === "" ? void 0 : Number(normalized));
|
|
1407
|
+
};
|
|
1408
|
+
const digits = displayValue.replace(/[^\d]/g, "");
|
|
1409
|
+
const numericValue = digits === "" ? void 0 : Number(digits);
|
|
1410
|
+
const belowMin = touched && min !== void 0 && numericValue !== void 0 && numericValue < min;
|
|
1411
|
+
const aboveMax = touched && max !== void 0 && numericValue !== void 0 && numericValue > max;
|
|
1412
|
+
const computedError = error != null ? error : belowMin ? minErrorText != null ? minErrorText : `\u0E08\u0E33\u0E19\u0E27\u0E19\u0E40\u0E07\u0E34\u0E19\u0E02\u0E31\u0E49\u0E19\u0E15\u0E48\u0E33\u0E04\u0E37\u0E2D ${min.toLocaleString("en-US")} \u0E1A\u0E32\u0E17` : aboveMax ? maxErrorText != null ? maxErrorText : `\u0E08\u0E33\u0E19\u0E27\u0E19\u0E40\u0E07\u0E34\u0E19\u0E2A\u0E39\u0E07\u0E2A\u0E38\u0E14\u0E04\u0E37\u0E2D ${max.toLocaleString("en-US")} \u0E1A\u0E32\u0E17` : void 0;
|
|
1413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1414
|
+
TextField,
|
|
1415
|
+
__spreadValues({
|
|
1416
|
+
ref: inputRef,
|
|
1417
|
+
type: "text",
|
|
1418
|
+
inputMode: "tel",
|
|
1419
|
+
prefix: currencyIcon != null ? currencyIcon : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-body-small", children: "\u0E3F" }),
|
|
1420
|
+
value: displayValue,
|
|
1421
|
+
onChange: handleChange,
|
|
1422
|
+
onBlur: (event) => {
|
|
1423
|
+
setTouched(true);
|
|
1424
|
+
onBlur == null ? void 0 : onBlur(event);
|
|
1425
|
+
},
|
|
1426
|
+
error: computedError,
|
|
1427
|
+
className: `[&>input]:relative [&>input]:top-1 ${className != null ? className : ""}`
|
|
1428
|
+
}, props)
|
|
1429
|
+
);
|
|
1042
1430
|
}
|
|
1043
1431
|
);
|
|
1044
|
-
|
|
1432
|
+
CurrencyField.displayName = "CurrencyField";
|
|
1045
1433
|
|
|
1046
1434
|
// src/components/Dialog/Dialog.tsx
|
|
1047
|
-
var
|
|
1435
|
+
var import_react13 = require("react");
|
|
1436
|
+
var import_react_dom = require("react-dom");
|
|
1437
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1048
1438
|
function CloseIcon2({ className }) {
|
|
1049
|
-
return /* @__PURE__ */ (0,
|
|
1439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1050
1440
|
}
|
|
1051
1441
|
function WarningIcon2({ className }) {
|
|
1052
|
-
return /* @__PURE__ */ (0,
|
|
1442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M1 21h22L12 2 1 21Zm12-3h-2v-2h2v2Zm0-4h-2v-4h2v4Z" }) });
|
|
1053
1443
|
}
|
|
1054
1444
|
function useMountTransition(open, duration = 300) {
|
|
1055
|
-
const [mounted, setMounted] = (0,
|
|
1056
|
-
const [animate, setAnimate] = (0,
|
|
1057
|
-
(0,
|
|
1445
|
+
const [mounted, setMounted] = (0, import_react13.useState)(open);
|
|
1446
|
+
const [animate, setAnimate] = (0, import_react13.useState)(open);
|
|
1447
|
+
(0, import_react13.useEffect)(() => {
|
|
1058
1448
|
if (open) {
|
|
1059
1449
|
setMounted(true);
|
|
1060
1450
|
let raf2 = 0;
|
|
@@ -1079,9 +1469,9 @@ function DialogAction({
|
|
|
1079
1469
|
}) {
|
|
1080
1470
|
if (!action) return null;
|
|
1081
1471
|
const _a = action, { label, className = "" } = _a, rest = __objRest(_a, ["label", "className"]);
|
|
1082
|
-
return /* @__PURE__ */ (0,
|
|
1472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Button, __spreadProps(__spreadValues({ variant, size: "lg", className: `w-full lg:w-auto ${orderClass} ${className}` }, rest), { children: label }));
|
|
1083
1473
|
}
|
|
1084
|
-
var Dialog = (0,
|
|
1474
|
+
var Dialog = (0, import_react13.forwardRef)(
|
|
1085
1475
|
(_a, ref) => {
|
|
1086
1476
|
var _b = _a, {
|
|
1087
1477
|
open,
|
|
@@ -1115,7 +1505,7 @@ var Dialog = (0, import_react11.forwardRef)(
|
|
|
1115
1505
|
"className"
|
|
1116
1506
|
]);
|
|
1117
1507
|
const { mounted, animate } = useMountTransition(open);
|
|
1118
|
-
(0,
|
|
1508
|
+
(0, import_react13.useEffect)(() => {
|
|
1119
1509
|
if (!open || !closable) return;
|
|
1120
1510
|
const handleKeyDown = (e) => {
|
|
1121
1511
|
if (e.key === "Escape") onOpenChange == null ? void 0 : onOpenChange(false);
|
|
@@ -1135,7 +1525,7 @@ var Dialog = (0, import_react11.forwardRef)(
|
|
|
1135
1525
|
const mobileTransition = display === "centered" ? animate ? "scale-100 opacity-100" : "scale-95 opacity-0" : animate ? "translate-y-0" : "translate-y-full";
|
|
1136
1526
|
const desktopTransition = animate ? "lg:scale-100 lg:opacity-100 lg:translate-y-0" : "lg:scale-95 lg:opacity-0 lg:translate-y-0";
|
|
1137
1527
|
return (0, import_react_dom.createPortal)(
|
|
1138
|
-
/* @__PURE__ */ (0,
|
|
1528
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1139
1529
|
"div",
|
|
1140
1530
|
{
|
|
1141
1531
|
className: [
|
|
@@ -1150,7 +1540,7 @@ var Dialog = (0, import_react11.forwardRef)(
|
|
|
1150
1540
|
].filter(Boolean).join(" "),
|
|
1151
1541
|
role: "presentation",
|
|
1152
1542
|
onMouseDown: handleBackdropMouseDown,
|
|
1153
|
-
children: /* @__PURE__ */ (0,
|
|
1543
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1154
1544
|
"div",
|
|
1155
1545
|
__spreadProps(__spreadValues({
|
|
1156
1546
|
ref,
|
|
@@ -1170,53 +1560,53 @@ var Dialog = (0, import_react11.forwardRef)(
|
|
|
1170
1560
|
onMouseDown: (e) => e.stopPropagation()
|
|
1171
1561
|
}, rest), {
|
|
1172
1562
|
children: [
|
|
1173
|
-
artwork ? /* @__PURE__ */ (0,
|
|
1174
|
-
closable && /* @__PURE__ */ (0,
|
|
1563
|
+
artwork ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative shrink-0 bg-background-tertiary", children: [
|
|
1564
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "absolute right-24 top-20", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1175
1565
|
IconButton,
|
|
1176
1566
|
{
|
|
1177
|
-
icon: /* @__PURE__ */ (0,
|
|
1567
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CloseIcon2, { className: "h-24 w-24" }),
|
|
1178
1568
|
size: "m",
|
|
1569
|
+
surface: "dark",
|
|
1179
1570
|
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1180
|
-
onClick: handleClose
|
|
1181
|
-
className: "bg-icon-button-background-dark-transparent-enabled hover:bg-icon-button-background-dark-transparent-hover active:bg-icon-button-background-dark-transparent-active text-icon-button-icon-inverse!"
|
|
1571
|
+
onClick: handleClose
|
|
1182
1572
|
}
|
|
1183
1573
|
) }),
|
|
1184
1574
|
artwork
|
|
1185
1575
|
] }) : null,
|
|
1186
|
-
showHeader && /* @__PURE__ */ (0,
|
|
1187
|
-
/* @__PURE__ */ (0,
|
|
1188
|
-
warning && /* @__PURE__ */ (0,
|
|
1189
|
-
/* @__PURE__ */ (0,
|
|
1190
|
-
title && /* @__PURE__ */ (0,
|
|
1191
|
-
subtitle && !artwork && /* @__PURE__ */ (0,
|
|
1576
|
+
showHeader && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex shrink-0 items-center gap-8 bg-dialog-background-primary px-16 pb-12 pt-16 lg:px-24 lg:pb-12 lg:pt-20", children: [
|
|
1577
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex min-w-0 flex-1 items-start gap-8", children: [
|
|
1578
|
+
warning && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "flex shrink-0 items-center pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(WarningIcon2, { className: "h-20 w-20 text-dialog-icon-warning lg:h-24 lg:w-24" }) }),
|
|
1579
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
1580
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-heading-3 text-dialog-text-primary lg:text-heading-3-md", children: title }),
|
|
1581
|
+
subtitle && !artwork && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-body-small text-dialog-text-secondary", children: subtitle })
|
|
1192
1582
|
] })
|
|
1193
1583
|
] }),
|
|
1194
|
-
closable && !artwork && /* @__PURE__ */ (0,
|
|
1195
|
-
/* @__PURE__ */ (0,
|
|
1584
|
+
closable && !artwork && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1585
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1196
1586
|
IconButton,
|
|
1197
1587
|
{
|
|
1198
|
-
icon: /* @__PURE__ */ (0,
|
|
1588
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CloseIcon2, { className: "h-20 w-20" }),
|
|
1199
1589
|
size: "s",
|
|
1200
1590
|
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1201
1591
|
onClick: handleClose,
|
|
1202
|
-
className: "
|
|
1592
|
+
className: "lg:hidden!"
|
|
1203
1593
|
}
|
|
1204
1594
|
),
|
|
1205
|
-
/* @__PURE__ */ (0,
|
|
1595
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1206
1596
|
IconButton,
|
|
1207
1597
|
{
|
|
1208
|
-
icon: /* @__PURE__ */ (0,
|
|
1598
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CloseIcon2, { className: "h-24 w-24" }),
|
|
1209
1599
|
size: "m",
|
|
1210
1600
|
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1211
1601
|
onClick: handleClose,
|
|
1212
|
-
className: "hidden!
|
|
1602
|
+
className: "hidden! lg:inline-flex!"
|
|
1213
1603
|
}
|
|
1214
1604
|
)
|
|
1215
1605
|
] })
|
|
1216
1606
|
] }),
|
|
1217
|
-
/* @__PURE__ */ (0,
|
|
1218
|
-
showFooter && /* @__PURE__ */ (0,
|
|
1219
|
-
/* @__PURE__ */ (0,
|
|
1607
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex-1 overflow-y-auto bg-dialog-background-primary px-16 py-12 text-body-small text-dialog-text-primary lg:px-24 lg:text-body-regular", children }),
|
|
1608
|
+
showFooter && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex shrink-0 flex-col gap-8 bg-dialog-background-primary px-16 pb-16 pt-12 lg:flex-row lg:items-center lg:justify-end lg:px-24 lg:pb-24", children: [
|
|
1609
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1220
1610
|
DialogAction,
|
|
1221
1611
|
{
|
|
1222
1612
|
action: dismiss,
|
|
@@ -1224,8 +1614,8 @@ var Dialog = (0, import_react11.forwardRef)(
|
|
|
1224
1614
|
orderClass: `order-3 lg:order-1 ${splitDismissLeft ? "lg:mr-auto" : ""}`
|
|
1225
1615
|
}
|
|
1226
1616
|
),
|
|
1227
|
-
/* @__PURE__ */ (0,
|
|
1228
|
-
/* @__PURE__ */ (0,
|
|
1617
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogAction, { action: secondary, variant: "secondary", orderClass: "order-1 lg:order-2" }),
|
|
1618
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogAction, { action: confirm, variant: "primary", orderClass: "order-2 lg:order-3" })
|
|
1229
1619
|
] })
|
|
1230
1620
|
]
|
|
1231
1621
|
})
|
|
@@ -1239,16 +1629,16 @@ var Dialog = (0, import_react11.forwardRef)(
|
|
|
1239
1629
|
Dialog.displayName = "Dialog";
|
|
1240
1630
|
|
|
1241
1631
|
// src/components/Drawer/Drawer.tsx
|
|
1242
|
-
var
|
|
1632
|
+
var import_react14 = require("react");
|
|
1243
1633
|
var import_react_dom2 = require("react-dom");
|
|
1244
|
-
var
|
|
1634
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1245
1635
|
function CloseIcon3({ className }) {
|
|
1246
|
-
return /* @__PURE__ */ (0,
|
|
1636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1247
1637
|
}
|
|
1248
1638
|
function useMountTransition2(open, duration = 300) {
|
|
1249
|
-
const [mounted, setMounted] = (0,
|
|
1250
|
-
const [animate, setAnimate] = (0,
|
|
1251
|
-
(0,
|
|
1639
|
+
const [mounted, setMounted] = (0, import_react14.useState)(open);
|
|
1640
|
+
const [animate, setAnimate] = (0, import_react14.useState)(open);
|
|
1641
|
+
(0, import_react14.useEffect)(() => {
|
|
1252
1642
|
if (open) {
|
|
1253
1643
|
setMounted(true);
|
|
1254
1644
|
let raf2 = 0;
|
|
@@ -1273,7 +1663,7 @@ function DrawerAction({
|
|
|
1273
1663
|
}) {
|
|
1274
1664
|
if (!action) return null;
|
|
1275
1665
|
const _a = action, { label, className = "" } = _a, rest = __objRest(_a, ["label", "className"]);
|
|
1276
|
-
return /* @__PURE__ */ (0,
|
|
1666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1277
1667
|
Button,
|
|
1278
1668
|
__spreadProps(__spreadValues({
|
|
1279
1669
|
variant,
|
|
@@ -1284,7 +1674,7 @@ function DrawerAction({
|
|
|
1284
1674
|
})
|
|
1285
1675
|
);
|
|
1286
1676
|
}
|
|
1287
|
-
var Drawer = (0,
|
|
1677
|
+
var Drawer = (0, import_react14.forwardRef)(
|
|
1288
1678
|
(_a, ref) => {
|
|
1289
1679
|
var _b = _a, {
|
|
1290
1680
|
open,
|
|
@@ -1318,7 +1708,7 @@ var Drawer = (0, import_react12.forwardRef)(
|
|
|
1318
1708
|
"className"
|
|
1319
1709
|
]);
|
|
1320
1710
|
const { mounted, animate } = useMountTransition2(open);
|
|
1321
|
-
(0,
|
|
1711
|
+
(0, import_react14.useEffect)(() => {
|
|
1322
1712
|
if (!open || !closable) return;
|
|
1323
1713
|
const handleKeyDown = (e) => {
|
|
1324
1714
|
if (e.key === "Escape") onOpenChange == null ? void 0 : onOpenChange(false);
|
|
@@ -1335,7 +1725,7 @@ var Drawer = (0, import_react12.forwardRef)(
|
|
|
1335
1725
|
const showFooter = Boolean(dismiss || secondary || confirm);
|
|
1336
1726
|
const allActions = Boolean(dismiss && secondary && confirm);
|
|
1337
1727
|
return (0, import_react_dom2.createPortal)(
|
|
1338
|
-
/* @__PURE__ */ (0,
|
|
1728
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1339
1729
|
"div",
|
|
1340
1730
|
{
|
|
1341
1731
|
className: [
|
|
@@ -1346,7 +1736,7 @@ var Drawer = (0, import_react12.forwardRef)(
|
|
|
1346
1736
|
].filter(Boolean).join(" "),
|
|
1347
1737
|
role: "presentation",
|
|
1348
1738
|
onMouseDown: handleBackdropMouseDown,
|
|
1349
|
-
children: /* @__PURE__ */ (0,
|
|
1739
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1350
1740
|
"div",
|
|
1351
1741
|
__spreadProps(__spreadValues({
|
|
1352
1742
|
ref,
|
|
@@ -1366,7 +1756,7 @@ var Drawer = (0, import_react12.forwardRef)(
|
|
|
1366
1756
|
onMouseDown: (e) => e.stopPropagation()
|
|
1367
1757
|
}, rest), {
|
|
1368
1758
|
children: [
|
|
1369
|
-
showHeader && /* @__PURE__ */ (0,
|
|
1759
|
+
showHeader && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1370
1760
|
"div",
|
|
1371
1761
|
{
|
|
1372
1762
|
className: [
|
|
@@ -1374,36 +1764,36 @@ var Drawer = (0, import_react12.forwardRef)(
|
|
|
1374
1764
|
fullScreen ? "lg:gap-16 lg:px-112 lg:py-24" : "lg:px-24 lg:pb-16 lg:pt-20"
|
|
1375
1765
|
].join(" "),
|
|
1376
1766
|
children: [
|
|
1377
|
-
/* @__PURE__ */ (0,
|
|
1378
|
-
title && /* @__PURE__ */ (0,
|
|
1379
|
-
subtitle && /* @__PURE__ */ (0,
|
|
1767
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
1768
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-heading-3 text-dialog-text-primary lg:text-heading-3-md", children: title }),
|
|
1769
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-body-small text-dialog-text-secondary", children: subtitle })
|
|
1380
1770
|
] }),
|
|
1381
|
-
closable && /* @__PURE__ */ (0,
|
|
1382
|
-
/* @__PURE__ */ (0,
|
|
1771
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1772
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1383
1773
|
IconButton,
|
|
1384
1774
|
{
|
|
1385
|
-
icon: /* @__PURE__ */ (0,
|
|
1775
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CloseIcon3, { className: "h-20 w-20" }),
|
|
1386
1776
|
size: "s",
|
|
1387
1777
|
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1388
1778
|
onClick: handleClose,
|
|
1389
|
-
className: "
|
|
1779
|
+
className: "lg:hidden!"
|
|
1390
1780
|
}
|
|
1391
1781
|
),
|
|
1392
|
-
/* @__PURE__ */ (0,
|
|
1782
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1393
1783
|
IconButton,
|
|
1394
1784
|
{
|
|
1395
|
-
icon: /* @__PURE__ */ (0,
|
|
1785
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CloseIcon3, { className: "h-24 w-24" }),
|
|
1396
1786
|
size: fullScreen ? "l" : "m",
|
|
1397
1787
|
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1398
1788
|
onClick: handleClose,
|
|
1399
|
-
className: "hidden!
|
|
1789
|
+
className: "hidden! lg:inline-flex!"
|
|
1400
1790
|
}
|
|
1401
1791
|
)
|
|
1402
1792
|
] })
|
|
1403
1793
|
]
|
|
1404
1794
|
}
|
|
1405
1795
|
),
|
|
1406
|
-
/* @__PURE__ */ (0,
|
|
1796
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1407
1797
|
"div",
|
|
1408
1798
|
{
|
|
1409
1799
|
className: [
|
|
@@ -1414,23 +1804,23 @@ var Drawer = (0, import_react12.forwardRef)(
|
|
|
1414
1804
|
children
|
|
1415
1805
|
}
|
|
1416
1806
|
),
|
|
1417
|
-
showFooter && /* @__PURE__ */ (0,
|
|
1807
|
+
showFooter && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1418
1808
|
"div",
|
|
1419
1809
|
{
|
|
1420
1810
|
className: [
|
|
1421
1811
|
"flex shrink-0 flex-col gap-8 border-t border-border-subtle bg-dialog-background-primary px-16 pb-16 pt-12 lg:flex-row lg:items-center lg:justify-end",
|
|
1422
1812
|
fullScreen ? "lg:gap-16 lg:px-112 lg:py-24" : "lg:px-24 lg:pb-24 lg:pt-16"
|
|
1423
1813
|
].join(" "),
|
|
1424
|
-
children: allActions ? /* @__PURE__ */ (0,
|
|
1425
|
-
/* @__PURE__ */ (0,
|
|
1426
|
-
/* @__PURE__ */ (0,
|
|
1427
|
-
/* @__PURE__ */ (0,
|
|
1428
|
-
/* @__PURE__ */ (0,
|
|
1814
|
+
children: allActions ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1815
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DrawerAction, { action: dismiss, variant: "tertiary", orderClass: "order-3 lg:order-1" }),
|
|
1816
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "contents gap-8 lg:order-2 lg:ml-auto lg:flex lg:items-center", children: [
|
|
1817
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DrawerAction, { action: secondary, variant: "secondary", orderClass: "order-1" }),
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DrawerAction, { action: confirm, variant: "primary", orderClass: "order-2" })
|
|
1429
1819
|
] })
|
|
1430
|
-
] }) : /* @__PURE__ */ (0,
|
|
1431
|
-
/* @__PURE__ */ (0,
|
|
1432
|
-
/* @__PURE__ */ (0,
|
|
1433
|
-
/* @__PURE__ */ (0,
|
|
1820
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1821
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DrawerAction, { action: secondary, variant: "secondary", orderClass: "order-1 lg:order-2" }),
|
|
1822
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DrawerAction, { action: confirm, variant: "primary", orderClass: "order-2 lg:order-3" }),
|
|
1823
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DrawerAction, { action: dismiss, variant: "tertiary", orderClass: "order-3 lg:order-1" })
|
|
1434
1824
|
] })
|
|
1435
1825
|
}
|
|
1436
1826
|
)
|
|
@@ -1446,9 +1836,9 @@ var Drawer = (0, import_react12.forwardRef)(
|
|
|
1446
1836
|
Drawer.displayName = "Drawer";
|
|
1447
1837
|
|
|
1448
1838
|
// src/components/Dropdown/Dropdown.tsx
|
|
1449
|
-
var
|
|
1450
|
-
var
|
|
1451
|
-
var IconDanger = () => /* @__PURE__ */ (0,
|
|
1839
|
+
var import_react15 = require("react");
|
|
1840
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1841
|
+
var IconDanger = () => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1452
1842
|
"svg",
|
|
1453
1843
|
{
|
|
1454
1844
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1456,7 +1846,7 @@ var IconDanger = () => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
|
1456
1846
|
height: "20",
|
|
1457
1847
|
viewBox: "0 0 20 20",
|
|
1458
1848
|
fill: "none",
|
|
1459
|
-
children: /* @__PURE__ */ (0,
|
|
1849
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1460
1850
|
"path",
|
|
1461
1851
|
{
|
|
1462
1852
|
d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
|
|
@@ -1466,7 +1856,7 @@ var IconDanger = () => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
|
1466
1856
|
}
|
|
1467
1857
|
);
|
|
1468
1858
|
function IconCheck({ className }) {
|
|
1469
|
-
return /* @__PURE__ */ (0,
|
|
1859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1470
1860
|
"svg",
|
|
1471
1861
|
{
|
|
1472
1862
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1475,7 +1865,7 @@ function IconCheck({ className }) {
|
|
|
1475
1865
|
viewBox: "0 0 20 20",
|
|
1476
1866
|
fill: "none",
|
|
1477
1867
|
className,
|
|
1478
|
-
children: /* @__PURE__ */ (0,
|
|
1868
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1479
1869
|
"path",
|
|
1480
1870
|
{
|
|
1481
1871
|
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
@@ -1486,7 +1876,7 @@ function IconCheck({ className }) {
|
|
|
1486
1876
|
);
|
|
1487
1877
|
}
|
|
1488
1878
|
function ChevronDown({ className }) {
|
|
1489
|
-
return /* @__PURE__ */ (0,
|
|
1879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1490
1880
|
"svg",
|
|
1491
1881
|
{
|
|
1492
1882
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1495,7 +1885,7 @@ function ChevronDown({ className }) {
|
|
|
1495
1885
|
viewBox: "0 0 20 20",
|
|
1496
1886
|
fill: "none",
|
|
1497
1887
|
className,
|
|
1498
|
-
children: /* @__PURE__ */ (0,
|
|
1888
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1499
1889
|
"path",
|
|
1500
1890
|
{
|
|
1501
1891
|
d: "M14.7119 8.0625L10 12.7744L5.28809 8.0625L6.0625 7.28809L10 11.2256L13.9375 7.28809L14.7119 8.0625Z",
|
|
@@ -1505,7 +1895,7 @@ function ChevronDown({ className }) {
|
|
|
1505
1895
|
}
|
|
1506
1896
|
);
|
|
1507
1897
|
}
|
|
1508
|
-
var Dropdown = (0,
|
|
1898
|
+
var Dropdown = (0, import_react15.forwardRef)(
|
|
1509
1899
|
(_a, ref) => {
|
|
1510
1900
|
var _b = _a, {
|
|
1511
1901
|
size = "md",
|
|
@@ -1542,14 +1932,14 @@ var Dropdown = (0, import_react13.forwardRef)(
|
|
|
1542
1932
|
]);
|
|
1543
1933
|
const isCombobox = variant === "combobox";
|
|
1544
1934
|
const iconButtonSize = size === "lg" ? "m" : "s";
|
|
1545
|
-
const [isOpen, setIsOpen] = (0,
|
|
1546
|
-
const [isFocused, setIsFocused] = (0,
|
|
1547
|
-
const [query, setQuery] = (0,
|
|
1548
|
-
const [filterText, setFilterText] = (0,
|
|
1549
|
-
const dropdownRef = (0,
|
|
1550
|
-
const inputRef = (0,
|
|
1551
|
-
const listboxId = (0,
|
|
1552
|
-
const [prevLabel, setPrevLabel] = (0,
|
|
1935
|
+
const [isOpen, setIsOpen] = (0, import_react15.useState)(false);
|
|
1936
|
+
const [isFocused, setIsFocused] = (0, import_react15.useState)(false);
|
|
1937
|
+
const [query, setQuery] = (0, import_react15.useState)(value.label || "");
|
|
1938
|
+
const [filterText, setFilterText] = (0, import_react15.useState)("");
|
|
1939
|
+
const dropdownRef = (0, import_react15.useRef)(null);
|
|
1940
|
+
const inputRef = (0, import_react15.useRef)(null);
|
|
1941
|
+
const listboxId = (0, import_react15.useId)();
|
|
1942
|
+
const [prevLabel, setPrevLabel] = (0, import_react15.useState)(value.label);
|
|
1553
1943
|
if (value.label !== prevLabel) {
|
|
1554
1944
|
setPrevLabel(value.label);
|
|
1555
1945
|
setQuery(value.label || "");
|
|
@@ -1557,7 +1947,7 @@ var Dropdown = (0, import_react13.forwardRef)(
|
|
|
1557
1947
|
const filteredItems = isCombobox ? dropDownItems.filter(
|
|
1558
1948
|
(item) => item.label.toLowerCase().includes(filterText.toLowerCase())
|
|
1559
1949
|
) : dropDownItems;
|
|
1560
|
-
(0,
|
|
1950
|
+
(0, import_react15.useEffect)(() => {
|
|
1561
1951
|
function handleClickOutside(event) {
|
|
1562
1952
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1563
1953
|
setIsOpen(false);
|
|
@@ -1574,16 +1964,16 @@ var Dropdown = (0, import_react13.forwardRef)(
|
|
|
1574
1964
|
${!isCombobox ? disabled ? "text-dropdown-text-disabled cursor-not-allowed" : value ? "text-dropdown-text-primary cursor-pointer" : "text-dropdown-text-secondary cursor-pointer" : ""}
|
|
1575
1965
|
${disabled ? "pointer-events-none bg-dropdown-background-disabled border-dropdown-border-disabled" : error ? `bg-dropdown-background-enabled border-dropdown-border-danger ${isOpen ? "ring-1 ring-inset ring-dropdown-border-danger" : ""}` : isOpen ? "bg-dropdown-background-enabled border-dropdown-border-active ring-1 ring-inset ring-dropdown-border-active" : isFocused ? "bg-dropdown-background-enabled border-dropdown-border-focus ring-1 ring-inset ring-dropdown-border-focus" : "bg-dropdown-background-enabled border-dropdown-border-enabled hover:border-dropdown-border-hover"}
|
|
1576
1966
|
${className}`;
|
|
1577
|
-
return /* @__PURE__ */ (0,
|
|
1578
|
-
label ? /* @__PURE__ */ (0,
|
|
1967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
1968
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1579
1969
|
"p",
|
|
1580
1970
|
{
|
|
1581
1971
|
className: `text-label-medium text-left items-left font-medium ${disabled ? "text-dropdown-text-disabled" : "text-dropdown-text-primary"}`,
|
|
1582
1972
|
children: label
|
|
1583
1973
|
}
|
|
1584
|
-
) : /* @__PURE__ */ (0,
|
|
1585
|
-
/* @__PURE__ */ (0,
|
|
1586
|
-
isCombobox ? /* @__PURE__ */ (0,
|
|
1974
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, {}),
|
|
1975
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w-full flex flex-col relative", ref: dropdownRef, children: [
|
|
1976
|
+
isCombobox ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1587
1977
|
"div",
|
|
1588
1978
|
__spreadProps(__spreadValues({
|
|
1589
1979
|
ref
|
|
@@ -1594,7 +1984,7 @@ var Dropdown = (0, import_react13.forwardRef)(
|
|
|
1594
1984
|
},
|
|
1595
1985
|
className: triggerClassName,
|
|
1596
1986
|
children: [
|
|
1597
|
-
/* @__PURE__ */ (0,
|
|
1987
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1598
1988
|
"input",
|
|
1599
1989
|
{
|
|
1600
1990
|
ref: inputRef,
|
|
@@ -1627,16 +2017,17 @@ var Dropdown = (0, import_react13.forwardRef)(
|
|
|
1627
2017
|
className: `grow w-full min-w-0 bg-transparent focus:outline-none ${disabled ? "text-dropdown-text-disabled cursor-not-allowed" : "text-dropdown-text-primary cursor-text"}`
|
|
1628
2018
|
}
|
|
1629
2019
|
),
|
|
1630
|
-
/* @__PURE__ */ (0,
|
|
1631
|
-
disabled ? /* @__PURE__ */ (0,
|
|
1632
|
-
/* @__PURE__ */ (0,
|
|
2020
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
2021
|
+
disabled ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconDanger, {}) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, {}),
|
|
2022
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1633
2023
|
IconButton,
|
|
1634
2024
|
{
|
|
1635
2025
|
size: iconButtonSize,
|
|
2026
|
+
transparent: true,
|
|
1636
2027
|
disabled,
|
|
1637
2028
|
tabIndex: -1,
|
|
1638
2029
|
"aria-label": "\u0E40\u0E1B\u0E34\u0E14/\u0E1B\u0E34\u0E14\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
1639
|
-
icon: /* @__PURE__ */ (0,
|
|
2030
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1640
2031
|
ChevronDown,
|
|
1641
2032
|
{
|
|
1642
2033
|
className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
|
|
@@ -1659,7 +2050,7 @@ var Dropdown = (0, import_react13.forwardRef)(
|
|
|
1659
2050
|
] })
|
|
1660
2051
|
]
|
|
1661
2052
|
})
|
|
1662
|
-
) : /* @__PURE__ */ (0,
|
|
2053
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1663
2054
|
"div",
|
|
1664
2055
|
__spreadProps(__spreadValues({
|
|
1665
2056
|
ref
|
|
@@ -1692,23 +2083,24 @@ var Dropdown = (0, import_react13.forwardRef)(
|
|
|
1692
2083
|
},
|
|
1693
2084
|
className: `focus:outline-none ${triggerClassName}`,
|
|
1694
2085
|
children: [
|
|
1695
|
-
/* @__PURE__ */ (0,
|
|
2086
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1696
2087
|
"p",
|
|
1697
2088
|
{
|
|
1698
2089
|
className: `grow truncate ${textCenter ? "text-center" : "text-start"}`,
|
|
1699
2090
|
children: value.label || placeholder
|
|
1700
2091
|
}
|
|
1701
2092
|
),
|
|
1702
|
-
/* @__PURE__ */ (0,
|
|
1703
|
-
disabled ? /* @__PURE__ */ (0,
|
|
1704
|
-
/* @__PURE__ */ (0,
|
|
2093
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
2094
|
+
disabled ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconDanger, {}) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, {}),
|
|
2095
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1705
2096
|
IconButton,
|
|
1706
2097
|
{
|
|
1707
2098
|
size: iconButtonSize,
|
|
2099
|
+
transparent: true,
|
|
1708
2100
|
disabled,
|
|
1709
2101
|
tabIndex: -1,
|
|
1710
2102
|
"aria-label": "\u0E40\u0E1B\u0E34\u0E14/\u0E1B\u0E34\u0E14\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
1711
|
-
icon: /* @__PURE__ */ (0,
|
|
2103
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1712
2104
|
ChevronDown,
|
|
1713
2105
|
{
|
|
1714
2106
|
className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
|
|
@@ -1725,17 +2117,17 @@ var Dropdown = (0, import_react13.forwardRef)(
|
|
|
1725
2117
|
]
|
|
1726
2118
|
})
|
|
1727
2119
|
),
|
|
1728
|
-
/* @__PURE__ */ (0,
|
|
2120
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1729
2121
|
"div",
|
|
1730
2122
|
{
|
|
1731
2123
|
className: `${isOpen ? "flex" : "hidden"} top-[calc(100%+4px)] left-0 absolute z-10000 bg-dropdown-background-enabled rounded-6 shadow-base w-full flex-col pt-4 overflow-hidden`,
|
|
1732
|
-
children: /* @__PURE__ */ (0,
|
|
2124
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1733
2125
|
"ul",
|
|
1734
2126
|
{
|
|
1735
2127
|
id: isCombobox ? listboxId : void 0,
|
|
1736
2128
|
role: isCombobox ? "listbox" : void 0,
|
|
1737
2129
|
className: "h-auto max-h-200 overflow-y-auto cursor-pointer",
|
|
1738
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, idx) => /* @__PURE__ */ (0,
|
|
2130
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1739
2131
|
"div",
|
|
1740
2132
|
{
|
|
1741
2133
|
onClick: () => {
|
|
@@ -1745,46 +2137,46 @@ var Dropdown = (0, import_react13.forwardRef)(
|
|
|
1745
2137
|
},
|
|
1746
2138
|
className: "relative h-48 py-8 px-16 border-t border-gray-50 text-label-medium hover:bg-dropdown-background-hover active:bg-dropdown-background-active flex items-center justify-between gap-12",
|
|
1747
2139
|
children: [
|
|
1748
|
-
/* @__PURE__ */ (0,
|
|
1749
|
-
value.value === item.value && /* @__PURE__ */ (0,
|
|
2140
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-label-medium text-dropdown-text-primary", children: item.label }),
|
|
2141
|
+
value.value === item.value && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconCheck, { className: "h-20 w-20" })
|
|
1750
2142
|
]
|
|
1751
2143
|
}
|
|
1752
|
-
) }, idx)) : /* @__PURE__ */ (0,
|
|
2144
|
+
) }, idx)) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { className: "px-16 py-8 text-label-medium text-dropdown-text-secondary", children: "\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23" })
|
|
1753
2145
|
}
|
|
1754
2146
|
)
|
|
1755
2147
|
}
|
|
1756
2148
|
)
|
|
1757
2149
|
] }),
|
|
1758
|
-
error ? /* @__PURE__ */ (0,
|
|
2150
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-caption-caption text-left items-left text-dropdown-text-danger", children: error }) : helperText ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1759
2151
|
"p",
|
|
1760
2152
|
{
|
|
1761
2153
|
className: `text-caption-caption text-left items-left ${disabled ? "text-dropdown-text-disabled" : "text-dropdown-text-secondary"}`,
|
|
1762
2154
|
children: helperText
|
|
1763
2155
|
}
|
|
1764
|
-
) : /* @__PURE__ */ (0,
|
|
2156
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, {})
|
|
1765
2157
|
] });
|
|
1766
2158
|
}
|
|
1767
2159
|
);
|
|
1768
2160
|
Dropdown.displayName = "Dropdown";
|
|
1769
2161
|
|
|
1770
2162
|
// src/components/FinancialLogo/FinancialLogo.tsx
|
|
1771
|
-
var
|
|
1772
|
-
var
|
|
1773
|
-
var
|
|
2163
|
+
var import_react16 = require("react");
|
|
2164
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2165
|
+
var inlineClasses = {
|
|
1774
2166
|
info: "bg-alert-inline-info-bg border-alert-inline-info-border text-alert-text-primary",
|
|
1775
2167
|
success: "bg-alert-inline-success-bg border-alert-inline-success-border text-alert-text-primary",
|
|
1776
2168
|
warning: "bg-alert-inline-warning-bg border-alert-inline-warning-border text-alert-text-primary",
|
|
1777
2169
|
danger: "bg-alert-inline-danger-bg border-alert-inline-danger-border text-alert-text-primary",
|
|
1778
2170
|
common: "bg-alert-inline-common-bg border-alert-inline-common-border text-alert-text-primary"
|
|
1779
2171
|
};
|
|
1780
|
-
var
|
|
2172
|
+
var pageClasses = {
|
|
1781
2173
|
info: "bg-alert-page-info-bg text-alert-text-primary-inverse",
|
|
1782
2174
|
success: "bg-alert-page-success-bg text-alert-text-primary-inverse",
|
|
1783
2175
|
warning: "bg-alert-page-warning-bg text-alert-text-primary-inverse",
|
|
1784
2176
|
danger: "bg-alert-page-danger-bg text-alert-text-primary-inverse",
|
|
1785
2177
|
common: "bg-alert-page-common-bg text-alert-text-primary-inverse"
|
|
1786
2178
|
};
|
|
1787
|
-
var
|
|
2179
|
+
var actionsPageClasses = {
|
|
1788
2180
|
info: "text-enabled-inverse",
|
|
1789
2181
|
success: "text-enabled-inverse",
|
|
1790
2182
|
warning: "text-enabled-dark",
|
|
@@ -1799,25 +2191,25 @@ var inlineIconClasses2 = {
|
|
|
1799
2191
|
common: "text-alert-inline-common-icon"
|
|
1800
2192
|
};
|
|
1801
2193
|
function InfoIcon2({ className }) {
|
|
1802
|
-
return /* @__PURE__ */ (0,
|
|
2194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime16.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" }) });
|
|
1803
2195
|
}
|
|
1804
2196
|
function SuccessIcon2({ className }) {
|
|
1805
|
-
return /* @__PURE__ */ (0,
|
|
1806
|
-
/* @__PURE__ */ (0,
|
|
1807
|
-
/* @__PURE__ */ (0,
|
|
2197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2198
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2199
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1808
2200
|
] });
|
|
1809
2201
|
}
|
|
1810
2202
|
function WarningIcon3({ className }) {
|
|
1811
|
-
return /* @__PURE__ */ (0,
|
|
2203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime16.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" }) });
|
|
1812
2204
|
}
|
|
1813
2205
|
function DangerIcon2({ className }) {
|
|
1814
|
-
return /* @__PURE__ */ (0,
|
|
2206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime16.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" }) });
|
|
1815
2207
|
}
|
|
1816
2208
|
function CommonIcon({ className }) {
|
|
1817
|
-
return /* @__PURE__ */ (0,
|
|
2209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime16.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" }) });
|
|
1818
2210
|
}
|
|
1819
2211
|
function CloseIcon4({ className }) {
|
|
1820
|
-
return /* @__PURE__ */ (0,
|
|
2212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1821
2213
|
}
|
|
1822
2214
|
var defaultIcons2 = {
|
|
1823
2215
|
info: InfoIcon2,
|
|
@@ -1826,7 +2218,7 @@ var defaultIcons2 = {
|
|
|
1826
2218
|
danger: DangerIcon2,
|
|
1827
2219
|
common: CommonIcon
|
|
1828
2220
|
};
|
|
1829
|
-
var FinancialLogo = (0,
|
|
2221
|
+
var FinancialLogo = (0, import_react16.forwardRef)(
|
|
1830
2222
|
(_a, ref) => {
|
|
1831
2223
|
var _b = _a, {
|
|
1832
2224
|
variant = "info",
|
|
@@ -1850,8 +2242,8 @@ var FinancialLogo = (0, import_react14.forwardRef)(
|
|
|
1850
2242
|
"children"
|
|
1851
2243
|
]);
|
|
1852
2244
|
const isPage = mode === "page";
|
|
1853
|
-
const variantClass = isPage ?
|
|
1854
|
-
const actionClass = isPage ?
|
|
2245
|
+
const variantClass = isPage ? pageClasses[variant] : inlineClasses[variant];
|
|
2246
|
+
const actionClass = isPage ? actionsPageClasses[variant] : "text-enabled";
|
|
1855
2247
|
const DefaultIcon = defaultIcons2[variant];
|
|
1856
2248
|
const iconColorClass = isPage ? "" : inlineIconClasses2[variant];
|
|
1857
2249
|
const descColorClass = isPage ? "text-alert-text-secondary-inverse" : "text-alert-text-secondary";
|
|
@@ -1862,22 +2254,22 @@ var FinancialLogo = (0, import_react14.forwardRef)(
|
|
|
1862
2254
|
variantClass,
|
|
1863
2255
|
className
|
|
1864
2256
|
].filter(Boolean).join(" ");
|
|
1865
|
-
return /* @__PURE__ */ (0,
|
|
1866
|
-
/* @__PURE__ */ (0,
|
|
1867
|
-
/* @__PURE__ */ (0,
|
|
1868
|
-
title && /* @__PURE__ */ (0,
|
|
1869
|
-
description && /* @__PURE__ */ (0,
|
|
2257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
2258
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: `shrink-0 mt-2 ${iconColorClass}`, children: icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
2259
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
2260
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-sm font-medium leading-20", children: title }),
|
|
2261
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: `text-sm leading-20 ${descColorClass} ${title ? "mt-4" : ""}`, children: description }),
|
|
1870
2262
|
children
|
|
1871
2263
|
] }),
|
|
1872
|
-
action && /* @__PURE__ */ (0,
|
|
1873
|
-
onClose && /* @__PURE__ */ (0,
|
|
2264
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: `${actionClass} underline text-sm font-medium`, children: action }),
|
|
2265
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1874
2266
|
"button",
|
|
1875
2267
|
{
|
|
1876
2268
|
type: "button",
|
|
1877
2269
|
onClick: onClose,
|
|
1878
2270
|
className: `shrink-0 p-2 rounded transition-colors ${closeColorClass}`,
|
|
1879
2271
|
"aria-label": "Close",
|
|
1880
|
-
children: /* @__PURE__ */ (0,
|
|
2272
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CloseIcon4, { className: "h-16 w-16" })
|
|
1881
2273
|
}
|
|
1882
2274
|
)
|
|
1883
2275
|
] }));
|
|
@@ -1886,9 +2278,9 @@ var FinancialLogo = (0, import_react14.forwardRef)(
|
|
|
1886
2278
|
FinancialLogo.displayName = "FinancialLogo";
|
|
1887
2279
|
|
|
1888
2280
|
// src/components/Icon/Icon.tsx
|
|
1889
|
-
var
|
|
1890
|
-
var
|
|
1891
|
-
var Icon = (0,
|
|
2281
|
+
var import_react17 = require("react");
|
|
2282
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2283
|
+
var Icon = (0, import_react17.forwardRef)(
|
|
1892
2284
|
(_a, ref) => {
|
|
1893
2285
|
var _b = _a, {
|
|
1894
2286
|
name,
|
|
@@ -1916,7 +2308,7 @@ var Icon = (0, import_react15.forwardRef)(
|
|
|
1916
2308
|
"material-symbols-outlined select-none shrink-0 inline-block leading-none",
|
|
1917
2309
|
className
|
|
1918
2310
|
].filter(Boolean).join(" ");
|
|
1919
|
-
return /* @__PURE__ */ (0,
|
|
2311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1920
2312
|
"span",
|
|
1921
2313
|
__spreadProps(__spreadValues({
|
|
1922
2314
|
ref,
|
|
@@ -1939,8 +2331,8 @@ var Icon = (0, import_react15.forwardRef)(
|
|
|
1939
2331
|
Icon.displayName = "Icon";
|
|
1940
2332
|
|
|
1941
2333
|
// src/components/Link/Link.tsx
|
|
1942
|
-
var
|
|
1943
|
-
var
|
|
2334
|
+
var import_react18 = require("react");
|
|
2335
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1944
2336
|
var linkStyleClasses = {
|
|
1945
2337
|
brand: "font-sans text-link-text-enabled",
|
|
1946
2338
|
white: "font-sans text-link-text-enabled-inverse",
|
|
@@ -1962,12 +2354,12 @@ var iconVariantClasses = {
|
|
|
1962
2354
|
lg: "w-24 h-24"
|
|
1963
2355
|
};
|
|
1964
2356
|
function SuccessIcon3({ className }) {
|
|
1965
|
-
return /* @__PURE__ */ (0,
|
|
1966
|
-
/* @__PURE__ */ (0,
|
|
1967
|
-
/* @__PURE__ */ (0,
|
|
2357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2358
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2359
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1968
2360
|
] });
|
|
1969
2361
|
}
|
|
1970
|
-
var Link = (0,
|
|
2362
|
+
var Link = (0, import_react18.forwardRef)(
|
|
1971
2363
|
(_a, ref) => {
|
|
1972
2364
|
var _b = _a, {
|
|
1973
2365
|
variant = "sm",
|
|
@@ -1998,18 +2390,18 @@ var Link = (0, import_react16.forwardRef)(
|
|
|
1998
2390
|
variantClass,
|
|
1999
2391
|
className
|
|
2000
2392
|
].filter(Boolean).join(" ");
|
|
2001
|
-
return /* @__PURE__ */ (0,
|
|
2002
|
-
/* @__PURE__ */ (0,
|
|
2003
|
-
icon && !isInline ? /* @__PURE__ */ (0,
|
|
2393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", __spreadProps(__spreadValues({ ref, role: "link", className: classes }, rest), { children: [
|
|
2394
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("a", { href, target: "_blank", rel: "noopener noreferrer", children: text }),
|
|
2395
|
+
icon && !isInline ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SuccessIcon3, { className: iconClass }) : null
|
|
2004
2396
|
] }));
|
|
2005
2397
|
}
|
|
2006
2398
|
);
|
|
2007
2399
|
Link.displayName = "Link";
|
|
2008
2400
|
|
|
2009
2401
|
// src/components/Radio/Radio.tsx
|
|
2010
|
-
var
|
|
2011
|
-
var
|
|
2012
|
-
var Radio = (0,
|
|
2402
|
+
var import_react19 = require("react");
|
|
2403
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2404
|
+
var Radio = (0, import_react19.forwardRef)(
|
|
2013
2405
|
(_a, ref) => {
|
|
2014
2406
|
var _b = _a, {
|
|
2015
2407
|
size = "sm",
|
|
@@ -2034,20 +2426,20 @@ var Radio = (0, import_react17.forwardRef)(
|
|
|
2034
2426
|
"id",
|
|
2035
2427
|
"name"
|
|
2036
2428
|
]);
|
|
2037
|
-
const reactId = (0,
|
|
2429
|
+
const reactId = (0, import_react19.useId)();
|
|
2038
2430
|
const inputId = id != null ? id : reactId;
|
|
2039
|
-
return /* @__PURE__ */ (0,
|
|
2431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2040
2432
|
"div",
|
|
2041
2433
|
{
|
|
2042
2434
|
className: `${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
2043
|
-
children: /* @__PURE__ */ (0,
|
|
2435
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2044
2436
|
"label",
|
|
2045
2437
|
{
|
|
2046
2438
|
htmlFor: inputId,
|
|
2047
2439
|
className: `flex gap-4 ${disabled ? "pointer-events-none text-gray-400" : "text-gray-900 cursor-pointer"}`,
|
|
2048
2440
|
children: [
|
|
2049
|
-
/* @__PURE__ */ (0,
|
|
2050
|
-
/* @__PURE__ */ (0,
|
|
2441
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
|
|
2442
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2051
2443
|
"input",
|
|
2052
2444
|
__spreadValues({
|
|
2053
2445
|
ref,
|
|
@@ -2060,14 +2452,14 @@ var Radio = (0, import_react17.forwardRef)(
|
|
|
2060
2452
|
name
|
|
2061
2453
|
}, rest)
|
|
2062
2454
|
),
|
|
2063
|
-
/* @__PURE__ */ (0,
|
|
2455
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2064
2456
|
"div",
|
|
2065
2457
|
{
|
|
2066
2458
|
className: `relative box flex items-center justify-center rounded-full border-2 group bg-white
|
|
2067
2459
|
${size === "sm" ? "h-16 w-16 my-4 ml-3 mr-3" : "m-3 h-20 w-20 text-label-large"}
|
|
2068
2460
|
${error ? "border-red-500" : "border-gray-600 peer-checked:border-blue-600 peer-disabled:border-gray-400!"}
|
|
2069
2461
|
`,
|
|
2070
|
-
children: /* @__PURE__ */ (0,
|
|
2462
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2071
2463
|
"span",
|
|
2072
2464
|
{
|
|
2073
2465
|
className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2
|
|
@@ -2078,12 +2470,12 @@ var Radio = (0, import_react17.forwardRef)(
|
|
|
2078
2470
|
}
|
|
2079
2471
|
)
|
|
2080
2472
|
] }),
|
|
2081
|
-
/* @__PURE__ */ (0,
|
|
2473
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2082
2474
|
"div",
|
|
2083
2475
|
{
|
|
2084
2476
|
className: `flex flex-col gap-1 ${size === "sm" ? "mt-2" : "mt-4"}`,
|
|
2085
2477
|
children: [
|
|
2086
|
-
/* @__PURE__ */ (0,
|
|
2478
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2087
2479
|
"p",
|
|
2088
2480
|
{
|
|
2089
2481
|
className: `
|
|
@@ -2093,7 +2485,7 @@ var Radio = (0, import_react17.forwardRef)(
|
|
|
2093
2485
|
children: label
|
|
2094
2486
|
}
|
|
2095
2487
|
),
|
|
2096
|
-
/* @__PURE__ */ (0,
|
|
2488
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2097
2489
|
"p",
|
|
2098
2490
|
{
|
|
2099
2491
|
className: `text-caption-caption ${disabled ? "text-gray-400" : error ? "text-red-600" : "text-gray-600"}`,
|
|
@@ -2113,18 +2505,18 @@ var Radio = (0, import_react17.forwardRef)(
|
|
|
2113
2505
|
Radio.displayName = "Radio";
|
|
2114
2506
|
|
|
2115
2507
|
// src/components/SegmentControl/SegmentControl.tsx
|
|
2116
|
-
var
|
|
2117
|
-
var
|
|
2118
|
-
var SegmentControl = (0,
|
|
2508
|
+
var import_react20 = require("react");
|
|
2509
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2510
|
+
var SegmentControl = (0, import_react20.forwardRef)(
|
|
2119
2511
|
(_a, ref) => {
|
|
2120
2512
|
var _b = _a, { size = "md", items, selected, setSelected, className = "" } = _b, rest = __objRest(_b, ["size", "items", "selected", "setSelected", "className"]);
|
|
2121
|
-
return /* @__PURE__ */ (0,
|
|
2513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2122
2514
|
"div",
|
|
2123
2515
|
__spreadProps(__spreadValues({
|
|
2124
2516
|
ref,
|
|
2125
2517
|
className: `bg-background-tertiary rounded-full flex flex-row items-center justify-center p-4 gap-4 ${className}`
|
|
2126
2518
|
}, rest), {
|
|
2127
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
2519
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2128
2520
|
"div",
|
|
2129
2521
|
{
|
|
2130
2522
|
onClick: () => setSelected == null ? void 0 : setSelected(item.value),
|
|
@@ -2141,8 +2533,8 @@ var SegmentControl = (0, import_react18.forwardRef)(
|
|
|
2141
2533
|
SegmentControl.displayName = "SegmentControl";
|
|
2142
2534
|
|
|
2143
2535
|
// src/components/Slider/Slider.tsx
|
|
2144
|
-
var
|
|
2145
|
-
var
|
|
2536
|
+
var import_react21 = require("react");
|
|
2537
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2146
2538
|
var sizeConfig = {
|
|
2147
2539
|
small: {
|
|
2148
2540
|
trackH: "h-4",
|
|
@@ -2173,7 +2565,7 @@ var sizeConfig = {
|
|
|
2173
2565
|
}
|
|
2174
2566
|
};
|
|
2175
2567
|
function ChevronGlyphs({ size, color }) {
|
|
2176
|
-
return /* @__PURE__ */ (0,
|
|
2568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2177
2569
|
"svg",
|
|
2178
2570
|
{
|
|
2179
2571
|
width: size,
|
|
@@ -2183,7 +2575,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
2183
2575
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2184
2576
|
"aria-hidden": "true",
|
|
2185
2577
|
children: [
|
|
2186
|
-
/* @__PURE__ */ (0,
|
|
2578
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2187
2579
|
"path",
|
|
2188
2580
|
{
|
|
2189
2581
|
d: "M4.75 3.25L2.25 6L4.75 8.75",
|
|
@@ -2193,7 +2585,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
2193
2585
|
strokeLinejoin: "round"
|
|
2194
2586
|
}
|
|
2195
2587
|
),
|
|
2196
|
-
/* @__PURE__ */ (0,
|
|
2588
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2197
2589
|
"path",
|
|
2198
2590
|
{
|
|
2199
2591
|
d: "M7.25 3.25L9.75 6L7.25 8.75",
|
|
@@ -2207,7 +2599,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
2207
2599
|
}
|
|
2208
2600
|
);
|
|
2209
2601
|
}
|
|
2210
|
-
var Slider = (0,
|
|
2602
|
+
var Slider = (0, import_react21.forwardRef)(
|
|
2211
2603
|
(_a, ref) => {
|
|
2212
2604
|
var _b = _a, {
|
|
2213
2605
|
size = "medium",
|
|
@@ -2242,15 +2634,15 @@ var Slider = (0, import_react19.forwardRef)(
|
|
|
2242
2634
|
"onChange",
|
|
2243
2635
|
"aria-label"
|
|
2244
2636
|
]);
|
|
2245
|
-
const reactId = (0,
|
|
2637
|
+
const reactId = (0, import_react21.useId)();
|
|
2246
2638
|
const inputId = id != null ? id : reactId;
|
|
2247
2639
|
const sz = sizeConfig[size];
|
|
2248
2640
|
const ariaLabel = ariaLabelProp != null ? ariaLabelProp : typeof label === "string" ? void 0 : "Slider";
|
|
2249
2641
|
const ariaDescriptionId = description ? `${inputId}-description` : void 0;
|
|
2250
2642
|
const isControlled = controlledValue !== void 0;
|
|
2251
|
-
const [internalValue, setInternalValue] = (0,
|
|
2643
|
+
const [internalValue, setInternalValue] = (0, import_react21.useState)(defaultValue != null ? defaultValue : min);
|
|
2252
2644
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
2253
|
-
const handleChange = (0,
|
|
2645
|
+
const handleChange = (0, import_react21.useCallback)(
|
|
2254
2646
|
(e) => {
|
|
2255
2647
|
const val = Number(e.target.value);
|
|
2256
2648
|
if (!isControlled) {
|
|
@@ -2270,13 +2662,13 @@ var Slider = (0, import_react19.forwardRef)(
|
|
|
2270
2662
|
const descriptionColor = disabled ? "text-slider-label-disabled" : "text-slider-description";
|
|
2271
2663
|
const thumbOffset = percent * sz.thumbPx / 100;
|
|
2272
2664
|
const fillOffset = sz.thumbPx / 2 - thumbOffset;
|
|
2273
|
-
return /* @__PURE__ */ (0,
|
|
2665
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2274
2666
|
"div",
|
|
2275
2667
|
{
|
|
2276
2668
|
className: ["flex w-full flex-col gap-8 font-sans", className].filter(Boolean).join(" "),
|
|
2277
2669
|
children: [
|
|
2278
|
-
(label || showValue && !disabled) && /* @__PURE__ */ (0,
|
|
2279
|
-
label && /* @__PURE__ */ (0,
|
|
2670
|
+
(label || showValue && !disabled) && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
2671
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2280
2672
|
"label",
|
|
2281
2673
|
{
|
|
2282
2674
|
htmlFor: inputId,
|
|
@@ -2289,7 +2681,7 @@ var Slider = (0, import_react19.forwardRef)(
|
|
|
2289
2681
|
children: label
|
|
2290
2682
|
}
|
|
2291
2683
|
),
|
|
2292
|
-
showValue && /* @__PURE__ */ (0,
|
|
2684
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2293
2685
|
"span",
|
|
2294
2686
|
{
|
|
2295
2687
|
className: [sz.description, "tabular-nums", labelColor].join(" "),
|
|
@@ -2297,7 +2689,7 @@ var Slider = (0, import_react19.forwardRef)(
|
|
|
2297
2689
|
}
|
|
2298
2690
|
)
|
|
2299
2691
|
] }),
|
|
2300
|
-
/* @__PURE__ */ (0,
|
|
2692
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2301
2693
|
"div",
|
|
2302
2694
|
{
|
|
2303
2695
|
className: [
|
|
@@ -2306,7 +2698,7 @@ var Slider = (0, import_react19.forwardRef)(
|
|
|
2306
2698
|
disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
2307
2699
|
].join(" "),
|
|
2308
2700
|
children: [
|
|
2309
|
-
/* @__PURE__ */ (0,
|
|
2701
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2310
2702
|
"div",
|
|
2311
2703
|
{
|
|
2312
2704
|
className: [
|
|
@@ -2316,14 +2708,14 @@ var Slider = (0, import_react19.forwardRef)(
|
|
|
2316
2708
|
].join(" ")
|
|
2317
2709
|
}
|
|
2318
2710
|
),
|
|
2319
|
-
/* @__PURE__ */ (0,
|
|
2711
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2320
2712
|
"div",
|
|
2321
2713
|
{
|
|
2322
2714
|
className: ["absolute left-0 rounded-full", sz.trackH, fillBg].join(" "),
|
|
2323
2715
|
style: { width: `calc(${percent}% + ${fillOffset}px)` }
|
|
2324
2716
|
}
|
|
2325
2717
|
),
|
|
2326
|
-
/* @__PURE__ */ (0,
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2327
2719
|
"input",
|
|
2328
2720
|
__spreadValues({
|
|
2329
2721
|
ref,
|
|
@@ -2344,7 +2736,7 @@ var Slider = (0, import_react19.forwardRef)(
|
|
|
2344
2736
|
].join(" ")
|
|
2345
2737
|
}, rest)
|
|
2346
2738
|
),
|
|
2347
|
-
/* @__PURE__ */ (0,
|
|
2739
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2348
2740
|
"div",
|
|
2349
2741
|
{
|
|
2350
2742
|
className: [
|
|
@@ -2357,13 +2749,13 @@ var Slider = (0, import_react19.forwardRef)(
|
|
|
2357
2749
|
!disabled && "peer-hover:shadow-medium"
|
|
2358
2750
|
].filter(Boolean).join(" "),
|
|
2359
2751
|
style: { left: `calc(${percent}% - ${thumbOffset}px)` },
|
|
2360
|
-
children: /* @__PURE__ */ (0,
|
|
2752
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ChevronGlyphs, { size: sz.iconPx, color: iconColor })
|
|
2361
2753
|
}
|
|
2362
2754
|
)
|
|
2363
2755
|
]
|
|
2364
2756
|
}
|
|
2365
2757
|
),
|
|
2366
|
-
description && /* @__PURE__ */ (0,
|
|
2758
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2367
2759
|
"span",
|
|
2368
2760
|
{
|
|
2369
2761
|
id: ariaDescriptionId,
|
|
@@ -2379,9 +2771,9 @@ var Slider = (0, import_react19.forwardRef)(
|
|
|
2379
2771
|
Slider.displayName = "Slider";
|
|
2380
2772
|
|
|
2381
2773
|
// src/components/Tab/Tab.tsx
|
|
2382
|
-
var
|
|
2383
|
-
var
|
|
2384
|
-
var Tab = (0,
|
|
2774
|
+
var import_react22 = require("react");
|
|
2775
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2776
|
+
var Tab = (0, import_react22.forwardRef)(
|
|
2385
2777
|
(_a, ref) => {
|
|
2386
2778
|
var _b = _a, {
|
|
2387
2779
|
size = "md",
|
|
@@ -2400,7 +2792,7 @@ var Tab = (0, import_react20.forwardRef)(
|
|
|
2400
2792
|
"setSelected",
|
|
2401
2793
|
"className"
|
|
2402
2794
|
]);
|
|
2403
|
-
return /* @__PURE__ */ (0,
|
|
2795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2404
2796
|
"div",
|
|
2405
2797
|
__spreadProps(__spreadValues({
|
|
2406
2798
|
ref,
|
|
@@ -2418,9 +2810,9 @@ var Tab = (0, import_react20.forwardRef)(
|
|
|
2418
2810
|
Tab.displayName = "Tab";
|
|
2419
2811
|
|
|
2420
2812
|
// src/components/TextArea/TextArea.tsx
|
|
2421
|
-
var
|
|
2422
|
-
var
|
|
2423
|
-
var TextArea = (0,
|
|
2813
|
+
var import_react23 = require("react");
|
|
2814
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2815
|
+
var TextArea = (0, import_react23.forwardRef)(
|
|
2424
2816
|
(_a, ref) => {
|
|
2425
2817
|
var _b = _a, {
|
|
2426
2818
|
error,
|
|
@@ -2460,21 +2852,21 @@ var TextArea = (0, import_react21.forwardRef)(
|
|
|
2460
2852
|
"className"
|
|
2461
2853
|
]);
|
|
2462
2854
|
var _a2;
|
|
2463
|
-
const [isFocused, setIsFocused] = (0,
|
|
2855
|
+
const [isFocused, setIsFocused] = (0, import_react23.useState)(false);
|
|
2464
2856
|
const isActive = isFocused && !!value;
|
|
2465
|
-
return /* @__PURE__ */ (0,
|
|
2466
|
-
label || showCounter ? /* @__PURE__ */ (0,
|
|
2467
|
-
label ? /* @__PURE__ */ (0,
|
|
2857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
2858
|
+
label || showCounter ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "w-full flex justify-between items-center gap-8", children: [
|
|
2859
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2468
2860
|
"p",
|
|
2469
2861
|
{
|
|
2470
2862
|
className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-primary"}`,
|
|
2471
2863
|
children: [
|
|
2472
2864
|
label,
|
|
2473
|
-
optional && /* @__PURE__ */ (0,
|
|
2865
|
+
optional && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-text-area-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
2474
2866
|
]
|
|
2475
2867
|
}
|
|
2476
|
-
) : /* @__PURE__ */ (0,
|
|
2477
|
-
showCounter && /* @__PURE__ */ (0,
|
|
2868
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", {}),
|
|
2869
|
+
showCounter && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2478
2870
|
"p",
|
|
2479
2871
|
{
|
|
2480
2872
|
className: `shrink-0 text-caption-caption ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-tertiary"}`,
|
|
@@ -2485,13 +2877,13 @@ var TextArea = (0, import_react21.forwardRef)(
|
|
|
2485
2877
|
]
|
|
2486
2878
|
}
|
|
2487
2879
|
)
|
|
2488
|
-
] }) : /* @__PURE__ */ (0,
|
|
2489
|
-
/* @__PURE__ */ (0,
|
|
2880
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, {}),
|
|
2881
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2490
2882
|
"div",
|
|
2491
2883
|
{
|
|
2492
2884
|
className: `relative w-full rounded-6 border ${disabled ? "bg-text-area-background-disabled border-text-area-border-disabled" : error ? `bg-text-area-background-enabled border-text-area-border-danger ${isFocused ? "ring-1 ring-inset ring-text-area-border-danger" : ""}` : isActive ? "bg-text-area-background-enabled border-text-area-border-active ring-1 ring-inset ring-text-area-border-active" : isFocused ? "bg-text-area-background-enabled border-text-area-border-focus ring-1 ring-inset ring-text-area-border-focus" : "bg-text-area-background-enabled border-text-area-border-enabled hover:border-text-area-border-hover"} ${className != null ? className : ""}`,
|
|
2493
2885
|
children: [
|
|
2494
|
-
/* @__PURE__ */ (0,
|
|
2886
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2495
2887
|
"textarea",
|
|
2496
2888
|
__spreadValues({
|
|
2497
2889
|
ref,
|
|
@@ -2512,13 +2904,14 @@ var TextArea = (0, import_react21.forwardRef)(
|
|
|
2512
2904
|
className: `block w-full min-w-0 pt-12 pb-8 pl-16 pr-48 text-body-small bg-transparent focus:outline-none placeholder:text-text-area-text-tertiary ${disabled ? "resize-none text-text-area-text-disabled" : "resize-y text-text-area-text-primary"}`
|
|
2513
2905
|
}, props)
|
|
2514
2906
|
),
|
|
2515
|
-
pending ? /* @__PURE__ */ (0,
|
|
2907
|
+
pending ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Loading, { size: "sm", className: "shrink-0 absolute right-12 top-12" }) : clearable && isFocused && value ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2516
2908
|
IconButton,
|
|
2517
2909
|
{
|
|
2518
2910
|
size: "s",
|
|
2911
|
+
transparent: true,
|
|
2519
2912
|
"aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
2520
2913
|
className: "absolute right-6 top-6",
|
|
2521
|
-
icon: /* @__PURE__ */ (0,
|
|
2914
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2522
2915
|
"svg",
|
|
2523
2916
|
{
|
|
2524
2917
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2526,7 +2919,7 @@ var TextArea = (0, import_react21.forwardRef)(
|
|
|
2526
2919
|
height: "20",
|
|
2527
2920
|
viewBox: "0 0 20 20",
|
|
2528
2921
|
fill: "none",
|
|
2529
|
-
children: /* @__PURE__ */ (0,
|
|
2922
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2530
2923
|
"path",
|
|
2531
2924
|
{
|
|
2532
2925
|
d: "M14.7119 6.0625L10.7744 10L14.7119 13.9375L13.9375 14.7119L10 10.7744L6.0625 14.7119L5.28809 13.9375L9.22559 10L5.28809 6.0625L6.0625 5.28809L10 9.22559L13.9375 5.28809L14.7119 6.0625Z",
|
|
@@ -2544,7 +2937,7 @@ var TextArea = (0, import_react21.forwardRef)(
|
|
|
2544
2937
|
});
|
|
2545
2938
|
}
|
|
2546
2939
|
}
|
|
2547
|
-
) : success ? /* @__PURE__ */ (0,
|
|
2940
|
+
) : success ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2548
2941
|
"svg",
|
|
2549
2942
|
{
|
|
2550
2943
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2553,7 +2946,7 @@ var TextArea = (0, import_react21.forwardRef)(
|
|
|
2553
2946
|
viewBox: "0 0 20 20",
|
|
2554
2947
|
fill: "none",
|
|
2555
2948
|
className: "shrink-0 text-accent-success flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2556
|
-
children: /* @__PURE__ */ (0,
|
|
2949
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2557
2950
|
"path",
|
|
2558
2951
|
{
|
|
2559
2952
|
fillRule: "evenodd",
|
|
@@ -2563,7 +2956,7 @@ var TextArea = (0, import_react21.forwardRef)(
|
|
|
2563
2956
|
}
|
|
2564
2957
|
)
|
|
2565
2958
|
}
|
|
2566
|
-
) : error ? /* @__PURE__ */ (0,
|
|
2959
|
+
) : error ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2567
2960
|
"svg",
|
|
2568
2961
|
{
|
|
2569
2962
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2572,7 +2965,7 @@ var TextArea = (0, import_react21.forwardRef)(
|
|
|
2572
2965
|
viewBox: "0 0 20 20",
|
|
2573
2966
|
fill: "none",
|
|
2574
2967
|
className: "shrink-0 text-text-area-text-danger flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2575
|
-
children: /* @__PURE__ */ (0,
|
|
2968
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2576
2969
|
"path",
|
|
2577
2970
|
{
|
|
2578
2971
|
d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
|
|
@@ -2580,237 +2973,42 @@ var TextArea = (0, import_react21.forwardRef)(
|
|
|
2580
2973
|
}
|
|
2581
2974
|
)
|
|
2582
2975
|
}
|
|
2583
|
-
) : /* @__PURE__ */ (0,
|
|
2976
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, {})
|
|
2584
2977
|
]
|
|
2585
2978
|
}
|
|
2586
2979
|
),
|
|
2587
|
-
error ? /* @__PURE__ */ (0,
|
|
2980
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-caption-caption text-left items-left text-text-area-text-danger", children: error }) : helperText ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2588
2981
|
"p",
|
|
2589
2982
|
{
|
|
2590
2983
|
className: `text-caption-caption text-left items-left ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-secondary"}`,
|
|
2591
2984
|
children: helperText
|
|
2592
2985
|
}
|
|
2593
|
-
) : /* @__PURE__ */ (0,
|
|
2986
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, {})
|
|
2594
2987
|
] });
|
|
2595
2988
|
}
|
|
2596
2989
|
);
|
|
2597
2990
|
TextArea.displayName = "TextArea";
|
|
2598
2991
|
|
|
2599
|
-
// src/components/TextField/TextField.tsx
|
|
2600
|
-
var import_react22 = require("react");
|
|
2601
|
-
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2602
|
-
var TextField = (0, import_react22.forwardRef)(
|
|
2603
|
-
(_a, ref) => {
|
|
2604
|
-
var _b = _a, {
|
|
2605
|
-
size = "md",
|
|
2606
|
-
error,
|
|
2607
|
-
label,
|
|
2608
|
-
placeholder,
|
|
2609
|
-
helperText,
|
|
2610
|
-
prefix,
|
|
2611
|
-
suffix,
|
|
2612
|
-
optional = false,
|
|
2613
|
-
success = false,
|
|
2614
|
-
pending = false,
|
|
2615
|
-
clearable = true,
|
|
2616
|
-
disabled = false,
|
|
2617
|
-
type,
|
|
2618
|
-
value,
|
|
2619
|
-
onChange,
|
|
2620
|
-
onFocus,
|
|
2621
|
-
onBlur,
|
|
2622
|
-
className
|
|
2623
|
-
} = _b, props = __objRest(_b, [
|
|
2624
|
-
"size",
|
|
2625
|
-
"error",
|
|
2626
|
-
"label",
|
|
2627
|
-
"placeholder",
|
|
2628
|
-
"helperText",
|
|
2629
|
-
"prefix",
|
|
2630
|
-
"suffix",
|
|
2631
|
-
"optional",
|
|
2632
|
-
"success",
|
|
2633
|
-
"pending",
|
|
2634
|
-
"clearable",
|
|
2635
|
-
"disabled",
|
|
2636
|
-
"type",
|
|
2637
|
-
"value",
|
|
2638
|
-
"onChange",
|
|
2639
|
-
"onFocus",
|
|
2640
|
-
"onBlur",
|
|
2641
|
-
"className"
|
|
2642
|
-
]);
|
|
2643
|
-
const [isFocused, setIsFocused] = (0, import_react22.useState)(false);
|
|
2644
|
-
const isActive = isFocused && !!value;
|
|
2645
|
-
const iconButtonSize = size === "lg" ? "m" : "s";
|
|
2646
|
-
const inputRef = (0, import_react22.useRef)(null);
|
|
2647
|
-
(0, import_react22.useImperativeHandle)(ref, () => inputRef.current);
|
|
2648
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
2649
|
-
label ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2650
|
-
"p",
|
|
2651
|
-
{
|
|
2652
|
-
className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`,
|
|
2653
|
-
children: [
|
|
2654
|
-
label,
|
|
2655
|
-
optional && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-text-field-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
2656
|
-
]
|
|
2657
|
-
}
|
|
2658
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, {}),
|
|
2659
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2660
|
-
"div",
|
|
2661
|
-
{
|
|
2662
|
-
className: `flex items-center gap-8 w-full rounded-6 border ${size === "lg" ? "h-48 py-16" : "h-40 py-12"} px-16 ${disabled ? "cursor-not-allowed" : "cursor-text"} ${disabled ? "bg-text-field-background-disabled border-text-field-border-disabled" : error ? `bg-text-field-background-enabled border-text-field-border-danger ${isFocused ? "ring-1 ring-inset ring-text-field-border-danger" : ""}` : isActive ? "bg-text-field-background-enabled border-text-field-border-active ring-1 ring-inset ring-text-field-border-active" : isFocused ? "bg-text-field-background-enabled border-text-field-border-focus ring-1 ring-inset ring-text-field-border-focus" : "bg-text-field-background-enabled border-text-field-border-enabled hover:border-text-field-border-hover"} ${className != null ? className : ""}`,
|
|
2663
|
-
onMouseDown: (e) => {
|
|
2664
|
-
var _a2;
|
|
2665
|
-
if (e.target !== inputRef.current && !disabled) {
|
|
2666
|
-
e.preventDefault();
|
|
2667
|
-
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
2668
|
-
}
|
|
2669
|
-
},
|
|
2670
|
-
children: [
|
|
2671
|
-
prefix && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2672
|
-
"span",
|
|
2673
|
-
{
|
|
2674
|
-
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
2675
|
-
children: prefix
|
|
2676
|
-
}
|
|
2677
|
-
),
|
|
2678
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2679
|
-
"input",
|
|
2680
|
-
__spreadValues({
|
|
2681
|
-
ref: inputRef,
|
|
2682
|
-
type: type || "text",
|
|
2683
|
-
placeholder,
|
|
2684
|
-
disabled: disabled || pending,
|
|
2685
|
-
onFocus: (e) => {
|
|
2686
|
-
setIsFocused(true);
|
|
2687
|
-
onFocus == null ? void 0 : onFocus(e);
|
|
2688
|
-
},
|
|
2689
|
-
onBlur: (e) => {
|
|
2690
|
-
setIsFocused(false);
|
|
2691
|
-
onBlur == null ? void 0 : onBlur(e);
|
|
2692
|
-
},
|
|
2693
|
-
value,
|
|
2694
|
-
onChange,
|
|
2695
|
-
className: `w-full min-w-0 text-body-small bg-transparent focus:outline-none placeholder:text-text-field-text-tertiary ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`
|
|
2696
|
-
}, props)
|
|
2697
|
-
),
|
|
2698
|
-
suffix && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2699
|
-
"span",
|
|
2700
|
-
{
|
|
2701
|
-
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
2702
|
-
children: suffix
|
|
2703
|
-
}
|
|
2704
|
-
),
|
|
2705
|
-
(pending || clearable || success || error) && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2706
|
-
"span",
|
|
2707
|
-
{
|
|
2708
|
-
className: `shrink-0 flex items-center justify-center ${size === "lg" ? "h-40 w-40" : "h-32 w-32"}`,
|
|
2709
|
-
children: pending ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Loading, { size: "sm" }) : clearable && isFocused && value ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2710
|
-
IconButton,
|
|
2711
|
-
{
|
|
2712
|
-
size: iconButtonSize,
|
|
2713
|
-
"aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
2714
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2715
|
-
"svg",
|
|
2716
|
-
{
|
|
2717
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2718
|
-
width: "20",
|
|
2719
|
-
height: "20",
|
|
2720
|
-
viewBox: "0 0 20 20",
|
|
2721
|
-
fill: "none",
|
|
2722
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2723
|
-
"path",
|
|
2724
|
-
{
|
|
2725
|
-
d: "M14.7119 6.0625L10.7744 10L14.7119 13.9375L13.9375 14.7119L10 10.7744L6.0625 14.7119L5.28809 13.9375L9.22559 10L5.28809 6.0625L6.0625 5.28809L10 9.22559L13.9375 5.28809L14.7119 6.0625Z",
|
|
2726
|
-
fill: "currentColor"
|
|
2727
|
-
}
|
|
2728
|
-
)
|
|
2729
|
-
}
|
|
2730
|
-
),
|
|
2731
|
-
onMouseDown: (e) => {
|
|
2732
|
-
e.preventDefault();
|
|
2733
|
-
},
|
|
2734
|
-
onClick: () => {
|
|
2735
|
-
onChange == null ? void 0 : onChange({
|
|
2736
|
-
target: { value: "" }
|
|
2737
|
-
});
|
|
2738
|
-
}
|
|
2739
|
-
}
|
|
2740
|
-
) : success ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2741
|
-
"svg",
|
|
2742
|
-
{
|
|
2743
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2744
|
-
width: "20",
|
|
2745
|
-
height: "20",
|
|
2746
|
-
viewBox: "0 0 20 20",
|
|
2747
|
-
fill: "none",
|
|
2748
|
-
className: "text-accent-success flex h-20 w-20 items-center justify-center",
|
|
2749
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2750
|
-
"path",
|
|
2751
|
-
{
|
|
2752
|
-
fillRule: "evenodd",
|
|
2753
|
-
clipRule: "evenodd",
|
|
2754
|
-
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
2755
|
-
fill: "currentColor"
|
|
2756
|
-
}
|
|
2757
|
-
)
|
|
2758
|
-
}
|
|
2759
|
-
) : error ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2760
|
-
"svg",
|
|
2761
|
-
{
|
|
2762
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2763
|
-
width: "20",
|
|
2764
|
-
height: "20",
|
|
2765
|
-
viewBox: "0 0 20 20",
|
|
2766
|
-
fill: "none",
|
|
2767
|
-
className: "text-text-field-text-danger flex h-20 w-20 items-center justify-center",
|
|
2768
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2769
|
-
"path",
|
|
2770
|
-
{
|
|
2771
|
-
d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
|
|
2772
|
-
fill: "currentColor"
|
|
2773
|
-
}
|
|
2774
|
-
)
|
|
2775
|
-
}
|
|
2776
|
-
) : null
|
|
2777
|
-
}
|
|
2778
|
-
)
|
|
2779
|
-
]
|
|
2780
|
-
}
|
|
2781
|
-
),
|
|
2782
|
-
error ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-caption-caption text-left items-left text-text-field-text-danger", children: error }) : helperText ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2783
|
-
"p",
|
|
2784
|
-
{
|
|
2785
|
-
className: `text-caption-caption text-left items-left ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-secondary"}`,
|
|
2786
|
-
children: helperText
|
|
2787
|
-
}
|
|
2788
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, {})
|
|
2789
|
-
] });
|
|
2790
|
-
}
|
|
2791
|
-
);
|
|
2792
|
-
TextField.displayName = "TextField";
|
|
2793
|
-
|
|
2794
2992
|
// src/components/Toast/Toast.tsx
|
|
2795
|
-
var
|
|
2796
|
-
var
|
|
2993
|
+
var import_react24 = require("react");
|
|
2994
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2797
2995
|
function CheckCircleIcon({ className }) {
|
|
2798
|
-
return /* @__PURE__ */ (0,
|
|
2799
|
-
/* @__PURE__ */ (0,
|
|
2800
|
-
/* @__PURE__ */ (0,
|
|
2996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2997
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2998
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
2801
2999
|
] });
|
|
2802
3000
|
}
|
|
2803
3001
|
function ProgressIcon({ className }) {
|
|
2804
|
-
return /* @__PURE__ */ (0,
|
|
3002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Loading, { size: "sm", className });
|
|
2805
3003
|
}
|
|
2806
3004
|
function ErrorIcon({ className }) {
|
|
2807
|
-
return /* @__PURE__ */ (0,
|
|
2808
|
-
/* @__PURE__ */ (0,
|
|
2809
|
-
/* @__PURE__ */ (0,
|
|
3005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
3006
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
3007
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M10 6.5v4M10 13.5h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
2810
3008
|
] });
|
|
2811
3009
|
}
|
|
2812
3010
|
function CloseIcon5({ className }) {
|
|
2813
|
-
return /* @__PURE__ */ (0,
|
|
3011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
2814
3012
|
}
|
|
2815
3013
|
var defaultIcons3 = {
|
|
2816
3014
|
default: CheckCircleIcon,
|
|
@@ -2827,7 +3025,7 @@ var iconColorClasses = {
|
|
|
2827
3025
|
progress: "text-toast-progress-icon",
|
|
2828
3026
|
error: "text-toast-error-icon"
|
|
2829
3027
|
};
|
|
2830
|
-
var Toast = (0,
|
|
3028
|
+
var Toast = (0, import_react24.forwardRef)(
|
|
2831
3029
|
(_a, ref) => {
|
|
2832
3030
|
var _b = _a, {
|
|
2833
3031
|
type = "default",
|
|
@@ -2855,10 +3053,10 @@ var Toast = (0, import_react23.forwardRef)(
|
|
|
2855
3053
|
typeClasses[type],
|
|
2856
3054
|
className
|
|
2857
3055
|
].filter(Boolean).join(" ");
|
|
2858
|
-
return /* @__PURE__ */ (0,
|
|
2859
|
-
icon && /* @__PURE__ */ (0,
|
|
2860
|
-
/* @__PURE__ */ (0,
|
|
2861
|
-
actionLabel && onAction && /* @__PURE__ */ (0,
|
|
3056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
3057
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: `shrink-0 ${iconColorClasses[type]}`, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
3058
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "flex-1 text-sm font-medium leading-20 truncate", children }),
|
|
3059
|
+
actionLabel && onAction && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2862
3060
|
"button",
|
|
2863
3061
|
{
|
|
2864
3062
|
type: "button",
|
|
@@ -2867,14 +3065,14 @@ var Toast = (0, import_react23.forwardRef)(
|
|
|
2867
3065
|
children: actionLabel
|
|
2868
3066
|
}
|
|
2869
3067
|
),
|
|
2870
|
-
onDismiss && /* @__PURE__ */ (0,
|
|
3068
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2871
3069
|
"button",
|
|
2872
3070
|
{
|
|
2873
3071
|
type: "button",
|
|
2874
3072
|
onClick: onDismiss,
|
|
2875
3073
|
className: "shrink-0 p-4 rounded-md text-toast-dismiss hover:text-toast-dismiss-hover transition-colors",
|
|
2876
3074
|
"aria-label": "Dismiss",
|
|
2877
|
-
children: /* @__PURE__ */ (0,
|
|
3075
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CloseIcon5, { className: "h-16 w-16" })
|
|
2878
3076
|
}
|
|
2879
3077
|
)
|
|
2880
3078
|
] }));
|
|
@@ -2883,9 +3081,9 @@ var Toast = (0, import_react23.forwardRef)(
|
|
|
2883
3081
|
Toast.displayName = "Toast";
|
|
2884
3082
|
|
|
2885
3083
|
// src/components/ToggleSwitch/ToggleSwitch.tsx
|
|
2886
|
-
var
|
|
2887
|
-
var
|
|
2888
|
-
var ToggleSwitch = (0,
|
|
3084
|
+
var import_react25 = require("react");
|
|
3085
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3086
|
+
var ToggleSwitch = (0, import_react25.forwardRef)(
|
|
2889
3087
|
(_a, ref) => {
|
|
2890
3088
|
var _b = _a, {
|
|
2891
3089
|
value,
|
|
@@ -2900,14 +3098,14 @@ var ToggleSwitch = (0, import_react24.forwardRef)(
|
|
|
2900
3098
|
"setIsSelected",
|
|
2901
3099
|
"className"
|
|
2902
3100
|
]);
|
|
2903
|
-
return /* @__PURE__ */ (0,
|
|
3101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2904
3102
|
"label",
|
|
2905
3103
|
__spreadProps(__spreadValues({
|
|
2906
3104
|
ref,
|
|
2907
3105
|
className: `inline-flex items-center ${className}`
|
|
2908
3106
|
}, rest), {
|
|
2909
3107
|
children: [
|
|
2910
|
-
/* @__PURE__ */ (0,
|
|
3108
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2911
3109
|
"input",
|
|
2912
3110
|
{
|
|
2913
3111
|
type: "checkbox",
|
|
@@ -2917,7 +3115,7 @@ var ToggleSwitch = (0, import_react24.forwardRef)(
|
|
|
2917
3115
|
onChange: () => !isDisabled && (setIsSelected == null ? void 0 : setIsSelected(!isSelected))
|
|
2918
3116
|
}
|
|
2919
3117
|
),
|
|
2920
|
-
/* @__PURE__ */ (0,
|
|
3118
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2921
3119
|
"div",
|
|
2922
3120
|
{
|
|
2923
3121
|
className: `${isDisabled ? "opacity-40 cursor-not-allowed" : "cursor-pointer hover:bg-gray-300 hover:peer-checked:bg-green-700"} relative w-48 h-26 bg-gray-200 rounded-full peer-checked:after:translate-x-22 rtl:peer-checked:after:-translate-x-22 peer-checked:after:border-white after:content-[''] after:absolute after:top-4 after:left-4 after:bg-white after:border-gray-300 after:border after:rounded-full after:h-18 after:w-18 after:transition-all peer-checked:bg-green-600 `
|
|
@@ -2931,9 +3129,9 @@ var ToggleSwitch = (0, import_react24.forwardRef)(
|
|
|
2931
3129
|
ToggleSwitch.displayName = "ToggleSwitch";
|
|
2932
3130
|
|
|
2933
3131
|
// src/components/Tooltip/Tooltip.tsx
|
|
2934
|
-
var
|
|
2935
|
-
var
|
|
2936
|
-
var Tooltip = (0,
|
|
3132
|
+
var import_react26 = require("react");
|
|
3133
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3134
|
+
var Tooltip = (0, import_react26.forwardRef)(
|
|
2937
3135
|
(_a, ref) => {
|
|
2938
3136
|
var _b = _a, {
|
|
2939
3137
|
size = "md",
|
|
@@ -2950,10 +3148,10 @@ var Tooltip = (0, import_react25.forwardRef)(
|
|
|
2950
3148
|
"position",
|
|
2951
3149
|
"className"
|
|
2952
3150
|
]);
|
|
2953
|
-
const wrapperRef = (0,
|
|
2954
|
-
const [isVisible, setIsVisible] = (0,
|
|
2955
|
-
const [isHovered, setIsHovered] = (0,
|
|
2956
|
-
(0,
|
|
3151
|
+
const wrapperRef = (0, import_react26.useRef)(null);
|
|
3152
|
+
const [isVisible, setIsVisible] = (0, import_react26.useState)(false);
|
|
3153
|
+
const [isHovered, setIsHovered] = (0, import_react26.useState)(false);
|
|
3154
|
+
(0, import_react26.useEffect)(() => {
|
|
2957
3155
|
const handleClickOutside = (event) => {
|
|
2958
3156
|
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
|
|
2959
3157
|
setIsVisible(false);
|
|
@@ -2965,14 +3163,14 @@ var Tooltip = (0, import_react25.forwardRef)(
|
|
|
2965
3163
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
2966
3164
|
};
|
|
2967
3165
|
}, []);
|
|
2968
|
-
return /* @__PURE__ */ (0,
|
|
3166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2969
3167
|
"div",
|
|
2970
3168
|
__spreadProps(__spreadValues({
|
|
2971
3169
|
className: `group relative inline-block ${className}`,
|
|
2972
3170
|
ref
|
|
2973
3171
|
}, rest), {
|
|
2974
3172
|
children: [
|
|
2975
|
-
/* @__PURE__ */ (0,
|
|
3173
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2976
3174
|
"div",
|
|
2977
3175
|
{
|
|
2978
3176
|
ref: wrapperRef,
|
|
@@ -2989,25 +3187,25 @@ var Tooltip = (0, import_react25.forwardRef)(
|
|
|
2989
3187
|
children
|
|
2990
3188
|
}
|
|
2991
3189
|
),
|
|
2992
|
-
/* @__PURE__ */ (0,
|
|
3190
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2993
3191
|
"div",
|
|
2994
3192
|
{
|
|
2995
3193
|
className: `min-w-100 max-w-300 whitespace-nowrap rounded bg-gray-900 text-white ${size === "lg" ? "text-body-regular py-12 px-16" : size === "md" ? "text-body-small px-12 pt-10 pb-8" : "text-body-small px-8 pt-6 pb-4"} ${position === "right" && `absolute left-full top-1/2 z-20 ml-8 -translate-y-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}` || position === "top" && `absolute bottom-full left-1/2 z-20 mb-8 -translate-x-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}` || position === "left" && `absolute right-full top-1/2 z-20 mr-8 -translate-y-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}` || position === "bottom" && `absolute left-1/2 top-full z-20 mt-8 -translate-x-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}`}`,
|
|
2996
3194
|
children: [
|
|
2997
|
-
/* @__PURE__ */ (0,
|
|
3195
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2998
3196
|
"span",
|
|
2999
3197
|
{
|
|
3000
3198
|
className: ` ${position === "right" && `absolute -left-3 top-1/2 -z-10 h-8 w-8 -translate-y-1/2 rotate-45 rounded-xs bg-black` || position === "top" && `absolute -bottom-3 left-1/2 -z-10 h-8 w-8 -translate-x-1/2 rotate-45 rounded-xs bg-black` || position === "left" && `absolute -right-3 top-1/2 -z-10 h-8 w-8 -translate-y-1/2 rotate-45 rounded-xs bg-black` || position === "bottom" && `absolute left-1/2 -top-3 -z-10 h-8 w-8 -translate-x-1/2 rotate-45 rounded-xs bg-black`} `
|
|
3001
3199
|
}
|
|
3002
3200
|
),
|
|
3003
|
-
headText ? /* @__PURE__ */ (0,
|
|
3201
|
+
headText ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3004
3202
|
"p",
|
|
3005
3203
|
{
|
|
3006
3204
|
className: `text-sm text-white font-semibold text-center ${text ? "mb-5" : ""}`,
|
|
3007
3205
|
children: headText
|
|
3008
3206
|
}
|
|
3009
|
-
) : /* @__PURE__ */ (0,
|
|
3010
|
-
text ? /* @__PURE__ */ (0,
|
|
3207
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, {}),
|
|
3208
|
+
text ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs text-white font-normal text-center text-wrap", children: text }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, {})
|
|
3011
3209
|
]
|
|
3012
3210
|
}
|
|
3013
3211
|
)
|
|
@@ -3027,6 +3225,7 @@ Tooltip.displayName = "Tooltip";
|
|
|
3027
3225
|
Button,
|
|
3028
3226
|
Checkbox,
|
|
3029
3227
|
Chip,
|
|
3228
|
+
CurrencyField,
|
|
3030
3229
|
Dialog,
|
|
3031
3230
|
Drawer,
|
|
3032
3231
|
Dropdown,
|