srcdev-nuxt-components 6.0.0 → 6.1.0

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.
Files changed (82) hide show
  1. package/README.md +2 -2
  2. package/app/assets/styles/extends-layer/srcdev-components/components/_display-prompt-core.css +72 -0
  3. package/app/assets/styles/extends-layer/srcdev-components/components/index.css +1 -0
  4. package/app/assets/styles/extends-layer/srcdev-components/index.css +2 -0
  5. package/app/assets/styles/extends-layer/srcdev-components/setup/index.css +1 -0
  6. package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_error.css +15 -0
  7. package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_info.css +15 -0
  8. package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_secondary.css +15 -0
  9. package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_success.css +15 -0
  10. package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_warning.css +15 -0
  11. package/app/assets/styles/extends-layer/srcdev-components/setup/themes/index.css +5 -0
  12. package/app/assets/styles/main.css +2 -0
  13. package/app/assets/styles/setup/_head.css +36 -0
  14. package/app/assets/styles/setup/a11y/_utils.css +20 -0
  15. package/app/assets/styles/setup/a11y/_variables.css +8 -0
  16. package/app/assets/styles/setup/a11y/index.css +2 -0
  17. package/app/assets/styles/setup/index.css +5 -0
  18. package/app/assets/styles/setup/typography/index.css +2 -0
  19. package/app/assets/styles/setup/typography/utility-classes/_generic-font-classes.css +217 -0
  20. package/app/assets/styles/setup/typography/utility-classes/_generic-font-variation-settings.css +29 -0
  21. package/app/assets/styles/setup/typography/utility-classes/_generic-font-weights.css +39 -0
  22. package/app/assets/styles/setup/typography/utility-classes/index.css +3 -0
  23. package/app/assets/styles/setup/typography/vars/_colors.css +14 -0
  24. package/app/assets/styles/setup/typography/vars/_reponsive-font-sizes.css +12 -0
  25. package/app/assets/styles/setup/typography/vars/index.css +2 -0
  26. package/app/assets/styles/setup/utility-classes/_fluid-spacing.css +13 -0
  27. package/app/assets/styles/setup/utility-classes/animations/_auto-rotate.css +13 -0
  28. package/app/assets/styles/setup/utility-classes/animations/_entry-exit-blur.css +16 -0
  29. package/app/assets/styles/setup/utility-classes/animations/_entry-slide-in.css +15 -0
  30. package/app/assets/styles/setup/utility-classes/animations/_entry-zoom-reveal.css +15 -0
  31. package/app/assets/styles/setup/utility-classes/animations/index.css +4 -0
  32. package/app/assets/styles/setup/utility-classes/index.css +2 -0
  33. package/app/assets/styles/setup/variables/colors/_blue.css +15 -0
  34. package/app/assets/styles/setup/variables/colors/_gray.css +16 -0
  35. package/app/assets/styles/setup/variables/colors/_green.css +15 -0
  36. package/app/assets/styles/setup/variables/colors/_orange.css +15 -0
  37. package/app/assets/styles/setup/variables/colors/_red.css +15 -0
  38. package/app/assets/styles/setup/variables/colors/_yellow.css +15 -0
  39. package/app/assets/styles/setup/variables/colors/index.css +6 -0
  40. package/app/assets/styles/setup/variables/index.css +1 -0
  41. package/app/components/accordian/AccordianCore.vue +53 -0
  42. package/app/components/animated-svg-text/AnimatedSvgText.vue +87 -0
  43. package/app/components/canvas-switcher/CanvasSwitcher.vue +77 -0
  44. package/app/components/carousel-basic/CarouselBasic.vue +291 -0
  45. package/app/components/carousel-basic/CarouselFlip.vue +461 -0
  46. package/app/components/carousel-basic/CarouselInfinite.vue +325 -0
  47. package/app/components/clip-element/ClipElement.vue +73 -0
  48. package/app/components/clipped-panels/ClippedPanel.vue +73 -0
  49. package/app/components/container-glow/ContainerGlowCore.vue +211 -0
  50. package/app/components/content-grid/ContentGrid.vue +85 -0
  51. package/app/components/deep-expanding-menu/DeepExpandingMenu.vue +214 -0
  52. package/app/components/deep-expanding-menu/DeepExpandingMenuOld.vue +218 -0
  53. package/app/components/display-banner/DisplayBanner.vue +63 -0
  54. package/app/components/display-details/DisplayDetailsCore.vue +301 -0
  55. package/app/components/display-dialog/DisplayDialogCore.vue +255 -0
  56. package/app/components/display-dialog/variants/DisplayDialogConfirm.vue +45 -0
  57. package/app/components/display-dialog/variants/DisplayDialogScrollableContent.vue +49 -0
  58. package/app/components/display-grid/DisplayGridCore.vue +22 -0
  59. package/app/components/display-prompt/DisplayPromptCore.vue +187 -0
  60. package/app/components/display-prompt/variants/DisplayPromptError.vue +53 -0
  61. package/app/components/expanding-panel/ExpandingPanel.vue +124 -0
  62. package/app/components/image-galleries/SliderGallery.vue +784 -0
  63. package/app/components/layout-grids/LayoutGridA.vue +103 -0
  64. package/app/components/layout-grids/LayoutGridB.vue +132 -0
  65. package/app/components/layout-row/LayoutRow.vue +165 -0
  66. package/app/components/masonry-grid/MasonryGrid.vue +62 -0
  67. package/app/components/masonry-grid-ordered/MasonryGridOrdered.vue +158 -0
  68. package/app/components/masonry-grid-sorted/MasonryGridSorted.vue +115 -0
  69. package/app/components/pop-over/PopOver.vue +88 -0
  70. package/app/components/responsive-header/NavigationItems.vue +169 -0
  71. package/app/components/responsive-header/ResponsiveHeader.vue +686 -0
  72. package/app/components/rotating-carousel/RotatingCarouselImage.vue +200 -0
  73. package/app/components/skip-links/SkipLinks.vue +92 -0
  74. package/app/components/tabs/TabsCore.vue +277 -0
  75. package/app/composables/useDialogControls.ts +44 -0
  76. package/app/composables/useStyleClassPassthrough.ts +35 -0
  77. package/app/composables/useTabs.ts +201 -0
  78. package/app/types/gallery-data.ts +13 -0
  79. package/app/types/responsiveHeader.ts +38 -0
  80. package/app/types/types.carousel-basic.ts +19 -0
  81. package/nuxt.config.ts +14 -14
  82. package/package.json +4 -7
