@sprawlify/react 0.0.7 → 0.0.8

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 (167) hide show
  1. package/dist/chunk-BYnRvbsk.cjs +53 -0
  2. package/dist/{collapsible-B06GGGE7.mjs → collapsible-Nbt3Sequ.mjs} +7 -7
  3. package/dist/{collapsible-D5kle6Bc.cjs → collapsible-aFKYmVbP.cjs} +10 -9
  4. package/dist/{collection-BKabYqpE.cjs → collection-DGEUORi5.cjs} +4 -3
  5. package/dist/{collection-DEsp9z6X.mjs → collection-DQWWySNV.mjs} +2 -2
  6. package/dist/components/accordion/index.cjs +13 -11
  7. package/dist/components/accordion/index.d.cts +11 -11
  8. package/dist/components/accordion/index.d.mts +11 -11
  9. package/dist/components/accordion/index.mjs +10 -9
  10. package/dist/components/angle-slider/index.cjs +11 -9
  11. package/dist/components/angle-slider/index.d.cts +13 -13
  12. package/dist/components/angle-slider/index.d.mts +13 -13
  13. package/dist/components/angle-slider/index.mjs +8 -7
  14. package/dist/components/avatar/index.cjs +11 -9
  15. package/dist/components/avatar/index.d.cts +8 -8
  16. package/dist/components/avatar/index.d.mts +8 -8
  17. package/dist/components/avatar/index.mjs +8 -7
  18. package/dist/components/bottom-sheet/index.cjs +17 -14
  19. package/dist/components/bottom-sheet/index.d.cts +15 -15
  20. package/dist/components/bottom-sheet/index.d.mts +16 -16
  21. package/dist/components/bottom-sheet/index.mjs +12 -10
  22. package/dist/components/carousel/index.cjs +11 -9
  23. package/dist/components/carousel/index.d.cts +18 -18
  24. package/dist/components/carousel/index.d.mts +18 -18
  25. package/dist/components/carousel/index.mjs +8 -7
  26. package/dist/components/checkbox/index.cjs +17 -14
  27. package/dist/components/checkbox/index.d.cts +14 -14
  28. package/dist/components/checkbox/index.d.mts +14 -14
  29. package/dist/components/checkbox/index.mjs +13 -11
  30. package/dist/components/client-only/index.cjs +1 -1
  31. package/dist/components/clipboard/index.cjs +8 -7
  32. package/dist/components/clipboard/index.d.cts +12 -12
  33. package/dist/components/clipboard/index.d.mts +12 -12
  34. package/dist/components/clipboard/index.mjs +6 -6
  35. package/dist/components/collapsible/index.cjs +8 -6
  36. package/dist/components/collapsible/index.d.cts +10 -10
  37. package/dist/components/collapsible/index.d.mts +10 -10
  38. package/dist/components/collapsible/index.mjs +7 -6
  39. package/dist/components/collection/index.cjs +3 -3
  40. package/dist/components/collection/index.d.cts +1 -1
  41. package/dist/components/collection/index.d.mts +1 -1
  42. package/dist/components/collection/index.mjs +3 -3
  43. package/dist/components/color-picker/index.cjs +19 -15
  44. package/dist/components/color-picker/index.d.cts +34 -34
  45. package/dist/components/color-picker/index.d.mts +36 -36
  46. package/dist/components/color-picker/index.mjs +14 -11
  47. package/dist/components/combobox/index.cjs +19 -15
  48. package/dist/components/combobox/index.d.cts +22 -22
  49. package/dist/components/combobox/index.d.mts +23 -23
  50. package/dist/components/combobox/index.mjs +15 -12
  51. package/dist/components/date-picker/index.cjs +567 -0
  52. package/dist/components/date-picker/index.d.cts +164 -0
  53. package/dist/components/date-picker/index.d.mts +165 -0
  54. package/dist/components/date-picker/index.mjs +526 -0
  55. package/dist/components/dialog/index.cjs +211 -0
  56. package/dist/components/dialog/index.d.cts +80 -0
  57. package/dist/components/dialog/index.d.mts +81 -0
  58. package/dist/components/dialog/index.mjs +187 -0
  59. package/dist/components/download-trigger/index.cjs +43 -0
  60. package/dist/components/download-trigger/index.d.cts +16 -0
  61. package/dist/components/download-trigger/index.d.mts +16 -0
  62. package/dist/components/download-trigger/index.mjs +42 -0
  63. package/dist/components/editable/index.cjs +246 -0
  64. package/dist/components/editable/index.d.cts +79 -0
  65. package/dist/components/editable/index.d.mts +79 -0
  66. package/dist/components/editable/index.mjs +221 -0
  67. package/dist/components/field/index.cjs +9 -7
  68. package/dist/components/field/index.d.cts +14 -14
  69. package/dist/components/field/index.d.mts +14 -14
  70. package/dist/components/field/index.mjs +9 -7
  71. package/dist/components/fieldset/index.cjs +10 -8
  72. package/dist/components/fieldset/index.d.cts +10 -10
  73. package/dist/components/fieldset/index.d.mts +10 -10
  74. package/dist/components/fieldset/index.mjs +9 -7
  75. package/dist/components/file-upload/index.cjs +351 -0
  76. package/dist/components/file-upload/index.d.cts +102 -0
  77. package/dist/components/file-upload/index.d.mts +102 -0
  78. package/dist/components/file-upload/index.mjs +322 -0
  79. package/dist/components/floating-panel/index.cjs +287 -0
  80. package/dist/components/floating-panel/index.d.cts +100 -0
  81. package/dist/components/floating-panel/index.d.mts +101 -0
  82. package/dist/components/floating-panel/index.mjs +259 -0
  83. package/dist/components/focus-trap/index.cjs +36 -0
  84. package/dist/components/focus-trap/index.d.cts +14 -0
  85. package/dist/components/focus-trap/index.d.mts +14 -0
  86. package/dist/components/focus-trap/index.mjs +35 -0
  87. package/dist/components/format/index.cjs +57 -0
  88. package/dist/components/format/index.d.cts +36 -0
  89. package/dist/components/format/index.d.mts +36 -0
  90. package/dist/components/format/index.mjs +49 -0
  91. package/dist/components/frame/index.cjs +90 -0
  92. package/dist/components/frame/index.d.cts +13 -0
  93. package/dist/components/frame/index.d.mts +13 -0
  94. package/dist/components/frame/index.mjs +89 -0
  95. package/dist/components/highlight/index.cjs +2 -2
  96. package/dist/components/highlight/index.d.cts +3 -3
  97. package/dist/components/highlight/index.d.mts +3 -3
  98. package/dist/components/highlight/index.mjs +1 -1
  99. package/dist/components/portal/index.cjs +5 -4
  100. package/dist/components/portal/index.d.cts +2 -2
  101. package/dist/components/portal/index.d.mts +2 -2
  102. package/dist/components/portal/index.mjs +4 -3
  103. package/dist/components/presence/index.cjs +5 -5
  104. package/dist/components/presence/index.d.cts +1 -1
  105. package/dist/components/presence/index.d.mts +3 -3
  106. package/dist/components/presence/index.mjs +5 -5
  107. package/dist/components/select/index.cjs +19 -15
  108. package/dist/components/select/index.d.cts +21 -21
  109. package/dist/components/select/index.d.mts +22 -22
  110. package/dist/components/select/index.mjs +15 -12
  111. package/dist/compose-refs-BEptPEkE.mjs +16 -0
  112. package/dist/compose-refs-C5QNDywq.cjs +22 -0
  113. package/dist/{core-CPLjF6nm.cjs → core-DCWyxy9D.cjs} +2 -53
  114. package/dist/{create-context-D6DyFRSf.cjs → create-context-CQ4U0lLj.cjs} +1 -1
  115. package/dist/{environment-DLPiALpf.cjs → environment-CvilmfQt.cjs} +2 -2
  116. package/dist/{environment-BXkWNF2O.mjs → environment-Ded7DkGr.mjs} +1 -1
  117. package/dist/{factory-DQlmCPH2.mjs → factory-Bi8oEg8i.mjs} +2 -16
  118. package/dist/{factory-CDX-oCN5.cjs → factory-C166evrS.cjs} +3 -23
  119. package/dist/{field-CGCTFCx2.mjs → field-B-6qoKdn.mjs} +9 -7
  120. package/dist/{field-CXhpW6zO.cjs → field-C-57Gj2E.cjs} +12 -10
  121. package/dist/{fieldset-CuSSYZxV.cjs → fieldset-B-MkM2Ms.cjs} +15 -13
  122. package/dist/{fieldset-poJ8RDvB.mjs → fieldset-gaVneDYh.mjs} +8 -6
  123. package/dist/{index-DtdZfcpz.d.mts → index-BJvW7OpY.d.mts} +3 -3
  124. package/dist/{index-BUN9wyVM.d.mts → index-BhGgEHWc.d.cts} +7 -7
  125. package/dist/{index-DqRXPiW_.d.cts → index-Cp1i1zbg.d.mts} +7 -7
  126. package/dist/index.cjs +12 -10
  127. package/dist/index.d.cts +7 -7
  128. package/dist/index.d.mts +7 -7
  129. package/dist/index.mjs +7 -6
  130. package/dist/{providers-Bk3ALTxZ.cjs → locale-BcnWD1Hf.cjs} +2 -2
  131. package/dist/{providers-CyTYcOU1.mjs → locale-Coin-d7R.mjs} +1 -1
  132. package/dist/{normalize-props-sqcs77GC.d.cts → normalize-props-skGwa8Dk.d.cts} +3 -3
  133. package/dist/{presence-2A4loEJY.mjs → presence-Bc6Bxe5i.mjs} +6 -5
  134. package/dist/{presence-BX1tNsGA.cjs → presence-CPov8wyU.cjs} +9 -7
  135. package/dist/providers-BNAArubQ.cjs +0 -0
  136. package/dist/providers-Dm2P3F2_.mjs +1 -0
  137. package/dist/{render-strategy-k1JmEGnq.cjs → render-strategy-BywM_IvB.cjs} +2 -2
  138. package/dist/{render-strategy-D3w8btTD.mjs → render-strategy-FiPgAp1U.mjs} +2 -2
  139. package/dist/{types-FLvjyw__.d.mts → types-B4tvWlDb.d.cts} +2 -1
  140. package/dist/{types-DYWV3uAj.d.cts → types-BmBABPZb.d.mts} +2 -1
  141. package/dist/{use-event-CGMgV6xB.cjs → use-event-CLH8zHoJ.cjs} +1 -1
  142. package/dist/{use-safe-layout-effect-vuYaDIpT.cjs → use-fieldset-context-CCQLmNLL.cjs} +1 -13
  143. package/dist/use-fieldset-context-LwveT1OS.mjs +12 -0
  144. package/dist/use-safe-layout-effect-C2GgvNT3.cjs +13 -0
  145. package/dist/use-safe-layout-effect-CLjnuJFb.mjs +7 -0
  146. package/dist/utils/index.cjs +3 -3
  147. package/dist/utils/index.d.cts +1 -1
  148. package/dist/utils/index.d.mts +1 -1
  149. package/dist/utils/index.mjs +2 -2
  150. package/package.json +92 -2
  151. package/dist/use-safe-layout-effect-BlOhFUAp.mjs +0 -17
  152. /package/dist/{chunk-DLP0tNsH.mjs → chunk-BXPHTOwk.mjs} +0 -0
  153. /package/dist/{core-C0F-4KYH.mjs → core-Ba4IEjhK.mjs} +0 -0
  154. /package/dist/{create-context-CdjrBhu7.mjs → create-context-CCXzjEv8.mjs} +0 -0
  155. /package/dist/{create-split-props-BJQdOyld.mjs → create-split-props-CBL0m-GX.mjs} +0 -0
  156. /package/dist/{create-split-props-CSkzaUOy.cjs → create-split-props-Dp4TWOyM.cjs} +0 -0
  157. /package/dist/{factory-BbbIuDqa.d.mts → factory-C-EBNsCW.d.mts} +0 -0
  158. /package/dist/{factory-DaNWFLLN.d.cts → factory-C4cfTHs7.d.cts} +0 -0
  159. /package/dist/{index-Dhthtdz_.d.mts → index-ByIsf4E7.d.mts} +0 -0
  160. /package/dist/{index-DsZldSch.d.cts → index-CumJbg8V.d.cts} +0 -0
  161. /package/dist/{index-BwTxN5vG.d.mts → index-CureNJdc.d.mts} +0 -0
  162. /package/dist/{index-zOmANnUL.d.cts → index-dbTyAXLy.d.cts} +0 -0
  163. /package/dist/{render-strategy-GetMScNK.d.mts → render-strategy-C8IyLw0O.d.mts} +0 -0
  164. /package/dist/{render-strategy-CdpAg9jb.d.cts → render-strategy-rA4C5NUX.d.cts} +0 -0
  165. /package/dist/{use-event-BcyNH29h.mjs → use-event-4J5QFFqK.mjs} +0 -0
  166. /package/dist/{utils-Cb5K29pi.cjs → utils-B_Ojepvp.cjs} +0 -0
  167. /package/dist/{utils-DflO0-3U.mjs → utils-C-m3mZWI.mjs} +0 -0
