nuance-ui 0.2.7 → 0.2.8

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 (118) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/action-icon/action-icon.d.vue.ts +1 -1
  3. package/dist/runtime/components/action-icon/action-icon.vue +23 -23
  4. package/dist/runtime/components/action-icon/action-icon.vue.d.ts +1 -1
  5. package/dist/runtime/components/box.vue +3 -3
  6. package/dist/runtime/components/button/button.d.vue.ts +5 -3
  7. package/dist/runtime/components/button/button.vue +43 -39
  8. package/dist/runtime/components/button/button.vue.d.ts +5 -3
  9. package/dist/runtime/components/calendar/calendar.d.vue.ts +1 -1
  10. package/dist/runtime/components/calendar/calendar.vue +60 -60
  11. package/dist/runtime/components/calendar/calendar.vue.d.ts +1 -1
  12. package/dist/runtime/components/calendar/types.d.ts +4 -3
  13. package/dist/runtime/components/calendar/ui/core/calendar-header.d.vue.ts +7 -1
  14. package/dist/runtime/components/calendar/ui/core/calendar-header.vue.d.ts +7 -1
  15. package/dist/runtime/components/calendar/ui/levels/calendar-decade.d.vue.ts +3 -1
  16. package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue.d.ts +3 -1
  17. package/dist/runtime/components/calendar/ui/levels/calendar-month.d.vue.ts +2 -1
  18. package/dist/runtime/components/calendar/ui/levels/calendar-month.vue +77 -77
  19. package/dist/runtime/components/calendar/ui/levels/calendar-month.vue.d.ts +2 -1
  20. package/dist/runtime/components/calendar/ui/levels/calendar-year.d.vue.ts +3 -1
  21. package/dist/runtime/components/calendar/ui/levels/calendar-year.vue.d.ts +3 -1
  22. package/dist/runtime/components/card/card-section.d.vue.ts +2 -1
  23. package/dist/runtime/components/card/card-section.vue.d.ts +2 -1
  24. package/dist/runtime/components/card/card.d.vue.ts +1 -0
  25. package/dist/runtime/components/card/card.vue.d.ts +1 -0
  26. package/dist/runtime/components/checkbox/checkbox-card.d.vue.ts +4 -1
  27. package/dist/runtime/components/checkbox/checkbox-card.vue +37 -37
  28. package/dist/runtime/components/checkbox/checkbox-card.vue.d.ts +4 -1
  29. package/dist/runtime/components/checkbox/checkbox-indicator.d.vue.ts +6 -0
  30. package/dist/runtime/components/checkbox/checkbox-indicator.vue.d.ts +6 -0
  31. package/dist/runtime/components/checkbox/checkbox.d.vue.ts +12 -2
  32. package/dist/runtime/components/checkbox/checkbox.vue +139 -139
  33. package/dist/runtime/components/checkbox/checkbox.vue.d.ts +12 -2
  34. package/dist/runtime/components/chip/chip-group.d.vue.ts +3 -0
  35. package/dist/runtime/components/chip/chip-group.vue.d.ts +3 -0
  36. package/dist/runtime/components/chip/chip.d.vue.ts +9 -0
  37. package/dist/runtime/components/chip/chip.vue +200 -200
  38. package/dist/runtime/components/chip/chip.vue.d.ts +9 -0
  39. package/dist/runtime/components/combobox/combobox-group.d.vue.ts +1 -0
  40. package/dist/runtime/components/combobox/combobox-group.vue.d.ts +1 -0
  41. package/dist/runtime/components/combobox/combobox-option.d.vue.ts +3 -0
  42. package/dist/runtime/components/combobox/combobox-option.vue.d.ts +3 -0
  43. package/dist/runtime/components/combobox/combobox-options-dropdown.d.vue.ts +10 -0
  44. package/dist/runtime/components/combobox/combobox-options-dropdown.vue +29 -29
  45. package/dist/runtime/components/combobox/combobox-options-dropdown.vue.d.ts +10 -0
  46. package/dist/runtime/components/combobox/combobox-root.d.vue.ts +8 -4
  47. package/dist/runtime/components/combobox/combobox-root.vue.d.ts +8 -4
  48. package/dist/runtime/components/combobox/types.d.ts +11 -0
  49. package/dist/runtime/components/container.d.vue.ts +2 -0
  50. package/dist/runtime/components/container.vue.d.ts +2 -0
  51. package/dist/runtime/components/dialog/types.d.ts +1 -0
  52. package/dist/runtime/components/files/file-upload-button.d.vue.ts +4 -2
  53. package/dist/runtime/components/files/file-upload-button.vue +12 -12
  54. package/dist/runtime/components/files/file-upload-button.vue.d.ts +4 -2
  55. package/dist/runtime/components/files/file-upload-icon.d.vue.ts +4 -2
  56. package/dist/runtime/components/files/file-upload-icon.vue +1 -1
  57. package/dist/runtime/components/files/file-upload-icon.vue.d.ts +4 -2
  58. package/dist/runtime/components/input/email-input.d.vue.ts +5 -5
  59. package/dist/runtime/components/input/email-input.vue +5 -6
  60. package/dist/runtime/components/input/email-input.vue.d.ts +5 -5
  61. package/dist/runtime/components/input/lib/input-wrapper.context.d.ts +8 -2
  62. package/dist/runtime/components/input/number-input.d.vue.ts +7 -5
  63. package/dist/runtime/components/input/number-input.vue +6 -2
  64. package/dist/runtime/components/input/number-input.vue.d.ts +7 -5
  65. package/dist/runtime/components/input/password-input.vue +1 -0
  66. package/dist/runtime/components/input/text-input.d.vue.ts +7 -5
  67. package/dist/runtime/components/input/text-input.vue +37 -34
  68. package/dist/runtime/components/input/text-input.vue.d.ts +7 -5
  69. package/dist/runtime/components/input/ui/input-inline.d.vue.ts +7 -3
  70. package/dist/runtime/components/input/ui/input-inline.vue +105 -105
  71. package/dist/runtime/components/input/ui/input-inline.vue.d.ts +7 -3
  72. package/dist/runtime/components/input/ui/input-wrapper.d.vue.ts +4 -1
  73. package/dist/runtime/components/input/ui/input-wrapper.vue +54 -54
  74. package/dist/runtime/components/input/ui/input-wrapper.vue.d.ts +4 -1
  75. package/dist/runtime/components/link/link-button.vue +1 -0
  76. package/dist/runtime/components/nav-link/nav-link.d.vue.ts +6 -4
  77. package/dist/runtime/components/nav-link/nav-link.vue +7 -3
  78. package/dist/runtime/components/nav-link/nav-link.vue.d.ts +6 -4
  79. package/dist/runtime/components/paper.d.vue.ts +3 -1
  80. package/dist/runtime/components/paper.vue +33 -33
  81. package/dist/runtime/components/paper.vue.d.ts +3 -1
  82. package/dist/runtime/components/progress/progress-section.d.vue.ts +1 -1
  83. package/dist/runtime/components/progress/progress-section.vue.d.ts +1 -1
  84. package/dist/runtime/components/select.d.vue.ts +2 -0
  85. package/dist/runtime/components/select.vue +63 -63
  86. package/dist/runtime/components/select.vue.d.ts +2 -0
  87. package/dist/runtime/components/table/types.d.ts +10 -1
  88. package/dist/runtime/components/table/ui/table-sortable-header.vue +1 -0
  89. package/dist/runtime/components/tabs/tabs-list.d.vue.ts +2 -0
  90. package/dist/runtime/components/tabs/tabs-list.vue.d.ts +2 -0
  91. package/dist/runtime/components/tabs/tabs-panel.d.vue.ts +1 -0
  92. package/dist/runtime/components/tabs/tabs-panel.vue.d.ts +1 -0
  93. package/dist/runtime/components/tabs/tabs-root.d.vue.ts +36 -9
  94. package/dist/runtime/components/tabs/tabs-root.vue.d.ts +36 -9
  95. package/dist/runtime/components/tabs/tabs-tab.d.vue.ts +7 -3
  96. package/dist/runtime/components/tabs/tabs-tab.vue +7 -4
  97. package/dist/runtime/components/tabs/tabs-tab.vue.d.ts +7 -3
  98. package/dist/runtime/components/text.d.vue.ts +6 -1
  99. package/dist/runtime/components/text.vue.d.ts +6 -1
  100. package/dist/runtime/components/textarea.d.vue.ts +7 -5
  101. package/dist/runtime/components/textarea.vue +6 -3
  102. package/dist/runtime/components/textarea.vue.d.ts +7 -5
  103. package/dist/runtime/components/title.d.vue.ts +5 -0
  104. package/dist/runtime/components/title.vue.d.ts +5 -0
  105. package/dist/runtime/components/transition.d.vue.ts +12 -2
  106. package/dist/runtime/components/transition.vue.d.ts +12 -2
  107. package/dist/runtime/components/tree/_ui/tree-item.d.vue.ts +1 -0
  108. package/dist/runtime/components/tree/_ui/tree-item.vue.d.ts +1 -0
  109. package/dist/runtime/components/tree/_ui/tree-root.d.vue.ts +8 -0
  110. package/dist/runtime/components/tree/_ui/tree-root.vue.d.ts +8 -0
  111. package/dist/runtime/components/tree/lib/context.d.ts +15 -0
  112. package/dist/runtime/components/tree/types.d.ts +9 -0
  113. package/dist/runtime/components/visually-hidden/visually-hidden-input.d.vue.ts +2 -0
  114. package/dist/runtime/components/visually-hidden/visually-hidden-input.vue +1 -1
  115. package/dist/runtime/components/visually-hidden/visually-hidden-input.vue.d.ts +2 -0
  116. package/dist/runtime/components/visually-hidden/visually-hidden.d.vue.ts +1 -0
  117. package/dist/runtime/components/visually-hidden/visually-hidden.vue.d.ts +1 -0
  118. package/package.json +1 -1
