@pdf-viewer/react 0.4.0-beta.2 → 0.5.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/Container-337e1b18.js +37 -0
  2. package/dist/{RPLayout-608b83dd.js → RPLayout-88110444.js} +942 -941
  3. package/dist/assets/Container.css +1 -1
  4. package/dist/assets/RPLayout.css +1 -1
  5. package/dist/assets/RPTooltip.css +1 -0
  6. package/dist/components/RPController.js +1 -1
  7. package/dist/components/RPViewer.js +1 -1
  8. package/dist/components/layout/Container.js +1 -1
  9. package/dist/components/layout/RPLayout.js +2 -2
  10. package/dist/components/layout/sidebar/RPSidebar.js +3 -2
  11. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  12. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  13. package/dist/components/layout/toolbar/DarkModeTool.js +13 -12
  14. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  15. package/dist/components/layout/toolbar/DocumentProperties.js +7 -6
  16. package/dist/components/layout/toolbar/FileDownloadTool.js +3 -2
  17. package/dist/components/layout/toolbar/FileUploadTool.js +16 -15
  18. package/dist/components/layout/toolbar/FullScreenTool.js +30 -32
  19. package/dist/components/layout/toolbar/MostPageTool.js +3 -2
  20. package/dist/components/layout/toolbar/OtherTool.js +3 -2
  21. package/dist/components/layout/toolbar/Paginate.js +3 -2
  22. package/dist/components/layout/toolbar/PrintTool.js +3 -2
  23. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  24. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  25. package/dist/components/layout/toolbar/RotateTool.js +24 -23
  26. package/dist/components/layout/toolbar/ScrollModeTool.js +34 -33
  27. package/dist/components/layout/toolbar/SearchTool.js +3 -2
  28. package/dist/components/layout/toolbar/SelectionModeTool.js +27 -26
  29. package/dist/components/layout/toolbar/ZoomTool.js +3 -2
  30. package/dist/components/page/AnnotationLayer.js +1 -1
  31. package/dist/components/page/CanvasLayer.js +1 -1
  32. package/dist/components/page/DualPage.js +1 -1
  33. package/dist/components/page/RPPage.js +1 -1
  34. package/dist/components/page/SinglePage.js +1 -1
  35. package/dist/components/page/TextLayer.js +1 -1
  36. package/dist/components/ui/Checkbox.js +130 -242
  37. package/dist/components/ui/LoadingIndicator.js +1 -1
  38. package/dist/components/ui/RPTooltip.js +2397 -0
  39. package/dist/contexts/PaginateContext.js +1 -1
  40. package/dist/contexts/PrintContext.js +1 -1
  41. package/dist/contexts/SearchContext.js +1 -1
  42. package/dist/contexts/ThumbnailsContext.js +1 -1
  43. package/dist/index-2b077daa.js +122 -0
  44. package/dist/main.js +1 -1
  45. package/dist/types/components/ui/RPTooltip.d.ts +8 -0
  46. package/dist/utils/hooks/useFileDownload.js +1 -1
  47. package/dist/utils/hooks/useLicense.js +1 -1
  48. package/dist/utils/hooks/usePaginate.js +1 -1
  49. package/dist/utils/hooks/usePrint.js +1 -1
  50. package/dist/utils/hooks/useScrollToPage.js +1 -1
  51. package/dist/utils/hooks/useSearch.js +1 -1
  52. package/dist/utils/hooks/useThumbnail.js +1 -1
  53. package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
  54. package/package.json +2 -1
  55. package/dist/Container-cea98fc1.js +0 -37
@@ -1,8 +1,9 @@
1
- import { jsx as h, Fragment as $, jsxs as M } from "react/jsx-runtime";
1
+ import { jsx as f, Fragment as q, jsxs as M } from "react/jsx-runtime";
2
2
  import * as i from "react";
3
+ import { u as A, c as B, a as K, b as z } from "../../index-2b077daa.js";
3
4
  import "react-dom";
