nuance-ui 0.2.9 → 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 (153) 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 -26
  34. package/dist/runtime/components/button/button.module.css +1 -1
  35. package/dist/runtime/components/button/button.vue +36 -42
  36. package/dist/runtime/components/button/button.vue.d.ts +21 -26
  37. package/dist/runtime/components/button/unstyled-button.vue +2 -21
  38. package/dist/runtime/components/calendar/calendar.d.vue.ts +2 -2
  39. package/dist/runtime/components/calendar/calendar.vue +3 -10
  40. package/dist/runtime/components/calendar/calendar.vue.d.ts +2 -2
  41. package/dist/runtime/components/calendar/ui/core/calendar-cell.d.vue.ts +2 -2
  42. package/dist/runtime/components/calendar/ui/core/calendar-cell.vue +3 -114
  43. package/dist/runtime/components/calendar/ui/core/calendar-cell.vue.d.ts +2 -2
  44. package/dist/runtime/components/calendar/ui/core/calendar-header.vue +2 -67
  45. package/dist/runtime/components/calendar/ui/levels/calendar-decade.d.vue.ts +2 -2
  46. package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue +3 -25
  47. package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue.d.ts +2 -2
  48. package/dist/runtime/components/calendar/ui/levels/calendar-month.d.vue.ts +2 -2
  49. package/dist/runtime/components/calendar/ui/levels/calendar-month.vue +9 -34
  50. package/dist/runtime/components/calendar/ui/levels/calendar-month.vue.d.ts +2 -2
  51. package/dist/runtime/components/calendar/ui/levels/calendar-year.d.vue.ts +2 -2
  52. package/dist/runtime/components/calendar/ui/levels/calendar-year.vue +3 -25
  53. package/dist/runtime/components/calendar/ui/levels/calendar-year.vue.d.ts +2 -2
  54. package/dist/runtime/components/checkbox/checkbox-card.vue +2 -28
  55. package/dist/runtime/components/checkbox/checkbox-group.vue +3 -3
  56. package/dist/runtime/components/checkbox/checkbox-indicator.d.vue.ts +5 -4
  57. package/dist/runtime/components/checkbox/checkbox-indicator.vue +15 -123
  58. package/dist/runtime/components/checkbox/checkbox-indicator.vue.d.ts +5 -4
  59. package/dist/runtime/components/checkbox/checkbox.d.vue.ts +5 -7
  60. package/dist/runtime/components/checkbox/checkbox.vue +30 -136
  61. package/dist/runtime/components/checkbox/checkbox.vue.d.ts +5 -7
  62. package/dist/runtime/components/chip/chip.d.vue.ts +3 -2
  63. package/dist/runtime/components/chip/chip.vue +29 -212
  64. package/dist/runtime/components/chip/chip.vue.d.ts +3 -2
  65. package/dist/runtime/components/combobox/combobox-dropdown.vue +2 -4
  66. package/dist/runtime/components/container.d.vue.ts +2 -2
  67. package/dist/runtime/components/container.vue +1 -1
  68. package/dist/runtime/components/container.vue.d.ts +2 -2
  69. package/dist/runtime/components/date-time-picker.vue +6 -10
  70. package/dist/runtime/components/dialog/ui/dialog-close-button.vue +11 -7
  71. package/dist/runtime/components/dialog/ui/dialog-root.d.vue.ts +11 -9
  72. package/dist/runtime/components/dialog/ui/dialog-root.vue +5 -5
  73. package/dist/runtime/components/dialog/ui/dialog-root.vue.d.ts +11 -9
  74. package/dist/runtime/components/dialog/ui/dialog-title.vue +2 -2
  75. package/dist/runtime/components/drawer/drawer-close-button.vue +6 -6
  76. package/dist/runtime/components/drawer/drawer-root.vue +4 -4
  77. package/dist/runtime/components/drawer/drawer-title.vue +2 -2
  78. package/dist/runtime/components/files/file-upload-button.vue +8 -7
  79. package/dist/runtime/components/files/file-upload-icon.vue +5 -5
  80. package/dist/runtime/components/input/date-picker.vue +6 -10
  81. package/dist/runtime/components/input/email-input.vue +4 -4
  82. package/dist/runtime/components/input/lib/input-wrapper.context.d.ts +5 -5
  83. package/dist/runtime/components/input/number-input.vue +6 -84
  84. package/dist/runtime/components/input/password-input.vue +4 -4
  85. package/dist/runtime/components/input/text-input.vue +4 -4
  86. package/dist/runtime/components/input/ui/button-input.vue +6 -25
  87. package/dist/runtime/components/input/ui/input-base.vue +6 -265
  88. package/dist/runtime/components/input/ui/input-inline.d.vue.ts +2 -2
  89. package/dist/runtime/components/input/ui/input-inline.vue +3 -82
  90. package/dist/runtime/components/input/ui/input-inline.vue.d.ts +2 -2
  91. package/dist/runtime/components/input/ui/input-label.d.vue.ts +2 -2
  92. package/dist/runtime/components/input/ui/input-label.vue +1 -1
  93. package/dist/runtime/components/input/ui/input-label.vue.d.ts +2 -2
  94. package/dist/runtime/components/input/ui/input-wrapper.d.vue.ts +5 -1
  95. package/dist/runtime/components/input/ui/input-wrapper.vue +13 -65
  96. package/dist/runtime/components/input/ui/input-wrapper.vue.d.ts +5 -1
  97. package/dist/runtime/components/input/ui/spin-input.vue +2 -53
  98. package/dist/runtime/components/link/link-button.vue +9 -8
  99. package/dist/runtime/components/link/link.vue +2 -2
  100. package/dist/runtime/components/loader/loader.d.vue.ts +7 -7
  101. package/dist/runtime/components/loader/loader.vue +8 -7
  102. package/dist/runtime/components/loader/loader.vue.d.ts +7 -7
  103. package/dist/runtime/components/modal/modal-close-button.vue +6 -6
  104. package/dist/runtime/components/modal/modal-root.vue +4 -4
  105. package/dist/runtime/components/modal/modal-title.vue +2 -2
  106. package/dist/runtime/components/nav-link/nav-icon-link.vue +4 -4
  107. package/dist/runtime/components/nav-link/nav-link.d.vue.ts +6 -5
  108. package/dist/runtime/components/nav-link/nav-link.vue +30 -113
  109. package/dist/runtime/components/nav-link/nav-link.vue.d.ts +6 -5
  110. package/dist/runtime/components/paper.vue +2 -31
  111. package/dist/runtime/components/popover/popover-dropdown.vue +2 -54
  112. package/dist/runtime/components/progress/progress-root.d.vue.ts +3 -3
  113. package/dist/runtime/components/progress/progress-root.vue +2 -2
  114. package/dist/runtime/components/progress/progress-root.vue.d.ts +3 -3
  115. package/dist/runtime/components/progress/progress-section.d.vue.ts +3 -0
  116. package/dist/runtime/components/progress/progress-section.vue +8 -6
  117. package/dist/runtime/components/progress/progress-section.vue.d.ts +3 -0
  118. package/dist/runtime/components/progress/progress.vue +2 -2
  119. package/dist/runtime/components/select.vue +6 -10
  120. package/dist/runtime/components/switch/switch-group.vue +3 -3
  121. package/dist/runtime/components/switch/switch.d.vue.ts +3 -0
  122. package/dist/runtime/components/switch/switch.vue +15 -205
  123. package/dist/runtime/components/switch/switch.vue.d.ts +3 -0
  124. package/dist/runtime/components/table/types.d.ts +4 -3
  125. package/dist/runtime/components/table/ui/table-sortable-header.vue +9 -8
  126. package/dist/runtime/components/table/ui/table.vue +9 -174
  127. package/dist/runtime/components/tabs/tabs-root.d.vue.ts +14 -16
  128. package/dist/runtime/components/tabs/tabs-root.vue +14 -12
  129. package/dist/runtime/components/tabs/tabs-root.vue.d.ts +14 -16
  130. package/dist/runtime/components/text.d.vue.ts +10 -9
  131. package/dist/runtime/components/text.vue +16 -77
  132. package/dist/runtime/components/text.vue.d.ts +10 -9
  133. package/dist/runtime/components/textarea.vue +4 -4
  134. package/dist/runtime/components/time-picker/time-picker.vue +6 -132
  135. package/dist/runtime/components/title.vue +4 -8
  136. package/dist/runtime/components/tree/_ui/tree-item.vue +2 -62
  137. package/dist/runtime/components/tree/_ui/tree-root.d.vue.ts +7 -6
  138. package/dist/runtime/components/tree/_ui/tree-root.vue +13 -19
  139. package/dist/runtime/components/tree/_ui/tree-root.vue.d.ts +7 -6
  140. package/dist/runtime/components/tree/tree.vue +5 -5
  141. package/dist/runtime/composables/index.d.ts +1 -1
  142. package/dist/runtime/composables/index.js +1 -1
  143. package/dist/runtime/composables/use-vars-resolver.d.ts +4 -0
  144. package/dist/runtime/composables/use-vars-resolver.js +6 -0
  145. package/dist/runtime/types/index.d.ts +2 -2
  146. package/dist/runtime/types/styling.d.ts +6 -0
  147. package/dist/runtime/types/styling.js +0 -0
  148. package/dist/runtime/types/theme.d.ts +10 -15
  149. package/dist/runtime/utils/color/parse-theme-color.d.ts +2 -2
  150. package/dist/runtime/utils/style/create-variant-color-resolver.d.ts +2 -2
  151. package/package.json +2 -2
  152. package/dist/runtime/composables/use-style-resolver.d.ts +0 -6
  153. package/dist/runtime/composables/use-style-resolver.js +0 -5
