@una-ui/nuxt 0.10.1-beta.1 → 0.11.0-beta.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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "configKey": "una",
4
- "version": "0.10.1-beta.1",
4
+ "version": "0.11.0-beta.1",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.0.0"
7
7
  },
package/dist/module.mjs CHANGED
@@ -7,7 +7,7 @@ import '@una-ui/preset/prefixes';
7
7
  import '@una-ui/extractor-vue-script';
8
8
 
9
9
  const name = "@una-ui/nuxt";
10
- const version = "0.10.1-beta.1";
10
+ const version = "0.11.0-beta.1";
11
11
 
12
12
  const module = defineNuxtModule({
13
13
  meta: {
@@ -46,6 +46,12 @@ const module = defineNuxtModule({
46
46
  global: options.global,
47
47
  watch: nuxt.options.dev
48
48
  });
49
+ addComponentsDir({
50
+ path: resolve(runtimeDir, "components/elements", "card"),
51
+ prefix: options.prefix,
52
+ global: options.global,
53
+ watch: nuxt.options.dev
54
+ });
49
55
  addComponentsDir({
50
56
  path: resolve(runtimeDir, "components", "forms"),
51
57
  prefix: options.prefix,
@@ -0,0 +1,90 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue'
3
+ import type { NCardProps } from '../../../types/card'
4
+ import { cn } from '../../../utils'
5
+ import CardContent from './CardContent.vue'
6
+ import CardHeader from './CardHeader.vue'
7
+ import CardAbout from './CardAbout.vue'
8
+ import CardFooter from './CardFooter.vue'
9
+ import CardTitle from './CardTitle.vue'
10
+ import CardDescription from './CardDescription.vue'
11
+
12
+ defineOptions({
13
+ inheritAttrs: false,
14
+ })
15
+
16
+ const props = withDefaults(defineProps<NCardProps>(), {
17
+ una: () => ({
18
+ cardDefaultVariant: 'card-default-variant',
19
+ }),
20
+ })
21
+
22
+ const delegatedProps = computed(() => {
23
+ const { class: _, ...delegated } = props
24
+
25
+ return delegated
26
+ })
27
+
28
+ const cardVariants = ['soft', 'outline'] as const
29
+ const hasVariant = computed(() => cardVariants.some(cardVariant => props.card?.includes(cardVariant)))
30
+ const isBaseVariant = computed(() => props.card?.includes('~'))
31
+ </script>
32
+
33
+ <template>
34
+ <div
35
+ v-bind="{ ...$attrs, delegatedProps }"
36
+ :card="card"
37
+ :class="cn(
38
+ 'card',
39
+ !hasVariant && !isBaseVariant ? una?.cardDefaultVariant : '',
40
+ props.class,
41
+ una?.card,
42
+ )"
43
+ >
44
+ <slot name="root">
45
+ <CardHeader
46
+ v-bind="delegatedProps._cardHeader"
47
+ >
48
+ <slot name="header" />
49
+ </CardHeader>
50
+
51
+ <CardAbout
52
+ v-if="$slots.about || title || description || $slots.title || $slots.description"
53
+ v-bind="delegatedProps._cardAbout"
54
+ >
55
+ <slot name="about">
56
+ <CardTitle
57
+ v-if="$slots.title || title"
58
+ v-bind="delegatedProps._cardTitle"
59
+ >
60
+ <slot name="title">
61
+ {{ title }}
62
+ </slot>
63
+ </CardTitle>
64
+ <CardDescription
65
+ v-if="$slots.description || description"
66
+ v-bind="delegatedProps._cardDescription"
67
+ >
68
+ <slot name="description">
69
+ {{ description }}
70
+ </slot>
71
+ </CardDescription>
72
+ </slot>
73
+ </CardAbout>
74
+
75
+ <CardContent
76
+ v-if="$slots.default"
77
+ v-bind="delegatedProps._cardContent"
78
+ >
79
+ <slot />
80
+ </CardContent>
81
+
82
+ <CardFooter
83
+ v-if="$slots.footer"
84
+ v-bind="delegatedProps._cardFooter"
85
+ >
86
+ <slot name="footer" />
87
+ </CardFooter>
88
+ </slot>
89
+ </div>
90
+ </template>
@@ -0,0 +1,18 @@
1
+ <script setup lang="ts">
2
+ import type { NCardAboutProps } from '../../../types'
3
+ import { cn } from '../../../utils'
4
+
5
+ const props = defineProps<NCardAboutProps>()
6
+ </script>
7
+
8
+ <template>
9
+ <div
10
+ :class="cn(
11
+ 'card-about',
12
+ props.class,
13
+ props.una?.cardAbout,
14
+ )"
15
+ >
16
+ <slot />
17
+ </div>
18
+ </template>
@@ -0,0 +1,18 @@
1
+ <script setup lang="ts">
2
+ import type { NCardContentProps } from '../../../types/card'
3
+ import { cn } from '../../../utils'
4
+
5
+ const props = defineProps<NCardContentProps>()
6
+ </script>
7
+
8
+ <template>
9
+ <div
10
+ :class="cn(
11
+ 'card-content',
12
+ props.class,
13
+ props.una?.cardContent,
14
+ )"
15
+ >
16
+ <slot />
17
+ </div>
18
+ </template>
@@ -0,0 +1,18 @@
1
+ <script setup lang="ts">
2
+ import type { NCardDescriptionProps } from '../../../types/card'
3
+ import { cn } from '../../../utils'
4
+
5
+ const props = defineProps<NCardDescriptionProps>()
6
+ </script>
7
+
8
+ <template>
9
+ <p
10
+ :class="cn(
11
+ 'card-description',
12
+ props.class,
13
+ props.una?.cardSubtitle,
14
+ )"
15
+ >
16
+ <slot />
17
+ </p>
18
+ </template>
@@ -0,0 +1,18 @@
1
+ <script setup lang="ts">
2
+ import type { NCardFooterProps } from '../../../types/card'
3
+ import { cn } from '../../../utils'
4
+
5
+ const props = defineProps<NCardFooterProps>()
6
+ </script>
7
+
8
+ <template>
9
+ <div
10
+ :class="cn(
11
+ 'card-footer',
12
+ props.class,
13
+ props.una?.cardFooter,
14
+ )"
15
+ >
16
+ <slot />
17
+ </div>
18
+ </template>
@@ -0,0 +1,18 @@
1
+ <script setup lang="ts">
2
+ import type { NCardHeaderProps } from '../../../types/card'
3
+ import { cn } from '../../../utils'
4
+
5
+ const props = defineProps<NCardHeaderProps>()
6
+ </script>
7
+
8
+ <template>
9
+ <div
10
+ :class="cn(
11
+ 'card-header',
12
+ props.class,
13
+ props.una?.cardHeader,
14
+ )"
15
+ >
16
+ <slot />
17
+ </div>
18
+ </template>
@@ -0,0 +1,19 @@
1
+ <script setup lang="ts">
2
+ import type { NCardTitleProps } from '../../../types/card'
3
+ import { cn } from '../../../utils'
4
+
5
+ const props = defineProps<NCardTitleProps>()
6
+ </script>
7
+
8
+ <template>
9
+ <h3
10
+ :class="
11
+ cn('card-title',
12
+ props.class,
13
+ props.una?.cardTitle,
14
+ )
15
+ "
16
+ >
17
+ <slot />
18
+ </h3>
19
+ </template>
@@ -0,0 +1,69 @@
1
+ import type { HTMLAttributes } from 'vue';
2
+ interface BaseExtensions {
3
+ class?: HTMLAttributes['class'];
4
+ }
5
+ export interface NCardProps extends BaseExtensions {
6
+ /**
7
+ * Allows you to add `UnaUI` card preset properties,
8
+ * Think of it as a shortcut for adding options or variants to the preset if available.
9
+ *
10
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/card.ts
11
+ * @example
12
+ * card="outline-green"
13
+ */
14
+ card?: string;
15
+ /**
16
+ * Add a title to the card.
17
+ */
18
+ title?: string;
19
+ /**
20
+ * Add a description to the card.
21
+ */
22
+ description?: string;
23
+ _cardContent?: Partial<NCardContentProps>;
24
+ _cardTitle?: Partial<NCardTitleProps>;
25
+ _cardDescription?: Partial<NCardDescriptionProps>;
26
+ _cardHeader?: Partial<NCardHeaderProps>;
27
+ _cardAbout?: Partial<NCardAboutProps>;
28
+ _cardFooter?: Partial<NCardFooterProps>;
29
+ /**
30
+ * `UnaUI` preset configuration
31
+ *
32
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/card.ts
33
+ */
34
+ una?: {
35
+ cardDefaultVariant: HTMLAttributes['class'];
36
+ card?: HTMLAttributes['class'];
37
+ };
38
+ }
39
+ export interface NCardContentProps extends BaseExtensions {
40
+ una?: {
41
+ cardContent?: HTMLAttributes['class'];
42
+ };
43
+ }
44
+ export interface NCardTitleProps extends BaseExtensions {
45
+ una?: {
46
+ cardTitle?: HTMLAttributes['class'];
47
+ };
48
+ }
49
+ export interface NCardDescriptionProps extends BaseExtensions {
50
+ una?: {
51
+ cardSubtitle?: HTMLAttributes['class'];
52
+ };
53
+ }
54
+ export interface NCardHeaderProps extends BaseExtensions {
55
+ una?: {
56
+ cardHeader?: HTMLAttributes['class'];
57
+ };
58
+ }
59
+ export interface NCardAboutProps extends BaseExtensions {
60
+ una?: {
61
+ cardAbout?: HTMLAttributes['class'];
62
+ };
63
+ }
64
+ export interface NCardFooterProps extends BaseExtensions {
65
+ una?: {
66
+ cardFooter?: HTMLAttributes['class'];
67
+ };
68
+ }
69
+ export {};
File without changes
@@ -21,6 +21,7 @@ export * from './skeleton.js';
21
21
  export * from './tabs.js';
