@solibo/solibo-ui 1.0.10 → 1.0.12

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 (86) hide show
  1. package/dist/assets/index10.css +1 -1
  2. package/dist/assets/index12.css +1 -1
  3. package/dist/assets/index15.css +1 -1
  4. package/dist/assets/index17.css +1 -1
  5. package/dist/assets/index20.css +1 -1
  6. package/dist/assets/index26.css +1 -1
  7. package/dist/assets/index28.css +1 -1
  8. package/dist/assets/index34.css +1 -1
  9. package/dist/assets/index36.css +1 -1
  10. package/dist/assets/index38.css +1 -1
  11. package/dist/assets/index39.css +1 -1
  12. package/dist/assets/index4.css +1 -1
  13. package/dist/assets/index41.css +1 -1
  14. package/dist/assets/index47.css +1 -1
  15. package/dist/assets/index9.css +1 -1
  16. package/dist/components/aside/index.cjs +1 -1
  17. package/dist/components/aside/index.js +18 -18
  18. package/dist/components/badge/index.cjs +1 -1
  19. package/dist/components/badge/index.js +37 -37
  20. package/dist/components/checkbox/index.cjs +1 -1
  21. package/dist/components/checkbox/index.cjs.map +1 -1
  22. package/dist/components/checkbox/index.js +1 -1
  23. package/dist/components/checkbox/index.js.map +1 -1
  24. package/dist/components/chip/index.cjs +1 -1
  25. package/dist/components/chip/index.js +7 -7
  26. package/dist/components/controls/index.cjs +1 -1
  27. package/dist/components/controls/index.cjs.map +1 -1
  28. package/dist/components/controls/index.js +20 -20
  29. package/dist/components/controls/index.js.map +1 -1
  30. package/dist/components/dialog/index.cjs +1 -1
  31. package/dist/components/dialog/index.js +38 -38
  32. package/dist/components/dropdown/index.cjs +1 -1
  33. package/dist/components/dropdown/index.js +65 -65
  34. package/dist/components/editor/index.cjs +16 -16
  35. package/dist/components/editor/index.cjs.map +1 -1
  36. package/dist/components/editor/index.js +4 -4
  37. package/dist/components/header/index.cjs +1 -1
  38. package/dist/components/header/index.js +9 -9
  39. package/dist/components/icon/index.cjs +1 -1
  40. package/dist/components/icon/index.js +1 -1
  41. package/dist/components/input/index.cjs +1 -1
  42. package/dist/components/input/index.js +2 -2
  43. package/dist/components/menu/index.cjs +1 -1
  44. package/dist/components/menu/index.cjs.map +1 -1
  45. package/dist/components/menu/index.js +67 -59
  46. package/dist/components/menu/index.js.map +1 -1
  47. package/dist/components/message/index.cjs +1 -1
  48. package/dist/components/message/index.js +21 -21
  49. package/dist/components/nav/index.cjs +1 -1
  50. package/dist/components/nav/index.js +19 -19
  51. package/dist/components/popover/index.cjs +1 -1
  52. package/dist/components/popover/index.cjs.map +1 -1
  53. package/dist/components/popover/index.js +78 -79
  54. package/dist/components/popover/index.js.map +1 -1
  55. package/dist/components/portal/index.cjs +1 -1
  56. package/dist/components/portal/index.js +15 -15
  57. package/dist/components/search/index.cjs +1 -1
  58. package/dist/components/search/index.cjs.map +1 -1
  59. package/dist/components/search/index.js +75 -45
  60. package/dist/components/search/index.js.map +1 -1
  61. package/dist/components/select/index.cjs +1 -1
  62. package/dist/components/select/index.js +2 -2
  63. package/dist/components/toasts/index.cjs +1 -1
  64. package/dist/components/toasts/index.js +4 -4
  65. package/dist/{icons-BFgf_lJN.js → icons-BIi_mYLy.js} +4 -1
  66. package/dist/icons-BIi_mYLy.js.map +1 -0
  67. package/dist/icons-CR-eUx2p.cjs +2 -0
  68. package/dist/icons-CR-eUx2p.cjs.map +1 -0
  69. package/dist/index-CWD8Jp0A.cjs +2 -0
  70. package/dist/{index-CEzqxRIu.cjs.map → index-CWD8Jp0A.cjs.map} +1 -1
  71. package/dist/{index-C_YiNpZP.js → index-Clex8VE6.js} +2 -2
  72. package/dist/{index-C_YiNpZP.js.map → index-Clex8VE6.js.map} +1 -1
  73. package/dist/{index-BPIK2dxs.cjs → index-DVXi-Ryi.cjs} +2 -2
  74. package/dist/{index-BPIK2dxs.cjs.map → index-DVXi-Ryi.cjs.map} +1 -1
  75. package/dist/index-yIe5PqD1.js +73 -0
  76. package/dist/{index-BHgGZxsR.js.map → index-yIe5PqD1.js.map} +1 -1
  77. package/dist/index.cjs +1 -1
  78. package/dist/index.d.ts +35 -12
  79. package/dist/index.js +2 -2
  80. package/dist/tokens.json +1 -1
  81. package/package.json +1 -1
  82. package/dist/icons-BFgf_lJN.js.map +0 -1
  83. package/dist/icons-Dx0NQYLH.cjs +0 -2
  84. package/dist/icons-Dx0NQYLH.cjs.map +0 -1
  85. package/dist/index-BHgGZxsR.js +0 -73
  86. package/dist/index-CEzqxRIu.cjs +0 -2
@@ -1,45 +1,45 @@
1
- import { jsxs as p, jsx as f } from "react/jsx-runtime";
2
- import { t as m } from "../../classix-DG18itHa.js";
1
+ import { jsxs as f, jsx as m } from "react/jsx-runtime";
2
+ import { t as p } from "../../classix-DG18itHa.js";
3
3
  import { Children as u, isValidElement as _, cloneElement as x } from "react";
4
4
  import { Button as y } from "../button/index.js";
