@wirekyt/react 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.cjs +209 -0
- package/dist/accordion.d.cts +69 -0
- package/dist/accordion.d.ts +69 -0
- package/dist/accordion.js +184 -0
- package/dist/angle-slider.cjs +193 -0
- package/dist/angle-slider.d.cts +73 -0
- package/dist/angle-slider.d.ts +73 -0
- package/dist/angle-slider.js +168 -0
- package/dist/avatar.cjs +120 -0
- package/dist/avatar.d.cts +48 -0
- package/dist/avatar.d.ts +48 -0
- package/dist/avatar.js +100 -0
- package/dist/carousel.cjs +246 -0
- package/dist/carousel.d.cts +94 -0
- package/dist/carousel.d.ts +94 -0
- package/dist/carousel.js +223 -0
- package/dist/checkbox.cjs +284 -0
- package/dist/checkbox.d.cts +115 -0
- package/dist/checkbox.d.ts +115 -0
- package/dist/checkbox.js +263 -0
- package/dist/client-only.cjs +12 -0
- package/dist/client-only.d.cts +8 -0
- package/dist/client-only.d.ts +8 -0
- package/dist/client-only.js +11 -0
- package/dist/clipboard.cjs +174 -0
- package/dist/clipboard.d.cts +70 -0
- package/dist/clipboard.d.ts +70 -0
- package/dist/clipboard.js +150 -0
- package/dist/collapsible-B62i_oPJ.cjs +185 -0
- package/dist/collapsible-CiTNjCNf.js +131 -0
- package/dist/collapsible.cjs +23 -0
- package/dist/collapsible.d.cts +56 -0
- package/dist/collapsible.d.ts +56 -0
- package/dist/collapsible.js +2 -0
- package/dist/collection-BFjWNdUS.cjs +223 -0
- package/dist/collection-BJOl6a4H.js +180 -0
- package/dist/collection.cjs +9 -0
- package/dist/collection.d.cts +2 -0
- package/dist/collection.d.ts +2 -0
- package/dist/collection.js +2 -0
- package/dist/color-picker.cjs +575 -0
- package/dist/color-picker.d.cts +179 -0
- package/dist/color-picker.d.ts +179 -0
- package/dist/color-picker.js +530 -0
- package/dist/combobox.cjs +390 -0
- package/dist/combobox.d.cts +128 -0
- package/dist/combobox.d.ts +128 -0
- package/dist/combobox.js +359 -0
- package/dist/core-CBFAnVIP.cjs +375 -0
- package/dist/core-CEYOEcVI.js +357 -0
- package/dist/date-input.cjs +217 -0
- package/dist/date-input.d.cts +69 -0
- package/dist/date-input.d.ts +69 -0
- package/dist/date-input.js +193 -0
- package/dist/date-picker.cjs +588 -0
- package/dist/date-picker.d.cts +190 -0
- package/dist/date-picker.d.ts +190 -0
- package/dist/date-picker.js +543 -0
- package/dist/dialog.cjs +199 -0
- package/dist/dialog.d.cts +78 -0
- package/dist/dialog.d.ts +78 -0
- package/dist/dialog.js +174 -0
- package/dist/download-trigger.cjs +53 -0
- package/dist/download-trigger.d.cts +22 -0
- package/dist/download-trigger.d.ts +22 -0
- package/dist/download-trigger.js +51 -0
- package/dist/drawer.cjs +296 -0
- package/dist/drawer.d.cts +115 -0
- package/dist/drawer.d.ts +115 -0
- package/dist/drawer.js +264 -0
- package/dist/editable.cjs +228 -0
- package/dist/editable.d.cts +79 -0
- package/dist/editable.d.ts +79 -0
- package/dist/editable.js +202 -0
- package/dist/environment-B6IaCAuQ.cjs +59 -0
- package/dist/environment-BTgKwk5E.js +42 -0
- package/dist/factory--dkoVnFK.d.cts +14 -0
- package/dist/factory--dkoVnFK.d.ts +14 -0
- package/dist/factory-CFFufs5e.cjs +59 -0
- package/dist/factory-Nm__-4xn.js +48 -0
- package/dist/field-Cy1E02DH.js +349 -0
- package/dist/field-x8H5uXB9.cjs +438 -0
- package/dist/field.cjs +22 -0
- package/dist/field.d.cts +129 -0
- package/dist/field.d.ts +129 -0
- package/dist/field.js +2 -0
- package/dist/fieldset-DWZXj1t5.cjs +232 -0
- package/dist/fieldset-fx44GCtM.js +178 -0
- package/dist/fieldset.cjs +18 -0
- package/dist/fieldset.d.cts +71 -0
- package/dist/fieldset.d.ts +71 -0
- package/dist/fieldset.js +3 -0
- package/dist/file-upload.cjs +328 -0
- package/dist/file-upload.d.cts +101 -0
- package/dist/file-upload.d.ts +101 -0
- package/dist/file-upload.js +298 -0
- package/dist/floating-panel.cjs +271 -0
- package/dist/floating-panel.d.cts +98 -0
- package/dist/floating-panel.d.ts +98 -0
- package/dist/floating-panel.js +242 -0
- package/dist/format.cjs +64 -0
- package/dist/format.d.cts +44 -0
- package/dist/format.d.ts +44 -0
- package/dist/format.js +54 -0
- package/dist/frame.cjs +85 -0
- package/dist/frame.d.cts +12 -0
- package/dist/frame.d.ts +12 -0
- package/dist/frame.js +84 -0
- package/dist/highlight.cjs +29 -0
- package/dist/highlight.d.cts +13 -0
- package/dist/highlight.d.ts +13 -0
- package/dist/highlight.js +27 -0
- package/dist/hover-card.cjs +154 -0
- package/dist/hover-card.d.cts +68 -0
- package/dist/hover-card.d.ts +68 -0
- package/dist/hover-card.js +131 -0
- package/dist/image-cropper.cjs +0 -0
- package/dist/image-cropper.d.cts +1 -0
- package/dist/image-cropper.d.ts +1 -0
- package/dist/image-cropper.js +0 -0
- package/dist/index-3Al0R5bH.d.cts +73 -0
- package/dist/index-B7wAg5Wf.d.ts +146 -0
- package/dist/index-BAn8qiCM.d.ts +73 -0
- package/dist/index-BSX88T_g.d.cts +146 -0
- package/dist/index-CQAbOgb7.d.cts +23 -0
- package/dist/index-CW-Aj6aT.d.ts +95 -0
- package/dist/index-CxWYgVJk.d.ts +23 -0
- package/dist/index-DRnET7mJ.d.ts +33 -0
- package/dist/index-DTLK6Fuh.d.cts +95 -0
- package/dist/index-DyTY8HEb.d.cts +33 -0
- package/dist/index-srZfUQNt.d.cts +20 -0
- package/dist/index-srZfUQNt.d.ts +20 -0
- package/dist/index.cjs +45 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/json-tree-view.cjs +244 -0
- package/dist/json-tree-view.d.cts +45 -0
- package/dist/json-tree-view.d.ts +45 -0
- package/dist/json-tree-view.js +234 -0
- package/dist/listbox.cjs +290 -0
- package/dist/listbox.d.cts +109 -0
- package/dist/listbox.d.ts +109 -0
- package/dist/listbox.js +264 -0
- package/dist/marquee.cjs +164 -0
- package/dist/marquee.d.cts +60 -0
- package/dist/marquee.d.ts +60 -0
- package/dist/marquee.js +142 -0
- package/dist/menu.cjs +506 -0
- package/dist/menu.d.cts +162 -0
- package/dist/menu.d.ts +162 -0
- package/dist/menu.js +469 -0
- package/dist/navigation-menu.cjs +331 -0
- package/dist/navigation-menu.d.cts +89 -0
- package/dist/navigation-menu.d.ts +89 -0
- package/dist/navigation-menu.js +303 -0
- package/dist/number-input.cjs +222 -0
- package/dist/number-input.d.cts +73 -0
- package/dist/number-input.d.ts +73 -0
- package/dist/number-input.js +197 -0
- package/dist/pagination.cjs +183 -0
- package/dist/pagination.d.cts +68 -0
- package/dist/pagination.d.ts +68 -0
- package/dist/pagination.js +159 -0
- package/dist/password-input.cjs +179 -0
- package/dist/password-input.d.cts +65 -0
- package/dist/password-input.d.ts +65 -0
- package/dist/password-input.js +156 -0
- package/dist/pin-input.cjs +180 -0
- package/dist/pin-input.d.cts +58 -0
- package/dist/pin-input.d.ts +58 -0
- package/dist/pin-input.js +158 -0
- package/dist/popover.cjs +222 -0
- package/dist/popover.d.cts +93 -0
- package/dist/popover.d.ts +93 -0
- package/dist/popover.js +194 -0
- package/dist/portal-6_XzBXiA.cjs +33 -0
- package/dist/portal-QYL_2wB0.js +28 -0
- package/dist/portal.cjs +3 -0
- package/dist/portal.d.cts +9 -0
- package/dist/portal.d.ts +9 -0
- package/dist/portal.js +2 -0
- package/dist/presence-BOs-D6Cv.cjs +96 -0
- package/dist/presence-I8Rceflw.js +65 -0
- package/dist/presence.cjs +7 -0
- package/dist/presence.d.cts +2 -0
- package/dist/presence.d.ts +2 -0
- package/dist/presence.js +2 -0
- package/dist/progress.cjs +206 -0
- package/dist/progress.d.cts +78 -0
- package/dist/progress.d.ts +78 -0
- package/dist/progress.js +180 -0
- package/dist/providers-DrJEJcrE.cjs +128 -0
- package/dist/providers-FEHnDTvb.js +87 -0
- package/dist/qr-code.cjs +154 -0
- package/dist/qr-code.d.cts +58 -0
- package/dist/qr-code.d.ts +58 -0
- package/dist/qr-code.js +132 -0
- package/dist/radio-group.cjs +222 -0
- package/dist/radio-group.d.cts +78 -0
- package/dist/radio-group.d.ts +78 -0
- package/dist/radio-group.js +196 -0
- package/dist/rating-group.cjs +186 -0
- package/dist/rating-group.d.cts +68 -0
- package/dist/rating-group.d.ts +68 -0
- package/dist/rating-group.js +162 -0
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/rolldown-runtime-DakpK96I.cjs +43 -0
- package/dist/scroll-area.cjs +166 -0
- package/dist/scroll-area.d.cts +67 -0
- package/dist/scroll-area.d.ts +67 -0
- package/dist/scroll-area.js +143 -0
- package/dist/segment-group.cjs +215 -0
- package/dist/segment-group.d.cts +81 -0
- package/dist/segment-group.d.ts +81 -0
- package/dist/segment-group.js +194 -0
- package/dist/select.cjs +395 -0
- package/dist/select.d.cts +132 -0
- package/dist/select.d.ts +132 -0
- package/dist/select.js +358 -0
- package/dist/signature-pad.cjs +197 -0
- package/dist/signature-pad.d.cts +68 -0
- package/dist/signature-pad.d.ts +68 -0
- package/dist/signature-pad.js +173 -0
- package/dist/slider.cjs +260 -0
- package/dist/slider.d.cts +88 -0
- package/dist/slider.d.ts +88 -0
- package/dist/slider.js +232 -0
- package/dist/steps.cjs +271 -0
- package/dist/steps.d.cts +104 -0
- package/dist/steps.d.ts +104 -0
- package/dist/steps.js +241 -0
- package/dist/swap.cjs +134 -0
- package/dist/swap.d.cts +49 -0
- package/dist/swap.d.ts +49 -0
- package/dist/swap.js +121 -0
- package/dist/switch.cjs +166 -0
- package/dist/switch.d.cts +58 -0
- package/dist/switch.d.ts +58 -0
- package/dist/switch.js +144 -0
- package/dist/tabs.cjs +177 -0
- package/dist/tabs.d.cts +59 -0
- package/dist/tabs.d.ts +59 -0
- package/dist/tabs.js +155 -0
- package/dist/tags-input.cjs +298 -0
- package/dist/tags-input.d.cts +98 -0
- package/dist/tags-input.d.ts +98 -0
- package/dist/tags-input.js +268 -0
- package/dist/timer.cjs +167 -0
- package/dist/timer.d.cts +63 -0
- package/dist/timer.d.ts +63 -0
- package/dist/timer.js +144 -0
- package/dist/toast.cjs +154 -0
- package/dist/toast.d.cts +59 -0
- package/dist/toast.d.ts +59 -0
- package/dist/toast.js +132 -0
- package/dist/toggle-group.cjs +118 -0
- package/dist/toggle-group.d.cts +43 -0
- package/dist/toggle-group.d.ts +43 -0
- package/dist/toggle-group.js +99 -0
- package/dist/toggle.cjs +85 -0
- package/dist/toggle.d.cts +38 -0
- package/dist/toggle.d.ts +38 -0
- package/dist/toggle.js +71 -0
- package/dist/tooltip.cjs +154 -0
- package/dist/tooltip.d.cts +68 -0
- package/dist/tooltip.d.ts +68 -0
- package/dist/tooltip.js +131 -0
- package/dist/tour.cjs +290 -0
- package/dist/tour.d.cts +112 -0
- package/dist/tour.d.ts +112 -0
- package/dist/tour.js +246 -0
- package/dist/tree-view-CNTEWXlu.js +339 -0
- package/dist/tree-view-CU4Hl5X1.cjs +484 -0
- package/dist/tree-view.cjs +41 -0
- package/dist/tree-view.d.cts +3 -0
- package/dist/tree-view.d.ts +3 -0
- package/dist/tree-view.js +3 -0
- package/dist/types-BQQfrr86.d.cts +6 -0
- package/dist/types-BQQfrr86.d.ts +6 -0
- package/dist/use-context-38DKWHsx.cjs +20 -0
- package/dist/use-context-CITa6pn9.js +10 -0
- package/dist/utils-Cfwm9WW1.cjs +166 -0
- package/dist/utils-CqLmqrgj.js +107 -0
- package/package.json +274 -6
package/dist/steps.js
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { c as createSplitProps, u as createContext$1 } from "./utils-CqLmqrgj.js";
|
|
3
|
+
import { n as useEnvironmentContext } from "./environment-BTgKwk5E.js";
|
|
4
|
+
import { a as useMachine, i as normalizeProps, t as mergeProps } from "./core-CEYOEcVI.js";
|
|
5
|
+
import { n as wire } from "./factory-Nm__-4xn.js";
|
|
6
|
+
import { a as useLocaleContext } from "./providers-FEHnDTvb.js";
|
|
7
|
+
import { forwardRef, useId } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
import * as steps from "@wirekyt/dom/machines/steps";
|
|
10
|
+
import { anatomy as stepsAnatomy } from "@wirekyt/dom/machines/steps";
|
|
11
|
+
//#region src/components/steps/use-context.ts
|
|
12
|
+
const [StepsProvider, useStepsContext] = createContext$1({
|
|
13
|
+
name: "StepsContext",
|
|
14
|
+
hookName: "useStepsContext",
|
|
15
|
+
providerName: "<StepsProvider />"
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/steps/completed-content.tsx
|
|
19
|
+
const StepsCompletedContent = forwardRef((props, ref) => {
|
|
20
|
+
const steps = useStepsContext();
|
|
21
|
+
const mergedProps = mergeProps(steps.getContentProps({ index: steps.count }), props);
|
|
22
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
23
|
+
...mergedProps,
|
|
24
|
+
ref
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
StepsCompletedContent.displayName = "StepsCompletedContent";
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/steps/content.tsx
|
|
30
|
+
const splitContentProps = createSplitProps();
|
|
31
|
+
const StepsContent = forwardRef((props, ref) => {
|
|
32
|
+
const [itemProps, localProps] = splitContentProps(props, ["index"]);
|
|
33
|
+
const mergedProps = mergeProps(useStepsContext().getContentProps(itemProps), localProps);
|
|
34
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
35
|
+
...mergedProps,
|
|
36
|
+
ref
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
StepsContent.displayName = "StepsContent";
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/components/steps/context.tsx
|
|
42
|
+
const StepsContext = (props) => {
|
|
43
|
+
const context = useStepsContext();
|
|
44
|
+
return props.children(context);
|
|
45
|
+
};
|
|
46
|
+
StepsContext.displayName = "StepsContext";
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/components/steps/use-item-props-context.ts
|
|
49
|
+
const [StepsItemPropsProvider, useStepsItemPropsContext] = createContext$1({
|
|
50
|
+
name: "StepsItemPropsContext",
|
|
51
|
+
hookName: "useStepsItemPropsContext",
|
|
52
|
+
providerName: "<StepsItemPropsProvider />"
|
|
53
|
+
});
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/components/steps/indicator.tsx
|
|
56
|
+
const StepsIndicator = forwardRef((props, ref) => {
|
|
57
|
+
const steps = useStepsContext();
|
|
58
|
+
const itemProps = useStepsItemPropsContext();
|
|
59
|
+
const mergedProps = mergeProps(steps.getIndicatorProps(itemProps), props);
|
|
60
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
61
|
+
...mergedProps,
|
|
62
|
+
ref
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
StepsIndicator.displayName = "StepsIndicator";
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/components/steps/use-item-context.ts
|
|
68
|
+
const [StepsItemProvider, useStepsItemContext] = createContext$1({
|
|
69
|
+
name: "StepsItemContext",
|
|
70
|
+
hookName: "useStepsItemContext",
|
|
71
|
+
providerName: "<StepsItem />"
|
|
72
|
+
});
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/components/steps/item.tsx
|
|
75
|
+
const splitItemProps = createSplitProps();
|
|
76
|
+
const StepsItem = forwardRef((props, ref) => {
|
|
77
|
+
const [itemProps, localProps] = splitItemProps(props, ["index"]);
|
|
78
|
+
const steps = useStepsContext();
|
|
79
|
+
const mergedProps = mergeProps(steps.getItemProps(itemProps), localProps);
|
|
80
|
+
return /* @__PURE__ */ jsx(StepsItemPropsProvider, {
|
|
81
|
+
value: itemProps,
|
|
82
|
+
children: /* @__PURE__ */ jsx(StepsItemProvider, {
|
|
83
|
+
value: steps.getItemState(itemProps),
|
|
84
|
+
children: /* @__PURE__ */ jsx(wire.div, {
|
|
85
|
+
...mergedProps,
|
|
86
|
+
ref
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
StepsItem.displayName = "StepsItem";
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/components/steps/item-context.tsx
|
|
94
|
+
const StepsItemContext = (props) => {
|
|
95
|
+
return props.children(useStepsItemContext());
|
|
96
|
+
};
|
|
97
|
+
StepsItemContext.displayName = "StepsItemContext";
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/components/steps/list.tsx
|
|
100
|
+
const StepsList = forwardRef((props, ref) => {
|
|
101
|
+
const mergedProps = mergeProps(useStepsContext().getListProps(), props);
|
|
102
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
103
|
+
...mergedProps,
|
|
104
|
+
ref
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
StepsList.displayName = "StepsList";
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/components/steps/next-trigger.tsx
|
|
110
|
+
const StepsNextTrigger = forwardRef((props, ref) => {
|
|
111
|
+
const mergedProps = mergeProps(useStepsContext().getNextTriggerProps(), props);
|
|
112
|
+
return /* @__PURE__ */ jsx(wire.button, {
|
|
113
|
+
...mergedProps,
|
|
114
|
+
ref
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
StepsNextTrigger.displayName = "StepsNextTrigger";
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/components/steps/prev-trigger.tsx
|
|
120
|
+
const StepsPrevTrigger = forwardRef((props, ref) => {
|
|
121
|
+
const mergedProps = mergeProps(useStepsContext().getPrevTriggerProps(), props);
|
|
122
|
+
return /* @__PURE__ */ jsx(wire.button, {
|
|
123
|
+
...mergedProps,
|
|
124
|
+
ref
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
StepsPrevTrigger.displayName = "StepsPrevTrigger";
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/components/steps/progress.tsx
|
|
130
|
+
const StepsProgress = forwardRef((props, ref) => {
|
|
131
|
+
const mergedProps = mergeProps(useStepsContext().getProgressProps(), props);
|
|
132
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
133
|
+
...mergedProps,
|
|
134
|
+
ref
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
StepsProgress.displayName = "StepsProgress";
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/components/steps/use.ts
|
|
140
|
+
function useSteps(props) {
|
|
141
|
+
const id = useId();
|
|
142
|
+
const { getRootNode } = useEnvironmentContext();
|
|
143
|
+
const { dir } = useLocaleContext();
|
|
144
|
+
const machineProps = {
|
|
145
|
+
id,
|
|
146
|
+
dir,
|
|
147
|
+
getRootNode,
|
|
148
|
+
...props
|
|
149
|
+
};
|
|
150
|
+
const service = useMachine(steps.machine, machineProps);
|
|
151
|
+
return steps.connect(service, normalizeProps);
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region src/components/steps/root.tsx
|
|
155
|
+
const splitRootProps = createSplitProps();
|
|
156
|
+
const StepsRoot = forwardRef((props, ref) => {
|
|
157
|
+
const [useStepsProps, localProps] = splitRootProps(props, [
|
|
158
|
+
"count",
|
|
159
|
+
"defaultStep",
|
|
160
|
+
"id",
|
|
161
|
+
"ids",
|
|
162
|
+
"isStepSkippable",
|
|
163
|
+
"isStepValid",
|
|
164
|
+
"linear",
|
|
165
|
+
"onStepChange",
|
|
166
|
+
"onStepComplete",
|
|
167
|
+
"onStepInvalid",
|
|
168
|
+
"orientation",
|
|
169
|
+
"step"
|
|
170
|
+
]);
|
|
171
|
+
const steps = useSteps(useStepsProps);
|
|
172
|
+
const mergedProps = mergeProps(steps.getRootProps(), localProps);
|
|
173
|
+
return /* @__PURE__ */ jsx(StepsProvider, {
|
|
174
|
+
value: steps,
|
|
175
|
+
children: /* @__PURE__ */ jsx(wire.div, {
|
|
176
|
+
...mergedProps,
|
|
177
|
+
ref
|
|
178
|
+
})
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
StepsRoot.displayName = "StepsRoot";
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/components/steps/root-provider.tsx
|
|
184
|
+
const splitRootProviderProps = createSplitProps();
|
|
185
|
+
const StepsRootProvider = forwardRef((props, ref) => {
|
|
186
|
+
const [{ value: steps }, rootProps] = splitRootProviderProps(props, ["value"]);
|
|
187
|
+
const mergedProps = mergeProps(steps.getRootProps(), rootProps);
|
|
188
|
+
return /* @__PURE__ */ jsx(StepsProvider, {
|
|
189
|
+
value: steps,
|
|
190
|
+
children: /* @__PURE__ */ jsx(wire.div, {
|
|
191
|
+
...mergedProps,
|
|
192
|
+
ref,
|
|
193
|
+
children: props.children
|
|
194
|
+
})
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
StepsRootProvider.displayName = "StepsRootProvider";
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/components/steps/separator.tsx
|
|
200
|
+
const StepsSeparator = forwardRef((props, ref) => {
|
|
201
|
+
const steps = useStepsContext();
|
|
202
|
+
const itemProps = useStepsItemPropsContext();
|
|
203
|
+
const mergedProps = mergeProps(steps.getSeparatorProps(itemProps), props);
|
|
204
|
+
return /* @__PURE__ */ jsx(wire.div, {
|
|
205
|
+
...mergedProps,
|
|
206
|
+
ref
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
StepsSeparator.displayName = "StepsSeparator";
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region src/components/steps/trigger.tsx
|
|
212
|
+
const StepsTrigger = forwardRef((props, ref) => {
|
|
213
|
+
const steps = useStepsContext();
|
|
214
|
+
const itemProps = useStepsItemPropsContext();
|
|
215
|
+
const mergedProps = mergeProps(steps.getTriggerProps(itemProps), props);
|
|
216
|
+
return /* @__PURE__ */ jsx(wire.button, {
|
|
217
|
+
...mergedProps,
|
|
218
|
+
ref
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
StepsTrigger.displayName = "StepsTrigger";
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/components/steps/steps.ts
|
|
224
|
+
var steps_exports = /* @__PURE__ */ __exportAll({
|
|
225
|
+
CompletedContent: () => StepsCompletedContent,
|
|
226
|
+
Content: () => StepsContent,
|
|
227
|
+
Context: () => StepsContext,
|
|
228
|
+
Indicator: () => StepsIndicator,
|
|
229
|
+
Item: () => StepsItem,
|
|
230
|
+
ItemContext: () => StepsItemContext,
|
|
231
|
+
List: () => StepsList,
|
|
232
|
+
NextTrigger: () => StepsNextTrigger,
|
|
233
|
+
PrevTrigger: () => StepsPrevTrigger,
|
|
234
|
+
Progress: () => StepsProgress,
|
|
235
|
+
Root: () => StepsRoot,
|
|
236
|
+
RootProvider: () => StepsRootProvider,
|
|
237
|
+
Separator: () => StepsSeparator,
|
|
238
|
+
Trigger: () => StepsTrigger
|
|
239
|
+
});
|
|
240
|
+
//#endregion
|
|
241
|
+
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.cjs
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_rolldown_runtime = require("./rolldown-runtime-DakpK96I.cjs");
|
|
3
|
+
const require_utils = require("./utils-Cfwm9WW1.cjs");
|
|
4
|
+
require("./core-CBFAnVIP.cjs");
|
|
5
|
+
const require_factory = require("./factory-CFFufs5e.cjs");
|
|
6
|
+
const require_presence = require("./presence-BOs-D6Cv.cjs");
|
|
7
|
+
let react = require("react");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
let _wirekyt_dom_anatomy = require("@wirekyt/dom/anatomy");
|
|
10
|
+
let _wirekyt_dom = require("@wirekyt/dom");
|
|
11
|
+
//#region src/components/swap/use-context.ts
|
|
12
|
+
const [SwapProvider, useSwapContext] = require_utils.createContext({
|
|
13
|
+
name: "SwapContext",
|
|
14
|
+
hookName: "useSwapContext",
|
|
15
|
+
providerName: "<SwapProvider />"
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/swap/indicator.tsx
|
|
19
|
+
const SwapIndicator = (0, react.forwardRef)((props, ref) => {
|
|
20
|
+
const { type, ...restProps } = props;
|
|
21
|
+
const swap = useSwapContext();
|
|
22
|
+
const presence = type === "on" ? swap.onPresence : swap.offPresence;
|
|
23
|
+
const composedRefs = require_utils.useComposedRefs(presence.ref, ref);
|
|
24
|
+
if (presence.unmounted) return null;
|
|
25
|
+
const mergedProps = (0, _wirekyt_dom.mergeProps)(swap.getIndicatorProps({ type }), restProps);
|
|
26
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.wire.span, {
|
|
27
|
+
...mergedProps,
|
|
28
|
+
ref: composedRefs
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
SwapIndicator.displayName = "SwapIndicator";
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/swap/anatomy.ts
|
|
34
|
+
const swapAnatomy = (0, _wirekyt_dom_anatomy.createAnatomy)("swap", ["root", "indicator"]);
|
|
35
|
+
const parts = swapAnatomy.build();
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/components/swap/use.ts
|
|
38
|
+
const useSwap = (props = {}) => {
|
|
39
|
+
const { swap = false, lazyMount, unmountOnExit } = props;
|
|
40
|
+
const presenceProps = {
|
|
41
|
+
lazyMount,
|
|
42
|
+
unmountOnExit
|
|
43
|
+
};
|
|
44
|
+
const onPresence = require_presence.usePresence({
|
|
45
|
+
present: swap,
|
|
46
|
+
...presenceProps,
|
|
47
|
+
skipAnimationOnMount: true
|
|
48
|
+
});
|
|
49
|
+
const offPresence = require_presence.usePresence({
|
|
50
|
+
present: !swap,
|
|
51
|
+
...presenceProps,
|
|
52
|
+
skipAnimationOnMount: true
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
swap,
|
|
56
|
+
onPresence,
|
|
57
|
+
offPresence,
|
|
58
|
+
getRootProps() {
|
|
59
|
+
return {
|
|
60
|
+
...parts.root.attrs,
|
|
61
|
+
"data-swap": swap ? "on" : "off",
|
|
62
|
+
style: { display: "inline-grid" }
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
getIndicatorProps({ type }) {
|
|
66
|
+
const presence = type === "on" ? onPresence : offPresence;
|
|
67
|
+
return {
|
|
68
|
+
...parts.indicator.attrs,
|
|
69
|
+
...presence.getPresenceProps(),
|
|
70
|
+
"data-type": type,
|
|
71
|
+
style: {
|
|
72
|
+
gridArea: "1 / 1",
|
|
73
|
+
display: "inline-flex"
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/components/swap/root.tsx
|
|
81
|
+
const SwapRoot = (0, react.forwardRef)((props, ref) => {
|
|
82
|
+
const { children, swap: swapProp, lazyMount, unmountOnExit, ...restProps } = props;
|
|
83
|
+
const swap = useSwap({
|
|
84
|
+
swap: swapProp,
|
|
85
|
+
lazyMount,
|
|
86
|
+
unmountOnExit
|
|
87
|
+
});
|
|
88
|
+
const mergedProps = (0, _wirekyt_dom.mergeProps)(swap.getRootProps(), restProps);
|
|
89
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SwapProvider, {
|
|
90
|
+
value: swap,
|
|
91
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.wire.span, {
|
|
92
|
+
...mergedProps,
|
|
93
|
+
ref,
|
|
94
|
+
children
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
SwapRoot.displayName = "SwapRoot";
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/components/swap/root-provider.tsx
|
|
101
|
+
const SwapRootProvider = (0, react.forwardRef)((props, ref) => {
|
|
102
|
+
const { value, children, ...restProps } = props;
|
|
103
|
+
const mergedProps = (0, _wirekyt_dom.mergeProps)(value.getRootProps(), restProps);
|
|
104
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SwapProvider, {
|
|
105
|
+
value,
|
|
106
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.wire.span, {
|
|
107
|
+
...mergedProps,
|
|
108
|
+
ref,
|
|
109
|
+
children
|
|
110
|
+
})
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
SwapRootProvider.displayName = "SwapRootProvider";
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/components/swap/swap.ts
|
|
116
|
+
var swap_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
117
|
+
Indicator: () => SwapIndicator,
|
|
118
|
+
Root: () => SwapRoot,
|
|
119
|
+
RootProvider: () => SwapRootProvider,
|
|
120
|
+
swapAnatomy: () => swapAnatomy
|
|
121
|
+
});
|
|
122
|
+
//#endregion
|
|
123
|
+
Object.defineProperty(exports, "Swap", {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
get: function() {
|
|
126
|
+
return swap_exports;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
exports.SwapIndicator = SwapIndicator;
|
|
130
|
+
exports.SwapRoot = SwapRoot;
|
|
131
|
+
exports.SwapRootProvider = SwapRootProvider;
|
|
132
|
+
exports.swapAnatomy = swapAnatomy;
|
|
133
|
+
exports.useSwap = useSwap;
|
|
134
|
+
exports.useSwapContext = useSwapContext;
|
package/dist/swap.d.cts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { r as PolymorphicProps, t as HTMLProps } from "./factory--dkoVnFK.cjs";
|
|
2
|
+
import { r as RenderStrategyProps } from "./index-srZfUQNt.cjs";
|
|
3
|
+
import { l as UsePresenceReturn } from "./index-DyTY8HEb.cjs";
|
|
4
|
+
//#region src/components/swap/indicator.d.ts
|
|
5
|
+
interface SwapIndicatorBaseProps extends PolymorphicProps {
|
|
6
|
+
type: "on" | "off";
|
|
7
|
+
}
|
|
8
|
+
interface SwapIndicatorProps extends HTMLProps<"span">, SwapIndicatorBaseProps {}
|
|
9
|
+
declare const SwapIndicator: import("react").ForwardRefExoticComponent<SwapIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/swap/use.d.ts
|
|
12
|
+
interface UseSwapProps extends RenderStrategyProps {
|
|
13
|
+
swap?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface IndicatorProps {
|
|
16
|
+
type: "on" | "off";
|
|
17
|
+
}
|
|
18
|
+
interface UseSwapReturn {
|
|
19
|
+
swap: boolean;
|
|
20
|
+
onPresence: UsePresenceReturn;
|
|
21
|
+
offPresence: UsePresenceReturn;
|
|
22
|
+
getRootProps: () => HTMLProps<"span">;
|
|
23
|
+
getIndicatorProps: (props: IndicatorProps) => HTMLProps<"span">;
|
|
24
|
+
}
|
|
25
|
+
declare const useSwap: (props?: UseSwapProps) => UseSwapReturn;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/components/swap/root.d.ts
|
|
28
|
+
interface SwapRootBaseProps extends UseSwapProps, PolymorphicProps {}
|
|
29
|
+
interface SwapRootProps extends HTMLProps<"span">, SwapRootBaseProps {}
|
|
30
|
+
declare const SwapRoot: import("react").ForwardRefExoticComponent<SwapRootProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/swap/root-provider.d.ts
|
|
33
|
+
interface SwapRootProviderBaseProps extends PolymorphicProps {
|
|
34
|
+
value: UseSwapReturn;
|
|
35
|
+
}
|
|
36
|
+
interface SwapRootProviderProps extends HTMLProps<"span">, SwapRootProviderBaseProps {}
|
|
37
|
+
declare const SwapRootProvider: import("react").ForwardRefExoticComponent<SwapRootProviderProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/components/swap/anatomy.d.ts
|
|
40
|
+
declare const swapAnatomy: import("@wirekyt/dom/anatomy").Anatomy<"root" | "indicator">;
|
|
41
|
+
declare namespace swap_d_exports {
|
|
42
|
+
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 };
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/components/swap/use-context.d.ts
|
|
46
|
+
interface UseSwapContext extends UseSwapReturn {}
|
|
47
|
+
declare const SwapProvider: import("react").Provider<UseSwapContext>, useSwapContext: () => UseSwapContext;
|
|
48
|
+
//#endregion
|
|
49
|
+
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.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { r as PolymorphicProps, t as HTMLProps } from "./factory--dkoVnFK.js";
|
|
2
|
+
import { r as RenderStrategyProps } from "./index-srZfUQNt.js";
|
|
3
|
+
import { l as UsePresenceReturn } from "./index-DRnET7mJ.js";
|
|
4
|
+
//#region src/components/swap/indicator.d.ts
|
|
5
|
+
interface SwapIndicatorBaseProps extends PolymorphicProps {
|
|
6
|
+
type: "on" | "off";
|
|
7
|
+
}
|
|
8
|
+
interface SwapIndicatorProps extends HTMLProps<"span">, SwapIndicatorBaseProps {}
|
|
9
|
+
declare const SwapIndicator: import("react").ForwardRefExoticComponent<SwapIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/swap/use.d.ts
|
|
12
|
+
interface UseSwapProps extends RenderStrategyProps {
|
|
13
|
+
swap?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface IndicatorProps {
|
|
16
|
+
type: "on" | "off";
|
|
17
|
+
}
|
|
18
|
+
interface UseSwapReturn {
|
|
19
|
+
swap: boolean;
|
|
20
|
+
onPresence: UsePresenceReturn;
|
|
21
|
+
offPresence: UsePresenceReturn;
|
|
22
|
+
getRootProps: () => HTMLProps<"span">;
|
|
23
|
+
getIndicatorProps: (props: IndicatorProps) => HTMLProps<"span">;
|
|
24
|
+
}
|
|
25
|
+
declare const useSwap: (props?: UseSwapProps) => UseSwapReturn;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/components/swap/root.d.ts
|
|
28
|
+
interface SwapRootBaseProps extends UseSwapProps, PolymorphicProps {}
|
|
29
|
+
interface SwapRootProps extends HTMLProps<"span">, SwapRootBaseProps {}
|
|
30
|
+
declare const SwapRoot: import("react").ForwardRefExoticComponent<SwapRootProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/swap/root-provider.d.ts
|
|
33
|
+
interface SwapRootProviderBaseProps extends PolymorphicProps {
|
|
34
|
+
value: UseSwapReturn;
|
|
35
|
+
}
|
|
36
|
+
interface SwapRootProviderProps extends HTMLProps<"span">, SwapRootProviderBaseProps {}
|
|
37
|
+
declare const SwapRootProvider: import("react").ForwardRefExoticComponent<SwapRootProviderProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/components/swap/anatomy.d.ts
|
|
40
|
+
declare const swapAnatomy: import("@wirekyt/dom/anatomy").Anatomy<"root" | "indicator">;
|
|
41
|
+
declare namespace swap_d_exports {
|
|
42
|
+
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 };
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/components/swap/use-context.d.ts
|
|
46
|
+
interface UseSwapContext extends UseSwapReturn {}
|
|
47
|
+
declare const SwapProvider: import("react").Provider<UseSwapContext>, useSwapContext: () => UseSwapContext;
|
|
48
|
+
//#endregion
|
|
49
|
+
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,121 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { l as useComposedRefs, u as createContext$1 } from "./utils-CqLmqrgj.js";
|
|
3
|
+
import { t as mergeProps } from "./core-CEYOEcVI.js";
|
|
4
|
+
import { n as wire } from "./factory-Nm__-4xn.js";
|
|
5
|
+
import { i as usePresence } from "./presence-I8Rceflw.js";
|
|
6
|
+
import { forwardRef } from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { createAnatomy } from "@wirekyt/dom/anatomy";
|
|
9
|
+
//#region src/components/swap/use-context.ts
|
|
10
|
+
const [SwapProvider, useSwapContext] = createContext$1({
|
|
11
|
+
name: "SwapContext",
|
|
12
|
+
hookName: "useSwapContext",
|
|
13
|
+
providerName: "<SwapProvider />"
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/components/swap/indicator.tsx
|
|
17
|
+
const SwapIndicator = forwardRef((props, ref) => {
|
|
18
|
+
const { type, ...restProps } = props;
|
|
19
|
+
const swap = useSwapContext();
|
|
20
|
+
const presence = type === "on" ? swap.onPresence : swap.offPresence;
|
|
21
|
+
const composedRefs = useComposedRefs(presence.ref, ref);
|
|
22
|
+
if (presence.unmounted) return null;
|
|
23
|
+
const mergedProps = mergeProps(swap.getIndicatorProps({ type }), restProps);
|
|
24
|
+
return /* @__PURE__ */ jsx(wire.span, {
|
|
25
|
+
...mergedProps,
|
|
26
|
+
ref: composedRefs
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
SwapIndicator.displayName = "SwapIndicator";
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/components/swap/anatomy.ts
|
|
32
|
+
const swapAnatomy = createAnatomy("swap", ["root", "indicator"]);
|
|
33
|
+
const parts = swapAnatomy.build();
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/components/swap/use.ts
|
|
36
|
+
const useSwap = (props = {}) => {
|
|
37
|
+
const { swap = false, lazyMount, unmountOnExit } = props;
|
|
38
|
+
const presenceProps = {
|
|
39
|
+
lazyMount,
|
|
40
|
+
unmountOnExit
|
|
41
|
+
};
|
|
42
|
+
const onPresence = usePresence({
|
|
43
|
+
present: swap,
|
|
44
|
+
...presenceProps,
|
|
45
|
+
skipAnimationOnMount: true
|
|
46
|
+
});
|
|
47
|
+
const offPresence = usePresence({
|
|
48
|
+
present: !swap,
|
|
49
|
+
...presenceProps,
|
|
50
|
+
skipAnimationOnMount: true
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
swap,
|
|
54
|
+
onPresence,
|
|
55
|
+
offPresence,
|
|
56
|
+
getRootProps() {
|
|
57
|
+
return {
|
|
58
|
+
...parts.root.attrs,
|
|
59
|
+
"data-swap": swap ? "on" : "off",
|
|
60
|
+
style: { display: "inline-grid" }
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
getIndicatorProps({ type }) {
|
|
64
|
+
const presence = type === "on" ? onPresence : offPresence;
|
|
65
|
+
return {
|
|
66
|
+
...parts.indicator.attrs,
|
|
67
|
+
...presence.getPresenceProps(),
|
|
68
|
+
"data-type": type,
|
|
69
|
+
style: {
|
|
70
|
+
gridArea: "1 / 1",
|
|
71
|
+
display: "inline-flex"
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/components/swap/root.tsx
|
|
79
|
+
const SwapRoot = forwardRef((props, ref) => {
|
|
80
|
+
const { children, swap: swapProp, lazyMount, unmountOnExit, ...restProps } = props;
|
|
81
|
+
const swap = useSwap({
|
|
82
|
+
swap: swapProp,
|
|
83
|
+
lazyMount,
|
|
84
|
+
unmountOnExit
|
|
85
|
+
});
|
|
86
|
+
const mergedProps = mergeProps(swap.getRootProps(), restProps);
|
|
87
|
+
return /* @__PURE__ */ jsx(SwapProvider, {
|
|
88
|
+
value: swap,
|
|
89
|
+
children: /* @__PURE__ */ jsx(wire.span, {
|
|
90
|
+
...mergedProps,
|
|
91
|
+
ref,
|
|
92
|
+
children
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
SwapRoot.displayName = "SwapRoot";
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/components/swap/root-provider.tsx
|
|
99
|
+
const SwapRootProvider = forwardRef((props, ref) => {
|
|
100
|
+
const { value, children, ...restProps } = props;
|
|
101
|
+
const mergedProps = mergeProps(value.getRootProps(), restProps);
|
|
102
|
+
return /* @__PURE__ */ jsx(SwapProvider, {
|
|
103
|
+
value,
|
|
104
|
+
children: /* @__PURE__ */ jsx(wire.span, {
|
|
105
|
+
...mergedProps,
|
|
106
|
+
ref,
|
|
107
|
+
children
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
SwapRootProvider.displayName = "SwapRootProvider";
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/components/swap/swap.ts
|
|
114
|
+
var swap_exports = /* @__PURE__ */ __exportAll({
|
|
115
|
+
Indicator: () => SwapIndicator,
|
|
116
|
+
Root: () => SwapRoot,
|
|
117
|
+
RootProvider: () => SwapRootProvider,
|
|
118
|
+
swapAnatomy: () => swapAnatomy
|
|
119
|
+
});
|
|
120
|
+
//#endregion
|
|
121
|
+
export { swap_exports as Swap, SwapIndicator, SwapRoot, SwapRootProvider, swapAnatomy, useSwap, useSwapContext };
|