@surflane/css 0.22.0 → 0.23.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.
@@ -39,6 +39,16 @@
39
39
  .surf-inline[data-justify='end'] {
40
40
  justify-content: flex-end;
41
41
  }
42
+ /* One line: the parts keep their size, and a layout inside gives way. */
43
+ .surf-inline[data-wrap='false'] {
44
+ flex-wrap: nowrap;
45
+ }
46
+ .surf-inline[data-wrap='false'] > * {
47
+ flex-shrink: 0;
48
+ }
49
+ .surf-inline[data-wrap='false'] > :is(.surf-inline, .surf-stack) {
50
+ flex-shrink: 1;
51
+ }
42
52
  .surf-grid {
43
53
  --surf-layout-grid-columns: 3;
44
54
  --surf-grid-inline-bleed: 0px;
@@ -75,6 +85,9 @@
75
85
  .surf-grid[data-min='tile'] {
76
86
  --surf-grid-column-min: var(--surf-layout-column-tile);
77
87
  }
88
+ .surf-grid[data-min='brief'] {
89
+ --surf-grid-column-min: var(--surf-layout-column-brief);
90
+ }
78
91
  .surf-grid[data-min='card'] {
79
92
  --surf-grid-column-min: var(--surf-layout-column-card);
80
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surflane/css",
3
- "version": "0.22.0",
3
+ "version": "0.23.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.22.0"
40
+ "@surflane/design-tokens": "^0.23.0"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
@@ -90,27 +90,27 @@
90
90
  position: absolute;
91
91
  inset-inline-end: 0;
92
92
  bottom: 0;
93
- width: max(8px, 25%);
94
- height: max(8px, 25%);
93
+ width: max(var(--surf-status-dot-size), 25%);
94
+ height: max(var(--surf-status-dot-size), 25%);
95
95
  box-sizing: border-box;
96
96
  border: 2px solid var(--surf-plane);
97
97
  border-radius: var(--surf-radius-full);
98
- background: var(--surf-status-success-fg);
98
+ background: var(--surf-status-success-mark);
99
99
  }
100
100
  .surf-avatar-status[data-tone='neutral'] {
101
- background: var(--surf-status-neutral-fg);
101
+ background: var(--surf-status-neutral-mark);
102
102
  }
103
103
  .surf-avatar-status[data-tone='info'] {
104
- background: var(--surf-status-info-fg);
104
+ background: var(--surf-status-info-mark);
105
105
  }
106
106
  .surf-avatar-status[data-tone='danger'] {
107
- background: var(--surf-status-danger-fg);
107
+ background: var(--surf-status-danger-mark);
108
108
  }
109
109
  .surf-avatar-status[data-tone='caution'] {
110
- background: var(--surf-status-caution-fg);
110
+ background: var(--surf-status-caution-mark);
111
111
  }
112
112
  .surf-avatar-status[data-tone='progress'] {
113
- background: var(--surf-status-progress-fg);
113
+ background: var(--surf-status-progress-mark);
114
114
  }
115
115
  .surf-avatar-status[data-live] {
116
116
  animation: surf-progress-pulse var(--surf-motion-pulse) ease-in-out infinite;
@@ -51,6 +51,65 @@
51
51
  color: var(--surf-status-info-fg);
52
52
  background: var(--surf-badge-info-bg);
53
53
  }
54
+ /* A status without words, for a state that text nearby names, such as a group's
55
+ count: a dot in the tone's color, flat like an avatar's status marker. */
56
+ .surf-status-dot {
57
+ display: inline-block;
58
+ flex: none;
59
+ vertical-align: middle;
60
+ inline-size: var(--surf-status-dot-size);
61
+ block-size: var(--surf-status-dot-size);
62
+ border-radius: var(--surf-radius-full);
63
+ background: var(--surf-status-neutral-mark);
64
+ }
65
+ .surf-status-dot[data-tone='info'] {
66
+ background: var(--surf-status-info-mark);
67
+ }
68
+ .surf-status-dot[data-tone='success'] {
69
+ background: var(--surf-status-success-mark);
70
+ }
71
+ .surf-status-dot[data-tone='danger'] {
72
+ background: var(--surf-status-danger-mark);
73
+ }
74
+ .surf-status-dot[data-tone='caution'] {
75
+ background: var(--surf-status-caution-mark);
76
+ }
77
+ .surf-status-dot[data-tone='progress'] {
78
+ background: var(--surf-status-progress-mark);
79
+ }
80
+ /* Live pulses while the state is under way, as an avatar's marker does. */
81
+ .surf-status-dot[data-live] {
82
+ animation: surf-status-dot-pulse var(--surf-motion-pulse) ease-in-out
83
+ infinite;
84
+ }
85
+ /* Attention blinks three times as the state arrives, such as waiting for an
86
+ answer, then holds still: blinking past five seconds would need a way to stop
87
+ it. */
88
+ .surf-status-dot[data-attention] {
89
+ animation: surf-status-dot-blink var(--surf-motion-pulse) steps(1, end) 3;
90
+ }
91
+ @keyframes surf-status-dot-pulse {
92
+ 50% {
93
+ opacity: 0.45;
94
+ }
95
+ }
96
+ @keyframes surf-status-dot-blink {
97
+ 50% {
98
+ opacity: 0.2;
99
+ }
100
+ }
101
+ @media (prefers-reduced-motion: reduce) {
102
+ .surf-status-dot:is([data-live], [data-attention]) {
103
+ animation: none;
104
+ }
105
+ }
106
+ /* Forced colors drop the fill, so the dot keeps a system color; the words
107
+ nearby, or its label, tell the states apart. */
108
+ @media (forced-colors: active) {
109
+ .surf-status-dot {
110
+ background: CanvasText;
111
+ }
112
+ }
54
113
  @media (forced-colors: active) {
55
114
  .surf-badge {
56
115
  border: 1px solid CanvasText;
@@ -64,6 +64,17 @@
64
64
  text-decoration: none;
65
65
  cursor: pointer;
66
66
  }
67
+ /* At most --surf-text-lines lines, the last ending with an ellipsis. A button
68
+ is a box of its own, so its text is clamped inside it. */
69
+ .surf-card-title[data-lines],
70
+ .surf-card-title[data-lines] > button.surf-card-action {
71
+ display: -webkit-box;
72
+ -webkit-box-orient: vertical;
73
+ -webkit-line-clamp: var(--surf-text-lines);
74
+ line-clamp: var(--surf-text-lines);
75
+ overflow: hidden;
76
+ overflow-wrap: anywhere;
77
+ }
67
78
  .surf-card-action::after {
68
79
  content: '';
69
80
  position: absolute;