nuance-ui 0.2.7 → 0.2.9

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 (172) hide show
  1. package/LICENSE.md +9 -9
  2. package/README.md +75 -75
  3. package/dist/module.json +1 -1
  4. package/dist/runtime/components/action-icon/action-icon-group.vue +3 -3
  5. package/dist/runtime/components/action-icon/action-icon.d.vue.ts +1 -1
  6. package/dist/runtime/components/action-icon/action-icon.vue.d.ts +1 -1
  7. package/dist/runtime/components/app-shell/app-shell-aside.vue +30 -30
  8. package/dist/runtime/components/app-shell/app-shell-footer.vue +29 -29
  9. package/dist/runtime/components/app-shell/app-shell-header.vue +30 -30
  10. package/dist/runtime/components/app-shell/app-shell-main.vue +18 -18
  11. package/dist/runtime/components/app-shell/app-shell-navbar.vue +34 -34
  12. package/dist/runtime/components/app-shell/app-shell-section.vue +10 -10
  13. package/dist/runtime/components/app-shell/app-shell.vue +34 -34
  14. package/dist/runtime/components/breadcrumbs.vue +78 -78
  15. package/dist/runtime/components/button/button.d.vue.ts +5 -3
  16. package/dist/runtime/components/button/button.vue +7 -3
  17. package/dist/runtime/components/button/button.vue.d.ts +5 -3
  18. package/dist/runtime/components/button/unstyled-button.vue +23 -23
  19. package/dist/runtime/components/calendar/calendar.d.vue.ts +1 -1
  20. package/dist/runtime/components/calendar/calendar.vue.d.ts +1 -1
  21. package/dist/runtime/components/calendar/types.d.ts +4 -3
  22. package/dist/runtime/components/calendar/ui/core/calendar-header.d.vue.ts +7 -1
  23. package/dist/runtime/components/calendar/ui/core/calendar-header.vue +95 -95
  24. package/dist/runtime/components/calendar/ui/core/calendar-header.vue.d.ts +7 -1
  25. package/dist/runtime/components/calendar/ui/core/calendar-root.vue +3 -3
  26. package/dist/runtime/components/calendar/ui/levels/calendar-decade.d.vue.ts +3 -1
  27. package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue +40 -40
  28. package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue.d.ts +3 -1
  29. package/dist/runtime/components/calendar/ui/levels/calendar-month.d.vue.ts +2 -1
  30. package/dist/runtime/components/calendar/ui/levels/calendar-month.vue.d.ts +2 -1
  31. package/dist/runtime/components/calendar/ui/levels/calendar-year.d.vue.ts +3 -1
  32. package/dist/runtime/components/calendar/ui/levels/calendar-year.vue +40 -40
  33. package/dist/runtime/components/calendar/ui/levels/calendar-year.vue.d.ts +3 -1
  34. package/dist/runtime/components/card/card-section.d.vue.ts +2 -1
  35. package/dist/runtime/components/card/card-section.vue +3 -3
  36. package/dist/runtime/components/card/card-section.vue.d.ts +2 -1
  37. package/dist/runtime/components/card/card.d.vue.ts +1 -0
  38. package/dist/runtime/components/card/card.vue +3 -3
  39. package/dist/runtime/components/card/card.vue.d.ts +1 -0
  40. package/dist/runtime/components/checkbox/checkbox-card.d.vue.ts +4 -1
  41. package/dist/runtime/components/checkbox/checkbox-card.vue.d.ts +4 -1
  42. package/dist/runtime/components/checkbox/checkbox-indicator.d.vue.ts +6 -0
  43. package/dist/runtime/components/checkbox/checkbox-indicator.vue +117 -117
  44. package/dist/runtime/components/checkbox/checkbox-indicator.vue.d.ts +6 -0
  45. package/dist/runtime/components/checkbox/checkbox.d.vue.ts +12 -2
  46. package/dist/runtime/components/checkbox/checkbox.vue.d.ts +12 -2
  47. package/dist/runtime/components/chip/chip-group.d.vue.ts +3 -0
  48. package/dist/runtime/components/chip/chip-group.vue +2 -2
  49. package/dist/runtime/components/chip/chip-group.vue.d.ts +3 -0
  50. package/dist/runtime/components/chip/chip.d.vue.ts +9 -0
  51. package/dist/runtime/components/chip/chip.vue.d.ts +9 -0
  52. package/dist/runtime/components/combobox/combobox-dropdown.vue +14 -14
  53. package/dist/runtime/components/combobox/combobox-empty.vue +3 -3
  54. package/dist/runtime/components/combobox/combobox-group.d.vue.ts +1 -0
  55. package/dist/runtime/components/combobox/combobox-group.vue +21 -21
  56. package/dist/runtime/components/combobox/combobox-group.vue.d.ts +1 -0
  57. package/dist/runtime/components/combobox/combobox-option-list.vue +3 -3
  58. package/dist/runtime/components/combobox/combobox-option.d.vue.ts +3 -0
  59. package/dist/runtime/components/combobox/combobox-option.vue +22 -22
  60. package/dist/runtime/components/combobox/combobox-option.vue.d.ts +3 -0
  61. package/dist/runtime/components/combobox/combobox-options-dropdown.d.vue.ts +10 -0
  62. package/dist/runtime/components/combobox/combobox-options-dropdown.vue.d.ts +10 -0
  63. package/dist/runtime/components/combobox/combobox-root.d.vue.ts +8 -4
  64. package/dist/runtime/components/combobox/combobox-root.vue +3 -3
  65. package/dist/runtime/components/combobox/combobox-root.vue.d.ts +8 -4
  66. package/dist/runtime/components/combobox/combobox-target.vue +3 -3
  67. package/dist/runtime/components/combobox/types.d.ts +11 -0
  68. package/dist/runtime/components/container.d.vue.ts +2 -0
  69. package/dist/runtime/components/container.vue +8 -8
  70. package/dist/runtime/components/container.vue.d.ts +2 -0
  71. package/dist/runtime/components/date-time-picker.d.vue.ts +3 -3
  72. package/dist/runtime/components/date-time-picker.vue +66 -66
  73. package/dist/runtime/components/date-time-picker.vue.d.ts +3 -3
  74. package/dist/runtime/components/dialog/types.d.ts +1 -0
  75. package/dist/runtime/components/dialog/ui/dialog-close-button.vue +11 -11
  76. package/dist/runtime/components/dialog/ui/dialog-header.vue +5 -5
  77. package/dist/runtime/components/dialog/ui/dialog-title.vue +5 -5
  78. package/dist/runtime/components/drawer/drawer-close-button.vue +3 -3
  79. package/dist/runtime/components/drawer/drawer-header.vue +3 -3
  80. package/dist/runtime/components/drawer/drawer-root.vue +15 -15
  81. package/dist/runtime/components/drawer/drawer-title.vue +3 -3
  82. package/dist/runtime/components/files/file-upload-button.d.vue.ts +4 -2
  83. package/dist/runtime/components/files/file-upload-button.vue.d.ts +4 -2
  84. package/dist/runtime/components/files/file-upload-icon.d.vue.ts +4 -2
  85. package/dist/runtime/components/files/file-upload-icon.vue.d.ts +4 -2
  86. package/dist/runtime/components/input/date-picker.vue +85 -85
  87. package/dist/runtime/components/input/email-input.d.vue.ts +5 -5
  88. package/dist/runtime/components/input/email-input.vue +21 -22
  89. package/dist/runtime/components/input/email-input.vue.d.ts +5 -5
  90. package/dist/runtime/components/input/lib/input-wrapper.context.d.ts +8 -2
  91. package/dist/runtime/components/input/number-input.d.vue.ts +7 -5
  92. package/dist/runtime/components/input/number-input.vue +136 -132
  93. package/dist/runtime/components/input/number-input.vue.d.ts +7 -5
  94. package/dist/runtime/components/input/password-input.vue +29 -28
  95. package/dist/runtime/components/input/text-input.d.vue.ts +7 -5
  96. package/dist/runtime/components/input/text-input.vue +6 -3
  97. package/dist/runtime/components/input/text-input.vue.d.ts +7 -5
  98. package/dist/runtime/components/input/ui/input-inline.d.vue.ts +7 -3
  99. package/dist/runtime/components/input/ui/input-inline.vue.d.ts +7 -3
  100. package/dist/runtime/components/input/ui/input-wrapper.d.vue.ts +4 -1
  101. package/dist/runtime/components/input/ui/input-wrapper.vue.d.ts +4 -1
  102. package/dist/runtime/components/link/link-button.vue +17 -16
  103. package/dist/runtime/components/link/link.vue +10 -10
  104. package/dist/runtime/components/loader/_loaders/bars-loader.vue +5 -5
  105. package/dist/runtime/components/loader/_loaders/dots-loader.vue +5 -5
  106. package/dist/runtime/components/loader/_loaders/oval-loader.vue +1 -1
  107. package/dist/runtime/components/modal/modal-close-button.vue +3 -3
  108. package/dist/runtime/components/modal/modal-header.vue +3 -3
  109. package/dist/runtime/components/modal/modal-root.vue +13 -13
  110. package/dist/runtime/components/modal/modal-title.vue +3 -3
  111. package/dist/runtime/components/nav-link/nav-icon-link.vue +15 -15
  112. package/dist/runtime/components/nav-link/nav-link.d.vue.ts +6 -4
  113. package/dist/runtime/components/nav-link/nav-link.vue +135 -131
  114. package/dist/runtime/components/nav-link/nav-link.vue.d.ts +6 -4
  115. package/dist/runtime/components/paper.d.vue.ts +3 -1
  116. package/dist/runtime/components/paper.vue.d.ts +3 -1
  117. package/dist/runtime/components/popover/popover-dropdown.vue +69 -70
  118. package/dist/runtime/components/popover/popover-target.vue +8 -8
  119. package/dist/runtime/components/popover/popover.vue +1 -1
  120. package/dist/runtime/components/progress/progress-label.vue +3 -3
  121. package/dist/runtime/components/progress/progress-root.vue +3 -3
  122. package/dist/runtime/components/progress/progress-section.d.vue.ts +1 -1
  123. package/dist/runtime/components/progress/progress-section.vue +8 -8
  124. package/dist/runtime/components/progress/progress-section.vue.d.ts +1 -1
  125. package/dist/runtime/components/progress/progress.vue +9 -9
  126. package/dist/runtime/components/renderless/renderless.vue +3 -3
  127. package/dist/runtime/components/roving-focus/roving-focus-item.vue +14 -14
  128. package/dist/runtime/components/select.d.vue.ts +2 -0
  129. package/dist/runtime/components/select.vue.d.ts +2 -0
  130. package/dist/runtime/components/switch/switch-group.vue +16 -16
  131. package/dist/runtime/components/table/table.d.ts +30 -30
  132. package/dist/runtime/components/table/types.d.ts +10 -1
  133. package/dist/runtime/components/table/ui/table-sortable-header.vue +12 -11
  134. package/dist/runtime/components/tabs/tabs-list.d.vue.ts +2 -0
  135. package/dist/runtime/components/tabs/tabs-list.vue +10 -10
  136. package/dist/runtime/components/tabs/tabs-list.vue.d.ts +2 -0
  137. package/dist/runtime/components/tabs/tabs-panel.d.vue.ts +1 -0
  138. package/dist/runtime/components/tabs/tabs-panel.vue +11 -11
  139. package/dist/runtime/components/tabs/tabs-panel.vue.d.ts +1 -0
  140. package/dist/runtime/components/tabs/tabs-root.d.vue.ts +36 -9
  141. package/dist/runtime/components/tabs/tabs-root.vue +8 -8
  142. package/dist/runtime/components/tabs/tabs-root.vue.d.ts +36 -9
  143. package/dist/runtime/components/tabs/tabs-tab.d.vue.ts +7 -3
  144. package/dist/runtime/components/tabs/tabs-tab.vue +25 -22
  145. package/dist/runtime/components/tabs/tabs-tab.vue.d.ts +7 -3
  146. package/dist/runtime/components/text.d.vue.ts +6 -1
  147. package/dist/runtime/components/text.vue +67 -67
  148. package/dist/runtime/components/text.vue.d.ts +6 -1
  149. package/dist/runtime/components/textarea.d.vue.ts +7 -5
  150. package/dist/runtime/components/textarea.vue +38 -35
  151. package/dist/runtime/components/textarea.vue.d.ts +7 -5
  152. package/dist/runtime/components/title.d.vue.ts +5 -0
  153. package/dist/runtime/components/title.vue +14 -14
  154. package/dist/runtime/components/title.vue.d.ts +5 -0
  155. package/dist/runtime/components/transition.d.vue.ts +12 -2
  156. package/dist/runtime/components/transition.vue +3 -3
  157. package/dist/runtime/components/transition.vue.d.ts +12 -2
  158. package/dist/runtime/components/tree/_ui/tree-item.d.vue.ts +1 -0
  159. package/dist/runtime/components/tree/_ui/tree-item.vue +128 -129
  160. package/dist/runtime/components/tree/_ui/tree-item.vue.d.ts +1 -0
  161. package/dist/runtime/components/tree/_ui/tree-root.d.vue.ts +8 -0
  162. package/dist/runtime/components/tree/_ui/tree-root.vue +21 -21
  163. package/dist/runtime/components/tree/_ui/tree-root.vue.d.ts +8 -0
  164. package/dist/runtime/components/tree/lib/context.d.ts +15 -0
  165. package/dist/runtime/components/tree/types.d.ts +9 -0
  166. package/dist/runtime/components/visually-hidden/visually-hidden-input.d.vue.ts +2 -0
  167. package/dist/runtime/components/visually-hidden/visually-hidden-input.vue.d.ts +2 -0
  168. package/dist/runtime/components/visually-hidden/visually-hidden.d.vue.ts +1 -0
  169. package/dist/runtime/components/visually-hidden/visually-hidden.vue +9 -9
  170. package/dist/runtime/components/visually-hidden/visually-hidden.vue.d.ts +1 -0
  171. package/dist/runtime/styles/dark-theme.css +1 -1
  172. package/package.json +1 -1
