@solibo/solibo-ui 2.0.3 → 2.1.1

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 (156) hide show
  1. package/README.md +4 -4
  2. package/dist/assets/index.css +1 -1
  3. package/dist/assets/index13.css +1 -1
  4. package/dist/assets/index14.css +1 -1
  5. package/dist/assets/index16.css +1 -1
  6. package/dist/assets/index18.css +1 -1
  7. package/dist/assets/index19.css +1 -1
  8. package/dist/assets/index2.css +1 -1
  9. package/dist/assets/index28.css +1 -1
  10. package/dist/assets/index29.css +1 -1
  11. package/dist/assets/index31.css +1 -1
  12. package/dist/assets/index35.css +1 -1
  13. package/dist/assets/index36.css +1 -1
  14. package/dist/assets/index37.css +1 -1
  15. package/dist/assets/index38.css +1 -1
  16. package/dist/assets/index39.css +1 -1
  17. package/dist/assets/index40.css +1 -1
  18. package/dist/assets/index41.css +1 -1
  19. package/dist/assets/index42.css +1 -1
  20. package/dist/assets/index43.css +1 -1
  21. package/dist/assets/index44.css +1 -1
  22. package/dist/assets/index45.css +1 -1
  23. package/dist/assets/index46.css +1 -1
  24. package/dist/assets/index47.css +1 -1
  25. package/dist/assets/index48.css +1 -1
  26. package/dist/assets/index49.css +1 -1
  27. package/dist/assets/index50.css +1 -1
  28. package/dist/assets/index51.css +1 -1
  29. package/dist/assets/index52.css +1 -1
  30. package/dist/assets/index53.css +1 -1
  31. package/dist/assets/index54.css +1 -1
  32. package/dist/assets/index55.css +1 -0
  33. package/dist/assets/index6.css +1 -1
  34. package/dist/assets/menu-popover.css +1 -1
  35. package/dist/components/badge/index.cjs +1 -1
  36. package/dist/components/badge/index.js +38 -38
  37. package/dist/components/banner/index.cjs +1 -1
  38. package/dist/components/banner/index.js +12 -12
  39. package/dist/components/button/index.cjs +1 -1
  40. package/dist/components/button/index.js +29 -29
  41. package/dist/components/checkbox/index.cjs +1 -1
  42. package/dist/components/checkbox/index.js +1 -1
  43. package/dist/components/clipboard/index.cjs +2 -0
  44. package/dist/components/clipboard/index.cjs.map +1 -0
  45. package/dist/components/clipboard/index.js +29 -0
  46. package/dist/components/clipboard/index.js.map +1 -0
  47. package/dist/components/collapsible/index.cjs +1 -1
  48. package/dist/components/collapsible/index.js +1 -1
  49. package/dist/components/controls/index.cjs +1 -1
  50. package/dist/components/controls/index.js +2 -2
  51. package/dist/components/croppable/index.cjs +1 -1
  52. package/dist/components/croppable/index.js +1 -1
  53. package/dist/components/dialog/index.cjs +1 -1
  54. package/dist/components/dialog/index.js +35 -35
  55. package/dist/components/divider/index.cjs +1 -1
  56. package/dist/components/divider/index.js +3 -3
  57. package/dist/components/dropdown/index.cjs +1 -1
  58. package/dist/components/dropdown/index.js +61 -61
  59. package/dist/components/dropzone/index.cjs +1 -1
  60. package/dist/components/dropzone/index.js +1 -1
  61. package/dist/components/editor/index.cjs +1 -1
  62. package/dist/components/editor/index.js +2 -2
  63. package/dist/components/empty-state/index.cjs +1 -1
  64. package/dist/components/empty-state/index.cjs.map +1 -1
  65. package/dist/components/empty-state/index.js +18 -13
  66. package/dist/components/empty-state/index.js.map +1 -1
  67. package/dist/components/fieldset/index.cjs +1 -1
  68. package/dist/components/fieldset/index.js +4 -4
  69. package/dist/components/figure/index.cjs +1 -1
  70. package/dist/components/figure/index.js +1 -1
  71. package/dist/components/file/index.cjs +1 -1
  72. package/dist/components/file/index.js +1 -1
  73. package/dist/components/group/index.cjs +1 -1
  74. package/dist/components/group/index.js +3 -3
  75. package/dist/components/header/index.cjs +1 -1
  76. package/dist/components/header/index.cjs.map +1 -1
  77. package/dist/components/header/index.js +22 -22
  78. package/dist/components/icon/index.cjs +1 -1
  79. package/dist/components/icon/index.cjs.map +1 -1
  80. package/dist/components/icon/index.js +28 -26
  81. package/dist/components/icon/index.js.map +1 -1
  82. package/dist/components/iframe/index.cjs +1 -1
  83. package/dist/components/iframe/index.cjs.map +1 -1
  84. package/dist/components/iframe/index.js +45 -44
  85. package/dist/components/iframe/index.js.map +1 -1
  86. package/dist/components/input/index.cjs +1 -1
  87. package/dist/components/input/index.js +2 -2
  88. package/dist/components/link/index.cjs +1 -1
  89. package/dist/components/link/index.js +1 -1
  90. package/dist/components/list/index.cjs +1 -1
  91. package/dist/components/list/index.cjs.map +1 -1
  92. package/dist/components/list/index.js +72 -44
  93. package/dist/components/list/index.js.map +1 -1
  94. package/dist/components/loading/index.cjs +1 -1
  95. package/dist/components/loading/index.js +1 -1
  96. package/dist/components/menu/index.cjs +1 -1
  97. package/dist/components/menu/index.cjs.map +1 -1
  98. package/dist/components/menu/index.js +23 -22
  99. package/dist/components/menu/index.js.map +1 -1
  100. package/dist/components/message/index.cjs +1 -1
  101. package/dist/components/message/index.cjs.map +1 -1
  102. package/dist/components/message/index.js +33 -33
  103. package/dist/components/message/index.js.map +1 -1
  104. package/dist/components/messages/index.cjs +1 -1
  105. package/dist/components/messages/index.js +13 -13
  106. package/dist/components/nav/index.cjs +1 -1
  107. package/dist/components/nav/index.js +36 -36
  108. package/dist/components/popover/index.cjs +1 -1
  109. package/dist/components/popover/index.cjs.map +1 -1
  110. package/dist/components/popover/index.js +81 -69
  111. package/dist/components/popover/index.js.map +1 -1
  112. package/dist/components/search/index.cjs +1 -1
  113. package/dist/components/search/index.js +1 -1
  114. package/dist/components/select/index.cjs +1 -1
  115. package/dist/components/select/index.js +2 -2
  116. package/dist/components/sortable/index.cjs.map +1 -1
  117. package/dist/components/sortable/index.js.map +1 -1
  118. package/dist/components/table/index.cjs.map +1 -1
  119. package/dist/components/table/index.js.map +1 -1
  120. package/dist/components/textarea/index.cjs +1 -1
  121. package/dist/components/textarea/index.js +12 -12
  122. package/dist/components/toolbar/index.cjs +1 -1
  123. package/dist/components/toolbar/index.js +1 -1
  124. package/dist/components/widget/index.cjs +1 -1
  125. package/dist/components/widget/index.cjs.map +1 -1
  126. package/dist/components/widget/index.js +13 -8
  127. package/dist/components/widget/index.js.map +1 -1
  128. package/dist/icons-B3hIY9Bm.cjs +2 -0
  129. package/dist/icons-B3hIY9Bm.cjs.map +1 -0
  130. package/dist/{icons-dUP7sKyt.js → icons-CTtWkF6z.js} +45 -7
  131. package/dist/icons-CTtWkF6z.js.map +1 -0
  132. package/dist/{index-BLb3JiCr.js → index-BIpgkB-u.js} +3 -3
  133. package/dist/{index-BLb3JiCr.js.map → index-BIpgkB-u.js.map} +1 -1
  134. package/dist/{index-DWDp66fp.cjs → index-Bbauu1No.cjs} +2 -2
  135. package/dist/{index-DWDp66fp.cjs.map → index-Bbauu1No.cjs.map} +1 -1
  136. package/dist/{index-Ds-Ocs4L.js → index-CMPTHneU.js} +3 -3
  137. package/dist/{index-Ds-Ocs4L.js.map → index-CMPTHneU.js.map} +1 -1
  138. package/dist/{index-Bt7vnwji.cjs → index-DAjU2bTe.cjs} +2 -2
  139. package/dist/{index-Bt7vnwji.cjs.map → index-DAjU2bTe.cjs.map} +1 -1
  140. package/dist/index.cjs +1 -1
  141. package/dist/index.d.ts +56 -7
  142. package/dist/index.js +97 -95
  143. package/dist/index.js.map +1 -1
  144. package/dist/menu-popover-BV7nUXlb.js +77 -0
  145. package/dist/menu-popover-BV7nUXlb.js.map +1 -0
  146. package/dist/menu-popover-fGpFDJTo.cjs +2 -0
  147. package/dist/menu-popover-fGpFDJTo.cjs.map +1 -0
  148. package/dist/tokens.json +1 -1
  149. package/package.json +2 -1
  150. package/dist/icons-Dv_p0bUF.cjs +0 -2
  151. package/dist/icons-Dv_p0bUF.cjs.map +0 -1
  152. package/dist/icons-dUP7sKyt.js.map +0 -1
  153. package/dist/menu-popover-CM3v5s-5.cjs +0 -2
  154. package/dist/menu-popover-CM3v5s-5.cjs.map +0 -1
  155. package/dist/menu-popover-DOkciab5.js +0 -74
  156. package/dist/menu-popover-DOkciab5.js.map +0 -1
@@ -1,45 +1,45 @@
1
- import { jsxs as n, jsx as l } from "react/jsx-runtime";
1
+ import { jsxs as n, jsx as _ } from "react/jsx-runtime";
2
2
  import { t } from "../../classix-DG18itHa.js";
