@solibo/solibo-ui 0.3.38 → 0.3.40

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 (112) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/assets/index10.css +1 -1
  3. package/dist/assets/index11.css +1 -1
  4. package/dist/assets/index12.css +1 -1
  5. package/dist/assets/index13.css +1 -1
  6. package/dist/assets/index14.css +1 -1
  7. package/dist/assets/index15.css +1 -1
  8. package/dist/assets/index16.css +1 -1
  9. package/dist/assets/index17.css +1 -1
  10. package/dist/assets/index18.css +1 -1
  11. package/dist/assets/index19.css +1 -1
  12. package/dist/assets/index20.css +1 -1
  13. package/dist/assets/index21.css +1 -1
  14. package/dist/assets/index22.css +1 -1
  15. package/dist/assets/index33.css +1 -1
  16. package/dist/assets/index4.css +1 -1
  17. package/dist/assets/index41.css +1 -1
  18. package/dist/assets/index42.css +1 -1
  19. package/dist/assets/index43.css +1 -1
  20. package/dist/assets/index44.css +1 -0
  21. package/dist/assets/index5.css +1 -1
  22. package/dist/assets/index6.css +1 -1
  23. package/dist/assets/index7.css +0 -1
  24. package/dist/assets/index8.css +1 -0
  25. package/dist/assets/index9.css +1 -1
  26. package/dist/components/_avatar/index.cjs +1 -1
  27. package/dist/components/_avatar/index.js +1 -1
  28. package/dist/components/_card/index.cjs +1 -1
  29. package/dist/components/_card/index.js +1 -1
  30. package/dist/components/_collapsible/index.cjs +1 -1
  31. package/dist/components/_collapsible/index.cjs.map +1 -1
  32. package/dist/components/_collapsible/index.js +19 -15
  33. package/dist/components/_collapsible/index.js.map +1 -1
  34. package/dist/components/_croppable/index.cjs +1 -1
  35. package/dist/components/_croppable/index.js +1 -1
  36. package/dist/components/_dropdown/index.cjs +2 -0
  37. package/dist/components/_dropdown/index.cjs.map +1 -0
  38. package/dist/components/_dropdown/index.js +188 -0
  39. package/dist/components/_dropdown/index.js.map +1 -0
  40. package/dist/components/app-link/index.cjs +1 -1
  41. package/dist/components/app-link/index.js +1 -1
  42. package/dist/components/badge/index.cjs +1 -1
  43. package/dist/components/badge/index.js +1 -1
  44. package/dist/components/banner/index.cjs +1 -1
  45. package/dist/components/banner/index.js +1 -1
  46. package/dist/components/button/index.cjs +1 -1
  47. package/dist/components/button/index.cjs.map +1 -1
  48. package/dist/components/button/index.js +18 -17
  49. package/dist/components/button/index.js.map +1 -1
  50. package/dist/components/checkbox/index.cjs +1 -1
  51. package/dist/components/checkbox/index.js +2 -2
  52. package/dist/components/controls/index.cjs +1 -1
  53. package/dist/components/controls/index.js +1 -1
  54. package/dist/components/dialog/index.cjs +1 -1
  55. package/dist/components/dialog/index.js +1 -1
  56. package/dist/components/file/index.cjs +1 -1
  57. package/dist/components/file/index.js +1 -1
  58. package/dist/components/footer/index.cjs +1 -1
  59. package/dist/components/footer/index.js +1 -1
  60. package/dist/components/graph/index.cjs +1 -1
  61. package/dist/components/graph/index.js +1 -1
  62. package/dist/components/group/index.cjs +1 -1
  63. package/dist/components/group/index.js +1 -1
  64. package/dist/components/header/index.cjs +1 -1
  65. package/dist/components/header/index.js +1 -1
  66. package/dist/components/icon/index.cjs +1 -1
  67. package/dist/components/icon/index.js +1 -1
  68. package/dist/components/image/index.cjs +1 -1
  69. package/dist/components/image/index.js +1 -1
  70. package/dist/components/input/index.cjs +1 -1
  71. package/dist/components/input/index.js +2 -2
  72. package/dist/components/layout/index.cjs +1 -1
  73. package/dist/components/layout/index.js +1 -1
  74. package/dist/components/loading/index.cjs +1 -1
  75. package/dist/components/loading/index.js +1 -1
  76. package/dist/components/nav/index.cjs +1 -1
  77. package/dist/components/nav/index.js +1 -1
  78. package/dist/components/select/index.cjs +1 -1
  79. package/dist/components/select/index.cjs.map +1 -1
  80. package/dist/components/select/index.js +6 -26
  81. package/dist/components/select/index.js.map +1 -1
  82. package/dist/components/table/index.cjs +1 -1
  83. package/dist/components/table/index.cjs.map +1 -1
  84. package/dist/components/table/index.js +10 -10
  85. package/dist/components/table/index.js.map +1 -1
  86. package/dist/components/textarea/index.cjs +1 -1
  87. package/dist/components/textarea/index.js +2 -2
  88. package/dist/components/toast/index.cjs +1 -1
  89. package/dist/components/toast/index.js +1 -1
  90. package/dist/components/toolbar/index.cjs +1 -1
  91. package/dist/components/toolbar/index.js +1 -1
  92. package/dist/{icons-CMoejLkL.cjs → icons-C_cX1FYp.cjs} +2 -2
  93. package/dist/{icons-CMoejLkL.cjs.map → icons-C_cX1FYp.cjs.map} +1 -1
  94. package/dist/{icons-BqQRUUWn.js → icons-DfmpRbxE.js} +2 -2
  95. package/dist/{icons-BqQRUUWn.js.map → icons-DfmpRbxE.js.map} +1 -1
  96. package/dist/index-C_OgUYu-.js +41 -0
  97. package/dist/index-C_OgUYu-.js.map +1 -0
  98. package/dist/index-CfK1ATlt.cjs +2 -0
  99. package/dist/index-CfK1ATlt.cjs.map +1 -0
  100. package/dist/index.cjs +1 -1
  101. package/dist/index.d.ts +29 -10
  102. package/dist/index.js +76 -74
  103. package/dist/index.js.map +1 -1
  104. package/dist/utils-BFlnRYx7.js +34 -0
  105. package/dist/utils-BFlnRYx7.js.map +1 -0
  106. package/dist/utils-DqVa4K58.cjs +2 -0
  107. package/dist/utils-DqVa4K58.cjs.map +1 -0
  108. package/package.json +1 -1
  109. package/dist/utils-DXIJVVzz.js +0 -14
  110. package/dist/utils-DXIJVVzz.js.map +0 -1
  111. package/dist/utils-D_TJ8wDc.cjs +0 -2
  112. package/dist/utils-D_TJ8wDc.cjs.map +0 -1