@@ -0,0 +1,36 @@
1
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
2
+
3
+ //#region src/components/format/format-byte.d.ts
4
+ interface FormatByteProps {
5
+ unit?: "bit" | "byte" | undefined;
6
+ unitDisplay?: "long" | "short" | "narrow" | undefined;
7
+ unitSystem?: "decimal" | "binary" | undefined;
8
+ value: number;
9
+ }
10
+ declare const FormatByte: {
11
+ (props: FormatByteProps): react_jsx_runtime7.JSX.Element;
12
+ displayName: string;
13
+ };
14
+ //#endregion
15
+ //#region src/components/format/format-number.d.ts
16
+ interface FormatNumberProps extends Intl.NumberFormatOptions {
17
+ value: number;
18
+ }
19
+ declare const FormatNumber: {
20
+ (props: FormatNumberProps): react_jsx_runtime7.JSX.Element;
21
+ displayName: string;
22
+ };
23
+ //#endregion
24
+ //#region src/components/format/format-relative-time.d.ts
25
+ interface FormatRelativeTimeProps extends Intl.RelativeTimeFormatOptions {
26
+ value: Date;
27
+ }
28
+ declare const FormatRelativeTime: {
29
+ (props: FormatRelativeTimeProps): react_jsx_runtime7.JSX.Element;
30
+ displayName: string;
31
+ };
32
+ declare namespace format_d_exports {
33
+ export { FormatByte as Byte, FormatByteProps as ByteProps, FormatNumber as Number, FormatNumberProps as NumberProps, FormatRelativeTime as RelativeTime, FormatRelativeTimeProps as RelativeTimeProps };
34
+ }
35
+ //#endregion
36
+ export { format_d_exports as Format, FormatByte, type FormatByteProps, FormatNumber, type FormatNumberProps, FormatRelativeTime, type FormatRelativeTimeProps };
@@ -0,0 +1,36 @@
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+
3
+ //#region src/components/format/format-byte.d.ts
4
+ interface FormatByteProps {
5
+ unit?: "bit" | "byte" | undefined;
6
+ unitDisplay?: "long" | "short" | "narrow" | undefined;
7
+ unitSystem?: "decimal" | "binary" | undefined;
8
+ value: number;
9
+ }
10
+ declare const FormatByte: {
11
+ (props: FormatByteProps): react_jsx_runtime0.JSX.Element;
12
+ displayName: string;
13
+ };
14
+ //#endregion
15
+ //#region src/components/format/format-number.d.ts
16
+ interface FormatNumberProps extends Intl.NumberFormatOptions {
17
+ value: number;
18
+ }
19
+ declare const FormatNumber: {
20
+ (props: FormatNumberProps): react_jsx_runtime0.JSX.Element;
21
+ displayName: string;
22
+ };
23
+ //#endregion
24
+ //#region src/components/format/format-relative-time.d.ts
25
+ interface FormatRelativeTimeProps extends Intl.RelativeTimeFormatOptions {
26
+ value: Date;
27
+ }
28
+ declare const FormatRelativeTime: {
29
+ (props: FormatRelativeTimeProps): react_jsx_runtime0.JSX.Element;
30
+ displayName: string;
31
+ };
32
+ declare namespace format_d_exports {
33
+ export { FormatByte as Byte, FormatByteProps as ByteProps, FormatNumber as Number, FormatNumberProps as NumberProps, FormatRelativeTime as RelativeTime, FormatRelativeTimeProps as RelativeTimeProps };
34
+ }
35
+ //#endregion
36
+ export { format_d_exports as Format, FormatByte, type FormatByteProps, FormatNumber, type FormatNumberProps, FormatRelativeTime, type FormatRelativeTimeProps };
@@ -0,0 +1,49 @@
1
+ import { t as __export } from "../../chunk-BXPHTOwk.mjs";
2
+ import "../../create-context-CCXzjEv8.mjs";
3
+ import { i as useLocaleContext } from "../../locale-Coin-d7R.mjs";
4
+ import { useMemo } from "react";
5
+ import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
6
+ import { formatBytes, formatNumber, formatRelativeTime } from "@sprawlify/primitives/i18n-utils";
7
+
8
+ //#region src/components/format/format-byte.tsx
9
+ const FormatByte = (props) => {
10
+ const { locale } = useLocaleContext();
11
+ return /* @__PURE__ */ jsx(Fragment$1, { children: useMemo(() => {
12
+ const { value, ...intlOptions } = props;
13
+ return formatBytes(value, locale, intlOptions);
14
+ }, [props, locale]) });
15
+ };
16
+ FormatByte.displayName = "FormatByte";
17
+
18
+ //#endregion
19
+ //#region src/components/format/format-number.tsx
20
+ const FormatNumber = (props) => {
21
+ const { locale } = useLocaleContext();
22
+ return /* @__PURE__ */ jsx(Fragment$1, { children: useMemo(() => {
23
+ const { value, ...intlOptions } = props;
24
+ return formatNumber(value, locale, intlOptions);
25
+ }, [props, locale]) });
26
+ };
27
+ FormatNumber.displayName = "FormatNumber";
28
+
29
+ //#endregion
30
+ //#region src/components/format/format-relative-time.tsx
31
+ const FormatRelativeTime = (props) => {
32
+ const { locale } = useLocaleContext();
33
+ return /* @__PURE__ */ jsx(Fragment$1, { children: useMemo(() => {
34
+ const { value, ...intlOptions } = props;
35
+ return formatRelativeTime(value, locale, intlOptions);
36
+ }, [props, locale]) });
37
+ };
38
+ FormatRelativeTime.displayName = "FormatRelativeTime";
39
+
40
+ //#endregion
41
+ //#region src/components/format/format.ts
42
+ var format_exports = /* @__PURE__ */ __export({
43
+ Byte: () => FormatByte,
44
+ Number: () => FormatNumber,
45
+ RelativeTime: () => FormatRelativeTime
46
+ });
47
+
48
+ //#endregion
49
+ export { format_exports as Format, FormatByte, FormatNumber, FormatRelativeTime };
@@ -0,0 +1,90 @@
1
+ const require_chunk = require('../../chunk-BYnRvbsk.cjs');
2
+ require('../../create-context-CQ4U0lLj.cjs');
3
+ const require_environment = require('../../environment-CvilmfQt.cjs');
4
+ require('../../locale-BcnWD1Hf.cjs');
5
+ require('../../providers-BNAArubQ.cjs');
6
+ const require_compose_refs = require('../../compose-refs-C5QNDywq.cjs');
7
+ const require_use_safe_layout_effect = require('../../use-safe-layout-effect-C2GgvNT3.cjs');
8
+ let react = require("react");
9
+ let react_dom = require("react-dom");
10
+ let react_jsx_runtime = require("react/jsx-runtime");
11
+
12
+ //#region src/components/frame/frame-content.tsx
13
+ const FrameContent = (props) => {
14
+ const { onMount, onUnmount, children } = props;
15
+ const mountedRef = (0, react.useRef)(false);
16
+ const calledRef = (0, react.useRef)(false);
17
+ (0, react.useEffect)(() => {
18
+ if (!mountedRef.current && !calledRef.current) {
19
+ onMount?.();
20
+ mountedRef.current = true;
21
+ calledRef.current = true;
22
+ }
23
+ return () => {
24
+ if (mountedRef.current) {
25
+ onUnmount?.();
26
+ mountedRef.current = false;
27
+ }
28
+ };
29
+ }, []);
30
+ return children;
31
+ };
32
+
33
+ //#endregion
34
+ //#region src/components/frame/frame.tsx
35
+ const initialSrcDoc = `<html><head><style>*,*::before,*::after { margin: 0; padding: 0; box-sizing: border-box; }</style></head><body><div class="frame-root"></div></body></html>`;
36
+ function getMountNode(frame) {
37
+ const doc = frame.contentWindow?.document;
38
+ if (!doc) return null;
39
+ return doc.body.querySelector(".frame-root") || doc.body;
40
+ }
41
+ const Frame = (0, react.forwardRef)((props, ref) => {
42
+ const { children, head, onMount, onUnmount, srcDoc = initialSrcDoc, ...rest } = props;
43
+ const [frameRef, setFrameRef] = (0, react.useState)(null);
44
+ const [mountNode, setMountNode] = (0, react.useState)(null);
45
+ require_use_safe_layout_effect.useSafeLayoutEffect(() => {
46
+ if (!frameRef) return;
47
+ const doc = frameRef.contentWindow?.document;
48
+ if (!doc) return;
49
+ doc.open();
50
+ doc.write(srcDoc);
51
+ doc.close();
52
+ setMountNode(getMountNode(frameRef));
53
+ }, [frameRef, srcDoc]);
54
+ (0, react.useEffect)(() => {
55
+ if (!frameRef || !frameRef.contentDocument) return;
56
+ const win = frameRef.contentWindow;
57
+ if (!win) return;
58
+ const mountNode$1 = getMountNode(frameRef);
59
+ if (!mountNode$1) return;
60
+ const exec = () => {
61
+ win.requestAnimationFrame(() => {
62
+ if (!frameRef.contentDocument?.documentElement) return;
63
+ frameRef.style.setProperty("--width", `${mountNode$1.scrollWidth}px`);
64
+ frameRef.style.setProperty("--height", `${mountNode$1.scrollHeight}px`);
65
+ });
66
+ };
67
+ const resizeObserver = new win.ResizeObserver(exec);
68
+ exec();
69
+ if (frameRef.contentDocument) resizeObserver.observe(mountNode$1);
70
+ return () => {
71
+ resizeObserver.disconnect();
72
+ };
73
+ }, [frameRef]);
74
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_environment.EnvironmentProvider, {
75
+ value: () => frameRef?.contentDocument ?? document,
76
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("iframe", {
77
+ title: `frame:${(0, react.useId)()}`,
78
+ ref: require_compose_refs.composeRefs(ref, setFrameRef),
79
+ ...rest,
80
+ children: [mountNode ? (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FrameContent, {
81
+ onMount,
82
+ onUnmount,
83
+ children
84
+ }), mountNode) : null, head && frameRef ? (0, react_dom.createPortal)(head, frameRef.contentDocument.head) : null]
85
+ })
86
+ });
87
+ });
88
+
89
+ //#endregion
90
+ exports.Frame = Frame;
@@ -0,0 +1,13 @@
1
+ import { t as Assign } from "../../types-B4tvWlDb.cjs";
2
+ import * as react28 from "react";
3
+
4
+ //#region src/components/frame/frame.d.ts
5
+ interface FrameBaseProps {
6
+ head?: React.ReactNode | undefined;
7
+ onMount?: (() => void) | undefined;
8
+ onUnmount?: (() => void) | undefined;
9
+ }
10
+ interface FrameProps extends Assign<React.IframeHTMLAttributes<HTMLIFrameElement>, FrameBaseProps> {}
11
+ declare const Frame: react28.ForwardRefExoticComponent<FrameProps & react28.RefAttributes<HTMLIFrameElement>>;
12
+ //#endregion
13
+ export { Frame, type FrameBaseProps, type FrameProps };
@@ -0,0 +1,13 @@
1
+ import { t as Assign } from "../../types-BmBABPZb.mjs";
2
+ import * as react78 from "react";
3
+
4
+ //#region src/components/frame/frame.d.ts
5
+ interface FrameBaseProps {
6
+ head?: React.ReactNode | undefined;
7
+ onMount?: (() => void) | undefined;
8
+ onUnmount?: (() => void) | undefined;
9
+ }
10
+ interface FrameProps extends Assign<React.IframeHTMLAttributes<HTMLIFrameElement>, FrameBaseProps> {}
11
+ declare const Frame: react78.ForwardRefExoticComponent<FrameProps & react78.RefAttributes<HTMLIFrameElement>>;
12
+ //#endregion
13
+ export { Frame, type FrameBaseProps, type FrameProps };
@@ -0,0 +1,89 @@
1
+ import "../../create-context-CCXzjEv8.mjs";
2
+ import { t as EnvironmentProvider } from "../../environment-Ded7DkGr.mjs";
3
+ import "../../locale-Coin-d7R.mjs";
4
+ import "../../providers-Dm2P3F2_.mjs";
5
+ import { t as composeRefs } from "../../compose-refs-BEptPEkE.mjs";
6
+ import { t as useSafeLayoutEffect } from "../../use-safe-layout-effect-CLjnuJFb.mjs";
7
+ import { forwardRef, useEffect, useId, useRef, useState } from "react";
8
+ import { createPortal } from "react-dom";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+
11
+ //#region src/components/frame/frame-content.tsx
12
+ const FrameContent = (props) => {
13
+ const { onMount, onUnmount, children } = props;
14
+ const mountedRef = useRef(false);
15
+ const calledRef = useRef(false);
16
+ useEffect(() => {
17
+ if (!mountedRef.current && !calledRef.current) {
18
+ onMount?.();
19
+ mountedRef.current = true;
20
+ calledRef.current = true;
21
+ }
22
+ return () => {
23
+ if (mountedRef.current) {
24
+ onUnmount?.();
25
+ mountedRef.current = false;
26
+ }
27
+ };
28
+ }, []);
29
+ return children;
30
+ };
31
+
32
+ //#endregion
33
+ //#region src/components/frame/frame.tsx
34
+ const initialSrcDoc = `<html><head><style>*,*::before,*::after { margin: 0; padding: 0; box-sizing: border-box; }</style></head><body><div class="frame-root"></div></body></html>`;
35
+ function getMountNode(frame) {
36
+ const doc = frame.contentWindow?.document;
37
+ if (!doc) return null;
38
+ return doc.body.querySelector(".frame-root") || doc.body;
39
+ }
40
+ const Frame = forwardRef((props, ref) => {
41
+ const { children, head, onMount, onUnmount, srcDoc = initialSrcDoc, ...rest } = props;
42
+ const [frameRef, setFrameRef] = useState(null);
43
+ const [mountNode, setMountNode] = useState(null);
44
+ useSafeLayoutEffect(() => {
45
+ if (!frameRef) return;
46
+ const doc = frameRef.contentWindow?.document;
47
+ if (!doc) return;
48
+ doc.open();
49
+ doc.write(srcDoc);
50
+ doc.close();
51
+ setMountNode(getMountNode(frameRef));
52
+ }, [frameRef, srcDoc]);
53
+ useEffect(() => {
54
+ if (!frameRef || !frameRef.contentDocument) return;
55
+ const win = frameRef.contentWindow;
56
+ if (!win) return;
57
+ const mountNode$1 = getMountNode(frameRef);
58
+ if (!mountNode$1) return;
59
+ const exec = () => {
60
+ win.requestAnimationFrame(() => {
61
+ if (!frameRef.contentDocument?.documentElement) return;
62
+ frameRef.style.setProperty("--width", `${mountNode$1.scrollWidth}px`);
63
+ frameRef.style.setProperty("--height", `${mountNode$1.scrollHeight}px`);
64
+ });
65
+ };
66
+ const resizeObserver = new win.ResizeObserver(exec);
67
+ exec();
68
+ if (frameRef.contentDocument) resizeObserver.observe(mountNode$1);
69
+ return () => {
70
+ resizeObserver.disconnect();
71
+ };
72
+ }, [frameRef]);
73
+ return /* @__PURE__ */ jsx(EnvironmentProvider, {
74
+ value: () => frameRef?.contentDocument ?? document,
75
+ children: /* @__PURE__ */ jsxs("iframe", {
76
+ title: `frame:${useId()}`,
77
+ ref: composeRefs(ref, setFrameRef),
78
+ ...rest,
79
+ children: [mountNode ? createPortal(/* @__PURE__ */ jsx(FrameContent, {
80
+ onMount,
81
+ onUnmount,
82
+ children
83
+ }), mountNode) : null, head && frameRef ? createPortal(head, frameRef.contentDocument.head) : null]
84
+ })
85
+ });
86
+ });
87
+
88
+ //#endregion
89
+ export { Frame };
@@ -1,5 +1,5 @@
1
- const require_core = require('../../core-CPLjF6nm.cjs');
2
- const require_create_split_props = require('../../create-split-props-CSkzaUOy.cjs');
1
+ const require_chunk = require('../../chunk-BYnRvbsk.cjs');
2
+ const require_create_split_props = require('../../create-split-props-Dp4TWOyM.cjs');
3
3
  let react = require("react");
