@solibo/solibo-ui 0.3.39 → 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.
Files changed (57) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/assets/index20.css +1 -1
  3. package/dist/assets/index22.css +1 -1
  4. package/dist/assets/index41.css +1 -1
  5. package/dist/components/_collapsible/index.cjs +1 -1
  6. package/dist/components/_collapsible/index.cjs.map +1 -1
  7. package/dist/components/_collapsible/index.js +19 -15
  8. package/dist/components/_collapsible/index.js.map +1 -1
  9. package/dist/components/_dropdown/index.cjs +1 -1
  10. package/dist/components/_dropdown/index.cjs.map +1 -1
  11. package/dist/components/_dropdown/index.js +149 -136
  12. package/dist/components/_dropdown/index.js.map +1 -1
  13. package/dist/components/button/index.cjs +1 -1
  14. package/dist/components/button/index.cjs.map +1 -1
  15. package/dist/components/button/index.js +13 -13
  16. package/dist/components/button/index.js.map +1 -1
  17. package/dist/components/checkbox/index.cjs +1 -1
  18. package/dist/components/checkbox/index.js +1 -1
  19. package/dist/components/icon/index.cjs +1 -1
  20. package/dist/components/icon/index.js +1 -1
  21. package/dist/components/input/index.cjs +1 -1
  22. package/dist/components/input/index.cjs.map +1 -1
  23. package/dist/components/input/index.js +13 -13
  24. package/dist/components/input/index.js.map +1 -1
  25. package/dist/components/nav/index.cjs +1 -1
  26. package/dist/components/nav/index.js +1 -1
  27. package/dist/components/select/index.cjs +1 -1
  28. package/dist/components/select/index.js +3 -2
  29. package/dist/components/select/index.js.map +1 -1
  30. package/dist/components/table/index.cjs +1 -1
  31. package/dist/components/table/index.cjs.map +1 -1
  32. package/dist/components/table/index.js +10 -10
  33. package/dist/components/table/index.js.map +1 -1
  34. package/dist/components/textarea/index.cjs +1 -1
  35. package/dist/components/textarea/index.js +1 -1
  36. package/dist/{icons-CMoejLkL.cjs → icons-C_cX1FYp.cjs} +2 -2
  37. package/dist/{icons-CMoejLkL.cjs.map → icons-C_cX1FYp.cjs.map} +1 -1
  38. package/dist/{icons-BqQRUUWn.js → icons-DfmpRbxE.js} +2 -2
  39. package/dist/{icons-BqQRUUWn.js.map → icons-DfmpRbxE.js.map} +1 -1
  40. package/dist/{index-xRmXVWAN.js → index-C_OgUYu-.js} +25 -18
  41. package/dist/index-C_OgUYu-.js.map +1 -0
  42. package/dist/index-CfK1ATlt.cjs +2 -0
  43. package/dist/index-CfK1ATlt.cjs.map +1 -0
  44. package/dist/index.cjs +1 -1
  45. package/dist/index.js +1 -1
  46. package/dist/utils-BFlnRYx7.js +34 -0
  47. package/dist/utils-BFlnRYx7.js.map +1 -0
  48. package/dist/utils-DqVa4K58.cjs +2 -0
  49. package/dist/utils-DqVa4K58.cjs.map +1 -0
  50. package/package.json +1 -1
  51. package/dist/index-HNd9cEc6.cjs +0 -2
  52. package/dist/index-HNd9cEc6.cjs.map +0 -1
  53. package/dist/index-xRmXVWAN.js.map +0 -1
  54. package/dist/utils-DXIJVVzz.js +0 -14
  55. package/dist/utils-DXIJVVzz.js.map +0 -1
  56. package/dist/utils-D_TJ8wDc.cjs +0 -2
  57. package/dist/utils-D_TJ8wDc.cjs.map +0 -1
