nuance-ui 0.1.13 → 0.1.14

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.13",
7
+ "version": "0.1.14",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -1 +1 @@
1
- .root{--ai-size-xs:rem(18px);--ai-size-sm:rem(22px);--ai-size-md:rem(28px);--ai-size-lg:rem(34px);--ai-size-xl:rem(44px);--ai-size-input-xs:rem(30px);--ai-size-input-sm:rem(36px);--ai-size-input-md:rem(42px);--ai-size-input-lg:rem(50px);--ai-size-input-xl:rem(60px);--ai-size:var(--ai-size-md);--ai-color:var(--color-white);--ai-radius:var(--radius-default);--ai-bg:var(--color-primary-filled);--ai-hover:var(--color-primary-filled-hover);align-items:center;background:var(--ai-bg,var(--color-primary-filled));border:var(--ai-bd,rem(1px) solid transparent);border-radius:var(--ai-radius,var(--radius-default));color:var(--ai-color,var(--color-white));cursor:pointer;display:inline-flex;height:var(--ai-size);justify-content:center;line-height:1;min-height:var(--ai-size);min-width:var(--ai-size);overflow:hidden;padding:0;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ai-size)}.root[data-loading]{cursor:not-allowed}.root[data-loading] .icon{opacity:0;transform:translateY(100%)}.root:where(:disabled:not([data-loading]),[data-disabled]:not([data-loading])){border:1px solid transparent;cursor:not-allowed}.root:where(:disabled:not([data-loading]),[data-disabled]:not([data-loading])):active{transform:none}.root:where(:disabled:not([data-loading]),[data-disabled]:not([data-loading])){@mixin where-light{background-color:var(--color-gray-1);color:var(--color-gray-5)}}.root:where(:disabled:not([data-loading]),[data-disabled]:not([data-loading])){@mixin where-dark{background-color:var(--color-dark-6);color:var(--color-dark-3)}}.root{@mixin hover{&:where(:not([data-loading],:disabled,[data-disabled])){background-color:var(--ai-hover);color:var(--ai-color)}}}.loader{align-items:center;border-radius:var(--ai-radius,var(--radius-default));display:flex;justify-content:center;left:calc(50% - var(--loader-size)/2);position:absolute;top:calc(50% - var(--loader-size)/2);@mixin where-light{background-color:hsla(0,0%,100%,.15)}@mixin where-dark{background-color:rgba(0,0,0,.15)}}.icon{align-items:center;display:flex;height:100%;justify-content:center;transition:transform .15s ease,opacity .1s ease;width:100%}.group{--ai-border-width:1px;display:flex}.group :where(*):focus{position:relative;z-index:1}.group[data-orientation=horizontal]{flex-direction:row}.group[data-orientation=horizontal] .groupSection:not(:only-child):first-child,.group[data-orientation=horizontal] .root:not(:only-child):first-child{border-end-end-radius:0;border-inline-end-width:calc(var(--ai-border-width)/2);border-start-end-radius:0}.group[data-orientation=horizontal] .groupSection:not(:only-child):last-child,.group[data-orientation=horizontal] .root:not(:only-child):last-child{border-end-start-radius:0;border-inline-start-width:calc(var(--ai-border-width)/2);border-start-start-radius:0}.group[data-orientation=horizontal] .groupSection:not(:only-child):not(:first-child):not(:last-child),.group[data-orientation=horizontal] .root:not(:only-child):not(:first-child):not(:last-child){border-inline-width:calc(var(--ai-border-width)/2);border-radius:0}.group[data-orientation=vertical]{flex-direction:column}.group[data-orientation=vertical] .groupSection:not(:only-child):first-child,.group[data-orientation=vertical] .root:not(:only-child):first-child{border-bottom-width:calc(var(--ai-border-width)/2);border-end-end-radius:0;border-end-start-radius:0}.group[data-orientation=vertical] .groupSection:not(:only-child):last-child,.group[data-orientation=vertical] .root:not(:only-child):last-child{border-start-end-radius:0;border-start-start-radius:0;border-top-width:calc(var(--ai-border-width)/2)}.group[data-orientation=vertical] .groupSection:not(:only-child):not(:first-child):not(:last-child),.group[data-orientation=vertical] .root:not(:only-child):not(:first-child):not(:last-child){border-bottom-width:calc(var(--ai-border-width)/2);border-radius:0;border-top-width:calc(var(--ai-border-width)/2)}.section{--section-height-xs:var(--ai-size-xs);--section-height-sm:var(--ai-size-sm);--section-height-md:var(--ai-size-md);--section-height-lg:var(--ai-size-lg);--section-height-xl:var(--ai-size-xl);--section-height-input-xs:var(--ai-size-input-xs);--section-height-input-sm:var(--ai-size-input-sm);--section-height-input-md:var(--ai-size-input-md);--section-height-input-lg:var(--ai-size-input-lg);--section-height-input-xl:var(--ai-size-input-xl);--section-padding-x-xs:rem(6px);--section-padding-x-sm:rem(8px);--section-padding-x-md:rem(10px);--section-padding-x-lg:rem(12px);--section-padding-x-xl:rem(16px);--section-height:var(--section-height-sm);--section-padding-x:var(--section-padding-x-sm);--section-color:var(--color-white);align-items:center;background:var(--section-bg,var(--color-primary-filled));border:var(--section-bd,rem(1px) solid transparent);border-radius:var(--section-radius,var(--mantine-radius-default));color:var(--section-color,var(--color-white));display:inline-flex;font-size:var(--section-fz,var(--mantine-font-size-sm));font-weight:600;height:var(--section-height,var(--section-height-sm));justify-content:center;line-height:1;padding-inline:var(--section-padding-x,var(--section-padding-x-sm));vertical-align:middle;width:auto}
1
+ .root{--ai-size-xs:rem(18px);--ai-size-sm:rem(22px);--ai-size-md:rem(28px);--ai-size-lg:rem(34px);--ai-size-xl:rem(44px);--ai-size-input-xs:rem(30px);--ai-size-input-sm:rem(36px);--ai-size-input-md:rem(42px);--ai-size-input-lg:rem(50px);--ai-size-input-xl:rem(60px);--ai-size:var(--ai-size-md);--ai-color:var(--color-white);--ai-radius:var(--radius-default);--ai-bg:var(--color-primary-filled);--ai-hover:var(--color-primary-filled-hover);align-items:center;background:var(--ai-bg,var(--color-primary-filled));border:var(--ai-bd,rem(1px) solid transparent);border-radius:var(--ai-radius,var(--radius-default));color:var(--ai-color,var(--color-white));cursor:pointer;display:inline-flex;height:var(--ai-size);justify-content:center;line-height:1;min-height:var(--ai-size);min-width:var(--ai-size);overflow:hidden;padding:0;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:var(--ai-size)}.root[data-loading]{cursor:not-allowed}.root[data-loading] .icon{opacity:0;transform:translateY(100%)}.root:where(:disabled:not([data-loading]),[data-disabled]:not([data-loading])){border:1px solid transparent;cursor:not-allowed}.root:where(:disabled:not([data-loading]),[data-disabled]:not([data-loading])):active{transform:none}.root:where(:disabled:not([data-loading]),[data-disabled]:not([data-loading])){@mixin where-light{background-color:var(--color-gray-1);color:var(--color-gray-5)}}.root:where(:disabled:not([data-loading]),[data-disabled]:not([data-loading])){@mixin where-dark{background-color:var(--color-dark-6);color:var(--color-dark-3)}}.root:hover:where(:not([data-loading],:disabled,[data-disabled])){background-color:var(--ai-hover);color:var(--ai-color)}.loader{align-items:center;border-radius:var(--ai-radius,var(--radius-default));display:flex;justify-content:center;left:calc(50% - var(--loader-size)/2);position:absolute;top:calc(50% - var(--loader-size)/2);@mixin where-light{background-color:hsla(0,0%,100%,.15)}@mixin where-dark{background-color:rgba(0,0,0,.15)}}.icon{align-items:center;display:flex;height:100%;justify-content:center;transition:transform .15s ease,opacity .1s ease;width:100%}.icon-element{height:80%;width:80%}.group{--ai-border-width:1px;display:flex}.group :where(*):focus{position:relative;z-index:1}.group[data-orientation=horizontal]{flex-direction:row}.group[data-orientation=horizontal] .groupSection:not(:only-child):first-child,.group[data-orientation=horizontal] .root:not(:only-child):first-child{border-end-end-radius:0;border-inline-end-width:calc(var(--ai-border-width)/2);border-start-end-radius:0}.group[data-orientation=horizontal] .groupSection:not(:only-child):last-child,.group[data-orientation=horizontal] .root:not(:only-child):last-child{border-end-start-radius:0;border-inline-start-width:calc(var(--ai-border-width)/2);border-start-start-radius:0}.group[data-orientation=horizontal] .groupSection:not(:only-child):not(:first-child):not(:last-child),.group[data-orientation=horizontal] .root:not(:only-child):not(:first-child):not(:last-child){border-inline-width:calc(var(--ai-border-width)/2);border-radius:0}.group[data-orientation=vertical]{flex-direction:column}.group[data-orientation=vertical] .groupSection:not(:only-child):first-child,.group[data-orientation=vertical] .root:not(:only-child):first-child{border-bottom-width:calc(var(--ai-border-width)/2);border-end-end-radius:0;border-end-start-radius:0}.group[data-orientation=vertical] .groupSection:not(:only-child):last-child,.group[data-orientation=vertical] .root:not(:only-child):last-child{border-start-end-radius:0;border-start-start-radius:0;border-top-width:calc(var(--ai-border-width)/2)}.group[data-orientation=vertical] .groupSection:not(:only-child):not(:first-child):not(:last-child),.group[data-orientation=vertical] .root:not(:only-child):not(:first-child):not(:last-child){border-bottom-width:calc(var(--ai-border-width)/2);border-radius:0;border-top-width:calc(var(--ai-border-width)/2)}.section{--section-height-xs:var(--ai-size-xs);--section-height-sm:var(--ai-size-sm);--section-height-md:var(--ai-size-md);--section-height-lg:var(--ai-size-lg);--section-height-xl:var(--ai-size-xl);--section-height-input-xs:var(--ai-size-input-xs);--section-height-input-sm:var(--ai-size-input-sm);--section-height-input-md:var(--ai-size-input-md);--section-height-input-lg:var(--ai-size-input-lg);--section-height-input-xl:var(--ai-size-input-xl);--section-padding-x-xs:rem(6px);--section-padding-x-sm:rem(8px);--section-padding-x-md:rem(10px);--section-padding-x-lg:rem(12px);--section-padding-x-xl:rem(16px);--section-height:var(--section-height-sm);--section-padding-x:var(--section-padding-x-sm);--section-color:var(--color-white);align-items:center;background:var(--section-bg,var(--color-primary-filled));border:var(--section-bd,rem(1px) solid transparent);border-radius:var(--section-radius,var(--mantine-radius-default));color:var(--section-color,var(--color-white));display:inline-flex;font-size:var(--section-fz,var(--mantine-font-size-sm));font-weight:600;height:var(--section-height,var(--section-height-sm));justify-content:center;line-height:1;padding-inline:var(--section-padding-x,var(--section-padding-x-sm));vertical-align:middle;width:auto}
@@ -64,7 +64,7 @@ const _mod = computed(() => [{ loading }, mod]);
64
64
 
