nuance-ui 0.1.15 → 0.1.16

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.15",
7
+ "version": "0.1.16",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -1,15 +1,8 @@
1
1
  <script setup>
2
- import { computed } from "vue";
2
+ import { computed, toRefs } from "vue";
3
3
  import Box from "../box.vue";
4
- const {
5
- mod,
6
- layout = "default",
7
- withBorder = false,
8
- aside,
9
- footer,
10
- header,
11
- navbar
12
- } = defineProps({
4
+ import { useProvideAppShell } from "./context";
5
+ const { is, mod, layout = "default", withBorder = false, ...rest } = defineProps({
13
6
  navbar: { type: Boolean, required: false },
14
7
  aside: { type: Boolean, required: false },
15
8
  header: { type: Boolean, required: false },
@@ -19,20 +12,22 @@ const {
19
12
  is: { type: null, required: false },
20
13
  mod: { type: [Object, Array, null], required: false }
21
14
  });
15
+ const flags = toRefs(rest);
16
+ useProvideAppShell(flags);
22
17
  const style = computed(() => ({
23
- "--app-shell-navbar-transform": navbar ? "translateX(calc(-1 * var(--app-shell-navbar-width)))" : void 0,
24
- "--app-shell-navbar-offset": navbar ? "0rem" : void 0,
25
- "--app-shell-aside-transform": aside ? "translateX(var(--app-shell-aside-width))" : void 0,
26
- "--app-shell-aside-offset": aside ? "0rem" : void 0,
27
- "--app-shell-header-transform": header ? "translateY(calc(-1 * var(--app-shell-header-height)))" : void 0,
28
- "--app-shell-header-offset": header ? "0rem" : void 0,
29
- "--app-shell-footer-transform": footer ? "translateY(var(--app-shell-footer-height))" : void 0,
30
- "--app-shell-footer-offset": footer ? "0rem" : void 0
18
+ "--app-shell-navbar-transform": flags.navbar.value ? "translateX(calc(-1 * var(--app-shell-navbar-width)))" : void 0,
19
+ "--app-shell-navbar-offset": flags.navbar.value ? "0rem" : void 0,
20
+ "--app-shell-aside-transform": flags.aside.value ? "translateX(var(--app-shell-aside-width))" : void 0,
21
+ "--app-shell-aside-offset": flags.aside.value ? "0rem" : void 0,
22
+ "--app-shell-header-transform": flags.header.value ? "translateY(calc(-1 * var(--app-shell-header-height)))" : void 0,
23
+ "--app-shell-header-offset": flags.header.value ? "0rem" : void 0,
24
+ "--app-shell-footer-transform": flags.footer.value ? "translateY(var(--app-shell-footer-height))" : void 0,
25
+ "--app-shell-footer-offset": flags.footer.value ? "0rem" : void 0
31
26
  }));
32
27
  </script>
33
28
 
34
29
  <template>
35
- <Box :style :class='$style.root' :mod='[mod, { layout, "with-border": withBorder }]'>
30
+ <Box :is :style :class='$style.root' :mod='[mod, { layout, "with-border": withBorder }]'>
36
31
  <slot />
37
32
  </Box>
38
33
  </template>
@@ -0,0 +1,10 @@
1
+ import type { Ref } from 'vue';
2
+ interface AppShellState {
3
+ header: Ref<boolean>;
4
+ navbar: Ref<boolean>;
5
+ aside: Ref<boolean>;
6
+ footer: Ref<boolean>;
7
+ }
8
+ export declare const useProvideAppShell: (args_0: AppShellState) => AppShellState;
9
+ export declare const useAppShell: () => AppShellState | undefined;
10
+ export {};
@@ -0,0 +1,4 @@
1
+ import { createInjectionState } from "@vueuse/core";
2
+ const [useProvide, useAState] = createInjectionState((state) => state);
3
+ export const useProvideAppShell = useProvide;
4
+ export const useAppShell = useAState;
@@ -5,3 +5,4 @@ export type * from './app-shell-main.vue';
5
5
  export type * from './app-shell-navbar.vue';
6
6
  export type * from './app-shell-section.vue';
7
7
  export type * from './app-shell.vue';
8
+ export { useAppShell } from './context.js';
@@ -0,0 +1 @@
1
+ export { useAppShell } from "./context.js";
@@ -43,7 +43,7 @@ const { link, rest } = pickLinkProps(etc);
43
43
  <NuxtLink v-slot='{ href, navigate, isActive, ...linkProps }' v-bind='link' custom>
44
44
  <ActionIcon
45
45
  is='a'
46
- v-bind='rest'
46
+ v-bind='{ ...rest, $attrs }'
47
47
  :href
48
48
  :variant='isActive ? active : notActive'
49
49
  :mod='[{ active: isActive }, mod]'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuance-ui",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "A UI Library for Modern Web Apps, powered by Vue.",
5
5
  "repository": {
6
6
  "type": "git",