4
4
  let react_jsx_runtime = require("react/jsx-runtime");
5
5
  let __sprawlify_primitives_highlight_word = require("@sprawlify/primitives/highlight-word");
@@ -1,5 +1,5 @@
1
- import { t as Assign } from "../../types-DYWV3uAj.cjs";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import { t as Assign } from "../../types-B4tvWlDb.cjs";
2
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
3
3
  import { HighlightChunk, HighlightWordProps } from "@sprawlify/primitives/highlight-word";
4
4
 
5
5
  //#region src/components/highlight/use-highlight.d.ts
@@ -9,6 +9,6 @@ declare const useHighlight: (props: UseHighlightProps) => HighlightChunk[];
9
9
  //#region src/components/highlight/highlight.d.ts
10
10
  interface HighlightBaseProps extends UseHighlightProps {}
11
11
  interface HighlightProps extends Assign<React.ComponentProps<"mark">, HighlightBaseProps> {}
12
- declare const Highlight: (props: HighlightProps) => react_jsx_runtime0.JSX.Element;
12
+ declare const Highlight: (props: HighlightProps) => react_jsx_runtime2.JSX.Element;
13
13
  //#endregion
14
14
  export { Highlight, type HighlightChunk, type HighlightProps, type UseHighlightProps, useHighlight };