@@ -53,53 +53,53 @@ function handleSelect(year) {
53
53
  </script>
54
54
 
55
55
  <template>
56
- <Box is='table' role='grid' tabindex='-1' :class='$style.table'>
57
- <tbody>
58
- <tr v-for='(years, yearsIx) in yearList' :key='`decade-${yearsIx}`'>
59
- <td v-for='year in years' :key='year'>
60
- <CalendarCell
61
- :class='$style.year'
56
+ <Box is='table' role='grid' tabindex='-1' :class='$style.table'>
57
+ <tbody>
58
+ <tr v-for='(years, yearsIx) in yearList' :key='`decade-${yearsIx}`'>
59
+ <td v-for='year in years' :key='year'>
60
+ <CalendarCell
61
+ :class='$style.year'
62
62
  :mod='{
63
63
  "today": isToday(year),
64
64
  "selected": isSelected(year),
65
65
  "in-range": isInRange(year),
66
66
  "first-in-range": isFirstInRange(year),
67
67
  "last-in-range": isLastInRange(year)
68
- }'
69
- :disabled='isDisabled(year)'
70
- :size
71
- @click='handleSelect(year)'
72
- >
73
- {{ year }}
74
- </CalendarCell>
75
- </td>
76
- </tr>
77
- </tbody>
78
- </Box>
68
+ }'
69
+ :disabled='isDisabled(year)'
70
+ :size
71
+ @click='handleSelect(year)'
72
+ >
73
+ {{ year }}
74
+ </CalendarCell>
75
+ </td>
76
+ </tr>
77
+ </tbody>
78
+ </Box>
79
79
  </template>