@@ -69,146 +69,146 @@ const style = computed(() => useStyleResolver((theme) => {
69
69
  </script>
70
70
 
71
71
  <template>
72
- <InputInline v-bind='rest' :id='uuid' :class='$style.root' :style :size>
73
- <Box :class='$style.inner' :mod='{ "label-position": rest?.labelPosition }'>
74
- <input
75
- :id
76
- v-model='checked'
77
- type='checkbox'
78
- :class='$style.input'
79
- :disabled
80
- >
81
-
82
- <slot name='icon' :indeterminate='modelValue === "indeterminate"' :class='$style.icon'>
83
- <Icon v-if='modelValue !== "indeterminate"' name='gravity-ui:check' :class='$style.icon' />
84
- <Icon v-else name='gravity-ui:minus' :class='$style.icon' />
85
- </slot>
86
- </Box>
87
- </InputInline>
72
+ <InputInline v-bind='rest' :id='uuid' :class='$style.root' :style :size>
73
+ <Box :class='$style.inner' :mod='{ "label-position": rest?.labelPosition }'>
74
+ <input
75
+ :id
76
+ v-model='checked'
77
+ type='checkbox'
78
+ :class='$style.input'
79
+ :disabled
80
+ >
81
+
82
+ <slot name='icon' :indeterminate='modelValue === "indeterminate"' :class='$style.icon'>
83
+ <Icon v-if='modelValue !== "indeterminate"' name='gravity-ui:check' :class='$style.icon' />
84
+ <Icon v-else name='gravity-ui:minus' :class='$style.icon' />
85
+ </slot>
86
+ </Box>
87
+ </InputInline>
88
88
  </template>
89
89
 
90
90
  <style module lang="postcss">
91
- .root {
92
- --checkbox-size-xs: rem(16px);
93
- --checkbox-size-sm: rem(20px);
94
- --checkbox-size-md: rem(24px);
95
- --checkbox-size-lg: rem(30px);
96
- --checkbox-size-xl: rem(36px);
97
-
98
- --checkbox-size: var(--checkbox-size-sm);
99
- --checkbox-color: var(--color-primary-filled);
100
- --checkbox-icon-color: var(--color-white);
101
- }
102
-
103
- .inner {
104
- position: relative;
105
-
106
- order: 1;
107
-
108
- width: var(--checkbox-size);
109
- height: var(--checkbox-size);
110
-
111
- &:where([data-label-position='right']) {
112
- order: 2;
113
- }
114
- }
115
-
116
- .input {
117
- cursor: pointer;
118
-
119
- display: block;
120
-
121
- width: var(--checkbox-size);
122
- height: var(--checkbox-size);
123
- margin: 0;
124
- padding: 0;
125
- border: 1px solid transparent;
126
- border-radius: var(--checkbox-radius, var(--radius-default));
127
-
128
- appearance: none;
129
-
130
- transition: border-color 100ms ease,
131
- background-color 100ms ease;
132
- -webkit-tap-highlight-color: transparent;
133
-
134
- &:where([data-error]) {
135
- border-color: var(--color-error);
136
- }
137
-
138
- &[data-indeterminate],
139
- &:checked {
140
- border-color: var(--checkbox-color);
141
-
142
- background-color: var(--checkbox-color);
143
-
144
- &+.icon {
145
- transform: none;
146
-
147
- opacity: 1;
148
- }
149
- }
150
-
151
- &:disabled {
152
- cursor: not-allowed;
153
-
154
- border-color: var(--color-disabled-border);
155
-
156
- background-color: var(--color-disabled);
157
-
158
- &+.icon {
159
- color: var(--color-disabled);
160
- }
161
- }
162
-
163
- @mixin where-light {
164
- border-color: var(--color-gray-4);
165
-
166
- background-color: var(--color-white);
167
- }
168
-
169
- @mixin where-dark {
170
- border-color: var(--color-dark-4);
171
-
172
- background-color: var(--color-dark-6);
173
- }
174
- }
175
-
176
- .input[data-variant='outline'] {
177
- &+.icon {
178
- color: var(--checkbox-color);
179
- }
180
-
181
- &[data-indeterminate]:not(:disabled),
182
- &:checked:not(:disabled) {
183
- border-color: var(--checkbox-color);
184
-
185
- background-color: transparent;
186
-
187
- &+.icon {
188
- transform: none;
189
-
190
- color: var(--checkbox-color);
191
-
192
- opacity: 1;
193
- }
194
- }
195
- }
196
-
197
- .icon {
198
- pointer-events: none;
199
-
200
- position: absolute;
201
- inset: 0;
202
- transform: translateY(.25rem) scale(0.5);
203
-
204
- width: 80%;
205
- margin: auto;
206
-
207
- color: var(--checkbox-icon-color);
208
-
209
- opacity: 0;
210
-
211
- transition: transform 100ms ease,
212
- opacity 100ms ease;
213
- }
91
+ .root {
92
+ --checkbox-size-xs: rem(16px);
93
+ --checkbox-size-sm: rem(20px);
94
+ --checkbox-size-md: rem(24px);
95
+ --checkbox-size-lg: rem(30px);
96
+ --checkbox-size-xl: rem(36px);
97
+
98
+ --checkbox-size: var(--checkbox-size-sm);
99
+ --checkbox-color: var(--color-primary-filled);
100
+ --checkbox-icon-color: var(--color-white);
101
+ }
102
+
103
+ .inner {
104
+ position: relative;
105
+
106
+ order: 1;
107
+
108
+ width: var(--checkbox-size);
109
+ height: var(--checkbox-size);
110
+
111
+ &:where([data-label-position='right']) {
112
+ order: 2;
113
+ }
114
+ }
115
+
116
+ .input {
117
+ cursor: pointer;
118
+
119
+ display: block;
120
+
121
+ width: var(--checkbox-size);
122
+ height: var(--checkbox-size);
123
+ margin: 0;
124
+ padding: 0;
125
+ border: 1px solid transparent;
126
+ border-radius: var(--checkbox-radius, var(--radius-default));
127
+
128
+ appearance: none;
129
+
130
+ transition: border-color 100ms ease,
131
+ background-color 100ms ease;
132
+ -webkit-tap-highlight-color: transparent;
133
+
134
+ &:where([data-error]) {
135
+ border-color: var(--color-error);
136
+ }
137
+
138
+ &[data-indeterminate],
139
+ &:checked {
140
+ border-color: var(--checkbox-color);
141
+
142
+ background-color: var(--checkbox-color);
143
+
144
+ &+.icon {
145
+ transform: none;
146
+
147
+ opacity: 1;
148
+ }
149
+ }
150
+
151
+ &:disabled {
152
+ cursor: not-allowed;
153
+
154
+ border-color: var(--color-disabled-border);
155
+
156
+ background-color: var(--color-disabled);
157
+
158
+ &+.icon {
159
+ color: var(--color-disabled);
160
+ }
161
+ }
162
+
163
+ @mixin where-light {
164
+ border-color: var(--color-gray-4);
165
+
166
+ background-color: var(--color-white);
167
+ }
168
+
169
+ @mixin where-dark {
170
+ border-color: var(--color-dark-4);
171
+
172
+ background-color: var(--color-dark-6);
173
+ }
174
+ }
175
+
176
+ .input[data-variant='outline'] {
177
+ &+.icon {
178
+ color: var(--checkbox-color);
179
+ }
180
+
181
+ &[data-indeterminate]:not(:disabled),
182
+ &:checked:not(:disabled) {
183
+ border-color: var(--checkbox-color);
184
+
185
+ background-color: transparent;
186
+
187
+ &+.icon {
188
+ transform: none;
189
+
190
+ color: var(--checkbox-color);
191
+
192
+ opacity: 1;
193
+ }
194
+ }
195
+ }
196
+
197
+ .icon {
198
+ pointer-events: none;
199
+
200
+ position: absolute;
201
+ inset: 0;
202
+ transform: translateY(.25rem) scale(0.5);
203
+
204
+ width: 80%;
205
+ margin: auto;
206
+
207
+ color: var(--checkbox-icon-color);
208
+
209
+ opacity: 0;
210
+
211
+ transition: transform 100ms ease,
212
+ opacity 100ms ease;
213
+ }
214
214
  </style>
@@ -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;
@@ -1,7 +1,10 @@
1
1
  import type { ChipGroupValue } from './lib.js';
2
2
  export interface ChipGroupProps<T extends boolean = false> {
3
+ /** Form input name */
3
4
  name: string;
5
+ /** Allows selecting multiple chips at once */
4
6
  multiple?: T;
7
+ /** Disables all chips in the group */
5
8
  disabled?: boolean;
6
9
  }
7
10
  declare const __VLS_export: <T extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
@@ -1,7 +1,10 @@
1
1
  import type { ChipGroupValue } from './lib.js';
2
2
  export interface ChipGroupProps<T extends boolean = false> {
3
+ /** Form input name */
3
4
  name: string;
5
+ /** Allows selecting multiple chips at once */
4
6
  multiple?: T;
7
+ /** Disables all chips in the group */
5
8
  disabled?: boolean;
6
9
  }
7
10
  declare const __VLS_export: <T extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
@@ -1,15 +1,24 @@
1
1
  import type { NuanceColor, NuanceRadius, NuanceSize } from '@nui/types';
2
2
  export interface ChipProps {
3
+ /** Border radius */
3
4
  radius?: NuanceRadius;
5
+ /** Component size */
4
6
  size?: NuanceSize;
7
+ /** Input type used when rendered without a group */
5
8
  type?: 'radio' | 'checkbox';
9
+ /** Color from theme */
6
10
  color?: NuanceColor;
7
11
  /** Id used to bind input and label, auto-generated if not provided */
8
12
  id?: string;
13
+ /** Visual variant */
9
14
  variant?: 'filled' | 'outline' | 'light';
15
+ /** Value used in chip group context */
10
16
  value?: string;
17
+ /** Check icon name */
11
18
  icon?: string;
19
+ /** Shows the check icon when the chip is checked */
12
20
  hideIcon?: boolean;
21
+ /** Disables the component */
13
22
  disabled?: boolean;
14
23
  }
15
24
  type __VLS_Props = ChipProps;