@una-ui/nuxt 0.27.1-beta.1 → 0.29.0-beta.1
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 +8 -1
- package/dist/runtime/components/elements/Button.vue +1 -0
- package/dist/runtime/components/elements/Skeleton.vue +3 -2
- package/dist/runtime/components/elements/Toggle.vue +1 -1
- package/dist/runtime/components/elements/avatar/Avatar.vue +58 -0
- package/dist/runtime/components/elements/avatar/AvatarFallback.vue +46 -0
- package/dist/runtime/components/elements/avatar/AvatarImage.vue +19 -0
- package/dist/runtime/components/elements/collapsible/Collapsible.vue +28 -0
- package/dist/runtime/components/elements/collapsible/CollapsibleContent.vue +19 -0
- package/dist/runtime/components/elements/collapsible/CollapsibleTrigger.vue +11 -0
- package/dist/runtime/components/elements/dialog/DialogDescription.vue +1 -1
- package/dist/runtime/components/elements/dialog/DialogOverlay.vue +1 -0
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenu.vue +73 -75
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuContent.vue +1 -1
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSubContent.vue +1 -1
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSubTrigger.vue +18 -20
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuTrigger.vue +16 -18
- package/dist/runtime/components/elements/tooltip/Tooltip.vue +14 -7
- package/dist/runtime/components/forms/Checkbox.vue +15 -11
- package/dist/runtime/components/forms/Input.vue +6 -5
- package/dist/runtime/components/forms/Slider.vue +4 -1
- package/dist/runtime/components/forms/Switch.vue +6 -5
- package/dist/runtime/components/forms/select/Select.vue +9 -9
- package/dist/runtime/components/misc/ThemeSwitcher.vue +12 -6
- package/dist/runtime/components/slots/AvatarGroupDefault.js +2 -2
- package/dist/runtime/types/avatar.d.ts +49 -55
- package/dist/runtime/types/button.d.ts +6 -0
- package/dist/runtime/types/checkbox.d.ts +4 -21
- package/dist/runtime/types/collapsible.d.ts +12 -0
- package/dist/runtime/types/collapsible.js +0 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/select.d.ts +11 -6
- package/dist/runtime/types/separator.d.ts +2 -2
- package/dist/runtime/types/skeleton.d.ts +10 -2
- package/dist/runtime/types/tooltip.d.ts +3 -9
- package/package.json +21 -21
- package/dist/runtime/components/elements/Avatar.vue +0 -83
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import 'unocss';
|
|
|
7
7
|
import 'unocss-preset-animations';
|
|
8
8
|
|
|
9
9
|
const name = "@una-ui/nuxt";
|
|
10
|
-
const version = "0.
|
|
10
|
+
const version = "0.29.0-beta.1";
|
|
11
11
|
|
|
12
12
|
const module = defineNuxtModule({
|
|
13
13
|
meta: {
|
|
@@ -71,6 +71,13 @@ const module = defineNuxtModule({
|
|
|
71
71
|
watch: nuxt.options.dev,
|
|
72
72
|
priority: 10
|
|
73
73
|
});
|
|
74
|
+
addComponentsDir({
|
|
75
|
+
path: resolve(runtimeDir, "components/elements", "collapsible"),
|
|
76
|
+
prefix: options.prefix,
|
|
77
|
+
global: options.global,
|
|
78
|
+
watch: nuxt.options.dev,
|
|
79
|
+
priority: 10
|
|
80
|
+
});
|
|
74
81
|
addComponentsDir({
|
|
75
82
|
path: resolve(runtimeDir, "components/elements", "tooltip"),
|
|
76
83
|
prefix: options.prefix,
|
|
@@ -52,6 +52,7 @@ const [DefineTemplate, ReuseTemplate] = createReusableTemplate()
|
|
|
52
52
|
:type="to ? null : type"
|
|
53
53
|
:class="cn(
|
|
54
54
|
(square === '' || square === true) && 'btn-square',
|
|
55
|
+
block && 'btn-block',
|
|
55
56
|
!rounded && 'btn-default-radius',
|
|
56
57
|
!hasVariant && !isBaseVariant ? una?.btnDefaultVariant : null,
|
|
57
58
|
reverse && 'btn-reverse',
|
|
@@ -15,7 +15,7 @@ const props = withDefaults(defineProps<NToggleProps>(), {
|
|
|
15
15
|
const emits = defineEmits<ToggleEmits>()
|
|
16
16
|
|
|
17
17
|
const delegatedProps = computed(() => {
|
|
18
|
-
const { class: _,
|
|
18
|
+
const { class: _, ...delegated } = props
|
|
19
19
|
|
|
20
20
|
return delegated
|
|
21
21
|
})
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NAvatarProps } from '../../../types'
|
|
3
|
+
import { AvatarRoot } from 'radix-vue'
|
|
4
|
+
import { cn } from '../../../utils'
|
|
5
|
+
import AvatarFallback from './AvatarFallback.vue'
|
|
6
|
+
import AvatarImage from './AvatarImage.vue'
|
|
7
|
+
|
|
8
|
+
defineOptions({
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
const props = withDefaults(defineProps<NAvatarProps>(), {
|
|
13
|
+
as: 'span',
|
|
14
|
+
size: 'md',
|
|
15
|
+
rounded: 'full',
|
|
16
|
+
square: '2.5em',
|
|
17
|
+
avatar: 'soft',
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<AvatarRoot
|
|
23
|
+
as-child
|
|
24
|
+
>
|
|
25
|
+
<component
|
|
26
|
+
:is="as"
|
|
27
|
+
:class="cn(
|
|
28
|
+
'avatar',
|
|
29
|
+
una?.avatarRoot,
|
|
30
|
+
props.class,
|
|
31
|
+
)"
|
|
32
|
+
:size
|
|
33
|
+
:rounded
|
|
34
|
+
:square
|
|
35
|
+
:avatar
|
|
36
|
+
v-bind="{ ..._avatarRoot, ...$attrs }"
|
|
37
|
+
>
|
|
38
|
+
<slot :props>
|
|
39
|
+
<AvatarImage
|
|
40
|
+
v-if="src"
|
|
41
|
+
:src
|
|
42
|
+
:una
|
|
43
|
+
v-bind="_avatarImage"
|
|
44
|
+
/>
|
|
45
|
+
</slot>
|
|
46
|
+
|
|
47
|
+
<AvatarFallback
|
|
48
|
+
:avatar
|
|
49
|
+
:label="label || alt?.split(' ').map(word => word[0]).join('').slice(0, 2)"
|
|
50
|
+
:icon
|
|
51
|
+
v-bind="_avatarFallback"
|
|
52
|
+
:una
|
|
53
|
+
>
|
|
54
|
+
<slot name="fallback" />
|
|
55
|
+
</AvatarFallback>
|
|
56
|
+
</component>
|
|
57
|
+
</AvatarRoot>
|
|
58
|
+
</template>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NAvatarAvatarFallbackProps } from '../../../types'
|
|
3
|
+
import { AvatarFallback } from 'radix-vue'
|
|
4
|
+
import { cn } from '../../../utils'
|
|
5
|
+
import Icon from '../Icon.vue'
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<NAvatarAvatarFallbackProps>(), {
|
|
8
|
+
as: 'span',
|
|
9
|
+
})
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<AvatarFallback
|
|
14
|
+
as-child
|
|
15
|
+
>
|
|
16
|
+
<component
|
|
17
|
+
:is="as"
|
|
18
|
+
v-bind="props"
|
|
19
|
+
:class="cn(
|
|
20
|
+
'avatar-fallback',
|
|
21
|
+
una?.avatarFallback,
|
|
22
|
+
props.class,
|
|
23
|
+
)"
|
|
24
|
+
>
|
|
25
|
+
<slot>
|
|
26
|
+
<span
|
|
27
|
+
v-if="label && !icon"
|
|
28
|
+
:class="cn(
|
|
29
|
+
'avatar-label',
|
|
30
|
+
una?.avatarLabel,
|
|
31
|
+
)"
|
|
32
|
+
>
|
|
33
|
+
{{ label }}
|
|
34
|
+
</span>
|
|
35
|
+
<Icon
|
|
36
|
+
v-else-if="icon"
|
|
37
|
+
:class="cn(
|
|
38
|
+
'avatar-icon',
|
|
39
|
+
una?.avatarIcon,
|
|
40
|
+
)"
|
|
41
|
+
:name="label"
|
|
42
|
+
/>
|
|
43
|
+
</slot>
|
|
44
|
+
</component>
|
|
45
|
+
</AvatarFallback>
|
|
46
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NAvatarImageProps } from '../../../types'
|
|
3
|
+
import { AvatarImage } from 'radix-vue'
|
|
4
|
+
import { cn } from '../../../utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<NAvatarImageProps>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<AvatarImage
|
|
11
|
+
v-bind="props"
|
|
12
|
+
:src="src!"
|
|
13
|
+
:class="cn(
|
|
14
|
+
'avatar-image',
|
|
15
|
+
una?.avatarImage,
|
|
16
|
+
props.class,
|
|
17
|
+
)"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CollapsibleRootEmits } from 'radix-vue'
|
|
3
|
+
import type { NCollapsibleProps } from '../../../types'
|
|
4
|
+
import { CollapsibleRoot, useForwardPropsEmits } from 'radix-vue'
|
|
5
|
+
import CollapsibleContent from './CollapsibleContent.vue'
|
|
6
|
+
import CollapsibleTrigger from './CollapsibleTrigger.vue'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<NCollapsibleProps>()
|
|
9
|
+
const emits = defineEmits<CollapsibleRootEmits>()
|
|
10
|
+
|
|
11
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<CollapsibleRoot v-slot="{ open }" v-bind="forwarded">
|
|
16
|
+
<slot :open>
|
|
17
|
+
<CollapsibleTrigger>
|
|
18
|
+
<slot name="trigger" :open />
|
|
19
|
+
</CollapsibleTrigger>
|
|
20
|
+
|
|
21
|
+
<CollapsibleContent
|
|
22
|
+
v-bind="_collapsibleContent"
|
|
23
|
+
>
|
|
24
|
+
<slot name="content" />
|
|
25
|
+
</CollapsibleContent>
|
|
26
|
+
</slot>
|
|
27
|
+
</CollapsibleRoot>
|
|
28
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NCollapsibleContentProps } from '../../../types'
|
|
3
|
+
import { CollapsibleContent } from 'radix-vue'
|
|
4
|
+
import { cn } from '../../../utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<NCollapsibleContentProps>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<CollapsibleContent
|
|
11
|
+
v-bind="props"
|
|
12
|
+
:class="cn(
|
|
13
|
+
'collapsible-content',
|
|
14
|
+
props.class,
|
|
15
|
+
)"
|
|
16
|
+
>
|
|
17
|
+
<slot />
|
|
18
|
+
</CollapsibleContent>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { CollapsibleTrigger, type CollapsibleTriggerProps } from 'radix-vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<CollapsibleTriggerProps>()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<CollapsibleTrigger v-bind="props">
|
|
9
|
+
<slot />
|
|
10
|
+
</CollapsibleTrigger>
|
|
11
|
+
</template>
|
|
@@ -15,7 +15,7 @@ const forwardedProps = useForwardProps(delegatedProps)
|
|
|
15
15
|
<DialogDescription
|
|
16
16
|
v-bind="forwardedProps"
|
|
17
17
|
:class="cn(
|
|
18
|
-
'dialog-description',
|
|
18
|
+
'dialog-description data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-48% data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-48%',
|
|
19
19
|
props.una?.dialogDescription,
|
|
20
20
|
props.class,
|
|
21
21
|
)"
|
|
@@ -9,6 +9,7 @@ const props = defineProps<NDialogOverlayProps>()
|
|
|
9
9
|
<template>
|
|
10
10
|
<DialogOverlay
|
|
11
11
|
:class="cn(
|
|
12
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
12
13
|
!props.scrollable ? 'dialog-overlay' : 'dialog-scroll-overlay',
|
|
13
14
|
props.una?.dialogOverlay,
|
|
14
15
|
props.class,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { DropdownMenuContentEmits, DropdownMenuRootEmits } from 'radix-vue'
|
|
3
3
|
import type { NDropdownMenuProps } from '../../../types'
|
|
4
|
-
import { createReusableTemplate } from '@vueuse/core'
|
|
4
|
+
import { createReusableTemplate, reactivePick } from '@vueuse/core'
|
|
5
5
|
import { DropdownMenuPortal, useForwardPropsEmits } from 'radix-vue'
|
|
6
|
-
import { omitProps
|
|
6
|
+
import { omitProps } from '../../../utils'
|
|
7
7
|
import DropdownMenuContent from './DropdownMenuContent.vue'
|
|
8
8
|
import DropdownMenuGroup from './DropdownMenuGroup.vue'
|
|
9
9
|
import DropdownMenuItem from './DropdownMenuItem.vue'
|
|
@@ -24,88 +24,86 @@ const [DefineMenuSub, ReuseMenuSub] = createReusableTemplate<NDropdownMenuProps>
|
|
|
24
24
|
|
|
25
25
|
<template>
|
|
26
26
|
<DropdownMenuRoot
|
|
27
|
-
v-bind="
|
|
27
|
+
v-bind="reactivePick(forwarded, ['defaultOpen', 'open', 'modal', 'dir'])"
|
|
28
28
|
>
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</slot>
|
|
29
|
+
<DropdownMenuTrigger
|
|
30
|
+
v-bind="omitProps({ ...forwarded, ...forwarded._dropdownMenuTrigger }, [
|
|
31
|
+
'dropdownMenuItem',
|
|
32
|
+
'items',
|
|
33
|
+
'menuLabel',
|
|
34
|
+
'_dropdownMenuItem',
|
|
35
|
+
'_dropdownMenuContent',
|
|
36
|
+
'_dropdownMenuLabel',
|
|
37
|
+
'_dropdownMenuSeparator',
|
|
38
|
+
'_dropdownMenuGroup',
|
|
39
|
+
'_dropdownMenuTrigger',
|
|
40
|
+
'_dropdownMenuSubTrigger',
|
|
41
|
+
'_dropdownMenuSubContent',
|
|
42
|
+
])"
|
|
43
|
+
>
|
|
44
|
+
<slot />
|
|
45
|
+
</DropdownMenuTrigger>
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
<DropdownMenuContent
|
|
48
|
+
v-bind="forwarded._dropdownMenuContent"
|
|
49
|
+
>
|
|
50
|
+
<slot name="content">
|
|
51
|
+
<template
|
|
52
|
+
v-if="menuLabel || $slots['menu-label']"
|
|
53
|
+
>
|
|
54
|
+
<DropdownMenuLabel
|
|
55
|
+
:size
|
|
56
|
+
:inset
|
|
57
|
+
:una="forwarded.una?.dropdownMenuLabel"
|
|
58
|
+
v-bind="forwarded._dropdownMenuLabel"
|
|
54
59
|
>
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
</DropdownMenuLabel>
|
|
65
|
-
<DropdownMenuSeparator
|
|
66
|
-
:una="forwarded.una?.dropdownMenuSeparator"
|
|
67
|
-
v-bind="forwarded._dropdownMenuSeparator"
|
|
68
|
-
/>
|
|
69
|
-
</template>
|
|
60
|
+
<slot name="menu-label">
|
|
61
|
+
{{ menuLabel }}
|
|
62
|
+
</slot>
|
|
63
|
+
</DropdownMenuLabel>
|
|
64
|
+
<DropdownMenuSeparator
|
|
65
|
+
:una="forwarded.una?.dropdownMenuSeparator"
|
|
66
|
+
v-bind="forwarded._dropdownMenuSeparator"
|
|
67
|
+
/>
|
|
68
|
+
</template>
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
<slot name="items" :items>
|
|
71
|
+
<DropdownMenuGroup
|
|
72
|
+
:una="forwarded.una?.dropdownMenuGroup"
|
|
73
|
+
v-bind="forwarded._dropdownMenuGroup"
|
|
74
|
+
>
|
|
75
|
+
<template
|
|
76
|
+
v-for="item in items"
|
|
77
|
+
:key="item.label"
|
|
75
78
|
>
|
|
76
|
-
<
|
|
77
|
-
v-
|
|
78
|
-
:
|
|
79
|
+
<slot
|
|
80
|
+
v-if="!item.items && item.label"
|
|
81
|
+
:name="`item-${item.label}`"
|
|
79
82
|
>
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
:inset
|
|
87
|
-
:dropdown-menu-item
|
|
88
|
-
:una="forwarded.una?.dropdownMenuItem"
|
|
89
|
-
v-bind="{ ...item, ...forwarded._dropdownMenuItem, ...item._dropdownMenuItem }"
|
|
90
|
-
/>
|
|
91
|
-
</slot>
|
|
92
|
-
|
|
93
|
-
<DropdownMenuSeparator
|
|
94
|
-
v-else-if="!item.label && !item.items"
|
|
95
|
-
:una="forwarded.una?.dropdownMenuSeparator"
|
|
96
|
-
v-bind="{ ...forwarded._dropdownMenuSeparator, ...item._dropdownMenuSeparator }"
|
|
83
|
+
<DropdownMenuItem
|
|
84
|
+
:size
|
|
85
|
+
:inset
|
|
86
|
+
:dropdown-menu-item
|
|
87
|
+
:una="forwarded.una?.dropdownMenuItem"
|
|
88
|
+
v-bind="{ ...item, ...forwarded._dropdownMenuItem, ...item._dropdownMenuItem }"
|
|
97
89
|
/>
|
|
90
|
+
</slot>
|
|
98
91
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
92
|
+
<DropdownMenuSeparator
|
|
93
|
+
v-else-if="!item.label && !item.items"
|
|
94
|
+
:una="forwarded.una?.dropdownMenuSeparator"
|
|
95
|
+
v-bind="{ ...forwarded._dropdownMenuSeparator, ...item._dropdownMenuSeparator }"
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
<ReuseMenuSub
|
|
99
|
+
v-else
|
|
100
|
+
v-bind="item"
|
|
101
|
+
/>
|
|
102
|
+
</template>
|
|
103
|
+
</DropdownMenuGroup>
|
|
106
104
|
</slot>
|
|
107
|
-
</
|
|
108
|
-
</
|
|
105
|
+
</slot>
|
|
106
|
+
</DropdownMenuContent>
|
|
109
107
|
</DropdownMenuRoot>
|
|
110
108
|
|
|
111
109
|
<DefineMenuSub
|
|
@@ -31,7 +31,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
31
31
|
<DropdownMenuContent
|
|
32
32
|
v-bind="forwarded"
|
|
33
33
|
:class="cn(
|
|
34
|
-
'dropdown-menu-content',
|
|
34
|
+
'dropdown-menu-content data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
35
35
|
props.class,
|
|
36
36
|
props.una?.dropdownMenuContent,
|
|
37
37
|
)"
|
|
@@ -24,7 +24,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
24
24
|
<DropdownMenuSubContent
|
|
25
25
|
v-bind="forwarded"
|
|
26
26
|
:class="cn(
|
|
27
|
-
'dropdown-menu-sub-content',
|
|
27
|
+
'dropdown-menu-sub-content data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
28
28
|
props.class,
|
|
29
29
|
forwarded.una?.dropdownMenuSubContent,
|
|
30
30
|
)"
|
|
@@ -25,25 +25,23 @@ const forwardedProps = useForwardProps(delegatedProps)
|
|
|
25
25
|
<DropdownMenuSubTrigger
|
|
26
26
|
as-child
|
|
27
27
|
>
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</template>
|
|
47
|
-
</Button>
|
|
28
|
+
<slot>
|
|
29
|
+
<Button
|
|
30
|
+
v-bind="forwardedProps"
|
|
31
|
+
:dropdown-menu-item
|
|
32
|
+
:class="cn(
|
|
33
|
+
'dropdown-menu-sub-trigger w-full justify-start font-normal rounded-sm px-2',
|
|
34
|
+
forwardedProps.inset && !(forwardedProps.leading || $slots.leading) && 'pl-8',
|
|
35
|
+
props.class,
|
|
36
|
+
)"
|
|
37
|
+
btn="~"
|
|
38
|
+
:una="{
|
|
39
|
+
btnLeading: cn('dropdown-menu-sub-trigger-leading', forwardedProps.una?.btnLeading),
|
|
40
|
+
btnTrailing: cn('dropdown-menu-sub-trigger-trailing', forwardedProps.una?.btnTrailing),
|
|
41
|
+
...forwardedProps.una,
|
|
42
|
+
}"
|
|
43
|
+
trailing="dropdown-menu-sub-trigger-trailing-icon"
|
|
44
|
+
/>
|
|
45
|
+
</slot>
|
|
48
46
|
</dropdownmenusubtrigger>
|
|
49
47
|
</template>
|
|
@@ -13,23 +13,21 @@ const forwardedProps = useForwardProps(props)
|
|
|
13
13
|
<DropdownMenuTrigger
|
|
14
14
|
as-child
|
|
15
15
|
>
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</template>
|
|
33
|
-
</Button>
|
|
16
|
+
<slot>
|
|
17
|
+
<Button
|
|
18
|
+
v-bind="forwardedProps"
|
|
19
|
+
:id="randomId('dropdown-menu-trigger')"
|
|
20
|
+
:class="cn(
|
|
21
|
+
'dropdown-menu-trigger',
|
|
22
|
+
props.class,
|
|
23
|
+
)"
|
|
24
|
+
:una="{
|
|
25
|
+
btnDefaultVariant: 'dropdown-menu-default-variant',
|
|
26
|
+
btnLeading: cn('dropdown-menu-trigger-leading', forwardedProps.una?.btnLeading),
|
|
27
|
+
btnTrailing: cn('dropdown-menu-trigger-trailing', forwardedProps.una?.btnTrailing),
|
|
28
|
+
...props.una,
|
|
29
|
+
}"
|
|
30
|
+
/>
|
|
31
|
+
</slot>
|
|
34
32
|
</DropdownMenuTrigger>
|
|
35
33
|
</template>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { TooltipRootEmits } from 'radix-vue'
|
|
3
3
|
import type { NTooltipProps } from '../../../types'
|
|
4
|
+
import { reactivePick } from '@vueuse/core'
|
|
4
5
|
import { useForwardPropsEmits } from 'radix-vue'
|
|
5
|
-
|
|
6
6
|
import TooltipContent from './TooltipContent.vue'
|
|
7
7
|
import TooltipProvider from './TooltipProvider.vue'
|
|
8
8
|
import TooltipRoot from './TooltipRoot.vue'
|
|
@@ -14,17 +14,24 @@ defineOptions({
|
|
|
14
14
|
|
|
15
15
|
const props = defineProps<NTooltipProps>()
|
|
16
16
|
const emits = defineEmits<TooltipRootEmits>()
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const rootProps = reactivePick(props, [
|
|
18
|
+
'defaultOpen',
|
|
19
|
+
'delayDuration',
|
|
20
|
+
'disableClosingTrigger',
|
|
21
|
+
'disabled',
|
|
22
|
+
'disableHoverableContent',
|
|
23
|
+
'ignoreNonKeyboardFocus',
|
|
24
|
+
'open',
|
|
25
|
+
])
|
|
26
|
+
const forwarded = useForwardPropsEmits(rootProps, emits)
|
|
19
27
|
</script>
|
|
20
28
|
|
|
21
29
|
<template>
|
|
22
30
|
<TooltipProvider
|
|
23
31
|
v-bind="_tooltipProvider"
|
|
24
|
-
:disabled
|
|
25
32
|
>
|
|
26
33
|
<TooltipRoot
|
|
27
|
-
v-bind="
|
|
34
|
+
v-bind="forwarded"
|
|
28
35
|
>
|
|
29
36
|
<TooltipTrigger
|
|
30
37
|
as-child
|
|
@@ -35,11 +42,11 @@ const forwarded = useForwardPropsEmits(props, emits)
|
|
|
35
42
|
|
|
36
43
|
<TooltipContent
|
|
37
44
|
v-if="$slots.content || content"
|
|
38
|
-
v-bind="
|
|
45
|
+
v-bind="_tooltipContent"
|
|
39
46
|
:size
|
|
40
47
|
:tooltip
|
|
41
48
|
:disabled
|
|
42
|
-
:una="
|
|
49
|
+
:una="una?.tooltipContent"
|
|
43
50
|
>
|
|
44
51
|
<slot name="content">
|
|
45
52
|
{{ content }}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { CheckboxRootEmits } from 'radix-vue'
|
|
3
3
|
import type { NCheckboxProps } from '../../types'
|
|
4
|
+
import { reactivePick } from '@vueuse/core'
|
|
4
5
|
import { CheckboxIndicator, CheckboxRoot, useForwardPropsEmits } from 'radix-vue'
|
|
5
6
|
import { computed } from 'vue'
|
|
6
7
|
import { cn, randomId } from '../../utils'
|
|
@@ -12,11 +13,16 @@ const props = withDefaults(defineProps<NCheckboxProps>(), {
|
|
|
12
13
|
})
|
|
13
14
|
const emits = defineEmits<CheckboxRootEmits>()
|
|
14
15
|
|
|
15
|
-
const delegatedProps =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const delegatedProps = reactivePick(props, [
|
|
17
|
+
'checked',
|
|
18
|
+
'defaultChecked',
|
|
19
|
+
'disabled',
|
|
20
|
+
'id',
|
|
21
|
+
'name',
|
|
22
|
+
'required',
|
|
23
|
+
'value',
|
|
24
|
+
'size',
|
|
25
|
+
])
|
|
20
26
|
|
|
21
27
|
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
22
28
|
|
|
@@ -25,13 +31,11 @@ const id = computed(() => props.id ?? randomId('checkbox'))
|
|
|
25
31
|
|
|
26
32
|
<template>
|
|
27
33
|
<div
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
:class="cn(
|
|
35
|
+
'checkbox-wrapper flex',
|
|
30
36
|
una?.checkboxWrapper,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
]"
|
|
37
|
+
reverse && 'checkbox-reverse',
|
|
38
|
+
)"
|
|
35
39
|
>
|
|
36
40
|
<CheckboxRoot
|
|
37
41
|
v-bind="forwarded"
|