@ark-ui/solid 4.8.0 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk/{UXJGHMFS.js → 22UQ4DZC.js} +1 -1
- package/dist/chunk/{D4XLNL66.jsx → 2ILK4IFM.jsx} +16 -5
- package/dist/chunk/{JTHKX457.js → 2J42A7KM.js} +1 -14
- package/dist/chunk/{MARFWGWI.jsx → 2NEVBQW4.jsx} +1 -1
- package/dist/chunk/{RCK6LCJM.jsx → 34JAVC2R.jsx} +1 -1
- package/dist/chunk/{35R4VP6U.js → 3V3HI6QW.js} +12 -4
- package/dist/chunk/{QLGAAWNC.js → 5EVN6V64.js} +3 -2
- package/dist/chunk/{VQWGXSW6.js → 6ABKGV6Q.js} +1 -1
- package/dist/chunk/{U23DU73Q.js → 6D57YTRH.js} +1 -1
- package/dist/chunk/{ZYF7ARA6.jsx → 7BGOIKYK.jsx} +1 -1
- package/dist/chunk/{T6IREKKO.js → 7KPVYYFT.js} +1 -1
- package/dist/chunk/ANUFR4QW.jsx +36 -0
- package/dist/chunk/{G7GWGK6F.js → AWO62YTJ.js} +1 -1
- package/dist/chunk/CIPYIXIW.js +227 -0
- package/dist/chunk/{6L7HNED6.jsx → CQN5S4C3.jsx} +1 -1
- package/dist/chunk/DOBZPYAN.jsx +18 -0
- package/dist/chunk/{MZPPLECL.js → DUDD2T7G.js} +1 -1
- package/dist/chunk/{VIUEKSBO.js → DUYGPLFV.js} +1 -1
- package/dist/chunk/{YCESXPIN.jsx → EHJDQTTW.jsx} +3 -15
- package/dist/chunk/{VZFG6XYZ.js → FDN5MSFM.js} +1 -1
- package/dist/chunk/{GVRRR27D.jsx → FS3LMJ37.jsx} +1 -1
- package/dist/chunk/FVMQXW27.jsx +265 -0
- package/dist/chunk/{27RTXL55.jsx → HWL7X2QR.jsx} +21 -7
- package/dist/chunk/IL7WZATP.js +25 -0
- package/dist/chunk/{TY6NCPFG.jsx → MSHQY44G.jsx} +22 -22
- package/dist/chunk/{4XC3UALJ.jsx → N73ADPX5.jsx} +1 -1
- package/dist/chunk/{PZ7ZCWGA.js → NDY7YFV2.js} +1 -1
- package/dist/chunk/{4FXOTC23.js → OYIT66CI.js} +1 -1
- package/dist/chunk/{DT5WVDUV.jsx → RH2PDRKN.jsx} +1 -1
- package/dist/chunk/{YVIJOCWC.jsx → RVUYRERH.jsx} +1 -1
- package/dist/chunk/{3NSM24PL.jsx → SBPY26HV.jsx} +1 -1
- package/dist/chunk/{SZH7YUGW.jsx → SUVE6C6L.jsx} +1 -1
- package/dist/chunk/{3EJGSZCP.jsx → TMUQ6SLE.jsx} +1 -1
- package/dist/chunk/XN6EERRM.js +16 -0
- package/dist/chunk/{BUWVAHRG.js → XTV6ZFAA.js} +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/index.jsx +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.jsx +2 -2
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/color-picker/index.jsx +2 -2
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/combobox/index.jsx +2 -2
- package/dist/components/date-picker/index.d.ts +11 -9
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-picker/index.jsx +1 -1
- package/dist/components/editable/index.js +1 -1
- package/dist/components/editable/index.jsx +2 -2
- package/dist/components/field/index.d.ts +7 -7
- package/dist/components/field/index.js +1 -1
- package/dist/components/field/index.jsx +1 -1
- package/dist/components/file-upload/index.d.ts +5 -5
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/file-upload/index.jsx +2 -2
- package/dist/components/focus-trap/index.d.ts +18 -0
- package/dist/components/focus-trap/index.js +1 -0
- package/dist/components/focus-trap/index.jsx +10 -0
- package/dist/components/frame/index.js +1 -1
- package/dist/components/frame/index.jsx +2 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +29 -27
- package/dist/components/index.jsx +233 -188
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/number-input/index.jsx +2 -2
- package/dist/components/pin-input/index.js +1 -1
- package/dist/components/pin-input/index.jsx +2 -2
- package/dist/components/rating-group/index.js +1 -1
- package/dist/components/rating-group/index.jsx +2 -2
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/index.jsx +2 -2
- package/dist/components/signature-pad/index.js +1 -1
- package/dist/components/signature-pad/index.jsx +2 -2
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.jsx +2 -2
- package/dist/components/tags-input/index.js +1 -1
- package/dist/components/tags-input/index.jsx +2 -2
- package/dist/components/toggle/index.js +1 -1
- package/dist/components/toggle/index.jsx +1 -1
- package/dist/components/tour/index.d.ts +136 -0
- package/dist/components/tour/index.js +1 -0
- package/dist/components/tour/index.jsx +52 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +29 -27
- package/dist/index.jsx +233 -188
- package/package.json +55 -52
- package/dist/chunk/{PBJ7MGGS.js → 632HFNZF.js} +19 -19
- package/dist/chunk/{7KBRNVZ6.js → MV3KTL7M.js} +9 -9
- package/dist/chunk/{5D3VKQUP.jsx → NK4T7LIZ.jsx} +0 -0
- package/dist/chunk/{2PEBPAD5.jsx → R2YVXMP7.jsx} +0 -0
- package/dist/chunk/{CFEFSYGC.jsx → SN5TXTB6.jsx} +9 -9
- /package/dist/chunk/{ZKHLGP7Q.js → W43X4SNE.js} +0 -0
- /package/dist/chunk/{FE2WXPJR.js → ZWNW7ARB.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useFieldContext
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./MSHQY44G.jsx";
|
|
4
4
|
import {
|
|
5
5
|
createSplitProps
|
|
6
6
|
} from "./6WEDGJKQ.jsx";
|
|
@@ -42,8 +42,14 @@ var FileUploadContext = (props) => props.children(useFileUploadContext());
|
|
|
42
42
|
// src/components/file-upload/file-upload-dropzone.tsx
|
|
43
43
|
import { mergeProps as mergeProps2 } from "@zag-js/solid";
|
|
44
44
|
var FileUploadDropzone = (props) => {
|
|
45
|
+
const [dropzoneProps, localProps] = createSplitProps()(props, [
|
|
46
|
+
"disableClick"
|
|
47
|
+
]);
|
|
45
48
|
const fileUpload2 = useFileUploadContext();
|
|
46
|
-
const mergedProps = mergeProps2(
|
|
49
|
+
const mergedProps = mergeProps2(
|
|
50
|
+
() => fileUpload2().getDropzoneProps(dropzoneProps),
|
|
51
|
+
localProps
|
|
52
|
+
);
|
|
47
53
|
return <ark.div {...mergedProps} />;
|
|
48
54
|
};
|
|
49
55
|
|
|
@@ -113,20 +119,25 @@ var FileUploadItemPreview = (props) => {
|
|
|
113
119
|
|
|
114
120
|
// src/components/file-upload/file-upload-item-preview-image.tsx
|
|
115
121
|
import { mergeProps as mergeProps9 } from "@zag-js/solid";
|
|
116
|
-
import { createEffect, createSignal, onCleanup } from "solid-js";
|
|
122
|
+
import { Show, createEffect, createSignal, onCleanup } from "solid-js";
|
|
117
123
|
var FileUploadItemPreviewImage = (props) => {
|
|
118
124
|
const fileUpload2 = useFileUploadContext();
|
|
119
125
|
const itemProps = useFileUploadItemPropsContext();
|
|
120
126
|
const [url, setUrl] = createSignal("");
|
|
121
127
|
createEffect(() => {
|
|
122
|
-
const cleanup = fileUpload2().createFileUrl(
|
|
128
|
+
const cleanup = fileUpload2().createFileUrl(
|
|
129
|
+
itemProps.file,
|
|
130
|
+
(url2) => setUrl(url2)
|
|
131
|
+
);
|
|
123
132
|
onCleanup(cleanup);
|
|
124
133
|
});
|
|
125
134
|
const mergedProps = mergeProps9(
|
|
126
135
|
() => fileUpload2().getItemPreviewImageProps({ ...itemProps, url: url() }),
|
|
127
136
|
props
|
|
128
137
|
);
|
|
129
|
-
return <
|
|
138
|
+
return <Show when={url()}>
|
|
139
|
+
<ark.img {...mergedProps} />
|
|
140
|
+
</Show>;
|
|
130
141
|
};
|
|
131
142
|
|
|
132
143
|
// src/components/file-upload/file-upload-item-size-text.tsx
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
+
import { composeRefs } from './XN6EERRM.js';
|
|
1
2
|
import { EnvironmentProvider } from './QODB3C3M.js';
|
|
2
3
|
import { createComponent, use, spread, insert, Portal, template } from 'solid-js/web';
|
|
3
4
|
import { splitProps, createMemo, createSignal, createEffect, onCleanup, Show } from 'solid-js';
|
|
4
5
|
|
|
5
|
-
// src/utils/compose-refs.ts
|
|
6
|
-
var isRefFn = (ref) => typeof ref === "function";
|
|
7
|
-
function setRef(ref, value) {
|
|
8
|
-
if (isRefFn(ref)) {
|
|
9
|
-
ref(value);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
function composeRefs(...refs) {
|
|
13
|
-
return (node) => {
|
|
14
|
-
for (const ref of refs) {
|
|
15
|
-
setRef(ref, node);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
6
|
var FrameContent = (props) => {
|
|
20
7
|
const {
|
|
21
8
|
onMount,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useFieldContext } from './
|
|
1
|
+
import { useFieldContext } from './632HFNZF.js';
|
|
2
2
|
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
3
3
|
import { ark } from './EPLBB4QN.js';
|
|
4
4
|
import { useEnvironmentContext } from './QODB3C3M.js';
|
|
@@ -7,7 +7,7 @@ import { createContext } from './I5UG2QUO.js';
|
|
|
7
7
|
import { __export } from './ESLJRKWD.js';
|
|
8
8
|
import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
|
|
9
9
|
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
10
|
-
import { createSignal, createEffect, onCleanup, createUniqueId, createMemo } from 'solid-js';
|
|
10
|
+
import { createSignal, createEffect, onCleanup, Show, createUniqueId, createMemo } from 'solid-js';
|
|
11
11
|
import * as fileUpload from '@zag-js/file-upload';
|
|
12
12
|
export { anatomy } from '@zag-js/file-upload';
|
|
13
13
|
|
|
@@ -27,8 +27,9 @@ var FileUploadClearTrigger = (props) => {
|
|
|
27
27
|
// src/components/file-upload/file-upload-context.tsx
|
|
28
28
|
var FileUploadContext = (props) => props.children(useFileUploadContext());
|
|
29
29
|
var FileUploadDropzone = (props) => {
|
|
30
|
+
const [dropzoneProps, localProps] = createSplitProps()(props, ["disableClick"]);
|
|
30
31
|
const fileUpload2 = useFileUploadContext();
|
|
31
|
-
const mergedProps = mergeProps(() => fileUpload2().getDropzoneProps(),
|
|
32
|
+
const mergedProps = mergeProps(() => fileUpload2().getDropzoneProps(dropzoneProps), localProps);
|
|
32
33
|
return createComponent(ark.div, mergedProps);
|
|
33
34
|
};
|
|
34
35
|
var FileUploadHiddenInput = (props) => {
|
|
@@ -100,7 +101,14 @@ var FileUploadItemPreviewImage = (props) => {
|
|
|
100
101
|
...itemProps,
|
|
101
102
|
url: url()
|
|
102
103
|
}), props);
|
|
103
|
-
return createComponent(
|
|
104
|
+
return createComponent(Show, {
|
|
105
|
+
get when() {
|
|
106
|
+
return url();
|
|
107
|
+
},
|
|
108
|
+
get children() {
|
|
109
|
+
return createComponent(ark.img, mergedProps);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
104
112
|
};
|
|
105
113
|
var FileUploadItemSizeText = (props) => {
|
|
106
114
|
const fileUpload2 = useFileUploadContext();
|
|
@@ -46,7 +46,7 @@ var DatePickerControl = (props) => {
|
|
|
46
46
|
return createComponent(ark.div, mergedProps);
|
|
47
47
|
};
|
|
48
48
|
var DatePickerInput = (props) => {
|
|
49
|
-
const [inputProps, localProps] = createSplitProps()(props, ["index"]);
|
|
49
|
+
const [inputProps, localProps] = createSplitProps()(props, ["index", "fixOnBlur"]);
|
|
50
50
|
const datePicker2 = useDatePickerContext();
|
|
51
51
|
const mergedProps = mergeProps(() => datePicker2().getInputProps(inputProps), localProps);
|
|
52
52
|
return createComponent(ark.input, mergedProps);
|
|
@@ -137,6 +137,7 @@ var useDatePicker = (props = {}) => {
|
|
|
137
137
|
open: props.defaultOpen,
|
|
138
138
|
"open.controlled": props.open !== void 0,
|
|
139
139
|
value: props.defaultValue,
|
|
140
|
+
view: props.defaultView,
|
|
140
141
|
...props
|
|
141
142
|
}));
|
|
142
143
|
const [state, send] = useMachine(datePicker.machine(context()), { context });
|
|
@@ -146,7 +147,7 @@ var useDatePicker = (props = {}) => {
|
|
|
146
147
|
// src/components/date-picker/date-picker-root.tsx
|
|
147
148
|
var DatePickerRoot = (props) => {
|
|
148
149
|
const [presenceProps, datePickerProps] = splitPresenceProps(props);
|
|
149
|
-
const [useDatePickerProps, localProps] = createSplitProps()(datePickerProps, ["closeOnSelect", "defaultOpen", "defaultValue", "disabled", "fixedWeeks", "focusedValue", "format", "id", "ids", "isDateUnavailable", "isDateUnavailable", "locale", "max", "min", "name", "numOfMonths", "onFocusChange", "onOpenChange", "onValueChange", "onViewChange", "open", "positioning", "readOnly", "selectionMode", "startOfWeek", "timeZone", "translations", "value", "view"]);
|
|
150
|
+
const [useDatePickerProps, localProps] = createSplitProps()(datePickerProps, ["closeOnSelect", "defaultOpen", "defaultValue", "defaultView", "disabled", "fixedWeeks", "focusedValue", "format", "id", "ids", "isDateUnavailable", "isDateUnavailable", "locale", "max", "maxView", "min", "minView", "name", "numOfMonths", "onFocusChange", "onOpenChange", "onValueChange", "onViewChange", "open", "parse", "placeholder", "positioning", "readOnly", "selectionMode", "startOfWeek", "timeZone", "translations", "value", "view"]);
|
|
150
151
|
const api = useDatePicker(useDatePickerProps);
|
|
151
152
|
const apiPresence = usePresence(mergeProps(presenceProps, () => ({
|
|
152
153
|
present: api().open
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useFieldContext } from './PBJ7MGGS.js';
|
|
2
1
|
import { usePresenceContext, splitPresenceProps, usePresence, PresenceProvider } from './LCESUDZB.js';
|
|
2
|
+
import { useFieldContext } from './632HFNZF.js';
|
|
3
3
|
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
4
4
|
import { ark } from './EPLBB4QN.js';
|
|
5
5
|
import { useEnvironmentContext } from './QODB3C3M.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useFieldContext } from './PBJ7MGGS.js';
|
|
2
1
|
import { usePresenceContext, splitPresenceProps, usePresence, PresenceProvider } from './LCESUDZB.js';
|
|
2
|
+
import { useFieldContext } from './632HFNZF.js';
|
|
3
3
|
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
4
4
|
import { ark } from './EPLBB4QN.js';
|
|
5
5
|
import { useEnvironmentContext } from './QODB3C3M.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useControllableState } from './BSPFGETO.js';
|
|
2
|
-
import { useFieldContext } from './
|
|
2
|
+
import { useFieldContext } from './632HFNZF.js';
|
|
3
3
|
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
4
4
|
import { ark } from './EPLBB4QN.js';
|
|
5
5
|
import { useEnvironmentContext } from './QODB3C3M.js';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
composeRefs
|
|
3
|
+
} from "./DOBZPYAN.jsx";
|
|
4
|
+
import {
|
|
5
|
+
createSplitProps
|
|
6
|
+
} from "./6WEDGJKQ.jsx";
|
|
7
|
+
import {
|
|
8
|
+
ark
|
|
9
|
+
} from "./UFYZ7HLU.jsx";
|
|
10
|
+
|
|
11
|
+
// src/components/focus-trap/focus-trap.tsx
|
|
12
|
+
import { trapFocus } from "@zag-js/focus-trap";
|
|
13
|
+
import { createEffect, onCleanup } from "solid-js";
|
|
14
|
+
var FocusTrap = (props) => {
|
|
15
|
+
let localNode;
|
|
16
|
+
const [trapProps, localProps] = createSplitProps()(props, [
|
|
17
|
+
"disabled",
|
|
18
|
+
"onActivate",
|
|
19
|
+
"onDeactivate",
|
|
20
|
+
"initialFocus",
|
|
21
|
+
"fallbackFocus",
|
|
22
|
+
"returnFocusOnDeactivate",
|
|
23
|
+
"setReturnFocus"
|
|
24
|
+
]);
|
|
25
|
+
createEffect(() => {
|
|
26
|
+
if (!localNode || trapProps.disabled) return;
|
|
27
|
+
const autoFocusNode = localNode.querySelector("[autofocus], [data-autofocus]");
|
|
28
|
+
trapProps.initialFocus ||= autoFocusNode ?? void 0;
|
|
29
|
+
onCleanup(trapFocus(localNode, trapProps));
|
|
30
|
+
});
|
|
31
|
+
return <ark.div {...localProps} ref={composeRefs((el) => localNode = el, props.ref)} />;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
FocusTrap
|
|
36
|
+
};
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { usePresence, usePresenceContext, splitPresenceProps, PresenceProvider } from './LCESUDZB.js';
|
|
2
|
+
import { useRenderStrategyContext, splitRenderStrategyProps, RenderStrategyProvider } from './L7OSYHVR.js';
|
|
3
|
+
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
4
|
+
import { ark } from './EPLBB4QN.js';
|
|
5
|
+
import { useEnvironmentContext } from './QODB3C3M.js';
|
|
6
|
+
import { useLocaleContext } from './HPDOBQ3V.js';
|
|
7
|
+
import { createContext } from './I5UG2QUO.js';
|
|
8
|
+
import { __export } from './ESLJRKWD.js';
|
|
9
|
+
import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
|
|
10
|
+
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
11
|
+
import { Show, createUniqueId, createMemo } from 'solid-js';
|
|
12
|
+
import * as tour from '@zag-js/tour';
|
|
13
|
+
import { anatomy } from '@zag-js/tour';
|
|
14
|
+
|
|
15
|
+
// src/components/tour/use-tour-context.ts
|
|
16
|
+
var [TourProvider, useTourContext] = createContext({
|
|
17
|
+
hookName: "useTourContext",
|
|
18
|
+
providerName: "<TourProvider />"
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// src/components/tour/tour-action-trigger.tsx
|
|
22
|
+
var TourActionTrigger = (props) => {
|
|
23
|
+
const [actionTriggerProps, localProps] = createSplitProps()(props, ["action"]);
|
|
24
|
+
const tour2 = useTourContext();
|
|
25
|
+
const mergedProps = mergeProps(() => tour2().getActionTriggerProps(actionTriggerProps), localProps);
|
|
26
|
+
return createComponent(ark.button, mergeProps$1(mergedProps, {
|
|
27
|
+
get children() {
|
|
28
|
+
return mergedProps.children || actionTriggerProps.action.label;
|
|
29
|
+
}
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/components/tour/tour-actions.tsx
|
|
34
|
+
var TourActions = (props) => {
|
|
35
|
+
const tour2 = useTourContext();
|
|
36
|
+
return props.children(() => tour2().step?.actions ?? []);
|
|
37
|
+
};
|
|
38
|
+
var TourArrow = (props) => {
|
|
39
|
+
const tour2 = useTourContext();
|
|
40
|
+
const mergedProps = mergeProps(() => tour2().getArrowProps(), props);
|
|
41
|
+
return createComponent(Show, {
|
|
42
|
+
get when() {
|
|
43
|
+
return tour2().step?.arrow;
|
|
44
|
+
},
|
|
45
|
+
get children() {
|
|
46
|
+
return createComponent(ark.div, mergedProps);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
var TourArrowTip = (props) => {
|
|
51
|
+
const tour2 = useTourContext();
|
|
52
|
+
const mergedProps = mergeProps(() => tour2().getArrowTipProps(), props);
|
|
53
|
+
return createComponent(ark.div, mergedProps);
|
|
54
|
+
};
|
|
55
|
+
var TourBackdrop = (props) => {
|
|
56
|
+
const tour2 = useTourContext();
|
|
57
|
+
const renderStrategyProps = useRenderStrategyContext();
|
|
58
|
+
const presence = usePresence(mergeProps(renderStrategyProps, () => ({
|
|
59
|
+
present: tour2().open
|
|
60
|
+
})));
|
|
61
|
+
const mergedProps = mergeProps(() => tour2().getBackdropProps(), () => presence().presenceProps, props);
|
|
62
|
+
return createComponent(Show, {
|
|
63
|
+
get when() {
|
|
64
|
+
return !presence().unmounted;
|
|
65
|
+
},
|
|
66
|
+
get children() {
|
|
67
|
+
return createComponent(ark.div, mergeProps$1(mergedProps, {
|
|
68
|
+
get hidden() {
|
|
69
|
+
return !tour2().step?.backdrop;
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
var TourCloseTrigger = (props) => {
|
|
76
|
+
const tour2 = useTourContext();
|
|
77
|
+
const mergedProps = mergeProps(() => tour2().getCloseTriggerProps(), props);
|
|
78
|
+
return createComponent(ark.button, mergedProps);
|
|
79
|
+
};
|
|
80
|
+
var TourContent = (props) => {
|
|
81
|
+
const tour2 = useTourContext();
|
|
82
|
+
const renderStrategyProps = useRenderStrategyContext();
|
|
83
|
+
const presence = usePresence(mergeProps(renderStrategyProps, () => ({
|
|
84
|
+
present: tour2().open
|
|
85
|
+
})));
|
|
86
|
+
const mergedProps = mergeProps(() => tour2().getContentProps(), () => presence().presenceProps, props);
|
|
87
|
+
return createComponent(Show, {
|
|
88
|
+
get when() {
|
|
89
|
+
return !presence().unmounted;
|
|
90
|
+
},
|
|
91
|
+
get children() {
|
|
92
|
+
return createComponent(ark.div, mergedProps);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// src/components/tour/tour-context.tsx
|
|
98
|
+
var TourContext = (props) => props.children(useTourContext());
|
|
99
|
+
var tourAnatomy = anatomy.extendWith("control");
|
|
100
|
+
|
|
101
|
+
// src/components/tour/tour-control.tsx
|
|
102
|
+
var TourControl = (props) => {
|
|
103
|
+
const mergedProps = mergeProps(() => tourAnatomy.build().control.attrs, props);
|
|
104
|
+
return createComponent(ark.div, mergedProps);
|
|
105
|
+
};
|
|
106
|
+
var TourDescription = (props) => {
|
|
107
|
+
const tour2 = useTourContext();
|
|
108
|
+
const mergedProps = mergeProps(() => tour2().getDescriptionProps(), props);
|
|
109
|
+
return createComponent(ark.div, mergeProps$1(mergedProps, {
|
|
110
|
+
get children() {
|
|
111
|
+
return mergedProps.children || tour2().step?.description;
|
|
112
|
+
}
|
|
113
|
+
}));
|
|
114
|
+
};
|
|
115
|
+
var TourPositioner = (props) => {
|
|
116
|
+
const tour2 = useTourContext();
|
|
117
|
+
const presence = usePresenceContext();
|
|
118
|
+
const mergedProps = mergeProps(() => tour2().getPositionerProps(), props);
|
|
119
|
+
return createComponent(Show, {
|
|
120
|
+
get when() {
|
|
121
|
+
return !presence().unmounted;
|
|
122
|
+
},
|
|
123
|
+
get children() {
|
|
124
|
+
return createComponent(ark.div, mergedProps);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
var TourProgressText = (props) => {
|
|
129
|
+
const tour2 = useTourContext();
|
|
130
|
+
const mergedProps = mergeProps(() => tour2().getProgressTextProps(), props);
|
|
131
|
+
return createComponent(ark.div, mergeProps$1(mergedProps, {
|
|
132
|
+
get children() {
|
|
133
|
+
return mergedProps.children || tour2().getProgressText();
|
|
134
|
+
}
|
|
135
|
+
}));
|
|
136
|
+
};
|
|
137
|
+
var TourRoot = (props) => {
|
|
138
|
+
const [presenceProps, rootProps] = splitPresenceProps(props);
|
|
139
|
+
const [renderStrategyProps] = splitRenderStrategyProps(presenceProps);
|
|
140
|
+
const presence = usePresence(mergeProps(presenceProps, () => ({
|
|
141
|
+
present: rootProps.tour().open
|
|
142
|
+
})));
|
|
143
|
+
return createComponent(TourProvider, {
|
|
144
|
+
get value() {
|
|
145
|
+
return rootProps.tour;
|
|
146
|
+
},
|
|
147
|
+
get children() {
|
|
148
|
+
return createComponent(RenderStrategyProvider, {
|
|
149
|
+
value: renderStrategyProps,
|
|
150
|
+
get children() {
|
|
151
|
+
return createComponent(PresenceProvider, {
|
|
152
|
+
value: presence,
|
|
153
|
+
get children() {
|
|
154
|
+
return rootProps.children;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
var TourSpotlight = (props) => {
|
|
163
|
+
const tour2 = useTourContext();
|
|
164
|
+
const renderStrategyProps = useRenderStrategyContext();
|
|
165
|
+
const presenceApi = usePresence(mergeProps(renderStrategyProps, () => ({
|
|
166
|
+
present: tour2().open
|
|
167
|
+
})));
|
|
168
|
+
const mergedProps = mergeProps(() => tour2().getSpotlightProps(), () => presenceApi().presenceProps, props);
|
|
169
|
+
return createComponent(Show, {
|
|
170
|
+
get when() {
|
|
171
|
+
return !presenceApi().unmounted;
|
|
172
|
+
},
|
|
173
|
+
get children() {
|
|
174
|
+
return createComponent(ark.div, mergeProps$1(mergedProps, {
|
|
175
|
+
get hidden() {
|
|
176
|
+
return !tour2().open || !tour2().step?.target?.();
|
|
177
|
+
}
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
var TourTitle = (props) => {
|
|
183
|
+
const tour2 = useTourContext();
|
|
184
|
+
const mergedProps = mergeProps(() => tour2().getTitleProps(), props);
|
|
185
|
+
return createComponent(ark.h2, mergeProps$1(mergedProps, {
|
|
186
|
+
get children() {
|
|
187
|
+
return mergedProps.children || tour2().step?.title;
|
|
188
|
+
}
|
|
189
|
+
}));
|
|
190
|
+
};
|
|
191
|
+
var useTour = (props = {}) => {
|
|
192
|
+
const id = createUniqueId();
|
|
193
|
+
const locale = useLocaleContext();
|
|
194
|
+
const environment = useEnvironmentContext();
|
|
195
|
+
const context = createMemo(() => ({
|
|
196
|
+
id,
|
|
197
|
+
dir: locale().dir,
|
|
198
|
+
getRootNode: environment().getRootNode,
|
|
199
|
+
...props
|
|
200
|
+
}));
|
|
201
|
+
const [state, send] = useMachine(tour.machine(context()), {
|
|
202
|
+
context
|
|
203
|
+
});
|
|
204
|
+
return createMemo(() => tour.connect(state, send, normalizeProps));
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// src/components/tour/tour.ts
|
|
208
|
+
var tour_exports = {};
|
|
209
|
+
__export(tour_exports, {
|
|
210
|
+
ActionTrigger: () => TourActionTrigger,
|
|
211
|
+
Actions: () => TourActions,
|
|
212
|
+
Arrow: () => TourArrow,
|
|
213
|
+
ArrowTip: () => TourArrowTip,
|
|
214
|
+
Backdrop: () => TourBackdrop,
|
|
215
|
+
CloseTrigger: () => TourCloseTrigger,
|
|
216
|
+
Content: () => TourContent,
|
|
217
|
+
Context: () => TourContext,
|
|
218
|
+
Control: () => TourControl,
|
|
219
|
+
Description: () => TourDescription,
|
|
220
|
+
Positioner: () => TourPositioner,
|
|
221
|
+
ProgressText: () => TourProgressText,
|
|
222
|
+
Root: () => TourRoot,
|
|
223
|
+
Spotlight: () => TourSpotlight,
|
|
224
|
+
Title: () => TourTitle
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
export { TourActionTrigger, TourActions, TourArrow, TourArrowTip, TourBackdrop, TourCloseTrigger, TourContent, TourContext, TourControl, TourDescription, TourPositioner, TourProgressText, TourRoot, TourSpotlight, TourTitle, tourAnatomy, tour_exports, useTour, useTourContext };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/utils/compose-refs.ts
|
|
2
|
+
var isRefFn = (ref) => typeof ref === "function";
|
|
3
|
+
function setRef(ref, value) {
|
|
4
|
+
if (isRefFn(ref)) {
|
|
5
|
+
ref(value);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
function composeRefs(...refs) {
|
|
9
|
+
return (node) => {
|
|
10
|
+
for (const ref of refs) {
|
|
11
|
+
setRef(ref, node);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
composeRefs
|
|
18
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
composeRefs
|
|
3
|
+
} from "./DOBZPYAN.jsx";
|
|
1
4
|
import {
|
|
2
5
|
EnvironmentProvider
|
|
3
6
|
} from "./5O4RWSWO.jsx";
|
|
@@ -13,21 +16,6 @@ import {
|
|
|
13
16
|
} from "solid-js";
|
|
14
17
|
import { Portal } from "solid-js/web";
|
|
15
18
|
|
|
16
|
-
// src/utils/compose-refs.ts
|
|
17
|
-
var isRefFn = (ref) => typeof ref === "function";
|
|
18
|
-
function setRef(ref, value) {
|
|
19
|
-
if (isRefFn(ref)) {
|
|
20
|
-
ref(value);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
function composeRefs(...refs) {
|
|
24
|
-
return (node) => {
|
|
25
|
-
for (const ref of refs) {
|
|
26
|
-
setRef(ref, node);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
19
|
// src/components/frame/frame-content.tsx
|
|
32
20
|
import { createEffect, onCleanup } from "solid-js";
|
|
33
21
|
var FrameContent = (props) => {
|