nuance-ui 0.2.33 → 0.2.35

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.
Files changed (38) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +1 -2
  4. package/dist/runtime/components/alert.d.vue.ts +5 -3
  5. package/dist/runtime/components/alert.vue +6 -3
  6. package/dist/runtime/components/alert.vue.d.ts +5 -3
  7. package/dist/runtime/components/dialog/ui/dialog-title.vue +1 -0
  8. package/dist/runtime/components/divider.d.vue.ts +40 -0
  9. package/dist/runtime/components/divider.vue +49 -0
  10. package/dist/runtime/components/divider.vue.d.ts +40 -0
  11. package/dist/runtime/components/drawer/drawer-title.vue +1 -0
  12. package/dist/runtime/components/index.d.ts +1 -0
  13. package/dist/runtime/components/link/link.vue +1 -0
  14. package/dist/runtime/components/modal/modal-title.vue +1 -0
  15. package/dist/runtime/components/text.d.vue.ts +2 -0
  16. package/dist/runtime/components/text.vue +4 -1
  17. package/dist/runtime/components/text.vue.d.ts +2 -0
  18. package/dist/runtime/components/timeline.d.vue.ts +3 -1
  19. package/dist/runtime/components/timeline.vue +6 -3
  20. package/dist/runtime/components/timeline.vue.d.ts +3 -1
  21. package/dist/runtime/components/title.vue +3 -0
  22. package/dist/runtime/utils/color/get-gradient.js +1 -1
  23. package/dist/runtime/utils/color/index.d.ts +0 -1
  24. package/dist/runtime/utils/color/index.js +0 -1
  25. package/dist/runtime/utils/const/icons.js +33 -0
  26. package/dist/runtime/utils/const/index.d.ts +2 -0
  27. package/dist/runtime/utils/const/index.js +2 -0
  28. package/dist/runtime/utils/index.d.ts +1 -1
  29. package/dist/runtime/utils/index.js +1 -1
  30. package/dist/runtime/utils/style/create-variant-color-resolver.d.ts +1 -1
  31. package/dist/runtime/utils/style/create-variant-color-resolver.js +17 -1
  32. package/package.json +3 -2
  33. package/dist/runtime/utils/icons/default-icons.js +0 -33
  34. package/dist/runtime/utils/icons/index.d.ts +0 -1
  35. package/dist/runtime/utils/icons/index.js +0 -1
  36. /package/dist/runtime/utils/{color/const.d.ts → const/gradient.d.ts} +0 -0
  37. /package/dist/runtime/utils/{color/const.js → const/gradient.js} +0 -0
  38. /package/dist/runtime/utils/{icons/default-icons.d.ts → const/icons.d.ts} +0 -0
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 NuxtLabs
3
+ Copyright (c) 2026 Igor Iugin
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^4.0.0"
6
6
  },
7
- "version": "0.2.33",
7
+ "version": "0.2.35",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,7 +1,6 @@
1
1
  import { defineNuxtModule, createResolver, addTypeTemplate, addComponentsDir, addImportsDir, addTemplate } from '@nuxt/kit';
2
2
  import { defu } from 'defu';
3
- import { DEFAULT_GRADIENT } from '../dist/runtime/utils/color/const.js';
4
- import { DEFAULT_ICONS } from '../dist/runtime/utils/icons/default-icons.js';
3
+ import { DEFAULT_ICONS, DEFAULT_GRADIENT } from '../dist/runtime/utils/index.js';
5
4
 
6
5
  const SHADES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
