@solibo/solibo-ui 1.0.15 → 1.0.16

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 (120) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/assets/index10.css +1 -1
  3. package/dist/assets/index12.css +1 -1
  4. package/dist/assets/index13.css +1 -1
  5. package/dist/assets/index14.css +1 -1
  6. package/dist/assets/index15.css +1 -1
  7. package/dist/assets/index18.css +1 -1
  8. package/dist/assets/index23.css +1 -1
  9. package/dist/assets/index24.css +1 -1
  10. package/dist/assets/index25.css +1 -1
  11. package/dist/assets/index26.css +1 -1
  12. package/dist/assets/index27.css +1 -1
  13. package/dist/assets/index29.css +1 -1
  14. package/dist/assets/index3.css +1 -1
  15. package/dist/assets/index30.css +1 -1
  16. package/dist/assets/index31.css +1 -1
  17. package/dist/assets/index33.css +1 -1
  18. package/dist/assets/index34.css +1 -1
  19. package/dist/assets/index35.css +1 -1
  20. package/dist/assets/index36.css +1 -1
  21. package/dist/assets/index37.css +1 -1
  22. package/dist/assets/index39.css +1 -1
  23. package/dist/assets/index4.css +1 -1
  24. package/dist/assets/index43.css +1 -1
  25. package/dist/assets/index44.css +1 -1
  26. package/dist/assets/index45.css +1 -1
  27. package/dist/assets/index47.css +1 -1
  28. package/dist/assets/index48.css +1 -1
  29. package/dist/assets/index49.css +1 -1
  30. package/dist/assets/index6.css +1 -1
  31. package/dist/assets/index8.css +1 -1
  32. package/dist/assets/index9.css +1 -1
  33. package/dist/assets/menu-popover.css +1 -1
  34. package/dist/components/app-link/index.cjs +1 -1
  35. package/dist/components/app-link/index.js +8 -8
  36. package/dist/components/aside/index.cjs +1 -1
  37. package/dist/components/aside/index.js +11 -11
  38. package/dist/components/avatar/index.cjs +1 -1
  39. package/dist/components/avatar/index.cjs.map +1 -1
  40. package/dist/components/avatar/index.js +58 -58
  41. package/dist/components/badge/index.cjs +1 -1
  42. package/dist/components/badge/index.js +27 -27
  43. package/dist/components/banner/index.cjs +1 -1
  44. package/dist/components/banner/index.js +14 -14
  45. package/dist/components/button/index.cjs +1 -1
  46. package/dist/components/button/index.js +18 -18
  47. package/dist/components/card/index.cjs +1 -1
  48. package/dist/components/card/index.js +46 -46
  49. package/dist/components/checkbox/index.cjs +1 -1
  50. package/dist/components/checkbox/index.js +7 -7
  51. package/dist/components/collapsible/index.cjs +1 -1
  52. package/dist/components/collapsible/index.cjs.map +1 -1
  53. package/dist/components/collapsible/index.js +18 -37
  54. package/dist/components/collapsible/index.js.map +1 -1
  55. package/dist/components/controls/index.cjs +1 -1
  56. package/dist/components/controls/index.cjs.map +1 -1
  57. package/dist/components/controls/index.js +110 -90
  58. package/dist/components/controls/index.js.map +1 -1
  59. package/dist/components/croppable/index.cjs +1 -1
  60. package/dist/components/croppable/index.js +181 -181
  61. package/dist/components/dialog/index.cjs +1 -1
  62. package/dist/components/dialog/index.js +31 -31
  63. package/dist/components/dropdown/index.cjs +1 -1
  64. package/dist/components/dropdown/index.js +80 -80
  65. package/dist/components/editor/index.cjs +16 -16
  66. package/dist/components/editor/index.cjs.map +1 -1
  67. package/dist/components/editor/index.js +196 -196
  68. package/dist/components/file/index.cjs +1 -1
  69. package/dist/components/file/index.js +24 -24
  70. package/dist/components/header/index.cjs +1 -1
  71. package/dist/components/header/index.cjs.map +1 -1
  72. package/dist/components/header/index.js +14 -14
  73. package/dist/components/icon/index.cjs +1 -1
  74. package/dist/components/icon/index.js +20 -20
  75. package/dist/components/input/index.cjs +1 -1
  76. package/dist/components/input/index.js +1 -1
  77. package/dist/components/list/index.cjs +1 -1
  78. package/dist/components/list/index.js +24 -24
  79. package/dist/components/loading/index.cjs +1 -1
  80. package/dist/components/loading/index.js +11 -11
  81. package/dist/components/menu/index.cjs +1 -1
  82. package/dist/components/menu/index.js +1 -1
  83. package/dist/components/message/index.cjs +1 -1
  84. package/dist/components/message/index.cjs.map +1 -1
  85. package/dist/components/message/index.js +26 -26
  86. package/dist/components/messages/index.cjs +1 -1
  87. package/dist/components/messages/index.js +20 -20
  88. package/dist/components/nav/index.cjs +1 -1
  89. package/dist/components/nav/index.js +12 -12
  90. package/dist/components/popover/index.cjs +1 -1
  91. package/dist/components/popover/index.js +38 -38
  92. package/dist/components/portal/index.cjs +1 -1
  93. package/dist/components/portal/index.js +7 -7
  94. package/dist/components/search/index.cjs +1 -1
  95. package/dist/components/search/index.cjs.map +1 -1
  96. package/dist/components/search/index.js +36 -36
  97. package/dist/components/sortable/index.cjs +1 -1
  98. package/dist/components/sortable/index.js +74 -74
  99. package/dist/components/textarea/index.cjs +1 -1
  100. package/dist/components/textarea/index.js +15 -15
  101. package/dist/components/toasts/index.cjs +1 -1
  102. package/dist/components/toasts/index.js +4 -4
  103. package/dist/components/toggle/index.cjs +1 -1
  104. package/dist/components/toggle/index.js +6 -6
  105. package/dist/components/tooltip/index.cjs +1 -1
  106. package/dist/components/tooltip/index.js +1 -1
  107. package/dist/{index-DE2nzqL5.js → index-BIV5OwVJ.js} +23 -23
  108. package/dist/{index-DE2nzqL5.js.map → index-BIV5OwVJ.js.map} +1 -1
  109. package/dist/index-CQNlYa2P.cjs +2 -0
  110. package/dist/{index-DF8JisYI.cjs.map → index-CQNlYa2P.cjs.map} +1 -1
  111. package/dist/index.cjs +1 -1
  112. package/dist/index.d.ts +3 -1
  113. package/dist/index.js +1 -1
  114. package/dist/{menu-popover-jTTxzTGZ.cjs → menu-popover-D1ALaiV5.cjs} +2 -2
  115. package/dist/{menu-popover-jTTxzTGZ.cjs.map → menu-popover-D1ALaiV5.cjs.map} +1 -1
  116. package/dist/{menu-popover-SiOOwab-.js → menu-popover-DQHDIw-8.js} +12 -12
  117. package/dist/{menu-popover-SiOOwab-.js.map → menu-popover-DQHDIw-8.js.map} +1 -1
  118. package/dist/tokens.json +1 -1
  119. package/package.json +1 -1
  120. package/dist/index-DF8JisYI.cjs +0 -2
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index37.css');const l=require("react/jsx-runtime"),g=require("../../classix-5H4IWnMA.cjs"),a=require("react"),F=require("../button/index.cjs"),de=require("../../icons-DaZGJzI0.cjs"),X=require("../../index-DF8JisYI.cjs"),pe=require("../list/index.cjs"),E=require("../../index-Dn1v0qm6.cjs");function V(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(V).join(" "):a.isValidElement(t)?V(t.props.children):""}function fe(t){return a.isValidElement(t)&&t.type==="option"}function me(t){return a.isValidElement(t)&&t.type==="optgroup"}function be(t){return a.isValidElement(t)&&t.type===a.Fragment}function _e(t){return a.isValidElement(t)&&t.type===E.Select}function W(t,i,r=!1){const s=[];return a.Children.forEach(t,n=>{if(be(n))s.push(...W(n.props.children,i,r));else if(fe(n)){const c=V(n.props.children).trim(),f=n.props.value!=null?String(n.props.value):c;s.push({disabled:r||!!n.props.disabled,groupLabel:i,hidden:!!n.props.hidden,isPlaceholder:!!(n.props.hidden&&f===""),label:n.props.children,selected:!!n.props.selected,text:c,value:f})}else me(n)&&s.push(...W(n.props.children,n.props.label,r||!!n.props.disabled))}),s}function he(t){const i=t.trim();if(!i)return null;const s=[.../[*?]/.test(i)?i:`*${i}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${s}$`,"i")}function ye(t,i){const r=he(i),s=t.filter(n=>!n.hidden&&!n.isPlaceholder);return r?s.filter(n=>r.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):s}function xe(t,i){return t.find(r=>r.value===i)??t.find(r=>r.isPlaceholder)??t[0]}function ge(t,i,r){var s,n;return i!=null?String(i):r!=null?String(r):((s=t.find(c=>c.selected))==null?void 0:s.value)??((n=t[0])==null?void 0:n.value)??""}function ve(t){if(_e(t)){const{children:i,placeholder:r,...s}=t.props;return{children:l.jsxs(l.Fragment,{children:[r&&l.jsx("option",{hidden:!0,value:"",children:r}),i]}),props:s}}return{children:t.props.children,props:t.props}}const je="_combobox_1bqyf_3",qe="_dropdown_1bqyf_27",we="_empty_1bqyf_30",Se="_group_1bqyf_31",Ne="_placeholder_1bqyf_32",Ce="_filter_1bqyf_40",Ee="_native_1bqyf_52",Ve="_option_1bqyf_62",Le="_options_1bqyf_84",Re="_panel_1bqyf_108",$e="_selected_1bqyf_132",Be="_text_1bqyf_136",Ie="_trigger_1bqyf_144",Pe="_minimal_1bqyf_180",De="_inline_1bqyf_235",ke="_label_1bqyf_267",o={combobox:je,"combobox-input":"_combobox-input_1bqyf_12",dropdown:qe,empty:we,group:Se,placeholder:Ne,filter:Ce,native:Ee,option:Ve,options:Le,panel:Re,selected:$e,text:Be,trigger:Ie,minimal:Pe,inline:De,label:ke,"inline-field":"_inline-field_1bqyf_273"};function Y(t,i){return{"--icon-svg":de.iconSVG(t).replace("currentColor",i)}}const Fe=({children:t,className:i,combobox:r=!1,createOption:s,emptyLabel:n="No matches found",label:c,renderOption:f,searchPlaceholder:L="Filter",selectedItems:Z,variant:h="default",...ee})=>{const R=ve(t),{defaultValue:te,onChange:$,value:B,...ne}=R.props,v=E.sanitizeSelectProps(ne),{className:re,...se}=v,M=a.useRef(null),Q=a.useRef(null),j=a.useId(),z=a.useRef(null),m=a.useRef(null),y=W(R.children),x=B!=null,I=ge(y,B,te),[P,D]=a.useState(()=>I),[u,p]=a.useState(!1),[q,w]=a.useState(""),S=x?String(B):P,O={default:E.resolveColor("--colors-semantic-content-secondary"),white:E.resolveColor("--color-white","white")},T=h==="minimal"?O.white:O.default,N=xe(y,S),le=Y("chevron",T),oe=Y("search",T),A=ye(y,q),b=q.trim(),C=!!(r&&s&&b&&s.isValid(b)),ie=c&&h==="inline"?X.formatInlineLabel(c):c,G=e=>e?(f==null?void 0:f({groupLabel:e.groupLabel,isSelected:e.value===S,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";a.useEffect(()=>{!x&&!y.some(e=>e.value===P)&&D(I)},[I,P,x,y]),a.useEffect(()=>{var e;if(!u){w("");return}(e=m.current)==null||e.focus()},[u]),a.useEffect(()=>{if(!u)return;const e=d=>{var _;(_=Q.current)!=null&&_.contains(d.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);const ae=e=>{x||D(e.target.value),$==null||$(e)},k=()=>{var e;p(!1),r||(e=M.current)==null||e.focus()},K=()=>{var e;w(""),p(!0),(e=m.current)==null||e.focus()},H=()=>{!s||!C||(s.onCreate(b),K())},ce=e=>{var U;x||D(e);const d=z.current;if(!d){k();return}const _=(U=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:U.set;_==null||_.call(d,e),d.dispatchEvent(new Event("change",{bubbles:!0})),r?K():k()},ue=e=>{e.key==="Escape"&&k(),e.key==="Enter"&&e.target===m.current&&C&&(e.preventDefault(),H())},J=l.jsxs("div",{className:g.t(o.dropdown,h==="inline"&&o.inline,h==="minimal"&&o.minimal,i),onKeyDown:ue,ref:Q,...ee,children:[l.jsx("select",{...se,"aria-hidden":"true",className:g.t(o.native,re),onChange:ae,ref:z,tabIndex:-1,value:S,children:R.children}),r?l.jsxs("div",{className:o.combobox,onClick:()=>{var e;return(e=m.current)==null?void 0:e.focus()},children:[Z,l.jsx("input",{"aria-autocomplete":"list","aria-expanded":u,"aria-label":v["aria-label"]??c??L,className:o["combobox-input"],disabled:v.disabled,onChange:e=>{w(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:L||void 0,ref:m,role:"combobox",type:"text",value:q})]}):l.jsx(F.Button,{"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":c?`${j} ${j}-value`:void 0,className:g.t(o.trigger,(N==null?void 0:N.isPlaceholder)&&o.placeholder),"data-open":u?"true":void 0,disabled:v.disabled,onClick:()=>p(e=>!e),ref:M,style:le,variant:"tertiary",children:l.jsx("span",{className:o.text,id:`${j}-value`,children:G(N)})}),u&&l.jsxs("div",{className:o.panel,children:[!r&&l.jsx(X.Input,{"aria-label":"Filter",className:o.filter,icon:"search",onChange:e=>w(e.target.value),placeholder:L,ref:m,style:oe,type:"search",value:q}),l.jsxs(pe.List,{"aria-label":"Dropdown",className:o.options,children:[A.map(e=>{const d=e.value===S;return l.jsx("li",{"data-component":"dropdown",children:l.jsxs(F.Button,{"aria-label":d?`${e.text}, selected`:e.text,className:g.t(o.option,d&&o.selected),disabled:e.disabled,onClick:()=>ce(e.value),variant:"tertiary",children:[l.jsx("span",{className:o.text,children:G(e)}),e.groupLabel&&l.jsx("small",{className:o.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),C&&s&&l.jsx("li",{children:l.jsx(F.Button,{"aria-label":V(s.render(b))||b,className:o.option,onClick:H,variant:"tertiary",children:l.jsx("span",{className:o.text,children:s.render(b)})})}),A.length===0&&!C&&l.jsx("li",{className:o.empty,children:n})]})]})]});return c?l.jsxs("div",{className:g.t(o.label,h==="inline"&&o["inline-field"]),"data-component":"dropdown",children:[l.jsx("span",{id:j,children:ie}),J]}):J};exports.Dropdown=Fe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index37.css');const l=require("react/jsx-runtime"),g=require("../../classix-5H4IWnMA.cjs"),a=require("react"),F=require("../button/index.cjs"),de=require("../../icons-DaZGJzI0.cjs"),X=require("../../index-CQNlYa2P.cjs"),pe=require("../list/index.cjs"),E=require("../../index-Dn1v0qm6.cjs");function V(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(V).join(" "):a.isValidElement(t)?V(t.props.children):""}function fe(t){return a.isValidElement(t)&&t.type==="option"}function me(t){return a.isValidElement(t)&&t.type==="optgroup"}function be(t){return a.isValidElement(t)&&t.type===a.Fragment}function _e(t){return a.isValidElement(t)&&t.type===E.Select}function W(t,i,r=!1){const s=[];return a.Children.forEach(t,n=>{if(be(n))s.push(...W(n.props.children,i,r));else if(fe(n)){const c=V(n.props.children).trim(),f=n.props.value!=null?String(n.props.value):c;s.push({disabled:r||!!n.props.disabled,groupLabel:i,hidden:!!n.props.hidden,isPlaceholder:!!(n.props.hidden&&f===""),label:n.props.children,selected:!!n.props.selected,text:c,value:f})}else me(n)&&s.push(...W(n.props.children,n.props.label,r||!!n.props.disabled))}),s}function he(t){const i=t.trim();if(!i)return null;const s=[.../[*?]/.test(i)?i:`*${i}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${s}$`,"i")}function ye(t,i){const r=he(i),s=t.filter(n=>!n.hidden&&!n.isPlaceholder);return r?s.filter(n=>r.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):s}function xe(t,i){return t.find(r=>r.value===i)??t.find(r=>r.isPlaceholder)??t[0]}function ge(t,i,r){var s,n;return i!=null?String(i):r!=null?String(r):((s=t.find(c=>c.selected))==null?void 0:s.value)??((n=t[0])==null?void 0:n.value)??""}function je(t){if(_e(t)){const{children:i,placeholder:r,...s}=t.props;return{children:l.jsxs(l.Fragment,{children:[r&&l.jsx("option",{hidden:!0,value:"",children:r}),i]}),props:s}}return{children:t.props.children,props:t.props}}const ve="_combobox_jkdyb_3",we="_dropdown_jkdyb_27",ke="_empty_jkdyb_30",Se="_group_jkdyb_31",Ne="_placeholder_jkdyb_32",Ce="_filter_jkdyb_40",Ee="_native_jkdyb_52",Ve="_option_jkdyb_62",Le="_options_jkdyb_84",Re="_panel_jkdyb_108",$e="_selected_jkdyb_132",Be="_text_jkdyb_136",Ie="_trigger_jkdyb_144",qe="_minimal_jkdyb_180",Pe="_inline_jkdyb_235",De="_label_jkdyb_267",o={combobox:ve,"combobox-input":"_combobox-input_jkdyb_12",dropdown:we,empty:ke,group:Se,placeholder:Ne,filter:Ce,native:Ee,option:Ve,options:Le,panel:Re,selected:$e,text:Be,trigger:Ie,minimal:qe,inline:Pe,label:De,"inline-field":"_inline-field_jkdyb_273"};function Y(t,i){return{"--icon-svg":de.iconSVG(t).replace("currentColor",i)}}const Fe=({children:t,className:i,combobox:r=!1,createOption:s,emptyLabel:n="No matches found",label:c,renderOption:f,searchPlaceholder:L="Filter",selectedItems:Z,variant:h="default",...ee})=>{const R=je(t),{defaultValue:te,onChange:$,value:B,...ne}=R.props,j=E.sanitizeSelectProps(ne),{className:re,...se}=j,M=a.useRef(null),Q=a.useRef(null),v=a.useId(),z=a.useRef(null),m=a.useRef(null),y=W(R.children),x=B!=null,I=ge(y,B,te),[q,P]=a.useState(()=>I),[u,p]=a.useState(!1),[w,k]=a.useState(""),S=x?String(B):q,O={default:E.resolveColor("--colors-semantic-content-secondary"),white:E.resolveColor("--color-white","white")},T=h==="minimal"?O.white:O.default,N=xe(y,S),le=Y("chevron",T),oe=Y("search",T),A=ye(y,w),b=w.trim(),C=!!(r&&s&&b&&s.isValid(b)),ie=c&&h==="inline"?X.formatInlineLabel(c):c,G=e=>e?(f==null?void 0:f({groupLabel:e.groupLabel,isSelected:e.value===S,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";a.useEffect(()=>{!x&&!y.some(e=>e.value===q)&&P(I)},[I,q,x,y]),a.useEffect(()=>{var e;if(!u){k("");return}(e=m.current)==null||e.focus()},[u]),a.useEffect(()=>{if(!u)return;const e=d=>{var _;(_=Q.current)!=null&&_.contains(d.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);const ae=e=>{x||P(e.target.value),$==null||$(e)},D=()=>{var e;p(!1),r||(e=M.current)==null||e.focus()},K=()=>{var e;k(""),p(!0),(e=m.current)==null||e.focus()},H=()=>{!s||!C||(s.onCreate(b),K())},ce=e=>{var U;x||P(e);const d=z.current;if(!d){D();return}const _=(U=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:U.set;_==null||_.call(d,e),d.dispatchEvent(new Event("change",{bubbles:!0})),r?K():D()},ue=e=>{e.key==="Escape"&&D(),e.key==="Enter"&&e.target===m.current&&C&&(e.preventDefault(),H())},J=l.jsxs("div",{className:g.t(o.dropdown,h==="inline"&&o.inline,h==="minimal"&&o.minimal,i),onKeyDown:ue,ref:Q,...ee,children:[l.jsx("select",{...se,"aria-hidden":"true",className:g.t(o.native,re),onChange:ae,ref:z,tabIndex:-1,value:S,children:R.children}),r?l.jsxs("div",{className:o.combobox,onClick:()=>{var e;return(e=m.current)==null?void 0:e.focus()},children:[Z,l.jsx("input",{"aria-autocomplete":"list","aria-expanded":u,"aria-label":j["aria-label"]??c??L,className:o["combobox-input"],disabled:j.disabled,onChange:e=>{k(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:L||void 0,ref:m,role:"combobox",type:"text",value:w})]}):l.jsx(F.Button,{"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":c?`${v} ${v}-value`:void 0,className:g.t(o.trigger,(N==null?void 0:N.isPlaceholder)&&o.placeholder),"data-open":u?"true":void 0,disabled:j.disabled,onClick:()=>p(e=>!e),ref:M,style:le,variant:"tertiary",children:l.jsx("span",{className:o.text,id:`${v}-value`,children:G(N)})}),u&&l.jsxs("div",{className:o.panel,children:[!r&&l.jsx(X.Input,{"aria-label":"Filter",className:o.filter,icon:"search",onChange:e=>k(e.target.value),placeholder:L,ref:m,style:oe,type:"search",value:w}),l.jsxs(pe.List,{"aria-label":"Dropdown",className:o.options,children:[A.map(e=>{const d=e.value===S;return l.jsx("li",{"data-component":"dropdown",children:l.jsxs(F.Button,{"aria-label":d?`${e.text}, selected`:e.text,className:g.t(o.option,d&&o.selected),disabled:e.disabled,onClick:()=>ce(e.value),variant:"tertiary",children:[l.jsx("span",{className:o.text,children:G(e)}),e.groupLabel&&l.jsx("small",{className:o.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),C&&s&&l.jsx("li",{children:l.jsx(F.Button,{"aria-label":V(s.render(b))||b,className:o.option,onClick:H,variant:"tertiary",children:l.jsx("span",{className:o.text,children:s.render(b)})})}),A.length===0&&!C&&l.jsx("li",{className:o.empty,children:n})]})]})]});return c?l.jsxs("div",{className:g.t(o.label,h==="inline"&&o["inline-field"]),"data-component":"dropdown",children:[l.jsx("span",{id:v,children:ie}),J]}):J};exports.Dropdown=Fe;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,33 +1,33 @@
1
1
  import { jsxs as p, Fragment as me, jsx as i } from "react/jsx-runtime";
2
2
  import { t as v } from "../../classix-DG18itHa.js";
3
- import be, { Children as he, isValidElement as x, useRef as I, useId as _e, useState as W, useEffect as Q } from "react";
4
- import { Button as z } from "../button/index.js";
3
+ import be, { Children as he, isValidElement as x, useRef as V, useId as _e, useState as Q, useEffect as z } from "react";
4
+ import { Button as M } from "../button/index.js";
5
5
  import { i as ye } from "../../icons-Dj0vEOCB.js";
6
- import { f as ge, I as ve } from "../../index-DE2nzqL5.js";
6
+ import { f as ge, I as ve } from "../../index-BIV5OwVJ.js";
7
7
  import { List as xe } from "../list/index.js";
8
- import { S as we, s as Ne, r as ee } from "../../index-CgA0NUMD.js";
9
- import '../../assets/index37.css';function L(t) {
10
- return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(L).join(" ") : x(t) ? L(t.props.children) : "";
8
+ import { S as ke, s as we, r as ee } from "../../index-CgA0NUMD.js";
9
+ import '../../assets/index37.css';function I(t) {
10
+ return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(I).join(" ") : x(t) ? I(t.props.children) : "";
11
11
  }
12
- function Se(t) {
12
+ function je(t) {
13
13
  return x(t) && t.type === "option";
14
14
  }
15
- function qe(t) {
15
+ function Ne(t) {
16
16
  return x(t) && t.type === "optgroup";
17
17
  }
18
- function Ce(t) {
18
+ function Se(t) {
19
19
  return x(t) && t.type === be.Fragment;
20
20
  }
21
- function Ee(t) {
22
- return x(t) && t.type === we;
21
+ function Ce(t) {
22
+ return x(t) && t.type === ke;
23
23
  }
24
- function M(t, s, r = !1) {
24
+ function A(t, s, r = !1) {
25
25
  const l = [];
26
26
  return he.forEach(t, (n) => {
27
- if (Ce(n))
28
- l.push(...M(n.props.children, s, r));
29
- else if (Se(n)) {
30
- const a = L(n.props.children).trim(), f = n.props.value != null ? String(n.props.value) : a;
27
+ if (Se(n))
28
+ l.push(...A(n.props.children, s, r));
29
+ else if (je(n)) {
30
+ const a = I(n.props.children).trim(), f = n.props.value != null ? String(n.props.value) : a;
31
31
  l.push({
32
32
  disabled: r || !!n.props.disabled,
33
33
  groupLabel: s,
@@ -38,28 +38,28 @@ function M(t, s, r = !1) {
38
38
  text: a,
39
39
  value: f
40
40
  });
41
- } else qe(n) && l.push(...M(n.props.children, n.props.label, r || !!n.props.disabled));
41
+ } else Ne(n) && l.push(...A(n.props.children, n.props.label, r || !!n.props.disabled));
42
42
  }), l;
43
43
  }
44
- function Ve(t) {
44
+ function Ee(t) {
45
45
  const s = t.trim();
46
46
  if (!s) return null;
47
47
  const l = [.../[*?]/.test(s) ? s : `*${s}*`].map((n) => n === "*" ? ".*" : n === "?" ? "." : n.replace(/[|\\{}()[\]^$+.,]/g, "\\$&")).join("");
48
48
  return new RegExp(`^${l}$`, "i");
49
49
  }
50
- function Ie(t, s) {
51
- const r = Ve(s), l = t.filter((n) => !n.hidden && !n.isPlaceholder);
50
+ function Ve(t, s) {
51
+ const r = Ee(s), l = t.filter((n) => !n.hidden && !n.isPlaceholder);
52
52
  return r ? l.filter((n) => r.test([n.groupLabel, n.text, n.value].filter(Boolean).join(" "))) : l;
53
53
  }
54
- function Le(t, s) {
54
+ function Ie(t, s) {
55
55
  return t.find((r) => r.value === s) ?? t.find((r) => r.isPlaceholder) ?? t[0];
56
56
  }
57
- function $e(t, s, r) {
57
+ function Le(t, s, r) {
58
58
  var l, n;
59
59
  return s != null ? String(s) : r != null ? String(r) : ((l = t.find((a) => a.selected)) == null ? void 0 : l.value) ?? ((n = t[0]) == null ? void 0 : n.value) ?? "";
60
60
  }
61
- function Be(t) {
62
- if (Ee(t)) {
61
+ function $e(t) {
62
+ if (Ce(t)) {
63
63
  const {
64
64
  children: s,
65
65
  placeholder: r,
@@ -78,25 +78,25 @@ function Be(t) {
78
78
  props: t.props
79
79
  };
80
80
  }
81
- const Pe = "_combobox_1bqyf_3", ke = "_dropdown_1bqyf_27", De = "_empty_1bqyf_30", Re = "_group_1bqyf_31", je = "_placeholder_1bqyf_32", Fe = "_filter_1bqyf_40", We = "_native_1bqyf_52", Qe = "_option_1bqyf_62", ze = "_options_1bqyf_84", Me = "_panel_1bqyf_108", Ae = "_selected_1bqyf_132", Ge = "_text_1bqyf_136", Ke = "_trigger_1bqyf_144", Oe = "_minimal_1bqyf_180", Te = "_inline_1bqyf_235", He = "_label_1bqyf_267", o = {
82
- combobox: Pe,
83
- "combobox-input": "_combobox-input_1bqyf_12",
84
- dropdown: ke,
81
+ const Be = "_combobox_jkdyb_3", Pe = "_dropdown_jkdyb_27", De = "_empty_jkdyb_30", Re = "_group_jkdyb_31", Fe = "_placeholder_jkdyb_32", We = "_filter_jkdyb_40", Qe = "_native_jkdyb_52", ze = "_option_jkdyb_62", Me = "_options_jkdyb_84", Ae = "_panel_jkdyb_108", Ge = "_selected_jkdyb_132", Ke = "_text_jkdyb_136", Oe = "_trigger_jkdyb_144", Te = "_minimal_jkdyb_180", qe = "_inline_jkdyb_235", He = "_label_jkdyb_267", o = {
82
+ combobox: Be,
83
+ "combobox-input": "_combobox-input_jkdyb_12",
84
+ dropdown: Pe,
85
85
  empty: De,
86
86
  group: Re,
87
- placeholder: je,
88
- filter: Fe,
89
- native: We,
90
- option: Qe,
91
- options: ze,
92
- panel: Me,
93
- selected: Ae,
94
- text: Ge,
95
- trigger: Ke,
96
- minimal: Oe,
97
- inline: Te,
87
+ placeholder: Fe,
88
+ filter: We,
89
+ native: Qe,
90
+ option: ze,
91
+ options: Me,
92
+ panel: Ae,
93
+ selected: Ge,
94
+ text: Ke,
95
+ trigger: Oe,
96
+ minimal: Te,
97
+ inline: qe,
98
98
  label: He,
99
- "inline-field": "_inline-field_1bqyf_273"
99
+ "inline-field": "_inline-field_jkdyb_273"
100
100
  };
101
101
  function te(t, s) {
102
102
  return {
@@ -111,101 +111,101 @@ const rt = ({
111
111
  emptyLabel: n = "No matches found",
112
112
  label: a,
113
113
  renderOption: f,
114
- searchPlaceholder: $ = "Filter",
114
+ searchPlaceholder: L = "Filter",
115
115
  selectedItems: ne,
116
116
  variant: _ = "default",
117
117
  ...re
118
118
  }) => {
119
- const B = Be(t), {
119
+ const $ = $e(t), {
120
120
  defaultValue: le,
121
- onChange: P,
122
- value: k,
121
+ onChange: B,
122
+ value: P,
123
123
  ...oe
124
- } = B.props, w = Ne(oe), {
124
+ } = $.props, k = we(oe), {
125
125
  className: se,
126
126
  ...ie
127
- } = w, A = I(null), G = I(null), N = _e(), K = I(null), m = I(null), y = M(B.children), g = k != null, D = $e(y, k, le), [R, j] = W(() => D), [c, d] = W(!1), [S, q] = W(""), C = g ? String(k) : R, O = {
127
+ } = k, G = V(null), K = V(null), w = _e(), O = V(null), m = V(null), y = A($.children), g = P != null, D = Le(y, P, le), [R, F] = Q(() => D), [c, u] = Q(!1), [j, N] = Q(""), S = g ? String(P) : R, T = {
128
128
  default: ee("--colors-semantic-content-secondary"),
129
129
  white: ee("--color-white", "white")
130
- }, T = _ === "minimal" ? O.white : O.default, E = Le(y, C), ae = te("chevron", T), ce = te("search", T), H = Ie(y, S), b = S.trim(), V = !!(r && l && b && l.isValid(b)), ue = a && _ === "inline" ? ge(a) : a, J = (e) => e ? (f == null ? void 0 : f({
130
+ }, q = _ === "minimal" ? T.white : T.default, C = Ie(y, S), ae = te("chevron", q), ce = te("search", q), H = Ve(y, j), b = j.trim(), E = !!(r && l && b && l.isValid(b)), de = a && _ === "inline" ? ge(a) : a, J = (e) => e ? (f == null ? void 0 : f({
131
131
  groupLabel: e.groupLabel,
132
- isSelected: e.value === C,
132
+ isSelected: e.value === S,
133
133
  label: e.label,
134
134
  text: e.text,
135
135
  value: e.value
136
136
  })) ?? e.label : "Select an option";
137
- Q(() => {
138
- !g && !y.some((e) => e.value === R) && j(D);
139
- }, [D, R, g, y]), Q(() => {
137
+ z(() => {
138
+ !g && !y.some((e) => e.value === R) && F(D);
139
+ }, [D, R, g, y]), z(() => {
140
140
  var e;
141
141
  if (!c) {
142
- q("");
142
+ N("");
143
143
  return;
144
144
  }
145
145
  (e = m.current) == null || e.focus();
146
- }, [c]), Q(() => {
146
+ }, [c]), z(() => {
147
147
  if (!c)
148
148
  return;
149
- const e = (u) => {
149
+ const e = (d) => {
150
150
  var h;
151
- (h = G.current) != null && h.contains(u.target) || d(!1);
151
+ (h = K.current) != null && h.contains(d.target) || u(!1);
152
152
  };
153
153
  return document.addEventListener("mousedown", e), () => {
154
154
  document.removeEventListener("mousedown", e);
155
155
  };
156
156
  }, [c]);
157
- const de = (e) => {
158
- g || j(e.target.value), P == null || P(e);
159
- }, F = () => {
157
+ const ue = (e) => {
158
+ g || F(e.target.value), B == null || B(e);
159
+ }, W = () => {
160
160
  var e;
161
- d(!1), r || (e = A.current) == null || e.focus();
161
+ u(!1), r || (e = G.current) == null || e.focus();
162
162
  }, U = () => {
163
163
  var e;
164
- q(""), d(!0), (e = m.current) == null || e.focus();
164
+ N(""), u(!0), (e = m.current) == null || e.focus();
165
165
  }, X = () => {
166
- !l || !V || (l.onCreate(b), U());
166
+ !l || !E || (l.onCreate(b), U());
167
167
  }, pe = (e) => {
168
168
  var Z;
169
- g || j(e);
170
- const u = K.current;
171
- if (!u) {
172
- F();
169
+ g || F(e);
170
+ const d = O.current;
171
+ if (!d) {
172
+ W();
173
173
  return;
174
174
  }
175
175
  const h = (Z = Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype, "value")) == null ? void 0 : Z.set;
176
- h == null || h.call(u, e), u.dispatchEvent(new Event("change", {
176
+ h == null || h.call(d, e), d.dispatchEvent(new Event("change", {
177
177
  bubbles: !0
178
- })), r ? U() : F();
178
+ })), r ? U() : W();
179
179
  }, fe = (e) => {
180
- e.key === "Escape" && F(), e.key === "Enter" && e.target === m.current && V && (e.preventDefault(), X());
181
- }, Y = /* @__PURE__ */ p("div", { className: v(o.dropdown, _ === "inline" && o.inline, _ === "minimal" && o.minimal, s), onKeyDown: fe, ref: G, ...re, children: [
182
- /* @__PURE__ */ i("select", { ...ie, "aria-hidden": "true", className: v(o.native, se), onChange: de, ref: K, tabIndex: -1, value: C, children: B.children }),
180
+ e.key === "Escape" && W(), e.key === "Enter" && e.target === m.current && E && (e.preventDefault(), X());
181
+ }, Y = /* @__PURE__ */ p("div", { className: v(o.dropdown, _ === "inline" && o.inline, _ === "minimal" && o.minimal, s), onKeyDown: fe, ref: K, ...re, children: [
182
+ /* @__PURE__ */ i("select", { ...ie, "aria-hidden": "true", className: v(o.native, se), onChange: ue, ref: O, tabIndex: -1, value: S, children: $.children }),
183
183
  r ? /* @__PURE__ */ p("div", { className: o.combobox, onClick: () => {
184
184
  var e;
185
185
  return (e = m.current) == null ? void 0 : e.focus();
186
186
  }, children: [
187
187
  ne,
188
- /* @__PURE__ */ i("input", { "aria-autocomplete": "list", "aria-expanded": c, "aria-label": w["aria-label"] ?? a ?? $, className: o["combobox-input"], disabled: w.disabled, onChange: (e) => {
189
- q(e.target.value), d(!0);
190
- }, onClick: () => d(!0), onFocus: () => d(!0), placeholder: $ || void 0, ref: m, role: "combobox", type: "text", value: S })
191
- ] }) : /* @__PURE__ */ i(z, { "aria-expanded": c, "aria-haspopup": "dialog", "aria-labelledby": a ? `${N} ${N}-value` : void 0, className: v(o.trigger, (E == null ? void 0 : E.isPlaceholder) && o.placeholder), "data-open": c ? "true" : void 0, disabled: w.disabled, onClick: () => d((e) => !e), ref: A, style: ae, variant: "tertiary", children: /* @__PURE__ */ i("span", { className: o.text, id: `${N}-value`, children: J(E) }) }),
188
+ /* @__PURE__ */ i("input", { "aria-autocomplete": "list", "aria-expanded": c, "aria-label": k["aria-label"] ?? a ?? L, className: o["combobox-input"], disabled: k.disabled, onChange: (e) => {
189
+ N(e.target.value), u(!0);
190
+ }, onClick: () => u(!0), onFocus: () => u(!0), placeholder: L || void 0, ref: m, role: "combobox", type: "text", value: j })
191
+ ] }) : /* @__PURE__ */ i(M, { "aria-expanded": c, "aria-haspopup": "dialog", "aria-labelledby": a ? `${w} ${w}-value` : void 0, className: v(o.trigger, (C == null ? void 0 : C.isPlaceholder) && o.placeholder), "data-open": c ? "true" : void 0, disabled: k.disabled, onClick: () => u((e) => !e), ref: G, style: ae, variant: "tertiary", children: /* @__PURE__ */ i("span", { className: o.text, id: `${w}-value`, children: J(C) }) }),
192
192
  c && /* @__PURE__ */ p("div", { className: o.panel, children: [
193
- !r && /* @__PURE__ */ i(ve, { "aria-label": "Filter", className: o.filter, icon: "search", onChange: (e) => q(e.target.value), placeholder: $, ref: m, style: ce, type: "search", value: S }),
193
+ !r && /* @__PURE__ */ i(ve, { "aria-label": "Filter", className: o.filter, icon: "search", onChange: (e) => N(e.target.value), placeholder: L, ref: m, style: ce, type: "search", value: j }),
194
194
  /* @__PURE__ */ p(xe, { "aria-label": "Dropdown", className: o.options, children: [
195
195
  H.map((e) => {
196
- const u = e.value === C;
197
- return /* @__PURE__ */ i("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(z, { "aria-label": u ? `${e.text}, selected` : e.text, className: v(o.option, u && o.selected), disabled: e.disabled, onClick: () => pe(e.value), variant: "tertiary", children: [
196
+ const d = e.value === S;
197
+ return /* @__PURE__ */ i("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(M, { "aria-label": d ? `${e.text}, selected` : e.text, className: v(o.option, d && o.selected), disabled: e.disabled, onClick: () => pe(e.value), variant: "tertiary", children: [
198
198
  /* @__PURE__ */ i("span", { className: o.text, children: J(e) }),
199
199
  e.groupLabel && /* @__PURE__ */ i("small", { className: o.group, children: e.groupLabel })
200
200
  ] }) }, `${e.groupLabel ?? "root"}-${e.value}`);
201
201
  }),
202
- V && l && /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(z, { "aria-label": L(l.render(b)) || b, className: o.option, onClick: X, variant: "tertiary", children: /* @__PURE__ */ i("span", { className: o.text, children: l.render(b) }) }) }),
203
- H.length === 0 && !V && /* @__PURE__ */ i("li", { className: o.empty, children: n })
202
+ E && l && /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(M, { "aria-label": I(l.render(b)) || b, className: o.option, onClick: X, variant: "tertiary", children: /* @__PURE__ */ i("span", { className: o.text, children: l.render(b) }) }) }),
203
+ H.length === 0 && !E && /* @__PURE__ */ i("li", { className: o.empty, children: n })
204
204
  ] })
205
205
  ] })
206
206
  ] });
207
207
  return a ? /* @__PURE__ */ p("div", { className: v(o.label, _ === "inline" && o["inline-field"]), "data-component": "dropdown", children: [
208
- /* @__PURE__ */ i("span", { id: N, children: ue }),
208
+ /* @__PURE__ */ i("span", { id: w, children: de }),
209
209
  Y
210
210
  ] }) : Y;
211
211
  };