srcdev-nuxt-components 6.0.0 → 6.0.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/README.md +2 -2
- package/app/assets/styles/extends-layer/srcdev-components/components/_display-prompt-core.css +72 -0
- package/app/assets/styles/extends-layer/srcdev-components/components/index.css +1 -0
- package/app/assets/styles/extends-layer/srcdev-components/index.css +2 -0
- package/app/assets/styles/extends-layer/srcdev-components/setup/index.css +1 -0
- package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_error.css +15 -0
- package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_info.css +15 -0
- package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_secondary.css +15 -0
- package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_success.css +15 -0
- package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_warning.css +15 -0
- package/app/assets/styles/extends-layer/srcdev-components/setup/themes/index.css +5 -0
- package/app/assets/styles/main.css +2 -0
- package/app/assets/styles/setup/_head.css +36 -0
- package/app/assets/styles/setup/a11y/_utils.css +20 -0
- package/app/assets/styles/setup/a11y/_variables.css +8 -0
- package/app/assets/styles/setup/a11y/index.css +2 -0
- package/app/assets/styles/setup/index.css +5 -0
- package/app/assets/styles/setup/typography/index.css +2 -0
- package/app/assets/styles/setup/typography/utility-classes/_generic-font-classes.css +217 -0
- package/app/assets/styles/setup/typography/utility-classes/_generic-font-variation-settings.css +29 -0
- package/app/assets/styles/setup/typography/utility-classes/_generic-font-weights.css +39 -0
- package/app/assets/styles/setup/typography/utility-classes/index.css +3 -0
- package/app/assets/styles/setup/typography/vars/_colors.css +14 -0
- package/app/assets/styles/setup/typography/vars/_reponsive-font-sizes.css +12 -0
- package/app/assets/styles/setup/typography/vars/index.css +2 -0
- package/app/assets/styles/setup/utility-classes/_fluid-spacing.css +13 -0
- package/app/assets/styles/setup/utility-classes/animations/_auto-rotate.css +13 -0
- package/app/assets/styles/setup/utility-classes/animations/_entry-exit-blur.css +16 -0
- package/app/assets/styles/setup/utility-classes/animations/_entry-slide-in.css +15 -0
- package/app/assets/styles/setup/utility-classes/animations/_entry-zoom-reveal.css +15 -0
- package/app/assets/styles/setup/utility-classes/animations/index.css +4 -0
- package/app/assets/styles/setup/utility-classes/index.css +2 -0
- package/app/assets/styles/setup/variables/colors/_blue.css +15 -0
- package/app/assets/styles/setup/variables/colors/_gray.css +16 -0
- package/app/assets/styles/setup/variables/colors/_green.css +15 -0
- package/app/assets/styles/setup/variables/colors/_orange.css +15 -0
- package/app/assets/styles/setup/variables/colors/_red.css +15 -0
- package/app/assets/styles/setup/variables/colors/_yellow.css +15 -0
- package/app/assets/styles/setup/variables/colors/index.css +6 -0
- package/app/assets/styles/setup/variables/index.css +1 -0
- package/app/components/accordian/AccordianCore.vue +46 -0
- package/app/components/animated-svg-text/AnimatedSvgText.vue +87 -0
- package/app/components/canvas-switcher/CanvasSwitcher.vue +77 -0
- package/app/components/carousel-basic/CarouselBasic.vue +291 -0
- package/app/components/carousel-basic/CarouselFlip.vue +461 -0
- package/app/components/carousel-basic/CarouselInfinite.vue +325 -0
- package/app/components/clip-element/ClipElement.vue +73 -0
- package/app/components/clipped-panels/ClippedPanel.vue +73 -0
- package/app/components/container-glow/ContainerGlowCore.vue +211 -0
- package/app/components/content-grid/ContentGrid.vue +85 -0
- package/app/components/deep-expanding-menu/DeepExpandingMenu.vue +214 -0
- package/app/components/deep-expanding-menu/DeepExpandingMenuOld.vue +218 -0
- package/app/components/display-banner/DisplayBanner.vue +63 -0
- package/app/components/display-details/DisplayDetailsCore.vue +301 -0
- package/app/components/display-dialog/DisplayDialogCore.vue +255 -0
- package/app/components/display-dialog/variants/DisplayDialogConfirm.vue +45 -0
- package/app/components/display-dialog/variants/DisplayDialogScrollableContent.vue +49 -0
- package/app/components/display-grid/DisplayGridCore.vue +22 -0
- package/app/components/display-prompt/DisplayPromptCore.vue +187 -0
- package/app/components/display-prompt/variants/DisplayPromptError.vue +53 -0
- package/app/components/expanding-panel/ExpandingPanel.vue +124 -0
- package/app/components/image-galleries/SliderGallery.vue +784 -0
- package/app/components/layout-grids/LayoutGridA.vue +103 -0
- package/app/components/layout-grids/LayoutGridB.vue +132 -0
- package/app/components/layout-row/LayoutRow.vue +165 -0
- package/app/components/masonry-grid/MasonryGrid.vue +62 -0
- package/app/components/masonry-grid-ordered/MasonryGridOrdered.vue +158 -0
- package/app/components/masonry-grid-sorted/MasonryGridSorted.vue +115 -0
- package/app/components/pop-over/PopOver.vue +88 -0
- package/app/components/responsive-header/NavigationItems.vue +169 -0
- package/app/components/responsive-header/ResponsiveHeader.vue +686 -0
- package/app/components/rotating-carousel/RotatingCarouselImage.vue +200 -0
- package/app/components/skip-links/SkipLinks.vue +92 -0
- package/app/components/tabs/TabsCore.vue +277 -0
- package/app/composables/useDialogControls.ts +44 -0
- package/app/composables/useStyleClassPassthrough.ts +35 -0
- package/app/composables/useTabs.ts +201 -0
- package/app/types/gallery-data.ts +13 -0
- package/app/types/responsiveHeader.ts +38 -0
- package/app/types/types.carousel-basic.ts +19 -0
- package/package.json +3 -6
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="tag"
|
|
4
|
+
class="rotating-carousel"
|
|
5
|
+
:class="[elementClasses]"
|
|
6
|
+
:style="`--_rotate-x: ${rotateXProp}deg; --_perspective: ${perspectiveProp}; --_translateZ: ${translateZProp}; --_animation-play-state: ${pauseOnHover ? 'paused' : 'running'}`"
|
|
7
|
+
ref="carouselRef"
|
|
8
|
+
>
|
|
9
|
+
<div class="slider" :style="`--quantity: ${Object.keys(data).length}`">
|
|
10
|
+
<div v-for="(item, key) in data" :key="key" class="item" :style="`--_position: ${key}`"><NuxtImg :src="item.src" :alt="item.alt" /></div>
|
|
11
|
+
</div>
|
|
12
|
+
</component>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script lang="ts">
|
|
16
|
+
const TAGS_ALLOWED = <string[]>['div', 'p', 'span', 'section', 'article', 'aside', 'header', 'footer', 'main', 'nav', 'ul', 'ol'];
|
|
17
|
+
interface IAccordianData {
|
|
18
|
+
src: string;
|
|
19
|
+
alt: string;
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
data: {
|
|
26
|
+
type: Array as PropType<IAccordianData[]>,
|
|
27
|
+
default: () => [],
|
|
28
|
+
},
|
|
29
|
+
tag: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: 'div',
|
|
32
|
+
validator(value: string) {
|
|
33
|
+
return TAGS_ALLOWED.includes(value);
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
rotateX: {
|
|
37
|
+
type: Number,
|
|
38
|
+
default: 0,
|
|
39
|
+
},
|
|
40
|
+
perspective: {
|
|
41
|
+
type: Number,
|
|
42
|
+
default: 1000,
|
|
43
|
+
},
|
|
44
|
+
translateZ: {
|
|
45
|
+
type: Number,
|
|
46
|
+
default: 1000,
|
|
47
|
+
},
|
|
48
|
+
pauseOnHover: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false,
|
|
51
|
+
},
|
|
52
|
+
useParallaxEffect: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true,
|
|
55
|
+
},
|
|
56
|
+
styleClassPassthrough: {
|
|
57
|
+
type: Array as PropType<string[]>,
|
|
58
|
+
default: () => [],
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const perspectiveProp = computed(() => `${props.perspective.toString()}px`);
|
|
63
|
+
const translateZProp = computed(() => `${props.translateZ.toString()}px`);
|
|
64
|
+
|
|
65
|
+
const carouselRef = ref<HTMLElement | null>(null);
|
|
66
|
+
const rotateXProp = ref(props.rotateX);
|
|
67
|
+
const minRotateX = -32;
|
|
68
|
+
const maxRotateX = 32;
|
|
69
|
+
|
|
70
|
+
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
71
|
+
|
|
72
|
+
watch(
|
|
73
|
+
() => props.styleClassPassthrough,
|
|
74
|
+
() => {
|
|
75
|
+
resetElementClasses(props.styleClassPassthrough);
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
watch(
|
|
80
|
+
() => props.rotateX,
|
|
81
|
+
() => {
|
|
82
|
+
if (!props.useParallaxEffect) {
|
|
83
|
+
console.log('rotateXProp changed: ', rotateXProp.value);
|
|
84
|
+
|
|
85
|
+
rotateXProp.value = props.rotateX;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
watch(
|
|
91
|
+
() => props.useParallaxEffect,
|
|
92
|
+
(currentValue) => {
|
|
93
|
+
if (currentValue) {
|
|
94
|
+
handleScroll();
|
|
95
|
+
window.addEventListener('scroll', handleScroll);
|
|
96
|
+
} else {
|
|
97
|
+
window.removeEventListener('scroll', handleScroll);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
const handleScroll = () => {
|
|
103
|
+
if (!carouselRef.value) return;
|
|
104
|
+
if ('IntersectionObserver' in window) {
|
|
105
|
+
const rect = carouselRef.value.getBoundingClientRect();
|
|
106
|
+
const viewportHeight = window.innerHeight;
|
|
107
|
+
|
|
108
|
+
const elementCenter = rect.top + rect.height / 2;
|
|
109
|
+
const viewportCenter = viewportHeight / 2;
|
|
110
|
+
const distanceFromCenter = viewportCenter - elementCenter;
|
|
111
|
+
const maxDistance = viewportHeight / 2 + rect.height / 2;
|
|
112
|
+
|
|
113
|
+
const progress = (distanceFromCenter + maxDistance) / (maxDistance * 2);
|
|
114
|
+
const clampedProgress = Math.max(0, Math.min(1, progress));
|
|
115
|
+
|
|
116
|
+
rotateXProp.value = minRotateX + (maxRotateX - minRotateX) * clampedProgress;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
onMounted(async () => {
|
|
121
|
+
if (props.useParallaxEffect) {
|
|
122
|
+
handleScroll();
|
|
123
|
+
await nextTick();
|
|
124
|
+
window.addEventListener('scroll', handleScroll);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
onUnmounted(() => {
|
|
129
|
+
window.removeEventListener('scroll', handleScroll);
|
|
130
|
+
});
|
|
131
|
+
</script>
|
|
132
|
+
|
|
133
|
+
<style lang="css">
|
|
134
|
+
/* @property --_rotate-x {
|
|
135
|
+
syntax: '<angle>';
|
|
136
|
+
inherits: false;
|
|
137
|
+
initial-value: 0deg;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@keyframes autoRotateAnimation {
|
|
141
|
+
from {
|
|
142
|
+
--_rotate-x: -16deg;
|
|
143
|
+
}
|
|
144
|
+
to {
|
|
145
|
+
--_rotate-x: 16deg;
|
|
146
|
+
}
|
|
147
|
+
} */
|
|
148
|
+
|
|
149
|
+
@keyframes autoRun {
|
|
150
|
+
from {
|
|
151
|
+
transform: perspective(var(--_perspective)) rotateX(var(--_rotate-x)) rotateY(0deg);
|
|
152
|
+
}
|
|
153
|
+
to {
|
|
154
|
+
transform: perspective(var(--_perspective)) rotateX(var(--_rotate-x)) rotateY(360deg);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.rotating-carousel {
|
|
159
|
+
width: 100%;
|
|
160
|
+
height: 70svh;
|
|
161
|
+
text-align: center;
|
|
162
|
+
overflow: hidden;
|
|
163
|
+
position: relative;
|
|
164
|
+
|
|
165
|
+
/* padding-block: 800px; */
|
|
166
|
+
|
|
167
|
+
/* &.scroll-effect {
|
|
168
|
+
animation: autoRotateAnimation;
|
|
169
|
+
animation-timeline: view();
|
|
170
|
+
} */
|
|
171
|
+
|
|
172
|
+
.slider {
|
|
173
|
+
position: absolute;
|
|
174
|
+
width: 200px;
|
|
175
|
+
height: 250px;
|
|
176
|
+
bottom: 35%;
|
|
177
|
+
left: calc(50% - 100px);
|
|
178
|
+
transform-style: preserve-3d;
|
|
179
|
+
transform: perspective(var(--_perspective));
|
|
180
|
+
animation: autoRun 30s linear infinite;
|
|
181
|
+
z-index: 2;
|
|
182
|
+
|
|
183
|
+
&:has(.item img:hover) {
|
|
184
|
+
animation-play-state: var(--_animation-play-state);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.item {
|
|
188
|
+
position: absolute;
|
|
189
|
+
inset: 0 0 0 0;
|
|
190
|
+
transform: rotateY(calc((var(--_position) - 1) * (360 / var(--quantity)) * 1deg)) translateZ(var(--_translateZ));
|
|
191
|
+
|
|
192
|
+
img {
|
|
193
|
+
width: 100%;
|
|
194
|
+
height: 100%;
|
|
195
|
+
object-fit: cover;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
</style>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ul class="home-link-navigation" aria-label="Home Navigation">
|
|
3
|
+
<li v-if="hasHomeLink" class="home-link">
|
|
4
|
+
<slot name="homeLink">
|
|
5
|
+
<NuxtLink to="/" class="home-link-default">Logo</NuxtLink>
|
|
6
|
+
</slot>
|
|
7
|
+
</li>
|
|
8
|
+
<li class="skip-links">
|
|
9
|
+
<ul class="skip-links-nav">
|
|
10
|
+
<li class="skip-link-item"><a href="#main-content" class="skip-link" ref="skipLink">Skip to main content</a></li>
|
|
11
|
+
<li class="skip-link-item"><a href="#footer" class="skip-link">Skip to footer</a></li>
|
|
12
|
+
</ul>
|
|
13
|
+
</li>
|
|
14
|
+
</ul>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
const slots = useSlots();
|
|
19
|
+
const hasHomeLink = ref(slots.homeLink !== undefined);
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<style lang="css">
|
|
23
|
+
.home-link-navigation {
|
|
24
|
+
position: relative;
|
|
25
|
+
list-style: none;
|
|
26
|
+
padding: 0;
|
|
27
|
+
|
|
28
|
+
.skip-links {
|
|
29
|
+
list-style: none;
|
|
30
|
+
background-color: black;
|
|
31
|
+
padding: 0;
|
|
32
|
+
margin: 0;
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: 40px;
|
|
35
|
+
left: 0;
|
|
36
|
+
height: 0;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
transition: height 0.3s ease-in-out;
|
|
39
|
+
|
|
40
|
+
&:focus-within {
|
|
41
|
+
height: auto;
|
|
42
|
+
z-index: 1000;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.skip-links-nav {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
gap: 0.2rem;
|
|
49
|
+
background-color: black;
|
|
50
|
+
|
|
51
|
+
border: 1px solid white;
|
|
52
|
+
|
|
53
|
+
list-style: none;
|
|
54
|
+
padding: 0.2rem;
|
|
55
|
+
margin: 0;
|
|
56
|
+
|
|
57
|
+
.skip-link-item {
|
|
58
|
+
padding: 0.2rem;
|
|
59
|
+
|
|
60
|
+
.skip-link {
|
|
61
|
+
display: block;
|
|
62
|
+
color: white;
|
|
63
|
+
text-decoration: none;
|
|
64
|
+
margin: 0.2rem;
|
|
65
|
+
|
|
66
|
+
padding: 0.8rem 1.2rem;
|
|
67
|
+
text-wrap: nowrap;
|
|
68
|
+
|
|
69
|
+
&:focus-visible {
|
|
70
|
+
outline: 2px solid white;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* .skip-link {
|
|
79
|
+
position: absolute;
|
|
80
|
+
top: -40px;
|
|
81
|
+
left: 0;
|
|
82
|
+
background: #000;
|
|
83
|
+
color: #fff;
|
|
84
|
+
padding: 8px 12px;
|
|
85
|
+
text-decoration: none;
|
|
86
|
+
transition: top 0.3s;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.skip-link:focus {
|
|
90
|
+
top: 0;
|
|
91
|
+
} */
|
|
92
|
+
</style>
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tabs-core" :class="`axis-${axis}`">
|
|
3
|
+
<ul role="tablist" aria-labelledby="channel-name" ref="tabsNavRef" @mouseleave="resetHoverToActivePosition()" class="tabs-list" :class="[elementClasses]">
|
|
4
|
+
<li v-for="(index, key) in itemCount" :key="key">
|
|
5
|
+
<button
|
|
6
|
+
@click.prevent="navItemClicked($event)"
|
|
7
|
+
@mouseover="navItemHovered($event)"
|
|
8
|
+
:id="`tab-${key}-trigger`"
|
|
9
|
+
:data-tab-index="key"
|
|
10
|
+
data-nav-item
|
|
11
|
+
role="tab"
|
|
12
|
+
aria-selected="false"
|
|
13
|
+
class="tabs-list-item"
|
|
14
|
+
>
|
|
15
|
+
<slot :name="`tab-${key}-trigger`"></slot>
|
|
16
|
+
</button>
|
|
17
|
+
</li>
|
|
18
|
+
</ul>
|
|
19
|
+
<div class="tab-content-wrapper">
|
|
20
|
+
<div v-for="(item, key) in itemCount" :key="key" class="tab-content" :aria-labelledby="`tab-${key}-trigger`" :id="`tab-${key}-content`" role="region" aria-hidden="true" ref="tabsContentRefs">
|
|
21
|
+
<slot :name="`tab-${key}-content`"></slot>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
const props = defineProps({
|
|
29
|
+
tag: {
|
|
30
|
+
type: String as PropType<string>,
|
|
31
|
+
default: 'button',
|
|
32
|
+
},
|
|
33
|
+
axis: {
|
|
34
|
+
type: String as PropType<'x' | 'y'>,
|
|
35
|
+
default: 'x',
|
|
36
|
+
},
|
|
37
|
+
transitionDuration: {
|
|
38
|
+
type: Number as PropType<number>,
|
|
39
|
+
default: 200,
|
|
40
|
+
},
|
|
41
|
+
itemCount: {
|
|
42
|
+
type: Number as PropType<number>,
|
|
43
|
+
default: 0,
|
|
44
|
+
},
|
|
45
|
+
trackHover: {
|
|
46
|
+
type: Boolean as PropType<boolean>,
|
|
47
|
+
default: true,
|
|
48
|
+
},
|
|
49
|
+
trackActive: {
|
|
50
|
+
type: Boolean as PropType<boolean>,
|
|
51
|
+
default: true,
|
|
52
|
+
},
|
|
53
|
+
trackIndicator: {
|
|
54
|
+
type: Boolean as PropType<boolean>,
|
|
55
|
+
default: true,
|
|
56
|
+
},
|
|
57
|
+
styleClassPassthrough: {
|
|
58
|
+
type: Array as PropType<string[]>,
|
|
59
|
+
default: () => [],
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
64
|
+
|
|
65
|
+
const tabsNavRef = ref<HTMLElement | null>(null);
|
|
66
|
+
const tabsContentRefs = ref<HTMLElement[] | null>(null);
|
|
67
|
+
|
|
68
|
+
const { initNavDecorators, navItemClicked, navItemHovered, resetHoverToActivePosition } = useTabs(props.axis, tabsNavRef, tabsContentRefs, props.transitionDuration);
|
|
69
|
+
|
|
70
|
+
onMounted(() => {
|
|
71
|
+
initNavDecorators();
|
|
72
|
+
});
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<style lang="css">
|
|
76
|
+
.tabs-core {
|
|
77
|
+
.tabs-list {
|
|
78
|
+
position: relative;
|
|
79
|
+
display: flex;
|
|
80
|
+
width: fit-content;
|
|
81
|
+
z-index: 1;
|
|
82
|
+
|
|
83
|
+
list-style-type: none;
|
|
84
|
+
margin: 0;
|
|
85
|
+
padding: 0;
|
|
86
|
+
|
|
87
|
+
.nav__hovered {
|
|
88
|
+
content: '';
|
|
89
|
+
position: absolute;
|
|
90
|
+
left: 0;
|
|
91
|
+
right: 0;
|
|
92
|
+
bottom: 0;
|
|
93
|
+
top: 0;
|
|
94
|
+
scale: var(--_width-hovered, 0.125) 1;
|
|
95
|
+
translate: var(--_x-hovered, 0) 0;
|
|
96
|
+
transform-origin: left;
|
|
97
|
+
transition: scale var(--_transition-duration), translate var(--_transition-duration);
|
|
98
|
+
z-index: 1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.nav__active {
|
|
102
|
+
content: '';
|
|
103
|
+
position: absolute;
|
|
104
|
+
left: 0;
|
|
105
|
+
right: 0;
|
|
106
|
+
bottom: 0;
|
|
107
|
+
top: 0;
|
|
108
|
+
scale: var(--_width-active, 0.125) 1;
|
|
109
|
+
translate: var(--_x-active, 0) 0;
|
|
110
|
+
transform-origin: left;
|
|
111
|
+
transition: scale var(--_transition-duration), translate var(--_transition-duration);
|
|
112
|
+
z-index: 2;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.nav__active-indicator {
|
|
116
|
+
content: '';
|
|
117
|
+
position: absolute;
|
|
118
|
+
left: 0;
|
|
119
|
+
right: 0;
|
|
120
|
+
bottom: 0;
|
|
121
|
+
scale: var(--_width-active, 0.125) 1;
|
|
122
|
+
translate: var(--_x-active, 0) 0;
|
|
123
|
+
transform-origin: left;
|
|
124
|
+
transition: scale var(--_transition-duration), translate var(--_transition-duration);
|
|
125
|
+
z-index: 3;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.tabs-list-item {
|
|
129
|
+
opacity: 0.7;
|
|
130
|
+
position: relative;
|
|
131
|
+
transition: color 100ms;
|
|
132
|
+
z-index: 4;
|
|
133
|
+
|
|
134
|
+
&:hover {
|
|
135
|
+
opacity: 1;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
&[aria-selected='true'] {
|
|
139
|
+
opacity: 1;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
border-bottom: var(--_tabs-border-bottom);
|
|
144
|
+
|
|
145
|
+
.nav__hovered {
|
|
146
|
+
background: light-dark(var(--gray-7), var(--gray-3));
|
|
147
|
+
color: light-dark(var(--gray-0), var(--gray-12));
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.nav__active {
|
|
151
|
+
background: light-dark(var(--gray-12), var(--gray-0));
|
|
152
|
+
color: light-dark(var(--gray-0), var(--gray-12));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.nav__active-indicator {
|
|
156
|
+
background: light-dark(var(--gray-12), var(--gray-0));
|
|
157
|
+
height: 0.4rem;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.tabs-list-item {
|
|
161
|
+
background: transparent;
|
|
162
|
+
border: 0;
|
|
163
|
+
color: light-dark(var(--gray-12), var(--gray-0));
|
|
164
|
+
cursor: pointer;
|
|
165
|
+
font: inherit;
|
|
166
|
+
text-transform: uppercase;
|
|
167
|
+
font-weight: 500;
|
|
168
|
+
margin: 0;
|
|
169
|
+
padding: 1em 2em;
|
|
170
|
+
|
|
171
|
+
&:hover {
|
|
172
|
+
color: light-dark(var(--gray-0), var(--gray-12));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&[aria-selected='true'] {
|
|
176
|
+
color: light-dark(var(--gray-0), var(--gray-12));
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
&.transitioning {
|
|
180
|
+
color: light-dark(var(--gray-0), var(--gray-12));
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.tab-content-wrapper {
|
|
186
|
+
display: grid;
|
|
187
|
+
grid-template-areas: 'element-stack';
|
|
188
|
+
|
|
189
|
+
background-color: light-dark(var(--gray-9), var(--gray-10));
|
|
190
|
+
border: 0.1rem solid var(--gray-6);
|
|
191
|
+
border-start-start-radius: 0;
|
|
192
|
+
border-start-end-radius: 0;
|
|
193
|
+
border-end-start-radius: 0;
|
|
194
|
+
border-end-end-radius: 0;
|
|
195
|
+
outline: 0.1rem solid var(--gray-6);
|
|
196
|
+
|
|
197
|
+
.tab-content {
|
|
198
|
+
grid-area: element-stack;
|
|
199
|
+
display: none;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/*
|
|
205
|
+
* Deal with axis-y
|
|
206
|
+
**/
|
|
207
|
+
|
|
208
|
+
.tabs-core {
|
|
209
|
+
&.axis-y {
|
|
210
|
+
display: flex;
|
|
211
|
+
flex-direction: row;
|
|
212
|
+
gap: 2em;
|
|
213
|
+
|
|
214
|
+
.tabs-list {
|
|
215
|
+
flex-direction: column;
|
|
216
|
+
|
|
217
|
+
border-bottom: initial;
|
|
218
|
+
border-left: var(--_tabs-border-bottom);
|
|
219
|
+
position: relative;
|
|
220
|
+
|
|
221
|
+
.tabs-list-item {
|
|
222
|
+
text-align: left;
|
|
223
|
+
width: 100%;
|
|
224
|
+
|
|
225
|
+
&:hover {
|
|
226
|
+
/* color: light-dark(var(--gray-0), var(--gray-12)); */
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
&[aria-selected='true'] {
|
|
230
|
+
/* color: var(--_tabs-active-text); */
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&.transitioning {
|
|
234
|
+
/* color: light-dark(var(--gray-0), var(--gray-12)); */
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.nav__hovered {
|
|
239
|
+
left: 0;
|
|
240
|
+
right: initial;
|
|
241
|
+
bottom: initial;
|
|
242
|
+
top: 0;
|
|
243
|
+
height: var(--_y-height);
|
|
244
|
+
translate: 0 var(--_y-hovered, 0);
|
|
245
|
+
transform-origin: top;
|
|
246
|
+
width: var(--_y-width);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.nav__active {
|
|
250
|
+
left: 0;
|
|
251
|
+
right: initial;
|
|
252
|
+
bottom: initial;
|
|
253
|
+
top: 0;
|
|
254
|
+
height: var(--_y-height);
|
|
255
|
+
translate: 0 var(--_y-active, 0);
|
|
256
|
+
transform-origin: top;
|
|
257
|
+
width: var(--_y-width);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.nav__active-indicator {
|
|
261
|
+
left: 0;
|
|
262
|
+
right: initial;
|
|
263
|
+
bottom: initial;
|
|
264
|
+
top: 0;
|
|
265
|
+
height: var(--_y-height);
|
|
266
|
+
scale: var(--_width-active, 0.125) 1;
|
|
267
|
+
translate: 0 var(--_y-active, 0);
|
|
268
|
+
transform-origin: top;
|
|
269
|
+
width: 0.4em;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
.tab-content-wrapper {
|
|
273
|
+
flex-grow: 1;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export const useDialogControls = () => {
|
|
2
|
+
interface DialogConfig {
|
|
3
|
+
[key: string]: boolean;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
interface DialogCallbacks {
|
|
7
|
+
[key: string]: {
|
|
8
|
+
onConfirm?: () => void;
|
|
9
|
+
onCancel?: () => void;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const dialogsConfig = reactive<DialogConfig>({});
|
|
14
|
+
const dialogCallbacks = reactive<DialogCallbacks>({});
|
|
15
|
+
|
|
16
|
+
function initialiseDialogs(dialogIds: string[]) {
|
|
17
|
+
dialogIds.forEach((id) => {
|
|
18
|
+
dialogsConfig[id] = false;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function registerDialogCallbacks(dialogId: string, callbacks: { onConfirm?: () => void; onCancel?: () => void }) {
|
|
23
|
+
dialogCallbacks[dialogId] = callbacks;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const controlDialogs = (name: string, state: boolean, action?: 'confirm' | 'cancel') => {
|
|
27
|
+
if (!state && action && dialogCallbacks[name]) {
|
|
28
|
+
// Execute callback before closing dialog
|
|
29
|
+
if (action === 'confirm' && dialogCallbacks[name].onConfirm) {
|
|
30
|
+
dialogCallbacks[name].onConfirm!();
|
|
31
|
+
} else if (action === 'cancel' && dialogCallbacks[name].onCancel) {
|
|
32
|
+
dialogCallbacks[name].onCancel!();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
dialogsConfig[name] = state;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
dialogsConfig,
|
|
40
|
+
controlDialogs,
|
|
41
|
+
initialiseDialogs,
|
|
42
|
+
registerDialogCallbacks,
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const useStyleClassPassthrough = (styleClassPassthrough: string[]) => {
|
|
2
|
+
const styleClassPassthroughRef = ref(styleClassPassthrough);
|
|
3
|
+
|
|
4
|
+
const elementClasses = computed(() => {
|
|
5
|
+
return styleClassPassthroughRef.value.join(' ');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const updateElementClasses = (cssClass: string | string[]) => {
|
|
9
|
+
let cssClasses = [] as string[];
|
|
10
|
+
if (typeof cssClass === 'string') {
|
|
11
|
+
cssClasses = [cssClass];
|
|
12
|
+
} else if (Array.isArray(cssClass)) {
|
|
13
|
+
cssClasses = cssClass;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
cssClasses.forEach((cssClass) => {
|
|
17
|
+
if (styleClassPassthroughRef.value.includes(cssClass)) {
|
|
18
|
+
styleClassPassthroughRef.value = styleClassPassthroughRef.value.filter((className) => className !== cssClass);
|
|
19
|
+
} else {
|
|
20
|
+
styleClassPassthroughRef.value.push(cssClass);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const resetElementClasses = (propsClasses: string[]) => {
|
|
26
|
+
styleClassPassthroughRef.value = propsClasses;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
elementClasses,
|
|
31
|
+
updateElementClasses,
|
|
32
|
+
resetElementClasses,
|
|
33
|
+
styleClassPassthroughRef,
|
|
34
|
+
};
|
|
35
|
+
};
|