@sprawlify/vue 0.0.72 → 0.0.73
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/{collapsible-jX9S7WYj.js → collapsible-SXAS3iFc.js} +1 -1
- package/dist/{collection-DGKjEgOz.js → collection-C_ZHBDQD.js} +1 -1
- package/dist/components/accordion/index.d.ts +15 -15
- package/dist/components/accordion/index.js +4 -4
- package/dist/components/angle-slider/index.d.ts +15 -15
- package/dist/components/angle-slider/index.js +1 -1
- package/dist/components/avatar/index.d.ts +8 -8
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/bottom-sheet/index.d.ts +16 -16
- package/dist/components/bottom-sheet/index.js +4 -4
- package/dist/components/carousel/index.d.ts +22 -22
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/checkbox/index.d.ts +23 -23
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/client-only/index.d.ts +2 -2
- package/dist/components/clipboard/index.d.ts +16 -16
- package/dist/components/clipboard/index.js +1 -1
- package/dist/components/collapsible/index.d.ts +11 -11
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/collection/index.js +1 -1
- package/dist/components/color-picker/index.d.ts +48 -48
- package/dist/components/color-picker/index.js +3 -3
- package/dist/components/combobox/index.d.ts +31 -31
- package/dist/components/combobox/index.js +4 -4
- package/dist/components/date-picker/index.d.ts +42 -42
- package/dist/components/date-picker/index.js +3 -3
- package/dist/components/dialog/index.d.ts +28 -28
- package/dist/components/dialog/index.js +3 -3
- package/dist/components/download-trigger/index.d.ts +2 -2
- package/dist/components/editable/index.d.ts +24 -24
- package/dist/components/editable/index.js +1 -1
- package/dist/components/field/index.d.ts +23 -23
- package/dist/components/fieldset/index.d.ts +12 -12
- package/dist/components/file-upload/index.d.ts +20 -20
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/floating-panel/index.d.ts +19 -19
- package/dist/components/floating-panel/index.js +2 -2
- package/dist/components/focus-trap/index.d.ts +4 -4
- package/dist/components/focus-trap/index.js +1 -1
- package/dist/components/format/index.d.ts +4 -4
- package/dist/components/frame/index.d.ts +6 -6
- package/dist/components/highlight/index.d.ts +4 -4
- package/dist/components/highlight/index.js +1 -1
- package/dist/components/hover-card/index.d.ts +21 -21
- package/dist/components/hover-card/index.js +3 -3
- package/dist/components/image-cropper/index.d.ts +13 -13
- package/dist/components/image-cropper/index.js +1 -1
- package/dist/components/json-tree-view/index.d.ts +7 -7
- package/dist/components/json-tree-view/index.js +5 -5
- package/dist/components/listbox/index.d.ts +22 -22
- package/dist/components/listbox/index.js +2 -2
- package/dist/components/marquee/index.d.ts +20 -20
- package/dist/components/marquee/index.js +1 -1
- package/dist/components/menu/index.d.ts +45 -45
- package/dist/components/menu/index.js +3 -3
- package/dist/components/navigation-menu/index.d.ts +16 -16
- package/dist/components/navigation-menu/index.js +3 -3
- package/dist/components/number-input/index.d.ts +15 -15
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/pagination/index.d.ts +14 -14
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/password-input/index.d.ts +20 -20
- package/dist/components/password-input/index.js +1 -1
- package/dist/components/pin-input/index.d.ts +12 -12
- package/dist/components/pin-input/index.js +1 -1
- package/dist/components/popover/index.d.ts +31 -31
- package/dist/components/popover/index.js +3 -3
- package/dist/components/presence/index.d.ts +1 -1
- package/dist/components/presence/index.js +1 -1
- package/dist/components/progress/index.d.ts +12 -12
- package/dist/components/progress/index.js +1 -1
- package/dist/components/qr-code/index.d.ts +8 -8
- package/dist/components/qr-code/index.js +1 -1
- package/dist/components/radio-group/index.d.ts +15 -15
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/rating-group/index.d.ts +13 -13
- package/dist/components/rating-group/index.js +1 -1
- package/dist/components/scroll-area/index.d.ts +9 -9
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/segment-group/index.d.ts +17 -17
- package/dist/components/segment-group/index.js +1 -1
- package/dist/components/select/index.d.ts +30 -30
- package/dist/components/select/index.js +4 -4
- package/dist/components/signature-pad/index.d.ts +12 -12
- package/dist/components/signature-pad/index.js +1 -1
- package/dist/components/slider/index.d.ts +20 -20
- package/dist/components/slider/index.js +1 -1
- package/dist/components/splitter/index.d.ts +9 -9
- package/dist/components/splitter/index.js +1 -1
- package/dist/components/steps/index.d.ts +17 -17
- package/dist/components/steps/index.js +1 -1
- package/dist/components/switch/index.d.ts +14 -14
- package/dist/components/switch/index.js +1 -1
- package/dist/components/tabs/index.d.ts +14 -14
- package/dist/components/tabs/index.js +3 -3
- package/dist/components/tags-input/index.d.ts +27 -27
- package/dist/components/tags-input/index.js +1 -1
- package/dist/components/timer/index.d.ts +11 -11
- package/dist/components/timer/index.js +1 -1
- package/dist/components/toast/index.d.ts +154 -0
- package/dist/components/toast/index.js +265 -0
- package/dist/components/toggle/index.d.ts +101 -0
- package/dist/components/toggle/index.js +131 -0
- package/dist/components/toggle-group/index.d.ts +127 -0
- package/dist/components/toggle-group/index.js +207 -0
- package/dist/components/tooltip/index.d.ts +201 -0
- package/dist/components/tooltip/index.js +349 -0
- package/dist/components/tour/index.d.ts +308 -0
- package/dist/components/tour/index.js +505 -0
- package/dist/components/tree-view/index.d.ts +1 -1
- package/dist/components/tree-view/index.js +4 -4
- package/dist/{index-B_UiXhk3.d.ts → index-8bjPAUl0.d.ts} +9 -9
- package/dist/{index-xb1q4_02.d.ts → index-BnYwp0nl.d.ts} +7 -7
- package/dist/{index-DwWFWpls.d.ts → index-CmCVWB7e.d.ts} +28 -28
- package/dist/index.d.ts +1 -1
- package/dist/{tree-view-Ctpu5RjE.js → tree-view-N6ShNmpe.js} +4 -4
- package/package.json +22 -2
- /package/dist/{clean-props-D2R4tz5e.js → clean-props-ChPEW0vT.js} +0 -0
- /package/dist/{create-split-props-0RD5_O4P.js → create-split-props-BDJ_VWs3.js} +0 -0
- /package/dist/{presence-B4-UhJY9.js → presence-BK6rPXK7.js} +0 -0
- /package/dist/{use-render-strategy-DA33j31C.js → use-render-strategy-DMa_QmB6.js} +0 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { t as PolymorphicProps } from "../../factory-B5zr8_kk.js";
|
|
2
|
+
import { a as Optional } from "../../types-DIEO6uP3.js";
|
|
3
|
+
import { r as PropTypes } from "../../index-CCRVRFFQ.js";
|
|
4
|
+
import * as vue448 from "vue";
|
|
5
|
+
import { ButtonHTMLAttributes, ComputedRef, HTMLAttributes, SlotsType, UnwrapRef, VNodeChild } from "vue";
|
|
6
|
+
import * as toast from "@sprawlify/primitives/machines/toast";
|
|
7
|
+
import { ActionOptions, ActionOptions as ToastActionOptions, Placement, Placement as ToastPlacement, PromiseOptions, PromiseOptions as ToastPromiseOptions, Status, Status as ToastStatus, StatusChangeDetails, StatusChangeDetails as ToastStatusChangeDetails, StoreProps, StoreProps as ToastStoreProps, Type, Type as ToastType, anatomy as toastAnatomy } from "@sprawlify/primitives/machines/toast";
|
|
8
|
+
|
|
9
|
+
//#region src/components/toast/create-toaster.d.ts
|
|
10
|
+
interface CreateToasterProps extends Optional<Partial<toast.StoreProps>, 'placement'> {
|
|
11
|
+
placement: toast.Placement;
|
|
12
|
+
}
|
|
13
|
+
interface CreateToasterReturn extends toast.Store<VNodeChild> {}
|
|
14
|
+
declare const createToaster: (props: CreateToasterProps) => CreateToasterReturn;
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/components/toast/toast-action-trigger.vue.d.ts
|
|
17
|
+
interface ToastActionTriggerBaseProps extends PolymorphicProps {}
|
|
18
|
+
interface ToastActionTriggerProps extends ToastActionTriggerBaseProps,
|
|
19
|
+
/**
|
|
20
|
+
* @vue-ignore
|
|
21
|
+
*/
|
|
22
|
+
ButtonHTMLAttributes {}
|
|
23
|
+
declare const _default: typeof __VLS_export$6;
|
|
24
|
+
declare const __VLS_export$6: __VLS_WithSlots$6<vue448.DefineComponent<ToastActionTriggerProps, {}, {}, {}, {}, vue448.ComponentOptionsMixin, vue448.ComponentOptionsMixin, {}, string, vue448.PublicProps, Readonly<ToastActionTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, vue448.ComponentProvideOptions, false, {}, any>, {
|
|
25
|
+
default?: (props: {}) => any;
|
|
26
|
+
}>;
|
|
27
|
+
type __VLS_WithSlots$6<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/toast/toast-close-trigger.vue.d.ts
|
|
34
|
+
interface ToastCloseTriggerBaseProps extends PolymorphicProps {}
|
|
35
|
+
interface ToastCloseTriggerProps extends ToastCloseTriggerBaseProps,
|
|
36
|
+
/**
|
|
37
|
+
* @vue-ignore
|
|
38
|
+
*/
|
|
39
|
+
ButtonHTMLAttributes {}
|
|
40
|
+
declare const _default$1: typeof __VLS_export$5;
|
|
41
|
+
declare const __VLS_export$5: __VLS_WithSlots$5<vue448.DefineComponent<ToastCloseTriggerProps, {}, {}, {}, {}, vue448.ComponentOptionsMixin, vue448.ComponentOptionsMixin, {}, string, vue448.PublicProps, Readonly<ToastCloseTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, vue448.ComponentProvideOptions, false, {}, any>, {
|
|
42
|
+
default?: (props: {}) => any;
|
|
43
|
+
}>;
|
|
44
|
+
type __VLS_WithSlots$5<T, S> = T & {
|
|
45
|
+
new (): {
|
|
46
|
+
$slots: S;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/components/toast/use-toast-context.d.ts
|
|
51
|
+
interface UseToastContext extends ComputedRef<toast.Api<PropTypes>> {}
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/toast/toast-context.vue.d.ts
|
|
54
|
+
interface ToastContextProps extends SlotsType<{
|
|
55
|
+
default: UnwrapRef<UseToastContext>;
|
|
56
|
+
}> {}
|
|
57
|
+
declare const _default$2: typeof __VLS_export$4;
|
|
58
|
+
declare const __VLS_export$4: __VLS_WithSlots$4<vue448.DefineComponent<{}, {}, {}, {}, {}, vue448.ComponentOptionsMixin, vue448.ComponentOptionsMixin, {}, string, vue448.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue448.ComponentProvideOptions, true, {}, any>, {
|
|
59
|
+
default(toast: UnwrapRef<UseToastContext>): unknown;
|
|
60
|
+
}>;
|
|
61
|
+
type __VLS_WithSlots$4<T, S> = T & {
|
|
62
|
+
new (): {
|
|
63
|
+
$slots: S;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/components/toast/toast-description.vue.d.ts
|
|
68
|
+
interface ToastDescriptionBaseProps extends PolymorphicProps {}
|
|
69
|
+
interface ToastDescriptionProps extends ToastDescriptionBaseProps,
|
|
70
|
+
/**
|
|
71
|
+
* @vue-ignore
|
|
72
|
+
*/
|
|
73
|
+
HTMLAttributes {}
|
|
74
|
+
declare const _default$3: typeof __VLS_export$3;
|
|
75
|
+
declare const __VLS_export$3: __VLS_WithSlots$3<vue448.DefineComponent<ToastDescriptionProps, {}, {}, {}, {}, vue448.ComponentOptionsMixin, vue448.ComponentOptionsMixin, {}, string, vue448.PublicProps, Readonly<ToastDescriptionProps> & Readonly<{}>, {}, {}, {}, {}, string, vue448.ComponentProvideOptions, false, {}, any>, {
|
|
76
|
+
default?: (props: {}) => any;
|
|
77
|
+
}>;
|
|
78
|
+
type __VLS_WithSlots$3<T, S> = T & {
|
|
79
|
+
new (): {
|
|
80
|
+
$slots: S;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/components/toast/toast-root.vue.d.ts
|
|
85
|
+
interface ToastRootBaseProps extends PolymorphicProps {}
|
|
86
|
+
interface ToastRootProps extends ToastRootBaseProps,
|
|
87
|
+
/**
|
|
88
|
+
* @vue-ignore
|
|
89
|
+
*/
|
|
90
|
+
HTMLAttributes {}
|
|
91
|
+
declare const _default$4: typeof __VLS_export$2;
|
|
92
|
+
declare const __VLS_export$2: __VLS_WithSlots$2<vue448.DefineComponent<ToastRootProps, {}, {}, {}, {}, vue448.ComponentOptionsMixin, vue448.ComponentOptionsMixin, {}, string, vue448.PublicProps, Readonly<ToastRootProps> & Readonly<{}>, {}, {}, {}, {}, string, vue448.ComponentProvideOptions, false, {}, any>, {
|
|
93
|
+
default?: (props: {}) => any;
|
|
94
|
+
}>;
|
|
95
|
+
type __VLS_WithSlots$2<T, S> = T & {
|
|
96
|
+
new (): {
|
|
97
|
+
$slots: S;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/components/toast/toast-title.vue.d.ts
|
|
102
|
+
interface ToastTitleBaseProps extends PolymorphicProps {}
|
|
103
|
+
interface ToastTitleProps extends ToastTitleBaseProps,
|
|
104
|
+
/**
|
|
105
|
+
* @vue-ignore
|
|
106
|
+
*/
|
|
107
|
+
HTMLAttributes {}
|
|
108
|
+
declare const _default$5: typeof __VLS_export$1;
|
|
109
|
+
declare const __VLS_export$1: __VLS_WithSlots$1<vue448.DefineComponent<ToastTitleProps, {}, {}, {}, {}, vue448.ComponentOptionsMixin, vue448.ComponentOptionsMixin, {}, string, vue448.PublicProps, Readonly<ToastTitleProps> & Readonly<{}>, {}, {}, {}, {}, string, vue448.ComponentProvideOptions, false, {}, any>, {
|
|
110
|
+
default?: (props: {}) => any;
|
|
111
|
+
}>;
|
|
112
|
+
type __VLS_WithSlots$1<T, S> = T & {
|
|
113
|
+
new (): {
|
|
114
|
+
$slots: S;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/components/toast/toaster.vue.d.ts
|
|
119
|
+
type ToastOptions = toast.Options<VNodeChild>;
|
|
120
|
+
interface ToasterBaseProps extends PolymorphicProps {
|
|
121
|
+
toaster: CreateToasterReturn;
|
|
122
|
+
}
|
|
123
|
+
interface ToasterProps extends ToasterBaseProps, /** @vue-ignore */HTMLAttributes, /** @vue-ignore */SlotsType<{
|
|
124
|
+
default: ToastOptions;
|
|
125
|
+
}> {}
|
|
126
|
+
declare var __VLS_15: {
|
|
127
|
+
title?: VNodeChild;
|
|
128
|
+
description?: VNodeChild;
|
|
129
|
+
duration?: number | undefined;
|
|
130
|
+
removeDelay?: number | undefined;
|
|
131
|
+
id?: string | undefined;
|
|
132
|
+
type?: toast.Type | undefined;
|
|
133
|
+
onStatusChange?: ((details: toast.StatusChangeDetails) => void) | undefined;
|
|
134
|
+
action?: toast.ActionOptions | undefined;
|
|
135
|
+
closable?: boolean | undefined;
|
|
136
|
+
meta?: Record<string, any> | undefined;
|
|
137
|
+
promise?: Promise<any> | (() => Promise<any>) | undefined;
|
|
138
|
+
};
|
|
139
|
+
type __VLS_Slots = {} & {
|
|
140
|
+
default?: (props: typeof __VLS_15) => any;
|
|
141
|
+
};
|
|
142
|
+
declare const __VLS_base: vue448.DefineComponent<{}, {}, {}, {}, {}, vue448.ComponentOptionsMixin, vue448.ComponentOptionsMixin, {}, string, vue448.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue448.ComponentProvideOptions, false, {}, any>;
|
|
143
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
144
|
+
declare const _default$6: typeof __VLS_export;
|
|
145
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
146
|
+
new (): {
|
|
147
|
+
$slots: S;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
declare namespace toast_d_exports {
|
|
151
|
+
export { ActionOptions, _default as ActionTrigger, ToastActionTriggerBaseProps as ActionTriggerBaseProps, ToastActionTriggerProps as ActionTriggerProps, _default$1 as CloseTrigger, ToastCloseTriggerBaseProps as CloseTriggerBaseProps, ToastCloseTriggerProps as CloseTriggerProps, _default$2 as Context, ToastContextProps as ContextProps, _default$3 as Description, ToastDescriptionBaseProps as DescriptionBaseProps, ToastDescriptionProps as DescriptionProps, ToastOptions as Options, Placement, PromiseOptions, _default$4 as Root, ToastRootBaseProps as RootBaseProps, ToastRootProps as RootProps, Status, StatusChangeDetails, StoreProps, _default$5 as Title, ToastTitleBaseProps as TitleBaseProps, ToastTitleProps as TitleProps, Type };
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
154
|
+
export { type CreateToasterProps, type CreateToasterReturn, toast_d_exports as Toast, type ToastActionOptions, _default as ToastActionTrigger, type ToastActionTriggerBaseProps, type ToastActionTriggerProps, _default$1 as ToastCloseTrigger, type ToastCloseTriggerBaseProps, type ToastCloseTriggerProps, _default$2 as ToastContext, type ToastContextProps, _default$3 as ToastDescription, type ToastDescriptionBaseProps, type ToastDescriptionProps, type ToastOptions, type ToastPlacement, type ToastPromiseOptions, _default$4 as ToastRoot, type ToastRootBaseProps, type ToastRootProps, type ToastStatus, type ToastStatusChangeDetails, type ToastStoreProps, _default$5 as ToastTitle, type ToastTitleBaseProps, type ToastTitleProps, type ToastType, _default$6 as Toaster, type ToasterBaseProps, type ToasterProps, type UseToastContext, createToaster, toastAnatomy, useToastContext };
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BN_g-Awi.js";
|
|
2
|
+
import { n as useMachine, r as normalizeProps$1 } from "../../core-DNndr38p.js";
|
|
3
|
+
import { a as useLocaleContext, c as useEnvironmentContext, i as DEFAULT_LOCALE, s as DEFAULT_ENVIRONMENT } from "../../providers-DNBWT-O_.js";
|
|
4
|
+
import { t as createContext } from "../../create-context-Ds1GbsVc.js";
|
|
5
|
+
import { t as useForwardExpose } from "../../use-forward-expose-CCAmHTUB.js";
|
|
6
|
+
import { t as sprawlify } from "../../factory-Co08Aw8u.js";
|
|
7
|
+
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderList, renderSlot, unref, useId, withCtx } from "vue";
|
|
8
|
+
import * as toast from "@sprawlify/primitives/machines/toast";
|
|
9
|
+
import { anatomy as toastAnatomy } from "@sprawlify/primitives/machines/toast";
|
|
10
|
+
|
|
11
|
+
//#region src/components/toast/create-toaster.ts
|
|
12
|
+
const createToaster = (props) => {
|
|
13
|
+
return toast.createStore(props);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/toast/use-toast-context.ts
|
|
18
|
+
const [ToastProvider, useToastContext] = createContext("ToastContext");
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/components/toast/toast-action-trigger.vue?vue&type=script&setup=true&lang.ts
|
|
22
|
+
var toast_action_trigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
23
|
+
__name: "toast-action-trigger",
|
|
24
|
+
props: { asChild: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
required: false
|
|
27
|
+
} },
|
|
28
|
+
setup(__props) {
|
|
29
|
+
const toast = useToastContext();
|
|
30
|
+
useForwardExpose();
|
|
31
|
+
return (_ctx, _cache) => {
|
|
32
|
+
return openBlock(), createBlock(unref(sprawlify).button, mergeProps(unref(toast).getActionTriggerProps(), { "as-child": __props.asChild }), {
|
|
33
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
34
|
+
_: 3
|
|
35
|
+
}, 16, ["as-child"]);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/components/toast/toast-action-trigger.vue
|
|
42
|
+
var toast_action_trigger_default = toast_action_trigger_vue_vue_type_script_setup_true_lang_default;
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/components/toast/toast-close-trigger.vue?vue&type=script&setup=true&lang.ts
|
|
46
|
+
var toast_close_trigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
47
|
+
__name: "toast-close-trigger",
|
|
48
|
+
props: { asChild: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
required: false
|
|
51
|
+
} },
|
|
52
|
+
setup(__props) {
|
|
53
|
+
const toast = useToastContext();
|
|
54
|
+
useForwardExpose();
|
|
55
|
+
return (_ctx, _cache) => {
|
|
56
|
+
return openBlock(), createBlock(unref(sprawlify).button, mergeProps(unref(toast).getCloseTriggerProps(), { "as-child": __props.asChild }), {
|
|
57
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
58
|
+
_: 3
|
|
59
|
+
}, 16, ["as-child"]);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/components/toast/toast-close-trigger.vue
|
|
66
|
+
var toast_close_trigger_default = toast_close_trigger_vue_vue_type_script_setup_true_lang_default;
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/components/toast/toast-context.vue?vue&type=script&setup=true&lang.ts
|
|
70
|
+
var toast_context_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
71
|
+
__name: "toast-context",
|
|
72
|
+
setup(__props) {
|
|
73
|
+
const toast = useToastContext();
|
|
74
|
+
return (_ctx, _cache) => {
|
|
75
|
+
return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(toast))));
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/components/toast/toast-context.vue
|
|
82
|
+
var toast_context_default = toast_context_vue_vue_type_script_setup_true_lang_default;
|
|
83
|
+
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/components/toast/toast-description.vue?vue&type=script&setup=true&lang.ts
|
|
86
|
+
var toast_description_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
87
|
+
__name: "toast-description",
|
|
88
|
+
props: { asChild: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
required: false
|
|
91
|
+
} },
|
|
92
|
+
setup(__props) {
|
|
93
|
+
const toast = useToastContext();
|
|
94
|
+
useForwardExpose();
|
|
95
|
+
return (_ctx, _cache) => {
|
|
96
|
+
return openBlock(), createBlock(unref(sprawlify).div, mergeProps(unref(toast).getDescriptionProps(), { "as-child": __props.asChild }), {
|
|
97
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
98
|
+
_: 3
|
|
99
|
+
}, 16, ["as-child"]);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/components/toast/toast-description.vue
|
|
106
|
+
var toast_description_default = toast_description_vue_vue_type_script_setup_true_lang_default;
|
|
107
|
+
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/components/toast/toast-root.vue?vue&type=script&setup=true&lang.ts
|
|
110
|
+
var toast_root_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
111
|
+
__name: "toast-root",
|
|
112
|
+
props: { asChild: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
required: false
|
|
115
|
+
} },
|
|
116
|
+
setup(__props) {
|
|
117
|
+
const toast = useToastContext();
|
|
118
|
+
useForwardExpose();
|
|
119
|
+
return (_ctx, _cache) => {
|
|
120
|
+
return openBlock(), createBlock(unref(sprawlify).div, mergeProps(unref(toast).getRootProps(), { "as-child": __props.asChild }), {
|
|
121
|
+
default: withCtx(() => [
|
|
122
|
+
createElementVNode("div", normalizeProps(guardReactiveProps(unref(toast).getGhostBeforeProps())), null, 16),
|
|
123
|
+
renderSlot(_ctx.$slots, "default"),
|
|
124
|
+
createElementVNode("div", normalizeProps(guardReactiveProps(unref(toast).getGhostAfterProps())), null, 16)
|
|
125
|
+
]),
|
|
126
|
+
_: 3
|
|
127
|
+
}, 16, ["as-child"]);
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/components/toast/toast-root.vue
|
|
134
|
+
var toast_root_default = toast_root_vue_vue_type_script_setup_true_lang_default;
|
|
135
|
+
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/components/toast/toast-title.vue?vue&type=script&setup=true&lang.ts
|
|
138
|
+
var toast_title_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
139
|
+
__name: "toast-title",
|
|
140
|
+
props: { asChild: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
required: false
|
|
143
|
+
} },
|
|
144
|
+
setup(__props) {
|
|
145
|
+
const toast = useToastContext();
|
|
146
|
+
useForwardExpose();
|
|
147
|
+
return (_ctx, _cache) => {
|
|
148
|
+
return openBlock(), createBlock(unref(sprawlify).div, mergeProps(unref(toast).getTitleProps(), { "as-child": __props.asChild }), {
|
|
149
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
150
|
+
_: 3
|
|
151
|
+
}, 16, ["as-child"]);
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/components/toast/toast-title.vue
|
|
158
|
+
var toast_title_default = toast_title_vue_vue_type_script_setup_true_lang_default;
|
|
159
|
+
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/components/toast/toaster-item.vue?vue&type=script&setup=true&lang.ts
|
|
162
|
+
var toaster_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
163
|
+
__name: "toaster-item",
|
|
164
|
+
props: {
|
|
165
|
+
value: {
|
|
166
|
+
type: null,
|
|
167
|
+
required: true
|
|
168
|
+
},
|
|
169
|
+
index: {
|
|
170
|
+
type: Number,
|
|
171
|
+
required: true
|
|
172
|
+
},
|
|
173
|
+
parent: {
|
|
174
|
+
type: null,
|
|
175
|
+
required: true
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
setup(__props) {
|
|
179
|
+
const props = __props;
|
|
180
|
+
const env = useEnvironmentContext(DEFAULT_ENVIRONMENT);
|
|
181
|
+
const machineProps = computed(() => ({
|
|
182
|
+
...props.value,
|
|
183
|
+
index: props.index,
|
|
184
|
+
parent: props.parent,
|
|
185
|
+
getRootNode: env?.value.getRootNode
|
|
186
|
+
}));
|
|
187
|
+
const service = useMachine(toast.machine, machineProps);
|
|
188
|
+
ToastProvider(computed(() => toast.connect(service, normalizeProps$1)));
|
|
189
|
+
useForwardExpose();
|
|
190
|
+
return (_ctx, _cache) => {
|
|
191
|
+
return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(props.value)));
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region src/components/toast/toaster-item.vue
|
|
198
|
+
var toaster_item_default = toaster_item_vue_vue_type_script_setup_true_lang_default;
|
|
199
|
+
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/components/toast/toaster.vue?vue&type=script&setup=true&lang.ts
|
|
202
|
+
var toaster_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
203
|
+
__name: "toaster",
|
|
204
|
+
props: {
|
|
205
|
+
toaster: {
|
|
206
|
+
type: Object,
|
|
207
|
+
required: true
|
|
208
|
+
},
|
|
209
|
+
asChild: {
|
|
210
|
+
type: Boolean,
|
|
211
|
+
required: false
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
setup(__props) {
|
|
215
|
+
const props = __props;
|
|
216
|
+
const locale = useLocaleContext(DEFAULT_LOCALE);
|
|
217
|
+
const env = useEnvironmentContext(DEFAULT_ENVIRONMENT);
|
|
218
|
+
const service = useMachine(toast.group.machine, {
|
|
219
|
+
store: props.toaster,
|
|
220
|
+
id: useId(),
|
|
221
|
+
dir: locale?.value.dir,
|
|
222
|
+
getRootNode: env?.value.getRootNode
|
|
223
|
+
});
|
|
224
|
+
const api = computed(() => toast.group.connect(service, normalizeProps$1));
|
|
225
|
+
useForwardExpose();
|
|
226
|
+
return (_ctx, _cache) => {
|
|
227
|
+
return openBlock(), createBlock(unref(sprawlify).div, normalizeProps(guardReactiveProps(api.value.getGroupProps())), {
|
|
228
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(api.value.getToasts(), (toastItem, index) => {
|
|
229
|
+
return openBlock(), createBlock(toaster_item_default, {
|
|
230
|
+
key: toastItem.id,
|
|
231
|
+
value: toastItem,
|
|
232
|
+
parent: unref(service),
|
|
233
|
+
index
|
|
234
|
+
}, {
|
|
235
|
+
default: withCtx((slotProps) => [renderSlot(_ctx.$slots, "default", mergeProps({ ref_for: true }, slotProps))]),
|
|
236
|
+
_: 3
|
|
237
|
+
}, 8, [
|
|
238
|
+
"value",
|
|
239
|
+
"parent",
|
|
240
|
+
"index"
|
|
241
|
+
]);
|
|
242
|
+
}), 128))]),
|
|
243
|
+
_: 3
|
|
244
|
+
}, 16);
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region src/components/toast/toaster.vue
|
|
251
|
+
var toaster_default = toaster_vue_vue_type_script_setup_true_lang_default;
|
|
252
|
+
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/components/toast/toast.ts
|
|
255
|
+
var toast_exports = /* @__PURE__ */ __exportAll({
|
|
256
|
+
ActionTrigger: () => toast_action_trigger_default,
|
|
257
|
+
CloseTrigger: () => toast_close_trigger_default,
|
|
258
|
+
Context: () => toast_context_default,
|
|
259
|
+
Description: () => toast_description_default,
|
|
260
|
+
Root: () => toast_root_default,
|
|
261
|
+
Title: () => toast_title_default
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
//#endregion
|
|
265
|
+
export { toast_exports as Toast, toast_action_trigger_default as ToastActionTrigger, toast_close_trigger_default as ToastCloseTrigger, toast_context_default as ToastContext, toast_description_default as ToastDescription, toast_root_default as ToastRoot, toast_title_default as ToastTitle, toaster_default as Toaster, createToaster, toastAnatomy, useToastContext };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { t as PolymorphicProps } from "../../factory-B5zr8_kk.js";
|
|
2
|
+
import { r as EmitFn$1 } from "../../types-DIEO6uP3.js";
|
|
3
|
+
import { r as PropTypes } from "../../index-CCRVRFFQ.js";
|
|
4
|
+
import * as vue1884 from "vue";
|
|
5
|
+
import { ButtonHTMLAttributes, ComputedRef, HTMLAttributes, MaybeRef, SlotsType, UnwrapRef } from "vue";
|
|
6
|
+
import * as _sprawlify_primitives_anatomy7 from "@sprawlify/primitives/anatomy";
|
|
7
|
+
import * as toggle from "@sprawlify/primitives/machines/toggle";
|
|
8
|
+
|
|
9
|
+
//#region src/components/toggle/toggle-types.d.ts
|
|
10
|
+
interface RootProps {
|
|
11
|
+
defaultPressed?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
pressed?: boolean;
|
|
14
|
+
}
|
|
15
|
+
type RootEmits = {
|
|
16
|
+
pressedChange: [pressed: boolean];
|
|
17
|
+
'update:pressed': [pressed: boolean];
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/components/toggle/toggle-root.vue.d.ts
|
|
21
|
+
interface ToggleRootBaseProps extends RootProps, PolymorphicProps {}
|
|
22
|
+
interface ToggleRootProps extends ToggleRootBaseProps,
|
|
23
|
+
/**
|
|
24
|
+
* @vue-ignore
|
|
25
|
+
*/
|
|
26
|
+
Omit<ButtonHTMLAttributes, 'disabled'> {}
|
|
27
|
+
interface ToggleRootEmits extends RootEmits {}
|
|
28
|
+
declare var __VLS_8$1: {};
|
|
29
|
+
type __VLS_Slots$1 = {} & {
|
|
30
|
+
default?: (props: typeof __VLS_8$1) => any;
|
|
31
|
+
};
|
|
32
|
+
declare const __VLS_base$1: vue1884.DefineComponent<ToggleRootProps, {}, {}, {}, {}, vue1884.ComponentOptionsMixin, vue1884.ComponentOptionsMixin, {
|
|
33
|
+
pressedChange: (pressed: boolean) => any;
|
|
34
|
+
"update:pressed": (pressed: boolean) => any;
|
|
35
|
+
}, string, vue1884.PublicProps, Readonly<ToggleRootProps> & Readonly<{
|
|
36
|
+
onPressedChange?: ((pressed: boolean) => any) | undefined;
|
|
37
|
+
"onUpdate:pressed"?: ((pressed: boolean) => any) | undefined;
|
|
38
|
+
}>, {
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
defaultPressed: boolean;
|
|
41
|
+
pressed: boolean;
|
|
42
|
+
}, {}, {}, {}, string, vue1884.ComponentProvideOptions, false, {}, any>;
|
|
43
|
+
declare const __VLS_export$2: __VLS_WithSlots$2<typeof __VLS_base$1, __VLS_Slots$1>;
|
|
44
|
+
declare const _default$2: typeof __VLS_export$2;
|
|
45
|
+
type __VLS_WithSlots$2<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/components/toggle/toggle-indicator.vue.d.ts
|
|
52
|
+
interface ToggleIndicatorBaseProps extends PolymorphicProps {}
|
|
53
|
+
interface ToggleIndicatorProps extends ToggleIndicatorBaseProps,
|
|
54
|
+
/**
|
|
55
|
+
* @vue-ignore
|
|
56
|
+
*/
|
|
57
|
+
HTMLAttributes {}
|
|
58
|
+
declare var __VLS_8: {}, __VLS_10: {};
|
|
59
|
+
type __VLS_Slots = {} & {
|
|
60
|
+
default?: (props: typeof __VLS_8) => any;
|
|
61
|
+
} & {
|
|
62
|
+
fallback?: (props: typeof __VLS_10) => any;
|
|
63
|
+
};
|
|
64
|
+
declare const __VLS_base: vue1884.DefineComponent<ToggleIndicatorProps, {}, {}, {}, {}, vue1884.ComponentOptionsMixin, vue1884.ComponentOptionsMixin, {}, string, vue1884.PublicProps, Readonly<ToggleIndicatorProps> & Readonly<{}>, {}, {}, {}, {}, string, vue1884.ComponentProvideOptions, false, {}, any>;
|
|
65
|
+
declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base, __VLS_Slots>;
|
|
66
|
+
declare const _default$1: typeof __VLS_export$1;
|
|
67
|
+
type __VLS_WithSlots$1<T, S> = T & {
|
|
68
|
+
new (): {
|
|
69
|
+
$slots: S;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/components/toggle/use-toggle.d.ts
|
|
74
|
+
interface UseToggleProps extends toggle.Props {}
|
|
75
|
+
interface UseToggleReturn extends ComputedRef<toggle.Api<PropTypes>> {}
|
|
76
|
+
declare function useToggle(props: MaybeRef<UseToggleProps>, emit?: EmitFn$1<RootEmits>): UseToggleReturn;
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/components/toggle/use-toggle-context.d.ts
|
|
79
|
+
interface UseToggleContext extends UseToggleReturn {}
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/components/toggle/toggle-anatomy.d.ts
|
|
82
|
+
declare const toggleAnatomy: _sprawlify_primitives_anatomy7.Anatomy<"root" | "indicator">;
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/components/toggle/toggle-context.vue.d.ts
|
|
85
|
+
interface ToggleContextProps extends SlotsType<{
|
|
86
|
+
default: UnwrapRef<UseToggleContext>;
|
|
87
|
+
}> {}
|
|
88
|
+
declare const _default: typeof __VLS_export;
|
|
89
|
+
declare const __VLS_export: __VLS_WithSlots<vue1884.DefineComponent<{}, {}, {}, {}, {}, vue1884.ComponentOptionsMixin, vue1884.ComponentOptionsMixin, {}, string, vue1884.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue1884.ComponentProvideOptions, true, {}, any>, {
|
|
90
|
+
default(toggle: UnwrapRef<UseToggleContext>): unknown;
|
|
91
|
+
}>;
|
|
92
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
93
|
+
new (): {
|
|
94
|
+
$slots: S;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
declare namespace toggle_d_exports {
|
|
98
|
+
export { _default as Context, ToggleContextProps as ContextProps, _default$1 as Indicator, ToggleIndicatorBaseProps as IndicatorBaseProps, ToggleIndicatorProps as IndicatorProps, _default$2 as Root, ToggleRootBaseProps as RootBaseProps, ToggleRootEmits as RootEmits, ToggleRootProps as RootProps };
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
export { toggle_d_exports as Toggle, _default as ToggleContext, type ToggleContextProps, _default$1 as ToggleIndicator, type ToggleIndicatorBaseProps, type ToggleIndicatorProps, _default$2 as ToggleRoot, type ToggleRootBaseProps, type ToggleRootEmits, type ToggleRootProps, type UseToggleContext, type UseToggleProps, type UseToggleReturn, toggleAnatomy, useToggle, useToggleContext };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../chunk-BN_g-Awi.js";
|
|
2
|
+
import { n as useMachine, r as normalizeProps$1 } from "../../core-DNndr38p.js";
|
|
3
|
+
import { t as createContext } from "../../create-context-Ds1GbsVc.js";
|
|
4
|
+
import { t as useForwardExpose } from "../../use-forward-expose-CCAmHTUB.js";
|
|
5
|
+
import { t as sprawlify } from "../../factory-Co08Aw8u.js";
|
|
6
|
+
import { t as cleanProps } from "../../clean-props-ChPEW0vT.js";
|
|
7
|
+
import { computed, createBlock, createCommentVNode, defineComponent, guardReactiveProps, mergeDefaults, mergeProps, normalizeProps, openBlock, renderSlot, toValue, unref, withCtx } from "vue";
|
|
8
|
+
import { createAnatomy } from "@sprawlify/primitives/anatomy";
|
|
9
|
+
import * as toggle from "@sprawlify/primitives/machines/toggle";
|
|
10
|
+
|
|
11
|
+
//#region src/components/toggle/use-toggle.ts
|
|
12
|
+
function useToggle(props, emit) {
|
|
13
|
+
const machineProps = computed(() => {
|
|
14
|
+
const localProps = toValue(props);
|
|
15
|
+
return {
|
|
16
|
+
...cleanProps(localProps),
|
|
17
|
+
onPressedChange: (value) => {
|
|
18
|
+
emit?.("pressedChange", value);
|
|
19
|
+
emit?.("update:pressed", value);
|
|
20
|
+
localProps.onPressedChange?.(value);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
const service = useMachine(toggle.machine, machineProps);
|
|
25
|
+
return computed(() => toggle.connect(service, normalizeProps$1));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/toggle/use-toggle-context.ts
|
|
30
|
+
const [ToggleProvider, useToggleContext] = createContext("ToggleContext");
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/toggle/toggle-root.vue?vue&type=script&setup=true&lang.ts
|
|
34
|
+
var toggle_root_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
35
|
+
__name: "toggle-root",
|
|
36
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
37
|
+
defaultPressed: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
required: false
|
|
40
|
+
},
|
|
41
|
+
disabled: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
required: false
|
|
44
|
+
},
|
|
45
|
+
pressed: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
required: false
|
|
48
|
+
},
|
|
49
|
+
asChild: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
required: false
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
disabled: void 0,
|
|
55
|
+
defaultPressed: void 0,
|
|
56
|
+
pressed: void 0
|
|
57
|
+
}),
|
|
58
|
+
emits: ["pressedChange", "update:pressed"],
|
|
59
|
+
setup(__props, { emit: __emit }) {
|
|
60
|
+
const toggle = useToggle(__props, __emit);
|
|
61
|
+
ToggleProvider(toggle);
|
|
62
|
+
useForwardExpose();
|
|
63
|
+
return (_ctx, _cache) => {
|
|
64
|
+
return openBlock(), createBlock(unref(sprawlify).button, mergeProps(unref(toggle).getRootProps(), { "as-child": __props.asChild }), {
|
|
65
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
66
|
+
_: 3
|
|
67
|
+
}, 16, ["as-child"]);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/components/toggle/toggle-root.vue
|
|
74
|
+
var toggle_root_default = toggle_root_vue_vue_type_script_setup_true_lang_default;
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/components/toggle/toggle-indicator.vue?vue&type=script&setup=true&lang.ts
|
|
78
|
+
var toggle_indicator_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
79
|
+
__name: "toggle-indicator",
|
|
80
|
+
props: { asChild: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
required: false
|
|
83
|
+
} },
|
|
84
|
+
setup(__props) {
|
|
85
|
+
const toggle = useToggleContext();
|
|
86
|
+
const fallback = computed(() => !toggle.value.pressed);
|
|
87
|
+
useForwardExpose();
|
|
88
|
+
return (_ctx, _cache) => {
|
|
89
|
+
return openBlock(), createBlock(unref(sprawlify).span, mergeProps(unref(toggle).getIndicatorProps(), { "as-child": __props.asChild }), {
|
|
90
|
+
default: withCtx(() => [!fallback.value ? renderSlot(_ctx.$slots, "default", { key: 0 }) : renderSlot(_ctx.$slots, "fallback", { key: 1 })]),
|
|
91
|
+
_: 3
|
|
92
|
+
}, 16, ["as-child"]);
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/components/toggle/toggle-indicator.vue
|
|
99
|
+
var toggle_indicator_default = toggle_indicator_vue_vue_type_script_setup_true_lang_default;
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/components/toggle/toggle-anatomy.ts
|
|
103
|
+
const toggleAnatomy = createAnatomy("toggle", ["root", "indicator"]);
|
|
104
|
+
const parts = toggleAnatomy.build();
|
|
105
|
+
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/components/toggle/toggle-context.vue?vue&type=script&setup=true&lang.ts
|
|
108
|
+
var toggle_context_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
109
|
+
__name: "toggle-context",
|
|
110
|
+
setup(__props) {
|
|
111
|
+
const toggle = useToggleContext();
|
|
112
|
+
return (_ctx, _cache) => {
|
|
113
|
+
return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(toggle))));
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/components/toggle/toggle-context.vue
|
|
120
|
+
var toggle_context_default = toggle_context_vue_vue_type_script_setup_true_lang_default;
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/components/toggle/toggle.ts
|
|
124
|
+
var toggle_exports = /* @__PURE__ */ __exportAll({
|
|
125
|
+
Context: () => toggle_context_default,
|
|
126
|
+
Indicator: () => toggle_indicator_default,
|
|
127
|
+
Root: () => toggle_root_default
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
//#endregion
|
|
131
|
+
export { toggle_exports as Toggle, toggle_context_default as ToggleContext, toggle_indicator_default as ToggleIndicator, toggle_root_default as ToggleRoot, toggleAnatomy, useToggle, useToggleContext };
|