@@ -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/_dropzone/index.cjs"),i=require("./components/_editor/index.cjs"),s=require("./components/_messages/index.cjs"),c=require("./components/_portal/index.cjs"),_=require("./components/_sortable/index.cjs"),a=require("./components/_toasts/index.cjs"),d=require("./components/_widget/index.cjs"),p=require("./components/accordion/index.cjs"),u=require("./components/app-link/index.cjs"),m=require("./components/aside/index.cjs"),x=require("./components/badge/index.cjs"),l=require("./components/banner/index.cjs"),q=require("./components/branding/index.cjs"),g=require("./components/button/index.cjs"),b=require("./components/checkbox/index.cjs"),T=require("./components/controls/index.cjs"),L=require("./components/dialog/index.cjs"),C=require("./components/figure/index.cjs"),k=require("./components/file/index.cjs"),A=require("./components/footer/index.cjs"),B=require("./components/form/index.cjs"),F=require("./components/graph/index.cjs"),h=require("./components/group/index.cjs"),v=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"),D=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("./components/select/index.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"),w=require("./components/toolbar/index.cjs");exports.Avatar=e.Avatar;exports.Card=n.Card;exports.Collapsible=o.Collapsible;exports.Croppable=r.Croppable;exports.Dropzone=t.Dropzone;exports.Editor=i.Editor;exports.Messages=s.Messages;exports.Portal=c.Portal;exports.Sortable=_.Sortable;exports.Toasts=a.Toasts;exports.Widget=d.Widget;exports.Accordion=p.Accordion;exports.AppLink=u.AppLink;exports.Aside=m.Aside;exports.Badge=x.Badge;exports.Banner=l.Banner;exports.Branding=q.Branding;exports.Button=g.Button;exports.Checkbox=b.Checkbox;exports.Controls=T.Controls;exports.Dialog=L.Dialog;exports.Figure=C.Figure;exports.File=k.File;exports.Footer=A.Footer;exports.Form=B.Form;exports.Graph=F.Graph;exports.Group=h.Group;exports.Header=v.Header;exports.Icon=I.Icon;exports.Image=S.Image;exports.Input=f.Input;exports.Layout=y.Layout;exports.Link=M.Link;exports.List=D.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=w.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.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ButtonHTMLAttributes } from 'react';
1
2
  import { ChangeEvent } from 'react';
