srcdev-nuxt-components 2.1.1 → 2.1.3
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/components/canvas-switcher/CanvasSwitcher.vue +0 -1
- package/components/deep-expanding-menu/DeepExpandingMenu.vue +2 -6
- package/components/deep-expanding-menu/DeepExpandingMenuOld.vue +110 -85
- package/components/functional/pop-over/PopOver.vue +18 -8
- package/nuxt.config.ts +1 -2
- package/package.json +5 -6
- package/plugins/css-anchor-positioning.ts +0 -11
|
@@ -32,7 +32,6 @@ import type { MediaCanvas } from '@/types/types.canvasName';
|
|
|
32
32
|
const canvasName = defineModel<MediaCanvas>('canvasName');
|
|
33
33
|
|
|
34
34
|
const updateCanvas = (setCanvas: MediaCanvas) => {
|
|
35
|
-
console.log('setCanvas', setCanvas);
|
|
36
35
|
canvasName.value = setCanvas;
|
|
37
36
|
};
|
|
38
37
|
</script>
|
|
@@ -121,6 +121,7 @@ watch(
|
|
|
121
121
|
|
|
122
122
|
.navigation-group {
|
|
123
123
|
--_icon-transform: scaleY(1);
|
|
124
|
+
position: relative;
|
|
124
125
|
|
|
125
126
|
.navigation-group-toggle {
|
|
126
127
|
anchor-name: var(--_anchor-name);
|
|
@@ -146,6 +147,7 @@ watch(
|
|
|
146
147
|
/* inset: auto; */
|
|
147
148
|
top: calc(anchor(bottom) + 10px);
|
|
148
149
|
left: calc(anchor(left) + 0px);
|
|
150
|
+
|
|
149
151
|
opacity: 0;
|
|
150
152
|
transition: opacity 200ms, display 200ms, overlay 200ms;
|
|
151
153
|
transition-behavior: allow-discrete;
|
|
@@ -159,12 +161,6 @@ watch(
|
|
|
159
161
|
padding: 12px;
|
|
160
162
|
overflow: clip;
|
|
161
163
|
|
|
162
|
-
/* position-try: flip-inline, flip-block, flip-block flip-inline; */
|
|
163
|
-
/* position-try-fallbacks: flip-inline, flip-block, flip-block flip-inline; */
|
|
164
|
-
|
|
165
|
-
/* position-try: ----anchor-left; */
|
|
166
|
-
/* position-try-fallbacks: --anchor-right; */
|
|
167
|
-
|
|
168
164
|
&:popover-open {
|
|
169
165
|
display: block;
|
|
170
166
|
opacity: 1;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component :is="tag" class="deep-expanding-menu" :class="[elementClasses]">
|
|
2
|
+
<component :is="tag" class="deep-expanding-menu-old" :class="[elementClasses]">
|
|
3
3
|
<div class="inner">
|
|
4
4
|
<template v-for="(link, key) in navLinks" :key="key">
|
|
5
|
-
<NuxtLink v-if="link.path" :to="link.path" class="">{{ link.name }}</NuxtLink>
|
|
6
|
-
<details v-else name="
|
|
7
|
-
<summary
|
|
8
|
-
|
|
9
|
-
<
|
|
5
|
+
<NuxtLink v-if="link.path" :to="link.path" class="navigation-link">{{ link.name }}</NuxtLink>
|
|
6
|
+
<details v-else class="navigation-group" name="navigation-group" :style="`--_position-anchor: --anchor-nav-1-${key};, --_anchor-name: --anchor-nav-1-${key};`">
|
|
7
|
+
<summary class="navigation-group-toggle">
|
|
8
|
+
<span>{{ link.name }}</span>
|
|
9
|
+
<Icon name="bi:caret-down-fill" class="icon" />
|
|
10
|
+
</summary>
|
|
11
|
+
<div class="navigation-group-panel" :id="`popovertarget-nav-1-${key}`">
|
|
12
|
+
<h4 class="heading-4 mb-6">{{ link.childLinksTitle }}</h4>
|
|
13
|
+
<ul class="navigation-group-list">
|
|
14
|
+
<li class="navigation-group-item" v-for="childLink in link.childLinks" :key="childLink.name">
|
|
15
|
+
<NuxtLink :to="childLink.path" class="navigation-group-link">{{ childLink.name }}</NuxtLink>
|
|
16
|
+
</li>
|
|
17
|
+
</ul>
|
|
10
18
|
</div>
|
|
11
19
|
</details>
|
|
12
20
|
</template>
|
|
@@ -23,6 +31,10 @@ const props = defineProps({
|
|
|
23
31
|
return TAGS_ALLOWED.includes(value);
|
|
24
32
|
},
|
|
25
33
|
},
|
|
34
|
+
navLinks: {
|
|
35
|
+
type: Array as PropType<INavLink[]>,
|
|
36
|
+
default: () => [],
|
|
37
|
+
},
|
|
26
38
|
styleClassPassthrough: {
|
|
27
39
|
type: Array as PropType<string[]>,
|
|
28
40
|
default: () => [],
|
|
@@ -30,7 +42,6 @@ const props = defineProps({
|
|
|
30
42
|
});
|
|
31
43
|
|
|
32
44
|
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
33
|
-
const detailsRef = useTemplateRef('detailsRef');
|
|
34
45
|
|
|
35
46
|
watch(
|
|
36
47
|
() => props.styleClassPassthrough,
|
|
@@ -38,10 +49,6 @@ watch(
|
|
|
38
49
|
resetElementClasses(props.styleClassPassthrough);
|
|
39
50
|
}
|
|
40
51
|
);
|
|
41
|
-
|
|
42
|
-
onMounted(() => {
|
|
43
|
-
console.log(detailsRef.value);
|
|
44
|
-
});
|
|
45
52
|
</script>
|
|
46
53
|
|
|
47
54
|
<script lang="ts">
|
|
@@ -53,54 +60,11 @@ interface INavLink {
|
|
|
53
60
|
isExternal?: boolean;
|
|
54
61
|
childLinks?: INavLink[];
|
|
55
62
|
}
|
|
56
|
-
|
|
57
|
-
const navLinks = <INavLink[]>[
|
|
58
|
-
{ name: 'Home', path: '/' },
|
|
59
|
-
{
|
|
60
|
-
name: 'Components',
|
|
61
|
-
childLinks: [
|
|
62
|
-
{ name: 'Container Glow', path: '/ui/container-glow' },
|
|
63
|
-
{ name: 'Accordian', path: '/ui/accordian' },
|
|
64
|
-
{ name: 'Dialogs', path: '/ui/dialog' },
|
|
65
|
-
{ name: 'Tabs X', path: '/ui/tabs' },
|
|
66
|
-
{ name: 'Tabs Y', path: '/ui/tabs-y' },
|
|
67
|
-
{ name: 'Prompts', path: '/ui/display-prompt' },
|
|
68
|
-
{ name: 'Rotating Carousel', path: '/ui/rotating-carousel' },
|
|
69
|
-
{ name: 'Clipped Panels', path: '/ui/clipped-panels' },
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: 'Layouts',
|
|
74
|
-
childLinks: [
|
|
75
|
-
{ name: 'Layout Row', path: '/ui/layout-row' },
|
|
76
|
-
{ name: 'Layout Grid A', path: '/ui/layout-grid-a' },
|
|
77
|
-
{ name: 'Layout Grid B', path: '/ui/layout-grid-b' },
|
|
78
|
-
{ name: 'Simple Grid', path: '/ui/simple-grid' },
|
|
79
|
-
{ name: 'Masonry Grid Simple', path: '/ui/masonry-grid' },
|
|
80
|
-
{ name: 'Masonry Grid Sorted', path: '/ui/masonry-grid-sorted' },
|
|
81
|
-
{ name: 'Masonry Grid Ordered', path: '/ui/masonry-grid-ordered' },
|
|
82
|
-
{ name: 'Masonry Columns', path: '/ui/masonry-columns' },
|
|
83
|
-
],
|
|
84
|
-
},
|
|
85
|
-
{ name: 'About', path: '/' },
|
|
86
|
-
];
|
|
87
63
|
</script>
|
|
88
64
|
|
|
89
65
|
<style lang="css">
|
|
90
66
|
@layer popover-setup {
|
|
91
|
-
|
|
92
|
-
inset: auto;
|
|
93
|
-
top: anchor(top);
|
|
94
|
-
right: calc(anchor(left) + 10px);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@position-try-fallbacks --anchor-right {
|
|
98
|
-
inset: auto;
|
|
99
|
-
top: anchor(top);
|
|
100
|
-
left: calc(anchor(right) + 10px);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.deep-expanding-menu {
|
|
67
|
+
.deep-expanding-menu-old {
|
|
104
68
|
container-type: inline-size;
|
|
105
69
|
display: grid;
|
|
106
70
|
grid-template-areas: 'element-stack';
|
|
@@ -114,64 +78,125 @@ const navLinks = <INavLink[]>[
|
|
|
114
78
|
align-items: center;
|
|
115
79
|
z-index: 1;
|
|
116
80
|
|
|
117
|
-
|
|
118
|
-
|
|
81
|
+
.navigation-link,
|
|
82
|
+
.navigation-group-toggle {
|
|
83
|
+
all: unset;
|
|
84
|
+
border-bottom: 2px solid transparent;
|
|
85
|
+
padding-block: 8px;
|
|
86
|
+
|
|
87
|
+
transition: border-color 200ms;
|
|
88
|
+
|
|
119
89
|
&:hover {
|
|
120
90
|
cursor: pointer;
|
|
91
|
+
border-color: light-dark(var(--blue-12), var(--gray-0));
|
|
121
92
|
}
|
|
122
|
-
}
|
|
123
93
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
padding: 6px 12px;
|
|
94
|
+
&:focus {
|
|
95
|
+
border-color: light-dark(var(--blue-12), var(--gray-0));
|
|
96
|
+
}
|
|
128
97
|
|
|
129
98
|
&:focus-visible {
|
|
130
|
-
|
|
99
|
+
border-color: light-dark(var(--blue-12), var(--gray-0));
|
|
131
100
|
}
|
|
132
101
|
}
|
|
133
102
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
border: 1px solid red;
|
|
137
|
-
padding: 6px 12px;
|
|
138
|
-
}
|
|
103
|
+
.navigation-group {
|
|
104
|
+
--_icon-transform: scaleY(1);
|
|
139
105
|
|
|
140
|
-
details {
|
|
141
106
|
display: grid;
|
|
142
107
|
grid-template-areas: 'details-stack';
|
|
143
108
|
z-index: 1;
|
|
109
|
+
position: relative;
|
|
144
110
|
|
|
145
|
-
summary
|
|
111
|
+
summary::-webkit-details-marker,
|
|
112
|
+
summary::marker {
|
|
113
|
+
display: none;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&[open] {
|
|
117
|
+
--_icon-transform: scaleY(-1);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.navigation-group-toggle {
|
|
146
121
|
grid-area: details-stack;
|
|
147
|
-
/* position: relative; */
|
|
148
|
-
anchor-name: var(--_anchor-name);
|
|
149
122
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
123
|
+
display: flex !important;
|
|
124
|
+
align-items: center;
|
|
125
|
+
gap: 12px;
|
|
126
|
+
list-style: none;
|
|
153
127
|
|
|
154
|
-
|
|
155
|
-
|
|
128
|
+
.icon {
|
|
129
|
+
display: block;
|
|
130
|
+
font-size: 1.2rem;
|
|
131
|
+
|
|
132
|
+
transform: var(--_icon-transform);
|
|
133
|
+
transition: transform 200ms;
|
|
156
134
|
}
|
|
157
135
|
}
|
|
158
136
|
|
|
159
|
-
|
|
160
|
-
position-anchor: var(--_position-anchor);
|
|
137
|
+
.navigation-group-panel {
|
|
161
138
|
background-color: black;
|
|
162
139
|
display: grid;
|
|
163
140
|
grid-area: details-stack;
|
|
164
141
|
z-index: 2;
|
|
165
142
|
position: absolute;
|
|
166
143
|
inset: auto;
|
|
167
|
-
top:
|
|
168
|
-
left:
|
|
169
|
-
/* translate: 0 20px; */
|
|
170
|
-
padding: 12px;
|
|
144
|
+
top: 40px;
|
|
145
|
+
left: 0px;
|
|
171
146
|
gap: 12px;
|
|
172
147
|
|
|
173
|
-
|
|
174
|
-
|
|
148
|
+
width: 200px;
|
|
149
|
+
|
|
150
|
+
@media screen and (min-width: 768px) {
|
|
151
|
+
width: 400px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@media screen and (min-width: 1024px) {
|
|
155
|
+
width: 600px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
background-color: white;
|
|
159
|
+
border: 1px solid black;
|
|
160
|
+
border-radius: 12px;
|
|
161
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
162
|
+
padding: 12px;
|
|
163
|
+
overflow: clip;
|
|
164
|
+
|
|
165
|
+
h4 {
|
|
166
|
+
color: var(--gray-12);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.navigation-group-list {
|
|
170
|
+
display: grid;
|
|
171
|
+
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
|
|
172
|
+
gap: 12px;
|
|
173
|
+
padding-inline-start: 0;
|
|
174
|
+
margin-block-end: 8px;
|
|
175
|
+
|
|
176
|
+
.navigation-group-item {
|
|
177
|
+
display: block;
|
|
178
|
+
|
|
179
|
+
a.navigation-group-link {
|
|
180
|
+
display: inline-block;
|
|
181
|
+
color: var(--gray-12);
|
|
182
|
+
text-decoration: none;
|
|
183
|
+
padding-block: 8px;
|
|
184
|
+
|
|
185
|
+
border-bottom: 2px solid transparent;
|
|
186
|
+
|
|
187
|
+
transition: border-color 200ms;
|
|
188
|
+
|
|
189
|
+
&:hover {
|
|
190
|
+
cursor: pointer;
|
|
191
|
+
border-color: var(--gray-12);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&:focus-visible {
|
|
195
|
+
border-color: var(--gray-12);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
175
200
|
}
|
|
176
201
|
}
|
|
177
202
|
}
|
|
@@ -30,7 +30,7 @@ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
|
30
30
|
|
|
31
31
|
<style scoped lang="css">
|
|
32
32
|
@layer popover-setup {
|
|
33
|
-
@position-try --right {
|
|
33
|
+
/* @position-try --right {
|
|
34
34
|
inset: auto;
|
|
35
35
|
top: anchor(top);
|
|
36
36
|
left: calc(anchor(right) + 10px);
|
|
@@ -40,7 +40,7 @@ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
|
40
40
|
inset: auto;
|
|
41
41
|
top: anchor(top);
|
|
42
42
|
right: calc(anchor(left) + 10px);
|
|
43
|
-
}
|
|
43
|
+
} */
|
|
44
44
|
|
|
45
45
|
.popover-trigger {
|
|
46
46
|
anchor-name: v-bind(anchorName);
|
|
@@ -52,17 +52,13 @@ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
|
52
52
|
position-anchor: v-bind(anchorName);
|
|
53
53
|
margin: 0;
|
|
54
54
|
inset: auto;
|
|
55
|
-
top: anchor(top);
|
|
55
|
+
top: calc(anchor(top) + 0px);
|
|
56
56
|
left: calc(anchor(right) + 10px);
|
|
57
57
|
opacity: 0;
|
|
58
58
|
transition: opacity 200ms, display 200ms, overlay 200ms;
|
|
59
59
|
transition-behavior: allow-discrete;
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
/* position-try-fallbacks: flip-inline, flip-block, flip-block flip-inline; */
|
|
63
|
-
|
|
64
|
-
position-try: --right;
|
|
65
|
-
position-try-fallbacks: --left;
|
|
61
|
+
position-try-fallbacks: flip-inline;
|
|
66
62
|
|
|
67
63
|
&:popover-open {
|
|
68
64
|
display: block;
|
|
@@ -74,5 +70,19 @@ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
|
74
70
|
}
|
|
75
71
|
}
|
|
76
72
|
}
|
|
73
|
+
|
|
74
|
+
@position-try --top-left {
|
|
75
|
+
top: anchor(top);
|
|
76
|
+
right: calc(anchor(left + 10px));
|
|
77
|
+
left: unset;
|
|
78
|
+
/* width: revert; */
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@position-try --bottom-right {
|
|
82
|
+
top: anchor(bottom);
|
|
83
|
+
/* right: calc(anchor(left + 10px)); */
|
|
84
|
+
/* left: unset; */
|
|
85
|
+
/* width: revert; */
|
|
86
|
+
}
|
|
77
87
|
}
|
|
78
88
|
</style>
|
package/nuxt.config.ts
CHANGED
|
@@ -3,7 +3,6 @@ export default defineNuxtConfig({
|
|
|
3
3
|
devtools: { enabled: true },
|
|
4
4
|
css: ['modern-normalize', './assets/styles/main.css'],
|
|
5
5
|
modules: ['@nuxt/icon', '@nuxt/image'],
|
|
6
|
-
|
|
7
6
|
app: {
|
|
8
7
|
head: {
|
|
9
8
|
htmlAttrs: {
|
|
@@ -32,4 +31,4 @@ export default defineNuxtConfig({
|
|
|
32
31
|
},
|
|
33
32
|
// plugins: ['css-anchor-positioning'],
|
|
34
33
|
compatibilityDate: '2024-07-13',
|
|
35
|
-
});
|
|
34
|
+
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "srcdev-nuxt-components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.3",
|
|
5
5
|
"main": "nuxt.config.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"clean": "rm -rf .nuxt && rm -rf .output && rm -rf .playground/.nuxt && rm -rf .playground/.output",
|
|
@@ -30,15 +30,14 @@
|
|
|
30
30
|
"@nuxt/eslint-config": "1.0.0",
|
|
31
31
|
"@nuxt/icon": "1.10.3",
|
|
32
32
|
"@nuxt/image": "^1.9.0",
|
|
33
|
-
"
|
|
34
|
-
"eslint": "9.19.0",
|
|
33
|
+
"eslint": "9.22.0",
|
|
35
34
|
"happy-dom": "16.8.1",
|
|
36
|
-
"nuxt": "3.
|
|
35
|
+
"nuxt": "3.16.0",
|
|
37
36
|
"release-it": "18.1.2",
|
|
38
|
-
"typescript": "5.
|
|
37
|
+
"typescript": "5.8.2"
|
|
39
38
|
},
|
|
40
39
|
"dependencies": {
|
|
41
|
-
"@vueuse/core": "
|
|
40
|
+
"@vueuse/core": "13.0.0",
|
|
42
41
|
"focus-trap-vue": "4.0.3",
|
|
43
42
|
"modern-normalize": "3.0.1"
|
|
44
43
|
},
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import polyfill from '@oddbird/css-anchor-positioning/fn';
|
|
2
|
-
|
|
3
|
-
export default defineNuxtPlugin(() => {
|
|
4
|
-
if (import.meta.client && !('anchorName' in document.documentElement.style)) {
|
|
5
|
-
polyfill({
|
|
6
|
-
elements: undefined,
|
|
7
|
-
excludeInlineStyles: false,
|
|
8
|
-
useAnimationFrame: false,
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
});
|