3
- import { Icon as a } from "../icon/index.js";
4
- import '../../assets/index28.css';const i = "_badge_1r0jb_1", b = "_highlight_1r0jb_19", g = "_info_1r0jb_25", j = "_primary_1r0jb_30", m = "_success_1r0jb_35", h = "_warning_1r0jb_40", r = {
3
+ import { Icon as e } from "../icon/index.js";
4
+ import '../../assets/index28.css';const i = "_badge_1w0ss_1", g = "_highlight_1w0ss_20", w = "_info_1w0ss_26", m = "_primary_1w0ss_31", h = "_success_1w0ss_36", p = "_warning_1w0ss_41", s = {
5
5
  badge: i,
6
- highlight: b,
7
- info: g,
8
- primary: j,
9
- success: m,
10
- warning: h,
11
- "color-1": "_color-1_1r0jb_45",
12
- "color-2": "_color-2_1r0jb_50",
13
- "color-yellow": "_color-yellow_1r0jb_51",
14
- "color-3": "_color-3_1r0jb_56",
15
- "color-peach": "_color-peach_1r0jb_57",
16
- "color-4": "_color-4_1r0jb_62",
17
- "color-magenta": "_color-magenta_1r0jb_63",
18
- "color-5": "_color-5_1r0jb_68",
19
- "color-purple": "_color-purple_1r0jb_69",
20
- "color-6": "_color-6_1r0jb_74",
21
- "color-blue": "_color-blue_1r0jb_75",
22
- "color-7": "_color-7_1r0jb_80",
23
- "color-green": "_color-green_1r0jb_81"
24
- }, p = {
25
- default: r.default,
26
- highlight: r.highlight,
27
- info: r.info,
28
- primary: r.primary,
29
- success: r.success,
30
- warning: r.warning
31
- }, y = ({
32
- color: c,
33
- children: _,
6
+ highlight: g,
7
+ info: w,
8
+ primary: m,
9
+ success: h,
10
+ warning: p,
11
+ "color-1": "_color-1_1w0ss_46",
12
+ "color-2": "_color-2_1w0ss_51",
13
+ "color-yellow": "_color-yellow_1w0ss_52",
14
+ "color-3": "_color-3_1w0ss_57",
15
+ "color-peach": "_color-peach_1w0ss_58",
16
+ "color-4": "_color-4_1w0ss_63",
17
+ "color-magenta": "_color-magenta_1w0ss_64",
18
+ "color-5": "_color-5_1w0ss_69",
19
+ "color-purple": "_color-purple_1w0ss_70",
20
+ "color-6": "_color-6_1w0ss_75",
21
+ "color-blue": "_color-blue_1w0ss_76",
22
+ "color-7": "_color-7_1w0ss_81",
23
+ "color-green": "_color-green_1w0ss_82"
24
+ }, u = {
25
+ default: s.default,
26
+ highlight: s.highlight,
27
+ info: s.info,
28
+ primary: s.primary,
29
+ success: s.success,
30
+ warning: s.warning
31
+ }, b = ({
32
+ color: l,
33
+ children: r,
34
34
  icon: o,
35
- position: e = "left",
36
- variant: s = "default"
37
- }) => _ === 0 || _ == null ? null : /* @__PURE__ */ n("span", { className: t(r.badge, p[s], c && r[`color-${c}`]), "data-component": "badge", children: [
38
- o && e == "left" && /* @__PURE__ */ l(a, { name: o, size: "small" }),
39
- /* @__PURE__ */ l("span", { children: _ }),
40
- o && e == "right" && /* @__PURE__ */ l(a, { name: o, size: "small" })
35
+ position: c = "left",
36
+ variant: a = "default"
37
+ }) => r === 0 || r == null ? null : /* @__PURE__ */ n("span", { className: t(s.badge, u[a], l && s[`color-${l}`]), "data-component": "badge", children: [
38
+ o && c == "left" && /* @__PURE__ */ _(e, { name: o, size: "small" }),
39
+ /* @__PURE__ */ _("span", { children: r }),
40
+ o && c == "right" && /* @__PURE__ */ _(e, { name: o, size: "small" })
41
41
  ] });
42
42
  export {
43
- y as Badge
43
+ b as Badge
44
44
  };
45
45
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index29.css');const t=require("react/jsx-runtime"),l=require("../../classix-5H4IWnMA.cjs"),b=require("../button/index.cjs"),u="_banner_1au2i_13",o="_visible_1au2i_32",r={banner:u,visible:o},d=({button:a,message:s,onClick:e,onDismiss:n,visible:i=!1})=>{const c=()=>{e==null||e(),n==null||n()};return t.jsxs("div",{"aria-live":"assertive",className:l.t(r.banner,i&&r.visible),"data-component":"banner",children:[s,t.jsx(b.Button,{onClick:c,children:a})]})};exports.Banner=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index29.css');const t=require("react/jsx-runtime"),c=require("../../classix-5H4IWnMA.cjs"),i=require("../button/index.cjs"),o="_banner_hqbfl_13",u="_visible_hqbfl_32",r={banner:o,visible:u},d=({button:a,message:s,onClick:e,onDismiss:n,visible:l=!1})=>{const b=()=>{e==null||e(),n==null||n()};return t.jsxs("div",{"aria-live":"assertive",className:c.t(r.banner,l&&r.visible),"data-component":"banner",children:[s,t.jsx(i.Button,{onClick:b,children:a})]})};exports.Banner=d;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,25 +1,25 @@
1
- import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
- import { t as c } from "../../classix-DG18itHa.js";
1
+ import { jsxs as o, jsx as c } from "react/jsx-runtime";
2
+ import { t as i } from "../../classix-DG18itHa.js";
3
3
  import { Button as s } from "../button/index.js";
4
- import '../../assets/index29.css';const v = "_banner_1au2i_13", _ = "_visible_1au2i_32", a = {
4
+ import '../../assets/index29.css';const v = "_banner_hqbfl_13", f = "_visible_hqbfl_32", n = {
5
5
  banner: v,
6
- visible: _
7
- }, m = ({
8
- button: n,
9
- message: t,
6
+ visible: f
7
+ }, p = ({
8
+ button: t,
9
+ message: a,
10
10
  onClick: e,
11
11
  onDismiss: r,
12
12
  visible: b = !1
13
13
  }) => {
14
- const i = () => {
14
+ const l = () => {
15
15
  e == null || e(), r == null || r();
16
16
  };
17
- return /* @__PURE__ */ l("div", { "aria-live": "assertive", className: c(a.banner, b && a.visible), "data-component": "banner", children: [
18
- t,
19
- /* @__PURE__ */ o(s, { onClick: i, children: n })
17
+ return /* @__PURE__ */ o("div", { "aria-live": "assertive", className: i(n.banner, b && n.visible), "data-component": "banner", children: [
18
+ a,
19
+ /* @__PURE__ */ c(s, { onClick: l, children: t })
20
20
  ] });
21
21
  };
22
22
  export {
23
- m as Banner
23
+ p as Banner
24
24
  };
25
25
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index31.css');const t=require("react/jsx-runtime"),g=require("../../classix-5H4IWnMA.cjs"),y=require("../loading/index.cjs"),p=require("../badge/index.cjs"),q=require("../icon/index.cjs"),b="_button_qo4o4_1",x="_large_qo4o4_20",j="_small_qo4o4_24",f="_danger_qo4o4_34",h="_simple_qo4o4_40",v="_primary_qo4o4_49",B="_secondary_qo4o4_58",S="_tertiary_qo4o4_81",e={button:b,large:x,small:j,danger:f,simple:h,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:r,children:s,className:a,disabled:i=!1,icon:n,intent:l="default",isLoading:m=!1,onClick:c,ref:_,size:o="medium",variant:d="secondary",...u}){return t.jsxs("button",{className:g.t(e.button,z[d],I[o],a,l==="danger"&&e.danger),disabled:i,onClick:c,ref:_,type:"button",...u,"data-component":"button",children:[m?t.jsx(y.Loading,{size:o==="large"?"medium":"small"}):n&&t.jsx(q.Icon,{name:n,size:o==="large"?"medium":"small"}),s,t.jsx(p.Badge,{variant:"highlight",children:r})]})}exports.Button=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index31.css');const t=require("react/jsx-runtime"),g=require("../../classix-5H4IWnMA.cjs"),y=require("../loading/index.cjs"),p=require("../badge/index.cjs"),b=require("../icon/index.cjs"),x="_button_53369_3",j="_large_53369_22",f="_small_53369_26",h="_danger_53369_36",q="_simple_53369_42",v="_primary_53369_51",B="_secondary_53369_62",S="_tertiary_53369_89",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:a,className:o,disabled:i=!1,icon:r,intent:l="default",isLoading:m=!1,onClick:c,ref:_,size:n="medium",variant:d="secondary",...u}){return t.jsxs("button",{className:g.t(e.button,z[d],I[n],o,l==="danger"&&e.danger),disabled:i,onClick:c,ref:_,type:"button",...u,"data-component":"button",children:[m?t.jsx(y.Loading,{size:n==="large"?"medium":"small"}):r&&t.jsx(b.Icon,{name:r,size:n==="large"?"medium":"small"}),a,t.jsx(p.Badge,{variant:"highlight",children:s})]})}exports.Button=L;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,45 +1,45 @@
1
- import { jsxs as y, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as y, jsx as a } from "react/jsx-runtime";
2
2
  import { t as g } from "../../classix-DG18itHa.js";
3
3
  import { Loading as u } from "../loading/index.js";
4
4
  import { Badge as f } from "../badge/index.js";
5
- import { Icon as q } from "../icon/index.js";
6
- import '../../assets/index31.css';const b = "_button_qo4o4_1", h = "_large_qo4o4_20", x = "_small_qo4o4_24", j = "_danger_qo4o4_34", v = "_simple_qo4o4_40", B = "_primary_qo4o4_49", z = "_secondary_qo4o4_58", I = "_tertiary_qo4o4_81", o = {
7
- button: b,
8
- large: h,
9
- small: x,
10
- danger: j,
11
- simple: v,
12
- primary: B,
13
- secondary: z,
14
- tertiary: I
15
- }, L = {
16
- primary: o.primary,
17
- secondary: o.secondary,
18
- simple: o.simple,
19
- tertiary: o.tertiary
5
+ import { Icon as b } from "../icon/index.js";
6
+ import '../../assets/index31.css';const h = "_button_53369_3", x = "_large_53369_22", j = "_small_53369_26", v = "_danger_53369_36", B = "_simple_53369_42", z = "_primary_53369_51", I = "_secondary_53369_62", L = "_tertiary_53369_89", 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
20
15
  }, N = {
21
- large: o.large,
22
- medium: o.medium,
23
- small: o.small
16
+ primary: r.primary,
17
+ secondary: r.secondary,
18
+ simple: r.simple,
19
+ tertiary: r.tertiary
20
+ }, k = {
21
+ large: r.large,
22
+ medium: r.medium,
23
+ small: r.small
24
24
  };
25
25
  function E({
26
- badge: e,
27
- children: n,
28
- className: s,
29
- disabled: m = !1,
30
- icon: a,
26
+ badge: n,
27
+ children: s,
28
+ className: m,
29
+ disabled: o = !1,
30
+ icon: e,
31
31
  intent: l = "default",
32
32
  isLoading: i = !1,
33
33
  onClick: _,
34
34
  ref: c,
35
- size: r = "medium",
35
+ size: t = "medium",
36
36
  variant: d = "secondary",
37
37
  ...p
38
38
  }) {
39
- return /* @__PURE__ */ y("button", { className: g(o.button, L[d], N[r], s, l === "danger" && o.danger), disabled: m, onClick: _, ref: c, type: "button", ...p, "data-component": "button", children: [
40
- i ? /* @__PURE__ */ t(u, { size: r === "large" ? "medium" : "small" }) : a && /* @__PURE__ */ t(q, { name: a, size: r === "large" ? "medium" : "small" }),
41
- n,
42
- /* @__PURE__ */ t(f, { variant: "highlight", children: e })
39
+ return /* @__PURE__ */ y("button", { className: g(r.button, N[d], k[t], m, l === "danger" && r.danger), disabled: o, onClick: _, ref: c, type: "button", ...p, "data-component": "button", children: [
40
+ i ? /* @__PURE__ */ a(u, { size: t === "large" ? "medium" : "small" }) : e && /* @__PURE__ */ a(b, { name: e, size: t === "large" ? "medium" : "small" }),
41
+ s,
42
+ /* @__PURE__ */ a(f, { variant: "highlight", children: n })
43
43
  ] });
44
44
  }
45
45
  export {
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index33.css');const e=require("react/jsx-runtime"),x=require("../../icons-Dv_p0bUF.cjs"),b=require("../loading/index.cjs"),h="_checkbox_qf257_3",l={checkbox:h},a=({checked:s,disabled:t,isLoading:c,label:o,onChange:n,...i})=>{const r={"--icon-svg":x.iconSVG("Check")};return e.jsxs("label",{className:l.checkbox,"data-component":"checkbox",children:[e.jsx("input",{checked:s,disabled:t||c,onChange:n,type:"checkbox",style:r,...i}),c&&e.jsx(b.Loading,{size:"small",sticky:!0}),o&&o]})};exports.Checkbox=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index33.css');const e=require("react/jsx-runtime"),x=require("../../icons-B3hIY9Bm.cjs"),b=require("../loading/index.cjs"),h="_checkbox_qf257_3",l={checkbox:h},a=({checked:s,disabled:t,isLoading:c,label:o,onChange:n,...i})=>{const r={"--icon-svg":x.iconSVG("Check")};return e.jsxs("label",{className:l.checkbox,"data-component":"checkbox",children:[e.jsx("input",{checked:s,disabled:t||c,onChange:n,type:"checkbox",style:r,...i}),c&&e.jsx(b.Loading,{size:"small",sticky:!0}),o&&o]})};exports.Checkbox=a;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,5 @@
1
1
  import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
- import { i as x } from "../../icons-dUP7sKyt.js";
2
+ import { i as x } from "../../icons-CTtWkF6z.js";
3
3
  import { Loading as k } from "../loading/index.js";
4
4
  import '../../assets/index33.css';const m = "_checkbox_qf257_3", a = {
5
5
  checkbox: m
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index35.css');const t=require("react/jsx-runtime"),l=require("../icon/index.cjs"),s="_clipboard_1npqh_1",d="_label_1npqh_9",c={clipboard:s,label:d},p=({label:o,onSuccess:a})=>{const i=async()=>{if(navigator.clipboard)return navigator.clipboard.writeText(o);const e=document.createElement("textarea");e.value=o,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();const r=document.execCommand("copy");if(e.remove(),!r)throw new Error("Unable to copy text to clipboard")},n=()=>{i().then(()=>a())};return t.jsxs("span",{className:c.clipboard,onClick:n,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),n())},role:"button",tabIndex:0,"data-component":"clipboard",children:[t.jsx("span",{className:c.label,children:o}),t.jsx(l.Icon,{name:"Copy",size:"small"})]})};exports.Clipboard=p;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/clipboard/index.tsx"],"sourcesContent":["import { Icon } from '@/components/icon';\n\nimport styles from './styles.module.css';\n\nexport type ClipboardProps = {\n label: string;\n onSuccess: () => void;\n};\n\nexport const Clipboard = ({ label, onSuccess }: ClipboardProps) => {\n const copyText = async () => {\n if (navigator.clipboard) return navigator.clipboard.writeText(label);\n\n const input = document.createElement('textarea');\n input.value = label;\n input.style.position = 'fixed';\n input.style.opacity = '0';\n document.body.appendChild(input);\n input.select();\n const copied = document.execCommand('copy');\n input.remove();\n\n if (!copied) throw new Error('Unable to copy text to clipboard');\n };\n\n const handleClick = () => {\n void copyText().then(() => onSuccess());\n };\n\n return (\n <span\n className={styles.clipboard}\n onClick={handleClick}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleClick();\n }\n }}\n role='button'\n tabIndex={0}\n >\n <span className={styles.label}>{label}</span>\n <Icon\n name='Copy'\n size='small'\n />\n </span>\n );\n};\n"],"names":["Clipboard","label","onSuccess","copyText","navigator","clipboard","writeText","input","document","createElement","value","style","position","opacity","body","appendChild","select","copied","execCommand","remove","Error","handleClick","then","jsxs","styles","e","key","preventDefault","jsx","Icon"],"mappings":"sNASaA,EAAYA,CAAC,CAAEC,MAAAA,EAAOC,UAAAA,CAA0B,IAAM,CACjE,MAAMC,EAAW,SAAY,CAC3B,GAAIC,UAAUC,UAAW,OAAOD,UAAUC,UAAUC,UAAUL,CAAK,EAEnE,MAAMM,EAAQC,SAASC,cAAc,UAAU,EAC/CF,EAAMG,MAAQT,EACdM,EAAMI,MAAMC,SAAW,QACvBL,EAAMI,MAAME,QAAU,IACtBL,SAASM,KAAKC,YAAYR,CAAK,EAC/BA,EAAMS,OAAAA,EACN,MAAMC,EAAST,SAASU,YAAY,MAAM,EAG1C,GAFAX,EAAMY,OAAAA,EAEF,CAACF,EAAQ,MAAM,IAAIG,MAAM,kCAAkC,CACjE,EAEMC,EAAcA,IAAM,CACnBlB,EAAAA,EAAWmB,KAAK,IAAMpB,GAAW,CACxC,EAEA,OACEqB,OAAC,QACC,UAAWC,EAAOnB,UAClB,QAASgB,EACT,UAAYI,GAAM,EACZA,EAAEC,MAAQ,SAAWD,EAAEC,MAAQ,OACjCD,EAAEE,eAAAA,EACFN,EAAAA,EAEJ,EACA,KAAK,SACL,SAAU,EAAE,iBAAA,YAEZ,SAAA,CAAAO,EAAAA,IAAC,OAAA,CAAK,UAAWJ,EAAOvB,MAAQA,SAAAA,EAAM,EACtC2B,EAAAA,IAACC,EAAAA,KAAA,CACC,KAAK,OACL,KAAK,OAAA,CAAO,CAAA,EAEhB,CAEJ"}
@@ -0,0 +1,29 @@
1
+ import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
+ import { Icon as p } from "../icon/index.js";
3
+ import '../../assets/index35.css';const s = "_clipboard_1npqh_1", d = "_label_1npqh_9", a = {
4
+ clipboard: s,
5
+ label: d
6
+ }, y = ({
7
+ label: e,
8
+ onSuccess: c
9
+ }) => {
10
+ const r = async () => {
11
+ if (navigator.clipboard) return navigator.clipboard.writeText(e);
12
+ const o = document.createElement("textarea");
13
+ o.value = e, o.style.position = "fixed", o.style.opacity = "0", document.body.appendChild(o), o.select();
14
+ const l = document.execCommand("copy");
15
+ if (o.remove(), !l) throw new Error("Unable to copy text to clipboard");
16
+ }, t = () => {
17
+ r().then(() => c());
18
+ };
19
+ return /* @__PURE__ */ i("span", { className: a.clipboard, onClick: t, onKeyDown: (o) => {
20
+ (o.key === "Enter" || o.key === " ") && (o.preventDefault(), t());
21
+ }, role: "button", tabIndex: 0, "data-component": "clipboard", children: [
22
+ /* @__PURE__ */ n("span", { className: a.label, children: e }),
23
+ /* @__PURE__ */ n(p, { name: "Copy", size: "small" })
24
+ ] });
25
+ };
26
+ export {
27
+ y as Clipboard
28
+ };
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/clipboard/index.tsx"],"sourcesContent":["import { Icon } from '@/components/icon';\n\nimport styles from './styles.module.css';\n\nexport type ClipboardProps = {\n label: string;\n onSuccess: () => void;\n};\n\nexport const Clipboard = ({ label, onSuccess }: ClipboardProps) => {\n const copyText = async () => {\n if (navigator.clipboard) return navigator.clipboard.writeText(label);\n\n const input = document.createElement('textarea');\n input.value = label;\n input.style.position = 'fixed';\n input.style.opacity = '0';\n document.body.appendChild(input);\n input.select();\n const copied = document.execCommand('copy');\n input.remove();\n\n if (!copied) throw new Error('Unable to copy text to clipboard');\n };\n\n const handleClick = () => {\n void copyText().then(() => onSuccess());\n };\n\n return (\n <span\n className={styles.clipboard}\n onClick={handleClick}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleClick();\n }\n }}\n role='button'\n tabIndex={0}\n >\n <span className={styles.label}>{label}</span>\n <Icon\n name='Copy'\n size='small'\n />\n </span>\n );\n};\n"],"names":["Clipboard","label","onSuccess","copyText","navigator","clipboard","writeText","input","document","createElement","value","style","position","opacity","body","appendChild","select","copied","execCommand","remove","Error","handleClick","then","jsxs","styles","e","key","preventDefault","jsx","Icon"],"mappings":";;;;;GASaA,IAAYA,CAAC;AAAA,EAAEC,OAAAA;AAAAA,EAAOC,WAAAA;AAA0B,MAAM;AACjE,QAAMC,IAAW,YAAY;AAC3B,QAAIC,UAAUC,UAAW,QAAOD,UAAUC,UAAUC,UAAUL,CAAK;AAEnE,UAAMM,IAAQC,SAASC,cAAc,UAAU;AAC/CF,IAAAA,EAAMG,QAAQT,GACdM,EAAMI,MAAMC,WAAW,SACvBL,EAAMI,MAAME,UAAU,KACtBL,SAASM,KAAKC,YAAYR,CAAK,GAC/BA,EAAMS,OAAAA;AACN,UAAMC,IAAST,SAASU,YAAY,MAAM;AAG1C,QAFAX,EAAMY,OAAAA,GAEF,CAACF,EAAQ,OAAM,IAAIG,MAAM,kCAAkC;AAAA,EACjE,GAEMC,IAAcA,MAAM;AACxB,IAAKlB,EAAAA,EAAWmB,KAAK,MAAMpB,GAAW;AAAA,EACxC;AAEA,SACE,gBAAAqB,EAAC,UACC,WAAWC,EAAOnB,WAClB,SAASgB,GACT,WAAYI,CAAAA,MAAM;AAChB,KAAIA,EAAEC,QAAQ,WAAWD,EAAEC,QAAQ,SACjCD,EAAEE,eAAAA,GACFN,EAAAA;AAAAA,EAEJ,GACA,MAAK,UACL,UAAU,GAAE,kBAAA,aAEZ,UAAA;AAAA,IAAA,gBAAAO,EAAC,QAAA,EAAK,WAAWJ,EAAOvB,OAAQA,UAAAA,GAAM;AAAA,IACtC,gBAAA2B,EAACC,GAAA,EACC,MAAK,QACL,MAAK,QAAA,CAAO;AAAA,EAAA,GAEhB;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index35.css');const n=require("react/jsx-runtime"),l=require("../icon/index.cjs"),a="_collapsible_1nzgt_1",i="_content_1nzgt_12",r="_indicator_1nzgt_16",e={collapsible:a,content:i,indicator:r},d=({children:o,disabled:t,open:s,summary:c})=>n.jsxs("details",{className:e.collapsible,open:t||s||void 0,"data-component":"collapsible",children:[n.jsxs("summary",{children:[n.jsx("span",{className:e.content,"data-content":"collapsible-summary",children:c}),!t&&n.jsx("span",{className:e.indicator,"data-content":"collapsible-indicator",children:n.jsx(l.Icon,{name:"CaretDown",size:"medium"})})]}),o]});exports.Collapsible=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index36.css');const n=require("react/jsx-runtime"),l=require("../icon/index.cjs"),a="_collapsible_1nzgt_1",i="_content_1nzgt_12",r="_indicator_1nzgt_16",e={collapsible:a,content:i,indicator:r},d=({children:o,disabled:t,open:s,summary:c})=>n.jsxs("details",{className:e.collapsible,open:t||s||void 0,"data-component":"collapsible",children:[n.jsxs("summary",{children:[n.jsx("span",{className:e.content,"data-content":"collapsible-summary",children:c}),!t&&n.jsx("span",{className:e.indicator,"data-content":"collapsible-indicator",children:n.jsx(l.Icon,{name:"CaretDown",size:"medium"})})]}),o]});exports.Collapsible=d;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,6 +1,6 @@
1
1
  import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
2
  import { Icon as s } from "../icon/index.js";
3
- import '../../assets/index35.css';const i = "_collapsible_1nzgt_1", r = "_content_1nzgt_12", m = "_indicator_1nzgt_16", t = {
3
+ import '../../assets/index36.css';const i = "_collapsible_1nzgt_1", r = "_content_1nzgt_12", m = "_indicator_1nzgt_16", t = {
4
4
  collapsible: i,
5
5
  content: r,
6
6
  indicator: m
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index36.css');const b=require("react/jsx-runtime"),Z=require("../../classix-5H4IWnMA.cjs"),l=require("react"),ee=require("../button/index.cjs"),A=require("../../menu-popover-CM3v5s-5.cjs"),te="_controls_t1re6_13",ne="_inline_t1re6_43",ie="_embedded_t1re6_48",re="_fixed_t1re6_49",oe="_adaptive_t1re6_60",se="_measurement_t1re6_65",h={controls:te,default:"_default_t1re6_28",inline:ne,embedded:ie,fixed:re,adaptive:oe,measurement:se,"non-button-content":"_non-button-content_t1re6_99","overflow-trigger":"_overflow-trigger_t1re6_128"},de={primary:2,secondary:1,tertiary:0,simple:0},ce={default:h.default,embedded:h.embedded,fixed:h.fixed,inline:h.inline},ae=s=>de[s.props.variant??"secondary"];function le({buttons:s,menuAccessibleLabel:i,triggerAccessibleLabel:n}){const x=s.map(o=>({button:o,isDanger:o.props.intent==="danger",value:o}));return b.jsx(A.MenuPopover,{triggerAccessibleLabel:n,"data-component":"overflowmenu",children:({close:o,initialFocus:r})=>b.jsx(A.MenuActionList,{actions:x,initialFocus:r,menuAccessibleLabel:i,onSelect:()=>o(),usesMenuSemantics:!0})})}const p=(s,i)=>{const n=Number.parseFloat(String(s[i]));return Number.isFinite(n)?n:0},ue=s=>{if(!s.trim().endsWith("px"))return;const i=Number.parseFloat(s);return Number.isFinite(i)?i:void 0},me=(s,i)=>{const n=s.parentElement;if(!n)return;const x=n.getBoundingClientRect(),o=getComputedStyle(n),r=x.width||n.clientWidth,S=x.left+p(o,"borderLeftWidth")+p(o,"paddingLeft"),M=x.left+r-p(o,"borderRightWidth")-p(o,"paddingRight"),_=Array.from(n.children).slice(0,Array.from(n.children).indexOf(s)),y=_.reduce((f,u)=>Math.max(f,u.getBoundingClientRect().right),S),c=_.length>0?p(o,"columnGap"):0,a=Math.max(0,M-y-c),R=(i==null?void 0:i.parent)===n?Math.max(0,r-i.parentWidth):0;return{availableWidth:R>0?Math.max(a,((i==null?void 0:i.availableWidth)??0)+R):a,parent:n,parentWidth:r}},fe=({children:s,className:i,maxVisibleButtons:n,overflow:x,overflowAccessibleLabel:o="More actions",variant:r="default",...S})=>{const M=l.Children.toArray(s),_=[],y=[];M.forEach(e=>{l.isValidElement(e)&&e.type===ee.Button?_.push(e):y.push(e)});const c=_.map((e,d)=>({button:e,index:d,rank:ae(e)})).sort((e,d)=>e.rank-d.rank||e.index-d.index).map(({button:e,index:d})=>l.cloneElement(e,{key:e.key??d})),a=r==="embedded"||r==="fixed"&&x==="menu",R=typeof n=="number"&&Number.isFinite(n)?Math.floor(n):0,f=r==="embedded"&&R>0?Math.min(c.length,R):c.length,u=l.useRef(null),N=l.useRef(void 0),z=l.useRef(null),E=l.useRef(null),[F,C]=l.useState(f),k=c.map(e=>String(e.key)).join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index37.css');const b=require("react/jsx-runtime"),Z=require("../../classix-5H4IWnMA.cjs"),l=require("react"),ee=require("../button/index.cjs"),A=require("../../menu-popover-fGpFDJTo.cjs"),te="_controls_t1re6_13",ne="_inline_t1re6_43",ie="_embedded_t1re6_48",re="_fixed_t1re6_49",oe="_adaptive_t1re6_60",se="_measurement_t1re6_65",h={controls:te,default:"_default_t1re6_28",inline:ne,embedded:ie,fixed:re,adaptive:oe,measurement:se,"non-button-content":"_non-button-content_t1re6_99","overflow-trigger":"_overflow-trigger_t1re6_128"},de={primary:2,secondary:1,tertiary:0,simple:0},ce={default:h.default,embedded:h.embedded,fixed:h.fixed,inline:h.inline},ae=s=>de[s.props.variant??"secondary"];function le({buttons:s,menuAccessibleLabel:i,triggerAccessibleLabel:n}){const x=s.map(o=>({button:o,isDanger:o.props.intent==="danger",value:o}));return b.jsx(A.MenuPopover,{triggerAccessibleLabel:n,"data-component":"overflowmenu",children:({close:o,initialFocus:r})=>b.jsx(A.MenuActionList,{actions:x,initialFocus:r,menuAccessibleLabel:i,onSelect:()=>o(),usesMenuSemantics:!0})})}const p=(s,i)=>{const n=Number.parseFloat(String(s[i]));return Number.isFinite(n)?n:0},ue=s=>{if(!s.trim().endsWith("px"))return;const i=Number.parseFloat(s);return Number.isFinite(i)?i:void 0},me=(s,i)=>{const n=s.parentElement;if(!n)return;const x=n.getBoundingClientRect(),o=getComputedStyle(n),r=x.width||n.clientWidth,S=x.left+p(o,"borderLeftWidth")+p(o,"paddingLeft"),M=x.left+r-p(o,"borderRightWidth")-p(o,"paddingRight"),_=Array.from(n.children).slice(0,Array.from(n.children).indexOf(s)),y=_.reduce((f,u)=>Math.max(f,u.getBoundingClientRect().right),S),c=_.length>0?p(o,"columnGap"):0,a=Math.max(0,M-y-c),R=(i==null?void 0:i.parent)===n?Math.max(0,r-i.parentWidth):0;return{availableWidth:R>0?Math.max(a,((i==null?void 0:i.availableWidth)??0)+R):a,parent:n,parentWidth:r}},fe=({children:s,className:i,maxVisibleButtons:n,overflow:x,overflowAccessibleLabel:o="More actions",variant:r="default",...S})=>{const M=l.Children.toArray(s),_=[],y=[];M.forEach(e=>{l.isValidElement(e)&&e.type===ee.Button?_.push(e):y.push(e)});const c=_.map((e,d)=>({button:e,index:d,rank:ae(e)})).sort((e,d)=>e.rank-d.rank||e.index-d.index).map(({button:e,index:d})=>l.cloneElement(e,{key:e.key??d})),a=r==="embedded"||r==="fixed"&&x==="menu",R=typeof n=="number"&&Number.isFinite(n)?Math.floor(n):0,f=r==="embedded"&&R>0?Math.min(c.length,R):c.length,u=l.useRef(null),N=l.useRef(void 0),z=l.useRef(null),E=l.useRef(null),[F,C]=l.useState(f),k=c.map(e=>String(e.key)).join(`
2
2
  `),[D,G]=l.useState(k);D!==k&&(G(k),C(f));const g=l.useCallback(()=>{var L,I,T;if(!a){C(f);return}const e=u.current,d=z.current;if(!e||!d)return;const W=Array.from(d.querySelectorAll('[data-component="button"]')),w=W.at(-1);if(!w)return;const v=W.slice(0,c.length).map(t=>t.getBoundingClientRect().width);if(v.length!==c.length)return;const m=getComputedStyle(e),H=p(m,"paddingLeft")+p(m,"paddingRight")+p(m,"borderLeftWidth")+p(m,"borderRightWidth"),J=ue(m.maxWidth),B=r==="embedded"?me(e,N.current):void 0;B&&(N.current=B);const Q=(B==null?void 0:B.availableWidth)??((L=e.parentElement)==null?void 0:L.clientWidth)??0,U=((I=window.visualViewport)==null?void 0:I.width)??document.documentElement.clientWidth,V=Math.min(...[J,Q,U].filter(t=>typeof t=="number"&&Number.isFinite(t)&&t>0));if(!Number.isFinite(V))return;const q=Math.max(0,V-H),P=((T=E.current)==null?void 0:T.getBoundingClientRect().width)??0,X=v.reduce((t,Y)=>t+Y,0);if(f===c.length&&P+X<=q){C(t=>t===f?t:f);return}let K=P+w.getBoundingClientRect().width,j=0;for(let t=0;t<f&&!(K+v[t]>q);t+=1)K+=v[t],j=t+1;C(t=>t===j?t:j)},[a,c.length,r,f]);if(l.useLayoutEffect(()=>{var d,W,w,v;if(g(),!a)return;const e=typeof ResizeObserver>"u"?void 0:new ResizeObserver(g);return u.current&&(e==null||e.observe(u.current)),(d=u.current)!=null&&d.parentElement&&(e==null||e.observe(u.current.parentElement)),r==="embedded"&&((W=u.current)!=null&&W.parentElement)&&Array.from(u.current.parentElement.children).forEach(m=>{m!==u.current&&(e==null||e.observe(m))}),E.current&&(e==null||e.observe(E.current)),window.addEventListener("resize",g),(w=window.visualViewport)==null||w.addEventListener("resize",g),(v=document.fonts)==null||v.ready.then(g),()=>{var m;e==null||e.disconnect(),window.removeEventListener("resize",g),(m=window.visualViewport)==null||m.removeEventListener("resize",g)}},[a,s,g,r]),M.length===0)return null;const $=a?c.slice(0,F):c,O=a?c.slice(F):[];return b.jsxs("div",{"data-component":"controls","data-dynamic-position":r==="fixed"?!0:void 0,"data-adaptive":a?!0:void 0,className:Z.t(h.controls,ce[r],a&&h.adaptive,i),ref:u,...S,children:[a&&b.jsxs("div",{"aria-hidden":"true",className:h.measurement,ref:z,children:[c.map((e,d)=>l.cloneElement(e,{"aria-hidden":!0,id:void 0,key:`measure-${String(e.key??d)}`,onClick:void 0,ref:void 0,tabIndex:-1})),b.jsx(A.MenuPopover,{triggerAccessibleLabel:o,children:null})]}),r!=="embedded"&&y.length>0&&b.jsx("span",{className:h["non-button-content"],ref:E,children:y}),$,O.length>0&&b.jsx("span",{className:h["overflow-trigger"],children:b.jsx(le,{buttons:O,menuAccessibleLabel:o,triggerAccessibleLabel:o})})]})};exports.Controls=fe;
3
3
  //# sourceMappingURL=index.cjs.map
@@ -2,8 +2,8 @@ import { jsxs as G, jsx as v } from "react/jsx-runtime";
2
2
  import { t as ne } from "../../classix-DG18itHa.js";
3
3
  import { Children as ie, isValidElement as re, cloneElement as P, useRef as C, useState as T, useCallback as oe, useLayoutEffect as de } from "react";
4
4
  import { Button as se } from "../button/index.js";
5
- import { a as $, M as ce } from "../../menu-popover-DOkciab5.js";
6
- import '../../assets/index36.css';const ae = "_controls_t1re6_13", le = "_inline_t1re6_43", ue = "_embedded_t1re6_48", me = "_fixed_t1re6_49", fe = "_adaptive_t1re6_60", he = "_measurement_t1re6_65", f = {
5
+ import { a as $, M as ce } from "../../menu-popover-BV7nUXlb.js";
6
+ import '../../assets/index37.css';const ae = "_controls_t1re6_13", le = "_inline_t1re6_43", ue = "_embedded_t1re6_48", me = "_fixed_t1re6_49", fe = "_adaptive_t1re6_60", he = "_measurement_t1re6_65", f = {
7
7
  controls: ae,
8
8
  default: "_default_t1re6_28",
9
9
  inline: le,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index37.css');const d=require("react/jsx-runtime"),tt=require("../../classix-5H4IWnMA.cjs"),c=require("react"),mt=require("../button/index.cjs"),pt=require("../figure/index.cjs"),gt=require("../icon/index.cjs"),I=10,A=.1,kt=.92,m=(h,x,R)=>Math.min(R,Math.max(x,h)),It=h=>new Promise((x,R)=>{const f=URL.createObjectURL(h),a=new globalThis.Image;a.onload=()=>{URL.revokeObjectURL(f),x(a)},a.onerror=()=>{URL.revokeObjectURL(f),R(new Error("croppable-image-load-failed"))},a.src=f}),Ot=async({file:h,fill:x,transform:R,viewport:f})=>{const a=await It(h),O=f.width/a.naturalWidth,M=f.height/a.naturalHeight,y=Math.max(O,M),D=a.naturalWidth*y,E=a.naturalHeight*y,Q=x==="width"?Math.max(A,O/y):x==="height"?Math.max(A,M/y):A,j=m(R.zoom,Q,I),w=y*j,b=D*j,B=E*j,p=(f.width-b)/2+R.offset.x,L=(f.height-B)/2+R.offset.y,S=m(-p/w,0,a.naturalWidth),T=m(-L/w,0,a.naturalHeight),v=m(f.width/w,1,Math.max(1,a.naturalWidth-S)),s=m(f.height/w,1,Math.max(1,a.naturalHeight-T)),_=document.createElement("canvas"),u=_.getContext("2d");if(!u)throw new Error("croppable-image-context-missing");_.width=Math.max(1,Math.round(v)),_.height=Math.max(1,Math.round(s)),u.drawImage(a,S,T,v,s,0,0,_.width,_.height);const U=h.type.startsWith("image/")?h.type:"image/jpeg",P=await new Promise(N=>{_.toBlob(N,U,kt)});if(!P)throw new Error("croppable-image-export-failed");return new globalThis.File([P],h.name,{lastModified:Date.now(),type:P.type||U})},St="_croppable_1kqo4_1",Ut="_empty_1kqo4_14",Pt="_media_1kqo4_22",qt="_overlay_1kqo4_33",Yt="_viewport_1kqo4_41",Xt="_draggable_1kqo4_53",At="_dragging_1kqo4_57",Dt="_inner_1kqo4_61",Wt="_standalone_1kqo4_77",z={croppable:St,empty:Ut,media:Pt,overlay:qt,viewport:Yt,draggable:Xt,dragging:At,inner:Dt,standalone:Wt},Ht=192,Z={offset:{x:0,y:0},zoom:1},xt="Select image",Zt=({children:h,fill:x="none",height:R,image:f,label:a,onCroppableChange:O,onFileChange:M,onImageChange:y,onTransformChange:D,transform:E,standalone:Q})=>{const j=c.useRef(null),w=c.useRef(null),b=c.useRef(null),B=c.useRef(null),p=c.useRef(y),L=c.useRef(null),S=c.useRef(null),T=c.useRef(null),v=c.useRef(new Map),s=c.useRef(Z),_=c.useRef(null),[u,U]=c.useState(null),[P,N]=c.useState(null),[et,V]=c.useState(!1),[wt,nt]=c.useState(Z),[F,ot]=c.useState(null),[g,yt]=c.useState({width:0,height:0}),W=(()=>{const t=g.width,n=g.height;if(!t||!n)return{width:0,height:0,minZoom:A};if(!u)return{width:t,height:n,minZoom:A};const o=t/u.width,e=n/u.height,r=Math.max(o,e),i=x==="width"?o/r:x==="height"?e/r:0;return{width:u.width*r,height:u.height*r,minZoom:Math.max(A,i)}})(),q=W.minZoom,H=E??wt,Y=m(H.zoom,q,I),$=P??f??null,rt=!h&&!!f&&!P&&!F,G=!rt,ct=h??($?d.jsx("img",{alt:"",draggable:!1,onLoad:t=>{const n=t.currentTarget;n.naturalWidth&&n.naturalHeight&&U({width:n.naturalWidth,height:n.naturalHeight})},src:$}):null),X=ct==null,J=(t,n)=>{const{maxX:o,maxY:e}=it(n);return{x:m(t.x,-o,o),y:m(t.y,-e,e)}},st=(t,n)=>{const o=_.current;if(!o)return null;const e=o.getBoundingClientRect(),r=t-e.left-e.width/2,i=n-e.top-e.height/2;return{x:r,y:i}},bt=(t,n,o,e)=>{const r=m(n,q,I),i=m(o,q,I);if(r===0)return t;const l=i/r;return{x:(1-l)*e.x+l*t.x,y:(1-l)*e.y+l*t.y}},_t=(t,n,o)=>{const e=s.current.zoom,r=m(t,q,I),i=s.current.offset,l=o?bt(i,e,r,o):n,k=J(l,r);s.current={zoom:r,offset:k},E||nt({zoom:r,offset:k}),D==null||D({zoom:r,offset:k})},K=(t,n,o)=>{S.current={zoom:t,offset:n,anchor:o??null},w.current==null&&(w.current=window.requestAnimationFrame(()=>{w.current=null;const e=S.current;S.current=null;const r=(e==null?void 0:e.zoom)??s.current.zoom,i=(e==null?void 0:e.offset)??s.current.offset,l=(e==null?void 0:e.anchor)??null;_t(r,i,l)}))},zt=t=>{if(X||!G)return;const n=t.ctrlKey?.001:25e-5,o=s.current.zoom*Math.exp(-t.deltaY*n),e=st(t.clientX,t.clientY);K(o,s.current.offset,e)},it=t=>{const n=g.width,o=g.height;if(!n||!o)return{maxX:0,maxY:0};const e=m(t,q,I),r=W.width*e,i=W.height*e,l=Math.max(0,(r-n)/2),k=Math.max(0,(i-o)/2);return{maxX:l,maxY:k}},Rt=t=>{var r;const n=t.target,o=((r=n.files)==null?void 0:r[0])??null;if(L.current&&(URL.revokeObjectURL(L.current),L.current=null),!o){N(null),ot(null),M==null||M(null),n.value="";return}const e=URL.createObjectURL(o);L.current=e,N(e),U(null),ot(o),K(Z.zoom,Z.offset),s.current=Z,M==null||M(o),n.value=""},Mt=t=>{if(!(X||!G||t.pointerType==="mouse"&&t.button!==0)){if(t.currentTarget.setPointerCapture(t.pointerId),t.pointerType==="touch"){const n=v.current;if(n.set(t.pointerId,{x:t.clientX,y:t.clientY}),n.size===2){b.current=null,j.current=null,V(!1);const[o,e]=Array.from(n.values());T.current=Math.hypot(o.x-e.x,o.y-e.y);return}}j.current=t.pointerId,b.current={x:t.clientX,y:t.clientY,originX:s.current.offset.x,originY:s.current.offset.y}}},Et=t=>{if(X||!G)return;if(t.pointerType==="touch"){const r=v.current;if(!r.has(t.pointerId))return;if(r.set(t.pointerId,{x:t.clientX,y:t.clientY}),r.size===2){const[i,l]=Array.from(r.values()),k=i.x-l.x,jt=i.y-l.y,ht=Math.hypot(k,jt),ft={x:(i.x+l.x)/2,y:(i.y+l.y)/2};if(T.current){const Lt=ht/T.current,Tt=s.current.zoom*Lt,vt=st(ft.x,ft.y);K(Tt,s.current.offset,vt)}T.current=ht;return}}if(j.current!==t.pointerId||!b.current||!C)return;const n=t.clientX-b.current.x,o=t.clientY-b.current.y,e=Math.abs(n)+Math.abs(o);!et&&e>2&&V(!0),!(e<=1)&&K(s.current.zoom,{x:b.current.originX+n,y:b.current.originY+o})},at=t=>{t.pointerType==="touch"&&(v.current.delete(t.pointerId),v.current.size<2&&(T.current=null)),j.current===t.pointerId&&(j.current=null,b.current=null,V(!1))};c.useEffect(()=>{if(!E)return;const t=m(E.zoom,q,I);s.current={zoom:t,offset:J(E.offset,t)}},[E,g.width,g.height,u==null?void 0:u.width,u==null?void 0:u.height]),c.useEffect(()=>()=>{L.current&&URL.revokeObjectURL(L.current)},[]),c.useEffect(()=>{const t=_.current;if(!t)return;const n=()=>{const r=t.getBoundingClientRect();yt(i=>i.width===r.width&&i.height===r.height?i:{width:r.width,height:r.height}),O&&O(r)};n();const o=()=>n();if(window.addEventListener("scroll",o,!0),typeof ResizeObserver>"u"){const r=()=>n();return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r),window.removeEventListener("scroll",o,!0)}}const e=new ResizeObserver(()=>n());return e.observe(t),()=>{e.disconnect(),window.removeEventListener("scroll",o,!0)}},[O]),c.useEffect(()=>{if(E)return;const t=s.current.offset,n=J(t,Y);t.x===n.x&&t.y===n.y||(s.current={zoom:s.current.zoom,offset:n},nt(o=>({...o,offset:n})))},[Y,u,g.width,g.height]),c.useEffect(()=>{$||U(null)},[$]),c.useEffect(()=>{p.current=y},[y]),c.useEffect(()=>{var o;if(!y)return;if(!F||!g.width||!g.height||h){(o=p.current)==null||o.call(p,null);return}let t=!0;const n=window.setTimeout(()=>{Ot({file:F,fill:x,transform:{zoom:Y,offset:H.offset},viewport:g}).then(e=>{var r;t&&((r=p.current)==null||r.call(p,e))}).catch(()=>{var e;t&&((e=p.current)==null||e.call(p,null))})},75);return()=>{t=!1,window.clearTimeout(n)}},[h,Y,H.offset,x,F,g]),c.useEffect(()=>()=>{w.current!=null&&(window.cancelAnimationFrame(w.current),w.current=null)},[]);const ut=it(Y),C=!X&&G&&(ut.maxX>0||ut.maxY>0),lt=()=>{var t;return(t=B.current)==null?void 0:t.click()},dt=t=>{t.preventDefault(),t.stopPropagation(),lt()};return d.jsxs("div",{className:tt.t(z.croppable,Q&&z.standalone),onClick:()=>{X&&lt()},"data-component":"croppable",children:[d.jsx("input",{accept:"image/*",onChange:Rt,ref:B,type:"file"}),d.jsx("div",{className:z.viewport,ref:_,onDragStart:t=>t.preventDefault(),onPointerDown:Mt,onPointerMove:Et,onPointerUp:at,onPointerCancel:at,onWheel:zt,style:{"--croppable-height":`${R??Ht}px`,"--croppable-zoom":Y,"--croppable-x":`${H.offset.x}px`,"--croppable-y":`${H.offset.y}px`,...u?{"--croppable-image-width":`${W.width}px`,"--croppable-image-height":`${W.height}px`}:null},children:X?d.jsxs("div",{className:z.empty,children:[d.jsx(pt.Figure,{children:d.jsx(gt.Icon,{name:"Image",size:"large"})}),d.jsx(mt.Button,{onClick:dt,children:a??xt})]}):d.jsxs("div",{className:tt.t(z.media,C&&z.draggable,C&&et&&z.dragging),children:[d.jsx("div",{className:tt.t(z.inner),children:ct}),rt&&d.jsx("div",{className:z.overlay,children:d.jsxs("div",{className:z.empty,children:[d.jsx(pt.Figure,{children:d.jsx(gt.Icon,{name:"Image",size:"large"})}),d.jsx(mt.Button,{onClick:dt,children:a??xt})]})})]})})]})};exports.Croppable=Zt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index38.css');const d=require("react/jsx-runtime"),tt=require("../../classix-5H4IWnMA.cjs"),c=require("react"),mt=require("../button/index.cjs"),pt=require("../figure/index.cjs"),gt=require("../icon/index.cjs"),I=10,A=.1,kt=.92,m=(h,x,R)=>Math.min(R,Math.max(x,h)),It=h=>new Promise((x,R)=>{const f=URL.createObjectURL(h),a=new globalThis.Image;a.onload=()=>{URL.revokeObjectURL(f),x(a)},a.onerror=()=>{URL.revokeObjectURL(f),R(new Error("croppable-image-load-failed"))},a.src=f}),Ot=async({file:h,fill:x,transform:R,viewport:f})=>{const a=await It(h),O=f.width/a.naturalWidth,M=f.height/a.naturalHeight,y=Math.max(O,M),D=a.naturalWidth*y,E=a.naturalHeight*y,Q=x==="width"?Math.max(A,O/y):x==="height"?Math.max(A,M/y):A,j=m(R.zoom,Q,I),w=y*j,b=D*j,B=E*j,p=(f.width-b)/2+R.offset.x,L=(f.height-B)/2+R.offset.y,S=m(-p/w,0,a.naturalWidth),T=m(-L/w,0,a.naturalHeight),v=m(f.width/w,1,Math.max(1,a.naturalWidth-S)),s=m(f.height/w,1,Math.max(1,a.naturalHeight-T)),_=document.createElement("canvas"),u=_.getContext("2d");if(!u)throw new Error("croppable-image-context-missing");_.width=Math.max(1,Math.round(v)),_.height=Math.max(1,Math.round(s)),u.drawImage(a,S,T,v,s,0,0,_.width,_.height);const U=h.type.startsWith("image/")?h.type:"image/jpeg",P=await new Promise(N=>{_.toBlob(N,U,kt)});if(!P)throw new Error("croppable-image-export-failed");return new globalThis.File([P],h.name,{lastModified:Date.now(),type:P.type||U})},St="_croppable_1kqo4_1",Ut="_empty_1kqo4_14",Pt="_media_1kqo4_22",qt="_overlay_1kqo4_33",Yt="_viewport_1kqo4_41",Xt="_draggable_1kqo4_53",At="_dragging_1kqo4_57",Dt="_inner_1kqo4_61",Wt="_standalone_1kqo4_77",z={croppable:St,empty:Ut,media:Pt,overlay:qt,viewport:Yt,draggable:Xt,dragging:At,inner:Dt,standalone:Wt},Ht=192,Z={offset:{x:0,y:0},zoom:1},xt="Select image",Zt=({children:h,fill:x="none",height:R,image:f,label:a,onCroppableChange:O,onFileChange:M,onImageChange:y,onTransformChange:D,transform:E,standalone:Q})=>{const j=c.useRef(null),w=c.useRef(null),b=c.useRef(null),B=c.useRef(null),p=c.useRef(y),L=c.useRef(null),S=c.useRef(null),T=c.useRef(null),v=c.useRef(new Map),s=c.useRef(Z),_=c.useRef(null),[u,U]=c.useState(null),[P,N]=c.useState(null),[et,V]=c.useState(!1),[wt,nt]=c.useState(Z),[F,ot]=c.useState(null),[g,yt]=c.useState({width:0,height:0}),W=(()=>{const t=g.width,n=g.height;if(!t||!n)return{width:0,height:0,minZoom:A};if(!u)return{width:t,height:n,minZoom:A};const o=t/u.width,e=n/u.height,r=Math.max(o,e),i=x==="width"?o/r:x==="height"?e/r:0;return{width:u.width*r,height:u.height*r,minZoom:Math.max(A,i)}})(),q=W.minZoom,H=E??wt,Y=m(H.zoom,q,I),$=P??f??null,rt=!h&&!!f&&!P&&!F,G=!rt,ct=h??($?d.jsx("img",{alt:"",draggable:!1,onLoad:t=>{const n=t.currentTarget;n.naturalWidth&&n.naturalHeight&&U({width:n.naturalWidth,height:n.naturalHeight})},src:$}):null),X=ct==null,J=(t,n)=>{const{maxX:o,maxY:e}=it(n);return{x:m(t.x,-o,o),y:m(t.y,-e,e)}},st=(t,n)=>{const o=_.current;if(!o)return null;const e=o.getBoundingClientRect(),r=t-e.left-e.width/2,i=n-e.top-e.height/2;return{x:r,y:i}},bt=(t,n,o,e)=>{const r=m(n,q,I),i=m(o,q,I);if(r===0)return t;const l=i/r;return{x:(1-l)*e.x+l*t.x,y:(1-l)*e.y+l*t.y}},_t=(t,n,o)=>{const e=s.current.zoom,r=m(t,q,I),i=s.current.offset,l=o?bt(i,e,r,o):n,k=J(l,r);s.current={zoom:r,offset:k},E||nt({zoom:r,offset:k}),D==null||D({zoom:r,offset:k})},K=(t,n,o)=>{S.current={zoom:t,offset:n,anchor:o??null},w.current==null&&(w.current=window.requestAnimationFrame(()=>{w.current=null;const e=S.current;S.current=null;const r=(e==null?void 0:e.zoom)??s.current.zoom,i=(e==null?void 0:e.offset)??s.current.offset,l=(e==null?void 0:e.anchor)??null;_t(r,i,l)}))},zt=t=>{if(X||!G)return;const n=t.ctrlKey?.001:25e-5,o=s.current.zoom*Math.exp(-t.deltaY*n),e=st(t.clientX,t.clientY);K(o,s.current.offset,e)},it=t=>{const n=g.width,o=g.height;if(!n||!o)return{maxX:0,maxY:0};const e=m(t,q,I),r=W.width*e,i=W.height*e,l=Math.max(0,(r-n)/2),k=Math.max(0,(i-o)/2);return{maxX:l,maxY:k}},Rt=t=>{var r;const n=t.target,o=((r=n.files)==null?void 0:r[0])??null;if(L.current&&(URL.revokeObjectURL(L.current),L.current=null),!o){N(null),ot(null),M==null||M(null),n.value="";return}const e=URL.createObjectURL(o);L.current=e,N(e),U(null),ot(o),K(Z.zoom,Z.offset),s.current=Z,M==null||M(o),n.value=""},Mt=t=>{if(!(X||!G||t.pointerType==="mouse"&&t.button!==0)){if(t.currentTarget.setPointerCapture(t.pointerId),t.pointerType==="touch"){const n=v.current;if(n.set(t.pointerId,{x:t.clientX,y:t.clientY}),n.size===2){b.current=null,j.current=null,V(!1);const[o,e]=Array.from(n.values());T.current=Math.hypot(o.x-e.x,o.y-e.y);return}}j.current=t.pointerId,b.current={x:t.clientX,y:t.clientY,originX:s.current.offset.x,originY:s.current.offset.y}}},Et=t=>{if(X||!G)return;if(t.pointerType==="touch"){const r=v.current;if(!r.has(t.pointerId))return;if(r.set(t.pointerId,{x:t.clientX,y:t.clientY}),r.size===2){const[i,l]=Array.from(r.values()),k=i.x-l.x,jt=i.y-l.y,ht=Math.hypot(k,jt),ft={x:(i.x+l.x)/2,y:(i.y+l.y)/2};if(T.current){const Lt=ht/T.current,Tt=s.current.zoom*Lt,vt=st(ft.x,ft.y);K(Tt,s.current.offset,vt)}T.current=ht;return}}if(j.current!==t.pointerId||!b.current||!C)return;const n=t.clientX-b.current.x,o=t.clientY-b.current.y,e=Math.abs(n)+Math.abs(o);!et&&e>2&&V(!0),!(e<=1)&&K(s.current.zoom,{x:b.current.originX+n,y:b.current.originY+o})},at=t=>{t.pointerType==="touch"&&(v.current.delete(t.pointerId),v.current.size<2&&(T.current=null)),j.current===t.pointerId&&(j.current=null,b.current=null,V(!1))};c.useEffect(()=>{if(!E)return;const t=m(E.zoom,q,I);s.current={zoom:t,offset:J(E.offset,t)}},[E,g.width,g.height,u==null?void 0:u.width,u==null?void 0:u.height]),c.useEffect(()=>()=>{L.current&&URL.revokeObjectURL(L.current)},[]),c.useEffect(()=>{const t=_.current;if(!t)return;const n=()=>{const r=t.getBoundingClientRect();yt(i=>i.width===r.width&&i.height===r.height?i:{width:r.width,height:r.height}),O&&O(r)};n();const o=()=>n();if(window.addEventListener("scroll",o,!0),typeof ResizeObserver>"u"){const r=()=>n();return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r),window.removeEventListener("scroll",o,!0)}}const e=new ResizeObserver(()=>n());return e.observe(t),()=>{e.disconnect(),window.removeEventListener("scroll",o,!0)}},[O]),c.useEffect(()=>{if(E)return;const t=s.current.offset,n=J(t,Y);t.x===n.x&&t.y===n.y||(s.current={zoom:s.current.zoom,offset:n},nt(o=>({...o,offset:n})))},[Y,u,g.width,g.height]),c.useEffect(()=>{$||U(null)},[$]),c.useEffect(()=>{p.current=y},[y]),c.useEffect(()=>{var o;if(!y)return;if(!F||!g.width||!g.height||h){(o=p.current)==null||o.call(p,null);return}let t=!0;const n=window.setTimeout(()=>{Ot({file:F,fill:x,transform:{zoom:Y,offset:H.offset},viewport:g}).then(e=>{var r;t&&((r=p.current)==null||r.call(p,e))}).catch(()=>{var e;t&&((e=p.current)==null||e.call(p,null))})},75);return()=>{t=!1,window.clearTimeout(n)}},[h,Y,H.offset,x,F,g]),c.useEffect(()=>()=>{w.current!=null&&(window.cancelAnimationFrame(w.current),w.current=null)},[]);const ut=it(Y),C=!X&&G&&(ut.maxX>0||ut.maxY>0),lt=()=>{var t;return(t=B.current)==null?void 0:t.click()},dt=t=>{t.preventDefault(),t.stopPropagation(),lt()};return d.jsxs("div",{className:tt.t(z.croppable,Q&&z.standalone),onClick:()=>{X&&lt()},"data-component":"croppable",children:[d.jsx("input",{accept:"image/*",onChange:Rt,ref:B,type:"file"}),d.jsx("div",{className:z.viewport,ref:_,onDragStart:t=>t.preventDefault(),onPointerDown:Mt,onPointerMove:Et,onPointerUp:at,onPointerCancel:at,onWheel:zt,style:{"--croppable-height":`${R??Ht}px`,"--croppable-zoom":Y,"--croppable-x":`${H.offset.x}px`,"--croppable-y":`${H.offset.y}px`,...u?{"--croppable-image-width":`${W.width}px`,"--croppable-image-height":`${W.height}px`}:null},children:X?d.jsxs("div",{className:z.empty,children:[d.jsx(pt.Figure,{children:d.jsx(gt.Icon,{name:"Image",size:"large"})}),d.jsx(mt.Button,{onClick:dt,children:a??xt})]}):d.jsxs("div",{className:tt.t(z.media,C&&z.draggable,C&&et&&z.dragging),children:[d.jsx("div",{className:tt.t(z.inner),children:ct}),rt&&d.jsx("div",{className:z.overlay,children:d.jsxs("div",{className:z.empty,children:[d.jsx(pt.Figure,{children:d.jsx(gt.Icon,{name:"Image",size:"large"})}),d.jsx(mt.Button,{onClick:dt,children:a??xt})]})})]})})]})};exports.Croppable=Zt;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -4,7 +4,7 @@ import { useRef as x, useState as S, useEffect as E } from "react";
4
4
  import { Button as wt } from "../button/index.js";
5
5
  import { Figure as xt } from "../figure/index.js";
6
6
  import { Icon as yt } from "../icon/index.js";
7
- import '../../assets/index37.css';const O = 10, Z = 0.1, Pt = 0.92, d = (u, p, _) => Math.min(_, Math.max(p, u)), Yt = (u) => new Promise((p, _) => {
7
+ import '../../assets/index38.css';const O = 10, Z = 0.1, Pt = 0.92, d = (u, p, _) => Math.min(_, Math.max(p, u)), Yt = (u) => new Promise((p, _) => {
8
8
  const h = URL.createObjectURL(u), s = new globalThis.Image();
9
9
  s.onload = () => {
10
10
  URL.revokeObjectURL(h), p(s);
@@ -1,2 +1,2 @@
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"),j=require("../button/index.cjs"),T=require("../icon/index.cjs"),X="_dialog_10cs4_3",E="_close_10cs4_24",F="_fullscreen_10cs4_35",M="_structured_10cs4_56",S="_header_10cs4_62",Y="_content_10cs4_73",w="_controls_10cs4_81",c={dialog:X,close:E,fullscreen:F,structured:M,header:S,content:Y,controls:w},B=l=>a.Children.toArray(l).some(r=>a.isValidElement(r)?r.type===j.Button&&r.props.intent==="danger"?!0:B(r.props.children):!1),A=({children:l,className:r,controls:n,fullscreen:f=!1,header:_,onCancel:i,onClick:u,onClose:d,open:o=!1,setOpen:s,...b})=>{const g=a.useRef(null),m=B(n),h=f||_!=null||n!=null;a.useEffect(()=>{const t=g.current;t&&(o&&!t.open?t.showModal():!o&&t.open&&t.close())},[o]);const q=t=>{i==null||i(t),!(t.defaultPrevented||!s)&&(t.preventDefault(),s(!1))},y=t=>{if(u==null||u(t),m||t.defaultPrevented||t.target!==t.currentTarget||!s)return;const{bottom:R,left:D,right:k,top:p}=t.currentTarget.getBoundingClientRect();(t.clientX<D||t.clientX>k||t.clientY<p||t.clientY>R)&&s(!1)},N=t=>{d==null||d(t),o&&(s==null||s(!1))},x=s&&!m?e.jsx(j.Button,{"aria-label":"Close dialog",className:c.close,onClick:()=>s(!1),variant:"simple",children:e.jsx(T.Icon,{name:"X"})}):null;return e.jsx("dialog",{className:P.t(c.dialog,h&&c.structured,f&&c.fullscreen,r),onCancel:q,onClick:y,onClose:N,ref:g,...b,"data-component":"dialog",children:h?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:c.header,children:[_,x]}),e.jsx("div",{className:c.content,children:l}),n!=null&&e.jsx("div",{className:c.controls,children:n})]}):e.jsxs(e.Fragment,{children:[x,l]})})};exports.Dialog=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index39.css');const e=require("react/jsx-runtime"),k=require("../../classix-5H4IWnMA.cjs"),a=require("react"),j=require("../button/index.cjs"),p=require("../icon/index.cjs"),P="_dialog_9zw0o_3",T="_close_9zw0o_34",X="_fullscreen_9zw0o_45",E="_structured_9zw0o_66",F="_header_9zw0o_72",M="_content_9zw0o_83",S="_controls_9zw0o_94",s={dialog:P,close:T,fullscreen:X,structured:E,header:F,content:M,controls:S},w=c=>a.Children.toArray(c).some(o=>a.isValidElement(o)?o.type===j.Button&&o.props.intent==="danger"?!0:w(o.props.children):!1),Y=({children:c,className:o,controls:l,fullscreen:f=!1,header:_,onCancel:i,onClick:u,onClose:d,open:n=!1,setOpen:r,...z})=>{const g=a.useRef(null),m=w(l),h=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))},b=t=>{if(u==null||u(t),m||t.defaultPrevented||t.target!==t.currentTarget||!r)return;const{bottom:y,left:N,right:R,top:D}=t.currentTarget.getBoundingClientRect();(t.clientX<N||t.clientX>R||t.clientY<D||t.clientY>y)&&r(!1)},q=t=>{d==null||d(t),n&&(r==null||r(!1))},x=r&&!m?e.jsx(j.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:k.t(s.dialog,h&&s.structured,f&&s.fullscreen,o),onCancel:B,onClick:b,onClose:q,ref:g,...z,"data-component":"dialog",children:h?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:s.header,children:[_,x]}),e.jsx("div",{className:s.content,children:c}),l!=null&&e.jsx("div",{className:s.controls,children:l})]}):e.jsxs(e.Fragment,{children:[x,c]})})};exports.Dialog=Y;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,20 +1,20 @@
1
- import { jsx as e, jsxs as u, Fragment as B } from "react/jsx-runtime";
2
- import { t as T } from "../../classix-DG18itHa.js";
3
- import N, { useRef as Y, useEffect as w } from "react";
4
- import { Button as R } from "../button/index.js";
5
- import { Icon as A } from "../icon/index.js";
6
- import '../../assets/index38.css';const F = "_dialog_10cs4_3", I = "_close_10cs4_24", M = "_fullscreen_10cs4_35", V = "_structured_10cs4_56", q = "_header_10cs4_62", z = "_content_10cs4_73", G = "_controls_10cs4_81", c = {
7
- dialog: F,
8
- close: I,
9
- fullscreen: M,
10
- structured: V,
11
- header: q,
12
- content: z,
1
+ import { jsx as e, jsxs as u, Fragment as z } from "react/jsx-runtime";
2
+ import { t as E } from "../../classix-DG18itHa.js";
3
+ import p, { useRef as P, useEffect as T } from "react";
4
+ import { Button as B } from "../button/index.js";
5
+ import { Icon as Y } from "../icon/index.js";
6
+ import '../../assets/index39.css';const A = "_dialog_9zw0o_3", F = "_close_9zw0o_34", I = "_fullscreen_9zw0o_45", M = "_structured_9zw0o_66", V = "_header_9zw0o_72", q = "_content_9zw0o_83", G = "_controls_9zw0o_94", o = {
7
+ dialog: A,
8
+ close: F,
9
+ fullscreen: I,
10
+ structured: M,
11
+ header: V,
12
+ content: q,
13
13
  controls: G
14
- }, k = (s) => N.Children.toArray(s).some((l) => N.isValidElement(l) ? l.type === R && l.props.intent === "danger" ? !0 : k(l.props.children) : !1), U = ({
15
- children: s,
14
+ }, N = (c) => p.Children.toArray(c).some((l) => p.isValidElement(l) ? l.type === B && l.props.intent === "danger" ? !0 : N(l.props.children) : !1), U = ({
15
+ children: c,
16
16
  className: l,
17
- controls: o,
17
+ controls: s,
18
18
  fullscreen: f = !1,
19
19
  header: m,
20
20
  onCancel: n,
@@ -22,37 +22,37 @@ import '../../assets/index38.css';const F = "_dialog_10cs4_3", I = "_close_10cs4
22
22
  onClose: d,
23
23
  open: a = !1,
24
24
  setOpen: r,
25
- ...x
25
+ ...R
26
26
  }) => {
27
- const _ = Y(null), g = k(o), h = f || m != null || o != null;
28
- w(() => {
27
+ const _ = P(null), g = N(s), h = f || m != null || s != null;
28
+ T(() => {
29
29
  const t = _.current;
30
30
  t && (a && !t.open ? t.showModal() : !a && t.open && t.close());
31
31
  }, [a]);
32
- const y = (t) => {
32
+ const k = (t) => {
33
33
  n == null || n(t), !(t.defaultPrevented || !r) && (t.preventDefault(), r(!1));
34
- }, D = (t) => {
34
+ }, x = (t) => {
35
35
  if (i == null || i(t), g || t.defaultPrevented || t.target !== t.currentTarget || !r) return;
36
36
  const {
37
- bottom: b,
38
- left: j,
39
- right: E,
40
- top: P
37
+ bottom: D,
38
+ left: X,
39
+ right: b,
40
+ top: j
41
41
  } = t.currentTarget.getBoundingClientRect();
42
- (t.clientX < j || t.clientX > E || t.clientY < P || t.clientY > b) && r(!1);
43
- }, X = (t) => {
42
+ (t.clientX < X || t.clientX > b || t.clientY < j || t.clientY > D) && r(!1);
43
+ }, y = (t) => {
44
44
  d == null || d(t), a && (r == null || r(!1));
45
- }, p = r && !g ? /* @__PURE__ */ e(R, { "aria-label": "Close dialog", className: c.close, onClick: () => r(!1), variant: "simple", children: /* @__PURE__ */ e(A, { name: "X" }) }) : null;
46
- return /* @__PURE__ */ e("dialog", { className: T(c.dialog, h && c.structured, f && c.fullscreen, l), onCancel: y, onClick: D, onClose: X, ref: _, ...x, "data-component": "dialog", children: h ? /* @__PURE__ */ u(B, { children: [
47
- /* @__PURE__ */ u("div", { className: c.header, children: [
45
+ }, w = r && !g ? /* @__PURE__ */ e(B, { "aria-label": "Close dialog", className: o.close, onClick: () => r(!1), variant: "simple", children: /* @__PURE__ */ e(Y, { name: "X" }) }) : null;
46
+ return /* @__PURE__ */ e("dialog", { className: E(o.dialog, h && o.structured, f && o.fullscreen, l), onCancel: k, onClick: x, onClose: y, ref: _, ...R, "data-component": "dialog", children: h ? /* @__PURE__ */ u(z, { children: [
47
+ /* @__PURE__ */ u("div", { className: o.header, children: [
48
48
  m,
49
- p
49
+ w
50
50
  ] }),
51
- /* @__PURE__ */ e("div", { className: c.content, children: s }),
52
- o != null && /* @__PURE__ */ e("div", { className: c.controls, children: o })
53
- ] }) : /* @__PURE__ */ u(B, { children: [
54
- p,
55
- s
51
+ /* @__PURE__ */ e("div", { className: o.content, children: c }),
52
+ s != null && /* @__PURE__ */ e("div", { className: o.controls, children: s })
53
+ ] }) : /* @__PURE__ */ u(z, { children: [
54
+ w,
55
+ c
56
56
  ] }) });
57
57
  };
58
58
  export {
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index39.css');const r=require("react/jsx-runtime"),t=require("../../classix-5H4IWnMA.cjs"),d="_divider_1fgyv_1",s={divider:d},o=({className:e,...i})=>r.jsx("hr",{className:t.t(s.divider,e),...i,"data-component":"divider"});exports.Divider=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index40.css');const r=require("react/jsx-runtime"),t=require("../../classix-5H4IWnMA.cjs"),d="_divider_1oie5_1",s={divider:d},o=({className:e,...i})=>r.jsx("hr",{className:t.t(s.divider,e),...i,"data-component":"divider"});exports.Divider=o;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,12 +1,12 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { t as e } from "../../classix-DG18itHa.js";
3
- import '../../assets/index39.css';const o = "_divider_1fgyv_1", t = {
3
+ import '../../assets/index40.css';const o = "_divider_1oie5_1", t = {
4
4
  divider: o
5
- }, m = ({
5
+ }, v = ({
6
6
  className: i,
7
7
  ...d
8
8
  }) => /* @__PURE__ */ r("hr", { className: e(t.divider, i), ...d, "data-component": "divider" });
9
9
  export {
10
- m as Divider
10
+ v as Divider
11
11
  };
12
12
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index40.css');const l=require("react/jsx-runtime"),j=require("../../classix-5H4IWnMA.cjs"),a=require("react"),F=require("../button/index.cjs"),de=require("../../icons-Dv_p0bUF.cjs"),X=require("../../index-DWDp66fp.cjs"),pe=require("../list/index.cjs"),V=require("../../index-Bt7vnwji.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 fe(t){return a.isValidElement(t)&&t.type==="option"}function me(t){return a.isValidElement(t)&&t.type==="optgroup"}function he(t){return a.isValidElement(t)&&t.type===a.Fragment}function _e(t){return a.isValidElement(t)&&t.type===V.Select}function M(t,i,s=!1){const r=[];return a.Children.forEach(t,n=>{if(he(n))r.push(...M(n.props.children,i,s));else if(fe(n)){const c=L(n.props.children).trim(),f=n.props.value!=null?String(n.props.value):c;r.push({disabled:s||!!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)&&r.push(...M(n.props.children,n.props.label,s||!!n.props.disabled))}),r}function ge(t){const i=t.trim();if(!i)return null;const r=[.../[*?]/.test(i)?i:`*${i}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${r}$`,"i")}function xe(t,i){const s=ge(i),r=t.filter(n=>!n.hidden&&!n.isPlaceholder);return s?r.filter(n=>s.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):r}function be(t,i){return t.find(s=>s.value===i)??t.find(s=>s.isPlaceholder)??t[0]}function je(t,i,s){var r,n;return i!=null?String(i):s!=null?String(s):((r=t.find(c=>c.selected))==null?void 0:r.value)??((n=t[0])==null?void 0:n.value)??""}function ve(t){if(_e(t)){const{children:i,placeholder:s,...r}=t.props;return{children:l.jsxs(l.Fragment,{children:[s&&l.jsx("option",{hidden:!0,value:"",children:s}),i]}),props:r}}return{children:t.props.children,props:t.props}}const ye="_combobox_ej99h_3",we="_dropdown_ej99h_27",Se="_empty_ej99h_32",Ne="_group_ej99h_33",Ce="_placeholder_ej99h_34",Ee="_filter_ej99h_42",Ve="_native_ej99h_52",Le="_option_ej99h_62",Re="_options_ej99h_83",$e="_panel_ej99h_107",Be="_selected_ej99h_132",Ie="_text_ej99h_136",qe="_trigger_ej99h_144",De="_minimal_ej99h_181",Pe="_inline_ej99h_240",ke="_label_ej99h_272",o={combobox:ye,"combobox-input":"_combobox-input_ej99h_12",dropdown:we,empty:Se,group:Ne,placeholder:Ce,filter:Ee,native:Ve,option:Le,options:Re,panel:$e,selected:Be,text:Ie,trigger:qe,minimal:De,inline:Pe,label:ke,"inline-field":"_inline-field_ej99h_278"};function Y(t,i){return{"--icon-svg":de.iconSVG(t,i)}}const Fe=({children:t,className:i,combobox:s=!1,createOption:r,emptyLabel:n="No matches found",label:c,renderOption:f,searchPlaceholder:R="Filter",selectedItems:Z,variant:g="default",...ee})=>{const $=ve(t),{defaultValue:te,onChange:B,value:I,...ne}=$.props,v=V.sanitizeSelectProps(ne),{className:se,...re}=v,W=a.useRef(null),G=a.useRef(null),y=a.useId(),Q=a.useRef(null),m=a.useRef(null),x=M($.children),b=I!=null,q=je(x,I,te),[D,P]=a.useState(()=>q),[u,p]=a.useState(!1),[w,S]=a.useState(""),N=b?String(I):D,z={default:V.resolveColor("--colors-semantic-content-secondary"),white:V.resolveColor("--color-white","white")},O=g==="minimal"?z.white:z.default,C=be(x,N),le=Y("CaretDown",O),oe=Y("MagnifyingGlass",O),T=xe(x,w),h=w.trim(),E=!!(s&&r&&h&&r.isValid(h)),ie=c&&g==="inline"?X.formatInlineLabel(c):c,A=e=>e?(f==null?void 0:f({groupLabel:e.groupLabel,isSelected:e.value===N,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){S("");return}(e=m.current)==null||e.focus()},[u]),a.useEffect(()=>{if(!u)return;const e=d=>{var _;(_=G.current)!=null&&_.contains(d.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);const ae=e=>{b||P(e.target.value),B==null||B(e)},k=()=>{var e;p(!1),s||(e=W.current)==null||e.focus()},K=()=>{var e;S(""),p(!0),(e=m.current)==null||e.focus()},H=()=>{!r||!E||(r.onCreate(h),K())},ce=e=>{var U;b||P(e);const d=Q.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})),s?K():k()},ue=e=>{e.key==="Escape"&&k(),e.key==="Enter"&&e.target===m.current&&E&&(e.preventDefault(),H())},J=l.jsxs("div",{className:j.t(o.dropdown,g==="inline"&&o.inline,g==="minimal"&&o.minimal,i),onKeyDown:ue,ref:G,...ee,children:[l.jsx("select",{...re,"aria-hidden":"true",className:j.t(o.native,se),onChange:ae,ref:Q,tabIndex:-1,value:N,children:$.children}),s?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??R,className:o["combobox-input"],disabled:v.disabled,onChange:e=>{S(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:R||void 0,ref:m,role:"combobox",type:"text",value:w})]}):l.jsx(F.Button,{"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":c?`${y} ${y}-value`:void 0,className:j.t(o.trigger,(C==null?void 0:C.isPlaceholder)&&o.placeholder),"data-open":u?"true":void 0,disabled:v.disabled,onClick:()=>p(e=>!e),ref:W,style:le,variant:"simple",children:l.jsx("span",{className:o.text,id:`${y}-value`,children:A(C)})}),u&&l.jsxs("div",{className:o.panel,children:[!s&&l.jsx(X.Input,{"aria-label":"Filter",className:o.filter,icon:"MagnifyingGlass",onChange:e=>S(e.target.value),placeholder:R,ref:m,style:oe,type:"search",value:w}),l.jsxs(pe.List,{"aria-label":"Dropdown",className:o.options,children:[T.map(e=>{const d=e.value===N;return l.jsx("li",{"data-component":"dropdown",children:l.jsxs(F.Button,{"aria-label":d?`${e.text}, selected`:e.text,className:j.t(o.option,d&&o.selected),disabled:e.disabled,onClick:()=>ce(e.value),variant:"tertiary",children:[l.jsx("span",{className:o.text,children:A(e)}),e.groupLabel&&l.jsx("small",{className:o.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),E&&r&&l.jsx("li",{children:l.jsx(F.Button,{"aria-label":L(r.render(h))||h,className:o.option,onClick:H,variant:"tertiary",children:l.jsx("span",{className:o.text,children:r.render(h)})})}),T.length===0&&!E&&l.jsx("li",{className:o.empty,children:n})]})]})]});return c?l.jsxs("div",{className:j.t(o.label,g==="inline"&&o["inline-field"]),"data-component":"dropdown",children:[l.jsx("span",{id:y,children:ie}),J]}):J};exports.Dropdown=Fe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index41.css');const l=require("react/jsx-runtime"),v=require("../../classix-5H4IWnMA.cjs"),a=require("react"),F=require("../button/index.cjs"),de=require("../../icons-B3hIY9Bm.cjs"),X=require("../../index-Bbauu1No.cjs"),pe=require("../list/index.cjs"),E=require("../../index-DAjU2bTe.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 _e(t){return a.isValidElement(t)&&t.type===a.Fragment}function he(t){return a.isValidElement(t)&&t.type===E.Select}function M(t,i,s=!1){const r=[];return a.Children.forEach(t,n=>{if(_e(n))r.push(...M(n.props.children,i,s));else if(fe(n)){const c=V(n.props.children).trim(),f=n.props.value!=null?String(n.props.value):c;r.push({disabled:s||!!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)&&r.push(...M(n.props.children,n.props.label,s||!!n.props.disabled))}),r}function ge(t){const i=t.trim();if(!i)return null;const r=[.../[*?]/.test(i)?i:`*${i}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${r}$`,"i")}function xe(t,i){const s=ge(i),r=t.filter(n=>!n.hidden&&!n.isPlaceholder);return s?r.filter(n=>s.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):r}function be(t,i){return t.find(s=>s.value===i)??t.find(s=>s.isPlaceholder)??t[0]}function ve(t,i,s){var r,n;return i!=null?String(i):s!=null?String(s):((r=t.find(c=>c.selected))==null?void 0:r.value)??((n=t[0])==null?void 0:n.value)??""}function ye(t){if(he(t)){const{children:i,placeholder:s,...r}=t.props;return{children:l.jsxs(l.Fragment,{children:[s&&l.jsx("option",{hidden:!0,value:"",children:s}),i]}),props:r}}return{children:t.props.children,props:t.props}}const je="_combobox_13pqc_3",qe="_dropdown_13pqc_27",we="_empty_13pqc_32",Se="_group_13pqc_33",Ne="_placeholder_13pqc_34",Ce="_filter_13pqc_42",Ee="_native_13pqc_52",Ve="_option_13pqc_62",Le="_options_13pqc_83",Re="_panel_13pqc_107",$e="_selected_13pqc_132",Be="_text_13pqc_136",Ie="_trigger_13pqc_144",De="_minimal_13pqc_181",Pe="_inline_13pqc_241",ke="_label_13pqc_273",o={combobox:je,"combobox-input":"_combobox-input_13pqc_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:De,inline:Pe,label:ke,"inline-field":"_inline-field_13pqc_279"};function Y(t,i){return{"--icon-svg":de.iconSVG(t,i)}}const Fe=({children:t,className:i,combobox:s=!1,createOption:r,emptyLabel:n="No matches found",label:c,renderOption:f,searchPlaceholder:L="Filter",selectedItems:Z,variant:g="default",...ee})=>{const R=ye(t),{defaultValue:te,onChange:$,value:B,...ne}=R.props,y=E.sanitizeSelectProps(ne),{className:se,...re}=y,W=a.useRef(null),G=a.useRef(null),j=a.useId(),Q=a.useRef(null),m=a.useRef(null),x=M(R.children),b=B!=null,I=ve(x,B,te),[D,P]=a.useState(()=>I),[u,p]=a.useState(!1),[q,w]=a.useState(""),S=b?String(B):D,z={default:E.resolveColor("--colors-semantic-content-secondary"),white:E.resolveColor("--color-white","white")},O=g==="minimal"?z.white:z.default,N=be(x,S),le=Y("CaretDown",O),oe=Y("MagnifyingGlass",O),T=xe(x,q),_=q.trim(),C=!!(s&&r&&_&&r.isValid(_)),ie=c&&g==="inline"?X.formatInlineLabel(c):c,A=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(I)},[I,D,b,x]),a.useEffect(()=>{var e;if(!u){w("");return}(e=m.current)==null||e.focus()},[u]),a.useEffect(()=>{if(!u)return;const e=d=>{var h;(h=G.current)!=null&&h.contains(d.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);const ae=e=>{b||P(e.target.value),$==null||$(e)},k=()=>{var e;p(!1),s||(e=W.current)==null||e.focus()},K=()=>{var e;w(""),p(!0),(e=m.current)==null||e.focus()},H=()=>{!r||!C||(r.onCreate(_),K())},ce=e=>{var U;b||P(e);const d=Q.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})),s?K():k()},ue=e=>{e.key==="Escape"&&k(),e.key==="Enter"&&e.target===m.current&&C&&(e.preventDefault(),H())},J=l.jsxs("div",{className:v.t(o.dropdown,g==="inline"&&o.inline,g==="minimal"&&o.minimal,i),onKeyDown:ue,ref:G,...ee,children:[l.jsx("select",{...re,"aria-hidden":"true",className:v.t(o.native,se),onChange:ae,ref:Q,tabIndex:-1,value:S,children:R.children}),s?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":y["aria-label"]??c??L,className:o["combobox-input"],disabled:y.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:v.t(o.trigger,(N==null?void 0:N.isPlaceholder)&&o.placeholder),"data-open":u?"true":void 0,disabled:y.disabled,onClick:()=>p(e=>!e),ref:W,style:le,variant:"simple",children:l.jsx("span",{className:o.text,id:`${j}-value`,children:A(N)})}),u&&l.jsxs("div",{className:o.panel,children:[!s&&l.jsx(X.Input,{"aria-label":"Filter",className:o.filter,icon:"MagnifyingGlass",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:[T.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:v.t(o.option,d&&o.selected),disabled:e.disabled,onClick:()=>ce(e.value),variant:"tertiary",children:[l.jsx("span",{className:o.text,children:A(e)}),e.groupLabel&&l.jsx("small",{className:o.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),C&&r&&l.jsx("li",{children:l.jsx(F.Button,{"aria-label":V(r.render(_))||_,className:o.option,onClick:H,variant:"tertiary",children:l.jsx("span",{className:o.text,children:r.render(_)})})}),T.length===0&&!C&&l.jsx("li",{className:o.empty,children:n})]})]})]});return c?l.jsxs("div",{className:v.t(o.label,g==="inline"&&o["inline-field"]),"data-component":"dropdown",children:[l.jsx("span",{id:j,children:ie}),J]}):J};exports.Dropdown=Fe;
2
2
  //# sourceMappingURL=index.cjs.map