@wirekyt/solid 0.0.1 → 0.0.3
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/accordion.d.ts +68 -0
- package/dist/accordion.js +168 -0
- package/dist/accordion.jsx +143 -0
- package/dist/angle-slider.d.ts +72 -0
- package/dist/angle-slider.js +141 -0
- package/dist/angle-slider.jsx +130 -0
- package/dist/avatar.d.ts +47 -0
- package/dist/avatar.js +86 -0
- package/dist/avatar.jsx +79 -0
- package/dist/carousel.d.ts +92 -0
- package/dist/carousel.js +189 -0
- package/dist/carousel.jsx +174 -0
- package/dist/checkbox.d.ts +140 -0
- package/dist/checkbox.js +252 -0
- package/dist/checkbox.jsx +234 -0
- package/dist/client-only.d.ts +9 -0
- package/dist/client-only.js +22 -0
- package/dist/client-only.jsx +13 -0
- package/dist/clipboard.d.ts +70 -0
- package/dist/clipboard.js +137 -0
- package/dist/clipboard.jsx +120 -0
- package/dist/collapsible-BwNoH1At.jsx +106 -0
- package/dist/collapsible-Dp8aqjtN.js +118 -0
- package/dist/collapsible.d.ts +58 -0
- package/dist/collapsible.js +2 -0
- package/dist/collapsible.jsx +2 -0
- package/dist/collection-By8qgqkx.js +213 -0
- package/dist/collection-Mkvw6TyT.jsx +213 -0
- package/dist/collection.d.ts +2 -0
- package/dist/collection.js +2 -0
- package/dist/collection.jsx +2 -0
- package/dist/color-picker.d.ts +179 -0
- package/dist/color-picker.js +457 -0
- package/dist/color-picker.jsx +395 -0
- package/dist/combobox.d.ts +128 -0
- package/dist/combobox.js +326 -0
- package/dist/combobox.jsx +284 -0
- package/dist/core-7QKBNp9p.js +485 -0
- package/dist/core-7QKBNp9p.jsx +485 -0
- package/dist/date-input.d.ts +68 -0
- package/dist/date-input.js +178 -0
- package/dist/date-input.jsx +163 -0
- package/dist/date-picker.d.ts +191 -0
- package/dist/date-picker.js +506 -0
- package/dist/date-picker.jsx +430 -0
- package/dist/dialog.d.ts +77 -0
- package/dist/dialog.js +205 -0
- package/dist/dialog.jsx +159 -0
- package/dist/download-trigger.d.ts +22 -0
- package/dist/download-trigger.js +55 -0
- package/dist/download-trigger.jsx +51 -0
- package/dist/drawer.d.ts +114 -0
- package/dist/drawer.js +291 -0
- package/dist/drawer.jsx +237 -0
- package/dist/editable.d.ts +77 -0
- package/dist/editable.js +171 -0
- package/dist/editable.jsx +162 -0
- package/dist/factory-D2A7xdtl.js +34 -0
- package/dist/factory-DRw_slzE.jsx +34 -0
- package/dist/factory-wuwfJqbU.d.ts +15 -0
- package/dist/field-CQr_Dibp.js +317 -0
- package/dist/field-R5jVNdtK.jsx +282 -0
- package/dist/field.d.ts +194 -0
- package/dist/field.js +2 -0
- package/dist/field.jsx +2 -0
- package/dist/fieldset-5shfE0Z5.jsx +155 -0
- package/dist/fieldset-D5teGLZ9.js +170 -0
- package/dist/fieldset.d.ts +98 -0
- package/dist/fieldset.js +2 -0
- package/dist/fieldset.jsx +2 -0
- package/dist/file-upload.d.ts +100 -0
- package/dist/file-upload.js +254 -0
- package/dist/file-upload.jsx +232 -0
- package/dist/floating-panel.d.ts +97 -0
- package/dist/floating-panel.js +231 -0
- package/dist/floating-panel.jsx +199 -0
- package/dist/focus-trap.d.ts +12 -0
- package/dist/focus-trap.js +30 -0
- package/dist/focus-trap.jsx +26 -0
- package/dist/format.d.ts +32 -0
- package/dist/format.js +50 -0
- package/dist/format.jsx +53 -0
- package/dist/frame.d.ts +12 -0
- package/dist/frame.js +119 -0
- package/dist/frame.jsx +83 -0
- package/dist/image-cropper.d.ts +62 -0
- package/dist/image-cropper.js +137 -0
- package/dist/image-cropper.jsx +130 -0
- package/dist/index-B17eqq14.d.ts +32 -0
- package/dist/index-BZHmHI7d.d.ts +142 -0
- package/dist/index-CANuc1X0.d.ts +81 -0
- package/dist/index-CJwZCGOS.d.ts +75 -0
- package/dist/index-ClU-Lb8Z.d.ts +23 -0
- package/dist/index-J9N2CBHP.d.ts +21 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.jsx +5 -0
- package/dist/json-tree-view.d.ts +50 -0
- package/dist/json-tree-view.js +330 -0
- package/dist/json-tree-view.jsx +201 -0
- package/dist/listbox.d.ts +109 -0
- package/dist/listbox.js +237 -0
- package/dist/listbox.jsx +212 -0
- package/dist/marquee.d.ts +57 -0
- package/dist/marquee.js +125 -0
- package/dist/marquee.jsx +113 -0
- package/dist/menu.d.ts +158 -0
- package/dist/menu.js +441 -0
- package/dist/menu.jsx +362 -0
- package/dist/navigation-menu.d.ts +88 -0
- package/dist/navigation-menu.js +289 -0
- package/dist/navigation-menu.jsx +228 -0
- package/dist/number-input.d.ts +72 -0
- package/dist/number-input.js +166 -0
- package/dist/number-input.jsx +157 -0
- package/dist/pagination.d.ts +67 -0
- package/dist/pagination.js +131 -0
- package/dist/pagination.jsx +124 -0
- package/dist/password-input.d.ts +64 -0
- package/dist/password-input.js +144 -0
- package/dist/password-input.jsx +125 -0
- package/dist/pin-input.d.ts +57 -0
- package/dist/pin-input.js +138 -0
- package/dist/pin-input.jsx +129 -0
- package/dist/popover.d.ts +92 -0
- package/dist/popover.js +206 -0
- package/dist/popover.jsx +174 -0
- package/dist/presence-9UGkuyfn.jsx +59 -0
- package/dist/presence-CE6lXCu5.js +72 -0
- package/dist/presence.d.ts +2 -0
- package/dist/presence.js +2 -0
- package/dist/presence.jsx +2 -0
- package/dist/progress.d.ts +77 -0
- package/dist/progress.js +146 -0
- package/dist/progress.jsx +137 -0
- package/dist/providers-B-Vi5wQ7.js +124 -0
- package/dist/providers-CqNHqLpB.jsx +110 -0
- package/dist/qr-code.d.ts +57 -0
- package/dist/qr-code.js +111 -0
- package/dist/qr-code.jsx +104 -0
- package/dist/radio-group.d.ts +77 -0
- package/dist/radio-group.js +170 -0
- package/dist/radio-group.jsx +157 -0
- package/dist/rating-group.d.ts +67 -0
- package/dist/rating-group.js +142 -0
- package/dist/rating-group.jsx +131 -0
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/rolldown-runtime-D7D4PA-g.jsx +13 -0
- package/dist/run-if-fn-CjvD7VzQ.js +5 -0
- package/dist/run-if-fn-CjvD7VzQ.jsx +5 -0
- package/dist/scroll-area.d.ts +61 -0
- package/dist/scroll-area.js +119 -0
- package/dist/scroll-area.jsx +109 -0
- package/dist/segment-group.d.ts +80 -0
- package/dist/segment-group.js +166 -0
- package/dist/segment-group.jsx +153 -0
- package/dist/select.d.ts +132 -0
- package/dist/select.js +337 -0
- package/dist/select.jsx +283 -0
- package/dist/signature-pad.d.ts +67 -0
- package/dist/signature-pad.js +159 -0
- package/dist/signature-pad.jsx +141 -0
- package/dist/slider.d.ts +87 -0
- package/dist/slider.js +191 -0
- package/dist/slider.jsx +179 -0
- package/dist/splitter.d.ts +57 -0
- package/dist/splitter.js +126 -0
- package/dist/splitter.jsx +116 -0
- package/dist/steps.d.ts +100 -0
- package/dist/steps.js +199 -0
- package/dist/steps.jsx +184 -0
- package/dist/swap.d.ts +51 -0
- package/dist/swap.js +123 -0
- package/dist/swap.jsx +106 -0
- package/dist/switch.d.ts +57 -0
- package/dist/switch.js +125 -0
- package/dist/switch.jsx +116 -0
- package/dist/tabs.d.ts +58 -0
- package/dist/tabs.js +146 -0
- package/dist/tabs.jsx +122 -0
- package/dist/tags-input.d.ts +97 -0
- package/dist/tags-input.js +228 -0
- package/dist/tags-input.jsx +213 -0
- package/dist/timer.d.ts +62 -0
- package/dist/timer.js +119 -0
- package/dist/timer.jsx +110 -0
- package/dist/toast.d.ts +60 -0
- package/dist/toast.js +120 -0
- package/dist/toast.jsx +106 -0
- package/dist/toggle-group.d.ts +42 -0
- package/dist/toggle-group.js +87 -0
- package/dist/toggle-group.jsx +80 -0
- package/dist/toggle.d.ts +38 -0
- package/dist/toggle.js +73 -0
- package/dist/toggle.jsx +61 -0
- package/dist/tooltip.d.ts +67 -0
- package/dist/tooltip.js +159 -0
- package/dist/tooltip.jsx +127 -0
- package/dist/tour.d.ts +112 -0
- package/dist/tour.js +256 -0
- package/dist/tour.jsx +192 -0
- package/dist/tree-view-ATyeBPXq.js +290 -0
- package/dist/tree-view-CoWx7osT.jsx +265 -0
- package/dist/tree-view.d.ts +3 -0
- package/dist/tree-view.js +3 -0
- package/dist/tree-view.jsx +3 -0
- package/package.json +324 -6
package/dist/steps.js
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { a as mergeProps$2, d as createContext$1, i as useMachine, l as createSplitProps, r as normalizeProps } from "./core-7QKBNp9p.js";
|
|
3
|
+
import { t as runIfFn } from "./run-if-fn-CjvD7VzQ.js";
|
|
4
|
+
import { t as wire } from "./factory-D2A7xdtl.js";
|
|
5
|
+
import { a as useLocaleContext, l as useEnvironmentContext } from "./providers-B-Vi5wQ7.js";
|
|
6
|
+
import { createMemo, createUniqueId } from "solid-js";
|
|
7
|
+
import { createComponent, mergeProps as mergeProps$1 } from "solid-js/web";
|
|
8
|
+
import * as steps from "@wirekyt/dom/machines/steps";
|
|
9
|
+
import { anatomy as stepsAnatomy } from "@wirekyt/dom/machines/steps";
|
|
10
|
+
//#region src/components/steps/use-context.ts
|
|
11
|
+
const [StepsProvider, useStepsContext] = createContext$1({
|
|
12
|
+
hookName: "useStepsContext",
|
|
13
|
+
providerName: "<StepsProvider />"
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/components/steps/completed-content.tsx
|
|
17
|
+
const StepsCompletedContent = (props) => {
|
|
18
|
+
const steps = useStepsContext();
|
|
19
|
+
const mergedProps = mergeProps$2(() => steps().getContentProps({ index: steps().count }), props);
|
|
20
|
+
return createComponent(wire.div, mergedProps);
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/steps/content.tsx
|
|
24
|
+
const StepsContent = (props) => {
|
|
25
|
+
const [itemProps, localProps] = createSplitProps()(props, ["index"]);
|
|
26
|
+
const steps = useStepsContext();
|
|
27
|
+
const mergedProps = mergeProps$2(() => steps().getContentProps(itemProps), localProps);
|
|
28
|
+
return createComponent(wire.div, mergedProps);
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/components/steps/context.tsx
|
|
32
|
+
const StepsContext = (props) => {
|
|
33
|
+
const context = useStepsContext();
|
|
34
|
+
return props.children(context);
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/components/steps/use-item-props-context.ts
|
|
38
|
+
const [StepsItemPropsProvider, useStepsItemPropsContext] = createContext$1({
|
|
39
|
+
hookName: "useStepsItemPropsContext",
|
|
40
|
+
providerName: "<StepsItemPropsProvider />"
|
|
41
|
+
});
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/steps/indicator.tsx
|
|
44
|
+
const StepsIndicator = (props) => {
|
|
45
|
+
const steps = useStepsContext();
|
|
46
|
+
const itemProps = useStepsItemPropsContext();
|
|
47
|
+
const mergedProps = mergeProps$2(() => steps().getIndicatorProps(itemProps), props);
|
|
48
|
+
return createComponent(wire.div, mergedProps);
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/components/steps/use-item-context.ts
|
|
52
|
+
const [StepsItemProvider, useStepsItemContext] = createContext$1({
|
|
53
|
+
hookName: "useStepsItemContext",
|
|
54
|
+
providerName: "<StepsItem />"
|
|
55
|
+
});
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/components/steps/item.tsx
|
|
58
|
+
const StepsItem = (props) => {
|
|
59
|
+
const [itemProps, localProps] = createSplitProps()(props, ["index"]);
|
|
60
|
+
const steps = useStepsContext();
|
|
61
|
+
const mergedProps = mergeProps$2(() => steps().getItemProps(itemProps), localProps);
|
|
62
|
+
const itemState = createMemo(() => steps().getItemState(itemProps));
|
|
63
|
+
return createComponent(StepsItemPropsProvider, {
|
|
64
|
+
value: itemProps,
|
|
65
|
+
get children() {
|
|
66
|
+
return createComponent(StepsItemProvider, {
|
|
67
|
+
value: itemState,
|
|
68
|
+
get children() {
|
|
69
|
+
return createComponent(wire.div, mergedProps);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/components/steps/item-context.tsx
|
|
77
|
+
const StepsItemContext = (props) => {
|
|
78
|
+
return props.children(useStepsItemContext());
|
|
79
|
+
};
|
|
80
|
+
StepsItemContext.displayName = "StepsItemContext";
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/components/steps/list.tsx
|
|
83
|
+
const StepsList = (props) => {
|
|
84
|
+
const steps = useStepsContext();
|
|
85
|
+
const mergedProps = mergeProps$2(() => steps().getListProps(), props);
|
|
86
|
+
return createComponent(wire.div, mergedProps);
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/components/steps/next-trigger.tsx
|
|
90
|
+
const StepsNextTrigger = (props) => {
|
|
91
|
+
const steps = useStepsContext();
|
|
92
|
+
const mergedProps = mergeProps$2(() => steps().getNextTriggerProps(), props);
|
|
93
|
+
return createComponent(wire.button, mergedProps);
|
|
94
|
+
};
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/components/steps/prev-trigger.tsx
|
|
97
|
+
const StepsPrevTrigger = (props) => {
|
|
98
|
+
const steps = useStepsContext();
|
|
99
|
+
const mergedProps = mergeProps$2(() => steps().getPrevTriggerProps(), props);
|
|
100
|
+
return createComponent(wire.button, mergedProps);
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/components/steps/progress.tsx
|
|
104
|
+
const StepsProgress = (props) => {
|
|
105
|
+
const steps = useStepsContext();
|
|
106
|
+
const mergedProps = mergeProps$2(() => steps().getProgressProps(), props);
|
|
107
|
+
return createComponent(wire.div, mergedProps);
|
|
108
|
+
};
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/components/steps/use.ts
|
|
111
|
+
function useSteps(props) {
|
|
112
|
+
const id = createUniqueId();
|
|
113
|
+
const environment = useEnvironmentContext();
|
|
114
|
+
const locale = useLocaleContext();
|
|
115
|
+
const machineProps = createMemo(() => ({
|
|
116
|
+
id,
|
|
117
|
+
dir: locale().dir,
|
|
118
|
+
getRootNode: environment().getRootNode,
|
|
119
|
+
...runIfFn(props)
|
|
120
|
+
}));
|
|
121
|
+
const service = useMachine(steps.machine, machineProps);
|
|
122
|
+
return createMemo(() => steps.connect(service, normalizeProps));
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/components/steps/root.tsx
|
|
126
|
+
const StepsRoot = (props) => {
|
|
127
|
+
const [useStepsProps, localProps] = createSplitProps()(props, [
|
|
128
|
+
"count",
|
|
129
|
+
"defaultStep",
|
|
130
|
+
"id",
|
|
131
|
+
"ids",
|
|
132
|
+
"isStepSkippable",
|
|
133
|
+
"isStepValid",
|
|
134
|
+
"linear",
|
|
135
|
+
"onStepChange",
|
|
136
|
+
"onStepComplete",
|
|
137
|
+
"onStepInvalid",
|
|
138
|
+
"orientation",
|
|
139
|
+
"step"
|
|
140
|
+
]);
|
|
141
|
+
const steps = useSteps(useStepsProps);
|
|
142
|
+
const mergedProps = mergeProps$2(() => steps().getRootProps(), localProps);
|
|
143
|
+
return createComponent(StepsProvider, {
|
|
144
|
+
value: steps,
|
|
145
|
+
get children() {
|
|
146
|
+
return createComponent(wire.div, mergedProps);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/components/steps/root-provider.tsx
|
|
152
|
+
const StepsRootProvider = (props) => {
|
|
153
|
+
const [{ value: steps }, rootProps] = createSplitProps()(props, ["value"]);
|
|
154
|
+
const mergedProps = mergeProps$2(() => steps().getRootProps(), rootProps);
|
|
155
|
+
return createComponent(StepsProvider, {
|
|
156
|
+
value: steps,
|
|
157
|
+
get children() {
|
|
158
|
+
return createComponent(wire.div, mergeProps$1(mergedProps, { get children() {
|
|
159
|
+
return props.children;
|
|
160
|
+
} }));
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/components/steps/separator.tsx
|
|
166
|
+
const StepsSeparator = (props) => {
|
|
167
|
+
const steps = useStepsContext();
|
|
168
|
+
const itemProps = useStepsItemPropsContext();
|
|
169
|
+
const mergedProps = mergeProps$2(() => steps().getSeparatorProps(itemProps), props);
|
|
170
|
+
return createComponent(wire.div, mergedProps);
|
|
171
|
+
};
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/components/steps/trigger.tsx
|
|
174
|
+
const StepsTrigger = (props) => {
|
|
175
|
+
const steps = useStepsContext();
|
|
176
|
+
const itemProps = useStepsItemPropsContext();
|
|
177
|
+
const mergedProps = mergeProps$2(() => steps().getTriggerProps(itemProps), props);
|
|
178
|
+
return createComponent(wire.button, mergedProps);
|
|
179
|
+
};
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region src/components/steps/steps.ts
|
|
182
|
+
var steps_exports = /* @__PURE__ */ __exportAll({
|
|
183
|
+
CompletedContent: () => StepsCompletedContent,
|
|
184
|
+
Content: () => StepsContent,
|
|
185
|
+
Context: () => StepsContext,
|
|
186
|
+
Indicator: () => StepsIndicator,
|
|
187
|
+
Item: () => StepsItem,
|
|
188
|
+
ItemContext: () => StepsItemContext,
|
|
189
|
+
List: () => StepsList,
|
|
190
|
+
NextTrigger: () => StepsNextTrigger,
|
|
191
|
+
PrevTrigger: () => StepsPrevTrigger,
|
|
192
|
+
Progress: () => StepsProgress,
|
|
193
|
+
Root: () => StepsRoot,
|
|
194
|
+
RootProvider: () => StepsRootProvider,
|
|
195
|
+
Separator: () => StepsSeparator,
|
|
196
|
+
Trigger: () => StepsTrigger
|
|
197
|
+
});
|
|
198
|
+
//#endregion
|
|
199
|
+
export { steps_exports as Steps, StepsCompletedContent, StepsContent, StepsContext, StepsIndicator, StepsItem, StepsItemContext, StepsList, StepsNextTrigger, StepsPrevTrigger, StepsProgress, StepsRoot, StepsRootProvider, StepsSeparator, StepsTrigger, stepsAnatomy, useSteps, useStepsContext, useStepsItemContext };
|
package/dist/steps.jsx
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.jsx";
|
|
2
|
+
import { a as mergeProps$1, d as createContext$1, i as useMachine, l as createSplitProps, r as normalizeProps } from "./core-7QKBNp9p.jsx";
|
|
3
|
+
import { t as runIfFn } from "./run-if-fn-CjvD7VzQ.jsx";
|
|
4
|
+
import { t as wire } from "./factory-DRw_slzE.jsx";
|
|
5
|
+
import { a as useLocaleContext, l as useEnvironmentContext } from "./providers-CqNHqLpB.jsx";
|
|
6
|
+
import { createMemo, createUniqueId } from "solid-js";
|
|
7
|
+
import * as steps from "@wirekyt/dom/machines/steps";
|
|
8
|
+
import { anatomy as stepsAnatomy } from "@wirekyt/dom/machines/steps";
|
|
9
|
+
//#region src/components/steps/use-context.ts
|
|
10
|
+
const [StepsProvider, useStepsContext] = createContext$1({
|
|
11
|
+
hookName: "useStepsContext",
|
|
12
|
+
providerName: "<StepsProvider />"
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/components/steps/completed-content.tsx
|
|
16
|
+
const StepsCompletedContent = (props) => {
|
|
17
|
+
const steps = useStepsContext();
|
|
18
|
+
const mergedProps = mergeProps$1(() => steps().getContentProps({ index: steps().count }), props);
|
|
19
|
+
return <wire.div {...mergedProps} />;
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/steps/content.tsx
|
|
23
|
+
const StepsContent = (props) => {
|
|
24
|
+
const [itemProps, localProps] = createSplitProps()(props, ["index"]);
|
|
25
|
+
const steps = useStepsContext();
|
|
26
|
+
const mergedProps = mergeProps$1(() => steps().getContentProps(itemProps), localProps);
|
|
27
|
+
return <wire.div {...mergedProps} />;
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/steps/context.tsx
|
|
31
|
+
const StepsContext = (props) => {
|
|
32
|
+
const context = useStepsContext();
|
|
33
|
+
return props.children(context);
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/steps/use-item-props-context.ts
|
|
37
|
+
const [StepsItemPropsProvider, useStepsItemPropsContext] = createContext$1({
|
|
38
|
+
hookName: "useStepsItemPropsContext",
|
|
39
|
+
providerName: "<StepsItemPropsProvider />"
|
|
40
|
+
});
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/steps/indicator.tsx
|
|
43
|
+
const StepsIndicator = (props) => {
|
|
44
|
+
const steps = useStepsContext();
|
|
45
|
+
const itemProps = useStepsItemPropsContext();
|
|
46
|
+
const mergedProps = mergeProps$1(() => steps().getIndicatorProps(itemProps), props);
|
|
47
|
+
return <wire.div {...mergedProps} />;
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/components/steps/use-item-context.ts
|
|
51
|
+
const [StepsItemProvider, useStepsItemContext] = createContext$1({
|
|
52
|
+
hookName: "useStepsItemContext",
|
|
53
|
+
providerName: "<StepsItem />"
|
|
54
|
+
});
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/components/steps/item.tsx
|
|
57
|
+
const StepsItem = (props) => {
|
|
58
|
+
const [itemProps, localProps] = createSplitProps()(props, ["index"]);
|
|
59
|
+
const steps = useStepsContext();
|
|
60
|
+
const mergedProps = mergeProps$1(() => steps().getItemProps(itemProps), localProps);
|
|
61
|
+
const itemState = createMemo(() => steps().getItemState(itemProps));
|
|
62
|
+
return <StepsItemPropsProvider value={itemProps}>
|
|
63
|
+
<StepsItemProvider value={itemState}>
|
|
64
|
+
<wire.div {...mergedProps} />
|
|
65
|
+
</StepsItemProvider>
|
|
66
|
+
</StepsItemPropsProvider>;
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/components/steps/item-context.tsx
|
|
70
|
+
const StepsItemContext = (props) => {
|
|
71
|
+
return props.children(useStepsItemContext());
|
|
72
|
+
};
|
|
73
|
+
StepsItemContext.displayName = "StepsItemContext";
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/components/steps/list.tsx
|
|
76
|
+
const StepsList = (props) => {
|
|
77
|
+
const steps = useStepsContext();
|
|
78
|
+
const mergedProps = mergeProps$1(() => steps().getListProps(), props);
|
|
79
|
+
return <wire.div {...mergedProps} />;
|
|
80
|
+
};
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/components/steps/next-trigger.tsx
|
|
83
|
+
const StepsNextTrigger = (props) => {
|
|
84
|
+
const steps = useStepsContext();
|
|
85
|
+
const mergedProps = mergeProps$1(() => steps().getNextTriggerProps(), props);
|
|
86
|
+
return <wire.button {...mergedProps} />;
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/components/steps/prev-trigger.tsx
|
|
90
|
+
const StepsPrevTrigger = (props) => {
|
|
91
|
+
const steps = useStepsContext();
|
|
92
|
+
const mergedProps = mergeProps$1(() => steps().getPrevTriggerProps(), props);
|
|
93
|
+
return <wire.button {...mergedProps} />;
|
|
94
|
+
};
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/components/steps/progress.tsx
|
|
97
|
+
const StepsProgress = (props) => {
|
|
98
|
+
const steps = useStepsContext();
|
|
99
|
+
const mergedProps = mergeProps$1(() => steps().getProgressProps(), props);
|
|
100
|
+
return <wire.div {...mergedProps} />;
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/components/steps/use.ts
|
|
104
|
+
function useSteps(props) {
|
|
105
|
+
const id = createUniqueId();
|
|
106
|
+
const environment = useEnvironmentContext();
|
|
107
|
+
const locale = useLocaleContext();
|
|
108
|
+
const machineProps = createMemo(() => ({
|
|
109
|
+
id,
|
|
110
|
+
dir: locale().dir,
|
|
111
|
+
getRootNode: environment().getRootNode,
|
|
112
|
+
...runIfFn(props)
|
|
113
|
+
}));
|
|
114
|
+
const service = useMachine(steps.machine, machineProps);
|
|
115
|
+
return createMemo(() => steps.connect(service, normalizeProps));
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/components/steps/root.tsx
|
|
119
|
+
const StepsRoot = (props) => {
|
|
120
|
+
const [useStepsProps, localProps] = createSplitProps()(props, [
|
|
121
|
+
"count",
|
|
122
|
+
"defaultStep",
|
|
123
|
+
"id",
|
|
124
|
+
"ids",
|
|
125
|
+
"isStepSkippable",
|
|
126
|
+
"isStepValid",
|
|
127
|
+
"linear",
|
|
128
|
+
"onStepChange",
|
|
129
|
+
"onStepComplete",
|
|
130
|
+
"onStepInvalid",
|
|
131
|
+
"orientation",
|
|
132
|
+
"step"
|
|
133
|
+
]);
|
|
134
|
+
const steps = useSteps(useStepsProps);
|
|
135
|
+
const mergedProps = mergeProps$1(() => steps().getRootProps(), localProps);
|
|
136
|
+
return <StepsProvider value={steps}>
|
|
137
|
+
<wire.div {...mergedProps} />
|
|
138
|
+
</StepsProvider>;
|
|
139
|
+
};
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/components/steps/root-provider.tsx
|
|
142
|
+
const StepsRootProvider = (props) => {
|
|
143
|
+
const [{ value: steps }, rootProps] = createSplitProps()(props, ["value"]);
|
|
144
|
+
const mergedProps = mergeProps$1(() => steps().getRootProps(), rootProps);
|
|
145
|
+
return <StepsProvider value={steps}>
|
|
146
|
+
<wire.div {...mergedProps}>{props.children}</wire.div>
|
|
147
|
+
</StepsProvider>;
|
|
148
|
+
};
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/components/steps/separator.tsx
|
|
151
|
+
const StepsSeparator = (props) => {
|
|
152
|
+
const steps = useStepsContext();
|
|
153
|
+
const itemProps = useStepsItemPropsContext();
|
|
154
|
+
const mergedProps = mergeProps$1(() => steps().getSeparatorProps(itemProps), props);
|
|
155
|
+
return <wire.div {...mergedProps} />;
|
|
156
|
+
};
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/components/steps/trigger.tsx
|
|
159
|
+
const StepsTrigger = (props) => {
|
|
160
|
+
const steps = useStepsContext();
|
|
161
|
+
const itemProps = useStepsItemPropsContext();
|
|
162
|
+
const mergedProps = mergeProps$1(() => steps().getTriggerProps(itemProps), props);
|
|
163
|
+
return <wire.button {...mergedProps} />;
|
|
164
|
+
};
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/components/steps/steps.ts
|
|
167
|
+
var steps_exports = /* @__PURE__ */ __exportAll({
|
|
168
|
+
CompletedContent: () => StepsCompletedContent,
|
|
169
|
+
Content: () => StepsContent,
|
|
170
|
+
Context: () => StepsContext,
|
|
171
|
+
Indicator: () => StepsIndicator,
|
|
172
|
+
Item: () => StepsItem,
|
|
173
|
+
ItemContext: () => StepsItemContext,
|
|
174
|
+
List: () => StepsList,
|
|
175
|
+
NextTrigger: () => StepsNextTrigger,
|
|
176
|
+
PrevTrigger: () => StepsPrevTrigger,
|
|
177
|
+
Progress: () => StepsProgress,
|
|
178
|
+
Root: () => StepsRoot,
|
|
179
|
+
RootProvider: () => StepsRootProvider,
|
|
180
|
+
Separator: () => StepsSeparator,
|
|
181
|
+
Trigger: () => StepsTrigger
|
|
182
|
+
});
|
|
183
|
+
//#endregion
|
|
184
|
+
export { steps_exports as Steps, StepsCompletedContent, StepsContent, StepsContext, StepsIndicator, StepsItem, StepsItemContext, StepsList, StepsNextTrigger, StepsPrevTrigger, StepsProgress, StepsRoot, StepsRootProvider, StepsSeparator, StepsTrigger, stepsAnatomy, useSteps, useStepsContext, useStepsItemContext };
|
package/dist/swap.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { r as MaybeAccessor } from "./index-ClU-Lb8Z.js";
|
|
2
|
+
import { r as PolymorphicProps, t as HTMLProps } from "./factory-wuwfJqbU.js";
|
|
3
|
+
import { t as RenderStrategyProps } from "./index-J9N2CBHP.js";
|
|
4
|
+
import { c as UsePresenceReturn } from "./index-B17eqq14.js";
|
|
5
|
+
import { Accessor } from "solid-js";
|
|
6
|
+
//#region src/components/swap/indicator.d.ts
|
|
7
|
+
interface SwapIndicatorBaseProps extends PolymorphicProps<"span"> {
|
|
8
|
+
type: "on" | "off";
|
|
9
|
+
}
|
|
10
|
+
interface SwapIndicatorProps extends HTMLProps<"span">, SwapIndicatorBaseProps {}
|
|
11
|
+
declare const SwapIndicator: (props: SwapIndicatorProps) => import("solid-js").JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/components/swap/use.d.ts
|
|
14
|
+
interface UseSwapProps extends RenderStrategyProps {
|
|
15
|
+
swap?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface IndicatorProps {
|
|
18
|
+
type: "on" | "off";
|
|
19
|
+
}
|
|
20
|
+
interface UseSwapReturn {
|
|
21
|
+
swap: boolean;
|
|
22
|
+
onPresence: UsePresenceReturn;
|
|
23
|
+
offPresence: UsePresenceReturn;
|
|
24
|
+
getRootProps: () => HTMLProps<"span">;
|
|
25
|
+
getIndicatorProps: (props: IndicatorProps) => HTMLProps<"span">;
|
|
26
|
+
}
|
|
27
|
+
declare const useSwap: (props?: MaybeAccessor<UseSwapProps>) => Accessor<UseSwapReturn>;
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/swap/root.d.ts
|
|
30
|
+
interface SwapRootBaseProps extends UseSwapProps, PolymorphicProps<"span"> {}
|
|
31
|
+
interface SwapRootProps extends HTMLProps<"span">, SwapRootBaseProps {}
|
|
32
|
+
declare const SwapRoot: (props: SwapRootProps) => import("solid-js").JSX.Element;
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/components/swap/root-provider.d.ts
|
|
35
|
+
interface SwapRootProviderBaseProps extends PolymorphicProps<"span"> {
|
|
36
|
+
value: Accessor<UseSwapReturn>;
|
|
37
|
+
}
|
|
38
|
+
interface SwapRootProviderProps extends HTMLProps<"span">, SwapRootProviderBaseProps {}
|
|
39
|
+
declare const SwapRootProvider: (props: SwapRootProviderProps) => import("solid-js").JSX.Element;
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/components/swap/anatomy.d.ts
|
|
42
|
+
declare const swapAnatomy: import("@wirekyt/dom/anatomy").Anatomy<"root" | "indicator">;
|
|
43
|
+
declare namespace swap_d_exports {
|
|
44
|
+
export { SwapIndicator as Indicator, SwapIndicatorBaseProps as IndicatorBaseProps, SwapIndicatorProps as IndicatorProps, SwapRoot as Root, SwapRootBaseProps as RootBaseProps, SwapRootProps as RootProps, SwapRootProvider as RootProvider, SwapRootProviderBaseProps as RootProviderBaseProps, SwapRootProviderProps as RootProviderProps, swapAnatomy };
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/swap/use-context.d.ts
|
|
48
|
+
interface UseSwapContext extends Accessor<UseSwapReturn> {}
|
|
49
|
+
declare const SwapProvider: import("solid-js").ContextProviderComponent<UseSwapContext>, useSwapContext: () => UseSwapContext;
|
|
50
|
+
//#endregion
|
|
51
|
+
export { swap_d_exports as Swap, SwapIndicator, type SwapIndicatorBaseProps, type SwapIndicatorProps, SwapRoot, type SwapRootBaseProps, type SwapRootProps, SwapRootProvider, type SwapRootProviderBaseProps, type SwapRootProviderProps, type UseSwapContext, type UseSwapProps, type UseSwapReturn, swapAnatomy, useSwap, useSwapContext };
|
package/dist/swap.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { a as mergeProps$2, d as createContext$1, u as composeRefs } from "./core-7QKBNp9p.js";
|
|
3
|
+
import { t as runIfFn } from "./run-if-fn-CjvD7VzQ.js";
|
|
4
|
+
import { t as wire } from "./factory-D2A7xdtl.js";
|
|
5
|
+
import { i as usePresence } from "./presence-CE6lXCu5.js";
|
|
6
|
+
import { Show, createMemo, splitProps } from "solid-js";
|
|
7
|
+
import { createComponent, mergeProps as mergeProps$1 } from "solid-js/web";
|
|
8
|
+
import { createAnatomy } from "@wirekyt/dom/anatomy";
|
|
9
|
+
//#region src/components/swap/use-context.ts
|
|
10
|
+
const [SwapProvider, useSwapContext] = createContext$1({
|
|
11
|
+
hookName: "useSwapContext",
|
|
12
|
+
providerName: "<SwapProvider />"
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/components/swap/indicator.tsx
|
|
16
|
+
const SwapIndicator = (props) => {
|
|
17
|
+
const [localProps, restProps] = splitProps(props, ["type", "ref"]);
|
|
18
|
+
const swap = useSwapContext();
|
|
19
|
+
const presence = () => {
|
|
20
|
+
return (localProps.type === "on" ? swap().onPresence : swap().offPresence)();
|
|
21
|
+
};
|
|
22
|
+
const mergedProps = mergeProps$2(() => swap().getIndicatorProps({ type: localProps.type }), restProps);
|
|
23
|
+
return createComponent(Show, {
|
|
24
|
+
get when() {
|
|
25
|
+
return !presence().unmounted;
|
|
26
|
+
},
|
|
27
|
+
get children() {
|
|
28
|
+
return createComponent(wire.span, mergeProps$1(mergedProps, { ref(r$) {
|
|
29
|
+
var _ref$ = composeRefs(presence().ref, localProps.ref);
|
|
30
|
+
typeof _ref$ === "function" && _ref$(r$);
|
|
31
|
+
} }));
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/swap/anatomy.ts
|
|
37
|
+
const swapAnatomy = createAnatomy("swap", ["root", "indicator"]);
|
|
38
|
+
const parts = swapAnatomy.build();
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/components/swap/use.ts
|
|
41
|
+
const useSwap = (props = {}) => {
|
|
42
|
+
const resolved = createMemo(() => runIfFn(props));
|
|
43
|
+
const onPresence = usePresence(mergeProps$2(() => ({
|
|
44
|
+
present: resolved().swap ?? false,
|
|
45
|
+
lazyMount: resolved().lazyMount,
|
|
46
|
+
unmountOnExit: resolved().unmountOnExit,
|
|
47
|
+
skipAnimationOnMount: true
|
|
48
|
+
})));
|
|
49
|
+
const offPresence = usePresence(mergeProps$2(() => ({
|
|
50
|
+
present: !(resolved().swap ?? false),
|
|
51
|
+
lazyMount: resolved().lazyMount,
|
|
52
|
+
unmountOnExit: resolved().unmountOnExit,
|
|
53
|
+
skipAnimationOnMount: true
|
|
54
|
+
})));
|
|
55
|
+
return createMemo(() => {
|
|
56
|
+
const swap = resolved().swap ?? false;
|
|
57
|
+
return {
|
|
58
|
+
swap,
|
|
59
|
+
onPresence,
|
|
60
|
+
offPresence,
|
|
61
|
+
getRootProps() {
|
|
62
|
+
return {
|
|
63
|
+
...parts.root.attrs,
|
|
64
|
+
"data-swap": swap ? "on" : "off",
|
|
65
|
+
style: { display: "inline-grid" }
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
getIndicatorProps({ type }) {
|
|
69
|
+
const presence = type === "on" ? onPresence() : offPresence();
|
|
70
|
+
return {
|
|
71
|
+
...parts.indicator.attrs,
|
|
72
|
+
...presence.presenceProps,
|
|
73
|
+
"data-type": type,
|
|
74
|
+
style: {
|
|
75
|
+
"grid-area": "1 / 1",
|
|
76
|
+
display: "inline-flex"
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/components/swap/root.tsx
|
|
85
|
+
const SwapRoot = (props) => {
|
|
86
|
+
const [swapProps, localProps] = splitProps(props, [
|
|
87
|
+
"swap",
|
|
88
|
+
"lazyMount",
|
|
89
|
+
"unmountOnExit"
|
|
90
|
+
]);
|
|
91
|
+
const swap = useSwap(() => swapProps);
|
|
92
|
+
const mergedProps = mergeProps$2(() => swap().getRootProps(), localProps);
|
|
93
|
+
return createComponent(SwapProvider, {
|
|
94
|
+
value: swap,
|
|
95
|
+
get children() {
|
|
96
|
+
return createComponent(wire.span, mergedProps);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/components/swap/root-provider.tsx
|
|
102
|
+
const SwapRootProvider = (props) => {
|
|
103
|
+
const [providerProps, localProps] = splitProps(props, ["value"]);
|
|
104
|
+
const mergedProps = mergeProps$2(() => providerProps.value().getRootProps(), localProps);
|
|
105
|
+
return createComponent(SwapProvider, {
|
|
106
|
+
get value() {
|
|
107
|
+
return providerProps.value;
|
|
108
|
+
},
|
|
109
|
+
get children() {
|
|
110
|
+
return createComponent(wire.span, mergedProps);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/components/swap/swap.ts
|
|
116
|
+
var swap_exports = /* @__PURE__ */ __exportAll({
|
|
117
|
+
Indicator: () => SwapIndicator,
|
|
118
|
+
Root: () => SwapRoot,
|
|
119
|
+
RootProvider: () => SwapRootProvider,
|
|
120
|
+
swapAnatomy: () => swapAnatomy
|
|
121
|
+
});
|
|
122
|
+
//#endregion
|
|
123
|
+
export { swap_exports as Swap, SwapIndicator, SwapRoot, SwapRootProvider, swapAnatomy, useSwap, useSwapContext };
|
package/dist/swap.jsx
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.jsx";
|
|
2
|
+
import { a as mergeProps$1, d as createContext$1, u as composeRefs } from "./core-7QKBNp9p.jsx";
|
|
3
|
+
import { t as runIfFn } from "./run-if-fn-CjvD7VzQ.jsx";
|
|
4
|
+
import { t as wire } from "./factory-DRw_slzE.jsx";
|
|
5
|
+
import { i as usePresence } from "./presence-9UGkuyfn.jsx";
|
|
6
|
+
import { Show, createMemo, splitProps } from "solid-js";
|
|
7
|
+
import { createAnatomy } from "@wirekyt/dom/anatomy";
|
|
8
|
+
//#region src/components/swap/use-context.ts
|
|
9
|
+
const [SwapProvider, useSwapContext] = createContext$1({
|
|
10
|
+
hookName: "useSwapContext",
|
|
11
|
+
providerName: "<SwapProvider />"
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/components/swap/indicator.tsx
|
|
15
|
+
const SwapIndicator = (props) => {
|
|
16
|
+
const [localProps, restProps] = splitProps(props, ["type", "ref"]);
|
|
17
|
+
const swap = useSwapContext();
|
|
18
|
+
const presence = () => {
|
|
19
|
+
return (localProps.type === "on" ? swap().onPresence : swap().offPresence)();
|
|
20
|
+
};
|
|
21
|
+
const mergedProps = mergeProps$1(() => swap().getIndicatorProps({ type: localProps.type }), restProps);
|
|
22
|
+
return <Show when={!presence().unmounted}>
|
|
23
|
+
<wire.span {...mergedProps} ref={composeRefs(presence().ref, localProps.ref)} />
|
|
24
|
+
</Show>;
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/components/swap/anatomy.ts
|
|
28
|
+
const swapAnatomy = createAnatomy("swap", ["root", "indicator"]);
|
|
29
|
+
const parts = swapAnatomy.build();
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/components/swap/use.ts
|
|
32
|
+
const useSwap = (props = {}) => {
|
|
33
|
+
const resolved = createMemo(() => runIfFn(props));
|
|
34
|
+
const onPresence = usePresence(mergeProps$1(() => ({
|
|
35
|
+
present: resolved().swap ?? false,
|
|
36
|
+
lazyMount: resolved().lazyMount,
|
|
37
|
+
unmountOnExit: resolved().unmountOnExit,
|
|
38
|
+
skipAnimationOnMount: true
|
|
39
|
+
})));
|
|
40
|
+
const offPresence = usePresence(mergeProps$1(() => ({
|
|
41
|
+
present: !(resolved().swap ?? false),
|
|
42
|
+
lazyMount: resolved().lazyMount,
|
|
43
|
+
unmountOnExit: resolved().unmountOnExit,
|
|
44
|
+
skipAnimationOnMount: true
|
|
45
|
+
})));
|
|
46
|
+
return createMemo(() => {
|
|
47
|
+
const swap = resolved().swap ?? false;
|
|
48
|
+
return {
|
|
49
|
+
swap,
|
|
50
|
+
onPresence,
|
|
51
|
+
offPresence,
|
|
52
|
+
getRootProps() {
|
|
53
|
+
return {
|
|
54
|
+
...parts.root.attrs,
|
|
55
|
+
"data-swap": swap ? "on" : "off",
|
|
56
|
+
style: { display: "inline-grid" }
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
getIndicatorProps({ type }) {
|
|
60
|
+
const presence = type === "on" ? onPresence() : offPresence();
|
|
61
|
+
return {
|
|
62
|
+
...parts.indicator.attrs,
|
|
63
|
+
...presence.presenceProps,
|
|
64
|
+
"data-type": type,
|
|
65
|
+
style: {
|
|
66
|
+
"grid-area": "1 / 1",
|
|
67
|
+
display: "inline-flex"
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/components/swap/root.tsx
|
|
76
|
+
const SwapRoot = (props) => {
|
|
77
|
+
const [swapProps, localProps] = splitProps(props, [
|
|
78
|
+
"swap",
|
|
79
|
+
"lazyMount",
|
|
80
|
+
"unmountOnExit"
|
|
81
|
+
]);
|
|
82
|
+
const swap = useSwap(() => swapProps);
|
|
83
|
+
const mergedProps = mergeProps$1(() => swap().getRootProps(), localProps);
|
|
84
|
+
return <SwapProvider value={swap}>
|
|
85
|
+
<wire.span {...mergedProps} />
|
|
86
|
+
</SwapProvider>;
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/components/swap/root-provider.tsx
|
|
90
|
+
const SwapRootProvider = (props) => {
|
|
91
|
+
const [providerProps, localProps] = splitProps(props, ["value"]);
|
|
92
|
+
const mergedProps = mergeProps$1(() => providerProps.value().getRootProps(), localProps);
|
|
93
|
+
return <SwapProvider value={providerProps.value}>
|
|
94
|
+
<wire.span {...mergedProps} />
|
|
95
|
+
</SwapProvider>;
|
|
96
|
+
};
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/components/swap/swap.ts
|
|
99
|
+
var swap_exports = /* @__PURE__ */ __exportAll({
|
|
100
|
+
Indicator: () => SwapIndicator,
|
|
101
|
+
Root: () => SwapRoot,
|
|
102
|
+
RootProvider: () => SwapRootProvider,
|
|
103
|
+
swapAnatomy: () => swapAnatomy
|
|
104
|
+
});
|
|
105
|
+
//#endregion
|
|
106
|
+
export { swap_exports as Swap, SwapIndicator, SwapRoot, SwapRootProvider, swapAnatomy, useSwap, useSwapContext };
|