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
@@ -2,5 +2,5 @@ export * from './create-strict-injection.js';
2
2
  export * from './use-active-link.js';
3
3
  export * from './use-date-config.js';
4
4
  export * from './use-selectable-group.js';
5
- export * from './use-style-resolver.js';
6
5
  export * from './use-theme.js';
6
+ export * from './use-vars-resolver.js';
@@ -2,5 +2,5 @@ export * from "./create-strict-injection.js";
2
2
  export * from "./use-active-link.js";
3
3
  export * from "./use-date-config.js";
4
4
  export * from "./use-selectable-group.js";
5
- export * from "./use-style-resolver.js";
6
5
  export * from "./use-theme.js";
6
+ export * from "./use-vars-resolver.js";
@@ -0,0 +1,4 @@
1
+ import type { CssVariable, NuanceTheme, TransformVars } from '@nui/types';
2
+ import type { ComputedRef } from 'vue';
3
+ /** Reactive style object builder. */
4
+ export declare function useVarsResolver<T extends Record<never, CssVariable>>(factory: (theme: NuanceTheme) => TransformVars<T>): ComputedRef<TransformVars<T>>;
@@ -0,0 +1,6 @@
1
+ import { computed } from "vue";
2
+ import { useTheme } from "./use-theme.js";
3
+ export function useVarsResolver(factory) {
4
+ const theme = useTheme();
5
+ return computed(() => factory(theme.value));
6
+ }
@@ -1,6 +1,5 @@
1
1
  export type * from './styling';
2
2
  export type * from './theme';
3
- /** Map of component part names to user-provided class names. */
4
- export type Classes<Key extends string, Value = string | string[]> = Partial<Record<Key, Value>>;
5
3
  /** Value that may be synchronous or wrapped in a promise. */
6
4
  export type MaybePromise<T = unknown> = T | Promise<T>;
5
+ export type AnyString = string & {};
@@ -1,4 +1,6 @@
1
1
  export type CssVariable = `--${string}`;
2
2
  export type TransformVars<V> = {
3
- [Key in keyof V]: V[Key] extends CssVariable ? Record<V[Key], string | undefined> : never;
3
+ [Key in keyof V]: V[Key] extends CssVariable ? Record<V[Key], string | number | undefined> : never;
4
4
  };
5
+ /** Map of component part names to user-provided class names. */
6
+ export type Classes<Key extends string, Value = string | string[]> = Partial<Record<Key, Value>>;
@@ -1,17 +1,12 @@
1
+ import type { AnyString } from '.';
1
2
  /** Standard Nuance size token. */
2
3
  export type NuanceSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
3
- export type NuanceBreakpointsValues = Record<NuanceSize | 'base', string>;
4
- export type NuanceFontSizesValues = Record<NuanceSize, string>;
5
- export type NuanceRadiusValues = Record<NuanceSize | 'full', string>;
6
- export type NuanceSpacingValues = Record<NuanceSize, string>;
7
- export type NuanceShadowsValues = Record<NuanceSize, string>;
8
- export type NuanceLineHeightValues = Record<NuanceSize, string>;
9
- export type NuanceBreakpoint = keyof NuanceBreakpointsValues;
10
- export type NuanceFontSize = keyof NuanceFontSizesValues;
11
- export type NuanceRadius = keyof NuanceRadiusValues | number;
12
- export type NuanceSpacing = keyof NuanceSpacingValues | number;
13
- export type NuanceShadow = keyof NuanceShadowsValues;
14
- export type NuanceLineHeight = keyof NuanceLineHeightValues;
4
+ export type NuanceBreakpoint = NuanceSize | 'base';
5
+ export type NuanceFontSize = NuanceSize;
6
+ export type NuanceRadius = NuanceSize | 'full' | number;
7
+ export type NuanceSpacing = NuanceSize | number;
8
+ export type NuanceShadow = NuanceSize;
9
+ export type NuanceLineHeight = NuanceSize;
15
10
  /** Numeric shade index within a color palette, from lightest (0) to darkest (9). */
16
11
  export type NuanceColorShade = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
17
12
  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}`;
@@ -23,11 +18,11 @@ export type NuanceTheme = 'light' | 'dark';
23
18
  /** Linear gradient definition. */
24
19
  export interface NuanceGradient {
25
20
  /** Fallback background color rendered behind the gradient. */
26
- bg?: NuanceColor | string;
21
+ bg?: NuanceColor | AnyString;
27
22
  /** Start color. */
28
- from: NuanceColor | string;
23
+ from: NuanceColor | AnyString;
29
24
  /** End color. */
30
- to: NuanceColor | string;
25
+ to: NuanceColor | AnyString;
31
26
  /** Gradient angle in degrees. */
32
27
  deg?: number;
33
28
  }
@@ -1,4 +1,4 @@
1
- import type { NuanceColor, NuanceGradient, NuanceTheme } from '@nui/types';
1
+ import type { AnyString, NuanceColor, NuanceGradient, NuanceTheme } from '@nui/types';
2
2
  interface VariantColorResolverResult {
3
3
  /** Base background CSS value. */
4
4
  background: string;
@@ -18,7 +18,7 @@ interface VariantColorResolverResult {
18
18
  * default `--color-*` tokens when no explicit shade is provided.
19
19
  */
20
20
  export declare function createVariantColorResolver({ color, variant, gradient, theme, }: {
21
- color: NuanceColor | string | undefined;
21
+ color: NuanceColor | AnyString | undefined;
22
22
  variant: 'filled' | 'light' | 'outline' | 'subtle' | 'default' | 'gradient' | 'gradient-outline' | 'dot';
23
23
  gradient?: NuanceGradient;
24
24
  theme: NuanceTheme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuance-ui",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "A modern Vue UI library inspired by the best of the React ecosystem.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -77,7 +77,7 @@
77
77
  }
78
78
  },
79
79
  "devDependencies": {
80
- "@antfu/eslint-config": "^7.2.0",
80
+ "@antfu/eslint-config": "^8.2.0",
81
81
  "@nuxt/devtools": "^3.1.1",
82
82
  "@nuxt/eslint": "1.10.0",
83
83
  "@nuxt/eslint-config": "^1.13.0",
@@ -1,5 +0,0 @@
1
- import type { NuanceTheme, TransformVars } from '@nui/types';
2
- /**
3
- * Builds a style object from a factory that receives the current theme.
4
- */
5
- export declare function useStyleResolver<T extends object>(factory: (theme: NuanceTheme) => TransformVars<T>): TransformVars<T>;
@@ -1,5 +0,0 @@
1
- import { useTheme } from "./use-theme.js";
2
- export function useStyleResolver(factory) {
3
- const theme = useTheme();
4
- return factory(theme.value);
5
- }