@@ -1,5 +1,5 @@
1
- import { t as Assign } from "../../types-FLvjyw__.mjs";
2
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import { t as Assign } from "../../types-BmBABPZb.mjs";
2
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
3
3
  import { HighlightChunk, HighlightWordProps } from "@sprawlify/primitives/highlight-word";
4
4
 
5
5
  //#region src/components/highlight/use-highlight.d.ts
@@ -9,6 +9,6 @@ declare const useHighlight: (props: UseHighlightProps) => HighlightChunk[];
9
9
  //#region src/components/highlight/highlight.d.ts
10
10
  interface HighlightBaseProps extends UseHighlightProps {}
11
11
  interface HighlightProps extends Assign<React.ComponentProps<"mark">, HighlightBaseProps> {}
12
- declare const Highlight: (props: HighlightProps) => react_jsx_runtime2.JSX.Element;
12
+ declare const Highlight: (props: HighlightProps) => react_jsx_runtime4.JSX.Element;
13
13
  //#endregion
14
14
  export { Highlight, type HighlightChunk, type HighlightProps, type UseHighlightProps, useHighlight };
@@ -1,4 +1,4 @@
1
- import { t as createSplitProps } from "../../create-split-props-BJQdOyld.mjs";
1
+ import { t as createSplitProps } from "../../create-split-props-CBL0m-GX.mjs";
2
2
  import { Fragment, useMemo } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { highlightWord } from "@sprawlify/primitives/highlight-word";