@@ -57,71 +57,6 @@ defineEmits(["prev", "level", "next"]);
57
57
  </Box>
58
58
  </template>
59
59
 
60
- <style lang="postcss" module>
61
- .header {
62
- --dch-control-size-xs: rem(30px);
63
- --dch-control-size-sm: rem(36px);
64
- --dch-control-size-md: rem(42px);
65
- --dch-control-size-lg: rem(48px);
66
- --dch-control-size-xl: rem(54px);
67
- --dch-control-size: var(--dch-control-size-sm);
68
-
69
- --dch-control-radius: var(--radius-default);
70
-
71
- display: flex;
72
- }
73
-
74
- .level,
75
- .control {
76
- cursor: pointer;
77
- user-select: none;
78
-
79
- display: flex;
80
- align-items: center;
81
- justify-content: center;
82
-
83
- height: var(--dch-control-size);
84
- border-radius: var(--dch-control-radius);
85
-
86
- opacity: 1;
87
-
88
- &:where([data-static]) {
89
- cursor: default;
90
- }
91
-
92
- &:hover {
93
- &:where(:not([data-static], :disabled)) {
94
- @mixin light {
95
- background-color: var(--color-gray-0);
96
- }
97
-
98
- @mixin dark {
99
- background-color: var(--color-dark-5);
100
- }
101
- }
102
- }
103
-
104
- &:where(:disabled) {
105
- cursor: not-allowed;
106
-
107
- opacity: 0.2;
108
- }
109
- }
110
-
111
- .level {
112
- flex: 1;
113
-
114
- font-size: var(--dch-fz, var(--font-size-sm));
115
- font-weight: 500;
116
- text-transform: capitalize;
117
- }
118
-
119
- .control {
120
- width: var(--dch-control-size);
121
- }
122
-
123
- .icon {
124
- width: 60%;
125
- height: 60%;
126
- }
60
+ <style module>
61
+ .header{--dch-control-size-xs:rem(30px);--dch-control-size-sm:rem(36px);--dch-control-size-md:rem(42px);--dch-control-size-lg:rem(48px);--dch-control-size-xl:rem(54px);--dch-control-size:var(--dch-control-size-sm);--dch-control-radius:var(--radius-default);display:flex}.control,.level{align-items:center;border-radius:var(--dch-control-radius);cursor:pointer;display:flex;height:var(--dch-control-size);justify-content:center;opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none}.control:where([data-static]),.level:where([data-static]){cursor:default}.control:hover:where(:not([data-static],:disabled)),.level:hover:where(:not([data-static],:disabled)){@mixin light{background-color:var(--color-gray-0)}@mixin dark{background-color:var(--color-dark-5)}}.control:where(:disabled),.level:where(:disabled){cursor:not-allowed;opacity:.2}.level{flex:1;font-size:var(--dch-fz,var(--font-size-sm));font-weight:500;text-transform:capitalize}.control{width:var(--dch-control-size)}.icon{height:60%;width:60%}
127
62
  </style>
