@redvars/peacock 3.15.0 → 3.17.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.
Files changed (157) hide show
  1. package/dist/assets/styles.css +1 -1
  2. package/dist/assets/styles.css.map +1 -1
  3. package/dist/assets/theme.js +19 -19
  4. package/dist/assets/tokens.css +1 -1
  5. package/dist/assets/tokens.css.map +1 -1
  6. package/dist/card-content.js +8 -7
  7. package/dist/card-content.js.map +1 -1
  8. package/dist/card.js +142 -98
  9. package/dist/card.js.map +1 -1
  10. package/dist/{chart-bar-D5dGFJfK.js → cartesian-chart-DgE4USyC.js} +529 -312
  11. package/dist/cartesian-chart-DgE4USyC.js.map +1 -0
  12. package/dist/chart-area.js +78 -0
  13. package/dist/chart-area.js.map +1 -0
  14. package/dist/chart-bar.js +283 -213
  15. package/dist/chart-bar.js.map +1 -1
  16. package/dist/{transform-DSwFSqzD.js → chart-base-C2qRMF48.js} +771 -102
  17. package/dist/chart-base-C2qRMF48.js.map +1 -0
  18. package/dist/chart-doughnut.js +55 -287
  19. package/dist/chart-doughnut.js.map +1 -1
  20. package/dist/chart-line.js +626 -0
  21. package/dist/chart-line.js.map +1 -0
  22. package/dist/chart-pie.js +637 -195
  23. package/dist/chart-pie.js.map +1 -1
  24. package/dist/code-editor.js +704 -131
  25. package/dist/code-editor.js.map +1 -1
  26. package/dist/code-group.js +188 -0
  27. package/dist/code-group.js.map +1 -0
  28. package/dist/code-highlighter.js +895 -257
  29. package/dist/code-highlighter.js.map +1 -1
  30. package/dist/custom-elements-jsdocs.json +2278 -677
  31. package/dist/custom-elements.json +13962 -3690
  32. package/dist/image.js +5 -1
  33. package/dist/image.js.map +1 -1
  34. package/dist/index.js +8 -7
  35. package/dist/index.js.map +1 -1
  36. package/dist/loader-full.js +1 -1
  37. package/dist/loader.js +9 -3
  38. package/dist/loader.js.map +1 -1
  39. package/dist/{is-dark-mode-DOcaw4Yq.js → observe-theme-change-DCifz1uv.js} +2 -6
  40. package/dist/observe-theme-change-DCifz1uv.js.map +1 -0
  41. package/dist/pagination.js +408 -110
  42. package/dist/pagination.js.map +1 -1
  43. package/dist/path-CJ0Arqcy.js +166 -0
  44. package/dist/path-CJ0Arqcy.js.map +1 -0
  45. package/dist/snackbar.js +89 -34
  46. package/dist/snackbar.js.map +1 -1
  47. package/dist/src/__internal/chart/cartesian-chart.d.ts +80 -0
  48. package/dist/src/__internal/chart/chart-base.d.ts +113 -0
  49. package/dist/src/__internal/chart/paths.d.ts +5 -0
  50. package/dist/src/__internal/chart/types.d.ts +42 -0
  51. package/dist/src/card/card-content.d.ts +2 -3
  52. package/dist/src/card/card.d.ts +31 -17
  53. package/dist/src/chart-area/chart-area.d.ts +54 -0
  54. package/dist/src/chart-area/index.d.ts +1 -0
  55. package/dist/src/chart-bar/chart-bar.d.ts +44 -33
  56. package/dist/src/chart-bar/index.d.ts +0 -1
  57. package/dist/src/chart-doughnut/chart-doughnut.d.ts +33 -39
  58. package/dist/src/chart-line/chart-line.d.ts +69 -0
  59. package/dist/src/chart-line/index.d.ts +1 -0
  60. package/dist/src/chart-pie/chart-pie.d.ts +63 -28
  61. package/dist/src/code-editor/code-editor.d.ts +52 -13
  62. package/dist/src/code-editor/editor-theme.d.ts +60 -0
  63. package/dist/src/code-highlighter/code-group.d.ts +52 -0
  64. package/dist/src/code-highlighter/code-highlighter.d.ts +122 -15
  65. package/dist/src/code-highlighter/index.d.ts +1 -0
  66. package/dist/src/code-highlighter/line-ranges.d.ts +24 -0
  67. package/dist/src/code-highlighter/local.d.ts +4 -1
  68. package/dist/src/code-highlighter/token-colors.d.ts +8 -0
  69. package/dist/src/index.d.ts +4 -2
  70. package/dist/src/pagination/page-items.d.ts +14 -0
  71. package/dist/src/pagination/pagination.d.ts +46 -7
  72. package/dist/src/snackbar/snackbar.d.ts +13 -1
  73. package/dist/src/table/table.d.ts +125 -27
  74. package/dist/src/toolbar/toolbar.d.ts +56 -51
  75. package/dist/table.js +1007 -338
  76. package/dist/table.js.map +1 -1
  77. package/dist/test/chart.test.d.ts +1 -0
  78. package/dist/test/code-highlighter.test.d.ts +1 -0
  79. package/dist/test/pagination.test.d.ts +1 -0
  80. package/dist/test/table.test.d.ts +1 -0
  81. package/dist/token-colors-0TFHWbcq.js +81 -0
  82. package/dist/token-colors-0TFHWbcq.js.map +1 -0
  83. package/dist/toolbar.js +195 -184
  84. package/dist/toolbar.js.map +1 -1
  85. package/dist/tsconfig.tsbuildinfo +1 -1
  86. package/package.json +1 -2
  87. package/readme.md +7 -6
  88. package/scss/_code-block.scss +139 -0
  89. package/scss/tokens.css +24 -0
  90. package/src/__internal/chart/cartesian-chart.ts +404 -0
  91. package/src/__internal/chart/chart-base.scss +252 -0
  92. package/src/__internal/chart/chart-base.ts +474 -0
  93. package/src/__internal/chart/paths.ts +28 -0
  94. package/src/__internal/chart/types.ts +49 -0
  95. package/src/card/card-content.ts +12 -9
  96. package/src/card/card.scss +66 -54
  97. package/src/card/card.ts +109 -73
  98. package/src/chart-area/chart-area.ts +82 -0
  99. package/src/chart-area/index.ts +1 -0
  100. package/src/chart-bar/chart-bar.ts +336 -250
  101. package/src/chart-bar/index.ts +0 -1
  102. package/src/chart-doughnut/chart-doughnut.ts +62 -262
  103. package/src/chart-doughnut/demo/index.html +14 -22
  104. package/src/chart-line/chart-line.scss +25 -0
  105. package/src/chart-line/chart-line.ts +346 -0
  106. package/src/chart-line/index.ts +1 -0
  107. package/src/chart-pie/chart-pie.scss +35 -16
  108. package/src/chart-pie/chart-pie.ts +282 -188
  109. package/src/chart-pie/demo/index.html +13 -21
  110. package/src/code-editor/code-editor.scss +132 -36
  111. package/src/code-editor/code-editor.ts +308 -88
  112. package/src/code-editor/demo/index.html +39 -12
  113. package/src/code-editor/editor-theme.ts +213 -0
  114. package/src/code-highlighter/code-group.scss +34 -0
  115. package/src/code-highlighter/code-group.ts +173 -0
  116. package/src/code-highlighter/code-highlighter.scss +226 -111
  117. package/src/code-highlighter/code-highlighter.ts +554 -199
  118. package/src/code-highlighter/demo/index.html +68 -4
  119. package/src/code-highlighter/index.ts +1 -0
  120. package/src/code-highlighter/line-ranges.ts +81 -0
  121. package/src/code-highlighter/local.ts +9 -3
  122. package/src/code-highlighter/token-colors.ts +42 -0
  123. package/src/index.ts +4 -2
  124. package/src/loader.ts +8 -2
  125. package/src/pagination/page-items.ts +50 -0
  126. package/src/pagination/pagination.scss +159 -44
  127. package/src/pagination/pagination.ts +275 -74
  128. package/src/snackbar/demo/index.html +39 -4
  129. package/src/snackbar/snackbar.scss +27 -10
  130. package/src/snackbar/snackbar.ts +80 -37
  131. package/src/table/table.scss +337 -109
  132. package/src/table/table.ts +812 -272
  133. package/src/toolbar/toolbar-colors.scss +6 -7
  134. package/src/toolbar/toolbar.scss +35 -106
  135. package/src/toolbar/toolbar.ts +180 -80
  136. package/dist/array-D5vjT2Xm.js +0 -14
  137. package/dist/array-D5vjT2Xm.js.map +0 -1
  138. package/dist/chart-bar-D5dGFJfK.js.map +0 -1
  139. package/dist/chart-stacked-bar.js +0 -403
  140. package/dist/chart-stacked-bar.js.map +0 -1
  141. package/dist/copy-to-clipboard-upGx-Ueo.js +0 -39
  142. package/dist/copy-to-clipboard-upGx-Ueo.js.map +0 -1
  143. package/dist/is-dark-mode-DOcaw4Yq.js.map +0 -1
  144. package/dist/pie-Dz0IDiPt.js +0 -537
  145. package/dist/pie-Dz0IDiPt.js.map +0 -1
  146. package/dist/pierre-dark-DFWl0m-C.js +0 -4
  147. package/dist/pierre-dark-DFWl0m-C.js.map +0 -1
  148. package/dist/pierre-light-BEkAPImt.js +0 -4
  149. package/dist/pierre-light-BEkAPImt.js.map +0 -1
  150. package/dist/src/chart-bar/chart-stacked-bar.d.ts +0 -78
  151. package/dist/src/code-highlighter/constants.d.ts +0 -1
  152. package/dist/transform-DSwFSqzD.js.map +0 -1
  153. package/src/chart-bar/chart-bar.scss +0 -58
  154. package/src/chart-bar/chart-stacked-bar.ts +0 -398
  155. package/src/chart-doughnut/chart-donut.scss +0 -37
  156. package/src/code-highlighter/constants.ts +0 -117
  157. /package/dist/test/{chart-bar.test.d.ts → card.test.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { LitElement, html, nothing } from 'lit';
2
- import { property, state } from 'lit/decorators.js';
2
+ import { property, query, state } from 'lit/decorators.js';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
4
  import styles from './snackbar.scss';
5
5
  import IndividualComponent from '@/IndividualComponent.js';
@@ -12,6 +12,11 @@ type SnackbarCloseReason = 'timeout' | 'dismiss' | 'action' | 'programmatic';
12
12
  * @rawTag snackbar
13
13
  * @summary Snackbars provide brief messages about app processes at the bottom of the screen.
14
14
  *
15
+ * @overview
16
+ * <p>An open snackbar is shown as a manual popover, so it renders in the browser's top layer, above sticky
17
+ * headers, app bars and open modals whatever their <code>z-index</code>. Opening it again while it is
18
+ * visible brings it back in front of anything opened since.</p>
19
+ *
15
20
  * @cssprop --snackbar-container-color - Container color for the snackbar.
16
21
  * @cssprop --snackbar-label-text-color - Label text color for the snackbar.
17
22
  * @cssprop --snackbar-action-text-color - Action text color.
@@ -19,7 +24,7 @@ type SnackbarCloseReason = 'timeout' | 'dismiss' | 'action' | 'programmatic';
19
24
  * @cssprop --snackbar-border-radius - Border radius of the snackbar surface.
20
25
  * @cssprop --snackbar-offset-inline - Inline offset from viewport edges.
21
26
  * @cssprop --snackbar-offset-bottom - Bottom offset from viewport edge.
22
- * @cssprop --snackbar-z-index - Stacking order for the snackbar.
27
+ * @cssprop --snackbar-z-index - Stacking order for the snackbar in browsers without the Popover API.
23
28
  *
24
29
  * @example
25
30
  * ```html
@@ -60,6 +65,9 @@ export class Snackbar extends LitElement {
60
65
  /** True while the exit animation is running before the snackbar fully closes. */
61
66
  @state() private dismissing = false;
62
67
 
68
+ /** The positioned layer that is shown in the top layer as a popover. */
69
+ @query('.layer') private layer?: HTMLElement;
70
+
63
71
  // ── Private fields ────────────────────────────────────────────────────────
64
72
 
65
73
  /** Timer handle for the auto-hide timeout. */
@@ -68,9 +76,7 @@ export class Snackbar extends LitElement {
68
76
  /** Timer handle for the exit animation duration timeout. */
69
77
  private exitTimer: ReturnType<typeof setTimeout> | null = null;
70
78
 
71
- private readonly handleGlobalSnackbarOpen = (
72
- event: Event,
73
- ) => {
79
+ private readonly handleGlobalSnackbarOpen = (event: Event) => {
74
80
  const { source } = (event as CustomEvent<{ source?: Snackbar }>).detail;
75
81
  if (source && source !== this) {
76
82
  this.hide();
@@ -92,10 +98,15 @@ export class Snackbar extends LitElement {
92
98
  );
93
99
  this.clearExitTimer();
94
100
  this.clearTimer();
101
+ this.syncLayer();
95
102
  super.disconnectedCallback();
96
103
  }
97
104
 
98
105
  protected updated(changedProperties: Map<string, unknown>) {
106
+ if (changedProperties.has('open') || changedProperties.has('preview')) {
107
+ this.syncLayer();
108
+ }
109
+
99
110
  if (changedProperties.has('open')) {
100
111
  if (this.open) {
101
112
  document.dispatchEvent(
@@ -119,6 +130,8 @@ export class Snackbar extends LitElement {
119
130
  return;
120
131
  }
121
132
 
133
+ // Already open: move it back to the top of the top layer, above anything opened since.
134
+ this.syncLayer(true);
122
135
  this.scheduleAutoHide();
123
136
  }
124
137
 
@@ -191,6 +204,30 @@ export class Snackbar extends LitElement {
191
204
  }
192
205
  }
193
206
 
207
+ /**
208
+ * Shows the layer in the top layer while the snackbar is open, and hides it otherwise.
209
+ * With `raise`, an already showing layer is shown again so it moves above newer top-layer elements.
210
+ */
211
+ private syncLayer(raise = false) {
212
+ const { layer } = this;
213
+ if (
214
+ !layer ||
215
+ typeof layer.showPopover !== 'function' ||
216
+ !layer.hasAttribute('popover')
217
+ ) {
218
+ return;
219
+ }
220
+
221
+ const shouldShow = this.open && !this.preview && this.isConnected;
222
+ const showing = layer.matches(':popover-open');
223
+ if (showing && (!shouldShow || raise)) {
224
+ layer.hidePopover();
225
+ }
226
+ if (shouldShow && (!showing || raise)) {
227
+ layer.showPopover();
228
+ }
229
+ }
230
+
194
231
  private scheduleAutoHide() {
195
232
  this.clearTimer();
196
233
  if (!this.open || this.duration <= 0) {
@@ -207,39 +244,45 @@ export class Snackbar extends LitElement {
207
244
  this.actionLabel || this.showCloseIcon ? 'alert' : 'status';
208
245
 
209
246
  return html`
210
- <div
211
- class=${classMap({
212
- snackbar: true,
213
- open: !this.preview && this.open,
214
- preview: this.preview,
215
- dismissing: this.dismissing,
216
- multiline: this.multiline,
217
- })}
218
- role=${liveRole}
219
- aria-live="polite"
220
- @animationend=${this.handleAnimationEnd}
221
- >
222
- <div class="label">
223
- <slot>${this.message}</slot>
247
+ <div class="layer" popover=${this.preview ? nothing : 'manual'}>
248
+ <div
249
+ class=${classMap({
250
+ snackbar: true,
251
+ open: !this.preview && this.open,
252
+ preview: this.preview,
253
+ dismissing: this.dismissing,
254
+ multiline: this.multiline,
255
+ })}
256
+ role=${liveRole}
257
+ aria-live="polite"
258
+ @animationend=${this.handleAnimationEnd}
259
+ >
260
+ <div class="label">
261
+ <slot>${this.message}</slot>
262
+ </div>
263
+
264
+ ${this.actionLabel
265
+ ? html`<wc-button
266
+ class="action"
267
+ variant="text"
268
+ size="sm"
269
+ @click=${this.handleActionClick}
270
+ >
271
+ ${this.actionLabel}
272
+ </wc-button>`
273
+ : nothing}
274
+ ${this.showCloseIcon
275
+ ? html`<wc-icon-button
276
+ class="close"
277
+ variant="text"
278
+ size="sm"
279
+ aria-label="Dismiss notification"
280
+ @click=${this.handleCloseClick}
281
+ >
282
+ <wc-icon name="close"></wc-icon>
283
+ </wc-icon-button>`
284
+ : nothing}
224
285
  </div>
225
-
226
- ${this.actionLabel
227
- ? html`<wc-button class="action" variant='text' size='sm' @click=${this.handleActionClick}>
228
- ${this.actionLabel}
229
- </wc-button>`
230
- : nothing}
231
-
232
- ${this.showCloseIcon
233
- ? html`<wc-icon-button
234
- class="close"
235
- variant='text'
236
- size='sm'
237
- aria-label="Dismiss notification"
238
- @click=${this.handleCloseClick}
239
- >
240
- <wc-icon name="close"></wc-icon>
241
- </wc-icon-button>`
242
- : nothing}
243
286
  </div>
244
287
  `;
245
288
  }
@@ -5,164 +5,392 @@
5
5
  :host {
6
6
  display: block;
7
7
  height: 100%;
8
- min-height: 20em;
8
+ min-width: 0;
9
+ --table-row-height: 3rem;
9
10
  --table-border-color: var(--color-outline-variant);
10
- --table-border: 1px solid var(--table-border-color);
11
- --table-col-content-padding: var(--spacing-150, 0.75rem)
12
- var(--spacing-200, 1rem);
11
+ --table-cell-padding-inline: var(--spacing-200, 1rem);
12
+ --table-header-background: var(--color-surface, #fff);
13
+ --table-background: var(--color-surface, #fff);
14
+ --_table-checkbox-width: 3rem;
15
+ --_table-edge-shadow: color-mix(in srgb, var(--color-shadow) 14%, transparent);
16
+ }
17
+
18
+ :host([density='compact']) {
19
+ --table-row-height: 2.25rem;
20
+ --table-cell-padding-inline: var(--spacing-150, 0.75rem);
21
+ }
22
+
23
+ :host([density='comfortable']) {
24
+ --table-row-height: 3.5rem;
13
25
  }
14
26
 
15
27
  .table {
28
+ position: relative;
16
29
  height: 100%;
17
30
  display: flex;
18
31
  flex-direction: column;
19
- background: var(--color-surface, #fff);
32
+ background: var(--table-background);
33
+ color: var(--color-on-surface);
20
34
 
21
35
  @include mixin.get-typography-not-important('body-medium');
36
+ }
37
+
38
+ .table-scroll-container {
39
+ // Wide rows scroll inside the table instead of widening the page around it.
40
+ contain: inline-size;
41
+ position: relative;
42
+ flex: 1 1 auto;
43
+ min-height: 0;
44
+ overflow: auto;
45
+ outline: none;
46
+ }
47
+
48
+ // ── Rows and cells ──────────────────────────────────────────────────────────
22
49
 
23
- .table-scroll-container {
24
- position: relative;
25
- overflow: auto;
26
- height: 100%;
50
+ .row {
51
+ --_cell-background: var(--table-background);
52
+
53
+ display: flex;
54
+ width: max-content;
55
+ // Fill the table when the columns are narrower, so the row dividers reach the edge.
56
+ min-width: max(100%, var(--_row-min-width, 0rem));
57
+ }
58
+
59
+ .columns {
60
+ display: flex;
61
+ }
62
+
63
+ .scroll-group {
64
+ flex: 1 0 auto;
65
+ // Keeps positioned cell content (tags, buttons) below the pinned columns.
66
+ isolation: isolate;
67
+
68
+ > .cell:last-child {
69
+ flex-grow: 1;
70
+ }
71
+ }
72
+
73
+ .pinned-group {
74
+ position: sticky;
75
+ z-index: 1;
76
+ flex: none;
77
+ }
78
+
79
+ .pinned-group-start {
80
+ inset-inline-start: 0;
81
+ }
82
+
83
+ .pinned-group-end {
84
+ inset-inline-end: 0;
85
+ }
86
+
87
+ .cell {
88
+ position: relative;
89
+ display: flex;
90
+ align-items: center;
91
+ flex-shrink: 0;
92
+ min-width: 0;
93
+ min-height: var(--table-row-height);
94
+ padding-inline: var(--table-cell-padding-inline);
95
+ background: var(--_cell-background);
96
+ border-bottom: 1px solid var(--table-border-color);
97
+
98
+ &:focus-visible {
99
+ outline: 2px solid var(--color-primary);
100
+ outline-offset: -2px;
27
101
  }
28
102
 
29
- .empty-table {
30
- height: 80%;
31
- display: flex;
32
- align-items: center;
103
+ &.align-start {
104
+ justify-content: flex-start;
105
+ text-align: start;
106
+ }
107
+
108
+ &.align-center {
33
109
  justify-content: center;
110
+ text-align: center;
111
+ }
34
112
 
35
- .empty-state {
36
- width: 10rem;
37
- }
113
+ &.align-end {
114
+ justify-content: flex-end;
115
+ text-align: end;
116
+ }
117
+
118
+ &.numeric {
119
+ font-variant-numeric: tabular-nums;
120
+ }
121
+
122
+ &.cell-checkbox {
123
+ width: var(--_table-checkbox-width);
124
+ padding-inline: 0;
38
125
  }
126
+ }
127
+
128
+ .cell-text {
129
+ min-width: 0;
130
+ overflow: hidden;
131
+ white-space: nowrap;
132
+ text-overflow: ellipsis;
133
+
134
+ .wrap & {
135
+ padding-block: var(--spacing-100, 0.5rem);
136
+ white-space: normal;
137
+ overflow-wrap: anywhere;
138
+ }
139
+ }
140
+
141
+ .cell-template {
142
+ display: flex;
143
+ align-items: center;
144
+ min-width: 0;
145
+ max-width: 100%;
146
+ }
147
+
148
+ // ── Header ──────────────────────────────────────────────────────────────────
149
+
150
+ .header {
151
+ position: sticky;
152
+ top: 0;
153
+ z-index: 3;
39
154
 
40
- wc-pagination {
41
- border-top: 1px solid var(--table-border-color);
155
+ .row {
156
+ --_cell-background: var(--table-header-background);
42
157
  }
43
158
 
44
- &.horizontal-scrolled {
45
- .fixed-columns::after {
46
- box-shadow: 10px 0 20px -20px var(--color-outline) inset;
47
- content: ' ';
48
- height: 100%;
49
- position: absolute;
50
- top: 0;
51
- right: -20px;
52
- width: 20px;
159
+ .cell {
160
+ color: var(--color-on-surface-variant);
161
+
162
+ @include mixin.get-typography-not-important('label-large');
163
+
164
+ &.sortable {
165
+ padding-inline: 0;
53
166
  }
167
+
168
+ &.sorted {
169
+ color: var(--color-on-surface);
170
+ }
171
+ }
172
+
173
+ .header-label {
174
+ min-width: 0;
175
+ overflow: hidden;
176
+ white-space: nowrap;
177
+ text-overflow: ellipsis;
54
178
  }
55
179
  }
56
180
 
57
- .row {
181
+ .sort-button {
182
+ @include mixin.reset-button-styles;
183
+
58
184
  display: flex;
59
- box-sizing: border-box;
60
- width: max-content;
61
- min-width: 100%;
185
+ align-items: center;
186
+ justify-content: inherit;
187
+ gap: var(--spacing-050, 0.25rem);
188
+ align-self: stretch;
189
+ width: 100%;
190
+ min-width: 0;
191
+ padding-inline: var(--table-cell-padding-inline);
192
+ color: inherit;
193
+ font: inherit;
194
+ letter-spacing: inherit;
195
+ text-align: inherit;
196
+ cursor: pointer;
197
+
198
+ .align-end & {
199
+ flex-direction: row-reverse;
200
+ }
62
201
 
63
- .columns-container {
64
- display: flex;
202
+ &:hover {
203
+ background: color-mix(in srgb, var(--color-on-surface) 6%, transparent);
65
204
  }
66
205
 
67
- .col {
68
- margin: 0;
69
- color: var(--color-on-surface);
70
- flex-shrink: 0;
206
+ &:focus-visible {
207
+ outline: 2px solid var(--color-primary);
208
+ outline-offset: -2px;
209
+ }
210
+ }
71
211
 
72
- .col-content {
73
- display: flex;
74
- align-items: center;
75
- height: 100%;
212
+ .sort-icon {
213
+ flex: none;
214
+ --icon-size: 1.125rem;
215
+ font-size: 1.125rem;
216
+ opacity: 0;
217
+ transition: opacity var(--duration-short2, 100ms) ease;
76
218
 
77
- .col-text {
78
- padding: var(--table-col-content-padding);
79
- flex: 1;
80
- overflow: hidden;
81
- white-space: nowrap;
82
- text-overflow: ellipsis;
83
- }
219
+ .sort-button:hover &,
220
+ .sort-button:focus-visible & {
221
+ opacity: 0.6;
222
+ }
84
223
 
85
- .col-template {
86
- width: 100%;
87
- }
224
+ .sorted & {
225
+ opacity: 1;
226
+ }
227
+ }
88
228
 
89
- .col-action {
90
- --button-container-shape: 0;
91
- }
229
+ .loading-bar {
230
+ position: absolute;
231
+ inset-inline: 0;
232
+ bottom: 0;
233
+ --progress-height: 2px;
234
+ }
92
235
 
93
- .checkbox {
94
- padding: 0 var(--spacing-100, 0.5rem);
95
- }
96
- }
236
+ // ── Body ────────────────────────────────────────────────────────────────────
97
237
 
98
- &.center .col-content {
99
- justify-content: center;
238
+ .body {
239
+ .cell {
240
+ cursor: pointer;
241
+
242
+ &.cell-checkbox {
243
+ cursor: default;
100
244
  }
245
+ }
101
246
 
102
- &:last-child {
103
- flex: 1;
247
+ .row:hover {
248
+ --_cell-background: var(--color-surface-container-low);
249
+ }
250
+
251
+ .row.selected {
252
+ --_cell-background: color-mix(
253
+ in srgb,
254
+ var(--color-secondary-container) 55%,
255
+ var(--table-background)
256
+ );
257
+
258
+ > .columns:first-child > .cell:first-child {
259
+ box-shadow: inset 2px 0 0 var(--color-primary);
104
260
  }
105
261
  }
106
262
 
107
- .fixed-columns {
108
- position: sticky;
109
- left: 0;
263
+ .row.selected:hover {
264
+ --_cell-background: var(--color-secondary-container);
110
265
  }
111
266
 
112
- .scrollable-columns {
113
- flex: 0 0 auto;
267
+ .skeleton-row .cell {
268
+ cursor: default;
114
269
  }
115
270
  }
116
271
 
117
- .header {
118
- position: sticky;
272
+ // The footer's top border already closes the table, so the last row needs no divider.
273
+ .has-footer .body .row:last-child .cell {
274
+ border-bottom-color: transparent;
275
+ }
276
+
277
+ :host([striped]) .body .row:nth-child(even):not(.selected) {
278
+ --_cell-background: color-mix(
279
+ in srgb,
280
+ var(--color-surface-container) 45%,
281
+ var(--table-background)
282
+ );
283
+
284
+ &:hover {
285
+ --_cell-background: var(--color-surface-container-low);
286
+ }
287
+ }
288
+
289
+ .skeleton-bar {
290
+ block-size: 0.75rem;
291
+ max-inline-size: 100%;
292
+ --skeleton-container-shape: var(--shape-corner-extra-small);
293
+
294
+ .cell-checkbox & {
295
+ inline-size: 1.125rem;
296
+ block-size: 1.125rem;
297
+ }
298
+ }
299
+
300
+ .checkbox {
301
+ display: flex;
302
+ }
303
+
304
+ // ── Edge shadows on pinned columns ──────────────────────────────────────────
305
+
306
+ .pinned-group-start::after,
307
+ .pinned-group-end::before {
308
+ content: '';
309
+ position: absolute;
119
310
  top: 0;
311
+ bottom: 0;
312
+ width: 0.75rem;
313
+ pointer-events: none;
314
+ opacity: 0;
315
+ transition: opacity var(--duration-short4, 200ms) ease;
316
+ }
317
+
318
+ .pinned-group-start::after {
319
+ inset-inline-end: -0.75rem;
320
+ background: linear-gradient(to right, var(--_table-edge-shadow), transparent);
321
+ }
120
322
 
121
- @include mixin.get-typography-not-important('label-medium');
323
+ .pinned-group-end::before {
324
+ inset-inline-start: -0.75rem;
325
+ background: linear-gradient(to left, var(--_table-edge-shadow), transparent);
326
+ }
327
+
328
+ .scrolled-from-start .pinned-group-start::after,
329
+ .scrolled-from-end .pinned-group-end::before {
330
+ opacity: 1;
331
+ }
122
332
 
123
- .col {
124
- background: var(--color-surface-variant, #f4f4f4);
333
+ // ── Selection bar ───────────────────────────────────────────────────────────
125
334
 
126
- &.sort {
127
- background: var(--color-secondary-container, #e8eaf6);
128
- }
335
+ .bulk-bar {
336
+ position: absolute;
337
+ top: 0;
338
+ inset-inline: var(--_table-checkbox-width) 0;
339
+ z-index: 4;
340
+ display: flex;
341
+ align-items: center;
342
+ gap: var(--spacing-100, 0.5rem);
343
+ height: var(--table-row-height);
344
+ padding-inline: var(--spacing-100, 0.5rem) var(--spacing-100, 0.5rem);
345
+ background: var(--color-secondary-container);
346
+ color: var(--color-on-secondary-container);
347
+ border-bottom: 1px solid var(--table-border-color);
348
+ // One line at any width: on a narrow table the actions scroll instead of wrapping.
349
+ overflow-x: auto;
350
+ scrollbar-width: none;
351
+ white-space: nowrap;
352
+
353
+ @include mixin.get-typography-not-important('label-large');
354
+
355
+ > *,
356
+ ::slotted(*) {
357
+ flex: none;
129
358
  }
130
359
  }
131
360
 
132
- .body {
133
- .row {
134
- .col {
135
- cursor: pointer;
136
- background: var(--color-surface, #fff);
137
- border-bottom: 1px solid var(--color-surface-variant, #f4f4f4);
138
-
139
- &.col-checkbox .col-content {
140
- border: 0;
141
- }
142
-
143
- .col-content {
144
- border: 2px solid transparent;
145
- border-bottom: 1px solid transparent;
146
-
147
- .col-text {
148
- text-wrap: wrap;
149
- }
150
- }
151
-
152
- &:focus {
153
- outline: none;
154
- border-bottom-color: var(--color-primary);
155
-
156
- .col-content {
157
- border-color: var(--color-primary);
158
- }
159
- }
160
- }
361
+ .bulk-count {
362
+ padding-inline-start: var(--spacing-050, 0.25rem);
363
+ white-space: nowrap;
364
+ font-variant-numeric: tabular-nums;
365
+ }
161
366
 
162
- &:hover {
163
- .col {
164
- background-color: var(--color-surface-container-low, #f8f8f8);
165
- }
166
- }
367
+ .bulk-spacer {
368
+ flex: 1;
369
+ }
370
+
371
+ ::slotted([slot='bulk-actions']) {
372
+ display: inline-flex;
373
+ align-items: center;
374
+ gap: var(--spacing-050, 0.25rem);
375
+ }
376
+
377
+ // ── Empty state and footer ──────────────────────────────────────────────────
378
+
379
+ .empty-table {
380
+ position: sticky;
381
+ inset-inline-start: 0;
382
+ display: flex;
383
+ align-items: center;
384
+ justify-content: center;
385
+ min-height: 16rem;
386
+ padding: var(--spacing-400, 2rem) var(--spacing-200, 1rem);
387
+
388
+ .empty-state {
389
+ max-width: 24rem;
167
390
  }
168
391
  }
392
+
393
+ .table-footer {
394
+ flex: none;
395
+ border-top: 1px solid var(--table-border-color);
396
+ }