@sprawlify/vue 0.0.67 → 0.0.72
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/boolean-CpMsIRK4.js +7 -0
- package/dist/{collapsible-DQfAISmg.js → collapsible-jX9S7WYj.js} +5 -4
- package/dist/{collection-Ba0Aeh5P.js → collection-DGKjEgOz.js} +1 -1
- package/dist/components/accordion/index.d.ts +19 -19
- package/dist/components/accordion/index.js +8 -7
- package/dist/components/angle-slider/index.d.ts +18 -18
- package/dist/components/angle-slider/index.js +5 -4
- package/dist/components/avatar/index.d.ts +11 -11
- package/dist/components/avatar/index.js +5 -4
- package/dist/components/bottom-sheet/index.d.ts +22 -22
- package/dist/components/bottom-sheet/index.js +8 -7
- package/dist/components/carousel/index.d.ts +25 -25
- package/dist/components/carousel/index.js +5 -4
- package/dist/components/checkbox/index.d.ts +27 -27
- package/dist/components/checkbox/index.js +8 -12
- package/dist/components/client-only/index.d.ts +2 -2
- package/dist/components/clipboard/index.d.ts +17 -17
- package/dist/components/clipboard/index.js +5 -4
- package/dist/components/collapsible/index.d.ts +16 -16
- package/dist/components/collapsible/index.js +5 -4
- package/dist/components/collection/index.d.ts +1 -1
- package/dist/components/collection/index.js +1 -1
- package/dist/components/color-picker/index.d.ts +56 -56
- package/dist/components/color-picker/index.js +8 -7
- package/dist/components/combobox/index.d.ts +38 -38
- package/dist/components/combobox/index.js +9 -8
- package/dist/components/date-picker/index.d.ts +47 -47
- package/dist/components/date-picker/index.js +7 -6
- package/dist/components/dialog/index.d.ts +35 -35
- package/dist/components/dialog/index.js +7 -6
- package/dist/components/download-trigger/index.d.ts +4 -4
- package/dist/components/download-trigger/index.js +4 -3
- package/dist/components/editable/index.d.ts +29 -29
- package/dist/components/editable/index.js +6 -5
- package/dist/components/field/index.d.ts +25 -25
- package/dist/components/field/index.js +5 -4
- package/dist/components/fieldset/index.d.ts +13 -13
- package/dist/components/fieldset/index.js +5 -4
- package/dist/components/file-upload/index.d.ts +329 -0
- package/dist/components/file-upload/index.js +597 -0
- package/dist/components/floating-panel/index.d.ts +325 -0
- package/dist/components/floating-panel/index.js +568 -0
- package/dist/components/focus-trap/index.d.ts +48 -0
- package/dist/components/focus-trap/index.js +96 -0
- package/dist/components/format/index.d.ts +40 -0
- package/dist/components/format/index.js +148 -0
- package/dist/components/frame/index.d.ts +39 -0
- package/dist/components/frame/index.js +111 -0
- 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 +200 -0
- package/dist/components/hover-card/index.js +335 -0
- package/dist/components/image-cropper/index.d.ts +211 -0
- package/dist/components/image-cropper/index.js +381 -0
- package/dist/components/json-tree-view/index.d.ts +91 -0
- package/dist/components/json-tree-view/index.js +490 -0
- package/dist/components/listbox/index.d.ts +325 -0
- package/dist/components/listbox/index.js +533 -0
- package/dist/components/marquee/index.d.ts +268 -0
- package/dist/components/marquee/index.js +340 -0
- package/dist/components/menu/index.d.ts +55 -56
- package/dist/components/menu/index.js +7 -6
- package/dist/components/navigation-menu/index.d.ts +272 -0
- package/dist/components/navigation-menu/index.js +559 -0
- package/dist/components/number-input/index.d.ts +253 -0
- package/dist/components/number-input/index.js +427 -0
- package/dist/components/pagination/index.d.ts +211 -0
- package/dist/components/pagination/index.js +346 -0
- package/dist/components/password-input/index.d.ts +213 -0
- package/dist/components/password-input/index.js +325 -0
- package/dist/components/pin-input/index.d.ts +198 -0
- package/dist/components/pin-input/index.js +346 -0
- package/dist/components/popover/index.d.ts +318 -0
- package/dist/components/popover/index.js +486 -0
- package/dist/components/presence/index.d.ts +2 -2
- package/dist/components/presence/index.js +4 -3
- package/dist/components/progress/index.d.ts +231 -0
- package/dist/components/progress/index.js +372 -0
- package/dist/components/qr-code/index.d.ts +159 -0
- package/dist/components/qr-code/index.js +263 -0
- package/dist/components/radio-group/index.d.ts +231 -0
- package/dist/components/radio-group/index.js +378 -0
- package/dist/components/rating-group/index.d.ts +201 -0
- package/dist/components/rating-group/index.js +330 -0
- package/dist/components/scroll-area/index.d.ts +171 -0
- package/dist/components/scroll-area/index.js +264 -0
- package/dist/components/segment-group/index.d.ts +231 -0
- package/dist/components/segment-group/index.js +422 -0
- package/dist/components/select/index.d.ts +39 -39
- package/dist/components/select/index.js +9 -8
- package/dist/components/signature-pad/index.d.ts +202 -0
- package/dist/components/signature-pad/index.js +345 -0
- package/dist/components/slider/index.d.ts +300 -0
- package/dist/components/slider/index.js +511 -0
- package/dist/components/splitter/index.d.ts +162 -0
- package/dist/components/splitter/index.js +280 -0
- package/dist/components/steps/index.d.ts +290 -0
- package/dist/components/steps/index.js +469 -0
- package/dist/components/switch/index.d.ts +179 -0
- package/dist/components/switch/index.js +290 -0
- package/dist/components/tabs/index.d.ts +181 -0
- package/dist/components/tabs/index.js +335 -0
- package/dist/components/tags-input/index.d.ts +339 -0
- package/dist/components/tags-input/index.js +569 -0
- package/dist/components/timer/index.d.ts +177 -0
- package/dist/components/timer/index.js +295 -0
- package/dist/components/tree-view/index.d.ts +6 -0
- package/dist/components/tree-view/index.js +11 -0
- package/dist/create-context-Ds1GbsVc.js +16 -0
- package/dist/{field-DnHnX3Tf.js → field-CtPR24u6.js} +4 -3
- package/dist/{fieldset-DzhN7Zrg.js → fieldset-D5SznrKY.js} +4 -3
- package/dist/{index-CDQghZtv.d.ts → index-B_UiXhk3.d.ts} +11 -11
- package/dist/index-DwWFWpls.d.ts +447 -0
- package/dist/{index-BBHms9-0.d.ts → index-xb1q4_02.d.ts} +7 -7
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -2
- package/dist/{presence-CvUnYMZQ.js → presence-B4-UhJY9.js} +3 -2
- package/dist/{providers-B2CNPFg1.js → providers-DNBWT-O_.js} +1 -1
- package/dist/tree-view-Ctpu5RjE.js +737 -0
- package/dist/{use-forward-expose-4p5AGAI3.js → use-forward-expose-CCAmHTUB.js} +2 -15
- package/dist/{use-render-strategy-BkxoN6ll.js → use-render-strategy-DA33j31C.js} +1 -1
- package/package.json +126 -2
- /package/dist/{clean-props-BDv2zb5M.js → clean-props-D2R4tz5e.js} +0 -0
- /package/dist/{create-split-props-YZ3qgXe_.js → create-split-props-0RD5_O4P.js} +0 -0
- /package/dist/{factory-D_ge_w76.d.ts → factory-B5zr8_kk.d.ts} +0 -0
- /package/dist/{factory-BH3WrWd2.js → factory-Co08Aw8u.js} +0 -0
- /package/dist/{index-B66Om_3U.d.ts → index-CCRVRFFQ.d.ts} +0 -0
- /package/dist/{index-DqRk-Yea.d.ts → index-DhFoJHfp.d.ts} +0 -0
- /package/dist/{presence-types-Bv1E60Cw.d.ts → presence-types-BJRr8tqd.d.ts} +0 -0
- /package/dist/{types-Bj-dS2Hc.d.ts → types-DIEO6uP3.d.ts} +0 -0
- /package/dist/{use-render-strategy-CHj_pCfT.d.ts → use-render-strategy-U5NxU252.d.ts} +0 -0
|
@@ -0,0 +1,378 @@
|
|
|
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 { t as cleanProps } from "../../clean-props-D2R4tz5e.js";
|
|
8
|
+
import { t as toBooleanValue } from "../../boolean-CpMsIRK4.js";
|
|
9
|
+
import { u as useFieldsetContext } from "../../fieldset-D5SznrKY.js";
|
|
10
|
+
import { computed, createBlock, defineComponent, guardReactiveProps, mergeDefaults, mergeProps, normalizeProps, openBlock, renderSlot, toValue, unref, useId, withCtx } from "vue";
|
|
11
|
+
import * as radioGroup from "@sprawlify/primitives/machines/radio-group";
|
|
12
|
+
import { anatomy as radioGroupAnatomy } from "@sprawlify/primitives/machines/radio-group";
|
|
13
|
+
|
|
14
|
+
//#region src/components/radio-group/use-radio-group-context.ts
|
|
15
|
+
const [RadioGroupProvider, useRadioGroupContext] = createContext("RadioGroupContext");
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/radio-group/radio-group-context.vue?vue&type=script&setup=true&lang.ts
|
|
19
|
+
var radio_group_context_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
20
|
+
__name: "radio-group-context",
|
|
21
|
+
setup(__props) {
|
|
22
|
+
const radioGroup = useRadioGroupContext();
|
|
23
|
+
return (_ctx, _cache) => {
|
|
24
|
+
return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(radioGroup))));
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/radio-group/radio-group-context.vue
|
|
31
|
+
var radio_group_context_default = radio_group_context_vue_vue_type_script_setup_true_lang_default;
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/components/radio-group/radio-group-indicator.vue?vue&type=script&setup=true&lang.ts
|
|
35
|
+
var radio_group_indicator_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
36
|
+
__name: "radio-group-indicator",
|
|
37
|
+
props: { asChild: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
required: false
|
|
40
|
+
} },
|
|
41
|
+
setup(__props) {
|
|
42
|
+
const radioGroup = useRadioGroupContext();
|
|
43
|
+
useForwardExpose();
|
|
44
|
+
return (_ctx, _cache) => {
|
|
45
|
+
return openBlock(), createBlock(unref(sprawlify).div, mergeProps(unref(radioGroup).getIndicatorProps(), { "as-child": __props.asChild }), {
|
|
46
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
47
|
+
_: 3
|
|
48
|
+
}, 16, ["as-child"]);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/components/radio-group/radio-group-indicator.vue
|
|
55
|
+
var radio_group_indicator_default = radio_group_indicator_vue_vue_type_script_setup_true_lang_default;
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/components/radio-group/use-radio-group-item-context.ts
|
|
59
|
+
const [RadioGroupItemProvider, useRadioGroupItemContext] = createContext("RadioGroupItemContext");
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/components/radio-group/radio-group-item-context.vue?vue&type=script&setup=true&lang.ts
|
|
63
|
+
var radio_group_item_context_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
64
|
+
__name: "radio-group-item-context",
|
|
65
|
+
setup(__props) {
|
|
66
|
+
const item = useRadioGroupItemContext();
|
|
67
|
+
return (_ctx, _cache) => {
|
|
68
|
+
return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(item))));
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/components/radio-group/radio-group-item-context.vue
|
|
75
|
+
var radio_group_item_context_default = radio_group_item_context_vue_vue_type_script_setup_true_lang_default;
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/components/radio-group/use-radio-group-item-props-context.ts
|
|
79
|
+
const [RadioGroupItemPropsProvider, useRadioGroupItemPropsContext] = createContext("RadioGroupItemPropsContext");
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/components/radio-group/radio-group-item-control.vue?vue&type=script&setup=true&lang.ts
|
|
83
|
+
var radio_group_item_control_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
84
|
+
__name: "radio-group-item-control",
|
|
85
|
+
props: { asChild: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
required: false
|
|
88
|
+
} },
|
|
89
|
+
setup(__props) {
|
|
90
|
+
const radioGroup = useRadioGroupContext();
|
|
91
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
92
|
+
useForwardExpose();
|
|
93
|
+
return (_ctx, _cache) => {
|
|
94
|
+
return openBlock(), createBlock(unref(sprawlify).div, mergeProps(unref(radioGroup).getItemControlProps(unref(itemProps)), { "as-child": __props.asChild }), {
|
|
95
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
96
|
+
_: 3
|
|
97
|
+
}, 16, ["as-child"]);
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/components/radio-group/radio-group-item-control.vue
|
|
104
|
+
var radio_group_item_control_default = radio_group_item_control_vue_vue_type_script_setup_true_lang_default;
|
|
105
|
+
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/components/radio-group/radio-group-item-hidden-input.vue?vue&type=script&setup=true&lang.ts
|
|
108
|
+
var radio_group_item_hidden_input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
109
|
+
__name: "radio-group-item-hidden-input",
|
|
110
|
+
props: { asChild: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
required: false
|
|
113
|
+
} },
|
|
114
|
+
setup(__props) {
|
|
115
|
+
const radioGroup = useRadioGroupContext();
|
|
116
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
117
|
+
useForwardExpose();
|
|
118
|
+
return (_ctx, _cache) => {
|
|
119
|
+
return openBlock(), createBlock(unref(sprawlify).input, mergeProps(unref(radioGroup).getItemHiddenInputProps(unref(itemProps)), { "as-child": __props.asChild }), {
|
|
120
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
121
|
+
_: 3
|
|
122
|
+
}, 16, ["as-child"]);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/components/radio-group/radio-group-item-hidden-input.vue
|
|
129
|
+
var radio_group_item_hidden_input_default = radio_group_item_hidden_input_vue_vue_type_script_setup_true_lang_default;
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/components/radio-group/radio-group-item-text.vue?vue&type=script&setup=true&lang.ts
|
|
133
|
+
var radio_group_item_text_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
134
|
+
__name: "radio-group-item-text",
|
|
135
|
+
props: { asChild: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
required: false
|
|
138
|
+
} },
|
|
139
|
+
setup(__props) {
|
|
140
|
+
const radioGroup = useRadioGroupContext();
|
|
141
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
142
|
+
useForwardExpose();
|
|
143
|
+
return (_ctx, _cache) => {
|
|
144
|
+
return openBlock(), createBlock(unref(sprawlify).span, mergeProps(unref(radioGroup).getItemTextProps(unref(itemProps)), { "as-child": __props.asChild }), {
|
|
145
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
146
|
+
_: 3
|
|
147
|
+
}, 16, ["as-child"]);
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/components/radio-group/radio-group-item-text.vue
|
|
154
|
+
var radio_group_item_text_default = radio_group_item_text_vue_vue_type_script_setup_true_lang_default;
|
|
155
|
+
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/components/radio-group/radio-group-item.vue?vue&type=script&setup=true&lang.ts
|
|
158
|
+
var radio_group_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
159
|
+
__name: "radio-group-item",
|
|
160
|
+
props: {
|
|
161
|
+
value: {
|
|
162
|
+
type: String,
|
|
163
|
+
required: true
|
|
164
|
+
},
|
|
165
|
+
disabled: {
|
|
166
|
+
type: Boolean,
|
|
167
|
+
required: false,
|
|
168
|
+
skipCheck: true
|
|
169
|
+
},
|
|
170
|
+
invalid: {
|
|
171
|
+
type: Boolean,
|
|
172
|
+
required: false,
|
|
173
|
+
skipCheck: true
|
|
174
|
+
},
|
|
175
|
+
asChild: {
|
|
176
|
+
type: Boolean,
|
|
177
|
+
required: false
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
setup(__props) {
|
|
181
|
+
const props = __props;
|
|
182
|
+
const radioGroup = useRadioGroupContext();
|
|
183
|
+
RadioGroupItemPropsProvider(props);
|
|
184
|
+
RadioGroupItemProvider(computed(() => radioGroup.value.getItemState(props)));
|
|
185
|
+
useForwardExpose();
|
|
186
|
+
return (_ctx, _cache) => {
|
|
187
|
+
return openBlock(), createBlock(unref(sprawlify).label, mergeProps(unref(radioGroup).getItemProps(props), { "as-child": __props.asChild }), {
|
|
188
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
189
|
+
_: 3
|
|
190
|
+
}, 16, ["as-child"]);
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/components/radio-group/radio-group-item.vue
|
|
197
|
+
var radio_group_item_default = radio_group_item_vue_vue_type_script_setup_true_lang_default;
|
|
198
|
+
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/components/radio-group/radio-group-label.vue?vue&type=script&setup=true&lang.ts
|
|
201
|
+
var radio_group_label_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
202
|
+
__name: "radio-group-label",
|
|
203
|
+
props: { asChild: {
|
|
204
|
+
type: Boolean,
|
|
205
|
+
required: false
|
|
206
|
+
} },
|
|
207
|
+
setup(__props) {
|
|
208
|
+
const radioGroup = useRadioGroupContext();
|
|
209
|
+
useForwardExpose();
|
|
210
|
+
return (_ctx, _cache) => {
|
|
211
|
+
return openBlock(), createBlock(unref(sprawlify).label, mergeProps(unref(radioGroup).getLabelProps(), { "as-child": __props.asChild }), {
|
|
212
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
213
|
+
_: 3
|
|
214
|
+
}, 16, ["as-child"]);
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/components/radio-group/radio-group-label.vue
|
|
221
|
+
var radio_group_label_default = radio_group_label_vue_vue_type_script_setup_true_lang_default;
|
|
222
|
+
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/components/radio-group/radio-group-root-provider.vue?vue&type=script&setup=true&lang.ts
|
|
225
|
+
var radio_group_root_provider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
226
|
+
__name: "radio-group-root-provider",
|
|
227
|
+
props: {
|
|
228
|
+
value: {
|
|
229
|
+
type: null,
|
|
230
|
+
required: true
|
|
231
|
+
},
|
|
232
|
+
asChild: {
|
|
233
|
+
type: Boolean,
|
|
234
|
+
required: false
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
setup(__props) {
|
|
238
|
+
const props = __props;
|
|
239
|
+
const radioGroup = computed(() => props.value);
|
|
240
|
+
RadioGroupProvider(radioGroup);
|
|
241
|
+
useForwardExpose();
|
|
242
|
+
return (_ctx, _cache) => {
|
|
243
|
+
return openBlock(), createBlock(unref(sprawlify).div, mergeProps(radioGroup.value.getRootProps(), { "as-child": __props.asChild }), {
|
|
244
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
245
|
+
_: 3
|
|
246
|
+
}, 16, ["as-child"]);
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/components/radio-group/radio-group-root-provider.vue
|
|
253
|
+
var radio_group_root_provider_default = radio_group_root_provider_vue_vue_type_script_setup_true_lang_default;
|
|
254
|
+
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region src/components/radio-group/use-radio-group.ts
|
|
257
|
+
const useRadioGroup = (props = {}, emit) => {
|
|
258
|
+
const id = useId();
|
|
259
|
+
const env = useEnvironmentContext(DEFAULT_ENVIRONMENT);
|
|
260
|
+
const locale = useLocaleContext(DEFAULT_LOCALE);
|
|
261
|
+
const fieldset = useFieldsetContext();
|
|
262
|
+
const context = computed(() => {
|
|
263
|
+
const localProps = toValue(props);
|
|
264
|
+
const fieldsetContext = fieldset?.value;
|
|
265
|
+
return {
|
|
266
|
+
id,
|
|
267
|
+
ids: { label: fieldsetContext?.ids?.legend },
|
|
268
|
+
disabled: toBooleanValue(fieldsetContext?.disabled),
|
|
269
|
+
invalid: fieldsetContext?.invalid,
|
|
270
|
+
dir: locale.value.dir,
|
|
271
|
+
value: localProps.modelValue,
|
|
272
|
+
getRootNode: env?.value.getRootNode,
|
|
273
|
+
...cleanProps(localProps),
|
|
274
|
+
onValueChange: (details) => {
|
|
275
|
+
emit?.("valueChange", details);
|
|
276
|
+
emit?.("update:modelValue", details.value);
|
|
277
|
+
localProps.onValueChange?.(details);
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
});
|
|
281
|
+
const service = useMachine(radioGroup.machine, context);
|
|
282
|
+
return computed(() => radioGroup.connect(service, normalizeProps$1));
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region src/components/radio-group/radio-group-root.vue?vue&type=script&setup=true&lang.ts
|
|
287
|
+
var radio_group_root_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
288
|
+
__name: "radio-group-root",
|
|
289
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
290
|
+
defaultValue: {
|
|
291
|
+
type: [String, null],
|
|
292
|
+
required: false
|
|
293
|
+
},
|
|
294
|
+
disabled: {
|
|
295
|
+
type: Boolean,
|
|
296
|
+
required: false
|
|
297
|
+
},
|
|
298
|
+
form: {
|
|
299
|
+
type: String,
|
|
300
|
+
required: false
|
|
301
|
+
},
|
|
302
|
+
id: {
|
|
303
|
+
type: String,
|
|
304
|
+
required: false
|
|
305
|
+
},
|
|
306
|
+
ids: {
|
|
307
|
+
type: Object,
|
|
308
|
+
required: false
|
|
309
|
+
},
|
|
310
|
+
invalid: {
|
|
311
|
+
type: Boolean,
|
|
312
|
+
required: false
|
|
313
|
+
},
|
|
314
|
+
modelValue: {
|
|
315
|
+
type: [String, null],
|
|
316
|
+
required: false
|
|
317
|
+
},
|
|
318
|
+
name: {
|
|
319
|
+
type: String,
|
|
320
|
+
required: false
|
|
321
|
+
},
|
|
322
|
+
orientation: {
|
|
323
|
+
type: String,
|
|
324
|
+
required: false
|
|
325
|
+
},
|
|
326
|
+
readOnly: {
|
|
327
|
+
type: Boolean,
|
|
328
|
+
required: false
|
|
329
|
+
},
|
|
330
|
+
required: {
|
|
331
|
+
type: Boolean,
|
|
332
|
+
required: false
|
|
333
|
+
},
|
|
334
|
+
asChild: {
|
|
335
|
+
type: Boolean,
|
|
336
|
+
required: false
|
|
337
|
+
}
|
|
338
|
+
}, {
|
|
339
|
+
disabled: void 0,
|
|
340
|
+
invalid: void 0,
|
|
341
|
+
readOnly: void 0,
|
|
342
|
+
required: void 0
|
|
343
|
+
}),
|
|
344
|
+
emits: ["valueChange", "update:modelValue"],
|
|
345
|
+
setup(__props, { emit: __emit }) {
|
|
346
|
+
const radioGroup = useRadioGroup(__props, __emit);
|
|
347
|
+
RadioGroupProvider(radioGroup);
|
|
348
|
+
useForwardExpose();
|
|
349
|
+
return (_ctx, _cache) => {
|
|
350
|
+
return openBlock(), createBlock(unref(sprawlify).div, mergeProps(unref(radioGroup).getRootProps(), { "as-child": __props.asChild }), {
|
|
351
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
352
|
+
_: 3
|
|
353
|
+
}, 16, ["as-child"]);
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region src/components/radio-group/radio-group-root.vue
|
|
360
|
+
var radio_group_root_default = radio_group_root_vue_vue_type_script_setup_true_lang_default;
|
|
361
|
+
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region src/components/radio-group/radio-group.ts
|
|
364
|
+
var radio_group_exports = /* @__PURE__ */ __exportAll({
|
|
365
|
+
Context: () => radio_group_context_default,
|
|
366
|
+
Indicator: () => radio_group_indicator_default,
|
|
367
|
+
Item: () => radio_group_item_default,
|
|
368
|
+
ItemContext: () => radio_group_item_context_default,
|
|
369
|
+
ItemControl: () => radio_group_item_control_default,
|
|
370
|
+
ItemHiddenInput: () => radio_group_item_hidden_input_default,
|
|
371
|
+
ItemText: () => radio_group_item_text_default,
|
|
372
|
+
Label: () => radio_group_label_default,
|
|
373
|
+
Root: () => radio_group_root_default,
|
|
374
|
+
RootProvider: () => radio_group_root_provider_default
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
//#endregion
|
|
378
|
+
export { radio_group_exports as RadioGroup, radio_group_context_default as RadioGroupContext, radio_group_indicator_default as RadioGroupIndicator, radio_group_item_default as RadioGroupItem, radio_group_item_context_default as RadioGroupItemContext, radio_group_item_control_default as RadioGroupItemControl, radio_group_item_hidden_input_default as RadioGroupItemHiddenInput, radio_group_item_text_default as RadioGroupItemText, radio_group_label_default as RadioGroupLabel, radio_group_root_default as RadioGroupRoot, radio_group_root_provider_default as RadioGroupRootProvider, radioGroupAnatomy, useRadioGroup, useRadioGroupContext, useRadioGroupItemContext };
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { t as PolymorphicProps } from "../../factory-B5zr8_kk.js";
|
|
2
|
+
import { a as Optional, r as EmitFn$1 } from "../../types-DIEO6uP3.js";
|
|
3
|
+
import { r as PropTypes } from "../../index-CCRVRFFQ.js";
|
|
4
|
+
import * as vue1050 from "vue";
|
|
5
|
+
import { ComputedRef, HTMLAttributes, InputHTMLAttributes, LabelHTMLAttributes, MaybeRef, SlotsType, UnwrapRef } from "vue";
|
|
6
|
+
import * as ratingGroup from "@sprawlify/primitives/machines/rating-group";
|
|
7
|
+
import { HoverChangeDetails, HoverChangeDetails as RatingGroupHoverChangeDetails, ItemProps, ItemState, ValueChangeDetails, ValueChangeDetails as RatingGroupValueChangeDetails, anatomy as ratingGroupAnatomy } from "@sprawlify/primitives/machines/rating-group";
|
|
8
|
+
|
|
9
|
+
//#region src/components/rating-group/rating-group-control.vue.d.ts
|
|
10
|
+
interface RatingGroupControlBaseProps extends PolymorphicProps {}
|
|
11
|
+
interface RatingGroupControlProps extends RatingGroupControlBaseProps,
|
|
12
|
+
/**
|
|
13
|
+
* @vue-ignore
|
|
14
|
+
*/
|
|
15
|
+
HTMLAttributes {}
|
|
16
|
+
declare const _default$1: typeof __VLS_export$7;
|
|
17
|
+
declare const __VLS_export$7: __VLS_WithSlots$7<vue1050.DefineComponent<RatingGroupControlProps, {}, {}, {}, {}, vue1050.ComponentOptionsMixin, vue1050.ComponentOptionsMixin, {}, string, vue1050.PublicProps, Readonly<RatingGroupControlProps> & Readonly<{}>, {}, {}, {}, {}, string, vue1050.ComponentProvideOptions, false, {}, any>, {
|
|
18
|
+
default?: (props: {}) => any;
|
|
19
|
+
}>;
|
|
20
|
+
type __VLS_WithSlots$7<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/rating-group/rating-group-hidden-input.vue.d.ts
|
|
27
|
+
interface RatingGroupHiddenInputBaseProps extends PolymorphicProps {}
|
|
28
|
+
interface RatingGroupHiddenInputProps extends RatingGroupHiddenInputBaseProps,
|
|
29
|
+
/**
|
|
30
|
+
* @vue-ignore
|
|
31
|
+
*/
|
|
32
|
+
InputHTMLAttributes {}
|
|
33
|
+
declare const _default$2: typeof __VLS_export$6;
|
|
34
|
+
declare const __VLS_export$6: __VLS_WithSlots$6<vue1050.DefineComponent<RatingGroupHiddenInputProps, {}, {}, {}, {}, vue1050.ComponentOptionsMixin, vue1050.ComponentOptionsMixin, {}, string, vue1050.PublicProps, Readonly<RatingGroupHiddenInputProps> & Readonly<{}>, {}, {}, {}, {}, string, vue1050.ComponentProvideOptions, false, {}, any>, {
|
|
35
|
+
default?: (props: {}) => any;
|
|
36
|
+
}>;
|
|
37
|
+
type __VLS_WithSlots$6<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/rating-group/use-rating-group-item-context.d.ts
|
|
44
|
+
interface UseRatingGroupItemContext extends ComputedRef<ItemState> {}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/components/rating-group/rating-group-item-context.vue.d.ts
|
|
47
|
+
interface RatingGroupItemContextProps extends SlotsType<{
|
|
48
|
+
default: UnwrapRef<UseRatingGroupItemContext>;
|
|
49
|
+
}> {}
|
|
50
|
+
declare const _default$4: typeof __VLS_export$5;
|
|
51
|
+
declare const __VLS_export$5: __VLS_WithSlots$5<vue1050.DefineComponent<{}, {}, {}, {}, {}, vue1050.ComponentOptionsMixin, vue1050.ComponentOptionsMixin, {}, string, vue1050.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue1050.ComponentProvideOptions, true, {}, any>, {
|
|
52
|
+
default(item: UnwrapRef<UseRatingGroupItemContext>): unknown;
|
|
53
|
+
}>;
|
|
54
|
+
type __VLS_WithSlots$5<T, S> = T & {
|
|
55
|
+
new (): {
|
|
56
|
+
$slots: S;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/components/rating-group/rating-group-item.vue.d.ts
|
|
61
|
+
interface RatingGroupItemBaseProps extends ItemProps, PolymorphicProps {}
|
|
62
|
+
interface RatingGroupItemProps extends RatingGroupItemBaseProps,
|
|
63
|
+
/**
|
|
64
|
+
* @vue-ignore
|
|
65
|
+
*/
|
|
66
|
+
HTMLAttributes {}
|
|
67
|
+
declare const _default$3: typeof __VLS_export$4;
|
|
68
|
+
declare const __VLS_export$4: __VLS_WithSlots$4<vue1050.DefineComponent<RatingGroupItemProps, {}, {}, {}, {}, vue1050.ComponentOptionsMixin, vue1050.ComponentOptionsMixin, {}, string, vue1050.PublicProps, Readonly<RatingGroupItemProps> & Readonly<{}>, {}, {}, {}, {}, string, vue1050.ComponentProvideOptions, false, {}, any>, {
|
|
69
|
+
default?: (props: {}) => any;
|
|
70
|
+
}>;
|
|
71
|
+
type __VLS_WithSlots$4<T, S> = T & {
|
|
72
|
+
new (): {
|
|
73
|
+
$slots: S;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/components/rating-group/rating-group-label.vue.d.ts
|
|
78
|
+
interface RatingGroupLabelBaseProps extends PolymorphicProps {}
|
|
79
|
+
interface RatingGroupLabelProps extends RatingGroupLabelBaseProps,
|
|
80
|
+
/**
|
|
81
|
+
* @vue-ignore
|
|
82
|
+
*/
|
|
83
|
+
LabelHTMLAttributes {}
|
|
84
|
+
declare const _default$5: typeof __VLS_export$3;
|
|
85
|
+
declare const __VLS_export$3: __VLS_WithSlots$3<vue1050.DefineComponent<RatingGroupLabelProps, {}, {}, {}, {}, vue1050.ComponentOptionsMixin, vue1050.ComponentOptionsMixin, {}, string, vue1050.PublicProps, Readonly<RatingGroupLabelProps> & Readonly<{}>, {}, {}, {}, {}, string, vue1050.ComponentProvideOptions, false, {}, any>, {
|
|
86
|
+
default?: (props: {}) => any;
|
|
87
|
+
}>;
|
|
88
|
+
type __VLS_WithSlots$3<T, S> = T & {
|
|
89
|
+
new (): {
|
|
90
|
+
$slots: S;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/components/rating-group/rating-group-root-provider.vue.d.ts
|
|
95
|
+
interface RootProviderProps {
|
|
96
|
+
value: UnwrapRef<UseRatingGroupReturn>;
|
|
97
|
+
}
|
|
98
|
+
interface RatingGroupRootProviderBaseProps extends RootProviderProps, PolymorphicProps {}
|
|
99
|
+
interface RatingGroupRootProviderProps extends RatingGroupRootProviderBaseProps,
|
|
100
|
+
/**
|
|
101
|
+
* @vue-ignore
|
|
102
|
+
*/
|
|
103
|
+
HTMLAttributes {}
|
|
104
|
+
declare const _default$7: typeof __VLS_export$2;
|
|
105
|
+
declare const __VLS_export$2: __VLS_WithSlots$2<vue1050.DefineComponent<RatingGroupRootProviderProps, {}, {}, {}, {}, vue1050.ComponentOptionsMixin, vue1050.ComponentOptionsMixin, {}, string, vue1050.PublicProps, Readonly<RatingGroupRootProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, vue1050.ComponentProvideOptions, false, {}, any>, {
|
|
106
|
+
default?: (props: {}) => any;
|
|
107
|
+
}>;
|
|
108
|
+
type __VLS_WithSlots$2<T, S> = T & {
|
|
109
|
+
new (): {
|
|
110
|
+
$slots: S;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/components/rating-group/rating-group-types.d.ts
|
|
115
|
+
interface RootProps {
|
|
116
|
+
allowHalf?: boolean;
|
|
117
|
+
autoFocus?: boolean;
|
|
118
|
+
count?: number;
|
|
119
|
+
defaultValue?: number;
|
|
120
|
+
disabled?: boolean;
|
|
121
|
+
form?: string;
|
|
122
|
+
id?: string;
|
|
123
|
+
ids?: Partial<{
|
|
124
|
+
root: string;
|
|
125
|
+
label: string;
|
|
126
|
+
hiddenInput: string;
|
|
127
|
+
control: string;
|
|
128
|
+
item(id: string): string;
|
|
129
|
+
}>;
|
|
130
|
+
modelValue?: number;
|
|
131
|
+
name?: string;
|
|
132
|
+
readOnly?: boolean;
|
|
133
|
+
required?: boolean;
|
|
134
|
+
translations?: ratingGroup.IntlTranslations;
|
|
135
|
+
}
|
|
136
|
+
type RootEmits = {
|
|
137
|
+
hoverChange: [details: ratingGroup.HoverChangeDetails];
|
|
138
|
+
valueChange: [details: ratingGroup.ValueChangeDetails];
|
|
139
|
+
'update:modelValue': [value: number];
|
|
140
|
+
};
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/components/rating-group/rating-group-root.vue.d.ts
|
|
143
|
+
interface RatingGroupRootBaseProps extends RootProps, PolymorphicProps {}
|
|
144
|
+
interface RatingGroupRootProps extends RatingGroupRootBaseProps,
|
|
145
|
+
/**
|
|
146
|
+
* @vue-ignore
|
|
147
|
+
*/
|
|
148
|
+
HTMLAttributes {}
|
|
149
|
+
interface RatingGroupRootEmits extends RootEmits {}
|
|
150
|
+
declare const _default$6: typeof __VLS_export$1;
|
|
151
|
+
declare const __VLS_export$1: __VLS_WithSlots$1<vue1050.DefineComponent<RatingGroupRootProps, {}, {}, {}, {}, vue1050.ComponentOptionsMixin, vue1050.ComponentOptionsMixin, {
|
|
152
|
+
valueChange: (details: ratingGroup.ValueChangeDetails) => any;
|
|
153
|
+
"update:modelValue": (value: number) => any;
|
|
154
|
+
hoverChange: (details: ratingGroup.HoverChangeDetails) => any;
|
|
155
|
+
}, string, vue1050.PublicProps, Readonly<RatingGroupRootProps> & Readonly<{
|
|
156
|
+
onValueChange?: ((details: ratingGroup.ValueChangeDetails) => any) | undefined;
|
|
157
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
158
|
+
onHoverChange?: ((details: ratingGroup.HoverChangeDetails) => any) | undefined;
|
|
159
|
+
}>, {
|
|
160
|
+
required: boolean;
|
|
161
|
+
disabled: boolean;
|
|
162
|
+
readOnly: boolean;
|
|
163
|
+
autoFocus: boolean;
|
|
164
|
+
allowHalf: boolean;
|
|
165
|
+
}, {}, {}, {}, string, vue1050.ComponentProvideOptions, false, {}, any>, {
|
|
166
|
+
default?: (props: {}) => any;
|
|
167
|
+
}>;
|
|
168
|
+
type __VLS_WithSlots$1<T, S> = T & {
|
|
169
|
+
new (): {
|
|
170
|
+
$slots: S;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
declare namespace rating_group_d_exports {
|
|
174
|
+
export { _default as Context, RatingGroupContextProps as ContextProps, _default$1 as Control, RatingGroupControlBaseProps as ControlBaseProps, RatingGroupControlProps as ControlProps, _default$2 as HiddenInput, RatingGroupHiddenInputBaseProps as HiddenInputBaseProps, RatingGroupHiddenInputProps as HiddenInputProps, HoverChangeDetails, _default$3 as Item, RatingGroupItemBaseProps as ItemBaseProps, _default$4 as ItemContext, RatingGroupItemContextProps as ItemContextProps, RatingGroupItemProps as ItemProps, _default$5 as Label, RatingGroupLabelBaseProps as LabelBaseProps, RatingGroupLabelProps as LabelProps, _default$6 as Root, RatingGroupRootBaseProps as RootBaseProps, RatingGroupRootEmits as RootEmits, RatingGroupRootProps as RootProps, _default$7 as RootProvider, RatingGroupRootProviderBaseProps as RootProviderBaseProps, RatingGroupRootProviderProps as RootProviderProps, ValueChangeDetails };
|
|
175
|
+
}
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/components/rating-group/use-rating-group.d.ts
|
|
178
|
+
interface UseRatingGroupProps extends Optional<Omit<ratingGroup.Props, 'dir' | 'getRootNode'>, 'id'> {
|
|
179
|
+
modelValue?: ratingGroup.Props['value'];
|
|
180
|
+
}
|
|
181
|
+
interface UseRatingGroupReturn extends ComputedRef<ratingGroup.Api<PropTypes>> {}
|
|
182
|
+
declare const useRatingGroup: (props?: MaybeRef<UseRatingGroupProps>, emit?: EmitFn$1<RatingGroupRootEmits>) => UseRatingGroupReturn;
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/components/rating-group/use-rating-group-context.d.ts
|
|
185
|
+
interface UseRatingGroupContext extends UseRatingGroupReturn {}
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/components/rating-group/rating-group-context.vue.d.ts
|
|
188
|
+
interface RatingGroupContextProps extends SlotsType<{
|
|
189
|
+
default: UnwrapRef<UseRatingGroupContext>;
|
|
190
|
+
}> {}
|
|
191
|
+
declare const _default: typeof __VLS_export;
|
|
192
|
+
declare const __VLS_export: __VLS_WithSlots<vue1050.DefineComponent<{}, {}, {}, {}, {}, vue1050.ComponentOptionsMixin, vue1050.ComponentOptionsMixin, {}, string, vue1050.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue1050.ComponentProvideOptions, true, {}, any>, {
|
|
193
|
+
default(ratingGroup: UnwrapRef<UseRatingGroupContext>): unknown;
|
|
194
|
+
}>;
|
|
195
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
196
|
+
new (): {
|
|
197
|
+
$slots: S;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
//#endregion
|
|
201
|
+
export { rating_group_d_exports as RatingGroup, _default as RatingGroupContext, type RatingGroupContextProps, _default$1 as RatingGroupControl, type RatingGroupControlBaseProps, type RatingGroupControlProps, _default$2 as RatingGroupHiddenInput, type RatingGroupHiddenInputBaseProps, type RatingGroupHiddenInputProps, type RatingGroupHoverChangeDetails, _default$3 as RatingGroupItem, type RatingGroupItemBaseProps, _default$4 as RatingGroupItemContext, type RatingGroupItemContextProps, type RatingGroupItemProps, _default$5 as RatingGroupLabel, type RatingGroupLabelBaseProps, type RatingGroupLabelProps, _default$6 as RatingGroupRoot, type RatingGroupRootBaseProps, type RatingGroupRootEmits, type RatingGroupRootProps, _default$7 as RatingGroupRootProvider, type RatingGroupRootProviderBaseProps, type RatingGroupRootProviderProps, type RatingGroupValueChangeDetails, type UseRatingGroupContext, type UseRatingGroupItemContext, type UseRatingGroupProps, type UseRatingGroupReturn, ratingGroupAnatomy, useRatingGroup, useRatingGroupContext, useRatingGroupItemContext };
|