@surflane/css 0.20.0 → 0.22.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.
@@ -63,6 +63,24 @@
63
63
  .surf-grid[data-columns='4'] {
64
64
  --surf-layout-grid-columns: 4;
65
65
  }
66
+ /* As many columns as the grid's own width fits, each at least its minimum, so a
67
+ grid in a panel or beside a sidebar reflows by the room it has, not by the
68
+ window. */
69
+ .surf-grid[data-columns='auto'] {
70
+ grid-template-columns: repeat(
71
+ auto-fill,
72
+ minmax(min(100%, var(--surf-grid-column-min)), 1fr)
73
+ );
74
+ }
75
+ .surf-grid[data-min='tile'] {
76
+ --surf-grid-column-min: var(--surf-layout-column-tile);
77
+ }
78
+ .surf-grid[data-min='card'] {
79
+ --surf-grid-column-min: var(--surf-layout-column-card);
80
+ }
81
+ .surf-grid[data-min='wide'] {
82
+ --surf-grid-column-min: var(--surf-layout-column-wide);
83
+ }
66
84
  .surf-surface {
67
85
  box-sizing: border-box;
68
86
  min-width: 0;
@@ -94,6 +94,15 @@
94
94
  .surf-text strong {
95
95
  font-weight: var(--surf-weight-medium);
96
96
  }
97
+ /* At most --surf-text-lines lines; the last one ends with an ellipsis. */
98
+ .surf-text[data-lines] {
99
+ display: -webkit-box;
100
+ -webkit-box-orient: vertical;
101
+ -webkit-line-clamp: var(--surf-text-lines);
102
+ line-clamp: var(--surf-text-lines);
103
+ overflow: hidden;
104
+ overflow-wrap: anywhere;
105
+ }
97
106
  .surf-prose {
98
107
  max-width: var(--surf-layout-reading);
99
108
  font-weight: var(--surf-weight-regular);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surflane/css",
3
- "version": "0.20.0",
3
+ "version": "0.22.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.20.0"
40
+ "@surflane/design-tokens": "^0.22.0"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
@@ -39,6 +39,53 @@
39
39
  object-fit: cover;
40
40
  border-radius: inherit;
41
41
  }
42
+ /* A category tints the plane under the initials and draws the edge in its color;
43
+ the initials keep the ink, so they read on every tint. */
44
+ .surf-avatar[data-category] {
45
+ border-color: var(--surf-avatar-category);
46
+ background: color-mix(
47
+ in oklab,
48
+ var(--surf-avatar-category) 24%,
49
+ var(--surf-plane)
50
+ );
51
+ color: var(--surf-ink);
52
+ }
53
+ .surf-avatar[data-category='1'] {
54
+ --surf-avatar-category: var(--surf-chart-category-1);
55
+ }
56
+ .surf-avatar[data-category='2'] {
57
+ --surf-avatar-category: var(--surf-chart-category-2);
58
+ }
59
+ .surf-avatar[data-category='3'] {
60
+ --surf-avatar-category: var(--surf-chart-category-3);
61
+ }
62
+ .surf-avatar[data-category='4'] {
63
+ --surf-avatar-category: var(--surf-chart-category-4);
64
+ }
65
+ .surf-avatar[data-category='5'] {
66
+ --surf-avatar-category: var(--surf-chart-category-5);
67
+ }
68
+ .surf-avatar[data-category='6'] {
69
+ --surf-avatar-category: var(--surf-chart-category-6);
70
+ }
71
+ .surf-avatar[data-category='7'] {
72
+ --surf-avatar-category: var(--surf-chart-category-7);
73
+ }
74
+ .surf-avatar[data-category='8'] {
75
+ --surf-avatar-category: var(--surf-chart-category-8);
76
+ }
77
+ .surf-avatar[data-category='9'] {
78
+ --surf-avatar-category: var(--surf-chart-category-9);
79
+ }
80
+ .surf-avatar[data-category='10'] {
81
+ --surf-avatar-category: var(--surf-chart-category-10);
82
+ }
83
+ .surf-avatar[data-category='11'] {
84
+ --surf-avatar-category: var(--surf-chart-category-11);
85
+ }
86
+ .surf-avatar[data-category='12'] {
87
+ --surf-avatar-category: var(--surf-chart-category-12);
88
+ }
42
89
  .surf-avatar-status {
43
90
  position: absolute;
44
91
  inset-inline-end: 0;
@@ -46,10 +93,39 @@
46
93
  width: max(8px, 25%);
47
94
  height: max(8px, 25%);
48
95
  box-sizing: border-box;
49
- border: 2px solid var(--surf-menu-background);
96
+ border: 2px solid var(--surf-plane);
50
97
  border-radius: var(--surf-radius-full);
51
98
  background: var(--surf-status-success-fg);
52
99
  }
100
+ .surf-avatar-status[data-tone='neutral'] {
101
+ background: var(--surf-status-neutral-fg);
102
+ }
103
+ .surf-avatar-status[data-tone='info'] {
104
+ background: var(--surf-status-info-fg);
105
+ }
106
+ .surf-avatar-status[data-tone='danger'] {
107
+ background: var(--surf-status-danger-fg);
108
+ }
109
+ .surf-avatar-status[data-tone='caution'] {
110
+ background: var(--surf-status-caution-fg);
111
+ }
112
+ .surf-avatar-status[data-tone='progress'] {
113
+ background: var(--surf-status-progress-fg);
114
+ }
115
+ .surf-avatar-status[data-live] {
116
+ animation: surf-progress-pulse var(--surf-motion-pulse) ease-in-out infinite;
117
+ }
118
+ @media (prefers-reduced-motion: reduce) {
119
+ .surf-avatar-status[data-live] {
120
+ animation: none;
121
+ }
122
+ }
123
+ /* Forced colors drop the fill, so the marker keeps a system color. */
124
+ @media (forced-colors: active) {
125
+ .surf-avatar-status {
126
+ background: CanvasText;
127
+ }
128
+ }
53
129
  .surf-avatar-fallback {
54
130
  display: flex;
55
131
  align-items: center;
@@ -5,10 +5,10 @@
5
5
  @layer surflane.components {
6
6
  /* Cards use one surface; children provide hierarchy without extra frames. */
7
7
  .surf-card {
8
- display: grid;
9
8
  /* Stretched to a taller neighbor in a row, a card keeps its parts at the top
10
- and leaves the extra height below them. */
11
- align-content: start;
9
+ and its footer at the bottom, so the footers of a row line up. */
10
+ display: flex;
11
+ flex-direction: column;
12
12
  gap: var(--surf-space-4);
13
13
  min-width: 0;
14
14
  padding: var(--surf-surface-padding, var(--surf-space-6));
@@ -46,6 +46,58 @@
46
46
  letter-spacing: var(--surf-type-section-tracking);
47
47
  overflow-wrap: anywhere;
48
48
  }
49
+ /* A card that opens something: its title's action stretches over it. The card is
50
+ the target, so the state layers and the focus ring draw on the card, and the
51
+ other controls on it sit above the stretch. */
52
+ .surf-card:has(.surf-card-action) {
53
+ position: relative;
54
+ }
55
+ .surf-card-action {
56
+ margin: 0;
57
+ padding: 0;
58
+ border: 0;
59
+ background: none;
60
+ color: inherit;
61
+ font: inherit;
62
+ letter-spacing: inherit;
63
+ text-align: inherit;
64
+ text-decoration: none;
65
+ cursor: pointer;
66
+ }
67
+ .surf-card-action::after {
68
+ content: '';
69
+ position: absolute;
70
+ inset: 0;
71
+ }
72
+ .surf-card-action:focus-visible {
73
+ outline: none;
74
+ }
75
+ .surf-card:has(.surf-card-action:hover) {
76
+ background-image: linear-gradient(
77
+ var(--surf-interaction-hover-bg),
78
+ var(--surf-interaction-hover-bg)
79
+ );
80
+ }
81
+ .surf-card:has(.surf-card-action:active) {
82
+ background-image: linear-gradient(
83
+ var(--surf-interaction-active-bg),
84
+ var(--surf-interaction-active-bg)
85
+ );
86
+ }
87
+ .surf-card:has(.surf-card-action:focus-visible) {
88
+ outline: var(--surf-focus-ring-width) solid var(--surf-interaction-focus);
89
+ outline-offset: var(--surf-focus-ring-offset);
90
+ }
91
+ /* No specificity, so a control's own position still wins. */
92
+ :where(
93
+ .surf-card:has(.surf-card-action)
94
+ :is(a[href], button, input, select, textarea, summary, [tabindex]):not(
95
+ .surf-card-action
96
+ )
97
+ ) {
98
+ position: relative;
99
+ z-index: 1;
100
+ }
49
101
  .surf-card-description {
50
102
  margin: 0;
51
103
  color: var(--surf-ink-body);
@@ -55,12 +107,17 @@
55
107
  overflow-wrap: break-word;
56
108
  }
57
109
  .surf-card-footer {
110
+ margin-block-start: auto;
58
111
  display: flex;
59
112
  flex-wrap: wrap;
60
113
  align-items: center;
61
114
  justify-content: space-between;
62
115
  gap: var(--surf-space-3);
63
116
  }
117
+ /* A bar, such as a Meter, takes a line of its own in the footer. */
118
+ .surf-card-footer > .surf-gauge {
119
+ flex: 1 1 100%;
120
+ }
64
121
  .surf-card-body > :first-child {
65
122
  margin-top: 0;
66
123
  }
@@ -47,37 +47,42 @@
47
47
  block-size: 1lh;
48
48
  color: var(--surf-status-neutral-fg);
49
49
  }
50
+ /* The title and its time share the first line; the status and description share
51
+ one under it. Anything else the event holds, such as a reply it quotes or the
52
+ tools a step ran, takes a line of its own across the event, in source order. */
50
53
  .surf-timeline-body {
51
54
  display: grid;
52
55
  grid-template-columns: auto minmax(0, 1fr) auto;
53
- grid-template-areas:
54
- 'title title time'
55
- 'status description description'
56
- 'detail detail detail';
56
+ min-inline-size: 0;
57
+ }
58
+ :where(.surf-timeline-body) > * {
59
+ grid-column: 1 / -1;
57
60
  min-inline-size: 0;
58
61
  }
59
62
  .surf-timeline-title {
60
- grid-area: title;
63
+ grid-row: 1;
64
+ grid-column: 1 / 3;
61
65
  min-inline-size: 0;
62
66
  color: var(--surf-ink);
63
67
  font-weight: var(--surf-weight-medium);
64
68
  overflow-wrap: anywhere;
65
69
  }
66
70
  .surf-timeline-time {
67
- grid-area: time;
71
+ grid-row: 1;
72
+ grid-column: 3;
68
73
  margin-inline-start: var(--surf-space-3);
69
74
  color: var(--surf-ink-muted);
70
75
  font-variant-numeric: tabular-nums;
71
76
  white-space: nowrap;
72
77
  }
73
78
  .surf-timeline-status {
74
- grid-area: status;
79
+ grid-column: 1;
75
80
  margin-inline-end: var(--surf-space-2);
76
81
  color: var(--surf-status-neutral-fg);
77
82
  font-weight: var(--surf-weight-medium);
78
83
  }
79
84
  .surf-timeline-description {
80
- grid-area: description;
85
+ grid-column: 2 / -1;
81
86
  min-inline-size: 0;
82
87
  color: var(--surf-ink-muted);
83
88
  overflow-wrap: anywhere;
@@ -85,7 +90,6 @@
85
90
  /* The disclosure's label lines up with the title; open, its plane reaches out
86
91
  into the item's padding. */
87
92
  .surf-timeline-detail {
88
- grid-area: detail;
89
93
  margin-block-start: var(--surf-space-1);
90
94
  margin-inline-start: calc(-1 * var(--surf-space-4));
91
95
  }