nuance-ui 0.1.55 → 0.1.56

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
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^4.0.0"
6
6
  },
7
- "version": "0.1.55",
7
+ "version": "0.1.56",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -1,7 +1,7 @@
1
1
  import type { ActionIconProps } from '../../action-icon/index.js';
2
- declare var __VLS_10: {};
2
+ declare var __VLS_16: {};
3
3
  type __VLS_Slots = {} & {
4
- default?: (props: typeof __VLS_10) => any;
4
+ default?: (props: typeof __VLS_16) => any;
5
5
  };
6
6
  declare const __VLS_base: import("vue").DefineComponent<ActionIconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ActionIconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -17,13 +17,15 @@ const close = useDialogState();
17
17
  </script>
18
18
 
19
19
  <template>
20
- <ActionIcon
21
- :icon
22
- :variant
23
- tabindex='0'
24
- v-bind='props'
25
- @click='close'
26
- >
27
- <slot />
28
- </ActionIcon>
20
+ <ClientOnly>
21
+ <ActionIcon
22
+ :icon
23
+ :variant
24
+ tabindex='0'
25
+ v-bind='props'
26
+ @click='close'
27
+ >
28
+ <slot />
29
+ </ActionIcon>
30
+ </ClientOnly>
29
31
  </template>
@@ -1,7 +1,7 @@
1
1
  import type { ActionIconProps } from '../../action-icon/index.js';
2
- declare var __VLS_10: {};
2
+ declare var __VLS_16: {};
3
3
  type __VLS_Slots = {} & {
4
- default?: (props: typeof __VLS_10) => any;
4
+ default?: (props: typeof __VLS_16) => any;
5
5
  };
6
6
  declare const __VLS_base: import("vue").DefineComponent<ActionIconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ActionIconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
7
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,9 +1,9 @@
1
1
  import type { BoxProps } from '../../box.vue.js';
2
2
  export interface DialogHeaderProps extends BoxProps {
3
3
  }
4
- declare var __VLS_8: {};
4
+ declare var __VLS_14: {};
5
5
  type __VLS_Slots = {} & {
6
- default?: (props: typeof __VLS_8) => any;
6
+ default?: (props: typeof __VLS_14) => any;
7
7
  };
8
8
  declare const __VLS_base: import("vue").DefineComponent<DialogHeaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogHeaderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