80
80
 
81
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
- }
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
+ }
105
105
  </style>
@@ -2,9 +2,11 @@ import type { DateInput } from '@formkit/tempo';
2
2
  import type { NuanceSize } from '@nui/types';
3
3
  import type { CalendarCellProps } from '../core/index.js';
4
4
  export interface CalendarDecadeProps extends CalendarCellProps {
5
+ /** Start date of the decade */
5
6
  date: DateInput;
6
- /** Controls size */
7
+ /** Component size */
7
8
  size?: NuanceSize | string;
9
+ /** Allows selecting a year as the final value without drilling down */
8
10
  selectable?: boolean;
9
11
  }
10
12
  declare const __VLS_export: import("vue").DefineComponent<CalendarDecadeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -1,10 +1,11 @@
1
1
  import type { DateInput } from '@formkit/tempo';
2
2
  import type { NuanceSize } from '@nui/types';
3
3
  export interface CalendarMonthProps {
4
+ /** ISO string of the month to render */
4
5
  month: string;
5
6
  /** Detects the presence of spaces between cells. @default `true` */
6
7
  withCellSpacing?: boolean;
7
- /** Controls size */
8
+ /** Component size */
8
9
  size?: NuanceSize | string;
9
10
  /** Determines whether week numbers should be displayed @default `false` */
10
11
  withWeekNumbers?: boolean;
@@ -1,10 +1,11 @@
1
1
  import type { DateInput } from '@formkit/tempo';
2
2
  import type { NuanceSize } from '@nui/types';
3
3
  export interface CalendarMonthProps {
4
+ /** ISO string of the month to render */
4
5
  month: string;
5
6
  /** Detects the presence of spaces between cells. @default `true` */
6
7
  withCellSpacing?: boolean;
7
- /** Controls size */
8
+ /** Component size */
8
9
  size?: NuanceSize | string;
9
10
  /** Determines whether week numbers should be displayed @default `false` */
10
11
  withWeekNumbers?: boolean;
@@ -2,9 +2,11 @@ import type { DateInput } from '@formkit/tempo';
2
2
  import type { NuanceSize } from '@nui/types';
3
3
  import type { CalendarCellProps } from '../core/index.js';
4
4
  export interface CalendarYearProps extends CalendarCellProps {
5
+ /** Year date used to generate the month grid */
5
6
  year: DateInput;
6
- /** Controls size */
7
+ /** Component size */
7
8
  size?: NuanceSize | string;
9
+ /** Allows selecting a month as the final value without drilling down */
8
10
  selectable?: boolean;
9
11
  }
10
12
  declare const __VLS_export: import("vue").DefineComponent<CalendarYearProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -48,53 +48,53 @@ function handleSelect(month) {
48
48
  </script>
49
49
 
50
50
  <template>
51
- <Box is='table' role='grid' tabindex='-1' :class='$style.table'>
52
- <tbody>
53
- <tr v-for='(months, seasonIx) in monthList' :key='`${year}-${seasonIx}`'>
54
- <td v-for='month in months' :key='`${year}-${month.ix}`'>
55
- <CalendarCell
56
- :class='$style.year'
51
+ <Box is='table' role='grid' tabindex='-1' :class='$style.table'>
52
+ <tbody>
53
+ <tr v-for='(months, seasonIx) in monthList' :key='`${year}-${seasonIx}`'>
54
+ <td v-for='month in months' :key='`${year}-${month.ix}`'>
55
+ <CalendarCell
56
+ :class='$style.year'
57
57
  :mod='{
58
58
  "today": isToday(month.ix),
59
59
  "selected": isSelected(month.ix),
60
60
  "in-range": isInRange(month.ix),
61
61
  "first-in-range": isFirstInRange(month.ix),
62
62
  "last-in-range": isLastInRange(month.ix)
63
- }'
64
- :disabled='isDisabled(month.ix)'
65
- :size
66
- @click='handleSelect(month.ix)'
67
- >
68
- {{ month.label }}
69
- </CalendarCell>
70
- </td>
71
- </tr>
72
- </tbody>
73
- </Box>
63
+ }'
64
+ :disabled='isDisabled(month.ix)'
65
+ :size
66
+ @click='handleSelect(month.ix)'
67
+ >
68
+ {{ month.label }}
69
+ </CalendarCell>
70
+ </td>
71
+ </tr>
72
+ </tbody>
73
+ </Box>
74
74
  </template>
75
75
 
76
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
- }
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
+ }
100
100
  </style>
