@sprawlify/solid 0.0.111 → 0.0.112
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/{alert-dialog-anatomy-C2_0cMsp.d.ts → alert-dialog-anatomy-Divf2Pd0.d.ts} +1 -1
- package/dist/{carousel-anatomy-D6Mj7oF7.d.ts → carousel-anatomy-CxiyJUg-.d.ts} +1 -1
- package/dist/{checkbox-anatomy-6YrEMoE8.d.ts → checkbox-anatomy-PPxvbQhr.d.ts} +1 -1
- package/dist/{collapsible-CqDl0d8N.js → collapsible-Dl7EhB4_.js} +2 -2
- package/dist/{color-picker-anatomy-CYCuI0Qh.d.ts → color-picker-anatomy-C1t36hMB.d.ts} +1 -1
- package/dist/{combobox-anatomy-BP3wcKDL.d.ts → combobox-anatomy-Cx_UzmKN.d.ts} +1 -1
- package/dist/components/accordion/index.d.ts +5 -5
- package/dist/components/accordion/index.js +3 -3
- package/dist/components/alert-dialog/index.d.ts +5 -5
- package/dist/components/alert-dialog/index.js +5 -4
- package/dist/components/alert-dialog/index.jsx +2 -1
- package/dist/components/anatomy.d.ts +53 -52
- package/dist/components/anatomy.js +12 -11
- package/dist/components/angle-slider/index.d.ts +4 -4
- package/dist/components/angle-slider/index.js +1 -1
- package/dist/components/aspect-ratio/index.d.ts +3 -3
- package/dist/components/aspect-ratio/index.js +1 -1
- package/dist/components/avatar/index.d.ts +4 -4
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/carousel/index.d.ts +4 -4
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/checkbox/index.d.ts +4 -4
- package/dist/components/checkbox/index.js +4 -4
- package/dist/components/checkbox/index.jsx +2 -2
- package/dist/components/clipboard/index.d.ts +4 -4
- package/dist/components/clipboard/index.js +1 -1
- package/dist/components/collapsible/index.d.ts +5 -5
- package/dist/components/collapsible/index.js +3 -3
- package/dist/components/collection/index.d.ts +1 -1
- package/dist/components/collection/index.js +1 -1
- package/dist/components/collection/index.jsx +1 -1
- package/dist/components/color-picker/index.d.ts +5 -5
- package/dist/components/color-picker/index.js +7 -6
- package/dist/components/color-picker/index.jsx +4 -3
- package/dist/components/combobox/index.d.ts +6 -6
- package/dist/components/combobox/index.js +8 -7
- package/dist/components/combobox/index.jsx +5 -4
- package/dist/components/date-picker/index.d.ts +5 -5
- package/dist/components/date-picker/index.js +5 -4
- package/dist/components/date-picker/index.jsx +2 -1
- package/dist/components/dialog/index.d.ts +5 -5
- package/dist/components/dialog/index.js +5 -4
- package/dist/components/dialog/index.jsx +2 -1
- package/dist/components/download-trigger/index.d.ts +2 -2
- package/dist/components/drawer/index.d.ts +5 -5
- package/dist/components/drawer/index.js +5 -4
- package/dist/components/drawer/index.jsx +2 -1
- package/dist/components/dropdown-menu/index.d.ts +5 -5
- package/dist/components/dropdown-menu/index.js +5 -4
- package/dist/components/dropdown-menu/index.jsx +2 -1
- package/dist/components/editable/index.d.ts +4 -4
- package/dist/components/editable/index.js +4 -4
- package/dist/components/editable/index.jsx +2 -2
- package/dist/components/field/index.d.ts +3 -3
- package/dist/components/field/index.js +4 -4
- package/dist/components/field/index.jsx +2 -2
- package/dist/components/fieldset/index.d.ts +3 -3
- package/dist/components/fieldset/index.js +3 -3
- package/dist/components/fieldset/index.jsx +1 -1
- package/dist/components/file-upload/index.d.ts +4 -4
- package/dist/components/file-upload/index.js +4 -4
- package/dist/components/file-upload/index.jsx +2 -2
- package/dist/components/floating-panel/index.d.ts +5 -5
- package/dist/components/floating-panel/index.js +5 -4
- package/dist/components/floating-panel/index.jsx +2 -1
- package/dist/components/focus-trap/index.d.ts +2 -2
- package/dist/components/focus-trap/index.js +2 -2
- package/dist/components/frame/index.d.ts +1 -1
- package/dist/components/frame/index.js +1 -1
- package/dist/components/highlight/index.d.ts +1 -1
- package/dist/components/highlight/index.js +1 -1
- package/dist/components/hover-card/index.d.ts +5 -5
- package/dist/components/hover-card/index.js +5 -4
- package/dist/components/hover-card/index.jsx +2 -1
- package/dist/components/image-cropper/index.d.ts +4 -4
- package/dist/components/image-cropper/index.js +1 -1
- package/dist/components/json-tree-view/index.d.ts +1 -1
- package/dist/components/json-tree-view/index.js +6 -5
- package/dist/components/json-tree-view/index.jsx +2 -2
- package/dist/components/listbox/index.d.ts +5 -5
- package/dist/components/listbox/index.js +2 -2
- package/dist/components/listbox/index.jsx +1 -1
- package/dist/components/marquee/index.d.ts +4 -4
- package/dist/components/marquee/index.js +1 -1
- package/dist/components/navigation-menu/index.d.ts +5 -5
- package/dist/components/navigation-menu/index.js +5 -4
- package/dist/components/navigation-menu/index.jsx +2 -1
- package/dist/components/number-input/index.d.ts +4 -4
- package/dist/components/number-input/index.js +4 -4
- package/dist/components/number-input/index.jsx +2 -2
- package/dist/components/pagination/index.d.ts +4 -4
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/password-input/index.d.ts +4 -4
- package/dist/components/password-input/index.js +4 -4
- package/dist/components/password-input/index.jsx +2 -2
- package/dist/components/pin-input/index.d.ts +4 -4
- package/dist/components/pin-input/index.js +4 -4
- package/dist/components/pin-input/index.jsx +2 -2
- package/dist/components/popover/index.d.ts +5 -5
- package/dist/components/popover/index.js +5 -4
- package/dist/components/popover/index.jsx +2 -1
- package/dist/components/presence/index.d.ts +2 -1
- package/dist/components/presence/index.js +5 -4
- package/dist/components/presence/index.jsx +2 -1
- package/dist/components/progress/index.d.ts +4 -4
- package/dist/components/progress/index.js +1 -1
- package/dist/components/qr-code/index.d.ts +4 -4
- package/dist/components/qr-code/index.js +1 -1
- package/dist/components/radio-group/index.d.ts +4 -4
- package/dist/components/radio-group/index.js +3 -3
- package/dist/components/radio-group/index.jsx +1 -1
- package/dist/components/rating-group/index.d.ts +4 -4
- package/dist/components/rating-group/index.js +4 -4
- package/dist/components/rating-group/index.jsx +2 -2
- package/dist/components/scroll-area/index.d.ts +4 -4
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/segment-group/index.d.ts +4 -4
- package/dist/components/segment-group/index.js +1 -1
- package/dist/components/select/index.d.ts +6 -6
- package/dist/components/select/index.js +8 -7
- package/dist/components/select/index.jsx +5 -4
- package/dist/components/separator/index.d.ts +4 -4
- package/dist/components/separator/index.js +1 -1
- package/dist/components/signature-pad/index.d.ts +4 -4
- package/dist/components/signature-pad/index.js +4 -4
- package/dist/components/signature-pad/index.jsx +2 -2
- package/dist/components/slider/index.d.ts +4 -4
- package/dist/components/slider/index.js +1 -1
- package/dist/components/splitter/index.d.ts +4 -4
- package/dist/components/splitter/index.js +1 -1
- package/dist/components/steps/index.d.ts +4 -4
- package/dist/components/steps/index.js +1 -1
- package/dist/components/swap/index.d.ts +69 -0
- package/dist/components/swap/index.js +123 -0
- package/dist/components/swap/index.jsx +110 -0
- package/dist/components/switch/index.d.ts +4 -4
- package/dist/components/switch/index.js +5 -5
- package/dist/components/switch/index.jsx +2 -2
- package/dist/components/tabs/index.d.ts +5 -5
- package/dist/components/tabs/index.js +6 -5
- package/dist/components/tabs/index.jsx +2 -1
- package/dist/components/tags-input/index.d.ts +4 -4
- package/dist/components/tags-input/index.js +5 -5
- package/dist/components/tags-input/index.jsx +2 -2
- package/dist/components/timer/index.d.ts +4 -4
- package/dist/components/timer/index.js +2 -2
- package/dist/components/toast/index.d.ts +4 -4
- package/dist/components/toast/index.js +1 -1
- package/dist/components/toggle/index.d.ts +3 -3
- package/dist/components/toggle/index.js +2 -2
- package/dist/components/toggle-group/index.d.ts +4 -4
- package/dist/components/toggle-group/index.js +2 -2
- package/dist/components/tooltip/index.d.ts +5 -5
- package/dist/components/tooltip/index.js +6 -5
- package/dist/components/tooltip/index.jsx +2 -1
- package/dist/components/tour/index.d.ts +5 -5
- package/dist/components/tour/index.js +6 -5
- package/dist/components/tour/index.jsx +2 -1
- package/dist/components/tree-view/index.d.ts +3 -3
- package/dist/components/tree-view/index.js +6 -6
- package/dist/components/tree-view/index.jsx +2 -2
- package/dist/{date-picker-anatomy-DFw6S35t.d.ts → date-picker-anatomy-BroAPu-j.d.ts} +1 -1
- package/dist/{factory-DkYIAa1r.d.ts → factory-BWHPCsSi.d.ts} +1 -1
- package/dist/{factory-BxBlXUD3.d.ts → factory-Czr-_Ofr.d.ts} +1 -1
- package/dist/{field-GL4C0tUr.js → field-C70Ji8uk.js} +3 -3
- package/dist/{field-Blp6NDsc.jsx → field-DXEYzw2T.jsx} +1 -1
- package/dist/{field-anatomy-DfP5AI6N.d.ts → field-anatomy-BasO5CS7.d.ts} +1 -1
- package/dist/{fieldset-DQUqxXN2.js → fieldset-BtF74SAd.js} +2 -2
- package/dist/{fieldset-anatomy-CKytu4jl.d.ts → fieldset-anatomy-DJxvxcg3.d.ts} +1 -1
- package/dist/index-3V4EpIEV.d.ts +17 -0
- package/dist/{index-CdpGOel-.d.ts → index-BswdUT0r.d.ts} +1 -1
- package/dist/{index-Dho3m7QX.d.ts → index-By9-0uzG.d.ts} +3 -24
- package/dist/{index-DJkj8LZ-.d.ts → index-D99Vniel.d.ts} +5 -5
- package/dist/{index-D1ooJgqW.d.ts → index-DIvFpCUM.d.ts} +1 -1
- package/dist/{index-ZHZGSdr3.d.ts → index-Dwb6sILP.d.ts} +1 -1
- package/dist/{index-BbGXwXgM.d.ts → index-WabVOPPI.d.ts} +1 -1
- package/dist/{index-DiSjSt81.d.ts → index-kdZWirLQ.d.ts} +5 -5
- package/dist/index.d.ts +4 -4
- package/dist/{listbox-anatomy-C6Bu4F-s.d.ts → listbox-anatomy-CIn4BxN-.d.ts} +1 -1
- package/dist/presence-DKT1oc5F.js +47 -0
- package/dist/presence-DRsmHLrP.jsx +34 -0
- package/dist/{render-strategy-BAqQL-Hs.js → render-strategy-Cq9ZZosp.js} +1 -1
- package/dist/{segment-group-anatomy-DKBcX-Mi.d.ts → segment-group-anatomy-DW5nrFOt.d.ts} +1 -1
- package/dist/swap-anatomy-CCWSAMZh.d.ts +6 -0
- package/dist/swap-anatomy-DoDvoWlX.js +6 -0
- package/dist/{tour-anatomy-BrwK1nVa.d.ts → tour-anatomy-gzwTjoy4.d.ts} +1 -1
- package/dist/{tree-view-DqjhHVfK.js → tree-view-Bg4RiWRk.js} +3 -3
- package/dist/use-presence-1Kxv6PoO.jsx +33 -0
- package/dist/use-presence-BLO11KjZ.d.ts +25 -0
- package/dist/use-presence-BWP_tdWv.js +33 -0
- package/dist/use-presence-Dz4pi-k1.d.ts +25 -0
- package/package.json +7 -2
- package/dist/index-Ywo5uneC.d.ts +0 -38
- package/dist/presence-BcYjLSBT.jsx +0 -63
- package/dist/presence-CuZG4SWb.js +0 -76
- /package/dist/{accordion-anatomy-Dlbi7hWX.d.ts → accordion-anatomy-C429Vw0w.d.ts} +0 -0
- /package/dist/{angle-slider-anatomy-D9WEbUDV.d.ts → angle-slider-anatomy-Dv78eP47.d.ts} +0 -0
- /package/dist/{avatar-anatomy-B1gugBlI.d.ts → avatar-anatomy-DHXW281Q.d.ts} +0 -0
- /package/dist/{clipboard-anatomy-nY5kNeMj.d.ts → clipboard-anatomy-gpC-or8a.d.ts} +0 -0
- /package/dist/{collapsible-anatomy-B75vA5QB.d.ts → collapsible-anatomy-ClRt7ESN.d.ts} +0 -0
- /package/dist/{collection-D83ZAzYd.js → collection-DnSW_ep2.js} +0 -0
- /package/dist/{collection-CotDTAMT.jsx → collection-UvoAoZwM.jsx} +0 -0
- /package/dist/{compose-refs-BKcaHXR8.js → compose-refs-CErSWGrI.js} +0 -0
- /package/dist/{create-split-props-OE-yOtGc.js → create-split-props-48F6HUEZ.js} +0 -0
- /package/dist/{dialog-anatomy-fsIDNa4U.d.ts → dialog-anatomy-BleGXY-0.d.ts} +0 -0
- /package/dist/{drawer-anatomy-BX_dO1CK.d.ts → drawer-anatomy--gagvSDB.d.ts} +0 -0
- /package/dist/{dropdown-menu-anatomy-6hFasLVn.d.ts → dropdown-menu-anatomy-Bi0jYnCG.d.ts} +0 -0
- /package/dist/{editable-anatomy-CDcZMAjM.d.ts → editable-anatomy-BjHWEjJ7.d.ts} +0 -0
- /package/dist/{fieldset-Lbk9tsVV.jsx → fieldset-DGggJ3qa.jsx} +0 -0
- /package/dist/{file-upload-anatomy-oz5HPKAl.d.ts → file-upload-anatomy-Kr9Qtpm4.d.ts} +0 -0
- /package/dist/{floating-panel-anatomy-CWHJO-gk.d.ts → floating-panel-anatomy-DwzhDYGr.d.ts} +0 -0
- /package/dist/{hover-card-anatomy-CrEsa3XF.d.ts → hover-card-anatomy-BeL7Wdzl.d.ts} +0 -0
- /package/dist/{image-cropper-anatomy-S1DPpjWp.d.ts → image-cropper-anatomy-SiJH9k2p.d.ts} +0 -0
- /package/dist/{index-Bnd2Fp7Q.d.ts → index-BNNwG8TW.d.ts} +0 -0
- /package/dist/{index-CRqsjDZx.d.ts → index-DcVpvJuo.d.ts} +0 -0
- /package/dist/{marquee-anatomy-B0VBpa40.d.ts → marquee-anatomy-CGqQSKHO.d.ts} +0 -0
- /package/dist/{navigation-menu-anatomy-6TacFtNy.d.ts → navigation-menu-anatomy-0kxxhca-.d.ts} +0 -0
- /package/dist/{number-input-anatomy-Be06g82m.d.ts → number-input-anatomy-DrXRPc-2.d.ts} +0 -0
- /package/dist/{pagination-anatomy-hb5d75ds.d.ts → pagination-anatomy-IbVBkvDE.d.ts} +0 -0
- /package/dist/{password-input-anatomy-DY3Btk4Z.d.ts → password-input-anatomy-DukzKaA_.d.ts} +0 -0
- /package/dist/{pin-input-anatomy-Dh7dVbsT.d.ts → pin-input-anatomy-Dod0i2Fj.d.ts} +0 -0
- /package/dist/{popover-anatomy-CIt7PUmS.d.ts → popover-anatomy-BRUYTStu.d.ts} +0 -0
- /package/dist/{progress-anatomy-Bh9Sh8d2.d.ts → progress-anatomy-CdUb6E_m.d.ts} +0 -0
- /package/dist/{qr-code-anatomy-Daeh1gXt.d.ts → qr-code-anatomy-HIK_cqc4.d.ts} +0 -0
- /package/dist/{radio-group-anatomy-fu9jDbmu.d.ts → radio-group-anatomy-4AtLbTvX.d.ts} +0 -0
- /package/dist/{rating-group-anatomy-B8hoEZBE.d.ts → rating-group-anatomy-C4MeQJFb.d.ts} +0 -0
- /package/dist/{render-strategy-C-bqwyH6.d.ts → render-strategy-Ci6JQxar.d.ts} +0 -0
- /package/dist/{render-strategy-RoCfkF8z.d.ts → render-strategy-VFaN_ls2.d.ts} +0 -0
- /package/dist/{scroll-area-anatomy-Eg5UQD6w.d.ts → scroll-area-anatomy-DpXR-8Ka.d.ts} +0 -0
- /package/dist/{select-anatomy-C85MRleF.d.ts → select-anatomy-DvmePPct.d.ts} +0 -0
- /package/dist/{separator-anatomy-CoRBCozn.d.ts → separator-anatomy-DcmKkhH4.d.ts} +0 -0
- /package/dist/{signature-pad-anatomy-69rnG-8v.d.ts → signature-pad-anatomy-CE3VaGlN.d.ts} +0 -0
- /package/dist/{slider-anatomy-Bi2M9sIn.d.ts → slider-anatomy-Bcn8infz.d.ts} +0 -0
- /package/dist/{splitter-anatomy-DOrZZHLS.d.ts → splitter-anatomy-CcU7r6nC.d.ts} +0 -0
- /package/dist/{steps-anatomy-DyFBdyZm.d.ts → steps-anatomy-BFfGItPO.d.ts} +0 -0
- /package/dist/{switch-anatomy-D5Q54mGY.js → switch-anatomy-BBKGer2O.js} +0 -0
- /package/dist/{switch-anatomy-ChIrrzPM.d.ts → switch-anatomy-V7-avrsf.d.ts} +0 -0
- /package/dist/{tabs-anatomy-DU5e5PwZ.js → tabs-anatomy-CSIjHllD.js} +0 -0
- /package/dist/{tabs-anatomy-Cx19UTVm.d.ts → tabs-anatomy-Sf4easVm.d.ts} +0 -0
- /package/dist/{tags-input-anatomy-BhGRRfIw.js → tags-input-anatomy-BVSVhUIY.js} +0 -0
- /package/dist/{tags-input-anatomy-Bwspep5o.d.ts → tags-input-anatomy-klR6M57D.d.ts} +0 -0
- /package/dist/{timer-anatomy-GlYZryvG.js → timer-anatomy-Bi9rZW6m.js} +0 -0
- /package/dist/{timer-anatomy-EHPlHptt.d.ts → timer-anatomy-DiFPa7w2.d.ts} +0 -0
- /package/dist/{toast-anatomy-DiPVPI_x.js → toast-anatomy-T5C60YOF.js} +0 -0
- /package/dist/{toast-anatomy-DtLjq13p.d.ts → toast-anatomy-TiT_rATb.d.ts} +0 -0
- /package/dist/{toggle-anatomy-Bh7LJ9JI.d.ts → toggle-anatomy-BEf2ev_N.d.ts} +0 -0
- /package/dist/{toggle-anatomy-DLOZu83X.js → toggle-anatomy-Cvb2YZ0Z.js} +0 -0
- /package/dist/{toggle-group-anatomy-lQ9EYEIt.js → toggle-group-anatomy-CY3buWoP.js} +0 -0
- /package/dist/{toggle-group-anatomy-DEo8iu_3.d.ts → toggle-group-anatomy-DPihvPM-.d.ts} +0 -0
- /package/dist/{tooltip-anatomy-CamCIpK3.d.ts → tooltip-anatomy-fBuzAg1k.d.ts} +0 -0
- /package/dist/{tooltip-anatomy-Py7dhRtQ.js → tooltip-anatomy-tX33r13s.js} +0 -0
- /package/dist/{tour-anatomy-VBbJhmJa.js → tour-anatomy-CmrXDTeQ.js} +0 -0
- /package/dist/{tree-view-nwQzRTs2.jsx → tree-view-Dj3OcF2q.jsx} +0 -0
- /package/dist/{tree-view-anatomy-DFap3OjP.d.ts → tree-view-anatomy-BqdaCO-D.d.ts} +0 -0
- /package/dist/{tree-view-anatomy-BK8OR6TX.js → tree-view-anatomy-Dmaz5yOz.js} +0 -0
- /package/dist/{types-BiaKY56E.d.ts → types-B4c9Wnje.d.ts} +0 -0
- /package/dist/{types-C0L5xDeS.d.ts → types-CgX1JJNs.d.ts} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { i as useMachine, n as normalizeProps } from "./core-DUR6M1Mz.jsx";
|
|
2
|
+
import { t as runIfFn } from "./run-if-fn-qkd0iQPO.jsx";
|
|
3
|
+
import { n as splitRenderStrategyProps } from "./render-strategy-6LT04Ztx.jsx";
|
|
4
|
+
import { createEffect, createMemo, createSignal } from "solid-js";
|
|
5
|
+
import * as presence from "@sprawlify/primitives/machines/presence";
|
|
6
|
+
//#region src/components/presence/use-presence.ts
|
|
7
|
+
const usePresence = (props) => {
|
|
8
|
+
const [renderStrategyProps, localProps] = splitRenderStrategyProps(runIfFn(props));
|
|
9
|
+
const [wasEverPresent, setWasEverPresent] = createSignal(false);
|
|
10
|
+
const service = useMachine(presence.machine, props);
|
|
11
|
+
const api = createMemo(() => presence.connect(service, normalizeProps));
|
|
12
|
+
createEffect(() => {
|
|
13
|
+
if (api().present) setWasEverPresent(true);
|
|
14
|
+
});
|
|
15
|
+
const setNode = (node) => {
|
|
16
|
+
if (!node) return;
|
|
17
|
+
service.send({
|
|
18
|
+
type: "NODE.SET",
|
|
19
|
+
node
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
return createMemo(() => ({
|
|
23
|
+
unmounted: !api().present && !wasEverPresent() && renderStrategyProps.lazyMount || renderStrategyProps.unmountOnExit && !api().present && wasEverPresent(),
|
|
24
|
+
present: api().present,
|
|
25
|
+
ref: setNode,
|
|
26
|
+
presenceProps: {
|
|
27
|
+
hidden: !api().present,
|
|
28
|
+
"data-state": api().skip && localProps.skipAnimationOnMount ? void 0 : localProps.present ? "open" : "closed"
|
|
29
|
+
}
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { usePresence as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { i as Optional, n as MaybeAccessor } from "./types-B4c9Wnje.js";
|
|
2
|
+
import { t as RenderStrategyProps } from "./render-strategy-VFaN_ls2.js";
|
|
3
|
+
import * as solid_js0 from "solid-js";
|
|
4
|
+
import * as presence from "@sprawlify/primitives/machines/presence";
|
|
5
|
+
|
|
6
|
+
//#region src/components/presence/use-presence.d.ts
|
|
7
|
+
interface UsePresenceProps extends Optional<presence.Props, "present">, RenderStrategyProps {
|
|
8
|
+
/**
|
|
9
|
+
* Whether to allow the initial presence animation.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
skipAnimationOnMount?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface UsePresenceReturn extends ReturnType<typeof usePresence> {}
|
|
15
|
+
declare const usePresence: (props: MaybeAccessor<UsePresenceProps>) => solid_js0.Accessor<{
|
|
16
|
+
unmounted: boolean | undefined;
|
|
17
|
+
present: boolean;
|
|
18
|
+
ref: (node: Element | null) => void;
|
|
19
|
+
presenceProps: {
|
|
20
|
+
hidden: boolean;
|
|
21
|
+
"data-state": string | undefined;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { UsePresenceReturn as n, usePresence as r, UsePresenceProps as t };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { i as useMachine, n as normalizeProps } from "./core-BHfpfUk-.js";
|
|
2
|
+
import { t as runIfFn } from "./run-if-fn-BV7F-Eeb.js";
|
|
3
|
+
import { n as splitRenderStrategyProps } from "./render-strategy-Cq9ZZosp.js";
|
|
4
|
+
import { createEffect, createMemo, createSignal } from "solid-js";
|
|
5
|
+
import * as presence from "@sprawlify/primitives/machines/presence";
|
|
6
|
+
//#region src/components/presence/use-presence.ts
|
|
7
|
+
const usePresence = (props) => {
|
|
8
|
+
const [renderStrategyProps, localProps] = splitRenderStrategyProps(runIfFn(props));
|
|
9
|
+
const [wasEverPresent, setWasEverPresent] = createSignal(false);
|
|
10
|
+
const service = useMachine(presence.machine, props);
|
|
11
|
+
const api = createMemo(() => presence.connect(service, normalizeProps));
|
|
12
|
+
createEffect(() => {
|
|
13
|
+
if (api().present) setWasEverPresent(true);
|
|
14
|
+
});
|
|
15
|
+
const setNode = (node) => {
|
|
16
|
+
if (!node) return;
|
|
17
|
+
service.send({
|
|
18
|
+
type: "NODE.SET",
|
|
19
|
+
node
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
return createMemo(() => ({
|
|
23
|
+
unmounted: !api().present && !wasEverPresent() && renderStrategyProps.lazyMount || renderStrategyProps.unmountOnExit && !api().present && wasEverPresent(),
|
|
24
|
+
present: api().present,
|
|
25
|
+
ref: setNode,
|
|
26
|
+
presenceProps: {
|
|
27
|
+
hidden: !api().present,
|
|
28
|
+
"data-state": api().skip && localProps.skipAnimationOnMount ? void 0 : localProps.present ? "open" : "closed"
|
|
29
|
+
}
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { usePresence as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { i as Optional, n as MaybeAccessor } from "./types-CgX1JJNs.js";
|
|
2
|
+
import { t as RenderStrategyProps } from "./render-strategy-Ci6JQxar.js";
|
|
3
|
+
import * as solid_js0 from "solid-js";
|
|
4
|
+
import * as presence from "@sprawlify/primitives/machines/presence";
|
|
5
|
+
|
|
6
|
+
//#region src/components/presence/use-presence.d.ts
|
|
7
|
+
interface UsePresenceProps extends Optional<presence.Props, "present">, RenderStrategyProps {
|
|
8
|
+
/**
|
|
9
|
+
* Whether to allow the initial presence animation.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
skipAnimationOnMount?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface UsePresenceReturn extends ReturnType<typeof usePresence> {}
|
|
15
|
+
declare const usePresence: (props: MaybeAccessor<UsePresenceProps>) => solid_js0.Accessor<{
|
|
16
|
+
unmounted: boolean | undefined;
|
|
17
|
+
present: boolean;
|
|
18
|
+
ref: (node: Element | null) => void;
|
|
19
|
+
presenceProps: {
|
|
20
|
+
hidden: boolean;
|
|
21
|
+
"data-state": string | undefined;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { UsePresenceReturn as n, usePresence as r, UsePresenceProps as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sprawlify/solid",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.112",
|
|
4
4
|
"description": "Solid wrapper for primitives.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "sprawlify <npm@sprawlify.com>",
|
|
@@ -277,6 +277,11 @@
|
|
|
277
277
|
"solid": "./dist/components/steps/index.jsx",
|
|
278
278
|
"default": "./dist/components/steps/index.js"
|
|
279
279
|
},
|
|
280
|
+
"./swap": {
|
|
281
|
+
"types": "./dist/components/swap/index.d.ts",
|
|
282
|
+
"solid": "./dist/components/swap/index.jsx",
|
|
283
|
+
"default": "./dist/components/swap/index.js"
|
|
284
|
+
},
|
|
280
285
|
"./switch": {
|
|
281
286
|
"types": "./dist/components/switch/index.d.ts",
|
|
282
287
|
"solid": "./dist/components/switch/index.jsx",
|
|
@@ -333,7 +338,7 @@
|
|
|
333
338
|
},
|
|
334
339
|
"dependencies": {
|
|
335
340
|
"@solid-primitives/keyed": "^1.5.3",
|
|
336
|
-
"@sprawlify/primitives": "0.0.
|
|
341
|
+
"@sprawlify/primitives": "0.0.112"
|
|
337
342
|
},
|
|
338
343
|
"peerDependencies": {
|
|
339
344
|
"solid-js": ">=1.9.10"
|
package/dist/index-Ywo5uneC.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { i as Optional, n as MaybeAccessor } from "./types-BiaKY56E.js";
|
|
2
|
-
import { r as PolymorphicProps, t as HTMLProps } from "./factory-DkYIAa1r.js";
|
|
3
|
-
import { t as RenderStrategyProps } from "./render-strategy-C-bqwyH6.js";
|
|
4
|
-
import * as solid_js0 from "solid-js";
|
|
5
|
-
import * as presence from "@sprawlify/primitives/machines/presence";
|
|
6
|
-
|
|
7
|
-
//#region src/components/presence/use-presence.d.ts
|
|
8
|
-
interface UsePresenceProps extends Optional<presence.Props, "present">, RenderStrategyProps {
|
|
9
|
-
/**
|
|
10
|
-
* Whether to allow the initial presence animation.
|
|
11
|
-
* @default false
|
|
12
|
-
*/
|
|
13
|
-
skipAnimationOnMount?: boolean;
|
|
14
|
-
}
|
|
15
|
-
interface UsePresenceReturn extends ReturnType<typeof usePresence> {}
|
|
16
|
-
declare const usePresence: (props: MaybeAccessor<UsePresenceProps>) => solid_js0.Accessor<{
|
|
17
|
-
unmounted: boolean | undefined;
|
|
18
|
-
present: boolean;
|
|
19
|
-
ref: (node: Element | null) => void;
|
|
20
|
-
presenceProps: {
|
|
21
|
-
hidden: boolean;
|
|
22
|
-
"data-state": string | undefined;
|
|
23
|
-
};
|
|
24
|
-
}>;
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region src/components/presence/presence.d.ts
|
|
27
|
-
interface PresenceBaseProps extends UsePresenceProps, PolymorphicProps<"div"> {}
|
|
28
|
-
interface PresenceProps extends HTMLProps<"div">, PresenceBaseProps {}
|
|
29
|
-
declare const Presence: (props: PresenceProps) => solid_js0.JSX.Element;
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/components/presence/split-presence-props.d.ts
|
|
32
|
-
declare const splitPresenceProps: <T extends UsePresenceProps>(props: T) => [Pick<T, Extract<("present" | "onExitComplete" | "immediate" | "skipAnimationOnMount" | "lazyMount" | "unmountOnExit")[], readonly (keyof T)[]>[number]>, { [P in keyof T as Exclude<P, "present" | "onExitComplete" | "immediate" | "skipAnimationOnMount" | "lazyMount" | "unmountOnExit">]: T[P] }];
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/components/presence/use-presence-context.d.ts
|
|
35
|
-
interface UsePresenceContext extends UsePresenceReturn {}
|
|
36
|
-
declare const PresenceProvider: solid_js0.ContextProviderComponent<UsePresenceContext>, usePresenceContext: () => UsePresenceContext;
|
|
37
|
-
//#endregion
|
|
38
|
-
export { Presence as a, UsePresenceReturn as c, splitPresenceProps as i, usePresence as l, UsePresenceContext as n, PresenceProps as o, usePresenceContext as r, UsePresenceProps as s, PresenceProvider as t };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { i as useMachine, n as normalizeProps, r as mergeProps$1 } from "./core-DUR6M1Mz.jsx";
|
|
2
|
-
import { t as runIfFn } from "./run-if-fn-qkd0iQPO.jsx";
|
|
3
|
-
import { t as createContext$1 } from "./create-context-iBxaUhvx.jsx";
|
|
4
|
-
import { t as sprawlify } from "./factory-B95XvEzz.jsx";
|
|
5
|
-
import { t as createSplitProps } from "./create-split-props-B2Gc7D9P.jsx";
|
|
6
|
-
import { n as splitRenderStrategyProps } from "./render-strategy-6LT04Ztx.jsx";
|
|
7
|
-
import { t as composeRefs } from "./compose-refs-Jq47jedK.jsx";
|
|
8
|
-
import { Show, createEffect, createMemo, createSignal } from "solid-js";
|
|
9
|
-
import * as presence from "@sprawlify/primitives/machines/presence";
|
|
10
|
-
//#region src/components/presence/split-presence-props.ts
|
|
11
|
-
const splitPresenceProps = (props) => createSplitProps()(props, [
|
|
12
|
-
"immediate",
|
|
13
|
-
"lazyMount",
|
|
14
|
-
"onExitComplete",
|
|
15
|
-
"present",
|
|
16
|
-
"skipAnimationOnMount",
|
|
17
|
-
"unmountOnExit"
|
|
18
|
-
]);
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/components/presence/use-presence.ts
|
|
21
|
-
const usePresence = (props) => {
|
|
22
|
-
const [renderStrategyProps, localProps] = splitRenderStrategyProps(runIfFn(props));
|
|
23
|
-
const [wasEverPresent, setWasEverPresent] = createSignal(false);
|
|
24
|
-
const service = useMachine(presence.machine, props);
|
|
25
|
-
const api = createMemo(() => presence.connect(service, normalizeProps));
|
|
26
|
-
createEffect(() => {
|
|
27
|
-
if (api().present) setWasEverPresent(true);
|
|
28
|
-
});
|
|
29
|
-
const setNode = (node) => {
|
|
30
|
-
if (!node) return;
|
|
31
|
-
service.send({
|
|
32
|
-
type: "NODE.SET",
|
|
33
|
-
node
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
return createMemo(() => ({
|
|
37
|
-
unmounted: !api().present && !wasEverPresent() && renderStrategyProps.lazyMount || renderStrategyProps.unmountOnExit && !api().present && wasEverPresent(),
|
|
38
|
-
present: api().present,
|
|
39
|
-
ref: setNode,
|
|
40
|
-
presenceProps: {
|
|
41
|
-
hidden: !api().present,
|
|
42
|
-
"data-state": api().skip && localProps.skipAnimationOnMount ? void 0 : localProps.present ? "open" : "closed"
|
|
43
|
-
}
|
|
44
|
-
}));
|
|
45
|
-
};
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region src/components/presence/presence.tsx
|
|
48
|
-
const Presence = (props) => {
|
|
49
|
-
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
50
|
-
const api = usePresence(presenceProps);
|
|
51
|
-
const mergedProps = mergeProps$1(() => api().presenceProps, localProps);
|
|
52
|
-
return <Show when={!api().unmounted}>
|
|
53
|
-
<sprawlify.div {...mergedProps} ref={composeRefs(api().ref, props.ref)} data-scope="presence" data-part="root" />
|
|
54
|
-
</Show>;
|
|
55
|
-
};
|
|
56
|
-
//#endregion
|
|
57
|
-
//#region src/components/presence/use-presence-context.ts
|
|
58
|
-
const [PresenceProvider, usePresenceContext] = createContext$1({
|
|
59
|
-
hookName: "usePresenceContext",
|
|
60
|
-
providerName: "<PresenceProvider />"
|
|
61
|
-
});
|
|
62
|
-
//#endregion
|
|
63
|
-
export { splitPresenceProps as a, usePresence as i, usePresenceContext as n, Presence as r, PresenceProvider as t };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { i as useMachine, n as normalizeProps, r as mergeProps$2 } from "./core-BHfpfUk-.js";
|
|
2
|
-
import { t as runIfFn } from "./run-if-fn-BV7F-Eeb.js";
|
|
3
|
-
import { t as createContext$1 } from "./create-context-BEnzb67H.js";
|
|
4
|
-
import { t as sprawlify } from "./factory-DORgzART.js";
|
|
5
|
-
import { t as createSplitProps } from "./create-split-props-OE-yOtGc.js";
|
|
6
|
-
import { n as splitRenderStrategyProps } from "./render-strategy-BAqQL-Hs.js";
|
|
7
|
-
import { t as composeRefs } from "./compose-refs-BKcaHXR8.js";
|
|
8
|
-
import { Show, createEffect, createMemo, createSignal } from "solid-js";
|
|
9
|
-
import { createComponent, mergeProps as mergeProps$1 } from "solid-js/web";
|
|
10
|
-
import * as presence from "@sprawlify/primitives/machines/presence";
|
|
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
|
-
//#endregion
|
|
21
|
-
//#region src/components/presence/use-presence.ts
|
|
22
|
-
const usePresence = (props) => {
|
|
23
|
-
const [renderStrategyProps, localProps] = splitRenderStrategyProps(runIfFn(props));
|
|
24
|
-
const [wasEverPresent, setWasEverPresent] = createSignal(false);
|
|
25
|
-
const service = useMachine(presence.machine, props);
|
|
26
|
-
const api = createMemo(() => presence.connect(service, normalizeProps));
|
|
27
|
-
createEffect(() => {
|
|
28
|
-
if (api().present) setWasEverPresent(true);
|
|
29
|
-
});
|
|
30
|
-
const setNode = (node) => {
|
|
31
|
-
if (!node) return;
|
|
32
|
-
service.send({
|
|
33
|
-
type: "NODE.SET",
|
|
34
|
-
node
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
return createMemo(() => ({
|
|
38
|
-
unmounted: !api().present && !wasEverPresent() && renderStrategyProps.lazyMount || renderStrategyProps.unmountOnExit && !api().present && wasEverPresent(),
|
|
39
|
-
present: api().present,
|
|
40
|
-
ref: setNode,
|
|
41
|
-
presenceProps: {
|
|
42
|
-
hidden: !api().present,
|
|
43
|
-
"data-state": api().skip && localProps.skipAnimationOnMount ? void 0 : localProps.present ? "open" : "closed"
|
|
44
|
-
}
|
|
45
|
-
}));
|
|
46
|
-
};
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/components/presence/presence.tsx
|
|
49
|
-
const Presence = (props) => {
|
|
50
|
-
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
51
|
-
const api = usePresence(presenceProps);
|
|
52
|
-
const mergedProps = mergeProps$2(() => api().presenceProps, localProps);
|
|
53
|
-
return createComponent(Show, {
|
|
54
|
-
get when() {
|
|
55
|
-
return !api().unmounted;
|
|
56
|
-
},
|
|
57
|
-
get children() {
|
|
58
|
-
return createComponent(sprawlify.div, mergeProps$1(mergedProps, {
|
|
59
|
-
ref(r$) {
|
|
60
|
-
var _ref$ = composeRefs(api().ref, props.ref);
|
|
61
|
-
typeof _ref$ === "function" && _ref$(r$);
|
|
62
|
-
},
|
|
63
|
-
"data-scope": "presence",
|
|
64
|
-
"data-part": "root"
|
|
65
|
-
}));
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region src/components/presence/use-presence-context.ts
|
|
71
|
-
const [PresenceProvider, usePresenceContext] = createContext$1({
|
|
72
|
-
hookName: "usePresenceContext",
|
|
73
|
-
providerName: "<PresenceProvider />"
|
|
74
|
-
});
|
|
75
|
-
//#endregion
|
|
76
|
-
export { splitPresenceProps as a, usePresence as i, usePresenceContext as n, Presence as r, PresenceProvider as t };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{navigation-menu-anatomy-6TacFtNy.d.ts → navigation-menu-anatomy-0kxxhca-.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|