@plexui/styles 0.1.14 → 0.1.16
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/dist/es/components/Field/Field.module.css +19 -0
- package/dist/es/components/FieldError/FieldError.module.css +28 -5
- package/dist/es/components/FieldGroup/FieldGroup.module.css +2 -1
- package/dist/es/components/Sortable/Sortable.module.css +192 -0
- package/dist/es/components/TagInput/TagInput.module.css +11 -0
- package/dist/es/components/Textarea/Textarea.module.css +12 -0
- package/dist/es/styles/touch.css +4 -0
- package/dist/es/styles/variables-components.css +20 -0
- package/package.json +1 -1
|
@@ -205,5 +205,24 @@
|
|
|
205
205
|
grid-column: 1;
|
|
206
206
|
grid-row: auto;
|
|
207
207
|
justify-self: stretch;
|
|
208
|
+
}/* A ghost field in a row: the row is its frame. Beside the label the value takes
|
|
209
|
+
the rest of the line and ends at the row's edge, under it the value starts
|
|
210
|
+
where the label does. An error is the line of words under both, not a frame. */.Field:where([data-row]:not([data-orientation="vertical"])):has(
|
|
211
|
+
.Control > [data-variant="ghost"] > input,
|
|
212
|
+
.Control > [data-variant="ghost"] > textarea
|
|
213
|
+
) {
|
|
214
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
215
|
+
}.Field:where([data-row]) .Control:has(> [data-variant="ghost"] > input, > [data-variant="ghost"] > textarea) {
|
|
216
|
+
justify-self: stretch;
|
|
217
|
+
}.Field:where([data-row]) .Control > [data-variant="ghost"]:is(:has(> input), :has(> textarea)) {
|
|
218
|
+
--input-size: var(--field-row-label-line-height);
|
|
219
|
+
--input-gutter: 0px;
|
|
220
|
+
--textarea-gutter-x: 0px;
|
|
221
|
+
--textarea-gutter-y: 0px;
|
|
222
|
+
|
|
223
|
+
border-radius: 0;
|
|
224
|
+
box-shadow: none;
|
|
225
|
+
}.Field:where([data-row]:not([data-orientation="vertical"])) .Control > [data-variant="ghost"] > input {
|
|
226
|
+
text-align: end;
|
|
208
227
|
}
|
|
209
228
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@layer components {.FieldError {
|
|
2
|
-
display:
|
|
3
|
-
|
|
4
|
-
gap: var(--field-error-gap);
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-rows: 1fr;
|
|
5
4
|
padding-inline-start: var(--field-error-padding-inline);
|
|
6
5
|
color: var(--field-error-color);
|
|
7
6
|
font-size: var(--field-error-font-size);
|
|
@@ -11,10 +10,16 @@
|
|
|
11
10
|
margin-top: var(--field-error-margin-top);
|
|
12
11
|
}.FieldError:last-of-type {
|
|
13
12
|
margin-bottom: var(--field-error-margin-bottom);
|
|
13
|
+
}.Inner {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: flex-start;
|
|
16
|
+
gap: var(--field-error-gap);
|
|
17
|
+
min-height: 0;
|
|
18
|
+
overflow: hidden;
|
|
14
19
|
}/* The icon keeps its size and sits on the first line; the text wraps, also
|
|
15
|
-
inside a long unbroken word, instead of pushing out of the field. */.
|
|
20
|
+
inside a long unbroken word, instead of pushing out of the field. */.Inner > * {
|
|
16
21
|
flex-shrink: 0;
|
|
17
|
-
}.
|
|
22
|
+
}.Inner > span {
|
|
18
23
|
flex-shrink: 1;
|
|
19
24
|
min-width: 0;
|
|
20
25
|
overflow-wrap: anywhere;
|
|
@@ -24,5 +29,23 @@
|
|
|
24
29
|
display: block;
|
|
25
30
|
align-self: flex-start;
|
|
26
31
|
margin-block-start: calc((var(--field-error-line-height) - var(--field-error-icon-size)) / 2);
|
|
32
|
+
}/* The room opens first, so what stands below slides down instead of dropping. */@media (prefers-reduced-motion: no-preference) {
|
|
33
|
+
.FieldError {
|
|
34
|
+
animation: open 200ms var(--cubic-enter);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.Inner {
|
|
38
|
+
animation: fade-in var(--transition-duration-basic) var(--cubic-enter);
|
|
39
|
+
}
|
|
40
|
+
}@keyframes open {
|
|
41
|
+
from {
|
|
42
|
+
grid-template-rows: 0fr;
|
|
43
|
+
margin-block: 0;
|
|
44
|
+
padding-block: 0;
|
|
45
|
+
}
|
|
46
|
+
}@keyframes fade-in {
|
|
47
|
+
from {
|
|
48
|
+
opacity: 0;
|
|
49
|
+
}
|
|
27
50
|
}
|
|
28
51
|
}
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
border: var(--field-group-border-width) solid var(--color-border);
|
|
31
31
|
border-radius: var(--field-group-radius);
|
|
32
32
|
background: var(--field-group-background);
|
|
33
|
-
}.Body > [data-row] + [data-row]
|
|
33
|
+
}.Body > [data-row] + [data-row],
|
|
34
|
+
.Body > [data-sortable] > [data-row] + [data-row] {
|
|
34
35
|
border-top: 1px solid var(--color-border);
|
|
35
36
|
}
|
|
36
37
|
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
@layer components {/* =============================================
|
|
2
|
+
List
|
|
3
|
+
============================================= */.Sortable > * {
|
|
4
|
+
-webkit-touch-callout: none;
|
|
5
|
+
}/* An item that takes the keyboard itself: arrow keys move it */.Sortable > [tabindex]:focus-visible {
|
|
6
|
+
outline: 2px solid var(--color-ring);
|
|
7
|
+
outline-offset: 2px;
|
|
8
|
+
}/* Without a grip in sight an item drags from anywhere but a control */.Sortable:not([data-disabled]):not(tbody):not([data-handles="true"]) > *,
|
|
9
|
+
.Sortable:not([data-disabled])[data-handles="false"] > * {
|
|
10
|
+
cursor: grab;
|
|
11
|
+
}/* While a drag runs the neighbours of the gap slide apart */.Sortable[data-dragging] > * {
|
|
12
|
+
transition: transform 200ms var(--cubic-enter);
|
|
13
|
+
}/* A row with a handle: the handle, then the row */.Sortable > :has(> .Handle) {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
}.Sortable > :has(> .Handle) > :not(.Handle) {
|
|
17
|
+
flex: 1;
|
|
18
|
+
min-width: 0;
|
|
19
|
+
}.Sortable > :has(> .Handle) > .Handle {
|
|
20
|
+
margin-inline-start: var(--sortable-handle-inset);
|
|
21
|
+
margin-inline-end: calc(var(--sortable-handle-inset) * -1);
|
|
22
|
+
}/* =============================================
|
|
23
|
+
Slot (the place a dragged item left, until the drop)
|
|
24
|
+
============================================= */.Sortable > [data-sortable-source] {
|
|
25
|
+
position: relative;
|
|
26
|
+
border-color: transparent;
|
|
27
|
+
background: none;
|
|
28
|
+
box-shadow: none;
|
|
29
|
+
color: transparent;
|
|
30
|
+
}.Sortable > [data-sortable-source] > * {
|
|
31
|
+
visibility: hidden !important;
|
|
32
|
+
}.Sortable > [data-sortable-source]::before {
|
|
33
|
+
position: absolute;
|
|
34
|
+
inset: var(--sortable-slot-inset);
|
|
35
|
+
border-radius: var(--sortable-slot-radius);
|
|
36
|
+
background: var(--sortable-slot-background);
|
|
37
|
+
content: "";
|
|
38
|
+
transition: background-color var(--transition-duration-basic);
|
|
39
|
+
}.Sortable > [data-sortable-source][data-sortable-away]::before {
|
|
40
|
+
background: var(--sortable-slot-background-away);
|
|
41
|
+
}.Sortable[data-layout="grid"] > [data-sortable-source]::before {
|
|
42
|
+
inset: 0;
|
|
43
|
+
}/* A row of a group keeps the hairline to the next row */.Sortable[data-layout="list"] > [data-sortable-source] {
|
|
44
|
+
border-color: inherit;
|
|
45
|
+
}/* A table row takes a pseudo element for a cell of its own and every column
|
|
46
|
+
slips: the slot hangs from the first cell, over the whole row */.Sortable > tr[data-sortable-source]::before {
|
|
47
|
+
content: none;
|
|
48
|
+
}.Sortable > tr[data-sortable-source] > * {
|
|
49
|
+
position: static !important;
|
|
50
|
+
}.Sortable > tr[data-sortable-source] > :first-child::before {
|
|
51
|
+
position: absolute;
|
|
52
|
+
inset: var(--sortable-slot-inset);
|
|
53
|
+
border-radius: var(--sortable-slot-radius);
|
|
54
|
+
background: var(--sortable-slot-background);
|
|
55
|
+
content: "";
|
|
56
|
+
transition: background-color var(--transition-duration-basic);
|
|
57
|
+
visibility: visible;
|
|
58
|
+
}.Sortable > tr[data-sortable-source][data-sortable-away] > :first-child::before {
|
|
59
|
+
background: var(--sortable-slot-background-away);
|
|
60
|
+
}/* =============================================
|
|
61
|
+
Handle
|
|
62
|
+
============================================= */.Handle {
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
flex: none;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
width: var(--sortable-handle-size);
|
|
68
|
+
height: var(--sortable-handle-size);
|
|
69
|
+
padding: 0;
|
|
70
|
+
border: 0;
|
|
71
|
+
border-radius: var(--control-radius-md);
|
|
72
|
+
background: none;
|
|
73
|
+
color: var(--sortable-handle-color);
|
|
74
|
+
font-size: var(--sortable-handle-icon-size);
|
|
75
|
+
touch-action: none;
|
|
76
|
+
transition: color var(--transition-duration-basic);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@media (hover: hover) and (pointer: fine) {.Handle:hover {
|
|
80
|
+
color: var(--sortable-handle-color-hover);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.Handle:focus-visible {
|
|
85
|
+
outline: 2px solid var(--color-ring);
|
|
86
|
+
outline-offset: -2px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.Handle > svg {
|
|
90
|
+
width: 1em;
|
|
91
|
+
height: 1em;
|
|
92
|
+
}/* Important: a page's own rule for every button stands outside the layer of this file */.Handle {
|
|
93
|
+
cursor: grab !important;
|
|
94
|
+
}.Sortable[data-disabled] .Handle {
|
|
95
|
+
cursor: not-allowed !important;
|
|
96
|
+
opacity: 0.5;
|
|
97
|
+
}/* Grips stand in a table and where `handles` asks for them. A hidden grip stays
|
|
98
|
+
in the tab order: the arrow keys still reach the row, and the row shows the focus */.Sortable:not(tbody):not([data-handles="true"]) .Handle,
|
|
99
|
+
.Sortable[data-handles="false"] .Handle {
|
|
100
|
+
position: absolute;
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
width: 1px;
|
|
103
|
+
height: 1px;
|
|
104
|
+
margin: 0;
|
|
105
|
+
clip-path: inset(50%);
|
|
106
|
+
}.Sortable:not(tbody):not([data-handles="true"]) > :has(.Handle:focus-visible),
|
|
107
|
+
.Sortable[data-handles="false"] > :has(.Handle:focus-visible) {
|
|
108
|
+
outline: 2px solid var(--color-ring);
|
|
109
|
+
outline-offset: -2px;
|
|
110
|
+
}/* =============================================
|
|
111
|
+
Chip (what follows the pointer)
|
|
112
|
+
============================================= */.Chip {
|
|
113
|
+
position: fixed;
|
|
114
|
+
top: 0;
|
|
115
|
+
left: 0;
|
|
116
|
+
z-index: var(--sortable-chip-z-index);
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
gap: 8px;
|
|
120
|
+
overflow: hidden;
|
|
121
|
+
max-width: var(--sortable-chip-max-width);
|
|
122
|
+
padding: 8px 12px;
|
|
123
|
+
border-radius: var(--sortable-chip-radius);
|
|
124
|
+
background: var(--color-surface);
|
|
125
|
+
box-shadow: var(--sortable-chip-shadow);
|
|
126
|
+
color: var(--color-text);
|
|
127
|
+
font-size: var(--font-text-sm-size);
|
|
128
|
+
line-height: var(--font-text-sm-line-height);
|
|
129
|
+
pointer-events: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@media (prefers-reduced-motion: no-preference) {.Chip {
|
|
133
|
+
animation: chip-lift 120ms var(--cubic-enter)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.Chip:has(.ChipImage) {
|
|
138
|
+
padding: 6px 12px 6px 6px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.Chip:has(.ChipImage):not(:has(.ChipLabel)) {
|
|
142
|
+
padding: 6px;
|
|
143
|
+
}@keyframes chip-lift {
|
|
144
|
+
from {
|
|
145
|
+
scale: 0.97;
|
|
146
|
+
}
|
|
147
|
+
}.ChipImage {
|
|
148
|
+
flex: none;
|
|
149
|
+
width: var(--sortable-chip-image-size);
|
|
150
|
+
height: var(--sortable-chip-image-size);
|
|
151
|
+
border-radius: calc(var(--sortable-chip-radius) - 4px);
|
|
152
|
+
-o-object-fit: cover;
|
|
153
|
+
object-fit: cover;
|
|
154
|
+
}.ChipLabel {
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
min-width: 0;
|
|
157
|
+
text-overflow: ellipsis;
|
|
158
|
+
white-space: nowrap;
|
|
159
|
+
}/* =============================================
|
|
160
|
+
Line (the gap the item will land in)
|
|
161
|
+
============================================= */.Line {
|
|
162
|
+
position: fixed;
|
|
163
|
+
top: 0;
|
|
164
|
+
left: 0;
|
|
165
|
+
z-index: calc(var(--sortable-chip-z-index) - 1);
|
|
166
|
+
width: var(--sortable-line-size);
|
|
167
|
+
height: var(--sortable-line-size);
|
|
168
|
+
border-radius: 999px;
|
|
169
|
+
background: var(--sortable-line-color);
|
|
170
|
+
pointer-events: none;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.Line[hidden] {
|
|
174
|
+
display: none;
|
|
175
|
+
}/* =============================================
|
|
176
|
+
Screen reader announcements
|
|
177
|
+
============================================= */.Live {
|
|
178
|
+
position: absolute;
|
|
179
|
+
overflow: hidden;
|
|
180
|
+
width: 1px;
|
|
181
|
+
height: 1px;
|
|
182
|
+
margin: -1px;
|
|
183
|
+
clip-path: inset(50%);
|
|
184
|
+
white-space: nowrap;
|
|
185
|
+
}/* The whole page while a drag runs */.Dragging,
|
|
186
|
+
.Dragging * {
|
|
187
|
+
cursor: grabbing !important;
|
|
188
|
+
-webkit-user-select: none;
|
|
189
|
+
-moz-user-select: none;
|
|
190
|
+
user-select: none;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
@@ -30,6 +30,9 @@
|
|
|
30
30
|
`--tag-input-tag-{height,gutter,font-size}` so the
|
|
31
31
|
inner pills stay proportional to the container.
|
|
32
32
|
============================================= */
|
|
33
|
+
|
|
34
|
+
/* Ghost: no frame, for a field that its container already frames, such as
|
|
35
|
+
a row of a group. Last in the block: it undoes hover and focus above. */
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
.Container[data-disabled] {
|
|
@@ -120,6 +123,14 @@ box-shadow: 0 0 0 1px var(--gray-500) inset;
|
|
|
120
123
|
--tag-input-height: 32px;
|
|
121
124
|
--tag-input-tag-spacing: 8px;
|
|
122
125
|
--tag-input-radius: var(--control-radius-xl);
|
|
126
|
+
}
|
|
127
|
+
.Container[data-variant="ghost"],
|
|
128
|
+
.Container[data-variant="ghost"]:not([data-disabled]),
|
|
129
|
+
.Container[data-variant="ghost"]:not([data-disabled])[data-focused] {
|
|
130
|
+
min-height: calc(var(--min-rows) * var(--tag-input-height));
|
|
131
|
+
padding: 0;
|
|
132
|
+
border-radius: 0;
|
|
133
|
+
box-shadow: none;
|
|
123
134
|
}.TagInput {
|
|
124
135
|
display: flex;
|
|
125
136
|
flex-wrap: wrap;
|
|
@@ -168,6 +168,18 @@
|
|
|
168
168
|
box-shadow: 0 0 0 1px var(--input-border-color-invalid) inset;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
+
/* =============================================
|
|
172
|
+
Ghost variant: no border, no fill. For a field that its container
|
|
173
|
+
already frames, such as a row of a group
|
|
174
|
+
============================================= */
|
|
175
|
+
.Container:where([data-variant="ghost"]) {
|
|
176
|
+
background-color: transparent;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.Container:where([data-variant="ghost"]):not([data-disabled])[data-invalid] {
|
|
180
|
+
box-shadow: 0 0 0 1px var(--input-border-color-invalid) inset;
|
|
181
|
+
}
|
|
182
|
+
|
|
171
183
|
/* =============================================
|
|
172
184
|
Invalid
|
|
173
185
|
============================================= */
|
package/dist/es/styles/touch.css
CHANGED
|
@@ -208,6 +208,26 @@
|
|
|
208
208
|
--field-horizontal-label-width: 120px;
|
|
209
209
|
--field-horizontal-control-width: 240px;
|
|
210
210
|
|
|
211
|
+
/* =============================================
|
|
212
|
+
Sortable
|
|
213
|
+
============================================= */
|
|
214
|
+
--sortable-chip-max-width: 18rem;
|
|
215
|
+
--sortable-chip-radius: 14px;
|
|
216
|
+
--sortable-chip-image-size: 40px;
|
|
217
|
+
--sortable-chip-shadow: 0 8px 24px rgb(0 0 0 / 16%), 0 0 0 1px var(--color-border);
|
|
218
|
+
--sortable-chip-z-index: 100000;
|
|
219
|
+
--sortable-handle-size: 32px;
|
|
220
|
+
--sortable-handle-icon-size: 16px;
|
|
221
|
+
--sortable-handle-inset: 8px;
|
|
222
|
+
--sortable-handle-color: var(--color-text-tertiary);
|
|
223
|
+
--sortable-handle-color-hover: var(--color-text-secondary);
|
|
224
|
+
--sortable-line-size: 2px;
|
|
225
|
+
--sortable-line-color: var(--color-background-info-solid);
|
|
226
|
+
--sortable-slot-inset: 8px;
|
|
227
|
+
--sortable-slot-radius: 12px;
|
|
228
|
+
--sortable-slot-background: var(--color-background-info-soft);
|
|
229
|
+
--sortable-slot-background-away: var(--color-surface-tertiary);
|
|
230
|
+
|
|
211
231
|
/* =============================================
|
|
212
232
|
Field row
|
|
213
233
|
============================================= */
|