nuxt-ui-ink 0.1.0 → 0.3.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 +12 -5
- package/app/app.config.ts +172 -74
- package/package.json +2 -2
- package/theme.css +5 -1
package/README.md
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
A theme for [Nuxt UI](https://ui.nuxt.com) 4, as a Nuxt layer. Monochrome, with one blue accent, in light and dark.
|
|
4
4
|
|
|
5
5
|
Surfaces have no border: a card, a field or a menu is drawn by a half-pixel line and a small shadow. The primary
|
|
6
|
-
button is a dark chip. A focused field darkens its edge instead of growing a ring.
|
|
6
|
+
button is a dark chip. A focused field darkens its edge instead of growing a ring. Controls are a little smaller
|
|
7
|
+
than Nuxt UI's.
|
|
7
8
|
|
|
8
9
|
## Install
|
|
9
10
|
|
|
@@ -28,8 +29,8 @@ export default defineNuxtConfig({
|
|
|
28
29
|
@import "nuxt-ui-ink/theme.css";
|
|
29
30
|
```
|
|
30
31
|
|
|
31
|
-
The layer adds the Nuxt UI module, the component overrides,
|
|
32
|
-
Inter font. The stylesheet has to be imported from yours so Tailwind compiles both together.
|
|
32
|
+
The layer adds the Nuxt UI module, the component overrides, Solar icons for the icons Nuxt UI renders itself, and
|
|
33
|
+
the Inter font. Use the same set in your own components with `i-solar-…-bold`. The stylesheet has to be imported from yours so Tailwind compiles both together.
|
|
33
34
|
|
|
34
35
|
## Classes
|
|
35
36
|
|
|
@@ -40,6 +41,7 @@ Inter font. The stylesheet has to be imported from yours so Tailwind compiles bo
|
|
|
40
41
|
| `bg-raised` | A surface on a tinted track, such as the knob of a segmented control. |
|
|
41
42
|
| `ring-stroke`, `border-stroke`, `divide-stroke` | Lines between things. |
|
|
42
43
|
| `ring-edge`, `border-edge` | A firmer line, as on a checkbox. |
|
|
44
|
+
| `outline-focus` | The keyboard-focus ring. |
|
|
43
45
|
| `shadow-card`, `shadow-card-hover` | A surface at rest and hovered. |
|
|
44
46
|
| `shadow-focus` | A focused field. |
|
|
45
47
|
| `shadow-lift` | A hovered card that links somewhere. |
|
|
@@ -83,7 +85,11 @@ export default defineAppConfig({
|
|
|
83
85
|
and on white cards alike. Two of them stacked get darker, and they do not hide what is behind them. Use
|
|
84
86
|
`bg-(--ink-solid)` where that matters.
|
|
85
87
|
- The half-pixel lines are sharp on high-density screens and can look softer on a 1x display.
|
|
86
|
-
-
|
|
88
|
+
- Sizes keep Nuxt UI's names but are smaller. Buttons are 20, 24, 28, 32 and 36px high (`xs` to `xl`), four less
|
|
89
|
+
than Nuxt UI's, with 13px text at `md`. Fields keep their height (32px at `md`) and use 13px text on desktop; on
|
|
90
|
+
phones they stay at 16px so the browser does not zoom. A button joined to a field in a `UFieldGroup` takes the
|
|
91
|
+
field's height.
|
|
92
|
+
- Keyboard focus shows as a blue ring (`--ink-focus`).
|
|
87
93
|
|
|
88
94
|
## Development
|
|
89
95
|
|
|
@@ -104,4 +110,5 @@ renamed slot in a new Nuxt UI version fails the test instead of silently styling
|
|
|
104
110
|
|
|
105
111
|
## License
|
|
106
112
|
|
|
107
|
-
MIT
|
|
113
|
+
MIT. The icons are [Solar](https://www.figma.com/community/file/1166831539721848736) by 480 Design, under CC BY 4.0,
|
|
114
|
+
which asks for attribution: credit them somewhere in a product that ships these icons.
|
package/app/app.config.ts
CHANGED
|
@@ -17,6 +17,7 @@ const rowByState = 'data-highlighted:before:bg-elevated data-[state=open]:before
|
|
|
17
17
|
|
|
18
18
|
/** A field at rest and hovered */
|
|
19
19
|
const field = 'bg-default ring-0 shadow-card hover:shadow-card-hover disabled:shadow-card'
|
|
20
|
+
const fieldBase = 'rounded-[7px] transition-[box-shadow,background-color]'
|
|
20
21
|
const fieldSoft = 'bg-elevated hover:bg-accented focus:bg-accented has-focus:bg-accented'
|
|
21
22
|
const fieldSubtle = 'ring-stroke'
|
|
22
23
|
|
|
@@ -24,6 +25,39 @@ const fieldSubtle = 'ring-stroke'
|
|
|
24
25
|
const focus = { color: 'primary' as const, variant: 'outline' as const, class: 'outline-0 focus-visible:outline-0 focus-visible:shadow-focus' }
|
|
25
26
|
const focusWithin = { color: 'primary' as const, variant: 'outline' as const, class: 'outline-0 has-focus-visible:outline-0 has-focus-visible:shadow-focus' }
|
|
26
27
|
|
|
28
|
+
/** Controls are set in 13px, one step under Nuxt UI's 14px (phones keep 16px in fields, so they do not zoom) */
|
|
29
|
+
const small = 'text-[13px]/5'
|
|
30
|
+
|
|
31
|
+
/** A field's text and icons at the two middle sizes, and the room its icons take */
|
|
32
|
+
const fieldSizes = {
|
|
33
|
+
md: { leadingIcon: 'size-4', trailingIcon: 'size-4' },
|
|
34
|
+
lg: { leadingIcon: 'size-4', trailingIcon: 'size-4' }
|
|
35
|
+
}
|
|
36
|
+
const fieldText = [
|
|
37
|
+
{ fixed: false, size: 'md' as const, class: 'md:text-[13px]/5' },
|
|
38
|
+
{ fixed: false, size: 'lg' as const, class: 'md:text-[13px]/5' }
|
|
39
|
+
]
|
|
40
|
+
const fieldIcons = [
|
|
41
|
+
{ leading: true, size: 'md' as const, class: 'ps-8' },
|
|
42
|
+
{ trailing: true, size: 'md' as const, class: 'pe-8' },
|
|
43
|
+
{ leading: true, size: 'lg' as const, class: 'ps-9' },
|
|
44
|
+
{ trailing: true, size: 'lg' as const, class: 'pe-9' }
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
/** A field that opens a menu: its rows follow */
|
|
48
|
+
const pickerSizes = {
|
|
49
|
+
md: { ...fieldSizes.md, item: small, itemLeadingIcon: 'size-4 my-0.5', itemTrailingIcon: 'size-4 my-0.5' },
|
|
50
|
+
lg: fieldSizes.lg
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** A menu row at the default size */
|
|
54
|
+
// A 16px icon beside a 20px line sits in its middle
|
|
55
|
+
const rowSizes = { md: { label: 'text-xs', item: small, itemLeadingIcon: 'size-4 my-0.5', itemTrailingIcon: 'size-4 my-0.5' } }
|
|
56
|
+
|
|
57
|
+
/** The ring around what the keyboard is on */
|
|
58
|
+
const ring = 'focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus'
|
|
59
|
+
const everyColor = ['primary', 'secondary', 'success', 'info', 'warning', 'error', 'neutral'] as const
|
|
60
|
+
|
|
27
61
|
/** A tag inside a field */
|
|
28
62
|
const tag = 'rounded-sm ring-0 bg-accented'
|
|
29
63
|
|
|
@@ -67,61 +101,72 @@ export default defineAppConfig({
|
|
|
67
101
|
}
|
|
68
102
|
},
|
|
69
103
|
|
|
70
|
-
//
|
|
104
|
+
// Solar for every icon the library renders on its own: the filled style for things, the line style for
|
|
105
|
+
// arrows, chevrons and the search glass, whose filled versions are solid shapes
|
|
71
106
|
icons: {
|
|
72
|
-
arrowDown: 'i-
|
|
73
|
-
arrowLeft: 'i-
|
|
74
|
-
arrowRight: 'i-
|
|
75
|
-
arrowUp: 'i-
|
|
76
|
-
caution: 'i-
|
|
77
|
-
check: 'i-
|
|
78
|
-
chevronDoubleLeft: 'i-
|
|
79
|
-
chevronDoubleRight: 'i-
|
|
80
|
-
chevronDown: 'i-
|
|
81
|
-
chevronLeft: 'i-
|
|
82
|
-
chevronRight: 'i-
|
|
83
|
-
chevronUp: 'i-
|
|
84
|
-
close: 'i-
|
|
85
|
-
copy: 'i-
|
|
86
|
-
copyCheck: 'i-
|
|
87
|
-
dark: 'i-
|
|
88
|
-
drag: 'i-
|
|
89
|
-
edit: 'i-
|
|
90
|
-
ellipsis: 'i-
|
|
91
|
-
error: 'i-
|
|
92
|
-
external: 'i-
|
|
93
|
-
eye: 'i-
|
|
94
|
-
eyeOff: 'i-
|
|
95
|
-
file: 'i-
|
|
96
|
-
folder: 'i-
|
|
97
|
-
folderOpen: 'i-
|
|
98
|
-
hash: 'i-
|
|
99
|
-
info: 'i-
|
|
100
|
-
light: 'i-
|
|
101
|
-
loading: 'i-
|
|
102
|
-
menu: 'i-
|
|
103
|
-
minus: 'i-
|
|
104
|
-
panelClose: 'i-
|
|
105
|
-
panelOpen: 'i-
|
|
106
|
-
plus: 'i-
|
|
107
|
-
reload: 'i-
|
|
108
|
-
search: 'i-
|
|
109
|
-
star: 'i-
|
|
110
|
-
stop: 'i-
|
|
111
|
-
success: 'i-
|
|
112
|
-
system: 'i-
|
|
113
|
-
tip: 'i-
|
|
114
|
-
trash: 'i-
|
|
115
|
-
upload: 'i-
|
|
116
|
-
warning: 'i-
|
|
107
|
+
arrowDown: 'i-solar-arrow-down-linear',
|
|
108
|
+
arrowLeft: 'i-solar-arrow-left-linear',
|
|
109
|
+
arrowRight: 'i-solar-arrow-right-linear',
|
|
110
|
+
arrowUp: 'i-solar-arrow-up-linear',
|
|
111
|
+
caution: 'i-solar-danger-circle-bold',
|
|
112
|
+
check: 'i-solar-check-bold',
|
|
113
|
+
chevronDoubleLeft: 'i-solar-double-alt-arrow-left-linear',
|
|
114
|
+
chevronDoubleRight: 'i-solar-double-alt-arrow-right-linear',
|
|
115
|
+
chevronDown: 'i-solar-alt-arrow-down-linear',
|
|
116
|
+
chevronLeft: 'i-solar-alt-arrow-left-linear',
|
|
117
|
+
chevronRight: 'i-solar-alt-arrow-right-linear',
|
|
118
|
+
chevronUp: 'i-solar-alt-arrow-up-linear',
|
|
119
|
+
close: 'i-solar-close-bold',
|
|
120
|
+
copy: 'i-solar-copy-bold',
|
|
121
|
+
copyCheck: 'i-solar-copy-check-bold',
|
|
122
|
+
dark: 'i-solar-moon-bold',
|
|
123
|
+
drag: 'i-solar-reorder-linear',
|
|
124
|
+
edit: 'i-solar-pen-new-square-bold',
|
|
125
|
+
ellipsis: 'i-solar-menu-dots-bold',
|
|
126
|
+
error: 'i-solar-close-circle-bold',
|
|
127
|
+
external: 'i-solar-arrow-right-up-linear',
|
|
128
|
+
eye: 'i-solar-eye-bold',
|
|
129
|
+
eyeOff: 'i-solar-eye-closed-bold',
|
|
130
|
+
file: 'i-solar-file-bold',
|
|
131
|
+
folder: 'i-solar-folder-bold',
|
|
132
|
+
folderOpen: 'i-solar-folder-open-bold',
|
|
133
|
+
hash: 'i-solar-hashtag-bold',
|
|
134
|
+
info: 'i-solar-info-circle-bold',
|
|
135
|
+
light: 'i-solar-sun-2-bold',
|
|
136
|
+
loading: 'i-solar-loader-bold',
|
|
137
|
+
menu: 'i-solar-hamburger-menu-linear',
|
|
138
|
+
minus: 'i-solar-minus-bold',
|
|
139
|
+
panelClose: 'i-solar-panel-left-close-bold',
|
|
140
|
+
panelOpen: 'i-solar-panel-left-open-bold',
|
|
141
|
+
plus: 'i-solar-add-bold',
|
|
142
|
+
reload: 'i-solar-restart-bold',
|
|
143
|
+
search: 'i-solar-magnifier-linear',
|
|
144
|
+
star: 'i-solar-star-bold',
|
|
145
|
+
stop: 'i-solar-stop-bold',
|
|
146
|
+
success: 'i-solar-check-circle-bold',
|
|
147
|
+
system: 'i-solar-monitor-bold',
|
|
148
|
+
tip: 'i-solar-lightbulb-bold',
|
|
149
|
+
trash: 'i-solar-trash-bin-trash-bold',
|
|
150
|
+
upload: 'i-solar-upload-bold',
|
|
151
|
+
warning: 'i-solar-danger-triangle-bold'
|
|
117
152
|
},
|
|
118
153
|
|
|
119
154
|
/* ── Elements ─────────────────────────────────────────────────────────────────────────────────────────── */
|
|
120
155
|
|
|
156
|
+
// Four pixels shorter than Nuxt UI's at every size: 20, 24, 28, 32 and 36 high
|
|
121
157
|
button: {
|
|
122
158
|
slots: {
|
|
123
159
|
base: 'font-medium transition-[background-color,color,box-shadow,scale] active:scale-[0.98]'
|
|
124
160
|
},
|
|
161
|
+
variants: {
|
|
162
|
+
size: {
|
|
163
|
+
xs: { base: 'px-1.5 py-0.5 text-xs gap-1', leadingIcon: 'size-3.5', trailingIcon: 'size-3.5' },
|
|
164
|
+
sm: { base: 'px-2 py-1 text-xs gap-1', leadingIcon: 'size-3.5', trailingIcon: 'size-3.5' },
|
|
165
|
+
md: { base: `px-2.5 py-1 ${small} gap-1.5`, leadingIcon: 'size-4', trailingIcon: 'size-4' },
|
|
166
|
+
lg: { base: `px-3 py-1.5 ${small} gap-1.5`, leadingIcon: 'size-4', trailingIcon: 'size-4' },
|
|
167
|
+
xl: { base: 'px-3.5 py-2 text-sm gap-2', leadingIcon: 'size-5', trailingIcon: 'size-5' }
|
|
168
|
+
}
|
|
169
|
+
},
|
|
125
170
|
compoundVariants: [
|
|
126
171
|
// A dark chip
|
|
127
172
|
{ color: 'primary', variant: 'solid', class: 'hover:bg-primary/90 active:bg-primary/90' },
|
|
@@ -130,7 +175,18 @@ export default defineAppConfig({
|
|
|
130
175
|
{ color: 'neutral', variant: 'soft', class: 'bg-elevated text-highlighted hover:bg-accented active:bg-accented' },
|
|
131
176
|
{ color: 'neutral', variant: 'subtle', class: 'bg-elevated text-highlighted ring-stroke hover:bg-accented' },
|
|
132
177
|
// A muted label until hovered
|
|
133
|
-
{ color: 'neutral', variant: 'ghost', class: 'text-toned hover:text-highlighted hover:bg-elevated active:bg-elevated' }
|
|
178
|
+
{ color: 'neutral', variant: 'ghost', class: 'text-toned hover:text-highlighted hover:bg-elevated active:bg-elevated' },
|
|
179
|
+
{ color: [...everyColor], class: ring },
|
|
180
|
+
// An icon alone makes a square of the same height
|
|
181
|
+
{ size: 'xs', square: true, class: 'p-[3px]' },
|
|
182
|
+
{ size: 'sm', square: true, class: 'p-[5px]' },
|
|
183
|
+
// Joined to a field, a button takes the field's height
|
|
184
|
+
{ fieldGroup: ['horizontal', 'vertical'], size: 'xs', class: 'py-1' },
|
|
185
|
+
{ fieldGroup: ['horizontal', 'vertical'], size: 'sm', class: 'py-1.5' },
|
|
186
|
+
{ fieldGroup: ['horizontal', 'vertical'], size: 'md', class: 'py-1.5' },
|
|
187
|
+
{ fieldGroup: ['horizontal', 'vertical'], size: 'lg', class: 'py-2' },
|
|
188
|
+
{ fieldGroup: ['horizontal', 'vertical'], size: 'xl', class: 'py-2.5' },
|
|
189
|
+
{ fieldGroup: ['horizontal', 'vertical'], size: 'md', square: true, class: 'p-2' }
|
|
134
190
|
]
|
|
135
191
|
},
|
|
136
192
|
|
|
@@ -138,6 +194,13 @@ export default defineAppConfig({
|
|
|
138
194
|
slots: {
|
|
139
195
|
base: 'rounded-sm font-medium'
|
|
140
196
|
},
|
|
197
|
+
variants: {
|
|
198
|
+
size: {
|
|
199
|
+
sm: { base: 'px-1 py-0.5 text-[10px]/3.5' },
|
|
200
|
+
md: { base: 'px-1.5 py-0.5 text-xs' },
|
|
201
|
+
lg: { base: 'px-2 py-0.5 text-[13px]/5' }
|
|
202
|
+
}
|
|
203
|
+
},
|
|
141
204
|
compoundVariants: [
|
|
142
205
|
{ color: 'neutral', variant: 'outline', class: 'bg-default text-toned ring-0 shadow-card' },
|
|
143
206
|
{ color: 'neutral', variant: 'soft', class: 'bg-accented text-toned' },
|
|
@@ -222,119 +285,127 @@ export default defineAppConfig({
|
|
|
222
285
|
|
|
223
286
|
input: {
|
|
224
287
|
slots: {
|
|
225
|
-
base:
|
|
288
|
+
base: fieldBase
|
|
226
289
|
},
|
|
227
290
|
variants: {
|
|
291
|
+
size: fieldSizes,
|
|
228
292
|
variant: { outline: field, soft: fieldSoft, subtle: fieldSubtle }
|
|
229
293
|
},
|
|
230
|
-
compoundVariants: [focus]
|
|
294
|
+
compoundVariants: [focus, ...fieldText, ...fieldIcons]
|
|
231
295
|
},
|
|
232
296
|
|
|
233
297
|
textarea: {
|
|
234
298
|
slots: {
|
|
235
|
-
base:
|
|
299
|
+
base: fieldBase
|
|
236
300
|
},
|
|
237
301
|
variants: {
|
|
302
|
+
size: fieldSizes,
|
|
238
303
|
variant: { outline: field, soft: fieldSoft, subtle: fieldSubtle }
|
|
239
304
|
},
|
|
240
|
-
compoundVariants: [focus]
|
|
305
|
+
compoundVariants: [focus, ...fieldText, ...fieldIcons]
|
|
241
306
|
},
|
|
242
307
|
|
|
243
308
|
inputNumber: {
|
|
244
309
|
slots: {
|
|
245
|
-
base:
|
|
310
|
+
base: fieldBase
|
|
246
311
|
},
|
|
247
312
|
variants: {
|
|
248
313
|
variant: { outline: field, soft: fieldSoft, subtle: fieldSubtle }
|
|
249
314
|
},
|
|
250
|
-
compoundVariants: [focus]
|
|
315
|
+
compoundVariants: [focus, ...fieldText]
|
|
251
316
|
},
|
|
252
317
|
|
|
253
318
|
pinInput: {
|
|
254
319
|
slots: {
|
|
255
|
-
base:
|
|
320
|
+
base: fieldBase
|
|
256
321
|
},
|
|
257
322
|
variants: {
|
|
258
323
|
variant: { outline: field, soft: fieldSoft, subtle: fieldSubtle }
|
|
259
324
|
},
|
|
260
|
-
compoundVariants: [focus]
|
|
325
|
+
compoundVariants: [focus, ...fieldText]
|
|
261
326
|
},
|
|
262
327
|
|
|
263
328
|
inputTags: {
|
|
264
329
|
slots: {
|
|
265
|
-
base:
|
|
330
|
+
base: fieldBase,
|
|
266
331
|
item: tag
|
|
267
332
|
},
|
|
268
333
|
variants: {
|
|
334
|
+
size: fieldSizes,
|
|
269
335
|
variant: { outline: field, soft: fieldSoft, subtle: fieldSubtle }
|
|
270
336
|
},
|
|
271
|
-
compoundVariants: [focusWithin]
|
|
337
|
+
compoundVariants: [focusWithin, ...fieldText, ...fieldIcons]
|
|
272
338
|
},
|
|
273
339
|
|
|
274
340
|
inputDate: {
|
|
275
341
|
slots: {
|
|
276
|
-
base:
|
|
342
|
+
base: fieldBase
|
|
277
343
|
},
|
|
278
344
|
variants: {
|
|
345
|
+
size: fieldSizes,
|
|
279
346
|
variant: { outline: field, soft: fieldSoft, subtle: fieldSubtle }
|
|
280
347
|
},
|
|
281
|
-
compoundVariants: [focusWithin]
|
|
348
|
+
compoundVariants: [focusWithin, ...fieldText, ...fieldIcons]
|
|
282
349
|
},
|
|
283
350
|
|
|
284
351
|
inputTime: {
|
|
285
352
|
slots: {
|
|
286
|
-
base:
|
|
353
|
+
base: fieldBase
|
|
287
354
|
},
|
|
288
355
|
variants: {
|
|
356
|
+
size: fieldSizes,
|
|
289
357
|
variant: { outline: field, soft: fieldSoft, subtle: fieldSubtle }
|
|
290
358
|
},
|
|
291
|
-
compoundVariants: [focusWithin]
|
|
359
|
+
compoundVariants: [focusWithin, ...fieldText, ...fieldIcons]
|
|
292
360
|
},
|
|
293
361
|
|
|
294
362
|
inputMenu: {
|
|
295
363
|
slots: {
|
|
296
|
-
base:
|
|
364
|
+
base: fieldBase,
|
|
297
365
|
content: pop,
|
|
298
366
|
item: row,
|
|
299
367
|
separator: line,
|
|
300
368
|
tagsItem: tag
|
|
301
369
|
},
|
|
302
370
|
variants: {
|
|
371
|
+
size: pickerSizes,
|
|
303
372
|
variant: { outline: field, soft: fieldSoft, subtle: fieldSubtle }
|
|
304
373
|
},
|
|
305
|
-
compoundVariants: [focusWithin]
|
|
374
|
+
compoundVariants: [focusWithin, ...fieldText, ...fieldIcons]
|
|
306
375
|
},
|
|
307
376
|
|
|
308
377
|
select: {
|
|
309
378
|
slots: {
|
|
310
|
-
base:
|
|
379
|
+
base: fieldBase,
|
|
311
380
|
content: pop,
|
|
312
381
|
item: row,
|
|
313
382
|
separator: line
|
|
314
383
|
},
|
|
315
384
|
variants: {
|
|
385
|
+
size: pickerSizes,
|
|
316
386
|
variant: { outline: `${field} hover:bg-default`, soft: fieldSoft, subtle: fieldSubtle }
|
|
317
387
|
},
|
|
318
|
-
compoundVariants: [focus]
|
|
388
|
+
compoundVariants: [focus, ...fieldText, ...fieldIcons]
|
|
319
389
|
},
|
|
320
390
|
|
|
321
391
|
selectMenu: {
|
|
322
392
|
slots: {
|
|
323
|
-
base:
|
|
393
|
+
base: fieldBase,
|
|
324
394
|
content: pop,
|
|
325
395
|
item: row,
|
|
326
396
|
separator: line,
|
|
327
397
|
input: 'border-stroke'
|
|
328
398
|
},
|
|
329
399
|
variants: {
|
|
400
|
+
size: pickerSizes,
|
|
330
401
|
variant: { outline: `${field} hover:bg-default`, soft: fieldSoft, subtle: fieldSubtle }
|
|
331
402
|
},
|
|
332
|
-
compoundVariants: [focus]
|
|
403
|
+
compoundVariants: [focus, ...fieldText, ...fieldIcons]
|
|
333
404
|
},
|
|
334
405
|
|
|
335
406
|
checkbox: {
|
|
336
407
|
slots: {
|
|
337
|
-
base:
|
|
408
|
+
base: `rounded-[4.5px] bg-default ring-edge ${ring}`
|
|
338
409
|
},
|
|
339
410
|
variants: {
|
|
340
411
|
variant: {
|
|
@@ -359,7 +430,7 @@ export default defineAppConfig({
|
|
|
359
430
|
|
|
360
431
|
radioGroup: {
|
|
361
432
|
slots: {
|
|
362
|
-
base:
|
|
433
|
+
base: `bg-default ring-edge ${ring}`
|
|
363
434
|
},
|
|
364
435
|
variants: {
|
|
365
436
|
variant: {
|
|
@@ -372,10 +443,19 @@ export default defineAppConfig({
|
|
|
372
443
|
]
|
|
373
444
|
},
|
|
374
445
|
|
|
446
|
+
// 32 by 20 at the default size
|
|
375
447
|
switch: {
|
|
376
448
|
slots: {
|
|
377
|
-
base:
|
|
449
|
+
base: `data-[state=unchecked]:bg-(--ink-track) ${ring}`,
|
|
378
450
|
thumb: 'shadow-knob'
|
|
451
|
+
},
|
|
452
|
+
variants: {
|
|
453
|
+
size: {
|
|
454
|
+
md: {
|
|
455
|
+
base: 'w-8',
|
|
456
|
+
thumb: 'group-active/switch:w-4.5 data-[state=checked]:translate-x-3 data-[state=checked]:group-active/switch:translate-x-2.5 data-[state=checked]:rtl:-translate-x-3 data-[state=checked]:rtl:group-active/switch:-translate-x-2.5'
|
|
457
|
+
}
|
|
458
|
+
}
|
|
379
459
|
}
|
|
380
460
|
},
|
|
381
461
|
|
|
@@ -455,18 +535,32 @@ export default defineAppConfig({
|
|
|
455
535
|
|
|
456
536
|
/* ── Navigation ───────────────────────────────────────────────────────────────────────────────────────── */
|
|
457
537
|
|
|
458
|
-
// Pill tabs as a segmented control: a raised knob on a tinted track
|
|
538
|
+
// Pill tabs as a segmented control: a raised knob on a tinted track, 28px high at the default size
|
|
459
539
|
tabs: {
|
|
540
|
+
slots: {
|
|
541
|
+
trigger: ring
|
|
542
|
+
},
|
|
543
|
+
variants: {
|
|
544
|
+
size: {
|
|
545
|
+
xs: { trigger: 'px-1.5 py-px text-xs gap-1', leadingIcon: 'size-3.5' },
|
|
546
|
+
sm: { trigger: 'px-2 py-0.5 text-xs gap-1', leadingIcon: 'size-3.5' },
|
|
547
|
+
md: { trigger: `px-2.5 py-0.5 ${small} gap-1.5`, leadingIcon: 'size-4' },
|
|
548
|
+
lg: { trigger: `px-3 py-1 ${small} gap-1.5`, leadingIcon: 'size-4' },
|
|
549
|
+
xl: { trigger: 'px-3 py-1.5 text-sm gap-2', leadingIcon: 'size-5' }
|
|
550
|
+
}
|
|
551
|
+
},
|
|
460
552
|
compoundVariants: [
|
|
461
553
|
{
|
|
462
554
|
color: ['primary', 'neutral'],
|
|
463
555
|
variant: 'pill',
|
|
464
556
|
class: {
|
|
465
|
-
list: 'bg-elevated',
|
|
557
|
+
list: 'bg-elevated p-0.5',
|
|
466
558
|
indicator: 'bg-raised shadow-card',
|
|
467
559
|
trigger: 'data-[state=active]:text-highlighted data-[state=inactive]:text-toned'
|
|
468
560
|
}
|
|
469
|
-
}
|
|
561
|
+
},
|
|
562
|
+
{ orientation: 'horizontal', variant: 'pill', class: { indicator: 'inset-y-0.5' } },
|
|
563
|
+
{ orientation: 'vertical', variant: 'pill', class: { indicator: 'inset-x-0.5' } }
|
|
470
564
|
]
|
|
471
565
|
},
|
|
472
566
|
|
|
@@ -512,11 +606,13 @@ export default defineAppConfig({
|
|
|
512
606
|
dropdownMenu: {
|
|
513
607
|
slots: {
|
|
514
608
|
content: pop,
|
|
609
|
+
label: 'font-medium text-muted',
|
|
515
610
|
item: 'before:rounded-lg',
|
|
516
611
|
input: 'border-stroke',
|
|
517
612
|
separator: line
|
|
518
613
|
},
|
|
519
614
|
variants: {
|
|
615
|
+
size: rowSizes,
|
|
520
616
|
active: {
|
|
521
617
|
false: { item: rowByState }
|
|
522
618
|
}
|
|
@@ -526,10 +622,12 @@ export default defineAppConfig({
|
|
|
526
622
|
contextMenu: {
|
|
527
623
|
slots: {
|
|
528
624
|
content: pop,
|
|
625
|
+
label: 'font-medium text-muted',
|
|
529
626
|
item: 'before:rounded-lg',
|
|
530
627
|
separator: line
|
|
531
628
|
},
|
|
532
629
|
variants: {
|
|
630
|
+
size: rowSizes,
|
|
533
631
|
active: {
|
|
534
632
|
false: { item: rowByState }
|
|
535
633
|
}
|
|
@@ -552,7 +650,7 @@ export default defineAppConfig({
|
|
|
552
650
|
modal: {
|
|
553
651
|
slots: {
|
|
554
652
|
content: 'divide-stroke',
|
|
555
|
-
title: 'font-medium'
|
|
653
|
+
title: 'text-[15px] font-medium'
|
|
556
654
|
},
|
|
557
655
|
variants: {
|
|
558
656
|
fullscreen: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-ui-ink",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A monochrome theme for Nuxt UI, as a Nuxt layer.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"preview": "nuxt build playground && wrangler dev --cwd playground --port 4310"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@iconify-json/
|
|
41
|
+
"@iconify-json/solar": "^1.2.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@nuxt/ui": "^4.13.0",
|
package/theme.css
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
--color-raised: var(--ink-raised);
|
|
36
36
|
--color-stroke: var(--ink-stroke);
|
|
37
37
|
--color-edge: var(--ink-edge);
|
|
38
|
+
--color-focus: var(--ink-focus);
|
|
38
39
|
|
|
39
40
|
/* `rounded-card` and `rounded-dialog` sit between Nuxt UI's steps */
|
|
40
41
|
--radius-card: calc(var(--ui-radius) * 2.5);
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
|
|
56
57
|
/* Light */
|
|
57
58
|
:root {
|
|
58
|
-
/* Buttons
|
|
59
|
+
/* Buttons 6px (md), fields 7px, menu rows 8px (lg), cards 10px, menus 12px (xl), dialogs 14px */
|
|
59
60
|
--ui-radius: 0.25rem;
|
|
60
61
|
|
|
61
62
|
--ui-primary: #1f1f1f;
|
|
@@ -101,6 +102,8 @@
|
|
|
101
102
|
--ink-track: rgb(0 0 0 / 0.12);
|
|
102
103
|
/* What dims the page behind a dialog */
|
|
103
104
|
--ink-scrim: rgb(0 0 0 / 0.16);
|
|
105
|
+
/* The ring around what the keyboard is on */
|
|
106
|
+
--ink-focus: rgb(0 96 226 / 0.7);
|
|
104
107
|
|
|
105
108
|
/* A surface is drawn by its shadow: a half-pixel edge and a small drop, no border */
|
|
106
109
|
--ink-shadow-card: 0 0 0 0.5px rgb(0 0 0 / 0.08), 0 1px 1px -1px rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
@@ -160,6 +163,7 @@
|
|
|
160
163
|
--ink-edge: rgb(255 255 255 / 0.22);
|
|
161
164
|
--ink-track: rgb(255 255 255 / 0.16);
|
|
162
165
|
--ink-scrim: rgb(0 0 0 / 0.5);
|
|
166
|
+
--ink-focus: rgb(77 141 255 / 0.8);
|
|
163
167
|
|
|
164
168
|
--ink-shadow-card: 0 0 0 0.5px rgb(255 255 255 / 0.12), 0 1px 2px 0 rgb(0 0 0 / 0.4);
|
|
165
169
|
--ink-shadow-card-hover: 0 0 0 0.5px rgb(255 255 255 / 0.2), 0 1px 2px 0 rgb(0 0 0 / 0.4);
|