@@ -1,7 +1,8 @@
1
- const require_core = require('../../core-CPLjF6nm.cjs');
2
- require('../../create-context-D6DyFRSf.cjs');
3
- const require_environment = require('../../environment-DLPiALpf.cjs');
4
- require('../../providers-Bk3ALTxZ.cjs');
1
+ const require_chunk = require('../../chunk-BYnRvbsk.cjs');
2
+ require('../../create-context-CQ4U0lLj.cjs');
3
+ const require_environment = require('../../environment-CvilmfQt.cjs');
4
+ require('../../locale-BcnWD1Hf.cjs');
5
+ require('../../providers-BNAArubQ.cjs');
5
6
  let react = require("react");
6
7
  let react_dom = require("react-dom");
7
8
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -1,11 +1,11 @@
1
1
  import { PropsWithChildren, RefObject } from "react";
2
- import * as react_jsx_runtime2 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/portal/portal.d.ts
5
5
  interface PortalProps {
6
6
  disabled?: boolean | undefined;
7
7
  container?: RefObject<HTMLElement | null> | undefined;
8
8
  }
9
- declare const Portal: (props: PropsWithChildren<PortalProps>) => react_jsx_runtime2.JSX.Element;
9
+ declare const Portal: (props: PropsWithChildren<PortalProps>) => react_jsx_runtime0.JSX.Element;
10
10
  //#endregion
