srcdev-nuxt-components 6.1.8 → 6.1.10

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.
@@ -4,40 +4,49 @@
4
4
  </component>
5
5
  </template>
6
6
 
7
- <script lang="ts">
8
- const TAGS_ALLOWED = <string[]>['div', 'p', 'span', 'section', 'article', 'aside', 'header', 'footer', 'main', 'nav', 'ul', 'ol'];
9
- </script>
10
-
11
7
  <script setup lang="ts">
12
8
  const props = defineProps({
13
9
  tag: {
14
10
  type: String,
15
- default: 'div',
11
+ default: "div",
16
12
  validator(value: string) {
17
- return TAGS_ALLOWED.includes(value);
13
+ return [
14
+ "div",
15
+ "p",
16
+ "span",
17
+ "section",
18
+ "article",
19
+ "aside",
20
+ "header",
21
+ "footer",
22
+ "main",
23
+ "nav",
24
+ "ul",
25
+ "ol",
26
+ ].includes(value)
18
27
  },
19
28
  },
20
29
  variant: {
21
30
  type: String,
22
- default: 'square',
31
+ default: "square",
23
32
  validator(value: string) {
24
- return ['circle-cutout', 'rectangle', 'square'].includes(value);
33
+ return ["circle-cutout", "rectangle", "square"].includes(value)
25
34
  },
26
35
  },
27
36
  styleClassPassthrough: {
28
37
  type: Array as PropType<string[]>,
29
38
  default: () => [],
30
39
  },
31
- });
40
+ })
32
41
 
33
- const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
42
+ const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
34
43
 
35
44
  watch(
36
45
  () => props.styleClassPassthrough,
37
46
  () => {
38
- resetElementClasses(props.styleClassPassthrough);
47
+ resetElementClasses(props.styleClassPassthrough)
39
48
  }
40
- );
49
+ )
41
50
  </script>
42
51
 
43
52
  <style lang="css">
@@ -54,20 +63,23 @@ watch(
54
63
  aspect-ratio: 1;
55
64
 
56
65
  &.rectangle {
57
-
58
66
  --_max-x-position: 300px;
59
67
  --_curve-radius: 10px;
60
68
 
61
- clip-path: path('M 10, 50 L 140, 50 A 10, 10, 0, 0, 0 150, 40 L 150, 10 A 10, 10, 0, 0, 1 160, 0 L 290, 0 A 10, 10, 0, 0, 1 300, 10 L 300, 190 A 10, 10, 0, 0, 1 290, 200 L 10, 200 A 10, 10, 0, 0, 1 0, 190 L 0, 60 A 10, 10, 0, 0, 1 10, 50 Z');
69
+ clip-path: path(
70
+ "M 10, 50 L 140, 50 A 10, 10, 0, 0, 0 150, 40 L 150, 10 A 10, 10, 0, 0, 1 160, 0 L 290, 0 A 10, 10, 0, 0, 1 300, 10 L 300, 190 A 10, 10, 0, 0, 1 290, 200 L 10, 200 A 10, 10, 0, 0, 1 0, 190 L 0, 60 A 10, 10, 0, 0, 1 10, 50 Z"
71
+ );
62
72
  width: 300px;
63
73
  }
64
74
  &.square {
65
75
  /* clip-path: path('M 10, 50 L 90, 50 A 10, 10, 0, 0, 0 100, 40 L 100, 10 L 110, 0 L 190, 0 L 200, 10 L 200, 190 L 190, 200 L 10, 200 L 0, 190 L 0, 60 L 10, 50 Z'); */
66
- clip-path: path('M 10, 50 L 90, 50 A 10, 10, 0, 0, 0 100, 40 L 100, 10 A 10, 10, 0, 0, 1 110, 0 L 190, 0 A 10, 10, 0, 0, 1 200, 10 L 200, 190 A 10, 10, 0, 0, 1 190, 200 L 10, 200 A 10, 10, 0, 0, 1 0, 190 L 0, 60 A 10, 10, 0, 0, 1 10, 50 Z');
76
+ clip-path: path(
77
+ "M 10, 50 L 90, 50 A 10, 10, 0, 0, 0 100, 40 L 100, 10 A 10, 10, 0, 0, 1 110, 0 L 190, 0 A 10, 10, 0, 0, 1 200, 10 L 200, 190 A 10, 10, 0, 0, 1 190, 200 L 10, 200 A 10, 10, 0, 0, 1 0, 190 L 0, 60 A 10, 10, 0, 0, 1 10, 50 Z"
78
+ );
67
79
  width: 200px;
68
80
  }
69
81
  &.circle-cutout {
70
- clip-path: path('M Z');
82
+ clip-path: path("M Z");
71
83
  }
72
84
  }