4
- import { CheckIcon as V } from "../icons/CheckIcon.js";
5
- import '../../assets/Checkbox.css';function A(e, t) {
5
+ import { CheckIcon as X } from "../icons/CheckIcon.js";
6
+ import '../../assets/Checkbox.css';function S(e, t) {
6
7
  if (typeof e == "function")
7
8
  return e(t);
8
9
  e != null && (e.current = t);
@@ -11,154 +12,41 @@ function I(...e) {
11
12
  return (t) => {
12
13
  let n = !1;
13
14
  const r = e.map((o) => {
14
- const s = A(o, t);
15
- return !n && typeof s == "function" && (n = !0), s;
15
+ const c = S(o, t);
16
+ return !n && typeof c == "function" && (n = !0), c;
16
17
  });
17
18
  if (n)
18
19
  return () => {
19
20
  for (let o = 0; o < r.length; o++) {
20
- const s = r[o];
21
- typeof s == "function" ? s() : A(e[o], null);
21
+ const c = r[o];
22
+ typeof c == "function" ? c() : S(e[o], null);
22
23
  }
23
24
  };
24
25
  };
25
26
  }
26
- function _(...e) {
27
+ function T(...e) {
27
28
  return i.useCallback(I(...e), e);
28
29
  }
29
- function q(e, t = []) {
30
- let n = [];
31
- function r(s, u) {
32
- const c = i.createContext(u), a = n.length;
33
- n = [...n, u];
34
- const l = (d) => {
35
- var y;
36
- const { scope: f, children: m, ...b } = d, v = ((y = f == null ? void 0 : f[e]) == null ? void 0 : y[a]) || c, k = i.useMemo(() => b, Object.values(b));
37
- return /* @__PURE__ */ h(v.Provider, { value: k, children: m });
38
- };
39
- l.displayName = s + "Provider";
40
- function p(d, f) {
41
- var v;
42
- const m = ((v = f == null ? void 0 : f[e]) == null ? void 0 : v[a]) || c, b = i.useContext(m);
43
- if (b)
44
- return b;
45
- if (u !== void 0)
46
- return u;
47
- throw new Error(`\`${d}\` must be used within \`${s}\``);
48
- }
49
- return [l, p];
50
- }
51
- const o = () => {
52
- const s = n.map((u) => i.createContext(u));
53
- return function(c) {
54
- const a = (c == null ? void 0 : c[e]) || s;
55
- return i.useMemo(
56
- () => ({ [`__scope${e}`]: { ...c, [e]: a } }),
57
- [c, a]
58
- );
59
- };
60
- };
61
- return o.scopeName = e, [r, K(o, ...t)];
62
- }
63
- function K(...e) {
64
- const t = e[0];
65
- if (e.length === 1)
66
- return t;
67
- const n = () => {
68
- const r = e.map((o) => ({
69
- useScope: o(),
70
- scopeName: o.scopeName
71
- }));
72
- return function(s) {
73
- const u = r.reduce((c, { useScope: a, scopeName: l }) => {
74
- const d = a(s)[`__scope${l}`];
75
- return { ...c, ...d };
76
- }, {});
77
- return i.useMemo(() => ({ [`__scope${t.scopeName}`]: u }), [u]);
78
- };
79
- };
80
- return n.scopeName = t.scopeName, n;
81
- }
82
30
  function O(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
83
31
  return function(o) {
84
32
  if (e == null || e(o), n === !1 || !o.defaultPrevented)
85
33
  return t == null ? void 0 : t(o);
86
34
  };
87
35
  }
88
- function T(e) {
89
- const t = i.useRef(e);
90
- return i.useEffect(() => {
91
- t.current = e;
92
- }), i.useMemo(() => (...n) => {
93
- var r;
94
- return (r = t.current) == null ? void 0 : r.call(t, ...n);
95
- }, []);
96
- }
97
- function X({
98
- prop: e,
99
- defaultProp: t,
100
- onChange: n = () => {
101
- }
102
- }) {
103
- const [r, o] = Z({ defaultProp: t, onChange: n }), s = e !== void 0, u = s ? e : r, c = T(n), a = i.useCallback(
104
- (l) => {
105
- if (s) {
106
- const d = typeof l == "function" ? l(e) : l;
107
- d !== e && c(d);
108
- } else
109
- o(l);
110
- },
111
- [s, e, o, c]
112
- );
113
- return [u, a];
114
- }
115
- function Z({
116
- defaultProp: e,
117
- onChange: t
118
- }) {
119
- const n = i.useState(e), [r] = n, o = i.useRef(r), s = T(t);
120
- return i.useEffect(() => {
121
- o.current !== r && (s(r), o.current = r);
122
- }, [r, o, s]), n;
123
- }
124
- function G(e) {
36
+ function $(e) {
125
37
  const t = i.useRef({ value: e, previous: e });
126
38
  return i.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
127
39
  }
128
- var R = globalThis != null && globalThis.document ? i.useLayoutEffect : () => {
129
- };
130
- function H(e) {
131
- const [t, n] = i.useState(void 0);
132
- return R(() => {
133
- if (e) {
134
- n({ width: e.offsetWidth, height: e.offsetHeight });
135
- const r = new ResizeObserver((o) => {
136
- if (!Array.isArray(o) || !o.length)
137
- return;
138
- const s = o[0];
139
- let u, c;
140
- if ("borderBoxSize" in s) {
141
- const a = s.borderBoxSize, l = Array.isArray(a) ? a[0] : a;
142
- u = l.inlineSize, c = l.blockSize;
143
- } else
144
- u = e.offsetWidth, c = e.offsetHeight;
145
- n({ width: u, height: c });
146
- });
147
- return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
148
- } else
149
- n(void 0);
150
- }, [e]), t;
151
- }
152
- function J(e, t) {
40
+ function Z(e, t) {
153
41
  return i.useReducer((n, r) => t[n][r] ?? n, e);
154
42
  }
155
- var D = (e) => {
156
- const { present: t, children: n } = e, r = Q(t), o = typeof n == "function" ? n({ present: r.isPresent }) : i.Children.only(n), s = _(r.ref, Y(o));
157
- return typeof n == "function" || r.isPresent ? i.cloneElement(o, { ref: s }) : null;
43
+ var _ = (e) => {
44
+ const { present: t, children: n } = e, r = G(t), o = typeof n == "function" ? n({ present: r.isPresent }) : i.Children.only(n), c = T(r.ref, J(o));
45
+ return typeof n == "function" || r.isPresent ? i.cloneElement(o, { ref: c }) : null;
158
46
  };
159
- D.displayName = "Presence";
160
- function Q(e) {
161
- const [t, n] = i.useState(), r = i.useRef({}), o = i.useRef(e), s = i.useRef("none"), u = e ? "mounted" : "unmounted", [c, a] = J(u, {
47
+ _.displayName = "Presence";
48
+ function G(e) {
49
+ const [t, n] = i.useState(), r = i.useRef({}), o = i.useRef(e), c = i.useRef("none"), a = e ? "mounted" : "unmounted", [s, l] = Z(a, {
162
50
  mounted: {
163
51
  UNMOUNT: "unmounted",
164
52
  ANIMATION_OUT: "unmountSuspended"
@@ -172,63 +60,63 @@ function Q(e) {
172
60
  }
173
61
  });
174
62
  return i.useEffect(() => {
175
- const l = g(r.current);
176
- s.current = c === "mounted" ? l : "none";
177
- }, [c]), R(() => {
178
- const l = r.current, p = o.current;
63
+ const u = R(r.current);
64
+ c.current = s === "mounted" ? u : "none";
65
+ }, [s]), A(() => {
66
+ const u = r.current, p = o.current;
179
67
  if (p !== e) {
180
- const f = s.current, m = g(l);
181
- e ? a("MOUNT") : m === "none" || (l == null ? void 0 : l.display) === "none" ? a("UNMOUNT") : a(p && f !== m ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
68
+ const d = c.current, m = R(u);
69
+ e ? l("MOUNT") : m === "none" || (u == null ? void 0 : u.display) === "none" ? l("UNMOUNT") : l(p && d !== m ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
182
70
  }
183
- }, [e, a]), R(() => {
71
+ }, [e, l]), A(() => {
184
72
  if (t) {
185
- let l;
186
- const p = t.ownerDocument.defaultView ?? window, d = (m) => {
187
- const v = g(r.current).includes(m.animationName);
188
- if (m.target === t && v && (a("ANIMATION_END"), !o.current)) {
189
- const k = t.style.animationFillMode;
190
- t.style.animationFillMode = "forwards", l = p.setTimeout(() => {
191
- t.style.animationFillMode === "forwards" && (t.style.animationFillMode = k);
73
+ let u;
74
+ const p = t.ownerDocument.defaultView ?? window, C = (m) => {
75
+ const y = R(r.current).includes(m.animationName);
76
+ if (m.target === t && y && (l("ANIMATION_END"), !o.current)) {
77
+ const g = t.style.animationFillMode;
78
+ t.style.animationFillMode = "forwards", u = p.setTimeout(() => {
79
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = g);
192
80
  });
193
81
  }
194
- }, f = (m) => {
195
- m.target === t && (s.current = g(r.current));
82
+ }, d = (m) => {
83
+ m.target === t && (c.current = R(r.current));
196
84
  };
197
- return t.addEventListener("animationstart", f), t.addEventListener("animationcancel", d), t.addEventListener("animationend", d), () => {
198
- p.clearTimeout(l), t.removeEventListener("animationstart", f), t.removeEventListener("animationcancel", d), t.removeEventListener("animationend", d);
85
+ return t.addEventListener("animationstart", d), t.addEventListener("animationcancel", C), t.addEventListener("animationend", C), () => {
86
+ p.clearTimeout(u), t.removeEventListener("animationstart", d), t.removeEventListener("animationcancel", C), t.removeEventListener("animationend", C);
199
87
  };
200
88
  } else
201
- a("ANIMATION_END");
202
- }, [t, a]), {
203
- isPresent: ["mounted", "unmountSuspended"].includes(c),
204
- ref: i.useCallback((l) => {
205
- l && (r.current = getComputedStyle(l)), n(l);
89
+ l("ANIMATION_END");
90
+ }, [t, l]), {
91
+ isPresent: ["mounted", "unmountSuspended"].includes(s),
92
+ ref: i.useCallback((u) => {
93
+ u && (r.current = getComputedStyle(u)), n(u);
206
94
  }, [])
207
95
  };
208
96
  }
209
- function g(e) {
97
+ function R(e) {
210
98
  return (e == null ? void 0 : e.animationName) || "none";
211
99
  }
212
- function Y(e) {
100
+ function J(e) {
213
101
  var r, o;
214
102
  let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
215
103
  return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
216
104
  }
217
- var U = i.forwardRef((e, t) => {
218
- const { children: n, ...r } = e, o = i.Children.toArray(n), s = o.find(te);
219
- if (s) {
220
- const u = s.props.children, c = o.map((a) => a === s ? i.Children.count(u) > 1 ? i.Children.only(null) : i.isValidElement(u) ? u.props.children : null : a);
221
- return /* @__PURE__ */ h(E, { ...r, ref: t, children: i.isValidElement(u) ? i.cloneElement(u, void 0, c) : null });
105
+ var D = i.forwardRef((e, t) => {
106
+ const { children: n, ...r } = e, o = i.Children.toArray(n), c = o.find(Y);
107
+ if (c) {
108
+ const a = c.props.children, s = o.map((l) => l === c ? i.Children.count(a) > 1 ? i.Children.only(null) : i.isValidElement(a) ? a.props.children : null : l);
109
+ return /* @__PURE__ */ f(E, { ...r, ref: t, children: i.isValidElement(a) ? i.cloneElement(a, void 0, s) : null });
222
110
  }
223
- return /* @__PURE__ */ h(E, { ...r, ref: t, children: n });
111
+ return /* @__PURE__ */ f(E, { ...r, ref: t, children: n });
224
112
  });
225
- U.displayName = "Slot";
113
+ D.displayName = "Slot";
226
114
  var E = i.forwardRef((e, t) => {
227
115
  const { children: n, ...r } = e;
228
116
  if (i.isValidElement(n)) {
229
- const o = re(n);
117
+ const o = ee(n);
230
118
  return i.cloneElement(n, {
231
- ...ne(r, n.props),
119
+ ...H(r, n.props),
232
120
  // @ts-ignore
233
121
  ref: t ? I(t, o) : o
234
122
  });
@@ -236,26 +124,26 @@ var E = i.forwardRef((e, t) => {
236
124
  return i.Children.count(n) > 1 ? i.Children.only(null) : null;
237
125
  });
238
126
  E.displayName = "SlotClone";
239
- var ee = ({ children: e }) => /* @__PURE__ */ h($, { children: e });
240
- function te(e) {
241
- return i.isValidElement(e) && e.type === ee;
127
+ var Q = ({ children: e }) => /* @__PURE__ */ f(q, { children: e });
128
+ function Y(e) {
129
+ return i.isValidElement(e) && e.type === Q;
242
130
  }
243
- function ne(e, t) {
131
+ function H(e, t) {
244
132
  const n = { ...t };
245
133
  for (const r in t) {
246
- const o = e[r], s = t[r];
247
- /^on[A-Z]/.test(r) ? o && s ? n[r] = (...c) => {
248
- s(...c), o(...c);
249
- } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...s } : r === "className" && (n[r] = [o, s].filter(Boolean).join(" "));
134
+ const o = e[r], c = t[r];
135
+ /^on[A-Z]/.test(r) ? o && c ? n[r] = (...s) => {
136
+ c(...s), o(...s);
137
+ } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...c } : r === "className" && (n[r] = [o, c].filter(Boolean).join(" "));
250
138
  }
251
139
  return { ...e, ...n };
252
140
  }
253
- function re(e) {
141
+ function ee(e) {
254
142
  var r, o;
255
143
  let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
256
144
  return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
257
145
  }
258
- var oe = [
146
+ var te = [
259
147
  "a",
260
148
  "button",
261
149
  "div",
@@ -272,85 +160,85 @@ var oe = [
272
160
  "span",
273
161
  "svg",
274
162
  "ul"
275
- ], W = oe.reduce((e, t) => {
163
+ ], U = te.reduce((e, t) => {
276
164
  const n = i.forwardRef((r, o) => {
277
- const { asChild: s, ...u } = r, c = s ? U : t;
278
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ h(c, { ...u, ref: o });
165
+ const { asChild: c, ...a } = r, s = c ? D : t;
166
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(s, { ...a, ref: o });
279
167
  });
280
168
  return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
281
- }, {}), w = "Checkbox", [se, me] = q(w), [ie, ce] = se(w), z = i.forwardRef(
169
+ }, {}), w = "Checkbox", [ne, fe] = B(w), [re, oe] = ne(w), W = i.forwardRef(
282
170
  (e, t) => {
283
171
  const {
284
172
  __scopeCheckbox: n,
285
173
  name: r,
286
174
  checked: o,
287
- defaultChecked: s,
288
- required: u,
289
- disabled: c,
290
- value: a = "on",
291
- onCheckedChange: l,
175
+ defaultChecked: c,
176
+ required: a,
177
+ disabled: s,
178
+ value: l = "on",
179
+ onCheckedChange: u,
292
180
  form: p,
293
- ...d
294
- } = e, [f, m] = i.useState(null), b = _(t, (C) => m(C)), v = i.useRef(!1), k = f ? p || !!f.closest("form") : !0, [y = !1, S] = X({
181
+ ...C
182
+ } = e, [d, m] = i.useState(null), k = T(t, (h) => m(h)), y = i.useRef(!1), g = d ? p || !!d.closest("form") : !0, [N = !1, x] = K({
295
183
  prop: o,
296
- defaultProp: s,
297
- onChange: l
298
- }), F = i.useRef(y);
184
+ defaultProp: c,
185
+ onChange: u
186
+ }), V = i.useRef(N);
299
187
  return i.useEffect(() => {
300
- const C = f == null ? void 0 : f.form;
301
- if (C) {
302
- const x = () => S(F.current);
303
- return C.addEventListener("reset", x), () => C.removeEventListener("reset", x);
188
+ const h = d == null ? void 0 : d.form;
189
+ if (h) {
190
+ const v = () => x(V.current);
191
+ return h.addEventListener("reset", v), () => h.removeEventListener("reset", v);
304
192
  }
305
- }, [f, S]), /* @__PURE__ */ M(ie, { scope: n, state: y, disabled: c, children: [
306
- /* @__PURE__ */ h(
307
- W.button,
193
+ }, [d, x]), /* @__PURE__ */ M(re, { scope: n, state: N, disabled: s, children: [
194
+ /* @__PURE__ */ f(
195
+ U.button,
308
196
  {
309
197
  type: "button",
310
198
  role: "checkbox",
311
- "aria-checked": N(y) ? "mixed" : y,
312
- "aria-required": u,
313
- "data-state": B(y),
314
- "data-disabled": c ? "" : void 0,
315
- disabled: c,
316
- value: a,
317
- ...d,
318
- ref: b,
319
- onKeyDown: O(e.onKeyDown, (C) => {
320
- C.key === "Enter" && C.preventDefault();
199
+ "aria-checked": b(N) ? "mixed" : N,
200
+ "aria-required": a,
201
+ "data-state": F(N),
202
+ "data-disabled": s ? "" : void 0,
203
+ disabled: s,
204
+ value: l,
205
+ ...C,
206
+ ref: k,
207
+ onKeyDown: O(e.onKeyDown, (h) => {
208
+ h.key === "Enter" && h.preventDefault();
321
209
  }),
322
- onClick: O(e.onClick, (C) => {
323
- S((x) => N(x) ? !0 : !x), k && (v.current = C.isPropagationStopped(), v.current || C.stopPropagation());
210
+ onClick: O(e.onClick, (h) => {
211
+ x((v) => b(v) ? !0 : !v), g && (y.current = h.isPropagationStopped(), y.current || h.stopPropagation());
324
212
  })
325
213
  }
326
214
  ),
327
- k && /* @__PURE__ */ h(
328
- ue,
215
+ g && /* @__PURE__ */ f(
216
+ ie,
329
217
  {
330
- control: f,
331
- bubbles: !v.current,
218
+ control: d,
219
+ bubbles: !y.current,
332
220
  name: r,
333
- value: a,
334
- checked: y,
335
- required: u,
336
- disabled: c,
221
+ value: l,
222
+ checked: N,
223
+ required: a,
224
+ disabled: s,
337
225
  form: p,
338
226
  style: { transform: "translateX(-100%)" },
339
- defaultChecked: N(s) ? !1 : s
227
+ defaultChecked: b(c) ? !1 : c
340
228
  }
341
229
  )
342
230
  ] });
343
231
  }
344
232
  );
345
- z.displayName = w;
233
+ W.displayName = w;
346
234
  var L = "CheckboxIndicator", j = i.forwardRef(
347
235
  (e, t) => {
348
- const { __scopeCheckbox: n, forceMount: r, ...o } = e, s = ce(L, n);
349
- return /* @__PURE__ */ h(D, { present: r || N(s.state) || s.state === !0, children: /* @__PURE__ */ h(
350
- W.span,
236
+ const { __scopeCheckbox: n, forceMount: r, ...o } = e, c = oe(L, n);
237
+ return /* @__PURE__ */ f(_, { present: r || b(c.state) || c.state === !0, children: /* @__PURE__ */ f(
238
+ U.span,
351
239
  {
352
- "data-state": B(s.state),
353
- "data-disabled": s.disabled ? "" : void 0,
240
+ "data-state": F(c.state),
241
+ "data-disabled": c.disabled ? "" : void 0,
354
242
  ...o,
355
243
  ref: t,
356
244
  style: { pointerEvents: "none", ...e.style }
@@ -359,28 +247,28 @@ var L = "CheckboxIndicator", j = i.forwardRef(
359
247
  }
360
248
  );
361
249
  j.displayName = L;
362
- var ue = (e) => {
363
- const { control: t, checked: n, bubbles: r = !0, defaultChecked: o, ...s } = e, u = i.useRef(null), c = G(n), a = H(t);
250
+ var ie = (e) => {
251
+ const { control: t, checked: n, bubbles: r = !0, defaultChecked: o, ...c } = e, a = i.useRef(null), s = $(n), l = z(t);
364
252
  i.useEffect(() => {
365
- const p = u.current, d = window.HTMLInputElement.prototype, m = Object.getOwnPropertyDescriptor(d, "checked").set;
366
- if (c !== n && m) {
367
- const b = new Event("click", { bubbles: r });
368
- p.indeterminate = N(n), m.call(p, N(n) ? !1 : n), p.dispatchEvent(b);
253
+ const p = a.current, C = window.HTMLInputElement.prototype, m = Object.getOwnPropertyDescriptor(C, "checked").set;
254
+ if (s !== n && m) {
255
+ const k = new Event("click", { bubbles: r });
256
+ p.indeterminate = b(n), m.call(p, b(n) ? !1 : n), p.dispatchEvent(k);
369
257
  }
370
- }, [c, n, r]);
371
- const l = i.useRef(N(n) ? !1 : n);
372
- return /* @__PURE__ */ h(
258
+ }, [s, n, r]);
259
+ const u = i.useRef(b(n) ? !1 : n);
260
+ return /* @__PURE__ */ f(
373
261
  "input",
374
262
  {
375
263
  type: "checkbox",
376
264
  "aria-hidden": !0,
377
- defaultChecked: o ?? l.current,
378
- ...s,
265
+ defaultChecked: o ?? u.current,
266
+ ...c,
379
267
  tabIndex: -1,
380
- ref: u,
268
+ ref: a,
381
269
  style: {
382
270
  ...e.style,
383
- ...a,
271
+ ...l,
384
272
  position: "absolute",
385
273
  pointerEvents: "none",
386
274
  opacity: 0,
@@ -389,25 +277,25 @@ var ue = (e) => {
389
277
  }
390
278
  );
391
279
  };
392
- function N(e) {
280
+ function b(e) {
393
281
  return e === "indeterminate";
394
282
  }
395
- function B(e) {
396
- return N(e) ? "indeterminate" : e ? "checked" : "unchecked";
283
+ function F(e) {
284
+ return b(e) ? "indeterminate" : e ? "checked" : "unchecked";
397
285
  }
398
- var ae = z, le = j;
286
+ var ce = W, se = j;
399
287
  const P = {
400
288
  "rp-checkbox": "_rp-checkbox_11dq0_1",
401
289
  "rp-checkbox-indicator": "_rp-checkbox-indicator_11dq0_18"
402
- }, he = ({
290
+ }, pe = ({
403
291
  children: e,
404
292
  value: t,
405
293
  name: n,
406
294
  onChange: r
407
295
  }) => /* @__PURE__ */ M("div", { style: { display: "flex", alignItems: "center", position: "relative" }, children: [
408
- /* @__PURE__ */ h(ae, { className: P["rp-checkbox"], checked: t, id: n, onCheckedChange: r, children: /* @__PURE__ */ h(le, { className: P["rp-checkbox-indicator"], children: /* @__PURE__ */ h(V, {}) }) }),
409
- /* @__PURE__ */ h("label", { className: P["rp-checkbox-label"], htmlFor: n, children: e })
296
+ /* @__PURE__ */ f(ce, { className: P["rp-checkbox"], checked: t, id: n, onCheckedChange: r, children: /* @__PURE__ */ f(se, { className: P["rp-checkbox-indicator"], children: /* @__PURE__ */ f(X, {}) }) }),
297
+ /* @__PURE__ */ f("label", { className: P["rp-checkbox-label"], htmlFor: n, children: e })
410
298
  ] });
411
299
  export {
412
- he as UICheckbox
300
+ pe as UICheckbox
413
301
  };
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { L as p } from "../../RPLayout-608b83dd.js";
2
+ import { L as p } from "../../RPLayout-88110444.js";
3
3
  import "../../clsx-0c6e471a.js";
4
4
  export {
5
5
  p as default