@@ -2,9 +2,11 @@ import type { DateInput } from '@formkit/tempo';
2
2
  import type { NuanceSize } from '@nui/types';
3
3
  import type { CalendarCellProps } from '../core/index.js';
4
4
  export interface CalendarYearProps extends CalendarCellProps {
5
+ /** Year date used to generate the month grid */
5
6
  year: DateInput;
6
- /** Controls size */
7
+ /** Component size */
7
8
  size?: NuanceSize | string;
9
+ /** Allows selecting a month as the final value without drilling down */
8
10
  selectable?: boolean;
9
11
  }
10
12
  declare const __VLS_export: import("vue").DefineComponent<CalendarYearProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -1,7 +1,8 @@
1
1
  import type { BoxProps } from '../box.vue.js';
2
2
  export interface CardSectionProps extends BoxProps {
3
+ /** Shows a top border */
3
4
  withBorder?: boolean;
4
- /** Determines whether the section should inherit padding from the parent `UiCard`, `false` by default */
5
+ /** Inherits horizontal padding from the parent card */
5
6
  inheritPadding?: boolean;
6
7
  }
7
8
  declare var __VLS_8: {};
@@ -10,7 +10,7 @@ const { is = "section", mod, inheritPadding, withBorder } = defineProps({
10
10
  </script>
11
11
 
12
12
  <template>
13
- <Box :is :class='css.section' :mod='[mod, { "with-border": withBorder, "inherit-padding": inheritPadding }]'>
14
- <slot />
15
- </Box>
13
+ <Box :is :class='css.section' :mod='[mod, { "with-border": withBorder, "inherit-padding": inheritPadding }]'>
14
+ <slot />
15
+ </Box>
16
16
  </template>
@@ -1,7 +1,8 @@
1
1
  import type { BoxProps } from '../box.vue.js';
2
2
  export interface CardSectionProps extends BoxProps {
3
+ /** Shows a top border */
3
4
  withBorder?: boolean;
4
- /** Determines whether the section should inherit padding from the parent `UiCard`, `false` by default */
5
+ /** Inherits horizontal padding from the parent card */
5
6
  inheritPadding?: boolean;
6
7
  }
7
8
  declare var __VLS_8: {};
@@ -1,6 +1,7 @@
1
1
  import type { NuanceSpacing } from '@nui/types';
2
2
  import type { PaperProps } from '../paper.vue.js';
3
3
  export interface CardProps extends PaperProps {
4
+ /** Padding token */
4
5
  padding?: NuanceSpacing;
5
6
  }
6
7
  declare var __VLS_8: {};
@@ -17,7 +17,7 @@ const style = computed(() => ({
17
17
  </script>
18
18
 
19
19
  <template>
20
- <Paper :is :style :class='css.root' v-bind='rest'>
21
- <slot />
22
- </Paper>
20
+ <Paper :is :style :class='css.root' v-bind='rest'>
21
+ <slot />
22
+ </Paper>
23
23
  </template>
@@ -1,6 +1,7 @@
1
1
  import type { NuanceSpacing } from '@nui/types';
2
2
  import type { PaperProps } from '../paper.vue.js';
3
3
  export interface CardProps extends PaperProps {
4
+ /** Padding token */
4
5
  padding?: NuanceSpacing;
5
6
  }
6
7
  declare var __VLS_8: {};
@@ -1,12 +1,15 @@
1
1
  import type { NuanceRadius } from '@nui/types';
2
2
  import type { Mod } from '@nui/utils';
3
3
  export interface CheckboxCardProps {
4
+ /** Element modifiers transformed into `data-` attributes, falsy values are removed */
4
5
  mod?: Mod | Mod[];
6
+ /** Shows a border around the card */
5
7
  withBorder?: boolean;
6
8
  /** Border radius */
7
9
  radius?: NuanceRadius;
8
- /** Disabled input prop */
10
+ /** Disables the component */
9
11
  disabled?: boolean | undefined;
12
+ /** Value used in checkbox group context */
10
13
  value?: string;
11
14
  }
12
15
  type __VLS_Props = CheckboxCardProps;
@@ -1,12 +1,15 @@
1
1
  import type { NuanceRadius } from '@nui/types';
2
2
  import type { Mod } from '@nui/utils';
3
3
  export interface CheckboxCardProps {
4
+ /** Element modifiers transformed into `data-` attributes, falsy values are removed */
4
5
  mod?: Mod | Mod[];
6
+ /** Shows a border around the card */
5
7
  withBorder?: boolean;
6
8
  /** Border radius */
7
9
  radius?: NuanceRadius;
8
- /** Disabled input prop */
10
+ /** Disables the component */
9
11
  disabled?: boolean | undefined;
12
+ /** Value used in checkbox group context */
10
13
  value?: string;
11
14
  }
12
15
  type __VLS_Props = CheckboxCardProps;
@@ -1,10 +1,16 @@
1
1
  import type { NuanceColor, NuanceSize } from '@nui/types';
2
2
  export interface CheckboxIndicatorProps {
3
+ /** Color from theme */
3
4
  color?: NuanceColor;
5
+ /** Icon color */
4
6
  iconColor?: NuanceColor;
7
+ /** Visual variant */
5
8
  variant?: 'filled' | 'outline';
9
+ /** Border radius */
6
10
  radius?: NuanceSize;
11
+ /** Component size */
7
12
  size?: NuanceSize;
13
+ /** Displays indeterminate icon */
8
14
  indeterminate?: boolean;
9
15
  }
10
16
  type __VLS_Props = CheckboxIndicatorProps;
@@ -39,124 +39,124 @@ const style = computed(() => useStyleResolver((theme) => {
39
39
  </script>
40
40
 
41
41
  <template>
42
- <Box :style :class='$style.indicator' :mod='{ checked }'>
43
- <slot :indeterminate='indeterminate' :class='$style.icon' :mod='{ checked }'>
44
- <Icon v-if='!indeterminate' name='gravity-ui:check' :class='$style.icon' :mod='{ checked }' />
45
- <Icon v-else :class='$style.icon' name='gravity-ui:minus' :mod='{ checked }' />
46
- </slot>
47
- </Box>
42
+ <Box :style :class='$style.indicator' :mod='{ checked }'>
43
+ <slot :indeterminate='indeterminate' :class='$style.icon' :mod='{ checked }'>
44
+ <Icon v-if='!indeterminate' name='gravity-ui:check' :class='$style.icon' :mod='{ checked }' />
45
+ <Icon v-else :class='$style.icon' name='gravity-ui:minus' :mod='{ checked }' />
46
+ </slot>
47
+ </Box>
48
48
  </template>
49
49
 
50
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
- }
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
+ }
162
162
  </style>
@@ -1,10 +1,16 @@
1
1
  import type { NuanceColor, NuanceSize } from '@nui/types';
2
2
  export interface CheckboxIndicatorProps {
3
+ /** Color from theme */
3
4
  color?: NuanceColor;
5
+ /** Icon color */
4
6
  iconColor?: NuanceColor;
7
+ /** Visual variant */
5
8
  variant?: 'filled' | 'outline';
9
+ /** Border radius */
6
10
  radius?: NuanceSize;
11
+ /** Component size */
7
12
  size?: NuanceSize;
13
+ /** Displays indeterminate icon */
8
14
  indeterminate?: boolean;
9
15
  }
10
16
  type __VLS_Props = CheckboxIndicatorProps;
@@ -3,13 +3,23 @@ import type { InlineInputProps } from '../input/index.js';
3
3
  export interface CheckboxProps extends Omit<InlineInputProps, 'id'> {
4
4
  /** Id used to bind input and label, auto-generated if not provided */
5
5
  id?: string;
6
+ /** Color from theme */
6
7
  color?: NuanceColor;
8
+ /** Icon color */
7
9
  iconColor?: NuanceColor;
8
- /** Visual variant @default 'filled' */
10
+ /**
11
+ * Visual variant
12
+ * @default `'filled'`
13
+ */
9
14
  variant?: 'filled' | 'outline';
15
+ /** Border radius */
10
16
  radius?: NuanceSize;
11
- /** Component size @default 'sm' */
17
+ /**
18
+ * Component size
19
+ * @default `'sm'`
20
+ */
12
21
  size?: NuanceSize;
22
+ /** Value used in checkbox group context */
13
23
  value?: string;
14
24
  }
15
25
  type __VLS_Props = CheckboxProps;