srcdev-nuxt-components 7.0.3 → 8.0.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.
@@ -32,7 +32,10 @@
32
32
  import type { AlertMaskConfig } from "../../types/components"
33
33
 
34
34
  const props = defineProps({
35
- config: Object as PropType<AlertMaskConfig>,
35
+ config: {
36
+ type: Object as PropType<AlertMaskConfig>,
37
+ default: () => ({}),
38
+ },
36
39
  styleClassPassthrough: {
37
40
  type: [String, Array] as PropType<string | string[]>,
38
41
  default: () => [],
@@ -66,7 +66,6 @@
66
66
  </template>
67
67
 
68
68
  <script setup lang="ts">
69
- import type { CarouselBasicItem, CarouselModifiedItem, ICarouselBasic } from "../../types/components"
70
69
  import { useEventListener, useResizeObserver, useSwipe } from "@vueuse/core"
71
70
 
72
71
  const props = defineProps({
@@ -1,7 +1,6 @@
1
1
  <template>
2
2
  <component
3
3
  :is="props.chip ? DisplayChip : as"
4
- tag="div"
5
4
  v-bind="props.chip ? (typeof props.chip === 'object' ? { config: props.chip } : { config: chipDefaultConfig }) : {}"
6
5
  class="display-avatar"
7
6
  :class="[size, elementClasses]"
@@ -15,33 +14,54 @@
15
14
  </component>
16
15
  </template>
17
16
 
18
- <script lang="ts">
17
+ <script setup lang="ts">
19
18
  import DisplayChip from "../display-chip/DisplayChip.vue"
20
19
  import type { DisplayChipProps } from "../../types/components"
21
- export interface AvatarProps {
22
- as?: any
23
- src?: string
24
- alt?: string
25
- text?: string
26
- size?: "xs" | "s" | "md" | "lg" | "xl" | string
27
- chip?: boolean | DisplayChipProps
28
- class?: any
29
- style?: any
30
- styleClassPassthrough?: string | string[]
31
- }
32
20
 
33
21
  export interface AvatarSlots {
34
22
  default(props?: {}): any
35
23
  icon(props?: {}): any
36
24
  }
37
- </script>
38
25
 
39
- <script setup lang="ts">
40
- const props = withDefaults(defineProps<AvatarProps>(), {
41
- as: "span",
42
- size: "md",
43
- styleClassPassthrough: () => [],
26
+ const props = defineProps({
27
+ as: {
28
+ type: [String, Object] as PropType<any>,
29
+ default: "span",
30
+ },
31
+ src: {
32
+ type: String,
33
+ default: undefined,
34
+ },
35
+ alt: {
36
+ type: String,
37
+ default: undefined,
38
+ },
39
+ text: {
40
+ type: String,
41
+ default: undefined,
42
+ },
43
+ size: {
44
+ type: String as PropType<"xs" | "s" | "md" | "lg" | "xl" | string>,
45
+ default: "md",
46
+ },
47
+ chip: {
48
+ type: [Boolean, Object] as PropType<boolean | DisplayChipProps>,
49
+ default: undefined,
50
+ },
51
+ class: {
52
+ type: [String, Array, Object] as PropType<any>,
53
+ default: undefined,
54
+ },
55
+ style: {
56
+ type: [String, Array, Object] as PropType<any>,
57
+ default: undefined,
58
+ },
59
+ styleClassPassthrough: {
60
+ type: [String, Array] as PropType<string | string[]>,
61
+ default: () => [],
62
+ },
44
63
  })
64
+
45
65
  defineSlots<AvatarSlots>()
46
66
 
47
67
  const { elementClasses, resetElementClasses, updateElementClasses } = useStyleClassPassthrough(
@@ -118,5 +138,9 @@ watch(
118
138
  border-radius: 50%;
119
139
  object-fit: cover;
120
140
  }
141
+
142
+ .avatar-icon {
143
+ font-size: 24px;
144
+ }
121
145
  }
122
146
  </style>
@@ -7,31 +7,36 @@
7
7
  </template>
8
8
 
9
9
  <script setup lang="ts">
10
- import type { DisplayChipProps } from "../../types/components"
11
-
12
- interface ChipSlots {
13
- default(props?: {}): any
14
- }
15
-
16
- const props = withDefaults(defineProps<DisplayChipProps>(), {
17
- tag: "div",
18
- shape: "circle",
19
- config: () => ({
20
- size: "12px",
21
- maskWidth: "4px",
22
- offset: "0px",
23
- angle: "90deg",
24
- icon: undefined,
25
- label: undefined,
26
- }),
27
- styleClassPassthrough: () => [],
10
+ import type { DisplayChipConfig } from "../../types/components"
11
+
12
+ const props = defineProps({
13
+ tag: {
14
+ type: String as PropType<"div" | "span">,
15
+ default: "div",
16
+ },
17
+ shape: {
18
+ type: String as PropType<"circle" | "square">,
19
+ default: "circle",
20
+ },
21
+ config: {
22
+ type: Object as PropType<DisplayChipConfig>,
23
+ default: () => ({
24
+ size: "12px",
25
+ maskWidth: "4px",
26
+ offset: "0px",
27
+ angle: "90deg",
28
+ icon: undefined,
29
+ label: undefined,
30
+ }),
31
+ },
32
+ styleClassPassthrough: {
33
+ type: [String, Array] as PropType<string | string[]>,
34
+ default: () => [],
35
+ },
28
36
  })
29
- const slots = defineSlots<ChipSlots>()
30
- // const slots = useSlots()
31
37
 
32
38
  const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
33
39
 
34
- // Validate and truncate label to max 3 characters
35
40
  const validatedLabel = computed(() => {
36
41
  if (!props.config?.label) return props.config?.label
37
42
  if (props.config.label.length > 3) {
@@ -49,32 +49,38 @@
49
49
 
50
50
  <script setup lang="ts">
51
51
  import type {
52
- DisplayToastProps,
52
+ DisplayToastConfig,
53
53
  DisplayToastTheme,
54
54
  DisplayToastPosition,
55
55
  DisplayToastAlignment,
56
56
  ToastSlots,
57
57
  } from "../../types/components"
58
58
 
59
- const props = withDefaults(defineProps<DisplayToastProps>(), {
60
- config: () => ({
61
- appearance: {
62
- theme: "ghost" as DisplayToastTheme,
63
- position: "top" as DisplayToastPosition,
64
- alignment: "right" as DisplayToastAlignment,
65
- fullWidth: false,
66
- },
67
- behavior: {
68
- autoDismiss: true,
69
- duration: 5000,
70
- revealDuration: 550,
71
- },
72
- content: {
73
- text: "",
74
- customIcon: undefined,
75
- },
76
- }),
77
- styleClassPassthrough: () => [],
59
+ const props = defineProps({
60
+ config: {
61
+ type: Object as PropType<DisplayToastConfig>,
62
+ default: () => ({
63
+ appearance: {
64
+ theme: "ghost" as DisplayToastTheme,
65
+ position: "top" as DisplayToastPosition,
66
+ alignment: "right" as DisplayToastAlignment,
67
+ fullWidth: false,
68
+ },
69
+ behavior: {
70
+ autoDismiss: true,
71
+ duration: 5000,
72
+ revealDuration: 550,
73
+ },
74
+ content: {
75
+ text: "",
76
+ customIcon: undefined,
77
+ },
78
+ }),
79
+ },
80
+ styleClassPassthrough: {
81
+ type: [String, Array] as PropType<string | string[]>,
82
+ default: () => [],
83
+ },
78
84
  })
79
85
 
80
86
  const slots = defineSlots<ToastSlots>()
@@ -31,18 +31,40 @@
31
31
  <script setup lang="ts">
32
32
  import type { DisplayToastTheme } from "../../../types/components"
33
33
 
34
- interface DefaultToastContentProps {
35
- theme: DisplayToastTheme
36
- customIcon?: string
37
- toastId: string
38
- toastDisplayText: string
39
- toastTitle?: string
40
- toastDescription?: string
41
- autoDismiss: boolean
42
- setDismissToast: () => void
43
- }
44
-
45
- const props = defineProps<DefaultToastContentProps>()
34
+ const props = defineProps({
35
+ theme: {
36
+ type: String as PropType<DisplayToastTheme>,
37
+ required: true,
38
+ },
39
+ customIcon: {
40
+ type: String,
41
+ default: undefined,
42
+ },
43
+ toastId: {
44
+ type: String,
45
+ required: true,
46
+ },
47
+ toastDisplayText: {
48
+ type: String,
49
+ required: true,
50
+ },
51
+ toastTitle: {
52
+ type: String,
53
+ default: undefined,
54
+ },
55
+ toastDescription: {
56
+ type: String,
57
+ default: undefined,
58
+ },
59
+ autoDismiss: {
60
+ type: Boolean,
61
+ required: true,
62
+ },
63
+ setDismissToast: {
64
+ type: Function as PropType<() => void>,
65
+ required: true,
66
+ },
67
+ })
46
68
 
47
69
  const defaultThemeIcons = {
48
70
  primary: "akar-icons:info",
@@ -15,7 +15,6 @@
15
15
  </template>
16
16
 
17
17
  <script setup lang="ts">
18
- import { computed, nextTick, onMounted, ref, watch, type PropType } from "vue"
19
18
  import { useElementSize, useResizeObserver } from "@vueuse/core"
20
19
 
21
20
  const props = defineProps({
@@ -14,8 +14,6 @@
14
14
  </template>
15
15
 
16
16
  <script setup lang="ts">
17
- import { useResizeObserver } from "@vueuse/core"
18
-
19
17
  const props = defineProps({
20
18
  gridData: {
21
19
  type: Array as PropType<any[]>,
@@ -16,17 +16,15 @@
16
16
  </component>
17
17
  </template>
18
18
 
19
- <script lang="ts">
20
- interface IAccordianData {
19
+ <script setup lang="ts">
20
+ interface CarouselImageData {
21
21
  src: string
22
22
  alt: string
23
23
  }
24
- </script>
25
24
 
26
- <script setup lang="ts">
27
25
  const props = defineProps({
28
26
  data: {
29
- type: Array as PropType<IAccordianData[]>,
27
+ type: Array as PropType<CarouselImageData[]>,
30
28
  default: () => [],
31
29
  },
32
30
  tag: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-components",
3
3
  "type": "module",
4
- "version": "7.0.3",
4
+ "version": "8.0.0",
5
5
  "main": "nuxt.config.ts",
6
6
  "types": "types.d.ts",
7
7
  "scripts": {
@@ -42,8 +42,7 @@
42
42
  "nuxt-qrcode": "0.4.8",
43
43
  "patch-package": "8.0.1",
44
44
  "release-it": "19.2.4",
45
- "typescript": "5.9.3",
46
- "vue-tsc": "3.2.4"
45
+ "typescript": "5.9.3"
47
46
  },
48
47
  "release-it": {
49
48
  "$schema": "https://unpkg.com/release-it/schema/release-it.json",