@solibo/solibo-ui 0.3.40 → 0.3.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button/index.cjs +1 -1
- package/dist/components/button/index.cjs.map +1 -1
- package/dist/components/button/index.js +13 -13
- package/dist/components/button/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 +11 -11
- package/dist/components/input/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index33.css');const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index33.css');const a=require("react/jsx-runtime"),u=require("../../classix-5H4IWnMA.cjs"),l=require("react"),d=require("../icon/index.cjs"),_="_button_1cw1v_1",p="_danger_1cw1v_19",b="_minimal_1cw1v_32",g="_primary_1cw1v_39",t={button:_,danger:p,minimal:b,primary:g},y={danger:t.danger,default:t.default,minimal:t.minimal,primary:t.primary},f=l.forwardRef(({children:r,className:i,disabled:o=!1,icon:n,onClick:s,variant:e="default",...c},m)=>a.jsxs("button",{className:u.t(t.button,y[e],i),disabled:o,onClick:s,ref:m,type:"button",...c,"data-component":"button",children:[n&&a.jsx(d.Icon,{gap:"right",name:n,size:"small",variant:e==="minimal"?"default":"white"}),r]}));exports.Button=f;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/button/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { forwardRef } from 'react';\n\nimport { Icon } from '../icon';\nimport { IconName } from '../icon/icons';\nimport styles from './styles.module.css';\n\nconst variants = {\n danger: styles.danger,\n default: styles.default,\n minimal: styles.minimal,\n primary: styles.primary,\n};\n\nexport type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n children: React.ReactNode;\n className?: string;\n disabled?: boolean;\n icon?: IconName;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n variant?: keyof typeof variants;\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n children,\n className,\n disabled = false,\n icon,\n onClick,\n variant = 'default',\n ...props\n },\n ref\n ) => {\n return (\n <button\n className={cx(styles.button, variants[variant], className)}\n disabled={disabled}\n onClick={onClick}\n ref={ref}\n type='button'\n {...props}\n >\n {icon && (\n <Icon\n gap='right'\n name={icon}\n size='small'\n variant={variant === 'minimal' ? 'default' : 'white'}\n />\n )}\n {children}\n </button>\n );\n }\n);\n"],"names":["variants","danger","styles","default","minimal","primary","Button","forwardRef","children","className","disabled","icon","onClick","variant","props","ref","cx","button","jsx","Icon"],"mappings":"8UAOMA,EAAW,CACfC,OAAQC,EAAOD,OACfE,QAASD,EAAOC,QAChBC,QAASF,EAAOE,QAChBC,QAASH,EAAOG,OAClB,EAWaC,EAASC,EAAAA,WACpB,CACE,CACEC,SAAAA,EACAC,UAAAA,EACAC,SAAAA,EAAW,GACXC,KAAAA,EACAC,QAAAA,EACAC,QAAAA,EAAU,UACV,GAAGC,CACL,EACAC,WAGG,SAAA,CACC,UAAWC,EAAAA,EAAGd,EAAOe,OAAQjB,EAASa,CAAO,EAAGJ,CAAS,EACzD,SAAAC,EACA,QAAAE,EACA,IAAAG,EACA,KAAK,SACL,GAAID,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/button/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { forwardRef } from 'react';\n\nimport { Icon } from '../icon';\nimport { IconName } from '../icon/icons';\nimport styles from './styles.module.css';\n\nconst variants = {\n danger: styles.danger,\n default: styles.default,\n minimal: styles.minimal,\n primary: styles.primary,\n};\n\nexport type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n children: React.ReactNode;\n className?: string;\n disabled?: boolean;\n icon?: IconName;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n variant?: keyof typeof variants;\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n children,\n className,\n disabled = false,\n icon,\n onClick,\n variant = 'default',\n ...props\n },\n ref\n ) => {\n return (\n <button\n className={cx(styles.button, variants[variant], className)}\n disabled={disabled}\n onClick={onClick}\n ref={ref}\n type='button'\n {...props}\n >\n {icon && (\n <Icon\n gap='right'\n name={icon}\n size='small'\n variant={variant === 'minimal' ? 'default' : 'white'}\n />\n )}\n {children}\n </button>\n );\n }\n);\n"],"names":["variants","danger","styles","default","minimal","primary","Button","forwardRef","children","className","disabled","icon","onClick","variant","props","ref","cx","button","jsx","Icon"],"mappings":"8UAOMA,EAAW,CACfC,OAAQC,EAAOD,OACfE,QAASD,EAAOC,QAChBC,QAASF,EAAOE,QAChBC,QAASH,EAAOG,OAClB,EAWaC,EAASC,EAAAA,WACpB,CACE,CACEC,SAAAA,EACAC,UAAAA,EACAC,SAAAA,EAAW,GACXC,KAAAA,EACAC,QAAAA,EACAC,QAAAA,EAAU,UACV,GAAGC,CACL,EACAC,WAGG,SAAA,CACC,UAAWC,EAAAA,EAAGd,EAAOe,OAAQjB,EAASa,CAAO,EAAGJ,CAAS,EACzD,SAAAC,EACA,QAAAE,EACA,IAAAG,EACA,KAAK,SACL,GAAID,EAAM,iBAAA,SAETH,SAAAA,CAAAA,GACCO,EAAAA,IAACC,EAAAA,KAAA,CACC,IAAI,QACJ,KAAMR,EACN,KAAK,QACL,QAASE,IAAY,UAAY,UAAY,QAAQ,EAGxDL,CAAAA,EACH,CAGN"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { jsxs as l, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { t as p } from "../../classix-DG18itHa.js";
|
|
3
3
|
import { forwardRef as u } from "react";
|
|
4
|
-
import { Icon as
|
|
5
|
-
import '../../assets/index33.css';const
|
|
6
|
-
button:
|
|
4
|
+
import { Icon as d } from "../icon/index.js";
|
|
5
|
+
import '../../assets/index33.css';const _ = "_button_1cw1v_1", f = "_danger_1cw1v_19", b = "_minimal_1cw1v_32", g = "_primary_1cw1v_39", t = {
|
|
6
|
+
button: _,
|
|
7
7
|
danger: f,
|
|
8
|
-
minimal:
|
|
9
|
-
primary:
|
|
10
|
-
},
|
|
8
|
+
minimal: b,
|
|
9
|
+
primary: g
|
|
10
|
+
}, y = {
|
|
11
11
|
danger: t.danger,
|
|
12
12
|
default: t.default,
|
|
13
13
|
minimal: t.minimal,
|
|
14
14
|
primary: t.primary
|
|
15
15
|
}, j = u(({
|
|
16
|
-
children:
|
|
16
|
+
children: r,
|
|
17
17
|
className: m,
|
|
18
|
-
disabled:
|
|
19
|
-
icon:
|
|
20
|
-
onClick:
|
|
18
|
+
disabled: o = !1,
|
|
19
|
+
icon: n,
|
|
20
|
+
onClick: i,
|
|
21
21
|
variant: a = "default",
|
|
22
22
|
...e
|
|
23
|
-
}, s) => /* @__PURE__ */ l("button", { className: p(t.button,
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
}, s) => /* @__PURE__ */ l("button", { className: p(t.button, y[a], m), disabled: o, onClick: i, ref: s, type: "button", ...e, "data-component": "button", children: [
|
|
24
|
+
n && /* @__PURE__ */ c(d, { gap: "right", name: n, size: "small", variant: a === "minimal" ? "default" : "white" }),
|
|
25
|
+
r
|
|
26
26
|
] }));
|
|
27
27
|
export {
|
|
28
28
|
j as Button
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/button/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { forwardRef } from 'react';\n\nimport { Icon } from '../icon';\nimport { IconName } from '../icon/icons';\nimport styles from './styles.module.css';\n\nconst variants = {\n danger: styles.danger,\n default: styles.default,\n minimal: styles.minimal,\n primary: styles.primary,\n};\n\nexport type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n children: React.ReactNode;\n className?: string;\n disabled?: boolean;\n icon?: IconName;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n variant?: keyof typeof variants;\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n children,\n className,\n disabled = false,\n icon,\n onClick,\n variant = 'default',\n ...props\n },\n ref\n ) => {\n return (\n <button\n className={cx(styles.button, variants[variant], className)}\n disabled={disabled}\n onClick={onClick}\n ref={ref}\n type='button'\n {...props}\n >\n {icon && (\n <Icon\n gap='right'\n name={icon}\n size='small'\n variant={variant === 'minimal' ? 'default' : 'white'}\n />\n )}\n {children}\n </button>\n );\n }\n);\n"],"names":["variants","danger","styles","default","minimal","primary","Button","forwardRef","children","className","disabled","icon","onClick","variant","props","ref","cx","button","jsx","Icon"],"mappings":";;;;;;;;;GAOMA,IAAW;AAAA,EACfC,QAAQC,EAAOD;AAAAA,EACfE,SAASD,EAAOC;AAAAA,EAChBC,SAASF,EAAOE;AAAAA,EAChBC,SAASH,EAAOG;AAClB,GAWaC,IAASC,EACpB,CACE;AAAA,EACEC,UAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,MAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,SAAAA,IAAU;AAAA,EACV,GAAGC;AACL,GACAC,wBAGG,UAAA,EACC,WAAWC,EAAGd,EAAOe,QAAQjB,EAASa,CAAO,GAAGJ,CAAS,GACzD,UAAAC,GACA,SAAAE,GACA,KAAAG,GACA,MAAK,UACL,GAAID,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/button/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { forwardRef } from 'react';\n\nimport { Icon } from '../icon';\nimport { IconName } from '../icon/icons';\nimport styles from './styles.module.css';\n\nconst variants = {\n danger: styles.danger,\n default: styles.default,\n minimal: styles.minimal,\n primary: styles.primary,\n};\n\nexport type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n children: React.ReactNode;\n className?: string;\n disabled?: boolean;\n icon?: IconName;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n variant?: keyof typeof variants;\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n children,\n className,\n disabled = false,\n icon,\n onClick,\n variant = 'default',\n ...props\n },\n ref\n ) => {\n return (\n <button\n className={cx(styles.button, variants[variant], className)}\n disabled={disabled}\n onClick={onClick}\n ref={ref}\n type='button'\n {...props}\n >\n {icon && (\n <Icon\n gap='right'\n name={icon}\n size='small'\n variant={variant === 'minimal' ? 'default' : 'white'}\n />\n )}\n {children}\n </button>\n );\n }\n);\n"],"names":["variants","danger","styles","default","minimal","primary","Button","forwardRef","children","className","disabled","icon","onClick","variant","props","ref","cx","button","jsx","Icon"],"mappings":";;;;;;;;;GAOMA,IAAW;AAAA,EACfC,QAAQC,EAAOD;AAAAA,EACfE,SAASD,EAAOC;AAAAA,EAChBC,SAASF,EAAOE;AAAAA,EAChBC,SAASH,EAAOG;AAClB,GAWaC,IAASC,EACpB,CACE;AAAA,EACEC,UAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,MAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,SAAAA,IAAU;AAAA,EACV,GAAGC;AACL,GACAC,wBAGG,UAAA,EACC,WAAWC,EAAGd,EAAOe,QAAQjB,EAASa,CAAO,GAAGJ,CAAS,GACzD,UAAAC,GACA,SAAAE,GACA,KAAAG,GACA,MAAK,UACL,GAAID,GAAM,kBAAA,UAETH,UAAAA;AAAAA,EAAAA,KACC,gBAAAO,EAACC,GAAA,EACC,KAAI,SACJ,MAAMR,GACN,MAAK,SACL,SAASE,MAAY,YAAY,YAAY,SAAQ;AAAA,EAGxDL;AAAAA,GACH,CAGN;"}
|
|
@@ -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"),l=require("../../classix-5H4IWnMA.cjs"),s=require("react"),I=require("../../icons-C_cX1FYp.cjs"),P=require("../../utils-DqVa4K58.cjs"),a=require("../../styles.module-CwroCNAt.cjs"),R=s.forwardRef(({className:p,defaultCountryCode:d="+47",disabled:i=!1,icon:o,label:h,placeholder:m,type:t="text",...e},v)=>{const[c,g]=s.useState(""),[r,x]=s.useState(""),{onChange:y,value:j,...N}=e,{touched:f,onBlur:S}=P.useTouched(j===""),q=o&&t!=="radio"&&t!=="datetime-local"?{"--icon-svg":I.iconSVG(o,!0)}:void 0;s.useEffect(()=>{if(typeof e.onChange=="function"&&t==="tel"){const u={name:e.name,value:r?(c||d).split(" ").join("")+r.split(" ").join(""):void 0};e.onChange({target:u,currentTarget:u})}},[c,r]),s.useEffect(()=>{t==="tel"&&!e.value&&(x(""),g(""))},[e.value,t]);const C=n.jsxs(n.Fragment,{children:[n.jsx("input",{disabled:i,hidden:!0,onChange:y,pattern:void 0,placeholder:m,ref:v,type:t,value:j}),n.jsx("input",{type:"text",className:a.inputStyles.input,disabled:i,maxLength:5,onChange:u=>g(u.target.value),placeholder:d,value:c}),n.jsx("input",{type:"tel",className:l.t(a.inputStyles.input,f&&"touched"),"data-icon":o?"true":void 0,disabled:i,maxLength:14,name:void 0,onChange:u=>x(u.target.value),onBlur:S,pattern:e.pattern,style:q,value:r,...N})]});return n.jsxs("label",{className:a.inputStyles.label,"data-component":"input",children:[h&&n.jsx("span",{className:l.t(e.required&&a.inputStyles.required),children:h}),t==="tel"?C:n.jsx("input",{ref:v,className:l.t(a.inputStyles.input,p,f&&"touched"),"data-icon":o?"true":void 0,disabled:i,onBlur:S,placeholder:m,style:q,type:t,...e})]})});exports.Input=R;
|
|
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 { forwardRef, 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.ComponentPropsWithoutRef<'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 const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n defaultCountryCode = '+47',\n disabled = false,\n icon,\n label,\n placeholder,\n type = 'text',\n ...props\n },\n ref\n ) => {\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);\n"],"names":["Input","forwardRef","className","defaultCountryCode","disabled","icon","label","placeholder","type","props","ref","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":"0SAkBaA,EAAQC,EAAAA,WACnB,CACE,CACEC,UAAAA,EACAC,mBAAAA,EAAqB,MACrBC,SAAAA,EAAW,GACXC,KAAAA,EACAC,MAAAA,EACAC,YAAAA,EACAC,KAAAA,EAAO,OACP,GAAGC,CACL,EACAC,IACG,CACH,KAAM,CAACC,EAAaC,CAAc,EAAIC,EAAAA,SAAS,EAAE,EAC3C,CAACC,EAAaC,CAAc,EAAIF,EAAAA,SAAS,EAAE,EAC3C,CAAEG,SAAAA,EAAUC,MAAAA,EAAO,GAAGC,CAAAA,EAAcT,EACpC,CAAEU,QAAAA,EAASC,OAAAA,CAAAA,EAAWC,EAAAA,WAAWJ,IAAU,EAAE,EAQ7CK,EACJjB,GAAQG,IAAS,SAAWA,IAAS,iBACjC,CACE,aAAce,EAAAA,QAAQlB,EAAM,EAAI,CAAA,EAElCmB,OAENC,EAAAA,UAAU,IAAM,CACd,GAAI,OAAOhB,EAAMO,UAAa,YAAcR,IAAS,MAAO,CAC1D,MAAMkB,EAAS,CACbC,KAAMlB,EAAMkB,KACZV,MAAOH,GACFH,GAAeR,GAAoByB,MAAM,GAAG,EAAEC,KAAK,EAAE,EACtDf,EAAYc,MAAM,GAAG,EAAEC,KAAK,EAAE,EAC9BL,MAAAA,EAGLf,EAAMO,SAAiB,CAAEU,OAAAA,EAAQI,cAAeJ,CAAAA,CAAQ,CAC3D,CAEF,EAAG,CAACf,EAAaG,CAAW,CAAC,EAE7BW,EAAAA,UAAU,IAAM,CACVjB,IAAS,OAAS,CAACC,EAAMQ,QAC3BF,EAAe,EAAE,EACjBH,EAAe,EAAE,EAErB,EAAG,CAACH,EAAMQ,MAAOT,CAAI,CAAC,EAEtB,MAAMuB,EACJC,EAAAA,KAAAC,EAAAA,SAAA,CACE,SAAA,CAAAC,EAAAA,IAAC,QAAA,CACC,SAAA9B,EACA,OAAM,GACN,SAAAY,EACA,QAASQ,OACT,YAAAjB,EACA,IAAAG,EACA,KAAAF,EACA,MAAAS,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,QAASX,EAAM8B,QACf,MAAOjB,EACP,MAAOR,EACP,GAAII,CAAAA,CAAU,CAAA,EAElB,EAGF,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/input/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { forwardRef, 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.ComponentPropsWithoutRef<'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 const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n defaultCountryCode = '+47',\n disabled = false,\n icon,\n label,\n placeholder,\n type = 'text',\n ...props\n },\n ref\n ) => {\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);\n"],"names":["Input","forwardRef","className","defaultCountryCode","disabled","icon","label","placeholder","type","props","ref","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":"0SAkBaA,EAAQC,EAAAA,WACnB,CACE,CACEC,UAAAA,EACAC,mBAAAA,EAAqB,MACrBC,SAAAA,EAAW,GACXC,KAAAA,EACAC,MAAAA,EACAC,YAAAA,EACAC,KAAAA,EAAO,OACP,GAAGC,CACL,EACAC,IACG,CACH,KAAM,CAACC,EAAaC,CAAc,EAAIC,EAAAA,SAAS,EAAE,EAC3C,CAACC,EAAaC,CAAc,EAAIF,EAAAA,SAAS,EAAE,EAC3C,CAAEG,SAAAA,EAAUC,MAAAA,EAAO,GAAGC,CAAAA,EAAcT,EACpC,CAAEU,QAAAA,EAASC,OAAAA,CAAAA,EAAWC,EAAAA,WAAWJ,IAAU,EAAE,EAQ7CK,EACJjB,GAAQG,IAAS,SAAWA,IAAS,iBACjC,CACE,aAAce,EAAAA,QAAQlB,EAAM,EAAI,CAAA,EAElCmB,OAENC,EAAAA,UAAU,IAAM,CACd,GAAI,OAAOhB,EAAMO,UAA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7B,EAAM+B,UAAYL,EAAAA,YAAOK,QAAQ,EAAIlC,SAAAA,CAAAA,CAAM,EACxEE,IAAS,MACRuB,EAEAG,EAAAA,IAAC,QAAA,CACC,IAAAxB,EACA,UAAW4B,EAAAA,EAAGH,EAAAA,YAAOC,MAAOlC,EAAWiB,GAAW,SAAS,EAC3D,YAAWd,EAAO,OAASmB,OAC3B,SAAApB,EACA,OAAAgB,EACA,YAAAb,EACA,MAAOe,EACP,KAAAd,EACA,GAAIC,CAAAA,CAAM,CAAA,EAGhB,CAEJ,CACF"}
|
|
@@ -8,44 +8,44 @@ const y = T(({
|
|
|
8
8
|
className: q,
|
|
9
9
|
defaultCountryCode: c = "+47",
|
|
10
10
|
disabled: u = !1,
|
|
11
|
-
icon:
|
|
11
|
+
icon: i,
|
|
12
12
|
label: m,
|
|
13
13
|
placeholder: h,
|
|
14
14
|
type: e = "text",
|
|
15
15
|
...t
|
|
16
16
|
}, d) => {
|
|
17
|
-
const [s, v] = j(""), [
|
|
17
|
+
const [s, v] = j(""), [r, f] = j(""), {
|
|
18
18
|
onChange: w,
|
|
19
19
|
value: g,
|
|
20
20
|
...I
|
|
21
21
|
} = t, {
|
|
22
|
-
touched:
|
|
23
|
-
onBlur:
|
|
24
|
-
} = B(g === ""),
|
|
25
|
-
"--icon-svg": V(
|
|
22
|
+
touched: p,
|
|
23
|
+
onBlur: x
|
|
24
|
+
} = B(g === ""), N = i && e !== "radio" && e !== "datetime-local" ? {
|
|
25
|
+
"--icon-svg": V(i, !0)
|
|
26
26
|
} : void 0;
|
|
27
27
|
S(() => {
|
|
28
28
|
if (typeof t.onChange == "function" && e === "tel") {
|
|
29
29
|
const n = {
|
|
30
30
|
name: t.name,
|
|
31
|
-
value:
|
|
31
|
+
value: r ? (s || c).split(" ").join("") + r.split(" ").join("") : void 0
|
|
32
32
|
};
|
|
33
33
|
t.onChange({
|
|
34
34
|
target: n,
|
|
35
35
|
currentTarget: n
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
}, [s,
|
|
38
|
+
}, [s, r]), S(() => {
|
|
39
39
|
e === "tel" && !t.value && (f(""), v(""));
|
|
40
40
|
}, [t.value, e]);
|
|
41
41
|
const L = /* @__PURE__ */ C(P, { children: [
|
|
42
42
|
/* @__PURE__ */ a("input", { disabled: u, hidden: !0, onChange: w, pattern: void 0, placeholder: h, ref: d, type: e, value: g }),
|
|
43
43
|
/* @__PURE__ */ a("input", { type: "text", className: o.input, disabled: u, maxLength: 5, onChange: (n) => v(n.target.value), placeholder: c, value: s }),
|
|
44
|
-
/* @__PURE__ */ a("input", { type: "tel", className: l(o.input,
|
|
44
|
+
/* @__PURE__ */ a("input", { type: "tel", className: l(o.input, p && "touched"), "data-icon": i ? "true" : void 0, disabled: u, maxLength: 14, name: void 0, onChange: (n) => f(n.target.value), onBlur: x, pattern: t.pattern, style: N, value: r, ...I })
|
|
45
45
|
] });
|
|
46
|
-
return /* @__PURE__ */ C("label", { className: o.label, children: [
|
|
46
|
+
return /* @__PURE__ */ C("label", { className: o.label, "data-component": "input", children: [
|
|
47
47
|
m && /* @__PURE__ */ a("span", { className: l(t.required && o.required), children: m }),
|
|
48
|
-
e === "tel" ? L : /* @__PURE__ */ a("input", { ref: d, className: l(o.input, q,
|
|
48
|
+
e === "tel" ? L : /* @__PURE__ */ a("input", { ref: d, className: l(o.input, q, p && "touched"), "data-icon": i ? "true" : void 0, disabled: u, onBlur: x, placeholder: h, style: N, type: e, ...t })
|
|
49
49
|
] });
|
|
50
50
|
});
|
|
51
51
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/input/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { forwardRef, 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.ComponentPropsWithoutRef<'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 const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n defaultCountryCode = '+47',\n disabled = false,\n icon,\n label,\n placeholder,\n type = 'text',\n ...props\n },\n ref\n ) => {\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);\n"],"names":["Input","forwardRef","className","defaultCountryCode","disabled","icon","label","placeholder","type","props","ref","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,MAAMA,IAAQC,EACnB,CACE;AAAA,EACEC,WAAAA;AAAAA,EACAC,oBAAAA,IAAqB;AAAA,EACrBC,UAAAA,IAAW;AAAA,EACXC,MAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,MAAAA,IAAO;AAAA,EACP,GAAGC;AACL,GACAC,MACG;AACH,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,IAAcT,GACpC;AAAA,IAAEU,SAAAA;AAAAA,IAASC,QAAAA;AAAAA,EAAAA,IAAWC,EAAWJ,MAAU,EAAE,GAQ7CK,IACJjB,KAAQG,MAAS,WAAWA,MAAS,mBACjC;AAAA,IACE,cAAce,EAAQlB,GAAM,EAAI;AAAA,EAAA,IAElCmB;AAENC,EAAAA,EAAU,MAAM;AACd,QAAI,OAAOhB,EAAMO,YAAa,cAAcR,MAAS,OAAO;AAC1D,YAAMkB,IAAS;AAAA,QACbC,MAAMlB,EAAMkB;AAAAA,QACZV,OAAOH,KACFH,KAAeR,GAAoByB,MAAM,GAAG,EAAEC,KAAK,EAAE,IACtDf,EAAYc,MAAM,GAAG,EAAEC,KAAK,EAAE,IAC9BL;AAAAA,MAAAA;AAGLf,MAAAA,EAAMO,SAAiB;AAAA,QAAEU,QAAAA;AAAAA,QAAQI,eAAeJ;AAAAA,MAAAA,CAAQ;AAAA,IAC3D;AAAA,EAEF,GAAG,CAACf,GAAaG,CAAW,CAAC,GAE7BW,EAAU,MAAM;AACd,IAAIjB,MAAS,SAAS,CAACC,EAAMQ,UAC3BF,EAAe,EAAE,GACjBH,EAAe,EAAE;AAAA,EAErB,GAAG,CAACH,EAAMQ,OAAOT,CAAI,CAAC;AAEtB,QAAMuB,IACJ,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC,EAAC,SAAA,EACC,UAAA9B,GACA,QAAM,IACN,UAAAY,GACA,SAASQ,QACT,aAAAjB,GACA,KAAAG,GACA,MAAAF,GACA,OAAAS,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,SAASX,EAAM8B,SACf,OAAOjB,GACP,OAAOR,GACP,GAAII,EAAAA,CAAU;AAAA,EAAA,GAElB;AAGF,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/input/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { forwardRef, 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.ComponentPropsWithoutRef<'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 const Input = forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n defaultCountryCode = '+47',\n disabled = false,\n icon,\n label,\n placeholder,\n type = 'text',\n ...props\n },\n ref\n ) => {\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);\n"],"names":["Input","forwardRef","className","defaultCountryCode","disabled","icon","label","placeholder","type","props","ref","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,MAAMA,IAAQC,EACnB,CACE;AAAA,EACEC,WAAAA;AAAAA,EACAC,oBAAAA,IAAqB;AAAA,EACrBC,UAAAA,IAAW;AAAA,EACXC,MAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,MAAAA,IAAO;AAAA,EACP,GAAGC;AACL,GACAC,MACG;AACH,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,IAAcT,GACpC;AAAA,IAAEU,SAAAA;AAAAA,IAASC,QAAAA;AAAAA,EAAAA,IAAWC,EAAWJ,MAAU,EAAE,GAQ7CK,IACJjB,KAAQG,MAAS,WAAWA,MAAS,mBACjC;AAAA,IACE,cAAce,EAAQlB,G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