@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
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { forcedEdge } from "./shared.js";
|
|
2
|
+
/*
|
|
3
|
+
* The card of the design system's spec, specs/card.spec.json: a panel of the system, the surface
|
|
4
|
+
* in an edge of the border color with the large radius, its parts apart by a line of the same
|
|
5
|
+
* color. Its title is a minor heading in mono. The spec's one kind is Nuxt UI's outline; the
|
|
6
|
+
* other variants keep working on the roles, outside the spec.
|
|
7
|
+
*
|
|
8
|
+
* The edge is a border, not Nuxt UI's ring, so that forced colors keep it, the subtle card's too.
|
|
9
|
+
* The lines between the parts are a divider, which draws one under every part but the last, so
|
|
10
|
+
* the body's line takes its color whether a footer follows it or not.
|
|
11
|
+
*
|
|
12
|
+
* The padding is the spec's from 64rem up; below it, as the frame's paddings narrow there too, it
|
|
13
|
+
* is --ws-space-16, and --ws-space-12 for the header's and the footer's padding-block. It is
|
|
14
|
+
* restated at sm: to cancel Nuxt UI's wider one there.
|
|
15
|
+
*/
|
|
16
|
+
export default {
|
|
17
|
+
slots: {
|
|
18
|
+
// in forced colors every card is outlined
|
|
19
|
+
root: forcedEdge,
|
|
20
|
+
header: 'px-(--ws-space-16) py-(--ws-space-12) sm:px-(--ws-space-16) lg:px-(--ws-space-20) lg:py-(--ws-space-16)',
|
|
21
|
+
title: 'font-mono font-(--ws-text-h4-font-weight) text-h4 text-text',
|
|
22
|
+
description: 'font-sans text-body-sm text-text-secondary',
|
|
23
|
+
body: 'border-border p-(--ws-space-16) sm:p-(--ws-space-16) lg:p-(--ws-space-20)',
|
|
24
|
+
footer: 'px-(--ws-space-16) py-(--ws-space-12) sm:px-(--ws-space-16) lg:px-(--ws-space-20) lg:py-(--ws-space-16)',
|
|
25
|
+
},
|
|
26
|
+
variants: {
|
|
27
|
+
variant: {
|
|
28
|
+
solid: {
|
|
29
|
+
root: 'bg-text text-bg',
|
|
30
|
+
title: 'text-bg',
|
|
31
|
+
description: 'text-bg',
|
|
32
|
+
},
|
|
33
|
+
outline: {
|
|
34
|
+
root: 'bg-surface text-text border-(length:--ws-border-width-thin) border-border ring-0 [box-shadow:none] rounded-lg divide-y-thin divide-border',
|
|
35
|
+
},
|
|
36
|
+
soft: {
|
|
37
|
+
root: 'bg-raised divide-y-thin divide-border',
|
|
38
|
+
},
|
|
39
|
+
subtle: {
|
|
40
|
+
root: 'bg-raised border-(length:--ws-border-width-thin) border-border ring-0 [box-shadow:none] divide-y-thin divide-border',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
slots: {
|
|
3
|
+
base: string;
|
|
4
|
+
indicator: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
variants: {
|
|
10
|
+
color: {
|
|
11
|
+
primary: {
|
|
12
|
+
indicator: string;
|
|
13
|
+
};
|
|
14
|
+
success: {
|
|
15
|
+
indicator: string;
|
|
16
|
+
};
|
|
17
|
+
info: {
|
|
18
|
+
indicator: string;
|
|
19
|
+
};
|
|
20
|
+
warning: {
|
|
21
|
+
indicator: string;
|
|
22
|
+
};
|
|
23
|
+
error: {
|
|
24
|
+
indicator: string;
|
|
25
|
+
};
|
|
26
|
+
neutral: {
|
|
27
|
+
indicator: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
variant: {
|
|
31
|
+
card: {
|
|
32
|
+
root: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
indicator: {
|
|
36
|
+
start: {
|
|
37
|
+
wrapper: string;
|
|
38
|
+
};
|
|
39
|
+
end: {
|
|
40
|
+
wrapper: string;
|
|
41
|
+
};
|
|
42
|
+
hidden: {
|
|
43
|
+
base: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
size: {
|
|
47
|
+
xs: {
|
|
48
|
+
icon: string;
|
|
49
|
+
base: string;
|
|
50
|
+
container: string;
|
|
51
|
+
wrapper: string;
|
|
52
|
+
};
|
|
53
|
+
sm: {
|
|
54
|
+
icon: string;
|
|
55
|
+
base: string;
|
|
56
|
+
container: string;
|
|
57
|
+
wrapper: string;
|
|
58
|
+
};
|
|
59
|
+
md: {
|
|
60
|
+
icon: string;
|
|
61
|
+
base: string;
|
|
62
|
+
container: string;
|
|
63
|
+
wrapper: string;
|
|
64
|
+
};
|
|
65
|
+
lg: {
|
|
66
|
+
icon: string;
|
|
67
|
+
base: string;
|
|
68
|
+
container: string;
|
|
69
|
+
wrapper: string;
|
|
70
|
+
};
|
|
71
|
+
xl: {
|
|
72
|
+
icon: string;
|
|
73
|
+
base: string;
|
|
74
|
+
container: string;
|
|
75
|
+
wrapper: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
required: {
|
|
79
|
+
true: {
|
|
80
|
+
label: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
disabled: {
|
|
84
|
+
true: {
|
|
85
|
+
root: string;
|
|
86
|
+
indicator: string;
|
|
87
|
+
base: string;
|
|
88
|
+
label: string;
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
compoundVariants: (({
|
|
94
|
+
variant: string;
|
|
95
|
+
} & {
|
|
96
|
+
color: import("./shared.ts").Color;
|
|
97
|
+
class: string | Record<string, string>;
|
|
98
|
+
}) | ({
|
|
99
|
+
highlight: boolean;
|
|
100
|
+
} & {
|
|
101
|
+
color: import("./shared.ts").Color;
|
|
102
|
+
class: string | Record<string, string>;
|
|
103
|
+
}) | {
|
|
104
|
+
variant: string;
|
|
105
|
+
indicator: string[];
|
|
106
|
+
class: {
|
|
107
|
+
base: string;
|
|
108
|
+
root?: undefined;
|
|
109
|
+
};
|
|
110
|
+
highlight?: undefined;
|
|
111
|
+
size?: undefined;
|
|
112
|
+
} | {
|
|
113
|
+
variant: string;
|
|
114
|
+
class: {
|
|
115
|
+
root: string;
|
|
116
|
+
base?: undefined;
|
|
117
|
+
};
|
|
118
|
+
indicator?: undefined;
|
|
119
|
+
highlight?: undefined;
|
|
120
|
+
size?: undefined;
|
|
121
|
+
} | {
|
|
122
|
+
variant: string;
|
|
123
|
+
indicator: string;
|
|
124
|
+
class: {
|
|
125
|
+
root: string;
|
|
126
|
+
base?: undefined;
|
|
127
|
+
};
|
|
128
|
+
highlight?: undefined;
|
|
129
|
+
size?: undefined;
|
|
130
|
+
} | {
|
|
131
|
+
variant: string;
|
|
132
|
+
highlight: boolean;
|
|
133
|
+
class: {
|
|
134
|
+
root: string;
|
|
135
|
+
base?: undefined;
|
|
136
|
+
};
|
|
137
|
+
indicator?: undefined;
|
|
138
|
+
size?: undefined;
|
|
139
|
+
} | {
|
|
140
|
+
size: string;
|
|
141
|
+
variant: string;
|
|
142
|
+
class: {
|
|
143
|
+
root: string;
|
|
144
|
+
base?: undefined;
|
|
145
|
+
};
|
|
146
|
+
indicator?: undefined;
|
|
147
|
+
highlight?: undefined;
|
|
148
|
+
} | {
|
|
149
|
+
size: string[];
|
|
150
|
+
variant: string;
|
|
151
|
+
class: {
|
|
152
|
+
root: string;
|
|
153
|
+
base?: undefined;
|
|
154
|
+
};
|
|
155
|
+
indicator?: undefined;
|
|
156
|
+
highlight?: undefined;
|
|
157
|
+
})[];
|
|
158
|
+
};
|
|
159
|
+
export default _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { cardFocus, cardHoverBorder, cardHoverFill, checked, checkedCard, choiceFocus, choiceSizes, control, description, disabled, forcedCheckedCard, highlight, highlightCard, indicator, label, } from "./choice.js";
|
|
2
|
+
import { byColor, forcedChecked, forcedControlEdge, forcedMark, transition } from "./shared.js";
|
|
3
|
+
/*
|
|
4
|
+
* A box with the smallest radius and a tick, as the design system's checkbox spec draws it. The
|
|
5
|
+
* fill shows only while the box is checked or indeterminate, so a disabled box takes the faint
|
|
6
|
+
* fill from the disabled variant alone: Nuxt UI passes its theme no checked variant.
|
|
7
|
+
*/
|
|
8
|
+
export default {
|
|
9
|
+
slots: {
|
|
10
|
+
base: `rounded-xs ${control} ${forcedControlEdge} ${transition}`,
|
|
11
|
+
indicator: `${indicator} flex items-center justify-center ${forcedChecked}`,
|
|
12
|
+
icon: forcedMark,
|
|
13
|
+
label,
|
|
14
|
+
description,
|
|
15
|
+
},
|
|
16
|
+
variants: {
|
|
17
|
+
color: {
|
|
18
|
+
primary: { indicator: checked.primary },
|
|
19
|
+
success: { indicator: checked.success },
|
|
20
|
+
info: { indicator: checked.info },
|
|
21
|
+
warning: { indicator: checked.warning },
|
|
22
|
+
error: { indicator: checked.error },
|
|
23
|
+
neutral: { indicator: checked.neutral },
|
|
24
|
+
},
|
|
25
|
+
variant: {
|
|
26
|
+
card: {
|
|
27
|
+
root: `border border-border rounded-lg ${cardHoverFill} ${forcedCheckedCard} ${transition}`,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
// Hidden, the box takes no room: Nuxt UI hides it as sr-only, which keeps it out of the
|
|
31
|
+
// row only while it is not relative.
|
|
32
|
+
indicator: {
|
|
33
|
+
start: { wrapper: 'ms-2.5' },
|
|
34
|
+
end: { wrapper: 'me-2.5' },
|
|
35
|
+
hidden: { base: 'absolute overflow-hidden' },
|
|
36
|
+
},
|
|
37
|
+
// The tick is drawn at the system's icon size in the twenty pixel box, four fifths of it; in
|
|
38
|
+
// the other boxes at four fifths too, to the even pixel, so it stays centered in the box.
|
|
39
|
+
size: {
|
|
40
|
+
xs: { ...choiceSizes.xs, icon: 'size-tick-sm' },
|
|
41
|
+
sm: { ...choiceSizes.sm, icon: 'size-tick-sm' },
|
|
42
|
+
md: { ...choiceSizes.md, icon: 'size-icon' },
|
|
43
|
+
lg: { ...choiceSizes.lg, icon: 'size-tick-lg' },
|
|
44
|
+
xl: { ...choiceSizes.xl, icon: 'size-icon-lg' },
|
|
45
|
+
},
|
|
46
|
+
required: {
|
|
47
|
+
true: {
|
|
48
|
+
label: "after:content-['*'] after:ms-0.5 after:text-(--ws-field-required-text-rest)",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
disabled: {
|
|
52
|
+
true: {
|
|
53
|
+
...disabled,
|
|
54
|
+
root: 'opacity-100',
|
|
55
|
+
// A disabled box that is checked or indeterminate keeps its mark, on the faint fill.
|
|
56
|
+
indicator: 'bg-(--ws-choice-indicator-bg-disabled) text-(--ws-choice-indicator-icon-disabled)',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
compoundVariants: [
|
|
61
|
+
{ variant: 'list', indicator: ['start', 'end'], class: { base: choiceFocus } },
|
|
62
|
+
{ variant: 'card', class: { root: cardFocus } },
|
|
63
|
+
{ variant: 'list', indicator: 'hidden', class: { root: cardFocus } },
|
|
64
|
+
{ variant: 'card', highlight: false, class: { root: cardHoverBorder } },
|
|
65
|
+
{ size: 'xs', variant: 'card', class: { root: 'p-2.5' } },
|
|
66
|
+
{ size: 'sm', variant: 'card', class: { root: 'p-3' } },
|
|
67
|
+
{ size: ['md', 'lg'], variant: 'card', class: { root: 'p-4' } },
|
|
68
|
+
{ size: 'xl', variant: 'card', class: { root: 'p-5' } },
|
|
69
|
+
...byColor(checkedCard, { variant: 'card' }, 'root'),
|
|
70
|
+
...byColor(highlight, { highlight: true }, 'base'),
|
|
71
|
+
...byColor(highlightCard, { indicator: 'hidden', highlight: true }, 'root'),
|
|
72
|
+
],
|
|
73
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { ByColor } from './shared.ts';
|
|
2
|
+
/** The control at rest: its edge, its fill, and the edge under the pointer. */
|
|
3
|
+
export declare const control = "relative overflow-visible ring-0 border-thin border-(--ws-choice-control-border-rest) bg-(--ws-choice-control-bg-rest) cursor-pointer hover:border-(--ws-choice-control-border-hover)";
|
|
4
|
+
/** The fill of a checked control, over the control and its edge, in the control's shape. */
|
|
5
|
+
export declare const indicator = "absolute -inset-(--ws-border-width-thin) size-auto rounded-[inherit]";
|
|
6
|
+
/**
|
|
7
|
+
* The label of an option, and the line about it. The line is in the color a checked card gives it
|
|
8
|
+
* in --choice-description, or else in its own.
|
|
9
|
+
*/
|
|
10
|
+
export declare const label = "font-sans font-normal text-(--ws-choice-label-text-rest) cursor-pointer";
|
|
11
|
+
export declare const description = "font-sans text-(--choice-description,var(--ws-choice-description-text-rest)) text-body-sm";
|
|
12
|
+
/** A disabled control, its label and its line: faint, and the same under the pointer. */
|
|
13
|
+
export declare const disabled: {
|
|
14
|
+
base: string;
|
|
15
|
+
label: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The fill of a checked control and the color of its mark: the solid fills of the buttons. The
|
|
20
|
+
* spec's color is primary, which reads the tier, the indeterminate box's too. The state picks the
|
|
21
|
+
* tokens into --choice-fill and --choice-mark, not the fill itself, so that a fill a variant gives
|
|
22
|
+
* in forced colors or to a disabled box still wins over the indeterminate one.
|
|
23
|
+
*/
|
|
24
|
+
export declare const checked: ByColor;
|
|
25
|
+
/**
|
|
26
|
+
* A card under the pointer, under the conditions Nuxt UI hovers it with, so these replace its
|
|
27
|
+
* classes: the fill, and the border.
|
|
28
|
+
*/
|
|
29
|
+
export declare const cardHoverFill = "hover:not-has-disabled:not-has-aria-disabled:not-has-focus-visible:not-has-data-[state=checked]:bg-raised/50";
|
|
30
|
+
export declare const cardHoverBorder = "hover:not-has-disabled:not-has-aria-disabled:not-has-focus-visible:not-has-data-[state=checked]:border-field-border";
|
|
31
|
+
/**
|
|
32
|
+
* A checked card: the border in the color, on the color's tint, and its line in the text color.
|
|
33
|
+
* The border is given again for a focused card, where it wins over the plain border of cardFocus.
|
|
34
|
+
*/
|
|
35
|
+
export declare const checkedCard: ByColor;
|
|
36
|
+
/**
|
|
37
|
+
* A checked card in forced colors: the border in the selection color, which a card without its
|
|
38
|
+
* control shows its state by alone. It wins over every other border of the card, as a
|
|
39
|
+
* highlighted or a focused card has, whose colors forced colors would replace.
|
|
40
|
+
*/
|
|
41
|
+
export declare const forcedCheckedCard = "forced-colors:has-data-[state=checked]:border-[Highlight]!";
|
|
42
|
+
/**
|
|
43
|
+
* A highlighted control takes its color as the edge, and keeps it under the pointer. A control in
|
|
44
|
+
* error is highlighted in the error color: the tier's invalid edge.
|
|
45
|
+
*/
|
|
46
|
+
export declare const highlight: ByColor;
|
|
47
|
+
/** A highlighted card: the border in its color, focused too, as with checkedCard. */
|
|
48
|
+
export declare const highlightCard: ByColor;
|
|
49
|
+
/**
|
|
50
|
+
* The control and the label beside it. The container is as tall as the label's first line, so
|
|
51
|
+
* the control sits centered on it.
|
|
52
|
+
*/
|
|
53
|
+
export declare const choiceSizes: {
|
|
54
|
+
xs: {
|
|
55
|
+
base: string;
|
|
56
|
+
container: string;
|
|
57
|
+
wrapper: string;
|
|
58
|
+
};
|
|
59
|
+
sm: {
|
|
60
|
+
base: string;
|
|
61
|
+
container: string;
|
|
62
|
+
wrapper: string;
|
|
63
|
+
};
|
|
64
|
+
md: {
|
|
65
|
+
base: string;
|
|
66
|
+
container: string;
|
|
67
|
+
wrapper: string;
|
|
68
|
+
};
|
|
69
|
+
lg: {
|
|
70
|
+
base: string;
|
|
71
|
+
container: string;
|
|
72
|
+
wrapper: string;
|
|
73
|
+
};
|
|
74
|
+
xl: {
|
|
75
|
+
base: string;
|
|
76
|
+
container: string;
|
|
77
|
+
wrapper: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
/** The focus ring of the control, three pixels out from it, and of a card, out from the card. */
|
|
81
|
+
export declare const choiceFocus = "outline-interactive focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-3";
|
|
82
|
+
export declare const cardFocus = "outline-interactive has-focus-visible:outline-2 has-focus-visible:outline-solid has-focus-visible:outline-offset-3 not-has-disabled:has-focus-visible:border-border";
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* What a checkbox and a radio group share: the control of the design system's checkbox and radio
|
|
3
|
+
* group specs, specs/checkbox.spec.json and specs/radio-group.spec.json. Twenty pixels at md, an
|
|
4
|
+
* edge in the field border on the page color, the interactive fill when checked. The label of an
|
|
5
|
+
* option is in Inter, on the line the control sits on. Disabled, all of it is faint. They read the
|
|
6
|
+
* component tier by name, --ws-choice-*, so a change of the tier reaches them.
|
|
7
|
+
*
|
|
8
|
+
* The edge is a border, not Nuxt UI's ring, so that forced colors keep it. The fill of a checked
|
|
9
|
+
* control covers the control, its edge too: it is laid over the control's border box. The control
|
|
10
|
+
* and its label take the pointer as one: HTML has a label's control under the pointer while the
|
|
11
|
+
* label is, so the control's own hover lightens the edge on either, and not on the line about it.
|
|
12
|
+
*/
|
|
13
|
+
/** The control at rest: its edge, its fill, and the edge under the pointer. */
|
|
14
|
+
export const control = 'relative overflow-visible ring-0 border-thin border-(--ws-choice-control-border-rest) bg-(--ws-choice-control-bg-rest) cursor-pointer hover:border-(--ws-choice-control-border-hover)';
|
|
15
|
+
/** The fill of a checked control, over the control and its edge, in the control's shape. */
|
|
16
|
+
export const indicator = 'absolute -inset-(--ws-border-width-thin) size-auto rounded-[inherit]';
|
|
17
|
+
/**
|
|
18
|
+
* The label of an option, and the line about it. The line is in the color a checked card gives it
|
|
19
|
+
* in --choice-description, or else in its own.
|
|
20
|
+
*/
|
|
21
|
+
export const label = 'font-sans font-normal text-(--ws-choice-label-text-rest) cursor-pointer';
|
|
22
|
+
export const description = 'font-sans text-(--choice-description,var(--ws-choice-description-text-rest)) text-body-sm';
|
|
23
|
+
/** A disabled control, its label and its line: faint, and the same under the pointer. */
|
|
24
|
+
export const disabled = {
|
|
25
|
+
base: 'cursor-not-allowed border-(--ws-choice-control-border-disabled) hover:border-(--ws-choice-control-border-disabled)',
|
|
26
|
+
label: 'cursor-not-allowed text-(--ws-choice-label-text-disabled)',
|
|
27
|
+
description: 'cursor-not-allowed text-(--ws-choice-description-text-disabled)',
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The fill of a checked control and the color of its mark: the solid fills of the buttons. The
|
|
31
|
+
* spec's color is primary, which reads the tier, the indeterminate box's too. The state picks the
|
|
32
|
+
* tokens into --choice-fill and --choice-mark, not the fill itself, so that a fill a variant gives
|
|
33
|
+
* in forced colors or to a disabled box still wins over the indeterminate one.
|
|
34
|
+
*/
|
|
35
|
+
export const checked = {
|
|
36
|
+
primary: 'bg-(--choice-fill) text-(--choice-mark) [--choice-fill:var(--ws-choice-indicator-bg-checked)] [--choice-mark:var(--ws-choice-indicator-icon-checked)] data-[state=indeterminate]:[--choice-fill:var(--ws-choice-indicator-bg-indeterminate)] data-[state=indeterminate]:[--choice-mark:var(--ws-choice-indicator-icon-indeterminate)]',
|
|
37
|
+
success: 'bg-tip-text text-bg',
|
|
38
|
+
info: 'bg-note-text text-bg',
|
|
39
|
+
warning: 'bg-warning-text text-bg',
|
|
40
|
+
error: 'bg-danger-text text-bg',
|
|
41
|
+
neutral: 'bg-text text-bg',
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* A card under the pointer, under the conditions Nuxt UI hovers it with, so these replace its
|
|
45
|
+
* classes: the fill, and the border.
|
|
46
|
+
*/
|
|
47
|
+
export const cardHoverFill = 'hover:not-has-disabled:not-has-aria-disabled:not-has-focus-visible:not-has-data-[state=checked]:bg-raised/50';
|
|
48
|
+
export const cardHoverBorder = 'hover:not-has-disabled:not-has-aria-disabled:not-has-focus-visible:not-has-data-[state=checked]:border-field-border';
|
|
49
|
+
/**
|
|
50
|
+
* The line about a checked card's option, in the text color: on a tint, text is the text color,
|
|
51
|
+
* as the secondary one is under 4.5:1 on the interactive tint in the dark theme. A disabled card
|
|
52
|
+
* keeps the faint line of the disabled variant.
|
|
53
|
+
*
|
|
54
|
+
* The card puts the color in --choice-description, which the line inherits and reads, so the
|
|
55
|
+
* :has() stays on the card it styles. A rule from the card down to the line, such as
|
|
56
|
+
* **:data-[slot=description], puts :has() in an ancestor of the line, a shape whose changes
|
|
57
|
+
* Chrome cannot narrow: each change to the page then has the whole page's style worked out again.
|
|
58
|
+
*/
|
|
59
|
+
const checkedCardDescription = 'not-has-disabled:not-has-aria-disabled:has-data-[state=checked]:[--choice-description:var(--ws-color-text)]';
|
|
60
|
+
/**
|
|
61
|
+
* A checked card: the border in the color, on the color's tint, and its line in the text color.
|
|
62
|
+
* The border is given again for a focused card, where it wins over the plain border of cardFocus.
|
|
63
|
+
*/
|
|
64
|
+
export const checkedCard = {
|
|
65
|
+
primary: `has-data-[state=checked]:border-interactive has-data-[state=checked]:bg-tag-bg not-has-disabled:has-focus-visible:has-data-[state=checked]:border-interactive ${checkedCardDescription}`,
|
|
66
|
+
success: `has-data-[state=checked]:border-tip has-data-[state=checked]:bg-tip-tint not-has-disabled:has-focus-visible:has-data-[state=checked]:border-tip ${checkedCardDescription}`,
|
|
67
|
+
info: `has-data-[state=checked]:border-note has-data-[state=checked]:bg-note-tint not-has-disabled:has-focus-visible:has-data-[state=checked]:border-note ${checkedCardDescription}`,
|
|
68
|
+
warning: `has-data-[state=checked]:border-warning has-data-[state=checked]:bg-warning-tint not-has-disabled:has-focus-visible:has-data-[state=checked]:border-warning ${checkedCardDescription}`,
|
|
69
|
+
error: `has-data-[state=checked]:border-danger has-data-[state=checked]:bg-danger-tint not-has-disabled:has-focus-visible:has-data-[state=checked]:border-danger ${checkedCardDescription}`,
|
|
70
|
+
neutral: `has-data-[state=checked]:border-text has-data-[state=checked]:bg-raised not-has-disabled:has-focus-visible:has-data-[state=checked]:border-text ${checkedCardDescription}`,
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* A checked card in forced colors: the border in the selection color, which a card without its
|
|
74
|
+
* control shows its state by alone. It wins over every other border of the card, as a
|
|
75
|
+
* highlighted or a focused card has, whose colors forced colors would replace.
|
|
76
|
+
*/
|
|
77
|
+
export const forcedCheckedCard = 'forced-colors:has-data-[state=checked]:border-[Highlight]!';
|
|
78
|
+
/**
|
|
79
|
+
* A highlighted control takes its color as the edge, and keeps it under the pointer. A control in
|
|
80
|
+
* error is highlighted in the error color: the tier's invalid edge.
|
|
81
|
+
*/
|
|
82
|
+
export const highlight = {
|
|
83
|
+
primary: 'border-interactive hover:border-interactive',
|
|
84
|
+
success: 'border-tip hover:border-tip',
|
|
85
|
+
info: 'border-note hover:border-note',
|
|
86
|
+
warning: 'border-warning hover:border-warning',
|
|
87
|
+
error: 'border-(--ws-choice-control-border-invalid) hover:border-(--ws-choice-control-border-invalid)',
|
|
88
|
+
neutral: 'border-text hover:border-text',
|
|
89
|
+
};
|
|
90
|
+
/** A highlighted card: the border in its color, focused too, as with checkedCard. */
|
|
91
|
+
export const highlightCard = {
|
|
92
|
+
primary: 'not-has-disabled:not-has-aria-disabled:border-interactive not-has-disabled:not-has-aria-disabled:has-focus-visible:border-interactive',
|
|
93
|
+
success: 'not-has-disabled:not-has-aria-disabled:border-tip not-has-disabled:not-has-aria-disabled:has-focus-visible:border-tip',
|
|
94
|
+
info: 'not-has-disabled:not-has-aria-disabled:border-note not-has-disabled:not-has-aria-disabled:has-focus-visible:border-note',
|
|
95
|
+
warning: 'not-has-disabled:not-has-aria-disabled:border-warning not-has-disabled:not-has-aria-disabled:has-focus-visible:border-warning',
|
|
96
|
+
error: 'not-has-disabled:not-has-aria-disabled:border-danger not-has-disabled:not-has-aria-disabled:has-focus-visible:border-danger',
|
|
97
|
+
neutral: 'not-has-disabled:not-has-aria-disabled:border-text not-has-disabled:not-has-aria-disabled:has-focus-visible:border-text',
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* The control and the label beside it. The container is as tall as the label's first line, so
|
|
101
|
+
* the control sits centered on it.
|
|
102
|
+
*/
|
|
103
|
+
export const choiceSizes = {
|
|
104
|
+
xs: { base: 'size-(--ws-choice-control-size-xs)', container: 'h-6', wrapper: 'text-body-sm' },
|
|
105
|
+
sm: { base: 'size-(--ws-choice-control-size-sm)', container: 'h-6', wrapper: 'text-body-sm' },
|
|
106
|
+
md: {
|
|
107
|
+
base: 'size-(--ws-choice-control-size-md)',
|
|
108
|
+
container: 'h-6',
|
|
109
|
+
wrapper: 'text-body leading-normal',
|
|
110
|
+
},
|
|
111
|
+
lg: {
|
|
112
|
+
base: 'size-(--ws-choice-control-size-lg)',
|
|
113
|
+
container: 'h-7',
|
|
114
|
+
wrapper: 'text-lead leading-7',
|
|
115
|
+
},
|
|
116
|
+
xl: {
|
|
117
|
+
base: 'size-(--ws-choice-control-size-xl)',
|
|
118
|
+
container: 'h-7',
|
|
119
|
+
wrapper: 'text-lead leading-7',
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
/** The focus ring of the control, three pixels out from it, and of a card, out from the card. */
|
|
123
|
+
export const choiceFocus = 'outline-interactive focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-3';
|
|
124
|
+
export const cardFocus = 'outline-interactive has-focus-visible:outline-2 has-focus-visible:outline-solid has-focus-visible:outline-offset-3 not-has-disabled:has-focus-visible:border-border';
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The heights, paddings and value sizes, for the field and the icons in it. An input's icons sit
|
|
3
|
+
* beside it, not inside its edge: past the padding and the rest edge, where a value starts.
|
|
4
|
+
*/
|
|
5
|
+
export declare const fieldSizes: {
|
|
6
|
+
xs: {
|
|
7
|
+
base: string;
|
|
8
|
+
leading: string;
|
|
9
|
+
trailing: string;
|
|
10
|
+
leadingIcon: string;
|
|
11
|
+
trailingIcon: string;
|
|
12
|
+
};
|
|
13
|
+
sm: {
|
|
14
|
+
base: string;
|
|
15
|
+
leading: string;
|
|
16
|
+
trailing: string;
|
|
17
|
+
leadingIcon: string;
|
|
18
|
+
trailingIcon: string;
|
|
19
|
+
};
|
|
20
|
+
md: {
|
|
21
|
+
base: string;
|
|
22
|
+
leading: string;
|
|
23
|
+
trailing: string;
|
|
24
|
+
leadingIcon: string;
|
|
25
|
+
trailingIcon: string;
|
|
26
|
+
};
|
|
27
|
+
lg: {
|
|
28
|
+
base: string;
|
|
29
|
+
leading: string;
|
|
30
|
+
trailing: string;
|
|
31
|
+
leadingIcon: string;
|
|
32
|
+
trailingIcon: string;
|
|
33
|
+
};
|
|
34
|
+
xl: {
|
|
35
|
+
base: string;
|
|
36
|
+
leading: string;
|
|
37
|
+
trailing: string;
|
|
38
|
+
leadingIcon: string;
|
|
39
|
+
trailingIcon: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/** In forced colors every field but the bare one is outlined, as a field there is. */
|
|
43
|
+
export declare const fieldVariants: {
|
|
44
|
+
outline: string;
|
|
45
|
+
soft: string;
|
|
46
|
+
subtle: string;
|
|
47
|
+
ghost: string;
|
|
48
|
+
none: string;
|
|
49
|
+
};
|
|
50
|
+
export declare const fieldCompoundVariants: ({
|
|
51
|
+
leading: boolean;
|
|
52
|
+
size: string;
|
|
53
|
+
class: string;
|
|
54
|
+
trailing?: undefined;
|
|
55
|
+
} | {
|
|
56
|
+
trailing: boolean;
|
|
57
|
+
size: string;
|
|
58
|
+
class: string;
|
|
59
|
+
leading?: undefined;
|
|
60
|
+
} | ({
|
|
61
|
+
highlight: boolean;
|
|
62
|
+
} & {
|
|
63
|
+
color: import("./shared.ts").Color;
|
|
64
|
+
class: string | Record<string, string>;
|
|
65
|
+
}) | {
|
|
66
|
+
variant: string[];
|
|
67
|
+
class: string;
|
|
68
|
+
highlight?: undefined;
|
|
69
|
+
color?: undefined;
|
|
70
|
+
fixed?: undefined;
|
|
71
|
+
size?: undefined;
|
|
72
|
+
loading?: undefined;
|
|
73
|
+
leading?: undefined;
|
|
74
|
+
trailing?: undefined;
|
|
75
|
+
} | {
|
|
76
|
+
variant: string;
|
|
77
|
+
highlight: boolean;
|
|
78
|
+
class: string;
|
|
79
|
+
color?: undefined;
|
|
80
|
+
fixed?: undefined;
|
|
81
|
+
size?: undefined;
|
|
82
|
+
loading?: undefined;
|
|
83
|
+
leading?: undefined;
|
|
84
|
+
trailing?: undefined;
|
|
85
|
+
} | {
|
|
86
|
+
variant: string;
|
|
87
|
+
highlight: boolean;
|
|
88
|
+
color: string;
|
|
89
|
+
class: string;
|
|
90
|
+
fixed?: undefined;
|
|
91
|
+
size?: undefined;
|
|
92
|
+
loading?: undefined;
|
|
93
|
+
leading?: undefined;
|
|
94
|
+
trailing?: undefined;
|
|
95
|
+
} | {
|
|
96
|
+
fixed: boolean;
|
|
97
|
+
size: string[];
|
|
98
|
+
class: string;
|
|
99
|
+
variant?: undefined;
|
|
100
|
+
highlight?: undefined;
|
|
101
|
+
color?: undefined;
|
|
102
|
+
loading?: undefined;
|
|
103
|
+
leading?: undefined;
|
|
104
|
+
trailing?: undefined;
|
|
105
|
+
} | {
|
|
106
|
+
loading: boolean;
|
|
107
|
+
leading: boolean;
|
|
108
|
+
class: {
|
|
109
|
+
leadingIcon: string;
|
|
110
|
+
trailingIcon?: undefined;
|
|
111
|
+
};
|
|
112
|
+
variant?: undefined;
|
|
113
|
+
highlight?: undefined;
|
|
114
|
+
color?: undefined;
|
|
115
|
+
fixed?: undefined;
|
|
116
|
+
size?: undefined;
|
|
117
|
+
trailing?: undefined;
|
|
118
|
+
} | {
|
|
119
|
+
loading: boolean;
|
|
120
|
+
leading: boolean;
|
|
121
|
+
trailing: boolean;
|
|
122
|
+
class: {
|
|
123
|
+
trailingIcon: string;
|
|
124
|
+
leadingIcon?: undefined;
|
|
125
|
+
};
|
|
126
|
+
variant?: undefined;
|
|
127
|
+
highlight?: undefined;
|
|
128
|
+
color?: undefined;
|
|
129
|
+
fixed?: undefined;
|
|
130
|
+
size?: undefined;
|
|
131
|
+
})[];
|