@whatsaaaa/ui-vue 0.0.0-stage → 0.1.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 +62 -0
- package/dist/theme/badge.js +123 -0
- package/dist/theme/button.d.ts +119 -0
- package/dist/theme/button.js +190 -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.d.ts +131 -0
- package/dist/theme/field.js +173 -0
- package/dist/theme/form-field.d.ts +44 -0
- package/dist/theme/form-field.js +34 -0
- package/dist/theme/index.d.ts +1288 -0
- package/dist/theme/index.js +112 -0
- package/dist/theme/input.d.ts +146 -0
- package/dist/theme/input.js +46 -0
- package/dist/theme/modal.d.ts +31 -0
- package/dist/theme/modal.js +44 -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 +181 -0
- package/dist/theme/select-menu.js +22 -0
- package/dist/theme/select.d.ts +281 -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/package.json +65 -3
- package/src/index.css +123 -0
- package/src/nuxt-ui.css +148 -0
package/src/index.css
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Nuxt UI on the design system: the app's whole stylesheet, imported alone and before the
|
|
3
|
+
* app's own rules.
|
|
4
|
+
*
|
|
5
|
+
* @import '@whatsaaaa/ui-vue/index.css';
|
|
6
|
+
*
|
|
7
|
+
* In this order: the design system's Tailwind entry, Tailwind and the system in their layers,
|
|
8
|
+
* then Nuxt UI, then the system's dark: and light: variants again, over Nuxt UI's, whose own
|
|
9
|
+
* follow only the class, then the bridge of Nuxt UI's variables to the system's roles,
|
|
10
|
+
* nuxt-ui.css, outside any layer. See the design system's tailwind.css for the layers.
|
|
11
|
+
*/
|
|
12
|
+
@import '@whatsaaaa/design-system/tailwind.css';
|
|
13
|
+
@import '@nuxt/ui';
|
|
14
|
+
@import '@whatsaaaa/design-system/tailwind/variants.css';
|
|
15
|
+
@import './nuxt-ui.css';
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* The classes the component themes use, read from the themes as the build compiles them: the
|
|
19
|
+
* same files an app runs, whether it has the package from the workspace or from npm.
|
|
20
|
+
*/
|
|
21
|
+
@source '../dist/theme';
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* A status as text is set in its text color, which differs from the status color in the light
|
|
25
|
+
* theme: text-error is the danger text, bg-error and ring-error the danger color.
|
|
26
|
+
*/
|
|
27
|
+
@theme inline {
|
|
28
|
+
--text-color-success: var(--ws-color-tip-text);
|
|
29
|
+
--text-color-info: var(--ws-color-note-text);
|
|
30
|
+
--text-color-warning: var(--ws-color-warning-text);
|
|
31
|
+
--text-color-error: var(--ws-color-danger-text);
|
|
32
|
+
|
|
33
|
+
/* Nuxt UI sets a callout's text in a shade of its color: it is the text color, as in a callout of the system */
|
|
34
|
+
--text-color-success-300: var(--ws-color-text);
|
|
35
|
+
--text-color-success-600: var(--ws-color-text);
|
|
36
|
+
--text-color-info-300: var(--ws-color-text);
|
|
37
|
+
--text-color-info-600: var(--ws-color-text);
|
|
38
|
+
--text-color-warning-300: var(--ws-color-text);
|
|
39
|
+
--text-color-warning-600: var(--ws-color-text);
|
|
40
|
+
--text-color-error-300: var(--ws-color-text);
|
|
41
|
+
--text-color-error-600: var(--ws-color-text);
|
|
42
|
+
--text-color-primary-300: var(--ws-color-text);
|
|
43
|
+
--text-color-primary-600: var(--ws-color-text);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* A control that does something when clicked says so with the pointer, as in the sample apps. */
|
|
47
|
+
@layer base {
|
|
48
|
+
button:not(:disabled),
|
|
49
|
+
[role='button']:not(:disabled) {
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Nuxt UI draws a link's focus ring on the text: the system's is three pixels out. */
|
|
55
|
+
@layer base {
|
|
56
|
+
a:focus-visible {
|
|
57
|
+
outline-offset: 3px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/*
|
|
62
|
+
* Forced colors, Windows' contrast themes, paint every background in the page color and take box
|
|
63
|
+
* shadows away. Nuxt UI draws an icon as a mask over its background and many an edge with ring,
|
|
64
|
+
* a box shadow, so both are gone there. These two rules draw them again for every component,
|
|
65
|
+
* whether the package themes it or not.
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
* An icon drawn as a mask is its background, in its own color, which forced colors would paint
|
|
70
|
+
* in the page color. Here the icon keeps its colors as they are, and its color is the text color
|
|
71
|
+
* of the page. Outside any layer, so it wins over the color a component gives its icon, which is
|
|
72
|
+
* not a system color and would stay. A theme still paints an icon in another system color by its
|
|
73
|
+
* background, as a disabled control's gray. An icon drawn as an image, as one in several colors
|
|
74
|
+
* is, has no fill and stays as it is, and one drawn as an SVG, as on Vue, already takes the text
|
|
75
|
+
* color.
|
|
76
|
+
*/
|
|
77
|
+
@media (forced-colors: active) {
|
|
78
|
+
.iconify:not(svg) {
|
|
79
|
+
forced-color-adjust: none;
|
|
80
|
+
color: canvastext;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
* An edge drawn as a ring, as an outline of the ring's width in the text color: where the ring
|
|
86
|
+
* is, outside the box or inside it, and taking no room either. Added to Tailwind's own ring
|
|
87
|
+
* utilities, so it follows every variant a ring is written with.
|
|
88
|
+
*
|
|
89
|
+
* The outline keeps its style against the classes that take an outline away, as Nuxt UI's
|
|
90
|
+
* focus:outline-none does on a popover or a drawer: they hide the outline the browser draws for
|
|
91
|
+
* the focus, and the edge stays while the part has it. A focus ring written as an outline still
|
|
92
|
+
* shows, by its width and its offset. Not so where the outline is taken away on the element
|
|
93
|
+
* itself, as Reka does on a menu: there its width is the browser's, not the ring's.
|
|
94
|
+
*/
|
|
95
|
+
@utility ring {
|
|
96
|
+
@media (forced-colors: active) {
|
|
97
|
+
--ring-outline-width: 1px;
|
|
98
|
+
|
|
99
|
+
outline: var(--ring-outline-width) solid canvastext;
|
|
100
|
+
|
|
101
|
+
&:not([style*='outline']) {
|
|
102
|
+
outline-style: solid !important;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@utility ring-* {
|
|
108
|
+
@media (forced-colors: active) {
|
|
109
|
+
--ring-outline-width: calc(--value(integer) * 1px);
|
|
110
|
+
|
|
111
|
+
outline: var(--ring-outline-width) solid canvastext;
|
|
112
|
+
|
|
113
|
+
&:not([style*='outline']) {
|
|
114
|
+
outline-style: solid !important;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@utility ring-inset {
|
|
120
|
+
@media (forced-colors: active) {
|
|
121
|
+
outline-offset: calc(-1 * var(--ring-outline-width, 1px));
|
|
122
|
+
}
|
|
123
|
+
}
|
package/src/nuxt-ui.css
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Nuxt UI's theme variables, pointed at the design system's roles. Both themes follow by
|
|
3
|
+
* themselves: the roles switch, and these read them.
|
|
4
|
+
*
|
|
5
|
+
* Outside any layer, so it wins over Nuxt UI's own values, which it keeps in its theme layer
|
|
6
|
+
* and in a style it adds at runtime. Declared again on every element with a data-theme or a dark
|
|
7
|
+
* or light class, where Nuxt UI puts its own, so a part of a page kept in one theme, either way,
|
|
8
|
+
* reads that theme's roles, as the tokens do.
|
|
9
|
+
*
|
|
10
|
+
* Where Nuxt UI wants a step the system has no role for, it is mixed from the roles around it
|
|
11
|
+
* in oklab. The shade scales Nuxt UI makes of each color run from the page (50) through the
|
|
12
|
+
* color (500) to the text (950), so a low shade is a faint tint in both themes.
|
|
13
|
+
*
|
|
14
|
+
* It reads the tokens and comes after Nuxt UI's own stylesheet: index.css imports it last.
|
|
15
|
+
*/
|
|
16
|
+
:root,
|
|
17
|
+
:host,
|
|
18
|
+
[data-theme],
|
|
19
|
+
.dark,
|
|
20
|
+
.light {
|
|
21
|
+
/*
|
|
22
|
+
* Text. Nuxt UI sets text in its dimmed color, a timeline's dates among it, so it is the
|
|
23
|
+
* secondary color too: the faint one is under 4.5:1 on the page.
|
|
24
|
+
*/
|
|
25
|
+
--ui-text-dimmed: var(--ws-color-text-secondary);
|
|
26
|
+
--ui-text-muted: var(--ws-color-text-secondary);
|
|
27
|
+
--ui-text-toned: color-mix(in oklab, var(--ws-color-text-secondary), var(--ws-color-text));
|
|
28
|
+
--ui-text: var(--ws-color-text);
|
|
29
|
+
--ui-text-highlighted: var(--ws-color-text);
|
|
30
|
+
--ui-text-inverted: var(--ws-color-bg);
|
|
31
|
+
|
|
32
|
+
/* Surfaces: the page, a panel, a hovered or current item, and one step past it */
|
|
33
|
+
--ui-bg: var(--ws-color-bg);
|
|
34
|
+
--ui-bg-muted: var(--ws-color-surface);
|
|
35
|
+
--ui-bg-elevated: var(--ws-color-raised);
|
|
36
|
+
--ui-bg-accented: color-mix(in oklab, var(--ws-color-raised) 85%, var(--ws-color-text));
|
|
37
|
+
--ui-bg-inverted: var(--ws-color-text);
|
|
38
|
+
|
|
39
|
+
/* Borders: dividers, and the outlines of controls */
|
|
40
|
+
--ui-border: var(--ws-color-border);
|
|
41
|
+
--ui-border-muted: var(--ws-color-border);
|
|
42
|
+
--ui-border-accented: var(--ws-color-field-border);
|
|
43
|
+
--ui-border-inverted: var(--ws-color-text);
|
|
44
|
+
|
|
45
|
+
/* The semantic colors. secondary has no role: the theme leaves it out. */
|
|
46
|
+
--ui-primary: var(--ws-color-interactive);
|
|
47
|
+
--ui-success: var(--ws-color-tip);
|
|
48
|
+
--ui-info: var(--ws-color-note);
|
|
49
|
+
--ui-warning: var(--ws-color-warning);
|
|
50
|
+
--ui-error: var(--ws-color-danger);
|
|
51
|
+
|
|
52
|
+
/* Their scales */
|
|
53
|
+
--ui-color-primary-50: color-mix(in oklab, var(--ws-color-interactive) 10%, var(--ws-color-bg));
|
|
54
|
+
--ui-color-primary-100: color-mix(in oklab, var(--ws-color-interactive) 20%, var(--ws-color-bg));
|
|
55
|
+
--ui-color-primary-200: color-mix(in oklab, var(--ws-color-interactive) 40%, var(--ws-color-bg));
|
|
56
|
+
--ui-color-primary-300: color-mix(in oklab, var(--ws-color-interactive) 60%, var(--ws-color-bg));
|
|
57
|
+
--ui-color-primary-400: color-mix(in oklab, var(--ws-color-interactive) 80%, var(--ws-color-bg));
|
|
58
|
+
--ui-color-primary-500: var(--ws-color-interactive);
|
|
59
|
+
--ui-color-primary-600: color-mix(
|
|
60
|
+
in oklab,
|
|
61
|
+
var(--ws-color-interactive) 80%,
|
|
62
|
+
var(--ws-color-text)
|
|
63
|
+
);
|
|
64
|
+
--ui-color-primary-700: color-mix(
|
|
65
|
+
in oklab,
|
|
66
|
+
var(--ws-color-interactive) 60%,
|
|
67
|
+
var(--ws-color-text)
|
|
68
|
+
);
|
|
69
|
+
--ui-color-primary-800: color-mix(
|
|
70
|
+
in oklab,
|
|
71
|
+
var(--ws-color-interactive) 40%,
|
|
72
|
+
var(--ws-color-text)
|
|
73
|
+
);
|
|
74
|
+
--ui-color-primary-900: color-mix(
|
|
75
|
+
in oklab,
|
|
76
|
+
var(--ws-color-interactive) 20%,
|
|
77
|
+
var(--ws-color-text)
|
|
78
|
+
);
|
|
79
|
+
--ui-color-primary-950: color-mix(
|
|
80
|
+
in oklab,
|
|
81
|
+
var(--ws-color-interactive) 10%,
|
|
82
|
+
var(--ws-color-text)
|
|
83
|
+
);
|
|
84
|
+
--ui-color-success-50: color-mix(in oklab, var(--ws-color-tip) 10%, var(--ws-color-bg));
|
|
85
|
+
--ui-color-success-100: color-mix(in oklab, var(--ws-color-tip) 20%, var(--ws-color-bg));
|
|
86
|
+
--ui-color-success-200: color-mix(in oklab, var(--ws-color-tip) 40%, var(--ws-color-bg));
|
|
87
|
+
--ui-color-success-300: color-mix(in oklab, var(--ws-color-tip) 60%, var(--ws-color-bg));
|
|
88
|
+
--ui-color-success-400: color-mix(in oklab, var(--ws-color-tip) 80%, var(--ws-color-bg));
|
|
89
|
+
--ui-color-success-500: var(--ws-color-tip);
|
|
90
|
+
--ui-color-success-600: color-mix(in oklab, var(--ws-color-tip) 80%, var(--ws-color-text));
|
|
91
|
+
--ui-color-success-700: color-mix(in oklab, var(--ws-color-tip) 60%, var(--ws-color-text));
|
|
92
|
+
--ui-color-success-800: color-mix(in oklab, var(--ws-color-tip) 40%, var(--ws-color-text));
|
|
93
|
+
--ui-color-success-900: color-mix(in oklab, var(--ws-color-tip) 20%, var(--ws-color-text));
|
|
94
|
+
--ui-color-success-950: color-mix(in oklab, var(--ws-color-tip) 10%, var(--ws-color-text));
|
|
95
|
+
--ui-color-info-50: color-mix(in oklab, var(--ws-color-note) 10%, var(--ws-color-bg));
|
|
96
|
+
--ui-color-info-100: color-mix(in oklab, var(--ws-color-note) 20%, var(--ws-color-bg));
|
|
97
|
+
--ui-color-info-200: color-mix(in oklab, var(--ws-color-note) 40%, var(--ws-color-bg));
|
|
98
|
+
--ui-color-info-300: color-mix(in oklab, var(--ws-color-note) 60%, var(--ws-color-bg));
|
|
99
|
+
--ui-color-info-400: color-mix(in oklab, var(--ws-color-note) 80%, var(--ws-color-bg));
|
|
100
|
+
--ui-color-info-500: var(--ws-color-note);
|
|
101
|
+
--ui-color-info-600: color-mix(in oklab, var(--ws-color-note) 80%, var(--ws-color-text));
|
|
102
|
+
--ui-color-info-700: color-mix(in oklab, var(--ws-color-note) 60%, var(--ws-color-text));
|
|
103
|
+
--ui-color-info-800: color-mix(in oklab, var(--ws-color-note) 40%, var(--ws-color-text));
|
|
104
|
+
--ui-color-info-900: color-mix(in oklab, var(--ws-color-note) 20%, var(--ws-color-text));
|
|
105
|
+
--ui-color-info-950: color-mix(in oklab, var(--ws-color-note) 10%, var(--ws-color-text));
|
|
106
|
+
--ui-color-warning-50: color-mix(in oklab, var(--ws-color-warning) 10%, var(--ws-color-bg));
|
|
107
|
+
--ui-color-warning-100: color-mix(in oklab, var(--ws-color-warning) 20%, var(--ws-color-bg));
|
|
108
|
+
--ui-color-warning-200: color-mix(in oklab, var(--ws-color-warning) 40%, var(--ws-color-bg));
|
|
109
|
+
--ui-color-warning-300: color-mix(in oklab, var(--ws-color-warning) 60%, var(--ws-color-bg));
|
|
110
|
+
--ui-color-warning-400: color-mix(in oklab, var(--ws-color-warning) 80%, var(--ws-color-bg));
|
|
111
|
+
--ui-color-warning-500: var(--ws-color-warning);
|
|
112
|
+
--ui-color-warning-600: color-mix(in oklab, var(--ws-color-warning) 80%, var(--ws-color-text));
|
|
113
|
+
--ui-color-warning-700: color-mix(in oklab, var(--ws-color-warning) 60%, var(--ws-color-text));
|
|
114
|
+
--ui-color-warning-800: color-mix(in oklab, var(--ws-color-warning) 40%, var(--ws-color-text));
|
|
115
|
+
--ui-color-warning-900: color-mix(in oklab, var(--ws-color-warning) 20%, var(--ws-color-text));
|
|
116
|
+
--ui-color-warning-950: color-mix(in oklab, var(--ws-color-warning) 10%, var(--ws-color-text));
|
|
117
|
+
--ui-color-error-50: color-mix(in oklab, var(--ws-color-danger) 10%, var(--ws-color-bg));
|
|
118
|
+
--ui-color-error-100: color-mix(in oklab, var(--ws-color-danger) 20%, var(--ws-color-bg));
|
|
119
|
+
--ui-color-error-200: color-mix(in oklab, var(--ws-color-danger) 40%, var(--ws-color-bg));
|
|
120
|
+
--ui-color-error-300: color-mix(in oklab, var(--ws-color-danger) 60%, var(--ws-color-bg));
|
|
121
|
+
--ui-color-error-400: color-mix(in oklab, var(--ws-color-danger) 80%, var(--ws-color-bg));
|
|
122
|
+
--ui-color-error-500: var(--ws-color-danger);
|
|
123
|
+
--ui-color-error-600: color-mix(in oklab, var(--ws-color-danger) 80%, var(--ws-color-text));
|
|
124
|
+
--ui-color-error-700: color-mix(in oklab, var(--ws-color-danger) 60%, var(--ws-color-text));
|
|
125
|
+
--ui-color-error-800: color-mix(in oklab, var(--ws-color-danger) 40%, var(--ws-color-text));
|
|
126
|
+
--ui-color-error-900: color-mix(in oklab, var(--ws-color-danger) 20%, var(--ws-color-text));
|
|
127
|
+
--ui-color-error-950: color-mix(in oklab, var(--ws-color-danger) 10%, var(--ws-color-text));
|
|
128
|
+
--ui-color-neutral-50: color-mix(in oklab, var(--ws-color-text) 5%, var(--ws-color-bg));
|
|
129
|
+
--ui-color-neutral-100: color-mix(in oklab, var(--ws-color-text) 10%, var(--ws-color-bg));
|
|
130
|
+
--ui-color-neutral-200: color-mix(in oklab, var(--ws-color-text) 20%, var(--ws-color-bg));
|
|
131
|
+
--ui-color-neutral-300: color-mix(in oklab, var(--ws-color-text) 30%, var(--ws-color-bg));
|
|
132
|
+
--ui-color-neutral-400: color-mix(in oklab, var(--ws-color-text) 40%, var(--ws-color-bg));
|
|
133
|
+
--ui-color-neutral-500: color-mix(in oklab, var(--ws-color-text) 50%, var(--ws-color-bg));
|
|
134
|
+
--ui-color-neutral-600: color-mix(in oklab, var(--ws-color-text) 60%, var(--ws-color-bg));
|
|
135
|
+
--ui-color-neutral-700: color-mix(in oklab, var(--ws-color-text) 70%, var(--ws-color-bg));
|
|
136
|
+
--ui-color-neutral-800: color-mix(in oklab, var(--ws-color-text) 80%, var(--ws-color-bg));
|
|
137
|
+
--ui-color-neutral-900: color-mix(in oklab, var(--ws-color-text) 90%, var(--ws-color-bg));
|
|
138
|
+
--ui-color-neutral-950: color-mix(in oklab, var(--ws-color-text) 95%, var(--ws-color-bg));
|
|
139
|
+
|
|
140
|
+
/* Radius: the small one, which Nuxt UI multiplies for the sizes past xl */
|
|
141
|
+
--ui-radius: var(--ws-radius-sm);
|
|
142
|
+
|
|
143
|
+
/*
|
|
144
|
+
* Nuxt UI's headers, the app's, a dashboard's and a modal's, are as tall as the tab bar, and
|
|
145
|
+
* so is the room it leaves for the app's header above a page and what sticks below it
|
|
146
|
+
*/
|
|
147
|
+
--ui-header-height: var(--ws-size-tab-bar);
|
|
148
|
+
}
|