@solibo/solibo-ui 1.0.7 → 1.0.9

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 (48) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/assets/index15.css +1 -1
  3. package/dist/assets/index19.css +1 -1
  4. package/dist/assets/index32.css +1 -1
  5. package/dist/assets/index38.css +1 -1
  6. package/dist/assets/index39.css +1 -1
  7. package/dist/assets/index46.css +1 -1
  8. package/dist/assets/index51.css +1 -1
  9. package/dist/assets/index8.css +1 -1
  10. package/dist/assets/index9.css +1 -1
  11. package/dist/components/card/index.cjs +1 -1
  12. package/dist/components/card/index.js +45 -45
  13. package/dist/components/dialog/index.cjs +1 -1
  14. package/dist/components/dialog/index.cjs.map +1 -1
  15. package/dist/components/dialog/index.js +39 -37
  16. package/dist/components/dialog/index.js.map +1 -1
  17. package/dist/components/dropdown/index.cjs +1 -1
  18. package/dist/components/dropdown/index.js +70 -70
  19. package/dist/components/icon/index.cjs +1 -1
  20. package/dist/components/icon/index.js +22 -22
  21. package/dist/components/iframe/index.cjs +1 -1
  22. package/dist/components/iframe/index.cjs.map +1 -1
  23. package/dist/components/iframe/index.js +46 -49
  24. package/dist/components/iframe/index.js.map +1 -1
  25. package/dist/components/message/index.cjs +1 -1
  26. package/dist/components/message/index.js +18 -18
  27. package/dist/components/popover/index.cjs +1 -1
  28. package/dist/components/popover/index.cjs.map +1 -1
  29. package/dist/components/popover/index.js +10 -10
  30. package/dist/components/popover/index.js.map +1 -1
  31. package/dist/components/search/index.cjs +1 -1
  32. package/dist/components/search/index.js +29 -29
  33. package/dist/components/select/index.cjs +1 -1
  34. package/dist/components/select/index.js +1 -1
  35. package/dist/components/sortable/index.cjs +1 -1
  36. package/dist/components/sortable/index.cjs.map +1 -1
  37. package/dist/components/sortable/index.js +141 -134
  38. package/dist/components/sortable/index.js.map +1 -1
  39. package/dist/{index-oL8GYbhj.cjs → index-BPIK2dxs.cjs} +2 -2
  40. package/dist/{index-oL8GYbhj.cjs.map → index-BPIK2dxs.cjs.map} +1 -1
  41. package/dist/{index-CMfR_USP.js → index-C_YiNpZP.js} +8 -8
  42. package/dist/{index-CMfR_USP.js.map → index-C_YiNpZP.js.map} +1 -1
  43. package/dist/index.cjs +1 -1
  44. package/dist/index.d.ts +13 -2
  45. package/dist/index.js +37 -36
  46. package/dist/tokens.css +3 -1
  47. package/dist/tokens.json +46 -19
  48. package/package.json +1 -1
@@ -1,33 +1,33 @@
1
1
  import { jsxs as p, Fragment as pe, jsx as s } from "react/jsx-runtime";
2
- import { t as I } from "../../classix-DG18itHa.js";
3
- import fe, { Children as me, isValidElement as v, useRef as L, useId as ge, useState as Q, useEffect as z } from "react";
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
4
  import { Button as M } from "../button/index.js";
5
- import { i as he } from "../../icons-BFgf_lJN.js";
6
- import { f as _e, I as be } from "../../index-BHgGZxsR.js";
7
- import { List as xe } from "../list/index.js";
8
- import { S as ve, s as ye, r as ee } from "../../index-CMfR_USP.js";
9
- import '../../assets/index39.css';function $(t) {
10
- return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map($).join(" ") : v(t) ? $(t.props.children) : "";
5
+ import { i as _e } from "../../icons-BFgf_lJN.js";
6
+ import { f as ye, I as be } from "../../index-BHgGZxsR.js";
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";
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) : "";
11
11
  }
12
- function we(t) {
13
- return v(t) && t.type === "option";
12
+ function xe(t) {
13
+ return w(t) && t.type === "option";
14
+ }
15
+ function je(t) {
16
+ return w(t) && t.type === "optgroup";
14
17
  }
15
18
  function Se(t) {
16
- return v(t) && t.type === "optgroup";
19
+ return w(t) && t.type === fe.Fragment;
17
20
  }
18
21
  function Ne(t) {
19
- return v(t) && t.type === fe.Fragment;
20
- }
21
- function Ce(t) {
22
- return v(t) && t.type === ve;
22
+ return w(t) && t.type === we;
23
23
  }
24
24
  function A(t, i, r = !1) {
25
25
  const l = [];
26
26
  return me.forEach(t, (n) => {
27
- if (Ne(n))
27
+ if (Se(n))
28
28
  l.push(...A(n.props.children, i, r));
29
- else if (we(n)) {
30
- const a = $(n.props.children).trim(), f = n.props.value != null ? String(n.props.value) : a;
29
+ else if (xe(n)) {
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,
33
33
  groupLabel: i,
@@ -38,28 +38,28 @@ function A(t, i, r = !1) {
38
38
  text: a,
39
39
  value: f
40
40
  });
41
- } else Se(n) && l.push(...A(n.props.children, n.props.label, r || !!n.props.disabled));
41
+ } else je(n) && l.push(...A(n.props.children, n.props.label, r || !!n.props.disabled));
42
42
  }), l;
43
43
  }
