@solibo/solibo-ui 0.4.1 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -13
- package/dist/assets/index.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index40.css +1 -1
- package/dist/assets/index44.css +1 -1
- package/dist/components/_card/index.cjs +1 -1
- package/dist/components/_card/index.js +18 -18
- package/dist/components/_collapsible/index.cjs +1 -1
- package/dist/components/_collapsible/index.js +1 -1
- package/dist/components/_dropdown/index.cjs +1 -1
- package/dist/components/_dropdown/index.js +2 -2
- package/dist/components/_dropzone/index.cjs +1 -1
- package/dist/components/_dropzone/index.js +15 -15
- package/dist/components/_portal/index.cjs +1 -1
- package/dist/components/_portal/index.js +2 -2
- package/dist/components/accordion/index.cjs +1 -1
- package/dist/components/accordion/index.cjs.map +1 -1
- package/dist/components/accordion/index.js +11 -17
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/aside/index.cjs +1 -1
- package/dist/components/aside/index.js +5 -5
- package/dist/components/branding/index.cjs +1 -1
- package/dist/components/branding/index.js +9 -9
- package/dist/components/button/index.cjs +1 -1
- package/dist/components/button/index.cjs.map +1 -1
- package/dist/components/button/index.js +22 -19
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/controls/index.cjs +1 -1
- package/dist/components/controls/index.cjs.map +1 -1
- package/dist/components/controls/index.js +7 -7
- package/dist/components/controls/index.js.map +1 -1
- package/dist/components/dialog/index.cjs +1 -1
- package/dist/components/dialog/index.cjs.map +1 -1
- package/dist/components/dialog/index.js +8 -8
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/file/index.cjs +1 -1
- package/dist/components/file/index.cjs.map +1 -1
- package/dist/components/file/index.js +18 -17
- package/dist/components/file/index.js.map +1 -1
- package/dist/components/group/index.cjs +1 -1
- package/dist/components/group/index.cjs.map +1 -1
- package/dist/components/group/index.js +4 -4
- package/dist/components/group/index.js.map +1 -1
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.cjs.map +1 -1
- package/dist/components/input/index.js +22 -21
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/list/index.cjs +1 -1
- package/dist/components/list/index.js +11 -11
- package/dist/components/nav/index.cjs +1 -1
- package/dist/components/nav/index.js +16 -16
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +2 -2
- package/dist/components/textarea/index.cjs +1 -1
- package/dist/components/textarea/index.cjs.map +1 -1
- package/dist/components/textarea/index.js +1 -1
- package/dist/components/textarea/index.js.map +1 -1
- package/dist/components/toggle/index.cjs +1 -1
- package/dist/components/toggle/index.cjs.map +1 -1
- package/dist/components/toggle/index.js +17 -14
- package/dist/components/toggle/index.js.map +1 -1
- package/dist/components/toolbar/index.cjs +1 -1
- package/dist/components/toolbar/index.js +4 -4
- package/dist/{index-CfK1ATlt.cjs → index-D0Nzihh-.cjs} +2 -2
- package/dist/{index-CfK1ATlt.cjs.map → index-D0Nzihh-.cjs.map} +1 -1
- package/dist/{index-C_OgUYu-.js → index-s_TTRzH8.js} +2 -2
- package/dist/{index-C_OgUYu-.js.map → index-s_TTRzH8.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +26 -29
- package/dist/index.js +1 -1
- package/dist/tokens.css +207 -72
- package/dist/tokens.json +2130 -231
- package/dist/utils--n2yqjCy.js +45 -0
- package/dist/utils--n2yqjCy.js.map +1 -0
- package/dist/utils-DBzf7CFq.cjs +2 -0
- package/dist/utils-DBzf7CFq.cjs.map +1 -0
- package/package.json +2 -1
- package/dist/utils-BFlnRYx7.js +0 -34
- package/dist/utils-BFlnRYx7.js.map +0 -1
- package/dist/utils-DqVa4K58.cjs +0 -2
- package/dist/utils-DqVa4K58.cjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index12.css');const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index12.css');const r=require("react/jsx-runtime"),n=require("../../helpers-fOobx0tS.cjs"),o="_controls_u02jm_15",a="_wrapper_u02jm_29",e={controls:o,wrapper:a},c=({children:s,...t})=>r.jsx(r.Fragment,{children:r.jsx("div",{className:e.wrapper,"data-wrapper":!0,children:r.jsx("div",{className:e.controls,children:r.jsx("menu",{"data-animation":"stagger",...t,children:n.wrapChildren(s)})})})});exports.Controls=c;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/controls/index.tsx"],"sourcesContent":["import { wrapChildren } from '@/lib/helpers';\n\nimport styles from './styles.module.css';\n\nexport type ControlsProps = React.ComponentPropsWithoutRef<'menu'> & {};\n\nexport const Controls = ({ children, ...props }: ControlsProps) => {\n return (\n <>\n <div
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/controls/index.tsx"],"sourcesContent":["import { wrapChildren } from '@/lib/helpers';\n\nimport styles from './styles.module.css';\n\nexport type ControlsProps = React.ComponentPropsWithoutRef<'menu'> & {};\n\nexport const Controls = ({ children, ...props }: ControlsProps) => {\n return (\n <>\n <div\n className={styles.wrapper}\n data-wrapper\n >\n <div className={styles.controls}>\n <menu\n data-animation='stagger'\n {...props}\n >\n {wrapChildren(children)}\n </menu>\n </div>\n </div>\n </>\n );\n};\n"],"names":["Controls","children","props","jsx","Fragment","styles","wrapper","controls","wrapChildren"],"mappings":"mOAMaA,EAAWA,CAAC,CAAEC,SAAAA,EAAU,GAAGC,CAAqB,IAEzDC,EAAAA,IAAAC,EAAAA,SAAA,CACE,SAAAD,EAAAA,IAAC,MAAA,CACC,UAAWE,EAAOC,QAClB,eAAY,GAEZ,SAAAH,EAAAA,IAAC,MAAA,CAAI,UAAWE,EAAOE,SACrB,SAAAJ,EAAAA,IAAC,OAAA,CACC,iBAAe,UACf,GAAID,EAEHM,wBAAaP,CAAQ,CAAA,CACxB,CAAA,CACF,CAAA,CACF,EACF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as r, Fragment as
|
|
2
|
-
import { w as
|
|
3
|
-
import '../../assets/index12.css';const
|
|
4
|
-
controls:
|
|
1
|
+
import { jsx as r, Fragment as e } from "react/jsx-runtime";
|
|
2
|
+
import { w as n } from "../../helpers-Dbey5Ztb.js";
|
|
3
|
+
import '../../assets/index12.css';const s = "_controls_u02jm_15", c = "_wrapper_u02jm_29", o = {
|
|
4
|
+
controls: s,
|
|
5
5
|
wrapper: c
|
|
6
6
|
}, i = ({
|
|
7
|
-
children:
|
|
8
|
-
...
|
|
9
|
-
}) => /* @__PURE__ */ r(
|
|
7
|
+
children: t,
|
|
8
|
+
...a
|
|
9
|
+
}) => /* @__PURE__ */ r(e, { children: /* @__PURE__ */ r("div", { className: o.wrapper, "data-wrapper": !0, children: /* @__PURE__ */ r("div", { className: o.controls, children: /* @__PURE__ */ r("menu", { "data-animation": "stagger", ...a, children: n(t) }) }) }) });
|
|
10
10
|
export {
|
|
11
11
|
i as Controls
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/controls/index.tsx"],"sourcesContent":["import { wrapChildren } from '@/lib/helpers';\n\nimport styles from './styles.module.css';\n\nexport type ControlsProps = React.ComponentPropsWithoutRef<'menu'> & {};\n\nexport const Controls = ({ children, ...props }: ControlsProps) => {\n return (\n <>\n <div
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/controls/index.tsx"],"sourcesContent":["import { wrapChildren } from '@/lib/helpers';\n\nimport styles from './styles.module.css';\n\nexport type ControlsProps = React.ComponentPropsWithoutRef<'menu'> & {};\n\nexport const Controls = ({ children, ...props }: ControlsProps) => {\n return (\n <>\n <div\n className={styles.wrapper}\n data-wrapper\n >\n <div className={styles.controls}>\n <menu\n data-animation='stagger'\n {...props}\n >\n {wrapChildren(children)}\n </menu>\n </div>\n </div>\n </>\n );\n};\n"],"names":["Controls","children","props","jsx","Fragment","styles","wrapper","controls","wrapChildren"],"mappings":";;;;;GAMaA,IAAWA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAU,GAAGC;AAAqB,MAEzD,gBAAAC,EAAAC,GAAA,EACE,UAAA,gBAAAD,EAAC,OAAA,EACC,WAAWE,EAAOC,SAClB,gBAAY,IAEZ,UAAA,gBAAAH,EAAC,OAAA,EAAI,WAAWE,EAAOE,UACrB,UAAA,gBAAAJ,EAAC,QAAA,EACC,kBAAe,WACf,GAAID,GAEHM,YAAaP,CAAQ,EAAA,CACxB,EAAA,CACF,EAAA,CACF,GACF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index11.css');const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index11.css');const o=require("react/jsx-runtime"),e="_dialog_1dwjg_1",d="_wrapper_1dwjg_32",r={dialog:e,wrapper:d},s=({children:i,setOpen:a,...l})=>o.jsx("div",{className:r.wrapper,"data-wrapper":!0,onClick:()=>a==null?void 0:a(!1),"data-component":"dialog",children:o.jsx("dialog",{className:r.dialog,onClick:t=>t.stopPropagation(),...l,children:i})});exports.Dialog=s;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/dialog/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport styles from './styles.module.css';\n\nexport type DialogProps = React.DialogHTMLAttributes<HTMLDialogElement> & {\n children: React.ReactNode;\n setOpen?: React.Dispatch<React.SetStateAction<boolean>>;\n};\n\nexport const Dialog = ({ children, setOpen, ...props }: DialogProps) => {\n return (\n <div\n className={styles.wrapper}\n onClick={() =>
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/dialog/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport styles from './styles.module.css';\n\nexport type DialogProps = React.DialogHTMLAttributes<HTMLDialogElement> & {\n children: React.ReactNode;\n setOpen?: React.Dispatch<React.SetStateAction<boolean>>;\n};\n\nexport const Dialog = ({ children, setOpen, ...props }: DialogProps) => {\n return (\n <div\n className={styles.wrapper}\n data-wrapper\n onClick={() => setOpen?.(false)}\n >\n <dialog\n className={styles.dialog}\n onClick={(e) => e.stopPropagation()}\n {...props}\n >\n {children}\n </dialog>\n </div>\n );\n};\n"],"names":["Dialog","children","setOpen","props","jsx","styles","wrapper","dialog","e","stopPropagation"],"mappings":"sLASaA,EAASA,CAAC,CAAEC,SAAAA,EAAUC,QAAAA,EAAS,GAAGC,CAAmB,IAE9DC,EAAAA,IAAC,MAAA,CACC,UAAWC,EAAOC,QAClB,eAAY,GACZ,QAAS,IAAMJ,GAAAA,YAAAA,EAAU,IAAO,iBAAA,SAEhC,SAAAE,EAAAA,IAAC,SAAA,CACC,UAAWC,EAAOE,OAClB,QAAUC,GAAMA,EAAEC,gBAAAA,EAClB,GAAIN,EAEHF,SAAAA,CAAAA,CACH,CAAA,CACF"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import '../../assets/index11.css';const
|
|
3
|
-
dialog:
|
|
4
|
-
wrapper:
|
|
5
|
-
},
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/index11.css';const p = "_dialog_1dwjg_1", c = "_wrapper_1dwjg_32", r = {
|
|
3
|
+
dialog: p,
|
|
4
|
+
wrapper: c
|
|
5
|
+
}, t = ({
|
|
6
6
|
children: l,
|
|
7
|
-
setOpen:
|
|
7
|
+
setOpen: a,
|
|
8
8
|
...i
|
|
9
|
-
}) => /* @__PURE__ */
|
|
9
|
+
}) => /* @__PURE__ */ o("div", { className: r.wrapper, "data-wrapper": !0, onClick: () => a == null ? void 0 : a(!1), "data-component": "dialog", children: /* @__PURE__ */ o("dialog", { className: r.dialog, onClick: (d) => d.stopPropagation(), ...i, children: l }) });
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
t as Dialog
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/dialog/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport styles from './styles.module.css';\n\nexport type DialogProps = React.DialogHTMLAttributes<HTMLDialogElement> & {\n children: React.ReactNode;\n setOpen?: React.Dispatch<React.SetStateAction<boolean>>;\n};\n\nexport const Dialog = ({ children, setOpen, ...props }: DialogProps) => {\n return (\n <div\n className={styles.wrapper}\n onClick={() =>
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/dialog/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport styles from './styles.module.css';\n\nexport type DialogProps = React.DialogHTMLAttributes<HTMLDialogElement> & {\n children: React.ReactNode;\n setOpen?: React.Dispatch<React.SetStateAction<boolean>>;\n};\n\nexport const Dialog = ({ children, setOpen, ...props }: DialogProps) => {\n return (\n <div\n className={styles.wrapper}\n data-wrapper\n onClick={() => setOpen?.(false)}\n >\n <dialog\n className={styles.dialog}\n onClick={(e) => e.stopPropagation()}\n {...props}\n >\n {children}\n </dialog>\n </div>\n );\n};\n"],"names":["Dialog","children","setOpen","props","jsx","styles","wrapper","dialog","e","stopPropagation"],"mappings":";;;;GASaA,IAASA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAUC,SAAAA;AAAAA,EAAS,GAAGC;AAAmB,MAE9D,gBAAAC,EAAC,OAAA,EACC,WAAWC,EAAOC,SAClB,gBAAY,IACZ,SAAS,MAAMJ,KAAAA,gBAAAA,EAAU,KAAO,kBAAA,UAEhC,UAAA,gBAAAE,EAAC,UAAA,EACC,WAAWC,EAAOE,QAClB,SAAUC,CAAAA,MAAMA,EAAEC,gBAAAA,GAClB,GAAIN,GAEHF,UAAAA,EAAAA,CACH,EAAA,CACF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index10.css');const e=require("react/jsx-runtime"),l=require("../icon/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index10.css');const e=require("react/jsx-runtime"),l=require("../icon/index.cjs"),c="_file_4fkv5_1",r={file:c,delete:"_delete_4fkv5_50"},d=({name:s,onClick:t,onDelete:a,ref:o,url:i})=>e.jsxs("div",{className:r.file,ref:o,"data-component":"file",children:[e.jsxs("a",{href:i,onClick:n=>{n.stopPropagation(),(t||!i)&&(n.preventDefault(),t==null||t())},title:s,children:[e.jsx(l.Icon,{name:"document",size:"small",variant:"primary"}),s]}),a&&e.jsx("a",{"aria-label":"delete document",className:r.delete,onClick:()=>a(),tabIndex:0,children:e.jsx(l.Icon,{name:"trash",size:"small",variant:"danger"})})]});exports.File=d;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/file/index.tsx"],"sourcesContent":["import { Icon } from '@/components/icon';\n\nimport styles from './styles.module.css';\n\nexport type FileProps = {\n name: string;\n onClick?: () => void;\n onDelete?: () => void;\n url?: string;\n};\n\nexport const File = ({ name, onClick, onDelete, url }: FileProps) => {\n return (\n <div
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/file/index.tsx"],"sourcesContent":["import { Icon } from '@/components/icon';\n\nimport styles from './styles.module.css';\n\nexport type FileProps = React.ComponentPropsWithRef<'div'> & {\n name: string;\n onClick?: () => void;\n onDelete?: () => void;\n url?: string;\n};\n\nexport const File = ({ name, onClick, onDelete, ref, url }: FileProps) => {\n return (\n <div\n className={styles.file}\n ref={ref}\n >\n <a\n href={url}\n onClick={(e) => {\n e.stopPropagation();\n\n if (onClick || !url) {\n e.preventDefault();\n onClick?.();\n }\n }}\n title={name}\n >\n <Icon\n name={'document'}\n size={'small'}\n variant={'primary'}\n />\n {name}\n </a>\n {onDelete && (\n <a\n aria-label={'delete document'}\n className={styles.delete}\n onClick={() => onDelete()}\n tabIndex={0}\n >\n <Icon\n name={'trash'}\n size={'small'}\n variant={'danger'}\n />\n </a>\n )}\n </div>\n );\n};\n"],"names":["File","name","onClick","onDelete","ref","url","styles","file","jsxs","e","stopPropagation","preventDefault","jsx","Icon","delete"],"mappings":"2MAWaA,EAAOA,CAAC,CAAEC,KAAAA,EAAMC,QAAAA,EAASC,SAAAA,EAAUC,IAAAA,EAAKC,IAAAA,CAAe,WAE/D,MAAA,CACC,UAAWC,EAAOC,KAClB,IAAAH,EAAS,iBAAA,OAET,SAAA,CAAAI,EAAAA,KAAC,IAAA,CACC,KAAMH,EACN,QAAUI,GAAM,CACdA,EAAEC,gBAAAA,GAEER,GAAW,CAACG,KACdI,EAAEE,eAAAA,EACFT,GAAAA,MAAAA,IAEJ,EACA,MAAOD,EAEP,SAAA,CAAAW,MAACC,EAAAA,MACC,KAAM,WACN,KAAM,QACN,QAAS,UAAU,EAEpBZ,CAAAA,EACH,EACCE,SACE,IAAA,CACC,aAAY,kBACZ,UAAWG,EAAOQ,OAClB,QAAS,IAAMX,EAAAA,EACf,SAAU,EAEV,eAACU,EAAAA,KAAA,CACC,KAAM,QACN,KAAM,QACN,QAAS,QAAA,CAAS,CAAA,CAEtB,CAAA,EAEJ"}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Icon as
|
|
3
|
-
import '../../assets/index10.css';const
|
|
4
|
-
file:
|
|
5
|
-
delete: "
|
|
6
|
-
},
|
|
7
|
-
name:
|
|
1
|
+
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { Icon as n } from "../icon/index.js";
|
|
3
|
+
import '../../assets/index10.css';const f = "_file_4fkv5_1", d = {
|
|
4
|
+
file: f,
|
|
5
|
+
delete: "_delete_4fkv5_50"
|
|
6
|
+
}, p = ({
|
|
7
|
+
name: t,
|
|
8
8
|
onClick: e,
|
|
9
|
-
onDelete:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
onDelete: l,
|
|
10
|
+
ref: m,
|
|
11
|
+
url: r
|
|
12
|
+
}) => /* @__PURE__ */ s("div", { className: d.file, ref: m, "data-component": "file", children: [
|
|
13
|
+
/* @__PURE__ */ s("a", { href: r, onClick: (i) => {
|
|
14
|
+
i.stopPropagation(), (e || !r) && (i.preventDefault(), e == null || e());
|
|
15
|
+
}, title: t, children: [
|
|
16
|
+
/* @__PURE__ */ a(n, { name: "document", size: "small", variant: "primary" }),
|
|
17
|
+
t
|
|
17
18
|
] }),
|
|
18
|
-
|
|
19
|
+
l && /* @__PURE__ */ a("a", { "aria-label": "delete document", className: d.delete, onClick: () => l(), tabIndex: 0, children: /* @__PURE__ */ a(n, { name: "trash", size: "small", variant: "danger" }) })
|
|
19
20
|
] });
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
+
p as File
|
|
22
23
|
};
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/file/index.tsx"],"sourcesContent":["import { Icon } from '@/components/icon';\n\nimport styles from './styles.module.css';\n\nexport type FileProps = {\n name: string;\n onClick?: () => void;\n onDelete?: () => void;\n url?: string;\n};\n\nexport const File = ({ name, onClick, onDelete, url }: FileProps) => {\n return (\n <div
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/file/index.tsx"],"sourcesContent":["import { Icon } from '@/components/icon';\n\nimport styles from './styles.module.css';\n\nexport type FileProps = React.ComponentPropsWithRef<'div'> & {\n name: string;\n onClick?: () => void;\n onDelete?: () => void;\n url?: string;\n};\n\nexport const File = ({ name, onClick, onDelete, ref, url }: FileProps) => {\n return (\n <div\n className={styles.file}\n ref={ref}\n >\n <a\n href={url}\n onClick={(e) => {\n e.stopPropagation();\n\n if (onClick || !url) {\n e.preventDefault();\n onClick?.();\n }\n }}\n title={name}\n >\n <Icon\n name={'document'}\n size={'small'}\n variant={'primary'}\n />\n {name}\n </a>\n {onDelete && (\n <a\n aria-label={'delete document'}\n className={styles.delete}\n onClick={() => onDelete()}\n tabIndex={0}\n >\n <Icon\n name={'trash'}\n size={'small'}\n variant={'danger'}\n />\n </a>\n )}\n </div>\n );\n};\n"],"names":["File","name","onClick","onDelete","ref","url","styles","file","jsxs","e","stopPropagation","preventDefault","jsx","Icon","delete"],"mappings":";;;;;GAWaA,IAAOA,CAAC;AAAA,EAAEC,MAAAA;AAAAA,EAAMC,SAAAA;AAAAA,EAASC,UAAAA;AAAAA,EAAUC,KAAAA;AAAAA,EAAKC,KAAAA;AAAe,wBAE/D,OAAA,EACC,WAAWC,EAAOC,MAClB,KAAAH,GAAS,kBAAA,QAET,UAAA;AAAA,EAAA,gBAAAI,EAAC,KAAA,EACC,MAAMH,GACN,SAAUI,CAAAA,MAAM;AACdA,IAAAA,EAAEC,gBAAAA,IAEER,KAAW,CAACG,OACdI,EAAEE,eAAAA,GACFT,KAAAA,QAAAA;AAAAA,EAEJ,GACA,OAAOD,GAEP,UAAA;AAAA,IAAA,gBAAAW,EAACC,KACC,MAAM,YACN,MAAM,SACN,SAAS,WAAU;AAAA,IAEpBZ;AAAAA,EAAAA,GACH;AAAA,EACCE,uBACE,KAAA,EACC,cAAY,mBACZ,WAAWG,EAAOQ,QAClB,SAAS,MAAMX,EAAAA,GACf,UAAU,GAEV,4BAACU,GAAA,EACC,MAAM,SACN,MAAM,SACN,SAAS,SAAA,CAAS,EAAA,CAEtB;AAAA,GAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index7.css');const s=require("react/jsx-runtime"),u=require("../../classix-5H4IWnMA.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index7.css');const s=require("react/jsx-runtime"),u=require("../../classix-5H4IWnMA.cjs"),a="_group_g6ddz_1",n={group:a},p=({animation:t,children:r,className:o,...e})=>s.jsx("div",{className:u.t(o,n.group),"data-animation":t,"data-wrapper":!0,...e,"data-component":"group",children:r});exports.Group=p;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/group/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport styles from './styles.module.css';\n\nexport type GroupProps = React.HTMLAttributes<HTMLDivElement> & {\n animation?: string;\n children: React.ReactNode;\n};\n\nexport const Group = ({ animation, children, className, ...props }: GroupProps) => {\n return (\n <div\n className={cx(className, styles.group)}\n data-animation={animation}\n {...props}\n >\n {children}\n </div>\n );\n};\n"],"names":["Group","animation","children","className","props","
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/group/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport styles from './styles.module.css';\n\nexport type GroupProps = React.HTMLAttributes<HTMLDivElement> & {\n animation?: string;\n children: React.ReactNode;\n};\n\nexport const Group = ({ animation, children, className, ...props }: GroupProps) => {\n return (\n <div\n className={cx(className, styles.group)}\n data-animation={animation}\n data-wrapper\n {...props}\n >\n {children}\n </div>\n );\n};\n"],"names":["Group","animation","children","className","props","cx","styles","group"],"mappings":"4LASaA,EAAQA,CAAC,CAAEC,UAAAA,EAAWC,SAAAA,EAAUC,UAAAA,EAAW,GAAGC,CAAkB,UAExE,MAAA,CACC,UAAWC,EAAAA,EAAGF,EAAWG,EAAOC,KAAK,EACrC,iBAAgBN,EAChB,eAAY,GACZ,GAAIG,EAAM,iBAAA,QAETF,SAAAA,EACH"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { t as n } from "../../classix-DG18itHa.js";
|
|
3
|
-
import '../../assets/index7.css';const s = "_group_g6ddz_1",
|
|
3
|
+
import '../../assets/index7.css';const s = "_group_g6ddz_1", u = {
|
|
4
4
|
group: s
|
|
5
|
-
},
|
|
5
|
+
}, d = ({
|
|
6
6
|
animation: o,
|
|
7
7
|
children: r,
|
|
8
8
|
className: t,
|
|
9
9
|
...p
|
|
10
|
-
}) => /* @__PURE__ */ a("div", { className: n(t,
|
|
10
|
+
}) => /* @__PURE__ */ a("div", { className: n(t, u.group), "data-animation": o, "data-wrapper": !0, ...p, "data-component": "group", children: r });
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
d as Group
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/group/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport styles from './styles.module.css';\n\nexport type GroupProps = React.HTMLAttributes<HTMLDivElement> & {\n animation?: string;\n children: React.ReactNode;\n};\n\nexport const Group = ({ animation, children, className, ...props }: GroupProps) => {\n return (\n <div\n className={cx(className, styles.group)}\n data-animation={animation}\n {...props}\n >\n {children}\n </div>\n );\n};\n"],"names":["Group","animation","children","className","props","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/group/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport styles from './styles.module.css';\n\nexport type GroupProps = React.HTMLAttributes<HTMLDivElement> & {\n animation?: string;\n children: React.ReactNode;\n};\n\nexport const Group = ({ animation, children, className, ...props }: GroupProps) => {\n return (\n <div\n className={cx(className, styles.group)}\n data-animation={animation}\n data-wrapper\n {...props}\n >\n {children}\n </div>\n );\n};\n"],"names":["Group","animation","children","className","props","cx","styles","group"],"mappings":";;;;GASaA,IAAQA,CAAC;AAAA,EAAEC,WAAAA;AAAAA,EAAWC,UAAAA;AAAAA,EAAUC,WAAAA;AAAAA,EAAW,GAAGC;AAAkB,wBAExE,OAAA,EACC,WAAWC,EAAGF,GAAWG,EAAOC,KAAK,GACrC,kBAAgBN,GAChB,gBAAY,IACZ,GAAIG,GAAM,kBAAA,SAETF,UAAAA,GACH;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("../../classix-5H4IWnMA.cjs"),c=require("react"),I=require("../../icons-C_cX1FYp.cjs"),P=require("../../utils-DBzf7CFq.cjs"),s=require("../../styles.module-CwroCNAt.cjs");function T({className:p,defaultCountryCode:d="+47",disabled:a=!1,icon:i,label:h,placeholder:m,ref:v,type:t="text",...e}){const[l,g]=c.useState(""),[o,x]=c.useState(""),{onChange:y,value:j,...N}=e,{touched:S,onBlur:f}=P.useTouched(j===""),q=i&&t!=="radio"&&t!=="datetime-local"?{"--icon-svg":I.iconSVG(i,!0)}:void 0;c.useEffect(()=>{if(typeof e.onChange=="function"&&t==="tel"){const u={name:e.name,value:o?(l||d).split(" ").join("")+o.split(" ").join(""):void 0};e.onChange({target:u,currentTarget:u})}},[l,o]),c.useEffect(()=>{t==="tel"&&!e.value&&(x(""),g(""))},[e.value,t]);const C=n.jsxs(n.Fragment,{children:[n.jsx("input",{disabled:a,hidden:!0,onChange:y,pattern:void 0,placeholder:m,ref:v,type:t,value:j}),n.jsx("input",{type:"text",className:s.inputStyles.input,disabled:a,maxLength:5,onChange:u=>g(u.target.value),placeholder:d,value:l}),n.jsx("input",{type:"tel",className:r.t(s.inputStyles.input,S&&"touched"),"data-icon":i?"true":void 0,disabled:a,maxLength:14,name:void 0,onChange:u=>x(u.target.value),onBlur:f,pattern:e.pattern,style:q,value:o,...N})]});return n.jsxs("label",{className:s.inputStyles.label,"data-component":"input",children:[h&&n.jsx("span",{className:r.t(e.required&&s.inputStyles.required),children:h}),t==="tel"?C:n.jsx("input",{ref:v,className:r.t(s.inputStyles.input,p,S&&"touched"),"data-icon":i?"true":void 0,disabled:a,onBlur:f,placeholder:m,style:q,type:t,...e})]})}exports.Input=T;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/input/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport {
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/input/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { useEffect, useState } from 'react';\n\nimport { IconName, iconSVG } from '@/components/icon/icons.ts';\nimport { useTouched } from '@/utils.ts';\n\nimport styles from './styles.module.css';\n\nexport type InputProps = React.ComponentPropsWithRef<'input'> & {\n defaultCountryCode?: string;\n disabled?: boolean;\n icon?: IconName;\n label?: string;\n onClick?: React.MouseEventHandler<HTMLInputElement>;\n placeholder?: string;\n type?: 'datetime-local' | 'email' | 'number' | 'password' | 'radio' | 'search' | 'tel' | 'text';\n};\n\nexport function Input({\n className,\n defaultCountryCode = '+47',\n disabled = false,\n icon,\n label,\n placeholder,\n ref,\n type = 'text',\n ...props\n}: InputProps) {\n const [countryCode, setCountryCode] = useState('');\n const [phoneNumber, setPhoneNumber] = useState('');\n const { onChange, value, ...restProps } = props;\n const { touched, onBlur } = useTouched(value === '');\n\n type withVars =\n | (React.CSSProperties & {\n '--icon-svg'?: string;\n })\n | undefined;\n\n const withVars: withVars =\n icon && type !== 'radio' && type !== 'datetime-local'\n ? {\n '--icon-svg': iconSVG(icon, true),\n }\n : undefined;\n\n useEffect(() => {\n if (typeof props.onChange === 'function' && type === 'tel') {\n const target = {\n name: props.name,\n value: phoneNumber\n ? (countryCode || defaultCountryCode).split(' ').join('') +\n phoneNumber.split(' ').join('')\n : undefined,\n } as unknown as HTMLInputElement;\n // eslint-disable-next-line\n (props.onChange as any)({ target, currentTarget: target });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [countryCode, phoneNumber]);\n\n useEffect(() => {\n if (type === 'tel' && !props.value) {\n setPhoneNumber('');\n setCountryCode('');\n }\n }, [props.value, type]);\n\n const telephoneInput = (\n <>\n <input\n disabled={disabled}\n hidden\n onChange={onChange}\n pattern={undefined}\n placeholder={placeholder}\n ref={ref}\n type={type}\n value={value}\n />\n <input\n type='text'\n className={styles.input}\n disabled={disabled}\n maxLength={5}\n onChange={(e) => setCountryCode(e.target.value)}\n placeholder={defaultCountryCode}\n value={countryCode}\n />\n <input\n type='tel'\n className={cx(styles.input, touched && 'touched')}\n data-icon={icon ? 'true' : undefined}\n disabled={disabled}\n maxLength={14}\n name={undefined}\n onChange={(e) => setPhoneNumber(e.target.value)}\n onBlur={onBlur}\n pattern={props.pattern}\n style={withVars}\n value={phoneNumber}\n {...restProps}\n />\n </>\n );\n\n return (\n <label className={styles.label}>\n {label && <span className={cx(props.required && styles.required)}>{label}</span>}\n {type === 'tel' ? (\n telephoneInput\n ) : (\n <input\n ref={ref}\n className={cx(styles.input, className, touched && 'touched')}\n data-icon={icon ? 'true' : undefined}\n disabled={disabled}\n onBlur={onBlur}\n placeholder={placeholder}\n style={withVars}\n type={type}\n {...props}\n />\n )}\n </label>\n );\n}\n"],"names":["Input","className","defaultCountryCode","disabled","icon","label","placeholder","ref","type","props","countryCode","setCountryCode","useState","phoneNumber","setPhoneNumber","onChange","value","restProps","touched","onBlur","useTouched","withVars","iconSVG","undefined","useEffect","target","name","split","join","currentTarget","telephoneInput","jsxs","Fragment","jsx","styles","input","e","cx","pattern","required"],"mappings":"0SAkBO,SAASA,EAAM,CACpBC,UAAAA,EACAC,mBAAAA,EAAqB,MACrBC,SAAAA,EAAW,GACXC,KAAAA,EACAC,MAAAA,EACAC,YAAAA,EACAC,IAAAA,EACAC,KAAAA,EAAO,OACP,GAAGC,CACO,EAAG,CACb,KAAM,CAACC,EAAaC,CAAc,EAAIC,EAAAA,SAAS,EAAE,EAC3C,CAACC,EAAaC,CAAc,EAAIF,EAAAA,SAAS,EAAE,EAC3C,CAAEG,SAAAA,EAAUC,MAAAA,EAAO,GAAGC,CAAAA,EAAcR,EACpC,CAAES,QAAAA,EAASC,OAAAA,CAAAA,EAAWC,EAAAA,WAAWJ,IAAU,EAAE,EAQ7CK,EACJjB,GAAQI,IAAS,SAAWA,IAAS,iBACjC,CACE,aAAcc,EAAAA,QAAQlB,EAAM,EAAI,CAAA,EAElCmB,OAENC,EAAAA,UAAU,IAAM,CACd,GAAI,OAAOf,EAAMM,UAAa,YAAcP,IAAS,MAAO,CAC1D,MAAMiB,EAAS,CACbC,KAAMjB,EAAMiB,KACZV,MAAOH,GACFH,GAAeR,GAAoByB,MAAM,GAAG,EAAEC,KAAK,EAAE,EACtDf,EAAYc,MAAM,GAAG,EAAEC,KAAK,EAAE,EAC9BL,MAAAA,EAGLd,EAAMM,SAAiB,CAAEU,OAAAA,EAAQI,cAAeJ,CAAAA,CAAQ,CAC3D,CAEF,EAAG,CAACf,EAAaG,CAAW,CAAC,EAE7BW,EAAAA,UAAU,IAAM,CACVhB,IAAS,OAAS,CAACC,EAAMO,QAC3BF,EAAe,EAAE,EACjBH,EAAe,EAAE,EAErB,EAAG,CAACF,EAAMO,MAAOR,CAAI,CAAC,EAEtB,MAAMsB,EACJC,EAAAA,KAAAC,EAAAA,SAAA,CACE,SAAA,CAAAC,EAAAA,IAAC,QAAA,CACC,SAAA9B,EACA,OAAM,GACN,SAAAY,EACA,QAASQ,OACT,YAAAjB,EACA,IAAAC,EACA,KAAAC,EACA,MAAAQ,CAAA,CAAa,EAEfiB,MAAC,SACC,KAAK,OACL,UAAWC,EAAAA,YAAOC,MAClB,SAAAhC,EACA,UAAW,EACX,SAAWiC,GAAMzB,EAAeyB,EAAEX,OAAOT,KAAK,EAC9C,YAAad,EACb,MAAOQ,EAAY,QAEpB,QAAA,CACC,KAAK,MACL,UAAW2B,EAAAA,EAAGH,EAAAA,YAAOC,MAAOjB,GAAW,SAAS,EAChD,YAAWd,EAAO,OAASmB,OAC3B,SAAApB,EACA,UAAW,GACX,KAAMoB,OACN,SAAWa,GAAMtB,EAAesB,EAAEX,OAAOT,KAAK,EAC9C,OAAAG,EACA,QAASV,EAAM6B,QACf,MAAOjB,EACP,MAAOR,EACP,GAAII,CAAAA,CAAU,CAAA,EAElB,EAGF,cACG,QAAA,CAAM,UAAWiB,EAAAA,YAAO7B,MAAM,iBAAA,QAC5BA,SAAAA,CAAAA,GAAS4B,EAAAA,IAAC,QAAK,UAAWI,EAAAA,EAAG5B,EAAM8B,UAAYL,EAAAA,YAAOK,QAAQ,EAAIlC,SAAAA,CAAAA,CAAM,EACxEG,IAAS,MACRsB,EAEAG,EAAAA,IAAC,QAAA,CACC,IAAA1B,EACA,UAAW8B,EAAAA,EAAGH,EAAAA,YAAOC,MAAOlC,EAAWiB,GAAW,SAAS,EAC3D,YAAWd,EAAO,OAASmB,OAC3B,SAAApB,EACA,OAAAgB,EACA,YAAAb,EACA,MAAOe,EACP,KAAAb,EACA,GAAIC,CAAAA,CAAM,CAAA,EAGhB,CAEJ"}
|
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
import { jsxs as C, Fragment as
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as C, Fragment as T, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { t as s } from "../../classix-DG18itHa.js";
|
|
3
|
+
import { useState as j, useEffect as S } from "react";
|
|
4
4
|
import { i as V } from "../../icons-DfmpRbxE.js";
|
|
5
|
-
import { u as
|
|
5
|
+
import { u as w } from "../../utils--n2yqjCy.js";
|
|
6
6
|
import { i as o } from "../../styles.module-C_Z8FrR5.js";
|
|
7
|
-
|
|
7
|
+
function y({
|
|
8
8
|
className: q,
|
|
9
9
|
defaultCountryCode: c = "+47",
|
|
10
10
|
disabled: u = !1,
|
|
11
11
|
icon: i,
|
|
12
12
|
label: m,
|
|
13
13
|
placeholder: h,
|
|
14
|
+
ref: d,
|
|
14
15
|
type: e = "text",
|
|
15
16
|
...t
|
|
16
|
-
}
|
|
17
|
-
const [
|
|
18
|
-
onChange:
|
|
19
|
-
value:
|
|
20
|
-
...
|
|
17
|
+
}) {
|
|
18
|
+
const [l, v] = j(""), [r, g] = j(""), {
|
|
19
|
+
onChange: I,
|
|
20
|
+
value: f,
|
|
21
|
+
...L
|
|
21
22
|
} = t, {
|
|
22
23
|
touched: p,
|
|
23
24
|
onBlur: x
|
|
24
|
-
} =
|
|
25
|
+
} = w(f === ""), N = i && e !== "radio" && e !== "datetime-local" ? {
|
|
25
26
|
"--icon-svg": V(i, !0)
|
|
26
27
|
} : void 0;
|
|
27
28
|
S(() => {
|
|
28
29
|
if (typeof t.onChange == "function" && e === "tel") {
|
|
29
30
|
const n = {
|
|
30
31
|
name: t.name,
|
|
31
|
-
value: r ? (
|
|
32
|
+
value: r ? (l || c).split(" ").join("") + r.split(" ").join("") : void 0
|
|
32
33
|
};
|
|
33
34
|
t.onChange({
|
|
34
35
|
target: n,
|
|
35
36
|
currentTarget: n
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
|
-
}, [
|
|
39
|
-
e === "tel" && !t.value && (
|
|
39
|
+
}, [l, r]), S(() => {
|
|
40
|
+
e === "tel" && !t.value && (g(""), v(""));
|
|
40
41
|
}, [t.value, e]);
|
|
41
|
-
const
|
|
42
|
-
/* @__PURE__ */ a("input", { disabled: u, hidden: !0, onChange:
|
|
43
|
-
/* @__PURE__ */ a("input", { type: "text", className: o.input, disabled: u, maxLength: 5, onChange: (n) => v(n.target.value), placeholder: c, value:
|
|
44
|
-
/* @__PURE__ */ a("input", { type: "tel", className:
|
|
42
|
+
const P = /* @__PURE__ */ C(T, { children: [
|
|
43
|
+
/* @__PURE__ */ a("input", { disabled: u, hidden: !0, onChange: I, pattern: void 0, placeholder: h, ref: d, type: e, value: f }),
|
|
44
|
+
/* @__PURE__ */ a("input", { type: "text", className: o.input, disabled: u, maxLength: 5, onChange: (n) => v(n.target.value), placeholder: c, value: l }),
|
|
45
|
+
/* @__PURE__ */ a("input", { type: "tel", className: s(o.input, p && "touched"), "data-icon": i ? "true" : void 0, disabled: u, maxLength: 14, name: void 0, onChange: (n) => g(n.target.value), onBlur: x, pattern: t.pattern, style: N, value: r, ...L })
|
|
45
46
|
] });
|
|
46
47
|
return /* @__PURE__ */ C("label", { className: o.label, "data-component": "input", children: [
|
|
47
|
-
m && /* @__PURE__ */ a("span", { className:
|
|
48
|
-
e === "tel" ?
|
|
48
|
+
m && /* @__PURE__ */ a("span", { className: s(t.required && o.required), children: m }),
|
|
49
|
+
e === "tel" ? P : /* @__PURE__ */ a("input", { ref: d, className: s(o.input, q, p && "touched"), "data-icon": i ? "true" : void 0, disabled: u, onBlur: x, placeholder: h, style: N, type: e, ...t })
|
|
49
50
|
] });
|
|
50
|
-
}
|
|
51
|
+
}
|
|
51
52
|
export {
|
|
52
53
|
y as Input
|
|
53
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/input/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/input/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { useEffect, useState } from 'react';\n\nimport { IconName, iconSVG } from '@/components/icon/icons.ts';\nimport { useTouched } from '@/utils.ts';\n\nimport styles from './styles.module.css';\n\nexport type InputProps = React.ComponentPropsWithRef<'input'> & {\n defaultCountryCode?: string;\n disabled?: boolean;\n icon?: IconName;\n label?: string;\n onClick?: React.MouseEventHandler<HTMLInputElement>;\n placeholder?: string;\n type?: 'datetime-local' | 'email' | 'number' | 'password' | 'radio' | 'search' | 'tel' | 'text';\n};\n\nexport function Input({\n className,\n defaultCountryCode = '+47',\n disabled = false,\n icon,\n label,\n placeholder,\n ref,\n type = 'text',\n ...props\n}: InputProps) {\n const [countryCode, setCountryCode] = useState('');\n const [phoneNumber, setPhoneNumber] = useState('');\n const { onChange, value, ...restProps } = props;\n const { touched, onBlur } = useTouched(value === '');\n\n type withVars =\n | (React.CSSProperties & {\n '--icon-svg'?: string;\n })\n | undefined;\n\n const withVars: withVars =\n icon && type !== 'radio' && type !== 'datetime-local'\n ? {\n '--icon-svg': iconSVG(icon, true),\n }\n : undefined;\n\n useEffect(() => {\n if (typeof props.onChange === 'function' && type === 'tel') {\n const target = {\n name: props.name,\n value: phoneNumber\n ? (countryCode || defaultCountryCode).split(' ').join('') +\n phoneNumber.split(' ').join('')\n : undefined,\n } as unknown as HTMLInputElement;\n // eslint-disable-next-line\n (props.onChange as any)({ target, currentTarget: target });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [countryCode, phoneNumber]);\n\n useEffect(() => {\n if (type === 'tel' && !props.value) {\n setPhoneNumber('');\n setCountryCode('');\n }\n }, [props.value, type]);\n\n const telephoneInput = (\n <>\n <input\n disabled={disabled}\n hidden\n onChange={onChange}\n pattern={undefined}\n placeholder={placeholder}\n ref={ref}\n type={type}\n value={value}\n />\n <input\n type='text'\n className={styles.input}\n disabled={disabled}\n maxLength={5}\n onChange={(e) => setCountryCode(e.target.value)}\n placeholder={defaultCountryCode}\n value={countryCode}\n />\n <input\n type='tel'\n className={cx(styles.input, touched && 'touched')}\n data-icon={icon ? 'true' : undefined}\n disabled={disabled}\n maxLength={14}\n name={undefined}\n onChange={(e) => setPhoneNumber(e.target.value)}\n onBlur={onBlur}\n pattern={props.pattern}\n style={withVars}\n value={phoneNumber}\n {...restProps}\n />\n </>\n );\n\n return (\n <label className={styles.label}>\n {label && <span className={cx(props.required && styles.required)}>{label}</span>}\n {type === 'tel' ? (\n telephoneInput\n ) : (\n <input\n ref={ref}\n className={cx(styles.input, className, touched && 'touched')}\n data-icon={icon ? 'true' : undefined}\n disabled={disabled}\n onBlur={onBlur}\n placeholder={placeholder}\n style={withVars}\n type={type}\n {...props}\n />\n )}\n </label>\n );\n}\n"],"names":["Input","className","defaultCountryCode","disabled","icon","label","placeholder","ref","type","props","countryCode","setCountryCode","useState","phoneNumber","setPhoneNumber","onChange","value","restProps","touched","onBlur","useTouched","withVars","iconSVG","undefined","useEffect","target","name","split","join","currentTarget","telephoneInput","jsxs","Fragment","jsx","styles","input","e","cx","pattern","required"],"mappings":";;;;;;AAkBO,SAASA,EAAM;AAAA,EACpBC,WAAAA;AAAAA,EACAC,oBAAAA,IAAqB;AAAA,EACrBC,UAAAA,IAAW;AAAA,EACXC,MAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,KAAAA;AAAAA,EACAC,MAAAA,IAAO;AAAA,EACP,GAAGC;AACO,GAAG;AACb,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAE,GAC3C,CAACC,GAAaC,CAAc,IAAIF,EAAS,EAAE,GAC3C;AAAA,IAAEG,UAAAA;AAAAA,IAAUC,OAAAA;AAAAA,IAAO,GAAGC;AAAAA,EAAAA,IAAcR,GACpC;AAAA,IAAES,SAAAA;AAAAA,IAASC,QAAAA;AAAAA,EAAAA,IAAWC,EAAWJ,MAAU,EAAE,GAQ7CK,IACJjB,KAAQI,MAAS,WAAWA,MAAS,mBACjC;AAAA,IACE,cAAcc,EAAQlB,GAAM,EAAI;AAAA,EAAA,IAElCmB;AAENC,EAAAA,EAAU,MAAM;AACd,QAAI,OAAOf,EAAMM,YAAa,cAAcP,MAAS,OAAO;AAC1D,YAAMiB,IAAS;AAAA,QACbC,MAAMjB,EAAMiB;AAAAA,QACZV,OAAOH,KACFH,KAAeR,GAAoByB,MAAM,GAAG,EAAEC,KAAK,EAAE,IACtDf,EAAYc,MAAM,GAAG,EAAEC,KAAK,EAAE,IAC9BL;AAAAA,MAAAA;AAGLd,MAAAA,EAAMM,SAAiB;AAAA,QAAEU,QAAAA;AAAAA,QAAQI,eAAeJ;AAAAA,MAAAA,CAAQ;AAAA,IAC3D;AAAA,EAEF,GAAG,CAACf,GAAaG,CAAW,CAAC,GAE7BW,EAAU,MAAM;AACd,IAAIhB,MAAS,SAAS,CAACC,EAAMO,UAC3BF,EAAe,EAAE,GACjBH,EAAe,EAAE;AAAA,EAErB,GAAG,CAACF,EAAMO,OAAOR,CAAI,CAAC;AAEtB,QAAMsB,IACJ,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC,EAAC,SAAA,EACC,UAAA9B,GACA,QAAM,IACN,UAAAY,GACA,SAASQ,QACT,aAAAjB,GACA,KAAAC,GACA,MAAAC,GACA,OAAAQ,EAAA,CAAa;AAAA,IAEf,gBAAAiB,EAAC,WACC,MAAK,QACL,WAAWC,EAAOC,OAClB,UAAAhC,GACA,WAAW,GACX,UAAWiC,CAAAA,MAAMzB,EAAeyB,EAAEX,OAAOT,KAAK,GAC9C,aAAad,GACb,OAAOQ,GAAY;AAAA,sBAEpB,SAAA,EACC,MAAK,OACL,WAAW2B,EAAGH,EAAOC,OAAOjB,KAAW,SAAS,GAChD,aAAWd,IAAO,SAASmB,QAC3B,UAAApB,GACA,WAAW,IACX,MAAMoB,QACN,UAAWa,CAAAA,MAAMtB,EAAesB,EAAEX,OAAOT,KAAK,GAC9C,QAAAG,GACA,SAASV,EAAM6B,SACf,OAAOjB,GACP,OAAOR,GACP,GAAII,EAAAA,CAAU;AAAA,EAAA,GAElB;AAGF,2BACG,SAAA,EAAM,WAAWiB,EAAO7B,OAAM,kBAAA,SAC5BA,UAAAA;AAAAA,IAAAA,KAAS,gBAAA4B,EAAC,UAAK,WAAWI,EAAG5B,EAAM8B,YAAYL,EAAOK,QAAQ,GAAIlC,UAAAA,EAAAA,CAAM;AAAA,IACxEG,MAAS,QACRsB,IAEA,gBAAAG,EAAC,SAAA,EACC,KAAA1B,GACA,WAAW8B,EAAGH,EAAOC,OAAOlC,GAAWiB,KAAW,SAAS,GAC3D,aAAWd,IAAO,SAASmB,QAC3B,UAAApB,GACA,QAAAgB,GACA,aAAAb,GACA,OAAOe,GACP,MAAAb,GACA,GAAIC,EAAAA,CAAM;AAAA,EAAA,GAGhB;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index38.css');const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index38.css');const a=require("react/jsx-runtime"),_=require("../../classix-5H4IWnMA.cjs"),c=require("../../helpers-fOobx0tS.cjs"),d="_horizontal_ham8z_1",z="_list_ham8z_12",x="_columns_ham8z_51",s={horizontal:d,list:z,columns:x};function y({children:t,className:r,columns:o=1,horizontal:m,ordered:u,style:h,...l}){const n=Number.isFinite(o)?Math.max(1,Math.floor(o)):1,e=_.t(r,s.list,n>1&&s.columns,m&&s.horizontal),i={...h,"--list-columns":n};return u?a.jsx("ol",{className:e,style:i,...l,"data-component":"list",children:c.wrapChildren(t)}):a.jsx("ul",{className:e,style:i,...l,"data-component":"list",children:c.wrapChildren(t)})}exports.List=y;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { t as u } from "../../classix-DG18itHa.js";
|
|
3
|
-
import { w as
|
|
4
|
-
import '../../assets/index38.css';const
|
|
5
|
-
horizontal:
|
|
3
|
+
import { w as m } from "../../helpers-Dbey5Ztb.js";
|
|
4
|
+
import '../../assets/index38.css';const z = "_horizontal_ham8z_1", f = "_list_ham8z_12", p = "_columns_ham8z_51", t = {
|
|
5
|
+
horizontal: z,
|
|
6
6
|
list: f,
|
|
7
7
|
columns: p
|
|
8
8
|
};
|
|
9
|
-
function
|
|
10
|
-
children:
|
|
11
|
-
className:
|
|
12
|
-
columns:
|
|
9
|
+
function y({
|
|
10
|
+
children: o,
|
|
11
|
+
className: r,
|
|
12
|
+
columns: s = 1,
|
|
13
13
|
horizontal: e,
|
|
14
14
|
ordered: h,
|
|
15
15
|
style: _,
|
|
16
16
|
...l
|
|
17
17
|
}) {
|
|
18
|
-
const
|
|
18
|
+
const n = Number.isFinite(s) ? Math.max(1, Math.floor(s)) : 1, a = u(r, t.list, n > 1 && t.columns, e && t.horizontal), i = {
|
|
19
19
|
..._,
|
|
20
|
-
"--list-columns":
|
|
20
|
+
"--list-columns": n
|
|
21
21
|
};
|
|
22
|
-
return h ? /* @__PURE__ */ c("ol", { className:
|
|
22
|
+
return h ? /* @__PURE__ */ c("ol", { className: a, style: i, ...l, "data-component": "list", children: m(o) }) : /* @__PURE__ */ c("ul", { className: a, style: i, ...l, "data-component": "list", children: m(o) });
|
|
23
23
|
}
|
|
24
24
|
export {
|
|
25
|
-
|
|
25
|
+
y as List
|
|
26
26
|
};
|
|
27
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index40.css');const p=require("react/jsx-runtime"),_=require("../../classix-5H4IWnMA.cjs"),f=require("react"),v=require("../../icons-C_cX1FYp.cjs"),h="
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index40.css');const p=require("react/jsx-runtime"),_=require("../../classix-5H4IWnMA.cjs"),f=require("react"),v=require("../../icons-C_cX1FYp.cjs"),h="_nav_joer2_1",b="_horizontal_joer2_7",j="_tabs_joer2_17",g="_pills_joer2_38",t={nav:h,horizontal:b,tabs:j,pills:g},m={default:t.default,pills:t.pills,tabs:t.tabs},w=({animation:o,children:i,className:r,horizontal:s=!1,variant:e="default",...l})=>{const[c,a]=f.useState(!1),u={"--icon-svg":v.iconSVG("chevron")};return p.jsx("nav",{className:_.t(r,s&&t.horizontal,t.nav,m[e]),"data-animation":o,"data-open":c?"true":"false","data-orientation":s?"horizontal":"vertical",onBlurCapture:n=>{if(e!=="pills"||window.innerWidth>960)return;const d=n.relatedTarget;n.currentTarget.contains(d)||a(!1)},onClick:()=>{e!=="pills"||window.innerWidth>960||a(n=>!n)},style:u,...l,"data-component":"nav",children:i})};exports.Nav=w;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -2,35 +2,35 @@ import { jsx as d } from "react/jsx-runtime";
|
|
|
2
2
|
import { t as _ } from "../../classix-DG18itHa.js";
|
|
3
3
|
import { useState as m } from "react";
|
|
4
4
|
import { i as u } from "../../icons-DfmpRbxE.js";
|
|
5
|
-
import '../../assets/index40.css';const v = "
|
|
5
|
+
import '../../assets/index40.css';const v = "_nav_joer2_1", h = "_horizontal_joer2_7", b = "_tabs_joer2_17", j = "_pills_joer2_38", t = {
|
|
6
6
|
nav: v,
|
|
7
7
|
horizontal: h,
|
|
8
8
|
tabs: b,
|
|
9
|
-
pills:
|
|
10
|
-
},
|
|
9
|
+
pills: j
|
|
10
|
+
}, w = {
|
|
11
11
|
default: t.default,
|
|
12
12
|
pills: t.pills,
|
|
13
13
|
tabs: t.tabs
|
|
14
|
-
},
|
|
15
|
-
animation:
|
|
16
|
-
children:
|
|
17
|
-
className:
|
|
18
|
-
horizontal:
|
|
19
|
-
variant:
|
|
14
|
+
}, C = ({
|
|
15
|
+
animation: e,
|
|
16
|
+
children: r,
|
|
17
|
+
className: i,
|
|
18
|
+
horizontal: a = !1,
|
|
19
|
+
variant: o = "default",
|
|
20
20
|
...l
|
|
21
21
|
}) => {
|
|
22
22
|
const [c, s] = m(!1), p = {
|
|
23
23
|
"--icon-svg": u("chevron")
|
|
24
24
|
};
|
|
25
|
-
return /* @__PURE__ */ d("nav", { className: _(
|
|
26
|
-
if (
|
|
27
|
-
const f =
|
|
28
|
-
|
|
25
|
+
return /* @__PURE__ */ d("nav", { className: _(i, a && t.horizontal, t.nav, w[o]), "data-animation": e, "data-open": c ? "true" : "false", "data-orientation": a ? "horizontal" : "vertical", onBlurCapture: (n) => {
|
|
26
|
+
if (o !== "pills" || window.innerWidth > 960) return;
|
|
27
|
+
const f = n.relatedTarget;
|
|
28
|
+
n.currentTarget.contains(f) || s(!1);
|
|
29
29
|
}, onClick: () => {
|
|
30
|
-
|
|
31
|
-
}, style: p, ...l, "data-component": "nav", children:
|
|
30
|
+
o !== "pills" || window.innerWidth > 960 || s((n) => !n);
|
|
31
|
+
}, style: p, ...l, "data-component": "nav", children: r });
|
|
32
32
|
};
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
C as Nav
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("../../classix-5H4IWnMA.cjs");require("../../icons-C_cX1FYp.cjs");require("../../utils-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("../../classix-5H4IWnMA.cjs");require("../../icons-C_cX1FYp.cjs");require("../../utils-DBzf7CFq.cjs");const e=require("../../index-D0Nzihh-.cjs");exports.Select=e.Select;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../../classix-DG18itHa.js";
|
|
3
3
|
import "../../icons-DfmpRbxE.js";
|
|
4
|
-
import "../../utils
|
|
5
|
-
import { S as e } from "../../index-
|
|
4
|
+
import "../../utils--n2yqjCy.js";
|
|
5
|
+
import { S as e } from "../../index-s_TTRzH8.js";
|
|
6
6
|
export {
|
|
7
7
|
e as Select
|
|
8
8
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index42.css');const e=require("react/jsx-runtime"),r=require("../../classix-5H4IWnMA.cjs"),y=require("../../utils-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index42.css');const e=require("react/jsx-runtime"),r=require("../../classix-5H4IWnMA.cjs"),y=require("../../utils-DBzf7CFq.cjs"),l=require("../../styles.module-CwroCNAt.cjs"),d="_label_b5yys_1",b="_textarea_b5yys_5",n={label:d,textarea:b},m=({label:t,maxRows:o=12,minRows:c=3,required:s,value:a,...u})=>{const{touched:i,onBlur:x}=y.useTouched(a==="");return e.jsxs("label",{"data-component":"textarea",children:[t&&e.jsx("span",{className:r.t(n.label,s&&l.inputStyles.required),children:t}),e.jsx("textarea",{className:r.t(l.inputStyles.input,n.textarea,i&&"touched"),onBlur:x,...u,required:s,style:{"--min-rows":c,"--max-rows":o},value:a})]})};exports.Textarea=m;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/textarea/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { useTouched } from '@/utils.ts';\n\nimport inputStyles from '../input/styles.module.css';\nimport styles from './styles.module.css';\n\nexport type TextareaProps = React.ComponentPropsWithoutRef<'textarea'> & {\n label?: string;\n maxRows?: number;\n minRows?: number;\n};\n\nexport const Textarea = ({\n label,\n maxRows = 12,\n minRows = 3,\n required,\n value,\n ...props\n}: TextareaProps) => {\n const { touched, onBlur } = useTouched(value === '');\n\n return (\n <label>\n {label && <span className={cx(styles.label, required && inputStyles.required)}>{label}</span>}\n <textarea\n className={cx(inputStyles.input, styles.textarea, touched && 'touched')}\n onBlur={onBlur}\n {...props}\n required={required}\n style={\n {\n '--min-rows': minRows,\n '--max-rows': maxRows,\n } as React.CSSProperties\n }\n value={value}\n
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/textarea/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { useTouched } from '@/utils.ts';\n\nimport inputStyles from '../input/styles.module.css';\nimport styles from './styles.module.css';\n\nexport type TextareaProps = Omit<React.ComponentPropsWithoutRef<'textarea'>, 'children'> & {\n label?: string;\n maxRows?: number;\n minRows?: number;\n};\n\nexport const Textarea = ({\n label,\n maxRows = 12,\n minRows = 3,\n required,\n value,\n ...props\n}: TextareaProps) => {\n const { touched, onBlur } = useTouched(value === '');\n\n return (\n <label>\n {label && <span className={cx(styles.label, required && inputStyles.required)}>{label}</span>}\n <textarea\n className={cx(inputStyles.input, styles.textarea, touched && 'touched')}\n onBlur={onBlur}\n {...props}\n required={required}\n style={\n {\n '--min-rows': minRows,\n '--max-rows': maxRows,\n } as React.CSSProperties\n }\n value={value}\n />\n </label>\n );\n};\n"],"names":["Textarea","label","maxRows","minRows","required","value","props","touched","onBlur","useTouched","jsxs","jsx","cx","styles","inputStyles","input","textarea"],"mappings":"iTAaaA,EAAWA,CAAC,CACvBC,MAAAA,EACAC,QAAAA,EAAU,GACVC,QAAAA,EAAU,EACVC,SAAAA,EACAC,MAAAA,EACA,GAAGC,CACU,IAAM,CACnB,KAAM,CAAEC,QAAAA,EAASC,OAAAA,CAAAA,EAAWC,EAAAA,WAAWJ,IAAU,EAAE,EAEnD,OACEK,EAAAA,KAAC,QAAA,CAAK,iBAAA,WACHT,SAAAA,CAAAA,GAASU,EAAAA,IAAC,OAAA,CAAK,UAAWC,EAAAA,EAAGC,EAAOZ,MAAOG,GAAYU,EAAAA,YAAYV,QAAQ,EAAIH,SAAAA,CAAAA,CAAM,EACtFU,EAAAA,IAAC,WAAA,CACC,UAAWC,EAAAA,EAAGE,EAAAA,YAAYC,MAAOF,EAAOG,SAAUT,GAAW,SAAS,EACtE,OAAAC,KACIF,EACJ,SAAAF,EACA,MACE,CACE,aAAcD,EACd,aAAcD,CAAAA,EAGlB,MAAAG,CAAA,CAAa,CAAA,EAEjB,CAEJ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as p, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { t as r } from "../../classix-DG18itHa.js";
|
|
3
|
-
import { u } from "../../utils
|
|
3
|
+
import { u } from "../../utils--n2yqjCy.js";
|
|
4
4
|
import { i as o } from "../../styles.module-C_Z8FrR5.js";
|
|
5
5
|
import '../../assets/index42.css';const y = "_label_b5yys_1", b = "_textarea_b5yys_5", l = {
|
|
6
6
|
label: y,
|