22
22
  export * from './select.js';
23
23
  export * from './separator.js';
24
+ export * from './card.js';
24
25
  export interface Colors {
25
26
  [key: string]: string;
26
27
  }
@@ -21,3 +21,4 @@ export * from "./skeleton.js";
21
21
  export * from "./tabs.js";
22
22
  export * from "./select.js";
23
23
  export * from "./separator.js";
24
+ export * from "./card.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "type": "module",
4
- "version": "0.10.1-beta.1",
4
+ "version": "0.11.0-beta.1",
5
5
  "description": "Nuxt module for @una-ui",
6
6
  "author": "Phojie Rengel <phojrengel@gmail.com>",
7
7
  "license": "MIT",
@@ -28,33 +28,32 @@
28
28
  ],
29
29
  "dependencies": {
30
30
  "@headlessui/vue": "^1.7.22",
31
- "@iconify-json/heroicons": "^1.1.22",
32
- "@iconify-json/lucide": "^1.1.200",
33
- "@iconify-json/radix-icons": "^1.1.14",
34
- "@iconify-json/tabler": "^1.1.117",
35
- "@nuxt/kit": "^3.12.3",
31
+ "@iconify-json/heroicons": "^1.1.24",
32
+ "@iconify-json/lucide": "^1.1.206",
33
+ "@iconify-json/radix-icons": "^1.1.15",
34
+ "@iconify-json/tabler": "^1.1.120",
35
+ "@nuxt/kit": "^3.12.4",
36
36
  "@nuxtjs/color-mode": "^3.4.2",
37
- "@unocss/core": "^0.61.5",
38
- "@unocss/nuxt": "^0.61.5",
39
- "@unocss/preset-attributify": "^0.61.5",
40
- "@unocss/preset-icons": "^0.61.5",
41
- "@vueuse/core": "^10.11.0",
42
- "@vueuse/integrations": "^10.11.0",
43
- "@vueuse/nuxt": "^10.11.0",
37
+ "@unocss/core": "^0.61.9",
38
+ "@unocss/nuxt": "^0.61.9",
39
+ "@unocss/preset-attributify": "^0.61.9",
40
+ "@unocss/preset-icons": "^0.61.9",
41
+ "@vueuse/core": "^10.11.1",
42
+ "@vueuse/integrations": "^10.11.1",
43
+ "@vueuse/nuxt": "^10.11.1",
44
44
  "clsx": "^2.1.1",
45
45
  "ohash": "^1.1.3",
46
- "radix-vue": "^1.9.1",
47
- "tailwind-merge": "^2.4.0",
48
- "typescript": "^5.5.3",
49
- "unocss": "^0.61.5",
46
+ "radix-vue": "^1.9.3",
47
+ "tailwind-merge": "^2.5.1",
48
+ "unocss": "^0.61.9",
50
49
  "unocss-preset-animations": "^1.1.0",
51
- "@una-ui/preset": "^0.10.1-beta.1",
52
- "@una-ui/extractor-vue-script": "^0.10.1-beta.1"
50
+ "@una-ui/extractor-vue-script": "^0.11.0-beta.1",
51
+ "@una-ui/preset": "^0.11.0-beta.1"
53
52
  },
54
53
  "devDependencies": {
55
54
  "@nuxt/module-builder": "^0.8.1",
56
- "@nuxt/schema": "^3.12.3",
57
- "nuxt": "^3.12.3"
55
+ "@nuxt/schema": "^3.12.4",
56
+ "nuxt": "^3.12.4"
58
57
  },
59
58
  "publishConfig": {
60
59
  "access": "public"