@@ -1,34 +1,41 @@
1
- import { jsxs as o, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
2
  import { t as l } from "./classix-DG18itHa.js";
3
- import { u as m } from "./utils-DXIJVVzz.js";
4
- import './assets/index41.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"]);
5
- function b(a) {
6
- return Object.fromEntries(Object.entries(a).filter(([e]) => e.startsWith("data-") || e.startsWith("aria-") || p.has(e)));
3
+ import { i as b } from "./icons-DfmpRbxE.js";
4
+ import { u as f, r as v } from "./utils-BFlnRYx7.js";
5
+ import './assets/index41.css';const y = /* @__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
+ function _(a) {
7
+ return Object.fromEntries(Object.entries(a).filter(([e]) => e.startsWith("data-") || e.startsWith("aria-") || y.has(e)));
7
8
  }
8
- const h = "_select_10mqf_1", f = "_label_10mqf_21", q = "_required_10mqf_25", t = {
9
- select: h,
10
- label: f,
11
- required: q
12
- }, w = ({
9
+ const q = "_select_1gu7m_1", g = "_label_1gu7m_24", w = "_required_1gu7m_28", t = {
10
+ select: q,
11
+ label: g,
12
+ required: w
13
+ }, j = ({
13
14
  children: a,
14
15
  label: e,
15
- placeholder: i,
16
+ placeholder: o,
16
17
  ...r
17
18
  }) => {
18
19
  const {
19
20
  touched: c,
20
- onBlur: d
21
- } = m(r.value === ""), u = b(r), s = /* @__PURE__ */ o("select", { className: l(t.select, c && "touched"), onBlur: d, ...u, children: [
22
- i && /* @__PURE__ */ n("option", { value: "", hidden: !0, children: i }),
21
+ onBlur: u
22
+ } = f(r.value === ""), d = _(r), {
23
+ style: m,
24
+ ...p
25
+ } = d, h = {
26
+ ...m,
27
+ "--icon-svg": b("chevron").replace("currentColor", v("--color-icon"))
28
+ }, s = /* @__PURE__ */ i("select", { className: l(t.select, c && "touched"), onBlur: u, style: h, ...p, children: [
29
+ o && /* @__PURE__ */ n("option", { value: "", hidden: !0, children: o }, "placeholder"),
23
30
  a
24
31
  ] });
25
- return e ? /* @__PURE__ */ o("label", { "data-component": "select", children: [
32
+ return e ? /* @__PURE__ */ i("label", { "data-component": "select", children: [
26
33
  /* @__PURE__ */ n("span", { className: l(t.label, r.required && t.required), children: e }),
27
34
  s
28
35
  ] }) : s;
29
36
  };
30
37
  export {
31
- w as S,
32
- b as s
38
+ j as S,
39
+ _ as s
33
40
  };
34
- //# sourceMappingURL=index-xRmXVWAN.js.map
41
+ //# sourceMappingURL=index-C_OgUYu-.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-C_OgUYu-.js","sources":["../src/components/select/sanitizeSelectProps.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","import cx from 'classix';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\nimport { resolveColor, useTouched } from '@/utils.ts';\n\nimport { sanitizeSelectProps } from './sanitizeSelectProps';\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 { style, ...restSelectProps } = selectProps;\n const withVars = {\n ...style,\n '--icon-svg': iconSVG('chevron').replace('currentColor', resolveColor('--color-icon')),\n } satisfies withVars;\n\n const selectElement = (\n <select\n className={cx(styles.select, touched && 'touched')}\n onBlur={onBlur}\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 className={cx(styles.label, props.required && styles.required)}>{label}</span>\n {selectElement}\n </label>\n );\n};\n"],"names":["selectKeys","Set","sanitizeSelectProps","props","Object","fromEntries","entries","filter","key","startsWith","has","Select","children","label","placeholder","touched","onBlur","useTouched","value","selectProps","style","restSelectProps","withVars","iconSVG","replace","resolveColor","selectElement","jsxs","cx","styles","select","jsx","required"],"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;;;;;GCvCaG,IAASA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAUC,OAAAA;AAAAA,EAAOC,aAAAA;AAAAA,EAAa,GAAGX;AAAmB,MAAM;AACjF,QAAM;AAAA,IAAEY,SAAAA;AAAAA,IAASC,QAAAA;AAAAA,EAAAA,IAAWC,EAAWd,EAAMe,UAAU,EAAE,GACnDC,IAAcjB,EAAoBC,CAAK,GACvC;AAAA,IAAEiB,OAAAA;AAAAA,IAAO,GAAGC;AAAAA,EAAAA,IAAoBF,GAChCG,IAAW;AAAA,IACf,GAAGF;AAAAA,IACH,cAAcG,EAAQ,SAAS,EAAEC,QAAQ,gBAAgBC,EAAa,cAAc,CAAC;AAAA,EAAA,GAGjFC,IACJ,gBAAAC,EAAC,UAAA,EACC,WAAWC,EAAGC,EAAOC,QAAQf,KAAW,SAAS,GACjD,QAAAC,GACA,OAAOM,GACP,GAAID,GAEHP,UAAAA;AAAAA,IAAAA,uBACE,UAAA,EAEC,OAAO,IACP,QAAM,IAELA,eAJG,aAKN;AAAA,IAEDF;AAAAA,EAAAA,GACH;AAGF,SAAKC,IAKH,gBAAAc,EAAC,SAAA,EAAK,kBAAA,UACJ,UAAA;AAAA,IAAA,gBAAAI,EAAC,QAAA,EAAK,WAAWH,EAAGC,EAAOhB,OAAOV,EAAM6B,YAAYH,EAAOG,QAAQ,GAAInB,UAAAA,EAAAA,CAAM;AAAA,IAC5Ea;AAAAA,EAAAA,GACH,IAPOA;AASX;"}
@@ -0,0 +1,2 @@
1
+ "use strict";require('./assets/index41.css');const t=require("react/jsx-runtime"),n=require("./classix-5H4IWnMA.cjs"),q=require("./icons-C_cX1FYp.cjs"),l=require("./utils-DqVa4K58.cjs"),v=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"]);function c(r){return Object.fromEntries(Object.entries(r).filter(([e])=>e.startsWith("data-")||e.startsWith("aria-")||v.has(e)))}const y="_select_1gu7m_1",_="_label_1gu7m_24",x="_required_1gu7m_28",s={select:y,label:_,required:x},j=({children:r,label:e,placeholder:i,...a})=>{const{touched:u,onBlur:d}=l.useTouched(a.value===""),h=c(a),{style:m,...p}=h,b={...m,"--icon-svg":q.iconSVG("chevron").replace("currentColor",l.resolveColor("--color-icon"))},o=t.jsxs("select",{className:n.t(s.select,u&&"touched"),onBlur:d,style:b,...p,children:[i&&t.jsx("option",{value:"",hidden:!0,children:i},"placeholder"),r]});return e?t.jsxs("label",{"data-component":"select",children:[t.jsx("span",{className:n.t(s.label,a.required&&s.required),children:e}),o]}):o};exports.Select=j;exports.sanitizeSelectProps=c;
2
+ //# sourceMappingURL=index-CfK1ATlt.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CfK1ATlt.cjs","sources":["../src/components/select/sanitizeSelectProps.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","import cx from 'classix';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\nimport { resolveColor, useTouched } from '@/utils.ts';\n\nimport { sanitizeSelectProps } from './sanitizeSelectProps';\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 { style, ...restSelectProps } = selectProps;\n const withVars = {\n ...style,\n '--icon-svg': iconSVG('chevron').replace('currentColor', resolveColor('--color-icon')),\n } satisfies withVars;\n\n const selectElement = (\n <select\n className={cx(styles.select, touched && 'touched')}\n onBlur={onBlur}\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 className={cx(styles.label, props.required && styles.required)}>{label}</span>\n {selectElement}\n </label>\n );\n};\n"],"names":["selectKeys","Set","sanitizeSelectProps","props","Object","fromEntries","entries","filter","key","startsWith","has","Select","children","label","placeholder","touched","onBlur","useTouched","value","selectProps","style","restSelectProps","withVars","iconSVG","replace","resolveColor","selectElement","jsxs","cx","styles","select","jsx","required"],"mappings":"0JAAMA,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,sGCvCaG,EAASA,CAAC,CAAEC,SAAAA,EAAUC,MAAAA,EAAOC,YAAAA,EAAa,GAAGX,CAAmB,IAAM,CACjF,KAAM,CAAEY,QAAAA,EAASC,OAAAA,CAAAA,EAAWC,aAAWd,EAAMe,QAAU,EAAE,EACnDC,EAAcjB,EAAoBC,CAAK,EACvC,CAAEiB,MAAAA,EAAO,GAAGC,CAAAA,EAAoBF,EAChCG,EAAW,CACf,GAAGF,EACH,aAAcG,EAAAA,QAAQ,SAAS,EAAEC,QAAQ,eAAgBC,EAAAA,aAAa,cAAc,CAAC,CAAA,EAGjFC,EACJC,EAAAA,KAAC,SAAA,CACC,UAAWC,EAAAA,EAAGC,EAAOC,OAAQf,GAAW,SAAS,EACjD,OAAAC,EACA,MAAOM,EACP,GAAID,EAEHP,SAAAA,CAAAA,SACE,SAAA,CAEC,MAAO,GACP,OAAM,GAELA,YAJG,aAKN,EAEDF,CAAAA,EACH,EAGF,OAAKC,EAKHc,EAAAA,KAAC,QAAA,CAAK,iBAAA,SACJ,SAAA,CAAAI,EAAAA,IAAC,OAAA,CAAK,UAAWH,EAAAA,EAAGC,EAAOhB,MAAOV,EAAM6B,UAAYH,EAAOG,QAAQ,EAAInB,SAAAA,CAAAA,CAAM,EAC5Ea,CAAAA,EACH,EAPOA,CASX"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/index.css');const e=require("./components/_avatar/index.cjs"),n=require("./components/_card/index.cjs"),o=require("./components/_collapsible/index.cjs"),r=require("./components/_croppable/index.cjs"),t=require("./components/_dropdown/index.cjs"),i=require("./components/_dropzone/index.cjs"),s=require("./components/_editor/index.cjs"),c=require("./components/_messages/index.cjs"),_=require("./components/_portal/index.cjs"),a=require("./components/_sortable/index.cjs"),d=require("./components/_toasts/index.cjs"),p=require("./components/_widget/index.cjs"),u=require("./components/accordion/index.cjs"),m=require("./components/app-link/index.cjs"),x=require("./components/aside/index.cjs"),l=require("./components/badge/index.cjs"),q=require("./components/banner/index.cjs"),g=require("./components/branding/index.cjs"),b=require("./components/button/index.cjs"),T=require("./components/checkbox/index.cjs"),L=require("./components/controls/index.cjs"),C=require("./components/dialog/index.cjs"),k=require("./components/figure/index.cjs"),A=require("./components/file/index.cjs"),B=require("./components/footer/index.cjs"),F=require("./components/form/index.cjs"),h=require("./components/graph/index.cjs"),v=require("./components/group/index.cjs"),D=require("./components/header/index.cjs"),I=require("./components/icon/index.cjs"),S=require("./components/image/index.cjs"),f=require("./components/input/index.cjs"),y=require("./components/layout/index.cjs"),M=require("./components/link/index.cjs"),w=require("./components/list/index.cjs"),G=require("./components/loading/index.cjs"),z=require("./components/message/index.cjs"),P=require("./components/nav/index.cjs"),E=require("./index-HNd9cEc6.cjs"),H=require("./components/table/index.cjs"),N=require("./components/textarea/index.cjs"),W=require("./components/toast/index.cjs"),j=require("./components/toggle/index.cjs"),O=require("./components/toolbar/index.cjs");exports.Avatar=e.Avatar;exports.Card=n.Card;exports.Collapsible=o.Collapsible;exports.Croppable=r.Croppable;exports.Dropdown=t.Dropdown;exports.Dropzone=i.Dropzone;exports.Editor=s.Editor;exports.Messages=c.Messages;exports.Portal=_.Portal;exports.Sortable=a.Sortable;exports.Toasts=d.Toasts;exports.Widget=p.Widget;exports.Accordion=u.Accordion;exports.AppLink=m.AppLink;exports.Aside=x.Aside;exports.Badge=l.Badge;exports.Banner=q.Banner;exports.Branding=g.Branding;exports.Button=b.Button;exports.Checkbox=T.Checkbox;exports.Controls=L.Controls;exports.Dialog=C.Dialog;exports.Figure=k.Figure;exports.File=A.File;exports.Footer=B.Footer;exports.Form=F.Form;exports.Graph=h.Graph;exports.Group=v.Group;exports.Header=D.Header;exports.Icon=I.Icon;exports.Image=S.Image;exports.Input=f.Input;exports.Layout=y.Layout;exports.Link=M.Link;exports.List=w.List;exports.Loading=G.Loading;exports.Message=z.Message;exports.Nav=P.Nav;exports.Select=E.Select;exports.Table=H.Table;exports.Textarea=N.Textarea;exports.Toast=W.Toast;exports.Toggle=j.Toggle;exports.Toolbar=O.Toolbar;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/index.css');const e=require("./components/_avatar/index.cjs"),n=require("./components/_card/index.cjs"),o=require("./components/_collapsible/index.cjs"),r=require("./components/_croppable/index.cjs"),t=require("./components/_dropdown/index.cjs"),i=require("./components/_dropzone/index.cjs"),s=require("./components/_editor/index.cjs"),c=require("./components/_messages/index.cjs"),_=require("./components/_portal/index.cjs"),a=require("./components/_sortable/index.cjs"),d=require("./components/_toasts/index.cjs"),p=require("./components/_widget/index.cjs"),u=require("./components/accordion/index.cjs"),m=require("./components/app-link/index.cjs"),x=require("./components/aside/index.cjs"),l=require("./components/badge/index.cjs"),q=require("./components/banner/index.cjs"),g=require("./components/branding/index.cjs"),b=require("./components/button/index.cjs"),T=require("./components/checkbox/index.cjs"),L=require("./components/controls/index.cjs"),C=require("./components/dialog/index.cjs"),k=require("./components/figure/index.cjs"),A=require("./components/file/index.cjs"),B=require("./components/footer/index.cjs"),F=require("./components/form/index.cjs"),h=require("./components/graph/index.cjs"),v=require("./components/group/index.cjs"),D=require("./components/header/index.cjs"),I=require("./components/icon/index.cjs"),S=require("./components/image/index.cjs"),f=require("./components/input/index.cjs"),y=require("./components/layout/index.cjs"),M=require("./components/link/index.cjs"),w=require("./components/list/index.cjs"),G=require("./components/loading/index.cjs"),z=require("./components/message/index.cjs"),P=require("./components/nav/index.cjs"),E=require("./index-CfK1ATlt.cjs"),H=require("./components/table/index.cjs"),N=require("./components/textarea/index.cjs"),W=require("./components/toast/index.cjs"),j=require("./components/toggle/index.cjs"),O=require("./components/toolbar/index.cjs");exports.Avatar=e.Avatar;exports.Card=n.Card;exports.Collapsible=o.Collapsible;exports.Croppable=r.Croppable;exports.Dropdown=t.Dropdown;exports.Dropzone=i.Dropzone;exports.Editor=s.Editor;exports.Messages=c.Messages;exports.Portal=_.Portal;exports.Sortable=a.Sortable;exports.Toasts=d.Toasts;exports.Widget=p.Widget;exports.Accordion=u.Accordion;exports.AppLink=m.AppLink;exports.Aside=x.Aside;exports.Badge=l.Badge;exports.Banner=q.Banner;exports.Branding=g.Branding;exports.Button=b.Button;exports.Checkbox=T.Checkbox;exports.Controls=L.Controls;exports.Dialog=C.Dialog;exports.Figure=k.Figure;exports.File=A.File;exports.Footer=B.Footer;exports.Form=F.Form;exports.Graph=h.Graph;exports.Group=v.Group;exports.Header=D.Header;exports.Icon=I.Icon;exports.Image=S.Image;exports.Input=f.Input;exports.Layout=y.Layout;exports.Link=M.Link;exports.List=w.List;exports.Loading=G.Loading;exports.Message=z.Message;exports.Nav=P.Nav;exports.Select=E.Select;exports.Table=H.Table;exports.Textarea=N.Textarea;exports.Toast=W.Toast;exports.Toggle=j.Toggle;exports.Toolbar=O.Toolbar;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import { List as co } from "./components/list/index.js";
36
36
  import { Loading as Co } from "./components/loading/index.js";
37
37
  import { Message as Ao } from "./components/message/index.js";
38
38
  import { Nav as Fo } from "./components/nav/index.js";
39
- import { S as Do } from "./index-xRmXVWAN.js";
39
+ import { S as Do } from "./index-C_OgUYu-.js";
40
40
  import { Table as So } from "./components/table/index.js";
41
41
  import { Textarea as vo } from "./components/textarea/index.js";
42
42
  import { Toast as Mo } from "./components/toast/index.js";
@@ -0,0 +1,34 @@
1
+ import { useState as d, useCallback as f, useEffect as m } from "react";
2
+ function b(o, n = "currentColor") {
3
+ var l;
4
+ const r = /^--[\w-]+$/, u = /^var\(\s*(--[\w-]+)\s*(?:,\s*(.+))?\)$/;
5
+ if (typeof document > "u")
6
+ return n;
7
+ const i = getComputedStyle(document.documentElement), c = /* @__PURE__ */ new Set();
8
+ let e = o.trim();
9
+ for (; e; ) {
10
+ const t = e.match(u), s = (t == null ? void 0 : t[1]) ?? (r.test(e) ? e : null), a = (l = t == null ? void 0 : t[2]) == null ? void 0 : l.trim();
11
+ if (!s)
12
+ return e;
13
+ if (c.has(s)) {
14
+ e = a ?? "";
15
+ continue;
16
+ }
17
+ c.add(s), e = i.getPropertyValue(s).trim() || a || "";
18
+ }
19
+ return n;
20
+ }
21
+ function w(o) {
22
+ const [n, r] = d(!1), u = f(() => r(!0), []);
23
+ return m(() => {
24
+ r(!1);
25
+ }, [o]), {
26
+ touched: n,
27
+ onBlur: u
28
+ };
29
+ }
30
+ export {
31
+ b as r,
32
+ w as u
33
+ };
34
+ //# sourceMappingURL=utils-BFlnRYx7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-BFlnRYx7.js","sources":["../src/utils.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nexport function resolveColor(input: `--${string}` | string, fallback = 'currentColor'): string {\n const cssVariablePattern = /^--[\\w-]+$/;\n const cssVariableReferencePattern = /^var\\(\\s*(--[\\w-]+)\\s*(?:,\\s*(.+))?\\)$/;\n\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 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 fallback;\n}\n\nexport function useTouched(resetKey?: unknown) {\n const [touched, setTouched] = useState(false);\n const onBlur = useCallback(() => setTouched(true), []);\n\n useEffect(() => {\n setTouched(false);\n }, [resetKey]);\n\n return { touched, onBlur };\n}\n"],"names":["resolveColor","input","fallback","cssVariablePattern","cssVariableReferencePattern","document","styles","getComputedStyle","documentElement","seen","Set","current","trim","match","variableName","test","nestedFallback","has","add","getPropertyValue","useTouched","resetKey","touched","setTouched","useState","onBlur","useCallback","useEffect"],"mappings":";AAEO,SAASA,EAAaC,GAA+BC,IAAW,gBAAwB;;AAC7F,QAAMC,IAAqB,cACrBC,IAA8B;AAEpC,MAAI,OAAOC,WAAa;AACtB,WAAOH;AAGT,QAAMI,IAASC,iBAAiBF,SAASG,eAAe,GAClDC,wBAAWC,IAAAA;AACjB,MAAIC,IAAUV,EAAMW,KAAAA;AAEpB,SAAOD,KAAS;AACd,UAAME,IAAQF,EAAQE,MAAMT,CAA2B,GACjDU,KAAeD,KAAAA,gBAAAA,EAAQ,QAAOV,EAAmBY,KAAKJ,CAAO,IAAIA,IAAU,OAC3EK,KAAiBH,IAAAA,KAAAA,gBAAAA,EAAQ,OAARA,gBAAAA,EAAYD;AAEnC,QAAI,CAACE;AACH,aAAOH;AAGT,QAAIF,EAAKQ,IAAIH,CAAY,GAAG;AAC1BH,MAAAA,IAAUK,KAAkB;AAC5B;AAAA,IACF;AAEAP,IAAAA,EAAKS,IAAIJ,CAAY,GAErBH,IAAUL,EAAOa,iBAAiBL,CAAY,EAAEF,KAAAA,KAAUI,KAAkB;AAAA,EAC9E;AAEA,SAAOd;AACT;AAEO,SAASkB,EAAWC,GAAoB;AAC7C,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAK,GACtCC,IAASC,EAAY,MAAMH,EAAW,EAAI,GAAG,CAAA,CAAE;AAErDI,SAAAA,EAAU,MAAM;AACdJ,IAAAA,EAAW,EAAK;AAAA,EAClB,GAAG,CAACF,CAAQ,CAAC,GAEN;AAAA,IAAEC,SAAAA;AAAAA,IAASG,QAAAA;AAAAA,EAAAA;AACpB;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const c=require("react");function f(o,n="currentColor"){var a;const s=/^--[\w-]+$/,u=/^var\(\s*(--[\w-]+)\s*(?:,\s*(.+))?\)$/;if(typeof document>"u")return n;const d=getComputedStyle(document.documentElement),l=new Set;let e=o.trim();for(;e;){const t=e.match(u),r=(t==null?void 0:t[1])??(s.test(e)?e:null),i=(a=t==null?void 0:t[2])==null?void 0:a.trim();if(!r)return e;if(l.has(r)){e=i??"";continue}l.add(r),e=d.getPropertyValue(r).trim()||i||""}return n}function m(o){const[n,s]=c.useState(!1),u=c.useCallback(()=>s(!0),[]);return c.useEffect(()=>{s(!1)},[o]),{touched:n,onBlur:u}}exports.resolveColor=f;exports.useTouched=m;
2
+ //# sourceMappingURL=utils-DqVa4K58.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-DqVa4K58.cjs","sources":["../src/utils.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nexport function resolveColor(input: `--${string}` | string, fallback = 'currentColor'): string {\n const cssVariablePattern = /^--[\\w-]+$/;\n const cssVariableReferencePattern = /^var\\(\\s*(--[\\w-]+)\\s*(?:,\\s*(.+))?\\)$/;\n\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 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 fallback;\n}\n\nexport function useTouched(resetKey?: unknown) {\n const [touched, setTouched] = useState(false);\n const onBlur = useCallback(() => setTouched(true), []);\n\n useEffect(() => {\n setTouched(false);\n }, [resetKey]);\n\n return { touched, onBlur };\n}\n"],"names":["resolveColor","input","fallback","cssVariablePattern","cssVariableReferencePattern","document","styles","getComputedStyle","documentElement","seen","Set","current","trim","match","variableName","test","nestedFallback","has","add","getPropertyValue","useTouched","resetKey","touched","setTouched","useState","onBlur","useCallback","useEffect"],"mappings":"sCAEO,SAASA,EAAaC,EAA+BC,EAAW,eAAwB,OAC7F,MAAMC,EAAqB,aACrBC,EAA8B,yCAEpC,GAAI,OAAOC,SAAa,IACtB,OAAOH,EAGT,MAAMI,EAASC,iBAAiBF,SAASG,eAAe,EAClDC,MAAWC,IACjB,IAAIC,EAAUV,EAAMW,KAAAA,EAEpB,KAAOD,GAAS,CACd,MAAME,EAAQF,EAAQE,MAAMT,CAA2B,EACjDU,GAAeD,GAAAA,YAAAA,EAAQ,MAAOV,EAAmBY,KAAKJ,CAAO,EAAIA,EAAU,MAC3EK,GAAiBH,EAAAA,GAAAA,YAAAA,EAAQ,KAARA,YAAAA,EAAYD,OAEnC,GAAI,CAACE,EACH,OAAOH,EAGT,GAAIF,EAAKQ,IAAIH,CAAY,EAAG,CAC1BH,EAAUK,GAAkB,GAC5B,QACF,CAEAP,EAAKS,IAAIJ,CAAY,EAErBH,EAAUL,EAAOa,iBAAiBL,CAAY,EAAEF,KAAAA,GAAUI,GAAkB,EAC9E,CAEA,OAAOd,CACT,CAEO,SAASkB,EAAWC,EAAoB,CAC7C,KAAM,CAACC,EAASC,CAAU,EAAIC,EAAAA,SAAS,EAAK,EACtCC,EAASC,EAAAA,YAAY,IAAMH,EAAW,EAAI,EAAG,CAAA,CAAE,EAErDI,OAAAA,EAAAA,UAAU,IAAM,CACdJ,EAAW,EAAK,CAClB,EAAG,CAACF,CAAQ,CAAC,EAEN,CAAEC,QAAAA,EAASG,OAAAA,CAAAA,CACpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solibo/solibo-ui",
3
- "version": "0.3.39",
3
+ "version": "0.3.41",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite build --watch",
@@ -1,2 +0,0 @@
1
- "use strict";require('./assets/index41.css');const a=require("react/jsx-runtime"),l=require("./classix-5H4IWnMA.cjs"),m=require("./utils-D_TJ8wDc.cjs"),b=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"]);function o(t){return Object.fromEntries(Object.entries(t).filter(([e])=>e.startsWith("data-")||e.startsWith("aria-")||b.has(e)))}const h="_select_10mqf_1",p="_label_10mqf_21",q="_required_10mqf_25",r={select:h,label:p,required:q},f=({children:t,label:e,placeholder:i,...s})=>{const{touched:c,onBlur:u}=m.useTouched(s.value===""),d=o(s),n=a.jsxs("select",{className:l.t(r.select,c&&"touched"),onBlur:u,...d,children:[i&&a.jsx("option",{value:"",hidden:!0,children:i}),t]});return e?a.jsxs("label",{"data-component":"select",children:[a.jsx("span",{className:l.t(r.label,s.required&&r.required),children:e}),n]}):n};exports.Select=f;exports.sanitizeSelectProps=o;
2
- //# sourceMappingURL=index-HNd9cEc6.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-HNd9cEc6.cjs","sources":["../src/components/select/sanitizeSelectProps.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","import cx from 'classix';\n\nimport { useTouched } from '@/utils.ts';\n\nimport { sanitizeSelectProps } from './sanitizeSelectProps';\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\nexport const Select = ({ children, label, placeholder, ...props }: SelectProps) => {\n const { touched, onBlur } = useTouched(props.value === '');\n const selectProps = sanitizeSelectProps(props);\n\n const selectElement = (\n <select\n className={cx(styles.select, touched && 'touched')}\n onBlur={onBlur}\n {...selectProps}\n >\n {placeholder && (\n <option\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 className={cx(styles.label, props.required && styles.required)}>{label}</span>\n {selectElement}\n </label>\n );\n};\n"],"names":["selectKeys","Set","sanitizeSelectProps","props","Object","fromEntries","entries","filter","key","startsWith","has","Select","children","label","placeholder","touched","onBlur","useTouched","value","selectProps","selectElement","jsxs","cx","styles","select","jsx","required"],"mappings":"wHAAMA,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,sGC5CaG,EAASA,CAAC,CAAEC,SAAAA,EAAUC,MAAAA,EAAOC,YAAAA,EAAa,GAAGX,CAAmB,IAAM,CACjF,KAAM,CAAEY,QAAAA,EAASC,OAAAA,CAAAA,EAAWC,aAAWd,EAAMe,QAAU,EAAE,EACnDC,EAAcjB,EAAoBC,CAAK,EAEvCiB,EACJC,EAAAA,KAAC,SAAA,CACC,UAAWC,EAAAA,EAAGC,EAAOC,OAAQT,GAAW,SAAS,EACjD,OAAAC,EACA,GAAIG,EAEHL,SAAAA,CAAAA,SACE,SAAA,CACC,MAAO,GACP,OAAM,GAELA,SAAAA,EACH,EAEDF,CAAAA,EACH,EAGF,OAAKC,EAKHQ,EAAAA,KAAC,QAAA,CAAK,iBAAA,SACJ,SAAA,CAAAI,EAAAA,IAAC,OAAA,CAAK,UAAWH,EAAAA,EAAGC,EAAOV,MAAOV,EAAMuB,UAAYH,EAAOG,QAAQ,EAAIb,SAAAA,CAAAA,CAAM,EAC5EO,CAAAA,EACH,EAPOA,CASX"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-xRmXVWAN.js","sources":["../src/components/select/sanitizeSelectProps.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","import cx from 'classix';\n\nimport { useTouched } from '@/utils.ts';\n\nimport { sanitizeSelectProps } from './sanitizeSelectProps';\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\nexport const Select = ({ children, label, placeholder, ...props }: SelectProps) => {\n const { touched, onBlur } = useTouched(props.value === '');\n const selectProps = sanitizeSelectProps(props);\n\n const selectElement = (\n <select\n className={cx(styles.select, touched && 'touched')}\n onBlur={onBlur}\n {...selectProps}\n >\n {placeholder && (\n <option\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 className={cx(styles.label, props.required && styles.required)}>{label}</span>\n {selectElement}\n </label>\n );\n};\n"],"names":["selectKeys","Set","sanitizeSelectProps","props","Object","fromEntries","entries","filter","key","startsWith","has","Select","children","label","placeholder","touched","onBlur","useTouched","value","selectProps","selectElement","jsxs","cx","styles","select","jsx","required"],"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;;;;;GC5CaG,IAASA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAUC,OAAAA;AAAAA,EAAOC,aAAAA;AAAAA,EAAa,GAAGX;AAAmB,MAAM;AACjF,QAAM;AAAA,IAAEY,SAAAA;AAAAA,IAASC,QAAAA;AAAAA,EAAAA,IAAWC,EAAWd,EAAMe,UAAU,EAAE,GACnDC,IAAcjB,EAAoBC,CAAK,GAEvCiB,IACJ,gBAAAC,EAAC,UAAA,EACC,WAAWC,EAAGC,EAAOC,QAAQT,KAAW,SAAS,GACjD,QAAAC,GACA,GAAIG,GAEHL,UAAAA;AAAAA,IAAAA,uBACE,UAAA,EACC,OAAO,IACP,QAAM,IAELA,UAAAA,GACH;AAAA,IAEDF;AAAAA,EAAAA,GACH;AAGF,SAAKC,IAKH,gBAAAQ,EAAC,SAAA,EAAK,kBAAA,UACJ,UAAA;AAAA,IAAA,gBAAAI,EAAC,QAAA,EAAK,WAAWH,EAAGC,EAAOV,OAAOV,EAAMuB,YAAYH,EAAOG,QAAQ,GAAIb,UAAAA,EAAAA,CAAM;AAAA,IAC5EO;AAAAA,EAAAA,GACH,IAPOA;AASX;"}
@@ -1,14 +0,0 @@
1
- import { useState as s, useCallback as c, useEffect as r } from "react";
2
- function f(t) {
3
- const [u, e] = s(!1), o = c(() => e(!0), []);
4
- return r(() => {
5
- e(!1);
6
- }, [t]), {
7
- touched: u,
8
- onBlur: o
9
- };
10
- }
11
- export {
12
- f as u
13
- };
14
- //# sourceMappingURL=utils-DXIJVVzz.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils-DXIJVVzz.js","sources":["../src/utils.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nexport function useTouched(resetKey?: unknown) {\n const [touched, setTouched] = useState(false);\n const onBlur = useCallback(() => setTouched(true), []);\n\n useEffect(() => {\n setTouched(false);\n }, [resetKey]);\n\n return { touched, onBlur };\n}\n"],"names":["useTouched","resetKey","touched","setTouched","useState","onBlur","useCallback","useEffect"],"mappings":";AAEO,SAASA,EAAWC,GAAoB;AAC7C,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAS,EAAK,GACtCC,IAASC,EAAY,MAAMH,EAAW,EAAI,GAAG,CAAA,CAAE;AAErDI,SAAAA,EAAU,MAAM;AACdJ,IAAAA,EAAW,EAAK;AAAA,EAClB,GAAG,CAACF,CAAQ,CAAC,GAEN;AAAA,IAAEC,SAAAA;AAAAA,IAASG,QAAAA;AAAAA,EAAAA;AACpB;"}
@@ -1,2 +0,0 @@
1
- "use strict";const e=require("react");function o(t){const[s,u]=e.useState(!1),c=e.useCallback(()=>u(!0),[]);return e.useEffect(()=>{u(!1)},[t]),{touched:s,onBlur:c}}exports.useTouched=o;
2
- //# sourceMappingURL=utils-D_TJ8wDc.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils-D_TJ8wDc.cjs","sources":["../src/utils.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nexport function useTouched(resetKey?: unknown) {\n const [touched, setTouched] = useState(false);\n const onBlur = useCallback(() => setTouched(true), []);\n\n useEffect(() => {\n setTouched(false);\n }, [resetKey]);\n\n return { touched, onBlur };\n}\n"],"names":["useTouched","resetKey","touched","setTouched","useState","onBlur","useCallback","useEffect"],"mappings":"sCAEO,SAASA,EAAWC,EAAoB,CAC7C,KAAM,CAACC,EAASC,CAAU,EAAIC,EAAAA,SAAS,EAAK,EACtCC,EAASC,EAAAA,YAAY,IAAMH,EAAW,EAAI,EAAG,CAAA,CAAE,EAErDI,OAAAA,EAAAA,UAAU,IAAM,CACdJ,EAAW,EAAK,CAClB,EAAG,CAACF,CAAQ,CAAC,EAEN,CAAEC,QAAAA,EAASG,OAAAA,CAAAA,CACpB"}