11
11
  export { Portal, type PortalProps };
@@ -1,11 +1,11 @@
1
1
  import { PropsWithChildren, RefObject } from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/portal/portal.d.ts
5
5
  interface PortalProps {
6
6
  disabled?: boolean | undefined;
7
7
  container?: RefObject<HTMLElement | null> | undefined;
8
8
  }
9
- declare const Portal: (props: PropsWithChildren<PortalProps>) => react_jsx_runtime0.JSX.Element;
9
+ declare const Portal: (props: PropsWithChildren<PortalProps>) => react_jsx_runtime5.JSX.Element;
10
10
  //#endregion
11
11
  export { Portal, type PortalProps };
@@ -1,6 +1,7 @@
1
- import "../../create-context-CdjrBhu7.mjs";
2
- import { n as useEnvironmentContext } from "../../environment-BXkWNF2O.mjs";
3
- import "../../providers-CyTYcOU1.mjs";
1
+ import "../../create-context-CCXzjEv8.mjs";
2
+ import { n as useEnvironmentContext } from "../../environment-Ded7DkGr.mjs";
3
+ import "../../locale-Coin-d7R.mjs";
4
+ import "../../providers-Dm2P3F2_.mjs";
4
5
  import { Children, useEffect, useState, useSyncExternalStore } from "react";
