@moondreamsdev/dreamer-ui 1.5.9 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{join-DATGxH1G.js → QuestionMarkCircled-4DNhWOBS.js} +11 -15
- package/dist/QuestionMarkCircled-4DNhWOBS.js.map +1 -0
- package/dist/{join-yP8AS-6v.cjs → QuestionMarkCircled-Cy7kVj8I.cjs} +2 -2
- package/dist/QuestionMarkCircled-Cy7kVj8I.cjs.map +1 -0
- package/dist/components.cjs.js +1 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +212 -198
- package/dist/components.esm.js.map +1 -1
- package/dist/components.lib.d.ts +1 -0
- package/dist/core/components/slot/index.d.ts +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/index.lib.d.ts +1 -3
- package/dist/symbols.cjs.js +2 -0
- package/dist/symbols.cjs.js.map +1 -0
- package/dist/symbols.esm.js +9 -0
- package/dist/symbols.esm.js.map +1 -0
- package/dist/symbols.lib.d.ts +1 -0
- package/dist/utils.cjs.js +2 -0
- package/dist/utils.cjs.js.map +1 -0
- package/dist/utils.esm.js +7 -0
- package/dist/utils.esm.js.map +1 -0
- package/dist/utils.lib.d.ts +1 -0
- package/package.json +15 -3
- package/dist/join-DATGxH1G.js.map +0 -1
- package/dist/join-yP8AS-6v.cjs.map +0 -1
- /package/dist/core/{utilities → components/slot}/Slot.d.ts +0 -0
- /package/dist/core/{util → utils}/join.d.ts +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
2
|
-
function
|
2
|
+
function i({ size: C = 15 }) {
|
3
3
|
return /* @__PURE__ */ e("svg", { width: C, height: C, className: "inline", viewBox: "0 0 15 15", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
|
4
4
|
"path",
|
5
5
|
{
|
@@ -10,7 +10,7 @@ function t({ size: C = 15 }) {
|
|
10
10
|
}
|
11
11
|
) });
|
12
12
|
}
|
13
|
-
function
|
13
|
+
function t({ size: C = 15 }) {
|
14
14
|
return /* @__PURE__ */ e("svg", { width: C, height: C, className: "inline", viewBox: "0 0 15 15", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
|
15
15
|
"path",
|
16
16
|
{
|
@@ -21,7 +21,7 @@ function o({ size: C = 15 }) {
|
|
21
21
|
}
|
22
22
|
) });
|
23
23
|
}
|
24
|
-
function
|
24
|
+
function o({ size: C = 15 }) {
|
25
25
|
return /* @__PURE__ */ e("svg", { width: C, height: C, className: "inline", viewBox: "0 0 15 15", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
|
26
26
|
"path",
|
27
27
|
{
|
@@ -32,7 +32,7 @@ function r({ size: C = 15 }) {
|
|
32
32
|
}
|
33
33
|
) });
|
34
34
|
}
|
35
|
-
function
|
35
|
+
function r({ size: C = 15 }) {
|
36
36
|
return /* @__PURE__ */ e("svg", { width: C, height: C, className: "inline", viewBox: "0 0 15 15", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
|
37
37
|
"path",
|
38
38
|
{
|
@@ -43,7 +43,7 @@ function d({ size: C = 15 }) {
|
|
43
43
|
}
|
44
44
|
) });
|
45
45
|
}
|
46
|
-
function
|
46
|
+
function d({ size: C = 15, color: l = "currentColor" }) {
|
47
47
|
return /* @__PURE__ */ e("svg", { width: C, height: C, className: "inline", viewBox: "0 0 15 15", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
|
48
48
|
"path",
|
49
49
|
{
|
@@ -54,15 +54,11 @@ function s({ size: C = 15, color: l = "currentColor" }) {
|
|
54
54
|
}
|
55
55
|
) });
|
56
56
|
}
|
57
|
-
function c(...C) {
|
58
|
-
return C.filter((n) => typeof n == "string" && n).join(" ").trim() || void 0;
|
59
|
-
}
|
60
57
|
export {
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
c as j
|
58
|
+
i as C,
|
59
|
+
t as E,
|
60
|
+
d as Q,
|
61
|
+
o as a,
|
62
|
+
r as b
|
67
63
|
};
|
68
|
-
//# sourceMappingURL=
|
64
|
+
//# sourceMappingURL=QuestionMarkCircled-4DNhWOBS.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QuestionMarkCircled-4DNhWOBS.js","sources":["../src/core/symbols/CheckCircled.tsx","../src/core/symbols/ExclamationTriangle.tsx","../src/core/symbols/EyeClosed.tsx","../src/core/symbols/EyeOpened.tsx","../src/core/symbols/QuestionMarkCircled.tsx"],"sourcesContent":["export default function CheckCircled({ size = 15 }: { size?: number }) {\n return (\n <svg width={size} height={size} className={'inline'} viewBox='0 0 15 15' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M7.49991 0.877045C3.84222 0.877045 0.877075 3.84219 0.877075 7.49988C0.877075 11.1575 3.84222 14.1227 7.49991 14.1227C11.1576 14.1227 14.1227 11.1575 14.1227 7.49988C14.1227 3.84219 11.1576 0.877045 7.49991 0.877045ZM1.82708 7.49988C1.82708 4.36686 4.36689 1.82704 7.49991 1.82704C10.6329 1.82704 13.1727 4.36686 13.1727 7.49988C13.1727 10.6329 10.6329 13.1727 7.49991 13.1727C4.36689 13.1727 1.82708 10.6329 1.82708 7.49988ZM10.1589 5.53774C10.3178 5.31191 10.2636 5.00001 10.0378 4.84109C9.81194 4.68217 9.50004 4.73642 9.34112 4.96225L6.51977 8.97154L5.35681 7.78706C5.16334 7.59002 4.84677 7.58711 4.64973 7.78058C4.45268 7.97404 4.44978 8.29061 4.64325 8.48765L6.22658 10.1003C6.33054 10.2062 6.47617 10.2604 6.62407 10.2483C6.77197 10.2363 6.90686 10.1591 6.99226 10.0377L10.1589 5.53774Z'\n fill='currentColor'\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","export default function ExclamationTriangle({ size = 15 }: { size?: number }) {\n return (\n <svg width={size} height={size} className={'inline'} viewBox='0 0 15 15' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z'\n fill='currentColor'\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","export default function EyeClosed({ size = 15 }: { size?: number }) {\n return (\n <svg width={size} height={size} className={'inline'} viewBox='0 0 15 15' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z'\n fill='currentColor'\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","export default function EyeClosed({ size = 15 }: { size?: number }) {\n return (\n <svg width={size} height={size} className={'inline'} viewBox='0 0 15 15' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z'\n fill='currentColor'\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","export default function QuestionMarkCircled({ size = 15, color = 'currentColor' }: { size?: number; color?: string }) {\n return (\n <svg width={size} height={size} className={'inline'} viewBox='0 0 15 15' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M0.877075 7.49972C0.877075 3.84204 3.84222 0.876892 7.49991 0.876892C11.1576 0.876892 14.1227 3.84204 14.1227 7.49972C14.1227 11.1574 11.1576 14.1226 7.49991 14.1226C3.84222 14.1226 0.877075 11.1574 0.877075 7.49972ZM7.49991 1.82689C4.36689 1.82689 1.82708 4.36671 1.82708 7.49972C1.82708 10.6327 4.36689 13.1726 7.49991 13.1726C10.6329 13.1726 13.1727 10.6327 13.1727 7.49972C13.1727 4.36671 10.6329 1.82689 7.49991 1.82689ZM8.24993 10.5C8.24993 10.9142 7.91414 11.25 7.49993 11.25C7.08571 11.25 6.74993 10.9142 6.74993 10.5C6.74993 10.0858 7.08571 9.75 7.49993 9.75C7.91414 9.75 8.24993 10.0858 8.24993 10.5ZM6.05003 6.25C6.05003 5.57211 6.63511 4.925 7.50003 4.925C8.36496 4.925 8.95003 5.57211 8.95003 6.25C8.95003 6.74118 8.68002 6.99212 8.21447 7.27494C8.16251 7.30651 8.10258 7.34131 8.03847 7.37854L8.03841 7.37858C7.85521 7.48497 7.63788 7.61119 7.47449 7.73849C7.23214 7.92732 6.95003 8.23198 6.95003 8.7C6.95004 9.00376 7.19628 9.25 7.50004 9.25C7.8024 9.25 8.04778 9.00601 8.05002 8.70417L8.05056 8.7033C8.05924 8.6896 8.08493 8.65735 8.15058 8.6062C8.25207 8.52712 8.36508 8.46163 8.51567 8.37436L8.51571 8.37433C8.59422 8.32883 8.68296 8.27741 8.78559 8.21506C9.32004 7.89038 10.05 7.35382 10.05 6.25C10.05 4.92789 8.93511 3.825 7.50003 3.825C6.06496 3.825 4.95003 4.92789 4.95003 6.25C4.95003 6.55376 5.19628 6.8 5.50003 6.8C5.80379 6.8 6.05003 6.55376 6.05003 6.25Z'\n fill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K;AAAA,MACL,UAAS;AAAA,MACT,UAAS;AAAA,IAAA;AAAA,EAAA,GAEb;AAEJ;ACXA,SAAwBG,EAAoB,EAAE,MAAAJ,IAAO,IAAI,OAAAK,IAAQ,kBAAqD;AAElH,SAAA,gBAAAJ,EAAC,OAAI,EAAA,OAAOD,GAAM,QAAQA,GAAM,WAAW,UAAU,SAAQ,aAAY,OAAM,8BAC7E,UAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,GAAE;AAAA,MACF,MAAMI;AAAA,MACN,UAAS;AAAA,MACT,UAAS;AAAA,IAAA;AAAA,EAAA,GAEb;AAEJ;"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime");function
|
2
|
-
//# sourceMappingURL=
|
1
|
+
"use strict";const e=require("react/jsx-runtime");function i({size:C=15}){return e.jsx("svg",{width:C,height:C,className:"inline",viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M7.49991 0.877045C3.84222 0.877045 0.877075 3.84219 0.877075 7.49988C0.877075 11.1575 3.84222 14.1227 7.49991 14.1227C11.1576 14.1227 14.1227 11.1575 14.1227 7.49988C14.1227 3.84219 11.1576 0.877045 7.49991 0.877045ZM1.82708 7.49988C1.82708 4.36686 4.36689 1.82704 7.49991 1.82704C10.6329 1.82704 13.1727 4.36686 13.1727 7.49988C13.1727 10.6329 10.6329 13.1727 7.49991 13.1727C4.36689 13.1727 1.82708 10.6329 1.82708 7.49988ZM10.1589 5.53774C10.3178 5.31191 10.2636 5.00001 10.0378 4.84109C9.81194 4.68217 9.50004 4.73642 9.34112 4.96225L6.51977 8.97154L5.35681 7.78706C5.16334 7.59002 4.84677 7.58711 4.64973 7.78058C4.45268 7.97404 4.44978 8.29061 4.64325 8.48765L6.22658 10.1003C6.33054 10.2062 6.47617 10.2604 6.62407 10.2483C6.77197 10.2363 6.90686 10.1591 6.99226 10.0377L10.1589 5.53774Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function n({size:C=15}){return e.jsx("svg",{width:C,height:C,className:"inline",viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function t({size:C=15}){return e.jsx("svg",{width:C,height:C,className:"inline",viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function r({size:C=15}){return e.jsx("svg",{width:C,height:C,className:"inline",viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function o({size:C=15,color:l="currentColor"}){return e.jsx("svg",{width:C,height:C,className:"inline",viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M0.877075 7.49972C0.877075 3.84204 3.84222 0.876892 7.49991 0.876892C11.1576 0.876892 14.1227 3.84204 14.1227 7.49972C14.1227 11.1574 11.1576 14.1226 7.49991 14.1226C3.84222 14.1226 0.877075 11.1574 0.877075 7.49972ZM7.49991 1.82689C4.36689 1.82689 1.82708 4.36671 1.82708 7.49972C1.82708 10.6327 4.36689 13.1726 7.49991 13.1726C10.6329 13.1726 13.1727 10.6327 13.1727 7.49972C13.1727 4.36671 10.6329 1.82689 7.49991 1.82689ZM8.24993 10.5C8.24993 10.9142 7.91414 11.25 7.49993 11.25C7.08571 11.25 6.74993 10.9142 6.74993 10.5C6.74993 10.0858 7.08571 9.75 7.49993 9.75C7.91414 9.75 8.24993 10.0858 8.24993 10.5ZM6.05003 6.25C6.05003 5.57211 6.63511 4.925 7.50003 4.925C8.36496 4.925 8.95003 5.57211 8.95003 6.25C8.95003 6.74118 8.68002 6.99212 8.21447 7.27494C8.16251 7.30651 8.10258 7.34131 8.03847 7.37854L8.03841 7.37858C7.85521 7.48497 7.63788 7.61119 7.47449 7.73849C7.23214 7.92732 6.95003 8.23198 6.95003 8.7C6.95004 9.00376 7.19628 9.25 7.50004 9.25C7.8024 9.25 8.04778 9.00601 8.05002 8.70417L8.05056 8.7033C8.05924 8.6896 8.08493 8.65735 8.15058 8.6062C8.25207 8.52712 8.36508 8.46163 8.51567 8.37436L8.51571 8.37433C8.59422 8.32883 8.68296 8.27741 8.78559 8.21506C9.32004 7.89038 10.05 7.35382 10.05 6.25C10.05 4.92789 8.93511 3.825 7.50003 3.825C6.06496 3.825 4.95003 4.92789 4.95003 6.25C4.95003 6.55376 5.19628 6.8 5.50003 6.8C5.80379 6.8 6.05003 6.55376 6.05003 6.25Z",fill:l,fillRule:"evenodd",clipRule:"evenodd"})})}exports.CheckCircled=i;exports.ExclamationTriangle=n;exports.EyeClosed=t;exports.EyeClosed$1=r;exports.QuestionMarkCircled=o;
|
2
|
+
//# sourceMappingURL=QuestionMarkCircled-Cy7kVj8I.cjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QuestionMarkCircled-Cy7kVj8I.cjs","sources":["../src/core/symbols/CheckCircled.tsx","../src/core/symbols/ExclamationTriangle.tsx","../src/core/symbols/EyeClosed.tsx","../src/core/symbols/EyeOpened.tsx","../src/core/symbols/QuestionMarkCircled.tsx"],"sourcesContent":["export default function CheckCircled({ size = 15 }: { size?: number }) {\n return (\n <svg width={size} height={size} className={'inline'} viewBox='0 0 15 15' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M7.49991 0.877045C3.84222 0.877045 0.877075 3.84219 0.877075 7.49988C0.877075 11.1575 3.84222 14.1227 7.49991 14.1227C11.1576 14.1227 14.1227 11.1575 14.1227 7.49988C14.1227 3.84219 11.1576 0.877045 7.49991 0.877045ZM1.82708 7.49988C1.82708 4.36686 4.36689 1.82704 7.49991 1.82704C10.6329 1.82704 13.1727 4.36686 13.1727 7.49988C13.1727 10.6329 10.6329 13.1727 7.49991 13.1727C4.36689 13.1727 1.82708 10.6329 1.82708 7.49988ZM10.1589 5.53774C10.3178 5.31191 10.2636 5.00001 10.0378 4.84109C9.81194 4.68217 9.50004 4.73642 9.34112 4.96225L6.51977 8.97154L5.35681 7.78706C5.16334 7.59002 4.84677 7.58711 4.64973 7.78058C4.45268 7.97404 4.44978 8.29061 4.64325 8.48765L6.22658 10.1003C6.33054 10.2062 6.47617 10.2604 6.62407 10.2483C6.77197 10.2363 6.90686 10.1591 6.99226 10.0377L10.1589 5.53774Z'\n fill='currentColor'\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","export default function ExclamationTriangle({ size = 15 }: { size?: number }) {\n return (\n <svg width={size} height={size} className={'inline'} viewBox='0 0 15 15' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z'\n fill='currentColor'\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","export default function EyeClosed({ size = 15 }: { size?: number }) {\n return (\n <svg width={size} height={size} className={'inline'} viewBox='0 0 15 15' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z'\n fill='currentColor'\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","export default function EyeClosed({ size = 15 }: { size?: number }) {\n return (\n <svg width={size} height={size} className={'inline'} viewBox='0 0 15 15' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z'\n fill='currentColor'\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","export default function QuestionMarkCircled({ size = 15, color = 'currentColor' }: { size?: number; color?: string }) {\n return (\n <svg width={size} height={size} className={'inline'} viewBox='0 0 15 15' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M0.877075 7.49972C0.877075 3.84204 3.84222 0.876892 7.49991 0.876892C11.1576 0.876892 14.1227 3.84204 14.1227 7.49972C14.1227 11.1574 11.1576 14.1226 7.49991 14.1226C3.84222 14.1226 0.877075 11.1574 0.877075 7.49972ZM7.49991 1.82689C4.36689 1.82689 1.82708 4.36671 1.82708 7.49972C1.82708 10.6327 4.36689 13.1726 7.49991 13.1726C10.6329 13.1726 13.1727 10.6327 13.1727 7.49972C13.1727 4.36671 10.6329 1.82689 7.49991 1.82689ZM8.24993 10.5C8.24993 10.9142 7.91414 11.25 7.49993 11.25C7.08571 11.25 6.74993 10.9142 6.74993 10.5C6.74993 10.0858 7.08571 9.75 7.49993 9.75C7.91414 9.75 8.24993 10.0858 8.24993 10.5ZM6.05003 6.25C6.05003 5.57211 6.63511 4.925 7.50003 4.925C8.36496 4.925 8.95003 5.57211 8.95003 6.25C8.95003 6.74118 8.68002 6.99212 8.21447 7.27494C8.16251 7.30651 8.10258 7.34131 8.03847 7.37854L8.03841 7.37858C7.85521 7.48497 7.63788 7.61119 7.47449 7.73849C7.23214 7.92732 6.95003 8.23198 6.95003 8.7C6.95004 9.00376 7.19628 9.25 7.50004 9.25C7.8024 9.25 8.04778 9.00601 8.05002 8.70417L8.05056 8.7033C8.05924 8.6896 8.08493 8.65735 8.15058 8.6062C8.25207 8.52712 8.36508 8.46163 8.51567 8.37436L8.51571 8.37433C8.59422 8.32883 8.68296 8.27741 8.78559 8.21506C9.32004 7.89038 10.05 7.35382 10.05 6.25C10.05 4.92789 8.93511 3.825 7.50003 3.825C6.06496 3.825 4.95003 4.92789 4.95003 6.25C4.95003 6.55376 5.19628 6.8 5.50003 6.8C5.80379 6.8 6.05003 6.55376 6.05003 6.25Z'\n fill={color}\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n"],"names":["CheckCircled","size","jsx","ExclamationTriangle","EyeClosed","QuestionMarkCircled","color"],"m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N,SAAS,UACT,SAAS,SAAA,CAAA,EAEb,CAEJ"}
|
package/dist/components.cjs.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),x=require("./join-yP8AS-6v.cjs"),b=require("react");function I(){const[a,r]=b.useState(0);return b.useEffect(()=>{const e=setInterval(()=>{r(s=>(s+1)%3)},500);return()=>clearInterval(e)},[]),i.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(e=>i.jsx("div",{className:x.join("rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",a===e&&"transform -translate-y-1")},e))})}const L={base:"",primary:"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",tertiary:"text-primary hover:text-primary-foreground disabled:text-muted",outline:"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",link:"underline-offset-4 hover:underline disabled:underline disabled:text-muted",danger:"bg-danger text-danger-foreground hover:bg-danger/85 disabled:bg-muted disabled:text-muted-foreground"},S={stripped:"",fitted:"size-fit",sm:"px-2 py-1 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",icon:"p-1 w-fit aspect-square",full:"p-2 w-full"},R={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},N={variant:"primary",size:"md",rounded:"md"};function z({variant:a=N.variant,size:r,rounded:e=N.rounded,loading:s,linkTo:t,linkProps:n,type:d="button",className:u,...l}){let m;a==="link"&&!r?m="fitted":m=r||N.size;const o=x.join("appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",L[a],S[m],R[e],s&&"relative pointer-events-none",t&&"relative",u);return i.jsxs("button",{...l,role:t?"link":l.role,"aria-label":l["aria-label"]||(n==null?void 0:n["aria-label"]),"aria-description":l["aria-description"]||(n==null?void 0:n["aria-description"]),"aria-disabled":l.disabled||s,"aria-busy":s,type:d,className:o,children:[s&&i.jsx(I,{}),i.jsx("span",{className:x.join(s&&"invisible"),children:l.children}),t&&!l.disabled&&i.jsx("a",{...n,"aria-hidden":!0,href:t,target:(n==null?void 0:n.target)||"_blank",rel:(n==null?void 0:n.rel)||"noreferrer",className:"absolute inset-0"})]})}function B({size:a=15,color:r="currentColor"}){return i.jsx("svg",{width:a,height:a,className:"inline",viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"})})}function q(a){const[r,e]=b.useState(""),s=b.useCallback(t=>{let n=t,d="";for(;n&&!d;){const u=window.getComputedStyle(n).backgroundColor;u&&u!=="transparent"&&u!=="rgba(0, 0, 0, 0)"&&(d=u),n=n.parentElement}return d||"transparent"},[]);return b.useEffect(()=>{const t=document.getElementById(a);if(t){const n=s(t.parentElement);e(n)}},[a,s]),r}function F({ref:a,id:r,size:e=20,color:s,filled:t=!1,rounded:n=!0,checked:d=!1,onCheckedChange:u,disabled:l,className:m="",...v}){const o=b.useId(),g=b.useMemo(()=>r||`checkbox-${o}`,[r,o]),f=q(g),[c,h]=b.useState(d);b.useEffect(()=>{h(d)},[d]);const w=()=>{l||(h(!c),u==null||u(!c))},p=C=>{C.key===" "&&(C.preventDefault(),w())},j=x.join("flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",n&&"rounded",l&&"opacity-40 cursor-not-allowed",!l&&"cursor-pointer",m);return i.jsx("button",{id:g,type:"button",ref:a,tabIndex:0,role:"checkbox",onClick:w,"aria-checked":c,"aria-disabled":l,onKeyDownCapture:p,style:{width:e,height:e,color:s,backgroundColor:c&&t?"currentcolor":"transparent"},className:j,...v,children:c&&i.jsx(B,{size:e,color:t?f:void 0})})}const G={base:"",default:"ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-danger not-disabled:data-success:ring-success",underline:"border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success"},V={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},A={variant:"default",rounded:"none"};function E({elementId:a,type:r,message:e}){return b.useEffect(()=>{const s=document.getElementById(a);if(s){if(!e&&r==="error"){s.removeAttribute("data-error");return}if(!e&&r==="success"){s.removeAttribute("data-success");return}return s.setAttribute("aria-describedby",`${a}-${r}-message`),s.setAttribute("aria-invalid",r==="error"?"true":"false"),r==="error"&&s.setAttribute("data-error","true"),r==="success"&&s.setAttribute("data-success","true"),()=>{s.removeAttribute("aria-describedby"),s.removeAttribute("aria-invalid"),s.removeAttribute("data-error"),s.removeAttribute("data-success")}}},[a,r,e]),e?i.jsxs("small",{className:x.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",r==="error"&&"text-danger",r==="success"&&"text-success"),role:"status",children:[r==="error"?i.jsx(x.ExclamationTriangle,{}):i.jsx(x.CheckCircled,{}),i.jsx("span",{id:`${a}-${r}-message`,children:e})]}):null}function H({variant:a=A.variant,rounded:r,displayOnlyMode:e=!1,errorMessage:s,successMessage:t,type:n="text",className:d,...u}){const l=b.useId(),[m,v]=b.useState(!1);let o=r;a==="outline"&&!r&&(o="md"),o=o||A.rounded;const c=x.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all","file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors",!e&&G[a],!e&&V[o],n==="password"&&"pr-10",!e&&"px-2 py-1",e&&"pointer-events-none",d);return i.jsxs("div",{className:x.join(e&&"cursor-text"),style:{height:u.height,width:u.width},children:[i.jsxs("div",{className:x.join(n==="password"&&"relative"),children:[i.jsx("input",{...u,id:l,type:n==="password"&&m?"text":n,"aria-disabled":u.disabled,readOnly:e,"aria-readonly":e||u["aria-readonly"],"data-error":s?!0:void 0,"data-success":t?!0:void 0,className:c}),n==="password"&&i.jsx("button",{onClick:()=>v(!m),className:"absolute inset-y-0 right-0 px-2 hover:cursor-pointer","aria-label":"Toggle password visibility","data-state":m?"visible":"hidden",children:m?i.jsx(x.EyeClosed$1,{size:20}):i.jsx(x.EyeClosed,{size:20})})]}),!e&&i.jsx(E,{elementId:l,type:"error",message:s}),!e&&i.jsx(E,{elementId:l,type:"success",message:t})]})}function K({display:a="inline",width:r="fit-content",className:e="",required:s,helpMessage:t,suffix:n,htmlFor:d,children:u,...l}){const m=b.useId(),v=x.join("font-medium",a,e),o=t?`${d??m}-help`:void 0;return i.jsxs("div",{style:{display:a==="inline"?"inline-flex":"flex",width:r},className:"relative",children:[i.jsxs("label",{className:v,htmlFor:d,...l,children:[u,s&&i.jsx("span",{className:"text-red-500 font-medium ml-1","aria-label":"required",children:"*"})]}),t&&i.jsx("span",{className:"text-gray-500 ml-1 size-fit -translate-y-1/3","aria-describedby":o,"aria-label":"Help information",title:t,children:i.jsx(x.QuestionMarkCircled,{})}),t&&i.jsx("div",{id:o,className:"sr-only",children:t}),n&&i.jsx("span",{className:"ml-1",children:n})]})}function k({itemId:a,checked:r,onChange:e,name:s,disabled:t=!1,className:n=""}){const d="relative inline-flex items-center justify-center rounded-full",u=()=>{t||e()},l=x.join(d,!r&&"hover:border-current/60",!t&&"border-current cursor-pointer",t&&"border-muted/60 cursor-not-allowed",n);return i.jsx("div",{id:a,role:"radio",tabIndex:-1,"aria-checked":r,"aria-disabled":t,"aria-description":`Radio button for ${s}`,"aria-labelledby":`${a}-label`,onClick:u,className:l,style:{width:"1em",height:"1em",padding:"0.1em",borderWidth:"0.06em"},children:r&&i.jsx("div",{className:x.join("size-full aspect-square rounded-full",t&&"bg-muted/60",!t&&"bg-current")})})}function y({value:a,children:r,className:e="",isSelected:s=!1,onChange:t,disabled:n=!1,hideInput:d=!1,description:u,name:l}){const v=`radio-${b.useId()}-${a}`,o=()=>{n||t==null||t(a)};return i.jsxs("div",{title:u,className:x.join("relative flex items-center",e,d&&`p-2 border-2 focus-within:border-dashed focus-within:${n?"border-current/50":"border-current/80"}`,d&&!s&&`border-transparent ${n?"":"not-focus-within:hover:border-border/60"}`,d&&s&&"border-border",n&&"opacity-60 cursor-not-allowed"),style:{gap:"0.5em"},children:[!d&&i.jsx(k,{itemId:v,name:l||"",checked:s,onChange:o,disabled:n,className:x.join(d&&"")}),i.jsx("div",{id:d?v:void 0,tabIndex:d?-1:void 0,role:d?"radio":void 0,onClick:d?o:void 0,"aria-checked":d?s?"true":"false":void 0,"aria-disabled":d?n:void 0,"aria-description":d?u||`Radio button for ${l}`:void 0,"aria-labelledby":d?`${v}-label`:void 0,className:x.join(d&&"size-full",typeof r=="object"&&"grow focus:outline-none"),children:i.jsx("label",{id:`${v}-label`,onClick:d?void 0:o,className:x.join(n&&"cursor-not-allowed",!n&&"cursor-pointer"),children:r})})]})}function T(a,r){const[e,s]=b.useState(r),[t,n]=b.useState(-1),[d,u]=b.useState(!1),l=b.useCallback((f,c)=>{var p;const h=f[c];h.hasAttribute("disabled")||h.getAttribute("aria-disabled")==="true"||((p=f[c])==null||p.click(),n(c))},[]),m=b.useCallback((f,c)=>{var w;if(f.preventDefault(),d||!c.length)return;const h=r!==-1?r:0;(w=c[h])==null||w.focus(),s(h),r!==-1&&l(c,h)},[r,d,l]),v=b.useCallback(f=>{var p;if(!f.shiftKey)return;f.preventDefault();const c=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(j=>!j.hasAttribute("disabled")&&j.tabIndex>=0),h=c.findIndex(j=>j.id===a),w=h>0?h-1:c.length-1;(p=c[w])==null||p.focus()},[a]),o=b.useCallback((f,c)=>{var C;if(!c.length)return;const h=f.target;if(!c.some(D=>D.id===h.id))return;const p=e!==-1?e:0;let j=p;switch(f.key){case"ArrowUp":case"ArrowLeft":f.preventDefault(),j=p>0?p-1:c.length-1;break;case"ArrowDown":case"ArrowRight":f.preventDefault(),j=(p+1)%c.length;break;case" ":f.preventDefault(),l(c,p);return;case"Tab":v(f);return;default:return}(C=c[j])==null||C.focus(),s(j),t!==-1&&l(c,j)},[e,t,v,l]),g=b.useCallback(()=>{const f=document.querySelector(`[id="${a}"][role="radiogroup"]`);return f?Array.from(f.querySelectorAll('[role="radio"]')):[]},[a]);b.useEffect(()=>{const f=document.querySelector(`[id="${a}"][role="radiogroup"]`);if(!f)return;const c=g(),h=C=>m(C,c),w=C=>o(C,c),p=()=>u(!0),j=()=>u(!1);return document.addEventListener("keydown",w),f.addEventListener("focus",h),f.addEventListener("mousedown",p),document.addEventListener("mouseup",j),()=>{document.removeEventListener("keydown",w),f.removeEventListener("focus",h),f.removeEventListener("mousedown",p),document.removeEventListener("mouseup",j)}},[a,g,m,o])}function U({options:a=[],value:r,onChange:e,name:s,children:t,className:n="",childrenClassName:d="",hideInputs:u=!1}){const l=b.useId(),m=s||`radio-group-${l}`;T(m,a.findIndex(o=>o===r));const v=b.useMemo(()=>a.reduce((o,g)=>(typeof g=="string"?o.some(f=>f.value===g)||o.push({label:g,value:g}):o.push(g),o),[]),[a]);return i.jsxs("div",{id:m,role:"radiogroup",tabIndex:0,className:x.join(n,"focus:outline-none"),children:[v.length>0&&v.map((o,g)=>i.jsx(y,{value:o.value,isSelected:r===o.value,onChange:e,name:m,disabled:o.disabled,description:o.description,hideInput:u,className:d,children:o.label},`${o.value}-${g}`)),v.length===0&&t&&b.Children.map(t,o=>b.isValidElement(o)&&o.type===y?i.jsx(y,{...o.props,className:x.join(d,o.props.className),hideInput:o.props.hideInput||u,isSelected:r===o.props.value,onChange:e,name:m,children:o.props.children}):null)]})}function Q(a,r){b.useEffect(()=>{const e=document.getElementById(a);if(!e)return;if(!r){e.style.height="auto";return}const s=()=>{e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return s(),e.addEventListener("input",s),e.addEventListener("resize",s),window.addEventListener("resize",s),()=>{e.removeEventListener("input",s),e.removeEventListener("resize",s),window.removeEventListener("resize",s)}},[a,r])}const W={base:"","left-line":"border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success"},Z={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},$={variant:"outline",rounded:"none"};function _({elementId:a,maxLength:r}){const[e,s]=b.useState(0);return b.useEffect(()=>{const t=document.getElementById(a);if(!t)return;const n=()=>{const d=t.value.length;s(d);const u=d>=r;t.setAttribute("aria-describedby",`${a}-character-count`),t.setAttribute("aria-invalid",u?"true":"false"),u?t.setAttribute("data-error","true"):t.removeAttribute("data-error")};return n(),t.addEventListener("input",n),t.setAttribute("maxlength",String(r)),()=>{t.removeEventListener("input",n),t.removeAttribute("maxlength"),t.removeAttribute("aria-describedby"),t.removeAttribute("aria-invalid"),t.removeAttribute("data-error")}},[a,r]),i.jsx("small",{className:x.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",e>=r&&"text-danger",e<r&&"text-current"),role:"status",children:i.jsxs("span",{id:`${a}-character-count`,children:[e," / ",r," characters"]})})}function J({variant:a=$.variant,rounded:r,displayOnlyMode:e=!1,errorMessage:s,successMessage:t,hideResizeHandle:n=!1,autoExpand:d=!1,characterLimit:u=0,className:l,...m}){const v=b.useId();Q(v,d||e);let o=r;a==="outline"&&!r&&(o="md"),o=o||$.rounded;let g=n;(e||a==="left-line"&&!n)&&(g=!0);const c=x.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",!e&&W[a],!e&&Z[o],!e&&"px-2 py-1",e&&"pointer-events-none",g&&"no-resize-handle",l);return i.jsxs("div",{className:x.join("-space-y-1.5",e&&"cursor-text"),children:[i.jsx("textarea",{...m,id:v,"aria-disabled":m.disabled,readOnly:e,"aria-readonly":e||m["aria-readonly"],style:{resize:d?"none":void 0},className:c}),u>0&&i.jsx(_,{elementId:v,maxLength:u}),!e&&i.jsx(E,{elementId:v,type:"error",message:s}),!e&&i.jsx(E,{elementId:v,type:"success",message:t})]})}exports.Button=z;exports.ButtonLoadingDots=I;exports.Checkbox=F;exports.Input=H;exports.Label=K;exports.RadioGroup=U;exports.RadioGroupItem=y;exports.RadioInput=k;exports.Textarea=J;
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),v=require("./utils.cjs.js"),l=require("react"),y=require("./QuestionMarkCircled-Cy7kVj8I.cjs");function k(){const[t,r]=l.useState(0);return l.useEffect(()=>{const e=setInterval(()=>{r(s=>(s+1)%3)},500);return()=>clearInterval(e)},[]),i.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(e=>i.jsx("div",{className:v.join("rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",t===e&&"transform -translate-y-1")},e))})}const S={base:"",primary:"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",tertiary:"text-primary hover:text-primary-foreground disabled:text-muted",outline:"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",link:"underline-offset-4 hover:underline disabled:underline disabled:text-muted",danger:"bg-danger text-danger-foreground hover:bg-danger/85 disabled:bg-muted disabled:text-muted-foreground"},R={stripped:"",fitted:"size-fit",sm:"px-2 py-1 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",icon:"p-1 w-fit aspect-square",full:"p-2 w-full"},z={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},A={variant:"primary",size:"md",rounded:"md"};function B({variant:t=A.variant,size:r,rounded:e=A.rounded,loading:s,linkTo:n,linkProps:a,type:d="button",className:u,...c}){let m;t==="link"&&!r?m="fitted":m=r||A.size;const o=v.join("appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",S[t],R[m],z[e],s&&"relative pointer-events-none",n&&"relative",u);return i.jsxs("button",{...c,role:n?"link":c.role,"aria-label":c["aria-label"]||(a==null?void 0:a["aria-label"]),"aria-description":c["aria-description"]||(a==null?void 0:a["aria-description"]),"aria-disabled":c.disabled||s,"aria-busy":s,type:d,className:o,children:[s&&i.jsx(k,{}),i.jsx("span",{className:v.join(s&&"invisible"),children:c.children}),n&&!c.disabled&&i.jsx("a",{...a,"aria-hidden":!0,href:n,target:(a==null?void 0:a.target)||"_blank",rel:(a==null?void 0:a.rel)||"noreferrer",className:"absolute inset-0"})]})}function q({size:t=15,color:r="currentColor"}){return i.jsx("svg",{width:t,height:t,className:"inline",viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"})})}function V(t){const[r,e]=l.useState(""),s=l.useCallback(n=>{let a=n,d="";for(;a&&!d;){const u=window.getComputedStyle(a).backgroundColor;u&&u!=="transparent"&&u!=="rgba(0, 0, 0, 0)"&&(d=u),a=a.parentElement}return d||"transparent"},[]);return l.useEffect(()=>{const n=document.getElementById(t);if(n){const a=s(n.parentElement);e(a)}},[t,s]),r}function F({ref:t,id:r,size:e=20,color:s,filled:n=!1,rounded:a=!0,checked:d=!1,onCheckedChange:u,disabled:c,className:m="",...x}){const o=l.useId(),g=l.useMemo(()=>r||`checkbox-${o}`,[r,o]),f=V(g),[b,p]=l.useState(d);l.useEffect(()=>{p(d)},[d]);const w=()=>{c||(p(!b),u==null||u(!b))},h=C=>{C.key===" "&&(C.preventDefault(),w())},j=v.join("flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",a&&"rounded",c&&"opacity-40 cursor-not-allowed",!c&&"cursor-pointer",m);return i.jsx("button",{id:g,type:"button",ref:t,tabIndex:0,role:"checkbox",onClick:w,"aria-checked":b,"aria-disabled":c,onKeyDownCapture:h,style:{width:e,height:e,color:s,backgroundColor:b&&n?"currentcolor":"transparent"},className:j,...x,children:b&&i.jsx(q,{size:e,color:n?f:void 0})})}const G={base:"",default:"ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-danger not-disabled:data-success:ring-success",underline:"border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success"},H={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},$={variant:"default",rounded:"none"};function N({elementId:t,type:r,message:e}){return l.useEffect(()=>{const s=document.getElementById(t);if(s){if(!e&&r==="error"){s.removeAttribute("data-error");return}if(!e&&r==="success"){s.removeAttribute("data-success");return}return s.setAttribute("aria-describedby",`${t}-${r}-message`),s.setAttribute("aria-invalid",r==="error"?"true":"false"),r==="error"&&s.setAttribute("data-error","true"),r==="success"&&s.setAttribute("data-success","true"),()=>{s.removeAttribute("aria-describedby"),s.removeAttribute("aria-invalid"),s.removeAttribute("data-error"),s.removeAttribute("data-success")}}},[t,r,e]),e?i.jsxs("small",{className:v.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",r==="error"&&"text-danger",r==="success"&&"text-success"),role:"status",children:[r==="error"?i.jsx(y.ExclamationTriangle,{}):i.jsx(y.CheckCircled,{}),i.jsx("span",{id:`${t}-${r}-message`,children:e})]}):null}function K({variant:t=$.variant,rounded:r,displayOnlyMode:e=!1,errorMessage:s,successMessage:n,type:a="text",className:d,...u}){const c=l.useId(),[m,x]=l.useState(!1);let o=r;t==="outline"&&!r&&(o="md"),o=o||$.rounded;const b=v.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all","file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors",!e&&G[t],!e&&H[o],a==="password"&&"pr-10",!e&&"px-2 py-1",e&&"pointer-events-none",d);return i.jsxs("div",{className:v.join(e&&"cursor-text"),style:{height:u.height,width:u.width},children:[i.jsxs("div",{className:v.join(a==="password"&&"relative"),children:[i.jsx("input",{...u,id:c,type:a==="password"&&m?"text":a,"aria-disabled":u.disabled,readOnly:e,"aria-readonly":e||u["aria-readonly"],"data-error":s?!0:void 0,"data-success":n?!0:void 0,className:b}),a==="password"&&i.jsx("button",{onClick:()=>x(!m),className:"absolute inset-y-0 right-0 px-2 hover:cursor-pointer","aria-label":"Toggle password visibility","data-state":m?"visible":"hidden",children:m?i.jsx(y.EyeClosed$1,{size:20}):i.jsx(y.EyeClosed,{size:20})})]}),!e&&i.jsx(N,{elementId:c,type:"error",message:s}),!e&&i.jsx(N,{elementId:c,type:"success",message:n})]})}function T({display:t="inline",width:r="fit-content",className:e="",required:s,helpMessage:n,suffix:a,htmlFor:d,children:u,...c}){const m=l.useId(),x=v.join("font-medium",t,e),o=n?`${d??m}-help`:void 0;return i.jsxs("div",{style:{display:t==="inline"?"inline-flex":"flex",width:r},className:"relative",children:[i.jsxs("label",{className:x,htmlFor:d,...c,children:[u,s&&i.jsx("span",{className:"text-red-500 font-medium ml-1","aria-label":"required",children:"*"})]}),n&&i.jsx("span",{className:"text-gray-500 ml-1 size-fit -translate-y-1/3","aria-describedby":o,"aria-label":"Help information",title:n,children:i.jsx(y.QuestionMarkCircled,{})}),n&&i.jsx("div",{id:o,className:"sr-only",children:n}),a&&i.jsx("span",{className:"ml-1",children:a})]})}function Q({children:t,ref:r,...e}){if(l.isValidElement(t)){let s={...e};return t.props&&(s={...s,...t.props}),l.cloneElement(t,{...s,ref:n=>{typeof r=="function"?r(n):r&&(r.current=n)}})}return l.createElement("div",{...e,ref:r},t)}function D({itemId:t,checked:r,onChange:e,name:s,disabled:n=!1,className:a=""}){const d="relative inline-flex items-center justify-center rounded-full",u=()=>{n||e()},c=v.join(d,!r&&"hover:border-current/60",!n&&"border-current cursor-pointer",n&&"border-muted/60 cursor-not-allowed",a);return i.jsx("div",{id:t,role:"radio",tabIndex:-1,"aria-checked":r,"aria-disabled":n,"aria-description":`Radio button for ${s}`,"aria-labelledby":`${t}-label`,onClick:u,className:c,style:{width:"1em",height:"1em",padding:"0.1em",borderWidth:"0.06em"},children:r&&i.jsx("div",{className:v.join("size-full aspect-square rounded-full",n&&"bg-muted/60",!n&&"bg-current")})})}function E({value:t,children:r,className:e="",isSelected:s=!1,onChange:n,disabled:a=!1,hideInput:d=!1,description:u,name:c}){const x=`radio-${l.useId()}-${t}`,o=()=>{a||n==null||n(t)};return i.jsxs("div",{title:u,className:v.join("relative flex items-center",e,d&&`p-2 border-2 focus-within:border-dashed focus-within:${a?"border-current/50":"border-current/80"}`,d&&!s&&`border-transparent ${a?"":"not-focus-within:hover:border-border/60"}`,d&&s&&"border-border",a&&"opacity-60 cursor-not-allowed"),style:{gap:"0.5em"},children:[!d&&i.jsx(D,{itemId:x,name:c||"",checked:s,onChange:o,disabled:a,className:v.join(d&&"")}),i.jsx("div",{id:d?x:void 0,tabIndex:d?-1:void 0,role:d?"radio":void 0,onClick:d?o:void 0,"aria-checked":d?s?"true":"false":void 0,"aria-disabled":d?a:void 0,"aria-description":d?u||`Radio button for ${c}`:void 0,"aria-labelledby":d?`${x}-label`:void 0,className:v.join(d&&"size-full",typeof r=="object"&&"grow focus:outline-none"),children:i.jsx("label",{id:`${x}-label`,onClick:d?void 0:o,className:v.join(a&&"cursor-not-allowed",!a&&"cursor-pointer"),children:r})})]})}function U(t,r){const[e,s]=l.useState(r),[n,a]=l.useState(-1),[d,u]=l.useState(!1),c=l.useCallback((f,b)=>{var h;const p=f[b];p.hasAttribute("disabled")||p.getAttribute("aria-disabled")==="true"||((h=f[b])==null||h.click(),a(b))},[]),m=l.useCallback((f,b)=>{var w;if(f.preventDefault(),d||!b.length)return;const p=r!==-1?r:0;(w=b[p])==null||w.focus(),s(p),r!==-1&&c(b,p)},[r,d,c]),x=l.useCallback(f=>{var h;if(!f.shiftKey)return;f.preventDefault();const b=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(j=>!j.hasAttribute("disabled")&&j.tabIndex>=0),p=b.findIndex(j=>j.id===t),w=p>0?p-1:b.length-1;(h=b[w])==null||h.focus()},[t]),o=l.useCallback((f,b)=>{var C;if(!b.length)return;const p=f.target;if(!b.some(L=>L.id===p.id))return;const h=e!==-1?e:0;let j=h;switch(f.key){case"ArrowUp":case"ArrowLeft":f.preventDefault(),j=h>0?h-1:b.length-1;break;case"ArrowDown":case"ArrowRight":f.preventDefault(),j=(h+1)%b.length;break;case" ":f.preventDefault(),c(b,h);return;case"Tab":x(f);return;default:return}(C=b[j])==null||C.focus(),s(j),n!==-1&&c(b,j)},[e,n,x,c]),g=l.useCallback(()=>{const f=document.querySelector(`[id="${t}"][role="radiogroup"]`);return f?Array.from(f.querySelectorAll('[role="radio"]')):[]},[t]);l.useEffect(()=>{const f=document.querySelector(`[id="${t}"][role="radiogroup"]`);if(!f)return;const b=g(),p=C=>m(C,b),w=C=>o(C,b),h=()=>u(!0),j=()=>u(!1);return document.addEventListener("keydown",w),f.addEventListener("focus",p),f.addEventListener("mousedown",h),document.addEventListener("mouseup",j),()=>{document.removeEventListener("keydown",w),f.removeEventListener("focus",p),f.removeEventListener("mousedown",h),document.removeEventListener("mouseup",j)}},[t,g,m,o])}function W({options:t=[],value:r,onChange:e,name:s,children:n,className:a="",childrenClassName:d="",hideInputs:u=!1}){const c=l.useId(),m=s||`radio-group-${c}`;U(m,t.findIndex(o=>o===r));const x=l.useMemo(()=>t.reduce((o,g)=>(typeof g=="string"?o.some(f=>f.value===g)||o.push({label:g,value:g}):o.push(g),o),[]),[t]);return i.jsxs("div",{id:m,role:"radiogroup",tabIndex:0,className:v.join(a,"focus:outline-none"),children:[x.length>0&&x.map((o,g)=>i.jsx(E,{value:o.value,isSelected:r===o.value,onChange:e,name:m,disabled:o.disabled,description:o.description,hideInput:u,className:d,children:o.label},`${o.value}-${g}`)),x.length===0&&n&&l.Children.map(n,o=>l.isValidElement(o)&&o.type===E?i.jsx(E,{...o.props,className:v.join(d,o.props.className),hideInput:o.props.hideInput||u,isSelected:r===o.props.value,onChange:e,name:m,children:o.props.children}):null)]})}function Z(t,r){l.useEffect(()=>{const e=document.getElementById(t);if(!e)return;if(!r){e.style.height="auto";return}const s=()=>{e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return s(),e.addEventListener("input",s),e.addEventListener("resize",s),window.addEventListener("resize",s),()=>{e.removeEventListener("input",s),e.removeEventListener("resize",s),window.removeEventListener("resize",s)}},[t,r])}const _={base:"","left-line":"border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success"},J={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},I={variant:"outline",rounded:"none"};function X({elementId:t,maxLength:r}){const[e,s]=l.useState(0);return l.useEffect(()=>{const n=document.getElementById(t);if(!n)return;const a=()=>{const d=n.value.length;s(d);const u=d>=r;n.setAttribute("aria-describedby",`${t}-character-count`),n.setAttribute("aria-invalid",u?"true":"false"),u?n.setAttribute("data-error","true"):n.removeAttribute("data-error")};return a(),n.addEventListener("input",a),n.setAttribute("maxlength",String(r)),()=>{n.removeEventListener("input",a),n.removeAttribute("maxlength"),n.removeAttribute("aria-describedby"),n.removeAttribute("aria-invalid"),n.removeAttribute("data-error")}},[t,r]),i.jsx("small",{className:v.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",e>=r&&"text-danger",e<r&&"text-current"),role:"status",children:i.jsxs("span",{id:`${t}-character-count`,children:[e," / ",r," characters"]})})}function Y({variant:t=I.variant,rounded:r,displayOnlyMode:e=!1,errorMessage:s,successMessage:n,hideResizeHandle:a=!1,autoExpand:d=!1,characterLimit:u=0,className:c,...m}){const x=l.useId();Z(x,d||e);let o=r;t==="outline"&&!r&&(o="md"),o=o||I.rounded;let g=a;(e||t==="left-line"&&!a)&&(g=!0);const b=v.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",!e&&_[t],!e&&J[o],!e&&"px-2 py-1",e&&"pointer-events-none",g&&"no-resize-handle",c);return i.jsxs("div",{className:v.join("-space-y-1.5",e&&"cursor-text"),children:[i.jsx("textarea",{...m,id:x,"aria-disabled":m.disabled,readOnly:e,"aria-readonly":e||m["aria-readonly"],style:{resize:d?"none":void 0},className:b}),u>0&&i.jsx(X,{elementId:x,maxLength:u}),!e&&i.jsx(N,{elementId:x,type:"error",message:s}),!e&&i.jsx(N,{elementId:x,type:"success",message:n})]})}exports.Button=B;exports.ButtonLoadingDots=k;exports.Checkbox=F;exports.Input=K;exports.Label=T;exports.RadioGroup=W;exports.RadioGroupItem=E;exports.RadioInput=D;exports.Slot=Q;exports.Textarea=Y;
|
2
2
|
//# sourceMappingURL=components.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"components.cjs.js","sources":["../src/core/components/button/LoadingDots.tsx","../src/core/components/button/variants.ts","../src/core/components/button/Button.tsx","../src/core/symbols/Check.tsx","../src/core/components/checkbox/hooks.ts","../src/core/components/checkbox/Checkbox.tsx","../src/core/components/input/variants.ts","../src/core/shared/forms/StatusHelpMessage.tsx","../src/core/components/input/Input.tsx","../src/core/components/label/Label.tsx","../src/core/components/radiogroup/RadioInput.tsx","../src/core/components/radiogroup/RadioGroupItem.tsx","../src/core/components/radiogroup/hooks.ts","../src/core/components/radiogroup/RadioGroup.tsx","../src/core/components/textarea/hooks.ts","../src/core/components/textarea/variants.ts","../src/core/components/textarea/CharacterCount.tsx","../src/core/components/textarea/Textarea.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { join } from '../../util/join';\n\nexport default function LoadingDots() {\n const [activeIndex, setActiveIndex] = useState(0);\n\n useEffect(() => {\n const interval = setInterval(() => {\n setActiveIndex((prevIndex) => (prevIndex + 1) % 3);\n }, 500);\n\n return () => clearInterval(interval);\n }, []);\n\n return (\n <div className='absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle'>\n {[0, 1, 2].map((index) => (\n <div\n key={index}\n className={join(\n 'rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current',\n activeIndex === index && 'transform -translate-y-1'\n )}\n />\n ))}\n </div>\n );\n}\n","export const buttonVariants = {\n base: '',\n primary: 'bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80',\n tertiary: 'text-primary hover:text-primary-foreground disabled:text-muted',\n outline: 'border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted',\n link: 'underline-offset-4 hover:underline disabled:underline disabled:text-muted',\n danger: 'bg-danger text-danger-foreground hover:bg-danger/85 disabled:bg-muted disabled:text-muted-foreground',\n} as const;\nexport type ButtonVariant = keyof typeof buttonVariants;\n\nexport const sizeVariants = {\n stripped: '',\n fitted: 'size-fit',\n sm: 'px-2 py-1 text-sm',\n md: 'px-4 py-2 text-base',\n lg: 'px-6 py-3 text-lg',\n icon: 'p-1 w-fit aspect-square',\n full: 'p-2 w-full',\n} as const;\nexport type ButtonSize = keyof typeof sizeVariants;\n\nexport const roundedVariants = {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n full: 'rounded-full',\n} as const;\nexport type ButtonRounded = keyof typeof roundedVariants;\n\nexport interface ButtonVariants {\n variant: ButtonVariant;\n size: ButtonSize;\n rounded: ButtonRounded;\n}\n\nexport const buttonDefaults: ButtonVariants = {\n variant: 'primary',\n size: 'md',\n rounded: 'md',\n} as const;\n","// Button.tsx\nimport { ButtonHTMLAttributes, Ref } from 'react';\nimport { join } from '../../util/join';\nimport LoadingDots from './LoadingDots';\nimport { ButtonSize, ButtonVariants, buttonDefaults, buttonVariants, roundedVariants, sizeVariants } from './variants';\n\ninterface ButtonProps extends Partial<ButtonVariants>, ButtonHTMLAttributes<HTMLButtonElement> {\n ref?: Ref<HTMLButtonElement>;\n loading?: boolean;\n linkTo?: string;\n linkProps?: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>;\n}\n\nexport default function Button({\n variant = buttonDefaults.variant,\n size,\n rounded = buttonDefaults.rounded,\n loading,\n linkTo,\n linkProps,\n type = 'button',\n className,\n ...rest\n}: ButtonProps) {\n let adjustedSize: ButtonSize;\n if (variant === 'link' && !size) {\n // default links to fitted size\n adjustedSize = 'fitted';\n } else {\n adjustedSize = size || buttonDefaults.size;\n }\n\n const baseClasses =\n 'appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all';\n\n const buttonClasses = join(\n baseClasses,\n buttonVariants[variant],\n sizeVariants[adjustedSize],\n roundedVariants[rounded],\n loading && 'relative pointer-events-none',\n linkTo && 'relative',\n className\n );\n\n return (\n <button\n {...rest}\n role={linkTo ? 'link' : rest.role}\n aria-label={rest['aria-label'] || linkProps?.['aria-label']}\n aria-description={rest['aria-description'] || linkProps?.['aria-description']}\n aria-disabled={rest.disabled || loading}\n aria-busy={loading}\n type={type}\n className={buttonClasses}\n >\n {loading && <LoadingDots />}\n <span className={join(loading && 'invisible')}>{rest.children}</span>\n\n {linkTo && !rest.disabled && (\n <a\n {...linkProps}\n aria-hidden={true} // Hide from screen readers since the button is already accessible\n href={linkTo}\n target={linkProps?.target || '_blank'}\n rel={linkProps?.rel || 'noreferrer'}\n className='absolute inset-0'\n />\n )}\n </button>\n );\n}\n","export default function Check({ size = 15, color = 'currentColor' }: { size?: number, color?: string }) {\n return (\n <svg width={size} height={size} className={'inline'} viewBox='0 0 15 15' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z'\n fill={color}\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","import { useCallback, useEffect, useState } from 'react';\n\nexport function useFilledBackgroundColor(id: string) {\n const [filledBackgroundColor, setFilledBackgroundColor] = useState<string>('');\n\n const getFirstNonTransparentBackgroundColor = useCallback((element: Element | null): string => {\n let currentElement = element;\n let color = '';\n while (currentElement && !color) {\n const backgroundColor = window.getComputedStyle(currentElement).backgroundColor;\n if (backgroundColor && backgroundColor !== 'transparent' && backgroundColor !== 'rgba(0, 0, 0, 0)') {\n color = backgroundColor;\n }\n currentElement = currentElement.parentElement;\n }\n return color || 'transparent';\n }, []);\n\n useEffect(() => {\n const checkbox = document.getElementById(id);\n if (checkbox) {\n const backgroundColor = getFirstNonTransparentBackgroundColor(checkbox.parentElement);\n setFilledBackgroundColor(backgroundColor);\n }\n }, [id, getFirstNonTransparentBackgroundColor]);\n\n return filledBackgroundColor;\n}\n","import React, { Ref, useEffect, useId, useMemo, useState } from 'react';\nimport Check from '../../symbols/Check';\nimport { join } from '../../util/join';\nimport { useFilledBackgroundColor } from './hooks';\n\nexport interface CheckboxProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n ref?: Ref<HTMLButtonElement>;\n size?: number;\n color?: string; // can be adjusted with tailwindcss by using `text-<color>`\n filled?: boolean;\n rounded?: boolean;\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport default function Checkbox({\n ref,\n id,\n size = 20,\n color,\n filled = false,\n rounded = true,\n checked = false,\n onCheckedChange,\n disabled,\n className = '',\n ...props\n}: CheckboxProps) {\n const generatedId = useId();\n const checkboxId = useMemo(() => id || `checkbox-${generatedId}`, [id, generatedId]);\n const parentBackgroundColor = useFilledBackgroundColor(checkboxId);\n const [isChecked, setIsChecked] = useState(checked);\n\n useEffect(() => {\n setIsChecked(checked);\n }, [checked]);\n\n const handleChange = () => {\n if (!disabled) {\n setIsChecked(!isChecked);\n onCheckedChange?.(!isChecked);\n }\n };\n\n const handleOnKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n if (e.key === ' ') {\n e.preventDefault();\n handleChange();\n }\n };\n\n const checkboxClasses = join(\n 'flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2',\n rounded && 'rounded',\n disabled && 'opacity-40 cursor-not-allowed',\n !disabled && 'cursor-pointer',\n className\n );\n\n return (\n <button\n id={checkboxId}\n type='button'\n ref={ref}\n tabIndex={0}\n role='checkbox'\n onClick={handleChange}\n aria-checked={isChecked}\n aria-disabled={disabled}\n onKeyDownCapture={handleOnKeyDown}\n style={{\n width: size,\n height: size,\n color: color,\n backgroundColor: isChecked && filled ? 'currentcolor' : 'transparent',\n }}\n className={checkboxClasses}\n {...props}\n >\n {isChecked && <Check size={size} color={filled ? parentBackgroundColor : undefined} />}\n </button>\n );\n}\n","export const inputVariants = {\n base: '',\n default:\n 'ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-danger not-disabled:data-success:ring-success',\n underline:\n 'border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success',\n outline:\n 'border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success',\n} as const;\nexport type InputVariant = keyof typeof inputVariants;\n\nexport const roundedVariants = {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n full: 'px-3 rounded-full',\n} as const;\nexport type InputRounded = keyof typeof roundedVariants;\n\nexport interface InputVariants {\n variant: InputVariant;\n rounded: InputRounded;\n}\n\nexport const inputDefaults: InputVariants = {\n variant: 'default',\n rounded: 'none',\n} as const;\n","import { useEffect } from 'react';\nimport { CheckCircled, ExclamationTriangle } from '../../symbols';\nimport { join } from '../../util/join';\n\ninterface StatusHelpMessageProps {\n elementId: string;\n type: 'error' | 'success';\n message?: string;\n}\n\nexport default function StatusHelpMessage({ elementId, type, message }: StatusHelpMessageProps) {\n useEffect(() => {\n const element = document.getElementById(elementId) as HTMLElement;\n if (!element) {\n return;\n }\n if (!message && type === 'error') {\n element.removeAttribute('data-error');\n return;\n }\n if (!message && type === 'success') {\n element.removeAttribute('data-success');\n return;\n }\n\n element.setAttribute('aria-describedby', `${elementId}-${type}-message`);\n element.setAttribute('aria-invalid', type === 'error' ? 'true' : 'false');\n\n if (type === 'error') {\n element.setAttribute('data-error', 'true');\n }\n if (type === 'success') {\n element.setAttribute('data-success', 'true');\n }\n\n return () => {\n element.removeAttribute('aria-describedby');\n element.removeAttribute('aria-invalid');\n element.removeAttribute('data-error');\n element.removeAttribute('data-success');\n };\n }, [elementId, type, message]);\n\n if (!message) {\n return null;\n }\n\n return (\n <small\n className={join(\n 'mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start',\n type === 'error' && 'text-danger',\n type === 'success' && 'text-success'\n )}\n role='status'\n >\n {type === 'error' ? <ExclamationTriangle /> : <CheckCircled />}\n <span id={`${elementId}-${type}-message`}>{message}</span>\n </small>\n );\n}\n","import { Ref, useId, useState } from 'react';\nimport { EyeClosed, EyeOpened } from '../../symbols';\nimport { join } from '../../util/join';\nimport './styles.css';\nimport { inputDefaults, inputVariants, InputVariants, roundedVariants } from './variants';\nimport { StatusHelpMessage } from '../../shared/forms';\n\ninterface InputProps extends Partial<InputVariants>, React.InputHTMLAttributes<HTMLInputElement> {\n ref?: Ref<HTMLInputElement>;\n displayOnlyMode?: boolean;\n errorMessage?: string;\n successMessage?: string;\n}\n\nexport default function Input({\n variant = inputDefaults.variant,\n rounded,\n displayOnlyMode = false,\n errorMessage,\n successMessage,\n type = 'text',\n className,\n ...rest\n}: InputProps) {\n const id = useId();\n const [showPassword, setShowPassword] = useState(false);\n\n // Default `round` of `md` for `outline` variant\n let adjustedRound = rounded;\n if (variant === 'outline' && !rounded) {\n adjustedRound = 'md';\n }\n adjustedRound = adjustedRound || inputDefaults.rounded;\n\n const baseClasses =\n 'appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all';\n const fileClasses =\n 'file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors';\n\n const inputClasses = join(\n baseClasses,\n fileClasses,\n !displayOnlyMode && inputVariants[variant],\n !displayOnlyMode && roundedVariants[adjustedRound],\n type === 'password' && 'pr-10',\n !displayOnlyMode && 'px-2 py-1',\n displayOnlyMode && 'pointer-events-none',\n className\n );\n\n return (\n <div className={join(displayOnlyMode && 'cursor-text')} style={{ height: rest.height, width: rest.width }}>\n <div className={join(type === 'password' && 'relative')}>\n <input\n {...rest}\n id={id}\n type={type === 'password' && showPassword ? 'text' : type}\n aria-disabled={rest.disabled}\n readOnly={displayOnlyMode}\n aria-readonly={displayOnlyMode || rest['aria-readonly']}\n data-error={errorMessage ? true : undefined}\n data-success={successMessage ? true : undefined}\n className={inputClasses}\n />\n {type === 'password' && (\n <button\n onClick={() => setShowPassword(!showPassword)}\n className='absolute inset-y-0 right-0 px-2 hover:cursor-pointer'\n aria-label='Toggle password visibility'\n data-state={showPassword ? 'visible' : 'hidden'}\n >\n {showPassword ? <EyeOpened size={20} /> : <EyeClosed size={20} />}\n </button>\n )}\n </div>\n {!displayOnlyMode && <StatusHelpMessage elementId={id} type='error' message={errorMessage} />}\n {!displayOnlyMode && <StatusHelpMessage elementId={id} type='success' message={successMessage} />}\n </div>\n );\n}\n","import React, { useId } from 'react';\nimport { QuestionMarkCircled } from '../../symbols';\nimport { join } from '../../util/join';\n\nexport interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n display?: 'block' | 'inline';\n width?: React.CSSProperties['width'];\n required?: boolean;\n helpMessage?: string;\n suffix?: React.ReactNode;\n}\n\nexport function Label({\n display = 'inline',\n width = 'fit-content',\n className = '',\n required,\n helpMessage,\n suffix,\n htmlFor,\n children,\n ...props\n}: LabelProps) {\n const id = useId();\n const labelClasses = join('font-medium', display, className);\n const helpId = helpMessage ? `${htmlFor ?? id}-help` : undefined;\n\n return (\n <div style={{ display: display === 'inline' ? 'inline-flex' : 'flex', width }} className='relative'>\n <label className={labelClasses} htmlFor={htmlFor} {...props}>\n {children}\n {required && (\n <span className='text-red-500 font-medium ml-1' aria-label='required'>\n *\n </span>\n )}\n </label>\n {helpMessage && (\n <span\n className='text-gray-500 ml-1 size-fit -translate-y-1/3'\n aria-describedby={helpId}\n aria-label='Help information'\n title={helpMessage}\n >\n <QuestionMarkCircled />\n </span>\n )}\n {helpMessage && (\n <div id={helpId} className='sr-only'>\n {helpMessage}\n </div>\n )}\n {suffix && <span className='ml-1'>{suffix}</span>}\n </div>\n );\n}\n","import { join } from '../../util/join';\n\nexport type RadioInputProps = {\n itemId: string;\n checked: boolean;\n onChange: () => void;\n name: string;\n disabled?: boolean;\n className?: string;\n};\n\n// Custom RadioInput Component\nexport function RadioInput({ itemId, checked, onChange, name, disabled = false, className = '' }: RadioInputProps) {\n const baseClasses = 'relative inline-flex items-center justify-center rounded-full';\n\n const handleClick = () => {\n if (disabled) return;\n onChange();\n };\n\n const radioClasses = join(\n baseClasses,\n !checked && 'hover:border-current/60',\n !disabled && 'border-current cursor-pointer',\n disabled && 'border-muted/60 cursor-not-allowed',\n className\n );\n return (\n <div\n id={itemId}\n role='radio'\n tabIndex={-1} // necessary so that the radio button can be focused as div is not a focusable element\n aria-checked={checked}\n aria-disabled={disabled}\n aria-description={`Radio button for ${name}`}\n aria-labelledby={`${itemId}-label`}\n onClick={handleClick}\n className={radioClasses}\n style={{\n width: '1em',\n height: '1em',\n padding: '0.1em',\n borderWidth: '0.06em',\n }}\n >\n {checked && (\n <div\n className={join(`size-full aspect-square rounded-full`, disabled && 'bg-muted/60', !disabled && 'bg-current')}\n />\n )}\n </div>\n );\n}\n","import { useId } from 'react';\nimport { join } from '../../util/join';\nimport { RadioInput } from './RadioInput';\n\nexport interface RadioGroupItemProps {\n value: string;\n children: React.ReactNode;\n className?: string;\n isSelected?: boolean;\n onChange?: (value: string) => void;\n disabled?: boolean;\n name?: string;\n hideInput?: boolean;\n description?: string;\n}\n\nexport function RadioGroupItem({\n value,\n children,\n className = '',\n isSelected = false,\n onChange,\n disabled = false,\n hideInput = false,\n description,\n name,\n}: RadioGroupItemProps) {\n const id = useId();\n const itemId = `radio-${id}-${value}`;\n\n const handleChange = () => {\n if (!disabled) {\n onChange?.(value);\n }\n };\n\n return (\n <div\n title={description}\n className={join(\n 'relative flex items-center',\n className,\n // Uses text color for borders\n hideInput &&\n `p-2 border-2 focus-within:border-dashed focus-within:${\n disabled ? 'border-current/50' : 'border-current/80'\n }`,\n hideInput && !isSelected && `border-transparent ${disabled ? '' : 'not-focus-within:hover:border-border/60'}`,\n hideInput && isSelected && 'border-border',\n disabled && 'opacity-60 cursor-not-allowed'\n )}\n style={{\n gap: '0.5em',\n }}\n >\n {!hideInput && (\n <RadioInput\n itemId={itemId}\n name={name || ''}\n checked={isSelected}\n onChange={handleChange}\n disabled={disabled}\n className={join(hideInput && '')}\n />\n )}\n <div\n id={hideInput ? itemId : undefined}\n tabIndex={hideInput ? -1 : undefined}\n role={hideInput ? 'radio' : undefined}\n onClick={hideInput ? handleChange : undefined}\n aria-checked={!hideInput ? undefined : isSelected ? 'true' : 'false'}\n aria-disabled={hideInput ? disabled : undefined}\n aria-description={!hideInput ? undefined : description || `Radio button for ${name}`}\n aria-labelledby={hideInput ? `${itemId}-label` : undefined}\n className={join(hideInput && 'size-full', typeof children === 'object' && 'grow focus:outline-none')}\n >\n <label\n id={`${itemId}-label`}\n onClick={hideInput ? undefined : handleChange}\n className={join(disabled && 'cursor-not-allowed', !disabled && 'cursor-pointer')}\n >\n {children}\n </label>\n </div>\n </div>\n );\n}\n","import { useCallback, useEffect, useState } from 'react';\n\nexport function useRadioFocus(id: string, selectedOptionIndex: number) {\n // Manage state locally to avoid race conditions, which can result in\n // the an option failing to be selected or incorrectly selected\n const [focusedIndex, setFocusedIndex] = useState<number>(selectedOptionIndex);\n const [clickedIndex, setClickedIndex] = useState<number>(-1);\n // Prevent onClicks from triggering focus events and automatically selecting the first option\n const [isMouseDown, setIsMouseDown] = useState<boolean>(false);\n\n const handleClicked = useCallback((options: HTMLElement[], index: number) => {\n const target = options[index] as HTMLElement;\n\n // Check if the target element is disabled\n const isDisabled = target.hasAttribute('disabled') || target.getAttribute('aria-disabled') === 'true';\n if (isDisabled) return;\n\n // Update the selected index\n options[index]?.click();\n setClickedIndex(index);\n }, []);\n\n const setInitialFocus = useCallback(\n (e: Event, options: HTMLElement[]) => {\n e.preventDefault();\n if (isMouseDown) return;\n if (!options.length) return;\n\n const indexToFocus = selectedOptionIndex !== -1 ? selectedOptionIndex : 0;\n options[indexToFocus]?.focus();\n setFocusedIndex(indexToFocus);\n\n // Only update the selected index if one is already set\n if (selectedOptionIndex !== -1) {\n handleClicked(options, indexToFocus);\n }\n },\n [selectedOptionIndex, isMouseDown, handleClicked]\n );\n\n /* Focus preceding element when Shift + Tab is pressed */\n const handleFocusPreceding = useCallback(\n (e: KeyboardEvent) => {\n // If the Shift key is not pressed while tab is entered, do nothing\n if (!e.shiftKey) {\n return;\n }\n\n e.preventDefault();\n const focusableElements = Array.from(\n document.querySelectorAll<HTMLElement>(\n 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'\n )\n ).filter((el) => !el.hasAttribute('disabled') && el.tabIndex >= 0);\n const currentIndex = focusableElements.findIndex((el) => el.id === id);\n const previousIndex = currentIndex > 0 ? currentIndex - 1 : focusableElements.length - 1;\n focusableElements[previousIndex]?.focus();\n },\n [id]\n );\n\n const handleKeyboardNavigation = useCallback(\n (e: KeyboardEvent, options: HTMLElement[]) => {\n if (!options.length) return;\n\n // Ensure we only toggle options part of radio group\n const target = e.target as HTMLElement;\n const isGroupOption = options.some((option) => option.id === target.id);\n if (!isGroupOption) return;\n\n const currentIndex = focusedIndex !== -1 ? focusedIndex : 0;\n let newIndex = currentIndex;\n\n switch (e.key) {\n case 'ArrowUp':\n case 'ArrowLeft':\n e.preventDefault();\n newIndex = currentIndex > 0 ? currentIndex - 1 : options.length - 1;\n break;\n\n case 'ArrowDown':\n case 'ArrowRight':\n e.preventDefault();\n newIndex = (currentIndex + 1) % options.length;\n break;\n\n // Select the option when the space key is pressed\n case ' ':\n e.preventDefault();\n handleClicked(options, currentIndex);\n return;\n\n case 'Tab':\n handleFocusPreceding(e);\n return;\n\n default:\n return;\n }\n\n options[newIndex]?.focus();\n setFocusedIndex(newIndex);\n // Only update the selected index if one is already set\n if (clickedIndex !== -1) {\n handleClicked(options, newIndex);\n }\n },\n [focusedIndex, clickedIndex, handleFocusPreceding, handleClicked]\n );\n\n const getRadioOptions = useCallback((): HTMLElement[] => {\n const radioGroup = document.querySelector(`[id=\"${id}\"][role=\"radiogroup\"]`);\n if (!radioGroup) return [];\n\n return Array.from(radioGroup.querySelectorAll('[role=\"radio\"]'));\n }, [id]);\n\n useEffect(() => {\n const radioGroup = document.querySelector(`[id=\"${id}\"][role=\"radiogroup\"]`);\n if (!radioGroup) return;\n\n const options = getRadioOptions();\n const handleFocus = (e: Event) => setInitialFocus(e, options);\n const handleKeyDown = (e: KeyboardEvent) => handleKeyboardNavigation(e, options);\n const handleMouseDown = () => setIsMouseDown(true);\n const handleMouseUp = () => setIsMouseDown(false);\n\n document.addEventListener('keydown', handleKeyDown);\n radioGroup.addEventListener('focus', handleFocus);\n radioGroup.addEventListener('mousedown', handleMouseDown);\n document.addEventListener('mouseup', handleMouseUp); // place on document since mouseup event can occur outside of radio group\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n radioGroup.removeEventListener('focus', handleFocus);\n radioGroup.removeEventListener('mousedown', handleMouseDown);\n document.removeEventListener('mouseup', handleMouseUp);\n };\n }, [id, getRadioOptions, setInitialFocus, handleKeyboardNavigation]);\n}\n","import React, { useId, useMemo } from 'react';\nimport { join } from '../../util/join';\nimport { RadioGroupItem, RadioGroupItemProps } from './RadioGroupItem';\nimport { useRadioFocus } from './hooks';\n\nexport type RadioOption = { label: string; value: string; disabled?: boolean; description?: string };\n\nexport type RadioGroupProps = {\n options?: (string | RadioOption)[];\n value: string | undefined;\n onChange: (value: string) => void;\n name?: string;\n children?: React.ReactElement<RadioGroupItemProps>[] | React.ReactElement<RadioGroupItemProps>;\n className?: string;\n childrenClassName?: string;\n hideInputs?: boolean;\n};\n\nexport function RadioGroup({\n options = [],\n value,\n onChange,\n name,\n children,\n className = '',\n childrenClassName = '',\n hideInputs = false,\n}: RadioGroupProps) {\n const groupId = useId();\n const groupName = name || `radio-group-${groupId}`;\n useRadioFocus(\n groupName,\n options.findIndex((option) => option === value)\n );\n\n // Check for duplicates if string options are provided\n const processedOptions = useMemo(() => {\n return options.reduce<RadioOption[]>((acc, option) => {\n if (typeof option === 'string') {\n // Check if we already have this string option\n if (!acc.some((item) => item.value === option)) {\n acc.push({ label: option, value: option });\n }\n } else {\n acc.push(option);\n }\n return acc;\n }, []);\n }, [options]);\n\n return (\n <div id={groupName} role='radiogroup' tabIndex={0} className={join(className, 'focus:outline-none')}>\n {/* Render from options prop */}\n {processedOptions.length > 0 &&\n processedOptions.map((option, index) => (\n <RadioGroupItem\n key={`${option.value}-${index}`}\n value={option.value}\n isSelected={value === option.value}\n onChange={onChange}\n name={groupName}\n disabled={option.disabled}\n description={option.description}\n hideInput={hideInputs}\n className={childrenClassName}\n >\n {option.label}\n </RadioGroupItem>\n ))}\n\n {/* Render RadioGroupItem components */}\n {processedOptions.length === 0 &&\n children &&\n React.Children.map(children, (child) => {\n // TypeScript enforces that child is a RadioGroupItem\n if (React.isValidElement(child) && child.type === RadioGroupItem) {\n return (\n <RadioGroupItem\n {...child.props}\n className={join(childrenClassName, child.props.className)}\n hideInput={child.props.hideInput || hideInputs}\n isSelected={value === child.props.value}\n onChange={onChange}\n name={groupName}\n >\n {child.props.children}\n </RadioGroupItem>\n );\n }\n return null;\n })}\n </div>\n );\n}\n","import { useEffect } from 'react';\n\nexport function useAutoExpand(id: string, autoExpand: boolean) {\n useEffect(() => {\n const textarea = document.getElementById(id) as HTMLTextAreaElement;\n if (!textarea) {\n return;\n }\n\n if (!autoExpand) {\n textarea.style.height = 'auto';\n return;\n }\n\n const adjustHeight = () => {\n // necessary to reset the height to `auto` before calculating the new height\n textarea.style.height = 'auto';\n textarea.style.height = `${textarea.scrollHeight}px`;\n };\n\n adjustHeight();\n textarea.addEventListener('input', adjustHeight);\n textarea.addEventListener('resize', adjustHeight);\n window.addEventListener('resize', adjustHeight);\n\n return () => {\n textarea.removeEventListener('input', adjustHeight);\n textarea.removeEventListener('resize', adjustHeight);\n window.removeEventListener('resize', adjustHeight);\n };\n }, [id, autoExpand]);\n}\n","export const textareaVariants = {\n base: '',\n 'left-line':\n 'border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success',\n outline:\n 'border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success',\n} as const;\nexport type TextareaVariant = keyof typeof textareaVariants;\n\nexport const roundedVariants = {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n full: 'px-3 rounded-full',\n} as const;\nexport type TextareaRounded = keyof typeof roundedVariants;\n\nexport interface TextareaVariants {\n variant: TextareaVariant;\n rounded: TextareaRounded;\n}\n\nexport const textareaDefaults: TextareaVariants = {\n variant: 'outline',\n rounded: 'none',\n} as const;\n","import { useEffect, useState } from 'react';\nimport { join } from '../../util/join';\n\ninterface CharacterCountProps {\n elementId: string;\n maxLength: number;\n}\n\nexport default function CharacterCount({ elementId, maxLength }: CharacterCountProps) {\n const [characterCount, setCharacterCount] = useState(0);\n\n useEffect(() => {\n const textarea = document.getElementById(elementId) as HTMLTextAreaElement;\n if (!textarea) {\n return;\n }\n\n const updateCharacterCount = () => {\n const updatedCharacterCount = textarea.value.length;\n setCharacterCount(updatedCharacterCount);\n const isError = updatedCharacterCount >= maxLength;\n textarea.setAttribute('aria-describedby', `${elementId}-character-count`);\n textarea.setAttribute('aria-invalid', isError ? 'true' : 'false');\n\n if (isError) {\n textarea.setAttribute('data-error', 'true');\n } else {\n textarea.removeAttribute('data-error');\n }\n };\n\n updateCharacterCount();\n textarea.addEventListener('input', updateCharacterCount);\n textarea.setAttribute('maxlength', String(maxLength));\n\n return () => {\n textarea.removeEventListener('input', updateCharacterCount);\n textarea.removeAttribute('maxlength');\n textarea.removeAttribute('aria-describedby');\n textarea.removeAttribute('aria-invalid');\n textarea.removeAttribute('data-error');\n };\n }, [elementId, maxLength]);\n\n return (\n <small\n className={join(\n 'mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end',\n characterCount >= maxLength && 'text-danger',\n characterCount < maxLength && 'text-current'\n )}\n role='status'\n >\n <span id={`${elementId}-character-count`}>\n {characterCount} / {maxLength} characters\n </span>\n </small>\n );\n}\n","import { Ref, useId } from 'react';\nimport { StatusHelpMessage } from '../../shared/forms';\nimport { join } from '../../util/join';\nimport { useAutoExpand } from './hooks';\nimport './styles.css';\nimport { roundedVariants, textareaDefaults, textareaVariants, TextareaVariants } from './variants';\nimport CharacterCount from './CharacterCount';\n\ninterface TextareaProps extends Partial<TextareaVariants>, React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n ref?: Ref<HTMLTextAreaElement>;\n displayOnlyMode?: boolean;\n errorMessage?: string;\n successMessage?: string;\n hideResizeHandle?: boolean; // only works for Webkit browsers\n autoExpand?: boolean;\n characterLimit?: number;\n}\n\nexport default function Textarea({\n variant = textareaDefaults.variant,\n rounded,\n displayOnlyMode = false,\n errorMessage,\n successMessage,\n hideResizeHandle = false,\n autoExpand = false,\n characterLimit = 0,\n className,\n ...rest\n}: TextareaProps) {\n const id = useId();\n useAutoExpand(id, autoExpand || displayOnlyMode);\n\n // Default `round` of `md` for `outline` variant\n let adjustedRound = rounded;\n if (variant === 'outline' && !rounded) {\n adjustedRound = 'md';\n }\n adjustedRound = adjustedRound || textareaDefaults.rounded;\n\n let adjustedHideResizeHandle = hideResizeHandle;\n if (displayOnlyMode || (variant === 'left-line' && !hideResizeHandle)) {\n adjustedHideResizeHandle = true;\n }\n\n const baseClasses =\n 'appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all';\n\n const inputClasses = join(\n baseClasses,\n !displayOnlyMode && textareaVariants[variant],\n !displayOnlyMode && roundedVariants[adjustedRound],\n !displayOnlyMode && 'px-2 py-1',\n displayOnlyMode && 'pointer-events-none',\n adjustedHideResizeHandle && 'no-resize-handle',\n\n className\n );\n\n return (\n <div className={join('-space-y-1.5', displayOnlyMode && 'cursor-text')}>\n <textarea\n {...rest}\n id={id}\n aria-disabled={rest.disabled}\n readOnly={displayOnlyMode}\n aria-readonly={displayOnlyMode || rest['aria-readonly']}\n style={{\n resize: autoExpand ? 'none' : undefined,\n }}\n className={inputClasses}\n />\n {characterLimit > 0 && <CharacterCount elementId={id} maxLength={characterLimit} />}\n {!displayOnlyMode && <StatusHelpMessage elementId={id} type='error' message={errorMessage} />}\n {!displayOnlyMode && <StatusHelpMessage elementId={id} type='success' message={successMessage} />}\n </div>\n );\n}\n"],"names":["LoadingDots","activeIndex","setActiveIndex","useState","useEffect","interval","prevIndex","jsx","index","join","buttonVariants","sizeVariants","roundedVariants","buttonDefaults","Button","variant","size","rounded","loading","linkTo","linkProps","type","className","rest","adjustedSize","buttonClasses","jsxs","Check","color","useFilledBackgroundColor","id","filledBackgroundColor","setFilledBackgroundColor","getFirstNonTransparentBackgroundColor","useCallback","element","currentElement","backgroundColor","checkbox","Checkbox","ref","filled","checked","onCheckedChange","disabled","props","generatedId","useId","checkboxId","useMemo","parentBackgroundColor","isChecked","setIsChecked","handleChange","handleOnKeyDown","e","checkboxClasses","inputVariants","inputDefaults","StatusHelpMessage","elementId","message","ExclamationTriangle","CheckCircled","Input","displayOnlyMode","errorMessage","successMessage","showPassword","setShowPassword","adjustedRound","inputClasses","EyeOpened","EyeClosed","Label","display","width","required","helpMessage","suffix","htmlFor","children","labelClasses","helpId","QuestionMarkCircled","RadioInput","itemId","onChange","name","baseClasses","handleClick","radioClasses","RadioGroupItem","value","isSelected","hideInput","description","useRadioFocus","selectedOptionIndex","focusedIndex","setFocusedIndex","clickedIndex","setClickedIndex","isMouseDown","setIsMouseDown","handleClicked","options","target","_a","setInitialFocus","indexToFocus","handleFocusPreceding","focusableElements","el","currentIndex","previousIndex","handleKeyboardNavigation","option","newIndex","getRadioOptions","radioGroup","handleFocus","handleKeyDown","handleMouseDown","handleMouseUp","RadioGroup","childrenClassName","hideInputs","groupId","groupName","processedOptions","acc","item","React","child","useAutoExpand","autoExpand","textarea","adjustHeight","textareaVariants","textareaDefaults","CharacterCount","maxLength","characterCount","setCharacterCount","updateCharacterCount","updatedCharacterCount","isError","Textarea","hideResizeHandle","characterLimit","adjustedHideResizeHandle"],"mappings":"yKAGA,SAAwBA,GAAc,CACpC,KAAM,CAACC,EAAaC,CAAc,EAAIC,EAAAA,SAAS,CAAC,EAEhDC,OAAAA,EAAAA,UAAU,IAAM,CACR,MAAAC,EAAW,YAAY,IAAM,CACjCH,EAAgBI,IAAeA,EAAY,GAAK,CAAC,GAChD,GAAG,EAEC,MAAA,IAAM,cAAcD,CAAQ,CACrC,EAAG,EAAE,EAGHE,EAAA,IAAC,MAAI,CAAA,UAAU,gFACZ,SAAA,CAAC,EAAG,EAAG,CAAC,EAAE,IAAKC,GACdD,EAAA,IAAC,MAAA,CAEC,UAAWE,EAAA,KACT,gFACAR,IAAgBO,GAAS,0BAAA,CAC3B,EAJKA,CAMR,CAAA,EACH,CAEJ,CC3BO,MAAME,EAAiB,CAC5B,KAAM,GACN,QAAS,0GACT,UAAW,sHACX,SAAU,iEACV,QAAS,6IACT,KAAM,4EACN,OAAQ,sGACV,EAGaC,EAAe,CAC1B,SAAU,GACV,OAAQ,WACR,GAAI,oBACJ,GAAI,sBACJ,GAAI,oBACJ,KAAM,0BACN,KAAM,YACR,EAGaC,EAAkB,CAC7B,KAAM,eACN,GAAI,aACJ,GAAI,aACJ,GAAI,aACJ,KAAM,cACR,EASaC,EAAiC,CAC5C,QAAS,UACT,KAAM,KACN,QAAS,IACX,EC5BA,SAAwBC,EAAO,CAC7B,QAAAC,EAAUF,EAAe,QACzB,KAAAG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AzG,EAAI0G,GAAcvE,CAAe,EAG/C,IAAIK,EAAgBrD,EAChBF,IAAY,WAAa,CAACE,IACZqD,EAAA,MAElBA,EAAgBA,GAAiBsE,EAAiB,QAElD,IAAIW,EAA2BF,GAC3BpF,GAAoBlD,IAAY,aAAe,CAACsI,KACvBE,EAAA,IAM7B,MAAMhF,EAAe9D,EAAA,KAFnB,8JAIA,CAACwD,GAAmB0E,EAAiB5H,CAAO,EAC5C,CAACkD,GAAmBrD,EAAgB0D,CAAa,EACjD,CAACL,GAAmB,YACpBA,GAAmB,sBACnBsF,GAA4B,mBAE5BjI,CACF,EAEA,cACG,MAAI,CAAA,UAAWb,EAAAA,KAAK,eAAgBwD,GAAmB,aAAa,EACnE,SAAA,CAAA1D,EAAA,IAAC,WAAA,CACE,GAAGgB,EACJ,GAAAO,EACA,gBAAeP,EAAK,SACpB,SAAU0C,EACV,gBAAeA,GAAmB1C,EAAK,eAAe,EACtD,MAAO,CACL,OAAQiH,EAAa,OAAS,MAChC,EACA,UAAWjE,CAAA,CACb,EACC+E,EAAiB,GAAK/I,EAAAA,IAACsI,GAAe,UAAW/G,EAAI,UAAWwH,EAAgB,EAChF,CAACrF,GAAoB1D,EAAAA,IAAAoD,EAAA,CAAkB,UAAW7B,EAAI,KAAK,QAAQ,QAASoC,EAAc,EAC1F,CAACD,GAAoB1D,MAAAoD,EAAA,CAAkB,UAAW7B,EAAI,KAAK,UAAU,QAASqC,CAAgB,CAAA,CAAA,EACjG,CAEJ"}
|
1
|
+
{"version":3,"file":"components.cjs.js","sources":["../src/core/components/button/LoadingDots.tsx","../src/core/components/button/variants.ts","../src/core/components/button/Button.tsx","../src/core/symbols/Check.tsx","../src/core/components/checkbox/hooks.ts","../src/core/components/checkbox/Checkbox.tsx","../src/core/components/input/variants.ts","../src/core/shared/forms/StatusHelpMessage.tsx","../src/core/components/input/Input.tsx","../src/core/components/label/Label.tsx","../src/core/components/slot/Slot.tsx","../src/core/components/radiogroup/RadioInput.tsx","../src/core/components/radiogroup/RadioGroupItem.tsx","../src/core/components/radiogroup/hooks.ts","../src/core/components/radiogroup/RadioGroup.tsx","../src/core/components/textarea/hooks.ts","../src/core/components/textarea/variants.ts","../src/core/components/textarea/CharacterCount.tsx","../src/core/components/textarea/Textarea.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { join } from '../../utils/join';\n\nexport default function LoadingDots() {\n const [activeIndex, setActiveIndex] = useState(0);\n\n useEffect(() => {\n const interval = setInterval(() => {\n setActiveIndex((prevIndex) => (prevIndex + 1) % 3);\n }, 500);\n\n return () => clearInterval(interval);\n }, []);\n\n return (\n <div className='absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle'>\n {[0, 1, 2].map((index) => (\n <div\n key={index}\n className={join(\n 'rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current',\n activeIndex === index && 'transform -translate-y-1'\n )}\n />\n ))}\n </div>\n );\n}\n","export const buttonVariants = {\n base: '',\n primary: 'bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80',\n tertiary: 'text-primary hover:text-primary-foreground disabled:text-muted',\n outline: 'border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted',\n link: 'underline-offset-4 hover:underline disabled:underline disabled:text-muted',\n danger: 'bg-danger text-danger-foreground hover:bg-danger/85 disabled:bg-muted disabled:text-muted-foreground',\n} as const;\nexport type ButtonVariant = keyof typeof buttonVariants;\n\nexport const sizeVariants = {\n stripped: '',\n fitted: 'size-fit',\n sm: 'px-2 py-1 text-sm',\n md: 'px-4 py-2 text-base',\n lg: 'px-6 py-3 text-lg',\n icon: 'p-1 w-fit aspect-square',\n full: 'p-2 w-full',\n} as const;\nexport type ButtonSize = keyof typeof sizeVariants;\n\nexport const roundedVariants = {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n full: 'rounded-full',\n} as const;\nexport type ButtonRounded = keyof typeof roundedVariants;\n\nexport interface ButtonVariants {\n variant: ButtonVariant;\n size: ButtonSize;\n rounded: ButtonRounded;\n}\n\nexport const buttonDefaults: ButtonVariants = {\n variant: 'primary',\n size: 'md',\n rounded: 'md',\n} as const;\n","// Button.tsx\nimport { ButtonHTMLAttributes, Ref } from 'react';\nimport { join } from '../../utils/join';\nimport LoadingDots from './LoadingDots';\nimport { ButtonSize, ButtonVariants, buttonDefaults, buttonVariants, roundedVariants, sizeVariants } from './variants';\n\ninterface ButtonProps extends Partial<ButtonVariants>, ButtonHTMLAttributes<HTMLButtonElement> {\n ref?: Ref<HTMLButtonElement>;\n loading?: boolean;\n linkTo?: string;\n linkProps?: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>;\n}\n\nexport default function Button({\n variant = buttonDefaults.variant,\n size,\n rounded = buttonDefaults.rounded,\n loading,\n linkTo,\n linkProps,\n type = 'button',\n className,\n ...rest\n}: ButtonProps) {\n let adjustedSize: ButtonSize;\n if (variant === 'link' && !size) {\n // default links to fitted size\n adjustedSize = 'fitted';\n } else {\n adjustedSize = size || buttonDefaults.size;\n }\n\n const baseClasses =\n 'appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all';\n\n const buttonClasses = join(\n baseClasses,\n buttonVariants[variant],\n sizeVariants[adjustedSize],\n roundedVariants[rounded],\n loading && 'relative pointer-events-none',\n linkTo && 'relative',\n className\n );\n\n return (\n <button\n {...rest}\n role={linkTo ? 'link' : rest.role}\n aria-label={rest['aria-label'] || linkProps?.['aria-label']}\n aria-description={rest['aria-description'] || linkProps?.['aria-description']}\n aria-disabled={rest.disabled || loading}\n aria-busy={loading}\n type={type}\n className={buttonClasses}\n >\n {loading && <LoadingDots />}\n <span className={join(loading && 'invisible')}>{rest.children}</span>\n\n {linkTo && !rest.disabled && (\n <a\n {...linkProps}\n aria-hidden={true} // Hide from screen readers since the button is already accessible\n href={linkTo}\n target={linkProps?.target || '_blank'}\n rel={linkProps?.rel || 'noreferrer'}\n className='absolute inset-0'\n />\n )}\n </button>\n );\n}\n","export default function Check({ size = 15, color = 'currentColor' }: { size?: number, color?: string }) {\n return (\n <svg width={size} height={size} className={'inline'} viewBox='0 0 15 15' xmlns='http://www.w3.org/2000/svg'>\n <path\n d='M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z'\n fill={color}\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","import { useCallback, useEffect, useState } from 'react';\n\nexport function useFilledBackgroundColor(id: string) {\n const [filledBackgroundColor, setFilledBackgroundColor] = useState<string>('');\n\n const getFirstNonTransparentBackgroundColor = useCallback((element: Element | null): string => {\n let currentElement = element;\n let color = '';\n while (currentElement && !color) {\n const backgroundColor = window.getComputedStyle(currentElement).backgroundColor;\n if (backgroundColor && backgroundColor !== 'transparent' && backgroundColor !== 'rgba(0, 0, 0, 0)') {\n color = backgroundColor;\n }\n currentElement = currentElement.parentElement;\n }\n return color || 'transparent';\n }, []);\n\n useEffect(() => {\n const checkbox = document.getElementById(id);\n if (checkbox) {\n const backgroundColor = getFirstNonTransparentBackgroundColor(checkbox.parentElement);\n setFilledBackgroundColor(backgroundColor);\n }\n }, [id, getFirstNonTransparentBackgroundColor]);\n\n return filledBackgroundColor;\n}\n","import React, { Ref, useEffect, useId, useMemo, useState } from 'react';\nimport Check from '../../symbols/Check';\nimport { join } from '../../utils/join';\nimport { useFilledBackgroundColor } from './hooks';\n\nexport interface CheckboxProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n ref?: Ref<HTMLButtonElement>;\n size?: number;\n color?: string; // can be adjusted with tailwindcss by using `text-<color>`\n filled?: boolean;\n rounded?: boolean;\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport default function Checkbox({\n ref,\n id,\n size = 20,\n color,\n filled = false,\n rounded = true,\n checked = false,\n onCheckedChange,\n disabled,\n className = '',\n ...props\n}: CheckboxProps) {\n const generatedId = useId();\n const checkboxId = useMemo(() => id || `checkbox-${generatedId}`, [id, generatedId]);\n const parentBackgroundColor = useFilledBackgroundColor(checkboxId);\n const [isChecked, setIsChecked] = useState(checked);\n\n useEffect(() => {\n setIsChecked(checked);\n }, [checked]);\n\n const handleChange = () => {\n if (!disabled) {\n setIsChecked(!isChecked);\n onCheckedChange?.(!isChecked);\n }\n };\n\n const handleOnKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n if (e.key === ' ') {\n e.preventDefault();\n handleChange();\n }\n };\n\n const checkboxClasses = join(\n 'flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2',\n rounded && 'rounded',\n disabled && 'opacity-40 cursor-not-allowed',\n !disabled && 'cursor-pointer',\n className\n );\n\n return (\n <button\n id={checkboxId}\n type='button'\n ref={ref}\n tabIndex={0}\n role='checkbox'\n onClick={handleChange}\n aria-checked={isChecked}\n aria-disabled={disabled}\n onKeyDownCapture={handleOnKeyDown}\n style={{\n width: size,\n height: size,\n color: color,\n backgroundColor: isChecked && filled ? 'currentcolor' : 'transparent',\n }}\n className={checkboxClasses}\n {...props}\n >\n {isChecked && <Check size={size} color={filled ? parentBackgroundColor : undefined} />}\n </button>\n );\n}\n","export const inputVariants = {\n base: '',\n default:\n 'ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-danger not-disabled:data-success:ring-success',\n underline:\n 'border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success',\n outline:\n 'border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success',\n} as const;\nexport type InputVariant = keyof typeof inputVariants;\n\nexport const roundedVariants = {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n full: 'px-3 rounded-full',\n} as const;\nexport type InputRounded = keyof typeof roundedVariants;\n\nexport interface InputVariants {\n variant: InputVariant;\n rounded: InputRounded;\n}\n\nexport const inputDefaults: InputVariants = {\n variant: 'default',\n rounded: 'none',\n} as const;\n","import { useEffect } from 'react';\nimport { CheckCircled, ExclamationTriangle } from '../../symbols';\nimport { join } from '../../utils/join';\n\ninterface StatusHelpMessageProps {\n elementId: string;\n type: 'error' | 'success';\n message?: string;\n}\n\nexport default function StatusHelpMessage({ elementId, type, message }: StatusHelpMessageProps) {\n useEffect(() => {\n const element = document.getElementById(elementId) as HTMLElement;\n if (!element) {\n return;\n }\n if (!message && type === 'error') {\n element.removeAttribute('data-error');\n return;\n }\n if (!message && type === 'success') {\n element.removeAttribute('data-success');\n return;\n }\n\n element.setAttribute('aria-describedby', `${elementId}-${type}-message`);\n element.setAttribute('aria-invalid', type === 'error' ? 'true' : 'false');\n\n if (type === 'error') {\n element.setAttribute('data-error', 'true');\n }\n if (type === 'success') {\n element.setAttribute('data-success', 'true');\n }\n\n return () => {\n element.removeAttribute('aria-describedby');\n element.removeAttribute('aria-invalid');\n element.removeAttribute('data-error');\n element.removeAttribute('data-success');\n };\n }, [elementId, type, message]);\n\n if (!message) {\n return null;\n }\n\n return (\n <small\n className={join(\n 'mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start',\n type === 'error' && 'text-danger',\n type === 'success' && 'text-success'\n )}\n role='status'\n >\n {type === 'error' ? <ExclamationTriangle /> : <CheckCircled />}\n <span id={`${elementId}-${type}-message`}>{message}</span>\n </small>\n );\n}\n","import { Ref, useId, useState } from 'react';\nimport { EyeClosed, EyeOpened } from '../../symbols';\nimport { join } from '../../utils/join';\nimport './styles.css';\nimport { inputDefaults, inputVariants, InputVariants, roundedVariants } from './variants';\nimport { StatusHelpMessage } from '../../shared/forms';\n\ninterface InputProps extends Partial<InputVariants>, React.InputHTMLAttributes<HTMLInputElement> {\n ref?: Ref<HTMLInputElement>;\n displayOnlyMode?: boolean;\n errorMessage?: string;\n successMessage?: string;\n}\n\nexport default function Input({\n variant = inputDefaults.variant,\n rounded,\n displayOnlyMode = false,\n errorMessage,\n successMessage,\n type = 'text',\n className,\n ...rest\n}: InputProps) {\n const id = useId();\n const [showPassword, setShowPassword] = useState(false);\n\n // Default `round` of `md` for `outline` variant\n let adjustedRound = rounded;\n if (variant === 'outline' && !rounded) {\n adjustedRound = 'md';\n }\n adjustedRound = adjustedRound || inputDefaults.rounded;\n\n const baseClasses =\n 'appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all';\n const fileClasses =\n 'file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors';\n\n const inputClasses = join(\n baseClasses,\n fileClasses,\n !displayOnlyMode && inputVariants[variant],\n !displayOnlyMode && roundedVariants[adjustedRound],\n type === 'password' && 'pr-10',\n !displayOnlyMode && 'px-2 py-1',\n displayOnlyMode && 'pointer-events-none',\n className\n );\n\n return (\n <div className={join(displayOnlyMode && 'cursor-text')} style={{ height: rest.height, width: rest.width }}>\n <div className={join(type === 'password' && 'relative')}>\n <input\n {...rest}\n id={id}\n type={type === 'password' && showPassword ? 'text' : type}\n aria-disabled={rest.disabled}\n readOnly={displayOnlyMode}\n aria-readonly={displayOnlyMode || rest['aria-readonly']}\n data-error={errorMessage ? true : undefined}\n data-success={successMessage ? true : undefined}\n className={inputClasses}\n />\n {type === 'password' && (\n <button\n onClick={() => setShowPassword(!showPassword)}\n className='absolute inset-y-0 right-0 px-2 hover:cursor-pointer'\n aria-label='Toggle password visibility'\n data-state={showPassword ? 'visible' : 'hidden'}\n >\n {showPassword ? <EyeOpened size={20} /> : <EyeClosed size={20} />}\n </button>\n )}\n </div>\n {!displayOnlyMode && <StatusHelpMessage elementId={id} type='error' message={errorMessage} />}\n {!displayOnlyMode && <StatusHelpMessage elementId={id} type='success' message={successMessage} />}\n </div>\n );\n}\n","import React, { useId } from 'react';\nimport { QuestionMarkCircled } from '../../symbols';\nimport { join } from '../../utils/join';\n\nexport interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n display?: 'block' | 'inline';\n width?: React.CSSProperties['width'];\n required?: boolean;\n helpMessage?: string;\n suffix?: React.ReactNode;\n}\n\nexport function Label({\n display = 'inline',\n width = 'fit-content',\n className = '',\n required,\n helpMessage,\n suffix,\n htmlFor,\n children,\n ...props\n}: LabelProps) {\n const id = useId();\n const labelClasses = join('font-medium', display, className);\n const helpId = helpMessage ? `${htmlFor ?? id}-help` : undefined;\n\n return (\n <div style={{ display: display === 'inline' ? 'inline-flex' : 'flex', width }} className='relative'>\n <label className={labelClasses} htmlFor={htmlFor} {...props}>\n {children}\n {required && (\n <span className='text-red-500 font-medium ml-1' aria-label='required'>\n *\n </span>\n )}\n </label>\n {helpMessage && (\n <span\n className='text-gray-500 ml-1 size-fit -translate-y-1/3'\n aria-describedby={helpId}\n aria-label='Help information'\n title={helpMessage}\n >\n <QuestionMarkCircled />\n </span>\n )}\n {helpMessage && (\n <div id={helpId} className='sr-only'>\n {helpMessage}\n </div>\n )}\n {suffix && <span className='ml-1'>{suffix}</span>}\n </div>\n );\n}\n","import React, {\n cloneElement,\n createElement,\n HTMLAttributes,\n isValidElement,\n ReactElement,\n ReactNode,\n Ref,\n} from 'react';\n\ninterface SlotProps<T> extends HTMLAttributes<T> {\n children?: ReactNode;\n ref?: Ref<T>;\n}\n\nexport function Slot<T = HTMLElement>({ children, ref, ...props }: SlotProps<T>) {\n\n if (isValidElement(children)) {\n let allProps = { ...props };\n if (children.props) {\n allProps = { ...allProps, ...children.props };\n }\n return cloneElement(children, {\n ...allProps,\n ref: (node: T) => {\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.RefObject<T>).current = node;\n }\n },\n } as unknown as ReactElement);\n }\n\n // If not asChild or no valid child, render as div\n return createElement('div', { ...props, ref }, children);\n}\n","import { join } from '../../utils/join';\n\nexport type RadioInputProps = {\n itemId: string;\n checked: boolean;\n onChange: () => void;\n name: string;\n disabled?: boolean;\n className?: string;\n};\n\n// Custom RadioInput Component\nexport function RadioInput({ itemId, checked, onChange, name, disabled = false, className = '' }: RadioInputProps) {\n const baseClasses = 'relative inline-flex items-center justify-center rounded-full';\n\n const handleClick = () => {\n if (disabled) return;\n onChange();\n };\n\n const radioClasses = join(\n baseClasses,\n !checked && 'hover:border-current/60',\n !disabled && 'border-current cursor-pointer',\n disabled && 'border-muted/60 cursor-not-allowed',\n className\n );\n return (\n <div\n id={itemId}\n role='radio'\n tabIndex={-1} // necessary so that the radio button can be focused as div is not a focusable element\n aria-checked={checked}\n aria-disabled={disabled}\n aria-description={`Radio button for ${name}`}\n aria-labelledby={`${itemId}-label`}\n onClick={handleClick}\n className={radioClasses}\n style={{\n width: '1em',\n height: '1em',\n padding: '0.1em',\n borderWidth: '0.06em',\n }}\n >\n {checked && (\n <div\n className={join(`size-full aspect-square rounded-full`, disabled && 'bg-muted/60', !disabled && 'bg-current')}\n />\n )}\n </div>\n );\n}\n","import { useId } from 'react';\nimport { join } from '../../utils/join';\nimport { RadioInput } from './RadioInput';\n\nexport interface RadioGroupItemProps {\n value: string;\n children: React.ReactNode;\n className?: string;\n isSelected?: boolean;\n onChange?: (value: string) => void;\n disabled?: boolean;\n name?: string;\n hideInput?: boolean;\n description?: string;\n}\n\nexport function RadioGroupItem({\n value,\n children,\n className = '',\n isSelected = false,\n onChange,\n disabled = false,\n hideInput = false,\n description,\n name,\n}: RadioGroupItemProps) {\n const id = useId();\n const itemId = `radio-${id}-${value}`;\n\n const handleChange = () => {\n if (!disabled) {\n onChange?.(value);\n }\n };\n\n return (\n <div\n title={description}\n className={join(\n 'relative flex items-center',\n className,\n // Uses text color for borders\n hideInput &&\n `p-2 border-2 focus-within:border-dashed focus-within:${\n disabled ? 'border-current/50' : 'border-current/80'\n }`,\n hideInput && !isSelected && `border-transparent ${disabled ? '' : 'not-focus-within:hover:border-border/60'}`,\n hideInput && isSelected && 'border-border',\n disabled && 'opacity-60 cursor-not-allowed'\n )}\n style={{\n gap: '0.5em',\n }}\n >\n {!hideInput && (\n <RadioInput\n itemId={itemId}\n name={name || ''}\n checked={isSelected}\n onChange={handleChange}\n disabled={disabled}\n className={join(hideInput && '')}\n />\n )}\n <div\n id={hideInput ? itemId : undefined}\n tabIndex={hideInput ? -1 : undefined}\n role={hideInput ? 'radio' : undefined}\n onClick={hideInput ? handleChange : undefined}\n aria-checked={!hideInput ? undefined : isSelected ? 'true' : 'false'}\n aria-disabled={hideInput ? disabled : undefined}\n aria-description={!hideInput ? undefined : description || `Radio button for ${name}`}\n aria-labelledby={hideInput ? `${itemId}-label` : undefined}\n className={join(hideInput && 'size-full', typeof children === 'object' && 'grow focus:outline-none')}\n >\n <label\n id={`${itemId}-label`}\n onClick={hideInput ? undefined : handleChange}\n className={join(disabled && 'cursor-not-allowed', !disabled && 'cursor-pointer')}\n >\n {children}\n </label>\n </div>\n </div>\n );\n}\n","import { useCallback, useEffect, useState } from 'react';\n\nexport function useRadioFocus(id: string, selectedOptionIndex: number) {\n // Manage state locally to avoid race conditions, which can result in\n // the an option failing to be selected or incorrectly selected\n const [focusedIndex, setFocusedIndex] = useState<number>(selectedOptionIndex);\n const [clickedIndex, setClickedIndex] = useState<number>(-1);\n // Prevent onClicks from triggering focus events and automatically selecting the first option\n const [isMouseDown, setIsMouseDown] = useState<boolean>(false);\n\n const handleClicked = useCallback((options: HTMLElement[], index: number) => {\n const target = options[index] as HTMLElement;\n\n // Check if the target element is disabled\n const isDisabled = target.hasAttribute('disabled') || target.getAttribute('aria-disabled') === 'true';\n if (isDisabled) return;\n\n // Update the selected index\n options[index]?.click();\n setClickedIndex(index);\n }, []);\n\n const setInitialFocus = useCallback(\n (e: Event, options: HTMLElement[]) => {\n e.preventDefault();\n if (isMouseDown) return;\n if (!options.length) return;\n\n const indexToFocus = selectedOptionIndex !== -1 ? selectedOptionIndex : 0;\n options[indexToFocus]?.focus();\n setFocusedIndex(indexToFocus);\n\n // Only update the selected index if one is already set\n if (selectedOptionIndex !== -1) {\n handleClicked(options, indexToFocus);\n }\n },\n [selectedOptionIndex, isMouseDown, handleClicked]\n );\n\n /* Focus preceding element when Shift + Tab is pressed */\n const handleFocusPreceding = useCallback(\n (e: KeyboardEvent) => {\n // If the Shift key is not pressed while tab is entered, do nothing\n if (!e.shiftKey) {\n return;\n }\n\n e.preventDefault();\n const focusableElements = Array.from(\n document.querySelectorAll<HTMLElement>(\n 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'\n )\n ).filter((el) => !el.hasAttribute('disabled') && el.tabIndex >= 0);\n const currentIndex = focusableElements.findIndex((el) => el.id === id);\n const previousIndex = currentIndex > 0 ? currentIndex - 1 : focusableElements.length - 1;\n focusableElements[previousIndex]?.focus();\n },\n [id]\n );\n\n const handleKeyboardNavigation = useCallback(\n (e: KeyboardEvent, options: HTMLElement[]) => {\n if (!options.length) return;\n\n // Ensure we only toggle options part of radio group\n const target = e.target as HTMLElement;\n const isGroupOption = options.some((option) => option.id === target.id);\n if (!isGroupOption) return;\n\n const currentIndex = focusedIndex !== -1 ? focusedIndex : 0;\n let newIndex = currentIndex;\n\n switch (e.key) {\n case 'ArrowUp':\n case 'ArrowLeft':\n e.preventDefault();\n newIndex = currentIndex > 0 ? currentIndex - 1 : options.length - 1;\n break;\n\n case 'ArrowDown':\n case 'ArrowRight':\n e.preventDefault();\n newIndex = (currentIndex + 1) % options.length;\n break;\n\n // Select the option when the space key is pressed\n case ' ':\n e.preventDefault();\n handleClicked(options, currentIndex);\n return;\n\n case 'Tab':\n handleFocusPreceding(e);\n return;\n\n default:\n return;\n }\n\n options[newIndex]?.focus();\n setFocusedIndex(newIndex);\n // Only update the selected index if one is already set\n if (clickedIndex !== -1) {\n handleClicked(options, newIndex);\n }\n },\n [focusedIndex, clickedIndex, handleFocusPreceding, handleClicked]\n );\n\n const getRadioOptions = useCallback((): HTMLElement[] => {\n const radioGroup = document.querySelector(`[id=\"${id}\"][role=\"radiogroup\"]`);\n if (!radioGroup) return [];\n\n return Array.from(radioGroup.querySelectorAll('[role=\"radio\"]'));\n }, [id]);\n\n useEffect(() => {\n const radioGroup = document.querySelector(`[id=\"${id}\"][role=\"radiogroup\"]`);\n if (!radioGroup) return;\n\n const options = getRadioOptions();\n const handleFocus = (e: Event) => setInitialFocus(e, options);\n const handleKeyDown = (e: KeyboardEvent) => handleKeyboardNavigation(e, options);\n const handleMouseDown = () => setIsMouseDown(true);\n const handleMouseUp = () => setIsMouseDown(false);\n\n document.addEventListener('keydown', handleKeyDown);\n radioGroup.addEventListener('focus', handleFocus);\n radioGroup.addEventListener('mousedown', handleMouseDown);\n document.addEventListener('mouseup', handleMouseUp); // place on document since mouseup event can occur outside of radio group\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n radioGroup.removeEventListener('focus', handleFocus);\n radioGroup.removeEventListener('mousedown', handleMouseDown);\n document.removeEventListener('mouseup', handleMouseUp);\n };\n }, [id, getRadioOptions, setInitialFocus, handleKeyboardNavigation]);\n}\n","import React, { useId, useMemo } from 'react';\nimport { join } from '../../utils/join';\nimport { RadioGroupItem, RadioGroupItemProps } from './RadioGroupItem';\nimport { useRadioFocus } from './hooks';\n\nexport type RadioOption = { label: string; value: string; disabled?: boolean; description?: string };\n\nexport type RadioGroupProps = {\n options?: (string | RadioOption)[];\n value: string | undefined;\n onChange: (value: string) => void;\n name?: string;\n children?: React.ReactElement<RadioGroupItemProps>[] | React.ReactElement<RadioGroupItemProps>;\n className?: string;\n childrenClassName?: string;\n hideInputs?: boolean;\n};\n\nexport function RadioGroup({\n options = [],\n value,\n onChange,\n name,\n children,\n className = '',\n childrenClassName = '',\n hideInputs = false,\n}: RadioGroupProps) {\n const groupId = useId();\n const groupName = name || `radio-group-${groupId}`;\n useRadioFocus(\n groupName,\n options.findIndex((option) => option === value)\n );\n\n // Check for duplicates if string options are provided\n const processedOptions = useMemo(() => {\n return options.reduce<RadioOption[]>((acc, option) => {\n if (typeof option === 'string') {\n // Check if we already have this string option\n if (!acc.some((item) => item.value === option)) {\n acc.push({ label: option, value: option });\n }\n } else {\n acc.push(option);\n }\n return acc;\n }, []);\n }, [options]);\n\n return (\n <div id={groupName} role='radiogroup' tabIndex={0} className={join(className, 'focus:outline-none')}>\n {/* Render from options prop */}\n {processedOptions.length > 0 &&\n processedOptions.map((option, index) => (\n <RadioGroupItem\n key={`${option.value}-${index}`}\n value={option.value}\n isSelected={value === option.value}\n onChange={onChange}\n name={groupName}\n disabled={option.disabled}\n description={option.description}\n hideInput={hideInputs}\n className={childrenClassName}\n >\n {option.label}\n </RadioGroupItem>\n ))}\n\n {/* Render RadioGroupItem components */}\n {processedOptions.length === 0 &&\n children &&\n React.Children.map(children, (child) => {\n // TypeScript enforces that child is a RadioGroupItem\n if (React.isValidElement(child) && child.type === RadioGroupItem) {\n return (\n <RadioGroupItem\n {...child.props}\n className={join(childrenClassName, child.props.className)}\n hideInput={child.props.hideInput || hideInputs}\n isSelected={value === child.props.value}\n onChange={onChange}\n name={groupName}\n >\n {child.props.children}\n </RadioGroupItem>\n );\n }\n return null;\n })}\n </div>\n );\n}\n","import { useEffect } from 'react';\n\nexport function useAutoExpand(id: string, autoExpand: boolean) {\n useEffect(() => {\n const textarea = document.getElementById(id) as HTMLTextAreaElement;\n if (!textarea) {\n return;\n }\n\n if (!autoExpand) {\n textarea.style.height = 'auto';\n return;\n }\n\n const adjustHeight = () => {\n // necessary to reset the height to `auto` before calculating the new height\n textarea.style.height = 'auto';\n textarea.style.height = `${textarea.scrollHeight}px`;\n };\n\n adjustHeight();\n textarea.addEventListener('input', adjustHeight);\n textarea.addEventListener('resize', adjustHeight);\n window.addEventListener('resize', adjustHeight);\n\n return () => {\n textarea.removeEventListener('input', adjustHeight);\n textarea.removeEventListener('resize', adjustHeight);\n window.removeEventListener('resize', adjustHeight);\n };\n }, [id, autoExpand]);\n}\n","export const textareaVariants = {\n base: '',\n 'left-line':\n 'border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success',\n outline:\n 'border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success',\n} as const;\nexport type TextareaVariant = keyof typeof textareaVariants;\n\nexport const roundedVariants = {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n full: 'px-3 rounded-full',\n} as const;\nexport type TextareaRounded = keyof typeof roundedVariants;\n\nexport interface TextareaVariants {\n variant: TextareaVariant;\n rounded: TextareaRounded;\n}\n\nexport const textareaDefaults: TextareaVariants = {\n variant: 'outline',\n rounded: 'none',\n} as const;\n","import { useEffect, useState } from 'react';\nimport { join } from '../../utils/join';\n\ninterface CharacterCountProps {\n elementId: string;\n maxLength: number;\n}\n\nexport default function CharacterCount({ elementId, maxLength }: CharacterCountProps) {\n const [characterCount, setCharacterCount] = useState(0);\n\n useEffect(() => {\n const textarea = document.getElementById(elementId) as HTMLTextAreaElement;\n if (!textarea) {\n return;\n }\n\n const updateCharacterCount = () => {\n const updatedCharacterCount = textarea.value.length;\n setCharacterCount(updatedCharacterCount);\n const isError = updatedCharacterCount >= maxLength;\n textarea.setAttribute('aria-describedby', `${elementId}-character-count`);\n textarea.setAttribute('aria-invalid', isError ? 'true' : 'false');\n\n if (isError) {\n textarea.setAttribute('data-error', 'true');\n } else {\n textarea.removeAttribute('data-error');\n }\n };\n\n updateCharacterCount();\n textarea.addEventListener('input', updateCharacterCount);\n textarea.setAttribute('maxlength', String(maxLength));\n\n return () => {\n textarea.removeEventListener('input', updateCharacterCount);\n textarea.removeAttribute('maxlength');\n textarea.removeAttribute('aria-describedby');\n textarea.removeAttribute('aria-invalid');\n textarea.removeAttribute('data-error');\n };\n }, [elementId, maxLength]);\n\n return (\n <small\n className={join(\n 'mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end',\n characterCount >= maxLength && 'text-danger',\n characterCount < maxLength && 'text-current'\n )}\n role='status'\n >\n <span id={`${elementId}-character-count`}>\n {characterCount} / {maxLength} characters\n </span>\n </small>\n );\n}\n","import { Ref, useId } from 'react';\nimport { StatusHelpMessage } from '../../shared/forms';\nimport { join } from '../../utils/join';\nimport { useAutoExpand } from './hooks';\nimport './styles.css';\nimport { roundedVariants, textareaDefaults, textareaVariants, TextareaVariants } from './variants';\nimport CharacterCount from './CharacterCount';\n\ninterface TextareaProps extends Partial<TextareaVariants>, React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n ref?: Ref<HTMLTextAreaElement>;\n displayOnlyMode?: boolean;\n errorMessage?: string;\n successMessage?: string;\n hideResizeHandle?: boolean; // only works for Webkit browsers\n autoExpand?: boolean;\n characterLimit?: number;\n}\n\nexport default function Textarea({\n variant = textareaDefaults.variant,\n rounded,\n displayOnlyMode = false,\n errorMessage,\n successMessage,\n hideResizeHandle = false,\n autoExpand = false,\n characterLimit = 0,\n className,\n ...rest\n}: TextareaProps) {\n const id = useId();\n useAutoExpand(id, autoExpand || displayOnlyMode);\n\n // Default `round` of `md` for `outline` variant\n let adjustedRound = rounded;\n if (variant === 'outline' && !rounded) {\n adjustedRound = 'md';\n }\n adjustedRound = adjustedRound || textareaDefaults.rounded;\n\n let adjustedHideResizeHandle = hideResizeHandle;\n if (displayOnlyMode || (variant === 'left-line' && !hideResizeHandle)) {\n adjustedHideResizeHandle = true;\n }\n\n const baseClasses =\n 'appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all';\n\n const inputClasses = join(\n baseClasses,\n !displayOnlyMode && textareaVariants[variant],\n !displayOnlyMode && roundedVariants[adjustedRound],\n !displayOnlyMode && 'px-2 py-1',\n displayOnlyMode && 'pointer-events-none',\n adjustedHideResizeHandle && 'no-resize-handle',\n\n className\n );\n\n return (\n <div className={join('-space-y-1.5', displayOnlyMode && 'cursor-text')}>\n <textarea\n {...rest}\n id={id}\n aria-disabled={rest.disabled}\n readOnly={displayOnlyMode}\n aria-readonly={displayOnlyMode || rest['aria-readonly']}\n style={{\n resize: autoExpand ? 'none' : undefined,\n }}\n className={inputClasses}\n />\n {characterLimit > 0 && <CharacterCount elementId={id} maxLength={characterLimit} />}\n {!displayOnlyMode && <StatusHelpMessage elementId={id} type='error' message={errorMessage} />}\n {!displayOnlyMode && <StatusHelpMessage elementId={id} type='success' message={successMessage} />}\n </div>\n );\n}\n"],"names":["LoadingDots","activeIndex","setActiveIndex","useState","useEffect","interval","prevIndex","jsx","index","join","buttonVariants","sizeVariants","roundedVariants","buttonDefaults","Button","variant","size","rounded","loading","linkTo","linkProps","type","className","rest","adjustedSize","buttonClasses","jsxs","Check","color","useFilledBackgroundColor","id","filledBackgroundColor","setFilledBackgroundColor","getFirstNonTransparentBackgroundColor","useCallback","element","currentElement","backgroundColor","checkbox","Checkbox","ref","filled","checked","onCheckedChange","disabled","props","generatedId","useId","checkboxId","useMemo","parentBackgroundColor","isChecked","setIsChecked","handleChange","handleOnKeyDown","e","checkboxClasses","inputVariants","inputDefaults","StatusHelpMessage","elementId","message","ExclamationTriangle","CheckCircled","Input","displayOnlyMode","errorMessage","successMessage","showPassword","setShowPassword","adjustedRound","inputClasses","EyeOpened","EyeClosed","Label","display","width","required","helpMessage","suffix","htmlFor","children","labelClasses","helpId","QuestionMarkCircled","Slot","isValidElement","allProps","cloneElement","node","createElement","RadioInput","itemId","onChange","name","baseClasses","handleClick","radioClasses","RadioGroupItem","value","isSelected","hideInput","description","useRadioFocus","selectedOptionIndex","focusedIndex","setFocusedIndex","clickedIndex","setClickedIndex","isMouseDown","setIsMouseDown","handleClicked","options","target","_a","setInitialFocus","indexToFocus","handleFocusPreceding","focusableElements","el","currentIndex","previousIndex","handleKeyboardNavigation","option","newIndex","getRadioOptions","radioGroup","handleFocus","handleKeyDown","handleMouseDown","handleMouseUp","RadioGroup","childrenClassName","hideInputs","groupId","groupName","processedOptions","acc","item","React","child","useAutoExpand","autoExpand","textarea","adjustHeight","textareaVariants","textareaDefaults","CharacterCount","maxLength","characterCount","setCharacterCount","updateCharacterCount","updatedCharacterCount","isError","Textarea","hideResizeHandle","characterLimit","adjustedHideResizeHandle"],"mappings":"oNAGA,SAAwBA,GAAc,CACpC,KAAM,CAACC,EAAaC,CAAc,EAAIC,EAAAA,SAAS,CAAC,EAEhDC,OAAAA,EAAAA,UAAU,IAAM,CACR,MAAAC,EAAW,YAAY,IAAM,CACjCH,EAAgBI,IAAeA,EAAY,GAAK,CAAC,GAChD,GAAG,EAEC,MAAA,IAAM,cAAcD,CAAQ,CACrC,EAAG,EAAE,EAGHE,EAAA,IAAC,MAAI,CAAA,UAAU,gFACZ,SAAA,CAAC,EAAG,EAAG,CAAC,EAAE,IAAKC,GACdD,EAAA,IAAC,MAAA,CAEC,UAAWE,EAAA,KACT,gFACAR,IAAgBO,GAAS,0BAAA,CAC3B,EAJKA,CAMR,CAAA,EACH,CAEJ,CC3BO,MAAME,EAAiB,CAC5B,KAAM,GACN,QAAS,0GACT,UAAW,sHACX,SAAU,iEACV,QAAS,6IACT,KAAM,4EACN,OAAQ,sGACV,EAGaC,EAAe,CAC1B,SAAU,GACV,OAAQ,WACR,GAAI,oBACJ,GAAI,sBACJ,GAAI,oBACJ,KAAM,0BACN,KAAM,YACR,EAGaC,EAAkB,CAC7B,KAAM,eACN,GAAI,aACJ,GAAI,aACJ,GAAI,aACJ,KAAM,cACR,EASaC,EAAiC,CAC5C,QAAS,UACT,KAAM,KACN,QAAS,IACX,EC5BA,SAAwBC,EAAO,CAC7B,QAAAC,EAAUF,EAAe,QACzB,KAAAG,EACA,QAAAC,EAAUJ,EAAe,QACzB,QAAAK,EACA,OAAAC,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