@@ -1,11 +1,11 @@
1
1
  import type { DateInput } from '@formkit/tempo';
2
- import type { NuanceSize } from '@nui/types';
2
+ import type { AnyString, NuanceSize } from '@nui/types';
3
3
  import type { CalendarCellProps } from '../core/index.js';
4
4
  export interface CalendarDecadeProps extends CalendarCellProps {
5
5
  /** Start date of the decade */
6
6
  date: DateInput;
7
7
  /** Component size */
8
- size?: NuanceSize | string;
8
+ size?: NuanceSize | AnyString;
9
9
  /** Allows selecting a year as the final value without drilling down */
10
10
  selectable?: boolean;
11
11
  }
@@ -8,7 +8,7 @@ import { useCalendarSelectionState } from "../../lib/use-calendar-selection";
8
8
  import { CalendarCell } from "../core";
9
9
  const { date, size, selectable } = defineProps({
10
10
  date: { type: [Date, String], required: true },
11
- size: { type: String, required: false },
11
+ size: { type: [String, Object], required: false },
12
12
  selectable: { type: Boolean, required: false },
13
13
  is: { type: null, required: false },
14
14
  mod: { type: [Object, Array, null], required: false }
@@ -78,28 +78,6 @@ function handleSelect(year) {
78
78
  </Box>
79
79
  </template>
80
80
 
81
- <style lang="postcss" module>
82
- .table {
83
- table-layout: fixed;
84
- }
85
-
86
- .year {
87
- --day-size-xs: 1.875rem;
88
- --day-size-sm: 2.25rem;
89
- --day-size-md: 2.625rem;
90
- --day-size-lg: 3rem;
91
- --day-size-xl: 3.375rem;
92
-
93
- cursor: pointer;
94
-
95
- display: flex;
96
- align-items: center;
97
- justify-content: center;
98
-
99
- width: calc((var(--day-size) * 7) / 3 + .09375rem);
100
-
101
- height: var(--day-size);
102
-
103
- text-transform: capitalize;
104
- }
81
+ <style module>
82
+ .table{table-layout:fixed}.year{--day-size-xs:1.875rem;--day-size-sm:2.25rem;--day-size-md:2.625rem;--day-size-lg:3rem;--day-size-xl:3.375rem;align-items:center;cursor:pointer;display:flex;height:var(--day-size);justify-content:center;text-transform:capitalize;width:calc((var(--day-size)*7)/3 + .09375rem)}
105
83
  </style>
@@ -1,11 +1,11 @@
1
1
  import type { DateInput } from '@formkit/tempo';
2
- import type { NuanceSize } from '@nui/types';
2
+ import type { AnyString, NuanceSize } from '@nui/types';
3
3
  import type { CalendarCellProps } from '../core/index.js';
4
4
  export interface CalendarDecadeProps extends CalendarCellProps {
5
5
  /** Start date of the decade */
6
6
  date: DateInput;
7
7
  /** Component size */
8
- size?: NuanceSize | string;
8
+ size?: NuanceSize | AnyString;
9
9
  /** Allows selecting a year as the final value without drilling down */
10
10
  selectable?: boolean;
11
11
  }
@@ -1,12 +1,12 @@
1
1
  import type { DateInput } from '@formkit/tempo';
2
- import type { NuanceSize } from '@nui/types';
2
+ import type { AnyString, NuanceSize } from '@nui/types';
3
3
  export interface CalendarMonthProps {
4
4
  /** ISO string of the month to render */
5
5
  month: string;
6
6
  /** Detects the presence of spaces between cells. @default `true` */
7
7
  withCellSpacing?: boolean;
8
8
  /** Component size */
9
- size?: NuanceSize | string;
9
+ size?: NuanceSize | AnyString;
10
10
  /** Determines whether week numbers should be displayed @default `false` */
11
11
  withWeekNumbers?: boolean;
12
12
  }
@@ -6,10 +6,15 @@ import Box from "../../../box.vue";
6
6
  import { useCalendarState } from "../../lib/context";
7
7
  import { useCalendarSelectionState } from "../../lib/use-calendar-selection";
8
8
  import { CalendarCell } from "../core";
9
- const { month, size, withWeekNumbers, withCellSpacing = true } = defineProps({
9
+ const {
10
+ month,
11
+ size,
12
+ withWeekNumbers,
13
+ withCellSpacing = true
14
+ } = defineProps({
10
15
  month: { type: String, required: true },
11
16
  withCellSpacing: { type: Boolean, required: false },
12
- size: { type: String, required: false },
17
+ size: { type: [String, Object], required: false },
13
18
  withWeekNumbers: { type: Boolean, required: false }
14
19
  });
15
20
  const emit = defineEmits(["select"]);
@@ -104,36 +109,6 @@ function handleSelect(event) {
104
109
  </table>
105
110
  </template>
106
111
 
107
- <style lang="postcss" module>
108
- .table {
109
- table-layout: fixed;
110
- border-collapse: collapse;
111
- }
112
-
113
- .row:where([data-selectable]):hover {
114
- @mixin light {
115
- background-color: var(--color-gray-0);
116
- }
117
-
118
- @mixin dark {
119
- background-color: var(--color-dark-5);
120
- }
121
- }
122
-
123
- .cell {
124
- padding: 0;
125
-
126
- &:where(&[data-with-spacing]) {
127
- padding: var(--calendar-cell-spacing);
128
- }
129
- }
130
-
131
- .weekday {
132
- padding-bottom: calc(var(--wr-spacing, var(--spacing-sm)) / 2);
133
-
134
- font-size: var(--wr-fz, var(--font-size-sm));
135
- font-weight: normal;
136
- color: var(--color-dimmed);
137
- text-transform: capitalize;
138
- }
112
+ <style module>
113
+ .table{border-collapse:collapse;table-layout:fixed}.row:where([data-selectable]):hover{@mixin light{background-color:var(--color-gray-0)}@mixin dark{background-color:var(--color-dark-5)}}.cell{padding:0}.cell:where(.cell[data-with-spacing]){padding:var(--calendar-cell-spacing)}.weekday{color:var(--color-dimmed);font-size:var(--wr-fz,var(--font-size-sm));font-weight:400;padding-bottom:calc(var(--wr-spacing, var(--spacing-sm))/2);text-transform:capitalize}
139
114
  </style>
@@ -1,12 +1,12 @@
1
1
  import type { DateInput } from '@formkit/tempo';
2
- import type { NuanceSize } from '@nui/types';
2
+ import type { AnyString, NuanceSize } from '@nui/types';
3
3
  export interface CalendarMonthProps {
4
4
  /** ISO string of the month to render */
5
5
  month: string;
6
6
  /** Detects the presence of spaces between cells. @default `true` */
7
7
  withCellSpacing?: boolean;
8
8
  /** Component size */
9
- size?: NuanceSize | string;
9
+ size?: NuanceSize | AnyString;
10
10
  /** Determines whether week numbers should be displayed @default `false` */
11
11
  withWeekNumbers?: boolean;
12
12
  }
@@ -1,11 +1,11 @@
1
1
  import type { DateInput } from '@formkit/tempo';
2
- import type { NuanceSize } from '@nui/types';
2
+ import type { AnyString, NuanceSize } from '@nui/types';
3
3
  import type { CalendarCellProps } from '../core/index.js';
4
4
  export interface CalendarYearProps extends CalendarCellProps {
5
5
  /** Year date used to generate the month grid */
6
6
  year: DateInput;
7
7
  /** Component size */
8
- size?: NuanceSize | string;
8
+ size?: NuanceSize | AnyString;
9
9
  /** Allows selecting a month as the final value without drilling down */
10
10
  selectable?: boolean;
11
11
  }
@@ -9,7 +9,7 @@ import { useCalendarSelectionState } from "../../lib/use-calendar-selection";
9
9
  import { CalendarCell } from "../core";
10
10
  const { year, size, selectable } = defineProps({
11
11
  year: { type: [Date, String], required: true },
12
- size: { type: String, required: false },
12
+ size: { type: [String, Object], required: false },
13
13
  selectable: { type: Boolean, required: false },
14
14
  is: { type: null, required: false },
15
15
  mod: { type: [Object, Array, null], required: false }
@@ -73,28 +73,6 @@ function handleSelect(month) {
73
73
  </Box>
74
74
  </template>
75
75
 
76
- <style lang="postcss" module>
77
- .table {
78
- table-layout: fixed;
79
- }
80
-
81
- .year {
82
- --day-size-xs: 1.875rem;
83
- --day-size-sm: 2.25rem;
84
- --day-size-md: 2.625rem;
85
- --day-size-lg: 3rem;
86
- --day-size-xl: 3.375rem;
87
-
88
- cursor: pointer;
89
-
90
- display: flex;
91
- align-items: center;
92
- justify-content: center;
93
-
94
- width: calc((var(--day-size) * 7) / 3 + .09375rem);
95
-
96
- height: var(--day-size);
97
-
98
- text-transform: capitalize;
99
- }
76
+ <style module>
77
+ .table{table-layout:fixed}.year{--day-size-xs:1.875rem;--day-size-sm:2.25rem;--day-size-md:2.625rem;--day-size-lg:3rem;--day-size-xl:3.375rem;align-items:center;cursor:pointer;display:flex;height:var(--day-size);justify-content:center;text-transform:capitalize;width:calc((var(--day-size)*7)/3 + .09375rem)}
100
78
  </style>
@@ -1,11 +1,11 @@
1
1
  import type { DateInput } from '@formkit/tempo';
2
- import type { NuanceSize } from '@nui/types';
2
+ import type { AnyString, NuanceSize } from '@nui/types';
3
3
  import type { CalendarCellProps } from '../core/index.js';
4
4
  export interface CalendarYearProps extends CalendarCellProps {
5
5
  /** Year date used to generate the month grid */
6
6
  year: DateInput;
7
7
  /** Component size */
8
- size?: NuanceSize | string;
8
+ size?: NuanceSize | AnyString;
9
9
  /** Allows selecting a month as the final value without drilling down */
10
10
  selectable?: boolean;
11
11
  }
@@ -60,32 +60,6 @@ const style = computed(() => ({
60
60
  </UnstyledButton>
61
61
  </template>
62
62
 
63
- <style module lang="postcss">
64
- .root {
65
- --card-radius: var(--radius-default);
66
-
67
- cursor: pointer;
68
-
69
- display: block;
70
-
71
- width: 100%;
72
-
73
- border-radius: var(--card-radius);
74
-
75
- & :where(*) {
76
- cursor: inherit;
77
- }
78
-
79
- &:where([data-with-border]) {
80
- border: 1px solid transparent;
81
-
82
- @mixin where-light {
83
- border-color: var(--color-gray-3);
84
- }
85
-
86
- @mixin where-dark {
87
- border-color: var(--color-dark-4);
88
- }
89
- }
90
- }
63
+ <style module>
64
+ .root{--card-radius:var(--radius-default);border-radius:var(--card-radius);cursor:pointer;display:block;width:100%}.root :where(*){cursor:inherit}.root:where([data-with-border]){border:1px solid transparent;@mixin where-light{border-color:var(--color-gray-3)}@mixin where-dark{border-color:var(--color-dark-4)}}
91
65
  </style>
@@ -20,10 +20,10 @@ const {
20
20
  description: { type: String, required: false },
21
21
  label: { type: String, required: false },
22
22
  required: { type: Boolean, required: false },
23
- radius: { type: String, required: false },
23
+ radius: { type: [String, Number, Object], required: false },
24
24
  variant: { type: String, required: false },
25
- leftSectionPE: { type: null, required: false },
26
- rightSectionPE: { type: null, required: false }
25
+ leftSectionPE: { type: void 0, required: false },
26
+ rightSectionPE: { type: void 0, required: false }
27
27
  });
28
28
  const value = defineModel({ type: Array, ...{ default: [] } });
29
29
  const id = useId();
@@ -1,17 +1,18 @@
1
- import type { NuanceColor, NuanceSize } from '@nui/types';
1
+ import type { AnyString, NuanceColor, NuanceRadius, NuanceSize } from '@nui/types';
2
+ type CheckboxIndicatorVariant = 'filled' | 'outline';
2
3
  export interface CheckboxIndicatorProps {
3
4
  /** Color from theme */
4
5
  color?: NuanceColor;
5
6
  /** Icon color */
6
7
  iconColor?: NuanceColor;
7
- /** Visual variant */
8
- variant?: 'filled' | 'outline';
9
8
  /** Border radius */
10
- radius?: NuanceSize;
9
+ radius?: NuanceRadius | AnyString;
11
10
  /** Component size */
12
11
  size?: NuanceSize;
13
12
  /** Displays indeterminate icon */
14
13
  indeterminate?: boolean;
14
+ /** Visual variant */
15
+ variant?: CheckboxIndicatorVariant;
15
16
  }
16
17
  type __VLS_Props = CheckboxIndicatorProps;
17
18
  type __VLS_ModelProps = {
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { useStyleResolver } from "@nui/composables";
2
+ import { useVarsResolver } from "@nui/composables";
3
3
  import { getRadius, getSize, getThemeColor, parseThemeColor } from "@nui/utils";
4
4
  import { computed } from "vue";
5
5
  import Box from "../box.vue";
@@ -14,10 +14,10 @@ const {
14
14
  } = defineProps({
15
15
  color: { type: null, required: false },
16
16
  iconColor: { type: null, required: false },
17
- variant: { type: String, required: false },
18
- radius: { type: String, required: false },
17
+ radius: { type: [String, Number, Object], required: false },
19
18
  size: { type: String, required: false },
20
- indeterminate: { type: Boolean, required: false }
19
+ indeterminate: { type: Boolean, required: false },
20
+ variant: { type: String, required: false }
21
21
  });
22
22
  const ctx = useCheckboxCardState();
23
23
  const modelValue = defineModel({ type: Boolean });
@@ -26,20 +26,22 @@ const checked = computed(() => {
26
26
  return ctx?.value.value;
27
27
  return modelValue.value;
28
28
  });
29
- const style = computed(() => useStyleResolver((theme) => {
29
+ const style = useVarsResolver((theme) => {
30
30
  const parsed = parseThemeColor({ color, theme });
31
31
  const outlineColor = parsed.isThemeColor && parsed.shade === void 0 ? `var(--color-${parsed.color}-outline)` : parsed.color;
32
32
  return {
33
- "--checkbox-size": getSize(size, "checkbox-size"),
34
- "--checkbox-radius": radius && getRadius(radius),
35
- "--checkbox-color": variant === "outline" ? outlineColor : getThemeColor(color, theme),
36
- "--checkbox-icon-color": iconColor ? getThemeColor(iconColor, theme) : void 0
33
+ root: {
34
+ "--checkbox-size": getSize(size, "checkbox-size"),
35
+ "--checkbox-radius": radius ? getRadius(radius) : void 0,
36
+ "--checkbox-color": variant === "outline" ? outlineColor : getThemeColor(color, theme),
37
+ "--checkbox-icon-color": iconColor ? getThemeColor(iconColor, theme) : void 0
38
+ }
37
39
  };
38
- }));
40
+ });
39
41
  </script>
40
42
 
41
43
  <template>
42
- <Box :style :class='$style.indicator' :mod='{ checked }'>
44
+ <Box :style='style.root' :class='$style.indicator' :mod='{ checked }'>
43
45
  <slot :indeterminate='indeterminate' :class='$style.icon' :mod='{ checked }'>
44
46
  <Icon v-if='!indeterminate' name='gravity-ui:check' :class='$style.icon' :mod='{ checked }' />
45
47
  <Icon v-else :class='$style.icon' name='gravity-ui:minus' :mod='{ checked }' />
@@ -47,116 +49,6 @@ const style = computed(() => useStyleResolver((theme) => {
47
49
  </Box>
48
50
  </template>
49
51
 
50
- <style module lang="postcss">
51
- .indicator {
52
- --checkbox-size-xs: rem(16px);
53
- --checkbox-size-sm: rem(20px);
54
- --checkbox-size-md: rem(24px);
55
- --checkbox-size-lg: rem(30px);
56
- --checkbox-size-xl: rem(36px);
57
-
58
- --checkbox-size: var(--checkbox-size-sm);
59
- --checkbox-color: var(--color-primary-filled);
60
- --checkbox-icon-color: var(--color-white);
61
-
62
- --checkbox-radius: var(--radius-default);
63
-
64
- position: relative;
65
-
66
- display: flex;
67
- align-items: center;
68
- justify-content: center;
69
-
70
- width: var(--checkbox-size);
71
- min-width: var(--checkbox-size);
72
- height: var(--checkbox-size);
73
- min-height: var(--checkbox-size);
74
-
75
- border: 1px solid transparent;
76
- border-radius: var(--checkbox-radius);
77
-
78
- transition: border-color 100ms ease,
79
- background-color 100ms ease;
80
- -webkit-tap-highlight-color: transparent;
81
-
82
- &[data-indeterminate],
83
- &[data-checked] {
84
- border-color: var(--checkbox-color);
85
-
86
- background-color: var(--checkbox-color);
87
-
88
- &>.icon {
89
- transform: none;
90
-
91
- color: var(--checkbox-icon-color);
92
-
93
- opacity: 1;
94
- }
95
- }
96
-
97
- &[data-disabled] {
98
- cursor: not-allowed;
99
-
100
- border-color: var(--color-disabled-border);
101
-
102
- background-color: var(--color-disabled);
103
-
104
- &[data-checked]>.icon {
105
- @mixin light {
106
- color: var(--color-gray-5);
107
- }
108
-
109
- @mixin dark {
110
- color: var(--color-dark-3);
111
- }
112
- }
113
- }
114
-
115
- @mixin where-light {
116
- border-color: var(--color-gray-4);
117
-
118
- background-color: var(--color-white);
119
- }
120
-
121
- @mixin where-dark {
122
- border-color: var(--color-dark-4);
123
-
124
- background-color: var(--color-dark-6);
125
- }
126
- }
127
-
128
- .indicator[data-variant='outline'] {
129
-
130
- &[data-indeterminate]:not([data-disabled]),
131
- &[data-checked]:not([data-disabled]) {
132
- border-color: var(--checkbox-color);
133
-
134
- background-color: transparent;
135
-
136
- &>.icon {
137
- transform: none;
138
-
139
- color: var(--checkbox-color);
140
-
141
- opacity: 1;
142
- }
143
- }
144
- }
145
-
146
- .icon {
147
- pointer-events: none;
148
-
149
- transform: translateY(.25rem) scale(0.5);
150
-
151
- display: block;
152
-
153
- width: 80%;
154
-
155
- color: transparent;
156
-
157
- opacity: 1;
158
-
159
- transition: transform 100ms ease,
160
- opacity 100ms ease;
161
- }
52
+ <style module>
53
+ .indicator{--checkbox-size-xs:rem(16px);--checkbox-size-sm:rem(20px);--checkbox-size-md:rem(24px);--checkbox-size-lg:rem(30px);--checkbox-size-xl:rem(36px);--checkbox-size:var(--checkbox-size-sm);--checkbox-color:var(--color-primary-filled);--checkbox-icon-color:var(--color-white);--checkbox-radius:var(--radius-default);align-items:center;border:1px solid transparent;border-radius:var(--checkbox-radius);display:flex;height:var(--checkbox-size);justify-content:center;min-height:var(--checkbox-size);min-width:var(--checkbox-size);position:relative;transition:border-color .1s ease,background-color .1s ease;width:var(--checkbox-size);-webkit-tap-highlight-color:transparent}.indicator[data-checked],.indicator[data-indeterminate]{background-color:var(--checkbox-color);border-color:var(--checkbox-color)}.indicator[data-checked]>.icon,.indicator[data-indeterminate]>.icon{color:var(--checkbox-icon-color);opacity:1;transform:none}.indicator[data-disabled]{background-color:var(--color-disabled);border-color:var(--color-disabled-border);cursor:not-allowed}.indicator[data-disabled][data-checked]>.icon{@mixin light{color:var(--color-gray-5)}@mixin dark{color:var(--color-dark-3)}}.indicator{@mixin where-light{background-color:var(--color-white);border-color:var(--color-gray-4)}}.indicator{@mixin where-dark{background-color:var(--color-dark-6);border-color:var(--color-dark-4)}}.indicator[data-variant=outline][data-checked]:not([data-disabled]),.indicator[data-variant=outline][data-indeterminate]:not([data-disabled]){background-color:transparent;border-color:var(--checkbox-color)}.indicator[data-variant=outline][data-checked]:not([data-disabled])>.icon,.indicator[data-variant=outline][data-indeterminate]:not([data-disabled])>.icon{color:var(--checkbox-color);opacity:1;transform:none}.icon{color:transparent;display:block;opacity:1;pointer-events:none;transform:translateY(.25rem) scale(.5);transition:transform .1s ease,opacity .1s ease;width:80%}
162
54
  </style>
@@ -1,17 +1,18 @@
1
- import type { NuanceColor, NuanceSize } from '@nui/types';
1
+ import type { AnyString, NuanceColor, NuanceRadius, NuanceSize } from '@nui/types';
2
+ type CheckboxIndicatorVariant = 'filled' | 'outline';
2
3
  export interface CheckboxIndicatorProps {
3
4
  /** Color from theme */
4
5
  color?: NuanceColor;
5
6
  /** Icon color */
6
7
  iconColor?: NuanceColor;
7
- /** Visual variant */
8
- variant?: 'filled' | 'outline';
9
8
  /** Border radius */
10
- radius?: NuanceSize;
9
+ radius?: NuanceRadius | AnyString;
11
10
  /** Component size */
12
11
  size?: NuanceSize;
13
12
  /** Displays indeterminate icon */
14
13
  indeterminate?: boolean;
14
+ /** Visual variant */
15
+ variant?: CheckboxIndicatorVariant;
15
16
  }
16
17
  type __VLS_Props = CheckboxIndicatorProps;
17
18
  type __VLS_ModelProps = {
@@ -1,5 +1,6 @@
1
- import type { NuanceColor, NuanceSize } from '@nui/types';
1
+ import type { AnyString, NuanceColor, NuanceRadius, NuanceSize } from '@nui/types';
2
2
  import type { InlineInputProps } from '../input/index.js';
3
+ export type CheckboxVariant = 'filled' | 'outline';
3
4
  export interface CheckboxProps extends Omit<InlineInputProps, 'id'> {
4
5
  /** Id used to bind input and label, auto-generated if not provided */
5
6
  id?: string;
@@ -7,13 +8,8 @@ export interface CheckboxProps extends Omit<InlineInputProps, 'id'> {
7
8
  color?: NuanceColor;
8
9
  /** Icon color */
9
10
  iconColor?: NuanceColor;
10
- /**
11
- * Visual variant
12
- * @default `'filled'`
13
- */
14
- variant?: 'filled' | 'outline';
15
11
  /** Border radius */
16
- radius?: NuanceSize;
12
+ radius?: NuanceRadius | AnyString;
17
13
  /**
18
14
  * Component size
19
15
  * @default `'sm'`
@@ -21,6 +17,8 @@ export interface CheckboxProps extends Omit<InlineInputProps, 'id'> {
21
17
  size?: NuanceSize;
22
18
  /** Value used in checkbox group context */
23
19
  value?: string;
20
+ /** Visual variant */
21
+ variant?: CheckboxVariant;
24
22
  }
25
23
  type __VLS_Props = CheckboxProps;
26
24
  type __VLS_ModelProps = {