@surflane/css 0.14.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 CHANGED
@@ -65,10 +65,21 @@
65
65
  var(--surf-interaction-active-bg)
66
66
  );
67
67
  }
68
- .surf-segment[aria-current='page'] {
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.14.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.14.0"
40
+ "@surflane/design-tokens": "^0.15.0"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
@@ -48,7 +48,7 @@
48
48
  }
49
49
  .surf-card-body {
50
50
  min-width: 0;
51
- overflow-wrap: anywhere;
51
+ overflow-wrap: break-word;
52
52
  }
53
53
  .surf-card-footer {
54
54
  display: flex;
@@ -33,7 +33,7 @@
33
33
  .surf-list-content {
34
34
  flex: 1;
35
35
  min-width: 0;
36
- overflow-wrap: anywhere;
36
+ overflow-wrap: break-word;
37
37
  }
38
38
  .surf-list-title {
39
39
  font-weight: var(--surf-weight-medium);
@@ -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);