@solibo/solibo-ui 2.3.3 → 2.3.4

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 (55) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/assets/index15.css +1 -1
  3. package/dist/assets/index2.css +1 -1
  4. package/dist/assets/index23.css +1 -1
  5. package/dist/assets/index26.css +1 -1
  6. package/dist/assets/index27.css +1 -1
  7. package/dist/assets/index29.css +1 -1
  8. package/dist/assets/index41.css +1 -1
  9. package/dist/assets/index43.css +1 -1
  10. package/dist/assets/index49.css +1 -1
  11. package/dist/assets/index52.css +1 -1
  12. package/dist/assets/index53.css +1 -1
  13. package/dist/assets/index55.css +1 -1
  14. package/dist/assets/index59.css +1 -1
  15. package/dist/components/app-link/index.cjs +1 -1
  16. package/dist/components/app-link/index.js +7 -7
  17. package/dist/components/badge/index.cjs +1 -1
  18. package/dist/components/badge/index.js +31 -31
  19. package/dist/components/banner/index.cjs +1 -1
  20. package/dist/components/banner/index.js +9 -9
  21. package/dist/components/button/index.cjs +1 -1
  22. package/dist/components/button/index.js +26 -26
  23. package/dist/components/dropdown/index.cjs +1 -1
  24. package/dist/components/dropdown/index.js +170 -177
  25. package/dist/components/editor/index.cjs +1 -1
  26. package/dist/components/editor/index.js +169 -169
  27. package/dist/components/form/index.cjs +1 -1
  28. package/dist/components/form/index.js +9 -9
  29. package/dist/components/icon/index.cjs +1 -1
  30. package/dist/components/icon/index.js +22 -22
  31. package/dist/components/input/index.cjs +1 -1
  32. package/dist/components/input/index.js +1 -1
  33. package/dist/components/link/index.cjs +1 -1
  34. package/dist/components/link/index.js +15 -15
  35. package/dist/components/nav/index.cjs +1 -1
  36. package/dist/components/nav/index.js +16 -16
  37. package/dist/components/search/index.cjs +1 -1
  38. package/dist/components/search/index.js +1 -1
  39. package/dist/components/select/index.cjs +1 -1
  40. package/dist/components/select/index.js +1 -1
  41. package/dist/components/widget/index.cjs +1 -1
  42. package/dist/components/widget/index.js +16 -16
  43. package/dist/index-CFMWBY53.cjs +1 -0
  44. package/dist/index-DBjIWUDE.cjs +1 -0
  45. package/dist/index-DJDY6iu6.js +48 -0
  46. package/dist/index-DO_phxRs.js +92 -0
  47. package/dist/index.cjs +1 -1
  48. package/dist/index.js +2 -2
  49. package/dist/tokens.css +55 -55
  50. package/dist/tokens.json +258 -462
  51. package/package.json +1 -1
  52. package/dist/index-CWeknFzO.js +0 -74
  53. package/dist/index-Ct84TXGv.cjs +0 -1
  54. package/dist/index-D3gtJMYv.cjs +0 -1
  55. package/dist/index-DpkXKD1Z.js +0 -87
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index27.css');const t=require("react/jsx-runtime"),s=require("classix"),i=require("../button/index.cjs"),o="_banner_hqbfl_13",u="_visible_hqbfl_32",r={banner:o,visible:u},d=({button:a,message:b,onClick:e,onDismiss:n,visible:c=!1})=>{const l=()=>{e==null||e(),n==null||n()};return t.jsxs("div",{"aria-live":"assertive",className:s(r.banner,c&&r.visible),"data-component":"banner",children:[b,t.jsx(i.Button,{onClick:l,children:a})]})};exports.Banner=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index27.css');const t=require("react/jsx-runtime"),o=require("classix"),b=require("../button/index.cjs"),i="_banner_1lo4j_13",u="_visible_1lo4j_32",r={banner:i,visible:u},d=({button:a,message:c,onClick:e,onDismiss:n,visible:l=!1})=>{const s=()=>{e==null||e(),n==null||n()};return t.jsxs("div",{"aria-live":"assertive",className:o(r.banner,l&&r.visible),"data-component":"banner",children:[c,t.jsx(b.Button,{onClick:s,children:a})]})};exports.Banner=d;
@@ -1,24 +1,24 @@
1
- import { jsxs as c, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as b, jsx as c } from "react/jsx-runtime";
2
2
  import i from "classix";
3
3
  import { Button as s } from "../button/index.js";