5
6
  import { createPortal } from "react-dom";
6
7
  import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
@@ -1,8 +1,8 @@
1
- require('../../core-CPLjF6nm.cjs');
2
- require('../../create-context-D6DyFRSf.cjs');
3
- require('../../factory-CDX-oCN5.cjs');
4
- const require_presence = require('../../presence-BX1tNsGA.cjs');
5
- require('../../use-event-CGMgV6xB.cjs');
1
+ require('../../core-DCWyxy9D.cjs');
2
+ require('../../create-context-CQ4U0lLj.cjs');
3
+ require('../../factory-C166evrS.cjs');
4
+ const require_presence = require('../../presence-CPov8wyU.cjs');
5
+ require('../../use-event-CLH8zHoJ.cjs');
6
6
 
7
7
  exports.Presence = require_presence.Presence;
8
8
  exports.PresenceProvider = require_presence.PresenceProvider;
@@ -1,2 +1,2 @@
1
- import { a as Presence, c as UsePresenceProps, i as splitPresenceProps, l as UsePresenceReturn, n as UsePresenceContext, o as PresenceBaseProps, r as usePresenceContext, s as PresenceProps, t as PresenceProvider, u as usePresence } from "../../index-DqRXPiW_.cjs";
1
+ import { a as Presence, c as UsePresenceProps, i as splitPresenceProps, l as UsePresenceReturn, n as UsePresenceContext, o as PresenceBaseProps, r as usePresenceContext, s as PresenceProps, t as PresenceProvider, u as usePresence } from "../../index-BhGgEHWc.cjs";
2
2
  export { Presence, PresenceBaseProps, PresenceProps, PresenceProvider, UsePresenceContext, UsePresenceProps, UsePresenceReturn, splitPresenceProps, usePresence, usePresenceContext };
@@ -1,4 +1,4 @@
1
- import "../../factory-BbbIuDqa.mjs";
2
- import "../../render-strategy-GetMScNK.mjs";
3
- import { a as Presence, c as UsePresenceProps, i as splitPresenceProps, l as UsePresenceReturn, n as UsePresenceContext, o as PresenceBaseProps, r as usePresenceContext, s as PresenceProps, t as PresenceProvider, u as usePresence } from "../../index-BUN9wyVM.mjs";
1
+ import "../../factory-C-EBNsCW.mjs";
2
+ import "../../render-strategy-C8IyLw0O.mjs";
3
+ import { a as Presence, c as UsePresenceProps, i as splitPresenceProps, l as UsePresenceReturn, n as UsePresenceContext, o as PresenceBaseProps, r as usePresenceContext, s as PresenceProps, t as PresenceProvider, u as usePresence } from "../../index-Cp1i1zbg.mjs";
4
4
  export { Presence, PresenceBaseProps, PresenceProps, PresenceProvider, UsePresenceContext, UsePresenceProps, UsePresenceReturn, splitPresenceProps, usePresence, usePresenceContext };