44
- function Ee(t) {
44
+ function Ce(t) {
45
45
  const i = t.trim();
46
46
  if (!i) return null;
47
47
  const l = [.../[*?]/.test(i) ? i : `*${i}*`].map((n) => n === "*" ? ".*" : n === "?" ? "." : n.replace(/[|\\{}()[\]^$+.,]/g, "\\$&")).join("");
48
48
  return new RegExp(`^${l}$`, "i");
49
49
  }
50
- function Ve(t, i) {
51
- const r = Ee(i), l = t.filter((n) => !n.hidden && !n.isPlaceholder);
50
+ function Ee(t, i) {
51
+ const r = Ce(i), l = t.filter((n) => !n.hidden && !n.isPlaceholder);
52
52
  return r ? l.filter((n) => r.test([n.groupLabel, n.text, n.value].filter(Boolean).join(" "))) : l;
53
53
  }
54
- function Ie(t, i) {
54
+ function Ve(t, i) {
55
55
  return t.find((r) => r.value === i) ?? t.find((r) => r.isPlaceholder) ?? t[0];
56
56
  }
57
- function Le(t, i, r) {
57
+ function Ie(t, i, r) {
58
58
  var l, n;
59
59
  return i != null ? String(i) : r != null ? String(r) : ((l = t.find((a) => a.selected)) == null ? void 0 : l.value) ?? ((n = t[0]) == null ? void 0 : n.value) ?? "";
60
60
  }
61
- function $e(t) {
62
- if (Ce(t)) {
61
+ function Le(t) {
62
+ if (Ne(t)) {
63
63
  const {
64
64
  children: i,
65
65
  placeholder: r,
@@ -78,14 +78,14 @@ function $e(t) {
78
78
  props: t.props
79
79
  };
80
80
  }
81
- const Be = "_combobox_1x1gr_3", ke = "_dropdown_1x1gr_27", De = "_empty_1x1gr_30", Pe = "_group_1x1gr_31", Re = "_placeholder_1x1gr_32", je = "_filter_1x1gr_40", Fe = "_native_1x1gr_52", We = "_option_1x1gr_62", Qe = "_options_1x1gr_84", ze = "_panel_1x1gr_108", Me = "_selected_1x1gr_132", Ae = "_text_1x1gr_136", Ge = "_trigger_1x1gr_145", Ke = "_minimal_1x1gr_164", Oe = "_inline_1x1gr_219", Te = "_label_1x1gr_251", o = {
82
- combobox: Be,
83
- "combobox-input": "_combobox-input_1x1gr_12",
84
- dropdown: ke,
85
- empty: De,
86
- group: Pe,
87
- placeholder: Re,
88
- filter: je,
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 = {
82
+ combobox: $e,
83
+ "combobox-input": "_combobox-input_18jwy_12",
84
+ dropdown: Be,
85
+ empty: ke,
86
+ group: De,
87
+ placeholder: Pe,
88
+ filter: Re,
89
89
  native: Fe,
90
90
  option: We,
91
91
  options: Qe,
@@ -96,11 +96,11 @@ const Be = "_combobox_1x1gr_3", ke = "_dropdown_1x1gr_27", De = "_empty_1x1gr_30
96
96
  minimal: Ke,
97
97
  inline: Oe,
98
98
  label: Te,
99
- "inline-field": "_inline-field_1x1gr_257"
99
+ "inline-field": "_inline-field_18jwy_274"
100
100
  };
101
101
  function te(t, i) {
102
102
  return {
103
- "--icon-svg": he(t).replace("currentColor", i)
103
+ "--icon-svg": _e(t).replace("currentColor", i)
104
104
  };
105
105
  }
106
106
  const tt = ({
@@ -111,32 +111,32 @@ const tt = ({
111
111
  emptyLabel: n = "No matches found",
112
112
  label: a,
113
113
  renderOption: f,
114
- searchPlaceholder: B = "Filter",
114
+ searchPlaceholder: $ = "Filter",
115
115
  selectedItems: ne,
116
- variant: _ = "default",
116
+ variant: y = "default",
117
117
  ...re
118
118
  }) => {
119
- const k = $e(t), {
119
+ const B = Le(t), {
120
120
  defaultValue: le,
121
- onChange: D,
122
- value: P,
121
+ onChange: k,
122
+ value: D,
123
123
  ...oe
124
- } = k.props, y = ye(oe), G = L(null), K = L(null), w = ge(), O = L(null), m = L(null), b = A(k.children), x = P != null, R = Le(b, P, le), [j, F] = Q(() => R), [c, d] = Q(!1), [S, N] = Q(""), C = x ? String(P) : j, T = {
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 = {
125
125
  default: ee("--colors-semantic-content-secondary"),
126
126
  white: ee("--color-white", "white")
127
- }, q = _ === "minimal" ? T.white : T.default, E = Ie(b, C), ie = te("chevron", q), se = te("search", q), H = Ve(b, S), g = S.trim(), V = !!(r && l && g && l.isValid(g)), ae = a && _ === "inline" ? _e(a) : a, J = (e) => e ? (f == null ? void 0 : f({
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({
128
128
  groupLabel: e.groupLabel,
129
- isSelected: e.value === C,
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
134
  z(() => {
135
- !x && !b.some((e) => e.value === j) && F(R);
136
- }, [R, j, x, b]), z(() => {
135
+ !g && !b.some((e) => e.value === R) && F(P);
136
+ }, [P, R, g, b]), z(() => {
137
137
  var e;
138
138
  if (!c) {
139
- N("");
139
+ S("");
140
140
  return;
141
141
  }
142
142
  (e = m.current) == null || e.focus();
@@ -144,65 +144,65 @@ const tt = ({
144
144
  if (!c)
145
145
  return;
146
146
  const e = (u) => {
147
- var h;
148
- (h = K.current) != null && h.contains(u.target) || d(!1);
147
+ var _;
148
+ (_ = K.current) != null && _.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
- x || F(e.target.value), D == null || D(e);
155
+ g || F(e.target.value), k == null || k(e);
156
156
  }, W = () => {
157
157
  var e;
158
158
  d(!1), r || (e = G.current) == null || e.focus();
159
159
  }, U = () => {
160
160
  var e;
161
- N(""), d(!0), (e = m.current) == null || e.focus();
161
+ S(""), d(!0), (e = m.current) == null || e.focus();
162
162
  }, X = () => {
163
- !l || !V || (l.onCreate(g), U());
163
+ !l || !E || (l.onCreate(h), U());
164
164
  }, ue = (e) => {
165
165
  var Z;
166
- x || F(e);
166
+ g || F(e);
167
167
  const u = O.current;
168
168
  if (!u) {
169
169
  W();
170
170
  return;
171
171
  }
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", {
172
+ const _ = (Z = Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype, "value")) == null ? void 0 : Z.set;
173
+ _ == null || _.call(u, e), u.dispatchEvent(new Event("change", {
174
174
  bubbles: !0
175
175
  })), r ? U() : W();
176
176
  }, de = (e) => {
177
- e.key === "Escape" && W(), e.key === "Enter" && e.target === m.current && V && (e.preventDefault(), X());
178
- }, Y = /* @__PURE__ */ p("div", { className: I(o.dropdown, _ === "inline" && o.inline, _ === "minimal" && o.minimal, i), onKeyDown: de, ref: K, ...re, children: [
179
- /* @__PURE__ */ s("select", { ...y, "aria-hidden": "true", className: o.native, onChange: ce, ref: O, tabIndex: -1, value: C, children: k.children }),
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 }),
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": y["aria-label"] ?? a ?? B, className: o["combobox-input"], disabled: y.disabled, onChange: (e) => {
186
- N(e.target.value), d(!0);
187
- }, onClick: () => d(!0), onFocus: () => d(!0), placeholder: B || void 0, ref: m, role: "combobox", type: "text", value: S })
188
- ] }) : /* @__PURE__ */ s(M, { "aria-expanded": c, "aria-haspopup": "dialog", "aria-labelledby": a ? `${w} ${w}-value` : void 0, className: I(o.trigger, (E == null ? void 0 : E.isPlaceholder) && o.placeholder), "data-open": c ? "true" : void 0, disabled: y.disabled, onClick: () => d((e) => !e), ref: G, style: ie, variant: "tertiary", children: /* @__PURE__ */ s("span", { className: o.text, id: `${w}-value`, children: J(E) }) }),
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) }) }),
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) => N(e.target.value), placeholder: B, ref: m, style: se, type: "search", value: S }),
191
- /* @__PURE__ */ p(xe, { "aria-label": "Dropdown", className: o.options, 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 }),
191
+ /* @__PURE__ */ p(ge, { "aria-label": "Dropdown", className: o.options, children: [
192
192
  H.map((e) => {
193
- const u = e.value === C;
194
- return /* @__PURE__ */ s("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(M, { "aria-label": u ? `${e.text}, selected` : e.text, className: I(o.option, u && o.selected), disabled: e.disabled, onClick: () => ue(e.value), variant: "tertiary", children: [
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: [
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
- V && l && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(M, { "aria-label": $(l.render(g)) || g, className: o.option, onClick: X, variant: "tertiary", children: /* @__PURE__ */ s("span", { className: o.text, children: l.render(g) }) }) }),
200
- H.length === 0 && !V && /* @__PURE__ */ s("li", { className: o.empty, children: n })
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) }) }) }),
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: I(o.label, _ === "inline" && o["inline-field"]), "data-component": "dropdown", children: [
205
- /* @__PURE__ */ s("span", { id: w, children: ae }),
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 }),
206
206
  Y
207
207
  ] }) : Y;
208
208
  };
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index46.css');const r=require("react/jsx-runtime"),l=require("../../classix-5H4IWnMA.cjs"),t=require("../../icons-Dx0NQYLH.cjs"),m="_icon_vhz6u_1",u="_small_vhz6u_10",_="_medium_vhz6u_15",g="_large_vhz6u_20",d="_danger_vhz6u_25",e={icon:m,small:u,medium:_,large:g,danger:d,"gap-right":"_gap-right_vhz6u_29","gap-left":"_gap-left_vhz6u_33"},h={large:e.large,medium:e.medium,small:e.small},v={danger:e.danger},z=({fill:o,gap:n="none",name:a,size:c="medium",variant:s})=>{const i={maskImage:t.iconSVG(a,o??!1)};return r.jsx("span",{"aria-hidden":"true",className:l.t(n!=="none"&&e[`gap-${n}`],h[c],e.icon,s&&v[s]),style:i,"data-component":"icon"})},p=()=>Object.keys(t.iconPaths);exports.Icon=z;exports.Icons=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index46.css');const m=require("react/jsx-runtime"),r=require("../../classix-5H4IWnMA.cjs"),t=require("../../icons-Dx0NQYLH.cjs"),l="_icon_ihnm9_1",_="_small_ihnm9_10",g="_medium_ihnm9_15",d="_large_ihnm9_20",u="_danger_ihnm9_25",n={icon:l,small:_,medium:g,large:d,danger:u,"gap-right":"_gap-right_ihnm9_29","gap-left":"_gap-left_ihnm9_33"},h={large:n.large,medium:n.medium,small:n.small},p={danger:n.danger},y=({fill:i,gap:e="none",name:o,size:a="medium",variant:s})=>{const c={maskImage:t.iconSVG(o,i??!1)};return m.jsx("span",{"aria-hidden":"true",className:r.t(e!=="none"&&n[`gap-${e}`],h[a],n.icon,s&&p[s]),style:c,"data-component":"icon"})},I=()=>Object.keys(t.iconPaths);exports.Icon=y;exports.Icons=I;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,34 +1,34 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { t as c } from "../../classix-DG18itHa.js";
3
- import { i, a as l } from "../../icons-BFgf_lJN.js";
4
- import '../../assets/index46.css';const _ = "_icon_vhz6u_1", g = "_small_vhz6u_10", u = "_medium_vhz6u_15", d = "_large_vhz6u_20", h = "_danger_vhz6u_25", n = {
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { t as r } from "../../classix-DG18itHa.js";
3
+ import { i as c, a as l } from "../../icons-BFgf_lJN.js";
4
+ import '../../assets/index46.css';const _ = "_icon_ihnm9_1", g = "_small_ihnm9_10", d = "_medium_ihnm9_15", h = "_large_ihnm9_20", p = "_danger_ihnm9_25", n = {
5
5
  icon: _,
6
6
  small: g,
7
- medium: u,
8
- large: d,
9
- danger: h,
10
- "gap-right": "_gap-right_vhz6u_29",
11
- "gap-left": "_gap-left_vhz6u_33"
12
- }, p = {
7
+ medium: d,
8
+ large: h,
9
+ danger: p,
10
+ "gap-right": "_gap-right_ihnm9_29",
11
+ "gap-left": "_gap-left_ihnm9_33"
12
+ }, u = {
13
13
  large: n.large,
14
14
  medium: n.medium,
15
15
  small: n.small
16
- }, z = {
16
+ }, f = {
17
17
  danger: n.danger
18
- }, I = ({
19
- fill: s,
18
+ }, k = ({
19
+ fill: a,
20
20
  gap: e = "none",
21
- name: o,
22
- size: t = "medium",
23
- variant: a
21
+ name: s,
22
+ size: o = "medium",
23
+ variant: m
24
24
  }) => {
25
- const m = {
26
- maskImage: i(o, s ?? !1)
25
+ const i = {
26
+ maskImage: c(s, a ?? !1)
27
27
  };
28
- return /* @__PURE__ */ r("span", { "aria-hidden": "true", className: c(e !== "none" && n[`gap-${e}`], p[t], n.icon, a && z[a]), style: m, "data-component": "icon" });
29
- }, j = () => Object.keys(l);
28
+ return /* @__PURE__ */ t("span", { "aria-hidden": "true", className: r(e !== "none" && n[`gap-${e}`], u[o], n.icon, m && f[m]), style: i, "data-component": "icon" });
29
+ }, x = () => Object.keys(l);
30
30
  export {
31
- I as Icon,
32
- j as Icons
31
+ k as Icon,
32
+ x as Icons
33
33
  };
34
34
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index19.css');const o=require("react/jsx-runtime"),S=require("../../classix-5H4IWnMA.cjs"),n=require("react"),q=require("../button/index.cjs"),B=require("../dialog/index.cjs"),G="_wrapper_owo4o_1",R="_toolbar_owo4o_6",V="_iframe_owo4o_16",c={wrapper:G,toolbar:R,"fullscreen-toolbar":"_fullscreen-toolbar_owo4o_7",iframe:V,"fullscreen-dialog":"_fullscreen-dialog_owo4o_22","fullscreen-iframe":"_fullscreen-iframe_owo4o_40"},f=120,$=12e3,L=8,X=({accessibleLabel:m,autoResize:l=!1,className:H,closeFullscreenLabel:A="Close fullscreen",fullscreenLabel:C="View in fullscreen",hasFullscreenView:I=!0,loading:O="lazy",onLoad:h,referrerPolicy:x="no-referrer",sandbox:y="",srcDoc:w,style:E,...b})=>{const _=n.useRef(null),i=n.useRef(null),s=n.useRef(null),[N,M]=n.useState(f),[T,g]=n.useState(!1),p=n.useCallback(()=>{i.current!==null&&(window.cancelAnimationFrame(i.current),i.current=null),s.current!==null&&(window.clearTimeout(s.current),s.current=null)},[]),v=n.useCallback(()=>{if(!l)return;const t=_.current,e=t==null?void 0:t.contentDocument;if(!t||!e)return;const d=t.style.height;try{t.style.height=`${f}px`;const a=e.querySelector("[data-iframe-content]")??e.body,u=a.getBoundingClientRect(),{body:j,documentElement:F}=e,U=Math.min(Math.max(Math.ceil(Math.max(a.scrollHeight,a.offsetHeight,u.height,j.scrollHeight,j.offsetHeight,F.scrollHeight,F.offsetHeight)+L),f),$);M(U)}catch{}finally{t.style.height=d}},[l]),r=n.useCallback(()=>{!l||i.current!==null||(i.current=window.requestAnimationFrame(()=>{i.current=null,v(),s.current!==null&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{s.current=null,v()},250)}))},[l,v]),k=t=>{var d,a;r();const e=(d=_.current)==null?void 0:d.contentDocument;Array.from((e==null?void 0:e.images)??[]).forEach(u=>{u.complete||(u.addEventListener("load",r,{once:!0}),u.addEventListener("error",r,{once:!0}))}),(a=e==null?void 0:e.fonts)==null||a.ready.then(r).catch(()=>{}),h==null||h(t)};return n.useEffect(()=>{if(l)return p(),M(f),r(),p},[l,p,r,w]),n.useEffect(()=>{var t;if(l)return window.addEventListener("resize",r),(t=window.visualViewport)==null||t.addEventListener("resize",r),()=>{var e;window.removeEventListener("resize",r),(e=window.visualViewport)==null||e.removeEventListener("resize",r)}},[l,r]),o.jsxs("div",{className:c.wrapper,"data-component":"iframe",children:[I&&o.jsx("div",{className:c.toolbar,children:o.jsx(q.Button,{"aria-expanded":T,"aria-haspopup":"dialog",onClick:()=>g(!0),variant:"tertiary",children:C})}),o.jsx("iframe",{...b,className:S.t(c.iframe,H),loading:O,onLoad:k,ref:_,referrerPolicy:x,sandbox:y,srcDoc:w,style:l?{...E,height:N,minHeight:f}:E,title:m}),T&&o.jsxs(B.Dialog,{"aria-label":`${m} fullscreen`,className:c["fullscreen-dialog"],open:!0,setOpen:g,children:[o.jsx("div",{className:c["fullscreen-toolbar"],children:o.jsx(q.Button,{autoFocus:!0,onClick:()=>g(!1),children:A})}),o.jsx("iframe",{...b,className:S.t(c.iframe,c["fullscreen-iframe"],H),loading:"eager",referrerPolicy:x,sandbox:y,srcDoc:w,title:`${m} fullscreen`})]})]})};exports.Iframe=X;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index19.css');const r=require("react/jsx-runtime"),S=require("../../classix-5H4IWnMA.cjs"),s=require("react"),A=require("../button/index.cjs"),N=require("../controls/index.cjs"),z=require("../dialog/index.cjs"),G=require("../header/index.cjs"),R="_wrapper_29z62_1",V="_toolbar_29z62_6",$="_iframe_29z62_12",a={wrapper:R,toolbar:V,iframe:$,"fullscreen-iframe":"_fullscreen-iframe_29z62_18"},d=120,L=12e3,X=8,J=({accessibleLabel:f,autoResize:l=!1,className:v,closeFullscreenLabel:F="Close fullscreen",fullscreenLabel:I="View in fullscreen",hasFullscreenView:O=!0,loading:b="lazy",onLoad:h,referrerPolicy:H="no-referrer",sandbox:y="",srcDoc:w,style:E,...j})=>{const _=s.useRef(null),c=s.useRef(null),i=s.useRef(null),[k,M]=s.useState(d),[T,p]=s.useState(!1),g=s.useCallback(()=>{c.current!==null&&(window.cancelAnimationFrame(c.current),c.current=null),i.current!==null&&(window.clearTimeout(i.current),i.current=null)},[]),x=s.useCallback(()=>{if(!l)return;const t=_.current,e=t==null?void 0:t.contentDocument;if(!t||!e)return;const m=t.style.height;try{t.style.height=`${d}px`;const o=e.querySelector("[data-iframe-content]")??e.body,u=o.getBoundingClientRect(),{body:q,documentElement:C}=e,B=Math.min(Math.max(Math.ceil(Math.max(o.scrollHeight,o.offsetHeight,u.height,q.scrollHeight,q.offsetHeight,C.scrollHeight,C.offsetHeight)+X),d),L);M(B)}catch{}finally{t.style.height=m}},[l]),n=s.useCallback(()=>{!l||c.current!==null||(c.current=window.requestAnimationFrame(()=>{c.current=null,x(),i.current!==null&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{i.current=null,x()},250)}))},[l,x]),U=t=>{var m,o;n();const e=(m=_.current)==null?void 0:m.contentDocument;Array.from((e==null?void 0:e.images)??[]).forEach(u=>{u.complete||(u.addEventListener("load",n,{once:!0}),u.addEventListener("error",n,{once:!0}))}),(o=e==null?void 0:e.fonts)==null||o.ready.then(n).catch(()=>{}),h==null||h(t)};return s.useEffect(()=>{if(l)return g(),M(d),n(),g},[l,g,n,w]),s.useEffect(()=>{var t;if(l)return window.addEventListener("resize",n),(t=window.visualViewport)==null||t.addEventListener("resize",n),()=>{var e;window.removeEventListener("resize",n),(e=window.visualViewport)==null||e.removeEventListener("resize",n)}},[l,n]),r.jsxs("div",{className:a.wrapper,"data-component":"iframe",children:[O&&r.jsx("div",{className:a.toolbar,children:r.jsx(A.Button,{"aria-expanded":T,"aria-haspopup":"dialog",onClick:()=>p(!0),variant:"tertiary",children:I})}),r.jsx("iframe",{...j,className:S.t(a.iframe,v),loading:b,onLoad:U,ref:_,referrerPolicy:H,sandbox:y,srcDoc:w,style:l?{...E,height:k,minHeight:d}:E,title:f}),T&&r.jsx(z.Dialog,{"aria-label":`${f} fullscreen`,controls:r.jsx(N.Controls,{children:r.jsx(A.Button,{onClick:()=>p(!1),children:F})}),fullscreen:!0,header:r.jsx(G.Header,{children:r.jsx("h2",{children:f})}),open:!0,setOpen:p,children:r.jsx("iframe",{...j,className:S.t(a.iframe,a["fullscreen-iframe"],v),loading:"eager",referrerPolicy:H,sandbox:y,srcDoc:w,title:`${f} fullscreen`})})]})};exports.Iframe=J;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/iframe/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { type ComponentPropsWithoutRef, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { Button } from '../button';\nimport { Dialog } from '../dialog';\nimport styles from './styles.module.css';\n\nconst MIN_AUTO_HEIGHT = 120;\nconst MAX_AUTO_HEIGHT = 12000;\nconst AUTO_HEIGHT_BUFFER = 8;\n\nexport type IframeProps = Omit<ComponentPropsWithoutRef<'iframe'>, 'src' | 'srcDoc' | 'title'> & {\n accessibleLabel: string;\n autoResize?: boolean;\n closeFullscreenLabel?: string;\n fullscreenLabel?: string;\n hasFullscreenView?: boolean;\n srcDoc: string;\n};\n\nexport const Iframe = ({\n accessibleLabel,\n autoResize = false,\n className,\n closeFullscreenLabel = 'Close fullscreen',\n fullscreenLabel = 'View in fullscreen',\n hasFullscreenView = true,\n loading = 'lazy',\n onLoad,\n referrerPolicy = 'no-referrer',\n sandbox = '',\n srcDoc,\n style,\n ...props\n}: IframeProps) => {\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const measurementFrameRef = useRef<number | null>(null);\n const followUpMeasurementTimeoutRef = useRef<number | null>(null);\n const [measuredHeight, setMeasuredHeight] = useState(MIN_AUTO_HEIGHT);\n const [isFullscreenOpen, setIsFullscreenOpen] = useState(false);\n\n const clearScheduledMeasurements = useCallback(() => {\n if (measurementFrameRef.current !== null) {\n window.cancelAnimationFrame(measurementFrameRef.current);\n measurementFrameRef.current = null;\n }\n\n if (followUpMeasurementTimeoutRef.current !== null) {\n window.clearTimeout(followUpMeasurementTimeoutRef.current);\n followUpMeasurementTimeoutRef.current = null;\n }\n }, []);\n\n const measureSize = useCallback(() => {\n if (!autoResize) return;\n\n const iframe = iframeRef.current;\n const iframeDocument = iframe?.contentDocument;\n if (!iframe || !iframeDocument) return;\n\n const renderedHeight = iframe.style.height;\n\n try {\n // measure from a stable viewport height so content sized with percentages or\n // viewport units cannot feed the iframe's previous height back into itself\n iframe.style.height = `${MIN_AUTO_HEIGHT}px`;\n\n const content =\n iframeDocument.querySelector<HTMLElement>('[data-iframe-content]') ?? iframeDocument.body;\n const contentRect = content.getBoundingClientRect();\n const { body, documentElement } = iframeDocument;\n const height = Math.min(\n Math.max(\n Math.ceil(\n Math.max(\n content.scrollHeight,\n content.offsetHeight,\n contentRect.height,\n body.scrollHeight,\n body.offsetHeight,\n documentElement.scrollHeight,\n documentElement.offsetHeight\n ) + AUTO_HEIGHT_BUFFER\n ),\n MIN_AUTO_HEIGHT\n ),\n MAX_AUTO_HEIGHT\n );\n\n setMeasuredHeight(height);\n } catch {\n // cross-origin iframe content cannot be measured; retain minimum height\n } finally {\n iframe.style.height = renderedHeight;\n }\n }, [autoResize]);\n\n const scheduleSizeMeasurement = useCallback(() => {\n if (!autoResize || measurementFrameRef.current !== null) return;\n\n measurementFrameRef.current = window.requestAnimationFrame(() => {\n measurementFrameRef.current = null;\n measureSize();\n\n if (followUpMeasurementTimeoutRef.current !== null) {\n window.clearTimeout(followUpMeasurementTimeoutRef.current);\n }\n\n followUpMeasurementTimeoutRef.current = window.setTimeout(() => {\n followUpMeasurementTimeoutRef.current = null;\n measureSize();\n }, 250);\n });\n }, [autoResize, measureSize]);\n\n const handleLoad: NonNullable<IframeProps['onLoad']> = (event) => {\n scheduleSizeMeasurement();\n\n const iframeDocument = iframeRef.current?.contentDocument;\n Array.from(iframeDocument?.images ?? []).forEach((image) => {\n if (image.complete) return;\n image.addEventListener('load', scheduleSizeMeasurement, { once: true });\n image.addEventListener('error', scheduleSizeMeasurement, { once: true });\n });\n iframeDocument?.fonts?.ready.then(scheduleSizeMeasurement).catch(() => undefined);\n\n onLoad?.(event);\n };\n\n useEffect(() => {\n if (!autoResize) return undefined;\n\n clearScheduledMeasurements();\n setMeasuredHeight(MIN_AUTO_HEIGHT);\n scheduleSizeMeasurement();\n\n return clearScheduledMeasurements;\n }, [autoResize, clearScheduledMeasurements, scheduleSizeMeasurement, srcDoc]);\n\n useEffect(() => {\n if (!autoResize) return undefined;\n\n window.addEventListener('resize', scheduleSizeMeasurement);\n window.visualViewport?.addEventListener('resize', scheduleSizeMeasurement);\n\n return () => {\n window.removeEventListener('resize', scheduleSizeMeasurement);\n window.visualViewport?.removeEventListener('resize', scheduleSizeMeasurement);\n };\n }, [autoResize, scheduleSizeMeasurement]);\n\n return (\n <div className={styles.wrapper}>\n {hasFullscreenView && (\n <div className={styles.toolbar}>\n <Button\n aria-expanded={isFullscreenOpen}\n aria-haspopup='dialog'\n onClick={() => setIsFullscreenOpen(true)}\n variant='tertiary'\n >\n {fullscreenLabel}\n </Button>\n </div>\n )}\n <iframe\n {...props}\n className={cx(styles.iframe, className)}\n loading={loading}\n onLoad={handleLoad}\n ref={iframeRef}\n referrerPolicy={referrerPolicy}\n sandbox={sandbox}\n srcDoc={srcDoc}\n style={\n autoResize\n ? {\n ...style,\n height: measuredHeight,\n minHeight: MIN_AUTO_HEIGHT,\n }\n : style\n }\n title={accessibleLabel}\n />\n {isFullscreenOpen && (\n <Dialog\n aria-label={`${accessibleLabel} fullscreen`}\n className={styles['fullscreen-dialog']}\n open\n setOpen={setIsFullscreenOpen}\n >\n <div className={styles['fullscreen-toolbar']}>\n <Button\n autoFocus\n onClick={() => setIsFullscreenOpen(false)}\n >\n {closeFullscreenLabel}\n </Button>\n </div>\n <iframe\n {...props}\n className={cx(styles.iframe, styles['fullscreen-iframe'], className)}\n loading='eager'\n referrerPolicy={referrerPolicy}\n sandbox={sandbox}\n srcDoc={srcDoc}\n title={`${accessibleLabel} fullscreen`}\n />\n </Dialog>\n )}\n </div>\n );\n};\n"],"names":["MIN_AUTO_HEIGHT","MAX_AUTO_HEIGHT","AUTO_HEIGHT_BUFFER","Iframe","accessibleLabel","autoResize","className","closeFullscreenLabel","fullscreenLabel","hasFullscreenView","loading","onLoad","referrerPolicy","sandbox","srcDoc","style","props","iframeRef","useRef","measurementFrameRef","followUpMeasurementTimeoutRef","measuredHeight","setMeasuredHeight","useState","isFullscreenOpen","setIsFullscreenOpen","clearScheduledMeasurements","useCallback","current","window","cancelAnimationFrame","clearTimeout","measureSize","iframe","iframeDocument","contentDocument","renderedHeight","height","content","querySelector","body","contentRect","getBoundingClientRect","documentElement","Math","min","max","ceil","scrollHeight","offsetHeight","scheduleSizeMeasurement","requestAnimationFrame","setTimeout","handleLoad","event","Array","from","images","forEach","image","complete","addEventListener","once","fonts","ready","then","catch","useEffect","visualViewport","removeEventListener","styles","wrapper","toolbar","jsx","Button","cx","minHeight","jsxs","Dialog"],"mappings":"yeAOMA,EAAkB,IAClBC,EAAkB,KAClBC,EAAqB,EAWdC,EAASA,CAAC,CACrBC,gBAAAA,EACAC,WAAAA,EAAa,GACbC,UAAAA,EACAC,qBAAAA,EAAuB,mBACvBC,gBAAAA,EAAkB,qBAClBC,kBAAAA,EAAoB,GACpBC,QAAAA,EAAU,OACVC,OAAAA,EACAC,eAAAA,EAAiB,cACjBC,QAAAA,EAAU,GACVC,OAAAA,EACAC,MAAAA,EACA,GAAGC,CACQ,IAAM,CACjB,MAAMC,EAAYC,EAAAA,OAA0B,IAAI,EAC1CC,EAAsBD,EAAAA,OAAsB,IAAI,EAChDE,EAAgCF,EAAAA,OAAsB,IAAI,EAC1D,CAACG,EAAgBC,CAAiB,EAAIC,EAAAA,SAASvB,CAAe,EAC9D,CAACwB,EAAkBC,CAAmB,EAAIF,EAAAA,SAAS,EAAK,EAExDG,EAA6BC,EAAAA,YAAY,IAAM,CAC/CR,EAAoBS,UAAY,OAClCC,OAAOC,qBAAqBX,EAAoBS,OAAO,EACvDT,EAAoBS,QAAU,MAG5BR,EAA8BQ,UAAY,OAC5CC,OAAOE,aAAaX,EAA8BQ,OAAO,EACzDR,EAA8BQ,QAAU,KAE5C,EAAG,CAAA,CAAE,EAECI,EAAcL,EAAAA,YAAY,IAAM,CACpC,GAAI,CAACtB,EAAY,OAEjB,MAAM4B,EAAShB,EAAUW,QACnBM,EAAiBD,GAAAA,YAAAA,EAAQE,gBAC/B,GAAI,CAACF,GAAU,CAACC,EAAgB,OAEhC,MAAME,EAAiBH,EAAOlB,MAAMsB,OAEpC,GAAI,C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AAI,UAAWH,EAAO,oBAAoB,EACzC,SAAAG,EAAAA,IAACC,EAAAA,OAAA,CACC,UAAS,GACT,QAAS,IAAMjD,EAAoB,EAAK,EAEvClB,WACH,EACF,EACAkE,MAAC,UACC,GAAIzD,EACJ,UAAW2D,EAAAA,EAAGL,EAAOrC,OAAQqC,EAAO,mBAAmB,EAAGhE,CAAS,EACnE,QAAQ,QACR,eAAAM,EACA,QAAAC,EACA,OAAAC,EACA,MAAO,GAAGV,CAAe,aAAA,CAAc,CAAA,CAAA,CAE3C,CAAA,EAEJ,CAEJ"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/iframe/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { type ComponentPropsWithoutRef, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { Button } from '../button';\nimport { Controls } from '../controls';\nimport { Dialog } from '../dialog';\nimport { Header } from '../header';\nimport styles from './styles.module.css';\n\nconst MIN_AUTO_HEIGHT = 120;\nconst MAX_AUTO_HEIGHT = 12000;\nconst AUTO_HEIGHT_BUFFER = 8;\n\nexport type IframeProps = Omit<ComponentPropsWithoutRef<'iframe'>, 'src' | 'srcDoc' | 'title'> & {\n accessibleLabel: string;\n autoResize?: boolean;\n closeFullscreenLabel?: string;\n fullscreenLabel?: string;\n hasFullscreenView?: boolean;\n srcDoc: string;\n};\n\nexport const Iframe = ({\n accessibleLabel,\n autoResize = false,\n className,\n closeFullscreenLabel = 'Close fullscreen',\n fullscreenLabel = 'View in fullscreen',\n hasFullscreenView = true,\n loading = 'lazy',\n onLoad,\n referrerPolicy = 'no-referrer',\n sandbox = '',\n srcDoc,\n style,\n ...props\n}: IframeProps) => {\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const measurementFrameRef = useRef<number | null>(null);\n const followUpMeasurementTimeoutRef = useRef<number | null>(null);\n const [measuredHeight, setMeasuredHeight] = useState(MIN_AUTO_HEIGHT);\n const [isFullscreenOpen, setIsFullscreenOpen] = useState(false);\n\n const clearScheduledMeasurements = useCallback(() => {\n if (measurementFrameRef.current !== null) {\n window.cancelAnimationFrame(measurementFrameRef.current);\n measurementFrameRef.current = null;\n }\n\n if (followUpMeasurementTimeoutRef.current !== null) {\n window.clearTimeout(followUpMeasurementTimeoutRef.current);\n followUpMeasurementTimeoutRef.current = null;\n }\n }, []);\n\n const measureSize = useCallback(() => {\n if (!autoResize) return;\n\n const iframe = iframeRef.current;\n const iframeDocument = iframe?.contentDocument;\n if (!iframe || !iframeDocument) return;\n\n const renderedHeight = iframe.style.height;\n\n try {\n // measure from a stable viewport height so content sized with percentages or\n // viewport units cannot feed the iframe's previous height back into itself\n iframe.style.height = `${MIN_AUTO_HEIGHT}px`;\n\n const content =\n iframeDocument.querySelector<HTMLElement>('[data-iframe-content]') ?? iframeDocument.body;\n const contentRect = content.getBoundingClientRect();\n const { body, documentElement } = iframeDocument;\n const height = Math.min(\n Math.max(\n Math.ceil(\n Math.max(\n content.scrollHeight,\n content.offsetHeight,\n contentRect.height,\n body.scrollHeight,\n body.offsetHeight,\n documentElement.scrollHeight,\n documentElement.offsetHeight\n ) + AUTO_HEIGHT_BUFFER\n ),\n MIN_AUTO_HEIGHT\n ),\n MAX_AUTO_HEIGHT\n );\n\n setMeasuredHeight(height);\n } catch {\n // cross-origin iframe content cannot be measured; retain minimum height\n } finally {\n iframe.style.height = renderedHeight;\n }\n }, [autoResize]);\n\n const scheduleSizeMeasurement = useCallback(() => {\n if (!autoResize || measurementFrameRef.current !== null) return;\n\n measurementFrameRef.current = window.requestAnimationFrame(() => {\n measurementFrameRef.current = null;\n measureSize();\n\n if (followUpMeasurementTimeoutRef.current !== null) {\n window.clearTimeout(followUpMeasurementTimeoutRef.current);\n }\n\n followUpMeasurementTimeoutRef.current = window.setTimeout(() => {\n followUpMeasurementTimeoutRef.current = null;\n measureSize();\n }, 250);\n });\n }, [autoResize, measureSize]);\n\n const handleLoad: NonNullable<IframeProps['onLoad']> = (event) => {\n scheduleSizeMeasurement();\n\n const iframeDocument = iframeRef.current?.contentDocument;\n Array.from(iframeDocument?.images ?? []).forEach((image) => {\n if (image.complete) return;\n image.addEventListener('load', scheduleSizeMeasurement, { once: true });\n image.addEventListener('error', scheduleSizeMeasurement, { once: true });\n });\n iframeDocument?.fonts?.ready.then(scheduleSizeMeasurement).catch(() => undefined);\n\n onLoad?.(event);\n };\n\n useEffect(() => {\n if (!autoResize) return undefined;\n\n clearScheduledMeasurements();\n setMeasuredHeight(MIN_AUTO_HEIGHT);\n scheduleSizeMeasurement();\n\n return clearScheduledMeasurements;\n }, [autoResize, clearScheduledMeasurements, scheduleSizeMeasurement, srcDoc]);\n\n useEffect(() => {\n if (!autoResize) return undefined;\n\n window.addEventListener('resize', scheduleSizeMeasurement);\n window.visualViewport?.addEventListener('resize', scheduleSizeMeasurement);\n\n return () => {\n window.removeEventListener('resize', scheduleSizeMeasurement);\n window.visualViewport?.removeEventListener('resize', scheduleSizeMeasurement);\n };\n }, [autoResize, scheduleSizeMeasurement]);\n\n return (\n <div className={styles.wrapper}>\n {hasFullscreenView && (\n <div className={styles.toolbar}>\n <Button\n aria-expanded={isFullscreenOpen}\n aria-haspopup='dialog'\n onClick={() => setIsFullscreenOpen(true)}\n variant='tertiary'\n >\n {fullscreenLabel}\n </Button>\n </div>\n )}\n <iframe\n {...props}\n className={cx(styles.iframe, className)}\n loading={loading}\n onLoad={handleLoad}\n ref={iframeRef}\n referrerPolicy={referrerPolicy}\n sandbox={sandbox}\n srcDoc={srcDoc}\n style={\n autoResize\n ? {\n ...style,\n height: measuredHeight,\n minHeight: MIN_AUTO_HEIGHT,\n }\n : style\n }\n title={accessibleLabel}\n />\n {isFullscreenOpen && (\n <Dialog\n aria-label={`${accessibleLabel} fullscreen`}\n controls={\n <Controls>\n <Button onClick={() => setIsFullscreenOpen(false)}>{closeFullscreenLabel}</Button>\n </Controls>\n }\n fullscreen\n header={\n <Header>\n <h2>{accessibleLabel}</h2>\n </Header>\n }\n open\n setOpen={setIsFullscreenOpen}\n >\n <iframe\n {...props}\n className={cx(styles.iframe, styles['fullscreen-iframe'], className)}\n loading='eager'\n referrerPolicy={referrerPolicy}\n sandbox={sandbox}\n srcDoc={srcDoc}\n title={`${accessibleLabel} fullscreen`}\n />\n </Dialog>\n )}\n </div>\n );\n};\n"],"names":["MIN_AUTO_HEIGHT","MAX_AUTO_HEIGHT","AUTO_HEIGHT_BUFFER","Iframe","accessibleLabel","autoResize","className","closeFullscreenLabel","fullscreenLabel","hasFullscreenView","loading","onLoad","referrerPolicy","sandbox","srcDoc","style","props","iframeRef","useRef","measurementFrameRef","followUpMeasurementTimeoutRef","measuredHeight","setMeasuredHeight","useState","isFullscreenOpen","setIsFullscreenOpen","clearScheduledMeasurements","useCallback","current","window","cancelAnimationFrame","clearTimeout","measureSize","iframe","iframeDocument","contentDocument","renderedHeight","height","content","querySelector","body","contentRect","getBoundingClientRect","documentElement","Math","min","max","ceil","scrollHeight","offsetHeight","scheduleSizeMeasurement","requestAnimationFrame","setTimeout","handleLoad","event","Array","from","images","forEach","image","complete","addEventListener","once","fonts","ready","then","catch","useEffect","visualViewport","removeEventListener","styles","wrapper","toolbar","jsx","Button","cx","minHeight","Dialog","Controls","Header"],"mappings":"wcASMA,EAAkB,IAClBC,EAAkB,KAClBC,EAAqB,EAWdC,EAASA,CAAC,CACrBC,gBAAAA,EACAC,WAAAA,EAAa,GACbC,UAAAA,EACAC,qBAAAA,EAAuB,mBACvBC,gBAAAA,EAAkB,qBAClBC,kBAAAA,EAAoB,GACpBC,QAAAA,EAAU,OACVC,OAAAA,EACAC,eAAAA,EAAiB,cACjBC,QAAAA,EAAU,GACVC,OAAAA,EACAC,MAAAA,EACA,GAAGC,CACQ,IAAM,CACjB,MAAMC,EAAYC,EAAAA,OAA0B,IAAI,EAC1CC,EAAsBD,EAAAA,OAAsB,IAAI,EAChDE,EAAgCF,EAAAA,OAAsB,IAAI,EAC1D,CAACG,EAAgBC,CAAiB,EAAIC,EAAAA,SAASvB,CAAe,EAC9D,CAACwB,EAAkB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QACC,gBAAelD,EACf,gBAAc,SACd,QAAS,IAAMC,EAAoB,EAAI,EACvC,QAAQ,WAEPjB,WACH,CAAA,CACF,QAED,SAAA,CACC,GAAIQ,EACJ,UAAW2D,IAAGL,EAAOrC,OAAQ3B,CAAS,EACtC,QAAAI,EACA,OAAQ2C,EACR,IAAKpC,EACL,eAAAL,EACA,QAAAC,EACA,OAAAC,EACA,MACET,EACI,CACE,GAAGU,EACHsB,OAAQhB,EACRuD,UAAW5E,CAAAA,EAEbe,EAEN,MAAOX,EAAgB,EAExBoB,GACCiD,EAAAA,IAACI,EAAAA,OAAA,CACC,aAAY,GAAGzE,CAAe,cAC9B,SACEqE,EAAAA,IAACK,EAAAA,SAAA,CACC,SAAAL,EAAAA,IAACC,EAAAA,OAAA,CAAO,QAAS,IAAMjD,EAAoB,EAAK,EAAIlB,SAAAA,CAAAA,CAAqB,CAAA,CAC3E,EAEF,WAAU,GACV,OACEkE,EAAAA,IAACM,EAAAA,OAAA,CACC,SAAAN,EAAAA,IAAC,KAAA,CAAIrE,SAAAA,CAAAA,CAAgB,EACvB,EAEF,KAAI,GACJ,QAASqB,EAET,SAAAgD,EAAAA,IAAC,SAAA,CACC,GAAIzD,EACJ,UAAW2D,EAAAA,EAAGL,EAAOrC,OAAQqC,EAAO,mBAAmB,EAAGhE,CAAS,EACnE,QAAQ,QACR,eAAAM,EACA,QAAAC,EACA,OAAAC,EACA,MAAO,GAAGV,CAAe,aAAA,CAAc,CAAA,CAE3C,CAAA,EAEJ,CAEJ"}
@@ -1,91 +1,88 @@
1
- import { jsxs as N, jsx as s } from "react/jsx-runtime";
1
+ import { jsxs as q, jsx as l } from "react/jsx-runtime";
2
2
  import { t as O } from "../../classix-DG18itHa.js";
3
- import { useRef as v, useState as C, useCallback as H, useEffect as S } from "react";
4
- import { Button as U } from "../button/index.js";
3
+ import { useRef as H, useState as S, useCallback as v, useEffect as U } from "react";
4
+ import { Button as N } from "../button/index.js";
5
+ import { Controls as b } from "../controls/index.js";
5
6
  import { Dialog as L } from "../dialog/index.js";
6
- import '../../assets/index19.css';const X = "_wrapper_owo4o_1", J = "_toolbar_owo4o_6", K = "_iframe_owo4o_16", l = {
7
- wrapper: X,
8
- toolbar: J,
9
- "fullscreen-toolbar": "_fullscreen-toolbar_owo4o_7",
10
- iframe: K,
11
- "fullscreen-dialog": "_fullscreen-dialog_owo4o_22",
12
- "fullscreen-iframe": "_fullscreen-iframe_owo4o_40"
13
- }, u = 120, Q = 12e3, W = 8, R = ({
14
- accessibleLabel: m,
7
+ import { Header as X } from "../header/index.js";
8
+ import '../../assets/index19.css';const J = "_wrapper_29z62_1", K = "_toolbar_29z62_6", Q = "_iframe_29z62_12", a = {
9
+ wrapper: J,
10
+ toolbar: K,
11
+ iframe: Q,
12
+ "fullscreen-iframe": "_fullscreen-iframe_29z62_18"
13
+ }, u = 120, W = 12e3, Y = 8, ne = ({
14
+ accessibleLabel: f,
15
15
  autoResize: n = !1,
16
16
  className: E,
17
17
  closeFullscreenLabel: k = "Close fullscreen",
18
- fullscreenLabel: B = "View in fullscreen",
19
- hasFullscreenView: G = !0,
20
- loading: V = "lazy",
18
+ fullscreenLabel: z = "View in fullscreen",
19
+ hasFullscreenView: B = !0,
20
+ loading: G = "lazy",
21
21
  onLoad: d,
22
22
  referrerPolicy: y = "no-referrer",
23
23
  sandbox: M = "",
24
24
  srcDoc: h,
25
25
  style: T,
26
- ...F
26
+ ...A
27
27
  }) => {
28
- const w = v(null), i = v(null), o = v(null), [$, A] = C(u), [b, p] = C(!1), g = H(() => {
29
- i.current !== null && (window.cancelAnimationFrame(i.current), i.current = null), o.current !== null && (window.clearTimeout(o.current), o.current = null);
30
- }, []), _ = H(() => {
28
+ const p = H(null), o = H(null), i = H(null), [V, F] = S(u), [x, w] = S(!1), g = v(() => {
29
+ o.current !== null && (window.cancelAnimationFrame(o.current), o.current = null), i.current !== null && (window.clearTimeout(i.current), i.current = null);
30
+ }, []), _ = v(() => {
31
31
  if (!n) return;
32
- const r = w.current, e = r == null ? void 0 : r.contentDocument;
32
+ const r = p.current, e = r == null ? void 0 : r.contentDocument;
33
33
  if (!r || !e) return;
34
- const f = r.style.height;
34
+ const m = r.style.height;
35
35
  try {
36
36
  r.style.height = `${u}px`;
37
- const c = e.querySelector("[data-iframe-content]") ?? e.body, a = c.getBoundingClientRect(), {
38
- body: x,
37
+ const c = e.querySelector("[data-iframe-content]") ?? e.body, s = c.getBoundingClientRect(), {
38
+ body: C,
39
39
  documentElement: I
40
- } = e, q = Math.min(Math.max(Math.ceil(Math.max(c.scrollHeight, c.offsetHeight, a.height, x.scrollHeight, x.offsetHeight, I.scrollHeight, I.offsetHeight) + W), u), Q);
41
- A(q);
40
+ } = e, j = Math.min(Math.max(Math.ceil(Math.max(c.scrollHeight, c.offsetHeight, s.height, C.scrollHeight, C.offsetHeight, I.scrollHeight, I.offsetHeight) + Y), u), W);
41
+ F(j);
42
42
  } catch {
43
43
  } finally {
44
- r.style.height = f;
44
+ r.style.height = m;
45
45
  }
46
- }, [n]), t = H(() => {
47
- !n || i.current !== null || (i.current = window.requestAnimationFrame(() => {
48
- i.current = null, _(), o.current !== null && window.clearTimeout(o.current), o.current = window.setTimeout(() => {
49
- o.current = null, _();
46
+ }, [n]), t = v(() => {
47
+ !n || o.current !== null || (o.current = window.requestAnimationFrame(() => {
48
+ o.current = null, _(), i.current !== null && window.clearTimeout(i.current), i.current = window.setTimeout(() => {
49
+ i.current = null, _();
50
50
  }, 250);
51
51
  }));
52
- }, [n, _]), j = (r) => {
53
- var f, c;
52
+ }, [n, _]), $ = (r) => {
53
+ var m, c;
54
54
  t();
55
- const e = (f = w.current) == null ? void 0 : f.contentDocument;
56
- Array.from((e == null ? void 0 : e.images) ?? []).forEach((a) => {
57
- a.complete || (a.addEventListener("load", t, {
55
+ const e = (m = p.current) == null ? void 0 : m.contentDocument;
56
+ Array.from((e == null ? void 0 : e.images) ?? []).forEach((s) => {
57
+ s.complete || (s.addEventListener("load", t, {
58
58
  once: !0
59
- }), a.addEventListener("error", t, {
59
+ }), s.addEventListener("error", t, {
60
60
  once: !0
61
61
  }));
62
62
  }), (c = e == null ? void 0 : e.fonts) == null || c.ready.then(t).catch(() => {
63
63
  }), d == null || d(r);
64
64
  };
65
- return S(() => {
65
+ return U(() => {
66
66
  if (n)
67
- return g(), A(u), t(), g;
68
- }, [n, g, t, h]), S(() => {
67
+ return g(), F(u), t(), g;
68
+ }, [n, g, t, h]), U(() => {
69
69
  var r;
70
70
  if (n)
71
71
  return window.addEventListener("resize", t), (r = window.visualViewport) == null || r.addEventListener("resize", t), () => {
72
72
  var e;
73
73
  window.removeEventListener("resize", t), (e = window.visualViewport) == null || e.removeEventListener("resize", t);
74
74
  };
75
- }, [n, t]), /* @__PURE__ */ N("div", { className: l.wrapper, "data-component": "iframe", children: [
76
- G && /* @__PURE__ */ s("div", { className: l.toolbar, children: /* @__PURE__ */ s(U, { "aria-expanded": b, "aria-haspopup": "dialog", onClick: () => p(!0), variant: "tertiary", children: B }) }),
77
- /* @__PURE__ */ s("iframe", { ...F, className: O(l.iframe, E), loading: V, onLoad: j, ref: w, referrerPolicy: y, sandbox: M, srcDoc: h, style: n ? {
75
+ }, [n, t]), /* @__PURE__ */ q("div", { className: a.wrapper, "data-component": "iframe", children: [
76
+ B && /* @__PURE__ */ l("div", { className: a.toolbar, children: /* @__PURE__ */ l(N, { "aria-expanded": x, "aria-haspopup": "dialog", onClick: () => w(!0), variant: "tertiary", children: z }) }),
77
+ /* @__PURE__ */ l("iframe", { ...A, className: O(a.iframe, E), loading: G, onLoad: $, ref: p, referrerPolicy: y, sandbox: M, srcDoc: h, style: n ? {
78
78
  ...T,
79
- height: $,
79
+ height: V,
80
80
  minHeight: u
81
- } : T, title: m }),
82
- b && /* @__PURE__ */ N(L, { "aria-label": `${m} fullscreen`, className: l["fullscreen-dialog"], open: !0, setOpen: p, children: [
83
- /* @__PURE__ */ s("div", { className: l["fullscreen-toolbar"], children: /* @__PURE__ */ s(U, { autoFocus: !0, onClick: () => p(!1), children: k }) }),
84
- /* @__PURE__ */ s("iframe", { ...F, className: O(l.iframe, l["fullscreen-iframe"], E), loading: "eager", referrerPolicy: y, sandbox: M, srcDoc: h, title: `${m} fullscreen` })
85
- ] })
81
+ } : T, title: f }),
82
+ x && /* @__PURE__ */ l(L, { "aria-label": `${f} fullscreen`, controls: /* @__PURE__ */ l(b, { children: /* @__PURE__ */ l(N, { onClick: () => w(!1), children: k }) }), fullscreen: !0, header: /* @__PURE__ */ l(X, { children: /* @__PURE__ */ l("h2", { children: f }) }), open: !0, setOpen: w, children: /* @__PURE__ */ l("iframe", { ...A, className: O(a.iframe, a["fullscreen-iframe"], E), loading: "eager", referrerPolicy: y, sandbox: M, srcDoc: h, title: `${f} fullscreen` }) })
86
83
  ] });
87
84
  };
88
85
  export {
89
- R as Iframe
86
+ ne as Iframe
90
87
  };
91
88
  //# sourceMappingURL=index.js.map