@una-ui/nuxt-edge 0.63.1-29239822.5f56f54 → 0.63.1-29247284.735a951
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/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/toggle-group/ToggleGroup.vue +70 -0
- package/dist/runtime/components/toggle-group/ToggleGroup.vue.d.ts +23 -0
- package/dist/runtime/components/toggle-group/ToggleGroupItem.vue +75 -0
- package/dist/runtime/components/toggle-group/ToggleGroupItem.vue.d.ts +18 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/toggle-group.d.ts +39 -0
- package/dist/runtime/types/toggle-group.js +0 -0
- package/package.json +4 -4
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
7
|
+
import { ToggleGroupRoot, useForwardPropsEmits } from "reka-ui";
|
|
8
|
+
import { cn } from "../../utils";
|
|
9
|
+
import ToggleGroupItem from "./ToggleGroupItem.vue";
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
items: { type: null, required: false },
|
|
12
|
+
_toggleGroupItem: { type: Object, required: false },
|
|
13
|
+
una: { type: Object, required: false },
|
|
14
|
+
rovingFocus: { type: Boolean, required: false },
|
|
15
|
+
disabled: { type: Boolean, required: false },
|
|
16
|
+
orientation: { type: String, required: false },
|
|
17
|
+
dir: { type: String, required: false },
|
|
18
|
+
loop: { type: Boolean, required: false },
|
|
19
|
+
asChild: { type: Boolean, required: false },
|
|
20
|
+
as: { type: [String, Object, Function], required: false },
|
|
21
|
+
name: { type: String, required: false },
|
|
22
|
+
required: { type: Boolean, required: false },
|
|
23
|
+
type: { type: String, required: false },
|
|
24
|
+
modelValue: { type: null, required: false },
|
|
25
|
+
defaultValue: { type: null, required: false },
|
|
26
|
+
toggleOff: { type: String, required: false },
|
|
27
|
+
toggleOn: { type: String, required: false },
|
|
28
|
+
class: { type: null, required: false },
|
|
29
|
+
size: { type: null, required: false }
|
|
30
|
+
});
|
|
31
|
+
const emits = defineEmits(["update:modelValue"]);
|
|
32
|
+
const rootProps = reactiveOmit(props, [
|
|
33
|
+
"class",
|
|
34
|
+
"size",
|
|
35
|
+
"toggleOff",
|
|
36
|
+
"toggleOn",
|
|
37
|
+
"una"
|
|
38
|
+
]);
|
|
39
|
+
const forwarded = useForwardPropsEmits(rootProps, emits);
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
<ToggleGroupRoot
|
|
44
|
+
v-slot="slotProps"
|
|
45
|
+
v-bind="forwarded"
|
|
46
|
+
data-slot="toggle-group"
|
|
47
|
+
:class="cn(
|
|
48
|
+
'toggle-group',
|
|
49
|
+
props.orientation === 'vertical' ? 'toggle-group-vertical' : 'toggle-group-horizontal',
|
|
50
|
+
props.class,
|
|
51
|
+
props.una?.toggleGroup
|
|
52
|
+
)"
|
|
53
|
+
>
|
|
54
|
+
<slot v-bind="slotProps">
|
|
55
|
+
<template v-if="items && items.length">
|
|
56
|
+
<template v-for="item in items" :key="item.value">
|
|
57
|
+
<slot :name="item.slot ?? 'item'" v-bind="{ item, value: item.value }">
|
|
58
|
+
<ToggleGroupItem
|
|
59
|
+
:una
|
|
60
|
+
:size
|
|
61
|
+
:toggle-on
|
|
62
|
+
:toggle-off
|
|
63
|
+
v-bind="{ ...item, ..._toggleGroupItem }"
|
|
64
|
+
/>
|
|
65
|
+
</slot>
|
|
66
|
+
</template>
|
|
67
|
+
</template>
|
|
68
|
+
</slot>
|
|
69
|
+
</ToggleGroupRoot>
|
|
70
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { NToggleGroupItemProps, NToggleGroupProps } from '../../types/index.js';
|
|
2
|
+
declare const _default: <T extends NToggleGroupItemProps, U extends Array<T>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
|
+
readonly "onUpdate:modelValue"?: ((payload: import("reka-ui").AcceptableValue | import("reka-ui").AcceptableValue[]) => any) | undefined;
|
|
5
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue"> & NToggleGroupProps<U> & Partial<{}>> & import("vue").PublicProps;
|
|
6
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
7
|
+
attrs: any;
|
|
8
|
+
slots: {
|
|
9
|
+
[x: string]: ((props: {
|
|
10
|
+
item: any;
|
|
11
|
+
value: any;
|
|
12
|
+
}) => any) | undefined;
|
|
13
|
+
} & {
|
|
14
|
+
default?: (props: any) => any;
|
|
15
|
+
};
|
|
16
|
+
emit: (evt: "update:modelValue", payload: import("reka-ui").AcceptableValue | import("reka-ui").AcceptableValue[]) => void;
|
|
17
|
+
}>) => import("vue").VNode & {
|
|
18
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_PrettifyLocal<T> = {
|
|
22
|
+
[K in keyof T]: T[K];
|
|
23
|
+
} & {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
7
|
+
import { ToggleGroupItem, useForwardPropsEmits } from "reka-ui";
|
|
8
|
+
import { cn } from "../../utils";
|
|
9
|
+
import Toggle from "../elements/Toggle.vue";
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
slot: { type: String, required: false },
|
|
12
|
+
una: { type: Object, required: false },
|
|
13
|
+
value: { type: null, required: true },
|
|
14
|
+
disabled: { type: Boolean, required: false },
|
|
15
|
+
asChild: { type: Boolean, required: false },
|
|
16
|
+
as: { type: [String, Object, Function], required: false, default: Toggle },
|
|
17
|
+
toggleOn: { type: String, required: false },
|
|
18
|
+
toggleOff: { type: String, required: false },
|
|
19
|
+
defaultValue: { type: Boolean, required: false },
|
|
20
|
+
modelValue: { type: [Boolean, null], required: false },
|
|
21
|
+
name: { type: String, required: false },
|
|
22
|
+
required: { type: Boolean, required: false },
|
|
23
|
+
type: { type: String, required: false },
|
|
24
|
+
loadingPlacement: { type: String, required: false },
|
|
25
|
+
icon: { type: Boolean, required: false, default: true },
|
|
26
|
+
reverse: { type: Boolean, required: false },
|
|
27
|
+
loading: { type: Boolean, required: false },
|
|
28
|
+
block: { type: Boolean, required: false },
|
|
29
|
+
to: { type: null, required: false },
|
|
30
|
+
label: { type: String, required: false },
|
|
31
|
+
btn: { type: String, required: false },
|
|
32
|
+
leading: { type: String, required: false },
|
|
33
|
+
trailing: { type: String, required: false },
|
|
34
|
+
size: { type: String, required: false },
|
|
35
|
+
square: { type: null, required: false, default: true },
|
|
36
|
+
rounded: { type: null, required: false },
|
|
37
|
+
class: { type: null, required: false },
|
|
38
|
+
breadcrumbActive: { type: String, required: false },
|
|
39
|
+
breadcrumbInactive: { type: String, required: false },
|
|
40
|
+
paginationSelected: { type: String, required: false },
|
|
41
|
+
paginationUnselected: { type: String, required: false },
|
|
42
|
+
dropdownMenu: { type: String, required: false },
|
|
43
|
+
tabsActive: { type: String, required: false },
|
|
44
|
+
tabsInactive: { type: String, required: false },
|
|
45
|
+
navigationMenu: { type: String, required: false },
|
|
46
|
+
navigationMenuLink: { type: String, required: false },
|
|
47
|
+
ariaLabel: { type: String, required: false }
|
|
48
|
+
});
|
|
49
|
+
const emits = defineEmits(["update:modelValue"]);
|
|
50
|
+
const delegatedProps = reactiveOmit(props, [
|
|
51
|
+
"class",
|
|
52
|
+
"toggleOff",
|
|
53
|
+
"toggleOn",
|
|
54
|
+
"una"
|
|
55
|
+
]);
|
|
56
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<template>
|
|
60
|
+
<ToggleGroupItem
|
|
61
|
+
v-slot="slotProps"
|
|
62
|
+
v-bind="forwarded"
|
|
63
|
+
data-slot="toggle-group-item"
|
|
64
|
+
:toggle-on
|
|
65
|
+
:toggle-off
|
|
66
|
+
:as="props.as"
|
|
67
|
+
:class="cn(
|
|
68
|
+
'toggle-group-item',
|
|
69
|
+
props.una?.toggleGroupItem,
|
|
70
|
+
props.class
|
|
71
|
+
)"
|
|
72
|
+
>
|
|
73
|
+
<slot v-bind="slotProps" />
|
|
74
|
+
</ToggleGroupItem>
|
|
75
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NToggleGroupItemProps } from '../../types/index.js';
|
|
2
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<NToggleGroupItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
3
|
+
"update:modelValue": (value: boolean) => any;
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<NToggleGroupItemProps> & Readonly<{
|
|
5
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
icon: boolean;
|
|
8
|
+
square: import("vue").HTMLAttributes["class"];
|
|
9
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
11
|
+
default?: (props: any) => any;
|
|
12
|
+
}>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ToggleGroupItemProps, ToggleGroupRootProps } from 'reka-ui';
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import type { NButtonProps } from './button.js';
|
|
4
|
+
import type { NToggleProps } from './toggle.js';
|
|
5
|
+
interface BaseExtensions {
|
|
6
|
+
/** CSS class for the component */
|
|
7
|
+
class?: HTMLAttributes['class'];
|
|
8
|
+
/** Size of the component */
|
|
9
|
+
size?: HTMLAttributes['class'];
|
|
10
|
+
}
|
|
11
|
+
export interface NToggleGroupProps<T> extends ToggleGroupRootProps, Pick<NToggleProps, 'toggleOff' | 'toggleOn'>, BaseExtensions {
|
|
12
|
+
/**
|
|
13
|
+
* The array of items that is passed to the toggle group.
|
|
14
|
+
*
|
|
15
|
+
* @default []
|
|
16
|
+
*/
|
|
17
|
+
items?: T;
|
|
18
|
+
/** Props for the toggle group item */
|
|
19
|
+
_toggleGroupItem?: Partial<NToggleGroupItemProps>;
|
|
20
|
+
/**
|
|
21
|
+
* `UnaUI` preset configuration
|
|
22
|
+
*
|
|
23
|
+
* @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/toggle-group.ts
|
|
24
|
+
*/
|
|
25
|
+
una?: NToggleGroupUnaProps;
|
|
26
|
+
}
|
|
27
|
+
export interface NToggleGroupItemProps extends ToggleGroupItemProps, Omit<NToggleProps, 'una'>, Pick<BaseExtensions, 'class'> {
|
|
28
|
+
/** Slot of the toggle group item */
|
|
29
|
+
slot?: string;
|
|
30
|
+
/** Additional properties for the una component */
|
|
31
|
+
una?: Pick<NToggleGroupUnaProps, 'toggleGroupItem'> & NButtonProps['una'];
|
|
32
|
+
}
|
|
33
|
+
interface NToggleGroupUnaProps {
|
|
34
|
+
/** CSS class for the navigation menu */
|
|
35
|
+
toggleGroup?: HTMLAttributes['class'];
|
|
36
|
+
/** CSS class for the navigation menu content */
|
|
37
|
+
toggleGroupItem?: HTMLAttributes['class'];
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@una-ui/nuxt-edge",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.63.1-
|
|
4
|
+
"version": "0.63.1-29247284.735a951",
|
|
5
5
|
"description": "Nuxt module for @una-ui",
|
|
6
6
|
"author": "Phojie Rengel <phojrengel@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"@nuxt/kit": "^3.18.1",
|
|
42
42
|
"@nuxtjs/color-mode": "^3.5.2",
|
|
43
43
|
"@tanstack/vue-table": "^8.21.3",
|
|
44
|
-
"@una-ui/extractor-vue-script": "npm:@una-ui/extractor-vue-script-edge@0.63.1-
|
|
45
|
-
"@una-ui/preset": "npm:@una-ui/preset-edge@0.63.1-
|
|
44
|
+
"@una-ui/extractor-vue-script": "npm:@una-ui/extractor-vue-script-edge@0.63.1-29247284.735a951",
|
|
45
|
+
"@una-ui/preset": "npm:@una-ui/preset-edge@0.63.1-29247284.735a951",
|
|
46
46
|
"@unocss/core": "^66.3.3",
|
|
47
47
|
"@unocss/nuxt": "^66.3.3",
|
|
48
48
|
"@unocss/preset-attributify": "^66.3.3",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"class-variance-authority": "^0.7.1",
|
|
56
56
|
"clsx": "^2.1.1",
|
|
57
57
|
"ohash": "^1.1.6",
|
|
58
|
-
"reka-ui": "^2.4.
|
|
58
|
+
"reka-ui": "^2.4.1",
|
|
59
59
|
"tailwind-merge": "^3.3.1",
|
|
60
60
|
"unocss": "^66.3.3",
|
|
61
61
|
"unocss-preset-animations": "^1.2.1",
|