@splendidlabz/styles 4.14.0 → 4.15.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/package.json
CHANGED
|
@@ -1,40 +1,179 @@
|
|
|
1
|
-
.combobox-options {
|
|
1
|
+
:where(.combobox-options) {
|
|
2
2
|
padding: 0;
|
|
3
3
|
border: 0;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
max-height: var(--height);
|
|
6
|
+
:where(.combobox-options [role='listbox']) {
|
|
7
|
+
max-height: var(--options-max-height, 15rem);
|
|
8
|
+
margin: 0;
|
|
12
9
|
overflow-y: auto;
|
|
13
10
|
}
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
/* The end of every option keeps room for the check, so labels don't shift when it shows */
|
|
13
|
+
:where(.combobox-options [role='option']) {
|
|
14
|
+
position: relative;
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: var(--option-padding, 0.25lh 0.5lh);
|
|
17
|
+
padding-inline-end: 2.5em;
|
|
16
18
|
cursor: pointer;
|
|
17
19
|
}
|
|
18
20
|
|
|
21
|
+
/* The search status lines up with the options */
|
|
22
|
+
:where(.combobox-options .combobox-status) {
|
|
23
|
+
padding: var(--option-padding, 0.25lh 0.5lh);
|
|
24
|
+
}
|
|
25
|
+
|
|
19
26
|
/* Keeps the pointer cursor over an option's own markup */
|
|
20
|
-
.combobox-options [role='option'] > * {
|
|
27
|
+
:where(.combobox-options [role='option'] > *) {
|
|
21
28
|
pointer-events: none;
|
|
22
29
|
}
|
|
23
30
|
|
|
31
|
+
/* An option a full selection refuses. It stays in the list so the person can still read it. */
|
|
32
|
+
:where(.combobox-options [aria-disabled='true']) {
|
|
33
|
+
opacity: 0.4;
|
|
34
|
+
cursor: not-allowed;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* The selection — what was chosen. Comes before the band, so the band shows over the tint when both land on one option. Without --font-weight-selected, the weight stays inherited. */
|
|
38
|
+
:where(.combobox-options [aria-selected='true']) {
|
|
39
|
+
font-weight: var(--font-weight-selected);
|
|
40
|
+
background: var(
|
|
41
|
+
--bg-selected-color,
|
|
42
|
+
color-mix(in oklab, currentcolor 7%, transparent)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
24
46
|
/* The band — where the keyboard or pointer is. Defaults to the platform's own colors for the current item in a list. */
|
|
25
|
-
|
|
26
|
-
.combobox-options [
|
|
47
|
+
:where(
|
|
48
|
+
.combobox-options [data-highlighted],
|
|
49
|
+
.combobox-options [role='option']:focus
|
|
50
|
+
) {
|
|
27
51
|
color: var(--text-highlighted-color, HighlightText);
|
|
28
52
|
background: var(--bg-highlighted-color, Highlight);
|
|
29
53
|
}
|
|
30
54
|
|
|
31
|
-
/*
|
|
32
|
-
.combobox-options
|
|
33
|
-
|
|
55
|
+
/* prepareOptions copies the check into every option, and only a selected option shows it */
|
|
56
|
+
:where(.combobox-options .option-check) {
|
|
57
|
+
position: absolute;
|
|
58
|
+
inset-block: 0;
|
|
59
|
+
inset-inline-end: 0.75em;
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
visibility: hidden;
|
|
63
|
+
|
|
64
|
+
svg {
|
|
65
|
+
width: 1em;
|
|
66
|
+
height: 1em;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:where(.combobox-options [aria-selected='true'] .option-check) {
|
|
71
|
+
visibility: visible;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* The create option, shown while the typed text matches nothing */
|
|
75
|
+
:where(.combobox-options [data-create]) {
|
|
76
|
+
font-style: italic;
|
|
34
77
|
}
|
|
35
78
|
|
|
36
79
|
/* Highlight pseudo-elements only take properties that don't affect layout, so the match can be recoloured but never bolded. font-weight here is silently ignored. */
|
|
37
|
-
::highlight(
|
|
80
|
+
::highlight(match) {
|
|
38
81
|
color: var(--text-match-color, #7c3aed);
|
|
39
82
|
text-decoration: underline;
|
|
40
83
|
}
|
|
84
|
+
|
|
85
|
+
/* The chips and the input share one box, and wrap onto the next line once the row fills up */
|
|
86
|
+
:where(.combobox .input-group) {
|
|
87
|
+
@apply focus-within;
|
|
88
|
+
flex-wrap: wrap;
|
|
89
|
+
align-items: center;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Each chip joins the box's own row, so the field can sit after the last one */
|
|
93
|
+
:where(.combobox .chips) {
|
|
94
|
+
display: contents;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* With chips, the box holds the padding, so the chips and the field's text start at the same edge */
|
|
98
|
+
:where(.combobox .input-group:has(.chip)) {
|
|
99
|
+
gap: 0.25lh;
|
|
100
|
+
padding: var(--padding);
|
|
101
|
+
|
|
102
|
+
.input {
|
|
103
|
+
padding: 0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* The field wraps to its own row once its placeholder or text no longer fits */
|
|
108
|
+
:where(.combobox .input-group .input) {
|
|
109
|
+
flex: 1 1 var(--field-min-width, max-content);
|
|
110
|
+
field-sizing: content;
|
|
111
|
+
min-width: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* The Select's button reads like a text field, with a caret at the end. The text's track has no minimum, so long text can't widen a container that sizes to its content. */
|
|
115
|
+
:where(.select-trigger) {
|
|
116
|
+
display: grid;
|
|
117
|
+
grid-template-columns: minmax(0, max-content) auto;
|
|
118
|
+
justify-content: space-between;
|
|
119
|
+
align-items: center;
|
|
120
|
+
gap: 0.5em;
|
|
121
|
+
text-align: start;
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
|
|
124
|
+
svg {
|
|
125
|
+
flex-shrink: 0;
|
|
126
|
+
width: 1em;
|
|
127
|
+
height: 1em;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* A long placeholder or label ends in an ellipsis instead of pushing the caret out */
|
|
132
|
+
:where(.select-trigger-text) {
|
|
133
|
+
overflow: hidden;
|
|
134
|
+
text-overflow: ellipsis;
|
|
135
|
+
white-space: nowrap;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:where(.select-placeholder) {
|
|
139
|
+
opacity: 0.5;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:where(.chips .chip) {
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
gap: 0.125em;
|
|
146
|
+
margin: 0;
|
|
147
|
+
padding-inline: 0.5em 0.125em;
|
|
148
|
+
border-radius: calc(var(--radius, 0.25rem) / 2);
|
|
149
|
+
color: var(--text-chip-color, inherit);
|
|
150
|
+
background: var(
|
|
151
|
+
--bg-chip-color,
|
|
152
|
+
color-mix(in oklab, currentcolor 10%, transparent)
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:where(.chips .chip-remove-button) {
|
|
157
|
+
display: grid;
|
|
158
|
+
place-items: center;
|
|
159
|
+
width: 1.25em;
|
|
160
|
+
height: 1.25em;
|
|
161
|
+
padding: 0;
|
|
162
|
+
border: 0;
|
|
163
|
+
border-radius: 50%;
|
|
164
|
+
color: inherit;
|
|
165
|
+
background: none;
|
|
166
|
+
opacity: 0.6;
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
|
|
169
|
+
svg {
|
|
170
|
+
width: 0.75em;
|
|
171
|
+
height: 0.75em;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&:hover,
|
|
175
|
+
&:focus-visible {
|
|
176
|
+
background: color-mix(in oklab, currentcolor 15%, transparent);
|
|
177
|
+
opacity: 1;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -55,3 +55,15 @@
|
|
|
55
55
|
.input-group.stack {
|
|
56
56
|
display: grid;
|
|
57
57
|
}
|
|
58
|
+
|
|
59
|
+
/* The replica sits under the textarea with the same text, so the stack grows with it */
|
|
60
|
+
.textarea-autogrow .replica-field {
|
|
61
|
+
visibility: hidden;
|
|
62
|
+
white-space: pre-wrap;
|
|
63
|
+
overflow-wrap: anywhere;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.textarea-autogrow textarea {
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
resize: none;
|
|
69
|
+
}
|