@surflane/css 0.13.0 → 0.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/controls.css +22 -2
- package/package.json +2 -2
- package/presentation/banner.css +105 -0
- package/presentation/card.css +1 -1
- package/presentation/code.css +0 -36
- package/presentation/copy-button.css +42 -0
- package/presentation/description-list.css +116 -0
- package/presentation/kbd.css +34 -0
- package/presentation/list.css +1 -1
- package/presentation/table.css +57 -0
- package/presentation/timeline.css +117 -0
- package/presentation.css +5 -0
package/controls.css
CHANGED
|
@@ -65,10 +65,21 @@
|
|
|
65
65
|
var(--surf-interaction-active-bg)
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
/* The chosen segment: the current page for links, a pressed button in a
|
|
69
|
+
SegmentedControl, or a checked radio below. */
|
|
70
|
+
.surf-segment:is([aria-current='page'], [aria-pressed='true']) {
|
|
69
71
|
background-color: var(--surf-selected);
|
|
70
72
|
color: var(--surf-ink);
|
|
71
73
|
}
|
|
74
|
+
button.surf-segment {
|
|
75
|
+
border: 0;
|
|
76
|
+
background-color: transparent;
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
}
|
|
79
|
+
.surf-segment:is(:disabled, [data-disabled]) {
|
|
80
|
+
opacity: var(--surf-control-disabled-opacity);
|
|
81
|
+
cursor: not-allowed;
|
|
82
|
+
}
|
|
72
83
|
.surf-segment:focus-visible,
|
|
73
84
|
.surf-icon-button:focus-visible {
|
|
74
85
|
outline: var(--surf-focus-ring-width) solid var(--surf-interaction-focus);
|
|
@@ -130,11 +141,20 @@
|
|
|
130
141
|
outline-offset: var(--surf-focus-ring-offset);
|
|
131
142
|
}
|
|
132
143
|
@media (forced-colors: active) {
|
|
133
|
-
.surf-segment[aria-current='page'],
|
|
144
|
+
.surf-segment:is([aria-current='page'], [aria-pressed='true']),
|
|
134
145
|
.surf-control-group label:has(input:checked) .surf-segment {
|
|
135
146
|
background-color: Highlight;
|
|
136
147
|
color: HighlightText;
|
|
137
148
|
forced-color-adjust: none;
|
|
138
149
|
}
|
|
139
150
|
}
|
|
151
|
+
/* On touch a segment is a whole target, and the track grows around it. */
|
|
152
|
+
@media (pointer: coarse) {
|
|
153
|
+
.surf-control-group {
|
|
154
|
+
height: auto;
|
|
155
|
+
}
|
|
156
|
+
.surf-segment {
|
|
157
|
+
min-block-size: var(--surf-control-target-size);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
140
160
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surflane/css",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Surflane's CSS-only layer: control, layout composition, document typography and presentation classes that work without React, on top of @surflane/design-tokens.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-system",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@surflane/design-tokens": "^0.
|
|
40
|
+
"@surflane/design-tokens": "^0.15.0"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/* Presentation classes: Banner. */
|
|
2
|
+
@layer surflane.tokens, surflane.themes, surflane.base, surflane.components,
|
|
3
|
+
surflane.sizes;
|
|
4
|
+
|
|
5
|
+
@layer surflane.components {
|
|
6
|
+
/* A notice for the whole product: a full-width plane in its tone, square, with the
|
|
7
|
+
icon, the title and description in one line where they fit, then the actions
|
|
8
|
+
and the dismiss button at the end. Parts keep their own spacing, so a missing
|
|
9
|
+
part leaves no gap. */
|
|
10
|
+
.surf-banner {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
display: grid;
|
|
13
|
+
grid-template-columns: auto minmax(0, 1fr) auto auto;
|
|
14
|
+
grid-template-areas: 'icon content actions dismiss';
|
|
15
|
+
align-items: center;
|
|
16
|
+
min-inline-size: 0;
|
|
17
|
+
padding-block: var(--surf-space-2);
|
|
18
|
+
padding-inline: var(--surf-banner-inset, var(--surf-space-4));
|
|
19
|
+
background: var(--surf-status-info-bg);
|
|
20
|
+
color: var(--surf-status-info-fg);
|
|
21
|
+
font: var(--surf-weight-regular) var(--surf-type-body-size) /
|
|
22
|
+
var(--surf-type-body-leading) var(--surf-font-body);
|
|
23
|
+
letter-spacing: var(--surf-type-body-tracking);
|
|
24
|
+
}
|
|
25
|
+
.surf-banner[data-tone='caution'] {
|
|
26
|
+
background: var(--surf-status-caution-bg);
|
|
27
|
+
color: var(--surf-status-caution-fg);
|
|
28
|
+
}
|
|
29
|
+
.surf-banner[data-tone='danger'] {
|
|
30
|
+
background: var(--surf-status-danger-bg);
|
|
31
|
+
color: var(--surf-status-danger-fg);
|
|
32
|
+
}
|
|
33
|
+
.surf-banner-icon {
|
|
34
|
+
grid-area: icon;
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
margin-inline-end: var(--surf-space-3);
|
|
37
|
+
}
|
|
38
|
+
.surf-banner-content {
|
|
39
|
+
grid-area: content;
|
|
40
|
+
min-inline-size: 0;
|
|
41
|
+
overflow-wrap: anywhere;
|
|
42
|
+
}
|
|
43
|
+
.surf-banner-title {
|
|
44
|
+
margin-inline-end: var(--surf-space-2);
|
|
45
|
+
font-weight: var(--surf-weight-medium);
|
|
46
|
+
}
|
|
47
|
+
.surf-banner-actions {
|
|
48
|
+
grid-area: actions;
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-wrap: wrap;
|
|
51
|
+
gap: var(--surf-space-2);
|
|
52
|
+
margin-inline-start: var(--surf-space-4);
|
|
53
|
+
}
|
|
54
|
+
.surf-banner > .surf-banner-dismiss {
|
|
55
|
+
grid-area: dismiss;
|
|
56
|
+
margin-inline-start: var(--surf-space-2);
|
|
57
|
+
color: inherit;
|
|
58
|
+
}
|
|
59
|
+
/* On a phone the description goes under the title and the actions under the
|
|
60
|
+
text, so the text keeps the width. */
|
|
61
|
+
@media (max-width: 760px) {
|
|
62
|
+
.surf-banner {
|
|
63
|
+
align-items: start;
|
|
64
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
65
|
+
grid-template-areas:
|
|
66
|
+
'icon content dismiss'
|
|
67
|
+
'. actions .';
|
|
68
|
+
}
|
|
69
|
+
/* The icon sits on the title's line, and the dismiss button at the top. */
|
|
70
|
+
.surf-banner-icon {
|
|
71
|
+
align-items: center;
|
|
72
|
+
block-size: 1lh;
|
|
73
|
+
}
|
|
74
|
+
.surf-banner-description {
|
|
75
|
+
display: block;
|
|
76
|
+
}
|
|
77
|
+
.surf-banner-actions {
|
|
78
|
+
margin-block-start: var(--surf-space-2);
|
|
79
|
+
margin-inline-start: 0;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/* Forced colors drop the tone's plane, so a line keeps the notice apart. */
|
|
83
|
+
@media (forced-colors: active) {
|
|
84
|
+
.surf-banner {
|
|
85
|
+
border-block-end: 1px solid CanvasText;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
:is(.surf-banner)[data-status-transition] {
|
|
89
|
+
background-color: color-mix(
|
|
90
|
+
in oklch,
|
|
91
|
+
var(--surf-status-from-0),
|
|
92
|
+
var(--surf-status-to-0) calc(var(--surf-status-progress) * 100%)
|
|
93
|
+
);
|
|
94
|
+
color: color-mix(
|
|
95
|
+
in oklch,
|
|
96
|
+
var(--surf-status-from-1),
|
|
97
|
+
var(--surf-status-to-1) calc(var(--surf-status-progress) * 100%)
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
@media (prefers-reduced-motion: reduce), (forced-colors: active) {
|
|
101
|
+
:is(.surf-banner)[data-status-transition] {
|
|
102
|
+
--surf-status-progress: 1 !important;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
package/presentation/card.css
CHANGED
package/presentation/code.css
CHANGED
|
@@ -55,40 +55,4 @@
|
|
|
55
55
|
white-space: pre-wrap;
|
|
56
56
|
overflow-wrap: anywhere;
|
|
57
57
|
}
|
|
58
|
-
/* Copy results stay inside the button. */
|
|
59
|
-
.surf-copy-button[data-copy-state='copied'] {
|
|
60
|
-
color: var(--surf-status-success-fg);
|
|
61
|
-
}
|
|
62
|
-
.surf-copy-button[data-copy-state='failed'] {
|
|
63
|
-
color: var(--surf-status-danger-fg);
|
|
64
|
-
}
|
|
65
|
-
/* Every label sits in one cell: the longest sets the width, the current shows. */
|
|
66
|
-
/* The label sits beside the icon; the room a longer result needs trails it. */
|
|
67
|
-
.surf-copy-text {
|
|
68
|
-
display: inline-grid;
|
|
69
|
-
text-align: start;
|
|
70
|
-
}
|
|
71
|
-
.surf-copy-text > * {
|
|
72
|
-
grid-area: 1 / 1;
|
|
73
|
-
}
|
|
74
|
-
.surf-copy-room {
|
|
75
|
-
visibility: hidden;
|
|
76
|
-
}
|
|
77
|
-
.surf-copy-room::before {
|
|
78
|
-
content: attr(data-label);
|
|
79
|
-
}
|
|
80
|
-
/* The result fades in where the action was, and the action fades back. */
|
|
81
|
-
.surf-copy-button[data-copy-used] :is(.surf-copy-icon, .surf-copy-label) {
|
|
82
|
-
animation: surf-copy-fade var(--surf-duration-base) var(--surf-ease-out);
|
|
83
|
-
}
|
|
84
|
-
@keyframes surf-copy-fade {
|
|
85
|
-
from {
|
|
86
|
-
opacity: 0;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
@media (prefers-reduced-motion: reduce) {
|
|
90
|
-
.surf-copy-button[data-copy-used] :is(.surf-copy-icon, .surf-copy-label) {
|
|
91
|
-
animation: none;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
58
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* Presentation classes: Copy button. */
|
|
2
|
+
@layer surflane.tokens, surflane.themes, surflane.base, surflane.components,
|
|
3
|
+
surflane.sizes;
|
|
4
|
+
|
|
5
|
+
@layer surflane.components {
|
|
6
|
+
/* Copy results stay inside the button. */
|
|
7
|
+
.surf-copy-button[data-copy-state='copied'] {
|
|
8
|
+
color: var(--surf-status-success-fg);
|
|
9
|
+
}
|
|
10
|
+
.surf-copy-button[data-copy-state='failed'] {
|
|
11
|
+
color: var(--surf-status-danger-fg);
|
|
12
|
+
}
|
|
13
|
+
/* Every label sits in one cell: the longest sets the width, the current shows. */
|
|
14
|
+
/* The label sits beside the icon; the room a longer result needs trails it. */
|
|
15
|
+
.surf-copy-text {
|
|
16
|
+
display: inline-grid;
|
|
17
|
+
text-align: start;
|
|
18
|
+
}
|
|
19
|
+
.surf-copy-text > * {
|
|
20
|
+
grid-area: 1 / 1;
|
|
21
|
+
}
|
|
22
|
+
.surf-copy-room {
|
|
23
|
+
visibility: hidden;
|
|
24
|
+
}
|
|
25
|
+
.surf-copy-room::before {
|
|
26
|
+
content: attr(data-label);
|
|
27
|
+
}
|
|
28
|
+
/* The result fades in where the action was, and the action fades back. */
|
|
29
|
+
.surf-copy-button[data-copy-used] :is(.surf-copy-icon, .surf-copy-label) {
|
|
30
|
+
animation: surf-copy-fade var(--surf-duration-base) var(--surf-ease-out);
|
|
31
|
+
}
|
|
32
|
+
@keyframes surf-copy-fade {
|
|
33
|
+
from {
|
|
34
|
+
opacity: 0;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
@media (prefers-reduced-motion: reduce) {
|
|
38
|
+
.surf-copy-button[data-copy-used] :is(.surf-copy-icon, .surf-copy-label) {
|
|
39
|
+
animation: none;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/* Presentation classes: Description list. */
|
|
2
|
+
@layer surflane.tokens, surflane.themes, surflane.base, surflane.components,
|
|
3
|
+
surflane.sizes;
|
|
4
|
+
|
|
5
|
+
@layer surflane.components {
|
|
6
|
+
/* Terms and their values, a row each, at least as tall as a menu row with its
|
|
7
|
+
line centered, so a badge or a copy action fits without growing it: the term in
|
|
8
|
+
muted ink in a column of its own width, the value beside it in ink. Where a row
|
|
9
|
+
is too narrow for both, the value moves under its term. No lines between rows:
|
|
10
|
+
the term column and the rhythm carry the structure. */
|
|
11
|
+
.surf-description-list {
|
|
12
|
+
--surf-description-list-term-width: 10rem;
|
|
13
|
+
--surf-description-list-value-min-width: 10rem;
|
|
14
|
+
--surf-description-list-column-min-width: 22rem;
|
|
15
|
+
--surf-description-list-row: var(--surf-size-row-default);
|
|
16
|
+
--surf-description-list-leading: var(--surf-size-leading-default);
|
|
17
|
+
--surf-description-list-gap: var(--surf-space-8);
|
|
18
|
+
--surf-description-list-stack-padding: var(--surf-space-2);
|
|
19
|
+
display: grid;
|
|
20
|
+
grid-template-columns: minmax(0, 1fr);
|
|
21
|
+
align-items: start;
|
|
22
|
+
column-gap: var(--surf-description-list-gap);
|
|
23
|
+
margin: 0;
|
|
24
|
+
font: var(--surf-weight-regular) var(--surf-size-font-default) /
|
|
25
|
+
var(--surf-description-list-leading) var(--surf-font-body);
|
|
26
|
+
letter-spacing: var(--surf-type-body-tracking);
|
|
27
|
+
}
|
|
28
|
+
/* Two columns where both fit, one where they do not. */
|
|
29
|
+
.surf-description-list[data-columns='2'] {
|
|
30
|
+
grid-template-columns: repeat(
|
|
31
|
+
auto-fill,
|
|
32
|
+
minmax(
|
|
33
|
+
max(
|
|
34
|
+
min(100%, var(--surf-description-list-column-min-width)),
|
|
35
|
+
calc((100% - var(--surf-description-list-gap)) / 2)
|
|
36
|
+
),
|
|
37
|
+
1fr
|
|
38
|
+
)
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
.surf-description-list-item {
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-wrap: wrap;
|
|
45
|
+
align-content: center;
|
|
46
|
+
align-items: baseline;
|
|
47
|
+
column-gap: var(--surf-space-4);
|
|
48
|
+
min-inline-size: 0;
|
|
49
|
+
min-block-size: var(--surf-description-list-row);
|
|
50
|
+
}
|
|
51
|
+
.surf-description-list-term {
|
|
52
|
+
flex: 0 1 var(--surf-description-list-term-width);
|
|
53
|
+
min-inline-size: 0;
|
|
54
|
+
color: var(--surf-ink-muted);
|
|
55
|
+
overflow-wrap: anywhere;
|
|
56
|
+
}
|
|
57
|
+
.surf-description-list-value {
|
|
58
|
+
flex: 1 1 var(--surf-description-list-value-min-width);
|
|
59
|
+
min-inline-size: 0;
|
|
60
|
+
margin: 0;
|
|
61
|
+
color: var(--surf-ink);
|
|
62
|
+
overflow-wrap: anywhere;
|
|
63
|
+
}
|
|
64
|
+
/* Stacked, and inline on a phone: each term above its value, a pair set apart from
|
|
65
|
+
the next by its own padding rather than a row height. */
|
|
66
|
+
.surf-description-list[data-layout='stacked'] .surf-description-list-item {
|
|
67
|
+
min-block-size: 0;
|
|
68
|
+
padding-block: var(--surf-description-list-stack-padding);
|
|
69
|
+
}
|
|
70
|
+
.surf-description-list[data-layout='stacked'] .surf-description-list-term {
|
|
71
|
+
flex-basis: 100%;
|
|
72
|
+
}
|
|
73
|
+
@media (max-width: 760px) {
|
|
74
|
+
.surf-description-list .surf-description-list-item {
|
|
75
|
+
min-block-size: 0;
|
|
76
|
+
padding-block: var(--surf-description-list-stack-padding);
|
|
77
|
+
}
|
|
78
|
+
.surf-description-list .surf-description-list-term {
|
|
79
|
+
flex-basis: 100%;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
.surf-description-list-value[data-empty] {
|
|
83
|
+
color: var(--surf-ink-muted);
|
|
84
|
+
}
|
|
85
|
+
/* One line, cut with an ellipsis; the whole value stays in the text, in the title
|
|
86
|
+
and in what the copy action copies. */
|
|
87
|
+
.surf-description-list-value[data-truncate]:not([data-copy]),
|
|
88
|
+
.surf-description-list-value[data-truncate] > .surf-description-list-text {
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
text-overflow: ellipsis;
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
}
|
|
93
|
+
/* A value with a copy action: the text, then the action, a square of the small
|
|
94
|
+
control height that fits the row. */
|
|
95
|
+
.surf-description-list-value[data-copy] {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
gap: var(--surf-space-2);
|
|
99
|
+
}
|
|
100
|
+
.surf-description-list-text {
|
|
101
|
+
min-inline-size: 0;
|
|
102
|
+
}
|
|
103
|
+
.surf-description-list-value > .surf-copy-button {
|
|
104
|
+
flex: none;
|
|
105
|
+
}
|
|
106
|
+
/* Compact: a small row, for dense panels. A list in a compact density scope is
|
|
107
|
+
compact unless it says density='default'. */
|
|
108
|
+
.surf-description-list:is(
|
|
109
|
+
[data-density='compact'],
|
|
110
|
+
:where([data-ui-density='compact'] :not([data-density]))
|
|
111
|
+
) {
|
|
112
|
+
--surf-description-list-row: var(--surf-size-row-small);
|
|
113
|
+
--surf-description-list-gap: var(--surf-space-6);
|
|
114
|
+
--surf-description-list-stack-padding: var(--surf-space-1);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* Presentation classes: Kbd. */
|
|
2
|
+
@layer surflane.tokens, surflane.themes, surflane.base, surflane.components,
|
|
3
|
+
surflane.sizes;
|
|
4
|
+
|
|
5
|
+
@layer surflane.components {
|
|
6
|
+
/* A key or a chord, on the plane recessed one step from the one it sits on. Its
|
|
7
|
+
size follows the text around it, like inline code, and its face is the body's:
|
|
8
|
+
key caps print words, not code. */
|
|
9
|
+
.surf-kbd {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
display: inline-block;
|
|
12
|
+
min-inline-size: 1.5em;
|
|
13
|
+
padding: 0 var(--surf-space-1);
|
|
14
|
+
border-radius: var(--surf-radius-sm);
|
|
15
|
+
background: var(--surf-recessed);
|
|
16
|
+
color: var(--surf-ink);
|
|
17
|
+
font-family: var(--surf-font-body);
|
|
18
|
+
font-size: 0.875em;
|
|
19
|
+
font-weight: var(--surf-weight-medium);
|
|
20
|
+
font-variant-numeric: tabular-nums;
|
|
21
|
+
letter-spacing: normal;
|
|
22
|
+
text-align: center;
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
}
|
|
25
|
+
.surf-kbd kbd {
|
|
26
|
+
font: inherit;
|
|
27
|
+
}
|
|
28
|
+
@media (forced-colors: active) {
|
|
29
|
+
.surf-kbd {
|
|
30
|
+
padding-inline: calc(var(--surf-space-1) - 1px);
|
|
31
|
+
border: 1px solid CanvasText;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
package/presentation/list.css
CHANGED
package/presentation/table.css
CHANGED
|
@@ -217,6 +217,63 @@
|
|
|
217
217
|
);
|
|
218
218
|
box-shadow: inset 0 -1px var(--surf-line);
|
|
219
219
|
}
|
|
220
|
+
/* A sticky first column stays at the inline start while the rest scrolls under it,
|
|
221
|
+
* on the surface behind the table. The fill has no specificity, so a stripe or a
|
|
222
|
+
* selection still paints over it. Under a sticky header the header sits above the
|
|
223
|
+
* column, and their corner above both. */
|
|
224
|
+
.surf-table[data-sticky-column]
|
|
225
|
+
> :is(.surf-table-head, .surf-table-body, .surf-table-foot)
|
|
226
|
+
> .surf-table-row
|
|
227
|
+
> :first-child {
|
|
228
|
+
position: sticky;
|
|
229
|
+
inset-inline-start: 0;
|
|
230
|
+
z-index: 1;
|
|
231
|
+
}
|
|
232
|
+
:where(
|
|
233
|
+
.surf-table[data-sticky-column]
|
|
234
|
+
> :is(.surf-table-head, .surf-table-body, .surf-table-foot)
|
|
235
|
+
> .surf-table-row
|
|
236
|
+
> :first-child
|
|
237
|
+
) {
|
|
238
|
+
background-color: var(
|
|
239
|
+
--surf-table-surface,
|
|
240
|
+
var(--table-surface, var(--surf-plane))
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
.surf-table[data-sticky-column][data-sticky-header]
|
|
244
|
+
> .surf-table-head
|
|
245
|
+
> .surf-table-row
|
|
246
|
+
> .surf-table-cell {
|
|
247
|
+
z-index: 2;
|
|
248
|
+
}
|
|
249
|
+
.surf-table[data-sticky-column][data-sticky-header]
|
|
250
|
+
> .surf-table-head
|
|
251
|
+
> .surf-table-row
|
|
252
|
+
> :first-child {
|
|
253
|
+
z-index: 3;
|
|
254
|
+
}
|
|
255
|
+
/* Once rows pass under the column, a line marks its edge. */
|
|
256
|
+
.surf-table[data-sticky-column]
|
|
257
|
+
> :is(.surf-table-head, .surf-table-body, .surf-table-foot)
|
|
258
|
+
> .surf-table-row
|
|
259
|
+
> :first-child::after {
|
|
260
|
+
content: '';
|
|
261
|
+
position: absolute;
|
|
262
|
+
inset-block: 0;
|
|
263
|
+
inset-inline-end: 0;
|
|
264
|
+
inline-size: 1px;
|
|
265
|
+
background: var(--surf-line);
|
|
266
|
+
opacity: 0;
|
|
267
|
+
}
|
|
268
|
+
[data-overflow-x-start]
|
|
269
|
+
> *
|
|
270
|
+
> *
|
|
271
|
+
> .surf-table[data-sticky-column]
|
|
272
|
+
> :is(.surf-table-head, .surf-table-body, .surf-table-foot)
|
|
273
|
+
> .surf-table-row
|
|
274
|
+
> :first-child::after {
|
|
275
|
+
opacity: 1;
|
|
276
|
+
}
|
|
220
277
|
.surf-table-truncate {
|
|
221
278
|
display: inline-block;
|
|
222
279
|
max-inline-size: var(--surf-table-truncate-measure, 32ch);
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/* Presentation classes: Timeline. */
|
|
2
|
+
@layer surflane.tokens, surflane.themes, surflane.base, surflane.components,
|
|
3
|
+
surflane.sizes;
|
|
4
|
+
|
|
5
|
+
@layer surflane.components {
|
|
6
|
+
/* Events in time order, one row each: the tone's icon in a column of its own on
|
|
7
|
+
the title's line, then what happened with its time at the end of the line,
|
|
8
|
+
and its state and description under it. No connecting line: the icon column
|
|
9
|
+
carries the sequence, and the current step sits on the recessed plane. */
|
|
10
|
+
.surf-timeline {
|
|
11
|
+
display: grid;
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
list-style: none;
|
|
15
|
+
color: var(--surf-ink-body);
|
|
16
|
+
font: var(--surf-weight-regular) var(--surf-type-body-size) /
|
|
17
|
+
var(--surf-type-body-leading) var(--surf-font-body);
|
|
18
|
+
letter-spacing: var(--surf-type-body-tracking);
|
|
19
|
+
}
|
|
20
|
+
.surf-timeline-item {
|
|
21
|
+
display: grid;
|
|
22
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
23
|
+
column-gap: var(--surf-space-3);
|
|
24
|
+
min-inline-size: 0;
|
|
25
|
+
padding: var(--surf-space-2) var(--surf-space-3);
|
|
26
|
+
border-radius: var(--surf-radius-md);
|
|
27
|
+
}
|
|
28
|
+
/* The current step is recessed one step from its plane, and what it holds sits on
|
|
29
|
+
that step: the pair passes to its children swapped. */
|
|
30
|
+
.surf-timeline-item[data-current] {
|
|
31
|
+
background: var(--surf-recessed);
|
|
32
|
+
--surf-timeline-plane: var(--surf-recessed);
|
|
33
|
+
--surf-timeline-recessed: var(--surf-plane);
|
|
34
|
+
}
|
|
35
|
+
.surf-timeline-item[data-current] > * {
|
|
36
|
+
--surf-plane: var(--surf-timeline-plane);
|
|
37
|
+
--surf-recessed: var(--surf-timeline-recessed);
|
|
38
|
+
}
|
|
39
|
+
/* One width for every mark, a Spinner's too, so the titles line up. */
|
|
40
|
+
.surf-timeline-mark {
|
|
41
|
+
display: inline-flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
inline-size: var(--surf-size-icon-default);
|
|
45
|
+
block-size: 1lh;
|
|
46
|
+
color: var(--surf-status-neutral-fg);
|
|
47
|
+
}
|
|
48
|
+
.surf-timeline-body {
|
|
49
|
+
display: grid;
|
|
50
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
51
|
+
grid-template-areas:
|
|
52
|
+
'title title time'
|
|
53
|
+
'status description description'
|
|
54
|
+
'detail detail detail';
|
|
55
|
+
min-inline-size: 0;
|
|
56
|
+
}
|
|
57
|
+
.surf-timeline-title {
|
|
58
|
+
grid-area: title;
|
|
59
|
+
min-inline-size: 0;
|
|
60
|
+
color: var(--surf-ink);
|
|
61
|
+
font-weight: var(--surf-weight-medium);
|
|
62
|
+
overflow-wrap: anywhere;
|
|
63
|
+
}
|
|
64
|
+
.surf-timeline-time {
|
|
65
|
+
grid-area: time;
|
|
66
|
+
margin-inline-start: var(--surf-space-3);
|
|
67
|
+
color: var(--surf-ink-muted);
|
|
68
|
+
font-variant-numeric: tabular-nums;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
}
|
|
71
|
+
.surf-timeline-status {
|
|
72
|
+
grid-area: status;
|
|
73
|
+
margin-inline-end: var(--surf-space-2);
|
|
74
|
+
color: var(--surf-status-neutral-fg);
|
|
75
|
+
font-weight: var(--surf-weight-medium);
|
|
76
|
+
}
|
|
77
|
+
.surf-timeline-description {
|
|
78
|
+
grid-area: description;
|
|
79
|
+
min-inline-size: 0;
|
|
80
|
+
color: var(--surf-ink-muted);
|
|
81
|
+
overflow-wrap: anywhere;
|
|
82
|
+
}
|
|
83
|
+
/* The disclosure's label lines up with the title; open, its plane reaches out
|
|
84
|
+
into the item's padding. */
|
|
85
|
+
.surf-timeline-detail {
|
|
86
|
+
grid-area: detail;
|
|
87
|
+
margin-block-start: var(--surf-space-1);
|
|
88
|
+
margin-inline-start: calc(-1 * var(--surf-space-4));
|
|
89
|
+
}
|
|
90
|
+
.surf-timeline-item[data-tone='info']
|
|
91
|
+
:is(.surf-timeline-mark, .surf-timeline-status) {
|
|
92
|
+
color: var(--surf-status-info-fg);
|
|
93
|
+
}
|
|
94
|
+
.surf-timeline-item[data-tone='success']
|
|
95
|
+
:is(.surf-timeline-mark, .surf-timeline-status) {
|
|
96
|
+
color: var(--surf-status-success-fg);
|
|
97
|
+
}
|
|
98
|
+
.surf-timeline-item[data-tone='danger']
|
|
99
|
+
:is(.surf-timeline-mark, .surf-timeline-status) {
|
|
100
|
+
color: var(--surf-status-danger-fg);
|
|
101
|
+
}
|
|
102
|
+
.surf-timeline-item[data-tone='caution']
|
|
103
|
+
:is(.surf-timeline-mark, .surf-timeline-status) {
|
|
104
|
+
color: var(--surf-status-caution-fg);
|
|
105
|
+
}
|
|
106
|
+
.surf-timeline-item[data-tone='progress']
|
|
107
|
+
:is(.surf-timeline-mark, .surf-timeline-status) {
|
|
108
|
+
color: var(--surf-status-progress-fg);
|
|
109
|
+
}
|
|
110
|
+
/* Forced colors drop the plane, so a line marks the current step. */
|
|
111
|
+
@media (forced-colors: active) {
|
|
112
|
+
.surf-timeline-item[data-current] {
|
|
113
|
+
outline: 1px solid CanvasText;
|
|
114
|
+
outline-offset: -1px;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
package/presentation.css
CHANGED
|
@@ -5,11 +5,16 @@
|
|
|
5
5
|
@import './presentation/table.css';
|
|
6
6
|
@import './presentation/link.css';
|
|
7
7
|
@import './presentation/badge.css';
|
|
8
|
+
@import './presentation/kbd.css';
|
|
8
9
|
@import './presentation/card.css';
|
|
9
10
|
@import './presentation/avatar.css';
|
|
10
11
|
@import './presentation/list.css';
|
|
11
12
|
@import './presentation/inline-message.css';
|
|
13
|
+
@import './presentation/banner.css';
|
|
12
14
|
@import './presentation/code.css';
|
|
15
|
+
@import './presentation/copy-button.css';
|
|
16
|
+
@import './presentation/description-list.css';
|
|
17
|
+
@import './presentation/timeline.css';
|
|
13
18
|
@import './presentation/empty-state.css';
|
|
14
19
|
@import './presentation/breadcrumbs.css';
|
|
15
20
|
@import './presentation/separator.css';
|