@solibo/solibo-ui 1.1.1 → 1.1.2

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.
Files changed (37) hide show
  1. package/dist/components/checkbox/index.cjs +1 -1
  2. package/dist/components/checkbox/index.js +1 -1
  3. package/dist/components/dropdown/index.cjs +1 -1
  4. package/dist/components/dropdown/index.js +3 -3
  5. package/dist/components/editor/index.cjs +1 -1
  6. package/dist/components/editor/index.js +1 -1
  7. package/dist/components/icon/index.cjs +1 -1
  8. package/dist/components/icon/index.cjs.map +1 -1
  9. package/dist/components/icon/index.js +15 -16
  10. package/dist/components/icon/index.js.map +1 -1
  11. package/dist/components/input/index.cjs +1 -1
  12. package/dist/components/input/index.js +2 -2
  13. package/dist/components/nav/index.cjs +1 -1
  14. package/dist/components/nav/index.js +1 -1
  15. package/dist/components/search/index.cjs +1 -1
  16. package/dist/components/search/index.cjs.map +1 -1
  17. package/dist/components/search/index.js +58 -53
  18. package/dist/components/search/index.js.map +1 -1
  19. package/dist/components/select/index.cjs +1 -1
  20. package/dist/components/select/index.js +2 -2
  21. package/dist/{icons-Dm2kyF0g.js → icons-D5KQxBn7.js} +5 -5
  22. package/dist/{icons-Dm2kyF0g.js.map → icons-D5KQxBn7.js.map} +1 -1
  23. package/dist/{icons-B_uIKmIp.cjs → icons-DPSOZZAy.cjs} +2 -2
  24. package/dist/{icons-B_uIKmIp.cjs.map → icons-DPSOZZAy.cjs.map} +1 -1
  25. package/dist/{index-Y3jsTJhs.cjs → index-BXHfIfib.cjs} +2 -2
  26. package/dist/{index-Y3jsTJhs.cjs.map → index-BXHfIfib.cjs.map} +1 -1
  27. package/dist/{index-rXfEqyt5.cjs → index-CoUj6S0o.cjs} +2 -2
  28. package/dist/{index-rXfEqyt5.cjs.map → index-CoUj6S0o.cjs.map} +1 -1
  29. package/dist/{index-DycOZMJl.js → index-DKe_FTGA.js} +2 -2
  30. package/dist/{index-DycOZMJl.js.map → index-DKe_FTGA.js.map} +1 -1
  31. package/dist/{index-m3slpD7c.js → index-KbL6DkMp.js} +2 -2
  32. package/dist/{index-m3slpD7c.js.map → index-KbL6DkMp.js.map} +1 -1
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.d.ts +2 -2
  35. package/dist/index.js +2 -2
  36. package/dist/tokens.json +1 -1
  37. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index-Y3jsTJhs.cjs","sources":["../src/components/select/sanitize-select-props.ts","../src/utils/color.ts","../src/components/select/index.tsx"],"sourcesContent":["const selectKeys = new Set([\n 'aria-activedescendant',\n 'aria-autocomplete',\n 'aria-busy',\n 'aria-controls',\n 'aria-describedby',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-live',\n 'aria-owns',\n 'aria-required',\n 'aria-roledescription',\n 'autoComplete',\n 'autoFocus',\n 'className',\n 'defaultValue',\n 'dir',\n 'disabled',\n 'form',\n 'id',\n 'multiple',\n 'name',\n 'onBlur',\n 'onChange',\n 'onClick',\n 'onFocus',\n 'onInput',\n 'onInvalid',\n 'onKeyDown',\n 'onKeyUp',\n 'onMouseDown',\n 'onMouseUp',\n 'onPointerDown',\n 'onPointerUp',\n 'required',\n 'role',\n 'size',\n 'style',\n 'tabIndex',\n 'title',\n 'value',\n]);\n\nexport function sanitizeSelectProps<T extends Record<string, unknown>>(props: T) {\n return Object.fromEntries(\n Object.entries(props).filter(\n ([key]) => key.startsWith('data-') || key.startsWith('aria-') || selectKeys.has(key)\n )\n ) as Partial<T>;\n}\n","const cssVariablePattern = /^--[\\w-]+$/;\nconst cssVariableReferencePattern = /^var\\(\\s*(--[\\w-]+)\\s*(?:,\\s*(.+))?\\)$/;\n\nconst unresolvedColorKeywords = new Set([\n 'currentcolor',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n]);\n\nconst probe = typeof document !== 'undefined' ? document.createElement('span') : null;\n\nfunction normalizeColorValue(input: string): string {\n const value = input.trim();\n\n if (!value || !probe || unresolvedColorKeywords.has(value.toLowerCase())) {\n return value;\n }\n\n const mountNode = document.body ?? document.documentElement;\n\n if (!mountNode) {\n return value;\n }\n\n probe.style.color = value;\n\n if (!probe.style.color) {\n return value;\n }\n\n mountNode.appendChild(probe);\n\n const normalized = getComputedStyle(probe).color.trim();\n probe.remove();\n\n return normalized || value;\n}\n\nexport function resolveColor(input: `--${string}` | string, fallback = 'currentColor'): string {\n if (typeof document === 'undefined') {\n return fallback;\n }\n\n const styles = getComputedStyle(document.documentElement);\n const seen = new Set<string>();\n let current = input.trim();\n\n while (current) {\n const match = current.match(cssVariableReferencePattern);\n const variableName = match?.[1] ?? (cssVariablePattern.test(current) ? current : null);\n const nestedFallback = match?.[2]?.trim();\n\n if (!variableName) {\n return normalizeColorValue(current);\n }\n\n if (seen.has(variableName)) {\n current = nestedFallback ?? '';\n continue;\n }\n\n seen.add(variableName);\n\n current = styles.getPropertyValue(variableName).trim() || nestedFallback || '';\n }\n\n return normalizeColorValue(fallback);\n}\n","import cx from 'classix';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\nimport { resolveColor } from '@/utils/color';\nimport { composeEventHandlers } from '@/utils/compose-event-handlers';\nimport { useTouched } from '@/utils/use-touched';\n\nimport { sanitizeSelectProps } from './sanitize-select-props';\nimport styles from './styles.module.css';\n\nexport type SelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {\n children: React.ReactNode;\n label?: string;\n placeholder?: string;\n};\n\ntype withVars = React.CSSProperties & {\n '--icon-svg'?: string;\n};\n\nexport const Select = ({ children, label, placeholder, ...props }: SelectProps) => {\n const { touched, onBlur } = useTouched(props.value === '');\n const selectProps = sanitizeSelectProps(props);\n const { className, onBlur: onBlurProp, style, ...restSelectProps } = selectProps;\n const withVars = {\n ...style,\n '--icon-svg': iconSVG('CaretDown', resolveColor('--colors-semantic-content-secondary')),\n } satisfies withVars;\n\n const selectElement = (\n <select\n className={cx(styles.select, className, touched && styles.touched)}\n onBlur={composeEventHandlers(onBlur, onBlurProp)}\n style={withVars}\n {...restSelectProps}\n >\n {placeholder && (\n <option\n key='placeholder'\n value={''}\n hidden\n >\n {placeholder}\n </option>\n )}\n {children}\n </select>\n );\n\n if (!label) {\n return selectElement;\n }\n\n return (\n <label>\n <span\n className={styles.label}\n data-required={props.required || undefined}\n >\n {label}\n </span>\n {selectElement}\n </label>\n );\n};\n"],"names":["selectKeys","Set","sanitizeSelectProps","props","Object","fromEntries","entries","filter","key","startsWith","has","cssVariablePattern","cssVariableReferencePattern","unresolvedColorKeywords","probe","document","createElement","normalizeColorValue","input","value","trim","toLowerCase","mountNode","body","documentElement","style","color","appendChild","normalized","getComputedStyle","remove","resolveColor","fallback","styles","seen","current","match","variableName","test","nestedFallback","add","getPropertyValue","Select","children","label","placeholder","touched","onBlur","useTouched","selectProps","className","onBlurProp","restSelectProps","withVars","iconSVG","selectElement","cx","select","composeEventHandlers","jsxs","jsx","required","undefined"],"mappings":"gKAAMA,EAAa,IAAIC,IAAI,CACzB,wBACA,oBACA,YACA,gBACA,mBACA,eACA,gBACA,oBACA,gBACA,gBACA,cACA,eACA,oBACA,aACA,kBACA,YACA,YACA,gBACA,uBACA,eACA,YACA,YACA,eACA,MACA,WACA,OACA,KACA,WACA,OACA,SACA,WACA,UACA,UACA,UACA,YACA,YACA,UACA,cACA,YACA,gBACA,cACA,WACA,OACA,OACA,QACA,WACA,QACA,OAAO,CACR,EAEM,SAASC,EAAuDC,EAAU,CAC/E,OAAOC,OAAOC,YACZD,OAAOE,QAAQH,CAAK,EAAEI,OACpB,CAAC,CAACC,CAAG,IAAMA,EAAIC,WAAW,OAAO,GAAKD,EAAIC,WAAW,OAAO,GAAKT,EAAWU,IAAIF,CAAG,CACrF,CACF,CACF,CCzDA,MAAMG,EAAqB,aACrBC,EAA8B,yCAE9BC,EAA0B,IAAIZ,IAA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AA,EAAa,GAAG1C,CAAmB,IAAM,CACjF,KAAM,CAAE2C,QAAAA,EAASC,OAAAA,CAAAA,EAAWC,aAAW7C,EAAMgB,QAAU,EAAE,EACnD8B,EAAc/C,EAAoBC,CAAK,EACvC,CAAE+C,UAAAA,EAAWH,OAAQI,EAAY1B,MAAAA,EAAO,GAAG2B,CAAAA,EAAoBH,EAC/DI,EAAW,CACf,GAAG5B,EACH,aAAc6B,EAAAA,QAAQ,YAAavB,EAAa,qCAAqC,CAAC,CAAA,EAGlFwB,SACH,SAAA,CACC,UAAWC,EAAAA,EAAGvB,EAAOwB,OAAQP,EAAWJ,GAAWb,EAAOa,OAAO,EACjE,OAAQY,EAAAA,qBAAqBX,EAAQI,CAAU,EAC/C,MAAOE,EACP,GAAID,EAEHP,SAAAA,CAAAA,SACE,SAAA,CAEC,MAAO,GACP,OAAM,GAELA,YAJG,aAKN,EAEDF,CAAAA,EACH,EAGF,OAAKC,EAKHe,EAAAA,KAAC,QAAA,CAAK,iBAAA,SACJ,SAAA,CAAAC,EAAAA,IAAC,OAAA,CACC,UAAW3B,EAAOW,MAClB,gBAAezC,EAAM0D,UAAYC,OAEhClB,SAAAA,CAAAA,CACH,EACCW,CAAAA,EACH,EAZOA,CAcX"}
1
+ {"version":3,"file":"index-BXHfIfib.cjs","sources":["../src/components/select/sanitize-select-props.ts","../src/utils/color.ts","../src/components/select/index.tsx"],"sourcesContent":["const selectKeys = new Set([\n 'aria-activedescendant',\n 'aria-autocomplete',\n 'aria-busy',\n 'aria-controls',\n 'aria-describedby',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-live',\n 'aria-owns',\n 'aria-required',\n 'aria-roledescription',\n 'autoComplete',\n 'autoFocus',\n 'className',\n 'defaultValue',\n 'dir',\n 'disabled',\n 'form',\n 'id',\n 'multiple',\n 'name',\n 'onBlur',\n 'onChange',\n 'onClick',\n 'onFocus',\n 'onInput',\n 'onInvalid',\n 'onKeyDown',\n 'onKeyUp',\n 'onMouseDown',\n 'onMouseUp',\n 'onPointerDown',\n 'onPointerUp',\n 'required',\n 'role',\n 'size',\n 'style',\n 'tabIndex',\n 'title',\n 'value',\n]);\n\nexport function sanitizeSelectProps<T extends Record<string, unknown>>(props: T) {\n return Object.fromEntries(\n Object.entries(props).filter(\n ([key]) => key.startsWith('data-') || key.startsWith('aria-') || selectKeys.has(key)\n )\n ) as Partial<T>;\n}\n","const cssVariablePattern = /^--[\\w-]+$/;\nconst cssVariableReferencePattern = /^var\\(\\s*(--[\\w-]+)\\s*(?:,\\s*(.+))?\\)$/;\n\nconst unresolvedColorKeywords = new Set([\n 'currentcolor',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n]);\n\nconst probe = typeof document !== 'undefined' ? document.createElement('span') : null;\n\nfunction normalizeColorValue(input: string): string {\n const value = input.trim();\n\n if (!value || !probe || unresolvedColorKeywords.has(value.toLowerCase())) {\n return value;\n }\n\n const mountNode = document.body ?? document.documentElement;\n\n if (!mountNode) {\n return value;\n }\n\n probe.style.color = value;\n\n if (!probe.style.color) {\n return value;\n }\n\n mountNode.appendChild(probe);\n\n const normalized = getComputedStyle(probe).color.trim();\n probe.remove();\n\n return normalized || value;\n}\n\nexport function resolveColor(input: `--${string}` | string, fallback = 'currentColor'): string {\n if (typeof document === 'undefined') {\n return fallback;\n }\n\n const styles = getComputedStyle(document.documentElement);\n const seen = new Set<string>();\n let current = input.trim();\n\n while (current) {\n const match = current.match(cssVariableReferencePattern);\n const variableName = match?.[1] ?? (cssVariablePattern.test(current) ? current : null);\n const nestedFallback = match?.[2]?.trim();\n\n if (!variableName) {\n return normalizeColorValue(current);\n }\n\n if (seen.has(variableName)) {\n current = nestedFallback ?? '';\n continue;\n }\n\n seen.add(variableName);\n\n current = styles.getPropertyValue(variableName).trim() || nestedFallback || '';\n }\n\n return normalizeColorValue(fallback);\n}\n","import cx from 'classix';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\nimport { resolveColor } from '@/utils/color';\nimport { composeEventHandlers } from '@/utils/compose-event-handlers';\nimport { useTouched } from '@/utils/use-touched';\n\nimport { sanitizeSelectProps } from './sanitize-select-props';\nimport styles from './styles.module.css';\n\nexport type SelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {\n children: React.ReactNode;\n label?: string;\n placeholder?: string;\n};\n\ntype withVars = React.CSSProperties & {\n '--icon-svg'?: string;\n};\n\nexport const Select = ({ children, label, placeholder, ...props }: SelectProps) => {\n const { touched, onBlur } = useTouched(props.value === '');\n const selectProps = sanitizeSelectProps(props);\n const { className, onBlur: onBlurProp, style, ...restSelectProps } = selectProps;\n const withVars = {\n ...style,\n '--icon-svg': iconSVG('CaretDown', resolveColor('--colors-semantic-content-secondary')),\n } satisfies withVars;\n\n const selectElement = (\n <select\n className={cx(styles.select, className, touched && styles.touched)}\n onBlur={composeEventHandlers(onBlur, onBlurProp)}\n style={withVars}\n {...restSelectProps}\n >\n {placeholder && (\n <option\n key='placeholder'\n value={''}\n hidden\n >\n {placeholder}\n </option>\n )}\n {children}\n </select>\n );\n\n if (!label) {\n return selectElement;\n }\n\n return (\n <label>\n <span\n className={styles.label}\n data-required={props.required || undefined}\n >\n {label}\n </span>\n {selectElement}\n </label>\n );\n};\n"],"names":["selectKeys","Set","sanitizeSelectProps","props","Object","fromEntries","entries","filter","key","startsWith","has","cssVariablePattern","cssVariableReferencePattern","unresolvedColorKeywords","probe","document","createElement","normalizeColorValue","input","value","trim","toLowerCase","mountNode","body","documentElement","style","color","appendChild","normalized","getComputedStyle","remove","resolveColor","fallback","styles","seen","current","match","variableName","test","nestedFallback","add","getPropertyValue","Select","children","label","placeholder","touched","onBlur","useTouched","selectProps","className","onBlurProp","restSelectProps","withVars","iconSVG","selectElement","cx","select","composeEventHandlers","jsxs","jsx","required","undefined"],"mappings":"gKAAMA,EAAa,IA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C,EAAM0D,UAAYC,OAEhClB,SAAAA,CAAAA,CACH,EACCW,CAAAA,EACH,EAZOA,CAcX"}
@@ -1,2 +1,2 @@
1
- "use strict";require('./assets/index45.css');const o=require("react/jsx-runtime"),d=require("./classix-5H4IWnMA.cjs"),p=require("react"),V=require("./icons-B_uIKmIp.cjs"),E=require("./use-touched-Bq5Gjbpz.cjs");function w(t){return t&&`${t[0].toLocaleUpperCase()}${t.slice(1)}`}function S(t){const n=w(t);return n&&!n.endsWith(":")?`${n}:`:n}const G="_input_p0mz8_3",H="_touched_p0mz8_43",U="_label_p0mz8_48",W="_inline_p0mz8_69",k="_code_p0mz8_86",s={input:G,touched:H,label:U,inline:W,code:k};function A({className:t,defaultCountryCode:n="+47",disabled:c=!1,icon:g,label:h,onBlur:T,placeholder:f,ref:j,required:m,style:v,type:e="text",variant:_="default",...L}){const[x,b]=p.useState(""),[u,z]=p.useState(""),{name:I,onChange:a,pattern:$,value:l,...F}=L,{touched:B,onBlur:P}=E.useTouched(l===""),r=g&&e!=="radio"&&e!=="datetime-local"?g:void 0,N=h&&_==="inline"?S(h):h,q=r?{...v,"--icon-svg":V.iconSVG(r)}:v,C=E.composeEventHandlers(P,T);p.useEffect(()=>{if(a&&e==="tel"){const i={name:I,value:u?(x||n).split(" ").join("")+u.split(" ").join(""):void 0};a({target:i,currentTarget:i})}},[x,n,I,a,u,e]),p.useEffect(()=>{e==="tel"&&!l&&(z(""),b(""))},[e,l]);const R=o.jsxs(o.Fragment,{children:[o.jsx("input",{disabled:c,hidden:!0,onChange:a,pattern:void 0,placeholder:f,ref:j,type:e,value:l}),o.jsx("input",{type:"text",className:d.t(s.code,s.input),disabled:c,maxLength:5,onChange:i=>b(i.target.value),placeholder:n,value:x}),o.jsx("input",{...F,type:"tel",className:d.t(s.input,t,B&&s.touched),"data-icon":r?"true":void 0,disabled:c,maxLength:14,name:void 0,onChange:i=>z(i.target.value),onBlur:C,pattern:$,required:m,style:q,value:u})]});return o.jsxs("label",{className:d.t(s.label,_==="inline"&&s.inline),"data-component":"input",children:[N&&o.jsx("span",{"data-required":m&&_!=="inline"?!0:void 0,children:N}),e==="tel"?R:o.jsx("input",{...L,ref:j,className:d.t(s.input,t,B&&s.touched),"data-icon":r?"true":void 0,disabled:c,onBlur:C,placeholder:f,required:m,style:q,type:e})]})}exports.Input=A;exports.formatInlineLabel=S;
2
- //# sourceMappingURL=index-rXfEqyt5.cjs.map
1
+ "use strict";require('./assets/index45.css');const o=require("react/jsx-runtime"),d=require("./classix-5H4IWnMA.cjs"),p=require("react"),V=require("./icons-DPSOZZAy.cjs"),E=require("./use-touched-Bq5Gjbpz.cjs");function w(t){return t&&`${t[0].toLocaleUpperCase()}${t.slice(1)}`}function S(t){const n=w(t);return n&&!n.endsWith(":")?`${n}:`:n}const G="_input_p0mz8_3",H="_touched_p0mz8_43",U="_label_p0mz8_48",W="_inline_p0mz8_69",k="_code_p0mz8_86",s={input:G,touched:H,label:U,inline:W,code:k};function A({className:t,defaultCountryCode:n="+47",disabled:c=!1,icon:g,label:h,onBlur:T,placeholder:f,ref:j,required:m,style:v,type:e="text",variant:_="default",...L}){const[x,b]=p.useState(""),[u,z]=p.useState(""),{name:I,onChange:a,pattern:$,value:l,...F}=L,{touched:B,onBlur:P}=E.useTouched(l===""),r=g&&e!=="radio"&&e!=="datetime-local"?g:void 0,N=h&&_==="inline"?S(h):h,q=r?{...v,"--icon-svg":V.iconSVG(r)}:v,C=E.composeEventHandlers(P,T);p.useEffect(()=>{if(a&&e==="tel"){const i={name:I,value:u?(x||n).split(" ").join("")+u.split(" ").join(""):void 0};a({target:i,currentTarget:i})}},[x,n,I,a,u,e]),p.useEffect(()=>{e==="tel"&&!l&&(z(""),b(""))},[e,l]);const R=o.jsxs(o.Fragment,{children:[o.jsx("input",{disabled:c,hidden:!0,onChange:a,pattern:void 0,placeholder:f,ref:j,type:e,value:l}),o.jsx("input",{type:"text",className:d.t(s.code,s.input),disabled:c,maxLength:5,onChange:i=>b(i.target.value),placeholder:n,value:x}),o.jsx("input",{...F,type:"tel",className:d.t(s.input,t,B&&s.touched),"data-icon":r?"true":void 0,disabled:c,maxLength:14,name:void 0,onChange:i=>z(i.target.value),onBlur:C,pattern:$,required:m,style:q,value:u})]});return o.jsxs("label",{className:d.t(s.label,_==="inline"&&s.inline),"data-component":"input",children:[N&&o.jsx("span",{"data-required":m&&_!=="inline"?!0:void 0,children:N}),e==="tel"?R:o.jsx("input",{...L,ref:j,className:d.t(s.input,t,B&&s.touched),"data-icon":r?"true":void 0,disabled:c,onBlur:C,placeholder:f,required:m,style:q,type:e})]})}exports.Input=A;exports.formatInlineLabel=S;
2
+ //# sourceMappingURL=index-CoUj6S0o.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-rXfEqyt5.cjs","sources":["../src/utils/text.ts","../src/components/input/index.tsx"],"sourcesContent":["export function capitalizeFirstLetter(value: string): string {\n return value ? `${value[0].toLocaleUpperCase()}${value.slice(1)}` : value;\n}\n\nexport function formatInlineLabel(value: string): string {\n const label = capitalizeFirstLetter(value);\n return label && !label.endsWith(':') ? `${label}:` : label;\n}\n","import cx from 'classix';\nimport { useEffect, useState } from 'react';\n\nimport { IconName, iconSVG } from '@/components/icon/icons.ts';\nimport { composeEventHandlers } from '@/utils/compose-event-handlers';\nimport { formatInlineLabel } from '@/utils/text';\nimport { useTouched } from '@/utils/use-touched';\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 variant?: 'default' | 'inline';\n type?:\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'number'\n | 'password'\n | 'radio'\n | 'search'\n | 'tel'\n | 'text';\n};\n\nexport function Input({\n className,\n defaultCountryCode = '+47',\n disabled = false,\n icon,\n label,\n onBlur: onBlurProp,\n placeholder,\n ref,\n required,\n style,\n type = 'text',\n variant = 'default',\n ...props\n}: InputProps) {\n const [countryCode, setCountryCode] = useState('');\n const [phoneNumber, setPhoneNumber] = useState('');\n const { name, onChange, pattern, value, ...restProps } = props;\n const { touched, onBlur } = useTouched(value === '');\n const inputIcon = icon && type !== 'radio' && type !== 'datetime-local' ? icon : undefined;\n const displayLabel = label && variant === 'inline' ? formatInlineLabel(label) : label;\n\n type withVars =\n | (React.CSSProperties & {\n '--icon-svg'?: string;\n })\n | undefined;\n\n const withVars: withVars = inputIcon\n ? {\n ...style,\n '--icon-svg': iconSVG(inputIcon),\n }\n : style;\n const handleBlur = composeEventHandlers(onBlur, onBlurProp);\n\n useEffect(() => {\n if (onChange && type === 'tel') {\n const target = {\n name,\n value: phoneNumber\n ? (countryCode || defaultCountryCode).split(' ').join('') +\n phoneNumber.split(' ').join('')\n : undefined,\n } as unknown as HTMLInputElement;\n\n onChange({ target, currentTarget: target } as React.ChangeEvent<HTMLInputElement>);\n }\n }, [countryCode, defaultCountryCode, name, onChange, phoneNumber, type]);\n\n useEffect(() => {\n if (type === 'tel' && !value) {\n setPhoneNumber('');\n setCountryCode('');\n }\n }, [type, value]);\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={cx(styles.code, 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 {...restProps}\n type='tel'\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n maxLength={14}\n name={undefined}\n onChange={(e) => setPhoneNumber(e.target.value)}\n onBlur={handleBlur}\n pattern={pattern}\n required={required}\n style={withVars}\n value={phoneNumber}\n />\n </>\n );\n\n return (\n <label className={cx(styles.label, variant === 'inline' && styles.inline)}>\n {displayLabel && (\n <span data-required={required && variant !== 'inline' ? true : undefined}>\n {displayLabel}\n </span>\n )}\n {type === 'tel' ? (\n telephoneInput\n ) : (\n <input\n {...props}\n ref={ref}\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n onBlur={handleBlur}\n placeholder={placeholder}\n required={required}\n style={withVars}\n type={type}\n />\n )}\n </label>\n );\n}\n"],"names":["capitalizeFirstLetter","value","toLocaleUpperCase","slice","formatInlineLabel","label","endsWith","Input","className","defaultCountryCode","disabled","icon","onBlur","onBlurProp","placeholder","ref","required","style","type","variant","props","countryCode","setCountryCode","useState","phoneNumber","setPhoneNumber","name","onChange","pattern","restProps","touched","useTouched","inputIcon","undefined","displayLabel","withVars","iconSVG","handleBlur","composeEventHandlers","useEffect","target","split","join","currentTarget","telephoneInput","jsxs","Fragment","jsx","cx","styles","code","input","e","inline"],"mappings":"mLAAO,SAASA,EAAsBC,EAAuB,CAC3D,OAAOA,GAAQ,GAAGA,EAAM,CAAC,EAAEC,mBAAmB,GAAGD,EAAME,MAAM,CAAC,CAAC,EACjE,CAEO,SAASC,EAAkBH,EAAuB,CACvD,MAAMI,EAAQL,EAAsBC,CAAK,EACzC,OAAOI,GAAS,CAACA,EAAMC,SAAS,GAAG,EAAI,GAAGD,CAAK,IAAMA,CACvD,0JCuBO,SAASE,EAAM,CACpBC,UAAAA,EACAC,mBAAAA,EAAqB,MACrBC,SAAAA,EAAW,GACXC,KAAAA,EACAN,MAAAA,EACAO,OAAQC,EACRC,YAAAA,EACAC,IAAAA,EACAC,SAAAA,EACAC,MAAAA,EACAC,KAAAA,EAAO,OACPC,QAAAA,EAAU,UACV,GAAGC,CACO,EAAG,CACb,KAAM,CAACC,EAAaC,CAAc,EAAIC,EAAAA,SAAS,EAAE,EAC3C,CAACC,EAAaC,CAAc,EAAIF,EAAAA,SAAS,EAAE,EAC3C,CAAEG,KAAAA,EAAMC,SAAAA,EAAUC,QAAAA,EAAS3B,MAAAA,EAAO,GAAG4B,CAAAA,EAAcT,EACnD,CA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A,CACC,GAAIQ,EACJ,KAAK,MACL,UAAWmB,EAAAA,EAAGC,EAAOE,MAAO3C,EAAWsB,GAAWmB,EAAOnB,OAAO,EAChE,YAAWE,EAAY,OAASC,OAChC,SAAAvB,EACA,UAAW,GACX,KAAMuB,OACN,SAAWmB,GAAM3B,EAAe2B,EAAEZ,OAAOvC,KAAK,EAC9C,OAAQoC,EACR,QAAAT,EACA,SAAAZ,EACA,MAAOmB,EACP,MAAOX,CAAAA,CAAY,CAAA,EAEvB,EAGF,OACEqB,EAAAA,KAAC,QAAA,CAAM,UAAWG,EAAAA,EAAGC,EAAO5C,MAAOc,IAAY,UAAY8B,EAAOI,MAAM,EAAE,iBAAA,QACvEnB,SAAAA,CAAAA,GACCa,EAAAA,IAAC,QAAK,gBAAe/B,GAAYG,IAAY,SAAW,GAAOc,OAC5DC,SAAAA,CAAAA,CACH,EAEDhB,IAAS,MACR0B,EAEAG,EAAAA,IAAC,QAAA,CACC,GAAI3B,EACJ,IAAAL,EACA,UAAWiC,EAAAA,EAAGC,EAAOE,MAAO3C,EAAWsB,GAAWmB,EAAOnB,OAAO,EAChE,YAAWE,EAAY,OAASC,OAChC,SAAAvB,EACA,OAAQ2B,EACR,YAAAvB,EACA,SAAAE,EACA,MAAOmB,EACP,KAAAjB,CAAA,CAAW,CAAA,EAGjB,CAEJ"}
1
+ {"version":3,"file":"index-CoUj6S0o.cjs","sources":["../src/utils/text.ts","../src/components/input/index.tsx"],"sourcesContent":["export function capitalizeFirstLetter(value: string): string {\n return value ? `${value[0].toLocaleUpperCase()}${value.slice(1)}` : value;\n}\n\nexport function formatInlineLabel(value: string): string {\n const label = capitalizeFirstLetter(value);\n return label && !label.endsWith(':') ? `${label}:` : label;\n}\n","import cx from 'classix';\nimport { useEffect, useState } from 'react';\n\nimport { IconName, iconSVG } from '@/components/icon/icons.ts';\nimport { composeEventHandlers } from '@/utils/compose-event-handlers';\nimport { formatInlineLabel } from '@/utils/text';\nimport { useTouched } from '@/utils/use-touched';\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 variant?: 'default' | 'inline';\n type?:\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'number'\n | 'password'\n | 'radio'\n | 'search'\n | 'tel'\n | 'text';\n};\n\nexport function Input({\n className,\n defaultCountryCode = '+47',\n disabled = false,\n icon,\n label,\n onBlur: onBlurProp,\n placeholder,\n ref,\n required,\n style,\n type = 'text',\n variant = 'default',\n ...props\n}: InputProps) {\n const [countryCode, setCountryCode] = useState('');\n const [phoneNumber, setPhoneNumber] = useState('');\n const { name, onChange, pattern, value, ...restProps } = props;\n const { touched, onBlur } = useTouched(value === '');\n const inputIcon = icon && type !== 'radio' && type !== 'datetime-local' ? icon : undefined;\n const displayLabel = label && variant === 'inline' ? formatInlineLabel(label) : label;\n\n type withVars =\n | (React.CSSProperties & {\n '--icon-svg'?: string;\n })\n | undefined;\n\n const withVars: withVars = inputIcon\n ? {\n ...style,\n '--icon-svg': iconSVG(inputIcon),\n }\n : style;\n const handleBlur = composeEventHandlers(onBlur, onBlurProp);\n\n useEffect(() => {\n if (onChange && type === 'tel') {\n const target = {\n name,\n value: phoneNumber\n ? (countryCode || defaultCountryCode).split(' ').join('') +\n phoneNumber.split(' ').join('')\n : undefined,\n } as unknown as HTMLInputElement;\n\n onChange({ target, currentTarget: target } as React.ChangeEvent<HTMLInputElement>);\n }\n }, [countryCode, defaultCountryCode, name, onChange, phoneNumber, type]);\n\n useEffect(() => {\n if (type === 'tel' && !value) {\n setPhoneNumber('');\n setCountryCode('');\n }\n }, [type, value]);\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={cx(styles.code, 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 {...restProps}\n type='tel'\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n maxLength={14}\n name={undefined}\n onChange={(e) => setPhoneNumber(e.target.value)}\n onBlur={handleBlur}\n pattern={pattern}\n required={required}\n style={withVars}\n value={phoneNumber}\n />\n </>\n );\n\n return (\n <label className={cx(styles.label, variant === 'inline' && styles.inline)}>\n {displayLabel && (\n <span data-required={required && variant !== 'inline' ? true : undefined}>\n {displayLabel}\n </span>\n )}\n {type === 'tel' ? (\n telephoneInput\n ) : (\n <input\n {...props}\n ref={ref}\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n onBlur={handleBlur}\n placeholder={placeholder}\n required={required}\n style={withVars}\n type={type}\n />\n )}\n </label>\n );\n}\n"],"names":["capitalizeFirstLetter","value","toLocaleUpperCase","slice","formatInlineLabel","label","endsWith","Input","className","defaultCountryCode","disabled","icon","onBlur","onBlurProp","placeholder","ref","required","style","type","variant","props","countryCode","setCountryCode","useState","phoneNumber","setPhoneNumber","name","onChange","pattern","restProps","touched","useTouched","inputIcon","undefined","displayLabel","withVars","iconSVG","handleBlur","composeEventHandlers","useEffect","target","split","join","currentTarget","telephoneInput","jsxs","Fragment","jsx","cx","styles","code","input","e","inline"],"mappings":"mLAAO,SAASA,EAAsBC,EAAuB,CAC3D,OAAOA,GAAQ,GAAGA,EAAM,CAAC,EAAEC,mBAAmB,GAAGD,EAAME,MAAM,CAAC,CAAC,EACjE,CAEO,SAASC,EAAkBH,EAAuB,CACvD,MAAMI,EAAQL,EAAsBC,CAAK,EACzC,OAAOI,GAAS,CAACA,EAAMC,SAAS,GAAG,EAAI,GAAGD,CAAK,IAAMA,CACvD,0JCuBO,SAASE,EAAM,CACpBC,UAAAA,EACAC,mBAAAA,EAAqB,MACr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
1
1
  import { jsxs as m, jsx as p } from "react/jsx-runtime";
2
2
  import { t as v } from "./classix-DG18itHa.js";
3
- import { i as w } from "./icons-Dm2kyF0g.js";
3
+ import { i as w } from "./icons-D5KQxBn7.js";
4
4
  import { u as C, c as S } from "./use-touched-B999bBr8.js";
5
5
  import './assets/index50.css';const P = /* @__PURE__ */ new Set(["aria-activedescendant", "aria-autocomplete", "aria-busy", "aria-controls", "aria-describedby", "aria-details", "aria-disabled", "aria-errormessage", "aria-expanded", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-required", "aria-roledescription", "autoComplete", "autoFocus", "className", "defaultValue", "dir", "disabled", "form", "id", "multiple", "name", "onBlur", "onChange", "onClick", "onFocus", "onInput", "onInvalid", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseUp", "onPointerDown", "onPointerUp", "required", "role", "size", "style", "tabIndex", "title", "value"]);
6
6
  function _(n) {
@@ -71,4 +71,4 @@ export {
71
71
  N as r,
72
72
  _ as s
73
73
  };
74
- //# sourceMappingURL=index-DycOZMJl.js.map
74
+ //# sourceMappingURL=index-DKe_FTGA.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-DycOZMJl.js","sources":["../src/components/select/sanitize-select-props.ts","../src/utils/color.ts","../src/components/select/index.tsx"],"sourcesContent":["const selectKeys = new Set([\n 'aria-activedescendant',\n 'aria-autocomplete',\n 'aria-busy',\n 'aria-controls',\n 'aria-describedby',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-live',\n 'aria-owns',\n 'aria-required',\n 'aria-roledescription',\n 'autoComplete',\n 'autoFocus',\n 'className',\n 'defaultValue',\n 'dir',\n 'disabled',\n 'form',\n 'id',\n 'multiple',\n 'name',\n 'onBlur',\n 'onChange',\n 'onClick',\n 'onFocus',\n 'onInput',\n 'onInvalid',\n 'onKeyDown',\n 'onKeyUp',\n 'onMouseDown',\n 'onMouseUp',\n 'onPointerDown',\n 'onPointerUp',\n 'required',\n 'role',\n 'size',\n 'style',\n 'tabIndex',\n 'title',\n 'value',\n]);\n\nexport function sanitizeSelectProps<T extends Record<string, unknown>>(props: T) {\n return Object.fromEntries(\n Object.entries(props).filter(\n ([key]) => key.startsWith('data-') || key.startsWith('aria-') || selectKeys.has(key)\n )\n ) as Partial<T>;\n}\n","const cssVariablePattern = /^--[\\w-]+$/;\nconst cssVariableReferencePattern = /^var\\(\\s*(--[\\w-]+)\\s*(?:,\\s*(.+))?\\)$/;\n\nconst unresolvedColorKeywords = new Set([\n 'currentcolor',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n]);\n\nconst probe = typeof document !== 'undefined' ? document.createElement('span') : null;\n\nfunction normalizeColorValue(input: string): string {\n const value = input.trim();\n\n if (!value || !probe || unresolvedColorKeywords.has(value.toLowerCase())) {\n return value;\n }\n\n const mountNode = document.body ?? document.documentElement;\n\n if (!mountNode) {\n return value;\n }\n\n probe.style.color = value;\n\n if (!probe.style.color) {\n return value;\n }\n\n mountNode.appendChild(probe);\n\n const normalized = getComputedStyle(probe).color.trim();\n probe.remove();\n\n return normalized || value;\n}\n\nexport function resolveColor(input: `--${string}` | string, fallback = 'currentColor'): string {\n if (typeof document === 'undefined') {\n return fallback;\n }\n\n const styles = getComputedStyle(document.documentElement);\n const seen = new Set<string>();\n let current = input.trim();\n\n while (current) {\n const match = current.match(cssVariableReferencePattern);\n const variableName = match?.[1] ?? (cssVariablePattern.test(current) ? current : null);\n const nestedFallback = match?.[2]?.trim();\n\n if (!variableName) {\n return normalizeColorValue(current);\n }\n\n if (seen.has(variableName)) {\n current = nestedFallback ?? '';\n continue;\n }\n\n seen.add(variableName);\n\n current = styles.getPropertyValue(variableName).trim() || nestedFallback || '';\n }\n\n return normalizeColorValue(fallback);\n}\n","import cx from 'classix';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\nimport { resolveColor } from '@/utils/color';\nimport { composeEventHandlers } from '@/utils/compose-event-handlers';\nimport { useTouched } from '@/utils/use-touched';\n\nimport { sanitizeSelectProps } from './sanitize-select-props';\nimport styles from './styles.module.css';\n\nexport type SelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {\n children: React.ReactNode;\n label?: string;\n placeholder?: string;\n};\n\ntype withVars = React.CSSProperties & {\n '--icon-svg'?: string;\n};\n\nexport const Select = ({ children, label, placeholder, ...props }: SelectProps) => {\n const { touched, onBlur } = useTouched(props.value === '');\n const selectProps = sanitizeSelectProps(props);\n const { className, onBlur: onBlurProp, style, ...restSelectProps } = selectProps;\n const withVars = {\n ...style,\n '--icon-svg': iconSVG('CaretDown', resolveColor('--colors-semantic-content-secondary')),\n } satisfies withVars;\n\n const selectElement = (\n <select\n className={cx(styles.select, className, touched && styles.touched)}\n onBlur={composeEventHandlers(onBlur, onBlurProp)}\n style={withVars}\n {...restSelectProps}\n >\n {placeholder && (\n <option\n key='placeholder'\n value={''}\n hidden\n >\n {placeholder}\n </option>\n )}\n {children}\n </select>\n );\n\n if (!label) {\n return selectElement;\n }\n\n return (\n <label>\n <span\n className={styles.label}\n data-required={props.required || undefined}\n >\n {label}\n </span>\n {selectElement}\n </label>\n );\n};\n"],"names":["selectKeys","Set","sanitizeSelectProps","props","Object","fromEntries","entries","filter","key","startsWith","has","cssVariablePattern","cssVariableReferencePattern","unresolvedColorKeywords","probe","document","createElement","normalizeColorValue","input","value","trim","toLowerCase","mountNode","body","documentElement","style","color","appendChild","normalized","getComputedStyle","remove","resolveColor","fallback","styles","seen","current","match","variableName","test","nestedFallback","add","getPropertyValue","Select","children","label","placeholder","touched","onBlur","useTouched","selectProps","className","onBlurProp","restSelectProps","withVars","iconSVG","selectElement","cx","select","composeEventHandlers","jsxs","jsx","required","undefined"],"mappings":";;;;AAAA,MAAMA,IAAa,oBAAIC,IAAI,CACzB,yBACA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AA,EAAAA,GACH;AAGF,SAAKC,IAKH,gBAAAe,EAAC,SAAA,EAAK,kBAAA,UACJ,UAAA;AAAA,IAAA,gBAAAC,EAAC,QAAA,EACC,WAAW3B,EAAOW,OAClB,iBAAezC,EAAM0D,YAAYC,QAEhClB,UAAAA,EAAAA,CACH;AAAA,IACCW;AAAAA,EAAAA,GACH,IAZOA;AAcX;"}
1
+ {"version":3,"file":"index-DKe_FTGA.js","sources":["../src/components/select/sanitize-select-props.ts","../src/utils/color.ts","../src/components/select/index.tsx"],"sourcesContent":["const selectKeys = new Set([\n 'aria-activedescendant',\n 'aria-autocomplete',\n 'aria-busy',\n 'aria-controls',\n 'aria-describedby',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-live',\n 'aria-owns',\n 'aria-required',\n 'aria-roledescription',\n 'autoComplete',\n 'autoFocus',\n 'className',\n 'defaultValue',\n 'dir',\n 'disabled',\n 'form',\n 'id',\n 'multiple',\n 'name',\n 'onBlur',\n 'onChange',\n 'onClick',\n 'onFocus',\n 'onInput',\n 'onInvalid',\n 'onKeyDown',\n 'onKeyUp',\n 'onMouseDown',\n 'onMouseUp',\n 'onPointerDown',\n 'onPointerUp',\n 'required',\n 'role',\n 'size',\n 'style',\n 'tabIndex',\n 'title',\n 'value',\n]);\n\nexport function sanitizeSelectProps<T extends Record<string, unknown>>(props: T) {\n return Object.fromEntries(\n Object.entries(props).filter(\n ([key]) => key.startsWith('data-') || key.startsWith('aria-') || selectKeys.has(key)\n )\n ) as Partial<T>;\n}\n","const cssVariablePattern = /^--[\\w-]+$/;\nconst cssVariableReferencePattern = /^var\\(\\s*(--[\\w-]+)\\s*(?:,\\s*(.+))?\\)$/;\n\nconst unresolvedColorKeywords = new Set([\n 'currentcolor',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n]);\n\nconst probe = typeof document !== 'undefined' ? document.createElement('span') : null;\n\nfunction normalizeColorValue(input: string): string {\n const value = input.trim();\n\n if (!value || !probe || unresolvedColorKeywords.has(value.toLowerCase())) {\n return value;\n }\n\n const mountNode = document.body ?? document.documentElement;\n\n if (!mountNode) {\n return value;\n }\n\n probe.style.color = value;\n\n if (!probe.style.color) {\n return value;\n }\n\n mountNode.appendChild(probe);\n\n const normalized = getComputedStyle(probe).color.trim();\n probe.remove();\n\n return normalized || value;\n}\n\nexport function resolveColor(input: `--${string}` | string, fallback = 'currentColor'): string {\n if (typeof document === 'undefined') {\n return fallback;\n }\n\n const styles = getComputedStyle(document.documentElement);\n const seen = new Set<string>();\n let current = input.trim();\n\n while (current) {\n const match = current.match(cssVariableReferencePattern);\n const variableName = match?.[1] ?? (cssVariablePattern.test(current) ? current : null);\n const nestedFallback = match?.[2]?.trim();\n\n if (!variableName) {\n return normalizeColorValue(current);\n }\n\n if (seen.has(variableName)) {\n current = nestedFallback ?? '';\n continue;\n }\n\n seen.add(variableName);\n\n current = styles.getPropertyValue(variableName).trim() || nestedFallback || '';\n }\n\n return normalizeColorValue(fallback);\n}\n","import cx from 'classix';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\nimport { resolveColor } from '@/utils/color';\nimport { composeEventHandlers } from '@/utils/compose-event-handlers';\nimport { useTouched } from '@/utils/use-touched';\n\nimport { sanitizeSelectProps } from './sanitize-select-props';\nimport styles from './styles.module.css';\n\nexport type SelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {\n children: React.ReactNode;\n label?: string;\n placeholder?: string;\n};\n\ntype withVars = React.CSSProperties & {\n '--icon-svg'?: string;\n};\n\nexport const Select = ({ children, label, placeholder, ...props }: SelectProps) => {\n const { touched, onBlur } = useTouched(props.value === '');\n const selectProps = sanitizeSelectProps(props);\n const { className, onBlur: onBlurProp, style, ...restSelectProps } = selectProps;\n const withVars = {\n ...style,\n '--icon-svg': iconSVG('CaretDown', resolveColor('--colors-semantic-content-secondary')),\n } satisfies withVars;\n\n const selectElement = (\n <select\n className={cx(styles.select, className, touched && styles.touched)}\n onBlur={composeEventHandlers(onBlur, onBlurProp)}\n style={withVars}\n {...restSelectProps}\n >\n {placeholder && (\n <option\n key='placeholder'\n value={''}\n hidden\n >\n {placeholder}\n </option>\n )}\n {children}\n </select>\n );\n\n if (!label) {\n return selectElement;\n }\n\n return (\n <label>\n <span\n className={styles.label}\n data-required={props.required || undefined}\n >\n {label}\n </span>\n {selectElement}\n </label>\n );\n};\n"],"names":["selectKeys","Set","sanitizeSelectProps","props","Object","fromEntries","entries","filter","key","startsWith","has","cssVariablePattern","cssVariableReferencePattern","unresolvedColorKeywords","probe","document","createElement","normalizeColorValue","input","value","trim","toLowerCase","mountNode","body","documentElement","style","color","appendChild","normalized","getComputedStyle","remove","resolveColor","fallback","styles","seen","current","match","variableName","test","nestedFallback","add","getPropertyValue","Select","children","label","placeholder","touched","onBlur","useTouched","selectProps","className","onBlurProp","restSelectProps","withVars","iconSVG","selectElement","cx","select","composeEventHandlers","jsxs","jsx","required","undefined"],"mappings":";;;;AAAA,MAAMA,IAAa,oBAAIC,IAAI,CACzB,yBACA,qBACA,aACA,iBACA,oBACA,gBACA,iBACA,qBACA,iBACA,iBACA,eACA,gBACA,qBACA,cACA,mBACA,aACA,aACA,iBACA,wBACA,gBACA,aACA,aACA,gBACA,OACA,YACA,QACA,MACA,YACA,QACA,UACA,YACA,WACA,WACA,WACA,aACA,aACA,WACA,eACA,aACA,iBACA,eACA,YACA,QACA,QACA,SACA,YACA,SACA,OAAO,CACR;AAEM,SAASC,EAAuDC,GAAU;AAC/E,SAAOC,OAAOC,YACZD,OAAOE,QAAQH,CAAK,EAAEI,OACpB,CAAC,CAACC,CAAG,MAAMA,EAAIC,WAAW,OAAO,KAAKD,EAAIC,WAAW,OAAO,KAAKT,EAAWU,IAAIF,CAAG,CACrF,CACF;AACF;ACzDA,MAAMG,IAAqB,cACrBC,IAA8B,0CAE9BC,IAA0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ACrC;;;;;GClDaU,IAASA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAUC,OAAAA;AAAAA,EAAOC,aAAAA;AAAAA,EAAa,GAAG1C;AAAmB,MAAM;AACjF,QAAM;AAAA,IAAE2C,SAAAA;AAAAA,IAASC,QAAAA;AAAAA,EAAAA,IAAWC,EAAW7C,EAAMgB,UAAU,EAAE,GACnD8B,IAAc/C,EAAoBC,CAAK,GACvC;AAAA,IAAE+C,WAAAA;AAAAA,IAAWH,QAAQI;AAAAA,IAAY1B,OAAAA;AAAAA,IAAO,GAAG2B;AAAAA,EAAAA,IAAoBH,GAC/DI,IAAW;AAAA,IACf,GAAG5B;AAAAA,IACH,cAAc6B,EAAQ,aAAavB,EAAa,qCAAqC,CAAC;AAAA,EAAA,GAGlFwB,sBACH,UAAA,EACC,WAAWC,EAAGvB,EAAOwB,QAAQP,GAAWJ,KAAWb,EAAOa,OAAO,GACjE,QAAQY,EAAqBX,GAAQI,CAAU,GAC/C,OAAOE,GACP,GAAID,GAEHP,UAAAA;AAAAA,IAAAA,uBACE,UAAA,EAEC,OAAO,IACP,QAAM,IAELA,eAJG,aAKN;AAAA,IAEDF;AAAAA,EAAAA,GACH;AAGF,SAAKC,IAKH,gBAAAe,EAAC,SAAA,EAAK,kBAAA,UACJ,UAAA;AAAA,IAAA,gBAAAC,EAAC,QAAA,EACC,WAAW3B,EAAOW,OAClB,iBAAezC,EAAM0D,YAAYC,QAEhClB,UAAAA,EAAAA,CACH;AAAA,IACCW;AAAAA,EAAAA,GACH,IAZOA;AAcX;"}
@@ -1,7 +1,7 @@
1
1
  import { jsxs as $, Fragment as G, jsx as c } from "react/jsx-runtime";
2
2
  import { t as p } from "./classix-DG18itHa.js";
3
3
  import { useState as E, useEffect as F } from "react";
4
- import { i as H } from "./icons-Dm2kyF0g.js";
4
+ import { i as H } from "./icons-D5KQxBn7.js";
5
5
  import { u as U, c as W } from "./use-touched-B999bBr8.js";
6
6
  import './assets/index45.css';function k(t) {
7
7
  return t && `${t[0].toLocaleUpperCase()}${t.slice(1)}`;
@@ -73,4 +73,4 @@ export {
73
73
  q as I,
74
74
  A as f
75
75
  };
76
- //# sourceMappingURL=index-m3slpD7c.js.map
76
+ //# sourceMappingURL=index-KbL6DkMp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-m3slpD7c.js","sources":["../src/utils/text.ts","../src/components/input/index.tsx"],"sourcesContent":["export function capitalizeFirstLetter(value: string): string {\n return value ? `${value[0].toLocaleUpperCase()}${value.slice(1)}` : value;\n}\n\nexport function formatInlineLabel(value: string): string {\n const label = capitalizeFirstLetter(value);\n return label && !label.endsWith(':') ? `${label}:` : label;\n}\n","import cx from 'classix';\nimport { useEffect, useState } from 'react';\n\nimport { IconName, iconSVG } from '@/components/icon/icons.ts';\nimport { composeEventHandlers } from '@/utils/compose-event-handlers';\nimport { formatInlineLabel } from '@/utils/text';\nimport { useTouched } from '@/utils/use-touched';\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 variant?: 'default' | 'inline';\n type?:\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'number'\n | 'password'\n | 'radio'\n | 'search'\n | 'tel'\n | 'text';\n};\n\nexport function Input({\n className,\n defaultCountryCode = '+47',\n disabled = false,\n icon,\n label,\n onBlur: onBlurProp,\n placeholder,\n ref,\n required,\n style,\n type = 'text',\n variant = 'default',\n ...props\n}: InputProps) {\n const [countryCode, setCountryCode] = useState('');\n const [phoneNumber, setPhoneNumber] = useState('');\n const { name, onChange, pattern, value, ...restProps } = props;\n const { touched, onBlur } = useTouched(value === '');\n const inputIcon = icon && type !== 'radio' && type !== 'datetime-local' ? icon : undefined;\n const displayLabel = label && variant === 'inline' ? formatInlineLabel(label) : label;\n\n type withVars =\n | (React.CSSProperties & {\n '--icon-svg'?: string;\n })\n | undefined;\n\n const withVars: withVars = inputIcon\n ? {\n ...style,\n '--icon-svg': iconSVG(inputIcon),\n }\n : style;\n const handleBlur = composeEventHandlers(onBlur, onBlurProp);\n\n useEffect(() => {\n if (onChange && type === 'tel') {\n const target = {\n name,\n value: phoneNumber\n ? (countryCode || defaultCountryCode).split(' ').join('') +\n phoneNumber.split(' ').join('')\n : undefined,\n } as unknown as HTMLInputElement;\n\n onChange({ target, currentTarget: target } as React.ChangeEvent<HTMLInputElement>);\n }\n }, [countryCode, defaultCountryCode, name, onChange, phoneNumber, type]);\n\n useEffect(() => {\n if (type === 'tel' && !value) {\n setPhoneNumber('');\n setCountryCode('');\n }\n }, [type, value]);\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={cx(styles.code, 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 {...restProps}\n type='tel'\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n maxLength={14}\n name={undefined}\n onChange={(e) => setPhoneNumber(e.target.value)}\n onBlur={handleBlur}\n pattern={pattern}\n required={required}\n style={withVars}\n value={phoneNumber}\n />\n </>\n );\n\n return (\n <label className={cx(styles.label, variant === 'inline' && styles.inline)}>\n {displayLabel && (\n <span data-required={required && variant !== 'inline' ? true : undefined}>\n {displayLabel}\n </span>\n )}\n {type === 'tel' ? (\n telephoneInput\n ) : (\n <input\n {...props}\n ref={ref}\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n onBlur={handleBlur}\n placeholder={placeholder}\n required={required}\n style={withVars}\n type={type}\n />\n )}\n </label>\n );\n}\n"],"names":["capitalizeFirstLetter","value","toLocaleUpperCase","slice","formatInlineLabel","label","endsWith","Input","className","defaultCountryCode","disabled","icon","onBlur","onBlurProp","placeholder","ref","required","style","type","variant","props","countryCode","setCountryCode","useState","phoneNumber","setPhoneNumber","name","onChange","pattern","restProps","touched","useTouched","inputIcon","undefined","displayLabel","withVars","iconSVG","handleBlur","composeEventHandlers","useEffect","target","split","join","currentTarget","telephoneInput","jsxs","Fragment","jsx","cx","styles","code","input","e","inline"],"mappings":";;;;;AAAO,SAASA,EAAsBC,GAAuB;AAC3D,SAAOA,KAAQ,GAAGA,EAAM,CAAC,EAAEC,mBAAmB,GAAGD,EAAME,MAAM,CAAC,CAAC;AACjE;AAEO,SAASC,EAAkBH,GAAuB;AACvD,QAAMI,IAAQL,EAAsBC,CAAK;AACzC,SAAOI,KAAS,CAACA,EAAMC,SAAS,GAAG,IAAI,GAAGD,CAAK,MAAMA;AACvD;;;;;;;;ACuBO,SAASE,EAAM;AAAA,EACpBC,WAAAA;AAAAA,EACAC,oBAAAA,IAAqB;AAAA,EACrBC,UAAAA,IAAW;AAAA,EACXC,MAAAA;AAAAA,EACAN,OAAAA;AAAAA,EACAO,QAAQC;AAAAA,EACRC,aAAAA;AAAAA,EACAC,KAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,MAAAA,IAAO;AAAA,EACPC,SAAAA,IAAU;AAAA,EACV,GAAGC;AACO,GAAG;AACb,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAE,GAC3C,CAACC,GAAaC,CAAc,IAAIF,EAAS,EAAE,GAC3C;AAAA,IAAEG,MAAAA;AAAAA,IAAMC,UAAAA;AAAAA,IAAUC,SAAAA;AAAAA,IAAS3B,OAAAA;AAAAA,IAAO,GAAG4B;AAAAA,EAAAA,IAAcT,GACnD;AAAA,IAAEU,SAAAA;AAAAA,IAASlB,QAAAA;AAAAA,EAAAA,IAAWmB,EAAW9B,MAAU,EAAE,GAC7C+B,IAAYrB,KAAQO,MAAS,WAAWA,MAAS,mBAAmBP,IAAOsB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AAGC,EAAOE,OAAO3C,GAAWsB,KAAWmB,EAAOnB,OAAO,GAChE,aAAWE,IAAY,SAASC,QAChC,UAAAvB,GACA,WAAW,IACX,MAAMuB,QACN,UAAWmB,CAAAA,MAAM3B,EAAe2B,EAAEZ,OAAOvC,KAAK,GAC9C,QAAQoC,GACR,SAAAT,GACA,UAAAZ,GACA,OAAOmB,GACP,OAAOX,EAAAA,CAAY;AAAA,EAAA,GAEvB;AAGF,SACE,gBAAAqB,EAAC,SAAA,EAAM,WAAWG,EAAGC,EAAO5C,OAAOc,MAAY,YAAY8B,EAAOI,MAAM,GAAE,kBAAA,SACvEnB,UAAAA;AAAAA,IAAAA,KACC,gBAAAa,EAAC,UAAK,iBAAe/B,KAAYG,MAAY,WAAW,KAAOc,QAC5DC,UAAAA,EAAAA,CACH;AAAA,IAEDhB,MAAS,QACR0B,IAEA,gBAAAG,EAAC,SAAA,EACC,GAAI3B,GACJ,KAAAL,GACA,WAAWiC,EAAGC,EAAOE,OAAO3C,GAAWsB,KAAWmB,EAAOnB,OAAO,GAChE,aAAWE,IAAY,SAASC,QAChC,UAAAvB,GACA,QAAQ2B,GACR,aAAAvB,GACA,UAAAE,GACA,OAAOmB,GACP,MAAAjB,EAAA,CAAW;AAAA,EAAA,GAGjB;AAEJ;"}
1
+ {"version":3,"file":"index-KbL6DkMp.js","sources":["../src/utils/text.ts","../src/components/input/index.tsx"],"sourcesContent":["export function capitalizeFirstLetter(value: string): string {\n return value ? `${value[0].toLocaleUpperCase()}${value.slice(1)}` : value;\n}\n\nexport function formatInlineLabel(value: string): string {\n const label = capitalizeFirstLetter(value);\n return label && !label.endsWith(':') ? `${label}:` : label;\n}\n","import cx from 'classix';\nimport { useEffect, useState } from 'react';\n\nimport { IconName, iconSVG } from '@/components/icon/icons.ts';\nimport { composeEventHandlers } from '@/utils/compose-event-handlers';\nimport { formatInlineLabel } from '@/utils/text';\nimport { useTouched } from '@/utils/use-touched';\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 variant?: 'default' | 'inline';\n type?:\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'number'\n | 'password'\n | 'radio'\n | 'search'\n | 'tel'\n | 'text';\n};\n\nexport function Input({\n className,\n defaultCountryCode = '+47',\n disabled = false,\n icon,\n label,\n onBlur: onBlurProp,\n placeholder,\n ref,\n required,\n style,\n type = 'text',\n variant = 'default',\n ...props\n}: InputProps) {\n const [countryCode, setCountryCode] = useState('');\n const [phoneNumber, setPhoneNumber] = useState('');\n const { name, onChange, pattern, value, ...restProps } = props;\n const { touched, onBlur } = useTouched(value === '');\n const inputIcon = icon && type !== 'radio' && type !== 'datetime-local' ? icon : undefined;\n const displayLabel = label && variant === 'inline' ? formatInlineLabel(label) : label;\n\n type withVars =\n | (React.CSSProperties & {\n '--icon-svg'?: string;\n })\n | undefined;\n\n const withVars: withVars = inputIcon\n ? {\n ...style,\n '--icon-svg': iconSVG(inputIcon),\n }\n : style;\n const handleBlur = composeEventHandlers(onBlur, onBlurProp);\n\n useEffect(() => {\n if (onChange && type === 'tel') {\n const target = {\n name,\n value: phoneNumber\n ? (countryCode || defaultCountryCode).split(' ').join('') +\n phoneNumber.split(' ').join('')\n : undefined,\n } as unknown as HTMLInputElement;\n\n onChange({ target, currentTarget: target } as React.ChangeEvent<HTMLInputElement>);\n }\n }, [countryCode, defaultCountryCode, name, onChange, phoneNumber, type]);\n\n useEffect(() => {\n if (type === 'tel' && !value) {\n setPhoneNumber('');\n setCountryCode('');\n }\n }, [type, value]);\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={cx(styles.code, 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 {...restProps}\n type='tel'\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n maxLength={14}\n name={undefined}\n onChange={(e) => setPhoneNumber(e.target.value)}\n onBlur={handleBlur}\n pattern={pattern}\n required={required}\n style={withVars}\n value={phoneNumber}\n />\n </>\n );\n\n return (\n <label className={cx(styles.label, variant === 'inline' && styles.inline)}>\n {displayLabel && (\n <span data-required={required && variant !== 'inline' ? true : undefined}>\n {displayLabel}\n </span>\n )}\n {type === 'tel' ? (\n telephoneInput\n ) : (\n <input\n {...props}\n ref={ref}\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n onBlur={handleBlur}\n placeholder={placeholder}\n required={required}\n style={withVars}\n type={type}\n />\n )}\n </label>\n );\n}\n"],"names":["capitalizeFirstLetter","value","toLocaleUpperCase","slice","formatInlineLabel","label","endsWith","Input","className","defaultCountryCode","disabled","icon","onBlur","onBlurProp","placeholder","ref","required","style","type","variant","props","countryCode","setCountryCode","useState","phoneNumber","setPhoneNumber","name","onChange","pattern","restProps","touched","useTouched","inputIcon","undefined","displayLabel","withVars","iconSVG","handleBlur","composeEventHandlers","useEffect","target","split","join","currentTarget","telephoneInput","jsxs","Fragment","jsx","cx","styles","code","input","e","inline"],"mappings":";;;;;AAAO,SAASA,EAAsBC,GAAuB;AAC3D,SAAOA,KAAQ,GAAGA,EAAM,CAAC,EAAEC,mBAAmB,GAAGD,EAAME,MAAM,CAAC,CAAC;AACjE;AAEO,SAASC,EAAkBH,GAAuB;AACvD,QAAMI,IAAQL,EAAsBC,CAAK;AACzC,SAAOI,KAAS,CAACA,EAAMC,SAAS,GAAG,IAAI,GAAGD,CAAK,MAAMA;AACvD;;;;;;;;ACuBO,SAASE,EAAM;AAAA,EACpBC,WAAAA;AAAAA,EACAC,oBAAAA,IAAqB;AAAA,EACrBC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E,OAAO3C,GAAWsB,KAAWmB,EAAOnB,OAAO,GAChE,aAAWE,IAAY,SAASC,QAChC,UAAAvB,GACA,QAAQ2B,GACR,aAAAvB,GACA,UAAAE,GACA,OAAOmB,GACP,MAAAjB,EAAA,CAAW;AAAA,EAAA,GAGjB;AAEJ;"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/index.css');const o=require("./components/app-link/index.cjs"),t=require("./components/aside/index.cjs"),r=require("./components/avatar/index.cjs"),i=require("./components/badge/index.cjs"),s=require("./components/banner/index.cjs"),c=require("./components/branding/index.cjs"),_=require("./components/button/index.cjs"),p=require("./components/card/index.cjs"),a=require("./components/checkbox/index.cjs"),d=require("./components/chip/index.cjs"),u=require("./components/collapsible/index.cjs"),m=require("./components/controls/index.cjs"),l=require("./components/croppable/index.cjs"),x=require("./components/dialog/index.cjs"),q=require("./components/dropdown/index.cjs"),g=require("./components/dropzone/index.cjs"),b=require("./components/editor/index.cjs"),T=require("./components/empty-state/index.cjs"),h=require("./components/fieldset/index.cjs"),S=require("./components/figure/index.cjs"),v=require("./components/file/index.cjs"),C=require("./components/footer/index.cjs"),L=require("./components/form/index.cjs"),F=require("./components/graph/index.cjs"),I=require("./components/group/index.cjs"),f=require("./components/header/index.cjs"),k=require("./components/icon/index.cjs"),B=require("./components/iframe/index.cjs"),M=require("./components/image/index.cjs"),A=require("./index-rXfEqyt5.cjs"),D=require("./components/link/index.cjs"),y=require("./components/list/index.cjs"),O=require("./components/loading/index.cjs"),P=require("./components/menu/index.cjs"),j=require("./components/message/index.cjs"),w=require("./components/messages/index.cjs"),e=require("./components/nav/index.cjs"),E=require("./components/object/index.cjs"),G=require("./components/popover/index.cjs"),N=require("./components/portal/index.cjs"),z=require("./components/search/index.cjs"),H=require("./index-Y3jsTJhs.cjs"),n=require("./components/sortable/index.cjs"),W=require("./components/table/index.cjs"),J=require("./components/textarea/index.cjs"),K=require("./components/toast/index.cjs"),Q=require("./components/toasts/index.cjs"),R=require("./components/toggle/index.cjs"),U=require("./components/toolbar/index.cjs"),V=require("./components/tooltip/index.cjs"),X=require("./components/widget/index.cjs");exports.AppLink=o.AppLink;exports.Aside=t.Aside;exports.Avatar=r.Avatar;exports.Badge=i.Badge;exports.Banner=s.Banner;exports.Branding=c.Branding;exports.Button=_.Button;exports.Card=p.Card;exports.Checkbox=a.Checkbox;exports.Chip=d.Chip;exports.Collapsible=u.Collapsible;exports.Controls=m.Controls;exports.Croppable=l.Croppable;exports.Dialog=x.Dialog;exports.Dropdown=q.Dropdown;exports.Dropzone=g.Dropzone;exports.Editor=b.Editor;exports.EmptyState=T.EmptyState;exports.Fieldset=h.Fieldset;exports.Figure=S.Figure;exports.File=v.File;exports.Footer=C.Footer;exports.Form=L.Form;exports.Graph=F.Graph;exports.Group=I.Group;exports.Header=f.Header;exports.Icon=k.Icon;exports.Iframe=B.Iframe;exports.Image=M.Image;exports.Input=A.Input;exports.Link=D.Link;exports.List=y.List;exports.Loading=O.Loading;exports.Menu=P.Menu;exports.Message=j.Message;exports.Messages=w.Messages;exports.Nav=e.Nav;exports.NavLabel=e.NavLabel;exports.Object=E.Object;exports.Popover=G.Popover;exports.Portal=N.Portal;exports.Search=z.Search;exports.Select=H.Select;exports.Sortable=n.Sortable;exports.useOptionalSortableItem=n.useOptionalSortableItem;exports.Table=W.Table;exports.Textarea=J.Textarea;exports.Toast=K.Toast;exports.Toasts=Q.Toasts;exports.Toggle=R.Toggle;exports.Toolbar=U.Toolbar;exports.Tooltip=V.Tooltip;exports.Widget=X.Widget;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/index.css');const o=require("./components/app-link/index.cjs"),t=require("./components/aside/index.cjs"),r=require("./components/avatar/index.cjs"),i=require("./components/badge/index.cjs"),s=require("./components/banner/index.cjs"),c=require("./components/branding/index.cjs"),_=require("./components/button/index.cjs"),p=require("./components/card/index.cjs"),a=require("./components/checkbox/index.cjs"),d=require("./components/chip/index.cjs"),u=require("./components/collapsible/index.cjs"),m=require("./components/controls/index.cjs"),l=require("./components/croppable/index.cjs"),x=require("./components/dialog/index.cjs"),q=require("./components/dropdown/index.cjs"),g=require("./components/dropzone/index.cjs"),b=require("./components/editor/index.cjs"),T=require("./components/empty-state/index.cjs"),h=require("./components/fieldset/index.cjs"),S=require("./components/figure/index.cjs"),v=require("./components/file/index.cjs"),C=require("./components/footer/index.cjs"),L=require("./components/form/index.cjs"),F=require("./components/graph/index.cjs"),I=require("./components/group/index.cjs"),f=require("./components/header/index.cjs"),k=require("./components/icon/index.cjs"),B=require("./components/iframe/index.cjs"),M=require("./components/image/index.cjs"),A=require("./index-CoUj6S0o.cjs"),D=require("./components/link/index.cjs"),y=require("./components/list/index.cjs"),O=require("./components/loading/index.cjs"),P=require("./components/menu/index.cjs"),j=require("./components/message/index.cjs"),w=require("./components/messages/index.cjs"),e=require("./components/nav/index.cjs"),E=require("./components/object/index.cjs"),G=require("./components/popover/index.cjs"),N=require("./components/portal/index.cjs"),z=require("./components/search/index.cjs"),H=require("./index-BXHfIfib.cjs"),n=require("./components/sortable/index.cjs"),W=require("./components/table/index.cjs"),J=require("./components/textarea/index.cjs"),K=require("./components/toast/index.cjs"),Q=require("./components/toasts/index.cjs"),R=require("./components/toggle/index.cjs"),U=require("./components/toolbar/index.cjs"),V=require("./components/tooltip/index.cjs"),X=require("./components/widget/index.cjs");exports.AppLink=o.AppLink;exports.Aside=t.Aside;exports.Avatar=r.Avatar;exports.Badge=i.Badge;exports.Banner=s.Banner;exports.Branding=c.Branding;exports.Button=_.Button;exports.Card=p.Card;exports.Checkbox=a.Checkbox;exports.Chip=d.Chip;exports.Collapsible=u.Collapsible;exports.Controls=m.Controls;exports.Croppable=l.Croppable;exports.Dialog=x.Dialog;exports.Dropdown=q.Dropdown;exports.Dropzone=g.Dropzone;exports.Editor=b.Editor;exports.EmptyState=T.EmptyState;exports.Fieldset=h.Fieldset;exports.Figure=S.Figure;exports.File=v.File;exports.Footer=C.Footer;exports.Form=L.Form;exports.Graph=F.Graph;exports.Group=I.Group;exports.Header=f.Header;exports.Icon=k.Icon;exports.Iframe=B.Iframe;exports.Image=M.Image;exports.Input=A.Input;exports.Link=D.Link;exports.List=y.List;exports.Loading=O.Loading;exports.Menu=P.Menu;exports.Message=j.Message;exports.Messages=w.Messages;exports.Nav=e.Nav;exports.NavLabel=e.NavLabel;exports.Object=E.Object;exports.Popover=G.Popover;exports.Portal=N.Portal;exports.Search=z.Search;exports.Select=H.Select;exports.Sortable=n.Sortable;exports.useOptionalSortableItem=n.useOptionalSortableItem;exports.Table=W.Table;exports.Textarea=J.Textarea;exports.Toast=K.Toast;exports.Toasts=Q.Toasts;exports.Toggle=R.Toggle;exports.Toolbar=U.Toolbar;exports.Tooltip=V.Tooltip;exports.Widget=X.Widget;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.ts CHANGED
@@ -763,7 +763,7 @@ declare type PortalProps = {
763
763
  setOpen: (open: boolean) => void;
764
764
  };
765
765
 
766
- export declare const Search: ({ closeLabel, filterButtonLabel, filterDialogColumns, filterDialogTitle, filterGroups, onChange, onSelectedFiltersChange, removeFilterLabel, resetLabel, searchLabel, searchPlaceholder, selectedFilters, value, }: SearchProps) => JSX.Element;
766
+ export declare const Search: ({ filterButtonLabel, filterDialogColumns, filterDialogTitle, filterGroups, onChange, onSelectedFiltersChange, removeFilterLabel, resetLabel, searchLabel, searchPlaceholder, selectedFilters, showResultsLabel, value, }: SearchProps) => JSX.Element;
767
767
 
768
768
  export declare type SearchFilter = {
769
769
  description?: string;
@@ -785,7 +785,6 @@ export declare type SearchFilterGroup = {
785
785
  };
786
786
 
787
787
  export declare type SearchProps = {
788
- closeLabel?: string;
789
788
  filterButtonLabel?: string;
790
789
  filterDialogColumns?: 1 | 2;
791
790
  filterDialogTitle?: string;
@@ -797,6 +796,7 @@ export declare type SearchProps = {
797
796
  searchLabel?: string;
798
797
  searchPlaceholder?: string;
799
798
  selectedFilters?: readonly string[];
799
+ showResultsLabel?: string;
800
800
  value?: string;
801
801
  };
802
802
 
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import { Header as _ } from "./components/header/index.js";
27
27
  import { Icon as oo } from "./components/icon/index.js";
28
28
  import { Iframe as eo } from "./components/iframe/index.js";
29
29
  import { Image as po } from "./components/image/index.js";
30
- import { I as xo } from "./index-m3slpD7c.js";
30
+ import { I as xo } from "./index-KbL6DkMp.js";
31
31
  import { Link as ao } from "./components/link/index.js";
32
32
  import { List as io } from "./components/list/index.js";
33
33
  import { Loading as no } from "./components/loading/index.js";
@@ -39,7 +39,7 @@ import { Object as ho } from "./components/object/index.js";
39
39
  import { Popover as Bo } from "./components/popover/index.js";
40
40
  import { Portal as Ao } from "./components/portal/index.js";
41
41
  import { Search as Mo } from "./components/search/index.js";
42
- import { S as Go } from "./index-DycOZMJl.js";
42
+ import { S as Go } from "./index-DKe_FTGA.js";
43
43
  import { Sortable as Oo, useOptionalSortableItem as Po } from "./components/sortable/index.js";
44
44
  import { Table as wo } from "./components/table/index.js";
45
45
  import { Textarea as zo } from "./components/textarea/index.js";
package/dist/tokens.json CHANGED
@@ -365,7 +365,7 @@
365
365
  },
366
366
  "com.solibo": {
367
367
  "packageName": "@solibo/solibo-ui",
368
- "packageVersion": "1.1.1"
368
+ "packageVersion": "1.1.2"
369
369
  }
370
370
  },
371
371
  "$name": "Solibo UI Tokens",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solibo/solibo-ui",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "pnpm run tokens:build && vite build --watch",