nuance-ui 0.2.10 → 0.2.11

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 (150) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/action-icon/action-icon-section.d.vue.ts +11 -10
  3. package/dist/runtime/components/action-icon/action-icon-section.vue +17 -20
  4. package/dist/runtime/components/action-icon/action-icon-section.vue.d.ts +11 -10
  5. package/dist/runtime/components/action-icon/action-icon.d.vue.ts +17 -14
  6. package/dist/runtime/components/action-icon/action-icon.vue +18 -17
  7. package/dist/runtime/components/action-icon/action-icon.vue.d.ts +17 -14
  8. package/dist/runtime/components/alert.d.vue.ts +8 -6
  9. package/dist/runtime/components/alert.vue +15 -101
  10. package/dist/runtime/components/alert.vue.d.ts +8 -6
  11. package/dist/runtime/components/app-shell/app-shell-aside.vue +2 -28
  12. package/dist/runtime/components/app-shell/app-shell-footer.vue +2 -27
  13. package/dist/runtime/components/app-shell/app-shell-header.vue +2 -28
  14. package/dist/runtime/components/app-shell/app-shell-main.vue +2 -16
  15. package/dist/runtime/components/app-shell/app-shell-navbar.vue +2 -32
  16. package/dist/runtime/components/app-shell/app-shell-section.vue +2 -8
  17. package/dist/runtime/components/app-shell/app-shell.vue +20 -44
  18. package/dist/runtime/components/avatar/avatar-group.d.vue.ts +2 -2
  19. package/dist/runtime/components/avatar/avatar-group.vue +1 -1
  20. package/dist/runtime/components/avatar/avatar-group.vue.d.ts +2 -2
  21. package/dist/runtime/components/avatar/avatar.d.vue.ts +9 -5
  22. package/dist/runtime/components/avatar/avatar.vue +26 -26
  23. package/dist/runtime/components/avatar/avatar.vue.d.ts +9 -5
  24. package/dist/runtime/components/background-image.d.vue.ts +2 -2
  25. package/dist/runtime/components/background-image.vue +3 -19
  26. package/dist/runtime/components/background-image.vue.d.ts +2 -2
  27. package/dist/runtime/components/badge.d.vue.ts +9 -8
  28. package/dist/runtime/components/badge.vue +18 -154
  29. package/dist/runtime/components/badge.vue.d.ts +9 -8
  30. package/dist/runtime/components/breadcrumbs.d.vue.ts +4 -4
  31. package/dist/runtime/components/breadcrumbs.vue +2 -48
  32. package/dist/runtime/components/breadcrumbs.vue.d.ts +4 -4
  33. package/dist/runtime/components/button/button.d.vue.ts +21 -31
  34. package/dist/runtime/components/button/button.vue +36 -45
  35. package/dist/runtime/components/button/button.vue.d.ts +21 -31
  36. package/dist/runtime/components/button/unstyled-button.vue +2 -21
  37. package/dist/runtime/components/calendar/calendar.d.vue.ts +2 -2
  38. package/dist/runtime/components/calendar/calendar.vue +3 -10
  39. package/dist/runtime/components/calendar/calendar.vue.d.ts +2 -2
  40. package/dist/runtime/components/calendar/ui/core/calendar-cell.d.vue.ts +2 -2
  41. package/dist/runtime/components/calendar/ui/core/calendar-cell.vue +3 -114
  42. package/dist/runtime/components/calendar/ui/core/calendar-cell.vue.d.ts +2 -2
  43. package/dist/runtime/components/calendar/ui/core/calendar-header.vue +2 -67
  44. package/dist/runtime/components/calendar/ui/levels/calendar-decade.d.vue.ts +2 -2
  45. package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue +3 -25
  46. package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue.d.ts +2 -2
  47. package/dist/runtime/components/calendar/ui/levels/calendar-month.d.vue.ts +2 -2
  48. package/dist/runtime/components/calendar/ui/levels/calendar-month.vue +9 -34
  49. package/dist/runtime/components/calendar/ui/levels/calendar-month.vue.d.ts +2 -2
  50. package/dist/runtime/components/calendar/ui/levels/calendar-year.d.vue.ts +2 -2
  51. package/dist/runtime/components/calendar/ui/levels/calendar-year.vue +3 -25
  52. package/dist/runtime/components/calendar/ui/levels/calendar-year.vue.d.ts +2 -2
  53. package/dist/runtime/components/checkbox/checkbox-card.vue +2 -28
  54. package/dist/runtime/components/checkbox/checkbox-group.vue +3 -3
  55. package/dist/runtime/components/checkbox/checkbox-indicator.d.vue.ts +5 -4
  56. package/dist/runtime/components/checkbox/checkbox-indicator.vue +15 -123
  57. package/dist/runtime/components/checkbox/checkbox-indicator.vue.d.ts +5 -4
  58. package/dist/runtime/components/checkbox/checkbox.d.vue.ts +5 -7
  59. package/dist/runtime/components/checkbox/checkbox.vue +30 -136
  60. package/dist/runtime/components/checkbox/checkbox.vue.d.ts +5 -7
  61. package/dist/runtime/components/chip/chip.d.vue.ts +3 -2
  62. package/dist/runtime/components/chip/chip.vue +29 -212
  63. package/dist/runtime/components/chip/chip.vue.d.ts +3 -2
  64. package/dist/runtime/components/combobox/combobox-dropdown.vue +2 -4
  65. package/dist/runtime/components/container.d.vue.ts +2 -2
  66. package/dist/runtime/components/container.vue +1 -1
  67. package/dist/runtime/components/container.vue.d.ts +2 -2
  68. package/dist/runtime/components/date-time-picker.vue +6 -10
  69. package/dist/runtime/components/dialog/ui/dialog-close-button.vue +11 -7
  70. package/dist/runtime/components/dialog/ui/dialog-root.d.vue.ts +11 -9
  71. package/dist/runtime/components/dialog/ui/dialog-root.vue +5 -5
  72. package/dist/runtime/components/dialog/ui/dialog-root.vue.d.ts +11 -9
  73. package/dist/runtime/components/dialog/ui/dialog-title.vue +2 -2
  74. package/dist/runtime/components/drawer/drawer-close-button.vue +6 -6
  75. package/dist/runtime/components/drawer/drawer-root.vue +4 -4
  76. package/dist/runtime/components/drawer/drawer-title.vue +2 -2
  77. package/dist/runtime/components/files/file-upload-button.vue +8 -8
  78. package/dist/runtime/components/files/file-upload-icon.vue +5 -5
  79. package/dist/runtime/components/input/date-picker.vue +6 -10
  80. package/dist/runtime/components/input/email-input.vue +4 -4
  81. package/dist/runtime/components/input/lib/input-wrapper.context.d.ts +5 -5
  82. package/dist/runtime/components/input/number-input.vue +6 -84
  83. package/dist/runtime/components/input/password-input.vue +4 -4
  84. package/dist/runtime/components/input/text-input.vue +4 -4
  85. package/dist/runtime/components/input/ui/button-input.vue +6 -25
  86. package/dist/runtime/components/input/ui/input-base.vue +6 -265
  87. package/dist/runtime/components/input/ui/input-inline.d.vue.ts +2 -2
  88. package/dist/runtime/components/input/ui/input-inline.vue +3 -82
  89. package/dist/runtime/components/input/ui/input-inline.vue.d.ts +2 -2
  90. package/dist/runtime/components/input/ui/input-label.d.vue.ts +2 -2
  91. package/dist/runtime/components/input/ui/input-label.vue +1 -1
  92. package/dist/runtime/components/input/ui/input-label.vue.d.ts +2 -2
  93. package/dist/runtime/components/input/ui/input-wrapper.d.vue.ts +5 -1
  94. package/dist/runtime/components/input/ui/input-wrapper.vue +13 -65
  95. package/dist/runtime/components/input/ui/input-wrapper.vue.d.ts +5 -1
  96. package/dist/runtime/components/input/ui/spin-input.vue +2 -53
  97. package/dist/runtime/components/link/link-button.vue +9 -9
  98. package/dist/runtime/components/link/link.vue +2 -2
  99. package/dist/runtime/components/loader/loader.d.vue.ts +7 -7
  100. package/dist/runtime/components/loader/loader.vue +8 -7
  101. package/dist/runtime/components/loader/loader.vue.d.ts +7 -7
  102. package/dist/runtime/components/modal/modal-close-button.vue +6 -6
  103. package/dist/runtime/components/modal/modal-root.vue +4 -4
  104. package/dist/runtime/components/modal/modal-title.vue +2 -2
  105. package/dist/runtime/components/nav-link/nav-icon-link.vue +4 -4
  106. package/dist/runtime/components/nav-link/nav-link.d.vue.ts +6 -5
  107. package/dist/runtime/components/nav-link/nav-link.vue +30 -113
  108. package/dist/runtime/components/nav-link/nav-link.vue.d.ts +6 -5
  109. package/dist/runtime/components/paper.vue +2 -31
  110. package/dist/runtime/components/popover/popover-dropdown.vue +2 -54
  111. package/dist/runtime/components/progress/progress-root.d.vue.ts +3 -3
  112. package/dist/runtime/components/progress/progress-root.vue +2 -2
  113. package/dist/runtime/components/progress/progress-root.vue.d.ts +3 -3
  114. package/dist/runtime/components/progress/progress-section.d.vue.ts +3 -0
  115. package/dist/runtime/components/progress/progress-section.vue +8 -6
  116. package/dist/runtime/components/progress/progress-section.vue.d.ts +3 -0
  117. package/dist/runtime/components/progress/progress.vue +2 -2
  118. package/dist/runtime/components/select.vue +6 -10
  119. package/dist/runtime/components/switch/switch-group.vue +3 -3
  120. package/dist/runtime/components/switch/switch.d.vue.ts +3 -0
  121. package/dist/runtime/components/switch/switch.vue +15 -205
  122. package/dist/runtime/components/switch/switch.vue.d.ts +3 -0
  123. package/dist/runtime/components/table/types.d.ts +4 -3
  124. package/dist/runtime/components/table/ui/table-sortable-header.vue +9 -9
  125. package/dist/runtime/components/table/ui/table.vue +9 -174
  126. package/dist/runtime/components/tabs/tabs-root.d.vue.ts +14 -16
  127. package/dist/runtime/components/tabs/tabs-root.vue +14 -12
  128. package/dist/runtime/components/tabs/tabs-root.vue.d.ts +14 -16
  129. package/dist/runtime/components/text.d.vue.ts +10 -9
  130. package/dist/runtime/components/text.vue +16 -77
  131. package/dist/runtime/components/text.vue.d.ts +10 -9
  132. package/dist/runtime/components/textarea.vue +4 -4
  133. package/dist/runtime/components/time-picker/time-picker.vue +6 -132
  134. package/dist/runtime/components/title.vue +4 -8
  135. package/dist/runtime/components/tree/_ui/tree-item.vue +2 -62
  136. package/dist/runtime/components/tree/_ui/tree-root.d.vue.ts +7 -6
  137. package/dist/runtime/components/tree/_ui/tree-root.vue +13 -19
  138. package/dist/runtime/components/tree/_ui/tree-root.vue.d.ts +7 -6
  139. package/dist/runtime/components/tree/tree.vue +5 -5
  140. package/dist/runtime/composables/index.d.ts +1 -1
  141. package/dist/runtime/composables/index.js +1 -1
  142. package/dist/runtime/composables/use-vars-resolver.d.ts +4 -0
  143. package/dist/runtime/composables/use-vars-resolver.js +6 -0
  144. package/dist/runtime/types/index.d.ts +1 -2
  145. package/dist/runtime/types/styling.d.ts +3 -1
  146. package/dist/runtime/types/theme.d.ts +10 -15
  147. package/dist/runtime/utils/style/create-variant-color-resolver.d.ts +2 -2
  148. package/package.json +2 -2
  149. package/dist/runtime/composables/use-style-resolver.d.ts +0 -5
  150. package/dist/runtime/composables/use-style-resolver.js +0 -5
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^4.0.0"
6
6
  },
