@sprawlify/react 0.0.6 → 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.
- package/dist/chunk-BYnRvbsk.cjs +53 -0
- package/dist/{collapsible-DYgHs1_i.mjs → collapsible-Nbt3Sequ.mjs} +7 -4
- package/dist/{collapsible-D_cXuaRy.cjs → collapsible-aFKYmVbP.cjs} +13 -9
- package/dist/collection-DGEUORi5.cjs +230 -0
- package/dist/collection-DQWWySNV.mjs +187 -0
- package/dist/components/accordion/index.cjs +21 -24
- package/dist/components/accordion/index.d.cts +11 -9
- package/dist/components/accordion/index.d.mts +11 -9
- package/dist/components/accordion/index.mjs +10 -14
- package/dist/components/angle-slider/index.cjs +14 -9
- package/dist/components/angle-slider/index.d.cts +13 -11
- package/dist/components/angle-slider/index.d.mts +13 -11
- package/dist/components/angle-slider/index.mjs +8 -4
- package/dist/components/avatar/index.cjs +14 -9
- package/dist/components/avatar/index.d.cts +8 -6
- package/dist/components/avatar/index.d.mts +8 -6
- package/dist/components/avatar/index.mjs +8 -4
- package/dist/components/bottom-sheet/index.cjs +216 -0
- package/dist/components/bottom-sheet/index.d.cts +80 -0
- package/dist/components/bottom-sheet/index.d.mts +81 -0
- package/dist/components/bottom-sheet/index.mjs +192 -0
- package/dist/components/carousel/index.cjs +265 -0
- package/dist/components/carousel/index.d.cts +95 -0
- package/dist/components/carousel/index.d.mts +95 -0
- package/dist/components/carousel/index.mjs +243 -0
- package/dist/components/checkbox/index.cjs +311 -0
- package/dist/components/checkbox/index.d.cts +115 -0
- package/dist/components/checkbox/index.d.mts +115 -0
- package/dist/components/checkbox/index.mjs +291 -0
- package/dist/components/client-only/index.cjs +14 -0
- package/dist/components/client-only/index.d.cts +8 -0
- package/dist/components/client-only/index.d.mts +8 -0
- package/dist/components/client-only/index.mjs +13 -0
- package/dist/components/clipboard/index.cjs +186 -0
- package/dist/components/clipboard/index.d.cts +71 -0
- package/dist/components/clipboard/index.d.mts +71 -0
- package/dist/components/clipboard/index.mjs +163 -0
- package/dist/components/collapsible/index.cjs +8 -3
- package/dist/components/collapsible/index.d.cts +10 -8
- package/dist/components/collapsible/index.d.mts +10 -8
- package/dist/components/collapsible/index.mjs +7 -3
- package/dist/components/collection/index.cjs +11 -0
- package/dist/components/collection/index.d.cts +2 -0
- package/dist/components/collection/index.d.mts +2 -0
- package/dist/components/collection/index.mjs +5 -0
- package/dist/components/color-picker/index.cjs +617 -0
- package/dist/components/color-picker/index.d.cts +181 -0
- package/dist/components/color-picker/index.d.mts +182 -0
- package/dist/components/color-picker/index.mjs +573 -0
- package/dist/components/combobox/index.cjs +420 -0
- package/dist/components/combobox/index.d.cts +132 -0
- package/dist/components/combobox/index.d.mts +133 -0
- package/dist/components/combobox/index.mjs +390 -0
- package/dist/components/date-picker/index.cjs +567 -0
- package/dist/components/date-picker/index.d.cts +164 -0
- package/dist/components/date-picker/index.d.mts +165 -0
- package/dist/components/date-picker/index.mjs +526 -0
- package/dist/components/dialog/index.cjs +211 -0
- package/dist/components/dialog/index.d.cts +80 -0
- package/dist/components/dialog/index.d.mts +81 -0
- package/dist/components/dialog/index.mjs +187 -0
- package/dist/components/download-trigger/index.cjs +43 -0
- package/dist/components/download-trigger/index.d.cts +16 -0
- package/dist/components/download-trigger/index.d.mts +16 -0
- package/dist/components/download-trigger/index.mjs +42 -0
- package/dist/components/editable/index.cjs +246 -0
- package/dist/components/editable/index.d.cts +79 -0
- package/dist/components/editable/index.d.mts +79 -0
- package/dist/components/editable/index.mjs +221 -0
- package/dist/components/field/index.cjs +29 -0
- package/dist/components/field/index.d.cts +116 -0
- package/dist/components/field/index.d.mts +116 -0
- package/dist/components/field/index.mjs +11 -0
- package/dist/components/fieldset/index.cjs +25 -0
- package/dist/components/fieldset/index.d.cts +73 -0
- package/dist/components/fieldset/index.d.mts +73 -0
- package/dist/components/fieldset/index.mjs +11 -0
- package/dist/components/file-upload/index.cjs +351 -0
- package/dist/components/file-upload/index.d.cts +102 -0
- package/dist/components/file-upload/index.d.mts +102 -0
- package/dist/components/file-upload/index.mjs +322 -0
- package/dist/components/floating-panel/index.cjs +287 -0
- package/dist/components/floating-panel/index.d.cts +100 -0
- package/dist/components/floating-panel/index.d.mts +101 -0
- package/dist/components/floating-panel/index.mjs +259 -0
- package/dist/components/focus-trap/index.cjs +36 -0
- package/dist/components/focus-trap/index.d.cts +14 -0
- package/dist/components/focus-trap/index.d.mts +14 -0
- package/dist/components/focus-trap/index.mjs +35 -0
- package/dist/components/format/index.cjs +57 -0
- package/dist/components/format/index.d.cts +36 -0
- package/dist/components/format/index.d.mts +36 -0
- package/dist/components/format/index.mjs +49 -0
- package/dist/components/frame/index.cjs +90 -0
- package/dist/components/frame/index.d.cts +13 -0
- package/dist/components/frame/index.d.mts +13 -0
- package/dist/components/frame/index.mjs +89 -0
- package/dist/components/highlight/index.cjs +32 -0
- package/dist/components/highlight/index.d.cts +14 -0
- package/dist/components/highlight/index.d.mts +14 -0
- package/dist/components/highlight/index.mjs +30 -0
- package/dist/components/portal/index.cjs +33 -0
- package/dist/components/portal/index.d.cts +11 -0
- package/dist/components/portal/index.d.mts +11 -0
- package/dist/components/portal/index.mjs +32 -0
- package/dist/components/presence/index.cjs +11 -0
- package/dist/components/presence/index.d.cts +2 -0
- package/dist/components/presence/index.d.mts +4 -0
- package/dist/components/presence/index.mjs +7 -0
- package/dist/components/select/index.cjs +423 -0
- package/dist/components/select/index.d.cts +132 -0
- package/dist/components/select/index.d.mts +133 -0
- package/dist/components/select/index.mjs +387 -0
- package/dist/compose-refs-BEptPEkE.mjs +16 -0
- package/dist/compose-refs-C5QNDywq.cjs +22 -0
- package/dist/{factory-DN0EdT7u.mjs → core-Ba4IEjhK.mjs} +4 -154
- package/dist/{factory-CfqPG186.cjs → core-DCWyxy9D.cjs} +2 -251
- package/dist/{create-context-DCEySQ7J.cjs → create-context-CQ4U0lLj.cjs} +1 -1
- package/dist/environment-CvilmfQt.cjs +58 -0
- package/dist/environment-Ded7DkGr.mjs +46 -0
- package/dist/factory-Bi8oEg8i.mjs +49 -0
- package/dist/factory-C-EBNsCW.d.mts +15 -0
- package/dist/factory-C166evrS.cjs +61 -0
- package/dist/factory-C4cfTHs7.d.cts +15 -0
- package/dist/field-B-6qoKdn.mjs +324 -0
- package/dist/field-C-57Gj2E.cjs +406 -0
- package/dist/fieldset-B-MkM2Ms.cjs +239 -0
- package/dist/fieldset-gaVneDYh.mjs +186 -0
- package/dist/index-BJvW7OpY.d.mts +25 -0
- package/dist/index-BhGgEHWc.d.cts +34 -0
- package/dist/index-ByIsf4E7.d.mts +74 -0
- package/dist/index-Cp1i1zbg.d.mts +34 -0
- package/dist/index-CumJbg8V.d.cts +74 -0
- package/dist/index.cjs +17 -12
- package/dist/index.d.cts +7 -5
- package/dist/index.d.mts +7 -5
- package/dist/index.mjs +7 -3
- package/dist/locale-BcnWD1Hf.cjs +78 -0
- package/dist/locale-Coin-d7R.mjs +54 -0
- package/dist/normalize-props-skGwa8Dk.d.cts +13 -0
- package/dist/presence-Bc6Bxe5i.mjs +72 -0
- package/dist/presence-CPov8wyU.cjs +103 -0
- package/dist/providers-BNAArubQ.cjs +0 -0
- package/dist/providers-Dm2P3F2_.mjs +1 -0
- package/dist/render-strategy-BywM_IvB.cjs +30 -0
- package/dist/render-strategy-FiPgAp1U.mjs +13 -0
- package/dist/types-B4tvWlDb.d.cts +6 -0
- package/dist/types-BmBABPZb.d.mts +6 -0
- package/dist/use-event-4J5QFFqK.mjs +19 -0
- package/dist/use-event-CLH8zHoJ.cjs +25 -0
- package/dist/use-fieldset-context-CCQLmNLL.cjs +23 -0
- package/dist/use-fieldset-context-LwveT1OS.mjs +12 -0
- package/dist/use-safe-layout-effect-C2GgvNT3.cjs +13 -0
- package/dist/use-safe-layout-effect-CLjnuJFb.mjs +7 -0
- package/dist/utils/index.cjs +3 -3
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +232 -2
- package/dist/factory-BZBSaT-0.d.cts +0 -29
- package/dist/factory-DaVMAttY.d.mts +0 -41
- /package/dist/{chunk-CYMnug_4.mjs → chunk-BXPHTOwk.mjs} +0 -0
- /package/dist/{create-context-DGYD_HQt.mjs → create-context-CCXzjEv8.mjs} +0 -0
- /package/dist/{create-split-props-BFscidWy.mjs → create-split-props-CBL0m-GX.mjs} +0 -0
- /package/dist/{create-split-props-CSaOnJRj.cjs → create-split-props-Dp4TWOyM.cjs} +0 -0
- /package/dist/{index-OOf7QNG5.d.mts → index-CureNJdc.d.mts} +0 -0
- /package/dist/{index-DiYk6N_L.d.cts → index-dbTyAXLy.d.cts} +0 -0
- /package/dist/{render-strategy--1FNKx5x.d.mts → render-strategy-C8IyLw0O.d.mts} +0 -0
- /package/dist/{render-strategy-RT-KvAqO.d.cts → render-strategy-rA4C5NUX.d.cts} +0 -0
- /package/dist/{utils-Cb5K29pi.cjs → utils-B_Ojepvp.cjs} +0 -0
- /package/dist/{utils-nfWHwVIS.mjs → utils-C-m3mZWI.mjs} +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { t as createContext$1 } from "./create-context-CCXzjEv8.mjs";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { createCollator, createFilter, isRTL } from "@sprawlify/primitives/i18n-utils";
|
|
5
|
+
|
|
6
|
+
//#region src/providers/locale/use-locale-context.ts
|
|
7
|
+
const [LocaleContextProvider, useLocaleContext] = createContext$1({
|
|
8
|
+
name: "LocaleContext",
|
|
9
|
+
hookName: "useLocaleContext",
|
|
10
|
+
providerName: "<LocaleProvider />",
|
|
11
|
+
strict: false,
|
|
12
|
+
defaultValue: {
|
|
13
|
+
dir: "ltr",
|
|
14
|
+
locale: "en-US"
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/providers/locale/locale-provider.tsx
|
|
20
|
+
const LocaleProvider = (props) => {
|
|
21
|
+
const { children, locale } = props;
|
|
22
|
+
return /* @__PURE__ */ jsx(LocaleContextProvider, {
|
|
23
|
+
value: {
|
|
24
|
+
locale,
|
|
25
|
+
dir: isRTL(locale) ? "rtl" : "ltr"
|
|
26
|
+
},
|
|
27
|
+
children
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/providers/locale/use-collator.ts
|
|
33
|
+
function useCollator(props = {}) {
|
|
34
|
+
const env = useLocaleContext();
|
|
35
|
+
const locale = props.locale ?? env.locale;
|
|
36
|
+
return useMemo(() => {
|
|
37
|
+
const { locale: _, ...options } = props;
|
|
38
|
+
return createCollator(locale, options);
|
|
39
|
+
}, [locale, props]);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/providers/locale/use-filter.ts
|
|
44
|
+
function useFilter(props) {
|
|
45
|
+
const env = useLocaleContext();
|
|
46
|
+
const locale = props.locale ?? env.locale;
|
|
47
|
+
return useMemo(() => createFilter({
|
|
48
|
+
...props,
|
|
49
|
+
locale
|
|
50
|
+
}), [locale, props]);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
export { useLocaleContext as i, useCollator as n, LocaleProvider as r, useFilter as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CSSProperties, HTMLAttributes, JSX } from "react";
|
|
2
|
+
import * as _sprawlify_primitives_types0 from "@sprawlify/primitives/types";
|
|
3
|
+
|
|
4
|
+
//#region src/core/normalize-props.d.ts
|
|
5
|
+
type WithoutRef<T> = Omit<T, "ref">;
|
|
6
|
+
type ElementsWithoutRef = { [K in keyof JSX.IntrinsicElements]: WithoutRef<JSX.IntrinsicElements[K]> };
|
|
7
|
+
type PropTypes$1 = ElementsWithoutRef & {
|
|
8
|
+
element: WithoutRef<HTMLAttributes<HTMLElement>>;
|
|
9
|
+
style: CSSProperties;
|
|
10
|
+
};
|
|
11
|
+
declare const normalizeProps: _sprawlify_primitives_types0.NormalizeProps<PropTypes$1>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { normalizeProps as n, PropTypes$1 as t };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { i as useMachine, r as normalizeProps } from "./core-Ba4IEjhK.mjs";
|
|
2
|
+
import { t as createContext$1 } from "./create-context-CCXzjEv8.mjs";
|
|
3
|
+
import { t as composeRefs } from "./compose-refs-BEptPEkE.mjs";
|
|
4
|
+
import { n as sprawlify } from "./factory-Bi8oEg8i.mjs";
|
|
5
|
+
import { t as createSplitProps } from "./create-split-props-CBL0m-GX.mjs";
|
|
6
|
+
import { t as useEvent } from "./use-event-4J5QFFqK.mjs";
|
|
7
|
+
import { forwardRef, useRef } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import * as presence from "@sprawlify/primitives/machines/presence";
|
|
10
|
+
|
|
11
|
+
//#region src/components/presence/split-presence-props.ts
|
|
12
|
+
const splitPresenceProps = (props) => createSplitProps()(props, [
|
|
13
|
+
"immediate",
|
|
14
|
+
"lazyMount",
|
|
15
|
+
"onExitComplete",
|
|
16
|
+
"present",
|
|
17
|
+
"skipAnimationOnMount",
|
|
18
|
+
"unmountOnExit"
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/presence/use-presence.ts
|
|
23
|
+
const usePresence = (props = {}) => {
|
|
24
|
+
const { lazyMount, unmountOnExit, present, skipAnimationOnMount = false, ...rest } = props;
|
|
25
|
+
const wasEverPresent = useRef(false);
|
|
26
|
+
const machineProps = {
|
|
27
|
+
...rest,
|
|
28
|
+
present,
|
|
29
|
+
onExitComplete: useEvent(props.onExitComplete)
|
|
30
|
+
};
|
|
31
|
+
const service = useMachine(presence.machine, machineProps);
|
|
32
|
+
const api = presence.connect(service, normalizeProps);
|
|
33
|
+
if (api.present) wasEverPresent.current = true;
|
|
34
|
+
const unmounted = !api.present && !wasEverPresent.current && lazyMount || unmountOnExit && !api.present && wasEverPresent.current;
|
|
35
|
+
const getPresenceProps = () => ({
|
|
36
|
+
"data-state": api.skip && skipAnimationOnMount ? void 0 : present ? "open" : "closed",
|
|
37
|
+
hidden: !api.present
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
ref: api.setNode,
|
|
41
|
+
getPresenceProps,
|
|
42
|
+
present: api.present,
|
|
43
|
+
unmounted
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/components/presence/presence.tsx
|
|
49
|
+
const Presence = forwardRef((props, ref) => {
|
|
50
|
+
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
51
|
+
const presence$1 = usePresence(presenceProps);
|
|
52
|
+
if (presence$1.unmounted) return null;
|
|
53
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
54
|
+
...localProps,
|
|
55
|
+
...presence$1.getPresenceProps(),
|
|
56
|
+
"data-scope": "presence",
|
|
57
|
+
"data-part": "root",
|
|
58
|
+
ref: composeRefs(presence$1.ref, ref)
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
Presence.displayName = "Presence";
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/components/presence/use-presence-context.ts
|
|
65
|
+
const [PresenceProvider, usePresenceContext] = createContext$1({
|
|
66
|
+
name: "PresenceContext",
|
|
67
|
+
hookName: "usePresenceContext",
|
|
68
|
+
providerName: "<PresenceProvider />"
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
export { splitPresenceProps as a, usePresence as i, usePresenceContext as n, Presence as r, PresenceProvider as t };
|
|
@@ -0,0 +1,103 @@
|
|
|
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_compose_refs = require('./compose-refs-C5QNDywq.cjs');
|
|
5
|
+
const require_factory = require('./factory-C166evrS.cjs');
|
|
6
|
+
const require_create_split_props = require('./create-split-props-Dp4TWOyM.cjs');
|
|
7
|
+
const require_use_event = require('./use-event-CLH8zHoJ.cjs');
|
|
8
|
+
let react = require("react");
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
let __sprawlify_primitives_machines_presence = require("@sprawlify/primitives/machines/presence");
|
|
11
|
+
__sprawlify_primitives_machines_presence = require_chunk.__toESM(__sprawlify_primitives_machines_presence);
|
|
12
|
+
|
|
13
|
+
//#region src/components/presence/split-presence-props.ts
|
|
14
|
+
const splitPresenceProps = (props) => require_create_split_props.createSplitProps()(props, [
|
|
15
|
+
"immediate",
|
|
16
|
+
"lazyMount",
|
|
17
|
+
"onExitComplete",
|
|
18
|
+
"present",
|
|
19
|
+
"skipAnimationOnMount",
|
|
20
|
+
"unmountOnExit"
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/components/presence/use-presence.ts
|
|
25
|
+
const usePresence = (props = {}) => {
|
|
26
|
+
const { lazyMount, unmountOnExit, present, skipAnimationOnMount = false, ...rest } = props;
|
|
27
|
+
const wasEverPresent = (0, react.useRef)(false);
|
|
28
|
+
const machineProps = {
|
|
29
|
+
...rest,
|
|
30
|
+
present,
|
|
31
|
+
onExitComplete: require_use_event.useEvent(props.onExitComplete)
|
|
32
|
+
};
|
|
33
|
+
const service = require_core.useMachine(__sprawlify_primitives_machines_presence.machine, machineProps);
|
|
34
|
+
const api = __sprawlify_primitives_machines_presence.connect(service, require_core.normalizeProps);
|
|
35
|
+
if (api.present) wasEverPresent.current = true;
|
|
36
|
+
const unmounted = !api.present && !wasEverPresent.current && lazyMount || unmountOnExit && !api.present && wasEverPresent.current;
|
|
37
|
+
const getPresenceProps = () => ({
|
|
38
|
+
"data-state": api.skip && skipAnimationOnMount ? void 0 : present ? "open" : "closed",
|
|
39
|
+
hidden: !api.present
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
ref: api.setNode,
|
|
43
|
+
getPresenceProps,
|
|
44
|
+
present: api.present,
|
|
45
|
+
unmounted
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/components/presence/presence.tsx
|
|
51
|
+
const Presence = (0, react.forwardRef)((props, ref) => {
|
|
52
|
+
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
53
|
+
const presence = usePresence(presenceProps);
|
|
54
|
+
if (presence.unmounted) return null;
|
|
55
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
56
|
+
...localProps,
|
|
57
|
+
...presence.getPresenceProps(),
|
|
58
|
+
"data-scope": "presence",
|
|
59
|
+
"data-part": "root",
|
|
60
|
+
ref: require_compose_refs.composeRefs(presence.ref, ref)
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
Presence.displayName = "Presence";
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/components/presence/use-presence-context.ts
|
|
67
|
+
const [PresenceProvider, usePresenceContext] = require_create_context.createContext({
|
|
68
|
+
name: "PresenceContext",
|
|
69
|
+
hookName: "usePresenceContext",
|
|
70
|
+
providerName: "<PresenceProvider />"
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
Object.defineProperty(exports, 'Presence', {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
get: function () {
|
|
77
|
+
return Presence;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(exports, 'PresenceProvider', {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function () {
|
|
83
|
+
return PresenceProvider;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
Object.defineProperty(exports, 'splitPresenceProps', {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
get: function () {
|
|
89
|
+
return splitPresenceProps;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
Object.defineProperty(exports, 'usePresence', {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function () {
|
|
95
|
+
return usePresence;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(exports, 'usePresenceContext', {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function () {
|
|
101
|
+
return usePresenceContext;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const require_create_context = require('./create-context-CQ4U0lLj.cjs');
|
|
2
|
+
const require_create_split_props = require('./create-split-props-Dp4TWOyM.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/utils/render-strategy.ts
|
|
5
|
+
const [RenderStrategyPropsProvider, useRenderStrategyPropsContext] = require_create_context.createContext({
|
|
6
|
+
name: "RenderStrategyContext",
|
|
7
|
+
hookName: "useRenderStrategyContext",
|
|
8
|
+
providerName: "<RenderStrategyPropsProvider />"
|
|
9
|
+
});
|
|
10
|
+
const splitRenderStrategyProps = (props) => require_create_split_props.createSplitProps()(props, ["lazyMount", "unmountOnExit"]);
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
Object.defineProperty(exports, 'RenderStrategyPropsProvider', {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return RenderStrategyPropsProvider;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, 'splitRenderStrategyProps', {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return splitRenderStrategyProps;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, 'useRenderStrategyPropsContext', {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return useRenderStrategyPropsContext;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { t as createContext } from "./create-context-CCXzjEv8.mjs";
|
|
2
|
+
import { t as createSplitProps } from "./create-split-props-CBL0m-GX.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/render-strategy.ts
|
|
5
|
+
const [RenderStrategyPropsProvider, useRenderStrategyPropsContext] = createContext({
|
|
6
|
+
name: "RenderStrategyContext",
|
|
7
|
+
hookName: "useRenderStrategyContext",
|
|
8
|
+
providerName: "<RenderStrategyPropsProvider />"
|
|
9
|
+
});
|
|
10
|
+
const splitRenderStrategyProps = (props) => createSplitProps()(props, ["lazyMount", "unmountOnExit"]);
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { splitRenderStrategyProps as n, useRenderStrategyPropsContext as r, RenderStrategyPropsProvider as t };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useCallback, useRef } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/use-event.ts
|
|
4
|
+
function useEvent(callback, opts = {}) {
|
|
5
|
+
const { sync = false } = opts;
|
|
6
|
+
const callbackRef = useLatestRef(callback);
|
|
7
|
+
return useCallback((...args) => {
|
|
8
|
+
if (sync) return queueMicrotask(() => callbackRef.current?.(...args));
|
|
9
|
+
return callbackRef.current?.(...args);
|
|
10
|
+
}, [sync, callbackRef]);
|
|
11
|
+
}
|
|
12
|
+
function useLatestRef(value) {
|
|
13
|
+
const ref = useRef(value);
|
|
14
|
+
ref.current = value;
|
|
15
|
+
return ref;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { useEvent as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-BYnRvbsk.cjs');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
|
|
4
|
+
//#region src/utils/use-event.ts
|
|
5
|
+
function useEvent(callback, opts = {}) {
|
|
6
|
+
const { sync = false } = opts;
|
|
7
|
+
const callbackRef = useLatestRef(callback);
|
|
8
|
+
return (0, react.useCallback)((...args) => {
|
|
9
|
+
if (sync) return queueMicrotask(() => callbackRef.current?.(...args));
|
|
10
|
+
return callbackRef.current?.(...args);
|
|
11
|
+
}, [sync, callbackRef]);
|
|
12
|
+
}
|
|
13
|
+
function useLatestRef(value) {
|
|
14
|
+
const ref = (0, react.useRef)(value);
|
|
15
|
+
ref.current = value;
|
|
16
|
+
return ref;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
Object.defineProperty(exports, 'useEvent', {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () {
|
|
23
|
+
return useEvent;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const require_create_context = require('./create-context-CQ4U0lLj.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/components/fieldset/use-fieldset-context.ts
|
|
4
|
+
const [FieldsetProvider, useFieldsetContext] = require_create_context.createContext({
|
|
5
|
+
name: "FieldsetContext",
|
|
6
|
+
hookName: "useFieldsetContext",
|
|
7
|
+
providerName: "<FieldsetProvider />",
|
|
8
|
+
strict: false
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
Object.defineProperty(exports, 'FieldsetProvider', {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return FieldsetProvider;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, 'useFieldsetContext', {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return useFieldsetContext;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { t as createContext } from "./create-context-CCXzjEv8.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/components/fieldset/use-fieldset-context.ts
|
|
4
|
+
const [FieldsetProvider, useFieldsetContext] = createContext({
|
|
5
|
+
name: "FieldsetContext",
|
|
6
|
+
hookName: "useFieldsetContext",
|
|
7
|
+
providerName: "<FieldsetProvider />",
|
|
8
|
+
strict: false
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { useFieldsetContext as n, FieldsetProvider as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-BYnRvbsk.cjs');
|
|
2
|
+
let react = require("react");
|
|
3
|
+
|
|
4
|
+
//#region src/utils/use-safe-layout-effect.ts
|
|
5
|
+
const useSafeLayoutEffect = typeof window !== "undefined" ? react.useLayoutEffect : react.useEffect;
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
Object.defineProperty(exports, 'useSafeLayoutEffect', {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () {
|
|
11
|
+
return useSafeLayoutEffect;
|
|
12
|
+
}
|
|
13
|
+
});
|
package/dist/utils/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
const require_create_context = require('../create-context-
|
|
3
|
-
require('../utils-
|
|
1
|
+
const require_chunk = require('../chunk-BYnRvbsk.cjs');
|
|
2
|
+
const require_create_context = require('../create-context-CQ4U0lLj.cjs');
|
|
3
|
+
require('../utils-B_Ojepvp.cjs');
|
|
4
4
|
let __sprawlify_primitives_core = require("@sprawlify/primitives/core");
|
|
5
5
|
|
|
6
6
|
exports.createContext = require_create_context.createContext;
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createContext, t as mergeProps } from "../index-
|
|
1
|
+
import { n as createContext, t as mergeProps } from "../index-dbTyAXLy.cjs";
|
|
2
2
|
export { createContext, mergeProps };
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createContext, t as mergeProps } from "../index-
|
|
1
|
+
import { n as createContext, t as mergeProps } from "../index-CureNJdc.mjs";
|
|
2
2
|
export { createContext, mergeProps };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createContext } from "../create-context-
|
|
2
|
-
import { t as mergeProps } from "../utils-
|
|
1
|
+
import { t as createContext } from "../create-context-CCXzjEv8.mjs";
|
|
2
|
+
import { t as mergeProps } from "../utils-C-m3mZWI.mjs";
|
|
3
3
|
|
|
4
4
|
export { createContext, mergeProps };
|