@refinn/core-ui 0.1.3 → 0.1.4
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/README.md +21 -0
- package/dist/index.d.mts +154 -5
- package/dist/index.d.ts +154 -5
- package/dist/index.js +1207 -135
- package/dist/index.mjs +1194 -116
- package/dist/theme.css +446 -526
- package/package.json +4 -2
package/dist/index.mjs
CHANGED
|
@@ -465,20 +465,116 @@ var Badge = forwardRef4(
|
|
|
465
465
|
);
|
|
466
466
|
Badge.displayName = "Badge";
|
|
467
467
|
|
|
468
|
+
// src/components/Branding/Branding.tsx
|
|
469
|
+
import {
|
|
470
|
+
forwardRef as forwardRef5
|
|
471
|
+
} from "react";
|
|
472
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
473
|
+
var Branding = forwardRef5(
|
|
474
|
+
(_a, ref) => {
|
|
475
|
+
var _b = _a, { type = "brand", className = "" } = _b, rest = __objRest(_b, ["type", "className"]);
|
|
476
|
+
return /* @__PURE__ */ jsx5(
|
|
477
|
+
"div",
|
|
478
|
+
__spreadProps(__spreadValues({
|
|
479
|
+
ref,
|
|
480
|
+
className: `${type === "black" ? "text-gray-900" : type === "white" ? "text-white-100" : "text-blue-600"} ${className}`
|
|
481
|
+
}, rest), {
|
|
482
|
+
children: /* @__PURE__ */ jsxs5(
|
|
483
|
+
"svg",
|
|
484
|
+
{
|
|
485
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
486
|
+
width: "89",
|
|
487
|
+
height: "20",
|
|
488
|
+
viewBox: "0 0 89 20",
|
|
489
|
+
fill: "currentColor",
|
|
490
|
+
children: [
|
|
491
|
+
/* @__PURE__ */ jsxs5("g", { "clip-path": "url(#clip0_828_998)", children: [
|
|
492
|
+
/* @__PURE__ */ jsx5(
|
|
493
|
+
"path",
|
|
494
|
+
{
|
|
495
|
+
"fill-rule": "evenodd",
|
|
496
|
+
"clip-rule": "evenodd",
|
|
497
|
+
d: "M16.7368 16.8241H16.7425L12.5943 11.7367C14.2529 11.1183 16.1138 9.64704 16.1138 6.12635C16.1138 -0.239164 10.023 0.0275032 10.0092 0.0275032H1.92874C1.91035 0.0275032 1.89311 0.0275032 1.87587 0.0275032C1.37851 0.0275032 0.901524 0.225077 0.549839 0.576762C0.198155 0.928447 0.000580351 1.40543 0.000580351 1.90279C0.000580351 2.40015 0.198155 2.87713 0.549839 3.22882C0.901524 3.5805 1.37851 3.77808 1.87587 3.77808C1.89426 3.77808 1.9115 3.77808 1.92874 3.77808H10.1149C10.7376 3.79195 11.3292 4.0526 11.7597 4.50268C12.1902 4.95277 12.4242 5.55543 12.4103 6.17808C12.3965 6.80073 12.1358 7.39236 11.6857 7.82284C11.2357 8.25331 10.633 8.48735 10.0103 8.47348H1.88621H1.87472C1.62814 8.47348 1.38398 8.52212 1.15623 8.61662C0.928482 8.71112 0.721611 8.84963 0.547468 9.0242C0.373325 9.19877 0.23533 9.40598 0.141388 9.63396C0.0474455 9.86194 -0.00059909 10.1062 5.6384e-06 10.3528C5.6384e-06 10.3528 5.6384e-06 10.3631 5.6384e-06 10.3677V17.9746C0.0121171 18.4636 0.214886 18.9286 0.565035 19.2701C0.915184 19.6117 1.38498 19.8029 1.87414 19.8029C2.36331 19.8029 2.8331 19.6117 3.18325 19.2701C3.5334 18.9286 3.73617 18.4636 3.74828 17.9746V12.1631H8.14943L13.8149 19.1643L13.8218 19.1585C14.1314 19.5449 14.5818 19.7925 15.0739 19.8468C15.566 19.9012 16.0596 19.7578 16.446 19.4482C16.8324 19.1386 17.08 18.6882 17.1343 18.1961C17.1886 17.704 17.0452 17.2104 16.7356 16.8241H16.7368Z",
|
|
498
|
+
fill: "currentColor"
|
|
499
|
+
}
|
|
500
|
+
),
|
|
501
|
+
/* @__PURE__ */ jsx5(
|
|
502
|
+
"path",
|
|
503
|
+
{
|
|
504
|
+
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",
|
|
505
|
+
fill: "currentColor"
|
|
506
|
+
}
|
|
507
|
+
),
|
|
508
|
+
/* @__PURE__ */ jsx5(
|
|
509
|
+
"path",
|
|
510
|
+
{
|
|
511
|
+
"fill-rule": "evenodd",
|
|
512
|
+
"clip-rule": "evenodd",
|
|
513
|
+
d: "M44.1379 5.09414H41.4805V4.56196C41.4808 4.16209 41.6398 3.77869 41.9225 3.49595C42.2052 3.2132 42.5886 3.05422 42.9885 3.05391H43.9977C44.398 3.05391 44.7818 2.89491 45.0649 2.61188C45.3479 2.32885 45.5069 1.94498 45.5069 1.54472C45.5069 1.14445 45.3479 0.760585 45.0649 0.477556C44.7818 0.194527 44.398 0.0355225 43.9977 0.0355225H41.9713V0.0435684C41.0274 0.0827094 40.1351 0.485118 39.4809 1.1667C38.8268 1.84829 38.4613 2.75632 38.4609 3.70104V5.08955H37.7402C37.3897 5.08955 37.0534 5.22881 36.8056 5.4767C36.5577 5.7246 36.4184 6.06081 36.4184 6.41138C36.4184 6.76196 36.5577 7.09817 36.8056 7.34607C37.0534 7.59396 37.3897 7.73322 37.7402 7.73322H38.4609V18.4229H38.4713C38.4925 18.806 38.6597 19.1665 38.9384 19.4303C39.2172 19.694 39.5864 19.841 39.9701 19.841C40.3539 19.841 40.7231 19.694 41.0018 19.4303C41.2806 19.1665 41.4477 18.806 41.469 18.4229H41.4793V7.73322H44.1379C44.4885 7.73322 44.8247 7.59396 45.0726 7.34607C45.3205 7.09817 45.4598 6.76196 45.4598 6.41138C45.4598 6.06081 45.3205 5.7246 45.0726 5.4767C44.8247 5.22881 44.4885 5.08955 44.1379 5.08955V5.09414Z",
|
|
514
|
+
fill: "currentColor"
|
|
515
|
+
}
|
|
516
|
+
),
|
|
517
|
+
/* @__PURE__ */ jsx5(
|
|
518
|
+
"path",
|
|
519
|
+
{
|
|
520
|
+
"fill-rule": "evenodd",
|
|
521
|
+
"clip-rule": "evenodd",
|
|
522
|
+
d: "M72.2724 10.154C72.2414 7.48161 70.0678 5.04368 67.3885 5.04368C66.4874 5.04385 65.6039 5.29338 64.8358 5.76464C64.0678 6.2359 63.4451 6.91052 63.0368 7.7138C63.0368 7.7138 63.0368 6.56437 63.0368 6.53334C63.0368 6.13307 62.8778 5.7492 62.5947 5.46617C62.3117 5.18314 61.9278 5.02414 61.5276 5.02414C61.1273 5.02414 60.7434 5.18314 60.4604 5.46617C60.1774 5.7492 60.0184 6.13307 60.0184 6.53334V18.4356H60.0287C60.0499 18.8188 60.2171 19.1793 60.4959 19.443C60.7746 19.7068 61.1438 19.8537 61.5276 19.8537C61.9113 19.8537 62.2805 19.7068 62.5593 19.443C62.838 19.1793 63.0052 18.8188 63.0264 18.4356H63.0368V11.1805L63.0483 11.1989C63.0483 9.47472 64.4414 7.80575 66.1598 7.80575C67.7758 7.80575 69.1046 9.32069 69.2563 10.8977V18.4368H69.2666C69.2879 18.82 69.455 19.1804 69.7338 19.4442C70.0126 19.7079 70.3817 19.8549 70.7655 19.8549C71.1493 19.8549 71.5184 19.7079 71.7972 19.4442C72.076 19.1804 72.2431 18.82 72.2644 18.4368H72.2747V10.154H72.2724Z",
|
|
523
|
+
fill: "currentColor"
|
|
524
|
+
}
|
|
525
|
+
),
|
|
526
|
+
/* @__PURE__ */ jsx5(
|
|
527
|
+
"path",
|
|
528
|
+
{
|
|
529
|
+
"fill-rule": "evenodd",
|
|
530
|
+
"clip-rule": "evenodd",
|
|
531
|
+
d: "M55.4322 2.2V1.96897H55.4126C55.2287 0.904602 53.7586 0.0758667 51.9724 0.0758667C50.1862 0.0758667 48.7161 0.905751 48.5322 1.96897H48.5126V4.4046H48.5241C48.6391 5.51035 50.1333 6.38621 51.9724 6.38621C53.8115 6.38621 55.3057 5.51035 55.4207 4.4046H55.431V4.27242L55.4322 2.2ZM54.1678 4.40575C54.1678 4.80115 53.1851 5.12184 51.9724 5.12184C50.7598 5.12184 49.777 4.80115 49.777 4.40575V3.53564C49.777 3.93104 50.7598 4.25173 51.9724 4.25173C53.1851 4.25173 54.1678 3.93104 54.1678 3.53564V4.40575ZM51.9724 3.09426C50.7598 3.09426 49.777 2.69196 49.777 2.19541C49.777 1.69885 50.7598 1.29541 51.9724 1.29541C53.1851 1.29541 54.1678 1.69771 54.1678 2.19541C54.1678 2.69311 53.1839 3.09426 51.9724 3.09426Z",
|
|
532
|
+
fill: "currentColor"
|
|
533
|
+
}
|
|
534
|
+
),
|
|
535
|
+
/* @__PURE__ */ jsx5(
|
|
536
|
+
"path",
|
|
537
|
+
{
|
|
538
|
+
"fill-rule": "evenodd",
|
|
539
|
+
"clip-rule": "evenodd",
|
|
540
|
+
d: "M55.4321 17.708V9.16092V9.08046C55.3689 7.94483 53.8482 7.03448 51.9781 7.03448C50.108 7.03448 48.5804 7.94598 48.5172 9.08046H48.5115V17.7012C48.5115 17.7012 48.5115 17.7115 48.5115 17.7161C48.5115 18.8862 50.0609 19.8356 51.9724 19.8356C53.8839 19.8356 55.4333 18.8874 55.4333 17.7161C55.4333 17.7161 55.4333 17.7058 55.4333 17.7012L55.4321 17.708ZM54.1678 17.8954C54.1678 18.2908 53.185 18.6115 51.9724 18.6115C50.7597 18.6115 49.777 18.2908 49.777 17.8954V17.0264C49.777 17.4218 50.7597 17.7425 51.9724 17.7425C53.185 17.7425 54.1678 17.4218 54.1678 17.0264V17.8954ZM54.1678 15.792C54.1678 16.1874 53.185 16.508 51.9724 16.508C50.7597 16.508 49.777 16.1874 49.777 15.792V14.923C49.777 15.3184 50.7597 15.6391 51.9724 15.6391C53.185 15.6391 54.1678 15.3184 54.1678 14.923V15.792ZM54.1678 13.6885C54.1678 14.0839 53.185 14.4046 51.9724 14.4046C50.7597 14.4046 49.777 14.0839 49.777 13.6885V12.8195C49.777 13.2149 50.7597 13.5356 51.9724 13.5356C53.185 13.5356 54.1678 13.2149 54.1678 12.8195V13.6885ZM54.1678 11.5161C54.1678 11.9115 53.185 12.2322 51.9724 12.2322C50.7597 12.2322 49.777 11.9115 49.777 11.5161V10.646C49.777 11.0414 50.7597 11.3621 51.9724 11.3621C53.185 11.3621 54.1678 11.0414 54.1678 10.646V11.5161ZM51.9724 10.0678C50.7597 10.0678 49.777 9.66552 49.777 9.16897C49.777 8.67242 50.7597 8.27012 51.9724 8.27012C53.185 8.27012 54.1678 8.67242 54.1678 9.16897C54.1678 9.66552 53.1839 10.0667 51.9724 10.0667V10.0678Z",
|
|
541
|
+
fill: "currentColor"
|
|
542
|
+
}
|
|
543
|
+
),
|
|
544
|
+
/* @__PURE__ */ jsx5(
|
|
545
|
+
"path",
|
|
546
|
+
{
|
|
547
|
+
"fill-rule": "evenodd",
|
|
548
|
+
"clip-rule": "evenodd",
|
|
549
|
+
d: "M88.8885 10.154C88.8574 7.48161 86.6839 5.04368 84.0046 5.04368C83.1039 5.04427 82.2209 5.294 81.4532 5.76524C80.6856 6.23648 80.0633 6.91086 79.6552 7.71379C79.6552 7.71379 79.6552 6.56437 79.6552 6.53333C79.6552 6.13307 79.4962 5.7492 79.2131 5.46617C78.9301 5.18314 78.5462 5.02414 78.146 5.02414C77.7457 5.02414 77.3618 5.18314 77.0788 5.46617C76.7958 5.7492 76.6368 6.13307 76.6368 6.53333V18.4356H76.6471C76.6684 18.8188 76.8355 19.1793 77.1143 19.443C77.393 19.7068 77.7622 19.8537 78.146 19.8537C78.5297 19.8537 78.8989 19.7068 79.1777 19.443C79.4564 19.1793 79.6236 18.8188 79.6448 18.4356H79.6552V11.1805L79.6667 11.1989C79.6667 9.47471 81.0598 7.80575 82.7781 7.80575C84.3942 7.80575 85.723 9.32069 85.8747 10.8977V18.4368H85.885C85.9063 18.8199 86.0734 19.1804 86.3522 19.4442C86.6309 19.7079 87.0001 19.8549 87.3839 19.8549C87.7676 19.8549 88.1368 19.7079 88.4156 19.4442C88.6943 19.1804 88.8615 18.8199 88.8827 18.4368H88.8931V10.154H88.8885Z",
|
|
550
|
+
fill: "currentColor"
|
|
551
|
+
}
|
|
552
|
+
)
|
|
553
|
+
] }),
|
|
554
|
+
/* @__PURE__ */ jsx5("defs", { children: /* @__PURE__ */ jsx5("clipPath", { id: "clip0_828_998", children: /* @__PURE__ */ jsx5("rect", { width: "88.892", height: "20", fill: "currentColor" }) }) })
|
|
555
|
+
]
|
|
556
|
+
}
|
|
557
|
+
)
|
|
558
|
+
})
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
);
|
|
562
|
+
Branding.displayName = "Branding";
|
|
563
|
+
|
|
468
564
|
// src/components/Button/Button.tsx
|
|
469
|
-
import { forwardRef as
|
|
565
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
470
566
|
|
|
471
567
|
// src/components/Loading/Loading.tsx
|
|
472
|
-
import { forwardRef as
|
|
473
|
-
import { jsx as
|
|
474
|
-
var Loading =
|
|
568
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
569
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
570
|
+
var Loading = forwardRef6(
|
|
475
571
|
(_a, ref) => {
|
|
476
572
|
var _b = _a, { size = "sm", isDark = false, className = "" } = _b, rest = __objRest(_b, ["size", "isDark", "className"]);
|
|
477
573
|
const containerClasses = [
|
|
478
574
|
isDark ? "text-white-100" : "text-blue-600",
|
|
479
575
|
className
|
|
480
576
|
].filter(Boolean).join(" ");
|
|
481
|
-
return size === "sm" && !isDark ? /* @__PURE__ */
|
|
577
|
+
return size === "sm" && !isDark ? /* @__PURE__ */ jsx6("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ jsxs6(
|
|
482
578
|
"svg",
|
|
483
579
|
{
|
|
484
580
|
className: "animate-spin",
|
|
@@ -488,7 +584,7 @@ var Loading = forwardRef5(
|
|
|
488
584
|
viewBox: "0 0 18 18",
|
|
489
585
|
fill: "none",
|
|
490
586
|
children: [
|
|
491
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ jsx6(
|
|
492
588
|
"path",
|
|
493
589
|
{
|
|
494
590
|
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",
|
|
@@ -496,7 +592,7 @@ var Loading = forwardRef5(
|
|
|
496
592
|
"stroke-width": "2"
|
|
497
593
|
}
|
|
498
594
|
),
|
|
499
|
-
/* @__PURE__ */
|
|
595
|
+
/* @__PURE__ */ jsx6(
|
|
500
596
|
"path",
|
|
501
597
|
{
|
|
502
598
|
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",
|
|
@@ -506,7 +602,7 @@ var Loading = forwardRef5(
|
|
|
506
602
|
)
|
|
507
603
|
]
|
|
508
604
|
}
|
|
509
|
-
) })) : /* @__PURE__ */
|
|
605
|
+
) })) : /* @__PURE__ */ jsx6("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ jsx6(
|
|
510
606
|
"svg",
|
|
511
607
|
{
|
|
512
608
|
className: "animate-spin",
|
|
@@ -514,7 +610,7 @@ var Loading = forwardRef5(
|
|
|
514
610
|
height: size === "sm" ? 18 : 88,
|
|
515
611
|
viewBox: "0 0 20 20",
|
|
516
612
|
fill: "none",
|
|
517
|
-
children: /* @__PURE__ */
|
|
613
|
+
children: /* @__PURE__ */ jsx6(
|
|
518
614
|
"path",
|
|
519
615
|
{
|
|
520
616
|
d: "M10 2.5a7.5 7.5 0 1 0 7.5 7.5",
|
|
@@ -530,7 +626,7 @@ var Loading = forwardRef5(
|
|
|
530
626
|
Loading.displayName = "Loading";
|
|
531
627
|
|
|
532
628
|
// src/components/Button/Button.tsx
|
|
533
|
-
import { jsx as
|
|
629
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
534
630
|
var variantClasses = {
|
|
535
631
|
primary: [
|
|
536
632
|
"bg-blue-600 text-white-100",
|
|
@@ -574,7 +670,7 @@ var sizeClasses3 = {
|
|
|
574
670
|
lg: "px-24 py-12 text-label-large",
|
|
575
671
|
xl: "px-32 py-16 text-label-large"
|
|
576
672
|
};
|
|
577
|
-
var Button =
|
|
673
|
+
var Button = forwardRef7(
|
|
578
674
|
(_a, ref) => {
|
|
579
675
|
var _b = _a, {
|
|
580
676
|
variant = "primary",
|
|
@@ -609,8 +705,8 @@ var Button = forwardRef6(
|
|
|
609
705
|
rounded ? "rounded-full" : size === "sm" ? "rounded-6" : size === "xl" ? "rounded-12" : "rounded-8",
|
|
610
706
|
className
|
|
611
707
|
].filter(Boolean).join(" ");
|
|
612
|
-
return /* @__PURE__ */
|
|
613
|
-
loading ? /* @__PURE__ */
|
|
708
|
+
return /* @__PURE__ */ jsxs7("button", __spreadProps(__spreadValues({ ref, disabled: isDisabled, className: classes }, rest), { children: [
|
|
709
|
+
loading ? /* @__PURE__ */ jsx7(Loading, { size: "sm", isDark: variant === "primary" || variant === "transparent" }) : startIcon,
|
|
614
710
|
children,
|
|
615
711
|
!loading && endIcon
|
|
616
712
|
] }));
|
|
@@ -619,10 +715,10 @@ var Button = forwardRef6(
|
|
|
619
715
|
Button.displayName = "Button";
|
|
620
716
|
|
|
621
717
|
// src/components/BottomSheet/BottomSheet.tsx
|
|
622
|
-
import React, { useEffect, useState as useState2, useCallback as useCallback2, forwardRef as
|
|
718
|
+
import React, { useEffect, useState as useState2, useCallback as useCallback2, forwardRef as forwardRef8 } from "react";
|
|
623
719
|
import { createPortal } from "react-dom";
|
|
624
|
-
import { jsx as
|
|
625
|
-
var BottomSheet =
|
|
720
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
721
|
+
var BottomSheet = forwardRef8(
|
|
626
722
|
(_a, ref) => {
|
|
627
723
|
var _b = _a, {
|
|
628
724
|
isForceOpen = false,
|
|
@@ -691,19 +787,19 @@ var BottomSheet = forwardRef7(
|
|
|
691
787
|
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
692
788
|
setIsOpen(false);
|
|
693
789
|
};
|
|
694
|
-
return /* @__PURE__ */
|
|
790
|
+
return /* @__PURE__ */ jsxs8("span", { ref, style: { display: "contents" }, children: [
|
|
695
791
|
startModalBtn && React.cloneElement(startModalBtn, {
|
|
696
792
|
onClick: handleStartClick
|
|
697
793
|
}),
|
|
698
794
|
shouldRender && createPortal(
|
|
699
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ jsxs8(
|
|
700
796
|
"div",
|
|
701
797
|
{
|
|
702
798
|
className: `fixed inset-0 z-50 flex items-end justify-center transition-opacity duration-300 ${animate ? "opacity-100" : "opacity-0"}`,
|
|
703
799
|
"aria-modal": "true",
|
|
704
800
|
role: "dialog",
|
|
705
801
|
children: [
|
|
706
|
-
/* @__PURE__ */
|
|
802
|
+
/* @__PURE__ */ jsx8(
|
|
707
803
|
"div",
|
|
708
804
|
{
|
|
709
805
|
className: "absolute inset-0 bg-black/40",
|
|
@@ -711,26 +807,26 @@ var BottomSheet = forwardRef7(
|
|
|
711
807
|
"aria-label": "Close modal"
|
|
712
808
|
}
|
|
713
809
|
),
|
|
714
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ jsxs8(
|
|
715
811
|
"div",
|
|
716
812
|
{
|
|
717
813
|
className: `flex flex-col z-10 w-full rounded-t-xl bg-white pt-8 pb-16 px-16 shadow-lg transform transition-all duration-300
|
|
718
814
|
${size === "sm" ? "h-auto max-h-auto" : size === "md" ? "h-full max-h-[85vh]" : "h-full max-h-screen rounded-t-none!"}
|
|
719
815
|
${animate ? "scale-100 translate-y-0" : "scale-95 translate-y-full"}`,
|
|
720
816
|
children: [
|
|
721
|
-
/* @__PURE__ */
|
|
722
|
-
/* @__PURE__ */
|
|
723
|
-
/* @__PURE__ */
|
|
724
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ jsxs8("div", { className: "w-full flex flex-row relative items-center pt-8 pb-16", children: [
|
|
818
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-col px-8 max-w-225", children: [
|
|
819
|
+
/* @__PURE__ */ jsx8("p", { className: "text-heading-3 text-button-sheet-text-primary", children: modalTitle }),
|
|
820
|
+
/* @__PURE__ */ jsx8("p", { className: "text-body-small text-button-sheet-text-secondary", children: modalDesc })
|
|
725
821
|
] }),
|
|
726
|
-
/* @__PURE__ */
|
|
822
|
+
/* @__PURE__ */ jsx8(
|
|
727
823
|
"i",
|
|
728
824
|
{
|
|
729
825
|
className: "fi fi-br-cross-small flex text-xl text-gray-600 w-44 h-44 absolute top-0 right-0 p-12",
|
|
730
826
|
onClick: () => handleCloseClick()
|
|
731
827
|
}
|
|
732
828
|
),
|
|
733
|
-
/* @__PURE__ */
|
|
829
|
+
/* @__PURE__ */ jsx8(
|
|
734
830
|
"div",
|
|
735
831
|
{
|
|
736
832
|
className: "text-gray-600 text-xl absolute top-0 right-0 p-12",
|
|
@@ -739,7 +835,7 @@ var BottomSheet = forwardRef7(
|
|
|
739
835
|
}
|
|
740
836
|
)
|
|
741
837
|
] }),
|
|
742
|
-
/* @__PURE__ */
|
|
838
|
+
/* @__PURE__ */ jsxs8("div", { className: "w-full h-full grow overflow-y-auto overflow-x-visible", children: [
|
|
743
839
|
children,
|
|
744
840
|
stopModalBtn && React.cloneElement(stopModalBtn, {
|
|
745
841
|
onClick: handleStopClick
|
|
@@ -761,20 +857,20 @@ BottomSheet.displayName = "BottomSheet";
|
|
|
761
857
|
|
|
762
858
|
// src/components/Checkbox/Checkbox.tsx
|
|
763
859
|
import {
|
|
764
|
-
forwardRef as
|
|
860
|
+
forwardRef as forwardRef9,
|
|
765
861
|
useId as useId2,
|
|
766
862
|
useState as useState3
|
|
767
863
|
} from "react";
|
|
768
|
-
import { jsx as
|
|
864
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
769
865
|
function CheckIcon({ className }) {
|
|
770
|
-
return /* @__PURE__ */
|
|
866
|
+
return /* @__PURE__ */ jsx9(
|
|
771
867
|
"svg",
|
|
772
868
|
{
|
|
773
869
|
className,
|
|
774
870
|
viewBox: "0 0 16 16",
|
|
775
871
|
fill: "none",
|
|
776
872
|
"aria-hidden": "true",
|
|
777
|
-
children: /* @__PURE__ */
|
|
873
|
+
children: /* @__PURE__ */ jsx9(
|
|
778
874
|
"path",
|
|
779
875
|
{
|
|
780
876
|
d: "M13.333 4.667 6 12l-3.333-3.333",
|
|
@@ -788,14 +884,14 @@ function CheckIcon({ className }) {
|
|
|
788
884
|
);
|
|
789
885
|
}
|
|
790
886
|
function IndeterminateIcon({ className }) {
|
|
791
|
-
return /* @__PURE__ */
|
|
887
|
+
return /* @__PURE__ */ jsx9(
|
|
792
888
|
"svg",
|
|
793
889
|
{
|
|
794
890
|
className,
|
|
795
891
|
viewBox: "0 0 16 16",
|
|
796
892
|
fill: "none",
|
|
797
893
|
"aria-hidden": "true",
|
|
798
|
-
children: /* @__PURE__ */
|
|
894
|
+
children: /* @__PURE__ */ jsx9(
|
|
799
895
|
"path",
|
|
800
896
|
{
|
|
801
897
|
d: "M3.333 8h9.334",
|
|
@@ -807,7 +903,7 @@ function IndeterminateIcon({ className }) {
|
|
|
807
903
|
}
|
|
808
904
|
);
|
|
809
905
|
}
|
|
810
|
-
var Checkbox =
|
|
906
|
+
var Checkbox = forwardRef9(
|
|
811
907
|
(_a, ref) => {
|
|
812
908
|
var _b = _a, {
|
|
813
909
|
label,
|
|
@@ -833,14 +929,14 @@ var Checkbox = forwardRef8(
|
|
|
833
929
|
const reactId = useId2();
|
|
834
930
|
const inputId = id != null ? id : reactId;
|
|
835
931
|
const [isChecked, setIsChecked] = useState3(defaultChecked != null ? defaultChecked : false);
|
|
836
|
-
return /* @__PURE__ */
|
|
932
|
+
return /* @__PURE__ */ jsxs9(
|
|
837
933
|
"label",
|
|
838
934
|
{
|
|
839
935
|
htmlFor: inputId,
|
|
840
936
|
className: `flex select-none font-sans ${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
841
937
|
children: [
|
|
842
|
-
/* @__PURE__ */
|
|
843
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ jsxs9("div", { className: "relative mr-16", children: [
|
|
939
|
+
/* @__PURE__ */ jsx9(
|
|
844
940
|
"input",
|
|
845
941
|
__spreadValues({
|
|
846
942
|
ref,
|
|
@@ -857,16 +953,16 @@ var Checkbox = forwardRef8(
|
|
|
857
953
|
className: "sr-only"
|
|
858
954
|
}, rest)
|
|
859
955
|
),
|
|
860
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ jsx9(
|
|
861
957
|
"div",
|
|
862
958
|
{
|
|
863
959
|
className: `box m-6 flex h-20 w-20 rounded-md items-center justify-center border ${contrast ? isChecked || indeterminate ? "border-white bg-white" : "border-white" : isChecked || indeterminate ? "bg-static-icon-brand border-static-icon-brand" : "border-static-icon-primary"}`,
|
|
864
|
-
children: isChecked ? /* @__PURE__ */
|
|
960
|
+
children: isChecked ? /* @__PURE__ */ jsx9(
|
|
865
961
|
CheckIcon,
|
|
866
962
|
{
|
|
867
963
|
className: `h-20 ${contrast ? "text-static-icon-brand" : "text-white"}`
|
|
868
964
|
}
|
|
869
|
-
) : indeterminate ? /* @__PURE__ */
|
|
965
|
+
) : indeterminate ? /* @__PURE__ */ jsx9(
|
|
870
966
|
IndeterminateIcon,
|
|
871
967
|
{
|
|
872
968
|
className: `h-20 ${contrast ? "text-static-icon-brand" : "text-white"}`
|
|
@@ -875,15 +971,15 @@ var Checkbox = forwardRef8(
|
|
|
875
971
|
}
|
|
876
972
|
)
|
|
877
973
|
] }),
|
|
878
|
-
(label || description) && /* @__PURE__ */
|
|
879
|
-
label && /* @__PURE__ */
|
|
974
|
+
(label || description) && /* @__PURE__ */ jsxs9("span", { className: "flex flex-col", children: [
|
|
975
|
+
label && /* @__PURE__ */ jsx9(
|
|
880
976
|
"span",
|
|
881
977
|
{
|
|
882
978
|
className: `text-label-large ${disabled ? "text-checkbox-text-disabled" : contrast ? "text-checkbox-text-primary-inverse" : "text-checkbox-text-primary"}`,
|
|
883
979
|
children: label
|
|
884
980
|
}
|
|
885
981
|
),
|
|
886
|
-
description && /* @__PURE__ */
|
|
982
|
+
description && /* @__PURE__ */ jsx9(
|
|
887
983
|
"span",
|
|
888
984
|
{
|
|
889
985
|
className: `text-body-small ${error ? "text-checkbox-text-danger" : disabled ? "text-checkbox-text-disabled" : contrast ? "text-checkbox-text-primary-inverse" : "text-checkbox-text-secondary"}`,
|
|
@@ -898,16 +994,94 @@ var Checkbox = forwardRef8(
|
|
|
898
994
|
);
|
|
899
995
|
Checkbox.displayName = "Checkbox";
|
|
900
996
|
|
|
997
|
+
// src/components/Chip/Chip.tsx
|
|
998
|
+
import {
|
|
999
|
+
forwardRef as forwardRef10,
|
|
1000
|
+
useState as useState4
|
|
1001
|
+
} from "react";
|
|
1002
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1003
|
+
var sizeClasses4 = {
|
|
1004
|
+
sm: "h-32 text-label-medium px-12 py-6",
|
|
1005
|
+
md: "h-40 text-label-large px-16 py-10",
|
|
1006
|
+
lg: "h-48 text-label-large px-24 py-14"
|
|
1007
|
+
};
|
|
1008
|
+
var marginImgClasses = {
|
|
1009
|
+
sm: "-ml-10 -my-4 h-28 w-28",
|
|
1010
|
+
md: "-ml-12 -my-6 h-32 w-32",
|
|
1011
|
+
lg: "-ml-18 -my-8 h-32 w-32"
|
|
1012
|
+
};
|
|
1013
|
+
var isOutlinedClasses = {
|
|
1014
|
+
true: "border border-chip-border-enabled bg-chip-background-inverse",
|
|
1015
|
+
false: "border-0 bg-chip-background-enabled"
|
|
1016
|
+
};
|
|
1017
|
+
var isDarkClasses = {
|
|
1018
|
+
true: "!bg-chip-background-black-active !text-chip-text-inverse",
|
|
1019
|
+
false: "!bg-chip-background-active !text-chip-text-inverse"
|
|
1020
|
+
};
|
|
1021
|
+
var Chip = forwardRef10(
|
|
1022
|
+
(_a, ref) => {
|
|
1023
|
+
var _b = _a, {
|
|
1024
|
+
size = "md",
|
|
1025
|
+
src,
|
|
1026
|
+
alt = "",
|
|
1027
|
+
label,
|
|
1028
|
+
icon,
|
|
1029
|
+
isOutlined = false,
|
|
1030
|
+
isDark = false,
|
|
1031
|
+
defaultSelected = false,
|
|
1032
|
+
disabled = false,
|
|
1033
|
+
className = ""
|
|
1034
|
+
} = _b, rest = __objRest(_b, [
|
|
1035
|
+
"size",
|
|
1036
|
+
"src",
|
|
1037
|
+
"alt",
|
|
1038
|
+
"label",
|
|
1039
|
+
"icon",
|
|
1040
|
+
"isOutlined",
|
|
1041
|
+
"isDark",
|
|
1042
|
+
"defaultSelected",
|
|
1043
|
+
"disabled",
|
|
1044
|
+
"className"
|
|
1045
|
+
]);
|
|
1046
|
+
const [selected, setSelected] = useState4(defaultSelected);
|
|
1047
|
+
const sz = sizeClasses4[size];
|
|
1048
|
+
const outlinedClass = isOutlinedClasses[String(isOutlined)];
|
|
1049
|
+
const darkClass = isDarkClasses[String(isDark)];
|
|
1050
|
+
const containerClasses = [
|
|
1051
|
+
"w-fit rounded-full flex flex-row gap-8 items-center justify-center text-chip-text-enabled",
|
|
1052
|
+
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
1053
|
+
outlinedClass,
|
|
1054
|
+
sz,
|
|
1055
|
+
className,
|
|
1056
|
+
selected ? darkClass : ""
|
|
1057
|
+
].filter(Boolean).join(" ");
|
|
1058
|
+
return /* @__PURE__ */ jsxs10(
|
|
1059
|
+
"div",
|
|
1060
|
+
__spreadProps(__spreadValues({
|
|
1061
|
+
ref,
|
|
1062
|
+
className: containerClasses
|
|
1063
|
+
}, rest), {
|
|
1064
|
+
onClick: () => !disabled && setSelected(!selected),
|
|
1065
|
+
children: [
|
|
1066
|
+
icon ? icon : src && /* @__PURE__ */ jsx10("img", { src, alt, className: `${marginImgClasses[size]} rounded-full` }),
|
|
1067
|
+
label
|
|
1068
|
+
]
|
|
1069
|
+
})
|
|
1070
|
+
);
|
|
1071
|
+
}
|
|
1072
|
+
);
|
|
1073
|
+
Chip.displayName = "Chip";
|
|
1074
|
+
|
|
901
1075
|
// src/components/Dialog/Dialog.tsx
|
|
902
1076
|
import React2, {
|
|
903
1077
|
useEffect as useEffect2,
|
|
904
|
-
useState as
|
|
1078
|
+
useState as useState5,
|
|
905
1079
|
useCallback as useCallback3,
|
|
906
|
-
forwardRef as
|
|
1080
|
+
forwardRef as forwardRef11
|
|
907
1081
|
} from "react";
|
|
908
1082
|
import { createPortal as createPortal2 } from "react-dom";
|
|
909
|
-
import { jsx as
|
|
910
|
-
var Dialog =
|
|
1083
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1084
|
+
var Dialog = forwardRef11(
|
|
911
1085
|
({
|
|
912
1086
|
isForceOpen = false,
|
|
913
1087
|
setIsForceOpen,
|
|
@@ -917,11 +1091,12 @@ var Dialog = forwardRef9(
|
|
|
917
1091
|
startModalBtn,
|
|
918
1092
|
stopModalBtn,
|
|
919
1093
|
afterStopBtn,
|
|
920
|
-
p = "20"
|
|
1094
|
+
p = "20",
|
|
1095
|
+
maxW = "md"
|
|
921
1096
|
}, ref) => {
|
|
922
|
-
const [isOpen, setIsOpen] =
|
|
923
|
-
const [isRender, setIsRender] =
|
|
924
|
-
const [animate, setAnimate] =
|
|
1097
|
+
const [isOpen, setIsOpen] = useState5(false);
|
|
1098
|
+
const [isRender, setIsRender] = useState5(false);
|
|
1099
|
+
const [animate, setAnimate] = useState5(false);
|
|
925
1100
|
useEffect2(() => {
|
|
926
1101
|
if (isOpen) {
|
|
927
1102
|
setIsRender(true);
|
|
@@ -961,19 +1136,19 @@ var Dialog = forwardRef9(
|
|
|
961
1136
|
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
962
1137
|
setIsOpen(false);
|
|
963
1138
|
};
|
|
964
|
-
return /* @__PURE__ */
|
|
1139
|
+
return /* @__PURE__ */ jsxs11("span", { ref, style: { display: "contents" }, children: [
|
|
965
1140
|
startModalBtn && React2.cloneElement(startModalBtn, {
|
|
966
1141
|
onClick: handleStartClick
|
|
967
1142
|
}),
|
|
968
1143
|
isRender && createPortal2(
|
|
969
|
-
/* @__PURE__ */
|
|
1144
|
+
/* @__PURE__ */ jsxs11(
|
|
970
1145
|
"div",
|
|
971
1146
|
{
|
|
972
1147
|
className: `fixed inset-0 z-50 flex items-center justify-center transition-opacity duration-300 ${animate ? "opacity-100" : "opacity-0"}`,
|
|
973
1148
|
"aria-modal": "true",
|
|
974
1149
|
role: "dialog",
|
|
975
1150
|
children: [
|
|
976
|
-
/* @__PURE__ */
|
|
1151
|
+
/* @__PURE__ */ jsx11(
|
|
977
1152
|
"div",
|
|
978
1153
|
{
|
|
979
1154
|
className: "absolute inset-0 bg-black/40",
|
|
@@ -981,12 +1156,12 @@ var Dialog = forwardRef9(
|
|
|
981
1156
|
"aria-label": "Close modal"
|
|
982
1157
|
}
|
|
983
1158
|
),
|
|
984
|
-
/* @__PURE__ */
|
|
1159
|
+
/* @__PURE__ */ jsxs11(
|
|
985
1160
|
"div",
|
|
986
1161
|
{
|
|
987
|
-
className: `relative z-10 w-[calc(100%-40px)] max-w
|
|
1162
|
+
className: `relative z-10 w-[calc(100%-40px)] max-w-${maxW} rounded-xl bg-white p-${p || "20"} shadow-lg transform transition-all duration-300 ${animate ? "scale-100 opacity-100" : "scale-95 opacity-0"}`,
|
|
988
1163
|
children: [
|
|
989
|
-
isCloseIcon && /* @__PURE__ */
|
|
1164
|
+
isCloseIcon && /* @__PURE__ */ jsx11(
|
|
990
1165
|
"svg",
|
|
991
1166
|
{
|
|
992
1167
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -999,7 +1174,7 @@ var Dialog = forwardRef9(
|
|
|
999
1174
|
e.preventDefault();
|
|
1000
1175
|
handleCloseClick();
|
|
1001
1176
|
},
|
|
1002
|
-
children: /* @__PURE__ */
|
|
1177
|
+
children: /* @__PURE__ */ jsx11(
|
|
1003
1178
|
"path",
|
|
1004
1179
|
{
|
|
1005
1180
|
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",
|
|
@@ -1026,10 +1201,342 @@ var Dialog = forwardRef9(
|
|
|
1026
1201
|
);
|
|
1027
1202
|
Dialog.displayName = "Dialog";
|
|
1028
1203
|
|
|
1204
|
+
// src/components/Dropdown/Dropdown.tsx
|
|
1205
|
+
import { useState as useState6, useRef, useEffect as useEffect3 } from "react";
|
|
1206
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1207
|
+
var IconDanger = () => /* @__PURE__ */ jsx12(
|
|
1208
|
+
"svg",
|
|
1209
|
+
{
|
|
1210
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1211
|
+
width: "20",
|
|
1212
|
+
height: "20",
|
|
1213
|
+
viewBox: "0 0 20 20",
|
|
1214
|
+
fill: "none",
|
|
1215
|
+
children: /* @__PURE__ */ jsx12(
|
|
1216
|
+
"path",
|
|
1217
|
+
{
|
|
1218
|
+
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",
|
|
1219
|
+
fill: "#EF4444"
|
|
1220
|
+
}
|
|
1221
|
+
)
|
|
1222
|
+
}
|
|
1223
|
+
);
|
|
1224
|
+
function IconCheck({ className }) {
|
|
1225
|
+
return /* @__PURE__ */ jsx12(
|
|
1226
|
+
"svg",
|
|
1227
|
+
{
|
|
1228
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1229
|
+
width: "20",
|
|
1230
|
+
height: "20",
|
|
1231
|
+
viewBox: "0 0 20 20",
|
|
1232
|
+
fill: "none",
|
|
1233
|
+
className,
|
|
1234
|
+
children: /* @__PURE__ */ jsx12(
|
|
1235
|
+
"path",
|
|
1236
|
+
{
|
|
1237
|
+
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
1238
|
+
fill: "#111827"
|
|
1239
|
+
}
|
|
1240
|
+
)
|
|
1241
|
+
}
|
|
1242
|
+
);
|
|
1243
|
+
}
|
|
1244
|
+
function ChevronDown({ className }) {
|
|
1245
|
+
return /* @__PURE__ */ jsx12(
|
|
1246
|
+
"svg",
|
|
1247
|
+
{
|
|
1248
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1249
|
+
width: "20",
|
|
1250
|
+
height: "20",
|
|
1251
|
+
viewBox: "0 0 20 20",
|
|
1252
|
+
fill: "none",
|
|
1253
|
+
className,
|
|
1254
|
+
children: /* @__PURE__ */ jsx12(
|
|
1255
|
+
"path",
|
|
1256
|
+
{
|
|
1257
|
+
d: "M14.7119 8.0625L10 12.7744L5.28809 8.0625L6.0625 7.28809L10 11.2256L13.9375 7.28809L14.7119 8.0625Z",
|
|
1258
|
+
fill: "#111827"
|
|
1259
|
+
}
|
|
1260
|
+
)
|
|
1261
|
+
}
|
|
1262
|
+
);
|
|
1263
|
+
}
|
|
1264
|
+
var Dropdown = ({
|
|
1265
|
+
error,
|
|
1266
|
+
label,
|
|
1267
|
+
placeholder,
|
|
1268
|
+
isDisabled = false,
|
|
1269
|
+
isSearchable = false,
|
|
1270
|
+
isTextCenter = false,
|
|
1271
|
+
value,
|
|
1272
|
+
setValue,
|
|
1273
|
+
dropDownItems = [
|
|
1274
|
+
{ label: "Bonnie Green", value: "Bonnie Green" },
|
|
1275
|
+
{ label: "Jese Leos", value: "Jese Leos" },
|
|
1276
|
+
{ label: "Joseph Mcfall", value: "Joseph Mcfall" },
|
|
1277
|
+
{ label: "John Smith", value: "John Smith" },
|
|
1278
|
+
{ label: "Maria Garcia", value: "Maria Garcia" }
|
|
1279
|
+
]
|
|
1280
|
+
}) => {
|
|
1281
|
+
const [isOpen, setIsOpen] = useState6(false);
|
|
1282
|
+
const [search, setSearch] = useState6("");
|
|
1283
|
+
const dropdownRef = useRef(null);
|
|
1284
|
+
const filteredItems = dropDownItems.filter(
|
|
1285
|
+
(item) => item.label.toLowerCase().includes(search.toLowerCase())
|
|
1286
|
+
);
|
|
1287
|
+
useEffect3(() => {
|
|
1288
|
+
function handleClickOutside(event) {
|
|
1289
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1290
|
+
setIsOpen(false);
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1294
|
+
return () => {
|
|
1295
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
1296
|
+
};
|
|
1297
|
+
}, []);
|
|
1298
|
+
return /* @__PURE__ */ jsxs12("div", { className: "w-full", children: [
|
|
1299
|
+
label ? /* @__PURE__ */ jsx12(
|
|
1300
|
+
"p",
|
|
1301
|
+
{
|
|
1302
|
+
className: `text-label-medium text-left items-left font-medium mb-4 ${isDisabled ? "text-dropdown-text-disabled" : "text-dropdown-text-primary"}`,
|
|
1303
|
+
children: label
|
|
1304
|
+
}
|
|
1305
|
+
) : /* @__PURE__ */ jsx12(Fragment2, {}),
|
|
1306
|
+
/* @__PURE__ */ jsxs12("div", { className: "w-full flex flex-col relative", ref: dropdownRef, children: [
|
|
1307
|
+
/* @__PURE__ */ jsxs12(
|
|
1308
|
+
"button",
|
|
1309
|
+
{
|
|
1310
|
+
onClick: () => !isDisabled && setIsOpen(!isOpen),
|
|
1311
|
+
className: `w-full rounded-md text-body-small px-16 py-10 text-center inline-flex gap-8 items-center border **:focus:outline-none focus:border-2 focus:px-15 focus:py-9
|
|
1312
|
+
${isDisabled ? "pointer-events-none bg-dropdown-background-disabled text-dropdown-text-disabled border-dropdown-border-disabled" : error ? "border-red-600 bg-dropdown-background-enabled focus:border-red-600" : value ? "text-dropdown-text-primary bg-dropdown-background-enabled border-dropdown-border-enabled focus:border-dropdown-border-active " : "text-dropdown-text-secondary bg-dropdown-background-enabled border-dropdown-border-enabled focus:border-dropdown-border-active "} `,
|
|
1313
|
+
type: "button",
|
|
1314
|
+
children: [
|
|
1315
|
+
/* @__PURE__ */ jsx12("p", { className: `grow ${isTextCenter ? "text-center" : "text-start"}`, children: value.label || placeholder }),
|
|
1316
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-8", children: [
|
|
1317
|
+
isDisabled ? /* @__PURE__ */ jsx12(Fragment2, {}) : error ? /* @__PURE__ */ jsx12(IconDanger, {}) : /* @__PURE__ */ jsx12(Fragment2, {}),
|
|
1318
|
+
/* @__PURE__ */ jsx12(
|
|
1319
|
+
ChevronDown,
|
|
1320
|
+
{
|
|
1321
|
+
className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
|
|
1322
|
+
}
|
|
1323
|
+
)
|
|
1324
|
+
] })
|
|
1325
|
+
]
|
|
1326
|
+
}
|
|
1327
|
+
),
|
|
1328
|
+
/* @__PURE__ */ jsxs12(
|
|
1329
|
+
"div",
|
|
1330
|
+
{
|
|
1331
|
+
id: "dropdownSearch",
|
|
1332
|
+
className: `${isOpen ? "flex" : "hidden"} top-[calc(100%+4px)] left-8 absolute z-10000 bg-white-100 rounded-lg shadow-base w-9/10 min-w-fit flex-col`,
|
|
1333
|
+
children: [
|
|
1334
|
+
isSearchable ? /* @__PURE__ */ jsxs12("div", { className: "p-3", children: [
|
|
1335
|
+
/* @__PURE__ */ jsx12("label", { htmlFor: "input-group-search", className: "sr-only", children: "Search" }),
|
|
1336
|
+
/* @__PURE__ */ jsxs12("div", { className: "relative", children: [
|
|
1337
|
+
/* @__PURE__ */ jsx12("div", { className: "absolute inset-y-0 rtl:inset-r-0 inset-s-0 flex items-center ps-12 pointer-events-none", children: /* @__PURE__ */ jsxs12(
|
|
1338
|
+
"svg",
|
|
1339
|
+
{
|
|
1340
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1341
|
+
width: "20",
|
|
1342
|
+
height: "20",
|
|
1343
|
+
viewBox: "0 0 20 20",
|
|
1344
|
+
fill: "none",
|
|
1345
|
+
children: [
|
|
1346
|
+
/* @__PURE__ */ jsx12(
|
|
1347
|
+
"mask",
|
|
1348
|
+
{
|
|
1349
|
+
id: "mask0_3218_5077",
|
|
1350
|
+
style: { maskType: "alpha" },
|
|
1351
|
+
maskUnits: "userSpaceOnUse",
|
|
1352
|
+
x: "0",
|
|
1353
|
+
y: "0",
|
|
1354
|
+
width: "20",
|
|
1355
|
+
height: "20",
|
|
1356
|
+
children: /* @__PURE__ */ jsx12("rect", { width: "20", height: "20", fill: "#D9D9D9" })
|
|
1357
|
+
}
|
|
1358
|
+
),
|
|
1359
|
+
/* @__PURE__ */ jsx12("g", { mask: "url(#mask0_3218_5077)", children: /* @__PURE__ */ jsx12(
|
|
1360
|
+
"path",
|
|
1361
|
+
{
|
|
1362
|
+
d: "M15.8894 16.6476L10.9263 11.6842C10.5096 12.0005 10.0527 12.2454 9.55563 12.419C9.05855 12.5926 8.54556 12.6794 8.01667 12.6794C6.7182 12.6794 5.61354 12.2241 4.70271 11.3134C3.79202 10.4026 3.33667 9.29811 3.33667 8.00005C3.33667 6.702 3.79202 5.59755 4.70271 4.68672C5.61354 3.77603 6.71799 3.32068 8.01604 3.32068C9.3141 3.32068 10.4185 3.77603 11.3294 4.68672C12.2401 5.59755 12.6954 6.70221 12.6954 8.00068C12.6954 8.54554 12.606 9.06651 12.4271 9.56359C12.2481 10.0608 12.0058 10.5097 11.7002 10.9103L16.6633 15.8734L15.8894 16.6476ZM8.01604 11.5963C9.02035 11.5963 9.87077 11.248 10.5673 10.5513C11.264 9.85478 11.6123 9.00436 11.6123 8.00005C11.6123 6.99575 11.264 6.14533 10.5673 5.4488C9.87077 4.75214 9.02035 4.4038 8.01604 4.4038C7.01174 4.4038 6.16132 4.75214 5.46479 5.4488C4.76813 6.14533 4.41979 6.99575 4.41979 8.00005C4.41979 9.00436 4.76813 9.85478 5.46479 10.5513C6.16132 11.248 7.01174 11.5963 8.01604 11.5963Z",
|
|
1363
|
+
fill: "#111827"
|
|
1364
|
+
}
|
|
1365
|
+
) })
|
|
1366
|
+
]
|
|
1367
|
+
}
|
|
1368
|
+
) }),
|
|
1369
|
+
/* @__PURE__ */ jsx12(
|
|
1370
|
+
"input",
|
|
1371
|
+
{
|
|
1372
|
+
type: "text",
|
|
1373
|
+
className: "block w-full p-8 ps-40 text-body-small text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-bubblegum focus:border-bubblegum",
|
|
1374
|
+
placeholder: "Search...",
|
|
1375
|
+
value: search,
|
|
1376
|
+
onChange: (e) => setSearch(e.target.value)
|
|
1377
|
+
}
|
|
1378
|
+
)
|
|
1379
|
+
] })
|
|
1380
|
+
] }) : /* @__PURE__ */ jsx12(Fragment2, {}),
|
|
1381
|
+
/* @__PURE__ */ jsx12(
|
|
1382
|
+
"ul",
|
|
1383
|
+
{
|
|
1384
|
+
className: "h-auto max-h-392 overflow-y-auto cursor-pointer",
|
|
1385
|
+
"aria-labelledby": "dropdownSearchButton",
|
|
1386
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, idx) => /* @__PURE__ */ jsx12("li", { children: /* @__PURE__ */ jsxs12(
|
|
1387
|
+
"div",
|
|
1388
|
+
{
|
|
1389
|
+
onClick: () => {
|
|
1390
|
+
setValue(item);
|
|
1391
|
+
setSearch("");
|
|
1392
|
+
setIsOpen(false);
|
|
1393
|
+
},
|
|
1394
|
+
className: "relative text-gray-900 py-12 px-16 rounded-sm text-label-medium hover:bg-gray-100",
|
|
1395
|
+
children: [
|
|
1396
|
+
item.label,
|
|
1397
|
+
value.value === item.value && /* @__PURE__ */ jsx12(IconCheck, { className: "absolute h-20 w-20 right-24 top-2 translate-y-1/2" })
|
|
1398
|
+
]
|
|
1399
|
+
}
|
|
1400
|
+
) }, idx)) : /* @__PURE__ */ jsx12("li", { className: "px-8 py-8 text-label-medium text-gray-900", children: "No results found" })
|
|
1401
|
+
}
|
|
1402
|
+
)
|
|
1403
|
+
]
|
|
1404
|
+
}
|
|
1405
|
+
)
|
|
1406
|
+
] }),
|
|
1407
|
+
error ? /* @__PURE__ */ jsx12(
|
|
1408
|
+
"p",
|
|
1409
|
+
{
|
|
1410
|
+
className: `text-caption-caption text-left items-left text-dropdown-text-danger mt-4 ${isDisabled ? "hidden" : ""}`,
|
|
1411
|
+
children: error
|
|
1412
|
+
}
|
|
1413
|
+
) : /* @__PURE__ */ jsx12(Fragment2, {})
|
|
1414
|
+
] });
|
|
1415
|
+
};
|
|
1416
|
+
Dropdown.displayName = "Dropdown";
|
|
1417
|
+
|
|
1418
|
+
// src/components/FinancialLogo/FinancialLogo.tsx
|
|
1419
|
+
import { forwardRef as forwardRef12 } from "react";
|
|
1420
|
+
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1421
|
+
var inlineClasses2 = {
|
|
1422
|
+
info: "bg-alert-inline-info-bg border-alert-inline-info-border text-alert-text-primary",
|
|
1423
|
+
success: "bg-alert-inline-success-bg border-alert-inline-success-border text-alert-text-primary",
|
|
1424
|
+
warning: "bg-alert-inline-warning-bg border-alert-inline-warning-border text-alert-text-primary",
|
|
1425
|
+
danger: "bg-alert-inline-danger-bg border-alert-inline-danger-border text-alert-text-primary",
|
|
1426
|
+
common: "bg-alert-inline-common-bg border-alert-inline-common-border text-alert-text-primary"
|
|
1427
|
+
};
|
|
1428
|
+
var pageClasses2 = {
|
|
1429
|
+
info: "bg-alert-page-info-bg text-alert-text-primary-inverse",
|
|
1430
|
+
success: "bg-alert-page-success-bg text-alert-text-primary-inverse",
|
|
1431
|
+
warning: "bg-alert-page-warning-bg text-alert-text-primary-inverse",
|
|
1432
|
+
danger: "bg-alert-page-danger-bg text-alert-text-primary-inverse",
|
|
1433
|
+
common: "bg-alert-page-common-bg text-alert-text-primary-inverse"
|
|
1434
|
+
};
|
|
1435
|
+
var actionsPageClasses2 = {
|
|
1436
|
+
info: "text-enabled-inverse",
|
|
1437
|
+
success: "text-enabled-inverse",
|
|
1438
|
+
warning: "text-enabled-dark",
|
|
1439
|
+
danger: "text-enabled-inverse",
|
|
1440
|
+
common: "text-enabled-inverse"
|
|
1441
|
+
};
|
|
1442
|
+
var inlineIconClasses2 = {
|
|
1443
|
+
info: "text-alert-inline-info-icon",
|
|
1444
|
+
success: "text-alert-inline-success-icon",
|
|
1445
|
+
warning: "text-alert-inline-warning-icon",
|
|
1446
|
+
danger: "text-alert-inline-danger-icon",
|
|
1447
|
+
common: "text-alert-inline-common-icon"
|
|
1448
|
+
};
|
|
1449
|
+
function InfoIcon2({ className }) {
|
|
1450
|
+
return /* @__PURE__ */ jsx13("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("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" }) });
|
|
1451
|
+
}
|
|
1452
|
+
function SuccessIcon2({ className }) {
|
|
1453
|
+
return /* @__PURE__ */ jsxs13("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1454
|
+
/* @__PURE__ */ jsx13("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1455
|
+
/* @__PURE__ */ jsx13("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1456
|
+
] });
|
|
1457
|
+
}
|
|
1458
|
+
function WarningIcon2({ className }) {
|
|
1459
|
+
return /* @__PURE__ */ jsx13("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("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" }) });
|
|
1460
|
+
}
|
|
1461
|
+
function DangerIcon2({ className }) {
|
|
1462
|
+
return /* @__PURE__ */ jsx13("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("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" }) });
|
|
1463
|
+
}
|
|
1464
|
+
function CommonIcon({ className }) {
|
|
1465
|
+
return /* @__PURE__ */ jsx13("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("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" }) });
|
|
1466
|
+
}
|
|
1467
|
+
function CloseIcon2({ className }) {
|
|
1468
|
+
return /* @__PURE__ */ jsx13("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1469
|
+
}
|
|
1470
|
+
var defaultIcons2 = {
|
|
1471
|
+
info: InfoIcon2,
|
|
1472
|
+
success: SuccessIcon2,
|
|
1473
|
+
warning: WarningIcon2,
|
|
1474
|
+
danger: DangerIcon2,
|
|
1475
|
+
common: CommonIcon
|
|
1476
|
+
};
|
|
1477
|
+
var FinancialLogo = forwardRef12(
|
|
1478
|
+
(_a, ref) => {
|
|
1479
|
+
var _b = _a, {
|
|
1480
|
+
variant = "info",
|
|
1481
|
+
mode = "inline",
|
|
1482
|
+
title,
|
|
1483
|
+
description,
|
|
1484
|
+
action,
|
|
1485
|
+
icon,
|
|
1486
|
+
onClose,
|
|
1487
|
+
className = "",
|
|
1488
|
+
children
|
|
1489
|
+
} = _b, rest = __objRest(_b, [
|
|
1490
|
+
"variant",
|
|
1491
|
+
"mode",
|
|
1492
|
+
"title",
|
|
1493
|
+
"description",
|
|
1494
|
+
"action",
|
|
1495
|
+
"icon",
|
|
1496
|
+
"onClose",
|
|
1497
|
+
"className",
|
|
1498
|
+
"children"
|
|
1499
|
+
]);
|
|
1500
|
+
const isPage = mode === "page";
|
|
1501
|
+
const variantClass = isPage ? pageClasses2[variant] : inlineClasses2[variant];
|
|
1502
|
+
const actionClass = isPage ? actionsPageClasses2[variant] : "text-enabled";
|
|
1503
|
+
const DefaultIcon = defaultIcons2[variant];
|
|
1504
|
+
const iconColorClass = isPage ? "" : inlineIconClasses2[variant];
|
|
1505
|
+
const descColorClass = isPage ? "text-alert-text-secondary-inverse" : "text-alert-text-secondary";
|
|
1506
|
+
const closeColorClass = isPage ? "text-alert-close-inverse hover:text-alert-close-inverse-hover" : "text-alert-close hover:text-alert-close-hover";
|
|
1507
|
+
const classes = [
|
|
1508
|
+
"flex items-start gap-12 font-sans",
|
|
1509
|
+
isPage ? "px-16 py-12" : "px-16 py-12 border-l-4 rounded-lg",
|
|
1510
|
+
variantClass,
|
|
1511
|
+
className
|
|
1512
|
+
].filter(Boolean).join(" ");
|
|
1513
|
+
return /* @__PURE__ */ jsxs13("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
1514
|
+
/* @__PURE__ */ jsx13("span", { className: `shrink-0 mt-2 ${iconColorClass}`, children: icon != null ? icon : /* @__PURE__ */ jsx13(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
1515
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
|
|
1516
|
+
title && /* @__PURE__ */ jsx13("p", { className: "text-sm font-medium leading-20", children: title }),
|
|
1517
|
+
description && /* @__PURE__ */ jsx13("p", { className: `text-sm leading-20 ${descColorClass} ${title ? "mt-4" : ""}`, children: description }),
|
|
1518
|
+
children
|
|
1519
|
+
] }),
|
|
1520
|
+
action && /* @__PURE__ */ jsx13("div", { className: `${actionClass} underline text-sm font-medium`, children: action }),
|
|
1521
|
+
onClose && /* @__PURE__ */ jsx13(
|
|
1522
|
+
"button",
|
|
1523
|
+
{
|
|
1524
|
+
type: "button",
|
|
1525
|
+
onClick: onClose,
|
|
1526
|
+
className: `shrink-0 p-2 rounded transition-colors ${closeColorClass}`,
|
|
1527
|
+
"aria-label": "Close",
|
|
1528
|
+
children: /* @__PURE__ */ jsx13(CloseIcon2, { className: "h-16 w-16" })
|
|
1529
|
+
}
|
|
1530
|
+
)
|
|
1531
|
+
] }));
|
|
1532
|
+
}
|
|
1533
|
+
);
|
|
1534
|
+
FinancialLogo.displayName = "FinancialLogo";
|
|
1535
|
+
|
|
1029
1536
|
// src/components/Icon/Icon.tsx
|
|
1030
|
-
import { forwardRef as
|
|
1031
|
-
import { jsx as
|
|
1032
|
-
var Icon =
|
|
1537
|
+
import { forwardRef as forwardRef13 } from "react";
|
|
1538
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1539
|
+
var Icon = forwardRef13(
|
|
1033
1540
|
(_a, ref) => {
|
|
1034
1541
|
var _b = _a, {
|
|
1035
1542
|
name,
|
|
@@ -1057,7 +1564,7 @@ var Icon = forwardRef10(
|
|
|
1057
1564
|
"material-symbols-outlined select-none shrink-0 inline-block leading-none",
|
|
1058
1565
|
className
|
|
1059
1566
|
].filter(Boolean).join(" ");
|
|
1060
|
-
return /* @__PURE__ */
|
|
1567
|
+
return /* @__PURE__ */ jsx14(
|
|
1061
1568
|
"span",
|
|
1062
1569
|
__spreadProps(__spreadValues({
|
|
1063
1570
|
ref,
|
|
@@ -1079,13 +1586,81 @@ var Icon = forwardRef10(
|
|
|
1079
1586
|
);
|
|
1080
1587
|
Icon.displayName = "Icon";
|
|
1081
1588
|
|
|
1589
|
+
// src/components/Link/Link.tsx
|
|
1590
|
+
import { forwardRef as forwardRef14 } from "react";
|
|
1591
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1592
|
+
var linkStyleClasses = {
|
|
1593
|
+
brand: "font-sans text-link-text-enabled",
|
|
1594
|
+
white: "font-sans text-link-text-enabled-inverse",
|
|
1595
|
+
black: "font-sans text-link-text-enabled-dark",
|
|
1596
|
+
brandLooped: "font-looped text-link-text-enabled",
|
|
1597
|
+
whiteLooped: "font-looped text-link-text-enabled-inverse",
|
|
1598
|
+
blackLooped: "font-looped text-link-text-enabled-dark"
|
|
1599
|
+
};
|
|
1600
|
+
var linkVariantClasses = {
|
|
1601
|
+
xs: "text-link-extra-small gap-2",
|
|
1602
|
+
sm: "text-link-small gap-2",
|
|
1603
|
+
md: "text-link-medium gap-2",
|
|
1604
|
+
lg: "text-link-large gap-4"
|
|
1605
|
+
};
|
|
1606
|
+
var iconVariantClasses = {
|
|
1607
|
+
xs: "w-20 h-20",
|
|
1608
|
+
sm: "w-20 h-20",
|
|
1609
|
+
md: "w-20 h-20",
|
|
1610
|
+
lg: "w-24 h-24"
|
|
1611
|
+
};
|
|
1612
|
+
function SuccessIcon3({ className }) {
|
|
1613
|
+
return /* @__PURE__ */ jsxs14("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1614
|
+
/* @__PURE__ */ jsx15("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1615
|
+
/* @__PURE__ */ jsx15("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1616
|
+
] });
|
|
1617
|
+
}
|
|
1618
|
+
var Link = forwardRef14(
|
|
1619
|
+
(_a, ref) => {
|
|
1620
|
+
var _b = _a, {
|
|
1621
|
+
variant = "sm",
|
|
1622
|
+
isInline = false,
|
|
1623
|
+
linkStyle = "brand",
|
|
1624
|
+
text,
|
|
1625
|
+
href,
|
|
1626
|
+
icon = true,
|
|
1627
|
+
className = "",
|
|
1628
|
+
children
|
|
1629
|
+
} = _b, rest = __objRest(_b, [
|
|
1630
|
+
"variant",
|
|
1631
|
+
"isInline",
|
|
1632
|
+
"linkStyle",
|
|
1633
|
+
"text",
|
|
1634
|
+
"href",
|
|
1635
|
+
"icon",
|
|
1636
|
+
"className",
|
|
1637
|
+
"children"
|
|
1638
|
+
]);
|
|
1639
|
+
const styleClass = linkStyleClasses[linkStyle];
|
|
1640
|
+
const variantClass = linkVariantClasses[variant];
|
|
1641
|
+
const iconClass = iconVariantClasses[variant];
|
|
1642
|
+
const classes = [
|
|
1643
|
+
"flex items-center",
|
|
1644
|
+
isInline ? "underline" : "",
|
|
1645
|
+
styleClass,
|
|
1646
|
+
variantClass,
|
|
1647
|
+
className
|
|
1648
|
+
].filter(Boolean).join(" ");
|
|
1649
|
+
return /* @__PURE__ */ jsxs14("div", __spreadProps(__spreadValues({ ref, role: "link", className: classes }, rest), { children: [
|
|
1650
|
+
/* @__PURE__ */ jsx15("a", { className: "", href, children: text }),
|
|
1651
|
+
icon && !isInline ? /* @__PURE__ */ jsx15(SuccessIcon3, { className: iconClass }) : null
|
|
1652
|
+
] }));
|
|
1653
|
+
}
|
|
1654
|
+
);
|
|
1655
|
+
Link.displayName = "Link";
|
|
1656
|
+
|
|
1082
1657
|
// src/components/Radio/Radio.tsx
|
|
1083
1658
|
import {
|
|
1084
|
-
forwardRef as
|
|
1659
|
+
forwardRef as forwardRef15,
|
|
1085
1660
|
useId as useId3
|
|
1086
1661
|
} from "react";
|
|
1087
|
-
import { jsx as
|
|
1088
|
-
var Radio =
|
|
1662
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1663
|
+
var Radio = forwardRef15(
|
|
1089
1664
|
(_a, ref) => {
|
|
1090
1665
|
var _b = _a, {
|
|
1091
1666
|
size = "sm",
|
|
@@ -1112,18 +1687,18 @@ var Radio = forwardRef11(
|
|
|
1112
1687
|
]);
|
|
1113
1688
|
const reactId = useId3();
|
|
1114
1689
|
const inputId = id != null ? id : reactId;
|
|
1115
|
-
return /* @__PURE__ */
|
|
1690
|
+
return /* @__PURE__ */ jsx16(
|
|
1116
1691
|
"div",
|
|
1117
1692
|
{
|
|
1118
1693
|
className: `${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
1119
|
-
children: /* @__PURE__ */
|
|
1694
|
+
children: /* @__PURE__ */ jsxs15(
|
|
1120
1695
|
"label",
|
|
1121
1696
|
{
|
|
1122
1697
|
htmlFor: inputId,
|
|
1123
1698
|
className: `flex gap-4 ${disabled ? "pointer-events-none text-gray-400" : "text-gray-900 cursor-pointer"}`,
|
|
1124
1699
|
children: [
|
|
1125
|
-
/* @__PURE__ */
|
|
1126
|
-
/* @__PURE__ */
|
|
1700
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
1701
|
+
/* @__PURE__ */ jsx16(
|
|
1127
1702
|
"input",
|
|
1128
1703
|
__spreadValues({
|
|
1129
1704
|
ref,
|
|
@@ -1136,14 +1711,14 @@ var Radio = forwardRef11(
|
|
|
1136
1711
|
name
|
|
1137
1712
|
}, rest)
|
|
1138
1713
|
),
|
|
1139
|
-
/* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ jsx16(
|
|
1140
1715
|
"div",
|
|
1141
1716
|
{
|
|
1142
1717
|
className: `relative box flex items-center justify-center rounded-full border-2 group bg-white
|
|
1143
1718
|
${size === "sm" ? "h-16 w-16 my-4 ml-3 mr-3" : "m-3 h-20 w-20 text-label-large"}
|
|
1144
1719
|
${error ? "border-red-500" : "border-gray-600 peer-checked:border-blue-600 peer-disabled:border-gray-400!"}
|
|
1145
1720
|
`,
|
|
1146
|
-
children: /* @__PURE__ */
|
|
1721
|
+
children: /* @__PURE__ */ jsx16(
|
|
1147
1722
|
"span",
|
|
1148
1723
|
{
|
|
1149
1724
|
className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2
|
|
@@ -1154,12 +1729,12 @@ var Radio = forwardRef11(
|
|
|
1154
1729
|
}
|
|
1155
1730
|
)
|
|
1156
1731
|
] }),
|
|
1157
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ jsxs15(
|
|
1158
1733
|
"div",
|
|
1159
1734
|
{
|
|
1160
1735
|
className: `flex flex-col gap-1 ${size === "sm" ? "mt-2" : "mt-4"}`,
|
|
1161
1736
|
children: [
|
|
1162
|
-
/* @__PURE__ */
|
|
1737
|
+
/* @__PURE__ */ jsx16(
|
|
1163
1738
|
"p",
|
|
1164
1739
|
{
|
|
1165
1740
|
className: `
|
|
@@ -1169,7 +1744,7 @@ var Radio = forwardRef11(
|
|
|
1169
1744
|
children: label
|
|
1170
1745
|
}
|
|
1171
1746
|
),
|
|
1172
|
-
/* @__PURE__ */
|
|
1747
|
+
/* @__PURE__ */ jsx16(
|
|
1173
1748
|
"p",
|
|
1174
1749
|
{
|
|
1175
1750
|
className: `text-caption-caption ${disabled ? "text-gray-400" : error ? "text-red-600" : "text-gray-600"}`,
|
|
@@ -1188,14 +1763,44 @@ var Radio = forwardRef11(
|
|
|
1188
1763
|
);
|
|
1189
1764
|
Radio.displayName = "Radio";
|
|
1190
1765
|
|
|
1766
|
+
// src/components/SegmentControl/SegmentControl.tsx
|
|
1767
|
+
import {
|
|
1768
|
+
forwardRef as forwardRef16
|
|
1769
|
+
} from "react";
|
|
1770
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1771
|
+
var SegmentControl = forwardRef16(
|
|
1772
|
+
(_a, ref) => {
|
|
1773
|
+
var _b = _a, { size = "md", items, selected, setSelected, className = "" } = _b, rest = __objRest(_b, ["size", "items", "selected", "setSelected", "className"]);
|
|
1774
|
+
return /* @__PURE__ */ jsx17(
|
|
1775
|
+
"div",
|
|
1776
|
+
__spreadProps(__spreadValues({
|
|
1777
|
+
ref,
|
|
1778
|
+
className: `bg-background-tertiary rounded-full flex flex-row items-center justify-center p-4 gap-4 ${className}`
|
|
1779
|
+
}, rest), {
|
|
1780
|
+
children: items.map((item) => /* @__PURE__ */ jsx17(
|
|
1781
|
+
"div",
|
|
1782
|
+
{
|
|
1783
|
+
onClick: () => setSelected == null ? void 0 : setSelected(item.value),
|
|
1784
|
+
className: `cursor-pointer rounded-full text-center grow
|
|
1785
|
+
${size === "sm" ? "px-8 py-6 text-label-medium" : size === "md" ? "px-12 py-10 text-label-large" : "px-16 py-14 text-label-large"} ${selected === item.value ? "bg-segmented-control-background-active shadow-base text-segmented-control-text-primary hover:bg-segmented-control-background-active-hover" : "bg-segmented-control-background-enabled text-segmented-control-text-primary hover:bg-segmented-control-background-hover"} `,
|
|
1786
|
+
children: item.label
|
|
1787
|
+
},
|
|
1788
|
+
item.value
|
|
1789
|
+
))
|
|
1790
|
+
})
|
|
1791
|
+
);
|
|
1792
|
+
}
|
|
1793
|
+
);
|
|
1794
|
+
SegmentControl.displayName = "SegmentControl";
|
|
1795
|
+
|
|
1191
1796
|
// src/components/Slider/Slider.tsx
|
|
1192
1797
|
import {
|
|
1193
|
-
forwardRef as
|
|
1798
|
+
forwardRef as forwardRef17,
|
|
1194
1799
|
useCallback as useCallback4,
|
|
1195
1800
|
useId as useId4,
|
|
1196
|
-
useState as
|
|
1801
|
+
useState as useState8
|
|
1197
1802
|
} from "react";
|
|
1198
|
-
import { jsx as
|
|
1803
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1199
1804
|
var sizeConfig = {
|
|
1200
1805
|
small: {
|
|
1201
1806
|
trackH: "h-4",
|
|
@@ -1226,7 +1831,7 @@ var sizeConfig = {
|
|
|
1226
1831
|
}
|
|
1227
1832
|
};
|
|
1228
1833
|
function ChevronGlyphs({ size, color }) {
|
|
1229
|
-
return /* @__PURE__ */
|
|
1834
|
+
return /* @__PURE__ */ jsxs16(
|
|
1230
1835
|
"svg",
|
|
1231
1836
|
{
|
|
1232
1837
|
width: size,
|
|
@@ -1236,7 +1841,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1236
1841
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1237
1842
|
"aria-hidden": "true",
|
|
1238
1843
|
children: [
|
|
1239
|
-
/* @__PURE__ */
|
|
1844
|
+
/* @__PURE__ */ jsx18(
|
|
1240
1845
|
"path",
|
|
1241
1846
|
{
|
|
1242
1847
|
d: "M4.75 3.25L2.25 6L4.75 8.75",
|
|
@@ -1246,7 +1851,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1246
1851
|
strokeLinejoin: "round"
|
|
1247
1852
|
}
|
|
1248
1853
|
),
|
|
1249
|
-
/* @__PURE__ */
|
|
1854
|
+
/* @__PURE__ */ jsx18(
|
|
1250
1855
|
"path",
|
|
1251
1856
|
{
|
|
1252
1857
|
d: "M7.25 3.25L9.75 6L7.25 8.75",
|
|
@@ -1260,7 +1865,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1260
1865
|
}
|
|
1261
1866
|
);
|
|
1262
1867
|
}
|
|
1263
|
-
var Slider =
|
|
1868
|
+
var Slider = forwardRef17(
|
|
1264
1869
|
(_a, ref) => {
|
|
1265
1870
|
var _b = _a, {
|
|
1266
1871
|
size = "medium",
|
|
@@ -1301,7 +1906,7 @@ var Slider = forwardRef12(
|
|
|
1301
1906
|
const ariaLabel = ariaLabelProp != null ? ariaLabelProp : typeof label === "string" ? void 0 : "Slider";
|
|
1302
1907
|
const ariaDescriptionId = description ? `${inputId}-description` : void 0;
|
|
1303
1908
|
const isControlled = controlledValue !== void 0;
|
|
1304
|
-
const [internalValue, setInternalValue] =
|
|
1909
|
+
const [internalValue, setInternalValue] = useState8(defaultValue != null ? defaultValue : min);
|
|
1305
1910
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
1306
1911
|
const handleChange = useCallback4(
|
|
1307
1912
|
(e) => {
|
|
@@ -1323,13 +1928,13 @@ var Slider = forwardRef12(
|
|
|
1323
1928
|
const descriptionColor = disabled ? "text-slider-label-disabled" : "text-slider-description";
|
|
1324
1929
|
const thumbOffset = percent * sz.thumbPx / 100;
|
|
1325
1930
|
const fillOffset = sz.thumbPx / 2 - thumbOffset;
|
|
1326
|
-
return /* @__PURE__ */
|
|
1931
|
+
return /* @__PURE__ */ jsxs16(
|
|
1327
1932
|
"div",
|
|
1328
1933
|
{
|
|
1329
1934
|
className: ["flex w-full flex-col gap-8 font-sans", className].filter(Boolean).join(" "),
|
|
1330
1935
|
children: [
|
|
1331
|
-
(label || showValue && !disabled) && /* @__PURE__ */
|
|
1332
|
-
label && /* @__PURE__ */
|
|
1936
|
+
(label || showValue && !disabled) && /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between", children: [
|
|
1937
|
+
label && /* @__PURE__ */ jsx18(
|
|
1333
1938
|
"label",
|
|
1334
1939
|
{
|
|
1335
1940
|
htmlFor: inputId,
|
|
@@ -1342,7 +1947,7 @@ var Slider = forwardRef12(
|
|
|
1342
1947
|
children: label
|
|
1343
1948
|
}
|
|
1344
1949
|
),
|
|
1345
|
-
showValue && /* @__PURE__ */
|
|
1950
|
+
showValue && /* @__PURE__ */ jsx18(
|
|
1346
1951
|
"span",
|
|
1347
1952
|
{
|
|
1348
1953
|
className: [sz.description, "tabular-nums", labelColor].join(" "),
|
|
@@ -1350,7 +1955,7 @@ var Slider = forwardRef12(
|
|
|
1350
1955
|
}
|
|
1351
1956
|
)
|
|
1352
1957
|
] }),
|
|
1353
|
-
/* @__PURE__ */
|
|
1958
|
+
/* @__PURE__ */ jsxs16(
|
|
1354
1959
|
"div",
|
|
1355
1960
|
{
|
|
1356
1961
|
className: [
|
|
@@ -1359,7 +1964,7 @@ var Slider = forwardRef12(
|
|
|
1359
1964
|
disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
1360
1965
|
].join(" "),
|
|
1361
1966
|
children: [
|
|
1362
|
-
/* @__PURE__ */
|
|
1967
|
+
/* @__PURE__ */ jsx18(
|
|
1363
1968
|
"div",
|
|
1364
1969
|
{
|
|
1365
1970
|
className: [
|
|
@@ -1369,14 +1974,14 @@ var Slider = forwardRef12(
|
|
|
1369
1974
|
].join(" ")
|
|
1370
1975
|
}
|
|
1371
1976
|
),
|
|
1372
|
-
/* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ jsx18(
|
|
1373
1978
|
"div",
|
|
1374
1979
|
{
|
|
1375
1980
|
className: ["absolute left-0 rounded-full", sz.trackH, fillBg].join(" "),
|
|
1376
1981
|
style: { width: `calc(${percent}% + ${fillOffset}px)` }
|
|
1377
1982
|
}
|
|
1378
1983
|
),
|
|
1379
|
-
/* @__PURE__ */
|
|
1984
|
+
/* @__PURE__ */ jsx18(
|
|
1380
1985
|
"input",
|
|
1381
1986
|
__spreadValues({
|
|
1382
1987
|
ref,
|
|
@@ -1397,7 +2002,7 @@ var Slider = forwardRef12(
|
|
|
1397
2002
|
].join(" ")
|
|
1398
2003
|
}, rest)
|
|
1399
2004
|
),
|
|
1400
|
-
/* @__PURE__ */
|
|
2005
|
+
/* @__PURE__ */ jsx18(
|
|
1401
2006
|
"div",
|
|
1402
2007
|
{
|
|
1403
2008
|
className: [
|
|
@@ -1410,13 +2015,13 @@ var Slider = forwardRef12(
|
|
|
1410
2015
|
!disabled && "peer-hover:shadow-medium"
|
|
1411
2016
|
].filter(Boolean).join(" "),
|
|
1412
2017
|
style: { left: `calc(${percent}% - ${thumbOffset}px)` },
|
|
1413
|
-
children: /* @__PURE__ */
|
|
2018
|
+
children: /* @__PURE__ */ jsx18(ChevronGlyphs, { size: sz.iconPx, color: iconColor })
|
|
1414
2019
|
}
|
|
1415
2020
|
)
|
|
1416
2021
|
]
|
|
1417
2022
|
}
|
|
1418
2023
|
),
|
|
1419
|
-
description && /* @__PURE__ */
|
|
2024
|
+
description && /* @__PURE__ */ jsx18(
|
|
1420
2025
|
"span",
|
|
1421
2026
|
{
|
|
1422
2027
|
id: ariaDescriptionId,
|
|
@@ -1431,31 +2036,351 @@ var Slider = forwardRef12(
|
|
|
1431
2036
|
);
|
|
1432
2037
|
Slider.displayName = "Slider";
|
|
1433
2038
|
|
|
2039
|
+
// src/components/Tab/Tab.tsx
|
|
2040
|
+
import { forwardRef as forwardRef18 } from "react";
|
|
2041
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2042
|
+
var Tab = forwardRef18(
|
|
2043
|
+
(_a, ref) => {
|
|
2044
|
+
var _b = _a, {
|
|
2045
|
+
size = "md",
|
|
2046
|
+
label,
|
|
2047
|
+
value,
|
|
2048
|
+
isDisabled = false,
|
|
2049
|
+
selected,
|
|
2050
|
+
setSelected,
|
|
2051
|
+
className = ""
|
|
2052
|
+
} = _b, rest = __objRest(_b, [
|
|
2053
|
+
"size",
|
|
2054
|
+
"label",
|
|
2055
|
+
"value",
|
|
2056
|
+
"isDisabled",
|
|
2057
|
+
"selected",
|
|
2058
|
+
"setSelected",
|
|
2059
|
+
"className"
|
|
2060
|
+
]);
|
|
2061
|
+
return /* @__PURE__ */ jsx19(
|
|
2062
|
+
"div",
|
|
2063
|
+
__spreadProps(__spreadValues({
|
|
2064
|
+
ref,
|
|
2065
|
+
className: `flex items-center justify-center
|
|
2066
|
+
${size === "md" ? "text-label-medium px-16 pt-12 pb-8" : "text-label-large p-16"}
|
|
2067
|
+
${value === selected ? isDisabled ? "cursor-not-allowed text-gray-400 border-gray-100 border-b-2" : "text-blue-600 border-blue-600 border-b-2 cursor-pointer" : isDisabled ? "cursor-not-allowed text-gray-400" : "text-gray-600 hover:border-b-2 hover:border-gray-200 cursor-pointer"}
|
|
2068
|
+
${className}`,
|
|
2069
|
+
onClick: () => !isDisabled && (setSelected == null ? void 0 : setSelected(value))
|
|
2070
|
+
}, rest), {
|
|
2071
|
+
children: label
|
|
2072
|
+
})
|
|
2073
|
+
);
|
|
2074
|
+
}
|
|
2075
|
+
);
|
|
2076
|
+
Tab.displayName = "Tab";
|
|
2077
|
+
|
|
2078
|
+
// src/components/TextArea/TextArea.tsx
|
|
2079
|
+
import {
|
|
2080
|
+
useState as useState9,
|
|
2081
|
+
forwardRef as forwardRef19
|
|
2082
|
+
} from "react";
|
|
2083
|
+
import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2084
|
+
var TextArea = forwardRef19(
|
|
2085
|
+
(_a, ref) => {
|
|
2086
|
+
var _b = _a, {
|
|
2087
|
+
maxText = 500,
|
|
2088
|
+
height = 100,
|
|
2089
|
+
error,
|
|
2090
|
+
label,
|
|
2091
|
+
placeholder,
|
|
2092
|
+
description,
|
|
2093
|
+
icon,
|
|
2094
|
+
isDisabled = false,
|
|
2095
|
+
isLoading = false,
|
|
2096
|
+
isVertify = false,
|
|
2097
|
+
isClearable = true,
|
|
2098
|
+
disabled,
|
|
2099
|
+
value,
|
|
2100
|
+
onChange
|
|
2101
|
+
} = _b, props = __objRest(_b, [
|
|
2102
|
+
"maxText",
|
|
2103
|
+
"height",
|
|
2104
|
+
"error",
|
|
2105
|
+
"label",
|
|
2106
|
+
"placeholder",
|
|
2107
|
+
"description",
|
|
2108
|
+
"icon",
|
|
2109
|
+
"isDisabled",
|
|
2110
|
+
"isLoading",
|
|
2111
|
+
"isVertify",
|
|
2112
|
+
"isClearable",
|
|
2113
|
+
"disabled",
|
|
2114
|
+
"value",
|
|
2115
|
+
"onChange"
|
|
2116
|
+
]);
|
|
2117
|
+
const [isFocused, setIsFocused] = useState9(false);
|
|
2118
|
+
return /* @__PURE__ */ jsxs17("div", { className: "w-full flex flex-col gap-4", children: [
|
|
2119
|
+
/* @__PURE__ */ jsxs17("div", { className: "w-full flex justify-between items-center ", children: [
|
|
2120
|
+
label ? /* @__PURE__ */ jsx20(
|
|
2121
|
+
"p",
|
|
2122
|
+
{
|
|
2123
|
+
className: `text-label-medium text-left items-left ${isDisabled || disabled ? "text-gray-400" : "text-gray-900"}`,
|
|
2124
|
+
children: label
|
|
2125
|
+
}
|
|
2126
|
+
) : /* @__PURE__ */ jsx20(Fragment3, {}),
|
|
2127
|
+
maxText ? /* @__PURE__ */ jsxs17("p", { className: "text-gray-400 text-caption-caption", children: [
|
|
2128
|
+
" ",
|
|
2129
|
+
(value == null ? void 0 : value.length) || 0,
|
|
2130
|
+
" / ",
|
|
2131
|
+
maxText
|
|
2132
|
+
] }) : /* @__PURE__ */ jsx20(Fragment3, {})
|
|
2133
|
+
] }),
|
|
2134
|
+
/* @__PURE__ */ jsxs17("div", { className: "relative w-full", children: [
|
|
2135
|
+
/* @__PURE__ */ jsx20(
|
|
2136
|
+
"textarea",
|
|
2137
|
+
__spreadValues({
|
|
2138
|
+
ref,
|
|
2139
|
+
name: "text-input",
|
|
2140
|
+
placeholder,
|
|
2141
|
+
disabled: isDisabled || disabled || isLoading,
|
|
2142
|
+
onFocus: () => setIsFocused(true),
|
|
2143
|
+
onBlur: () => setIsFocused(false),
|
|
2144
|
+
value,
|
|
2145
|
+
onChange,
|
|
2146
|
+
className: `w-full min-h-${height} focus:min-h-${height - 2} pt-12 pb-8 pr-44 pl-16 focus:pt-11 focus:pb-7 focus:pr-43 focus:pl-15 border border-gray-300 text-base rounded-md focus:outline-none focus:ring-1 focus:m-1 focus:w-[calc(100%-2px)] ${isDisabled || disabled ? "bg-gray-50 text-gray-400" : error ? "bg-white text-gray-900 border-red-500 focus:border-red-500 focus:ring-red-500" : "bg-white text-gray-900 focus:border-blue-600 focus:ring-blue-600"}`
|
|
2147
|
+
}, props)
|
|
2148
|
+
),
|
|
2149
|
+
isLoading ? /* @__PURE__ */ jsx20(
|
|
2150
|
+
Loading,
|
|
2151
|
+
{
|
|
2152
|
+
size: "sm",
|
|
2153
|
+
className: `absolute right-12 top-12`
|
|
2154
|
+
}
|
|
2155
|
+
) : isClearable && isFocused && value ? /* @__PURE__ */ jsx20(
|
|
2156
|
+
"svg",
|
|
2157
|
+
{
|
|
2158
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2159
|
+
width: "20",
|
|
2160
|
+
height: "20",
|
|
2161
|
+
viewBox: "0 0 20 20",
|
|
2162
|
+
fill: "none",
|
|
2163
|
+
className: "text-gray-900 flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2164
|
+
onMouseDown: (e) => {
|
|
2165
|
+
e.preventDefault();
|
|
2166
|
+
onChange == null ? void 0 : onChange({ target: { value: "" } });
|
|
2167
|
+
},
|
|
2168
|
+
children: /* @__PURE__ */ jsx20(
|
|
2169
|
+
"path",
|
|
2170
|
+
{
|
|
2171
|
+
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",
|
|
2172
|
+
fill: "#111827"
|
|
2173
|
+
}
|
|
2174
|
+
)
|
|
2175
|
+
}
|
|
2176
|
+
) : isVertify ? /* @__PURE__ */ jsx20(
|
|
2177
|
+
"svg",
|
|
2178
|
+
{
|
|
2179
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2180
|
+
width: "20",
|
|
2181
|
+
height: "20",
|
|
2182
|
+
viewBox: "0 0 20 20",
|
|
2183
|
+
fill: "none",
|
|
2184
|
+
className: "text-green-600 flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2185
|
+
children: /* @__PURE__ */ jsx20(
|
|
2186
|
+
"path",
|
|
2187
|
+
{
|
|
2188
|
+
"fill-rule": "evenodd",
|
|
2189
|
+
"clip-rule": "evenodd",
|
|
2190
|
+
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
2191
|
+
fill: "#16A34A"
|
|
2192
|
+
}
|
|
2193
|
+
)
|
|
2194
|
+
}
|
|
2195
|
+
) : error ? /* @__PURE__ */ jsx20(
|
|
2196
|
+
"svg",
|
|
2197
|
+
{
|
|
2198
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2199
|
+
width: "20",
|
|
2200
|
+
height: "20",
|
|
2201
|
+
viewBox: "0 0 20 20",
|
|
2202
|
+
fill: "none",
|
|
2203
|
+
className: "text-red-500 flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2204
|
+
children: /* @__PURE__ */ jsx20(
|
|
2205
|
+
"path",
|
|
2206
|
+
{
|
|
2207
|
+
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",
|
|
2208
|
+
fill: "#EF4444"
|
|
2209
|
+
}
|
|
2210
|
+
)
|
|
2211
|
+
}
|
|
2212
|
+
) : /* @__PURE__ */ jsx20(Fragment3, {})
|
|
2213
|
+
] }),
|
|
2214
|
+
error ? /* @__PURE__ */ jsx20("p", { className: "text-caption-caption text-left items-left text-red-600", children: error }) : description ? /* @__PURE__ */ jsx20("p", { className: "text-caption-caption text-left items-left text-gray-600", children: description }) : /* @__PURE__ */ jsx20(Fragment3, {})
|
|
2215
|
+
] });
|
|
2216
|
+
}
|
|
2217
|
+
);
|
|
2218
|
+
TextArea.displayName = "TextArea";
|
|
2219
|
+
|
|
2220
|
+
// src/components/TextField/TextField.tsx
|
|
2221
|
+
import {
|
|
2222
|
+
useState as useState10,
|
|
2223
|
+
forwardRef as forwardRef20
|
|
2224
|
+
} from "react";
|
|
2225
|
+
import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2226
|
+
var TextField = forwardRef20(
|
|
2227
|
+
(_a, ref) => {
|
|
2228
|
+
var _b = _a, {
|
|
2229
|
+
inputSize,
|
|
2230
|
+
error,
|
|
2231
|
+
label,
|
|
2232
|
+
placeholder,
|
|
2233
|
+
description,
|
|
2234
|
+
icon,
|
|
2235
|
+
isDisabled = false,
|
|
2236
|
+
isLoading = false,
|
|
2237
|
+
isVertify = false,
|
|
2238
|
+
isUnrequired = false,
|
|
2239
|
+
isClearable = true,
|
|
2240
|
+
disabled,
|
|
2241
|
+
value,
|
|
2242
|
+
onChange
|
|
2243
|
+
} = _b, props = __objRest(_b, [
|
|
2244
|
+
"inputSize",
|
|
2245
|
+
"error",
|
|
2246
|
+
"label",
|
|
2247
|
+
"placeholder",
|
|
2248
|
+
"description",
|
|
2249
|
+
"icon",
|
|
2250
|
+
"isDisabled",
|
|
2251
|
+
"isLoading",
|
|
2252
|
+
"isVertify",
|
|
2253
|
+
"isUnrequired",
|
|
2254
|
+
"isClearable",
|
|
2255
|
+
"disabled",
|
|
2256
|
+
"value",
|
|
2257
|
+
"onChange"
|
|
2258
|
+
]);
|
|
2259
|
+
const [isFocused, setIsFocused] = useState10(false);
|
|
2260
|
+
return /* @__PURE__ */ jsxs18("div", { className: "w-full flex flex-col gap-4", children: [
|
|
2261
|
+
label ? /* @__PURE__ */ jsxs18(
|
|
2262
|
+
"p",
|
|
2263
|
+
{
|
|
2264
|
+
className: `text-label-medium text-left items-left ${isDisabled || disabled ? "text-gray-400" : "text-gray-900"}`,
|
|
2265
|
+
children: [
|
|
2266
|
+
label,
|
|
2267
|
+
" ",
|
|
2268
|
+
isUnrequired && /* @__PURE__ */ jsx21("span", { className: "text-gray-400", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
2269
|
+
]
|
|
2270
|
+
}
|
|
2271
|
+
) : /* @__PURE__ */ jsx21(Fragment4, {}),
|
|
2272
|
+
/* @__PURE__ */ jsxs18("div", { className: "relative w-full", children: [
|
|
2273
|
+
/* @__PURE__ */ jsx21(
|
|
2274
|
+
"input",
|
|
2275
|
+
__spreadValues({
|
|
2276
|
+
ref,
|
|
2277
|
+
name: "text-input",
|
|
2278
|
+
type: "text",
|
|
2279
|
+
placeholder,
|
|
2280
|
+
disabled: isDisabled || disabled || isLoading,
|
|
2281
|
+
onFocus: () => setIsFocused(true),
|
|
2282
|
+
onBlur: () => setIsFocused(false),
|
|
2283
|
+
value,
|
|
2284
|
+
onChange,
|
|
2285
|
+
className: `w-full ${inputSize === "md" ? "px-16 py-12 focus:px-15 focus:py-11" : "p-16 focus:p-15"} border border-gray-300 text-base rounded-md focus:outline-none focus:ring-1 focus:m-1 focus:w-[calc(100%-2px)] ${isDisabled || disabled ? "bg-gray-50 text-gray-400" : error ? "bg-white text-gray-900 border-red-500 focus:border-red-500 focus:ring-red-500" : "bg-white text-gray-900 focus:border-blue-600 focus:ring-blue-600"}`
|
|
2286
|
+
}, props)
|
|
2287
|
+
),
|
|
2288
|
+
isLoading ? /* @__PURE__ */ jsx21(
|
|
2289
|
+
Loading,
|
|
2290
|
+
{
|
|
2291
|
+
size: "sm",
|
|
2292
|
+
className: `absolute right-16 top-1/2 -translate-y-1/2`
|
|
2293
|
+
}
|
|
2294
|
+
) : isClearable && isFocused && value ? /* @__PURE__ */ jsx21(
|
|
2295
|
+
"svg",
|
|
2296
|
+
{
|
|
2297
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2298
|
+
width: "20",
|
|
2299
|
+
height: "20",
|
|
2300
|
+
viewBox: "0 0 20 20",
|
|
2301
|
+
fill: "none",
|
|
2302
|
+
className: "text-gray-900 flex h-20 w-20 items-center justify-center absolute right-16 top-1/2 -translate-y-1/2",
|
|
2303
|
+
onMouseDown: (e) => {
|
|
2304
|
+
e.preventDefault();
|
|
2305
|
+
onChange == null ? void 0 : onChange({ target: { value: "" } });
|
|
2306
|
+
},
|
|
2307
|
+
children: /* @__PURE__ */ jsx21(
|
|
2308
|
+
"path",
|
|
2309
|
+
{
|
|
2310
|
+
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",
|
|
2311
|
+
fill: "#111827"
|
|
2312
|
+
}
|
|
2313
|
+
)
|
|
2314
|
+
}
|
|
2315
|
+
) : isVertify ? /* @__PURE__ */ jsx21(
|
|
2316
|
+
"svg",
|
|
2317
|
+
{
|
|
2318
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2319
|
+
width: "20",
|
|
2320
|
+
height: "20",
|
|
2321
|
+
viewBox: "0 0 20 20",
|
|
2322
|
+
fill: "none",
|
|
2323
|
+
className: "text-green-600 flex h-20 w-20 items-center justify-center absolute right-16 top-1/2 -translate-y-1/2",
|
|
2324
|
+
children: /* @__PURE__ */ jsx21(
|
|
2325
|
+
"path",
|
|
2326
|
+
{
|
|
2327
|
+
"fill-rule": "evenodd",
|
|
2328
|
+
"clip-rule": "evenodd",
|
|
2329
|
+
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
2330
|
+
fill: "#16A34A"
|
|
2331
|
+
}
|
|
2332
|
+
)
|
|
2333
|
+
}
|
|
2334
|
+
) : error ? /* @__PURE__ */ jsx21(
|
|
2335
|
+
"svg",
|
|
2336
|
+
{
|
|
2337
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2338
|
+
width: "20",
|
|
2339
|
+
height: "20",
|
|
2340
|
+
viewBox: "0 0 20 20",
|
|
2341
|
+
fill: "none",
|
|
2342
|
+
className: "text-red-500 flex h-20 w-20 items-center justify-center absolute right-16 top-1/2 -translate-y-1/2",
|
|
2343
|
+
children: /* @__PURE__ */ jsx21(
|
|
2344
|
+
"path",
|
|
2345
|
+
{
|
|
2346
|
+
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",
|
|
2347
|
+
fill: "#EF4444"
|
|
2348
|
+
}
|
|
2349
|
+
)
|
|
2350
|
+
}
|
|
2351
|
+
) : /* @__PURE__ */ jsx21(Fragment4, {})
|
|
2352
|
+
] }),
|
|
2353
|
+
error ? /* @__PURE__ */ jsx21("p", { className: "text-caption-caption text-left items-left text-red-600", children: error }) : description ? /* @__PURE__ */ jsx21("p", { className: "text-caption-caption text-left items-left text-gray-600", children: description }) : /* @__PURE__ */ jsx21(Fragment4, {})
|
|
2354
|
+
] });
|
|
2355
|
+
}
|
|
2356
|
+
);
|
|
2357
|
+
TextField.displayName = "TextField";
|
|
2358
|
+
|
|
1434
2359
|
// src/components/Toast/Toast.tsx
|
|
1435
|
-
import { forwardRef as
|
|
1436
|
-
import { jsx as
|
|
2360
|
+
import { forwardRef as forwardRef21 } from "react";
|
|
2361
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1437
2362
|
function CheckCircleIcon({ className }) {
|
|
1438
|
-
return /* @__PURE__ */
|
|
1439
|
-
/* @__PURE__ */
|
|
1440
|
-
/* @__PURE__ */
|
|
2363
|
+
return /* @__PURE__ */ jsxs19("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2364
|
+
/* @__PURE__ */ jsx22("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2365
|
+
/* @__PURE__ */ jsx22("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1441
2366
|
] });
|
|
1442
2367
|
}
|
|
1443
2368
|
function ProgressIcon({ className }) {
|
|
1444
|
-
return /* @__PURE__ */
|
|
1445
|
-
/* @__PURE__ */
|
|
1446
|
-
/* @__PURE__ */
|
|
2369
|
+
return /* @__PURE__ */ jsxs19("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2370
|
+
/* @__PURE__ */ jsx22("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5", opacity: "0.3" }),
|
|
2371
|
+
/* @__PURE__ */ jsx22("path", { d: "M10 2a8 8 0 0 1 8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: /* @__PURE__ */ jsx22("animateTransform", { attributeName: "transform", type: "rotate", from: "0 10 10", to: "360 10 10", dur: "1s", repeatCount: "indefinite" }) })
|
|
1447
2372
|
] });
|
|
1448
2373
|
}
|
|
1449
2374
|
function ErrorIcon({ className }) {
|
|
1450
|
-
return /* @__PURE__ */
|
|
1451
|
-
/* @__PURE__ */
|
|
1452
|
-
/* @__PURE__ */
|
|
2375
|
+
return /* @__PURE__ */ jsxs19("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2376
|
+
/* @__PURE__ */ jsx22("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2377
|
+
/* @__PURE__ */ jsx22("path", { d: "M10 6.5v4M10 13.5h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
1453
2378
|
] });
|
|
1454
2379
|
}
|
|
1455
|
-
function
|
|
1456
|
-
return /* @__PURE__ */
|
|
2380
|
+
function CloseIcon3({ className }) {
|
|
2381
|
+
return /* @__PURE__ */ jsx22("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx22("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1457
2382
|
}
|
|
1458
|
-
var
|
|
2383
|
+
var defaultIcons3 = {
|
|
1459
2384
|
default: CheckCircleIcon,
|
|
1460
2385
|
progress: ProgressIcon,
|
|
1461
2386
|
error: ErrorIcon
|
|
@@ -1470,7 +2395,7 @@ var iconColorClasses = {
|
|
|
1470
2395
|
progress: "text-toast-progress-icon",
|
|
1471
2396
|
error: "text-toast-error-icon"
|
|
1472
2397
|
};
|
|
1473
|
-
var Toast =
|
|
2398
|
+
var Toast = forwardRef21(
|
|
1474
2399
|
(_a, ref) => {
|
|
1475
2400
|
var _b = _a, {
|
|
1476
2401
|
type = "default",
|
|
@@ -1489,7 +2414,7 @@ var Toast = forwardRef13(
|
|
|
1489
2414
|
"children",
|
|
1490
2415
|
"className"
|
|
1491
2416
|
]);
|
|
1492
|
-
const DefaultIcon =
|
|
2417
|
+
const DefaultIcon = defaultIcons3[type];
|
|
1493
2418
|
const classes = [
|
|
1494
2419
|
"inline-flex items-center gap-12 font-sans",
|
|
1495
2420
|
"rounded-xl px-16 py-12",
|
|
@@ -1498,10 +2423,10 @@ var Toast = forwardRef13(
|
|
|
1498
2423
|
typeClasses[type],
|
|
1499
2424
|
className
|
|
1500
2425
|
].filter(Boolean).join(" ");
|
|
1501
|
-
return /* @__PURE__ */
|
|
1502
|
-
icon && /* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
1504
|
-
actionLabel && onAction && /* @__PURE__ */
|
|
2426
|
+
return /* @__PURE__ */ jsxs19("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
2427
|
+
icon && /* @__PURE__ */ jsx22("span", { className: `shrink-0 ${iconColorClasses[type]}`, children: /* @__PURE__ */ jsx22(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
2428
|
+
/* @__PURE__ */ jsx22("span", { className: "flex-1 text-sm font-medium leading-20 truncate", children }),
|
|
2429
|
+
actionLabel && onAction && /* @__PURE__ */ jsx22(
|
|
1505
2430
|
"button",
|
|
1506
2431
|
{
|
|
1507
2432
|
type: "button",
|
|
@@ -1510,31 +2435,184 @@ var Toast = forwardRef13(
|
|
|
1510
2435
|
children: actionLabel
|
|
1511
2436
|
}
|
|
1512
2437
|
),
|
|
1513
|
-
onDismiss && /* @__PURE__ */
|
|
2438
|
+
onDismiss && /* @__PURE__ */ jsx22(
|
|
1514
2439
|
"button",
|
|
1515
2440
|
{
|
|
1516
2441
|
type: "button",
|
|
1517
2442
|
onClick: onDismiss,
|
|
1518
2443
|
className: "shrink-0 p-4 rounded-md text-toast-dismiss hover:text-toast-dismiss-hover transition-colors",
|
|
1519
2444
|
"aria-label": "Dismiss",
|
|
1520
|
-
children: /* @__PURE__ */
|
|
2445
|
+
children: /* @__PURE__ */ jsx22(CloseIcon3, { className: "h-16 w-16" })
|
|
1521
2446
|
}
|
|
1522
2447
|
)
|
|
1523
2448
|
] }));
|
|
1524
2449
|
}
|
|
1525
2450
|
);
|
|
1526
2451
|
Toast.displayName = "Toast";
|
|
2452
|
+
|
|
2453
|
+
// src/components/ToggleSwitch/ToggleSwitch.tsx
|
|
2454
|
+
import { forwardRef as forwardRef22 } from "react";
|
|
2455
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2456
|
+
var ToggleSwitch = forwardRef22(
|
|
2457
|
+
(_a, ref) => {
|
|
2458
|
+
var _b = _a, {
|
|
2459
|
+
value,
|
|
2460
|
+
isDisabled = false,
|
|
2461
|
+
isSelected,
|
|
2462
|
+
setIsSelected,
|
|
2463
|
+
className = ""
|
|
2464
|
+
} = _b, rest = __objRest(_b, [
|
|
2465
|
+
"value",
|
|
2466
|
+
"isDisabled",
|
|
2467
|
+
"isSelected",
|
|
2468
|
+
"setIsSelected",
|
|
2469
|
+
"className"
|
|
2470
|
+
]);
|
|
2471
|
+
return /* @__PURE__ */ jsxs20(
|
|
2472
|
+
"label",
|
|
2473
|
+
__spreadProps(__spreadValues({
|
|
2474
|
+
ref,
|
|
2475
|
+
className: `inline-flex items-center ${className}`
|
|
2476
|
+
}, rest), {
|
|
2477
|
+
children: [
|
|
2478
|
+
/* @__PURE__ */ jsx23(
|
|
2479
|
+
"input",
|
|
2480
|
+
{
|
|
2481
|
+
type: "checkbox",
|
|
2482
|
+
value,
|
|
2483
|
+
className: "sr-only peer",
|
|
2484
|
+
checked: isSelected,
|
|
2485
|
+
onChange: () => !isDisabled && (setIsSelected == null ? void 0 : setIsSelected(!isSelected))
|
|
2486
|
+
}
|
|
2487
|
+
),
|
|
2488
|
+
/* @__PURE__ */ jsx23(
|
|
2489
|
+
"div",
|
|
2490
|
+
{
|
|
2491
|
+
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 `
|
|
2492
|
+
}
|
|
2493
|
+
)
|
|
2494
|
+
]
|
|
2495
|
+
})
|
|
2496
|
+
);
|
|
2497
|
+
}
|
|
2498
|
+
);
|
|
2499
|
+
ToggleSwitch.displayName = "ToggleSwitch";
|
|
2500
|
+
|
|
2501
|
+
// src/components/Tooltip/Tooltip.tsx
|
|
2502
|
+
import {
|
|
2503
|
+
useState as useState11,
|
|
2504
|
+
useEffect as useEffect6,
|
|
2505
|
+
useRef as useRef4,
|
|
2506
|
+
forwardRef as forwardRef23
|
|
2507
|
+
} from "react";
|
|
2508
|
+
import { Fragment as Fragment5, jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2509
|
+
var Tooltip = forwardRef23(
|
|
2510
|
+
(_a, ref) => {
|
|
2511
|
+
var _b = _a, {
|
|
2512
|
+
size = "md",
|
|
2513
|
+
children,
|
|
2514
|
+
headText,
|
|
2515
|
+
text,
|
|
2516
|
+
position = "top",
|
|
2517
|
+
className = ""
|
|
2518
|
+
} = _b, rest = __objRest(_b, [
|
|
2519
|
+
"size",
|
|
2520
|
+
"children",
|
|
2521
|
+
"headText",
|
|
2522
|
+
"text",
|
|
2523
|
+
"position",
|
|
2524
|
+
"className"
|
|
2525
|
+
]);
|
|
2526
|
+
const wrapperRef = useRef4(null);
|
|
2527
|
+
const [isVisible, setIsVisible] = useState11(false);
|
|
2528
|
+
const [isHovered, setIsHovered] = useState11(false);
|
|
2529
|
+
useEffect6(() => {
|
|
2530
|
+
const handleClickOutside = (event) => {
|
|
2531
|
+
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
|
|
2532
|
+
setIsVisible(false);
|
|
2533
|
+
setIsHovered(false);
|
|
2534
|
+
}
|
|
2535
|
+
};
|
|
2536
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
2537
|
+
return () => {
|
|
2538
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
2539
|
+
};
|
|
2540
|
+
}, []);
|
|
2541
|
+
return /* @__PURE__ */ jsxs21(
|
|
2542
|
+
"div",
|
|
2543
|
+
__spreadProps(__spreadValues({
|
|
2544
|
+
className: `group relative inline-block ${className}`,
|
|
2545
|
+
ref
|
|
2546
|
+
}, rest), {
|
|
2547
|
+
children: [
|
|
2548
|
+
/* @__PURE__ */ jsx24(
|
|
2549
|
+
"div",
|
|
2550
|
+
{
|
|
2551
|
+
ref: wrapperRef,
|
|
2552
|
+
onClick: () => {
|
|
2553
|
+
if (isVisible) {
|
|
2554
|
+
setIsVisible(false);
|
|
2555
|
+
setIsHovered(false);
|
|
2556
|
+
} else {
|
|
2557
|
+
setIsVisible(true);
|
|
2558
|
+
}
|
|
2559
|
+
},
|
|
2560
|
+
onMouseEnter: () => setIsHovered(true),
|
|
2561
|
+
onMouseLeave: () => setIsHovered(false),
|
|
2562
|
+
children
|
|
2563
|
+
}
|
|
2564
|
+
),
|
|
2565
|
+
/* @__PURE__ */ jsxs21(
|
|
2566
|
+
"div",
|
|
2567
|
+
{
|
|
2568
|
+
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"}`}`,
|
|
2569
|
+
children: [
|
|
2570
|
+
/* @__PURE__ */ jsx24(
|
|
2571
|
+
"span",
|
|
2572
|
+
{
|
|
2573
|
+
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`} `
|
|
2574
|
+
}
|
|
2575
|
+
),
|
|
2576
|
+
headText ? /* @__PURE__ */ jsx24(
|
|
2577
|
+
"p",
|
|
2578
|
+
{
|
|
2579
|
+
className: `text-sm text-white font-semibold text-center ${text ? "mb-5" : ""}`,
|
|
2580
|
+
children: headText
|
|
2581
|
+
}
|
|
2582
|
+
) : /* @__PURE__ */ jsx24(Fragment5, {}),
|
|
2583
|
+
text ? /* @__PURE__ */ jsx24("p", { className: "text-xs text-white font-normal text-center text-wrap", children: text }) : /* @__PURE__ */ jsx24(Fragment5, {})
|
|
2584
|
+
]
|
|
2585
|
+
}
|
|
2586
|
+
)
|
|
2587
|
+
]
|
|
2588
|
+
})
|
|
2589
|
+
);
|
|
2590
|
+
}
|
|
2591
|
+
);
|
|
2592
|
+
Tooltip.displayName = "Tooltip";
|
|
1527
2593
|
export {
|
|
1528
2594
|
Accordion,
|
|
1529
2595
|
AlertBanner,
|
|
1530
2596
|
Avatar,
|
|
1531
2597
|
Badge,
|
|
1532
2598
|
BottomSheet,
|
|
2599
|
+
Branding,
|
|
1533
2600
|
Button,
|
|
1534
2601
|
Checkbox,
|
|
2602
|
+
Chip,
|
|
1535
2603
|
Dialog,
|
|
2604
|
+
Dropdown,
|
|
2605
|
+
FinancialLogo,
|
|
1536
2606
|
Icon,
|
|
2607
|
+
Link,
|
|
2608
|
+
Loading,
|
|
1537
2609
|
Radio,
|
|
2610
|
+
SegmentControl,
|
|
1538
2611
|
Slider,
|
|
1539
|
-
|
|
2612
|
+
Tab,
|
|
2613
|
+
TextArea,
|
|
2614
|
+
TextField,
|
|
2615
|
+
Toast,
|
|
2616
|
+
ToggleSwitch,
|
|
2617
|
+
Tooltip
|
|
1540
2618
|
};
|