2
3
  import { default as default_2 } from 'react';
3
4
  import { DetailedHTMLProps } from 'react';
@@ -72,16 +73,14 @@ declare const brandingSVG: {
72
73
  logo: string;
73
74
  };
74
75
 
75
- export declare const Button: ({ children, className, disabled, icon, onClick, variant, ...props }: ButtonProps) => JSX.Element;
76
-
77
- declare type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
78
- children: React.ReactNode;
79
- className?: string;
80
- disabled?: boolean;
81
- icon?: IconName;
82
- onClick?: React.MouseEventHandler<HTMLButtonElement>;
83
- variant?: keyof typeof variants_4;
84
- };
76
+ export declare const Button: ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & {
77
+ children: React.ReactNode;
78
+ className?: string;
79
+ disabled?: boolean;
80
+ icon?: IconName;
81
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
82
+ variant?: keyof typeof variants_4;
83
+ } & RefAttributes<HTMLButtonElement>>;
85
84
 
86
85
  export declare const Card: ({ children, draft, image, onClick, scheduled }: CardProps) => JSX.Element;
87
86
 
@@ -146,6 +145,17 @@ declare type DialogProps = default_2.DialogHTMLAttributes<HTMLDialogElement> & {
146
145
  setOpen?: default_2.Dispatch<default_2.SetStateAction<boolean>>;
147
146
  };
148
147
 
148
+ export declare const Dropdown: ({ children: selectElement, className, emptyLabel, searchPlaceholder, variant, ...props }: DropdownProps) => JSX.Element;
149
+
150
+ declare type DropdownProps = Omit<default_2.ComponentPropsWithoutRef<'div'>, 'children'> & {
151
+ children: DropdownSelectElement;
152
+ emptyLabel?: string;
153
+ searchPlaceholder?: string;
154
+ variant?: 'default' | 'minimal';
155
+ };
156
+
157
+ declare type DropdownSelectElement = NativeSelectElement | WrappedSelectElement;
158
+
149
159
  export declare const Dropzone: ({ accepts, label, maxFileSize, multiple, onChange, onValidation, variant, ...props }: DropzoneProps) => JSX.Element;
150
160
 
