@whatsaaaa/ui-vue 0.0.0-stage → 0.2.0
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.
- package/LICENSE +21 -0
- package/README.md +24 -2
- package/dist/color-mode.d.ts +14 -0
- package/dist/color-mode.js +34 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +12 -0
- package/dist/theme/badge.d.ts +70 -0
- package/dist/theme/badge.js +116 -0
- package/dist/theme/button.d.ts +136 -0
- package/dist/theme/button.js +193 -0
- package/dist/theme/card.d.ts +29 -0
- package/dist/theme/card.js +44 -0
- package/dist/theme/checkbox.d.ts +159 -0
- package/dist/theme/checkbox.js +73 -0
- package/dist/theme/choice.d.ts +82 -0
- package/dist/theme/choice.js +124 -0
- package/dist/theme/field-group.d.ts +9 -0
- package/dist/theme/field-group.js +16 -0
- package/dist/theme/field.d.ts +263 -0
- package/dist/theme/field.js +248 -0
- package/dist/theme/file-upload.d.ts +106 -0
- package/dist/theme/file-upload.js +124 -0
- package/dist/theme/form-field.d.ts +44 -0
- package/dist/theme/form-field.js +34 -0
- package/dist/theme/index.d.ts +2349 -0
- package/dist/theme/index.js +130 -0
- package/dist/theme/input-date.d.ts +127 -0
- package/dist/theme/input-date.js +78 -0
- package/dist/theme/input-menu.d.ts +210 -0
- package/dist/theme/input-menu.js +83 -0
- package/dist/theme/input-number.d.ts +77 -0
- package/dist/theme/input-number.js +110 -0
- package/dist/theme/input-tags.d.ts +284 -0
- package/dist/theme/input-tags.js +38 -0
- package/dist/theme/input-time.d.ts +2 -0
- package/dist/theme/input-time.js +5 -0
- package/dist/theme/input.d.ts +138 -0
- package/dist/theme/input.js +48 -0
- package/dist/theme/modal.d.ts +31 -0
- package/dist/theme/modal.js +44 -0
- package/dist/theme/pin-input.d.ts +61 -0
- package/dist/theme/pin-input.js +40 -0
- package/dist/theme/radio-group.d.ts +177 -0
- package/dist/theme/radio-group.js +111 -0
- package/dist/theme/select-menu.d.ts +154 -0
- package/dist/theme/select-menu.js +22 -0
- package/dist/theme/select.d.ts +254 -0
- package/dist/theme/select.js +109 -0
- package/dist/theme/shared.d.ts +69 -0
- package/dist/theme/shared.js +103 -0
- package/dist/theme/table.d.ts +45 -0
- package/dist/theme/table.js +111 -0
- package/dist/theme/tabs.d.ts +95 -0
- package/dist/theme/tabs.js +144 -0
- package/dist/theme/tags.d.ts +40 -0
- package/dist/theme/tags.js +52 -0
- package/dist/theme/textarea.d.ts +127 -0
- package/dist/theme/textarea.js +72 -0
- package/package.json +65 -3
- package/src/index.css +123 -0
- package/src/nuxt-ui.css +148 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/** What a select and a select menu share. */
|
|
2
|
+
export declare const selectSlots: {
|
|
3
|
+
base: string;
|
|
4
|
+
placeholder: string;
|
|
5
|
+
leadingIcon: string;
|
|
6
|
+
trailingIcon: string;
|
|
7
|
+
content: string;
|
|
8
|
+
arrow: string;
|
|
9
|
+
viewport: string;
|
|
10
|
+
group: string;
|
|
11
|
+
empty: string;
|
|
12
|
+
label: string;
|
|
13
|
+
separator: string;
|
|
14
|
+
item: string;
|
|
15
|
+
itemLeadingIcon: string;
|
|
16
|
+
itemTrailing: string;
|
|
17
|
+
itemTrailingIcon: string;
|
|
18
|
+
itemDescription: string;
|
|
19
|
+
};
|
|
20
|
+
/** An open list fades in and grows a little, unless the reader asks for less motion. */
|
|
21
|
+
export declare const listMotion = "data-[state=open]:animate-[fade-in_var(--ws-motion-duration-fast)_var(--ws-motion-easing-out)] data-[state=closed]:animate-[fade-out_var(--ws-motion-duration-fast)_var(--ws-motion-easing-in)] motion-safe:data-[state=open]:animate-[scale-in_var(--ws-motion-duration-fast)_var(--ws-motion-easing-out)] motion-safe:data-[state=closed]:animate-[scale-out_var(--ws-motion-duration-fast)_var(--ws-motion-easing-in)]";
|
|
22
|
+
/**
|
|
23
|
+
* A select's icons sit inside its edge, as its value does. In the list an option's icon and its
|
|
24
|
+
* tick are the control's icon of the size, the icon centered on the option's first line, as the
|
|
25
|
+
* tick is, whatever lines follow.
|
|
26
|
+
*/
|
|
27
|
+
export declare const selectVariants: {
|
|
28
|
+
size: {
|
|
29
|
+
xs: {
|
|
30
|
+
leading: string;
|
|
31
|
+
trailing: string;
|
|
32
|
+
label: string;
|
|
33
|
+
item: string;
|
|
34
|
+
itemLeadingIcon: string;
|
|
35
|
+
itemTrailingIcon: string;
|
|
36
|
+
empty: string;
|
|
37
|
+
base: string;
|
|
38
|
+
leadingIcon: string;
|
|
39
|
+
trailingIcon: string;
|
|
40
|
+
};
|
|
41
|
+
sm: {
|
|
42
|
+
leading: string;
|
|
43
|
+
trailing: string;
|
|
44
|
+
label: string;
|
|
45
|
+
item: string;
|
|
46
|
+
itemLeadingIcon: string;
|
|
47
|
+
itemTrailingIcon: string;
|
|
48
|
+
empty: string;
|
|
49
|
+
base: string;
|
|
50
|
+
leadingIcon: string;
|
|
51
|
+
trailingIcon: string;
|
|
52
|
+
};
|
|
53
|
+
md: {
|
|
54
|
+
leading: string;
|
|
55
|
+
trailing: string;
|
|
56
|
+
label: string;
|
|
57
|
+
item: string;
|
|
58
|
+
itemLeadingIcon: string;
|
|
59
|
+
itemTrailingIcon: string;
|
|
60
|
+
empty: string;
|
|
61
|
+
base: string;
|
|
62
|
+
leadingIcon: string;
|
|
63
|
+
trailingIcon: string;
|
|
64
|
+
};
|
|
65
|
+
lg: {
|
|
66
|
+
leading: string;
|
|
67
|
+
trailing: string;
|
|
68
|
+
label: string;
|
|
69
|
+
item: string;
|
|
70
|
+
itemLeadingIcon: string;
|
|
71
|
+
itemTrailingIcon: string;
|
|
72
|
+
empty: string;
|
|
73
|
+
base: string;
|
|
74
|
+
leadingIcon: string;
|
|
75
|
+
trailingIcon: string;
|
|
76
|
+
};
|
|
77
|
+
xl: {
|
|
78
|
+
leading: string;
|
|
79
|
+
trailing: string;
|
|
80
|
+
label: string;
|
|
81
|
+
item: string;
|
|
82
|
+
itemLeadingIcon: string;
|
|
83
|
+
itemTrailingIcon: string;
|
|
84
|
+
empty: string;
|
|
85
|
+
base: string;
|
|
86
|
+
leadingIcon: string;
|
|
87
|
+
trailingIcon: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
variant: {
|
|
91
|
+
outline: string;
|
|
92
|
+
subtle: string;
|
|
93
|
+
soft: string;
|
|
94
|
+
ghost: string;
|
|
95
|
+
none: string;
|
|
96
|
+
};
|
|
97
|
+
position: {
|
|
98
|
+
popper: {
|
|
99
|
+
content: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
declare const _default: {
|
|
104
|
+
slots: {
|
|
105
|
+
base: string;
|
|
106
|
+
placeholder: string;
|
|
107
|
+
leadingIcon: string;
|
|
108
|
+
trailingIcon: string;
|
|
109
|
+
content: string;
|
|
110
|
+
arrow: string;
|
|
111
|
+
viewport: string;
|
|
112
|
+
group: string;
|
|
113
|
+
empty: string;
|
|
114
|
+
label: string;
|
|
115
|
+
separator: string;
|
|
116
|
+
item: string;
|
|
117
|
+
itemLeadingIcon: string;
|
|
118
|
+
itemTrailing: string;
|
|
119
|
+
itemTrailingIcon: string;
|
|
120
|
+
itemDescription: string;
|
|
121
|
+
};
|
|
122
|
+
variants: {
|
|
123
|
+
size: {
|
|
124
|
+
xs: {
|
|
125
|
+
leading: string;
|
|
126
|
+
trailing: string;
|
|
127
|
+
label: string;
|
|
128
|
+
item: string;
|
|
129
|
+
itemLeadingIcon: string;
|
|
130
|
+
itemTrailingIcon: string;
|
|
131
|
+
empty: string;
|
|
132
|
+
base: string;
|
|
133
|
+
leadingIcon: string;
|
|
134
|
+
trailingIcon: string;
|
|
135
|
+
};
|
|
136
|
+
sm: {
|
|
137
|
+
leading: string;
|
|
138
|
+
trailing: string;
|
|
139
|
+
label: string;
|
|
140
|
+
item: string;
|
|
141
|
+
itemLeadingIcon: string;
|
|
142
|
+
itemTrailingIcon: string;
|
|
143
|
+
empty: string;
|
|
144
|
+
base: string;
|
|
145
|
+
leadingIcon: string;
|
|
146
|
+
trailingIcon: string;
|
|
147
|
+
};
|
|
148
|
+
md: {
|
|
149
|
+
leading: string;
|
|
150
|
+
trailing: string;
|
|
151
|
+
label: string;
|
|
152
|
+
item: string;
|
|
153
|
+
itemLeadingIcon: string;
|
|
154
|
+
itemTrailingIcon: string;
|
|
155
|
+
empty: string;
|
|
156
|
+
base: string;
|
|
157
|
+
leadingIcon: string;
|
|
158
|
+
trailingIcon: string;
|
|
159
|
+
};
|
|
160
|
+
lg: {
|
|
161
|
+
leading: string;
|
|
162
|
+
trailing: string;
|
|
163
|
+
label: string;
|
|
164
|
+
item: string;
|
|
165
|
+
itemLeadingIcon: string;
|
|
166
|
+
itemTrailingIcon: string;
|
|
167
|
+
empty: string;
|
|
168
|
+
base: string;
|
|
169
|
+
leadingIcon: string;
|
|
170
|
+
trailingIcon: string;
|
|
171
|
+
};
|
|
172
|
+
xl: {
|
|
173
|
+
leading: string;
|
|
174
|
+
trailing: string;
|
|
175
|
+
label: string;
|
|
176
|
+
item: string;
|
|
177
|
+
itemLeadingIcon: string;
|
|
178
|
+
itemTrailingIcon: string;
|
|
179
|
+
empty: string;
|
|
180
|
+
base: string;
|
|
181
|
+
leadingIcon: string;
|
|
182
|
+
trailingIcon: string;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
variant: {
|
|
186
|
+
outline: string;
|
|
187
|
+
subtle: string;
|
|
188
|
+
soft: string;
|
|
189
|
+
ghost: string;
|
|
190
|
+
none: string;
|
|
191
|
+
};
|
|
192
|
+
position: {
|
|
193
|
+
popper: {
|
|
194
|
+
content: string;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
compoundVariants: ({
|
|
199
|
+
variant: string;
|
|
200
|
+
highlight: boolean;
|
|
201
|
+
class: string;
|
|
202
|
+
color?: undefined;
|
|
203
|
+
} | {
|
|
204
|
+
variant: string;
|
|
205
|
+
highlight: boolean;
|
|
206
|
+
color: string;
|
|
207
|
+
class: string;
|
|
208
|
+
} | {
|
|
209
|
+
fixed: boolean;
|
|
210
|
+
size: string[];
|
|
211
|
+
class: string;
|
|
212
|
+
} | {
|
|
213
|
+
leading: boolean;
|
|
214
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
215
|
+
class: string;
|
|
216
|
+
} | {
|
|
217
|
+
trailing: boolean;
|
|
218
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
219
|
+
class: string;
|
|
220
|
+
} | {
|
|
221
|
+
loading: boolean;
|
|
222
|
+
leading: boolean;
|
|
223
|
+
class: {
|
|
224
|
+
leadingIcon: string;
|
|
225
|
+
trailingIcon?: undefined;
|
|
226
|
+
};
|
|
227
|
+
trailing?: undefined;
|
|
228
|
+
} | {
|
|
229
|
+
loading: boolean;
|
|
230
|
+
leading: boolean;
|
|
231
|
+
trailing: boolean;
|
|
232
|
+
class: {
|
|
233
|
+
trailingIcon: string;
|
|
234
|
+
leadingIcon?: undefined;
|
|
235
|
+
};
|
|
236
|
+
} | ({
|
|
237
|
+
highlight: boolean;
|
|
238
|
+
} & {
|
|
239
|
+
color: import("./shared.ts").Color;
|
|
240
|
+
class: string | Record<string, string>;
|
|
241
|
+
}) | {
|
|
242
|
+
variant: string[];
|
|
243
|
+
class: string;
|
|
244
|
+
} | {
|
|
245
|
+
fieldGroup: string[];
|
|
246
|
+
class: string;
|
|
247
|
+
highlight?: undefined;
|
|
248
|
+
} | {
|
|
249
|
+
fieldGroup: string[];
|
|
250
|
+
highlight: boolean;
|
|
251
|
+
class: string;
|
|
252
|
+
})[];
|
|
253
|
+
};
|
|
254
|
+
export default _default;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { fieldCompoundVariants, fieldSizes, fieldVariants, inGroup } from "./field.js";
|
|
2
|
+
import { forcedIcon, transition } from "./shared.js";
|
|
3
|
+
/*
|
|
4
|
+
* The design system's select spec, specs/select.spec.json, and its select menu spec. The trigger
|
|
5
|
+
* is a field. The list opens on a panel of the overlay, --ws-overlay-*: the surface in the field
|
|
6
|
+
* border's edge, which reads at 3:1, and no shadow; the highlighted option raised, the chosen one
|
|
7
|
+
* ticked in the interactive color. Options are values, so they are in Inter; a group's name is an
|
|
8
|
+
* overline. The edge and the line between groups are borders, so forced colors keep them; there
|
|
9
|
+
* the highlighted option is outlined in the selection color.
|
|
10
|
+
*/
|
|
11
|
+
/** What a select and a select menu share. */
|
|
12
|
+
export const selectSlots = {
|
|
13
|
+
base: `rounded-(--ws-control-radius) font-sans cursor-pointer disabled:text-(--ws-field-text-disabled) disabled:opacity-100 ${transition}`,
|
|
14
|
+
// often the only words in the trigger, so in the secondary text color, which reads at 4.5:1;
|
|
15
|
+
// faint with the rest of a disabled trigger
|
|
16
|
+
placeholder: 'truncate text-text-secondary group-disabled:text-(--ws-field-text-disabled)',
|
|
17
|
+
leadingIcon: `text-(--ws-field-icon-rest) ${forcedIcon}`,
|
|
18
|
+
trailingIcon: `text-(--ws-field-icon-rest) ${forcedIcon}`,
|
|
19
|
+
content: 'bg-(--ws-overlay-bg-rest) rounded-(--ws-overlay-list-radius) border-(length:--ws-overlay-border-width) border-(--ws-overlay-border-rest) ring-0 [box-shadow:none]',
|
|
20
|
+
arrow: 'fill-(--ws-overlay-bg-rest) stroke-(--ws-overlay-border-rest)',
|
|
21
|
+
viewport: 'divide-y divide-border',
|
|
22
|
+
group: 'p-(--ws-overlay-list-padding)',
|
|
23
|
+
empty: 'text-center text-text-secondary',
|
|
24
|
+
// an overline: mono, in capitals
|
|
25
|
+
label: 'font-mono font-(--ws-text-overline-font-weight) uppercase text-text-secondary',
|
|
26
|
+
// Nuxt UI's line is a fill a pixel high, which forced colors paint over: no height and no fill,
|
|
27
|
+
// or the border and the fill would draw a line of two
|
|
28
|
+
separator: '-mx-(--ws-overlay-list-padding) my-(--ws-overlay-list-padding) h-0 bg-transparent border-b-thin border-border',
|
|
29
|
+
item: `cursor-pointer font-sans before:rounded-(--ws-radius-sm) data-disabled:opacity-100 data-disabled:text-text-faint text-text data-highlighted:not-data-disabled:text-text data-highlighted:not-data-disabled:before:bg-raised forced-colors:data-highlighted:not-data-disabled:before:border forced-colors:data-highlighted:not-data-disabled:before:border-[Highlight] ${transition} motion-reduce:before:transition-none`,
|
|
30
|
+
itemLeadingIcon: `text-text-secondary group-data-highlighted:not-group-data-disabled:text-text ${forcedIcon} ${transition}`,
|
|
31
|
+
// the chosen option's tick, centered on the option's first line
|
|
32
|
+
itemTrailing: 'h-lh',
|
|
33
|
+
itemTrailingIcon: `text-interactive ${forcedIcon}`,
|
|
34
|
+
itemDescription: 'truncate text-text-secondary text-body-sm',
|
|
35
|
+
};
|
|
36
|
+
/** An open list fades in and grows a little, unless the reader asks for less motion. */
|
|
37
|
+
export const listMotion = 'data-[state=open]:animate-[fade-in_var(--ws-motion-duration-fast)_var(--ws-motion-easing-out)] data-[state=closed]:animate-[fade-out_var(--ws-motion-duration-fast)_var(--ws-motion-easing-in)] motion-safe:data-[state=open]:animate-[scale-in_var(--ws-motion-duration-fast)_var(--ws-motion-easing-out)] motion-safe:data-[state=closed]:animate-[scale-out_var(--ws-motion-duration-fast)_var(--ws-motion-easing-in)]';
|
|
38
|
+
/**
|
|
39
|
+
* A select's icons sit inside its edge, as its value does. In the list an option's icon and its
|
|
40
|
+
* tick are the control's icon of the size, the icon centered on the option's first line, as the
|
|
41
|
+
* tick is, whatever lines follow.
|
|
42
|
+
*/
|
|
43
|
+
export const selectVariants = {
|
|
44
|
+
size: {
|
|
45
|
+
xs: {
|
|
46
|
+
...fieldSizes.xs,
|
|
47
|
+
leading: 'ps-[calc(var(--ws-space-8)-var(--field-edge-extra,0px))]',
|
|
48
|
+
trailing: 'pe-[calc(var(--ws-space-8)-var(--field-edge-extra,0px))]',
|
|
49
|
+
label: 'px-(--ws-space-6) py-(--ws-space-4) text-overline',
|
|
50
|
+
item: 'px-(--ws-space-6) py-(--ws-space-4) gap-(--ws-control-gap-xs) text-body-sm',
|
|
51
|
+
itemLeadingIcon: 'size-(--ws-control-icon-size-xs) my-[calc((1lh-var(--ws-control-icon-size-xs))/2)]',
|
|
52
|
+
itemTrailingIcon: 'size-(--ws-control-icon-size-xs)',
|
|
53
|
+
empty: 'p-(--ws-space-8) text-body-sm',
|
|
54
|
+
},
|
|
55
|
+
sm: {
|
|
56
|
+
...fieldSizes.sm,
|
|
57
|
+
leading: 'ps-[calc(var(--ws-space-10)-var(--field-edge-extra,0px))]',
|
|
58
|
+
trailing: 'pe-[calc(var(--ws-space-10)-var(--field-edge-extra,0px))]',
|
|
59
|
+
label: 'px-(--ws-space-8) py-(--ws-space-4) text-overline',
|
|
60
|
+
item: 'px-(--ws-space-8) py-(--ws-space-4) gap-(--ws-control-gap-sm) text-body-sm',
|
|
61
|
+
itemLeadingIcon: 'size-(--ws-control-icon-size-sm) my-[calc((1lh-var(--ws-control-icon-size-sm))/2)]',
|
|
62
|
+
itemTrailingIcon: 'size-(--ws-control-icon-size-sm)',
|
|
63
|
+
empty: 'p-(--ws-space-10) text-body-sm',
|
|
64
|
+
},
|
|
65
|
+
md: {
|
|
66
|
+
...fieldSizes.md,
|
|
67
|
+
leading: 'ps-[calc(var(--ws-space-12)-var(--field-edge-extra,0px))]',
|
|
68
|
+
trailing: 'pe-[calc(var(--ws-space-12)-var(--field-edge-extra,0px))]',
|
|
69
|
+
label: 'px-(--ws-space-8) py-(--ws-space-6) text-overline',
|
|
70
|
+
item: 'px-(--ws-space-8) py-(--ws-space-6) gap-(--ws-control-gap-md) text-body',
|
|
71
|
+
itemLeadingIcon: 'size-(--ws-control-icon-size-md) my-[calc((1lh-var(--ws-control-icon-size-md))/2)]',
|
|
72
|
+
itemTrailingIcon: 'size-(--ws-control-icon-size-md)',
|
|
73
|
+
empty: 'p-(--ws-space-12) text-body-sm',
|
|
74
|
+
},
|
|
75
|
+
lg: {
|
|
76
|
+
...fieldSizes.lg,
|
|
77
|
+
leading: 'ps-[calc(var(--ws-space-14)-var(--field-edge-extra,0px))]',
|
|
78
|
+
trailing: 'pe-[calc(var(--ws-space-14)-var(--field-edge-extra,0px))]',
|
|
79
|
+
label: 'px-(--ws-space-10) py-(--ws-space-6) text-overline',
|
|
80
|
+
item: 'px-(--ws-space-10) py-(--ws-space-8) gap-(--ws-control-gap-lg) text-body',
|
|
81
|
+
itemLeadingIcon: 'size-(--ws-control-icon-size-lg) my-[calc((1lh-var(--ws-control-icon-size-lg))/2)]',
|
|
82
|
+
itemTrailingIcon: 'size-(--ws-control-icon-size-lg)',
|
|
83
|
+
empty: 'p-(--ws-space-12) text-body',
|
|
84
|
+
},
|
|
85
|
+
xl: {
|
|
86
|
+
...fieldSizes.xl,
|
|
87
|
+
leading: 'ps-[calc(var(--ws-space-16)-var(--field-edge-extra,0px))]',
|
|
88
|
+
trailing: 'pe-[calc(var(--ws-space-16)-var(--field-edge-extra,0px))]',
|
|
89
|
+
label: 'px-(--ws-space-12) py-(--ws-space-8) text-overline',
|
|
90
|
+
item: 'px-(--ws-space-12) py-(--ws-space-8) gap-(--ws-control-gap-xl) text-body',
|
|
91
|
+
itemLeadingIcon: 'size-(--ws-control-icon-size-xl) my-[calc((1lh-var(--ws-control-icon-size-xl))/2)]',
|
|
92
|
+
itemTrailingIcon: 'size-(--ws-control-icon-size-xl)',
|
|
93
|
+
empty: 'p-(--ws-space-12) text-body',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
variant: {
|
|
97
|
+
...fieldVariants,
|
|
98
|
+
outline: `${fieldVariants.outline} hover:bg-(--ws-field-bg-rest) disabled:bg-(--ws-field-bg-rest)`,
|
|
99
|
+
subtle: `${fieldVariants.subtle} hover:bg-raised disabled:bg-transparent`,
|
|
100
|
+
},
|
|
101
|
+
position: {
|
|
102
|
+
popper: { content: listMotion },
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
export default {
|
|
106
|
+
slots: selectSlots,
|
|
107
|
+
variants: selectVariants,
|
|
108
|
+
compoundVariants: [...fieldCompoundVariants, ...inGroup],
|
|
109
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the component themes share. Tailwind finds the classes it builds by reading the
|
|
3
|
+
* compiled themes as text, so every class here and in the themes is written out whole: none is
|
|
4
|
+
* put together from parts, and each color has its own line.
|
|
5
|
+
*
|
|
6
|
+
* Every slot is a string, merged onto Nuxt UI's own classes, where a class of the same kind
|
|
7
|
+
* replaces Nuxt UI's: font-semibold its font-medium, disabled:opacity-100 its
|
|
8
|
+
* disabled:opacity-75. Nuxt UI can also take a function that replaces a slot whole, but its
|
|
9
|
+
* Vite plugin writes the config as JSON, so on Vue the function is lost.
|
|
10
|
+
*/
|
|
11
|
+
/** The colors of the theme. Nuxt UI's secondary has no role in the design system. */
|
|
12
|
+
export declare const colors: readonly ["primary", "success", "info", "warning", "error"];
|
|
13
|
+
export type Color = (typeof colors)[number] | 'neutral';
|
|
14
|
+
/** One class list for each color, neutral included. */
|
|
15
|
+
export type ByColor = Record<Color, string>;
|
|
16
|
+
/**
|
|
17
|
+
* The design system's focus ring, as base.css draws it: two pixels of the interactive color,
|
|
18
|
+
* three pixels out. Nuxt UI tints the outline with the component's color and widens it to
|
|
19
|
+
* three pixels; these replace that.
|
|
20
|
+
*/
|
|
21
|
+
export declare const focusRing = "outline-interactive focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-3";
|
|
22
|
+
/** The edge of a control: a border in the button border color, gray when it is disabled. */
|
|
23
|
+
export declare const forcedControlEdge = "forced-colors:border forced-colors:border-[ButtonBorder] forced-colors:disabled:border-[GrayText] forced-colors:aria-disabled:border-[GrayText]";
|
|
24
|
+
/** The edge of a panel or a tag: a border in the text color. */
|
|
25
|
+
export declare const forcedEdge = "forced-colors:border forced-colors:border-[CanvasText]";
|
|
26
|
+
/**
|
|
27
|
+
* A checked control's fill: the selection's colors, gray in a disabled control, kept as they are,
|
|
28
|
+
* so that its mark, painted in the text color, keeps the fill's text color.
|
|
29
|
+
*/
|
|
30
|
+
export declare const forcedChecked = "forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:forced-color-adjust-none forced-colors:in-disabled:bg-[GrayText] forced-colors:in-disabled:text-[Canvas]";
|
|
31
|
+
/**
|
|
32
|
+
* The mark of a checked control, where it is an icon drawn as a mask: in the fill's text color,
|
|
33
|
+
* where the stylesheet paints every icon in the text color of the page.
|
|
34
|
+
*/
|
|
35
|
+
export declare const forcedMark = "forced-colors:not-[svg]:bg-[HighlightText] forced-colors:in-disabled:not-[svg]:bg-[Canvas]";
|
|
36
|
+
/**
|
|
37
|
+
* An icon drawn as a mask, in the text color, gray inside a disabled control as its label is: a
|
|
38
|
+
* button, a select's trigger or a tab. An input's icons sit beside the input, not inside it, so
|
|
39
|
+
* they keep the text color when it is disabled. An icon drawn as an SVG, as Nuxt UI draws them on
|
|
40
|
+
* Vue, already takes the text color, and a fill behind it would hide it.
|
|
41
|
+
*/
|
|
42
|
+
export declare const forcedIcon = "forced-colors:not-[svg]:bg-[CanvasText] forced-colors:in-disabled:not-[svg]:bg-[GrayText] forced-colors:in-aria-disabled:not-[svg]:bg-[GrayText]";
|
|
43
|
+
/**
|
|
44
|
+
* Color changes on hover and focus, in the fast duration, unless the reader asks for less motion.
|
|
45
|
+
* Nuxt UI puts transition-colors on its controls; this adds it where it does not, and takes it
|
|
46
|
+
* off for a reader who asks for less motion.
|
|
47
|
+
*/
|
|
48
|
+
export declare const transition = "transition-colors motion-reduce:transition-none";
|
|
49
|
+
/**
|
|
50
|
+
* Text on a solid fill. The fill of a status is its text color, which reads on the page in both
|
|
51
|
+
* themes, so the page color reads on it: in the light theme every status fill is the text
|
|
52
|
+
* color, and the word on it carries the status. For danger that is the brand fill and the text
|
|
53
|
+
* on it, a pair the design system checks.
|
|
54
|
+
*/
|
|
55
|
+
export declare const solid: ByColor;
|
|
56
|
+
/** A tint of the color under its text color: the tag, and the status blocks of the system. */
|
|
57
|
+
export declare const tint: ByColor;
|
|
58
|
+
/** The color as text on the page. A status takes its text color, which can differ from it. */
|
|
59
|
+
export declare const text: ByColor;
|
|
60
|
+
/** The color as an outline drawn inside the box, which takes no room. */
|
|
61
|
+
export declare const ring: ByColor;
|
|
62
|
+
/**
|
|
63
|
+
* One compound variant for each color, from a class list for each. With a slot the classes go
|
|
64
|
+
* to that slot, without one to the component's first.
|
|
65
|
+
*/
|
|
66
|
+
export declare function byColor<Conditions extends object>(classes: ByColor, conditions: Conditions, slot?: string): (Conditions & {
|
|
67
|
+
color: Color;
|
|
68
|
+
class: string | Record<string, string>;
|
|
69
|
+
})[];
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the component themes share. Tailwind finds the classes it builds by reading the
|
|
3
|
+
* compiled themes as text, so every class here and in the themes is written out whole: none is
|
|
4
|
+
* put together from parts, and each color has its own line.
|
|
5
|
+
*
|
|
6
|
+
* Every slot is a string, merged onto Nuxt UI's own classes, where a class of the same kind
|
|
7
|
+
* replaces Nuxt UI's: font-semibold its font-medium, disabled:opacity-100 its
|
|
8
|
+
* disabled:opacity-75. Nuxt UI can also take a function that replaces a slot whole, but its
|
|
9
|
+
* Vite plugin writes the config as JSON, so on Vue the function is lost.
|
|
10
|
+
*/
|
|
11
|
+
/** The colors of the theme. Nuxt UI's secondary has no role in the design system. */
|
|
12
|
+
export const colors = ['primary', 'success', 'info', 'warning', 'error'];
|
|
13
|
+
/**
|
|
14
|
+
* The design system's focus ring, as base.css draws it: two pixels of the interactive color,
|
|
15
|
+
* three pixels out. Nuxt UI tints the outline with the component's color and widens it to
|
|
16
|
+
* three pixels; these replace that.
|
|
17
|
+
*/
|
|
18
|
+
export const focusRing = 'outline-interactive focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-3';
|
|
19
|
+
/*
|
|
20
|
+
* Forced colors, Windows' contrast themes, take box shadows away and paint every background in
|
|
21
|
+
* the page color. Nuxt UI draws the edge of a part with ring, a box shadow, and an icon as a mask
|
|
22
|
+
* over its background, so in forced colors the edges, the icons and the fill of a checked control
|
|
23
|
+
* are gone. These draw them again in the system's colors, and only in forced colors.
|
|
24
|
+
*/
|
|
25
|
+
/** The edge of a control: a border in the button border color, gray when it is disabled. */
|
|
26
|
+
export const forcedControlEdge = 'forced-colors:border forced-colors:border-[ButtonBorder] forced-colors:disabled:border-[GrayText] forced-colors:aria-disabled:border-[GrayText]';
|
|
27
|
+
/** The edge of a panel or a tag: a border in the text color. */
|
|
28
|
+
export const forcedEdge = 'forced-colors:border forced-colors:border-[CanvasText]';
|
|
29
|
+
/**
|
|
30
|
+
* A checked control's fill: the selection's colors, gray in a disabled control, kept as they are,
|
|
31
|
+
* so that its mark, painted in the text color, keeps the fill's text color.
|
|
32
|
+
*/
|
|
33
|
+
export const forcedChecked = 'forced-colors:bg-[Highlight] forced-colors:text-[HighlightText] forced-colors:forced-color-adjust-none forced-colors:in-disabled:bg-[GrayText] forced-colors:in-disabled:text-[Canvas]';
|
|
34
|
+
/**
|
|
35
|
+
* The mark of a checked control, where it is an icon drawn as a mask: in the fill's text color,
|
|
36
|
+
* where the stylesheet paints every icon in the text color of the page.
|
|
37
|
+
*/
|
|
38
|
+
export const forcedMark = 'forced-colors:not-[svg]:bg-[HighlightText] forced-colors:in-disabled:not-[svg]:bg-[Canvas]';
|
|
39
|
+
/**
|
|
40
|
+
* An icon drawn as a mask, in the text color, gray inside a disabled control as its label is: a
|
|
41
|
+
* button, a select's trigger or a tab. An input's icons sit beside the input, not inside it, so
|
|
42
|
+
* they keep the text color when it is disabled. An icon drawn as an SVG, as Nuxt UI draws them on
|
|
43
|
+
* Vue, already takes the text color, and a fill behind it would hide it.
|
|
44
|
+
*/
|
|
45
|
+
export const forcedIcon = 'forced-colors:not-[svg]:bg-[CanvasText] forced-colors:in-disabled:not-[svg]:bg-[GrayText] forced-colors:in-aria-disabled:not-[svg]:bg-[GrayText]';
|
|
46
|
+
/**
|
|
47
|
+
* Color changes on hover and focus, in the fast duration, unless the reader asks for less motion.
|
|
48
|
+
* Nuxt UI puts transition-colors on its controls; this adds it where it does not, and takes it
|
|
49
|
+
* off for a reader who asks for less motion.
|
|
50
|
+
*/
|
|
51
|
+
export const transition = 'transition-colors motion-reduce:transition-none';
|
|
52
|
+
/**
|
|
53
|
+
* Text on a solid fill. The fill of a status is its text color, which reads on the page in both
|
|
54
|
+
* themes, so the page color reads on it: in the light theme every status fill is the text
|
|
55
|
+
* color, and the word on it carries the status. For danger that is the brand fill and the text
|
|
56
|
+
* on it, a pair the design system checks.
|
|
57
|
+
*/
|
|
58
|
+
export const solid = {
|
|
59
|
+
primary: 'bg-interactive text-on-interactive',
|
|
60
|
+
success: 'bg-tip-text text-bg',
|
|
61
|
+
info: 'bg-note-text text-bg',
|
|
62
|
+
warning: 'bg-warning-text text-bg',
|
|
63
|
+
error: 'bg-danger-text text-bg',
|
|
64
|
+
neutral: 'bg-text text-bg',
|
|
65
|
+
};
|
|
66
|
+
/** A tint of the color under its text color: the tag, and the status blocks of the system. */
|
|
67
|
+
export const tint = {
|
|
68
|
+
primary: 'bg-tag-bg text-tag-text',
|
|
69
|
+
success: 'bg-tip-tint text-tip-text',
|
|
70
|
+
info: 'bg-note-tint text-note-text',
|
|
71
|
+
warning: 'bg-warning-tint text-warning-text',
|
|
72
|
+
error: 'bg-danger-tint text-danger-text',
|
|
73
|
+
neutral: 'bg-raised text-text',
|
|
74
|
+
};
|
|
75
|
+
/** The color as text on the page. A status takes its text color, which can differ from it. */
|
|
76
|
+
export const text = {
|
|
77
|
+
primary: 'text-interactive',
|
|
78
|
+
success: 'text-tip-text',
|
|
79
|
+
info: 'text-note-text',
|
|
80
|
+
warning: 'text-warning-text',
|
|
81
|
+
error: 'text-danger-text',
|
|
82
|
+
neutral: 'text-text',
|
|
83
|
+
};
|
|
84
|
+
/** The color as an outline drawn inside the box, which takes no room. */
|
|
85
|
+
export const ring = {
|
|
86
|
+
primary: 'ring-interactive',
|
|
87
|
+
success: 'ring-tip',
|
|
88
|
+
info: 'ring-note',
|
|
89
|
+
warning: 'ring-warning',
|
|
90
|
+
error: 'ring-danger',
|
|
91
|
+
neutral: 'ring-field-border',
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* One compound variant for each color, from a class list for each. With a slot the classes go
|
|
95
|
+
* to that slot, without one to the component's first.
|
|
96
|
+
*/
|
|
97
|
+
export function byColor(classes, conditions, slot) {
|
|
98
|
+
return Object.keys(classes).map((color) => ({
|
|
99
|
+
color,
|
|
100
|
+
...conditions,
|
|
101
|
+
class: slot ? { [slot]: classes[color] } : classes[color],
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
slots: {
|
|
3
|
+
root: string;
|
|
4
|
+
tbody: string;
|
|
5
|
+
tr: string;
|
|
6
|
+
th: string;
|
|
7
|
+
td: string;
|
|
8
|
+
separator: string;
|
|
9
|
+
empty: string;
|
|
10
|
+
};
|
|
11
|
+
variants: {
|
|
12
|
+
pinned: {
|
|
13
|
+
true: {
|
|
14
|
+
th: string;
|
|
15
|
+
td: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
sticky: {
|
|
19
|
+
true: {
|
|
20
|
+
thead: string;
|
|
21
|
+
tfoot: string;
|
|
22
|
+
};
|
|
23
|
+
header: {
|
|
24
|
+
thead: string;
|
|
25
|
+
};
|
|
26
|
+
footer: {
|
|
27
|
+
tfoot: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
compoundVariants: ({
|
|
32
|
+
loading: boolean;
|
|
33
|
+
class: {
|
|
34
|
+
thead: string;
|
|
35
|
+
};
|
|
36
|
+
loadingColor?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
loading: boolean;
|
|
39
|
+
loadingColor: string;
|
|
40
|
+
class: {
|
|
41
|
+
thead: string;
|
|
42
|
+
};
|
|
43
|
+
})[];
|
|
44
|
+
};
|
|
45
|
+
export default _default;
|