65
65
  <span :class='[css.icon, classes?.icon]'>
66
66
  <slot>
67
- <Icon v-if='icon' :name='icon' />
67
+ <Icon v-if='icon' :name='icon' :class='css["icon-element"]' />
68
68
  </slot>
69
69
  </span>
70
70
  </Box>
@@ -14,8 +14,6 @@ const { mod } = defineProps({
14
14
 
15
15
  <style module lang="postcss">
16
16
  .root {
17
- display: grid;
18
-
19
17
  min-height: 100dvh;
20
18
  padding-top: calc(var(--app-shell-header-offset, 0rem) + var(--app-shell-padding));
21
19
  padding-bottom: calc(var(--app-shell-footer-offset, 0rem) + var(--app-shell-padding));
@@ -0,0 +1,39 @@
1
+ import type { NuanceColor, NuanceSpacing } from '@nui/types';
2
+ import type { MaybeRef } from 'vue';
3
+ import type { BoxProps } from './box.vue.js';
4
+ import type { LinkProps } from './link/index.js';
5
+ import type { TextProps } from './text.vue.js';
6
+ export interface BreadcrumbsItem extends Omit<LinkProps, 'mod'> {
7
+ label: string;
8
+ icon?: string;
9
+ class?: string;
10
+ slot?: string;
11
+ }
12
+ export interface BreadcrumbsProps extends BoxProps {
13
+ items?: MaybeRef<BreadcrumbsItem[]>;
14
+ /** Separator icon between items @default `'gravity-ui:chevron-right'` */
15
+ separator?: string;
16
+ /** Controls spacing between separator and breadcrumb @default `'xs'` */
17
+ spacing?: NuanceSpacing;
18
+ color?: NuanceColor;
19
+ size?: TextProps['fz'];
20
+ }
21
+ declare var __VLS_16: string, __VLS_17: {
22
+ item: BreadcrumbsItem;
23
+ ix: number;
24
+ active: any;
25
+ }, __VLS_32: {};
26
+ type __VLS_Slots = {} & {
27
+ [K in NonNullable<typeof __VLS_16>]?: (props: typeof __VLS_17) => any;
28
+ } & {
29
+ separator?: (props: typeof __VLS_32) => any;
30
+ };
31
+ declare const __VLS_base: import("vue").DefineComponent<BreadcrumbsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BreadcrumbsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
33
+ declare const _default: typeof __VLS_export;
34
+ export default _default;
35
+ type __VLS_WithSlots<T, S> = T & {
36
+ new (): {
37
+ $slots: S;
38
+ };
39
+ };
@@ -0,0 +1,113 @@
1
+ <script setup>
2
+ import { getSpacing } from "@nui/utils";
3
+ import { computed, unref } from "vue";
4
+ import Box from "./box.vue";
5
+ import { pickLinkProps } from "./link";
6
+ import Link from "./link/link.vue";
7
+ import Text from "./text.vue";
8
+ const {
9
+ is = "ol",
10
+ mod,
11
+ spacing,
12
+ separator = "gravity-ui:chevron-right",
13
+ color = "primary",
14
+ size
15
+ } = defineProps({
16
+ items: { type: null, required: false },
17
+ separator: { type: String, required: false },
18
+ spacing: { type: [String, Number], required: false },
19
+ color: { type: null, required: false },
20
+ size: { type: null, required: false },
21
+ is: { type: null, required: false },
22
+ mod: { type: [Object, Array, null], required: false }
23
+ });
24
+ const style = computed(() => ({
25
+ "--bc-spacing": getSpacing(spacing)
26
+ }));
27
+ </script>
28
+
29
+ <template>
30
+ <Box :is :mod :style :class='$style.root' aria-label='breadcrumb'>
31
+ <template v-for='(item, ix) in unref(items)' :key='ix'>
32
+ <Text
33
+ is='li'
34
+ :c='color'
35
+ :fz='size'
36
+ :class='$style.breadcrumb'
37
+ role='presentation'
38
+ aria-hidden='true'
39
+ >
40
+ <NuxtLink v-slot='{ isActive }' v-bind='pickLinkProps(item).link' custom>
41
+ <slot :name='item.slot ?? "item"' :item='item' :ix='ix' :active='isActive'>
42
+ <Link v-bind='pickLinkProps(item).link' inherit :class='$style.item' :mod='{ active: isActive }'>
43
+ <Icon v-if='item?.icon' :name='item.icon' :class='$style.icon' />
44
+ <Text is='span' inherit truncate>
45
+ {{ item.label }}
46
+ </Text>
47
+ </Link>
48
+ </slot>
49
+ </NuxtLink>
50
+ </Text>
51
+ <li v-if='ix < unref(items).length - 1' role='presentation' aria-hidden='true' :class='$style.separator'>
52
+ <slot name='separator'>
53
+ <Icon :name='separator' />
54
+ </slot>
55
+ </li>
56
+ </template>
57
+ </Box>
58
+ </template>
59
+
60
+ <style module lang="postcss">
61
+ .root {
62
+ --bc-spacing: var(--spacing-xs);
63
+
64
+ display: flex;
65
+ flex-wrap: wrap;
66
+ gap: var(--bc-spacing);
67
+ align-items: center;
68
+
69
+ list-style: none;
70
+ }
71
+
72
+ .breadcrumb {
73
+ line-height: 1;
74
+
75
+ color: var(--color-text);
76
+ white-space: nowrap;
77
+ -webkit-tap-highlight-color: transparent;
78
+
79
+ }
80
+
81
+ .item {
82
+ display: flex;
83
+ gap: .25rem;
84
+ align-items: center;
85
+
86
+ font-weight: 600;
87
+
88
+ &:where([data-active]) {
89
+ color: var(--text-color);
90
+ }
91
+ }
92
+
93
+ .icon {
94
+ width: 1.2em;
95
+ height: 1.2em;
96
+ }
97
+
98
+ .separator {
99
+ display: flex;
100
+ align-items: center;
101
+ justify-content: center;
102
+
103
+ line-height: 1;
104
+
105
+ @mixin where-light {
106
+ color: var(--color-gray-7);
107
+ }
108
+
109
+ @mixin where-dark {
110
+ color: var(--color-dark-2);
111
+ }
112
+ }
113
+ </style>
@@ -0,0 +1,39 @@
1
+ import type { NuanceColor, NuanceSpacing } from '@nui/types';
2
+ import type { MaybeRef } from 'vue';
3
+ import type { BoxProps } from './box.vue.js';
4
+ import type { LinkProps } from './link/index.js';
5
+ import type { TextProps } from './text.vue.js';
6
+ export interface BreadcrumbsItem extends Omit<LinkProps, 'mod'> {
7
+ label: string;
8
+ icon?: string;
9
+ class?: string;
10
+ slot?: string;
11
+ }
12
+ export interface BreadcrumbsProps extends BoxProps {
13
+ items?: MaybeRef<BreadcrumbsItem[]>;
14
+ /** Separator icon between items @default `'gravity-ui:chevron-right'` */
15
+ separator?: string;
16
+ /** Controls spacing between separator and breadcrumb @default `'xs'` */
17
+ spacing?: NuanceSpacing;
18
+ color?: NuanceColor;
19
+ size?: TextProps['fz'];
20
+ }
21
+ declare var __VLS_16: string, __VLS_17: {
22
+ item: BreadcrumbsItem;
23
+ ix: number;
24
+ active: any;
25
+ }, __VLS_32: {};
26
+ type __VLS_Slots = {} & {
27
+ [K in NonNullable<typeof __VLS_16>]?: (props: typeof __VLS_17) => any;
28
+ } & {
29
+ separator?: (props: typeof __VLS_32) => any;
30
+ };
31
+ declare const __VLS_base: import("vue").DefineComponent<BreadcrumbsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BreadcrumbsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
33
+ declare const _default: typeof __VLS_export;
34
+ export default _default;
35
+ type __VLS_WithSlots<T, S> = T & {
36
+ new (): {
37
+ $slots: S;
38
+ };
39
+ };
@@ -1 +1 @@
1
- .root{--button-height-xs:rem(30px);--button-height-sm:rem(36px);--button-height-md:rem(42px);--button-height-lg:rem(50px);--button-height-xl:rem(60px);--button-height-compact-xs:rem(22px);--button-height-compact-sm:rem(26px);--button-height-compact-md:rem(30px);--button-height-compact-lg:rem(34px);--button-height-compact-xl:rem(40px);--button-padding-x-xs:rem(14px);--button-padding-x-sm:rem(18px);--button-padding-x-md:rem(22px);--button-padding-x-lg:rem(26px);--button-padding-x-xl:rem(32px);--button-padding-x-compact-xs:rem(7px);--button-padding-x-compact-sm:rem(8px);--button-padding-x-compact-md:rem(10px);--button-padding-x-compact-lg:rem(12px);--button-padding-x-compact-xl:rem(14px);--button-height:var(--button-height-sm);--button-padding-x:var(--button-padding-x-sm);--button-color:var(--color-white);--button-fz:var(--font-size-sm);--button-bg:var(--color-primary-filled);--button-radius:var(--radius-default);--button-hover:var(--color-primary-filled-hover);background:var(--button-bg);border:var(--button-bd,rem(1px) solid transparent);border-radius:var(--button-radius);color:var(--button-color,var(--color-white));cursor:pointer;display:inline-block;font-size:var(--button-fz);font-weight:600;height:var(--button-height,var(--button-height-sm));line-height:1;overflow:hidden;padding-inline:var(--button-padding-x,var(--button-padding-x-sm));position:relative;text-align:center;transition:background-color .2s ease-in,color .2s ease-in;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:auto}.root:where([data-with-left-section]){padding-inline-start:calc(var(--button-padding-x)/1.5)}.root:where([data-with-right-section]){padding-inline-end:calc(var(--button-padding-x)/1.5)}.root:where([data-variant=gradient-outline]){background-clip:padding-box,border-box;background-origin:border-box}.root:where(:disabled:not([data-loading])){background:var(--color-disabled);border:1px solid transparent;color:var(--color-disabled);cursor:not-allowed;transform:none}.root:before{border-radius:var(--button-radius,var(--radius-default));content:"";filter:blur(12px);inset:-1px;opacity:0;pointer-events:none;position:absolute;transform:translateY(-100%);transition:transform .15s ease,opacity .1s ease;@mixin where-light{background:var(--color-gray-1);color:var(--color-gray-5)}@mixin where-dark{background:var(--color-dark-6);color:var(--color-dark-3)}}.root:where([data-loading]){cursor:not-allowed;transform:none}.root:where([data-loading]):before{opacity:1;transform:translateY(0)}.root:where([data-loading]) .inner{opacity:0;transform:translateY(100%)}.root{@mixin hover{&:where(:not([data-loading],:disabled)){background:var(--button-hover);color:var(--button-color)}&:where(:not([data-loading],:disabled)):where([data-variant=gradient-outline]){color:#fff}}}.inner{justify-content:center;overflow:visible;transition:transform .15s ease,opacity .1s ease}.inner,.label{align-items:center;display:flex;height:100%}.label{opacity:1;overflow:hidden;white-space:nowrap}.label:where([data-loading]){opacity:.2}.section{--section-pointer-events:none;align-items:center;display:flex;pointer-events:var(--section-pointer-events)}.section:where([data-position=left]){margin-inline-end:var(--spacing-xs)}.section:where([data-position=right]){margin-inline-start:var(--spacing-xs)}.loader{left:calc(50% - var(--loader-size)/2);position:absolute;top:calc(50% - var(--loader-size)/2)}.group{--button-border-width:1px;display:flex}.group :where(.root):focus{position:relative;z-index:1}.group[data-orientation=horizontal]{flex-direction:row}.group[data-orientation=horizontal] .root:not(:only-child):first-child{border-end-end-radius:0;border-inline-end-width:calc(var(--button-border-width)/2);border-start-end-radius:0}.group[data-orientation=horizontal] .root:not(:only-child):last-child{border-end-start-radius:0;border-inline-start-width:calc(var(--button-border-width)/2);border-start-start-radius:0}.group[data-orientation=horizontal] .root:not(:only-child):not(:first-child):not(:last-child){border-inline-width:calc(var(--button-border-width)/2);border-radius:0}.group[data-orientation=vertical]{flex-direction:column}.group[data-orientation=vertical] .root:not(:only-child):first-child{border-bottom-width:calc(var(--button-border-width)/2);border-end-end-radius:0;border-end-start-radius:0}.group[data-orientation=vertical] .root:not(:only-child):last-child{border-start-end-radius:0;border-start-start-radius:0;border-top-width:calc(var(--button-border-width)/2)}.group[data-orientation=vertical] .root:not(:only-child):not(:first-child):not(:last-child){border-bottom-width:calc(var(--button-border-width)/2);border-radius:0;border-top-width:calc(var(--button-border-width)/2)}
1
+ .root{--button-height-xs:rem(30px);--button-height-sm:rem(36px);--button-height-md:rem(42px);--button-height-lg:rem(50px);--button-height-xl:rem(60px);--button-height-compact-xs:rem(22px);--button-height-compact-sm:rem(26px);--button-height-compact-md:rem(30px);--button-height-compact-lg:rem(34px);--button-height-compact-xl:rem(40px);--button-padding-x-xs:rem(14px);--button-padding-x-sm:rem(18px);--button-padding-x-md:rem(22px);--button-padding-x-lg:rem(26px);--button-padding-x-xl:rem(32px);--button-padding-x-compact-xs:rem(7px);--button-padding-x-compact-sm:rem(8px);--button-padding-x-compact-md:rem(10px);--button-padding-x-compact-lg:rem(12px);--button-padding-x-compact-xl:rem(14px);--button-height:var(--button-height-sm);--button-padding-x:var(--button-padding-x-sm);--button-color:var(--color-white);--button-fz:var(--font-size-sm);--button-bg:var(--color-primary-filled);--button-radius:var(--radius-default);--button-hover:var(--color-primary-filled-hover);background:var(--button-bg);border:var(--button-bd,rem(1px) solid transparent);border-radius:var(--button-radius);color:var(--button-color,var(--color-white));cursor:pointer;display:inline-block;font-size:var(--button-fz);font-weight:600;height:var(--button-height,var(--button-height-sm));line-height:1;overflow:hidden;padding-inline:var(--button-padding-x,var(--button-padding-x-sm));position:relative;text-align:center;transition:background-color .2s ease-in,color .2s ease-in;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:auto}.root:where([data-with-left-section]){padding-inline-start:calc(var(--button-padding-x)/1.5)}.root:where([data-with-right-section]){padding-inline-end:calc(var(--button-padding-x)/1.5)}.root:where([data-variant=gradient-outline]){background-clip:padding-box,border-box;background-origin:border-box}.root:where(:disabled:not([data-loading])){background:var(--color-disabled);border:1px solid transparent;color:var(--color-disabled);cursor:not-allowed;transform:none}.root:before{border-radius:var(--button-radius,var(--radius-default));content:"";filter:blur(12px);inset:-1px;opacity:0;pointer-events:none;position:absolute;transform:translateY(-100%);transition:transform .15s ease,opacity .1s ease;@mixin where-light{background:var(--color-gray-1);color:var(--color-gray-5)}@mixin where-dark{background:var(--color-dark-6);color:var(--color-dark-3)}}.root:where([data-loading]){cursor:not-allowed;transform:none}.root:where([data-loading]):before{opacity:1;transform:translateY(0)}.root:where([data-loading]) .inner{opacity:0;transform:translateY(100%)}.root:hover:where(:not([data-loading],:disabled)){background:var(--button-hover);color:var(--button-color)}.root:hover:where(:not([data-loading],:disabled)):where([data-variant=gradient-outline]){color:#fff}.inner{justify-content:center;overflow:visible;transition:transform .15s ease,opacity .1s ease}.inner,.label{align-items:center;display:flex;height:100%}.label{opacity:1;overflow:hidden;white-space:nowrap}.label:where([data-loading]){opacity:.2}.section{--section-pointer-events:none;align-items:center;display:flex;pointer-events:var(--section-pointer-events)}.section:where([data-position=left]){margin-inline-end:var(--spacing-xs)}.section:where([data-position=right]){margin-inline-start:var(--spacing-xs)}.loader{left:calc(50% - var(--loader-size)/2);position:absolute;top:calc(50% - var(--loader-size)/2)}.group{--button-border-width:1px;display:flex}.group :where(.root):focus{position:relative;z-index:1}.group[data-orientation=horizontal]{flex-direction:row}.group[data-orientation=horizontal] .root:not(:only-child):first-child{border-end-end-radius:0;border-inline-end-width:calc(var(--button-border-width)/2);border-start-end-radius:0}.group[data-orientation=horizontal] .root:not(:only-child):last-child{border-end-start-radius:0;border-inline-start-width:calc(var(--button-border-width)/2);border-start-start-radius:0}.group[data-orientation=horizontal] .root:not(:only-child):not(:first-child):not(:last-child){border-inline-width:calc(var(--button-border-width)/2);border-radius:0}.group[data-orientation=vertical]{flex-direction:column}.group[data-orientation=vertical] .root:not(:only-child):first-child{border-bottom-width:calc(var(--button-border-width)/2);border-end-end-radius:0;border-end-start-radius:0}.group[data-orientation=vertical] .root:not(:only-child):last-child{border-start-end-radius:0;border-start-start-radius:0;border-top-width:calc(var(--button-border-width)/2)}.group[data-orientation=vertical] .root:not(:only-child):not(:first-child):not(:last-child){border-bottom-width:calc(var(--button-border-width)/2);border-radius:0;border-top-width:calc(var(--button-border-width)/2)}
@@ -3,6 +3,7 @@ export * from './app-shell/index.js';
3
3
  export * from './avatar/index.js';
4
4
  export * from './background-image.vue.js';
5
5
  export * from './box.vue.js';
6
+ export type { BreadcrumbsItem, BreadcrumbsProps } from './breadcrumbs.vue.js';
6
7
  export * from './button/index.js';
7
8
  export * from './card/index.js';
8
9
  export * from './checkbox/index.js';
@@ -1,3 +1,3 @@
1
- export { extractNuxtLinkProps } from './lib.js';
1
+ export { pickLinkProps } from './lib.js';
2
2
  export type * from './link-button.vue';
3
3
  export type * from './link.vue';
@@ -1 +1 @@
1
- export { extractNuxtLinkProps } from "./lib.js";
1
+ export { pickLinkProps } from "./lib.js";
@@ -1,16 +1,16 @@
1
1
  import type { NuxtLinkProps } from '#app';
2
- export declare function extractNuxtLinkProps<T extends NuxtLinkProps>(props: T): {
2
+ export declare function pickLinkProps<T extends NuxtLinkProps>(props: T): {
3
3
  link: {
4
4
  prefetch: NonNullable<import("vue").UnwrapRef<T["prefetch"]>> | undefined;
5
5
  noPrefetch: NonNullable<import("vue").UnwrapRef<T["noPrefetch"]>> | undefined;
6
6
  to?: import("vue").UnwrapRef<T["to"]> | undefined;
7
7
  target?: import("vue").UnwrapRef<T["target"]> | undefined;
8
- replace?: import("vue").UnwrapRef<T["replace"]> | undefined;
9
8
  external?: import("vue").UnwrapRef<T["external"]> | undefined;
10
9
  rel?: import("vue").UnwrapRef<T["rel"]> | undefined;
11
10
  noRel?: import("vue").UnwrapRef<T["noRel"]> | undefined;
11
+ replace?: import("vue").UnwrapRef<T["replace"]> | undefined;
12
12
  prefetchOn?: import("vue").UnwrapRef<T["prefetchOn"]> | undefined;
13
13
  trailingSlash?: import("vue").UnwrapRef<T["trailingSlash"]> | undefined;
14
14
  };
15
- rest: Omit<T, Extract<"to", keyof T> | Extract<"target", keyof T> | Extract<"replace", keyof T> | Extract<"external", keyof T> | Extract<"rel", keyof T> | Extract<"noRel", keyof T> | Extract<"prefetch", keyof T> | Extract<"noPrefetch", keyof T> | Extract<"prefetchOn", keyof T> | Extract<"trailingSlash", keyof T>>;
15
+ rest: Omit<T, Extract<"to", keyof T> | Extract<"target", keyof T> | Extract<"external", keyof T> | Extract<"rel", keyof T> | Extract<"noRel", keyof T> | Extract<"prefetch", keyof T> | Extract<"noPrefetch", keyof T> | Extract<"replace", keyof T> | Extract<"prefetchOn", keyof T> | Extract<"trailingSlash", keyof T>>;
16
16
  };
@@ -11,7 +11,7 @@ const linkProps = [
11
11
  "prefetchOn",
12
12
  "trailingSlash"
13
13
  ];
14
- export function extractNuxtLinkProps(props) {
14
+ export function pickLinkProps(props) {
15
15
  const link = reactivePick(props, ...linkProps);
16
16
  const rest = reactiveOmit(props, ...linkProps);
17
17
  return {
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import Button from "../button/button.vue";
3
- import { extractNuxtLinkProps } from "./lib";
3
+ import { pickLinkProps } from "./lib";
4
4
  const props = defineProps({
5
5
  to: { type: null, required: false },
6
6
  external: { type: Boolean, required: false },
@@ -31,27 +31,28 @@ const props = defineProps({
31
31
  is: { type: null, required: false },
32
32
  mod: { type: [Object, Array, null], required: false }
33
33
  });
34
- const { link, rest } = extractNuxtLinkProps(props);
34
+ const { link, rest } = pickLinkProps(props);
35
35
  </script>
36
36
 
37
37
  <template>
38
- <!-- @vue-ignore -->
39
- <NuxtLink
40
- v-slot='{ href, navigate, rel, target }'
41
- v-bind='link'
42
- custom
43
- >
38
+ <NuxtLink v-slot='{ href, navigate, ...linkProps }' v-bind='link' custom>
44
39
  <Button
45
- v-bind='{ ...rest, is: rest?.is || "a", href, rel, target }'
46
- @click='(e) => navigate(e)'
40
+ v-bind='{
41
+ ...rest,
42
+ is: rest?.is || "a",
43
+ href,
44
+ rel: "rel" in linkProps ? linkProps.rel : void 0,
45
+ target: "target" in linkProps ? linkProps.target : void 0
46
+ }'
47
+ @click='navigate'
47
48
  >
48
- <template #leftSection>
49
+ <template v-if='$slots.leftSection' #leftSection>
49
50
  <slot name='leftSection' />
50
51
  </template>
51
52
 
52
53
  <slot />
53
54
 
54
- <template #rightSection>
55
+ <template v-if='$slots.rightSection' #rightSection>
55
56
  <slot name='rightSection' />
56
57
  </template>
57
58
  </Button>
@@ -1,7 +1,8 @@
1
1
  <script setup>
2
2
  import { NuxtLink } from "#components";
3
3
  import Text from "../text.vue";
4
- import { extractNuxtLinkProps } from "./lib";
4
+ import { pickLinkProps } from "./lib";
5
+ defineOptions({ inheritAttrs: false });
5
6
  const props = defineProps({
6
7
  underline: { type: Boolean, required: false },
7
8
  to: { type: null, required: false },
@@ -32,26 +33,22 @@ const props = defineProps({
32
33
  c: { type: null, required: false },
33
34
  mod: { type: [Object, Array, null], required: false }
34
35
  });
35
- const { link, rest } = extractNuxtLinkProps(props);
36
+ const { link, rest: { underline, ...rest } } = pickLinkProps(props);
36
37
  </script>
37
38
 
38
39
  <template>
39
- <!-- @vue-ignore -->
40
- <NuxtLink
41
- v-slot='{ href, navigate, rel, target }'
42
- v-bind='link'
43
- custom
44
- >
40
+ <NuxtLink v-slot='{ href, navigate, ...linkProps }' v-bind='link' custom>
45
41
  <Text
46
42
  is='a'
47
- :class='[$style.root, { [$style.underline]: rest.underline }]'
43
+ :class='[$style.root, { [$style.underline]: underline }]'
48
44
  v-bind='{
49
45
  ...rest,
46
+ ...$attrs,
50
47
  href,
51
- rel,
52
- target
48
+ rel: "rel" in linkProps ? linkProps.rel : void 0,
49
+ target: "target" in linkProps ? linkProps.target : void 0
53
50
  }'
54
- @click='(e) => navigate(e)'
51
+ @click='navigate'
55
52
  >
56
53
  <slot />
57
54
  </Text>
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
- import { useActiveLink, useStyleResolver } from "@nui/composals";
2
+ import { useStyleResolver } from "@nui/composals";
3
3
  import { createVariantColorResolver } from "@nui/utils";
4
4
  import { computed } from "vue";
5
5
  import Box from "../box.vue";
6
6
  import UnstyledButton from "../button/unstyled-button.vue";
7
- import { extractNuxtLinkProps } from "../link";
7
+ import { pickLinkProps } from "../link";
8
8
  const props = defineProps({
9
9
  description: { type: String, required: false },
10
10
  active: { type: Boolean, required: false },
@@ -34,47 +34,37 @@ const {
34
34
  link,
35
35
  rest: {
36
36
  disabled,
37
- mod: _mod,
37
+ mod,
38
38
  variant = "filled",
39
39
  color,
40
40
  noWrap,
41
41
  description
42
42
  }
43
- } = extractNuxtLinkProps(props);
44
- const active = useActiveLink(link?.to);
45
- const mod = computed(() => [{ active: active.value, disabled }, _mod]);
46
- const style = useStyleResolver((theme) => {
43
+ } = pickLinkProps(props);
44
+ const style = computed(() => useStyleResolver((theme) => {
47
45
  const { background, hover, text } = createVariantColorResolver({ variant, color, theme });
48
46
  return {
49
- root: {
50
- "--nl-bg": variant ? background : void 0,
51
- "--nl-hover": variant ? hover : void 0,
52
- "--nl-color": variant ? text : void 0
53
- }
47
+ "--nl-bg": variant ? background : void 0,
48
+ "--nl-hover": variant ? hover : void 0,
49
+ "--nl-color": variant ? text : void 0
54
50
  };
55
- });
51
+ }));
56
52
  </script>
57
53
 
58
54
  <template>
59
- <!-- @vue-ignore -->
60
- <NuxtLink
61
- v-slot='{ href, navigate }'
62
- v-bind='link'
63
- custom
64
- >
55
+ <NuxtLink v-slot='{ href, navigate, isActive, ...linkProps }' v-bind='link' custom>
65
56
  <UnstyledButton
66
57
  is='a'
67
- :class='$style.root'
68
- :style='style.root'
69
- :mod
70
58
  :href
71
- @click='(e) => navigate(e)'
59
+ :style
60
+ :class='$style.root'
61
+ :mod='[{ active: isActive, disabled }, mod]'
62
+ :aria-current="isActive ? 'page' : void 0"
63
+ :rel='"rel" in linkProps ? linkProps?.rel : void 0'
64
+ :target='"target" in linkProps ? linkProps?.target : void 0'
65
+ @click='navigate'
72
66
  >
73
- <span
74
- v-if='$slots.leftSection'
75
- :class='$style.section'
76
- data-position='left'
77
- >
67
+ <span v-if='$slots.leftSection' :class='$style.section' data-position='left'>
78
68
  <slot name='leftSection' />
79
69
  </span>
80
70
 
@@ -89,11 +79,7 @@ const style = useStyleResolver((theme) => {
89
79
  </Box>
90
80
  </Box>
91
81
 
92
- <span
93
- v-if='$slots.rightSection'
94
- :class='$style.section'
95
- data-position='right'
96
- >
82
+ <span v-if='$slots.rightSection' :class='$style.section' data-position='right'>
97
83
  <slot name='rightSection' />
98
84
  </span>
99
85
  </UnstyledButton>
@@ -131,7 +117,7 @@ const style = useStyleResolver((theme) => {
131
117
  }
132
118
  }
133
119
 
134
- &:where([data-active], [aria-current='page']) {
120
+ &:where([data-active]) {
135
121
  color: var(--nl-color);
136
122
 
137
123
  background-color: var(--nl-bg);
@@ -141,7 +127,7 @@ const style = useStyleResolver((theme) => {
141
127
  --description-color: var(--nl-color);
142
128
  }
143
129
 
144
- @mixin hover {
130
+ &:hover {
145
131
  background-color: var(--nl-hover);
146
132
  }
147
133
  }
@@ -20,7 +20,7 @@ export declare const useProvideRovingFocus: (args_0: State) => {
20
20
  attr: string;
21
21
  list: Readonly<ShallowRef<HTMLElement | null>>;
22
22
  loop: boolean | undefined;
23
- orientation: "both" | "horizontal" | "vertical" | undefined;
23
+ orientation: "horizontal" | "vertical" | "both" | undefined;
24
24
  init: () => number;
25
25
  focus: {
26
26
  (dir: "first" | "last"): void;
@@ -38,7 +38,7 @@ export declare const useRovingFocus: () => {
38
38
  attr: string;
39
39
  list: Readonly<ShallowRef<HTMLElement | null>>;
40
40
  loop: boolean | undefined;
41
- orientation: "both" | "horizontal" | "vertical" | undefined;
41
+ orientation: "horizontal" | "vertical" | "both" | undefined;
42
42
  init: () => number;
43
43
  focus: {
44
44
  (dir: "first" | "last"): void;
@@ -10,13 +10,13 @@ const {
10
10
  inline,
11
11
  inherit,
12
12
  mod,
13
- variant = "text",
13
+ variant,
14
14
  gradient,
15
15
  fz,
16
16
  fw,
17
17
  lh,
18
18
  c,
19
- size = "sm",
19
+ size,
20
20
  ...rest
21
21
  } = defineProps({
22
22
  size: { type: null, required: false },
@@ -33,16 +33,13 @@ const {
33
33
  is: { type: null, required: false },
34
34
  mod: { type: [Object, Array, null], required: false }
35
35
  });
36
- const _mod = computed(() => [
37
- {
38
- truncate,
39
- "line-clamp": lineClamp,
40
- inline,
41
- inherit,
42
- variant
43
- },
44
- mod
45
- ]);
36
+ const _mod = computed(() => [{
37
+ truncate,
38
+ "line-clamp": lineClamp,
39
+ inline,
40
+ inherit,
41
+ variant
42
+ }, mod]);
46
43
  const style = computed(() => useStyleResolver((theme) => ({
47
44
  "--text-fz": getFontSize(fz || size),
48
45
  "--text-fw": fw,
@@ -61,10 +58,12 @@ const style = computed(() => useStyleResolver((theme) => ({
61
58
 
62
59
  <style module lang="postcss">
63
60
  .root {
64
- --text-fz: var(--font-size-md);
65
- --text-lh: var(--line-height-md);
61
+ --text-fz: var(--font-size-sm);
62
+ --text-lh: var(--line-height-sm);
66
63
  --text-color: inherit;
67
64
  --text-fw: normal;
65
+ --text-gradient: none;
66
+ --text-line-clamp: none;
68
67
 
69
68
  margin: 0;
70
69
  padding: 0;
@@ -115,6 +114,7 @@ const style = computed(() => useStyleResolver((theme) => ({
115
114
  font-size: inherit;
116
115
  font-weight: inherit;
117
116
  line-height: inherit;
117
+ color: inherit;
118
118
  }
119
119
 
120
120
  &:where([data-inline]) {
@@ -12,8 +12,8 @@ export type NuanceSpacing = keyof NuanceSpacingValues | number;
12
12
  export type NuanceShadow = keyof NuanceShadowsValues;
13
13
  export type NuanceLineHeight = keyof NuanceLineHeightValues;
14
14
  export type NuanceColorShade = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
15
- type ShadedColor = `dark.${NuanceColorShade}` | `slate.${NuanceColorShade}` | `gray.${NuanceColorShade}` | `red.${NuanceColorShade}` | `pink.${NuanceColorShade}` | `grape.${NuanceColorShade}` | `violet.${NuanceColorShade}` | `indigo.${NuanceColorShade}` | `blue.${NuanceColorShade}` | `cyan.${NuanceColorShade}` | `green.${NuanceColorShade}` | `lime.${NuanceColorShade}` | `yellow.${NuanceColorShade}` | `orange.${NuanceColorShade}` | `teal.${NuanceColorShade}`;
16
- export type NuanceDefaultThemeColor = 'dark' | 'slate' | 'gray' | 'red' | 'pink' | 'grape' | 'violet' | 'indigo' | 'blue' | 'cyan' | 'green' | 'lime' | 'yellow' | 'orange' | 'teal' | 'black' | 'white';
15
+ type ShadedColor = `dark.${NuanceColorShade}` | `slate.${NuanceColorShade}` | `gray.${NuanceColorShade}` | `red.${NuanceColorShade}` | `pink.${NuanceColorShade}` | `grape.${NuanceColorShade}` | `violet.${NuanceColorShade}` | `indigo.${NuanceColorShade}` | `blue.${NuanceColorShade}` | `cyan.${NuanceColorShade}` | `green.${NuanceColorShade}` | `lime.${NuanceColorShade}` | `yellow.${NuanceColorShade}` | `orange.${NuanceColorShade}` | `teal.${NuanceColorShade}` | `primary.${NuanceColorShade}`;
16
+ export type NuanceDefaultThemeColor = 'dark' | 'slate' | 'gray' | 'red' | 'pink' | 'grape' | 'violet' | 'indigo' | 'blue' | 'cyan' | 'green' | 'lime' | 'yellow' | 'orange' | 'teal' | 'black' | 'white' | 'primary';
17
17
  export type NuanceColor = NuanceDefaultThemeColor | ShadedColor;
18
18
  export type NuanceTheme = 'light' | 'dark';
19
19
  export interface NuanceGradient {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuance-ui",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "A UI Library for Modern Web Apps, powered by Vue.",
5
5
  "repository": {
6
6
  "type": "git",