@surflane/css 0.12.0 → 0.14.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 CHANGED
@@ -10,7 +10,7 @@
10
10
  justify-content: center;
11
11
  gap: 2px;
12
12
  height: var(--surf-control-height);
13
- border: 1px solid var(--surf-line);
13
+ border: 1px solid var(--surf-control-border);
14
14
  border-radius: var(--surf-radius-pill);
15
15
  background: transparent;
16
16
  color: var(--surf-ink-muted);
@@ -52,15 +52,21 @@
52
52
  }
53
53
  .surf-segment:hover,
54
54
  .surf-icon-button:hover {
55
- background: var(--surf-interaction-hover-bg);
55
+ background-image: linear-gradient(
56
+ var(--surf-interaction-hover-bg),
57
+ var(--surf-interaction-hover-bg)
58
+ );
56
59
  color: var(--surf-ink);
57
60
  }
58
61
  .surf-segment:active,
59
62
  .surf-icon-button:active {
60
- background: var(--surf-interaction-active-bg);
63
+ background-image: linear-gradient(
64
+ var(--surf-interaction-active-bg),
65
+ var(--surf-interaction-active-bg)
66
+ );
61
67
  }
62
68
  .surf-segment[aria-current='page'] {
63
- background: var(--surf-selected);
69
+ background-color: var(--surf-selected);
64
70
  color: var(--surf-ink);
65
71
  }
66
72
  .surf-segment:focus-visible,
@@ -93,10 +99,16 @@
93
99
  cursor: pointer;
94
100
  }
95
101
  .surf-theme-action:hover {
96
- background: var(--surf-interaction-hover-bg);
102
+ background-image: linear-gradient(
103
+ var(--surf-interaction-hover-bg),
104
+ var(--surf-interaction-hover-bg)
105
+ );
97
106
  }
98
107
  .surf-theme-action:active {
99
- background: var(--surf-interaction-active-bg);
108
+ background-image: linear-gradient(
109
+ var(--surf-interaction-active-bg),
110
+ var(--surf-interaction-active-bg)
111
+ );
100
112
  }
101
113
  .surf-theme-action:focus-visible {
102
114
  outline: var(--surf-focus-ring-width) solid var(--surf-interaction-focus);
@@ -110,11 +122,19 @@
110
122
  letter-spacing: var(--surf-type-caption-tracking);
111
123
  }
112
124
  .surf-control-group label:has(input:checked) .surf-segment {
113
- background: var(--surf-selected);
125
+ background-color: var(--surf-selected);
114
126
  color: var(--surf-ink);
115
127
  }
116
128
  .surf-control-group input:focus-visible + .surf-segment {
117
129
  outline: var(--surf-focus-ring-width) solid var(--surf-interaction-focus);
118
130
  outline-offset: var(--surf-focus-ring-offset);
119
131
  }
132
+ @media (forced-colors: active) {
133
+ .surf-segment[aria-current='page'],
134
+ .surf-control-group label:has(input:checked) .surf-segment {
135
+ background-color: Highlight;
136
+ color: HighlightText;
137
+ forced-color-adjust: none;
138
+ }
139
+ }
120
140
  }
@@ -70,12 +70,22 @@
70
70
  border-radius: var(--surf-radius-lg);
71
71
  background: var(--surf-surface);
72
72
  color: var(--surf-ink);
73
+ --surf-plane: var(--surf-surface);
74
+ --surf-recessed: var(--surf-canvas);
73
75
  }
