@arkyn/components 3.0.3 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -24
- package/dist/components/alert/alertContainer/index.d.ts +7 -7
- package/dist/components/alert/alertContent/index.d.ts +1 -1
- package/dist/components/alert/alertDescription/index.d.ts +1 -1
- package/dist/components/alert/alertIcon/index.d.ts +1 -1
- package/dist/components/alert/alertTitle/index.d.ts +1 -1
- package/dist/components/audioPlayer/index.d.ts +1 -1
- package/dist/components/audioUpload/index.d.ts +2 -2
- package/dist/components/badge/index.d.ts +1 -1
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/cardTab/cardTabButton/index.d.ts +1 -1
- package/dist/components/cardTab/cardTabContainer/index.d.ts +1 -1
- package/dist/components/checkbox/index.d.ts +3 -3
- package/dist/components/checkbox/index.d.ts.map +1 -1
- package/dist/components/clientOnly.d.ts +2 -2
- package/dist/components/clientOnly.d.ts.map +1 -1
- package/dist/components/currencyInput/index.d.ts +2 -2
- package/dist/components/datePicker/index.d.ts +1 -1
- package/dist/components/divider/index.d.ts +1 -1
- package/dist/components/drawer/drawerContainer/index.d.ts +1 -1
- package/dist/components/drawer/drawerHeader/index.d.ts +1 -1
- package/dist/components/facebookPixel/index.d.ts +1 -1
- package/dist/components/fieldError/index.d.ts +1 -1
- package/dist/components/fieldLabel/index.d.ts +1 -1
- package/dist/components/fieldWrapper/index.d.ts +1 -1
- package/dist/components/fileUpload/index.d.ts +2 -2
- package/dist/components/googleAnalytics/index.d.ts +1 -1
- package/dist/components/googleTagManager/index.d.ts +1 -1
- package/dist/components/iconButton/index.d.ts +1 -1
- package/dist/components/imageUpload/index.d.ts +2 -2
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/mapView/index.d.ts +2 -2
- package/dist/components/mapView/index.d.ts.map +1 -1
- package/dist/components/maskedInput/index.d.ts +3 -3
- package/dist/components/modal/modalContainer/index.d.ts +1 -1
- package/dist/components/modal/modalFooter/index.d.ts +1 -1
- package/dist/components/modal/modalHeader/index.d.ts +1 -1
- package/dist/components/multiSelect/index.d.ts +1 -1
- package/dist/components/pagination/index.d.ts +1 -1
- package/dist/components/phoneInput/index.d.ts +2 -2
- package/dist/components/phoneInput/index.d.ts.map +1 -1
- package/dist/components/popover/index.d.ts +2 -2
- package/dist/components/popover/index.d.ts.map +1 -1
- package/dist/components/radio/radioBox/index.d.ts +4 -4
- package/dist/components/radio/radioGroup/index.d.ts +3 -3
- package/dist/components/richText/index.d.ts +13 -4
- package/dist/components/richText/index.d.ts.map +1 -1
- package/dist/components/richText/insertLink/index.d.ts +5 -0
- package/dist/components/richText/insertLink/index.d.ts.map +1 -0
- package/dist/components/richText/insertVideo/index.d.ts.map +1 -1
- package/dist/components/richText/leaf/index.d.ts +1 -0
- package/dist/components/richText/leaf/index.d.ts.map +1 -1
- package/dist/components/searchPlaces.d.ts +3 -3
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/slider/index.d.ts +1 -1
- package/dist/components/switch/index.d.ts +3 -3
- package/dist/components/switch/index.d.ts.map +1 -1
- package/dist/components/tab/tabButton/index.d.ts +1 -1
- package/dist/components/tab/tabContainer/index.d.ts +1 -1
- package/dist/components/table/tableBody/index.d.ts +1 -1
- package/dist/components/table/tableCaption/index.d.ts +2 -2
- package/dist/components/table/tableContainer/index.d.ts +1 -1
- package/dist/components/table/tableFooter/index.d.ts +1 -1
- package/dist/components/table/tableHeader/index.d.ts +2 -2
- package/dist/components/textarea/index.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/hooks/useAutomation.d.ts +1 -1
- package/dist/hooks/useDrawer.d.ts +5 -5
- package/dist/hooks/useForm.d.ts +2 -2
- package/dist/hooks/useHydrated.d.ts +1 -1
- package/dist/hooks/useModal.d.ts +5 -5
- package/dist/hooks/useScopedParams.d.ts +5 -5
- package/dist/hooks/useScrollLock.d.ts +2 -2
- package/dist/hooks/useSearchAutomation.d.ts +6 -6
- package/dist/hooks/useSlider.d.ts +2 -2
- package/dist/hooks/useToast.d.ts +1 -1
- package/dist/index.js +710 -633
- package/dist/index.js.map +1 -1
- package/dist/modules/components/alert/alertContainer/index.js.map +1 -1
- package/dist/modules/components/alert/alertContent/index.js.map +1 -1
- package/dist/modules/components/alert/alertDescription/index.js.map +1 -1
- package/dist/modules/components/alert/alertIcon/index.js.map +1 -1
- package/dist/modules/components/alert/alertTitle/index.js.map +1 -1
- package/dist/modules/components/audioPlayer/index.js.map +1 -1
- package/dist/modules/components/audioUpload/index.js.map +1 -1
- package/dist/modules/components/badge/index.js.map +1 -1
- package/dist/modules/components/button/index.js.map +1 -1
- package/dist/modules/components/cardTab/cardTabButton/index.js.map +1 -1
- package/dist/modules/components/cardTab/cardTabContainer/index.js.map +1 -1
- package/dist/modules/components/checkbox/index.js.map +1 -1
- package/dist/modules/components/clientOnly.js.map +1 -1
- package/dist/modules/components/currencyInput/index.js.map +1 -1
- package/dist/modules/components/datePicker/index.js.map +1 -1
- package/dist/modules/components/divider/index.js.map +1 -1
- package/dist/modules/components/drawer/drawerContainer/index.js.map +1 -1
- package/dist/modules/components/drawer/drawerHeader/index.js.map +1 -1
- package/dist/modules/components/facebookPixel/index.js.map +1 -1
- package/dist/modules/components/fieldError/index.js.map +1 -1
- package/dist/modules/components/fieldLabel/index.js.map +1 -1
- package/dist/modules/components/fieldWrapper/index.js.map +1 -1
- package/dist/modules/components/fileUpload/index.js.map +1 -1
- package/dist/modules/components/googleAnalytics/index.js.map +1 -1
- package/dist/modules/components/googleTagManager/index.js.map +1 -1
- package/dist/modules/components/iconButton/index.js.map +1 -1
- package/dist/modules/components/imageUpload/index.js.map +1 -1
- package/dist/modules/components/input/index.js.map +1 -1
- package/dist/modules/components/mapView/index.js.map +1 -1
- package/dist/modules/components/maskedInput/index.js.map +1 -1
- package/dist/modules/components/modal/modalContainer/index.js.map +1 -1
- package/dist/modules/components/modal/modalFooter/index.js.map +1 -1
- package/dist/modules/components/modal/modalHeader/index.js.map +1 -1
- package/dist/modules/components/multiSelect/index.js.map +1 -1
- package/dist/modules/components/pagination/index.js.map +1 -1
- package/dist/modules/components/phoneInput/index.js +59 -59
- package/dist/modules/components/phoneInput/index.js.map +1 -1
- package/dist/modules/components/popover/index.js.map +1 -1
- package/dist/modules/components/radio/radioBox/index.js.map +1 -1
- package/dist/modules/components/radio/radioGroup/index.js.map +1 -1
- package/dist/modules/components/richText/index.js +58 -56
- package/dist/modules/components/richText/index.js.map +1 -1
- package/dist/modules/components/richText/insertLink/index.js +68 -0
- package/dist/modules/components/richText/insertLink/index.js.map +1 -0
- package/dist/modules/components/richText/insertLink/styles.css +1 -0
- package/dist/modules/components/richText/insertVideo/index.js +45 -41
- package/dist/modules/components/richText/insertVideo/index.js.map +1 -1
- package/dist/modules/components/richText/leaf/index.js +6 -1
- package/dist/modules/components/richText/leaf/index.js.map +1 -1
- package/dist/modules/components/richText/leaf/styles.css +1 -0
- package/dist/modules/components/richText/styles.css +4 -0
- package/dist/modules/components/searchPlaces.js.map +1 -1
- package/dist/modules/components/select/index.js.map +1 -1
- package/dist/modules/components/slider/index.js.map +1 -1
- package/dist/modules/components/switch/index.js.map +1 -1
- package/dist/modules/components/tab/tabButton/index.js.map +1 -1
- package/dist/modules/components/tab/tabContainer/index.js.map +1 -1
- package/dist/modules/components/table/tableBody/index.js.map +1 -1
- package/dist/modules/components/table/tableCaption/index.js.map +1 -1
- package/dist/modules/components/table/tableContainer/index.js.map +1 -1
- package/dist/modules/components/table/tableFooter/index.js.map +1 -1
- package/dist/modules/components/table/tableHeader/index.js.map +1 -1
- package/dist/modules/components/textarea/index.js.map +1 -1
- package/dist/modules/components/tooltip/index.js.map +1 -1
- package/dist/modules/hooks/useAutomation.js.map +1 -1
- package/dist/modules/hooks/useDrawer.js.map +1 -1
- package/dist/modules/hooks/useForm.js.map +1 -1
- package/dist/modules/hooks/useHydrated.js.map +1 -1
- package/dist/modules/hooks/useModal.js.map +1 -1
- package/dist/modules/hooks/useScopedParams.js.map +1 -1
- package/dist/modules/hooks/useScrollLock.js.map +1 -1
- package/dist/modules/hooks/useSearchAutomation.js.map +1 -1
- package/dist/modules/hooks/useSlider.js.map +1 -1
- package/dist/modules/hooks/useToast.js.map +1 -1
- package/dist/modules/providers/drawerProvider.js.map +1 -1
- package/dist/modules/providers/formProvider.js.map +1 -1
- package/dist/modules/providers/modalProvider.js.map +1 -1
- package/dist/modules/providers/placesProvider.js.map +1 -1
- package/dist/modules/providers/toastProvider.js.map +1 -1
- package/dist/modules/services/isValidHttpsUrl.js +12 -0
- package/dist/modules/services/isValidHttpsUrl.js.map +1 -0
- package/dist/modules/services/toHtml.js.map +1 -1
- package/dist/modules/services/toRichTextValue.js.map +1 -1
- package/dist/modules/utils/richTextUtilities.js +24 -17
- package/dist/modules/utils/richTextUtilities.js.map +1 -1
- package/dist/providers/drawerProvider.d.ts +1 -1
- package/dist/providers/formProvider.d.ts +1 -1
- package/dist/providers/modalProvider.d.ts +1 -1
- package/dist/providers/placesProvider.d.ts +1 -1
- package/dist/providers/toastProvider.d.ts +1 -1
- package/dist/services/isValidHttpsUrl.d.ts +3 -0
- package/dist/services/isValidHttpsUrl.d.ts.map +1 -0
- package/dist/services/toHtml.d.ts +1 -1
- package/dist/services/toRichTextValue.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/types/richTextTypes.d.ts +13 -2
- package/dist/types/richTextTypes.d.ts.map +1 -1
- package/dist/utils/richTextUtilities.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Button as e } from "../../button/index.js";
|
|
2
|
+
import { Input as t } from "../../input/index.js";
|
|
3
|
+
import { ModalContainer as n } from "../../modal/modalContainer/index.js";
|
|
4
|
+
import { ModalFooter as r } from "../../modal/modalFooter/index.js";
|
|
5
|
+
import { ModalHeader as i } from "../../modal/modalHeader/index.js";
|
|
6
|
+
import { isValidHttpsUrl as a } from "../../../services/isValidHttpsUrl.js";
|
|
7
|
+
/* empty css */
|
|
8
|
+
import { useEffect as o, useState as s } from "react";
|
|
9
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
+
import { Link as d } from "lucide-react";
|
|
11
|
+
import { Editor as f, Range as p, Transforms as m } from "slate";
|
|
12
|
+
import { useSlate as h } from "slate-react";
|
|
13
|
+
//#region src/components/richText/insertLink/index.tsx
|
|
14
|
+
function g(g) {
|
|
15
|
+
let { modalCancelButton: _ = "Cancelar", modalConfirmButton: v = "Confirmar", modalInputUrlLabel: y = "URL do link:", modalTitle: b = "Inserir link", invalidUrlMessage: x = "URL inválida" } = g, S = h(), [C, w] = s(!1), [T, E] = s(""), [D, O] = s(S.selection), k = a(T), A = T && !k ? x : "";
|
|
16
|
+
function j(e) {
|
|
17
|
+
e.preventDefault(), O(S.selection), w(!0);
|
|
18
|
+
}
|
|
19
|
+
function M(e) {
|
|
20
|
+
e.preventDefault(), !(!k || !D) && (m.select(S, D), p.isCollapsed(D) ? m.insertNodes(S, {
|
|
21
|
+
text: T,
|
|
22
|
+
link: !0,
|
|
23
|
+
href: T
|
|
24
|
+
}) : (f.addMark(S, "link", !0), f.addMark(S, "href", T)), w(!1));
|
|
25
|
+
}
|
|
26
|
+
return o(() => {
|
|
27
|
+
C || (E(""), O(null));
|
|
28
|
+
}, [C]), /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("button", {
|
|
29
|
+
type: "button",
|
|
30
|
+
className: "arkynRichTextInsertLink",
|
|
31
|
+
onMouseDown: j,
|
|
32
|
+
children: /* @__PURE__ */ l(d, {})
|
|
33
|
+
}), /* @__PURE__ */ u(n, {
|
|
34
|
+
isVisible: C,
|
|
35
|
+
makeInvisible: () => w(!1),
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ l(i, { children: b }),
|
|
38
|
+
/* @__PURE__ */ l("div", {
|
|
39
|
+
className: "arkynRichTextInsertLinkModalContent",
|
|
40
|
+
children: /* @__PURE__ */ l(t, {
|
|
41
|
+
type: "text",
|
|
42
|
+
name: "richTextLinkURL",
|
|
43
|
+
label: y,
|
|
44
|
+
showAsterisk: !0,
|
|
45
|
+
defaultValue: T,
|
|
46
|
+
onChange: (e) => E(e.target.value),
|
|
47
|
+
errorMessage: A
|
|
48
|
+
})
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ u(r, { children: [/* @__PURE__ */ l(e, {
|
|
51
|
+
type: "button",
|
|
52
|
+
scheme: "danger",
|
|
53
|
+
variant: "outline",
|
|
54
|
+
onClick: () => w(!1),
|
|
55
|
+
children: _
|
|
56
|
+
}), /* @__PURE__ */ l(e, {
|
|
57
|
+
disabled: !k,
|
|
58
|
+
type: "button",
|
|
59
|
+
onClick: M,
|
|
60
|
+
children: v
|
|
61
|
+
})] })
|
|
62
|
+
]
|
|
63
|
+
})] });
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { g as InsertLink };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/richText/insertLink/index.tsx"],"sourcesContent":["import { Link } from \"lucide-react\";\nimport { type MouseEvent, useEffect, useState } from \"react\";\nimport { Editor, Range, Transforms } from \"slate\";\nimport { useSlate } from \"slate-react\";\n\nimport { isValidHttpsUrl } from \"../../../services/isValidHttpsUrl\";\nimport type { RichTextInsertLinkProps } from \"../../../types/richTextTypes\";\n\nimport { Button } from \"../../button\";\nimport { Input } from \"../../input\";\nimport { ModalContainer } from \"../../modal/modalContainer\";\nimport { ModalFooter } from \"../../modal/modalFooter\";\nimport { ModalHeader } from \"../../modal/modalHeader\";\n\nimport \"./styles.css\";\n\nfunction InsertLink(props: RichTextInsertLinkProps) {\n\tconst {\n\t\tmodalCancelButton = \"Cancelar\",\n\t\tmodalConfirmButton = \"Confirmar\",\n\t\tmodalInputUrlLabel = \"URL do link:\",\n\t\tmodalTitle = \"Inserir link\",\n\t\tinvalidUrlMessage = \"URL inválida\",\n\t} = props;\n\n\tconst editor = useSlate();\n\n\tconst [modalIsVisible, setModalIsVisible] = useState(false);\n\tconst [linkURL, setLinkURL] = useState(\"\");\n\tconst [selection, setSelection] = useState(editor.selection);\n\n\tconst isValidUrl = isValidHttpsUrl(linkURL);\n\tconst errorMessage = linkURL && !isValidUrl ? invalidUrlMessage : \"\";\n\n\tfunction handleOpenModal(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\t\tsetSelection(editor.selection);\n\t\tsetModalIsVisible(true);\n\t}\n\n\tfunction handleConfirm(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\t\tif (!isValidUrl || !selection) return;\n\n\t\tTransforms.select(editor, selection);\n\n\t\tif (Range.isCollapsed(selection)) {\n\t\t\tTransforms.insertNodes(editor, {\n\t\t\t\ttext: linkURL,\n\t\t\t\tlink: true,\n\t\t\t\thref: linkURL,\n\t\t\t});\n\t\t} else {\n\t\t\tEditor.addMark(editor, \"link\", true);\n\t\t\tEditor.addMark(editor, \"href\", linkURL);\n\t\t}\n\n\t\tsetModalIsVisible(false);\n\t}\n\n\tuseEffect(() => {\n\t\tif (!modalIsVisible) {\n\t\t\tsetLinkURL(\"\");\n\t\t\tsetSelection(null);\n\t\t}\n\t}, [modalIsVisible]);\n\n\treturn (\n\t\t<>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName=\"arkynRichTextInsertLink\"\n\t\t\t\tonMouseDown={handleOpenModal}\n\t\t\t>\n\t\t\t\t<Link />\n\t\t\t</button>\n\n\t\t\t<ModalContainer\n\t\t\t\tisVisible={modalIsVisible}\n\t\t\t\tmakeInvisible={() => setModalIsVisible(false)}\n\t\t\t>\n\t\t\t\t<ModalHeader>{modalTitle}</ModalHeader>\n\n\t\t\t\t<div className=\"arkynRichTextInsertLinkModalContent\">\n\t\t\t\t\t<Input\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tname=\"richTextLinkURL\"\n\t\t\t\t\t\tlabel={modalInputUrlLabel}\n\t\t\t\t\t\tshowAsterisk\n\t\t\t\t\t\tdefaultValue={linkURL}\n\t\t\t\t\t\tonChange={(e) => setLinkURL(e.target.value)}\n\t\t\t\t\t\terrorMessage={errorMessage}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t<ModalFooter>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tonClick={() => setModalIsVisible(false)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{modalCancelButton}\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button disabled={!isValidUrl} type=\"button\" onClick={handleConfirm}>\n\t\t\t\t\t\t{modalConfirmButton}\n\t\t\t\t\t</Button>\n\t\t\t\t</ModalFooter>\n\t\t\t</ModalContainer>\n\t\t</>\n\t);\n}\n\nexport { InsertLink };\n"],"mappings":";;;;;;;;;;;;;AAgBA,SAAS,EAAW,GAAgC;CACnD,IAAM,EACL,uBAAoB,YACpB,wBAAqB,aACrB,wBAAqB,gBACrB,gBAAa,gBACb,uBAAoB,mBACjB,GAEE,IAAS,EAAS,GAElB,CAAC,GAAgB,KAAqB,EAAS,EAAK,GACpD,CAAC,GAAS,KAAc,EAAS,EAAE,GACnC,CAAC,GAAW,KAAgB,EAAS,EAAO,SAAS,GAErD,IAAa,EAAgB,CAAO,GACpC,IAAe,KAAW,CAAC,IAAa,IAAoB;CAElE,SAAS,EAAgB,GAAsC;EAG9D,AAFA,EAAM,eAAe,GACrB,EAAa,EAAO,SAAS,GAC7B,EAAkB,EAAI;CACvB;CAEA,SAAS,EAAc,GAAsC;EAC5D,EAAM,eAAe,GACjB,GAAC,KAAc,CAAC,OAEpB,EAAW,OAAO,GAAQ,CAAS,GAE/B,EAAM,YAAY,CAAS,IAC9B,EAAW,YAAY,GAAQ;GAC9B,MAAM;GACN,MAAM;GACN,MAAM;EACP,CAAC,KAED,EAAO,QAAQ,GAAQ,QAAQ,EAAI,GACnC,EAAO,QAAQ,GAAQ,QAAQ,CAAO,IAGvC,EAAkB,EAAK;CACxB;CASA,OAPA,QAAgB;EACf,AAAK,MACJ,EAAW,EAAE,GACb,EAAa,IAAI;CAEnB,GAAG,CAAC,CAAc,CAAC,GAGlB,kBAAA,GAAA,EAAA,UAAA,CACC,kBAAC,UAAD;EACC,MAAK;EACL,WAAU;EACV,aAAa;YAEb,kBAAC,GAAD,CAAO,CAAA;CACA,CAAA,GAER,kBAAC,GAAD;EACC,WAAW;EACX,qBAAqB,EAAkB,EAAK;YAF7C;GAIC,kBAAC,GAAD,EAAA,UAAc,EAAwB,CAAA;GAEtC,kBAAC,OAAD;IAAK,WAAU;cACd,kBAAC,GAAD;KACC,MAAK;KACL,MAAK;KACL,OAAO;KACP,cAAA;KACA,cAAc;KACd,WAAW,MAAM,EAAW,EAAE,OAAO,KAAK;KAC5B;IACd,CAAA;GACG,CAAA;GAEL,kBAAC,GAAD,EAAA,UAAA,CACC,kBAAC,GAAD;IACC,MAAK;IACL,QAAO;IACP,SAAQ;IACR,eAAe,EAAkB,EAAK;cAErC;GACM,CAAA,GAER,kBAAC,GAAD;IAAQ,UAAU,CAAC;IAAY,MAAK;IAAS,SAAS;cACpD;GACM,CAAA,CACI,EAAA,CAAA;EACE;GACf,EAAA,CAAA;AAEJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer arkyn{.arkynRichTextInsertLink{background-color:var(--background-underground,#fafafa);border:none;border-radius:4px;justify-content:center;align-items:center;width:36px;height:36px;display:flex}.arkynRichTextInsertLink svg{width:20px;height:20px;color:var(--text-heading,#09090b)}.arkynRichTextInsertLink:hover{cursor:pointer;filter:brightness(.98)}.arkynRichTextInsertLinkModalContent{flex-direction:column;gap:16px;width:500px;padding:16px;display:flex}html.dark .arkynRichTextInsertLink:hover{cursor:pointer;filter:brightness(.9)}}
|
|
@@ -3,18 +3,19 @@ import { Input as t } from "../../input/index.js";
|
|
|
3
3
|
import { ModalContainer as n } from "../../modal/modalContainer/index.js";
|
|
4
4
|
import { ModalFooter as r } from "../../modal/modalFooter/index.js";
|
|
5
5
|
import { ModalHeader as i } from "../../modal/modalHeader/index.js";
|
|
6
|
+
import { isValidHttpsUrl as a } from "../../../services/isValidHttpsUrl.js";
|
|
6
7
|
/* empty css */
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { Video as
|
|
10
|
-
import { useSlate as
|
|
8
|
+
import { useEffect as o, useState as s } from "react";
|
|
9
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
+
import { Video as d } from "lucide-react";
|
|
11
|
+
import { useSlate as f } from "slate-react";
|
|
11
12
|
//#region src/components/richText/insertVideo/index.tsx
|
|
12
|
-
function
|
|
13
|
-
let { modalCancelButton:
|
|
14
|
-
function
|
|
15
|
-
if (e.preventDefault(), !
|
|
16
|
-
let t = `https://www.youtube.com/embed/${
|
|
17
|
-
|
|
13
|
+
function p(p) {
|
|
14
|
+
let { modalCancelButton: m = "Cancelar", modalConfirmButton: h = "Confirmar", modalInputUrlLabel: g = "URL do vídeo:", modalTitle: _ = "Inserir vídeo", invalidUrlMessage: v = "URL inválida" } = p, y = f(), [b, x] = s(!1), [S, C] = s(""), [w, T] = s(""), [E, D] = s("");
|
|
15
|
+
function O(e) {
|
|
16
|
+
if (e.preventDefault(), !S || S === "") return;
|
|
17
|
+
let t = `https://www.youtube.com/embed/${S}`;
|
|
18
|
+
y.insertNodes([
|
|
18
19
|
{
|
|
19
20
|
type: "paragraph",
|
|
20
21
|
children: [{ text: "" }]
|
|
@@ -28,61 +29,64 @@ function f(f) {
|
|
|
28
29
|
type: "paragraph",
|
|
29
30
|
children: [{ text: "" }]
|
|
30
31
|
}
|
|
31
|
-
]),
|
|
32
|
+
]), x(!1);
|
|
32
33
|
}
|
|
33
|
-
return
|
|
34
|
-
if (!
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
return o(() => {
|
|
35
|
+
if (!w || w === "") return;
|
|
36
|
+
if (C(""), D(""), !a(w)) {
|
|
37
|
+
D(v);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
let e = new URLSearchParams(w.split("?")[1]).get("v");
|
|
41
|
+
e ? C(e) : D(v);
|
|
42
|
+
}, [w, v]), o(() => {
|
|
43
|
+
b || (C(""), T(""), D(""));
|
|
44
|
+
}, [b]), /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("button", {
|
|
41
45
|
type: "button",
|
|
42
46
|
className: "arkynRichTextInsertVideo",
|
|
43
|
-
onMouseDown: () =>
|
|
44
|
-
children: /* @__PURE__ */
|
|
45
|
-
}), /* @__PURE__ */
|
|
46
|
-
isVisible:
|
|
47
|
-
makeInvisible: () =>
|
|
47
|
+
onMouseDown: () => x(!0),
|
|
48
|
+
children: /* @__PURE__ */ l(d, {})
|
|
49
|
+
}), /* @__PURE__ */ u(n, {
|
|
50
|
+
isVisible: b,
|
|
51
|
+
makeInvisible: () => x(!1),
|
|
48
52
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ l(i, { children: _ }),
|
|
54
|
+
/* @__PURE__ */ u("div", {
|
|
51
55
|
className: "arkynRichTextInsertVideoModalContent",
|
|
52
|
-
children: [/* @__PURE__ */
|
|
56
|
+
children: [/* @__PURE__ */ l(t, {
|
|
53
57
|
type: "text",
|
|
54
58
|
name: "richTextVideoURL",
|
|
55
|
-
label:
|
|
59
|
+
label: g,
|
|
56
60
|
showAsterisk: !0,
|
|
57
|
-
defaultValue:
|
|
58
|
-
onChange: (e) =>
|
|
59
|
-
errorMessage:
|
|
60
|
-
}),
|
|
61
|
+
defaultValue: w,
|
|
62
|
+
onChange: (e) => T(e.target.value),
|
|
63
|
+
errorMessage: E
|
|
64
|
+
}), S && /* @__PURE__ */ l("iframe", {
|
|
61
65
|
width: "auto",
|
|
62
66
|
height: "315",
|
|
63
|
-
src: `https://www.youtube.com/embed/${
|
|
67
|
+
src: `https://www.youtube.com/embed/${S}`,
|
|
64
68
|
title: "YouTube video player",
|
|
65
69
|
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
|
|
66
70
|
referrerPolicy: "strict-origin-when-cross-origin",
|
|
67
71
|
allowFullScreen: !0
|
|
68
72
|
})]
|
|
69
73
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ u(r, { children: [/* @__PURE__ */ l(e, {
|
|
71
75
|
type: "button",
|
|
72
76
|
scheme: "danger",
|
|
73
77
|
variant: "outline",
|
|
74
|
-
onClick: () =>
|
|
75
|
-
children: p
|
|
76
|
-
}), /* @__PURE__ */ c(e, {
|
|
77
|
-
disabled: !x,
|
|
78
|
-
type: "button",
|
|
79
|
-
onClick: D,
|
|
78
|
+
onClick: () => x(!1),
|
|
80
79
|
children: m
|
|
80
|
+
}), /* @__PURE__ */ l(e, {
|
|
81
|
+
disabled: !S,
|
|
82
|
+
type: "button",
|
|
83
|
+
onClick: O,
|
|
84
|
+
children: h
|
|
81
85
|
})] })
|
|
82
86
|
]
|
|
83
87
|
})] });
|
|
84
88
|
}
|
|
85
89
|
//#endregion
|
|
86
|
-
export {
|
|
90
|
+
export { p as InsertVideo };
|
|
87
91
|
|
|
88
92
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/richText/insertVideo/index.tsx"],"sourcesContent":["import { Video } from \"lucide-react\";\nimport { type MouseEvent, useEffect, useState } from \"react\";\nimport { useSlate } from \"slate-react\";\n\nimport type { RichTextInsertVideoProps } from \"../../../types/richTextTypes\";\n\nimport { Button } from \"../../button\";\nimport { Input } from \"../../input\";\nimport { ModalContainer } from \"../../modal/modalContainer\";\nimport { ModalFooter } from \"../../modal/modalFooter\";\nimport { ModalHeader } from \"../../modal/modalHeader\";\n\nimport \"./styles.css\";\n\nfunction InsertVideo(props: RichTextInsertVideoProps) {\n\tconst {\n\t\tmodalCancelButton = \"Cancelar\",\n\t\tmodalConfirmButton = \"Confirmar\",\n\t\tmodalInputUrlLabel = \"URL do vídeo:\",\n\t\tmodalTitle = \"Inserir vídeo\",\n\t\tinvalidUrlMessage = \"URL inválida\",\n\t} = props;\n\n\tconst editor = useSlate();\n\n\tconst [modalIsVisible, setModalIsVisible] = useState(false);\n\tconst [videoId, setVideoId] = useState(\"\");\n\tconst [videoRawURL, setVideoRawURL] = useState(\"\");\n\tconst [errorMessage, setErrorMessage] = useState(\"\");\n\n\tfunction handleMouseDown(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\n\t\tif (!videoId || videoId === \"\") return;\n\t\tconst videoUrl = `https://www.youtube.com/embed/${videoId}`;\n\n\t\teditor.insertNodes([\n\t\t\t{ type: \"paragraph\", children: [{ text: \"\" }] },\n\t\t\t{ type: \"video\", src: videoUrl, children: [{ text: \"\" }] },\n\t\t\t{ type: \"paragraph\", children: [{ text: \"\" }] },\n\t\t]);\n\n\t\tsetModalIsVisible(false);\n\t}\n\n\tuseEffect(() => {\n\t\tif (!videoRawURL || videoRawURL === \"\") return;\n\n\t\tsetVideoId(\"\");\n\t\tsetErrorMessage(\"\");\n\n\t\tconst searchParams = new URLSearchParams(videoRawURL.split(\"?\")[1]);\n\t\tconst vParam = searchParams.get(\"v\");\n\t\tif (vParam) setVideoId(vParam);\n\t\telse setErrorMessage(invalidUrlMessage);\n\t}, [videoRawURL, invalidUrlMessage]);\n\n\tuseEffect(() => {\n\t\tif (!modalIsVisible) {\n\t\t\tsetVideoId(\"\");\n\t\t\tsetVideoRawURL(\"\");\n\t\t\tsetErrorMessage(\"\");\n\t\t}\n\t}, [modalIsVisible]);\n\n\treturn (\n\t\t<>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName=\"arkynRichTextInsertVideo\"\n\t\t\t\tonMouseDown={() => setModalIsVisible(true)}\n\t\t\t>\n\t\t\t\t<Video />\n\t\t\t</button>\n\n\t\t\t<ModalContainer\n\t\t\t\tisVisible={modalIsVisible}\n\t\t\t\tmakeInvisible={() => setModalIsVisible(false)}\n\t\t\t>\n\t\t\t\t<ModalHeader>{modalTitle}</ModalHeader>\n\n\t\t\t\t<div className=\"arkynRichTextInsertVideoModalContent\">\n\t\t\t\t\t<Input\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tname=\"richTextVideoURL\"\n\t\t\t\t\t\tlabel={modalInputUrlLabel}\n\t\t\t\t\t\tshowAsterisk\n\t\t\t\t\t\tdefaultValue={videoRawURL}\n\t\t\t\t\t\tonChange={(e) => setVideoRawURL(e.target.value)}\n\t\t\t\t\t\terrorMessage={errorMessage}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{videoId && (\n\t\t\t\t\t\t<iframe\n\t\t\t\t\t\t\twidth=\"auto\"\n\t\t\t\t\t\t\theight=\"315\"\n\t\t\t\t\t\t\tsrc={`https://www.youtube.com/embed/${videoId}`}\n\t\t\t\t\t\t\ttitle=\"YouTube video player\"\n\t\t\t\t\t\t\tallow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n\t\t\t\t\t\t\treferrerPolicy=\"strict-origin-when-cross-origin\"\n\t\t\t\t\t\t\tallowFullScreen\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<ModalFooter>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tonClick={() => setModalIsVisible(false)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{modalCancelButton}\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button disabled={!videoId} type=\"button\" onClick={handleMouseDown}>\n\t\t\t\t\t\t{modalConfirmButton}\n\t\t\t\t\t</Button>\n\t\t\t\t</ModalFooter>\n\t\t\t</ModalContainer>\n\t\t</>\n\t);\n}\n\nexport { InsertVideo };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/richText/insertVideo/index.tsx"],"sourcesContent":["import { Video } from \"lucide-react\";\nimport { type MouseEvent, useEffect, useState } from \"react\";\nimport { useSlate } from \"slate-react\";\n\nimport { isValidHttpsUrl } from \"../../../services/isValidHttpsUrl\";\nimport type { RichTextInsertVideoProps } from \"../../../types/richTextTypes\";\n\nimport { Button } from \"../../button\";\nimport { Input } from \"../../input\";\nimport { ModalContainer } from \"../../modal/modalContainer\";\nimport { ModalFooter } from \"../../modal/modalFooter\";\nimport { ModalHeader } from \"../../modal/modalHeader\";\n\nimport \"./styles.css\";\n\nfunction InsertVideo(props: RichTextInsertVideoProps) {\n\tconst {\n\t\tmodalCancelButton = \"Cancelar\",\n\t\tmodalConfirmButton = \"Confirmar\",\n\t\tmodalInputUrlLabel = \"URL do vídeo:\",\n\t\tmodalTitle = \"Inserir vídeo\",\n\t\tinvalidUrlMessage = \"URL inválida\",\n\t} = props;\n\n\tconst editor = useSlate();\n\n\tconst [modalIsVisible, setModalIsVisible] = useState(false);\n\tconst [videoId, setVideoId] = useState(\"\");\n\tconst [videoRawURL, setVideoRawURL] = useState(\"\");\n\tconst [errorMessage, setErrorMessage] = useState(\"\");\n\n\tfunction handleMouseDown(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\n\t\tif (!videoId || videoId === \"\") return;\n\t\tconst videoUrl = `https://www.youtube.com/embed/${videoId}`;\n\n\t\teditor.insertNodes([\n\t\t\t{ type: \"paragraph\", children: [{ text: \"\" }] },\n\t\t\t{ type: \"video\", src: videoUrl, children: [{ text: \"\" }] },\n\t\t\t{ type: \"paragraph\", children: [{ text: \"\" }] },\n\t\t]);\n\n\t\tsetModalIsVisible(false);\n\t}\n\n\tuseEffect(() => {\n\t\tif (!videoRawURL || videoRawURL === \"\") return;\n\n\t\tsetVideoId(\"\");\n\t\tsetErrorMessage(\"\");\n\n\t\tif (!isValidHttpsUrl(videoRawURL)) {\n\t\t\tsetErrorMessage(invalidUrlMessage);\n\t\t\treturn;\n\t\t}\n\n\t\tconst searchParams = new URLSearchParams(videoRawURL.split(\"?\")[1]);\n\t\tconst vParam = searchParams.get(\"v\");\n\t\tif (vParam) setVideoId(vParam);\n\t\telse setErrorMessage(invalidUrlMessage);\n\t}, [videoRawURL, invalidUrlMessage]);\n\n\tuseEffect(() => {\n\t\tif (!modalIsVisible) {\n\t\t\tsetVideoId(\"\");\n\t\t\tsetVideoRawURL(\"\");\n\t\t\tsetErrorMessage(\"\");\n\t\t}\n\t}, [modalIsVisible]);\n\n\treturn (\n\t\t<>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName=\"arkynRichTextInsertVideo\"\n\t\t\t\tonMouseDown={() => setModalIsVisible(true)}\n\t\t\t>\n\t\t\t\t<Video />\n\t\t\t</button>\n\n\t\t\t<ModalContainer\n\t\t\t\tisVisible={modalIsVisible}\n\t\t\t\tmakeInvisible={() => setModalIsVisible(false)}\n\t\t\t>\n\t\t\t\t<ModalHeader>{modalTitle}</ModalHeader>\n\n\t\t\t\t<div className=\"arkynRichTextInsertVideoModalContent\">\n\t\t\t\t\t<Input\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tname=\"richTextVideoURL\"\n\t\t\t\t\t\tlabel={modalInputUrlLabel}\n\t\t\t\t\t\tshowAsterisk\n\t\t\t\t\t\tdefaultValue={videoRawURL}\n\t\t\t\t\t\tonChange={(e) => setVideoRawURL(e.target.value)}\n\t\t\t\t\t\terrorMessage={errorMessage}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{videoId && (\n\t\t\t\t\t\t<iframe\n\t\t\t\t\t\t\twidth=\"auto\"\n\t\t\t\t\t\t\theight=\"315\"\n\t\t\t\t\t\t\tsrc={`https://www.youtube.com/embed/${videoId}`}\n\t\t\t\t\t\t\ttitle=\"YouTube video player\"\n\t\t\t\t\t\t\tallow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n\t\t\t\t\t\t\treferrerPolicy=\"strict-origin-when-cross-origin\"\n\t\t\t\t\t\t\tallowFullScreen\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<ModalFooter>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tonClick={() => setModalIsVisible(false)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{modalCancelButton}\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button disabled={!videoId} type=\"button\" onClick={handleMouseDown}>\n\t\t\t\t\t\t{modalConfirmButton}\n\t\t\t\t\t</Button>\n\t\t\t\t</ModalFooter>\n\t\t\t</ModalContainer>\n\t\t</>\n\t);\n}\n\nexport { InsertVideo };\n"],"mappings":";;;;;;;;;;;;AAeA,SAAS,EAAY,GAAiC;CACrD,IAAM,EACL,uBAAoB,YACpB,wBAAqB,aACrB,wBAAqB,iBACrB,gBAAa,iBACb,uBAAoB,mBACjB,GAEE,IAAS,EAAS,GAElB,CAAC,GAAgB,KAAqB,EAAS,EAAK,GACpD,CAAC,GAAS,KAAc,EAAS,EAAE,GACnC,CAAC,GAAa,KAAkB,EAAS,EAAE,GAC3C,CAAC,GAAc,KAAmB,EAAS,EAAE;CAEnD,SAAS,EAAgB,GAAsC;EAG9D,IAFA,EAAM,eAAe,GAEjB,CAAC,KAAW,MAAY,IAAI;EAChC,IAAM,IAAW,iCAAiC;EAQlD,AANA,EAAO,YAAY;GAClB;IAAE,MAAM;IAAa,UAAU,CAAC,EAAE,MAAM,GAAG,CAAC;GAAE;GAC9C;IAAE,MAAM;IAAS,KAAK;IAAU,UAAU,CAAC,EAAE,MAAM,GAAG,CAAC;GAAE;GACzD;IAAE,MAAM;IAAa,UAAU,CAAC,EAAE,MAAM,GAAG,CAAC;GAAE;EAC/C,CAAC,GAED,EAAkB,EAAK;CACxB;CA2BA,OAzBA,QAAgB;EACf,IAAI,CAAC,KAAe,MAAgB,IAAI;EAKxC,IAHA,EAAW,EAAE,GACb,EAAgB,EAAE,GAEd,CAAC,EAAgB,CAAW,GAAG;GAClC,EAAgB,CAAiB;GACjC;EACD;EAGA,IAAM,IAAS,IADU,gBAAgB,EAAY,MAAM,GAAG,CAAC,CAAC,EACjD,CAAA,CAAa,IAAI,GAAG;EACnC,AAAI,IAAQ,EAAW,CAAM,IACxB,EAAgB,CAAiB;CACvC,GAAG,CAAC,GAAa,CAAiB,CAAC,GAEnC,QAAgB;EACf,AAAK,MACJ,EAAW,EAAE,GACb,EAAe,EAAE,GACjB,EAAgB,EAAE;CAEpB,GAAG,CAAC,CAAc,CAAC,GAGlB,kBAAA,GAAA,EAAA,UAAA,CACC,kBAAC,UAAD;EACC,MAAK;EACL,WAAU;EACV,mBAAmB,EAAkB,EAAI;YAEzC,kBAAC,GAAD,CAAQ,CAAA;CACD,CAAA,GAER,kBAAC,GAAD;EACC,WAAW;EACX,qBAAqB,EAAkB,EAAK;YAF7C;GAIC,kBAAC,GAAD,EAAA,UAAc,EAAwB,CAAA;GAEtC,kBAAC,OAAD;IAAK,WAAU;cAAf,CACC,kBAAC,GAAD;KACC,MAAK;KACL,MAAK;KACL,OAAO;KACP,cAAA;KACA,cAAc;KACd,WAAW,MAAM,EAAe,EAAE,OAAO,KAAK;KAChC;IACd,CAAA,GAEA,KACA,kBAAC,UAAD;KACC,OAAM;KACN,QAAO;KACP,KAAK,iCAAiC;KACtC,OAAM;KACN,OAAM;KACN,gBAAe;KACf,iBAAA;IACA,CAAA,CAEE;;GAEL,kBAAC,GAAD,EAAA,UAAA,CACC,kBAAC,GAAD;IACC,MAAK;IACL,QAAO;IACP,SAAQ;IACR,eAAe,EAAkB,EAAK;cAErC;GACM,CAAA,GAER,kBAAC,GAAD;IAAQ,UAAU,CAAC;IAAS,MAAK;IAAS,SAAS;cACjD;GACM,CAAA,CACI,EAAA,CAAA;EACE;GACf,EAAA,CAAA;AAEJ"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
/* empty css */
|
|
1
2
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
3
|
//#region src/components/richText/leaf/index.tsx
|
|
3
4
|
function t({ attributes: t, children: n, leaf: r }) {
|
|
4
|
-
return r.bold && (n = /* @__PURE__ */ e("strong", { children: n })), r.code && (n = /* @__PURE__ */ e("code", { children: n })), r.italic && (n = /* @__PURE__ */ e("em", { children: n })), r.underline && (n = /* @__PURE__ */ e("u", { children: n })), /* @__PURE__ */ e("
|
|
5
|
+
return r.bold && (n = /* @__PURE__ */ e("strong", { children: n })), r.code && (n = /* @__PURE__ */ e("code", { children: n })), r.italic && (n = /* @__PURE__ */ e("em", { children: n })), r.underline && (n = /* @__PURE__ */ e("u", { children: n })), r.link && (n = /* @__PURE__ */ e("a", {
|
|
6
|
+
className: "arkynLeafLink",
|
|
7
|
+
href: r.href,
|
|
8
|
+
children: n
|
|
9
|
+
})), /* @__PURE__ */ e("span", {
|
|
5
10
|
...t,
|
|
6
11
|
children: n
|
|
7
12
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/richText/leaf/index.tsx"],"sourcesContent":["import type { RenderLeafProps } from \"slate-react\";\n\nfunction Leaf({ attributes, children, leaf }: RenderLeafProps) {\n\tif (leaf.bold) children = <strong>{children}</strong>;\n\tif (leaf.code) children = <code>{children}</code>;\n\tif (leaf.italic) children = <em>{children}</em>;\n\tif (leaf.underline) children = <u>{children}</u>;\n\n\treturn <span {...attributes}>{children}</span>;\n}\n\nexport { Leaf };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/richText/leaf/index.tsx"],"sourcesContent":["import type { RenderLeafProps } from \"slate-react\";\nimport \"./styles.css\";\n\nfunction Leaf({ attributes, children, leaf }: RenderLeafProps) {\n\tif (leaf.bold) children = <strong>{children}</strong>;\n\tif (leaf.code) children = <code>{children}</code>;\n\tif (leaf.italic) children = <em>{children}</em>;\n\tif (leaf.underline) children = <u>{children}</u>;\n\tif (leaf.link) {\n\t\tchildren = (\n\t\t\t<a className=\"arkynLeafLink\" href={leaf.href}>\n\t\t\t\t{children}\n\t\t\t</a>\n\t\t);\n\t}\n\n\treturn <span {...attributes}>{children}</span>;\n}\n\nexport { Leaf };\n"],"mappings":";;;AAGA,SAAS,EAAK,EAAE,eAAY,aAAU,WAAyB;CAa9D,OAZI,EAAK,SAAM,IAAW,kBAAC,UAAD,EAAS,YAAiB,CAAA,IAChD,EAAK,SAAM,IAAW,kBAAC,QAAD,EAAO,YAAe,CAAA,IAC5C,EAAK,WAAQ,IAAW,kBAAC,MAAD,EAAK,YAAa,CAAA,IAC1C,EAAK,cAAW,IAAW,kBAAC,KAAD,EAAI,YAAY,CAAA,IAC3C,EAAK,SACR,IACC,kBAAC,KAAD;EAAG,WAAU;EAAgB,MAAM,EAAK;EACtC;CACC,CAAA,IAIE,kBAAC,QAAD;EAAM,GAAI;EAAa;CAAe,CAAA;AAC9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer arkyn{.arkynLeafLink{color:var(--text-link,#2563eb);text-decoration:underline}}
|
|
@@ -60,8 +60,12 @@
|
|
|
60
60
|
|
|
61
61
|
@layer arkyn{.arkynTabContainer{border-bottom:1px solid var(--border,#e2e8f0);justify-content:start;align-items:center;gap:4px;display:flex;position:relative}}
|
|
62
62
|
|
|
63
|
+
@layer arkyn{.arkynRichTextInsertLink{background-color:var(--background-underground,#fafafa);border:none;border-radius:4px;justify-content:center;align-items:center;width:36px;height:36px;display:flex}.arkynRichTextInsertLink svg{width:20px;height:20px;color:var(--text-heading,#09090b)}.arkynRichTextInsertLink:hover{cursor:pointer;filter:brightness(.98)}.arkynRichTextInsertLinkModalContent{flex-direction:column;gap:16px;width:500px;padding:16px;display:flex}html.dark .arkynRichTextInsertLink:hover{cursor:pointer;filter:brightness(.9)}}
|
|
64
|
+
|
|
63
65
|
@layer arkyn{.arkynRichTextInsertVideo{background-color:var(--background-underground,#fafafa);border:none;border-radius:4px;justify-content:center;align-items:center;width:36px;height:36px;display:flex}.arkynRichTextInsertVideo svg{width:20px;height:20px;color:var(--text-heading,#09090b)}.arkynRichTextInsertVideo:hover{cursor:pointer;filter:brightness(.98)}.arkynRichTextInsertVideoModalContent{flex-direction:column;gap:16px;width:500px;padding:16px;display:flex}.arkynRichTextInsertVideoModalPreviewVideo{border-radius:8px;width:100%}.arkynRichTextInsertVideoModalContent .arkynVideoUpload{min-height:174px}html.dark .arkynRichTextInsertVideo:hover{cursor:pointer;filter:brightness(.9)}}
|
|
64
66
|
|
|
67
|
+
@layer arkyn{.arkynLeafLink{color:var(--text-link,#2563eb);text-decoration:underline}}
|
|
68
|
+
|
|
65
69
|
@layer arkyn{.arkynRichTextMarkButton{background-color:var(--background-underground,#fafafa);border:none;border-radius:4px;justify-content:center;align-items:center;width:36px;height:36px;display:flex}.arkynRichTextMarkButton svg{width:20px;height:20px;color:var(--text-heading,#09090b)}.arkynRichTextMarkButton:hover{cursor:pointer;filter:brightness(.97)}html.dark .arkynRichTextMarkButton:hover{cursor:pointer;filter:brightness(.9)}.arkynRichTextMarkButton.activeTrue{filter:brightness(.97)}html.dark .arkynRichTextMarkButton.activeTrue{filter:brightness(.9)}.arkynRichTextMarkButton.activeTrue svg{color:rgba(var(--spotlight-primary,17, 109, 220), 1)}}
|
|
66
70
|
|
|
67
71
|
@layer arkyn{.arkynRichTextToolbar{background-color:var(--background-underground,#fafafa);border-bottom:1px solid var(--border,#e2e8f0);border-radius:8px 8px 0 0;flex-wrap:wrap;align-items:center;gap:12px 24px;padding:12px 16px;display:flex}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchPlaces.js","names":[],"sources":["../../../src/components/searchPlaces.tsx"],"sourcesContent":["import type { StandaloneSearchBoxProps } from \"@react-google-maps/api\";\nimport { StandaloneSearchBox } from \"@react-google-maps/api\";\nimport { type JSX, useState } from \"react\";\nimport { Input, type InputProps } from \"./input\";\n\ntype AddressComponentsType = {\n\tlong_name: string;\n\tshort_name: string;\n\ttypes: string[];\n}[];\n\n/** Structured address data extracted from a Google Places result. */\ntype PlaceData = {\n\t/** Street name (e.g. `\"Rua Exemplo\"`). */\n\tstreet: string;\n\t/** City name (e.g. `\"São Paulo\"`). */\n\tcity: string;\n\t/** Full state name (e.g. `\"São Paulo\"`). */\n\tstate: string;\n\t/** Neighborhood / district name. */\n\tneighborhood: string;\n\t/** Postal / ZIP code. */\n\tpostalCode: string;\n\t/** State abbreviation (e.g. `\"SP\"`). */\n\tstateShortName: string;\n\t/** Street number (e.g. `\"123\"`). */\n\tstreetNumber: string;\n\t/** Geographic coordinates of the place. */\n\tcoordinates: { lat: number; lng: number };\n};\n\ntype SearchPlacesProps = {\n\t/** Google Maps `StandaloneSearchBox` options (e.g. `componentRestrictions`, `bounds`). */\n\toptions?: StandaloneSearchBoxProps[\"options\"];\n\t/** Callback fired every time the input text changes. Receives the current string value. */\n\tonChange?: (e: string) => void;\n\t/**\n\t * Callback fired when the user selects a place from the autocomplete suggestions.\n\t * Receives a structured {@link PlaceData} object.\n\t */\n\tonPlaceChanged?: (e: PlaceData) => void;\n} & Omit<InputProps, \"onLoad\" | \"onChange\" | \"type\">;\n\n/**\n * SearchPlaces
|
|
1
|
+
{"version":3,"file":"searchPlaces.js","names":[],"sources":["../../../src/components/searchPlaces.tsx"],"sourcesContent":["import type { StandaloneSearchBoxProps } from \"@react-google-maps/api\";\nimport { StandaloneSearchBox } from \"@react-google-maps/api\";\nimport { type JSX, useState } from \"react\";\nimport { Input, type InputProps } from \"./input\";\n\ntype AddressComponentsType = {\n\tlong_name: string;\n\tshort_name: string;\n\ttypes: string[];\n}[];\n\n/** Structured address data extracted from a Google Places result. */\ntype PlaceData = {\n\t/** Street name (e.g. `\"Rua Exemplo\"`). */\n\tstreet: string;\n\t/** City name (e.g. `\"São Paulo\"`). */\n\tcity: string;\n\t/** Full state name (e.g. `\"São Paulo\"`). */\n\tstate: string;\n\t/** Neighborhood / district name. */\n\tneighborhood: string;\n\t/** Postal / ZIP code. */\n\tpostalCode: string;\n\t/** State abbreviation (e.g. `\"SP\"`). */\n\tstateShortName: string;\n\t/** Street number (e.g. `\"123\"`). */\n\tstreetNumber: string;\n\t/** Geographic coordinates of the place. */\n\tcoordinates: { lat: number; lng: number };\n};\n\ntype SearchPlacesProps = {\n\t/** Google Maps `StandaloneSearchBox` options (e.g. `componentRestrictions`, `bounds`). */\n\toptions?: StandaloneSearchBoxProps[\"options\"];\n\t/** Callback fired every time the input text changes. Receives the current string value. */\n\tonChange?: (e: string) => void;\n\t/**\n\t * Callback fired when the user selects a place from the autocomplete suggestions.\n\t * Receives a structured {@link PlaceData} object.\n\t */\n\tonPlaceChanged?: (e: PlaceData) => void;\n} & Omit<InputProps, \"onLoad\" | \"onChange\" | \"type\">;\n\n/**\n * SearchPlaces, text input with Google Places autocomplete that returns structured address data.\n *\n * Requires the Google Maps JavaScript API with the Places library to be loaded.\n * Built on `@react-google-maps/api`'s `StandaloneSearchBox`.\n *\n * @param props.options - Google Maps search box options (e.g. restrict by country).\n * @param props.onChange - Fires on every keystroke, receives the current text value.\n * @param props.onPlaceChanged - Fires when the user selects a suggestion, receives structured address data.\n *\n * **...Other valid `Input` properties (except `onLoad`, `onChange`, `type`)**\n *\n * @returns SearchPlaces JSX element (an `Input` wrapped in `StandaloneSearchBox`).\n *\n * @example\n * ```tsx\n * <SearchPlaces\n * name=\"address\"\n * label=\"Address\"\n * placeholder=\"Start typing an address…\"\n * options={{ componentRestrictions: { country: \"br\" } }}\n * onChange={(v) => setRawAddress(v)}\n * onPlaceChanged={(place) => {\n * setAddress({\n * street: place.street,\n * city: place.city,\n * state: place.state,\n * postalCode: place.postalCode,\n * coordinates: place.coordinates,\n * });\n * }}\n * />\n * ```\n */\n\nfunction SearchPlaces(props: SearchPlacesProps): JSX.Element {\n\tconst { onChange, onPlaceChanged, options, ...rest } = props;\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconst [searchBox, setSearchBox] = useState<any>(null);\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconst handleLoad = (ref: any) => setSearchBox(ref);\n\n\tconst handlePlacesChanged = () => {\n\t\tconst places = searchBox?.getPlaces();\n\t\tconst place = places ? places[0] : null;\n\n\t\tconst address_components =\n\t\t\tplace?.address_components as AddressComponentsType;\n\n\t\tfunction findData(key: string) {\n\t\t\tconst data = address_components.find((item) => item.types[0] === key);\n\t\t\tif (data) return data.long_name;\n\t\t\treturn \"\";\n\t\t}\n\n\t\tfunction findDataShort(key: string) {\n\t\t\tconst data = address_components.find((item) => item.types[0] === key);\n\t\t\tif (data) return data.short_name;\n\t\t\treturn \"\";\n\t\t}\n\n\t\tfunction findDataByMultipleTypes(keys: string[]) {\n\t\t\tfor (const key of keys) {\n\t\t\t\tconst data = address_components.find((item) =>\n\t\t\t\t\titem.types.includes(key),\n\t\t\t\t);\n\t\t\t\tif (data) return data.long_name;\n\t\t\t}\n\t\t\treturn \"\";\n\t\t}\n\n\t\tif (place) {\n\t\t\tconst street = findData(\"route\");\n\t\t\tconst streetNumber = findData(\"street_number\");\n\t\t\tconst neighborhood = findDataByMultipleTypes([\n\t\t\t\t\"sublocality_level_1\",\n\t\t\t\t\"sublocality\",\n\t\t\t\t\"neighborhood\",\n\t\t\t]);\n\t\t\tconst city = findData(\"administrative_area_level_2\");\n\t\t\tconst state = findData(\"administrative_area_level_1\");\n\t\t\tconst stateShortName = findDataShort(\"administrative_area_level_1\");\n\t\t\tconst postalCode = findDataByMultipleTypes([\n\t\t\t\t\"postal_code\",\n\t\t\t\t\"postal_code_prefix\",\n\t\t\t]);\n\n\t\t\tconst lat = place.geometry?.location?.lat();\n\t\t\tconst lng = place.geometry?.location?.lng();\n\n\t\t\tconst sendPlace = {\n\t\t\t\tstreet,\n\t\t\t\tcity,\n\t\t\t\tstate,\n\t\t\t\tneighborhood,\n\t\t\t\tpostalCode,\n\t\t\t\tstreetNumber,\n\t\t\t\tstateShortName,\n\t\t\t\tcoordinates: { lat, lng },\n\t\t\t};\n\n\t\t\tonPlaceChanged?.(sendPlace);\n\t\t}\n\t};\n\n\treturn (\n\t\t<StandaloneSearchBox\n\t\t\tonLoad={handleLoad}\n\t\t\tonPlacesChanged={handlePlacesChanged}\n\t\t\toptions={options}\n\t\t>\n\t\t\t<Input\n\t\t\t\ttype=\"text\"\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tonChange={(e) => onChange?.(e.target.value)}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t</StandaloneSearchBox>\n\t);\n}\n\nexport { SearchPlaces };\n"],"mappings":";;;;;AA8EA,SAAS,EAAa,GAAuC;CAC5D,IAAM,EAAE,aAAU,mBAAgB,YAAS,GAAG,MAAS,GAGjD,CAAC,GAAW,KAAgB,EAAc,IAAI;CAmEpD,OACC,kBAAC,GAAD;EACC,SAnEkB,MAAa,EAAa,CAAG;EAoE/C,uBAlEgC;GACjC,IAAM,IAAS,GAAW,UAAU,GAC9B,IAAQ,IAAS,EAAO,KAAK,MAE7B,IACL,GAAO;GAER,SAAS,EAAS,GAAa;IAC9B,IAAM,IAAO,EAAmB,MAAM,MAAS,EAAK,MAAM,OAAO,CAAG;IAEpE,OADI,IAAa,EAAK,YACf;GACR;GAEA,SAAS,EAAc,GAAa;IACnC,IAAM,IAAO,EAAmB,MAAM,MAAS,EAAK,MAAM,OAAO,CAAG;IAEpE,OADI,IAAa,EAAK,aACf;GACR;GAEA,SAAS,EAAwB,GAAgB;IAChD,KAAK,IAAM,KAAO,GAAM;KACvB,IAAM,IAAO,EAAmB,MAAM,MACrC,EAAK,MAAM,SAAS,CAAG,CACxB;KACA,IAAI,GAAM,OAAO,EAAK;IACvB;IACA,OAAO;GACR;GAEA,IAAI,GAAO;IACV,IAAM,IAAS,EAAS,OAAO,GACzB,IAAe,EAAS,eAAe,GACvC,IAAe,EAAwB;KAC5C;KACA;KACA;IACD,CAAC,GACK,IAAO,EAAS,6BAA6B,GAC7C,IAAQ,EAAS,6BAA6B,GAC9C,IAAiB,EAAc,6BAA6B,GAS5D,IAAY;KACjB;KACA;KACA;KACA;KACA,YAbkB,EAAwB,CAC1C,eACA,oBACD,CAUC;KACA;KACA;KACA,aAAa;MAAE,KAXJ,EAAM,UAAU,UAAU,IAAI;MAWrB,KAVT,EAAM,UAAU,UAAU,IAAI;KAUjB;IACzB;IAEA,IAAiB,CAAS;GAC3B;EACD;EAMW;YAET,kBAAC,GAAD;GACC,MAAK;GACL,cAAa;GACb,WAAW,MAAM,IAAW,EAAE,OAAO,KAAK;GAC1C,GAAI;EACJ,CAAA;CACmB,CAAA;AAEvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/select/index.tsx"],"sourcesContent":["import type { LucideIcon } from \"lucide-react\";\nimport { type FocusEvent, useId, useRef, useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\n\nimport { SelectChevron } from \"./selectChevron\";\nimport { SelectContainer } from \"./selectContainer\";\nimport { SelectContent } from \"./selectContent\";\nimport { SelectOption } from \"./selectOption\";\nimport { SelectOptionsContainer } from \"./selectOptionsContainer\";\nimport { SelectOverlay } from \"./selectOverlay\";\nimport { SelectSpinner } from \"./selectSpinner\";\n\ntype SelectProps = {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Array of selectable options. Required. */\n\toptions: { label: string; value: string }[];\n\t/** Optional HTML id for the underlying hidden input. */\n\tid?: string;\n\t/** Controlled selected value. */\n\tvalue?: string;\n\t/** Uncontrolled default selected value. @default \"\" */\n\tdefaultValue?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Optional label text displayed above the select. */\n\tlabel?: string;\n\t/** Validation error message displayed below the select. */\n\terrorMessage?: string;\n\t/** Placeholder text shown when no option is selected. @default \"Selecione...\" */\n\tplaceholder?: string;\n\t/** Text shown when no options match the search query. @default \"Sem opções disponíveis\" */\n\tnotFoundText?: string;\n\t/** Additional CSS class applied to the wrapper element. */\n\tclassName?: string;\n\t/** Disables all interactions. @default false */\n\tdisabled?: boolean;\n\t/** Prevents value changes while keeping the current value visible. @default false */\n\treadOnly?: boolean;\n\t/** Shows a loading spinner and disables interactions. @default false */\n\tisLoading?: boolean;\n\t/** Enables search/filter within the dropdown. @default false */\n\tisSearchable?: boolean;\n\t/** Closes the dropdown after an option is selected. @default true */\n\tcloseOnSelect?: boolean;\n\t/** Callback fired when the search query changes. Use for async option loading. */\n\tonSearch?: (value: string) => void;\n\t/** Callback fired when the selected value changes. */\n\tonChange?: (value: string) => void;\n\t/** Callback fired when the select gains focus. */\n\tonFocus?: () => void;\n\t/** Callback fired when the select loses focus. */\n\tonBlur?: (e: FocusEvent<HTMLDivElement>) => void;\n\t/**\n\t * Select size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/** Text or icon rendered at the far left, outside the select area. */\n\tprefix?: string | LucideIcon;\n\t/** Lucide icon rendered inside the select on the left. */\n\tleftIcon?: LucideIcon;\n\t/** Maximum height (in px) of the options dropdown. */\n\toptionMaxHeight?: number;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * Select — single-option dropdown with optional search, label, validation, and form integration.\n *\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.options - Array of selectable options (`{ label, value }`). Required.\n * @param props.value - Controlled selected value.\n * @param props.defaultValue - Uncontrolled default value. Default: \"\"\n * @param props.label - Label text displayed above the select.\n * @param props.placeholder - Placeholder shown when nothing is selected. Default: \"Selecione...\"\n * @param props.errorMessage - Validation error message.\n * @param props.isSearchable - Enables search/filter within the dropdown. Default: false\n * @param props.isLoading - Shows a loading spinner and disables interactions. Default: false\n * @param props.closeOnSelect - Closes the dropdown after selecting. Default: true\n * @param props.onChange - Callback fired when the selected value changes.\n * @param props.onSearch - Callback fired when the search query changes.\n * @param props.size - Select size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns Select JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Select\n * name=\"category\"\n * options={[\n * { label: \"Technology\", value: \"tech\" },\n * { label: \"Design\", value: \"design\" },\n * ]}\n * />\n *\n * // With label, validation, and searchable\n * <Select\n * name=\"country\"\n * label=\"Country\"\n * showAsterisk\n * isSearchable\n * options={countryOptions}\n * errorMessage={errors.country}\n * notFoundText=\"No countries found\"\n * />\n *\n * // Controlled with async search\n * <Select\n * name=\"tag\"\n * label=\"Tag\"\n * value={selectedTag}\n * onChange={setSelectedTag}\n * onSearch={fetchTagOptions}\n * isLoading={isLoadingTags}\n * options={tagOptions}\n * />\n * ```\n */\n\nfunction Select(props: SelectProps) {\n\tconst {\n\t\tname,\n\t\toptions,\n\t\tclassName: wrapperClassName = \"\",\n\t\tplaceholder = \"Selecione...\",\n\t\tcloseOnSelect = true,\n\t\tdefaultValue = \"\",\n\t\terrorMessage: baseErrorMessage,\n\t\tisLoading = false,\n\t\treadOnly = false,\n\t\tisSearchable = false,\n\t\tid,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tleftIcon: LeftIcon,\n\t\tonSearch,\n\t\tonChange,\n\t\tonBlur,\n\t\tnotFoundText = \"Sem opções disponíveis\",\n\t\tonFocus,\n\t\tdisabled: baseDisabled = false,\n\t\tprefix,\n\t\tsize = \"md\",\n\t\tvalue,\n\t\tvariant = \"solid\",\n\t\torientation = \"vertical\",\n\t\tunShowFieldTemplate = false,\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\n\tconst selectRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst selectId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst disabled = baseDisabled || isLoading || readOnly;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst [search, setSearch] = useState(\"\");\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [selectedOption, setSelectedOption] = useState(defaultValue);\n\n\tconst forceSelectedOptions = value || selectedOption;\n\n\tfunction optionHasSelected(value: string) {\n\t\treturn forceSelectedOptions === value;\n\t}\n\n\tfunction getOptionLabel(value: string) {\n\t\tconst option = options.find((option) => option.value === value);\n\t\treturn option?.label || \"\";\n\t}\n\n\tfunction handleContainerFocus() {\n\t\tif (disabled || !selectRef?.current || isFocused) return;\n\t\tsetIsFocused(true);\n\t\tselectRef.current.focus();\n\t\tonFocus?.();\n\t}\n\n\tfunction handleBlur() {\n\t\tsetIsFocused(false);\n\t\tif (onBlur && selectRef.current) selectRef.current.blur();\n\t}\n\n\tfunction handleSearch(value: string) {\n\t\tsetSearch(value);\n\t\tif (onSearch) onSearch(value);\n\t}\n\n\tfunction handleChangeValue(value: string) {\n\t\tif (optionHasSelected(value)) {\n\t\t\tsetSelectedOption(\"\");\n\t\t\tif (onChange) onChange(\"\");\n\t\t} else {\n\t\t\tsetSelectedOption(value);\n\t\t\tif (onChange) onChange(value);\n\t\t}\n\n\t\tif (closeOnSelect) handleBlur();\n\t}\n\n\tconst mappedOptions = options.filter((option) => {\n\t\tif (props.onSearch) return true;\n\t\tif (!props.isSearchable) return true;\n\t\tif (option.label.toLowerCase().includes(search.toLowerCase())) return true;\n\t\treturn false;\n\t});\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<SelectContainer\n\t\t\t\thandleContainerFocus={handleContainerFocus}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisError={isError}\n\t\t\t\tisFocused={isFocused}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tsize={size}\n\t\t\t\tvariant={variant}\n\t\t\t\tprefixExists={!!prefix}\n\t\t\t\tid={selectId}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tref={selectRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={forceSelectedOptions}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t{LeftIcon && <LeftIcon size={iconSize} strokeWidth={2.5} />}\n\n\t\t\t\t<SelectContent size={size}>\n\t\t\t\t\t{forceSelectedOptions !== \"\" && (\n\t\t\t\t\t\t<p className=\"hasValue\">{getOptionLabel(forceSelectedOptions)}</p>\n\t\t\t\t\t)}\n\t\t\t\t\t{forceSelectedOptions === \"\" && <p>{placeholder}</p>}\n\t\t\t\t</SelectContent>\n\n\t\t\t\t<SelectOptionsContainer\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\tisSearchable={isSearchable}\n\t\t\t\t\tsearch={search}\n\t\t\t\t\tonSearch={handleSearch}\n\t\t\t\t>\n\t\t\t\t\t{mappedOptions.map(({ label, value }) => (\n\t\t\t\t\t\t<SelectOption\n\t\t\t\t\t\t\tkey={value}\n\t\t\t\t\t\t\tlabel={label}\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\t\thandleChangeValue={handleChangeValue}\n\t\t\t\t\t\t\toptionHasSelected={optionHasSelected}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\n\t\t\t\t\t{mappedOptions.length <= 0 && <p>{notFoundText}</p>}\n\t\t\t\t</SelectOptionsContainer>\n\n\t\t\t\t<SelectChevron\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t/>\n\n\t\t\t\t<SelectSpinner iconSize={iconSize} isLoading={isLoading} />\n\t\t\t\t<SelectOverlay handleBlur={handleBlur} isFocused={isFocused} />\n\t\t\t</SelectContainer>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Select };\n"],"mappings":";;;;;;;;;;;;;AA+IA,SAAS,EAAO,GAAoB;CACnC,IAAM,EACL,SACA,YACA,WAAW,IAAmB,IAC9B,iBAAc,gBACd,mBAAgB,IAChB,kBAAe,IACf,cAAc,GACd,eAAY,IACZ,cAAW,IACX,mBAAe,IACf,QACA,WACA,iBACA,UAAU,GACV,aACA,aACA,WACA,kBAAe,0BACf,YACA,UAAU,IAAe,IACzB,WACA,UAAO,MACP,UACA,aAAU,SACV,iBAAc,YACd,yBAAsB,OACnB,GAEE,EAAE,mBAAgB,EAAQ,GAE1B,IAAY,EAAyB,IAAI,GACzC,KAAc,EAAM,GACpB,IAAW,MAAM,IAEjB,IAAe,KAAoB,IAAc,IACjD,IAAU,CAAC,CAAC,GACZ,IAAW,KAAgB,KAAa,GAGxC,IAAW;EADG,IAAI;EAAI,IAAI;CACf,EAAU,IAErB,CAAC,GAAQ,KAAa,EAAS,EAAE,GACjC,CAAC,GAAW,KAAgB,EAAS,EAAK,GAC1C,CAAC,GAAgB,KAAqB,EAAS,CAAY,GAE3D,IAAuB,KAAS;CAEtC,SAAS,EAAkB,GAAe;EACzC,OAAO,MAAyB;CACjC;CAEA,SAAS,GAAe,GAAe;EAEtC,OADe,EAAQ,MAAM,MAAW,EAAO,UAAU,CAClD,CAAA,EAAQ,SAAS;CACzB;CAEA,SAAS,KAAuB;EAC3B,KAAY,CAAC,GAAW,WAAW,MACvC,EAAa,EAAI,GACjB,EAAU,QAAQ,MAAM,GACxB,IAAU;CACX;CAEA,SAAS,IAAa;EAErB,AADA,EAAa,EAAK,GACd,KAAU,EAAU,WAAS,EAAU,QAAQ,KAAK;CACzD;CAEA,SAAS,GAAa,GAAe;EAEpC,AADA,EAAU,CAAK,GACX,KAAU,EAAS,CAAK;CAC7B;CAEA,SAAS,GAAkB,GAAe;EASzC,AARI,EAAkB,CAAK,KAC1B,EAAkB,EAAE,GAChB,KAAU,EAAS,EAAE,MAEzB,EAAkB,CAAK,GACnB,KAAU,EAAS,CAAK,IAGzB,KAAe,EAAW;CAC/B;CAEA,IAAM,IAAgB,EAAQ,QAAQ,MAGrC,GAFI,EAAM,YACN,CAAC,EAAM,gBACP,EAAO,MAAM,YAAY,CAAC,CAAC,SAAS,EAAO,YAAY,CAAC,EAE5D;CAED,OACC,kBAAC,GAAD;EACO;EACC;EACO;EACd,WAAW;EACG;EACO;EACR;YAEb,kBAAC,GAAD;GACuB;GACZ;GACD;GACE;GACA;GACD;GACJ;GACG;GACT,cAAc,CAAC,CAAC;GAChB,IAAI;aAVL;IAYC,kBAAC,SAAD;KACC,KAAK;KACC;KACN,OAAO;KACP,MAAK;IACL,CAAA;IAED,kBAAC,GAAD;KAAwB;KAAU,MAAM;KAAQ,WAAU;IAAU,CAAA;IAEnE,KAAY,kBAAC,GAAD;KAAU,MAAM;KAAU,aAAa;IAAM,CAAA;IAE1D,kBAAC,GAAD;KAAqB;eAArB,CACE,MAAyB,MACzB,kBAAC,KAAD;MAAG,WAAU;gBAAY,GAAe,CAAoB;KAAK,CAAA,GAEjE,MAAyB,MAAM,kBAAC,KAAD,EAAA,UAAI,EAAe,CAAA,CACrC;;IAEf,kBAAC,GAAD;KACY;KACG;KACN;KACR,UAAU;eAJX,CAME,EAAc,KAAK,EAAE,UAAO,eAC5B,kBAAC,GAAD;MAEQ;MACA;MACD;MACa;MACA;KACnB,GANK,CAML,CACD,GAEA,EAAc,UAAU,KAAK,kBAAC,KAAD,EAAA,UAAI,EAAgB,CAAA,CAC3B;;IAExB,kBAAC,GAAD;KACW;KACC;KACD;KACA;KACC;IACX,CAAA;IAED,kBAAC,IAAD;KAAyB;KAAqB;IAAY,CAAA;IAC1D,kBAAC,IAAD;KAA2B;KAAuB;IAAY,CAAA;GAC9C;;CACH,CAAA;AAEjB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/select/index.tsx"],"sourcesContent":["import type { LucideIcon } from \"lucide-react\";\nimport { type FocusEvent, useId, useRef, useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\n\nimport { SelectChevron } from \"./selectChevron\";\nimport { SelectContainer } from \"./selectContainer\";\nimport { SelectContent } from \"./selectContent\";\nimport { SelectOption } from \"./selectOption\";\nimport { SelectOptionsContainer } from \"./selectOptionsContainer\";\nimport { SelectOverlay } from \"./selectOverlay\";\nimport { SelectSpinner } from \"./selectSpinner\";\n\ntype SelectProps = {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Array of selectable options. Required. */\n\toptions: { label: string; value: string }[];\n\t/** Optional HTML id for the underlying hidden input. */\n\tid?: string;\n\t/** Controlled selected value. */\n\tvalue?: string;\n\t/** Uncontrolled default selected value. @default \"\" */\n\tdefaultValue?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Optional label text displayed above the select. */\n\tlabel?: string;\n\t/** Validation error message displayed below the select. */\n\terrorMessage?: string;\n\t/** Placeholder text shown when no option is selected. @default \"Selecione...\" */\n\tplaceholder?: string;\n\t/** Text shown when no options match the search query. @default \"Sem opções disponíveis\" */\n\tnotFoundText?: string;\n\t/** Additional CSS class applied to the wrapper element. */\n\tclassName?: string;\n\t/** Disables all interactions. @default false */\n\tdisabled?: boolean;\n\t/** Prevents value changes while keeping the current value visible. @default false */\n\treadOnly?: boolean;\n\t/** Shows a loading spinner and disables interactions. @default false */\n\tisLoading?: boolean;\n\t/** Enables search/filter within the dropdown. @default false */\n\tisSearchable?: boolean;\n\t/** Closes the dropdown after an option is selected. @default true */\n\tcloseOnSelect?: boolean;\n\t/** Callback fired when the search query changes. Use for async option loading. */\n\tonSearch?: (value: string) => void;\n\t/** Callback fired when the selected value changes. */\n\tonChange?: (value: string) => void;\n\t/** Callback fired when the select gains focus. */\n\tonFocus?: () => void;\n\t/** Callback fired when the select loses focus. */\n\tonBlur?: (e: FocusEvent<HTMLDivElement>) => void;\n\t/**\n\t * Select size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/** Text or icon rendered at the far left, outside the select area. */\n\tprefix?: string | LucideIcon;\n\t/** Lucide icon rendered inside the select on the left. */\n\tleftIcon?: LucideIcon;\n\t/** Maximum height (in px) of the options dropdown. */\n\toptionMaxHeight?: number;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * Select, single-option dropdown with optional search, label, validation, and form integration.\n *\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.options - Array of selectable options (`{ label, value }`). Required.\n * @param props.value - Controlled selected value.\n * @param props.defaultValue - Uncontrolled default value. Default: \"\"\n * @param props.label - Label text displayed above the select.\n * @param props.placeholder - Placeholder shown when nothing is selected. Default: \"Selecione...\"\n * @param props.errorMessage - Validation error message.\n * @param props.isSearchable - Enables search/filter within the dropdown. Default: false\n * @param props.isLoading - Shows a loading spinner and disables interactions. Default: false\n * @param props.closeOnSelect - Closes the dropdown after selecting. Default: true\n * @param props.onChange - Callback fired when the selected value changes.\n * @param props.onSearch - Callback fired when the search query changes.\n * @param props.size - Select size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns Select JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Select\n * name=\"category\"\n * options={[\n * { label: \"Technology\", value: \"tech\" },\n * { label: \"Design\", value: \"design\" },\n * ]}\n * />\n *\n * // With label, validation, and searchable\n * <Select\n * name=\"country\"\n * label=\"Country\"\n * showAsterisk\n * isSearchable\n * options={countryOptions}\n * errorMessage={errors.country}\n * notFoundText=\"No countries found\"\n * />\n *\n * // Controlled with async search\n * <Select\n * name=\"tag\"\n * label=\"Tag\"\n * value={selectedTag}\n * onChange={setSelectedTag}\n * onSearch={fetchTagOptions}\n * isLoading={isLoadingTags}\n * options={tagOptions}\n * />\n * ```\n */\n\nfunction Select(props: SelectProps) {\n\tconst {\n\t\tname,\n\t\toptions,\n\t\tclassName: wrapperClassName = \"\",\n\t\tplaceholder = \"Selecione...\",\n\t\tcloseOnSelect = true,\n\t\tdefaultValue = \"\",\n\t\terrorMessage: baseErrorMessage,\n\t\tisLoading = false,\n\t\treadOnly = false,\n\t\tisSearchable = false,\n\t\tid,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tleftIcon: LeftIcon,\n\t\tonSearch,\n\t\tonChange,\n\t\tonBlur,\n\t\tnotFoundText = \"Sem opções disponíveis\",\n\t\tonFocus,\n\t\tdisabled: baseDisabled = false,\n\t\tprefix,\n\t\tsize = \"md\",\n\t\tvalue,\n\t\tvariant = \"solid\",\n\t\torientation = \"vertical\",\n\t\tunShowFieldTemplate = false,\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\n\tconst selectRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst selectId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst disabled = baseDisabled || isLoading || readOnly;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst [search, setSearch] = useState(\"\");\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [selectedOption, setSelectedOption] = useState(defaultValue);\n\n\tconst forceSelectedOptions = value || selectedOption;\n\n\tfunction optionHasSelected(value: string) {\n\t\treturn forceSelectedOptions === value;\n\t}\n\n\tfunction getOptionLabel(value: string) {\n\t\tconst option = options.find((option) => option.value === value);\n\t\treturn option?.label || \"\";\n\t}\n\n\tfunction handleContainerFocus() {\n\t\tif (disabled || !selectRef?.current || isFocused) return;\n\t\tsetIsFocused(true);\n\t\tselectRef.current.focus();\n\t\tonFocus?.();\n\t}\n\n\tfunction handleBlur() {\n\t\tsetIsFocused(false);\n\t\tif (onBlur && selectRef.current) selectRef.current.blur();\n\t}\n\n\tfunction handleSearch(value: string) {\n\t\tsetSearch(value);\n\t\tif (onSearch) onSearch(value);\n\t}\n\n\tfunction handleChangeValue(value: string) {\n\t\tif (optionHasSelected(value)) {\n\t\t\tsetSelectedOption(\"\");\n\t\t\tif (onChange) onChange(\"\");\n\t\t} else {\n\t\t\tsetSelectedOption(value);\n\t\t\tif (onChange) onChange(value);\n\t\t}\n\n\t\tif (closeOnSelect) handleBlur();\n\t}\n\n\tconst mappedOptions = options.filter((option) => {\n\t\tif (props.onSearch) return true;\n\t\tif (!props.isSearchable) return true;\n\t\tif (option.label.toLowerCase().includes(search.toLowerCase())) return true;\n\t\treturn false;\n\t});\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<SelectContainer\n\t\t\t\thandleContainerFocus={handleContainerFocus}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisError={isError}\n\t\t\t\tisFocused={isFocused}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tsize={size}\n\t\t\t\tvariant={variant}\n\t\t\t\tprefixExists={!!prefix}\n\t\t\t\tid={selectId}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tref={selectRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={forceSelectedOptions}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t{LeftIcon && <LeftIcon size={iconSize} strokeWidth={2.5} />}\n\n\t\t\t\t<SelectContent size={size}>\n\t\t\t\t\t{forceSelectedOptions !== \"\" && (\n\t\t\t\t\t\t<p className=\"hasValue\">{getOptionLabel(forceSelectedOptions)}</p>\n\t\t\t\t\t)}\n\t\t\t\t\t{forceSelectedOptions === \"\" && <p>{placeholder}</p>}\n\t\t\t\t</SelectContent>\n\n\t\t\t\t<SelectOptionsContainer\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\tisSearchable={isSearchable}\n\t\t\t\t\tsearch={search}\n\t\t\t\t\tonSearch={handleSearch}\n\t\t\t\t>\n\t\t\t\t\t{mappedOptions.map(({ label, value }) => (\n\t\t\t\t\t\t<SelectOption\n\t\t\t\t\t\t\tkey={value}\n\t\t\t\t\t\t\tlabel={label}\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\t\thandleChangeValue={handleChangeValue}\n\t\t\t\t\t\t\toptionHasSelected={optionHasSelected}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\n\t\t\t\t\t{mappedOptions.length <= 0 && <p>{notFoundText}</p>}\n\t\t\t\t</SelectOptionsContainer>\n\n\t\t\t\t<SelectChevron\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t/>\n\n\t\t\t\t<SelectSpinner iconSize={iconSize} isLoading={isLoading} />\n\t\t\t\t<SelectOverlay handleBlur={handleBlur} isFocused={isFocused} />\n\t\t\t</SelectContainer>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Select };\n"],"mappings":";;;;;;;;;;;;;AA+IA,SAAS,EAAO,GAAoB;CACnC,IAAM,EACL,SACA,YACA,WAAW,IAAmB,IAC9B,iBAAc,gBACd,mBAAgB,IAChB,kBAAe,IACf,cAAc,GACd,eAAY,IACZ,cAAW,IACX,mBAAe,IACf,QACA,WACA,iBACA,UAAU,GACV,aACA,aACA,WACA,kBAAe,0BACf,YACA,UAAU,IAAe,IACzB,WACA,UAAO,MACP,UACA,aAAU,SACV,iBAAc,YACd,yBAAsB,OACnB,GAEE,EAAE,mBAAgB,EAAQ,GAE1B,IAAY,EAAyB,IAAI,GACzC,KAAc,EAAM,GACpB,IAAW,MAAM,IAEjB,IAAe,KAAoB,IAAc,IACjD,IAAU,CAAC,CAAC,GACZ,IAAW,KAAgB,KAAa,GAGxC,IAAW;EADG,IAAI;EAAI,IAAI;CACf,EAAU,IAErB,CAAC,GAAQ,KAAa,EAAS,EAAE,GACjC,CAAC,GAAW,KAAgB,EAAS,EAAK,GAC1C,CAAC,GAAgB,KAAqB,EAAS,CAAY,GAE3D,IAAuB,KAAS;CAEtC,SAAS,EAAkB,GAAe;EACzC,OAAO,MAAyB;CACjC;CAEA,SAAS,GAAe,GAAe;EAEtC,OADe,EAAQ,MAAM,MAAW,EAAO,UAAU,CAClD,CAAA,EAAQ,SAAS;CACzB;CAEA,SAAS,KAAuB;EAC3B,KAAY,CAAC,GAAW,WAAW,MACvC,EAAa,EAAI,GACjB,EAAU,QAAQ,MAAM,GACxB,IAAU;CACX;CAEA,SAAS,IAAa;EAErB,AADA,EAAa,EAAK,GACd,KAAU,EAAU,WAAS,EAAU,QAAQ,KAAK;CACzD;CAEA,SAAS,GAAa,GAAe;EAEpC,AADA,EAAU,CAAK,GACX,KAAU,EAAS,CAAK;CAC7B;CAEA,SAAS,GAAkB,GAAe;EASzC,AARI,EAAkB,CAAK,KAC1B,EAAkB,EAAE,GAChB,KAAU,EAAS,EAAE,MAEzB,EAAkB,CAAK,GACnB,KAAU,EAAS,CAAK,IAGzB,KAAe,EAAW;CAC/B;CAEA,IAAM,IAAgB,EAAQ,QAAQ,MAGrC,GAFI,EAAM,YACN,CAAC,EAAM,gBACP,EAAO,MAAM,YAAY,CAAC,CAAC,SAAS,EAAO,YAAY,CAAC,EAE5D;CAED,OACC,kBAAC,GAAD;EACO;EACC;EACO;EACd,WAAW;EACG;EACO;EACR;YAEb,kBAAC,GAAD;GACuB;GACZ;GACD;GACE;GACA;GACD;GACJ;GACG;GACT,cAAc,CAAC,CAAC;GAChB,IAAI;aAVL;IAYC,kBAAC,SAAD;KACC,KAAK;KACC;KACN,OAAO;KACP,MAAK;IACL,CAAA;IAED,kBAAC,GAAD;KAAwB;KAAU,MAAM;KAAQ,WAAU;IAAU,CAAA;IAEnE,KAAY,kBAAC,GAAD;KAAU,MAAM;KAAU,aAAa;IAAM,CAAA;IAE1D,kBAAC,GAAD;KAAqB;eAArB,CACE,MAAyB,MACzB,kBAAC,KAAD;MAAG,WAAU;gBAAY,GAAe,CAAoB;KAAK,CAAA,GAEjE,MAAyB,MAAM,kBAAC,KAAD,EAAA,UAAI,EAAe,CAAA,CACrC;;IAEf,kBAAC,GAAD;KACY;KACG;KACN;KACR,UAAU;eAJX,CAME,EAAc,KAAK,EAAE,UAAO,eAC5B,kBAAC,GAAD;MAEQ;MACA;MACD;MACa;MACA;KACnB,GANK,CAML,CACD,GAEA,EAAc,UAAU,KAAK,kBAAC,KAAD,EAAA,UAAI,EAAgB,CAAA,CAC3B;;IAExB,kBAAC,GAAD;KACW;KACC;KACD;KACA;KACC;IACX,CAAA;IAED,kBAAC,IAAD;KAAyB;KAAqB;IAAY,CAAA;IAC1D,kBAAC,IAAD;KAA2B;KAAuB;IAAY,CAAA;GAC9C;;CACH,CAAA;AAEjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/slider/index.tsx"],"sourcesContent":["import {\n\ttype HTMLAttributes,\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport \"./styles.css\";\n\ntype SliderProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> & {\n\t/** Current slider position as a percentage (0–100). Required. */\n\tvalue: number;\n\t/** Callback fired whenever the value changes. Required. */\n\tonChange: (value: number) => void;\n\t/** Disables all drag and click interactions. @default false */\n\tdisabled?: boolean;\n\t/** Callback fired when the dragging state changes (`true` = drag started, `false` = drag ended). */\n\tonDragging?: (isDragging: boolean) => void;\n};\n\n/**\n * Slider
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/slider/index.tsx"],"sourcesContent":["import {\n\ttype HTMLAttributes,\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport \"./styles.css\";\n\ntype SliderProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> & {\n\t/** Current slider position as a percentage (0–100). Required. */\n\tvalue: number;\n\t/** Callback fired whenever the value changes. Required. */\n\tonChange: (value: number) => void;\n\t/** Disables all drag and click interactions. @default false */\n\tdisabled?: boolean;\n\t/** Callback fired when the dragging state changes (`true` = drag started, `false` = drag ended). */\n\tonDragging?: (isDragging: boolean) => void;\n};\n\n/**\n * Slider, interactive track for selecting a numeric value between 0 and 100.\n *\n * Pair with `useSlider` for managed state.\n *\n * @param props.value - Current position as a percentage (0–100). Required.\n * @param props.onChange - Callback fired on value change. Required.\n * @param props.disabled - Disables interactions. Default: false\n * @param props.onDragging - Callback fired when dragging starts or stops.\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Slider JSX element.\n *\n * @example\n * ```tsx\n * // Controlled slider\n * const [value, setValue] = useState(50);\n * <Slider value={value} onChange={setValue} />\n *\n * // With useSlider hook\n * const [value, setValue] = useSlider(25);\n * <Slider value={value} onChange={setValue} onDragging={setIsDragging} />\n *\n * // Disabled\n * <Slider value={75} onChange={() => {}} disabled />\n * ```\n */\n\nfunction Slider(props: SliderProps) {\n\tconst {\n\t\tonChange,\n\t\tvalue,\n\t\tdisabled = false,\n\t\tonDragging,\n\t\tclassName = \"\",\n\t\t...rest\n\t} = props;\n\n\tconst [isDragging, setIsDragging] = useState(false);\n\tconst sliderRef = useRef<HTMLDivElement>(null);\n\n\tconst handleMouseDown = () => setIsDragging(true);\n\tconst handleMouseUp = useCallback(() => setIsDragging(false), []);\n\n\tconst handleMouseMove = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (disabled) return;\n\t\t\tif (!isDragging || !sliderRef.current) return;\n\n\t\t\tconst rect = sliderRef.current.getBoundingClientRect();\n\t\t\tconst offsetX = event.clientX - rect.left;\n\t\t\tconst newValue = Math.min(Math.max((offsetX / rect.width) * 100, 0), 100);\n\n\t\t\tonChange(newValue);\n\t\t},\n\t\t[disabled, isDragging, onChange],\n\t);\n\n\tconst handleSliderClick = (event: React.MouseEvent<HTMLDivElement>) => {\n\t\tif (disabled) return;\n\t\tif (!sliderRef.current) return;\n\n\t\tconst rect = sliderRef.current.getBoundingClientRect();\n\t\tconst offsetX = event.clientX - rect.left;\n\t\tconst newValue = Math.min(Math.max((offsetX / rect.width) * 100, 0), 100);\n\n\t\tonChange(newValue);\n\t};\n\n\tuseEffect(() => {\n\t\tif (isDragging) {\n\t\t\tonDragging?.(true);\n\t\t\tdocument.addEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.addEventListener(\"mouseup\", handleMouseUp);\n\t\t} else {\n\t\t\tonDragging?.(false);\n\t\t\tdocument.removeEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.removeEventListener(\"mouseup\", handleMouseUp);\n\t\t}\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.removeEventListener(\"mouseup\", handleMouseUp);\n\t\t};\n\t}, [isDragging, onDragging, handleMouseUp, handleMouseMove]);\n\n\tconst isDraggingClass = isDragging ? \"isDragging\" : \"isNotDragging\";\n\tconst disabledClass = disabled ? \"isDisabled\" : \"isEnabled\";\n\tconst sliderClassname = `arkynSliderTrack ${isDraggingClass} ${disabledClass} ${className}`;\n\n\treturn (\n\t\t<div\n\t\t\t{...rest}\n\t\t\tclassName={sliderClassname}\n\t\t\tonMouseDown={handleMouseDown}\n\t\t\tonClick={handleSliderClick}\n\t\t\tref={sliderRef}\n\t\t>\n\t\t\t<div className=\"arkynSliderFill\" style={{ width: `${value}%` }} />\n\t\t\t<div className=\"arkynSliderThumb\" style={{ left: `${value}%` }} />\n\t\t</div>\n\t);\n}\n\nexport { Slider };\n"],"mappings":";;;;AAkDA,SAAS,EAAO,GAAoB;CACnC,IAAM,EACL,aACA,UACA,cAAW,IACX,eACA,eAAY,IACZ,GAAG,MACA,GAEE,CAAC,GAAY,KAAiB,EAAS,EAAK,GAC5C,IAAY,EAAuB,IAAI,GAEvC,UAAwB,EAAc,EAAI,GAC1C,IAAgB,QAAkB,EAAc,EAAK,GAAG,CAAC,CAAC,GAE1D,IAAkB,GACtB,MAAsB;EAEtB,IADI,KACA,CAAC,KAAc,CAAC,EAAU,SAAS;EAEvC,IAAM,IAAO,EAAU,QAAQ,sBAAsB,GAC/C,IAAU,EAAM,UAAU,EAAK;EAGrC,EAFiB,KAAK,IAAI,KAAK,IAAK,IAAU,EAAK,QAAS,KAAK,CAAC,GAAG,GAE5D,CAAQ;CAClB,GACA;EAAC;EAAU;EAAY;CAAQ,CAChC,GAEM,KAAqB,MAA4C;EAEtE,IADI,KACA,CAAC,EAAU,SAAS;EAExB,IAAM,IAAO,EAAU,QAAQ,sBAAsB,GAC/C,IAAU,EAAM,UAAU,EAAK;EAGrC,EAFiB,KAAK,IAAI,KAAK,IAAK,IAAU,EAAK,QAAS,KAAK,CAAC,GAAG,GAE5D,CAAQ;CAClB;CAEA,SACK,KACH,IAAa,EAAI,GACjB,SAAS,iBAAiB,aAAa,CAAe,GACtD,SAAS,iBAAiB,WAAW,CAAa,MAElD,IAAa,EAAK,GAClB,SAAS,oBAAoB,aAAa,CAAe,GACzD,SAAS,oBAAoB,WAAW,CAAa,UAGzC;EAEZ,AADA,SAAS,oBAAoB,aAAa,CAAe,GACzD,SAAS,oBAAoB,WAAW,CAAa;CACtD,IACE;EAAC;EAAY;EAAY;EAAe;CAAe,CAAC;CAI3D,IAAM,IAAkB,oBAFA,IAAa,eAAe,gBAEQ,GADtC,IAAW,eAAe,YAC6B,GAAG;CAEhF,OACC,kBAAC,OAAD;EACC,GAAI;EACJ,WAAW;EACX,aAAa;EACb,SAAS;EACT,KAAK;YALN,CAOC,kBAAC,OAAD;GAAK,WAAU;GAAkB,OAAO,EAAE,OAAO,GAAG,EAAM,GAAG;EAAI,CAAA,GACjE,kBAAC,OAAD;GAAK,WAAU;GAAmB,OAAO,EAAE,MAAM,GAAG,EAAM,GAAG;EAAI,CAAA,CAC7D;;AAEP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/switch/index.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from \"react\";\nimport { useId, useRef, useState } from \"react\";\n\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport \"./styles.css\";\n\ntype SwitchProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"onChange\" | \"defaultValue\" | \"onCheck\" | \"value\"\n> & {\n\t/** Optional label text displayed beside the switch. */\n\tlabel?: string;\n\t/**\n\t * Switch size.\n\t * @default \"lg\"\n\t */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n\t/** Uncontrolled initial checked state. @default false */\n\tdefaultChecked?: boolean;\n\t/** Controlled checked state. */\n\tchecked?: boolean;\n\t/** Value emitted when the switch is on. @default \"checked\" */\n\tvalue?: string;\n\t/** Value emitted when the switch is off. @default \"\" */\n\tunCheckedValue?: string;\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Callback fired on toggle
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/switch/index.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from \"react\";\nimport { useId, useRef, useState } from \"react\";\n\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport \"./styles.css\";\n\ntype SwitchProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"onChange\" | \"defaultValue\" | \"onCheck\" | \"value\"\n> & {\n\t/** Optional label text displayed beside the switch. */\n\tlabel?: string;\n\t/**\n\t * Switch size.\n\t * @default \"lg\"\n\t */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n\t/** Uncontrolled initial checked state. @default false */\n\tdefaultChecked?: boolean;\n\t/** Controlled checked state. */\n\tchecked?: boolean;\n\t/** Value emitted when the switch is on. @default \"checked\" */\n\tvalue?: string;\n\t/** Value emitted when the switch is off. @default \"\" */\n\tunCheckedValue?: string;\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Callback fired on toggle, receives the current value string. */\n\tonCheck?: (value: string) => void;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontalReverse\"\n\t */\n\torientation?: \"vertical\" | \"horizontal\" | \"horizontalReverse\";\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Validation error message displayed below the switch. */\n\terrorMessage?: string;\n};\n\n/**\n * Switch, toggle input for binary on/off states.\n *\n * Stores value in a hidden `<input>` for native form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed beside the switch.\n * @param props.size - Switch size (`sm` | `md` | `lg`). Default: \"lg\"\n * @param props.defaultChecked - Uncontrolled initial checked state. Default: false\n * @param props.checked - Controlled checked state.\n * @param props.value - Value emitted when on. Default: \"checked\"\n * @param props.unCheckedValue - Value emitted when off. Default: \"\"\n * @param props.onCheck - Callback fired on toggle, receives the current value string.\n * @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: \"horizontalReverse\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.errorMessage - Validation error message.\n *\n * **...Other valid HTML properties for `<button>` (except `children`, `onChange`, `defaultValue`)**\n *\n * @returns Switch JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Switch name=\"notifications\" label=\"Enable notifications\" />\n *\n * // Custom on/off values\n * <Switch\n * name=\"theme\"\n * label=\"Dark mode\"\n * value=\"dark\"\n * unCheckedValue=\"light\"\n * onCheck={(v) => setTheme(v)}\n * />\n *\n * // Controlled\n * <Switch\n * name=\"autoSave\"\n * label=\"Auto-save\"\n * checked={isAutoSaveEnabled}\n * onCheck={(v) => setAutoSave(!!v)}\n * size=\"md\"\n * />\n * ```\n */\n\nfunction Switch(props: SwitchProps) {\n\tconst {\n\t\tlabel,\n\t\tsize = \"lg\",\n\t\tdefaultChecked = false,\n\t\tchecked: baseChecked = null,\n\t\tvalue,\n\t\tunCheckedValue = \"\",\n\t\tname,\n\t\tclassName: baseClassName = \"\",\n\t\tonCheck,\n\t\tid,\n\t\torientation = \"horizontalReverse\",\n\t\tclassName: wrapperClassName = \"\",\n\t\tshowAsterisk,\n\t\terrorMessage,\n\t\tunShowFieldTemplate = false,\n\t\t...rest\n\t} = props;\n\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst [isChecked, setIsChecked] = useState(defaultChecked);\n\n\tconst currentChecked =\n\t\ttypeof baseChecked === \"boolean\" ? baseChecked : isChecked;\n\n\tfunction handleCheck() {\n\t\tsetIsChecked(!isChecked);\n\t\tonCheck?.(!currentChecked ? value || \"checked\" : unCheckedValue);\n\t}\n\n\tconst checkedClass = currentChecked ? \"checkedTrue\" : \"checkedFalse\";\n\tconst className = `arkynSwitch ${checkedClass} ${size} ${baseClassName}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tonClick={handleCheck}\n\t\t\t\tclassName={className}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tid={inputId}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\tonClick={handleCheck}\n\t\t\t\t\tvalue={currentChecked ? value || \"checked\" : unCheckedValue}\n\t\t\t\t/>\n\t\t\t</button>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Switch };\n"],"mappings":";;;;;AA0FA,SAAS,EAAO,GAAoB;CACnC,IAAM,EACL,UACA,UAAO,MACP,oBAAiB,IACjB,SAAS,IAAc,MACvB,UACA,oBAAiB,IACjB,SACA,WAAW,IAAgB,IAC3B,YACA,OACA,iBAAc,qBACd,WAAW,IAAmB,IAC9B,iBACA,iBACA,yBAAsB,IACtB,GAAG,MACA,GAEE,IAAW,EAAyB,IAAI,GACxC,IAAc,EAAM,GACpB,IAAU,KAAM,GAEhB,CAAC,GAAW,KAAgB,EAAS,CAAc,GAEnD,IACL,OAAO,KAAgB,YAAY,IAAc;CAElD,SAAS,IAAc;EAEtB,AADA,EAAa,CAAC,CAAS,GACvB,IAAW,IAAsC,IAArB,KAAS,SAA0B;CAChE;CAKA,OACC,kBAAC,GAAD;EACO;EACC;EACO;EACd,WAAW;EACG;EACO;EACR;YAEb,kBAAC,UAAD;GACC,MAAK;GACL,SAAS;GACE,WAAA,eAhBO,IAAiB,gBAAgB,eACR,GAAG,EAAK,GAAG;GAgBtD,GAAI;aAEJ,kBAAC,SAAD;IACC,IAAI;IACJ,MAAK;IACC;IACN,KAAK;IACL,SAAS;IACT,OAAO,IAAiB,KAAS,YAAY;GAC7C,CAAA;EACM,CAAA;CACM,CAAA;AAEjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/tab/tabButton/index.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes, MouseEvent, ReactNode } from \"react\";\n\nimport { useTab } from \"../tabContext\";\nimport \"./styles.css\";\n\ntype TabButtonProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"value\" | \"type\"\n> & {\n\t/** Content displayed inside the tab button. */\n\tchildren: ReactNode;\n\t/** Unique identifier for this tab; matched against the container's active value. */\n\tvalue: string;\n};\n\n/**\n * TabButton
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/tab/tabButton/index.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes, MouseEvent, ReactNode } from \"react\";\n\nimport { useTab } from \"../tabContext\";\nimport \"./styles.css\";\n\ntype TabButtonProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"value\" | \"type\"\n> & {\n\t/** Content displayed inside the tab button. */\n\tchildren: ReactNode;\n\t/** Unique identifier for this tab; matched against the container's active value. */\n\tvalue: string;\n};\n\n/**\n * TabButton, individual tab button inside a `TabContainer`.\n *\n * Reads active state and disabled state from `TabContainer` context.\n * The button's own `disabled` prop is ORed with the container's `disabled`.\n *\n * @param props.children - Tab label content. Required.\n * @param props.value - Tab identifier. Required.\n * @param props.disabled - Disables this tab individually (container can also disable all tabs).\n *\n * **...Other valid HTML `<button>` properties except `type`**\n *\n * @returns TabButton JSX element.\n *\n * @example\n * ```tsx\n * <TabContainer defaultValue=\"overview\" onChange={setTab}>\n * <TabButton value=\"overview\">Overview</TabButton>\n * <TabButton value=\"activity\">Activity</TabButton>\n * <TabButton value=\"settings\" disabled>Settings</TabButton>\n * </TabContainer>\n * ```\n */\n\nfunction TabButton(props: TabButtonProps) {\n\tconst {\n\t\tchildren,\n\t\tdisabled: rawDisabled = false,\n\t\tclassName: baseClassName = \"\",\n\t\tonClick,\n\t\tvalue,\n\t\t...rest\n\t} = props;\n\n\tconst { disabled, currentTab, changeCurrentTab } = useTab();\n\n\tconst isDisabled = disabled || rawDisabled;\n\n\tconst disabledClass = isDisabled ? \"isDisabled\" : \"\";\n\tconst activeClass = currentTab === value && value ? \"isActive\" : \"\";\n\tconst className = `arkynTabButton ${disabledClass} ${activeClass} ${baseClassName}`;\n\n\tfunction handleClick(event: MouseEvent<HTMLButtonElement>) {\n\t\tchangeCurrentTab(value);\n\t\tonClick?.(event);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\tonClick={handleClick}\n\t\t\tclassName={className.trim()}\n\t\t\t{...rest}\n\t\t\tdisabled={isDisabled}\n\t\t\ttype=\"button\"\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\nexport { TabButton };\n"],"mappings":";;;;AAuCA,SAAS,EAAU,GAAuB;CACzC,IAAM,EACL,aACA,UAAU,IAAc,IACxB,WAAW,IAAgB,IAC3B,YACA,UACA,GAAG,MACA,GAEE,EAAE,aAAU,eAAY,wBAAqB,EAAO,GAEpD,IAAa,KAAY,GAIzB,IAAY,kBAFI,IAAa,eAAe,GAEA,GAD9B,MAAe,KAAS,IAAQ,aAAa,GACA,GAAG;CAEpE,SAAS,EAAY,GAAsC;EAE1D,AADA,EAAiB,CAAK,GACtB,IAAU,CAAK;CAChB;CAEA,OACC,kBAAC,UAAD;EACC,SAAS;EACT,WAAW,EAAU,KAAK;EAC1B,GAAI;EACJ,UAAU;EACV,MAAK;EAEJ;CACM,CAAA;AAEV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/tab/tabContainer/index.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, useState } from \"react\";\n\nimport { TabProvider } from \"../tabContext\";\nimport \"./styles.css\";\n\ntype TabContainerProps = Omit<\n\tHTMLAttributes<HTMLElement>,\n\t\"onChange\" | \"children\" | \"ref\" | \"onClick\"\n> & {\n\t/** `TabButton` components to render as tabs. Required. */\n\tchildren: ReactNode;\n\t/** Disables all tab buttons at once. @default false */\n\tdisabled?: boolean;\n\t/** Initially selected tab value. */\n\tdefaultValue?: string;\n\t/** Callback fired when the active tab changes, receiving the new value. */\n\tonChange?: (index: string) => void;\n};\n\n/**\n * TabContainer
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/tab/tabContainer/index.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, useState } from \"react\";\n\nimport { TabProvider } from \"../tabContext\";\nimport \"./styles.css\";\n\ntype TabContainerProps = Omit<\n\tHTMLAttributes<HTMLElement>,\n\t\"onChange\" | \"children\" | \"ref\" | \"onClick\"\n> & {\n\t/** `TabButton` components to render as tabs. Required. */\n\tchildren: ReactNode;\n\t/** Disables all tab buttons at once. @default false */\n\tdisabled?: boolean;\n\t/** Initially selected tab value. */\n\tdefaultValue?: string;\n\t/** Callback fired when the active tab changes, receiving the new value. */\n\tonChange?: (index: string) => void;\n};\n\n/**\n * TabContainer, wrapper that manages active state for a group of `TabButton` components.\n *\n * Renders as a `<nav>` element. Provides context consumed by each `TabButton`.\n *\n * @param props.children - `TabButton` elements. Required.\n * @param props.defaultValue - Initially selected tab value.\n * @param props.disabled - Disables all buttons. Default: false\n * @param props.onChange - Called with the new value whenever the active tab changes.\n *\n * **...Other valid HTML `<nav>` properties**\n *\n * @returns TabContainer JSX element.\n *\n * @example\n * ```tsx\n * <TabContainer defaultValue=\"overview\" onChange={setActiveTab}>\n * <TabButton value=\"overview\">Overview</TabButton>\n * <TabButton value=\"analytics\">Analytics</TabButton>\n * <TabButton value=\"settings\">Settings</TabButton>\n * </TabContainer>\n *\n * {activeTab === 'overview' && <OverviewPanel />}\n * {activeTab === 'analytics' && <AnalyticsPanel />}\n * ```\n */\n\nfunction TabContainer(props: TabContainerProps) {\n\tconst {\n\t\tchildren,\n\t\tonChange,\n\t\tdefaultValue,\n\t\tdisabled = false,\n\t\tclassName: baseClassName,\n\t\t...rest\n\t} = props;\n\n\tconst [currentTab, setCurrentTab] = useState(defaultValue || \"\");\n\n\tconst className = `arkynTabContainer ${baseClassName || \"\"}`;\n\n\tfunction changeCurrentTab(value: string) {\n\t\tsetCurrentTab(value);\n\t\tif (onChange) onChange(value);\n\t}\n\n\treturn (\n\t\t<TabProvider\n\t\t\tdisabled={disabled}\n\t\t\tcurrentTab={currentTab}\n\t\t\tchangeCurrentTab={changeCurrentTab}\n\t\t>\n\t\t\t<nav className={className.trim()} {...rest}>\n\t\t\t\t{children}\n\t\t\t</nav>\n\t\t</TabProvider>\n\t);\n}\n\nexport { TabContainer };\n"],"mappings":";;;;;AA8CA,SAAS,EAAa,GAA0B;CAC/C,IAAM,EACL,aACA,aACA,iBACA,cAAW,IACX,WAAW,GACX,GAAG,MACA,GAEE,CAAC,GAAY,KAAiB,EAAS,KAAgB,EAAE,GAEzD,IAAY,qBAAqB,KAAiB;CAExD,SAAS,EAAiB,GAAe;EAExC,AADA,EAAc,CAAK,GACf,KAAU,EAAS,CAAK;CAC7B;CAEA,OACC,kBAAC,GAAD;EACW;EACE;EACM;YAElB,kBAAC,OAAD;GAAK,WAAW,EAAU,KAAK;GAAG,GAAI;GACpC;EACG,CAAA;CACO,CAAA;AAEf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableBody/index.tsx"],"sourcesContent":["import { Children, type HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableBodyProps = HTMLAttributes<HTMLTableSectionElement> & {\n\t/** Text displayed in a full-width row when no children are present. @default \"Nenhum dado adicionado.\" */\n\temptyMessage?: string;\n};\n\n/**\n * TableBody
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableBody/index.tsx"],"sourcesContent":["import { Children, type HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableBodyProps = HTMLAttributes<HTMLTableSectionElement> & {\n\t/** Text displayed in a full-width row when no children are present. @default \"Nenhum dado adicionado.\" */\n\temptyMessage?: string;\n};\n\n/**\n * TableBody, `<tbody>` section with built-in empty state handling.\n *\n * When `children` is empty, renders a full-width row with `emptyMessage`.\n * Accepts all standard HTML `<tbody>` attributes.\n *\n * @param props.emptyMessage - Empty state text. Default: `\"Nenhum dado adicionado.\"`\n *\n * **...Other valid HTML `<tbody>` properties**\n *\n * @returns TableBody JSX element.\n *\n * @example\n * ```tsx\n * <TableBody emptyMessage=\"No orders found\">\n * {orders.map(o => (\n * <tr key={o.id}>\n * <td>{o.number}</td>\n * <td>{o.status}</td>\n * </tr>\n * ))}\n * </TableBody>\n * ```\n */\n\nfunction TableBody(props: TableBodyProps) {\n\tconst {\n\t\temptyMessage = \"Nenhum dado adicionado.\",\n\t\tclassName: baseClassName,\n\t\tchildren,\n\t\t...rest\n\t} = props;\n\n\tconst className = `arkynTableBody ${baseClassName}`;\n\tconst childArray = Children.toArray(children).filter(Boolean);\n\tconst isEmpty = childArray.length === 0;\n\n\treturn (\n\t\t<tbody className={className.trim()} {...rest}>\n\t\t\t{isEmpty ? (\n\t\t\t\t<tr className=\"arkynTableBodyEmptyLine\">\n\t\t\t\t\t<td colSpan={100}>\n\t\t\t\t\t\t<div>{emptyMessage}</div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t) : (\n\t\t\t\tchildArray\n\t\t\t)}\n\t\t</tbody>\n\t);\n}\n\nexport { TableBody };\n"],"mappings":";;;;AAiCA,SAAS,EAAU,GAAuB;CACzC,IAAM,EACL,kBAAe,2BACf,WAAW,GACX,aACA,GAAG,MACA,GAEE,IAAY,kBAAkB,KAC9B,IAAa,EAAS,QAAQ,CAAQ,CAAC,CAAC,OAAO,OAAO,GACtD,IAAU,EAAW,WAAW;CAEtC,OACC,kBAAC,SAAD;EAAO,WAAW,EAAU,KAAK;EAAG,GAAI;YACtC,IACA,kBAAC,MAAD;GAAI,WAAU;aACb,kBAAC,MAAD;IAAI,SAAS;cACZ,kBAAC,OAAD,EAAA,UAAM,EAAkB,CAAA;GACrB,CAAA;EACD,CAAA,IAEJ;CAEK,CAAA;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableCaption/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableCaptionProps = HTMLAttributes<HTMLElement>;\n\n/**\n * TableCaption
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableCaption/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableCaptionProps = HTMLAttributes<HTMLElement>;\n\n/**\n * TableCaption, title / description placed above a table. Renders as a `<caption>` element.\n *\n * Accepts all standard HTML element attributes.\n *\n * @returns TableCaption JSX element.\n *\n * @example\n * ```tsx\n * <TableContainer>\n * <TableCaption>Orders, Q2 2025</TableCaption>\n * <TableHeader>...</TableHeader>\n * <TableBody>...</TableBody>\n * </TableContainer>\n * ```\n */\n\nfunction TableCaption(props: TableCaptionProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableCaption ${baseClassName}`;\n\n\treturn (\n\t\t<caption className={className.trim()} {...rest}>\n\t\t\t<div className=\"arkynTableCaptionContent\">{children}</div>\n\t\t</caption>\n\t);\n}\n\nexport { TableCaption };\n"],"mappings":";;;AAsBA,SAAS,EAAa,GAA0B;CAC/C,IAAM,EAAE,WAAW,GAAe,aAAU,GAAG,MAAS;CAGxD,OACC,kBAAC,WAAD;EAAS,WAAW,qBAHkB,IAGR,KAAK;EAAG,GAAI;YACzC,kBAAC,OAAD;GAAK,WAAU;GAA4B;EAAc,CAAA;CACjD,CAAA;AAEX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableContainer/index.tsx"],"sourcesContent":["import type { TableHTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableContainerProps = TableHTMLAttributes<HTMLTableElement>;\n\n/**\n * TableContainer
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableContainer/index.tsx"],"sourcesContent":["import type { TableHTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableContainerProps = TableHTMLAttributes<HTMLTableElement>;\n\n/**\n * TableContainer, root wrapper for the Table component set. Renders a responsive scrollable container around a `<table>`.\n *\n * Accepts all standard HTML `<table>` attributes.\n *\n * @returns TableContainer JSX element.\n *\n * @example\n * ```tsx\n * <TableContainer>\n * <TableCaption>Users</TableCaption>\n * <TableHeader>\n * <th>Name</th>\n * <th>Email</th>\n * <th>Status</th>\n * </TableHeader>\n * <TableBody emptyMessage=\"No users found\">\n * {users.map(u => (\n * <tr key={u.id}>\n * <td>{u.name}</td>\n * <td>{u.email}</td>\n * <td>{u.status}</td>\n * </tr>\n * ))}\n * </TableBody>\n * <TableFooter><Pagination /></TableFooter>\n * </TableContainer>\n * ```\n */\n\nfunction TableContainer(props: TableContainerProps) {\n\tconst { children, className: baseClassName, ...rest } = props;\n\tconst className = `arkynTableContainer ${baseClassName}`;\n\n\treturn (\n\t\t<div className={className.trim()} {...rest}>\n\t\t\t<table>{children}</table>\n\t\t</div>\n\t);\n}\n\nexport { TableContainer };\n"],"mappings":";;;AAmCA,SAAS,EAAe,GAA4B;CACnD,IAAM,EAAE,aAAU,WAAW,GAAe,GAAG,MAAS;CAGxD,OACC,kBAAC,OAAD;EAAK,WAAW,uBAHwB,IAGd,KAAK;EAAG,GAAI;YACrC,kBAAC,SAAD,EAAQ,YAAgB,CAAA;CACpB,CAAA;AAEP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableFooter/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableFooterProps = HTMLAttributes<HTMLTableSectionElement>;\n\n/**\n * TableFooter
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableFooter/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableFooterProps = HTMLAttributes<HTMLTableSectionElement>;\n\n/**\n * TableFooter, `<tfoot>` section with an automatic spacing row above the content.\n *\n * Children span all columns via `colSpan={100}`. Commonly used for `Pagination`.\n * Accepts all standard HTML `<tfoot>` attributes.\n *\n * @returns TableFooter JSX element.\n *\n * @example\n * ```tsx\n * <TableFooter>\n * <Pagination currentPage={page} totalPages={totalPages} onChange={setPage} />\n * </TableFooter>\n * ```\n */\n\nfunction TableFooter(props: TableFooterProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableFooter ${baseClassName}`;\n\n\treturn (\n\t\t<tfoot className={className.trim()} {...rest}>\n\t\t\t<tr className=\"spacingRow\" />\n\t\t\t<tr>\n\t\t\t\t<th colSpan={100}>\n\t\t\t\t\t<div className=\"arkynTableFooterContent\">{children}</div>\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t</tfoot>\n\t);\n}\n\nexport { TableFooter };\n"],"mappings":";;;AAqBA,SAAS,EAAY,GAAyB;CAC7C,IAAM,EAAE,WAAW,GAAe,aAAU,GAAG,MAAS;CAGxD,OACC,kBAAC,SAAD;EAAO,WAAW,oBAHmB,IAGT,KAAK;EAAG,GAAI;YAAxC,CACC,kBAAC,MAAD,EAAI,WAAU,aAAc,CAAA,GAC5B,kBAAC,MAAD,EAAA,UACC,kBAAC,MAAD;GAAI,SAAS;aACZ,kBAAC,OAAD;IAAK,WAAU;IAA2B;GAAc,CAAA;EACrD,CAAA,EACD,CAAA,CACE;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableHeader/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableHeaderProps = HTMLAttributes<HTMLTableSectionElement>;\n\n/**\n * TableHeader
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/table/tableHeader/index.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableHeaderProps = HTMLAttributes<HTMLTableSectionElement>;\n\n/**\n * TableHeader, `<thead>` section with an automatic spacing row below the header row.\n *\n * Pass `<th>` elements as children, they are wrapped in a `<tr>` automatically.\n * Accepts all standard HTML `<thead>` attributes.\n *\n * @returns TableHeader JSX element.\n *\n * @example\n * ```tsx\n * <TableHeader>\n * <th>Name</th>\n * <th>Email</th>\n * <th>Actions</th>\n * </TableHeader>\n * ```\n */\n\nfunction TableHeader(props: TableHeaderProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableHeader ${baseClassName}`;\n\n\treturn (\n\t\t<thead className={className.trim()} {...rest}>\n\t\t\t<tr>{children}</tr>\n\t\t\t<tr className=\"spacingRow\" />\n\t\t</thead>\n\t);\n}\n\nexport { TableHeader };\n"],"mappings":";;;AAuBA,SAAS,EAAY,GAAyB;CAC7C,IAAM,EAAE,WAAW,GAAe,aAAU,GAAG,MAAS;CAGxD,OACC,kBAAC,SAAD;EAAO,WAAW,oBAHmB,IAGT,KAAK;EAAG,GAAI;YAAxC,CACC,kBAAC,MAAD,EAAK,YAAa,CAAA,GAClB,kBAAC,MAAD,EAAI,WAAU,aAAc,CAAA,CACtB;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/textarea/index.tsx"],"sourcesContent":["import {\n\ttype FocusEvent,\n\ttype TextareaHTMLAttributes,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldError } from \"../fieldError\";\nimport { FieldLabel } from \"../fieldLabel\";\nimport { FieldWrapper } from \"../fieldWrapper\";\nimport \"./styles.css\";\n\ntype TextareaProps = Omit<\n\tTextareaHTMLAttributes<HTMLTextAreaElement>,\n\t\"name\" | \"value\" | \"defaultValue\"\n> & {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Optional label text displayed above the textarea. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Validation error message displayed below the textarea. */\n\terrorMessage?: string;\n\t/**\n\t * Textarea size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\";\n\t/** Controlled value. */\n\tvalue?: string;\n\t/** Uncontrolled default value. */\n\tdefaultValue?: string;\n};\n\n/**\n * Textarea
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/textarea/index.tsx"],"sourcesContent":["import {\n\ttype FocusEvent,\n\ttype TextareaHTMLAttributes,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldError } from \"../fieldError\";\nimport { FieldLabel } from \"../fieldLabel\";\nimport { FieldWrapper } from \"../fieldWrapper\";\nimport \"./styles.css\";\n\ntype TextareaProps = Omit<\n\tTextareaHTMLAttributes<HTMLTextAreaElement>,\n\t\"name\" | \"value\" | \"defaultValue\"\n> & {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Optional label text displayed above the textarea. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Validation error message displayed below the textarea. */\n\terrorMessage?: string;\n\t/**\n\t * Textarea size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\";\n\t/** Controlled value. */\n\tvalue?: string;\n\t/** Uncontrolled default value. */\n\tdefaultValue?: string;\n};\n\n/**\n * Textarea, multi-line text input with label, validation, and form integration.\n *\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed above the textarea.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.errorMessage - Validation error message.\n * @param props.size - Textarea size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n *\n * **...Other valid HTML properties for `<textarea>`**\n *\n * @returns Textarea JSX element wrapped in `FieldWrapper`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Textarea name=\"description\" placeholder=\"Enter description...\" />\n *\n * // With label and validation\n * <Textarea\n * name=\"bio\"\n * label=\"Biography\"\n * showAsterisk\n * placeholder=\"Tell us about yourself\"\n * errorMessage=\"Biography is required\"\n * />\n *\n * // Controlled with custom rows\n * <Textarea\n * name=\"message\"\n * label=\"Message\"\n * value={message}\n * onChange={(e) => setMessage(e.target.value)}\n * rows={5}\n * size=\"lg\"\n * variant=\"outline\"\n * />\n * ```\n */\n\nfunction Textarea(props: TextareaProps) {\n\tconst {\n\t\tvariant = \"solid\",\n\t\tsize = \"md\",\n\t\tclassName: wrapperClassName,\n\t\terrorMessage: baseErrorMessage,\n\t\tdisabled = false,\n\t\treadOnly = false,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tname,\n\t\tonFocus,\n\t\tonBlur,\n\t\ttitle,\n\t\tstyle,\n\t\tvalue,\n\t\tdefaultValue,\n\t\tplaceholder,\n\t\tid,\n\t\t...rest\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst textareaRef = useRef<HTMLTextAreaElement>(null);\n\tconst generatedId = useId();\n\tconst textareaId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\n\tconst errorClass = isError ? \"errorTrue\" : \"errorFalse\";\n\tconst opacityClass = disabled || readOnly ? \"opacityTrue\" : \"opacityFalse\";\n\tconst focusedClass = isFocused ? \"focusedTrue\" : \"focusedFalse\";\n\n\tconst className = `arkynTextarea ${variant} ${size} ${opacityClass} ${errorClass} ${focusedClass}`;\n\tconst domValue = disabled ? undefined : value;\n\n\tfunction handleSectionClick() {\n\t\tif (disabled || !textareaRef?.current) return;\n\t\tsetIsFocused(true);\n\t\ttextareaRef.current.focus();\n\t}\n\n\tfunction handleFocus(e: FocusEvent<HTMLTextAreaElement>) {\n\t\tsetIsFocused(true);\n\t\tif (onFocus) onFocus(e);\n\t}\n\n\tfunction handleBlur(e: FocusEvent<HTMLTextAreaElement>) {\n\t\tsetIsFocused(false);\n\t\tif (onBlur) onBlur(e);\n\t}\n\n\treturn (\n\t\t<FieldWrapper className={wrapperClassName}>\n\t\t\t{label && (\n\t\t\t\t<FieldLabel htmlFor={textareaId} showAsterisk={showAsterisk}>\n\t\t\t\t\t{label}\n\t\t\t\t</FieldLabel>\n\t\t\t)}\n\n\t\t\t<section\n\t\t\t\ttitle={title}\n\t\t\t\tstyle={style}\n\t\t\t\tonClick={handleSectionClick}\n\t\t\t\tclassName={className}\n\t\t\t>\n\t\t\t\t<textarea\n\t\t\t\t\tid={textareaId}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tref={textareaRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonFocus={handleFocus}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\tdefaultValue={domValue === undefined ? defaultValue || \"\" : undefined}\n\t\t\t\t\tplaceholder={disabled ? value || placeholder : placeholder}\n\t\t\t\t\tvalue={domValue}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t</section>\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { Textarea };\n"],"mappings":";;;;;;;;AAuFA,SAAS,EAAS,GAAsB;CACvC,IAAM,EACL,aAAU,SACV,UAAO,MACP,WAAW,GACX,cAAc,GACd,cAAW,IACX,cAAW,IACX,UACA,iBACA,SACA,YACA,WACA,UACA,UACA,UACA,iBACA,gBACA,OACA,GAAG,MACA,GAEE,EAAE,mBAAgB,EAAQ,GAC1B,CAAC,GAAW,KAAgB,EAAS,EAAK,GAC1C,IAAc,EAA4B,IAAI,GAC9C,IAAc,EAAM,GACpB,IAAa,KAAM,GAEnB,IAAe,KAAoB,IAAc,IAOjD,IAAY,iBAAiB,EAAQ,GAAG,EAAK,GAH9B,KAAY,IAAW,gBAAgB,eAGO,GANjD,IAEW,cAAc,aAIsC,GAF5D,IAAY,gBAAgB,kBAG3C,IAAW,IAAW,KAAA,IAAY;CAExC,SAAS,IAAqB;EACzB,KAAY,CAAC,GAAa,YAC9B,EAAa,EAAI,GACjB,EAAY,QAAQ,MAAM;CAC3B;CAEA,SAAS,EAAY,GAAoC;EAExD,AADA,EAAa,EAAI,GACb,KAAS,EAAQ,CAAC;CACvB;CAEA,SAAS,EAAW,GAAoC;EAEvD,AADA,EAAa,EAAK,GACd,KAAQ,EAAO,CAAC;CACrB;CAEA,OACC,kBAAC,GAAD;EAAc,WAAW;YAAzB;GACE,KACA,kBAAC,GAAD;IAAY,SAAS;IAA0B;cAC7C;GACU,CAAA;GAGb,kBAAC,WAAD;IACQ;IACA;IACP,SAAS;IACE;cAEX,kBAAC,YAAD;KACC,IAAI;KACM;KACA;KACV,KAAK;KACC;KACN,SAAS;KACT,QAAQ;KACR,cAAc,MAAa,KAAA,IAAY,KAAgB,KAAK,KAAA;KAC5D,aAAa,KAAW,KAAuB;KAC/C,OAAO;KACP,GAAI;IACJ,CAAA;GACO,CAAA;GACR,KAAgB,kBAAC,GAAD,EAAA,UAAa,EAAyB,CAAA;EAC1C;;AAEhB"}
|