7
6
  function fromName(name) {
@@ -1,9 +1,9 @@
1
- import type { Classes, NuanceColor, NuanceRadius } from '@nui/types';
1
+ import type { Classes, NuanceColor, NuanceRadius, NuanceSize } from '@nui/types';
2
2
  import type { BoxProps } from './box.vue.js';
3
3
  export type AlertClasses = 'root' | 'icon' | 'body' | 'title' | 'label' | 'message' | 'closeButton';
4
- export type AlertVariant = 'filled' | 'light' | 'outline' | 'default';
4
+ export type AlertVariant = 'filled' | 'light' | 'outline' | 'light-outline' | 'default';
5
5
  export interface AlertVars {
6
- root: '--alert-radius' | '--alert-bg' | '--alert-color' | '--alert-bd';
6
+ root: '--alert-radius' | '--alert-bg' | '--alert-color' | '--alert-bd' | '--alert-font-size';
7
7
  }
8
8
  export interface AlertProps extends BoxProps {
9
9
  /** Border radius */
@@ -20,6 +20,8 @@ export interface AlertProps extends BoxProps {
20
20
  onClose?: () => void;
21
21
  /** `aria-label` for the close button */
22
22
  closeButtonLabel?: string;
23
+ /** Component size */
24
+ size?: NuanceSize;
23
25
  /** Visual variant */
24
26
  variant?: AlertVariant;
25
27
  /** Styles API */
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { useConfig, useVarsResolver } from "@nui/composables";
3
- import { getRadius } from "@nui/utils";
3
+ import { getFontSize, getRadius } from "@nui/utils";
4
4
  import { useId } from "vue";
5
5
  import ActionIcon from "./action-icon/action-icon.vue";
6
6
  import Box from "./box.vue";
@@ -10,6 +10,7 @@ const {
10
10
  color,
11
11
  title,
12
12
  radius,
13
+ size = "md",
13
14
  variant = "light",
14
15
  withCloseButton,
15
16
  classes
@@ -21,6 +22,7 @@ const {
21
22
  withCloseButton: { type: Boolean, required: false },
22
23
  onClose: { type: Function, required: false },
23
24
  closeButtonLabel: { type: String, required: false },
25
+ size: { type: String, required: false },
24
26
  variant: { type: String, required: false },
25
27
  classes: { type: Object, required: false },
26
28
  is: { type: null, required: false },
@@ -36,7 +38,8 @@ const style = useVarsResolver((theme) => {
36
38
  "--alert-radius": radius === void 0 ? void 0 : getRadius(radius),
37
39
  "--alert-bg": color || variant ? background : void 0,
38
40
  "--alert-color": text,
39
- "--alert-bd": color || variant ? border : void 0
41
+ "--alert-bd": color || variant ? border : void 0,
42
+ "--alert-font-size": getFontSize(size)
40
43
  }
41
44
  };
42
45
  });
@@ -89,5 +92,5 @@ const style = useVarsResolver((theme) => {
89
92
  </template>
90
93
 
91
94
  <style module>
92
- .root{--alert-radius:var(--radius-default);--alert-bg:var(--color-primary-light);--alert-bd:1px solid transparent;--alert-color:var(--color-primary-light-color);background-color:var(--alert-bg);border:var(--alert-bd);border-radius:var(--alert-radius);color:var(--alert-color);gap:var(--spacing-sm);overflow:hidden;padding:var(--spacing-sm);position:relative}.body,.root{display:flex}.body{flex:1;flex-direction:column;gap:var(--spacing-xs)}.title{align-items:center;display:flex;font-size:var(--font-size-md);font-weight:700;justify-content:space-between}.label{display:block;overflow:hidden;text-overflow:ellipsis}.icon{align-items:center;display:flex;height:1.25rem;justify-content:flex-start;line-height:1;margin-top:1px;width:1.25rem}.message{font-size:var(--font-size-md);overflow:hidden;text-overflow:ellipsis}:where([data-mantine-color-scheme=light]) .message{color:var(--color-black)}:where([data-mantine-color-scheme=dark]) .message{color:var(--color-white)}.message:where([data-variant=filled]){color:var(--alert-color)}.message:where([data-variant=white]){color:var(--color-black)}.closeButton{color:var(--alert-color);height:20px;width:20px}
95
+ .root{--alert-radius:var(--radius-default);--alert-bg:var(--color-primary-light);--alert-bd:1px solid transparent;--alert-color:var(--color-primary-light-color);background-color:var(--alert-bg);border:var(--alert-bd);border-radius:var(--alert-radius);color:var(--alert-color);gap:var(--spacing-xs);overflow:hidden;padding:var(--spacing-sm);position:relative}.body,.root{display:flex}.body{flex:1;flex-direction:column}.title{align-items:center;display:flex;font-size:var(--alert-font-size,var(--font-size-md));font-weight:700;justify-content:space-between}.label{display:block;overflow:hidden;text-overflow:ellipsis}.icon{align-items:center;display:flex;font-size:var(--alert-font-size);height:calc(var(--alert-font-size)*1.3);justify-content:flex-start;line-height:1;margin-top:1px;width:calc(var(--alert-font-size)*1.3)}.message{font-size:var(--alert-font-size,var(--font-size-md));overflow:hidden;text-overflow:ellipsis}:where([data-mantine-color-scheme=light]) .message{color:var(--color-black)}:where([data-mantine-color-scheme=dark]) .message{color:var(--color-white)}.message:where([data-variant=filled]){color:var(--alert-color)}.message:where([data-variant=white]){color:var(--color-black)}.closeButton{color:var(--alert-color);height:20px;width:20px}
93
96
  </style>
@@ -1,9 +1,9 @@
1
- import type { Classes, NuanceColor, NuanceRadius } from '@nui/types';
1
+ import type { Classes, NuanceColor, NuanceRadius, NuanceSize } from '@nui/types';
2
2
  import type { BoxProps } from './box.vue.js';
3
3
  export type AlertClasses = 'root' | 'icon' | 'body' | 'title' | 'label' | 'message' | 'closeButton';
4
- export type AlertVariant = 'filled' | 'light' | 'outline' | 'default';
4
+ export type AlertVariant = 'filled' | 'light' | 'outline' | 'light-outline' | 'default';
5
5
  export interface AlertVars {
6
- root: '--alert-radius' | '--alert-bg' | '--alert-color' | '--alert-bd';
6
+ root: '--alert-radius' | '--alert-bg' | '--alert-color' | '--alert-bd' | '--alert-font-size';
7
7
  }
8
8
  export interface AlertProps extends BoxProps {
9
9
  /** Border radius */
@@ -20,6 +20,8 @@ export interface AlertProps extends BoxProps {
20
20
  onClose?: () => void;
21
21
  /** `aria-label` for the close button */
22
22
  closeButtonLabel?: string;
23
+ /** Component size */
24
+ size?: NuanceSize;
23
25
  /** Visual variant */
24
26
  variant?: AlertVariant;
25
27
  /** Styles API */
@@ -11,6 +11,7 @@ const { size = "md", lh = "1", ...props } = defineProps({
11
11
  inherit: { type: Boolean, required: false },
12
12
  gradient: { type: Object, required: false },
13
13
  fz: { type: null, required: false },
14
+ ff: { type: [String, Object], required: false },
14
15
  lh: { type: [String, Object], required: false },
15
16
  fw: { type: void 0, required: false },
16
17
  c: { type: null, required: false },
@@ -0,0 +1,40 @@
1
+ import type { AnyString, NuanceColor, NuanceSize } from '@nui/types';
2
+ import type { BoxProps } from './box.vue.js';
3
+ export type DividerVariant = 'solid' | 'dashed' | 'dotted';
4
+ export interface DividerVars {
5
+ root: '--divider-color' | '--divider-border-style' | '--divider-size';
6
+ }
7
+ export interface DividerProps extends BoxProps {
8
+ /** Color from theme */
9
+ color?: NuanceColor | AnyString;
10
+ /**
11
+ * Controls width/height depending on orientation
12
+ * @default `'xs'`
13
+ */
14
+ size?: NuanceSize | AnyString;
15
+ /**
16
+ * Label position
17
+ * @default `'center'`
18
+ */
19
+ labelPosition?: 'left' | 'center' | 'right';
20
+ /**
21
+ * Divider orientation
22
+ * @default `'horizontal'`
23
+ */
24
+ orientation?: 'horizontal' | 'vertical';
25
+ /** Visual variant */
26
+ variant?: DividerVariant;
27
+ }
28
+ declare var __VLS_14: {};
29
+ type __VLS_Slots = {} & {
30
+ default?: (props: typeof __VLS_14) => any;
31
+ };
32
+ declare const __VLS_base: import("vue").DefineComponent<DividerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DividerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
34
+ declare const _default: typeof __VLS_export;
35
+ export default _default;
36
+ type __VLS_WithSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -0,0 +1,49 @@
1
+ <script setup>
2
+ import { useVarsResolver } from "@nui/composables";
3
+ import { getSize, getThemeColor } from "@nui/utils";
4
+ import Box from "./box.vue";
5
+ const {
6
+ color,
7
+ size,
8
+ labelPosition = "center",
9
+ orientation = "horizontal",
10
+ variant
11
+ } = defineProps({
12
+ color: { type: null, required: false },
13
+ size: { type: [String, Object], required: false },
14
+ labelPosition: { type: String, required: false },
15
+ orientation: { type: String, required: false },
16
+ variant: { type: String, required: false },
17
+ is: { type: null, required: false },
18
+ mod: { type: [Object, Array, null], required: false }
19
+ });
20
+ const style = useVarsResolver((theme) => ({
21
+ root: {
22
+ "--divider-color": color ? getThemeColor(color, theme) : void 0,
23
+ "--divider-border-style": variant,
24
+ "--divider-size": getSize(size, "divider-size")
25
+ }
26
+ }));
27
+ </script>
28
+
29
+ <template>
30
+ <Box
31
+ role='separator'
32
+ :style='style.root'
33
+ :class='$style.root'
34
+ :mod="[{ orientation, 'with-label': !!$slots.default }, mod]"
35
+ >
36
+ <Box
37
+ is='span'
38
+ v-if='$slots.default'
39
+ :class='$style.label'
40
+ :mod='{ position: labelPosition }'
41
+ >
42
+ <slot />
43
+ </Box>
44
+ </Box>
45
+ </template>
46
+
47
+ <style module>
48
+ .root{--divider-size-xs:1px;--divider-size-sm:2px;--divider-size-md:3px;--divider-size-lg:4px;--divider-size-xl:5px;--divider-size:var(--divider-size-xs);@mixin where-light{--divider-color:var(--color-gray-3)}@mixin where-dark{--divider-color:var(--color-dark-4)}}.root:where([data-orientation=horizontal]){border-top:var(--divider-size) var(--divider-border-style,solid) var(--divider-color)}.root:where([data-orientation=vertical]){align-self:stretch;border-inline-start:var(--divider-size) var(--divider-border-style,solid) var(--divider-color);height:auto}.root:where([data-with-label]){border:0}.label{align-items:center;color:var(--color-dimmed);display:flex;font-size:var(--font-size-xs);white-space:nowrap}.label:where([data-position=left]):before{display:none}.label:where([data-position=right]):after{display:none}.label:before{margin-inline-end:var(--spacing-xs)}.label:after,.label:before{border-top:var(--divider-size) var(--divider-border-style,solid) var(--divider-color);content:"";flex:1;height:1px}.label:after{margin-inline-start:var(--spacing-xs)}
49
+ </style>
@@ -0,0 +1,40 @@
1
+ import type { AnyString, NuanceColor, NuanceSize } from '@nui/types';
2
+ import type { BoxProps } from './box.vue.js';
3
+ export type DividerVariant = 'solid' | 'dashed' | 'dotted';
4
+ export interface DividerVars {
5
+ root: '--divider-color' | '--divider-border-style' | '--divider-size';
6
+ }
7
+ export interface DividerProps extends BoxProps {
8
+ /** Color from theme */
9
+ color?: NuanceColor | AnyString;
10
+ /**
11
+ * Controls width/height depending on orientation
12
+ * @default `'xs'`
13
+ */
14
+ size?: NuanceSize | AnyString;
15
+ /**
16
+ * Label position
17
+ * @default `'center'`
18
+ */
19
+ labelPosition?: 'left' | 'center' | 'right';
20
+ /**
21
+ * Divider orientation
22
+ * @default `'horizontal'`
23
+ */
24
+ orientation?: 'horizontal' | 'vertical';
25
+ /** Visual variant */
26
+ variant?: DividerVariant;
27
+ }
28
+ declare var __VLS_14: {};
29
+ type __VLS_Slots = {} & {
30
+ default?: (props: typeof __VLS_14) => any;
31
+ };
32
+ declare const __VLS_base: import("vue").DefineComponent<DividerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DividerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
34
+ declare const _default: typeof __VLS_export;
35
+ export default _default;
36
+ type __VLS_WithSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -10,6 +10,7 @@ const props = defineProps({
10
10
  inherit: { type: Boolean, required: false },
11
11
  gradient: { type: Object, required: false },
12
12
  fz: { type: null, required: false },
13
+ ff: { type: [String, Object], required: false },
13
14
  lh: { type: [String, Object], required: false },
14
15
  fw: { type: void 0, required: false },
15
16
  c: { type: null, required: false },
@@ -14,6 +14,7 @@ export * from './combobox/index.js';
14
14
  export type * from './container.vue';
15
15
  export type * from './date-time-picker.vue';
16
16
  export * from './dialog/index.js';
17
+ export type * from './divider.vue';
17
18
  export * from './drawer/index.js';
18
19
  export * from './files/index.js';
19
20
  export type * from './floating-indicator.vue';
@@ -27,6 +27,7 @@ const props = defineProps({
27
27
  inherit: { type: Boolean, required: false },
28
28
  gradient: { type: Object, required: false },
29
29
  fz: { type: null, required: false },
30
+ ff: { type: [String, Object], required: false },
30
31
  lh: { type: [String, Object], required: false },
31
32
  fw: { type: void 0, required: false },
32
33
  c: { type: null, required: false },
@@ -10,6 +10,7 @@ const props = defineProps({
10
10
  inherit: { type: Boolean, required: false },
11
11
  gradient: { type: Object, required: false },
12
12
  fz: { type: null, required: false },
13
+ ff: { type: [String, Object], required: false },
13
14
  lh: { type: [String, Object], required: false },
14
15
  fw: { type: void 0, required: false },
15
16
  c: { type: null, required: false },
@@ -19,6 +19,8 @@ export interface TextProps extends BoxProps {
19
19
  gradient?: NuanceGradient;
20
20
  /** Font size token */
21
21
  fz?: NuanceFontSize | `h${TitleOrder}` | AnyString;
22
+ /** Font family token @default 'text' */
23
+ ff?: 'mono' | 'headings' | 'text' | AnyString;
22
24
  /** Line height token */
23
25
  lh?: NuanceSize | AnyString;
24
26
  /** Font weight */
@@ -13,6 +13,7 @@ const {
13
13
  variant,
14
14
  gradient,
15
15
  fz,
16
+ ff,
16
17
  fw,
17
18
  lh,
18
19
  c,
@@ -26,6 +27,7 @@ const {
26
27
  inherit: { type: Boolean, required: false },
27
28
  gradient: { type: Object, required: false },
28
29
  fz: { type: null, required: false },
30
+ ff: { type: [String, Object], required: false },
29
31
  lh: { type: [String, Object], required: false },
30
32
  fw: { type: void 0, required: false },
31
33
  c: { type: null, required: false },
@@ -43,6 +45,7 @@ const _mod = computed(() => [{
43
45
  const style = useVarsResolver((theme) => ({
44
46
  root: {
45
47
  "--text-fz": getFontSize(fz || size),
48
+ "--text-ff": ff ? `var(--font-family${ff === "text" ? "" : ff})` : void 0,
46
49
  "--text-fw": fw?.toString(),
47
50
  "--text-lh": getLineHeight(lh || size),
48
51
  "--text-gradient": variant === "gradient" ? getGradient(gradient, theme) : void 0,
@@ -59,5 +62,5 @@ const style = useVarsResolver((theme) => ({
59
62
  </template>
60
63
 
61
64
  <style module>
62
- .root{--text-fz:var(--font-size-md);--text-lh:var(--line-height-md);--text-color:inherit;--text-fw:normal;--text-gradient:none;--text-line-clamp:none;color:var(--text-color);font-size:var(--text-fz);font-weight:var(--text-fw);line-height:var(--text-lh);margin:0;padding:0;text-decoration:none;-webkit-tap-highlight-color:transparent}.root:where([data-truncate]){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.root:where([data-truncate=start]){direction:rtl;text-align:right;@mixin where-rtl{direction:ltr;text-align:left}}.root:where([data-variant=gradient]){-webkit-background-clip:text;background-clip:text;background-image:var(--text-gradient);-webkit-text-fill-color:transparent}.root:where([data-line-clamp]){display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:var(--text-line-clamp);text-overflow:ellipsis}.root:where([data-inherit]){color:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}.root:where([data-inline]){line-height:1}
65
+ .root{--text-fz:var(--font-size-md);--text-lh:var(--line-height-md);--text-color:inherit;--text-fw:normal;--text-gradient:none;--text-line-clamp:none;color:var(--text-color);font-family:var(--text-ff,var(--font-family));font-size:var(--text-fz);font-weight:var(--text-fw);line-height:var(--text-lh);margin:0;padding:0;text-decoration:none;-webkit-tap-highlight-color:transparent}.root:where([data-truncate]){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.root:where([data-truncate=start]){direction:rtl;text-align:right;@mixin where-rtl{direction:ltr;text-align:left}}.root:where([data-variant=gradient]){-webkit-background-clip:text;background-clip:text;background-image:var(--text-gradient);-webkit-text-fill-color:transparent}.root:where([data-line-clamp]){display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:var(--text-line-clamp);text-overflow:ellipsis}.root:where([data-inherit]){color:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}.root:where([data-inline]){line-height:1}
63
66
  </style>
@@ -19,6 +19,8 @@ export interface TextProps extends BoxProps {
19
19
  gradient?: NuanceGradient;
20
20
  /** Font size token */
21
21
  fz?: NuanceFontSize | `h${TitleOrder}` | AnyString;
22
+ /** Font family token @default 'text' */
23
+ ff?: 'mono' | 'headings' | 'text' | AnyString;
22
24
  /** Line height token */
23
25
  lh?: NuanceSize | AnyString;
24
26
  /** Font weight */
@@ -27,7 +27,7 @@ export interface TimelineItem {
27
27
  [key: string]: any;
28
28
  }
29
29
  export interface TimelineVars {
30
- root: '--tl-line-width' | '--tl-size' | '--tl-color' | '--tl-radius';
30
+ root: '--tl-line-width' | '--tl-size' | '--tl-color' | '--tl-radius' | '--tl-gap';
31
31
  }
32
32
  export type TimelineSlots<T extends TimelineItem = TimelineItem> = {
33
33
  bullet?: SlotProps<T>;
@@ -57,6 +57,8 @@ export interface TimelineProps<T extends TimelineItem> extends BoxProps {
57
57
  align?: 'right' | 'left';
58
58
  /** Control width of the line */
59
59
  lineWidth?: number | string;
60
+ /** Gap between items (padding-bottom on each non-last item) */
61
+ gap?: number | string;
60
62
  /** If set, the active items direction is reversed without reversing items order @default false */
61
63
  reverse?: boolean;
62
64
  /** @default 'vertical' */
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { useVarsResolver } from "@nui/composables";
3
- import { getRadius, getSize, getThemeColor, rem } from "@nui/utils";
3
+ import { getRadius, getSize, getSpacing, getThemeColor, rem } from "@nui/utils";
4
4
  import { computed } from "vue";
5
5
  import Box from "./box.vue";
6
6
  const {
@@ -9,6 +9,7 @@ const {
9
9
  align = "left",
10
10
  size,
11
11
  lineWidth = 4,
12
+ gap,
12
13
  color,
13
14
  classes,
14
15
  mod,
@@ -22,6 +23,7 @@ const {
22
23
  size: { type: [String, Object], required: false },
23
24
  align: { type: String, required: false },
24
25
  lineWidth: { type: [Number, String], required: false },
26
+ gap: { type: [Number, String], required: false },
25
27
  reverse: { type: Boolean, required: false },
26
28
  orientation: { type: String, required: false },
27
29
  valueKey: { type: String, required: false },
@@ -37,7 +39,8 @@ const style = useVarsResolver((theme) => ({
37
39
  "--tl-size": getSize(size, "tl-size"),
38
40
  "--tl-line-width": rem(lineWidth),
39
41
  "--tl-radius": radius === void 0 ? void 0 : getRadius(radius),
40
- "--tl-color": color ? getThemeColor(color, theme) : void 0
42
+ "--tl-color": color ? getThemeColor(color, theme) : void 0,
43
+ "--tl-gap": getSpacing(gap)
41
44
  }
42
45
  }));
43
46
  const currentStepIx = computed(() => {
@@ -108,5 +111,5 @@ function getActive(ix) {
108
111
  </template>
109
112
 
110
113
  <style module>
111
- .root{--tl-size-xs:1rem;--tl-size-sm:1.25rem;--tl-size-md:1.5rem;--tl-size-lg:1.75rem;--tl-size-xl:2rem;--tl-size:var(--tl-size-md);--tl-offset:calc((var(--tl-size) - var(--tl-line-width))/2);--tl-line-width:.25rem;--tl-radius:1000px;--tl-color:var(--color-primary-filled)}.root:where([data-align=left]){padding-inline-start:var(--tl-offset)}.root:where([data-align=right]){padding-inline-end:var(--tl-offset)}.root:where([data-orientation=horizontal]){display:flex;flex-direction:row;padding-block-start:var(--tl-offset);padding-inline:0}.item{--tli-bd-style:solid;--tli-bd-color:var(--color-primary-filled);--item-border:var(--tl-line-width) var(--tli-bd-style) var(--tli-bd-color);color:var(--color-text);position:relative}.item:before{border-inline-start:var(--item-border);bottom:0;content:"";display:var(--timeline-line-display,none);left:var(--timeline-line-left,0);pointer-events:none;position:absolute;right:var(--timeline-line-right,0);top:0}.root[data-align=left] .item:before{--timeline-line-left:calc(var(--tl-line-width)*-1);--timeline-line-right:auto;@mixin rtl{--timeline-line-left:auto;--timeline-line-right:calc(var(--tl-line-width)*-1)}}.root[data-align=right] .item:before{--timeline-line-left:auto;--timeline-line-right:calc(var(--tl-line-width)*-1);@mixin rtl{--timeline-line-left:calc(var(--tl-line-width)*-1);--timeline-line-right:auto}}.root:where([data-align=left]) .item{padding-inline-start:var(--tl-offset);text-align:left}.root:where([data-align=right]) .item{padding-inline-end:var(--tl-offset);text-align:right}.root:where([data-orientation=horizontal]) .item{flex:1;padding-block-start:var(--tl-offset);padding-inline:0;text-align:center}.root:where([data-orientation=horizontal]) .item:before{--timeline-line-top:calc((var(--tl-size) - var(--tl-line-width))/2);border-inline-start:none;border-top:var(--item-border);bottom:auto;height:var(--tl-line-width);left:0;right:0;top:var(--timeline-line-top,0)}.root:where([data-orientation=horizontal]) .item:where(:not(:last-of-type)){--timeline-line-display:block;padding-bottom:0}.item{@mixin where-light{--tli-bd-color:var(--color-gray-3)}}.item{@mixin where-dark{--tli-bd-color:var(--color-dark-4)}}.item:where([data-line-active]){--tli-bd-color:var(--tl-color)}.item:where(:not(:last-of-type)){--timeline-line-display:block;padding-bottom:var(--spacing-xl)}.root:where([data-orientation=horizontal]) .item:where(:not(:first-of-type)){padding-bottom:0}.bullet{--tl-bullet-offset:calc(var(--tl-size)/2*-1 + var(--tl-line-width)/2*-1);align-items:center;background-color:var(--color-body);border:var(--tl-line-width) solid;border-radius:var(--tli-radius,var(--tl-radius));color:var(--color-text);display:flex;height:var(--tl-size);justify-content:center;position:absolute;top:0;width:var(--tl-size);@mixin where-light{border-color:var(--color-gray-3)}@mixin where-dark{border-color:var(--color-dark-4)}}.root:where([data-align=left]) .bullet{left:var(--tl-bullet-offset);right:auto;@mixin where-rtl{left:auto;right:var(--tl-bullet-offset)}}.root:where([data-align=right]) .bullet{left:auto;right:var(--tl-bullet-offset);@mixin where-rtl{left:var(--tl-bullet-offset);right:auto}}.root:where([data-orientation=horizontal]) .bullet{--tl-bullet-offset:0}.bullet:where([data-with-child]){border-width:var(--tl-line-width);@mixin where-light{background-color:var(--color-gray-3)}@mixin where-dark{background-color:var(--color-dark-4)}}.bullet:where([data-active]){background-color:var(--color-white);border-color:var(--tli-color,var(--tl-color));color:var(--tl-icon-color,var(--color-white))}.bullet:where([data-active]):where([data-with-child]){background-color:var(--tli-color,var(--tl-color));color:var(--tl-icon-color,var(--color-white))}.root:where([data-align=left]) .body{padding-inline-start:var(--tl-offset);text-align:left;@mixin where-rtl{text-align:right}}.root:where([data-align=right]) .body{padding-inline-end:var(--tl-offset);text-align:right;@mixin where-rtl{text-align:left}}.root:where([data-orientation=horizontal]) .body{padding-block-start:calc(var(--tl-offset) + var(--spacing-xs));padding-inline:0}.label{font-weight:600;line-height:var(--tl-size)}.content{color:var(--color-dimmed)}
114
+ .root{--tl-size-xs:1rem;--tl-size-sm:1.25rem;--tl-size-md:1.5rem;--tl-size-lg:1.75rem;--tl-size-xl:2rem;--tl-size:var(--tl-size-md);--tl-offset:calc((var(--tl-size) - var(--tl-line-width))/2);--tl-line-width:.25rem;--tl-radius:1000px;--tl-color:var(--color-primary-filled);--tl-gap:var(--spacing-xl)}.root:where([data-align=left]){padding-inline-start:var(--tl-offset)}.root:where([data-align=right]){padding-inline-end:var(--tl-offset)}.root:where([data-orientation=horizontal]){display:flex;flex-direction:row;padding-block-start:var(--tl-offset);padding-inline:0}.item{--tli-bd-style:solid;--tli-bd-color:var(--color-primary-filled);--item-border:var(--tl-line-width) var(--tli-bd-style) var(--tli-bd-color);color:var(--color-text);position:relative}.item:before{border-inline-start:var(--item-border);bottom:0;content:"";display:var(--timeline-line-display,none);left:var(--timeline-line-left,0);pointer-events:none;position:absolute;right:var(--timeline-line-right,0);top:0}.root[data-align=left] .item:before{--timeline-line-left:calc(var(--tl-line-width)*-1);--timeline-line-right:auto;@mixin rtl{--timeline-line-left:auto;--timeline-line-right:calc(var(--tl-line-width)*-1)}}.root[data-align=right] .item:before{--timeline-line-left:auto;--timeline-line-right:calc(var(--tl-line-width)*-1);@mixin rtl{--timeline-line-left:calc(var(--tl-line-width)*-1);--timeline-line-right:auto}}.root:where([data-align=left]) .item{padding-inline-start:var(--tl-offset);text-align:left}.root:where([data-align=right]) .item{padding-inline-end:var(--tl-offset);text-align:right}.root:where([data-orientation=horizontal]) .item{flex:1;padding-block-start:var(--tl-offset);padding-inline:0;text-align:center}.root:where([data-orientation=horizontal]) .item:before{--timeline-line-top:calc((var(--tl-size) - var(--tl-line-width))/2);border-inline-start:none;border-top:var(--item-border);bottom:auto;height:var(--tl-line-width);left:0;right:0;top:var(--timeline-line-top,0)}.root:where([data-orientation=horizontal]) .item:where(:not(:last-of-type)){--timeline-line-display:block;padding-bottom:0}.item{@mixin where-light{--tli-bd-color:var(--color-gray-3)}}.item{@mixin where-dark{--tli-bd-color:var(--color-dark-4)}}.item:where([data-line-active]){--tli-bd-color:var(--tl-color)}.item:where(:not(:last-of-type)){--timeline-line-display:block;padding-bottom:var(--tl-gap)}.root:where([data-orientation=horizontal]) .item:where(:not(:first-of-type)){padding-bottom:0}.bullet{--tl-bullet-offset:calc(var(--tl-size)/2*-1 + var(--tl-line-width)/2*-1);align-items:center;background-color:var(--color-body);border:var(--tl-line-width) solid;border-radius:var(--tli-radius,var(--tl-radius));color:var(--color-text);display:flex;height:var(--tl-size);justify-content:center;position:absolute;top:0;width:var(--tl-size);@mixin where-light{border-color:var(--color-gray-3)}@mixin where-dark{border-color:var(--color-dark-4)}}.root:where([data-align=left]) .bullet{left:var(--tl-bullet-offset);right:auto;@mixin where-rtl{left:auto;right:var(--tl-bullet-offset)}}.root:where([data-align=right]) .bullet{left:auto;right:var(--tl-bullet-offset);@mixin where-rtl{left:var(--tl-bullet-offset);right:auto}}.root:where([data-orientation=horizontal]) .bullet{--tl-bullet-offset:0}.bullet:where([data-with-child]){border-width:var(--tl-line-width);@mixin where-light{background-color:var(--color-gray-3)}@mixin where-dark{background-color:var(--color-dark-4)}}.bullet:where([data-active]){background-color:var(--color-white);border-color:var(--tli-color,var(--tl-color));color:var(--tl-icon-color,var(--color-white))}.bullet:where([data-active]):where([data-with-child]){background-color:var(--tli-color,var(--tl-color));color:var(--tl-icon-color,var(--color-white))}.root:where([data-align=left]) .body{padding-inline-start:var(--tl-offset);text-align:left;@mixin where-rtl{text-align:right}}.root:where([data-align=right]) .body{padding-inline-end:var(--tl-offset);text-align:right;@mixin where-rtl{text-align:left}}.root:where([data-orientation=horizontal]) .body{padding-block-start:calc(var(--tl-offset) + var(--spacing-xs));padding-inline:0}.label{font-weight:600;line-height:var(--tl-size)}.content{color:var(--color-dimmed)}
112
115
  </style>
@@ -27,7 +27,7 @@ export interface TimelineItem {
27
27
  [key: string]: any;
28
28
  }
29
29
  export interface TimelineVars {
30
- root: '--tl-line-width' | '--tl-size' | '--tl-color' | '--tl-radius';
30
+ root: '--tl-line-width' | '--tl-size' | '--tl-color' | '--tl-radius' | '--tl-gap';
31
31
  }
32
32
  export type TimelineSlots<T extends TimelineItem = TimelineItem> = {
33
33
  bullet?: SlotProps<T>;
@@ -57,6 +57,8 @@ export interface TimelineProps<T extends TimelineItem> extends BoxProps {
57
57
  align?: 'right' | 'left';
58
58
  /** Control width of the line */
59
59
  lineWidth?: number | string;
60
+ /** Gap between items (padding-bottom on each non-last item) */
61
+ gap?: number | string;
60
62
  /** If set, the active items direction is reversed without reversing items order @default false */
61
63
  reverse?: boolean;
62
64
  /** @default 'vertical' */
@@ -5,6 +5,7 @@ const {
5
5
  order = "2",
6
6
  textWrap,
7
7
  size,
8
+ ff = "headings",
8
9
  ...rest
9
10
  } = defineProps({
10
11
  order: { type: String, required: false },
@@ -16,6 +17,7 @@ const {
16
17
  inherit: { type: Boolean, required: false },
17
18
  gradient: { type: Object, required: false },
18
19
  fz: { type: null, required: false },
20
+ ff: { type: [String, Object], required: false },
19
21
  lh: { type: [String, Object], required: false },
20
22
  fw: { type: void 0, required: false },
21
23
  c: { type: null, required: false },
@@ -29,6 +31,7 @@ const style = computed(() => ({ "--title-text-wrap": textWrap }));
29
31
  <Text
30
32
  :is='`h${order}`'
31
33
  v-bind='rest'
34
+ :ff
32
35
  :size='size || `h${order}`'
33
36
  :class='$style.root'
34
37
  :style
@@ -1,4 +1,4 @@
1
- import { DEFAULT_GRADIENT } from "./const.js";
1
+ import { DEFAULT_GRADIENT } from "../const/index.js";
2
2
  import { parseThemeColor } from "./parse-theme-color.js";
3
3
  export function getGradient(gradient, theme) {
4
4
  const merged = {
@@ -1,4 +1,3 @@
1
- export * from './const.js';
2
1
  export * from './get-color-var.js';
3
2
  export * from './get-gradient.js';
4
3
  export * from './parse-theme-color.js';
@@ -1,4 +1,3 @@
1
- export * from "./const.js";
2
1
  export * from "./get-color-var.js";
3
2
  export * from "./get-gradient.js";
4
3
  export * from "./parse-theme-color.js";
@@ -0,0 +1,33 @@
1
+ export const DEFAULT_ICONS = {
2
+ // ─── Actions ───
3
+ close: "lucide:x",
4
+ check: "lucide:check",
5
+ minus: "lucide:minus",
6
+ plus: "lucide:plus",
7
+ // ─── Chevrons ───
8
+ chevronRight: "lucide:chevron-right",
9
+ chevronLeft: "lucide:chevron-left",
10
+ chevronDown: "lucide:chevron-down",
11
+ chevronUp: "lucide:chevron-up",
12
+ selectExpand: "lucide:chevrons-up-down",
13
+ // ─── Inputs ───
14
+ email: "lucide:at-sign",
15
+ passwordShow: "lucide:eye",
16
+ passwordHide: "lucide:eye-off",
17
+ calendar: "lucide:calendar",
18
+ clock: "lucide:clock",
19
+ // ─── User ───
20
+ person: "lucide:user",
21
+ // ─── Theme ───
22
+ sun: "lucide:sun",
23
+ moon: "lucide:moon",
24
+ // ─── Files & tree ───
25
+ upload: "lucide:upload",
26
+ file: "lucide:file",
27
+ folder: "lucide:folder",
28
+ folderOpen: "lucide:folder-open",
29
+ // ─── Table sort ───
30
+ sortAsc: "lucide:arrow-up-narrow-wide",
31
+ sortDesc: "lucide:arrow-down-wide-narrow",
32
+ sortOff: "lucide:arrow-up-down"
33
+ };
@@ -0,0 +1,2 @@
1
+ export * from './gradient.js';
2
+ export * from './icons.js';
@@ -0,0 +1,2 @@
1
+ export * from "./gradient.js";
2
+ export * from "./icons.js";
@@ -1,7 +1,7 @@
1
1
  export * from './boolean/index.js';
2
2
  export * from './color/index.js';
3
+ export * from './const/index.js';
3
4
  export * from './css/index.js';
4
5
  export * from './date/index.js';
5
- export * from './icons/index.js';
6
6
  export * from './style/index.js';
7
7
  export * from './tree.js';
@@ -1,7 +1,7 @@
1
1
  export * from "./boolean/index.js";
2
2
  export * from "./color/index.js";
3
+ export * from "./const/index.js";
3
4
  export * from "./css/index.js";
4
5
  export * from "./date/index.js";
5
- export * from "./icons/index.js";
6
6
  export * from "./style/index.js";
7
7
  export * from "./tree.js";
@@ -1,7 +1,7 @@
1
1
  import type { AnyString, NuanceColor, NuanceGradient, NuanceTheme } from '@nui/types';
2
2
  export interface VariantColorResolverOptions {
3
3
  color: NuanceColor | AnyString | undefined;
4
- variant: 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient' | 'gradient-outline';
4
+ variant: 'filled' | 'light' | 'outline' | 'light-outline' | 'subtle' | 'default' | 'gradient' | 'gradient-outline';
5
5
  gradient?: NuanceGradient;
6
6
  theme: NuanceTheme;
7
7
  }
@@ -1,6 +1,6 @@
1
- import { DEFAULT_GRADIENT } from "../color/const.js";
2
1
  import { getGradient, getGradientOutline } from "../color/get-gradient.js";
3
2
  import { getThemeColor, parseThemeColor } from "../color/parse-theme-color.js";
3
+ import { DEFAULT_GRADIENT } from "../const/index.js";
4
4
  export function createVariantColorResolver({
5
5
  color = "primary",
6
6
  variant,
@@ -57,6 +57,22 @@ export function createVariantColorResolver({
57
57
  border: `1px solid var(--color-${parsed.color}-${parsed.shade})`
58
58
  };
59
59
  }
60
+ if (variant === "light-outline") {
61
+ if (parsed.shade === void 0) {
62
+ return {
63
+ background: `var(--color-${color}-light)`,
64
+ hover: `var(--color-${color}-light-hover)`,
65
+ text: `var(--color-${color}-light-color)`,
66
+ border: `1px solid var(--color-${color}-outline)`
67
+ };
68
+ }
69
+ return {
70
+ background: `color-mix(var(--color-${parsed.color}-${parsed.shade}), .1)`,
71
+ hover: `color-mix(var(--color-${parsed.color}-${parsed.shade}), .12)`,
72
+ text: `var(--color-${parsed.color}-${Math.min(parsed.shade, 6)})`,
73
+ border: `1px solid var(--color-${parsed.color}-${parsed.shade})`
74
+ };
75
+ }
60
76
  if (variant === "subtle") {
61
77
  if (parsed.shade === void 0) {
62
78
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuance-ui",
3
- "version": "0.2.33",
4
- "description": "A modern Vue UI library inspired by the best of the React ecosystem.",
3
+ "version": "0.2.35",
4
+ "description": "A modern Nuxt UI library inspired by the best of the React ecosystem.",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/Igor-Iugin/nuance-ui.git"
@@ -78,6 +78,7 @@
78
78
  },
79
79
  "devDependencies": {
80
80
  "@antfu/eslint-config": "^8.2.0",
81
+ "@nuxt/icon": "^2.2.1",
81
82
  "@nuxt/devtools": "^3.1.1",
82
83
  "@nuxt/eslint": "1.10.0",
83
84
  "@nuxt/eslint-config": "^1.13.0",
@@ -1,33 +0,0 @@
1
- export const DEFAULT_ICONS = {
2
- // ─── Actions ───
3
- close: "gravity-ui:xmark",
4
- check: "gravity-ui:check",
5
- minus: "gravity-ui:minus",
6
- plus: "gravity-ui:plus",
7
- // ─── Chevrons ───
8
- chevronRight: "gravity-ui:chevron-right",
9
- chevronLeft: "gravity-ui:chevron-left",
10
- chevronDown: "gravity-ui:chevron-down",
11
- chevronUp: "gravity-ui:chevron-up",
12
- selectExpand: "gravity-ui:chevrons-expand-vertical",
13
- // ─── Inputs ───
14
- email: "gravity-ui:at",
15
- passwordShow: "gravity-ui:eye",
16
- passwordHide: "gravity-ui:eye-slash",
17
- calendar: "gravity-ui:calendar",
18
- clock: "gravity-ui:clock",
19
- // ─── User ───
20
- person: "gravity-ui:person",
21
- // ─── Theme ───
22
- sun: "gravity-ui:sun",
23
- moon: "gravity-ui:moon",
24
- // ─── Files & tree ───
25
- upload: "gravity-ui:arrow-shape-up-from-line",
26
- file: "gravity-ui:file",
27
- folder: "gravity-ui:folder",
28
- folderOpen: "gravity-ui:folder-open",
29
- // ─── Table sort ───
30
- sortAsc: "gravity-ui:bars-descending-align-left-arrow-up",
31
- sortDesc: "gravity-ui:bars-descending-align-left-arrow-down",
32
- sortOff: "gravity-ui:bars-descending-align-left"
33
- };
@@ -1 +0,0 @@
1
- export * from './default-icons.js';
@@ -1 +0,0 @@
1
- export * from "./default-icons.js";