4
- import '../../assets/index27.css';const v = "_banner_hqbfl_13", f = "_visible_hqbfl_32", n = {
4
+ import '../../assets/index27.css';const v = "_banner_1lo4j_13", _ = "_visible_1lo4j_32", n = {
5
5
  banner: v,
6
- visible: f
7
- }, p = ({
6
+ visible: _
7
+ }, j = ({
8
8
  button: t,
9
9
  message: a,
10
10
  onClick: e,
11
11
  onDismiss: r,
12
- visible: b = !1
12
+ visible: l = !1
13
13
  }) => {
14
- const l = () => {
14
+ const o = () => {
15
15
  e == null || e(), r == null || r();
16
16
  };
17
- return /* @__PURE__ */ c("div", { "aria-live": "assertive", className: i(n.banner, b && n.visible), "data-component": "banner", children: [
17
+ return /* @__PURE__ */ b("div", { "aria-live": "assertive", className: i(n.banner, l && n.visible), "data-component": "banner", children: [
18
18
  a,
19
- /* @__PURE__ */ o(s, { onClick: l, children: t })
19
+ /* @__PURE__ */ c(s, { onClick: o, children: t })
20
20
  ] });
21
21
  };
22
22
  export {
23
- p as Banner
23
+ j as Banner
24
24
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index29.css');const n=require("react/jsx-runtime"),u=require("classix"),p=require("../loading/index.cjs"),g=require("../badge/index.cjs"),b=require("../icon/index.cjs"),x="_button_10ypn_1",j="_large_10ypn_20",f="_small_10ypn_24",h="_danger_10ypn_34",q="_simple_10ypn_40",v="_primary_10ypn_53",B="_secondary_10ypn_64",S="_tertiary_10ypn_91",e={button:x,large:j,small:f,danger:h,simple:q,primary:v,secondary:B,tertiary:S},z={primary:e.primary,secondary:e.secondary,simple:e.simple,tertiary:e.tertiary},I={large:e.large,medium:e.medium,small:e.small};function L({badge:s,children:o,className:i,disabled:l=!1,icon:r,intent:a="default",isLoading:m=!1,onClick:c,ref:d,size:t="medium",variant:_="secondary",...y}){return n.jsxs("button",{className:u(e.button,z[_],I[t],i,a==="danger"&&e.danger),"data-intent":a,disabled:l,onClick:c,ref:d,type:"button",...y,"data-component":"button",children:[m?n.jsx(p.Loading,{size:t==="large"?"medium":"small"}):r&&n.jsx(b.Icon,{name:r,size:t==="large"?"medium":"small"}),o,n.jsx(g.Badge,{variant:"highlight",children:s})]})}exports.Button=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index29.css');const t=require("react/jsx-runtime"),g=require("classix"),y=require("../loading/index.cjs"),p=require("../badge/index.cjs"),q=require("../icon/index.cjs"),v="_button_4mvsq_1",b="_large_4mvsq_20",x="_small_4mvsq_24",j="_danger_4mvsq_34",f="_simple_4mvsq_40",h="_primary_4mvsq_53",B="_secondary_4mvsq_64",S="_tertiary_4mvsq_91",e={button:v,large:b,small:x,danger:j,simple:f,primary:h,secondary:B,tertiary:S},z={primary:e.primary,secondary:e.secondary,simple:e.simple,tertiary:e.tertiary},I={large:e.large,medium:e.medium,small:e.small};function L({badge:a,children:o,className:m,disabled:i=!1,icon:n,intent:r="default",isLoading:l=!1,onClick:c,ref:d,size:s="medium",variant:_="secondary",...u}){return t.jsxs("button",{className:g(e.button,z[_],I[s],m,r==="danger"&&e.danger),"data-intent":r,disabled:i,onClick:c,ref:d,type:"button",...u,"data-component":"button",children:[l?t.jsx(y.Loading,{size:s==="large"?"medium":"small"}):n&&t.jsx(q.Icon,{name:n,size:s==="large"?"medium":"small"}),o,t.jsx(p.Badge,{variant:"highlight",children:a})]})}exports.Button=L;
@@ -1,45 +1,45 @@
1
- import { jsxs as d, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as y, jsx as a } from "react/jsx-runtime";
2
2
  import g from "classix";
3
3
  import { Loading as u } from "../loading/index.js";
4
- import { Badge as f } from "../badge/index.js";
5
- import { Icon as b } from "../icon/index.js";
6
- import '../../assets/index29.css';const h = "_button_10ypn_1", x = "_large_10ypn_20", j = "_small_10ypn_24", v = "_danger_10ypn_34", B = "_simple_10ypn_40", z = "_primary_10ypn_53", I = "_secondary_10ypn_64", L = "_tertiary_10ypn_91", r = {
7
- button: h,
8
- large: x,
9
- small: j,
10
- danger: v,
11
- simple: B,
12
- primary: z,
13
- secondary: I,
14
- tertiary: L
15
- }, N = {
4
+ import { Badge as v } from "../badge/index.js";
5
+ import { Icon as f } from "../icon/index.js";
6
+ import '../../assets/index29.css';const q = "_button_4mvsq_1", b = "_large_4mvsq_20", h = "_small_4mvsq_24", x = "_danger_4mvsq_34", j = "_simple_4mvsq_40", B = "_primary_4mvsq_53", z = "_secondary_4mvsq_64", I = "_tertiary_4mvsq_91", r = {
7
+ button: q,
8
+ large: b,
9
+ small: h,
10
+ danger: x,
11
+ simple: j,
12
+ primary: B,
13
+ secondary: z,
14
+ tertiary: I
15
+ }, L = {
16
16
  primary: r.primary,
17
17
  secondary: r.secondary,
18
18
  simple: r.simple,
19
19
  tertiary: r.tertiary
20
- }, k = {
20
+ }, N = {
21
21
  large: r.large,
22
22
  medium: r.medium,
23
23
  small: r.small
24
24
  };
25
25
  function E({
26
- badge: s,
27
- children: m,
26
+ badge: e,
27
+ children: n,
28
28
  className: o,
29
29
  disabled: l = !1,
30
- icon: n,
31
- intent: e = "default",
30
+ icon: s,
31
+ intent: m = "default",
32
32
  isLoading: i = !1,
33
- onClick: p,
34
- ref: y,
33
+ onClick: _,
34
+ ref: c,
35
35
  size: t = "medium",
36
- variant: _ = "secondary",
37
- ...c
36
+ variant: d = "secondary",
37
+ ...p
38
38
  }) {
39
- return /* @__PURE__ */ d("button", { className: g(r.button, N[_], k[t], o, e === "danger" && r.danger), "data-intent": e, disabled: l, onClick: p, ref: y, type: "button", ...c, "data-component": "button", children: [
40
- i ? /* @__PURE__ */ a(u, { size: t === "large" ? "medium" : "small" }) : n && /* @__PURE__ */ a(b, { name: n, size: t === "large" ? "medium" : "small" }),
41
- m,
42
- /* @__PURE__ */ a(f, { variant: "highlight", children: s })
39
+ return /* @__PURE__ */ y("button", { className: g(r.button, L[d], N[t], o, m === "danger" && r.danger), "data-intent": m, disabled: l, onClick: _, ref: c, type: "button", ...p, "data-component": "button", children: [
40
+ i ? /* @__PURE__ */ a(u, { size: t === "large" ? "medium" : "small" }) : s && /* @__PURE__ */ a(f, { name: s, size: t === "large" ? "medium" : "small" }),
41
+ n,
42
+ /* @__PURE__ */ a(v, { variant: "highlight", children: e })
43
43
  ] });
44
44
  }
45
45
  export {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index41.css');const n=require("react/jsx-runtime"),V=require("classix"),s=require("react"),B=require("../button/index.cjs"),Ze=require("../form/index.cjs"),et=require("../../icons-BSfBrPs3.cjs"),Ee=require("../../index-D3gtJMYv.cjs"),tt=require("../label/index.cjs"),nt=require("../list/index.cjs"),Se=require("../loading/index.cjs"),$=require("../../index-Ct84TXGv.cjs");function G(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(G).join(" "):s.isValidElement(t)?G(t.props.children):""}function st(t){return s.isValidElement(t)&&t.type==="option"}function it(t){return s.isValidElement(t)&&t.type==="optgroup"}function lt(t){return s.isValidElement(t)&&t.type===s.Fragment}function rt(t){return s.isValidElement(t)&&t.type===$.Select}function le(t,o,r=!1){const a=[];return s.Children.forEach(t,i=>{if(lt(i))a.push(...le(i.props.children,o,r));else if(st(i)){const x=G(i.props.children).trim(),k=i.props.value!=null?String(i.props.value):x;a.push({disabled:r||!!i.props.disabled,groupLabel:o,hidden:!!i.props.hidden,isPlaceholder:!!(i.props.hidden&&k===""),label:i.props.children,selected:!!i.props.selected,text:x,value:k})}else it(i)&&a.push(...le(i.props.children,i.props.label,r||!!i.props.disabled))}),a}function ot(t){const o=t.trim();if(!o)return null;const a=[.../[*?]/.test(o)?o:`*${o}*`].map(i=>i==="*"?".*":i==="?"?".":i.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${a}$`,"i")}function at(t,o){const r=ot(o),a=t.filter(i=>!i.hidden&&!i.isPlaceholder);return r?a.filter(i=>r.test([i.groupLabel,i.text,i.value].filter(Boolean).join(" "))):a}function ct(t,o){return t.find(r=>r.value===o)??t.find(r=>r.isPlaceholder)??t[0]}function ut(t,o,r){var a,i;return o!=null?String(o):r!=null?String(r):((a=t.find(x=>x.selected))==null?void 0:a.value)??((i=t[0])==null?void 0:i.value)??""}function dt(t){if(rt(t)){const{children:o,placeholder:r,...a}=t.props;return{children:n.jsxs(n.Fragment,{children:[r&&n.jsx("option",{hidden:!0,value:"",children:r}),o]}),props:a}}return{children:t.props.children,props:t.props}}const ft="_combobox_7iy0q_3",pt="_dropdown_7iy0q_21",mt="_empty_7iy0q_29",_t="_group_7iy0q_30",bt="_placeholder_7iy0q_31",yt="_filter_7iy0q_39",vt="_native_7iy0q_71",xt="_option_7iy0q_81",ht="_options_7iy0q_107",jt="_panel_7iy0q_117",qt="_selected_7iy0q_142",gt="_text_7iy0q_146",wt="_trigger_7iy0q_154",Et="_minimal_7iy0q_199",St="_inline_7iy0q_259",Rt="_field_7iy0q_293",Nt="_label_7iy0q_297",l={combobox:ft,"combobox-input":"_combobox-input_7iy0q_12",dropdown:pt,empty:mt,group:_t,placeholder:bt,filter:yt,"filter-controls":"_filter-controls_7iy0q_46","loading-status":"_loading-status_7iy0q_57",native:vt,option:xt,options:ht,panel:jt,selected:qt,text:gt,trigger:wt,minimal:Et,inline:St,field:Rt,label:Nt,"inline-field":"_inline-field_7iy0q_302"};function Re(t,o){return{"--icon-svg":et.iconSVG(t,o)}}const It=({children:t,className:o,combobox:r=!1,description:a,errorMessage:i,invalid:x=!1,searchable:k,createOption:h,emptyLabel:Ne="No matches found",errorLabel:m,onRetry:re,retryLabel:Ie="Retry",label:y,filterOptions:Ce=!0,hasNextPage:b=!1,loading:d=!1,loadingLabel:oe="Loading",loadMoreLabel:Ve="Load more",onLoadMore:R,onOpenChange:D,onSearchChange:F,searchValue:M,renderOption:A,searchPlaceholder:L="Filter",selectedItems:Be,variant:j="default",...ae})=>{const O=dt(t),{defaultValue:$e,onChange:T,value:K,...ke}=O.props,c=$.sanitizeSelectProps(ke),{className:De,...Fe}=c,ce=s.useRef(null),ue=s.useRef(null),q=s.useId(),H=x&&i?`${q}-error`:void 0,de=a?`${q}-description`:void 0,fe=[c["aria-describedby"],de,H].filter(Boolean).join(" ")||void 0,pe=x?!0:c["aria-invalid"],me=s.useRef(null),g=s.useRef(null),P=s.useRef(null),_e=s.useRef(null),J=s.useRef(!1),U=s.useRef(!1),X=s.useRef(R),be=!!R,w=le(O.children),N=K!=null,Y=ut(w,K,$e),[Z,ee]=s.useState(()=>Y),[u,We]=s.useState(!1),[ze,ye]=s.useState(!1),[Qe,Ge]=s.useState(null),[Me,Ae]=s.useState(""),v=M??Me,te=w.filter(e=>!e.hidden).length,Le=Qe??(d||!!m||b||te>8),E=k??(Le||ze||v.length>0),I=s.useCallback(e=>{M===void 0&&Ae(e),F==null||F(e)},[F,M]),_=s.useCallback(e=>{J.current===e||e&&c.disabled||(J.current=e,We(e),D==null||D(e),e||I(""))},[D,c.disabled,I]),W=N?String(K):Z,ve={default:$.resolveColor("--colors-semantic-content-secondary"),white:$.resolveColor("--color-white","white")},xe=c.disabled?$.resolveColor("--colors-semantic-content-disabled"):j==="minimal"?ve.white:ve.default,z=ct(w,W),Oe=Re("CaretDown",xe),Te=Re("MagnifyingGlass",xe),ne=at(w,Ce?v:""),S=v.trim(),Q=!!(r&&h&&S&&h.isValid(S)),Ke=y&&j==="inline"?Ee.formatInlineLabel(y):y,he=e=>e?(A==null?void 0:A({groupLabel:e.groupLabel,isSelected:e.value===W,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";s.useEffect(()=>{u&&!v&&!d&&!m&&Ge(b||te>8)},[u,v,d,m,b,te]),s.useEffect(()=>{!N&&!w.some(e=>e.value===Z)&&ee(Y)},[Y,Z,N,w]),s.useEffect(()=>{u?E&&ye(!0):ye(!1)},[u,E]),s.useEffect(()=>{var e,f,p;u&&(r||E?(e=g.current)==null||e.focus():(p=(f=P.current)==null?void 0:f.querySelector("button:not(:disabled)"))==null||p.focus())},[u,r,E]),s.useEffect(()=>{if(!u)return;const e=f=>{var p;(p=ue.current)!=null&&p.contains(f.target)||_(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[_,u]),s.useEffect(()=>{X.current=R},[R]),s.useEffect(()=>{c.disabled&&_(!1)},[_,c.disabled]);const se=s.useCallback(()=>{!J.current||c.disabled||d||m||!b||!X.current||U.current||(U.current=!0,X.current())},[m,b,d,c.disabled]);s.useEffect(()=>{if(U.current=!1,!u||c.disabled||d||m||!b||!be)return;const e=_e.current,f=P.current;if(!e||!f||typeof IntersectionObserver>"u")return;let p=!0;const C=new IntersectionObserver(Xe=>{p&&Xe.some(Ye=>Ye.isIntersecting)&&se()},{root:f});return C.observe(e),()=>{p=!1,C.disconnect()}},[u,d,m,b,be,se,ne.length,v,c.disabled]);const He=e=>{N||ee(e.target.value),T==null||T(e)},ie=()=>{var e;_(!1),r||(e=ce.current)==null||e.focus()},je=()=>{var e;I(""),_(!0),(e=g.current)==null||e.focus()},qe=()=>{!h||!Q||(h.onCreate(S),je())},Pe=e=>{var C;N||ee(e);const f=me.current;if(!f){ie();return}const p=(C=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:C.set;p==null||p.call(f,e),f.dispatchEvent(new Event("change",{bubbles:!0})),r?je():ie()},Je=e=>{e.key==="Escape"&&ie(),e.key==="Enter"&&e.target===g.current&&Q&&(e.preventDefault(),qe())},ge=n.jsx("div",{"aria-hidden":!d,"aria-label":oe,className:l["loading-status"],role:"status",children:d&&n.jsx(Se.Loading,{size:"small"})}),we=n.jsxs("div",{className:V(l.dropdown,j==="inline"&&l.inline,j==="minimal"&&l.minimal,o),onKeyDown:Je,ref:ue,...ae,children:[n.jsx("select",{...Fe,"aria-hidden":"true",className:V(l.native,De),onChange:He,ref:me,tabIndex:-1,value:W,children:O.children}),r?n.jsxs("div",{className:l.combobox,onClick:()=>{var e;return(e=g.current)==null?void 0:e.focus()},children:[Be,n.jsx("input",{"aria-describedby":fe,"aria-invalid":pe,"aria-autocomplete":"list","aria-expanded":u,"aria-label":c["aria-label"]??y??L,className:l["combobox-input"],disabled:c.disabled,onChange:e=>{I(e.target.value),_(!0)},onClick:()=>_(!0),onFocus:()=>_(!0),placeholder:L||void 0,ref:g,role:"combobox",type:"text",value:v}),ge]}):n.jsx(B.Button,{"aria-describedby":fe,"aria-invalid":pe,"aria-label":y?void 0:c["aria-label"],"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":y?`${q} ${q}-value`:void 0,className:V(l.trigger,(z==null?void 0:z.isPlaceholder)&&l.placeholder),"data-open":u?"true":void 0,disabled:c.disabled,onClick:()=>_(!u),ref:ce,style:Oe,variant:"simple",children:n.jsx("span",{className:l.text,id:`${q}-value`,children:he(z)})}),u&&n.jsxs("div",{className:l.panel,children:[!r&&E&&n.jsxs("div",{className:l["filter-controls"],children:[n.jsx(Ee.Input,{"aria-label":"Filter",className:l.filter,icon:"MagnifyingGlass",onChange:e=>I(e.target.value),placeholder:L,ref:g,style:Te,type:"search",value:v}),ge]}),n.jsxs(nt.List,{"aria-label":"Dropdown","aria-busy":d||void 0,className:l.options,ref:P,children:[ne.map(e=>{const f=e.value===W;return n.jsx("li",{"data-component":"dropdown",children:n.jsxs(B.Button,{"aria-label":f?`${e.text}, selected`:e.text,className:V(l.option,f&&l.selected),disabled:e.disabled,onClick:()=>Pe(e.value),variant:"tertiary",children:[n.jsx("span",{className:l.text,children:he(e)}),e.groupLabel&&n.jsx("small",{className:l.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),Q&&h&&n.jsx("li",{children:n.jsx(B.Button,{"aria-label":G(h.render(S))||S,className:l.option,onClick:qe,variant:"tertiary",children:n.jsx("span",{className:l.text,children:h.render(S)})})}),ne.length===0&&!Q&&!d&&!m&&!b&&n.jsx("li",{className:l.empty,children:Ne}),m&&n.jsxs("li",{className:l.empty,children:[n.jsx("span",{role:"alert",children:m}),re&&n.jsx(B.Button,{disabled:d,onClick:re,variant:"tertiary",children:Ie})]}),d&&!r&&!E&&n.jsx("li",{"aria-label":oe,className:l.empty,role:"status",children:n.jsx(Se.Loading,{size:"small"})}),b&&R&&!m&&n.jsx("li",{ref:_e,children:n.jsx(B.Button,{className:l.option,disabled:d,onClick:se,variant:"tertiary",children:Ve})})]})]})]}),Ue=y||a?n.jsxs("div",{className:V(l.label,j==="inline"&&l["inline-field"]),children:[n.jsx(tt.Label,{label:Ke,labelId:y?q:void 0,description:a,descriptionId:de,inline:j==="inline",required:ae.required}),we]}):we;return n.jsxs("div",{className:l.field,"data-component":"dropdown",children:[Ue,H&&n.jsx(Ze.FieldError,{errorId:H,errorMessage:i})]})};exports.Dropdown=It;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index41.css');const n=require("react/jsx-runtime"),V=require("classix"),s=require("react"),$=require("../button/index.cjs"),Je=require("../form/index.cjs"),Ue=require("../../icons-BSfBrPs3.cjs"),ge=require("../../index-DBjIWUDE.cjs"),Xe=require("../label/index.cjs"),Ye=require("../list/index.cjs"),Ee=require("../loading/index.cjs"),Se=require("../../index-CFMWBY53.cjs");function W(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(W).join(" "):s.isValidElement(t)?W(t.props.children):""}function Ze(t){return s.isValidElement(t)&&t.type==="option"}function et(t){return s.isValidElement(t)&&t.type==="optgroup"}function tt(t){return s.isValidElement(t)&&t.type===s.Fragment}function nt(t){return s.isValidElement(t)&&t.type===Se.Select}function le(t,a,r=!1){const c=[];return s.Children.forEach(t,l=>{if(tt(l))c.push(...le(l.props.children,a,r));else if(Ze(l)){const j=W(l.props.children).trim(),k=l.props.value!=null?String(l.props.value):j;c.push({disabled:r||!!l.props.disabled,groupLabel:a,hidden:!!l.props.hidden,isPlaceholder:!!(l.props.hidden&&k===""),label:l.props.children,selected:!!l.props.selected,text:j,value:k})}else et(l)&&c.push(...le(l.props.children,l.props.label,r||!!l.props.disabled))}),c}function st(t){const a=t.trim();if(!a)return null;const c=[.../[*?]/.test(a)?a:`*${a}*`].map(l=>l==="*"?".*":l==="?"?".":l.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${c}$`,"i")}function lt(t,a){const r=st(a),c=t.filter(l=>!l.hidden&&!l.isPlaceholder);return r?c.filter(l=>r.test([l.groupLabel,l.text,l.value].filter(Boolean).join(" "))):c}function it(t,a){return t.find(r=>r.value===a)??t.find(r=>r.isPlaceholder)??t[0]}function rt(t,a,r){var c,l;return a!=null?String(a):r!=null?String(r):((c=t.find(j=>j.selected))==null?void 0:c.value)??((l=t[0])==null?void 0:l.value)??""}function at(t){if(nt(t)){const{children:a,placeholder:r,...c}=t.props;return{children:n.jsxs(n.Fragment,{children:[r&&n.jsx("option",{hidden:!0,value:"",children:r}),a]}),props:c}}return{children:t.props.children,props:t.props}}const ct="_combobox_bnh5j_3",ot="_dropdown_bnh5j_21",ut="_empty_bnh5j_29",dt="_group_bnh5j_30",ft="_placeholder_bnh5j_31",pt="_filter_bnh5j_39",mt="_native_bnh5j_71",bt="_option_bnh5j_81",_t="_options_bnh5j_107",ht="_panel_bnh5j_117",vt="_selected_bnh5j_142",jt="_text_bnh5j_146",xt="_trigger_bnh5j_154",yt="_minimal_bnh5j_200",gt="_inline_bnh5j_264",Et="_field_bnh5j_298",St="_label_bnh5j_302",i={combobox:ct,"combobox-input":"_combobox-input_bnh5j_12",dropdown:ot,empty:ut,group:dt,placeholder:ft,filter:pt,"filter-controls":"_filter-controls_bnh5j_46","loading-status":"_loading-status_bnh5j_57",native:mt,option:bt,options:_t,panel:ht,selected:vt,text:jt,trigger:xt,minimal:yt,inline:gt,field:Et,label:St,"inline-field":"_inline-field_bnh5j_307"},wt=({children:t,className:a,combobox:r=!1,description:c,errorMessage:l,invalid:j=!1,searchable:k,createOption:x,emptyLabel:we="No matches found",errorLabel:m,onRetry:ie,retryLabel:Re="Retry",label:h,filterOptions:Ne=!0,hasNextPage:_=!1,loading:d=!1,loadingLabel:re="Loading",loadMoreLabel:qe="Load more",onLoadMore:R,onOpenChange:C,onSearchChange:D,searchValue:A,renderOption:G,searchPlaceholder:L="Filter",selectedItems:Be,variant:N="default",...ae})=>{const M=at(t),{defaultValue:Ie,onChange:O,value:T,...Ve}=M.props,o=Se.sanitizeSelectProps(Ve),{className:$e,...ke}=o,ce=s.useRef(null),oe=s.useRef(null),y=s.useId(),K=j&&l?`${y}-error`:void 0,ue=c?`${y}-description`:void 0,de=[o["aria-describedby"],ue,K].filter(Boolean).join(" ")||void 0,fe=j?!0:o["aria-invalid"],pe=s.useRef(null),g=s.useRef(null),H=s.useRef(null),me=s.useRef(null),P=s.useRef(!1),J=s.useRef(!1),U=s.useRef(R),be=!!R,E=le(M.children),q=T!=null,X=rt(E,T,Ie),[Y,Z]=s.useState(()=>X),[u,Ce]=s.useState(!1),[De,_e]=s.useState(!1),[Fe,ze]=s.useState(null),[Qe,We]=s.useState(""),v=A??Qe,ee=E.filter(e=>!e.hidden).length,Ae=Fe??(d||!!m||_||ee>8),S=k??(Ae||De||v.length>0),B=s.useCallback(e=>{A===void 0&&We(e),D==null||D(e)},[D,A]),b=s.useCallback(e=>{P.current===e||e&&o.disabled||(P.current=e,Ce(e),C==null||C(e),e||B(""))},[C,o.disabled,B]),F=q?String(T):Y,z=it(E,F),Ge={"--icon-svg":Ue.iconSVG("CaretDown")},te=lt(E,Ne?v:""),w=v.trim(),Q=!!(r&&x&&w&&x.isValid(w)),Le=h&&N==="inline"?ge.formatInlineLabel(h):h,he=e=>e?(G==null?void 0:G({groupLabel:e.groupLabel,isSelected:e.value===F,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";s.useEffect(()=>{u&&!v&&!d&&!m&&ze(_||ee>8)},[u,v,d,m,_,ee]),s.useEffect(()=>{!q&&!E.some(e=>e.value===Y)&&Z(X)},[X,Y,q,E]),s.useEffect(()=>{u?S&&_e(!0):_e(!1)},[u,S]),s.useEffect(()=>{var e,f,p;u&&(r||S?(e=g.current)==null||e.focus():(p=(f=H.current)==null?void 0:f.querySelector("button:not(:disabled)"))==null||p.focus())},[u,r,S]),s.useEffect(()=>{if(!u)return;const e=f=>{var p;(p=oe.current)!=null&&p.contains(f.target)||b(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[b,u]),s.useEffect(()=>{U.current=R},[R]),s.useEffect(()=>{o.disabled&&b(!1)},[b,o.disabled]);const ne=s.useCallback(()=>{!P.current||o.disabled||d||m||!_||!U.current||J.current||(J.current=!0,U.current())},[m,_,d,o.disabled]);s.useEffect(()=>{if(J.current=!1,!u||o.disabled||d||m||!_||!be)return;const e=me.current,f=H.current;if(!e||!f||typeof IntersectionObserver>"u")return;let p=!0;const I=new IntersectionObserver(He=>{p&&He.some(Pe=>Pe.isIntersecting)&&ne()},{root:f});return I.observe(e),()=>{p=!1,I.disconnect()}},[u,d,m,_,be,ne,te.length,v,o.disabled]);const Me=e=>{q||Z(e.target.value),O==null||O(e)},se=()=>{var e;b(!1),r||(e=ce.current)==null||e.focus()},ve=()=>{var e;B(""),b(!0),(e=g.current)==null||e.focus()},je=()=>{!x||!Q||(x.onCreate(w),ve())},Oe=e=>{var I;q||Z(e);const f=pe.current;if(!f){se();return}const p=(I=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:I.set;p==null||p.call(f,e),f.dispatchEvent(new Event("change",{bubbles:!0})),r?ve():se()},Te=e=>{e.key==="Escape"&&se(),e.key==="Enter"&&e.target===g.current&&Q&&(e.preventDefault(),je())},xe=n.jsx("div",{"aria-hidden":!d,"aria-label":re,className:i["loading-status"],role:"status",children:d&&n.jsx(Ee.Loading,{size:"small"})}),ye=n.jsxs("div",{className:V(i.dropdown,N==="inline"&&i.inline,N==="minimal"&&i.minimal,a),onKeyDown:Te,ref:oe,...ae,children:[n.jsx("select",{...ke,"aria-hidden":"true",className:V(i.native,$e),onChange:Me,ref:pe,tabIndex:-1,value:F,children:M.children}),r?n.jsxs("div",{className:i.combobox,onClick:()=>{var e;return(e=g.current)==null?void 0:e.focus()},children:[Be,n.jsx("input",{"aria-describedby":de,"aria-invalid":fe,"aria-autocomplete":"list","aria-expanded":u,"aria-label":o["aria-label"]??h??L,className:i["combobox-input"],disabled:o.disabled,onChange:e=>{B(e.target.value),b(!0)},onClick:()=>b(!0),onFocus:()=>b(!0),placeholder:L||void 0,ref:g,role:"combobox",type:"text",value:v}),xe]}):n.jsx($.Button,{"aria-describedby":de,"aria-invalid":fe,"aria-label":h?void 0:o["aria-label"],"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":h?`${y} ${y}-value`:void 0,className:V(i.trigger,(z==null?void 0:z.isPlaceholder)&&i.placeholder),"data-open":u?"true":void 0,disabled:o.disabled,onClick:()=>b(!u),ref:ce,style:Ge,variant:"simple",children:n.jsx("span",{className:i.text,id:`${y}-value`,children:he(z)})}),u&&n.jsxs("div",{className:i.panel,children:[!r&&S&&n.jsxs("div",{className:i["filter-controls"],children:[n.jsx(ge.Input,{"aria-label":"Filter",className:i.filter,icon:"MagnifyingGlass",onChange:e=>B(e.target.value),placeholder:L,ref:g,type:"search",value:v}),xe]}),n.jsxs(Ye.List,{"aria-label":"Dropdown","aria-busy":d||void 0,className:i.options,ref:H,children:[te.map(e=>{const f=e.value===F;return n.jsx("li",{"data-component":"dropdown",children:n.jsxs($.Button,{"aria-label":f?`${e.text}, selected`:e.text,className:V(i.option,f&&i.selected),disabled:e.disabled,onClick:()=>Oe(e.value),variant:"tertiary",children:[n.jsx("span",{className:i.text,children:he(e)}),e.groupLabel&&n.jsx("small",{className:i.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),Q&&x&&n.jsx("li",{children:n.jsx($.Button,{"aria-label":W(x.render(w))||w,className:i.option,onClick:je,variant:"tertiary",children:n.jsx("span",{className:i.text,children:x.render(w)})})}),te.length===0&&!Q&&!d&&!m&&!_&&n.jsx("li",{className:i.empty,children:we}),m&&n.jsxs("li",{className:i.empty,children:[n.jsx("span",{role:"alert",children:m}),ie&&n.jsx($.Button,{disabled:d,onClick:ie,variant:"tertiary",children:Re})]}),d&&!r&&!S&&n.jsx("li",{"aria-label":re,className:i.empty,role:"status",children:n.jsx(Ee.Loading,{size:"small"})}),_&&R&&!m&&n.jsx("li",{ref:me,children:n.jsx($.Button,{className:i.option,disabled:d,onClick:ne,variant:"tertiary",children:qe})})]})]})]}),Ke=h||c?n.jsxs("div",{className:V(i.label,N==="inline"&&i["inline-field"]),children:[n.jsx(Xe.Label,{label:Le,labelId:h?y:void 0,description:c,descriptionId:ue,inline:N==="inline",required:ae.required}),ye]}):ye;return n.jsxs("div",{className:i.field,"data-component":"dropdown",children:[Ke,K&&n.jsx(Je.FieldError,{errorId:K,errorMessage:l})]})};exports.Dropdown=wt;