@whatsaaaa/ui-vue 0.1.0 → 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/README.md +2 -2
- package/dist/theme/badge.d.ts +8 -0
- package/dist/theme/badge.js +13 -20
- package/dist/theme/button.d.ts +17 -0
- package/dist/theme/button.js +3 -0
- package/dist/theme/field-group.d.ts +9 -0
- package/dist/theme/field-group.js +16 -0
- package/dist/theme/field.d.ts +169 -37
- package/dist/theme/field.js +146 -71
- package/dist/theme/file-upload.d.ts +106 -0
- package/dist/theme/file-upload.js +124 -0
- package/dist/theme/index.d.ts +1217 -156
- package/dist/theme/index.js +18 -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 +42 -50
- package/dist/theme/input.js +38 -36
- package/dist/theme/pin-input.d.ts +61 -0
- package/dist/theme/pin-input.js +40 -0
- package/dist/theme/select-menu.d.ts +23 -50
- package/dist/theme/select-menu.js +2 -2
- package/dist/theme/select.d.ts +23 -50
- package/dist/theme/select.js +2 -2
- 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 +3 -3
package/README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# @whatsaaaa/ui-vue
|
|
4
4
|
|
|
5
|
-
[Nuxt UI](https://ui.nuxt.com) themed with the [Whatsaaaa design system](https://github.com/whatsaaaa/design-system), for Vue and Nuxt. A trial:
|
|
5
|
+
[Nuxt UI](https://ui.nuxt.com) themed with the [Whatsaaaa design system](https://github.com/whatsaaaa/design-system), for Vue and Nuxt. A trial: twelve core components (button, badge, input, text area, number field, select and select menu, checkbox, radio group, card, modal, table, tabs) take the system's terminal look through Nuxt UI's central config, in both themes, held to its specs, and seven more (pin input, input tags, input menu, input date, input time, file upload, field group) are restyled on its tiers.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
pnpm add @whatsaaaa/ui-vue '@whatsaaaa/design-system@^1.
|
|
10
|
+
pnpm add @whatsaaaa/ui-vue '@whatsaaaa/design-system@^1.1.0' '@nuxt/ui@~4.13.0' tailwindcss
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
The versions are the package's peer ranges: a release works with one minor of Nuxt UI and, until the design system's 1.0.0, one minor of it.
|
package/dist/theme/badge.d.ts
CHANGED
package/dist/theme/badge.js
CHANGED
|
@@ -46,6 +46,14 @@ const subtleRing = {
|
|
|
46
46
|
error: 'ring ring-inset ring-danger/50',
|
|
47
47
|
neutral: 'ring ring-inset ring-border',
|
|
48
48
|
};
|
|
49
|
+
/** The tag's room and type at each size: an input's tags take them too. */
|
|
50
|
+
export const tagSizes = {
|
|
51
|
+
xs: 'rounded-(--ws-tag-radius) px-(--ws-tag-padding-inline-xs) py-0 gap-(--ws-space-4) text-caption',
|
|
52
|
+
sm: 'rounded-(--ws-tag-radius) px-(--ws-tag-padding-inline-sm) py-(--ws-tag-padding-block-sm) gap-(--ws-space-4) text-caption',
|
|
53
|
+
md: 'rounded-(--ws-tag-radius) px-(--ws-tag-padding-inline-md) py-(--ws-tag-padding-block-md) gap-(--ws-space-6) text-label-sm',
|
|
54
|
+
lg: 'rounded-(--ws-tag-radius) px-(--ws-tag-padding-inline-lg) py-(--ws-tag-padding-block-lg) gap-(--ws-space-6) text-label',
|
|
55
|
+
xl: 'rounded-(--ws-tag-radius) px-(--ws-tag-padding-inline-xl) py-(--ws-tag-padding-block-xl) gap-(--ws-space-8) text-label',
|
|
56
|
+
};
|
|
49
57
|
/** The icon of the system's text, at every size. */
|
|
50
58
|
const icon = { leadingIcon: 'size-icon', trailingIcon: 'size-icon' };
|
|
51
59
|
export default {
|
|
@@ -58,26 +66,11 @@ export default {
|
|
|
58
66
|
},
|
|
59
67
|
variants: {
|
|
60
68
|
size: {
|
|
61
|
-
xs: {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
base: 'rounded-(--ws-tag-radius) px-(--ws-tag-padding-inline-sm) py-(--ws-tag-padding-block-sm) gap-(--ws-space-4) text-caption',
|
|
67
|
-
...icon,
|
|
68
|
-
},
|
|
69
|
-
md: {
|
|
70
|
-
base: 'rounded-(--ws-tag-radius) px-(--ws-tag-padding-inline-md) py-(--ws-tag-padding-block-md) gap-(--ws-space-6) text-label-sm',
|
|
71
|
-
...icon,
|
|
72
|
-
},
|
|
73
|
-
lg: {
|
|
74
|
-
base: 'rounded-(--ws-tag-radius) px-(--ws-tag-padding-inline-lg) py-(--ws-tag-padding-block-lg) gap-(--ws-space-6) text-label',
|
|
75
|
-
...icon,
|
|
76
|
-
},
|
|
77
|
-
xl: {
|
|
78
|
-
base: 'rounded-(--ws-tag-radius) px-(--ws-tag-padding-inline-xl) py-(--ws-tag-padding-block-xl) gap-(--ws-space-8) text-label',
|
|
79
|
-
...icon,
|
|
80
|
-
},
|
|
69
|
+
xs: { base: tagSizes.xs, ...icon },
|
|
70
|
+
sm: { base: tagSizes.sm, ...icon },
|
|
71
|
+
md: { base: tagSizes.md, ...icon },
|
|
72
|
+
lg: { base: tagSizes.lg, ...icon },
|
|
73
|
+
xl: { base: tagSizes.xl, ...icon },
|
|
81
74
|
},
|
|
82
75
|
},
|
|
83
76
|
compoundVariants: [
|
package/dist/theme/button.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ declare const _default: {
|
|
|
48
48
|
variant: string;
|
|
49
49
|
class: string;
|
|
50
50
|
loading?: undefined;
|
|
51
|
+
fieldGroup?: undefined;
|
|
51
52
|
square?: undefined;
|
|
52
53
|
size?: undefined;
|
|
53
54
|
leading?: undefined;
|
|
@@ -56,6 +57,7 @@ declare const _default: {
|
|
|
56
57
|
variant: string[];
|
|
57
58
|
loading: boolean;
|
|
58
59
|
class: string;
|
|
60
|
+
fieldGroup?: undefined;
|
|
59
61
|
square?: undefined;
|
|
60
62
|
size?: undefined;
|
|
61
63
|
leading?: undefined;
|
|
@@ -64,6 +66,7 @@ declare const _default: {
|
|
|
64
66
|
variant: string[];
|
|
65
67
|
class: string;
|
|
66
68
|
loading?: undefined;
|
|
69
|
+
fieldGroup?: undefined;
|
|
67
70
|
square?: undefined;
|
|
68
71
|
size?: undefined;
|
|
69
72
|
leading?: undefined;
|
|
@@ -72,11 +75,22 @@ declare const _default: {
|
|
|
72
75
|
variant: string;
|
|
73
76
|
loading: boolean;
|
|
74
77
|
class: string;
|
|
78
|
+
fieldGroup?: undefined;
|
|
75
79
|
square?: undefined;
|
|
76
80
|
size?: undefined;
|
|
77
81
|
leading?: undefined;
|
|
78
82
|
trailing?: undefined;
|
|
79
83
|
} | {
|
|
84
|
+
class: string;
|
|
85
|
+
variant?: undefined;
|
|
86
|
+
loading?: undefined;
|
|
87
|
+
fieldGroup?: undefined;
|
|
88
|
+
square?: undefined;
|
|
89
|
+
size?: undefined;
|
|
90
|
+
leading?: undefined;
|
|
91
|
+
trailing?: undefined;
|
|
92
|
+
} | {
|
|
93
|
+
fieldGroup: string[];
|
|
80
94
|
class: string;
|
|
81
95
|
variant?: undefined;
|
|
82
96
|
loading?: undefined;
|
|
@@ -90,6 +104,7 @@ declare const _default: {
|
|
|
90
104
|
class: string;
|
|
91
105
|
variant?: undefined;
|
|
92
106
|
loading?: undefined;
|
|
107
|
+
fieldGroup?: undefined;
|
|
93
108
|
leading?: undefined;
|
|
94
109
|
trailing?: undefined;
|
|
95
110
|
} | {
|
|
@@ -100,6 +115,7 @@ declare const _default: {
|
|
|
100
115
|
trailingIcon?: undefined;
|
|
101
116
|
};
|
|
102
117
|
variant?: undefined;
|
|
118
|
+
fieldGroup?: undefined;
|
|
103
119
|
square?: undefined;
|
|
104
120
|
size?: undefined;
|
|
105
121
|
trailing?: undefined;
|
|
@@ -112,6 +128,7 @@ declare const _default: {
|
|
|
112
128
|
leadingIcon?: undefined;
|
|
113
129
|
};
|
|
114
130
|
variant?: undefined;
|
|
131
|
+
fieldGroup?: undefined;
|
|
115
132
|
square?: undefined;
|
|
116
133
|
size?: undefined;
|
|
117
134
|
})[];
|
package/dist/theme/button.js
CHANGED
|
@@ -168,6 +168,9 @@ export default {
|
|
|
168
168
|
{
|
|
169
169
|
class: 'outline-interactive focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-3',
|
|
170
170
|
},
|
|
171
|
+
// In a field group the button with the focus comes over a field in a color or under the
|
|
172
|
+
// pointer, which field.ts raises, so that its ring shows whole.
|
|
173
|
+
{ fieldGroup: ['horizontal', 'vertical'], class: 'focus-visible:z-[3]' },
|
|
171
174
|
// An icon button is as wide as it is tall.
|
|
172
175
|
{ square: true, size: 'xs', class: 'w-(--ws-control-height-xs) px-0 justify-center' },
|
|
173
176
|
{ square: true, size: 'sm', class: 'w-(--ws-control-height-sm) px-0 justify-center' },
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Controls joined in a row or a column: each one's edge lies over the one before it, by the
|
|
3
|
+
* control's border width, so that where two meet their edges are one line, at every size and in
|
|
4
|
+
* forced colors, which draw the same edge. Nuxt UI squares the corners where they meet. A field
|
|
5
|
+
* in a color or under the pointer comes over the controls beside it, so that the line is its
|
|
6
|
+
* edge, and a control with the focus over those too, so that its ring shows whole: field.ts
|
|
7
|
+
* raises a field, button.ts a button.
|
|
8
|
+
*/
|
|
9
|
+
export default {
|
|
10
|
+
variants: {
|
|
11
|
+
orientation: {
|
|
12
|
+
horizontal: '-space-x-(--ws-control-border-width-rest)',
|
|
13
|
+
vertical: '-space-y-(--ws-control-border-width-rest)',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
package/dist/theme/field.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ByColor } from './shared.ts';
|
|
1
2
|
/**
|
|
2
3
|
* The heights, paddings and value sizes, for the field and the icons in it. An input's icons sit
|
|
3
4
|
* beside it, not inside its edge: past the padding and the rest edge, where a value starts.
|
|
@@ -39,6 +40,34 @@ export declare const fieldSizes: {
|
|
|
39
40
|
trailingIcon: string;
|
|
40
41
|
};
|
|
41
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* The icons of a field that draws them inside its edge, as a field of tags and a date field do:
|
|
45
|
+
* the padding in from the edge, less what an edge wider than at rest adds, so that they sit where
|
|
46
|
+
* a text field's do and stay there when the edge widens. On the bare field, which draws no edge,
|
|
47
|
+
* that is the padding in from its side, as on a bare text field.
|
|
48
|
+
*/
|
|
49
|
+
export declare const iconsWithinSizes: {
|
|
50
|
+
xs: {
|
|
51
|
+
leading: string;
|
|
52
|
+
trailing: string;
|
|
53
|
+
};
|
|
54
|
+
sm: {
|
|
55
|
+
leading: string;
|
|
56
|
+
trailing: string;
|
|
57
|
+
};
|
|
58
|
+
md: {
|
|
59
|
+
leading: string;
|
|
60
|
+
trailing: string;
|
|
61
|
+
};
|
|
62
|
+
lg: {
|
|
63
|
+
leading: string;
|
|
64
|
+
trailing: string;
|
|
65
|
+
};
|
|
66
|
+
xl: {
|
|
67
|
+
leading: string;
|
|
68
|
+
trailing: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
42
71
|
/** In forced colors every field but the bare one is outlined, as a field there is. */
|
|
43
72
|
export declare const fieldVariants: {
|
|
44
73
|
outline: string;
|
|
@@ -47,16 +76,57 @@ export declare const fieldVariants: {
|
|
|
47
76
|
ghost: string;
|
|
48
77
|
none: string;
|
|
49
78
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
79
|
+
/** The same, with the focus inside: disabled is Reka's data-disabled, on an element that is no control. */
|
|
80
|
+
export declare const fieldWithinVariants: {
|
|
81
|
+
outline: string;
|
|
82
|
+
soft: string;
|
|
83
|
+
subtle: string;
|
|
84
|
+
ghost: string;
|
|
85
|
+
none: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* A highlighted field takes its color as the edge, and keeps it on hover and focus. A field in
|
|
89
|
+
* error is highlighted in the error color: the invalid edge, wider.
|
|
90
|
+
*/
|
|
91
|
+
export declare const fieldHighlight: ByColor;
|
|
92
|
+
/**
|
|
93
|
+
* The room for an icon at the start or the end of the field, where text before or after the value
|
|
94
|
+
* starts past it: the field's padding, the icon and the gap, less the extra edge.
|
|
95
|
+
*/
|
|
96
|
+
export declare const iconRoomStart: {
|
|
97
|
+
xs: string;
|
|
98
|
+
sm: string;
|
|
99
|
+
md: string;
|
|
100
|
+
lg: string;
|
|
101
|
+
xl: string;
|
|
102
|
+
};
|
|
103
|
+
export declare const iconRoomEnd: {
|
|
104
|
+
xs: string;
|
|
105
|
+
sm: string;
|
|
106
|
+
md: string;
|
|
107
|
+
lg: string;
|
|
108
|
+
xl: string;
|
|
109
|
+
};
|
|
110
|
+
export type FieldSize = keyof typeof iconRoomStart;
|
|
111
|
+
export declare const fieldSizeNames: FieldSize[];
|
|
112
|
+
/**
|
|
113
|
+
* What every field shares across its states: the edge on hover, on focus and disabled, the
|
|
114
|
+
* focus ring, the highlighted edge, and one size of the value at every width.
|
|
115
|
+
*/
|
|
116
|
+
export declare const fieldStateVariants: ({
|
|
117
|
+
variant: string;
|
|
118
|
+
highlight: boolean;
|
|
53
119
|
class: string;
|
|
54
|
-
|
|
120
|
+
color?: undefined;
|
|
55
121
|
} | {
|
|
56
|
-
|
|
57
|
-
|
|
122
|
+
variant: string;
|
|
123
|
+
highlight: boolean;
|
|
124
|
+
color: string;
|
|
125
|
+
class: string;
|
|
126
|
+
} | {
|
|
127
|
+
fixed: boolean;
|
|
128
|
+
size: string[];
|
|
58
129
|
class: string;
|
|
59
|
-
leading?: undefined;
|
|
60
130
|
} | ({
|
|
61
131
|
highlight: boolean;
|
|
62
132
|
} & {
|
|
@@ -65,43 +135,77 @@ export declare const fieldCompoundVariants: ({
|
|
|
65
135
|
}) | {
|
|
66
136
|
variant: string[];
|
|
67
137
|
class: string;
|
|
68
|
-
|
|
138
|
+
})[];
|
|
139
|
+
export declare const fieldCompoundVariants: ({
|
|
140
|
+
variant: string;
|
|
141
|
+
highlight: boolean;
|
|
142
|
+
class: string;
|
|
69
143
|
color?: undefined;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
144
|
+
} | {
|
|
145
|
+
variant: string;
|
|
146
|
+
highlight: boolean;
|
|
147
|
+
color: string;
|
|
148
|
+
class: string;
|
|
149
|
+
} | {
|
|
150
|
+
fixed: boolean;
|
|
151
|
+
size: string[];
|
|
152
|
+
class: string;
|
|
153
|
+
} | {
|
|
154
|
+
leading: boolean;
|
|
155
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
156
|
+
class: string;
|
|
157
|
+
} | {
|
|
158
|
+
trailing: boolean;
|
|
159
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
160
|
+
class: string;
|
|
161
|
+
} | {
|
|
162
|
+
loading: boolean;
|
|
163
|
+
leading: boolean;
|
|
164
|
+
class: {
|
|
165
|
+
leadingIcon: string;
|
|
166
|
+
trailingIcon?: undefined;
|
|
167
|
+
};
|
|
74
168
|
trailing?: undefined;
|
|
75
169
|
} | {
|
|
170
|
+
loading: boolean;
|
|
171
|
+
leading: boolean;
|
|
172
|
+
trailing: boolean;
|
|
173
|
+
class: {
|
|
174
|
+
trailingIcon: string;
|
|
175
|
+
leadingIcon?: undefined;
|
|
176
|
+
};
|
|
177
|
+
} | ({
|
|
178
|
+
highlight: boolean;
|
|
179
|
+
} & {
|
|
180
|
+
color: import("./shared.ts").Color;
|
|
181
|
+
class: string | Record<string, string>;
|
|
182
|
+
}) | {
|
|
183
|
+
variant: string[];
|
|
184
|
+
class: string;
|
|
185
|
+
})[];
|
|
186
|
+
/** The same, with the focus inside. */
|
|
187
|
+
export declare const fieldWithinCompoundVariants: ({
|
|
76
188
|
variant: string;
|
|
77
189
|
highlight: boolean;
|
|
78
190
|
class: string;
|
|
79
191
|
color?: undefined;
|
|
80
|
-
fixed?: undefined;
|
|
81
|
-
size?: undefined;
|
|
82
|
-
loading?: undefined;
|
|
83
|
-
leading?: undefined;
|
|
84
|
-
trailing?: undefined;
|
|
85
192
|
} | {
|
|
86
193
|
variant: string;
|
|
87
194
|
highlight: boolean;
|
|
88
195
|
color: string;
|
|
89
196
|
class: string;
|
|
90
|
-
fixed?: undefined;
|
|
91
|
-
size?: undefined;
|
|
92
|
-
loading?: undefined;
|
|
93
|
-
leading?: undefined;
|
|
94
|
-
trailing?: undefined;
|
|
95
197
|
} | {
|
|
96
198
|
fixed: boolean;
|
|
97
199
|
size: string[];
|
|
98
200
|
class: string;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
trailing
|
|
201
|
+
} | {
|
|
202
|
+
leading: boolean;
|
|
203
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
204
|
+
class: string;
|
|
205
|
+
} | {
|
|
206
|
+
trailing: boolean;
|
|
207
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
208
|
+
class: string;
|
|
105
209
|
} | {
|
|
106
210
|
loading: boolean;
|
|
107
211
|
leading: boolean;
|
|
@@ -109,11 +213,6 @@ export declare const fieldCompoundVariants: ({
|
|
|
109
213
|
leadingIcon: string;
|
|
110
214
|
trailingIcon?: undefined;
|
|
111
215
|
};
|
|
112
|
-
variant?: undefined;
|
|
113
|
-
highlight?: undefined;
|
|
114
|
-
color?: undefined;
|
|
115
|
-
fixed?: undefined;
|
|
116
|
-
size?: undefined;
|
|
117
216
|
trailing?: undefined;
|
|
118
217
|
} | {
|
|
119
218
|
loading: boolean;
|
|
@@ -123,9 +222,42 @@ export declare const fieldCompoundVariants: ({
|
|
|
123
222
|
trailingIcon: string;
|
|
124
223
|
leadingIcon?: undefined;
|
|
125
224
|
};
|
|
126
|
-
|
|
225
|
+
} | ({
|
|
226
|
+
highlight: boolean;
|
|
227
|
+
} & {
|
|
228
|
+
color: import("./shared.ts").Color;
|
|
229
|
+
class: string | Record<string, string>;
|
|
230
|
+
}) | {
|
|
231
|
+
variant: string[];
|
|
232
|
+
class: string;
|
|
233
|
+
})[];
|
|
234
|
+
/**
|
|
235
|
+
* In a field group each control's edge lies over the one before it, so that the two make one
|
|
236
|
+
* line. A field under the pointer comes over the controls beside it, so that the line is its
|
|
237
|
+
* edge, one in a color over those too, under the pointer or not, so that its color keeps the
|
|
238
|
+
* line, and one with the focus, on itself or on a part inside it, over all of them, so that its
|
|
239
|
+
* ring shows whole: on the part that is the group's item, the field itself, or the root around a
|
|
240
|
+
* text field.
|
|
241
|
+
*/
|
|
242
|
+
export declare const inGroup: ({
|
|
243
|
+
fieldGroup: string[];
|
|
244
|
+
class: string;
|
|
127
245
|
highlight?: undefined;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
246
|
+
} | {
|
|
247
|
+
fieldGroup: string[];
|
|
248
|
+
highlight: boolean;
|
|
249
|
+
class: string;
|
|
250
|
+
})[];
|
|
251
|
+
export declare const inGroupRoot: ({
|
|
252
|
+
fieldGroup: string[];
|
|
253
|
+
class: {
|
|
254
|
+
root: string;
|
|
255
|
+
};
|
|
256
|
+
highlight?: undefined;
|
|
257
|
+
} | {
|
|
258
|
+
fieldGroup: string[];
|
|
259
|
+
highlight: boolean;
|
|
260
|
+
class: {
|
|
261
|
+
root: string;
|
|
262
|
+
};
|
|
131
263
|
})[];
|