7
- "version": "0.2.10",
7
+ "version": "0.2.11",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -1,21 +1,22 @@
1
- import type { NuanceColor, NuanceGradient, NuanceRadius, NuanceSize } from '@nui/types';
1
+ import type { AnyString, NuanceColor, NuanceGradient, NuanceRadius } from '@nui/types';
2
2
  import type { BoxProps } from '../box.vue.js';
3
+ import type { ActionIconSize, ActionIconVariant } from './action-icon.vue.js';
4
+ export interface ActionIconSectionVars {
5
+ root: '--section-height' | '--section-padding-x' | '--section-fz' | '--section-radius' | '--section-bg' | '--section-color' | '--section-bd';
6
+ }
3
7
  export interface ActionIconSectionProps extends BoxProps {
4
8
  /** Component size */
5
- size?: NuanceSize | `compact-${NuanceSize}`;
6
- /**
7
- * Visual variant
8
- * @default 'default'
9
- */
10
- variant?: 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient';
9
+ size?: ActionIconSize;
11
10
  /** Gradient configuration (used with `variant="gradient"`) */
12
11
  gradient?: NuanceGradient;
13
- /** Loading state */
14
- loading?: boolean;
15
12
  /** Color from theme */
16
13
  color?: NuanceColor;
17
14
  /** Border radius */
18
- radius?: NuanceRadius;
15
+ radius?: NuanceRadius | AnyString;
16
+ /** Loading state */
17
+ loading?: boolean;
18
+ /** Visual variant */
19
+ variant?: ActionIconVariant;
19
20
  }