@@ -1,7 +1,7 @@
1
- import "../../core-C0F-4KYH.mjs";
2
- import "../../create-context-CdjrBhu7.mjs";
3
- import "../../factory-DQlmCPH2.mjs";
4
- import { a as splitPresenceProps, i as usePresence, n as usePresenceContext, r as Presence, t as PresenceProvider } from "../../presence-2A4loEJY.mjs";
5
- import "../../use-event-BcyNH29h.mjs";
1
+ import "../../core-Ba4IEjhK.mjs";
2
+ import "../../create-context-CCXzjEv8.mjs";
3
+ import "../../factory-Bi8oEg8i.mjs";
4
+ import { a as splitPresenceProps, i as usePresence, n as usePresenceContext, r as Presence, t as PresenceProvider } from "../../presence-Bc6Bxe5i.mjs";
5
+ import "../../use-event-4J5QFFqK.mjs";
6
6
 
7
7
  export { Presence, PresenceProvider, splitPresenceProps, usePresence, usePresenceContext };
@@ -1,18 +1,22 @@
1
- const require_core = require('../../core-CPLjF6nm.cjs');
2
- const require_create_context = require('../../create-context-D6DyFRSf.cjs');
3
- const require_environment = require('../../environment-DLPiALpf.cjs');
4
- const require_providers = require('../../providers-Bk3ALTxZ.cjs');
5
- const require_factory = require('../../factory-CDX-oCN5.cjs');
6
- const require_create_split_props = require('../../create-split-props-CSkzaUOy.cjs');
7
- const require_presence = require('../../presence-BX1tNsGA.cjs');
8
- require('../../use-event-CGMgV6xB.cjs');
9
- require('../../use-safe-layout-effect-vuYaDIpT.cjs');
10
- const require_field = require('../../field-CXhpW6zO.cjs');
11
- const require_collection = require('../../collection-BKabYqpE.cjs');
1
+ const require_chunk = require('../../chunk-BYnRvbsk.cjs');
2
+ const require_core = require('../../core-DCWyxy9D.cjs');
3
+ const require_create_context = require('../../create-context-CQ4U0lLj.cjs');
4
+ const require_environment = require('../../environment-CvilmfQt.cjs');
5
+ const require_locale = require('../../locale-BcnWD1Hf.cjs');
6
+ require('../../providers-BNAArubQ.cjs');
7
+ const require_compose_refs = require('../../compose-refs-C5QNDywq.cjs');
8
+ const require_factory = require('../../factory-C166evrS.cjs');
9
+ const require_create_split_props = require('../../create-split-props-Dp4TWOyM.cjs');
10
+ const require_presence = require('../../presence-CPov8wyU.cjs');
11
+ require('../../use-event-CLH8zHoJ.cjs');
12
+ require('../../use-fieldset-context-CCQLmNLL.cjs');
13
+ require('../../use-safe-layout-effect-C2GgvNT3.cjs');
14
+ const require_field = require('../../field-C-57Gj2E.cjs');
15
+ const require_collection = require('../../collection-DGEUORi5.cjs');
12
16
  let react = require("react");
13
17
  let react_jsx_runtime = require("react/jsx-runtime");
14
18
  let __sprawlify_primitives_machines_select = require("@sprawlify/primitives/machines/select");
15
- __sprawlify_primitives_machines_select = require_core.__toESM(__sprawlify_primitives_machines_select);
19
+ __sprawlify_primitives_machines_select = require_chunk.__toESM(__sprawlify_primitives_machines_select);
16
20
  let __sprawlify_primitives_core = require("@sprawlify/primitives/core");
17
21
 
18
22
  //#region src/components/select/use-select-context.ts
@@ -42,7 +46,7 @@ const SelectContent = (0, react.forwardRef)((props, ref) => {
42
46
  if (presence.unmounted) return null;
43
47
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
44
48
  ...mergedProps,
45
- ref: require_factory.composeRefs(presence.ref, ref)
49
+ ref: require_compose_refs.composeRefs(presence.ref, ref)
46
50
  });
47
51
  });
48
52
  SelectContent.displayName = "SelectContent";
@@ -239,7 +243,7 @@ SelectPositioner.displayName = "SelectPositioner";
239
243
  //#region src/components/select/use-select.ts
240
244
  const useSelect = (props) => {
241
245
  const id = (0, react.useId)();
242
- const { dir } = require_providers.useLocaleContext();
246
+ const { dir } = require_locale.useLocaleContext();
243
247
  const { getRootNode } = require_environment.useEnvironmentContext();
244
248
  const field = require_field.useFieldContext();
245
249
  const machineProps = {
@@ -358,7 +362,7 @@ SelectValueText.displayName = "SelectValueText";
358
362
 
359
363
  //#endregion
360
364
  //#region src/components/select/select.ts
361
- var select_exports = /* @__PURE__ */ require_core.__export({
365
+ var select_exports = /* @__PURE__ */ require_chunk.__export({
362
366
  ClearTrigger: () => SelectClearTrigger,
363
367
  Content: () => SelectContent,
364
368
  Context: () => SelectContext,