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,201 @@
|
|
|
1
|
+
import { useResizeObserver } from '@vueuse/core';
|
|
2
|
+
|
|
3
|
+
const useTabs = (axis: string, tabsNavRef: Ref<HTMLElement | null>, tabsContentRefs: Ref<HTMLElement[] | null>, duration: number) => {
|
|
4
|
+
const navItems = ref<HTMLElement[] | null>(null);
|
|
5
|
+
const previousActiveTab = useState<HTMLElement | null>('previousActiveTab', () => null);
|
|
6
|
+
const currentActiveTab = ref<HTMLElement>();
|
|
7
|
+
|
|
8
|
+
const previousHoveredTab = ref<HTMLElement>();
|
|
9
|
+
const currentHoveredTab = ref<HTMLElement>();
|
|
10
|
+
const tagName = ref<string>();
|
|
11
|
+
|
|
12
|
+
const initNavDecorators = () => {
|
|
13
|
+
navItems.value = tabsNavRef.value ? (Array.from(tabsNavRef.value.querySelectorAll('[data-nav-item')) as HTMLElement[]) : [];
|
|
14
|
+
tagName.value = navItems.value[0].tagName.toLowerCase();
|
|
15
|
+
|
|
16
|
+
const activeIndex = ref(0);
|
|
17
|
+
|
|
18
|
+
// Temporarily set the first nav item as active
|
|
19
|
+
navItems.value[0].setAttribute('aria-selected', 'true');
|
|
20
|
+
|
|
21
|
+
// Test if navItems are hyperlinks
|
|
22
|
+
if (navItems.value[0].tagName.toLowerCase() === 'a') {
|
|
23
|
+
// Find index of element with class "router-link-active"
|
|
24
|
+
activeIndex.value = navItems.value.findIndex((el) => el.classList.contains('router-link-active'));
|
|
25
|
+
}
|
|
26
|
+
// else {
|
|
27
|
+
// Set actve tab
|
|
28
|
+
// }
|
|
29
|
+
|
|
30
|
+
currentActiveTab.value = navItems.value[activeIndex.value];
|
|
31
|
+
currentHoveredTab.value = navItems.value[activeIndex.value];
|
|
32
|
+
|
|
33
|
+
previousActiveTab.value = navItems.value[activeIndex.value];
|
|
34
|
+
previousHoveredTab.value = navItems.value[activeIndex.value];
|
|
35
|
+
|
|
36
|
+
addNavDecorators();
|
|
37
|
+
setActiveTabContent();
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const addNavDecorators = () => {
|
|
41
|
+
const elementClasses = ['nav__active-indicator', 'nav__active', 'nav__hovered'];
|
|
42
|
+
if (tabsNavRef.value) {
|
|
43
|
+
for (let i = 0; i < 3; i++) {
|
|
44
|
+
const div = document.createElement('div');
|
|
45
|
+
div.classList.add(elementClasses[i]);
|
|
46
|
+
tabsNavRef.value.appendChild(div);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const navItemHovered = (event: Event) => {
|
|
52
|
+
const target = event.target as HTMLElement;
|
|
53
|
+
const newTabPosition = currentHoveredTab.value ? currentHoveredTab.value.compareDocumentPosition(target) : 0;
|
|
54
|
+
|
|
55
|
+
if (newTabPosition !== 0) {
|
|
56
|
+
previousHoveredTab.value = currentHoveredTab.value;
|
|
57
|
+
currentHoveredTab.value = target;
|
|
58
|
+
moveHoveredIndicator();
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const resetHoverToActivePosition = () => {
|
|
63
|
+
previousHoveredTab.value = currentHoveredTab.value;
|
|
64
|
+
currentHoveredTab.value = currentActiveTab.value;
|
|
65
|
+
moveHoveredIndicator();
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const navItemClicked = (event: Event) => {
|
|
69
|
+
const target = event.target as HTMLElement;
|
|
70
|
+
|
|
71
|
+
previousActiveTab.value = currentActiveTab.value || null;
|
|
72
|
+
currentActiveTab.value = target;
|
|
73
|
+
|
|
74
|
+
navItems.value?.forEach((tab) => {
|
|
75
|
+
tab.setAttribute('aria-selected', currentActiveTab.value === tab ? 'true' : 'false');
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
moveActiveIndicator();
|
|
79
|
+
setActiveTabContent();
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const handleTransitioningClass = (transitionDuration: number = 200) => {
|
|
83
|
+
if (previousHoveredTab.value && currentHoveredTab.value) {
|
|
84
|
+
const newTabPosition = previousHoveredTab.value.compareDocumentPosition(currentHoveredTab.value);
|
|
85
|
+
const navItemsArray = navItems.value || [];
|
|
86
|
+
|
|
87
|
+
const timeout = Math.floor(transitionDuration / Math.abs(navItemsArray.indexOf(currentHoveredTab.value) - navItemsArray.indexOf(previousHoveredTab.value)));
|
|
88
|
+
|
|
89
|
+
if (newTabPosition === 4) {
|
|
90
|
+
for (let i = navItemsArray.indexOf(previousHoveredTab.value); i < navItemsArray.indexOf(currentHoveredTab.value); i++) {
|
|
91
|
+
navItemsArray[i].classList.add('transitioning');
|
|
92
|
+
if (i >= navItemsArray.indexOf(previousHoveredTab.value) && i < navItemsArray.indexOf(currentHoveredTab.value)) {
|
|
93
|
+
setTimeout(() => {
|
|
94
|
+
navItemsArray[i].classList.remove('transitioning');
|
|
95
|
+
// }, timeout * (i - navItemsArray.indexOf(previousHoveredTab.value) - 1));
|
|
96
|
+
}, duration * 1.5);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
} else {
|
|
100
|
+
for (let i = navItemsArray.indexOf(previousHoveredTab.value); i > navItemsArray.indexOf(currentHoveredTab.value); i--) {
|
|
101
|
+
navItemsArray[i].classList.add('transitioning');
|
|
102
|
+
if (i <= navItemsArray.indexOf(previousHoveredTab.value) && i > navItemsArray.indexOf(currentHoveredTab.value)) {
|
|
103
|
+
setTimeout(() => {
|
|
104
|
+
navItemsArray[i].classList.remove('transitioning');
|
|
105
|
+
// }, timeout * (i - navItemsArray.indexOf(previousHoveredTab.value) - 1));
|
|
106
|
+
}, duration * 1.5);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const setFinalHoveredPositions = (resized: boolean = false) => {
|
|
114
|
+
const setDuration = resized ? 0 : duration;
|
|
115
|
+
// const tabsNavRefYPosition = tabsNavRef.value?.getBoundingClientRect().top || 0;
|
|
116
|
+
const newTabWidth = currentHoveredTab.value && tabsNavRef.value ? currentHoveredTab.value.offsetWidth / tabsNavRef.value.offsetWidth : 0;
|
|
117
|
+
tabsNavRef.value?.style.setProperty('--_transition-duration', setDuration + 'ms');
|
|
118
|
+
tabsNavRef.value?.style.setProperty('--_x-hovered', currentHoveredTab.value?.offsetLeft + 'px');
|
|
119
|
+
|
|
120
|
+
tabsNavRef.value?.style.setProperty('--_width-hovered', newTabWidth?.toString());
|
|
121
|
+
tabsNavRef.value?.style.setProperty('--_y-hovered', currentHoveredTab.value?.offsetTop + 'px');
|
|
122
|
+
tabsNavRef.value?.style.setProperty('--_y-height', currentHoveredTab.value?.offsetHeight + 'px');
|
|
123
|
+
tabsNavRef.value?.style.setProperty('--_y-width', currentHoveredTab.value?.offsetWidth + 'px');
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const setFinalActivePositions = (resized: boolean = false) => {
|
|
127
|
+
const setDuration = resized ? 0 : duration;
|
|
128
|
+
const newTabWidth = currentActiveTab.value && tabsNavRef.value ? currentActiveTab.value.offsetWidth / tabsNavRef.value.offsetWidth : 0;
|
|
129
|
+
tabsNavRef.value?.style.setProperty('--_transition-duration', setDuration + 'ms');
|
|
130
|
+
tabsNavRef.value?.style.setProperty('--_x-active', currentActiveTab.value?.offsetLeft + 'px');
|
|
131
|
+
tabsNavRef.value?.style.setProperty('--_width-active', newTabWidth?.toString());
|
|
132
|
+
tabsNavRef.value?.style.setProperty('--_y-active', currentActiveTab.value?.offsetTop + 'px');
|
|
133
|
+
tabsNavRef.value?.style.setProperty('--_y-height', currentActiveTab.value?.offsetHeight + 'px');
|
|
134
|
+
tabsNavRef.value?.style.setProperty('--_y-width', currentActiveTab.value?.offsetWidth + 'px');
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const moveActiveIndicator = () => {
|
|
138
|
+
tabsNavRef.value?.style.setProperty('--_transition-duration', duration + 'ms');
|
|
139
|
+
|
|
140
|
+
const newTabPosition = previousActiveTab.value && currentActiveTab.value ? previousActiveTab.value.compareDocumentPosition(currentActiveTab.value) : 0;
|
|
141
|
+
let transitionWidth;
|
|
142
|
+
|
|
143
|
+
if (newTabPosition === 4) {
|
|
144
|
+
transitionWidth = currentActiveTab.value && previousActiveTab.value ? currentActiveTab.value.offsetLeft + currentActiveTab.value.offsetWidth - previousActiveTab.value.offsetLeft : 0;
|
|
145
|
+
} else {
|
|
146
|
+
transitionWidth = previousActiveTab.value && currentActiveTab.value ? previousActiveTab.value.offsetLeft + previousActiveTab.value.offsetWidth - currentActiveTab.value.offsetLeft : 0;
|
|
147
|
+
tabsNavRef.value?.style.setProperty('--_x-active', currentActiveTab.value ? currentActiveTab.value.offsetLeft + 'px' : '0');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
tabsNavRef.value?.style.setProperty('--_width-active', String(transitionWidth / tabsNavRef.value.offsetWidth));
|
|
151
|
+
|
|
152
|
+
handleTransitioningClass(duration);
|
|
153
|
+
|
|
154
|
+
setTimeout(() => {
|
|
155
|
+
setFinalActivePositions();
|
|
156
|
+
}, Math.floor(duration + 20));
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const moveHoveredIndicator = () => {
|
|
160
|
+
tabsNavRef.value?.style.setProperty('--_transition-duration', duration + 'ms');
|
|
161
|
+
|
|
162
|
+
const newTabPosition = previousHoveredTab.value && currentHoveredTab.value ? previousHoveredTab.value.compareDocumentPosition(currentHoveredTab.value) : 0;
|
|
163
|
+
let transitionWidth;
|
|
164
|
+
|
|
165
|
+
if (newTabPosition === 4) {
|
|
166
|
+
transitionWidth = currentHoveredTab.value && previousHoveredTab.value ? currentHoveredTab.value.offsetLeft + currentHoveredTab.value.offsetWidth - previousHoveredTab.value.offsetLeft : 0;
|
|
167
|
+
} else {
|
|
168
|
+
transitionWidth = previousHoveredTab.value && currentHoveredTab.value ? previousHoveredTab.value.offsetLeft + previousHoveredTab.value.offsetWidth - currentHoveredTab.value.offsetLeft : 0;
|
|
169
|
+
tabsNavRef.value?.style.setProperty('--_x-hovered', currentHoveredTab.value ? currentHoveredTab.value.offsetLeft + 'px' : '0');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
tabsNavRef.value?.style.setProperty('--_width-hovered', String(transitionWidth / tabsNavRef.value.offsetWidth));
|
|
173
|
+
|
|
174
|
+
handleTransitioningClass(duration);
|
|
175
|
+
|
|
176
|
+
setTimeout(() => {
|
|
177
|
+
setFinalHoveredPositions();
|
|
178
|
+
}, Math.floor(duration + 20));
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const setActiveTabContent = () => {
|
|
182
|
+
const activeIndex = navItems.value?.findIndex((el) => el === currentActiveTab.value);
|
|
183
|
+
tabsContentRefs.value?.forEach((tabContent: HTMLElement, index: number) => {
|
|
184
|
+
tabContent.style.display = activeIndex === index ? 'block' : 'none';
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
useResizeObserver(tabsNavRef, () => {
|
|
189
|
+
setFinalActivePositions(true);
|
|
190
|
+
setFinalHoveredPositions(true);
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
return {
|
|
194
|
+
initNavDecorators,
|
|
195
|
+
navItemClicked,
|
|
196
|
+
navItemHovered,
|
|
197
|
+
resetHoverToActivePosition,
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export default useTabs;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface ResponsiveHeaderNavItem {
|
|
2
|
+
name: string;
|
|
3
|
+
path?: string;
|
|
4
|
+
iconName?: string;
|
|
5
|
+
imageSrc?: string;
|
|
6
|
+
imageAlt?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
isActive?: boolean;
|
|
9
|
+
isExternal?: boolean;
|
|
10
|
+
childLinksTitle?: string;
|
|
11
|
+
childLinks?: ResponsiveHeaderNavItem[];
|
|
12
|
+
config?: ResponsiveHeaderItemRects;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ResponsiveHeaderProp {
|
|
16
|
+
[key: string]: ResponsiveHeaderNavItem[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface IFlooredRect {
|
|
20
|
+
left: number;
|
|
21
|
+
right: number;
|
|
22
|
+
top: number;
|
|
23
|
+
bottom: number;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ResponsiveHeaderItemRects {
|
|
29
|
+
left: number;
|
|
30
|
+
right: number;
|
|
31
|
+
width?: number;
|
|
32
|
+
visible: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ResponsiveHeaderState {
|
|
36
|
+
navListVisibility: Record<string, boolean>;
|
|
37
|
+
clonedNavLinks?: ResponsiveHeaderProp;
|
|
38
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface CarouselBasicItem {
|
|
2
|
+
id: number | string;
|
|
3
|
+
url: string;
|
|
4
|
+
alt: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface CarouselModifiedItem {
|
|
8
|
+
id: number | string;
|
|
9
|
+
url: string;
|
|
10
|
+
alt: string;
|
|
11
|
+
order: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ICarouselBasic {
|
|
15
|
+
items: CarouselBasicItem[] | CarouselModifiedItem[];
|
|
16
|
+
total: number;
|
|
17
|
+
skip: number;
|
|
18
|
+
limit: number;
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "srcdev-nuxt-components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.0.
|
|
4
|
+
"version": "6.0.1",
|
|
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",
|
|
@@ -18,11 +18,8 @@
|
|
|
18
18
|
"test": "vitest"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"composables/",
|
|
24
|
-
"plugins/",
|
|
25
|
-
"types/"
|
|
21
|
+
"app/",
|
|
22
|
+
"nuxt.config.ts"
|
|
26
23
|
],
|
|
27
24
|
"devDependencies": {
|
|
28
25
|
"@iconify-json/akar-icons": "1.2.7",
|