151
161
  declare type DropzoneProps = {
@@ -364,6 +374,13 @@ declare type MessagesProps = {
364
374
  sending: boolean;
365
375
  };
366
376
 
377
+ declare type NativeSelectElement = default_2.ReactElement<NativeSelectProps, 'select'>;
378
+
379
+ declare type NativeSelectProps = Omit<default_2.ComponentPropsWithoutRef<'select'>, 'children' | 'multiple'> & {
380
+ children: default_2.ReactNode;
381
+ multiple?: false;
382
+ };
383
+
367
384
  export declare const Nav: ({ animation, children, className, horizontal, variant, ...props }: NavProps) => JSX.Element;
368
385
 
369
386
  declare type NavProps = React.HTMLAttributes<HTMLElement> & {
@@ -516,4 +533,6 @@ declare type WidgetProps = {
516
533
  children: React.ReactNode;
517
534
  };
518
535
 
536
+ declare type WrappedSelectElement = default_2.ReactElement<SelectProps, typeof Select>;
537
+
519
538
  export { }
package/dist/index.js CHANGED
@@ -2,88 +2,90 @@ import { Avatar as e } from "./components/_avatar/index.js";
2
2
  import { Card as p } from "./components/_card/index.js";
3
3
  import { Collapsible as x } from "./components/_collapsible/index.js";
4
4
  import { Croppable as a } from "./components/_croppable/index.js";
5
- import { Dropzone as l } from "./components/_dropzone/index.js";
6
- import { Editor as s } from "./components/_editor/index.js";
7
- import { Messages as d } from "./components/_messages/index.js";
8
- import { Portal as T } from "./components/_portal/index.js";
9
- import { Sortable as u } from "./components/_sortable/index.js";
10
- import { Toasts as L } from "./components/_toasts/index.js";
11
- import { Widget as B } from "./components/_widget/index.js";
12
- import { Accordion as k } from "./components/accordion/index.js";
5
+ import { Dropdown as i } from "./components/_dropdown/index.js";
6
+ import { Dropzone as s } from "./components/_dropzone/index.js";
7
+ import { Editor as d } from "./components/_editor/index.js";
8
+ import { Messages as T } from "./components/_messages/index.js";
9
+ import { Portal as u } from "./components/_portal/index.js";
10
+ import { Sortable as L } from "./components/_sortable/index.js";
11
+ import { Toasts as B } from "./components/_toasts/index.js";
12
+ import { Widget as k } from "./components/_widget/index.js";
13
+ import { Accordion as I } from "./components/accordion/index.js";
13
14
  import { AppLink as h } from "./components/app-link/index.js";
14
- import { Aside as D } from "./components/aside/index.js";
15
- import { Badge as M } from "./components/badge/index.js";
16
- import { Banner as y } from "./components/banner/index.js";
17
- import { Branding as E } from "./components/branding/index.js";
18
- import { Button as N } from "./components/button/index.js";
19
- import { Checkbox as W } from "./components/checkbox/index.js";
20
- import { Controls as q } from "./components/controls/index.js";
21
- import { Dialog as J } from "./components/dialog/index.js";
22
- import { Figure as O } from "./components/figure/index.js";
23
- import { File as R } from "./components/file/index.js";
24
- import { Footer as V } from "./components/footer/index.js";
25
- import { Form as Y } from "./components/form/index.js";
26
- import { Graph as _ } from "./components/graph/index.js";
27
- import { Group as oo } from "./components/group/index.js";
28
- import { Header as eo } from "./components/header/index.js";
29
- import { Icon as po } from "./components/icon/index.js";
30
- import { Image as xo } from "./components/image/index.js";
31
- import { Input as ao } from "./components/input/index.js";
32
- import { Layout as lo } from "./components/layout/index.js";
33
- import { Link as so } from "./components/link/index.js";
34
- import { List as bo } from "./components/list/index.js";
35
- import { Loading as co } from "./components/loading/index.js";
36
- import { Message as Co } from "./components/message/index.js";
37
- import { Nav as Ao } from "./components/nav/index.js";
38
- import { Select as Fo } from "./components/select/index.js";
39
- import { Table as Io } from "./components/table/index.js";
15
+ import { Aside as G } from "./components/aside/index.js";
16
+ import { Badge as w } from "./components/badge/index.js";
17
+ import { Banner as z } from "./components/banner/index.js";
18
+ import { Branding as H } from "./components/branding/index.js";
19
+ import { Button as P } from "./components/button/index.js";
20
+ import { Checkbox as j } from "./components/checkbox/index.js";
21
+ import { Controls as J } from "./components/controls/index.js";
22
+ import { Dialog as O } from "./components/dialog/index.js";
23
+ import { Figure as R } from "./components/figure/index.js";
24
+ import { File as V } from "./components/file/index.js";
25
+ import { Footer as Y } from "./components/footer/index.js";
26
+ import { Form as _ } from "./components/form/index.js";
27
+ import { Graph as oo } from "./components/graph/index.js";
28
+ import { Group as eo } from "./components/group/index.js";
29
+ import { Header as po } from "./components/header/index.js";
30
+ import { Icon as xo } from "./components/icon/index.js";
31
+ import { Image as ao } from "./components/image/index.js";
32
+ import { Input as io } from "./components/input/index.js";
33
+ import { Layout as so } from "./components/layout/index.js";
34
+ import { Link as bo } from "./components/link/index.js";
35
+ import { List as co } from "./components/list/index.js";
36
+ import { Loading as Co } from "./components/loading/index.js";
37
+ import { Message as Ao } from "./components/message/index.js";
38
+ import { Nav as Fo } from "./components/nav/index.js";
39
+ import { S as Do } from "./index-C_OgUYu-.js";
40
+ import { Table as So } from "./components/table/index.js";
40
41
  import { Textarea as vo } from "./components/textarea/index.js";
41
- import { Toast as Go } from "./components/toast/index.js";
42
- import { Toggle as So } from "./components/toggle/index.js";
43
- import { Toolbar as zo } from "./components/toolbar/index.js";
42
+ import { Toast as Mo } from "./components/toast/index.js";
43
+ import { Toggle as yo } from "./components/toggle/index.js";
44
+ import { Toolbar as Eo } from "./components/toolbar/index.js";
44
45
  import './assets/index.css';export {
45
- k as Accordion,
46
+ I as Accordion,
46
47
  h as AppLink,
47
- D as Aside,
48
+ G as Aside,
48
49
  e as Avatar,
49
- M as Badge,
50
- y as Banner,
51
- E as Branding,
52
- N as Button,
50
+ w as Badge,
51
+ z as Banner,
52
+ H as Branding,
53
+ P as Button,
53
54
  p as Card,
54
- W as Checkbox,
55
+ j as Checkbox,
55
56
  x as Collapsible,
56
- q as Controls,
57
+ J as Controls,
57
58
  a as Croppable,
58
- J as Dialog,
59
- l as Dropzone,
60
- s as Editor,
61
- O as Figure,
62
- R as File,
63
- V as Footer,
64
- Y as Form,
65
- _ as Graph,
66
- oo as Group,
67
- eo as Header,
68
- po as Icon,
69
- xo as Image,
70
- ao as Input,
71
- lo as Layout,
72
- so as Link,
73
- bo as List,
74
- co as Loading,
75
- Co as Message,
76
- d as Messages,
77
- Ao as Nav,
78
- T as Portal,
79
- Fo as Select,
80
- u as Sortable,
81
- Io as Table,
59
+ O as Dialog,
60
+ i as Dropdown,
61
+ s as Dropzone,
62
+ d as Editor,
63
+ R as Figure,
64
+ V as File,
65
+ Y as Footer,
66
+ _ as Form,
67
+ oo as Graph,
68
+ eo as Group,
69
+ po as Header,
70
+ xo as Icon,
71
+ ao as Image,
72
+ io as Input,
73
+ so as Layout,
74
+ bo as Link,
75
+ co as List,
76
+ Co as Loading,
77
+ Ao as Message,
78
+ T as Messages,
79
+ Fo as Nav,
80
+ u as Portal,
81
+ Do as Select,
82
+ L as Sortable,
83
+ So as Table,
82
84
  vo as Textarea,
83
- Go as Toast,
84
- L as Toasts,
85
- So as Toggle,
86
- zo as Toolbar,
87
- B as Widget
85
+ Mo as Toast,
86
+ B as Toasts,
87
+ yo as Toggle,
88
+ Eo as Toolbar,
89
+ k as Widget
88
90
  };
89
91
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -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.38",
3
+ "version": "0.3.40",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite build --watch",
@@ -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"}