5
- import '../../assets/index36.css';const k = "_controls_1p251_13", h = "_inline_1p251_35", B = "_fixed_1p251_40", o = {
5
+ import '../../assets/index36.css';const k = "_controls_j1dk0_13", j = "_inline_j1dk0_35", h = "_fixed_j1dk0_40", o = {
6
6
  controls: k,
7
- default: "_default_1p251_20",
8
- inline: h,
9
- fixed: B
10
- }, g = {
7
+ default: "_default_j1dk0_20",
8
+ inline: j,
9
+ fixed: h
10
+ }, B = {
11
11
  primary: 3,
12
12
  danger: 2,
13
13
  secondary: 1,
14
14
  tertiary: 0,
15
15
  simple: 0
16
- }, v = {
16
+ }, g = {
17
17
  default: o.default,
18
18
  fixed: o.fixed,
19
19
  inline: o.inline
20
- }, E = (e) => g[e.props.variant ?? "secondary"], N = ({
20
+ }, v = (e) => B[e.props.variant ?? "secondary"], N = ({
21
21
  children: e,
22
- className: a,
23
- variant: l = "default",
24
- ...c
22
+ className: d,
23
+ variant: s = "default",
24
+ ...l
25
25
  }) => {
26
- const s = u.toArray(e), i = [], r = [];
27
- s.forEach((n) => {
28
- _(n) && n.type === y ? i.push(n) : r.push(n);
26
+ const i = u.toArray(e), a = [], r = [];
27
+ i.forEach((n) => {
28
+ _(n) && n.type === y ? a.push(n) : r.push(n);
29
29
  });
30
- const d = i.map((n, t) => ({
30
+ const c = a.map((n, t) => ({
31
31
  button: n,
32
32
  index: t,
33
- rank: E(n)
33
+ rank: v(n)
34
34
  })).sort((n, t) => n.rank - t.rank || n.index - t.index).map(({
35
35
  button: n,
36
36
  index: t
37
37
  }) => x(n, {
38
38
  key: n.key ?? t
39
39
  }));
40
- return s.length === 0 ? null : /* @__PURE__ */ p("div", { className: m(o.controls, v[l], a), ...c, "data-component": "controls", children: [
41
- r && /* @__PURE__ */ f("span", { children: r }),
42
- d
40
+ return i.length === 0 ? null : /* @__PURE__ */ f("div", { "data-dynamic-position": s === "fixed" ? !0 : void 0, className: p(o.controls, g[s], d), ...l, "data-component": "controls", children: [
41
+ r && /* @__PURE__ */ m("span", { children: r }),
42
+ c
43
43
  ] });
44
44
  };
45
45
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/controls/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { Children, cloneElement, isValidElement } from 'react';\n\nimport { Button, type ButtonProps } from '../button';\nimport styles from './styles.module.css';\n\nconst buttonVariantOrder = {\n primary: 3,\n danger: 2,\n secondary: 1,\n tertiary: 0,\n simple: 0,\n} satisfies Record<NonNullable<ButtonProps['variant']>, number>;\n\nconst variants = {\n default: styles.default,\n fixed: styles.fixed,\n inline: styles.inline,\n};\n\nexport type ControlsProps = React.HTMLAttributes<HTMLDivElement> & {\n children?: React.ReactNode;\n variant?: keyof typeof variants;\n};\n\nconst getButtonRank = (button: React.ReactElement<ButtonProps>) =>\n buttonVariantOrder[button.props.variant ?? 'secondary'];\n\nexport const Controls = ({ children, className, variant = 'default', ...props }: ControlsProps) => {\n const childArray = Children.toArray(children);\n const buttons: React.ReactElement<ButtonProps>[] = [];\n const nonButtons: React.ReactNode[] = [];\n\n childArray.forEach((child) => {\n if (isValidElement<ButtonProps>(child) && child.type === Button) {\n buttons.push(child);\n } else {\n nonButtons.push(child);\n }\n });\n\n const sortedButtons = buttons\n .map((button, index) => ({ button, index, rank: getButtonRank(button) }))\n .sort((a, b) => a.rank - b.rank || a.index - b.index)\n .map(({ button, index }) =>\n cloneElement(button, {\n key: button.key ?? index,\n })\n );\n\n if (childArray.length === 0) {\n return null;\n }\n\n return (\n <div\n className={cx(styles.controls, variants[variant], className)}\n {...props}\n >\n {nonButtons && <span>{nonButtons}</span>}\n {sortedButtons}\n </div>\n );\n};\n"],"names":["buttonVariantOrder","primary","danger","secondary","tertiary","simple","variants","default","styles","fixed","inline","getButtonRank","button","props","variant","Controls","children","className","childArray","Children","toArray","buttons","nonButtons","forEach","child","isValidElement","type","Button","push","sortedButtons","map","index","rank","sort","a","b","cloneElement","key","length","jsxs","cx","controls","jsx"],"mappings":";;;;;;;;;GAMMA,IAAqB;AAAA,EACzBC,SAAS;AAAA,EACTC,QAAQ;AAAA,EACRC,WAAW;AAAA,EACXC,UAAU;AAAA,EACVC,QAAQ;AACV,GAEMC,IAAW;AAAA,EACfC,SAASC,EAAOD;AAAAA,EAChBE,OAAOD,EAAOC;AAAAA,EACdC,QAAQF,EAAOE;AACjB,GAOMC,IAAgBA,CAACC,MACrBZ,EAAmBY,EAAOC,MAAMC,WAAW,WAAW,GAE3CC,IAAWA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAUC,WAAAA;AAAAA,EAAWH,SAAAA,IAAU;AAAA,EAAW,GAAGD;AAAqB,MAAM;AACjG,QAAMK,IAAaC,EAASC,QAAQJ,CAAQ,GACtCK,IAA6C,CAAA,GAC7CC,IAAgC,CAAA;AAEtCJ,EAAAA,EAAWK,QAASC,CAAAA,MAAU;AAC5B,IAAIC,EAA4BD,CAAK,KAAKA,EAAME,SAASC,IACvDN,EAAQO,KAAKJ,CAAK,IAElBF,EAAWM,KAAKJ,CAAK;AAAA,EAEzB,CAAC;AAED,QAAMK,IAAgBR,EACnBS,IAAI,CAAClB,GAAQmB,OAAW;AAAA,IAAEnB,QAAAA;AAAAA,IAAQmB,OAAAA;AAAAA,IAAOC,MAAMrB,EAAcC,CAAM;AAAA,EAAA,EAAI,EACvEqB,KAAK,CAACC,GAAGC,MAAMD,EAAEF,OAAOG,EAAEH,QAAQE,EAAEH,QAAQI,EAAEJ,KAAK,EACnDD,IAAI,CAAC;AAAA,IAAElB,QAAAA;AAAAA,IAAQmB,OAAAA;AAAAA,EAAAA,MACdK,EAAaxB,GAAQ;AAAA,IACnByB,KAAKzB,EAAOyB,OAAON;AAAAA,EAAAA,CACpB,CACH;AAEF,SAAIb,EAAWoB,WAAW,IACjB,OAIP,gBAAAC,EAAC,OAAA,EACC,WAAWC,EAAGhC,EAAOiC,UAAUnC,EAASQ,CAAO,GAAGG,CAAS,GAC3D,GAAIJ,GAAM,kBAAA,YAETS,UAAAA;AAAAA,IAAAA,KAAc,gBAAAoB,EAAC,UAAMpB,UAAAA,EAAAA,CAAW;AAAA,IAChCO;AAAAA,EAAAA,GACH;AAEJ;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/controls/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { Children, cloneElement, isValidElement } from 'react';\n\nimport { Button, type ButtonProps } from '../button';\nimport styles from './styles.module.css';\n\nconst buttonVariantOrder = {\n primary: 3,\n danger: 2,\n secondary: 1,\n tertiary: 0,\n simple: 0,\n} satisfies Record<NonNullable<ButtonProps['variant']>, number>;\n\nconst variants = {\n default: styles.default,\n fixed: styles.fixed,\n inline: styles.inline,\n};\n\nexport type ControlsProps = React.HTMLAttributes<HTMLDivElement> & {\n children?: React.ReactNode;\n variant?: keyof typeof variants;\n};\n\nconst getButtonRank = (button: React.ReactElement<ButtonProps>) =>\n buttonVariantOrder[button.props.variant ?? 'secondary'];\n\nexport const Controls = ({ children, className, variant = 'default', ...props }: ControlsProps) => {\n const childArray = Children.toArray(children);\n const buttons: React.ReactElement<ButtonProps>[] = [];\n const nonButtons: React.ReactNode[] = [];\n\n childArray.forEach((child) => {\n if (isValidElement<ButtonProps>(child) && child.type === Button) {\n buttons.push(child);\n } else {\n nonButtons.push(child);\n }\n });\n\n const sortedButtons = buttons\n .map((button, index) => ({ button, index, rank: getButtonRank(button) }))\n .sort((a, b) => a.rank - b.rank || a.index - b.index)\n .map(({ button, index }) =>\n cloneElement(button, {\n key: button.key ?? index,\n })\n );\n\n if (childArray.length === 0) {\n return null;\n }\n\n return (\n <div\n data-dynamic-position={variant === 'fixed' ? true : undefined}\n className={cx(styles.controls, variants[variant], className)}\n {...props}\n >\n {nonButtons && <span>{nonButtons}</span>}\n {sortedButtons}\n </div>\n );\n};\n"],"names":["buttonVariantOrder","primary","danger","secondary","tertiary","simple","variants","default","styles","fixed","inline","getButtonRank","button","props","variant","Controls","children","className","childArray","Children","toArray","buttons","nonButtons","forEach","child","isValidElement","type","Button","push","sortedButtons","map","index","rank","sort","a","b","cloneElement","key","length","undefined","cx","controls","jsx"],"mappings":";;;;;;;;;GAMMA,IAAqB;AAAA,EACzBC,SAAS;AAAA,EACTC,QAAQ;AAAA,EACRC,WAAW;AAAA,EACXC,UAAU;AAAA,EACVC,QAAQ;AACV,GAEMC,IAAW;AAAA,EACfC,SAASC,EAAOD;AAAAA,EAChBE,OAAOD,EAAOC;AAAAA,EACdC,QAAQF,EAAOE;AACjB,GAOMC,IAAgBA,CAACC,MACrBZ,EAAmBY,EAAOC,MAAMC,WAAW,WAAW,GAE3CC,IAAWA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAUC,WAAAA;AAAAA,EAAWH,SAAAA,IAAU;AAAA,EAAW,GAAGD;AAAqB,MAAM;AACjG,QAAMK,IAAaC,EAASC,QAAQJ,CAAQ,GACtCK,IAA6C,CAAA,GAC7CC,IAAgC,CAAA;AAEtCJ,EAAAA,EAAWK,QAASC,CAAAA,MAAU;AAC5B,IAAIC,EAA4BD,CAAK,KAAKA,EAAME,SAASC,IACvDN,EAAQO,KAAKJ,CAAK,IAElBF,EAAWM,KAAKJ,CAAK;AAAA,EAEzB,CAAC;AAED,QAAMK,IAAgBR,EACnBS,IAAI,CAAClB,GAAQmB,OAAW;AAAA,IAAEnB,QAAAA;AAAAA,IAAQmB,OAAAA;AAAAA,IAAOC,MAAMrB,EAAcC,CAAM;AAAA,EAAA,EAAI,EACvEqB,KAAK,CAACC,GAAGC,MAAMD,EAAEF,OAAOG,EAAEH,QAAQE,EAAEH,QAAQI,EAAEJ,KAAK,EACnDD,IAAI,CAAC;AAAA,IAAElB,QAAAA;AAAAA,IAAQmB,OAAAA;AAAAA,EAAAA,MACdK,EAAaxB,GAAQ;AAAA,IACnByB,KAAKzB,EAAOyB,OAAON;AAAAA,EAAAA,CACpB,CACH;AAEF,SAAIb,EAAWoB,WAAW,IACjB,yBAIN,OAAA,EACC,yBAAuBxB,MAAY,UAAU,KAAOyB,QACpD,WAAWC,EAAGhC,EAAOiC,UAAUnC,EAASQ,CAAO,GAAGG,CAAS,GAC3D,GAAIJ,GAAM,kBAAA,YAETS,UAAAA;AAAAA,IAAAA,KAAc,gBAAAoB,EAAC,UAAMpB,UAAAA,EAAAA,CAAW;AAAA,IAChCO;AAAAA,EAAAA,GACH;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index38.css');const t=require("react/jsx-runtime"),k=require("../../classix-5H4IWnMA.cjs"),a=require("react"),j=require("../button/index.cjs"),p=require("../icon/index.cjs"),P="_dialog_vezdd_3",T="_close_vezdd_24",E="_structured_vezdd_32",F="_header_vezdd_38",M="_content_vezdd_49",S="_controls_vezdd_55",X="_fullscreen_vezdd_75",s={dialog:P,close:T,structured:E,header:F,content:M,controls:S,fullscreen:X},v=l=>a.Children.toArray(l).some(c=>a.isValidElement(c)?c.type===j.Button&&c.props.variant==="danger"?!0:v(c.props.children):!1),Y=({children:l,className:c,controls:o,fullscreen:f=!1,header:_,onCancel:d,onClick:i,onClose:u,open:n=!1,setOpen:r,...z})=>{const g=a.useRef(null),m=v(o),h=f||_!=null||o!=null;a.useEffect(()=>{const e=g.current;e&&(n&&!e.open?e.showModal():!n&&e.open&&e.close())},[n]);const B=e=>{d==null||d(e),!(e.defaultPrevented||!r)&&(e.preventDefault(),r(!1))},b=e=>{if(i==null||i(e),m||e.defaultPrevented||e.target!==e.currentTarget||!r)return;const{bottom:y,left:N,right:R,top:D}=e.currentTarget.getBoundingClientRect();(e.clientX<N||e.clientX>R||e.clientY<D||e.clientY>y)&&r(!1)},q=e=>{u==null||u(e),n&&(r==null||r(!1))},x=r&&!m?t.jsx(j.Button,{"aria-label":"Close dialog",className:s.close,onClick:()=>r(!1),variant:"simple",children:t.jsx(p.Icon,{name:"x"})}):null;return t.jsx("dialog",{className:k.t(s.dialog,h&&s.structured,f&&s.fullscreen,c),onCancel:B,onClick:b,onClose:q,ref:g,...z,"data-component":"dialog",children:h?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:s.header,children:[_,x]}),t.jsx("div",{className:s.content,children:l}),o!=null&&t.jsx("div",{className:s.controls,children:o})]}):t.jsxs(t.Fragment,{children:[x,l]})})};exports.Dialog=Y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index38.css');const e=require("react/jsx-runtime"),p=require("../../classix-5H4IWnMA.cjs"),a=require("react"),h=require("../button/index.cjs"),P=require("../icon/index.cjs"),T="_dialog_1ojxw_3",E="_close_1ojxw_24",F="_structured_1ojxw_32",M="_header_1ojxw_38",S="_content_1ojxw_49",X="_controls_1ojxw_57",Y="_fullscreen_1ojxw_77",s={dialog:T,close:E,structured:F,header:M,content:S,controls:X,fullscreen:Y},w=c=>a.Children.toArray(c).some(o=>a.isValidElement(o)?o.type===h.Button&&o.props.variant==="danger"?!0:w(o.props.children):!1),A=({children:c,className:o,controls:l,fullscreen:f=!1,header:_,onCancel:i,onClick:u,onClose:d,open:n=!1,setOpen:r,...B})=>{const g=a.useRef(null),x=w(l),j=f||_!=null||l!=null;a.useEffect(()=>{const t=g.current;t&&(n&&!t.open?t.showModal():!n&&t.open&&t.close())},[n]);const b=t=>{i==null||i(t),!(t.defaultPrevented||!r)&&(t.preventDefault(),r(!1))},q=t=>{if(u==null||u(t),x||t.defaultPrevented||t.target!==t.currentTarget||!r)return;const{bottom:N,left:R,right:D,top:k}=t.currentTarget.getBoundingClientRect();(t.clientX<R||t.clientX>D||t.clientY<k||t.clientY>N)&&r(!1)},y=t=>{d==null||d(t),n&&(r==null||r(!1))},m=r&&!x?e.jsx(h.Button,{"aria-label":"Close dialog",className:s.close,onClick:()=>r(!1),variant:"simple",children:e.jsx(P.Icon,{name:"x"})}):null;return e.jsx("dialog",{className:p.t(s.dialog,j&&s.structured,f&&s.fullscreen,o),onCancel:b,onClick:q,onClose:y,ref:g,...B,"data-component":"dialog",children:j?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:s.header,children:[_,m]}),e.jsx("div",{className:s.content,children:c}),l!=null&&e.jsx("div",{className:s.controls,children:l})]}):e.jsxs(e.Fragment,{children:[m,c]})})};exports.Dialog=A;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,61 +1,61 @@
1
- import { jsx as c, jsxs as u, Fragment as p } from "react/jsx-runtime";
2
- import { t as P } from "../../classix-DG18itHa.js";
3
- import v, { useRef as T, useEffect as X } from "react";
4
- import { Button as B } from "../button/index.js";
5
- import { Icon as Y } from "../icon/index.js";
6
- import '../../assets/index38.css';const w = "_dialog_vezdd_3", A = "_close_vezdd_24", F = "_structured_vezdd_32", I = "_header_vezdd_38", M = "_content_vezdd_49", V = "_controls_vezdd_55", q = "_fullscreen_vezdd_75", e = {
7
- dialog: w,
8
- close: A,
9
- structured: F,
10
- header: I,
11
- content: M,
12
- controls: V,
13
- fullscreen: q
14
- }, N = (o) => v.Children.toArray(o).some((l) => v.isValidElement(l) ? l.type === B && l.props.variant === "danger" ? !0 : N(l.props.children) : !1), S = ({
15
- children: o,
16
- className: l,
1
+ import { jsx as e, jsxs as u, Fragment as j } from "react/jsx-runtime";
2
+ import { t as T } from "../../classix-DG18itHa.js";
3
+ import w, { useRef as X, useEffect as Y } from "react";
4
+ import { Button as p } from "../button/index.js";
5
+ import { Icon as A } from "../icon/index.js";
6
+ import '../../assets/index38.css';const F = "_dialog_1ojxw_3", I = "_close_1ojxw_24", M = "_structured_1ojxw_32", V = "_header_1ojxw_38", q = "_content_1ojxw_49", z = "_controls_1ojxw_57", G = "_fullscreen_1ojxw_77", l = {
7
+ dialog: F,
8
+ close: I,
9
+ structured: M,
10
+ header: V,
11
+ content: q,
12
+ controls: z,
13
+ fullscreen: G
14
+ }, B = (c) => w.Children.toArray(c).some((o) => w.isValidElement(o) ? o.type === p && o.props.variant === "danger" ? !0 : B(o.props.children) : !1), U = ({
15
+ children: c,
16
+ className: o,
17
17
  controls: a,
18
18
  fullscreen: f = !1,
19
19
  header: _,
20
- onCancel: d,
21
- onClick: n,
22
- onClose: i,
20
+ onCancel: n,
21
+ onClick: i,
22
+ onClose: d,
23
23
  open: s = !1,
24
24
  setOpen: t,
25
- ...x
25
+ ...N
26
26
  }) => {
27
- const m = T(null), g = N(a), h = f || _ != null || a != null;
28
- X(() => {
27
+ const m = X(null), g = B(a), h = f || _ != null || a != null;
28
+ Y(() => {
29
29
  const r = m.current;
30
30
  r && (s && !r.open ? r.showModal() : !s && r.open && r.close());
31
31
  }, [s]);
32
32
  const R = (r) => {
33
- d == null || d(r), !(r.defaultPrevented || !t) && (r.preventDefault(), t(!1));
33
+ n == null || n(r), !(r.defaultPrevented || !t) && (r.preventDefault(), t(!1));
34
34
  }, k = (r) => {
35
- if (n == null || n(r), g || r.defaultPrevented || r.target !== r.currentTarget || !t) return;
35
+ if (i == null || i(r), g || r.defaultPrevented || r.target !== r.currentTarget || !t) return;
36
36
  const {
37
37
  bottom: D,
38
38
  left: b,
39
- right: j,
40
- top: E
39
+ right: E,
40
+ top: P
41
41
  } = r.currentTarget.getBoundingClientRect();
42
- (r.clientX < b || r.clientX > j || r.clientY < E || r.clientY > D) && t(!1);
42
+ (r.clientX < b || r.clientX > E || r.clientY < P || r.clientY > D) && t(!1);
43
43
  }, y = (r) => {
44
- i == null || i(r), s && (t == null || t(!1));
45
- }, z = t && !g ? /* @__PURE__ */ c(B, { "aria-label": "Close dialog", className: e.close, onClick: () => t(!1), variant: "simple", children: /* @__PURE__ */ c(Y, { name: "x" }) }) : null;
46
- return /* @__PURE__ */ c("dialog", { className: P(e.dialog, h && e.structured, f && e.fullscreen, l), onCancel: R, onClick: k, onClose: y, ref: m, ...x, "data-component": "dialog", children: h ? /* @__PURE__ */ u(p, { children: [
47
- /* @__PURE__ */ u("div", { className: e.header, children: [
44
+ d == null || d(r), s && (t == null || t(!1));
45
+ }, x = t && !g ? /* @__PURE__ */ e(p, { "aria-label": "Close dialog", className: l.close, onClick: () => t(!1), variant: "simple", children: /* @__PURE__ */ e(A, { name: "x" }) }) : null;
46
+ return /* @__PURE__ */ e("dialog", { className: T(l.dialog, h && l.structured, f && l.fullscreen, o), onCancel: R, onClick: k, onClose: y, ref: m, ...N, "data-component": "dialog", children: h ? /* @__PURE__ */ u(j, { children: [
47
+ /* @__PURE__ */ u("div", { className: l.header, children: [
48
48
  _,
49
- z
49
+ x
50
50
  ] }),
51
- /* @__PURE__ */ c("div", { className: e.content, children: o }),
52
- a != null && /* @__PURE__ */ c("div", { className: e.controls, children: a })
53
- ] }) : /* @__PURE__ */ u(p, { children: [
54
- z,
55
- o
51
+ /* @__PURE__ */ e("div", { className: l.content, children: c }),
52
+ a != null && /* @__PURE__ */ e("div", { className: l.controls, children: a })
53
+ ] }) : /* @__PURE__ */ u(j, { children: [
54
+ x,
55
+ c
56
56
  ] }) });
57
57
  };
58
58
  export {
59
- S as Dialog
59
+ U as Dialog
60
60
  };
61
61
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index39.css');const s=require("react/jsx-runtime"),N=require("../../classix-5H4IWnMA.cjs"),a=require("react"),F=require("../button/index.cjs"),ce=require("../../icons-Dx0NQYLH.cjs"),X=require("../../index-CEzqxRIu.cjs"),ue=require("../list/index.cjs"),V=require("../../index-BPIK2dxs.cjs");function L(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(L).join(" "):a.isValidElement(t)?L(t.props.children):""}function de(t){return a.isValidElement(t)&&t.type==="option"}function pe(t){return a.isValidElement(t)&&t.type==="optgroup"}function fe(t){return a.isValidElement(t)&&t.type===a.Fragment}function me(t){return a.isValidElement(t)&&t.type===V.Select}function W(t,i,r=!1){const l=[];return a.Children.forEach(t,n=>{if(fe(n))l.push(...W(n.props.children,i,r));else if(de(n)){const c=L(n.props.children).trim(),f=n.props.value!=null?String(n.props.value):c;l.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 pe(n)&&l.push(...W(n.props.children,n.props.label,r||!!n.props.disabled))}),l}function _e(t){const i=t.trim();if(!i)return null;const l=[.../[*?]/.test(i)?i:`*${i}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${l}$`,"i")}function he(t,i){const r=_e(i),l=t.filter(n=>!n.hidden&&!n.isPlaceholder);return r?l.filter(n=>r.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):l}function ye(t,i){return t.find(r=>r.value===i)??t.find(r=>r.isPlaceholder)??t[0]}function xe(t,i,r){var l,n;return i!=null?String(i):r!=null?String(r):((l=t.find(c=>c.selected))==null?void 0:l.value)??((n=t[0])==null?void 0:n.value)??""}function be(t){if(me(t)){const{children:i,placeholder:r,...l}=t.props;return{children:s.jsxs(s.Fragment,{children:[r&&s.jsx("option",{hidden:!0,value:"",children:r}),i]}),props:l}}return{children:t.props.children,props:t.props}}const ge="_combobox_18jwy_3",je="_dropdown_18jwy_27",we="_empty_18jwy_30",ve="_group_18jwy_31",Se="_placeholder_18jwy_32",Ce="_filter_18jwy_40",Ee="_native_18jwy_52",Ne="_option_18jwy_62",Ve="_options_18jwy_84",Le="_panel_18jwy_108",Re="_selected_18jwy_132",$e="_text_18jwy_136",Be="_trigger_18jwy_145",Ie="_minimal_18jwy_181",qe="_inline_18jwy_236",De="_label_18jwy_268",o={combobox:ge,"combobox-input":"_combobox-input_18jwy_12",dropdown:je,empty:we,group:ve,placeholder:Se,filter:Ce,native:Ee,option:Ne,options:Ve,panel:Le,selected:Re,text:$e,trigger:Be,minimal:Ie,inline:qe,label:De,"inline-field":"_inline-field_18jwy_274"};function Y(t,i){return{"--icon-svg":ce.iconSVG(t).replace("currentColor",i)}}const Pe=({children:t,className:i,combobox:r=!1,createOption:l,emptyLabel:n="No matches found",label:c,renderOption:f,searchPlaceholder:R="Filter",selectedItems:Z,variant:y="default",...ee})=>{const $=be(t),{defaultValue:te,onChange:B,value:I,...ne}=$.props,g=V.sanitizeSelectProps(ne),M=a.useRef(null),Q=a.useRef(null),j=a.useId(),z=a.useRef(null),m=a.useRef(null),x=W($.children),b=I!=null,q=xe(x,I,te),[D,P]=a.useState(()=>q),[u,p]=a.useState(!1),[w,v]=a.useState(""),S=b?String(I):D,O={default:V.resolveColor("--colors-semantic-content-secondary"),white:V.resolveColor("--color-white","white")},T=y==="minimal"?O.white:O.default,C=ye(x,S),re=Y("chevron",T),le=Y("search",T),A=he(x,w),_=w.trim(),E=!!(r&&l&&_&&l.isValid(_)),se=c&&y==="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(()=>{!b&&!x.some(e=>e.value===D)&&P(q)},[q,D,b,x]),a.useEffect(()=>{var e;if(!u){v("");return}(e=m.current)==null||e.focus()},[u]),a.useEffect(()=>{if(!u)return;const e=d=>{var h;(h=Q.current)!=null&&h.contains(d.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);const oe=e=>{b||P(e.target.value),B==null||B(e)},k=()=>{var e;p(!1),r||(e=M.current)==null||e.focus()},K=()=>{var e;v(""),p(!0),(e=m.current)==null||e.focus()},H=()=>{!l||!E||(l.onCreate(_),K())},ie=e=>{var U;b||P(e);const d=z.current;if(!d){k();return}const h=(U=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:U.set;h==null||h.call(d,e),d.dispatchEvent(new Event("change",{bubbles:!0})),r?K():k()},ae=e=>{e.key==="Escape"&&k(),e.key==="Enter"&&e.target===m.current&&E&&(e.preventDefault(),H())},J=s.jsxs("div",{className:N.t(o.dropdown,y==="inline"&&o.inline,y==="minimal"&&o.minimal,i),onKeyDown:ae,ref:Q,...ee,children:[s.jsx("select",{...g,"aria-hidden":"true",className:o.native,onChange:oe,ref:z,tabIndex:-1,value:S,children:$.children}),r?s.jsxs("div",{className:o.combobox,onClick:()=>{var e;return(e=m.current)==null?void 0:e.focus()},children:[Z,s.jsx("input",{"aria-autocomplete":"list","aria-expanded":u,"aria-label":g["aria-label"]??c??R,className:o["combobox-input"],disabled:g.disabled,onChange:e=>{v(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:R||void 0,ref:m,role:"combobox",type:"text",value:w})]}):s.jsx(F.Button,{"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":c?`${j} ${j}-value`:void 0,className:N.t(o.trigger,(C==null?void 0:C.isPlaceholder)&&o.placeholder),"data-open":u?"true":void 0,disabled:g.disabled,onClick:()=>p(e=>!e),ref:M,style:re,variant:"tertiary",children:s.jsx("span",{className:o.text,id:`${j}-value`,children:G(C)})}),u&&s.jsxs("div",{className:o.panel,children:[!r&&s.jsx(X.Input,{"aria-label":"Filter",className:o.filter,icon:"search",onChange:e=>v(e.target.value),placeholder:R,ref:m,style:le,type:"search",value:w}),s.jsxs(ue.List,{"aria-label":"Dropdown",className:o.options,children:[A.map(e=>{const d=e.value===S;return s.jsx("li",{"data-component":"dropdown",children:s.jsxs(F.Button,{"aria-label":d?`${e.text}, selected`:e.text,className:N.t(o.option,d&&o.selected),disabled:e.disabled,onClick:()=>ie(e.value),variant:"tertiary",children:[s.jsx("span",{className:o.text,children:G(e)}),e.groupLabel&&s.jsx("small",{className:o.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),E&&l&&s.jsx("li",{children:s.jsx(F.Button,{"aria-label":L(l.render(_))||_,className:o.option,onClick:H,variant:"tertiary",children:s.jsx("span",{className:o.text,children:l.render(_)})})}),A.length===0&&!E&&s.jsx("li",{className:o.empty,children:n})]})]})]});return c?s.jsxs("div",{className:N.t(o.label,y==="inline"&&o["inline-field"]),"data-component":"dropdown",children:[s.jsx("span",{id:j,children:se}),J]}):J};exports.Dropdown=Pe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index39.css');const s=require("react/jsx-runtime"),E=require("../../classix-5H4IWnMA.cjs"),a=require("react"),F=require("../button/index.cjs"),ce=require("../../icons-CR-eUx2p.cjs"),X=require("../../index-CWD8Jp0A.cjs"),ue=require("../list/index.cjs"),N=require("../../index-DVXi-Ryi.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 de(t){return a.isValidElement(t)&&t.type==="option"}function pe(t){return a.isValidElement(t)&&t.type==="optgroup"}function fe(t){return a.isValidElement(t)&&t.type===a.Fragment}function me(t){return a.isValidElement(t)&&t.type===N.Select}function W(t,i,r=!1){const l=[];return a.Children.forEach(t,n=>{if(fe(n))l.push(...W(n.props.children,i,r));else if(de(n)){const c=V(n.props.children).trim(),f=n.props.value!=null?String(n.props.value):c;l.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 pe(n)&&l.push(...W(n.props.children,n.props.label,r||!!n.props.disabled))}),l}function be(t){const i=t.trim();if(!i)return null;const l=[.../[*?]/.test(i)?i:`*${i}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${l}$`,"i")}function _e(t,i){const r=be(i),l=t.filter(n=>!n.hidden&&!n.isPlaceholder);return r?l.filter(n=>r.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):l}function he(t,i){return t.find(r=>r.value===i)??t.find(r=>r.isPlaceholder)??t[0]}function ye(t,i,r){var l,n;return i!=null?String(i):r!=null?String(r):((l=t.find(c=>c.selected))==null?void 0:l.value)??((n=t[0])==null?void 0:n.value)??""}function xe(t){if(me(t)){const{children:i,placeholder:r,...l}=t.props;return{children:s.jsxs(s.Fragment,{children:[r&&s.jsx("option",{hidden:!0,value:"",children:r}),i]}),props:l}}return{children:t.props.children,props:t.props}}const ge="_combobox_1bqyf_3",ve="_dropdown_1bqyf_27",je="_empty_1bqyf_30",qe="_group_1bqyf_31",we="_placeholder_1bqyf_32",Se="_filter_1bqyf_40",Ce="_native_1bqyf_52",Ee="_option_1bqyf_62",Ne="_options_1bqyf_84",Ve="_panel_1bqyf_108",Le="_selected_1bqyf_132",Re="_text_1bqyf_136",$e="_trigger_1bqyf_144",Be="_minimal_1bqyf_180",Ie="_inline_1bqyf_235",De="_label_1bqyf_267",o={combobox:ge,"combobox-input":"_combobox-input_1bqyf_12",dropdown:ve,empty:je,group:qe,placeholder:we,filter:Se,native:Ce,option:Ee,options:Ne,panel:Ve,selected:Le,text:Re,trigger:$e,minimal:Be,inline:Ie,label:De,"inline-field":"_inline-field_1bqyf_273"};function Y(t,i){return{"--icon-svg":ce.iconSVG(t).replace("currentColor",i)}}const Pe=({children:t,className:i,combobox:r=!1,createOption:l,emptyLabel:n="No matches found",label:c,renderOption:f,searchPlaceholder:L="Filter",selectedItems:Z,variant:h="default",...ee})=>{const R=xe(t),{defaultValue:te,onChange:$,value:B,...ne}=R.props,g=N.sanitizeSelectProps(ne),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=ye(y,B,te),[D,P]=a.useState(()=>I),[u,p]=a.useState(!1),[j,q]=a.useState(""),w=x?String(B):D,O={default:N.resolveColor("--colors-semantic-content-secondary"),white:N.resolveColor("--color-white","white")},T=h==="minimal"?O.white:O.default,S=he(y,w),re=Y("chevron",T),le=Y("search",T),A=_e(y,j),b=j.trim(),C=!!(r&&l&&b&&l.isValid(b)),se=c&&h==="inline"?X.formatInlineLabel(c):c,G=e=>e?(f==null?void 0:f({groupLabel:e.groupLabel,isSelected:e.value===w,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";a.useEffect(()=>{!x&&!y.some(e=>e.value===D)&&P(I)},[I,D,x,y]),a.useEffect(()=>{var e;if(!u){q("");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 oe=e=>{x||P(e.target.value),$==null||$(e)},k=()=>{var e;p(!1),r||(e=M.current)==null||e.focus()},K=()=>{var e;q(""),p(!0),(e=m.current)==null||e.focus()},H=()=>{!l||!C||(l.onCreate(b),K())},ie=e=>{var U;x||P(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()},ae=e=>{e.key==="Escape"&&k(),e.key==="Enter"&&e.target===m.current&&C&&(e.preventDefault(),H())},J=s.jsxs("div",{className:E.t(o.dropdown,h==="inline"&&o.inline,h==="minimal"&&o.minimal,i),onKeyDown:ae,ref:Q,...ee,children:[s.jsx("select",{...g,"aria-hidden":"true",className:o.native,onChange:oe,ref:z,tabIndex:-1,value:w,children:R.children}),r?s.jsxs("div",{className:o.combobox,onClick:()=>{var e;return(e=m.current)==null?void 0:e.focus()},children:[Z,s.jsx("input",{"aria-autocomplete":"list","aria-expanded":u,"aria-label":g["aria-label"]??c??L,className:o["combobox-input"],disabled:g.disabled,onChange:e=>{q(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:L||void 0,ref:m,role:"combobox",type:"text",value:j})]}):s.jsx(F.Button,{"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":c?`${v} ${v}-value`:void 0,className:E.t(o.trigger,(S==null?void 0:S.isPlaceholder)&&o.placeholder),"data-open":u?"true":void 0,disabled:g.disabled,onClick:()=>p(e=>!e),ref:M,style:re,variant:"tertiary",children:s.jsx("span",{className:o.text,id:`${v}-value`,children:G(S)})}),u&&s.jsxs("div",{className:o.panel,children:[!r&&s.jsx(X.Input,{"aria-label":"Filter",className:o.filter,icon:"search",onChange:e=>q(e.target.value),placeholder:L,ref:m,style:le,type:"search",value:j}),s.jsxs(ue.List,{"aria-label":"Dropdown",className:o.options,children:[A.map(e=>{const d=e.value===w;return s.jsx("li",{"data-component":"dropdown",children:s.jsxs(F.Button,{"aria-label":d?`${e.text}, selected`:e.text,className:E.t(o.option,d&&o.selected),disabled:e.disabled,onClick:()=>ie(e.value),variant:"tertiary",children:[s.jsx("span",{className:o.text,children:G(e)}),e.groupLabel&&s.jsx("small",{className:o.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),C&&l&&s.jsx("li",{children:s.jsx(F.Button,{"aria-label":V(l.render(b))||b,className:o.option,onClick:H,variant:"tertiary",children:s.jsx("span",{className:o.text,children:l.render(b)})})}),A.length===0&&!C&&s.jsx("li",{className:o.empty,children:n})]})]})]});return c?s.jsxs("div",{className:E.t(o.label,h==="inline"&&o["inline-field"]),"data-component":"dropdown",children:[s.jsx("span",{id:v,children:se}),J]}):J};exports.Dropdown=Pe;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,32 +1,32 @@
1
1
  import { jsxs as p, Fragment as pe, jsx as s } from "react/jsx-runtime";
2
2
  import { t as V } from "../../classix-DG18itHa.js";
3
- import fe, { Children as me, isValidElement as w, useRef as I, useId as he, useState as Q, useEffect as z } from "react";
4
- import { Button as M } from "../button/index.js";
5
- import { i as _e } from "../../icons-BFgf_lJN.js";
6
- import { f as ye, I as be } from "../../index-BHgGZxsR.js";
3
+ import fe, { Children as me, isValidElement as v, useRef as I, useId as be, useState as W, useEffect as Q } from "react";
4
+ import { Button as z } from "../button/index.js";
5
+ import { i as he } from "../../icons-BIi_mYLy.js";
6
+ import { f as _e, I as ye } from "../../index-yIe5PqD1.js";
7
7
  import { List as ge } from "../list/index.js";
8
- import { S as we, s as ve, r as ee } from "../../index-C_YiNpZP.js";
8
+ import { S as ve, s as xe, r as ee } from "../../index-Clex8VE6.js";
9
9
  import '../../assets/index39.css';function L(t) {
10
- return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(L).join(" ") : w(t) ? L(t.props.children) : "";
10
+ return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(L).join(" ") : v(t) ? L(t.props.children) : "";
11
11
  }
12
- function xe(t) {
13
- return w(t) && t.type === "option";
14
- }
15
- function je(t) {
16
- return w(t) && t.type === "optgroup";
12
+ function we(t) {
13
+ return v(t) && t.type === "option";
17
14
  }
18
15
  function Se(t) {
19
- return w(t) && t.type === fe.Fragment;
16
+ return v(t) && t.type === "optgroup";
17
+ }
18
+ function qe(t) {
19
+ return v(t) && t.type === fe.Fragment;
20
20
  }
21
21
  function Ne(t) {
22
- return w(t) && t.type === we;
22
+ return v(t) && t.type === ve;
23
23
  }
24
- function A(t, i, r = !1) {
24
+ function M(t, i, r = !1) {
25
25
  const l = [];
26
26
  return me.forEach(t, (n) => {
27
- if (Se(n))
28
- l.push(...A(n.props.children, i, r));
29
- else if (xe(n)) {
27
+ if (qe(n))
28
+ l.push(...M(n.props.children, i, r));
29
+ else if (we(n)) {
30
30
  const a = L(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,
@@ -38,7 +38,7 @@ function A(t, i, r = !1) {
38
38
  text: a,
39
39
  value: f
40
40
  });
41
- } else je(n) && l.push(...A(n.props.children, n.props.label, r || !!n.props.disabled));
41
+ } else Se(n) && l.push(...M(n.props.children, n.props.label, r || !!n.props.disabled));
42
42
  }), l;
43
43
  }
44
44
  function Ce(t) {
@@ -78,29 +78,29 @@ function Le(t) {
78
78
  props: t.props
79
79
  };
80
80
  }
81
- const $e = "_combobox_18jwy_3", Be = "_dropdown_18jwy_27", ke = "_empty_18jwy_30", De = "_group_18jwy_31", Pe = "_placeholder_18jwy_32", Re = "_filter_18jwy_40", Fe = "_native_18jwy_52", We = "_option_18jwy_62", Qe = "_options_18jwy_84", ze = "_panel_18jwy_108", Me = "_selected_18jwy_132", Ae = "_text_18jwy_136", Ge = "_trigger_18jwy_145", Ke = "_minimal_18jwy_181", Oe = "_inline_18jwy_236", Te = "_label_18jwy_268", o = {
81
+ const $e = "_combobox_1bqyf_3", Be = "_dropdown_1bqyf_27", ke = "_empty_1bqyf_30", De = "_group_1bqyf_31", Pe = "_placeholder_1bqyf_32", Re = "_filter_1bqyf_40", je = "_native_1bqyf_52", Fe = "_option_1bqyf_62", We = "_options_1bqyf_84", Qe = "_panel_1bqyf_108", ze = "_selected_1bqyf_132", Me = "_text_1bqyf_136", Ae = "_trigger_1bqyf_144", Ge = "_minimal_1bqyf_180", Ke = "_inline_1bqyf_235", Oe = "_label_1bqyf_267", o = {
82
82
  combobox: $e,
83
- "combobox-input": "_combobox-input_18jwy_12",
83
+ "combobox-input": "_combobox-input_1bqyf_12",
84
84
  dropdown: Be,
85
85
  empty: ke,
86
86
  group: De,
87
87
  placeholder: Pe,
88
88
  filter: Re,
89
- native: Fe,
90
- option: We,
91
- options: Qe,
92
- panel: ze,
93
- selected: Me,
94
- text: Ae,
95
- trigger: Ge,
96
- minimal: Ke,
97
- inline: Oe,
98
- label: Te,
99
- "inline-field": "_inline-field_18jwy_274"
89
+ native: je,
90
+ option: Fe,
91
+ options: We,
92
+ panel: Qe,
93
+ selected: ze,
94
+ text: Me,
95
+ trigger: Ae,
96
+ minimal: Ge,
97
+ inline: Ke,
98
+ label: Oe,
99
+ "inline-field": "_inline-field_1bqyf_273"
100
100
  };
101
101
  function te(t, i) {
102
102
  return {
103
- "--icon-svg": _e(t).replace("currentColor", i)
103
+ "--icon-svg": he(t).replace("currentColor", i)
104
104
  };
105
105
  }
106
106
  const tt = ({
@@ -113,7 +113,7 @@ const tt = ({
113
113
  renderOption: f,
114
114
  searchPlaceholder: $ = "Filter",
115
115
  selectedItems: ne,
116
- variant: y = "default",
116
+ variant: _ = "default",
117
117
  ...re
118
118
  }) => {
119
119
  const B = Le(t), {
@@ -121,88 +121,88 @@ const tt = ({
121
121
  onChange: k,
122
122
  value: D,
123
123
  ...oe
124
- } = B.props, v = ve(oe), G = I(null), K = I(null), x = he(), O = I(null), m = I(null), b = A(B.children), g = D != null, P = Ie(b, D, le), [R, F] = Q(() => P), [c, d] = Q(!1), [j, S] = Q(""), N = g ? String(D) : R, T = {
124
+ } = B.props, x = xe(oe), A = I(null), G = I(null), w = be(), K = I(null), m = I(null), y = M(B.children), g = D != null, P = Ie(y, D, le), [R, j] = W(() => P), [c, d] = W(!1), [S, q] = W(""), N = g ? String(D) : R, O = {
125
125
  default: ee("--colors-semantic-content-secondary"),
126
126
  white: ee("--color-white", "white")
127
- }, q = y === "minimal" ? T.white : T.default, C = Ve(b, N), ie = te("chevron", q), se = te("search", q), H = Ee(b, j), h = j.trim(), E = !!(r && l && h && l.isValid(h)), ae = a && y === "inline" ? ye(a) : a, J = (e) => e ? (f == null ? void 0 : f({
127
+ }, T = _ === "minimal" ? O.white : O.default, C = Ve(y, N), ie = te("chevron", T), se = te("search", T), H = Ee(y, S), b = S.trim(), E = !!(r && l && b && l.isValid(b)), ae = a && _ === "inline" ? _e(a) : a, J = (e) => e ? (f == null ? void 0 : f({
128
128
  groupLabel: e.groupLabel,
129
129
  isSelected: e.value === N,
130
130
  label: e.label,
131
131
  text: e.text,
132
132
  value: e.value
133
133
  })) ?? e.label : "Select an option";
134
- z(() => {
135
- !g && !b.some((e) => e.value === R) && F(P);
136
- }, [P, R, g, b]), z(() => {
134
+ Q(() => {
135
+ !g && !y.some((e) => e.value === R) && j(P);
136
+ }, [P, R, g, y]), Q(() => {
137
137
  var e;
138
138
  if (!c) {
139
- S("");
139
+ q("");
140
140
  return;
141
141
  }
142
142
  (e = m.current) == null || e.focus();
143
- }, [c]), z(() => {
143
+ }, [c]), Q(() => {
144
144
  if (!c)
145
145
  return;
146
146
  const e = (u) => {
147
- var _;
148
- (_ = K.current) != null && _.contains(u.target) || d(!1);
147
+ var h;
148
+ (h = G.current) != null && h.contains(u.target) || d(!1);
149
149
  };
150
150
  return document.addEventListener("mousedown", e), () => {
151
151
  document.removeEventListener("mousedown", e);
152
152
  };
153
153
  }, [c]);
154
154
  const ce = (e) => {
155
- g || F(e.target.value), k == null || k(e);
156
- }, W = () => {
155
+ g || j(e.target.value), k == null || k(e);
156
+ }, F = () => {
157
157
  var e;
158
- d(!1), r || (e = G.current) == null || e.focus();
158
+ d(!1), r || (e = A.current) == null || e.focus();
159
159
  }, U = () => {
160
160
  var e;
161
- S(""), d(!0), (e = m.current) == null || e.focus();
161
+ q(""), d(!0), (e = m.current) == null || e.focus();
162
162
  }, X = () => {
163
- !l || !E || (l.onCreate(h), U());
163
+ !l || !E || (l.onCreate(b), U());
164
164
  }, ue = (e) => {
165
165
  var Z;
166
- g || F(e);
167
- const u = O.current;
166
+ g || j(e);
167
+ const u = K.current;
168
168
  if (!u) {
169
- W();
169
+ F();
170
170
  return;
171
171
  }
172
- const _ = (Z = Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype, "value")) == null ? void 0 : Z.set;
173
- _ == null || _.call(u, e), u.dispatchEvent(new Event("change", {
172
+ const h = (Z = Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype, "value")) == null ? void 0 : Z.set;
173
+ h == null || h.call(u, e), u.dispatchEvent(new Event("change", {
174
174
  bubbles: !0
175
- })), r ? U() : W();
175
+ })), r ? U() : F();
176
176
  }, de = (e) => {
177
- e.key === "Escape" && W(), e.key === "Enter" && e.target === m.current && E && (e.preventDefault(), X());
178
- }, Y = /* @__PURE__ */ p("div", { className: V(o.dropdown, y === "inline" && o.inline, y === "minimal" && o.minimal, i), onKeyDown: de, ref: K, ...re, children: [
179
- /* @__PURE__ */ s("select", { ...v, "aria-hidden": "true", className: o.native, onChange: ce, ref: O, tabIndex: -1, value: N, children: B.children }),
177
+ e.key === "Escape" && F(), e.key === "Enter" && e.target === m.current && E && (e.preventDefault(), X());
178
+ }, Y = /* @__PURE__ */ p("div", { className: V(o.dropdown, _ === "inline" && o.inline, _ === "minimal" && o.minimal, i), onKeyDown: de, ref: G, ...re, children: [
179
+ /* @__PURE__ */ s("select", { ...x, "aria-hidden": "true", className: o.native, onChange: ce, ref: K, tabIndex: -1, value: N, children: B.children }),
180
180
  r ? /* @__PURE__ */ p("div", { className: o.combobox, onClick: () => {
181
181
  var e;
182
182
  return (e = m.current) == null ? void 0 : e.focus();
183
183
  }, children: [
184
184
  ne,
185
- /* @__PURE__ */ s("input", { "aria-autocomplete": "list", "aria-expanded": c, "aria-label": v["aria-label"] ?? a ?? $, className: o["combobox-input"], disabled: v.disabled, onChange: (e) => {
186
- S(e.target.value), d(!0);
187
- }, onClick: () => d(!0), onFocus: () => d(!0), placeholder: $ || void 0, ref: m, role: "combobox", type: "text", value: j })
188
- ] }) : /* @__PURE__ */ s(M, { "aria-expanded": c, "aria-haspopup": "dialog", "aria-labelledby": a ? `${x} ${x}-value` : void 0, className: V(o.trigger, (C == null ? void 0 : C.isPlaceholder) && o.placeholder), "data-open": c ? "true" : void 0, disabled: v.disabled, onClick: () => d((e) => !e), ref: G, style: ie, variant: "tertiary", children: /* @__PURE__ */ s("span", { className: o.text, id: `${x}-value`, children: J(C) }) }),
185
+ /* @__PURE__ */ s("input", { "aria-autocomplete": "list", "aria-expanded": c, "aria-label": x["aria-label"] ?? a ?? $, className: o["combobox-input"], disabled: x.disabled, onChange: (e) => {
186
+ q(e.target.value), d(!0);
187
+ }, onClick: () => d(!0), onFocus: () => d(!0), placeholder: $ || void 0, ref: m, role: "combobox", type: "text", value: S })
188
+ ] }) : /* @__PURE__ */ s(z, { "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: x.disabled, onClick: () => d((e) => !e), ref: A, style: ie, variant: "tertiary", children: /* @__PURE__ */ s("span", { className: o.text, id: `${w}-value`, children: J(C) }) }),
189
189
  c && /* @__PURE__ */ p("div", { className: o.panel, children: [
190
- !r && /* @__PURE__ */ s(be, { "aria-label": "Filter", className: o.filter, icon: "search", onChange: (e) => S(e.target.value), placeholder: $, ref: m, style: se, type: "search", value: j }),
190
+ !r && /* @__PURE__ */ s(ye, { "aria-label": "Filter", className: o.filter, icon: "search", onChange: (e) => q(e.target.value), placeholder: $, ref: m, style: se, type: "search", value: S }),
191
191
  /* @__PURE__ */ p(ge, { "aria-label": "Dropdown", className: o.options, children: [
192
192
  H.map((e) => {
193
193
  const u = e.value === N;
194
- return /* @__PURE__ */ s("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(M, { "aria-label": u ? `${e.text}, selected` : e.text, className: V(o.option, u && o.selected), disabled: e.disabled, onClick: () => ue(e.value), variant: "tertiary", children: [
194
+ return /* @__PURE__ */ s("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: () => ue(e.value), variant: "tertiary", children: [
195
195
  /* @__PURE__ */ s("span", { className: o.text, children: J(e) }),
196
196
  e.groupLabel && /* @__PURE__ */ s("small", { className: o.group, children: e.groupLabel })
197
197
  ] }) }, `${e.groupLabel ?? "root"}-${e.value}`);
198
198
  }),
199
- E && l && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(M, { "aria-label": L(l.render(h)) || h, className: o.option, onClick: X, variant: "tertiary", children: /* @__PURE__ */ s("span", { className: o.text, children: l.render(h) }) }) }),
199
+ E && l && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(z, { "aria-label": L(l.render(b)) || b, className: o.option, onClick: X, variant: "tertiary", children: /* @__PURE__ */ s("span", { className: o.text, children: l.render(b) }) }) }),
200
200
  H.length === 0 && !E && /* @__PURE__ */ s("li", { className: o.empty, children: n })
201
201
  ] })
202
202
  ] })
203
203
  ] });
204
- return a ? /* @__PURE__ */ p("div", { className: V(o.label, y === "inline" && o["inline-field"]), "data-component": "dropdown", children: [
205
- /* @__PURE__ */ s("span", { id: x, children: ae }),
204
+ return a ? /* @__PURE__ */ p("div", { className: V(o.label, _ === "inline" && o["inline-field"]), "data-component": "dropdown", children: [
205
+ /* @__PURE__ */ s("span", { id: w, children: ae }),
206
206
  Y
207
207
  ] }) : Y;
208
208
  };