@@ -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,13 @@
1
+ export interface IGalleryData {
2
+ src: string;
3
+ alt: string;
4
+ stylist?: string;
5
+ title?: string;
6
+ category?: string;
7
+ description?: string;
8
+ thumbnail?: {
9
+ title: string;
10
+ description: string;
11
+ };
12
+ textBrightness: 'light' | 'dark';
13
+ }
@@ -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/nuxt.config.ts CHANGED
@@ -1,40 +1,40 @@
1
1
  // https://nuxt.com/docs/api/configuration/nuxt-config
2
2
  export default defineNuxtConfig({
3
3
  devtools: { enabled: true },
4
- css: ['modern-normalize', './app/assets/styles/main.css'],
5
- modules: ['@nuxt/icon', '@nuxt/image'],
4
+ css: ["modern-normalize", "./app/assets/styles/main.css"],
5
+ modules: ["@nuxt/eslint", "@nuxt/icon", "@nuxt/image"],
6
6
  app: {
7
7
  head: {
8
8
  htmlAttrs: {
9
- lang: 'en',
10
- 'data-color-scheme': 'auto',
9
+ lang: "en",
10
+ "data-color-scheme": "auto",
11
11
  },
12
- titleTemplate: '%s - Nuxt Components Layer',
13
- meta: [{ charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }],
12
+ titleTemplate: "%s - Nuxt Components Layer",
13
+ meta: [{ charset: "utf-8" }, { name: "viewport", content: "width=device-width, initial-scale=1" }],
14
14
  bodyAttrs: {
15
- class: 'srcdev-components-extended',
15
+ class: "srcdev-components-extended",
16
16
  },
17
17
  },
18
18
  pageTransition: {
19
- name: 'page',
20
- mode: 'out-in',
19
+ name: "page",
20
+ mode: "out-in",
21
21
  },
22
22
  layoutTransition: {
23
- name: 'layout',
24
- mode: 'out-in',
23
+ name: "layout",
24
+ mode: "out-in",
25
25
  },
26
26
  },
27
27
  components: [
28
28
  {
29
- path: './components',
29
+ path: "./components",
30
30
  pathPrefix: false,
31
31
  },
32
32
  ],
33
33
  vue: {
34
34
  runtimeCompiler: true,
35
35
  },
36
- compatibilityDate: '2024-11-01',
36
+ compatibilityDate: "2024-11-01",
37
37
  typescript: {
38
38
  includeWorkspace: true,
39
39
  },
40
- });
40
+ })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-components",
3
3
  "type": "module",
4
- "version": "6.0.0",
4
+ "version": "6.1.0",
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,16 +18,13 @@
18
18
  "test": "vitest"
19
19
  },
20
20
  "files": [
21
- "assets/",
22
- "components/",
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",
29
26
  "@iconify-json/bitcoin-icons": "1.2.4",
30
- "@nuxt/eslint-config": "1.8.0",
27
+ "@nuxt/eslint": "1.8.0",
31
28
  "@nuxt/icon": "2.0.0",
32
29
  "@nuxt/image": "1.11.0",
33
30
  "@vueuse/core": "13.6.0",