9
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -8,7 +8,9 @@ const { is = "header", mod } = defineProps({
8
8
  </script>
9
9
 
10
10
  <template>
11
- <Box :is :mod :class='css.header'>
12
- <slot />
13
- </Box>
11
+ <ClientOnly>
12
+ <Box :is :mod :class='css.header'>
13
+ <slot />
14
+ </Box>
15
+ </ClientOnly>
14
16
  </template>
@@ -1,9 +1,9 @@
1
1
  import type { BoxProps } from '../../box.vue.js';
2
2
  export interface DialogHeaderProps extends BoxProps {
3
3
  }
4
- declare var __VLS_8: {};
4
+ declare var __VLS_14: {};
5
5
  type __VLS_Slots = {} & {
6
- default?: (props: typeof __VLS_8) => any;
6
+ default?: (props: typeof __VLS_14) => any;
7
7
  };
8
8
  declare const __VLS_base: import("vue").DefineComponent<DialogHeaderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogHeaderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
9
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -33,9 +33,9 @@ type __VLS_ModelProps = {
33
33
  'open'?: DialogModel['open'];
34
34
  };
35
35
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
36
- declare var __VLS_31: {};
36
+ declare var __VLS_38: {};
37
37
  type __VLS_Slots = {} & {
38
- default?: (props: typeof __VLS_31) => any;
38
+ default?: (props: typeof __VLS_38) => any;
39
39
  };
40
40
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
41
41
  close: () => any;
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
2
  import { getRadius, getShadow, getSize, getSpacing, rem } from "@nui/utils";
3
3
  import { onClickOutside, unrefElement } from "@vueuse/core";
4
- import { computed, onMounted, shallowRef, watch } from "vue";
4
+ import { computed, shallowRef, watch } from "vue";
5
5
  import Box from "../../box.vue";
6
6
  import NTransition from "../../transition/transition.vue";
7
7
  import { useProvideDialogState } from "../lib";
@@ -55,8 +55,7 @@ const dialogRef = shallowRef(null);
55
55
  if (closeOnClickOutside) {
56
56
  onClickOutside(dialogRef, () => opened.value = false);
57
57
  }
58
- watch(opened, (isOpen) => {
59
- const dialog = unrefElement(dialogRef);
58
+ watch([opened, () => unrefElement(dialogRef)], ([isOpen, dialog]) => {
60
59
  if (!dialog)
61
60
  return;
62
61
  if (isOpen)
@@ -64,11 +63,6 @@ watch(opened, (isOpen) => {
64
63
  else
65
64
  dialog.close();
66
65
  }, { flush: "post" });
67
- onMounted(() => {
68
- if (!opened.value)
69
- return;
70
- open(unrefElement(dialogRef));
71
- });
72
66
  const style = computed(() => ({
73
67
  "--dialog-size": getSize(size, "dialog-size"),
74
68
  "--dialog-radius": radius ? getRadius(radius) : void 0,
@@ -80,22 +74,24 @@ const style = computed(() => ({
80
74
  </script>
81
75
 
82
76
  <template>
83
- <Teleport :disabled='!withinPortal' :to='portalTarget'>
84
- <Box
85
- is='dialog'
86
- ref='dialogRef'
87
- :class='[css.root, rootClass]'
88
- :mod='[{ "without-overlay": withoutOverlay }, mod]'
89
- :style
90
- @click='overlayClick'
91
- @close='$emit("close")'
92
- @cancel.prevent='opened = false'
93
- >
94
- <NTransition :name='transition'>
95
- <Box is='section' v-if='opened' :class='css.content' v-bind='$attrs'>
96
- <slot />
97
- </Box>
98
- </NTransition>
99
- </Box>
100
- </Teleport>
77
+ <ClientOnly>
78
+ <Teleport :disabled='!withinPortal' :to='portalTarget'>
79
+ <Box
80
+ is='dialog'
81
+ ref='dialogRef'
82
+ :class='[css.root, rootClass]'
83
+ :mod='[{ "without-overlay": withoutOverlay }, mod]'
84
+ :style
85
+ @click='overlayClick'
86
+ @close='$emit("close")'
87
+ @cancel.prevent='opened = false'
88
+ >
89
+ <NTransition :name='transition'>
90
+ <Box is='section' v-if='opened' :class='css.content' v-bind='$attrs'>
91
+ <slot />
92
+ </Box>
93
+ </NTransition>
94
+ </Box>
95
+ </Teleport>
96
+ </ClientOnly>
101
97
  </template>
@@ -33,9 +33,9 @@ type __VLS_ModelProps = {
33
33
  'open'?: DialogModel['open'];
34
34
  };
35
35
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
36
- declare var __VLS_31: {};
36
+ declare var __VLS_38: {};
37
37
  type __VLS_Slots = {} & {
38
- default?: (props: typeof __VLS_31) => any;
38
+ default?: (props: typeof __VLS_38) => any;
39
39
  };
40
40
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
41
41
  close: () => any;
@@ -1,9 +1,9 @@
1
1
  import type { TitleProps } from '../../title.vue.js';
2
2
  export interface DialogTitleProps extends TitleProps {
3
3
  }
4
- declare var __VLS_8: {};
4
+ declare var __VLS_14: {};
5
5
  type __VLS_Slots = {} & {
6
- default?: (props: typeof __VLS_8) => any;
6
+ default?: (props: typeof __VLS_14) => any;
7
7
  };
8
8
  declare const __VLS_base: import("vue").DefineComponent<DialogTitleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogTitleProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
9
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -20,7 +20,9 @@ const { size = "md", lh = "1", ...props } = defineProps({
20
20
  </script>
21
21
 
22
22
  <template>
23
- <Title :class='css.title' :lh :size v-bind='props'>
24
- <slot />
25
- </Title>
23
+ <ClientOnly>
24
+ <Title :class='css.title' :lh :size v-bind='props'>
25
+ <slot />
26
+ </Title>
27
+ </ClientOnly>
26
28
  </template>
@@ -1,9 +1,9 @@
1
1
  import type { TitleProps } from '../../title.vue.js';
2
2
  export interface DialogTitleProps extends TitleProps {
3
3
  }
4
- declare var __VLS_8: {};
4
+ declare var __VLS_14: {};
5
5
  type __VLS_Slots = {} & {
6
- default?: (props: typeof __VLS_8) => any;
6
+ default?: (props: typeof __VLS_14) => any;
7
7
  };
8
8
  declare const __VLS_base: import("vue").DefineComponent<DialogTitleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogTitleProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
9
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,14 +1,19 @@
1
1
  <script setup>
2
- import { $modals } from "../../plugins/modals";
2
+ import { useNuxtApp } from "#app";
3
+ import { ClientOnly } from "#components";
4
+ import { computed } from "vue";
5
+ const modals = computed(() => useNuxtApp().$modals?.modals ?? []);
3
6
  </script>
4
7
 
5
8
  <template>
6
- <div id='nui-modals-root'>
7
- <component
8
- :is='entry.component'
9
- v-for='[id, entry] in $modals.modals'
10
- :key='id'
11
- v-bind='entry.props'
12
- />
13
- </div>
9
+ <ClientOnly>
10
+ <div id='nui-modals-root'>
11
+ <component
12
+ :is='entry.component'
13
+ v-for='[id, entry] in modals'
14
+ :key='id'
15
+ v-bind='entry.props'
16
+ />
17
+ </div>
18
+ </ClientOnly>
14
19
  </template>
@@ -1,8 +1,8 @@
1
1
  import { ModalManager } from './modal-manager.js';
2
- export declare const $modals: ModalManager;
2
+ export declare const $modals: import("vue").Raw<ModalManager>;
3
3
  declare const _default: import("#app").Plugin<{
4
- modals: ModalManager;
4
+ modals: import("vue").Raw<ModalManager>;
5
5
  }> & import("#app").ObjectPlugin<{
6
- modals: ModalManager;
6
+ modals: import("vue").Raw<ModalManager>;
7
7
  }>;
8
8
  export default _default;
@@ -1,6 +1,6 @@
1
- import { defineNuxtPlugin } from "#imports";
1
+ import { defineNuxtPlugin, markRaw } from "#imports";
2
2
  import { ModalManager } from "./modal-manager.js";
3
- export const $modals = new ModalManager();
3
+ export const $modals = markRaw(new ModalManager());
4
4
  export default defineNuxtPlugin(() => {
5
5
  return {
6
6
  provide: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuance-ui",
3
- "version": "0.1.55",
3
+ "version": "0.1.56",
4
4
  "description": "A UI Library for Modern Web Apps, powered by Vue.",
5
5
  "repository": {
6
6
  "type": "git",