@bjj/nuxt-layer-shadcn-ui 0.13.5 → 0.13.7
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/app/components/ui/Dropdown/MenuItems.vue +4 -1
- package/app/components/ui/Dropdown/index.stories.ts +2 -0
- package/app/components/ui/Dropdown/index.vue +3 -0
- package/app/components/ui/Dropdown/types.ts +4 -0
- package/app/components/ui/Popover/index.stories.ts +2 -0
- package/app/components/ui/Popover/index.vue +2 -0
- package/app/components/ui/Popover/types.ts +2 -0
- package/app/components/ui/Tabs/index.vue +1 -0
- package/package.json +2 -2
|
@@ -123,7 +123,10 @@ const handleItemAction = (
|
|
|
123
123
|
>
|
|
124
124
|
<ItemContent :item="menu" />
|
|
125
125
|
</DropdownMenuSubTrigger>
|
|
126
|
-
<DropdownMenuSubContent
|
|
126
|
+
<DropdownMenuSubContent
|
|
127
|
+
:style="ctx?.contentStyle.value"
|
|
128
|
+
:collisionPadding="ctx?.collisionPadding.value"
|
|
129
|
+
>
|
|
127
130
|
<MenuItems :menus="menu.subMenus" />
|
|
128
131
|
</DropdownMenuSubContent>
|
|
129
132
|
</DropdownMenuSub>
|
|
@@ -112,6 +112,7 @@ const meta = {
|
|
|
112
112
|
side: { control: 'select', options: sides },
|
|
113
113
|
align: { control: 'select', options: aligns },
|
|
114
114
|
sideOffset: { control: 'number' },
|
|
115
|
+
collisionPadding: { control: 'number' },
|
|
115
116
|
minWidth: { control: 'text' },
|
|
116
117
|
},
|
|
117
118
|
args: {
|
|
@@ -120,6 +121,7 @@ const meta = {
|
|
|
120
121
|
side: undefined,
|
|
121
122
|
align: undefined,
|
|
122
123
|
sideOffset: undefined,
|
|
124
|
+
collisionPadding: undefined,
|
|
123
125
|
minWidth: undefined,
|
|
124
126
|
},
|
|
125
127
|
render: args => ({
|
|
@@ -12,6 +12,7 @@ defineOptions({ inheritAttrs: false })
|
|
|
12
12
|
const props = withDefaults(defineProps<DropdownProps>(), {
|
|
13
13
|
menus: () => [],
|
|
14
14
|
trigger: 'hover',
|
|
15
|
+
collisionPadding: 8,
|
|
15
16
|
class: undefined,
|
|
16
17
|
minWidth: undefined,
|
|
17
18
|
})
|
|
@@ -80,6 +81,7 @@ provide(dropdownContextKey, {
|
|
|
80
81
|
hide,
|
|
81
82
|
slots,
|
|
82
83
|
contentStyle,
|
|
84
|
+
collisionPadding: computed(() => props.collisionPadding),
|
|
83
85
|
})
|
|
84
86
|
|
|
85
87
|
onBeforeUnmount(() => {
|
|
@@ -103,6 +105,7 @@ onBeforeUnmount(() => {
|
|
|
103
105
|
v-bind="$attrs"
|
|
104
106
|
:class="props.class"
|
|
105
107
|
:style="contentStyle"
|
|
108
|
+
:collisionPadding="collisionPadding"
|
|
106
109
|
@mouseenter="handleMenuEnter"
|
|
107
110
|
@mouseleave="handleMenuLeave"
|
|
108
111
|
>
|
|
@@ -104,6 +104,8 @@ export interface DropdownProps extends /* @vue-ignore */ DropdownMenuContentProp
|
|
|
104
104
|
menus?: DropdownItem[]
|
|
105
105
|
/** Trigger mode for showing the dropdown. Defaults to 'hover'. */
|
|
106
106
|
trigger?: 'click' | 'hover'
|
|
107
|
+
/** Gap kept from the viewport edges when repositioning on collision. Applies to the root content and all sub-menus. Defaults to 8. */
|
|
108
|
+
collisionPadding?: DropdownMenuContentProps['collisionPadding']
|
|
107
109
|
/** Extra class for the dropdown content container. */
|
|
108
110
|
class?: ClassValue
|
|
109
111
|
/** Min-width applied to the root content and all sub-menus. Numbers are treated as px. */
|
|
@@ -118,6 +120,8 @@ export interface DropdownContext {
|
|
|
118
120
|
slots: Slots
|
|
119
121
|
/** Inline style applied to root content and all sub-menus (currently min-width). */
|
|
120
122
|
contentStyle: ComputedRef<{ minWidth?: string } | undefined>
|
|
123
|
+
/** Collision padding applied to root content and all sub-menus. */
|
|
124
|
+
collisionPadding: ComputedRef<DropdownMenuContentProps['collisionPadding']>
|
|
121
125
|
}
|
|
122
126
|
|
|
123
127
|
/** Provide/inject key for the shared DropdownContext. */
|
|
@@ -11,12 +11,14 @@ const meta = {
|
|
|
11
11
|
side: { control: 'select', options: [ 'top', 'bottom', 'left', 'right' ]},
|
|
12
12
|
align: { control: 'select', options: [ 'start', 'center', 'end' ]},
|
|
13
13
|
sideOffset: { control: 'number' },
|
|
14
|
+
collisionPadding: { control: 'number' },
|
|
14
15
|
},
|
|
15
16
|
args: {
|
|
16
17
|
trigger: 'click',
|
|
17
18
|
side: undefined,
|
|
18
19
|
align: undefined,
|
|
19
20
|
sideOffset: undefined,
|
|
21
|
+
collisionPadding: undefined,
|
|
20
22
|
},
|
|
21
23
|
render: args => ({
|
|
22
24
|
components: { Popover, Button },
|
|
@@ -10,6 +10,7 @@ defineOptions({ inheritAttrs: false })
|
|
|
10
10
|
|
|
11
11
|
const props = withDefaults(defineProps<PopoverProps>(), {
|
|
12
12
|
trigger: 'click',
|
|
13
|
+
collisionPadding: 8,
|
|
13
14
|
class: undefined,
|
|
14
15
|
})
|
|
15
16
|
|
|
@@ -80,6 +81,7 @@ onBeforeUnmount(() => {
|
|
|
80
81
|
<PopoverContent
|
|
81
82
|
v-bind="$attrs"
|
|
82
83
|
:class="props.class"
|
|
84
|
+
:collisionPadding="collisionPadding"
|
|
83
85
|
@mouseenter="handleContentEnter"
|
|
84
86
|
@mouseleave="handleContentLeave"
|
|
85
87
|
>
|
|
@@ -3,6 +3,8 @@ import type { PopoverContentProps } from 'reka-ui'
|
|
|
3
3
|
export interface PopoverProps extends /* @vue-ignore */ PopoverContentProps {
|
|
4
4
|
/** Trigger mode for showing the popover. Defaults to 'click'. */
|
|
5
5
|
trigger?: 'click' | 'hover'
|
|
6
|
+
/** Gap kept from the viewport edges when repositioning on collision. Defaults to 8. */
|
|
7
|
+
collisionPadding?: PopoverContentProps['collisionPadding']
|
|
6
8
|
/** Extra class for the popover content container. */
|
|
7
9
|
class?: ClassValue
|
|
8
10
|
}
|
|
@@ -33,6 +33,7 @@ const mergedListClass = computed(() => cn(props.rounded && 'rounded-full', props
|
|
|
33
33
|
function getTriggerClass (item: TabsItem) {
|
|
34
34
|
const showsOnlyIcon = !!item.icon && (props.iconOnly || !item.title)
|
|
35
35
|
return cn(
|
|
36
|
+
'data-[state=active]:bg-card',
|
|
36
37
|
props.rounded && 'rounded-full',
|
|
37
38
|
showsOnlyIcon && 'px-0 aspect-square flex-none',
|
|
38
39
|
props.triggerClass,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bjj/nuxt-layer-shadcn-ui",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.7",
|
|
4
4
|
"description": "Nuxt layer providing shadcn-vue based UI components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./nuxt.config.ts",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"vue-i18n": "^11",
|
|
43
43
|
"vue-router": "^4 || ^5"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "b05cb4b437151428748e79fcfa78f73645fbd71a"
|
|
46
46
|
}
|