73
85
  </style>
@@ -25,8 +25,6 @@
25
25
  </template>
26
26
 
27
27
  <script lang="ts">
28
- const TAGS_ALLOWED = <string[]>["div", "section", "nav", "ul", "ol"]
29
-
30
28
  interface ResponsiveHeaderNavItem {
31
29
  name: string
32
30
  path?: string
@@ -42,7 +40,7 @@ const props = defineProps({
42
40
  type: String,
43
41
  default: "nav",
44
42
  validator(value: string) {
45
- return TAGS_ALLOWED.includes(value)
43
+ return ["div", "section", "nav", "ul", "ol"].includes(value)
46
44
  },
47
45
  },
48
46
  navLinks: {
@@ -30,7 +30,7 @@ const props = defineProps({
30
30
  type: String,
31
31
  default: "nav",
32
32
  validator(value: string) {
33
- return TAGS_ALLOWED.includes(value)
33
+ return ["div", "section", "nav", "ul", "ol"].includes(value)
34
34
  },
35
35
  },
36
36
  navLinks: {
@@ -64,8 +64,6 @@ onMounted(() => {
64
64
  </script>
65
65
 
66
66
  <script lang="ts">
67
- const TAGS_ALLOWED = <string[]>["div", "section", "nav", "ul", "ol"]
68
-
69
67
  interface ResponsiveHeaderNavItem {
70
68
  name: string
71
69
  path?: string
@@ -9,40 +9,48 @@
9
9
  </component>
10
10
  </template>
11
11
 
12
- <script lang="ts">
13
- const TAGS_ALLOWED = <string[]>['div', 'p', 'span', 'section', 'article', 'aside', 'header', 'footer', 'main', 'nav', 'ul', 'ol'];
14
- </script>
15
-
16
12
  <script setup lang="ts">
17
-
18
13
  const props = defineProps({
19
14
  tag: {
20
15
  type: String,
21
- default: 'div',
16
+ default: "div",
22
17
  validator(value: string) {
23
- return TAGS_ALLOWED.includes(value);
18
+ return [
19
+ "div",
20
+ "p",
21
+ "span",
22
+ "section",
23
+ "article",
24
+ "aside",
25
+ "header",
26
+ "footer",
27
+ "main",
28
+ "nav",
29
+ "ul",
30
+ "ol",
31
+ ].includes(value)
24
32
  },
25
33
  },
26
34
  styleClassPassthrough: {
27
35
  type: Array as PropType<string[]>,
28
36
  default: () => [],
29
37
  },
30
- });
38
+ })
31
39
 
32
- const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
40
+ const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
33
41
 
34
42
  watch(
35
43
  () => props.styleClassPassthrough,
36
44
  () => {
37
- resetElementClasses(props.styleClassPassthrough);
45
+ resetElementClasses(props.styleClassPassthrough)
38
46
  }
39
- );
47
+ )
40
48
  </script>
41
49
 
42
50
  <style lang="css">
43
51
  .display-banner {
44
52
  display: grid;
45
- grid-template-areas: 'banner';
53
+ grid-template-areas: "banner";
46
54
  container-type: inline-size;
47
55
  overflow: hidden;
48
56
 
@@ -1,5 +1,12 @@
1
1
  <template>
2
- <component :is="tag" class="layout-row" :class="elementClasses" :id :tab-index="isLandmark ? 0 : null" :aria-label="isLandmark ? 'Layout Row Landmark' : undefined">
2
+ <component
3
+ :is="tag"
4
+ class="layout-row"
5
+ :class="elementClasses"
6
+ :id
7
+ :tab-index="isLandmark ? 0 : null"
8
+ :aria-label="isLandmark ? 'Layout Row Landmark' : undefined"
9
+ >
3
10
  <div :data-testid="dataTestid" class="layout-row-inner" :class="variant">
4
11
  <div>
5
12
  <slot name="default"></slot>
@@ -8,47 +15,41 @@
8
15
  </component>
9
16
  </template>
10
17
 
11
- <script lang="ts">
12
- const TAGS_ALLOWED = <string[]>['div', 'section', 'article', 'aside', 'header', 'footer', 'main', 'nav', 'ul', 'ol'];
13
-
14
- const VARIANT_CLASSES = <string[]>[
15
- 'full',
16
- 'full-start',
17
- 'full-end',
18
- 'popout',
19
- 'popout-start',
20
- 'popout-end',
21
- 'content',
22
- 'content-start',
23
- 'content-end',
24
- 'inset-content',
25
- 'inset-content-start',
26
- 'inset-content-end',
27
- 'full-width',
28
- 'full-content',
29
- 'full-content-nopad',
30
- 'full-content',
31
- ];
32
- </script>
33
-
34
18
  <script setup lang="ts">
35
19
  const props = defineProps({
36
20
  dataTestid: {
37
21
  type: String,
38
- default: 'layout-row',
22
+ default: "layout-row",
39
23
  },
40
24
  tag: {
41
25
  type: String,
42
- default: 'div',
26
+ default: "div",
43
27
  validator(value: string) {
44
- return TAGS_ALLOWED.includes(value);
28
+ return ["div", "section", "article", "aside", "header", "footer", "main", "nav", "ul", "ol"].includes(value)
45
29
  },
46
30
  },
47
31
  variant: {
48
32
  type: String,
49
33
  required: true,
50
34
  validator(value: string) {
51
- return VARIANT_CLASSES.includes(value);
35
+ return [
36
+ "full",
37
+ "full-start",
38
+ "full-end",
39
+ "popout",
40
+ "popout-start",
41
+ "popout-end",
42
+ "content",
43
+ "content-start",
44
+ "content-end",
45
+ "inset-content",
46
+ "inset-content-start",
47
+ "inset-content-end",
48
+ "full-width",
49
+ "full-content",
50
+ "full-content-nopad",
51
+ "full-content",
52
+ ].includes(value)
52
53
  },
53
54
  },
54
55
  id: {
@@ -63,9 +64,9 @@ const props = defineProps({
63
64
  type: Boolean,
64
65
  default: false,
65
66
  },
66
- });
67
+ })
67
68
 
68
- const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
69
+ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
69
70
  </script>
70
71
 
71
72
  <style lang="css">
@@ -3,20 +3,23 @@
3
3
  :is="tag"
4
4
  class="rotating-carousel"
5
5
  :class="[elementClasses]"
6
- :style="`--_rotate-x: ${rotateXProp}deg; --_perspective: ${perspectiveProp}; --_translateZ: ${translateZProp}; --_animation-play-state: ${pauseOnHover ? 'paused' : 'running'}`"
6
+ :style="`--_rotate-x: ${rotateXProp}deg; --_perspective: ${perspectiveProp}; --_translateZ: ${translateZProp}; --_animation-play-state: ${
7
+ pauseOnHover ? 'paused' : 'running'
8
+ }`"
7
9
  ref="carouselRef"
8
10
  >
9
11
  <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>
12
+ <div v-for="(item, key) in data" :key="key" class="item" :style="`--_position: ${key}`">
13
+ <NuxtImg :src="item.src" :alt="item.alt" />
14
+ </div>
11
15
  </div>
12
16
  </component>
13
17
  </template>
14
18
 
15
19
  <script lang="ts">
16
- const TAGS_ALLOWED = <string[]>['div', 'p', 'span', 'section', 'article', 'aside', 'header', 'footer', 'main', 'nav', 'ul', 'ol'];
17
20
  interface IAccordianData {
18
- src: string;
19
- alt: string;
21
+ src: string
22
+ alt: string
20
23
  }
21
24
  </script>
22
25
 
@@ -28,9 +31,22 @@ const props = defineProps({
28
31
  },
29
32
  tag: {
30
33
  type: String,
31
- default: 'div',
34
+ default: "div",
32
35
  validator(value: string) {
33
- return TAGS_ALLOWED.includes(value);
36
+ return [
37
+ "div",
38
+ "p",
39
+ "span",
40
+ "section",
41
+ "article",
42
+ "aside",
43
+ "header",
44
+ "footer",
45
+ "main",
46
+ "nav",
47
+ "ul",
48
+ "ol",
49
+ ].includes(value)
34
50
  },
35
51
  },
36
52
  rotateX: {
@@ -57,77 +73,77 @@ const props = defineProps({
57
73
  type: Array as PropType<string[]>,
58
74
  default: () => [],
59
75
  },
60
- });
76
+ })
61
77
 
62
- const perspectiveProp = computed(() => `${props.perspective.toString()}px`);
63
- const translateZProp = computed(() => `${props.translateZ.toString()}px`);
78
+ const perspectiveProp = computed(() => `${props.perspective.toString()}px`)
79
+ const translateZProp = computed(() => `${props.translateZ.toString()}px`)
64
80
 
65
- const carouselRef = ref<HTMLElement | null>(null);
66
- const rotateXProp = ref(props.rotateX);
67
- const minRotateX = -32;
68
- const maxRotateX = 32;
81
+ const carouselRef = ref<HTMLElement | null>(null)
82
+ const rotateXProp = ref(props.rotateX)
83
+ const minRotateX = -32
84
+ const maxRotateX = 32
69
85
 
70
- const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
86
+ const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
71
87
 
72
88
  watch(
73
89
  () => props.styleClassPassthrough,
74
90
  () => {
75
- resetElementClasses(props.styleClassPassthrough);
91
+ resetElementClasses(props.styleClassPassthrough)
76
92
  }
77
- );
93
+ )
78
94
 
79
95
  watch(
80
96
  () => props.rotateX,
81
97
  () => {
82
98
  if (!props.useParallaxEffect) {
83
- console.log('rotateXProp changed: ', rotateXProp.value);
99
+ console.log("rotateXProp changed: ", rotateXProp.value)
84
100
 
85
- rotateXProp.value = props.rotateX;
101
+ rotateXProp.value = props.rotateX
86
102
  }
87
103
  }
88
- );
104
+ )
89
105
 
90
106
  watch(
91
107
  () => props.useParallaxEffect,
92
108
  (currentValue) => {
93
109
  if (currentValue) {
94
- handleScroll();
95
- window.addEventListener('scroll', handleScroll);
110
+ handleScroll()
111
+ window.addEventListener("scroll", handleScroll)
96
112
  } else {
97
- window.removeEventListener('scroll', handleScroll);
113
+ window.removeEventListener("scroll", handleScroll)
98
114
  }
99
115
  }
100
- );
116
+ )
101
117
 
102
118
  const handleScroll = () => {
103
- if (!carouselRef.value) return;
104
- if ('IntersectionObserver' in window) {
105
- const rect = carouselRef.value.getBoundingClientRect();
106
- const viewportHeight = window.innerHeight;
119
+ if (!carouselRef.value) return
120
+ if ("IntersectionObserver" in window) {
121
+ const rect = carouselRef.value.getBoundingClientRect()
122
+ const viewportHeight = window.innerHeight
107
123
 
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;
124
+ const elementCenter = rect.top + rect.height / 2
125
+ const viewportCenter = viewportHeight / 2
126
+ const distanceFromCenter = viewportCenter - elementCenter
127
+ const maxDistance = viewportHeight / 2 + rect.height / 2
112
128
 
113
- const progress = (distanceFromCenter + maxDistance) / (maxDistance * 2);
114
- const clampedProgress = Math.max(0, Math.min(1, progress));
129
+ const progress = (distanceFromCenter + maxDistance) / (maxDistance * 2)
130
+ const clampedProgress = Math.max(0, Math.min(1, progress))
115
131
 
116
- rotateXProp.value = minRotateX + (maxRotateX - minRotateX) * clampedProgress;
132
+ rotateXProp.value = minRotateX + (maxRotateX - minRotateX) * clampedProgress
117
133
  }
118
- };
134
+ }
119
135
 
120
136
  onMounted(async () => {
121
137
  if (props.useParallaxEffect) {
122
- handleScroll();
123
- await nextTick();
124
- window.addEventListener('scroll', handleScroll);
138
+ handleScroll()
139
+ await nextTick()
140
+ window.addEventListener("scroll", handleScroll)
125
141
  }
126
- });
142
+ })
127
143
 
128
144
  onUnmounted(() => {
129
- window.removeEventListener('scroll', handleScroll);
130
- });
145
+ window.removeEventListener("scroll", handleScroll)
146
+ })
131
147
  </script>
132
148
 
133
149
  <style lang="css">
package/nuxt.config.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  export default defineNuxtConfig({
3
3
  devtools: { enabled: true },
4
4
  // css: ["modern-normalize", "./app/assets/styles/main.css"],
5
- modules: ["@nuxt/eslint", "@nuxt/icon", "@nuxt/image"],
5
+ modules: ["@nuxt/eslint", "@nuxt/icon", "@nuxt/image", "@nuxtjs/i18n"],
6
6
  app: {
7
7
  head: {
8
8
  htmlAttrs: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-components",
3
3
  "type": "module",
4
- "version": "6.1.8",
4
+ "version": "6.1.10",
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",
@@ -36,6 +36,7 @@
36
36
  "typescript": "5.9.2"
37
37
  },
38
38
  "dependencies": {
39
+ "@nuxtjs/i18n": "^10.0.6",
39
40
  "focus-trap-vue": "4.0.3"
40
41
  },
41
42
  "release-it": {