@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
|
@@ -0,0 +1,130 @@
|
|
|
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 angleSlider from "@wirekyt/dom/machines/angle-slider";
|
|
8
|
+
import { anatomy as angleSliderAnatomy } from "@wirekyt/dom/machines/angle-slider";
|
|
9
|
+
//#region src/components/angle-slider/use-context.ts
|
|
10
|
+
const [AngleSliderProvider, useAngleSliderContext] = createContext$1({
|
|
11
|
+
hookName: "useAngleSliderContext",
|
|
12
|
+
providerName: "<AngleSliderProvider />"
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/components/angle-slider/context.tsx
|
|
16
|
+
const AngleSliderContext = (props) => props.children(useAngleSliderContext());
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/angle-slider/control.tsx
|
|
19
|
+
const AngleSliderControl = (props) => {
|
|
20
|
+
const api = useAngleSliderContext();
|
|
21
|
+
const mergedProps = mergeProps$1(() => api().getControlProps(), props);
|
|
22
|
+
return <wire.div {...mergedProps} />;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/components/angle-slider/hidden-input.tsx
|
|
26
|
+
const AngleSliderHiddenInput = (props) => {
|
|
27
|
+
const api = useAngleSliderContext();
|
|
28
|
+
const mergedProps = mergeProps$1(() => api().getHiddenInputProps(), props);
|
|
29
|
+
return <wire.input {...mergedProps} />;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/angle-slider/label.tsx
|
|
33
|
+
const AngleSliderLabel = (props) => {
|
|
34
|
+
const api = useAngleSliderContext();
|
|
35
|
+
const mergedProps = mergeProps$1(() => api().getLabelProps(), props);
|
|
36
|
+
return <wire.label {...mergedProps} />;
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/components/angle-slider/marker.tsx
|
|
40
|
+
const AngleSliderMarker = (props) => {
|
|
41
|
+
const [markerProps, localProps] = createSplitProps()(props, ["value"]);
|
|
42
|
+
const api = useAngleSliderContext();
|
|
43
|
+
const mergedProps = mergeProps$1(() => api().getMarkerProps(markerProps), localProps);
|
|
44
|
+
return <wire.div {...mergedProps} />;
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/angle-slider/marker-group.tsx
|
|
48
|
+
const AngleSliderMarkerGroup = (props) => {
|
|
49
|
+
const api = useAngleSliderContext();
|
|
50
|
+
const mergedProps = mergeProps$1(() => api().getMarkerGroupProps(), props);
|
|
51
|
+
return <wire.div {...mergedProps} />;
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/components/angle-slider/use.ts
|
|
55
|
+
const useAngleSlider = (props) => {
|
|
56
|
+
const id = createUniqueId();
|
|
57
|
+
const locale = useLocaleContext();
|
|
58
|
+
const environment = useEnvironmentContext();
|
|
59
|
+
const machineProps = createMemo(() => ({
|
|
60
|
+
id,
|
|
61
|
+
dir: locale().dir,
|
|
62
|
+
getRootNode: environment().getRootNode,
|
|
63
|
+
...runIfFn(props)
|
|
64
|
+
}));
|
|
65
|
+
const service = useMachine(angleSlider.machine, machineProps);
|
|
66
|
+
return createMemo(() => angleSlider.connect(service, normalizeProps));
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/components/angle-slider/root.tsx
|
|
70
|
+
const AngleSliderRoot = (props) => {
|
|
71
|
+
const [useAngleSliderProps, localProps] = createSplitProps()(props, [
|
|
72
|
+
"id",
|
|
73
|
+
"ids",
|
|
74
|
+
"name",
|
|
75
|
+
"invalid",
|
|
76
|
+
"readOnly",
|
|
77
|
+
"disabled",
|
|
78
|
+
"onValueChangeEnd",
|
|
79
|
+
"onValueChange",
|
|
80
|
+
"defaultValue",
|
|
81
|
+
"value",
|
|
82
|
+
"step",
|
|
83
|
+
"aria-label",
|
|
84
|
+
"aria-labelledby"
|
|
85
|
+
]);
|
|
86
|
+
const angleSlider = useAngleSlider(useAngleSliderProps);
|
|
87
|
+
const mergedProps = mergeProps$1(() => angleSlider().getRootProps(), localProps);
|
|
88
|
+
return <AngleSliderProvider value={angleSlider}>
|
|
89
|
+
<wire.div {...mergedProps} />
|
|
90
|
+
</AngleSliderProvider>;
|
|
91
|
+
};
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/components/angle-slider/root-provider.tsx
|
|
94
|
+
const AngleSliderRootProvider = (props) => {
|
|
95
|
+
const [rootProps, localProps] = createSplitProps()(props, ["value"]);
|
|
96
|
+
const mergedProps = mergeProps$1(() => rootProps.value().getRootProps(), localProps);
|
|
97
|
+
return <AngleSliderProvider value={rootProps.value}>
|
|
98
|
+
<wire.div {...mergedProps} />
|
|
99
|
+
</AngleSliderProvider>;
|
|
100
|
+
};
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/components/angle-slider/thumb.tsx
|
|
103
|
+
const AngleSliderThumb = (props) => {
|
|
104
|
+
const api = useAngleSliderContext();
|
|
105
|
+
const mergedProps = mergeProps$1(() => api().getThumbProps(), props);
|
|
106
|
+
return <wire.div {...mergedProps} />;
|
|
107
|
+
};
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/components/angle-slider/value-text.tsx
|
|
110
|
+
const AngleSliderValueText = (props) => {
|
|
111
|
+
const api = useAngleSliderContext();
|
|
112
|
+
const mergedProps = mergeProps$1(() => api().getValueTextProps(), props);
|
|
113
|
+
return <wire.div {...mergedProps}>{props.children || api().valueAsDegree}</wire.div>;
|
|
114
|
+
};
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/components/angle-slider/angle-slider.ts
|
|
117
|
+
var angle_slider_exports = /* @__PURE__ */ __exportAll({
|
|
118
|
+
Context: () => AngleSliderContext,
|
|
119
|
+
Control: () => AngleSliderControl,
|
|
120
|
+
HiddenInput: () => AngleSliderHiddenInput,
|
|
121
|
+
Label: () => AngleSliderLabel,
|
|
122
|
+
Marker: () => AngleSliderMarker,
|
|
123
|
+
MarkerGroup: () => AngleSliderMarkerGroup,
|
|
124
|
+
Root: () => AngleSliderRoot,
|
|
125
|
+
RootProvider: () => AngleSliderRootProvider,
|
|
126
|
+
Thumb: () => AngleSliderThumb,
|
|
127
|
+
ValueText: () => AngleSliderValueText
|
|
128
|
+
});
|
|
129
|
+
//#endregion
|
|
130
|
+
export { angle_slider_exports as AngleSlider, AngleSliderContext, AngleSliderControl, AngleSliderHiddenInput, AngleSliderLabel, AngleSliderMarker, AngleSliderMarkerGroup, AngleSliderRoot, AngleSliderRootProvider, AngleSliderThumb, AngleSliderValueText, angleSliderAnatomy, useAngleSlider, useAngleSliderContext };
|
package/dist/avatar.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { a as Optional, r as MaybeAccessor, s as PropTypes } from "./index-ClU-Lb8Z.js";
|
|
2
|
+
import { r as PolymorphicProps, t as HTMLProps } from "./factory-wuwfJqbU.js";
|
|
3
|
+
import { Accessor, JSX } from "solid-js";
|
|
4
|
+
import * as avatar from "@wirekyt/dom/machines/avatar";
|
|
5
|
+
import { StatusChangeDetails, StatusChangeDetails as AvatarStatusChangeDetails, anatomy as avatarAnatomy } from "@wirekyt/dom/machines/avatar";
|
|
6
|
+
//#region src/components/avatar/use.d.ts
|
|
7
|
+
interface UseAvatarProps extends Optional<Omit<avatar.Props, "dir" | "getRootNode">, "id"> {}
|
|
8
|
+
interface UseAvatarReturn extends Accessor<avatar.Api<PropTypes>> {}
|
|
9
|
+
declare const useAvatar: (props?: MaybeAccessor<UseAvatarProps>) => UseAvatarReturn;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/avatar/use-context.d.ts
|
|
12
|
+
interface UseAvatarContext extends UseAvatarReturn {}
|
|
13
|
+
declare const AvatarProvider: import("solid-js").ContextProviderComponent<UseAvatarContext>, useAvatarContext: () => UseAvatarContext;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/components/avatar/context.d.ts
|
|
16
|
+
interface AvatarContextProps {
|
|
17
|
+
children: (context: UseAvatarContext) => JSX.Element;
|
|
18
|
+
}
|
|
19
|
+
declare const AvatarContext: (props: AvatarContextProps) => JSX.Element;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/components/avatar/fallback.d.ts
|
|
22
|
+
interface AvatarFallbackBaseProps extends PolymorphicProps<"span"> {}
|
|
23
|
+
interface AvatarFallbackProps extends HTMLProps<"span">, AvatarFallbackBaseProps {}
|
|
24
|
+
declare const AvatarFallback: (props: AvatarFallbackProps) => import("solid-js").JSX.Element;
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/avatar/image.d.ts
|
|
27
|
+
interface AvatarImageBaseProps extends PolymorphicProps<"img"> {}
|
|
28
|
+
interface AvatarImageProps extends HTMLProps<"img">, AvatarImageBaseProps {}
|
|
29
|
+
declare const AvatarImage: (props: AvatarImageProps) => import("solid-js").JSX.Element;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/components/avatar/root.d.ts
|
|
32
|
+
interface AvatarRootBaseProps extends UseAvatarProps, PolymorphicProps<"div"> {}
|
|
33
|
+
interface AvatarRootProps extends HTMLProps<"div">, AvatarRootBaseProps {}
|
|
34
|
+
declare const AvatarRoot: (props: AvatarRootProps) => import("solid-js").JSX.Element;
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/avatar/root-provider.d.ts
|
|
37
|
+
interface RootProviderProps {
|
|
38
|
+
value: UseAvatarReturn;
|
|
39
|
+
}
|
|
40
|
+
interface AvatarRootProviderBaseProps extends PolymorphicProps<"div"> {}
|
|
41
|
+
interface AvatarRootProviderProps extends HTMLProps<"div">, RootProviderProps, AvatarRootProviderBaseProps {}
|
|
42
|
+
declare const AvatarRootProvider: (props: AvatarRootProviderProps) => import("solid-js").JSX.Element;
|
|
43
|
+
declare namespace avatar_d_exports {
|
|
44
|
+
export { AvatarContext as Context, AvatarContextProps as ContextProps, AvatarFallback as Fallback, AvatarFallbackBaseProps as FallbackBaseProps, AvatarFallbackProps as FallbackProps, AvatarImage as Image, AvatarImageBaseProps as ImageBaseProps, AvatarImageProps as ImageProps, AvatarRoot as Root, AvatarRootBaseProps as RootBaseProps, AvatarRootProps as RootProps, AvatarRootProvider as RootProvider, AvatarRootProviderBaseProps as RootProviderBaseProps, AvatarRootProviderProps as RootProviderProps, StatusChangeDetails };
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { avatar_d_exports as Avatar, AvatarContext, type AvatarContextProps, AvatarFallback, type AvatarFallbackBaseProps, type AvatarFallbackProps, AvatarImage, type AvatarImageBaseProps, type AvatarImageProps, AvatarRoot, type AvatarRootBaseProps, type AvatarRootProps, AvatarRootProvider, type AvatarRootProviderBaseProps, type AvatarRootProviderProps, type AvatarStatusChangeDetails, type UseAvatarContext, type UseAvatarProps, type UseAvatarReturn, avatarAnatomy, useAvatar, useAvatarContext };
|
package/dist/avatar.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
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 } from "solid-js/web";
|
|
8
|
+
import * as avatar from "@wirekyt/dom/machines/avatar";
|
|
9
|
+
import { anatomy as avatarAnatomy } from "@wirekyt/dom/machines/avatar";
|
|
10
|
+
//#region src/components/avatar/use-context.ts
|
|
11
|
+
const [AvatarProvider, useAvatarContext] = createContext$1({
|
|
12
|
+
hookName: "useAvatarContext",
|
|
13
|
+
providerName: "<AvatarProvider />"
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/components/avatar/context.tsx
|
|
17
|
+
const AvatarContext = (props) => props.children(useAvatarContext());
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/components/avatar/fallback.tsx
|
|
20
|
+
const AvatarFallback = (props) => {
|
|
21
|
+
const context = useAvatarContext();
|
|
22
|
+
const mergedProps = mergeProps$2(() => context().getFallbackProps(), props);
|
|
23
|
+
return createComponent(wire.span, mergedProps);
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/avatar/image.tsx
|
|
27
|
+
const AvatarImage = (props) => {
|
|
28
|
+
const context = useAvatarContext();
|
|
29
|
+
const mergedProps = mergeProps$2(() => context().getImageProps(), props);
|
|
30
|
+
return createComponent(wire.img, mergedProps);
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/avatar/use.ts
|
|
34
|
+
const useAvatar = (props) => {
|
|
35
|
+
const locale = useLocaleContext();
|
|
36
|
+
const environment = useEnvironmentContext();
|
|
37
|
+
const id = createUniqueId();
|
|
38
|
+
const machineProps = createMemo(() => ({
|
|
39
|
+
id,
|
|
40
|
+
dir: locale().dir,
|
|
41
|
+
getRootNode: environment().getRootNode,
|
|
42
|
+
...runIfFn(props)
|
|
43
|
+
}));
|
|
44
|
+
const service = useMachine(avatar.machine, machineProps);
|
|
45
|
+
return createMemo(() => avatar.connect(service, normalizeProps));
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/components/avatar/root.tsx
|
|
49
|
+
const AvatarRoot = (props) => {
|
|
50
|
+
const [useAvatarProps, localProps] = createSplitProps()(props, [
|
|
51
|
+
"id",
|
|
52
|
+
"ids",
|
|
53
|
+
"onStatusChange"
|
|
54
|
+
]);
|
|
55
|
+
const context = useAvatar(useAvatarProps);
|
|
56
|
+
const mergedProps = mergeProps$2(() => context().getRootProps(), localProps);
|
|
57
|
+
return createComponent(AvatarProvider, {
|
|
58
|
+
value: context,
|
|
59
|
+
get children() {
|
|
60
|
+
return createComponent(wire.div, mergedProps);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/components/avatar/root-provider.tsx
|
|
66
|
+
const AvatarRootProvider = (props) => {
|
|
67
|
+
const [{ value: avatar }, localProps] = createSplitProps()(props, ["value"]);
|
|
68
|
+
const mergedProps = mergeProps$2(() => avatar().getRootProps(), localProps);
|
|
69
|
+
return createComponent(AvatarProvider, {
|
|
70
|
+
value: avatar,
|
|
71
|
+
get children() {
|
|
72
|
+
return createComponent(wire.div, mergedProps);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/components/avatar/avatar.ts
|
|
78
|
+
var avatar_exports = /* @__PURE__ */ __exportAll({
|
|
79
|
+
Context: () => AvatarContext,
|
|
80
|
+
Fallback: () => AvatarFallback,
|
|
81
|
+
Image: () => AvatarImage,
|
|
82
|
+
Root: () => AvatarRoot,
|
|
83
|
+
RootProvider: () => AvatarRootProvider
|
|
84
|
+
});
|
|
85
|
+
//#endregion
|
|
86
|
+
export { avatar_exports as Avatar, AvatarContext, AvatarFallback, AvatarImage, AvatarRoot, AvatarRootProvider, avatarAnatomy, useAvatar, useAvatarContext };
|
package/dist/avatar.jsx
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
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 avatar from "@wirekyt/dom/machines/avatar";
|
|
8
|
+
import { anatomy as avatarAnatomy } from "@wirekyt/dom/machines/avatar";
|
|
9
|
+
//#region src/components/avatar/use-context.ts
|
|
10
|
+
const [AvatarProvider, useAvatarContext] = createContext$1({
|
|
11
|
+
hookName: "useAvatarContext",
|
|
12
|
+
providerName: "<AvatarProvider />"
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/components/avatar/context.tsx
|
|
16
|
+
const AvatarContext = (props) => props.children(useAvatarContext());
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/avatar/fallback.tsx
|
|
19
|
+
const AvatarFallback = (props) => {
|
|
20
|
+
const context = useAvatarContext();
|
|
21
|
+
const mergedProps = mergeProps$1(() => context().getFallbackProps(), props);
|
|
22
|
+
return <wire.span {...mergedProps} />;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/components/avatar/image.tsx
|
|
26
|
+
const AvatarImage = (props) => {
|
|
27
|
+
const context = useAvatarContext();
|
|
28
|
+
const mergedProps = mergeProps$1(() => context().getImageProps(), props);
|
|
29
|
+
return <wire.img {...mergedProps} />;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/avatar/use.ts
|
|
33
|
+
const useAvatar = (props) => {
|
|
34
|
+
const locale = useLocaleContext();
|
|
35
|
+
const environment = useEnvironmentContext();
|
|
36
|
+
const id = createUniqueId();
|
|
37
|
+
const machineProps = createMemo(() => ({
|
|
38
|
+
id,
|
|
39
|
+
dir: locale().dir,
|
|
40
|
+
getRootNode: environment().getRootNode,
|
|
41
|
+
...runIfFn(props)
|
|
42
|
+
}));
|
|
43
|
+
const service = useMachine(avatar.machine, machineProps);
|
|
44
|
+
return createMemo(() => avatar.connect(service, normalizeProps));
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/avatar/root.tsx
|
|
48
|
+
const AvatarRoot = (props) => {
|
|
49
|
+
const [useAvatarProps, localProps] = createSplitProps()(props, [
|
|
50
|
+
"id",
|
|
51
|
+
"ids",
|
|
52
|
+
"onStatusChange"
|
|
53
|
+
]);
|
|
54
|
+
const context = useAvatar(useAvatarProps);
|
|
55
|
+
const mergedProps = mergeProps$1(() => context().getRootProps(), localProps);
|
|
56
|
+
return <AvatarProvider value={context}>
|
|
57
|
+
<wire.div {...mergedProps} />
|
|
58
|
+
</AvatarProvider>;
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/components/avatar/root-provider.tsx
|
|
62
|
+
const AvatarRootProvider = (props) => {
|
|
63
|
+
const [{ value: avatar }, localProps] = createSplitProps()(props, ["value"]);
|
|
64
|
+
const mergedProps = mergeProps$1(() => avatar().getRootProps(), localProps);
|
|
65
|
+
return <AvatarProvider value={avatar}>
|
|
66
|
+
<wire.div {...mergedProps} />
|
|
67
|
+
</AvatarProvider>;
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/components/avatar/avatar.ts
|
|
71
|
+
var avatar_exports = /* @__PURE__ */ __exportAll({
|
|
72
|
+
Context: () => AvatarContext,
|
|
73
|
+
Fallback: () => AvatarFallback,
|
|
74
|
+
Image: () => AvatarImage,
|
|
75
|
+
Root: () => AvatarRoot,
|
|
76
|
+
RootProvider: () => AvatarRootProvider
|
|
77
|
+
});
|
|
78
|
+
//#endregion
|
|
79
|
+
export { avatar_exports as Avatar, AvatarContext, AvatarFallback, AvatarImage, AvatarRoot, AvatarRootProvider, avatarAnatomy, useAvatar, useAvatarContext };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { a as Optional, r as MaybeAccessor, s as PropTypes } from "./index-ClU-Lb8Z.js";
|
|
2
|
+
import { r as PolymorphicProps, t as HTMLProps } from "./factory-wuwfJqbU.js";
|
|
3
|
+
import { Accessor, JSX } from "solid-js";
|
|
4
|
+
import * as carousel from "@wirekyt/dom/machines/carousel";
|
|
5
|
+
import { AutoplayStatusDetails, AutoplayStatusDetails as CarouselAutoplayStatusDetails, DragStatusDetails, DragStatusDetails as CarouselDragStatusDetails, IndicatorProps, ItemProps, PageChangeDetails, PageChangeDetails as CarouselPageChangeDetails } from "@wirekyt/dom/machines/carousel";
|
|
6
|
+
//#region src/components/carousel/autoplay-indicator.d.ts
|
|
7
|
+
interface CarouselAutoplayIndicatorBaseProps extends PolymorphicProps<"span"> {
|
|
8
|
+
fallback?: JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
interface CarouselAutoplayIndicatorProps extends HTMLProps<"span">, CarouselAutoplayIndicatorBaseProps {}
|
|
11
|
+
declare const CarouselAutoplayIndicator: (props: CarouselAutoplayIndicatorProps) => JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/components/carousel/progress-text.d.ts
|
|
14
|
+
interface CarouselProgressTextBaseProps extends PolymorphicProps<"span"> {}
|
|
15
|
+
interface CarouselProgressTextProps extends HTMLProps<"span">, CarouselProgressTextBaseProps {}
|
|
16
|
+
declare const CarouselProgressText: (props: CarouselProgressTextProps) => import("solid-js").JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/carousel/autoplay-trigger.d.ts
|
|
19
|
+
interface CarouselAutoplayTriggerBaseProps extends PolymorphicProps<"button"> {}
|
|
20
|
+
interface CarouselAutoplayTriggerProps extends HTMLProps<"button">, CarouselAutoplayTriggerBaseProps {}
|
|
21
|
+
declare const CarouselAutoplayTrigger: (props: CarouselAutoplayTriggerProps) => import("solid-js").JSX.Element;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/carousel/use-carousel.d.ts
|
|
24
|
+
interface UseCarouselProps extends Optional<Omit<carousel.Props, "dir" | "getRootNode">, "id"> {}
|
|
25
|
+
interface UseCarouselReturn extends Accessor<carousel.Api<PropTypes>> {}
|
|
26
|
+
declare const useCarousel: (props: MaybeAccessor<UseCarouselProps>) => UseCarouselReturn;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/carousel/use-context.d.ts
|
|
29
|
+
interface UseCarouselContext extends UseCarouselReturn {}
|
|
30
|
+
declare const CarouselProvider: import("solid-js").ContextProviderComponent<UseCarouselContext>, useCarouselContext: () => UseCarouselContext;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/carousel/context.d.ts
|
|
33
|
+
interface CarouselContextProps {
|
|
34
|
+
children: (context: UseCarouselContext) => JSX.Element;
|
|
35
|
+
}
|
|
36
|
+
declare const CarouselContext: (props: CarouselContextProps) => JSX.Element;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/carousel/control.d.ts
|
|
39
|
+
interface CarouselControlBaseProps extends PolymorphicProps<"div"> {}
|
|
40
|
+
interface CarouselControlProps extends HTMLProps<"div">, CarouselControlBaseProps {}
|
|
41
|
+
declare const CarouselControl: (props: CarouselControlProps) => import("solid-js").JSX.Element;
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/carousel/indicator.d.ts
|
|
44
|
+
interface CarouselIndicatorBaseProps extends IndicatorProps, PolymorphicProps<"button"> {}
|
|
45
|
+
interface CarouselIndicatorProps extends HTMLProps<"button">, CarouselIndicatorBaseProps {}
|
|
46
|
+
declare const CarouselIndicator: (props: CarouselIndicatorProps) => import("solid-js").JSX.Element;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/components/carousel/indicator-group.d.ts
|
|
49
|
+
interface CarouselIndicatorGroupBaseProps extends PolymorphicProps<"div"> {}
|
|
50
|
+
interface CarouselIndicatorGroupProps extends HTMLProps<"div">, CarouselIndicatorGroupBaseProps {}
|
|
51
|
+
declare const CarouselIndicatorGroup: (props: CarouselIndicatorGroupProps) => import("solid-js").JSX.Element;
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/carousel/item.d.ts
|
|
54
|
+
interface CarouselItemBaseProps extends ItemProps, PolymorphicProps<"div"> {}
|
|
55
|
+
interface CarouselItemProps extends HTMLProps<"div">, CarouselItemBaseProps {}
|
|
56
|
+
declare const CarouselItem: (props: CarouselItemProps) => import("solid-js").JSX.Element;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/components/carousel/item-group.d.ts
|
|
59
|
+
interface CarouselItemGroupBaseProps extends PolymorphicProps<"div"> {}
|
|
60
|
+
interface CarouselItemGroupProps extends HTMLProps<"div">, CarouselItemGroupBaseProps {}
|
|
61
|
+
declare const CarouselItemGroup: (props: CarouselItemGroupProps) => import("solid-js").JSX.Element;
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/components/carousel/next-trigger.d.ts
|
|
64
|
+
interface CarouselNextTriggerBaseProps extends PolymorphicProps<"button"> {}
|
|
65
|
+
interface CarouselNextTriggerProps extends HTMLProps<"button">, CarouselNextTriggerBaseProps {}
|
|
66
|
+
declare const CarouselNextTrigger: (props: CarouselNextTriggerProps) => import("solid-js").JSX.Element;
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/components/carousel/prev-trigger.d.ts
|
|
69
|
+
interface CarouselPrevTriggerBaseProps extends PolymorphicProps<"button"> {}
|
|
70
|
+
interface CarouselPrevTriggerProps extends HTMLProps<"button">, CarouselPrevTriggerBaseProps {}
|
|
71
|
+
declare const CarouselPrevTrigger: (props: CarouselPrevTriggerProps) => import("solid-js").JSX.Element;
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/components/carousel/root.d.ts
|
|
74
|
+
interface CarouselRootBaseProps extends UseCarouselProps, PolymorphicProps<"div"> {}
|
|
75
|
+
interface CarouselRootProps extends HTMLProps<"div">, CarouselRootBaseProps {}
|
|
76
|
+
declare const CarouselRoot: (props: CarouselRootProps) => import("solid-js").JSX.Element;
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/components/carousel/root-provider.d.ts
|
|
79
|
+
interface RootProviderProps {
|
|
80
|
+
value: UseCarouselReturn;
|
|
81
|
+
}
|
|
82
|
+
interface CarouselRootProviderBaseProps extends PolymorphicProps<"div"> {}
|
|
83
|
+
interface CarouselRootProviderProps extends HTMLProps<"div">, RootProviderProps, CarouselRootProviderBaseProps {}
|
|
84
|
+
declare const CarouselRootProvider: (props: CarouselRootProviderProps) => import("solid-js").JSX.Element;
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/components/carousel/anatomy.d.ts
|
|
87
|
+
declare const carouselAnatomy: import("@wirekyt/dom/anatomy").AnatomyInstance<"root" | "indicator" | "control" | "item" | "itemGroup" | "nextTrigger" | "prevTrigger" | "indicatorGroup" | "autoplayTrigger" | "progressText" | "autoplayIndicator">;
|
|
88
|
+
declare namespace carousel_d_exports {
|
|
89
|
+
export { CarouselAutoplayIndicator as AutoplayIndicator, CarouselAutoplayIndicatorBaseProps as AutoplayIndicatorBaseProps, CarouselAutoplayIndicatorProps as AutoplayIndicatorProps, AutoplayStatusDetails, CarouselAutoplayTrigger as AutoplayTrigger, CarouselAutoplayTriggerBaseProps as AutoplayTriggerBaseProps, CarouselAutoplayTriggerProps as AutoplayTriggerProps, CarouselContext as Context, CarouselContextProps as ContextProps, CarouselControl as Control, CarouselControlBaseProps as ControlBaseProps, CarouselControlProps as ControlProps, DragStatusDetails, CarouselIndicator as Indicator, CarouselIndicatorBaseProps as IndicatorBaseProps, CarouselIndicatorGroup as IndicatorGroup, CarouselIndicatorGroupBaseProps as IndicatorGroupBaseProps, CarouselIndicatorGroupProps as IndicatorGroupProps, CarouselIndicatorProps as IndicatorProps, CarouselItem as Item, CarouselItemBaseProps as ItemBaseProps, CarouselItemGroup as ItemGroup, CarouselItemGroupBaseProps as ItemGroupBaseProps, CarouselItemGroupProps as ItemGroupProps, CarouselItemProps as ItemProps, CarouselNextTrigger as NextTrigger, CarouselNextTriggerBaseProps as NextTriggerBaseProps, CarouselNextTriggerProps as NextTriggerProps, PageChangeDetails, CarouselPrevTrigger as PrevTrigger, CarouselPrevTriggerBaseProps as PrevTriggerBaseProps, CarouselPrevTriggerProps as PrevTriggerProps, CarouselProgressText as ProgressText, CarouselProgressTextBaseProps as ProgressTextBaseProps, CarouselProgressTextProps as ProgressTextProps, CarouselRoot as Root, CarouselRootBaseProps as RootBaseProps, CarouselRootProps as RootProps, CarouselRootProvider as RootProvider, CarouselRootProviderBaseProps as RootProviderBaseProps, CarouselRootProviderProps as RootProviderProps };
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { carousel_d_exports as Carousel, CarouselAutoplayIndicator, type CarouselAutoplayIndicatorBaseProps, type CarouselAutoplayIndicatorProps, type CarouselAutoplayStatusDetails, CarouselAutoplayTrigger, type CarouselAutoplayTriggerBaseProps, type CarouselAutoplayTriggerProps, CarouselContext, type CarouselContextProps, CarouselControl, type CarouselControlBaseProps, type CarouselControlProps, type CarouselDragStatusDetails, CarouselIndicator, type CarouselIndicatorBaseProps, CarouselIndicatorGroup, type CarouselIndicatorGroupBaseProps, type CarouselIndicatorGroupProps, type CarouselIndicatorProps, CarouselItem, type CarouselItemBaseProps, CarouselItemGroup, type CarouselItemGroupBaseProps, type CarouselItemGroupProps, type CarouselItemProps, CarouselNextTrigger, type CarouselNextTriggerBaseProps, type CarouselNextTriggerProps, type CarouselPageChangeDetails, CarouselPrevTrigger, type CarouselPrevTriggerBaseProps, type CarouselPrevTriggerProps, CarouselProgressText, type CarouselProgressTextBaseProps, type CarouselProgressTextProps, CarouselRoot, type CarouselRootBaseProps, type CarouselRootProps, CarouselRootProvider, type CarouselRootProviderBaseProps, type CarouselRootProviderProps, type UseCarouselContext, type UseCarouselProps, type UseCarouselReturn, carouselAnatomy, useCarousel, useCarouselContext };
|
package/dist/carousel.js
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
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 { Show, createMemo, createUniqueId } from "solid-js";
|
|
7
|
+
import { createComponent, mergeProps as mergeProps$1 } from "solid-js/web";
|
|
8
|
+
import * as carousel from "@wirekyt/dom/machines/carousel";
|
|
9
|
+
import { anatomy } from "@wirekyt/dom/machines/carousel";
|
|
10
|
+
//#region src/components/carousel/anatomy.ts
|
|
11
|
+
const carouselAnatomy = anatomy.extendWith("progressText", "autoplayIndicator");
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/components/carousel/use-context.ts
|
|
14
|
+
const [CarouselProvider, useCarouselContext] = createContext$1({
|
|
15
|
+
hookName: "useCarouselContext",
|
|
16
|
+
providerName: "<CarouselProvider />"
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/components/carousel/autoplay-indicator.tsx
|
|
20
|
+
const parts$1 = carouselAnatomy.build();
|
|
21
|
+
const CarouselAutoplayIndicator = (props) => {
|
|
22
|
+
const api = useCarouselContext();
|
|
23
|
+
return createComponent(wire.span, mergeProps$1(() => parts$1.autoplayIndicator.attrs, props, { get children() {
|
|
24
|
+
return createComponent(Show, {
|
|
25
|
+
get when() {
|
|
26
|
+
return api().isPlaying;
|
|
27
|
+
},
|
|
28
|
+
get fallback() {
|
|
29
|
+
return props.fallback;
|
|
30
|
+
},
|
|
31
|
+
get children() {
|
|
32
|
+
return props.children;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
} }));
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/carousel/progress-text.tsx
|
|
39
|
+
const parts = carouselAnatomy.build();
|
|
40
|
+
const CarouselProgressText = (props) => {
|
|
41
|
+
const api = useCarouselContext();
|
|
42
|
+
const progressText = createMemo(() => {
|
|
43
|
+
return `${api().page + 1} / ${api().pageSnapPoints.length}`;
|
|
44
|
+
});
|
|
45
|
+
return createComponent(wire.span, mergeProps$1(() => parts.progressText.attrs, props, { get children() {
|
|
46
|
+
return props.children || progressText();
|
|
47
|
+
} }));
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/components/carousel/autoplay-trigger.tsx
|
|
51
|
+
const CarouselAutoplayTrigger = (props) => {
|
|
52
|
+
const api = useCarouselContext();
|
|
53
|
+
const mergedProps = mergeProps$2(() => api().getAutoplayTriggerProps(), props);
|
|
54
|
+
return createComponent(wire.button, mergedProps);
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/components/carousel/context.tsx
|
|
58
|
+
const CarouselContext = (props) => props.children(useCarouselContext());
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/components/carousel/control.tsx
|
|
61
|
+
const CarouselControl = (props) => {
|
|
62
|
+
const api = useCarouselContext();
|
|
63
|
+
const mergedProps = mergeProps$2(() => api().getControlProps(), props);
|
|
64
|
+
return createComponent(wire.div, mergedProps);
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/components/carousel/indicator.tsx
|
|
68
|
+
const CarouselIndicator = (props) => {
|
|
69
|
+
const [indicatorProps, localProps] = createSplitProps()(props, ["index", "readOnly"]);
|
|
70
|
+
const api = useCarouselContext();
|
|
71
|
+
const mergedProps = mergeProps$2(() => api().getIndicatorProps(indicatorProps), localProps);
|
|
72
|
+
return createComponent(wire.button, mergedProps);
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/components/carousel/indicator-group.tsx
|
|
76
|
+
const CarouselIndicatorGroup = (props) => {
|
|
77
|
+
const api = useCarouselContext();
|
|
78
|
+
const mergedProps = mergeProps$2(() => api().getIndicatorGroupProps(), props);
|
|
79
|
+
return createComponent(wire.div, mergedProps);
|
|
80
|
+
};
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/components/carousel/item.tsx
|
|
83
|
+
const CarouselItem = (props) => {
|
|
84
|
+
const [itemProps, localProps] = createSplitProps()(props, ["index", "snapAlign"]);
|
|
85
|
+
const api = useCarouselContext();
|
|
86
|
+
const mergedProps = mergeProps$2(() => api().getItemProps(itemProps), localProps);
|
|
87
|
+
return createComponent(wire.div, mergedProps);
|
|
88
|
+
};
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/components/carousel/item-group.tsx
|
|
91
|
+
const CarouselItemGroup = (props) => {
|
|
92
|
+
const api = useCarouselContext();
|
|
93
|
+
const mergedProps = mergeProps$2(() => api().getItemGroupProps(), props);
|
|
94
|
+
return createComponent(wire.div, mergedProps);
|
|
95
|
+
};
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/components/carousel/next-trigger.tsx
|
|
98
|
+
const CarouselNextTrigger = (props) => {
|
|
99
|
+
const api = useCarouselContext();
|
|
100
|
+
const mergedProps = mergeProps$2(() => api().getNextTriggerProps(), props);
|
|
101
|
+
return createComponent(wire.button, mergedProps);
|
|
102
|
+
};
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/components/carousel/prev-trigger.tsx
|
|
105
|
+
const CarouselPrevTrigger = (props) => {
|
|
106
|
+
const api = useCarouselContext();
|
|
107
|
+
const mergedProps = mergeProps$2(() => api().getPrevTriggerProps(), props);
|
|
108
|
+
return createComponent(wire.button, mergedProps);
|
|
109
|
+
};
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/components/carousel/use-carousel.ts
|
|
112
|
+
const useCarousel = (props) => {
|
|
113
|
+
const id = createUniqueId();
|
|
114
|
+
const locale = useLocaleContext();
|
|
115
|
+
const environment = useEnvironmentContext();
|
|
116
|
+
const machineProps = createMemo(() => ({
|
|
117
|
+
id,
|
|
118
|
+
dir: locale().dir,
|
|
119
|
+
getRootNode: environment().getRootNode,
|
|
120
|
+
...runIfFn(props)
|
|
121
|
+
}));
|
|
122
|
+
const service = useMachine(carousel.machine, machineProps);
|
|
123
|
+
return createMemo(() => carousel.connect(service, normalizeProps));
|
|
124
|
+
};
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/components/carousel/root.tsx
|
|
127
|
+
const CarouselRoot = (props) => {
|
|
128
|
+
const [useCarouselProps, localProps] = createSplitProps()(props, [
|
|
129
|
+
"allowMouseDrag",
|
|
130
|
+
"autoplay",
|
|
131
|
+
"autoSize",
|
|
132
|
+
"defaultPage",
|
|
133
|
+
"id",
|
|
134
|
+
"ids",
|
|
135
|
+
"inViewThreshold",
|
|
136
|
+
"loop",
|
|
137
|
+
"onAutoplayStatusChange",
|
|
138
|
+
"onDragStatusChange",
|
|
139
|
+
"onPageChange",
|
|
140
|
+
"orientation",
|
|
141
|
+
"padding",
|
|
142
|
+
"page",
|
|
143
|
+
"slideCount",
|
|
144
|
+
"slidesPerMove",
|
|
145
|
+
"slidesPerPage",
|
|
146
|
+
"snapType",
|
|
147
|
+
"spacing",
|
|
148
|
+
"translations"
|
|
149
|
+
]);
|
|
150
|
+
const api = useCarousel(useCarouselProps);
|
|
151
|
+
const mergedProps = mergeProps$2(() => api().getRootProps(), localProps);
|
|
152
|
+
return createComponent(CarouselProvider, {
|
|
153
|
+
value: api,
|
|
154
|
+
get children() {
|
|
155
|
+
return createComponent(wire.div, mergedProps);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/components/carousel/root-provider.tsx
|
|
161
|
+
const CarouselRootProvider = (props) => {
|
|
162
|
+
const [{ value: carousel }, localProps] = createSplitProps()(props, ["value"]);
|
|
163
|
+
const mergedProps = mergeProps$2(() => carousel().getRootProps(), localProps);
|
|
164
|
+
return createComponent(CarouselProvider, {
|
|
165
|
+
value: carousel,
|
|
166
|
+
get children() {
|
|
167
|
+
return createComponent(wire.div, mergedProps);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
//#endregion
|
|
172
|
+
//#region src/components/carousel/carousel.ts
|
|
173
|
+
var carousel_exports = /* @__PURE__ */ __exportAll({
|
|
174
|
+
AutoplayIndicator: () => CarouselAutoplayIndicator,
|
|
175
|
+
AutoplayTrigger: () => CarouselAutoplayTrigger,
|
|
176
|
+
Context: () => CarouselContext,
|
|
177
|
+
Control: () => CarouselControl,
|
|
178
|
+
Indicator: () => CarouselIndicator,
|
|
179
|
+
IndicatorGroup: () => CarouselIndicatorGroup,
|
|
180
|
+
Item: () => CarouselItem,
|
|
181
|
+
ItemGroup: () => CarouselItemGroup,
|
|
182
|
+
NextTrigger: () => CarouselNextTrigger,
|
|
183
|
+
PrevTrigger: () => CarouselPrevTrigger,
|
|
184
|
+
ProgressText: () => CarouselProgressText,
|
|
185
|
+
Root: () => CarouselRoot,
|
|
186
|
+
RootProvider: () => CarouselRootProvider
|
|
187
|
+
});
|
|
188
|
+
//#endregion
|
|
189
|
+
export { carousel_exports as Carousel, CarouselAutoplayIndicator, CarouselAutoplayTrigger, CarouselContext, CarouselControl, CarouselIndicator, CarouselIndicatorGroup, CarouselItem, CarouselItemGroup, CarouselNextTrigger, CarouselPrevTrigger, CarouselProgressText, CarouselRoot, CarouselRootProvider, carouselAnatomy, useCarousel, useCarouselContext };
|