20
21
  declare var __VLS_8: {};
21
22
  type __VLS_Slots = {} & {
@@ -1,7 +1,6 @@
1
1
  <script setup>
2
- import { useStyleResolver } from "@nui/composables";
2
+ import { useVarsResolver } from "@nui/composables";
3
3
  import { createVariantColorResolver, getFontSize, getRadius, getSize } from "@nui/utils";
4
- import { computed } from "vue";
5
4
  import Box from "../box.vue";
6
5
  import css from "./action-icon.module.css";
7
6
  const {
@@ -14,34 +13,32 @@ const {
14
13
  color
15
14
  } = defineProps({
16
15
  size: { type: null, required: false },
17
- variant: { type: String, required: false },
18
16
  gradient: { type: Object, required: false },
19
- loading: { type: Boolean, required: false },
20
17
  color: { type: null, required: false },
21
- radius: { type: [String, Number], required: false },
18
+ radius: { type: [String, Number, Object], required: false },
19
+ loading: { type: Boolean, required: false },
20
+ variant: { type: String, required: false },
22
21
  is: { type: null, required: false },
23
22
  mod: { type: [Object, Array, null], required: false }
24
23
  });
25
- const style = computed(() => useStyleResolver((theme) => {
26
- const {
27
- background,
28
- border,
29
- text
30
- } = createVariantColorResolver({ variant, color, theme, gradient });
24
+ const style = useVarsResolver((theme) => {
25
+ const { background, border, text } = createVariantColorResolver({ variant, color, theme, gradient });
31
26
  return {
32
- "--section-height": getSize(size, "section-height"),
33
- "--section-padding-x": getSize(size, "section-padding-x"),
34
- "--section-fz": getFontSize(size),
35
- "--section-radius": radius === void 0 ? void 0 : getRadius(radius),
36
- "--section-bg": color || variant ? background : void 0,
37
- "--section-color": text,
38
- "--section-bd": color || variant ? border : void 0
27
+ root: {
28
+ "--section-height": getSize(size, "section-height"),
29
+ "--section-padding-x": getSize(size, "section-padding-x"),
30
+ "--section-fz": getFontSize(size),
31
+ "--section-radius": radius === void 0 ? void 0 : getRadius(radius),
32
+ "--section-bg": color || variant ? background : void 0,
33
+ "--section-color": text,
34
+ "--section-bd": color || variant ? border : void 0
35
+ }
39
36
  };
40
- }));
37
+ });
41
38
  </script>
42
39
 
43
40
  <template>
44
- <Box :is :mod='[mod, { variant }]' :style :class='css.section'>
41
+ <Box :is :mod='[mod, { variant }]' :style='style.root' :class='css.section'>
45
42
  <slot />
46
43
  </Box>
47
44
  </template>
@@ -1,21 +1,22 @@
1
- import type { NuanceColor, NuanceGradient, NuanceRadius, NuanceSize } from '@nui/types';
1
+ import type { AnyString, NuanceColor, NuanceGradient, NuanceRadius } from '@nui/types';
2
2
  import type { BoxProps } from '../box.vue.js';
3
+ import type { ActionIconSize, ActionIconVariant } from './action-icon.vue.js';
4
+ export interface ActionIconSectionVars {
5
+ root: '--section-height' | '--section-padding-x' | '--section-fz' | '--section-radius' | '--section-bg' | '--section-color' | '--section-bd';
6
+ }
3
7
  export interface ActionIconSectionProps extends BoxProps {
4
8
  /** Component size */
5
- size?: NuanceSize | `compact-${NuanceSize}`;
6
- /**
7
- * Visual variant
8
- * @default 'default'
9
- */
10
- variant?: 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient';
9
+ size?: ActionIconSize;
11
10
  /** Gradient configuration (used with `variant="gradient"`) */
12
11
  gradient?: NuanceGradient;
13
- /** Loading state */
14
- loading?: boolean;
15
12
  /** Color from theme */
16
13
  color?: NuanceColor;
17
14
  /** Border radius */
18
- radius?: NuanceRadius;
15
+ radius?: NuanceRadius | AnyString;
16
+ /** Loading state */
17
+ loading?: boolean;
18
+ /** Visual variant */
19
+ variant?: ActionIconVariant;
19
20
  }
20
21
  declare var __VLS_8: {};
21
22
  type __VLS_Slots = {} & {
@@ -1,29 +1,32 @@
1
- import type { Classes, NuanceColor, NuanceGradient, NuanceRadius, NuanceSize } from '@nui/types';
1
+ import type { AnyString, Classes, NuanceColor, NuanceGradient, NuanceRadius, NuanceSize } from '@nui/types';
2
2
  import type { BoxProps } from '../box.vue.js';
3
+ export type ActionIconClasses = 'root' | 'icon';
4
+ export type ActionIconVariant = 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient';
5
+ export type ActionIconSize = NuanceSize | `input-${NuanceSize}` | AnyString;
6
+ export interface ActionIconVars {
7
+ root: '--ai-size' | '--ai-radius' | '--ai-bg' | '--ai-hover' | '--ai-color' | '--ai-bd';
8
+ }
3
9
  export interface ActionIconProps {
4
10
  /** Component size */
5
- size?: NuanceSize | `input-${NuanceSize}` | string;
6
- /**
7
- * Visual variant
8
- * @default 'default'
9
- */
10
- variant?: 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient';
11
+ size?: ActionIconSize;
11
12
  /** Gradient configuration (used with `variant="gradient"`) */
12
13
  gradient?: NuanceGradient;
13
- /** Loading state */
14
- loading?: boolean;
15
14
  /** Color from theme */
16
15
  color?: NuanceColor;
17
16
  /** Border radius */
18
- radius?: NuanceRadius;
19
- /** Styles API */
20
- classes?: Classes<'root' | 'icon'>;
21
- /** Element modifiers transformed into `data-` attributes, falsy values are removed */
22
- mod?: BoxProps['mod'];
17
+ radius?: NuanceRadius | AnyString;
18
+ /** Loading state */
19
+ loading?: boolean;
23
20
  /** Icon name rendered inside the button when no default slot is provided */
24
21
  icon?: string;
25
22
  /** Disables the component */
26
23
  disabled?: boolean;
24
+ /** Element modifiers transformed into `data-` attributes, falsy values are removed */
25
+ mod?: BoxProps['mod'];
26
+ /** Visual variant */
27
+ variant?: ActionIconVariant;
28
+ /** Styles API */
29
+ classes?: Classes<ActionIconClasses>;
27
30
  }
28
31
  declare var __VLS_19: {};
29
32
  type __VLS_Slots = {} & {
@@ -1,7 +1,6 @@
1
1
  <script setup>
2
- import { useStyleResolver } from "@nui/composables";
2
+ import { useVarsResolver } from "@nui/composables";
3
3
  import { createVariantColorResolver, getRadius, getSize } from "@nui/utils";
4
- import { computed } from "vue";
5
4
  import Box from "../box.vue";
6
5
  import Loader from "../loader/loader.vue";
7
6
  import css from "./action-icon.module.css";
@@ -18,17 +17,17 @@ const {
18
17
  disabled
19
18
  } = defineProps({
20
19
  size: { type: null, required: false },
21
- variant: { type: String, required: false },
22
20
  gradient: { type: Object, required: false },
23
- loading: { type: Boolean, required: false },
24
21
  color: { type: null, required: false },
25
- radius: { type: [String, Number], required: false },
26
- classes: { type: Object, required: false },
27
- mod: { type: [Object, Array, null], required: false },
22
+ radius: { type: [String, Number, Object], required: false },
23
+ loading: { type: Boolean, required: false },
28
24
  icon: { type: String, required: false },
29
- disabled: { type: Boolean, required: false }
25
+ disabled: { type: Boolean, required: false },
26
+ mod: { type: [Object, Array, null], required: false },
27
+ variant: { type: String, required: false },
28
+ classes: { type: Object, required: false }
30
29
  });
31
- const style = computed(() => useStyleResolver((theme) => {
30
+ const style = useVarsResolver((theme) => {
32
31
  const {
33
32
  background,
34
33
  border,
@@ -36,14 +35,16 @@ const style = computed(() => useStyleResolver((theme) => {
36
35
  text
37
36
  } = createVariantColorResolver({ variant, color, theme, gradient });
38
37
  return {
39
- "--ai-size": getSize(size, "ai-size"),
40
- "--ai-radius": getRadius(radius),
41
- "--ai-bg": background,
42
- "--ai-hover": hover,
43
- "--ai-color": text,
44
- "--ai-bd": border
38
+ root: {
39
+ "--ai-size": getSize(size, "ai-size"),
40
+ "--ai-radius": getRadius(radius),
41
+ "--ai-bg": background,
42
+ "--ai-hover": hover,
43
+ "--ai-color": text,
44
+ "--ai-bd": border
45
+ }
45
46
  };
46
- }));
47
+ });
47
48
  </script>
48
49
 
49
50
  <template>
@@ -51,7 +52,7 @@ const style = computed(() => useStyleResolver((theme) => {
51
52
  is='button'
52
53
  type='button'
53
54
  :mod='[{ loading }, mod]'
54
- :style
55
+ :style='style.root'
55
56
  :class='[css.root, classes?.root]'
56
57
  :disabled='(!disabled ? loading : disabled) || void 0'
57
58
  >
@@ -1,29 +1,32 @@
1
- import type { Classes, NuanceColor, NuanceGradient, NuanceRadius, NuanceSize } from '@nui/types';
1
+ import type { AnyString, Classes, NuanceColor, NuanceGradient, NuanceRadius, NuanceSize } from '@nui/types';
2
2
  import type { BoxProps } from '../box.vue.js';
3
+ export type ActionIconClasses = 'root' | 'icon';
4
+ export type ActionIconVariant = 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient';
5
+ export type ActionIconSize = NuanceSize | `input-${NuanceSize}` | AnyString;
6
+ export interface ActionIconVars {
7
+ root: '--ai-size' | '--ai-radius' | '--ai-bg' | '--ai-hover' | '--ai-color' | '--ai-bd';
8
+ }
3
9
  export interface ActionIconProps {
4
10
  /** Component size */
5
- size?: NuanceSize | `input-${NuanceSize}` | string;
6
- /**
7
- * Visual variant
8
- * @default 'default'
9
- */
10
- variant?: 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient';
11
+ size?: ActionIconSize;
11
12
  /** Gradient configuration (used with `variant="gradient"`) */
12
13
  gradient?: NuanceGradient;
13
- /** Loading state */
14
- loading?: boolean;
15
14
  /** Color from theme */
16
15
  color?: NuanceColor;
17
16
  /** Border radius */
18
- radius?: NuanceRadius;
19
- /** Styles API */
20
- classes?: Classes<'root' | 'icon'>;
21
- /** Element modifiers transformed into `data-` attributes, falsy values are removed */
22
- mod?: BoxProps['mod'];
17
+ radius?: NuanceRadius | AnyString;
18
+ /** Loading state */
19
+ loading?: boolean;
23
20
  /** Icon name rendered inside the button when no default slot is provided */
24
21
  icon?: string;
25
22
  /** Disables the component */
26
23
  disabled?: boolean;
24
+ /** Element modifiers transformed into `data-` attributes, falsy values are removed */
25
+ mod?: BoxProps['mod'];
26
+ /** Visual variant */
27
+ variant?: ActionIconVariant;
28
+ /** Styles API */
29
+ classes?: Classes<ActionIconClasses>;
27
30
  }
28
31
  declare var __VLS_19: {};
29
32
  type __VLS_Slots = {} & {
@@ -1,11 +1,11 @@
1
1
  import type { Classes, NuanceColor, NuanceRadius } from '@nui/types';
2
2
  import type { BoxProps } from './box.vue.js';
3
+ export type AlertClasses = 'root' | 'icon' | 'body' | 'title' | 'label' | 'message' | 'closeButton';
4
+ export type AlertVariant = 'filled' | 'light' | 'outline' | 'default';
5
+ export interface AlertVars {
6
+ root: '--alert-radius' | '--alert-bg' | '--alert-color' | '--alert-bd';
7
+ }
3
8
  export interface AlertProps extends BoxProps {
4
- /**
5
- * Visual variant
6
- * @default 'light'
7
- */
8
- variant?: 'filled' | 'light' | 'outline' | 'default';
9
9
  /** Border radius */
10
10
  radius?: NuanceRadius;
11
11
  /** Color from theme */
@@ -20,8 +20,10 @@ export interface AlertProps extends BoxProps {
20
20
  onClose?: () => void;
21
21
  /** `aria-label` for the close button */
22
22
  closeButtonLabel?: string;
23
+ /** Visual variant */
24
+ variant?: AlertVariant;
23
25
  /** Styles API */
24
- classes?: Classes<'root' | 'icon' | 'body' | 'title' | 'label' | 'message' | 'closeButton'>;
26
+ classes?: Classes<AlertClasses>;
25
27
  }
26
28
  declare var __VLS_19: {}, __VLS_27: {};
27
29
  type __VLS_Slots = {} & {
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
- import { useStyleResolver } from "@nui/composables";
2
+ import { useVarsResolver } from "@nui/composables";
3
3
  import { createVariantColorResolver, getRadius } from "@nui/utils";
4
- import { computed, useId } from "vue";
4
+ import { useId } from "vue";
5
5
  import ActionIcon from "./action-icon/action-icon.vue";
6
6
  import Box from "./box.vue";
7
7
  const {
@@ -14,7 +14,6 @@ const {
14
14
  withCloseButton,
15
15
  classes
16
16
  } = defineProps({
17
- variant: { type: String, required: false },
18
17
  radius: { type: [String, Number], required: false },
19
18
  color: { type: null, required: false },
20
19
  title: { type: String, required: false },
@@ -22,31 +21,30 @@ const {
22
21
  withCloseButton: { type: Boolean, required: false },
23
22
  onClose: { type: Function, required: false },
24
23
  closeButtonLabel: { type: String, required: false },
24
+ variant: { type: String, required: false },
25
25
  classes: { type: Object, required: false },
26
26
  is: { type: null, required: false },
27
27
  mod: { type: [Object, Array, null], required: false }
28
28
  });
29
29
  defineEmits(["close"]);
30
30
  const id = useId();
31
- const style = computed(() => useStyleResolver((theme) => {
32
- const { background, border, text } = createVariantColorResolver({
33
- variant,
34
- color,
35
- theme
36
- });
31
+ const style = useVarsResolver((theme) => {
32
+ const { background, border, text } = createVariantColorResolver({ variant, color, theme });
37
33
  return {
38
- "--alert-radius": radius === void 0 ? void 0 : getRadius(radius),
39
- "--alert-bg": color || variant ? background : void 0,
40
- "--alert-color": text,
41
- "--alert-bd": color || variant ? border : void 0
34
+ root: {
35
+ "--alert-radius": radius === void 0 ? void 0 : getRadius(radius),
36
+ "--alert-bg": color || variant ? background : void 0,
37
+ "--alert-color": text,
38
+ "--alert-bd": color || variant ? border : void 0
39
+ }
42
40
  };
43
- }));
41
+ });
44
42
  </script>
45
43
 
46
44
  <template>
47
45
  <Box
48
46
  role='alert'
49
- :style
47
+ :style='style.root'
50
48
  :class='[$style.root, classes?.root]'
51
49
  :mod='[{ variant }, mod]'
52
50
  :aria-describedby='$slots.default ? `${id}-body` : void 0'
@@ -89,90 +87,6 @@ const style = computed(() => useStyleResolver((theme) => {
89
87
  </Box>
90
88
  </template>
91
89
 
92
- <style module lang="postcss">
93
- .root {
94
- --alert-radius: var(--radius-default);
95
- --alert-bg: var(--color-primary-light);
96
- --alert-bd: 1px solid transparent;
97
- --alert-color: var(--color-primary-light-color);
98
-
99
- position: relative;
100
-
101
- overflow: hidden;
102
- display: flex;
103
- gap: var(--spacing-md);
104
-
105
- padding: var(--spacing-md) var(--spacing-md);
106
- border: var(--alert-bd);
107
- border-radius: var(--alert-radius);
108
-
109
- color: var(--alert-color);
110
-
111
- background-color: var(--alert-bg);
112
- }
113
-
114
- .body {
115
- display: flex;
116
- flex: 1;
117
- flex-direction: column;
118
- gap: var(--spacing-xs);
119
- }
120
-
121
- .title {
122
- display: flex;
123
- align-items: center;
124
- justify-content: space-between;
125
-
126
- font-size: var(--font-size-sm);
127
- font-weight: 700;
128
- }
129
-
130
- .label {
131
- overflow: hidden;
132
- display: block;
133
-
134
- text-overflow: ellipsis;
135
- }
136
-
137
- .icon {
138
- display: flex;
139
- align-items: center;
140
- justify-content: flex-start;
141
-
142
- width: 1.25rem;
143
- height: 1.25rem;
144
- margin-top: 1px;
145
-
146
- line-height: 1;
147
- }
148
-
149
- .message {
150
- overflow: hidden;
151
-
152
- font-size: var(--font-size-sm);
153
- text-overflow: ellipsis;
154
-
155
- :where([data-mantine-color-scheme='light']) & {
156
- color: var(--color-black);
157
- }
158
-
159
- :where([data-mantine-color-scheme='dark']) & {
160
- color: var(--color-white);
161
- }
162
-
163
- &:where([data-variant='filled']) {
164
- color: var(--alert-color);
165
- }
166
-
167
- &:where([data-variant='white']) {
168
- color: var(--color-black);
169
- }
170
- }
171
-
172
- .closeButton {
173
- width: 20px;
174
- height: 20px;
175
-
176
- color: var(--alert-color);
177
- }
90
+ <style module>
91
+ .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-md);overflow:hidden;padding:var(--spacing-md) var(--spacing-md);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-sm);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-sm);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}
178
92
  </style>
@@ -1,11 +1,11 @@
1
1
  import type { Classes, NuanceColor, NuanceRadius } from '@nui/types';
2
2
  import type { BoxProps } from './box.vue.js';
3
+ export type AlertClasses = 'root' | 'icon' | 'body' | 'title' | 'label' | 'message' | 'closeButton';
4
+ export type AlertVariant = 'filled' | 'light' | 'outline' | 'default';
5
+ export interface AlertVars {
6
+ root: '--alert-radius' | '--alert-bg' | '--alert-color' | '--alert-bd';
7
+ }
3
8
  export interface AlertProps extends BoxProps {
4
- /**
5
- * Visual variant
6
- * @default 'light'
7
- */
8
- variant?: 'filled' | 'light' | 'outline' | 'default';
9
9
  /** Border radius */
10
10
  radius?: NuanceRadius;
11
11
  /** Color from theme */
@@ -20,8 +20,10 @@ export interface AlertProps extends BoxProps {
20
20
  onClose?: () => void;
21
21
  /** `aria-label` for the close button */
22
22
  closeButtonLabel?: string;
23
+ /** Visual variant */
24
+ variant?: AlertVariant;
23
25
  /** Styles API */
24
- classes?: Classes<'root' | 'icon' | 'body' | 'title' | 'label' | 'message' | 'closeButton'>;
26
+ classes?: Classes<AlertClasses>;
25
27
  }
26
28
  declare var __VLS_19: {}, __VLS_27: {};
27
29
  type __VLS_Slots = {} & {
@@ -12,32 +12,6 @@ const { mod } = defineProps({
12
12
  </Box>
13
13
  </template>
14
14
 
15
- <style module lang="postcss">
16
- .root {
17
- position: fixed;
18
- z-index: 1;
19
- top: var(--app-shell-header-offset, 0);
20
-
21
- inset-inline-end: 0;
22
- transform: var(--app-shell-aside-transform);
23
-
24
- display: flex;
25
- flex-direction: column;
26
-
27
- width: var(--app-shell-aside-width);
28
-
29
- height: calc(100dvh - var(--app-shell-header-offset, 0rem));
30
-
31
- padding-block: var(--app-shell-element-padding);
32
-
33
- background-color: var(--color-aside);
34
-
35
- transition-timing-function: var(--app-shell-transition-timing-function);
36
- transition-duration: var(--app-shell-transition-duration);
37
- transition-property: transform, top, height;
38
-
39
- :where([data-with-border]) > & {
40
- border-inline-start: 1px solid var(--app-shell-border-color);
41
- }
42
- }
15
+ <style module>
16
+ .root{background-color:var(--color-aside);display:flex;flex-direction:column;height:calc(100dvh - var(--app-shell-header-offset, 0rem));inset-inline-end:0;padding-block:var(--app-shell-element-padding);position:fixed;top:var(--app-shell-header-offset,0);transform:var(--app-shell-aside-transform);transition-duration:var(--app-shell-transition-duration);transition-property:transform,top,height;transition-timing-function:var(--app-shell-transition-timing-function);width:var(--app-shell-aside-width);z-index:1}:where([data-with-border])>.root{border-inline-start:1px solid var(--app-shell-border-color)}
43
17
  </style>
@@ -12,31 +12,6 @@ const { mod } = defineProps({
12
12
  </Box>
13
13
  </template>
14
14
 
15
- <style module lang="postcss">
16
- .root {
17
- position: fixed;
18
- z-index: 1;
19
-
20
- bottom: 0;
21
- inset-inline: 0;
22
- transform: var(--app-shell-footer-transform);
23
-
24
- height: calc(var(--app-shell-footer-height) + env(safe-area-inset-bottom));
25
- padding-bottom: env(safe-area-inset-bottom);
26
-
27
- background-color: var(--color-body);
28
-
29
- transition-timing-function: var(--app-shell-transition-timing-function);
30
- transition-duration: var(--app-shell-transition-duration);
31
- transition-property: transform, left, right;
32
-
33
- :where([data-layout='alt']) > & {
34
- inset-inline-start: var(--app-shell-navbar-offset, 0rem);
35
- inset-inline-end: var(--app-shell-aside-offset, 0rem);
36
- }
37
-
38
- :where([data-with-border]) > & {
39
- border-top: 1px solid var(--app-shell-border-color);
40
- }
41
- }
15
+ <style module>
16
+ .root{background-color:var(--color-body);bottom:0;height:calc(var(--app-shell-footer-height) + env(safe-area-inset-bottom));inset-inline:0;padding-bottom:env(safe-area-inset-bottom);position:fixed;transform:var(--app-shell-footer-transform);transition-duration:var(--app-shell-transition-duration);transition-property:transform,left,right;transition-timing-function:var(--app-shell-transition-timing-function);z-index:1}:where([data-layout=alt])>.root{inset-inline-end:var(--app-shell-aside-offset,0);inset-inline-start:var(--app-shell-navbar-offset,0)}:where([data-with-border])>.root{border-top:1px solid var(--app-shell-border-color)}
42
17
  </style>
@@ -12,32 +12,6 @@ const { mod } = defineProps({
12
12
  </Box>
13
13
  </template>
14
14
 
15
- <style module lang="postcss">
16
- .root {
17
- position: fixed;
18
- z-index: 2;
19
- top: 0;
20
- inset-inline: 0;
21
- transform: var(--app-shell-header-transform);
22
-
23
- display: flex;
24
-
25
- height: var(--app-shell-header-height);
26
- padding-block: var(--app-shell-element-padding);
27
- padding-inline: 1rem;
28
-
29
- background-color: var(--color-header);
30
-
31
- transition-timing-function: var(--app-shell-transition-timing-function);
32
- transition-duration: var(--app-shell-transition-duration);
33
- transition-property: transform, left, right;
34
-
35
- :where([data-with-border]) > & {
36
- border-bottom: 1px solid var(--app-shell-border-color);
37
- }
38
-
39
- :where([data-layout='alt']) > & {
40
- inset-inline-start: var(--app-shell-navbar-offset, 0rem);
41
- }
42
- }
15
+ <style module>
16
+ .root{background-color:var(--color-header);display:flex;height:var(--app-shell-header-height);position:fixed;top:0;inset-inline:0;padding-block:var(--app-shell-element-padding);padding-inline:1rem;transform:var(--app-shell-header-transform);transition-duration:var(--app-shell-transition-duration);transition-property:transform,left,right;transition-timing-function:var(--app-shell-transition-timing-function);z-index:2}:where([data-with-border])>.root{border-bottom:1px solid var(--app-shell-border-color)}:where([data-layout=alt])>.root{inset-inline-start:var(--app-shell-navbar-offset,0)}
43
17
  </style>
@@ -12,20 +12,6 @@ const { mod } = defineProps({
12
12
  </Box>
13
13
  </template>
14
14
 
15
- <style module lang="postcss">
16
- .root {
17
- display: flex;
18
- flex-direction: column;
19
-
20
- min-height: 100dvh;
21
- padding-top: calc(var(--app-shell-header-offset, 0rem) + var(--app-shell-padding));
22
- padding-bottom: calc(var(--app-shell-footer-offset, 0rem) + var(--app-shell-padding));
23
- padding-inline-start: calc(var(--app-shell-navbar-offset, 0rem) + var(--app-shell-padding));
24
- padding-inline-end: calc(var(--app-shell-aside-offset, 0rem) + var(--app-shell-padding));
25
-
26
- transition-timing-function: var(--app-shell-transition-timing-function);
27
- transition-duration: var(--app-shell-transition-duration);
28
-
29
- transition-property: padding;
30
- }
15
+ <style module>
16
+ .root{display:flex;flex-direction:column;min-height:100dvh;padding-bottom:calc(var(--app-shell-footer-offset, 0rem) + var(--app-shell-padding));padding-inline-end:calc(var(--app-shell-aside-offset, 0rem) + var(--app-shell-padding));padding-top:calc(var(--app-shell-header-offset, 0rem) + var(--app-shell-padding));padding-inline-start:calc(var(--app-shell-navbar-offset, 0rem) + var(--app-shell-padding));transition-duration:var(--app-shell-transition-duration);transition-property:padding;transition-timing-function:var(--app-shell-transition-timing-function)}
31
17
  </style>