@una-ui/nuxt 0.17.0-beta.1 → 0.18.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.17.0-beta.1",
4
+ "version": "0.18.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.17.0-beta.1";
10
+ const version = "0.18.0-beta.1";
11
11
 
12
12
  const module = defineNuxtModule({
13
13
  meta: {
@@ -1,16 +1,29 @@
1
1
  <script setup lang="ts">
2
- import { PopoverRoot, useForwardPropsEmits } from 'radix-vue'
2
+ import { PopoverRoot, PopoverTrigger, useForwardPropsEmits } from 'radix-vue'
3
+ import { computed } from 'vue'
3
4
  import type { PopoverRootEmits } from 'radix-vue'
4
5
  import type { NPopoverProps } from '../../../types'
6
+ import NPopoverContent from './PopoverContent.vue'
5
7
 
6
8
  const props = defineProps<NPopoverProps>()
7
9
  const emits = defineEmits<PopoverRootEmits>()
8
10
 
9
- const forwarded = useForwardPropsEmits(props, emits)
11
+ const delegatedProps = computed(() => {
12
+ const { _popoverContent, ...delegated } = props
13
+
14
+ return delegated
15
+ })
16
+
17
+ const forwarded = useForwardPropsEmits(delegatedProps, emits)
10
18
  </script>
11
19
 
12
20
  <template>
13
- <PopoverRoot v-bind="forwarded">
14
- <slot />
21
+ <PopoverRoot v-slot="{ open }" v-bind="forwarded">
22
+ <PopoverTrigger as-child>
23
+ <slot name="default" :open />
24
+ </PopoverTrigger>
25
+ <NPopoverContent v-bind="_popoverContent">
26
+ <slot name="content" />
27
+ </NPopoverContent>
15
28
  </PopoverRoot>
16
29
  </template>
@@ -1,11 +1,11 @@
1
1
  <script setup lang="ts">
2
- import { computed } from 'vue'
3
2
  import {
4
3
  PopoverContent,
5
4
  type PopoverContentEmits,
6
5
  PopoverPortal,
7
6
  useForwardPropsEmits,
8
7
  } from 'radix-vue'
8
+ import { computed } from 'vue'
9
9
  import { cn } from '../../../utils'
10
10
  import type { NPopoverContentProps } from '../../../types'
11
11
 
@@ -37,7 +37,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
37
37
  v-bind="{ ...forwarded, ...$attrs }"
38
38
  :class="
39
39
  cn(
40
- 'popover',
40
+ 'popover-content',
41
41
  props.class,
42
42
  )
43
43
  "
@@ -15,8 +15,8 @@ export function useUnaSettings() {
15
15
  };
16
16
  const settings = useStorage("una-settings", defaultSettings);
17
17
  watchEffect(() => {
18
- settings.value.primaryColors = getPrimaryColors(settings.value.primary);
19
- settings.value.grayColors = getGrayColors(settings.value.gray);
18
+ settings.value.primaryColors = getPrimaryColors(settings.value.primary || una.primary);
19
+ settings.value.grayColors = getGrayColors(settings.value.gray || una.gray);
20
20
  });
21
21
  function reset() {
22
22
  settings.value.primary = defaultSettings.primary;
@@ -45,10 +45,10 @@ export interface ColorPalette {
45
45
  950: string;
46
46
  }
47
47
  export interface UnaSettings {
48
- primaryColors: Colors;
49
- grayColors: Colors;
50
- primary: string;
51
- gray: string;
52
- fontSize: number;
53
- radius: number;
48
+ primaryColors?: Colors;
49
+ grayColors?: Colors;
50
+ primary?: string;
51
+ gray?: string;
52
+ fontSize?: number;
53
+ radius?: number;
54
54
  }
@@ -4,6 +4,8 @@ interface BaseExtensions {
4
4
  class?: HTMLAttributes['class'];
5
5
  }
6
6
  export interface NPopoverProps extends PopoverRootProps {
7
+ /** Props for the popover content */
8
+ _popoverContent?: NPopoverContentProps;
7
9
  }
8
10
  export interface NPopoverContentProps extends PopoverContentProps, BaseExtensions {
9
11
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "type": "module",
4
- "version": "0.17.0-beta.1",
4
+ "version": "0.18.0-beta.1",
5
5
  "description": "Nuxt module for @una-ui",
6
6
  "author": "Phojie Rengel <phojrengel@gmail.com>",
7
7
  "license": "MIT",
@@ -49,8 +49,8 @@
49
49
  "typescript": "^5.5.4",
50
50
  "unocss": "^0.62.3",
51
51
  "unocss-preset-animations": "^1.1.0",
52
- "@una-ui/extractor-vue-script": "^0.17.0-beta.1",
53
- "@una-ui/preset": "^0.17.0-beta.1"
52
+ "@una-ui/extractor-vue-script": "^0.18.0-beta.1",
53
+ "@una-ui/preset": "^0.18.0-beta.1"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@nuxt/module-builder": "^0.8.1",