74
- /* data-tone is the earlier name of data-surface. */
75
- .surf-surface:is([data-surface='canvas'], [data-tone='canvas']) {
76
+ .surf-surface[data-surface='canvas'] {
76
77
  background: var(--surf-canvas);
78
+ --surf-plane: var(--surf-canvas);
79
+ --surf-recessed: var(--surf-surface);
77
80
  border-radius: var(--surf-radius-sheet);
78
81
  }
82
+ /* Forced colors flatten every plane to Canvas, so a surface draws its edge. */
83
+ @media (forced-colors: active) {
84
+ .surf-surface {
85
+ outline: 1px solid CanvasText;
86
+ outline-offset: -1px;
87
+ }
88
+ }
79
89
  @media (max-width: 1100px) and (min-width: 761px) {
80
90
  .surf-grid:not([data-columns='1']) {
81
91
  --surf-layout-grid-columns: 2;
@@ -26,6 +26,9 @@
26
26
  .surf-page-header-description {
27
27
  max-width: var(--surf-layout-description-measure);
28
28
  }
29
+ .surf-page-header-description[data-lead] {
30
+ max-width: var(--surf-layout-reading-measure);
31
+ }
29
32
  .surf-page-header-actions {
30
33
  min-inline-size: 0;
31
34
  max-inline-size: 100%;
@@ -61,7 +61,7 @@
61
61
  line-height: var(--surf-type-caption-leading);
62
62
  letter-spacing: var(--surf-type-caption-tracking);
63
63
  }
64
- .surf-text[data-variant='table'] {
64
+ .surf-text[data-variant='compact'] {
65
65
  font-size: var(--surf-type-compact-size);
66
66
  line-height: var(--surf-type-compact-leading);
67
67
  letter-spacing: var(--surf-type-compact-tracking);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surflane/css",
3
- "version": "0.12.0",
3
+ "version": "0.14.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.12.0"
40
+ "@surflane/design-tokens": "^0.14.0"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
@@ -17,17 +17,17 @@
17
17
  overflow: visible;
18
18
  border: 1px solid var(--surf-line);
19
19
  border-radius: var(--surf-radius-full);
20
- background: var(--surf-surface);
20
+ background: var(--surf-recessed);
21
21
  color: var(--surf-ink-body);
22
22
  font: var(--surf-weight-medium) var(--surf-type-caption-size)/1
23
23
  var(--surf-font-body);
24
24
  letter-spacing: var(--surf-type-caption-tracking);
25
25
  }
26
- .surf-avatar:is([data-size='sm'], [data-size='small']) {
26
+ .surf-avatar[data-size='small'] {
27
27
  --surf-avatar-size: var(--surf-size-avatar-small);
28
28
  font-size: var(--surf-type-caption-size);
29
29
  }
30
- .surf-avatar:is([data-size='lg'], [data-size='large']) {
30
+ .surf-avatar[data-size='large'] {
31
31
  --surf-avatar-size: var(--surf-size-avatar-large);
32
32
  font-size: var(--surf-size-font-large);
33
33
  }
@@ -10,7 +10,7 @@
10
10
  align-items: center;
11
11
  gap: var(--surf-status-badge-gap);
12
12
  max-width: 100%;
13
- padding: 4px 9px;
13
+ padding: var(--surf-space-1) var(--surf-space-2);
14
14
  border: 0;
15
15
  border-radius: var(--surf-radius-pill);
16
16
  background: var(--surf-badge-neutral-bg);
@@ -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
+ }
@@ -12,9 +12,21 @@
12
12
  border-radius: var(--surf-radius-lg);
13
13
  background: var(--surf-surface);
14
14
  color: var(--surf-ink-body);
15
+ /* On the card, the canvas is the recessed step: tracks and read-only values show. */
16
+ --surf-plane: var(--surf-surface);
17
+ --surf-recessed: var(--surf-canvas);
15
18
  }
16
- .surf-card:is([data-surface='canvas'], [data-tone='canvas']) {
19
+ .surf-card[data-surface='canvas'] {
17
20
  background: var(--surf-canvas);
21
+ --surf-plane: var(--surf-canvas);
22
+ --surf-recessed: var(--surf-surface);
23
+ }
24
+ /* Forced colors flatten every plane to Canvas, so a card draws its edge. */
25
+ @media (forced-colors: active) {
26
+ .surf-card {
27
+ outline: 1px solid CanvasText;
28
+ outline-offset: -1px;
29
+ }
18
30
  }
19
31
  .surf-card-header {
20
32
  display: grid;
@@ -55,27 +55,4 @@
55
55
  white-space: pre-wrap;
56
56
  overflow-wrap: anywhere;
57
57
  }
58
- /* Copy results stay inside the button. */
59
- .surf-code-copy[data-copy-state='copied'] {
60
- color: var(--surf-status-success-fg);
61
- }
62
- .surf-code-copy[data-copy-state='failed'] {
63
- color: var(--surf-status-danger-fg);
64
- }
65
- /* The result fades in where the action was, and the action fades back. */
66
- .surf-code-copy[data-copy-used]
67
- :is(.surf-code-copy-icon, .surf-code-copy-label) {
68
- animation: surf-copy-fade var(--surf-duration-base) var(--surf-ease-out);
69
- }
70
- @keyframes surf-copy-fade {
71
- from {
72
- opacity: 0;
73
- }
74
- }
75
- @media (prefers-reduced-motion: reduce) {
76
- .surf-code-copy[data-copy-used]
77
- :is(.surf-code-copy-icon, .surf-code-copy-label) {
78
- animation: none;
79
- }
80
- }
81
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
+ }
@@ -21,6 +21,11 @@
21
21
  color: var(--surf-ink-muted);
22
22
  margin-bottom: var(--surf-space-3);
23
23
  }
24
+ /* The one larger glyph: it marks what the empty area is about. */
25
+ .surf-empty-icon > svg {
26
+ inline-size: var(--surf-space-8);
27
+ block-size: var(--surf-space-8);
28
+ }
24
29
  .surf-empty-title {
25
30
  font: var(--surf-weight-medium)
26
31
  var(--surf-type-section-size)/var(--surf-type-section-leading)
@@ -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
+ }
@@ -19,11 +19,16 @@
19
19
  border-radius: var(--surf-radius-md);
20
20
  min-width: 0;
21
21
  }
22
- .surf-list-item:is(:hover, :focus-within) {
23
- background: var(--surf-interaction-hover-bg);
22
+ /* Hover is a layer over the item's own fill, a selected one too. Keyboard focus
23
+ shows on the control that holds it, not as a hover. */
24
+ .surf-list-item:hover {
25
+ background-image: linear-gradient(
26
+ var(--surf-interaction-hover-bg),
27
+ var(--surf-interaction-hover-bg)
28
+ );
24
29
  }
25
30
  .surf-list-item[data-selected] {
26
- background: var(--surf-selected);
31
+ background-color: var(--surf-selected);
27
32
  }
28
33
  .surf-list-content {
29
34
  flex: 1;
@@ -48,14 +48,20 @@
48
48
  }
49
49
  /* Only a control that can act shows hover and pressed layers. */
50
50
  .surf-pagination-control:is(a, button):where([href], :enabled):hover {
51
- background: var(--surf-interaction-hover-bg);
51
+ background-image: linear-gradient(
52
+ var(--surf-interaction-hover-bg),
53
+ var(--surf-interaction-hover-bg)
54
+ );
52
55
  }
53
56
  /* Pressed layers show touch feedback in the control's shape instead. */
54
57
  .surf-pagination-control:is(a, button) {
55
58
  -webkit-tap-highlight-color: transparent;
56
59
  }
57
60
  .surf-pagination-control:is(a, button):where([href], :enabled):active {
58
- background: var(--surf-interaction-active-bg);
61
+ background-image: linear-gradient(
62
+ var(--surf-interaction-active-bg),
63
+ var(--surf-interaction-active-bg)
64
+ );
59
65
  }
60
66
  .surf-pagination-control[aria-disabled='true'] {
61
67
  opacity: var(--surf-control-disabled-opacity);
@@ -76,7 +82,9 @@
76
82
  }
77
83
  @media (forced-colors: active) {
78
84
  .surf-pagination .surf-pagination-control[aria-current='page'] {
79
- border-color: CanvasText;
85
+ background-color: Highlight;
86
+ color: HighlightText;
87
+ forced-color-adjust: none;
80
88
  }
81
89
  }
82
90
  .surf-pagination-summary {
@@ -44,12 +44,17 @@
44
44
  > .surf-table-body
45
45
  > .surf-table-row:nth-child(even)
46
46
  > * {
47
- background: var(--surf-surface);
47
+ background-color: var(--surf-recessed);
48
48
  }
49
- .surf-table-body > .surf-table-row:is(:hover, :focus-within) > * {
50
- background: var(--surf-interaction-hover-bg);
49
+ /* Hover is a layer over the row's own fill, a stripe or a selection. Keyboard focus
50
+ * shows on the control that holds it, not as a hover. */
51
+ .surf-table-body > .surf-table-row:hover > * {
52
+ background-image: linear-gradient(
53
+ var(--surf-interaction-hover-bg),
54
+ var(--surf-interaction-hover-bg)
55
+ );
51
56
  }
52
- /* A selected row takes the selected tone and a faint edge in the focus color, so it
57
+ /* A selected row takes the selected tone and an edge in the focus color, so it
53
58
  * reads as held. Each cell draws its share of the edge; inset shadows follow a
54
59
  * rounded row's corners. */
55
60
  .surf-table-body > .surf-table-row[data-selected] > * {
@@ -57,7 +62,7 @@
57
62
  --surf-table-edge-end: 0px;
58
63
  --surf-table-edge-top: 1px;
59
64
  --surf-table-edge-bottom: 1px;
60
- background: var(--surf-selected);
65
+ background-color: var(--surf-selected);
61
66
  box-shadow:
62
67
  inset 0 var(--surf-table-edge-top) var(--surf-selected-edge),
63
68
  inset 0 calc(-1 * var(--surf-table-edge-bottom)) var(--surf-selected-edge),
@@ -120,7 +125,11 @@
120
125
  }
121
126
  /* Compact density: 4px row padding and 2px between rows, for scanning many
122
127
  * records with a pointer. It overrides the component size's cell padding. */
123
- .surf-table[data-density='compact'] {
128
+ /* A table in a compact density scope is compact unless it says density='default'. */
129
+ .surf-table:is(
130
+ [data-density='compact'],
131
+ :where([data-ui-density='compact'] :not([data-density]))
132
+ ) {
124
133
  border-spacing: 0 2px;
125
134
  }
126
135
  /* Lined, grid and striped rows meet edge to edge, square, so lines and stripes
@@ -184,11 +193,17 @@
184
193
  :where([data-ui-size], [data-ui-size] *).surf-scroll-root.surf-table-bleed {
185
194
  --surf-table-bleed: var(--surf-ui-table-padding-x);
186
195
  }
187
- .surf-scroll-root.surf-table-bleed:has(.surf-table[data-density='compact']) {
196
+ .surf-scroll-root.surf-table-bleed:has(
197
+ .surf-table:is(
198
+ [data-density='compact'],
199
+ :where([data-ui-density='compact'] :not([data-density]))
200
+ )
201
+ ) {
188
202
  --surf-table-bleed: var(--surf-space-3);
189
203
  }
190
204
  /* A sticky header needs a Container with a bounded block size that scrolls
191
- * vertically. --table-surface matches the surface behind the table. */
205
+ * vertically. --surf-table-surface matches the surface behind the table; --table-surface
206
+ * is its earlier, deprecated name. */
192
207
  .surf-table[data-sticky-header]
193
208
  > .surf-table-head
194
209
  > .surf-table-row
@@ -196,32 +211,42 @@
196
211
  position: sticky;
197
212
  inset-block-start: 0;
198
213
  z-index: 1;
199
- background: var(--table-surface, var(--surf-canvas));
214
+ background: var(
215
+ --surf-table-surface,
216
+ var(--table-surface, var(--surf-plane))
217
+ );
200
218
  box-shadow: inset 0 -1px var(--surf-line);
201
219
  }
202
220
  .surf-table-truncate {
203
221
  display: inline-block;
204
- max-inline-size: 32ch;
222
+ max-inline-size: var(--surf-table-truncate-measure, 32ch);
205
223
  overflow: hidden;
206
224
  text-overflow: ellipsis;
207
225
  white-space: nowrap;
208
226
  vertical-align: bottom;
209
227
  }
210
228
  /* Loading, empty, error and permission messages span every column. */
211
- .surf-table-body > .surf-table-message-row:is(:hover, :focus-within) > * {
212
- background: none;
229
+ .surf-table-body > .surf-table-message-row:hover > * {
230
+ background-image: none;
213
231
  }
214
232
  }
215
233
  @layer surflane.sizes {
216
234
  /* Extra-small and icon buttons keep their own inset. */
217
- .surf-table-header
218
- > .surf-button:where(:not([data-size='xs'], [data-size^='icon'])) {
235
+ .surf-table-header > .surf-button:where(:not([data-size^='icon'])) {
219
236
  padding-inline: var(--surf-space-3);
220
237
  }
221
- .surf-table[data-density='compact'] .surf-table-cell {
238
+ .surf-table:is(
239
+ [data-density='compact'],
240
+ :where([data-ui-density='compact'] :not([data-density]))
241
+ )
242
+ .surf-table-cell {
222
243
  padding: var(--surf-space-1) var(--surf-space-3);
223
244
  }
224
- .surf-table[data-density='compact'] .surf-table-sort {
245
+ .surf-table:is(
246
+ [data-density='compact'],
247
+ :where([data-ui-density='compact'] :not([data-density]))
248
+ )
249
+ .surf-table-sort {
225
250
  height: auto;
226
251
  min-height: 28px;
227
252
  }
@@ -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';