@slotted/styles 0.1.0-beta.23 → 0.1.0-beta.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slotted/styles",
3
- "version": "0.1.0-beta.23",
3
+ "version": "0.1.0-beta.24",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -563,7 +563,11 @@
563
563
  );
564
564
  --_item-inset: var(--slotted-control-padding-inline-md, 0.8125rem);
565
565
  --_item-height: var(--slotted-control-height-md, 34px);
566
- --_item-radius: var(--slotted-combobox-item-radius, var(--slotted-control-radius));
566
+ /* Concentric with the panel: its radius less the inset, floored at 0. */
567
+ --_item-radius: var(
568
+ --slotted-combobox-item-radius,
569
+ max(0px, calc(var(--_radius) - var(--_inset-inline)))
570
+ );
567
571
  --_content-font-size: var(--slotted-control-font-size-md, 13px);
568
572
  --_secondary-font-size: var(--slotted-control-font-size-sm, 12px);
569
573
  --_content-icon-size: var(--slotted-control-icon-size-md, 16px);
@@ -83,7 +83,11 @@
83
83
  /* The row, at the family's size step; the header one step up. */
84
84
  --_item-height: var(--slotted-control-height-md, 34px);
85
85
  --_item-inset: var(--slotted-control-padding-inline-md, 13px);
86
- --_item-radius: var(--slotted-command-palette-item-radius, var(--slotted-control-radius));
86
+ /* Concentric with the panel: its radius less the inset, floored at 0. */
87
+ --_item-radius: var(
88
+ --slotted-command-palette-item-radius,
89
+ max(0px, calc(var(--_radius) - var(--_list-inset)))
90
+ );
87
91
  --_font-size: var(--slotted-control-font-size-md, 13px);
88
92
  --_secondary-font-size: var(--slotted-control-font-size-sm, 12px);
89
93
  --_icon-size: var(--slotted-control-icon-size-md, 16px);
@@ -98,18 +98,31 @@
98
98
  --slotted-data-grid-row-surface-hover,
99
99
  var(--slotted-tone-secondary-subtle-hover, ButtonFace)
100
100
  );
101
+ /**
102
+ * A run of selected rows reads as one block: the accent border mixed
103
+ * into the row's ground, the same border closing the run above and
104
+ * below, and every rule inside it — between rows and at a pinned zone's
105
+ * edge — tinted toward that border; no rail (R1). The ink stays the
106
+ * row's own. The ground mixes the border, which is the light accent in
107
+ * the dark scheme and the dark one in the light: at 20% it stands 1.3:1
108
+ * from the page in both on the default theme, above the stripe and the
109
+ * hover. The accent's surfaces read as nothing on a dark row, and its
110
+ * solid ink at any one share was twice as strong in light as in dark.
111
+ */
112
+ --_selected-edge: var(
113
+ --slotted-data-grid-row-border-color-selected,
114
+ var(--slotted-tone-accent-border, Highlight)
115
+ );
101
116
  --_selected: var(
102
117
  --slotted-data-grid-row-surface-selected,
103
- var(--slotted-tone-accent-surface, Canvas)
118
+ color-mix(in oklab, var(--_selected-edge) 20%, var(--_surface))
104
119
  );
105
120
  --_selected-hover: var(
106
121
  --slotted-data-grid-row-surface-selected-hover,
107
- var(--slotted-tone-accent-subtle-hover, ButtonFace)
108
- );
109
- --_selected-text: var(
110
- --slotted-data-grid-row-color-selected,
111
- var(--slotted-tone-accent-text, CanvasText)
122
+ color-mix(in oklab, var(--_selected-edge) 28%, var(--_surface))
112
123
  );
124
+ --_selected-text: var(--slotted-data-grid-row-color-selected, var(--_text));
125
+ --_selected-rule: color-mix(in oklab, var(--_selected-edge) 30%, var(--_selected));
113
126
  /**
114
127
  * The cursor and the range are one colour: the accent border, which holds
115
128
  * the non-text ratio against the page and against the accent ground it
@@ -1236,7 +1249,11 @@
1236
1249
 
1237
1250
  [data-ui-data-grid] [data-part-row] {
1238
1251
  background-color: var(--_surface);
1239
- transition: background-color var(--_transition);
1252
+ /* The block's edges settle with its ground, not a frame before it. */
1253
+ transition:
1254
+ background-color var(--_transition),
1255
+ border-color var(--_transition),
1256
+ box-shadow var(--_transition);
1240
1257
  }
1241
1258
 
1242
1259
  /**
@@ -1421,6 +1438,31 @@
1421
1438
  background-color: var(--_selected-hover);
1422
1439
  }
1423
1440
 
1441
+ /* The block's edges. The bottom is the row's own rule; the top is drawn
1442
+ over the rule of the row above, by a shadow one rule tall, because a row
1443
+ cannot reach its previous sibling. Inside a run the shadow takes the
1444
+ inner tint. A head above, being sticky, paints over the shadow and its
1445
+ own rule closes the block; a frame below closes it the same way. */
1446
+ [data-ui-data-grid]:is([data-variant='ruled'], [data-variant='framed'])
1447
+ :is([data-part-body], [data-part-pinned-rows])
1448
+ > [data-part-row][data-selected] {
1449
+ border-block-end-color: var(--_selected-edge);
1450
+ box-shadow: 0 calc(var(--_rule-width) * -1) 0 var(--_selected-edge);
1451
+ }
1452
+
1453
+ [data-ui-data-grid]:is([data-variant='ruled'], [data-variant='framed'])
1454
+ :is([data-part-body], [data-part-pinned-rows])
1455
+ > [data-part-row][data-selected]
1456
+ + [data-part-row][data-selected] {
1457
+ box-shadow: 0 calc(var(--_rule-width) * -1) 0 var(--_selected-rule);
1458
+ }
1459
+
1460
+ [data-ui-data-grid][data-variant='framed']
1461
+ :is([data-part-body], [data-part-pinned-rows])
1462
+ > [data-part-row][data-selected]:last-child {
1463
+ border-block-end-color: transparent;
1464
+ }
1465
+
1424
1466
  [data-ui-data-grid] [data-part-row][data-disabled] {
1425
1467
  color: var(--slotted-disabled-foreground, GrayText);
1426
1468
  }
@@ -1772,7 +1814,9 @@
1772
1814
  > :is([data-part-body], [data-part-pinned-rows])
1773
1815
  > [data-part-row][data-selected]
1774
1816
  > [data-pinned] {
1775
- background-color: var(--_selected);
1817
+ /* The zone's edge inside the block is one of the block's inner rules. The
1818
+ ground is the row's, inherited, so it follows the row's hover. */
1819
+ --_rule: var(--_selected-rule);
1776
1820
  }
1777
1821
 
1778
1822
  /* The last pinned cell of each zone draws the edge: the same hairline as
@@ -1918,13 +1962,6 @@
1918
1962
  z-index: calc(var(--slotted-z-index-sticky, 100) + 2);
1919
1963
  }
1920
1964
 
1921
- [data-ui-data-grid]
1922
- :is([data-part-body], [data-part-pinned-rows])
1923
- > [data-part-row][data-selected]
1924
- > [data-part-selection] {
1925
- background-color: var(--_selected);
1926
- }
1927
-
1928
1965
  [data-ui-data-grid] [role='row'] > [data-part-selection] > [data-ui-checkbox] {
1929
1966
  block-size: var(--_line);
1930
1967
  }
@@ -48,6 +48,7 @@
48
48
  "--slotted-data-grid-resize-guide-color",
49
49
  "--slotted-data-grid-resize-guide-width",
50
50
  "--slotted-data-grid-row-block-size",
51
+ "--slotted-data-grid-row-border-color-selected",
51
52
  "--slotted-data-grid-row-color-selected",
52
53
  "--slotted-data-grid-row-max-block-size",
53
54
  "--slotted-data-grid-row-surface-hover",
@@ -95,7 +96,6 @@
95
96
  "--slotted-text-muted",
96
97
  "--slotted-tone-accent-border",
97
98
  "--slotted-tone-accent-solid",
98
- "--slotted-tone-accent-subtle-hover",
99
99
  "--slotted-tone-accent-surface",
100
100
  "--slotted-tone-accent-text",
101
101
  "--slotted-tone-danger-border",
@@ -304,13 +304,24 @@
304
304
  * guess at and cannot be wrong at a width nobody tested.
305
305
  */
306
306
  [data-ui-datetime-picker] [data-part-content] {
307
+ --_content-radius: var(--slotted-datetime-picker-content-radius, var(--slotted-radius-lg, 8px));
308
+ --_content-padding: var(
309
+ --slotted-datetime-picker-content-padding,
310
+ var(--slotted-space-3, 0.375rem)
311
+ );
312
+ /* Concentric with the panel: its radius less the inset, floored at 0. */
313
+ --_option-radius: var(
314
+ --slotted-datetime-picker-option-radius,
315
+ max(0px, calc(var(--_content-radius) - var(--_content-padding)))
316
+ );
317
+
307
318
  background-color: var(--slotted-datetime-picker-surface, var(--slotted-surface-raised, Canvas));
308
319
  border: var(--slotted-border-width-thin, 1px) solid
309
320
  var(
310
321
  --slotted-datetime-picker-content-border-color,
311
322
  var(--slotted-border-subtle, ButtonBorder)
312
323
  );
313
- border-radius: var(--slotted-datetime-picker-content-radius, var(--slotted-radius-lg, 8px));
324
+ border-radius: var(--_content-radius);
314
325
  box-shadow: var(--slotted-datetime-picker-content-shadow, var(--slotted-shadow-md));
315
326
  box-sizing: border-box;
316
327
  color: var(--slotted-datetime-picker-content-color, var(--slotted-text, CanvasText));
@@ -332,7 +343,7 @@
332
343
  grid-template-columns: minmax(0, 1fr);
333
344
  inline-size: auto;
334
345
  max-inline-size: min(34rem, var(--slotted-positioner-available-width, 34rem));
335
- padding: var(--slotted-datetime-picker-content-padding, var(--slotted-space-3, 0.375rem));
346
+ padding: var(--_content-padding);
336
347
  /* The layer above gave up the pointer; the surface takes it back. */
337
348
  pointer-events: auto;
338
349
  }
@@ -650,7 +661,7 @@
650
661
  [data-ui-datetime-picker] [data-part-option] {
651
662
  align-items: center;
652
663
  background-color: transparent;
653
- border-radius: var(--slotted-datetime-picker-option-radius, var(--slotted-radius-sm, 4px));
664
+ border-radius: var(--_option-radius);
654
665
  color: inherit;
655
666
  cursor: pointer;
656
667
  display: flex;
@@ -55,7 +55,6 @@
55
55
  "--slotted-font-size-sm",
56
56
  "--slotted-font-weight-medium",
57
57
  "--slotted-radius-lg",
58
- "--slotted-radius-sm",
59
58
  "--slotted-shadow-md",
60
59
  "--slotted-space-1",
61
60
  "--slotted-space-2",
@@ -78,7 +78,11 @@
78
78
  --_inset-inline: var(--slotted-listbox-padding-inline, var(--slotted-space-2, 0.25rem));
79
79
  --_option-inset: var(--slotted-control-padding-inline-md, 0.8125rem);
80
80
  --_option-height: var(--slotted-control-height-md, 34px);
81
- --_option-radius: var(--slotted-listbox-option-radius, var(--slotted-control-radius));
81
+ /* Concentric with the panel: its radius less the inset, floored at 0. */
82
+ --_option-radius: var(
83
+ --slotted-listbox-option-radius,
84
+ max(0px, calc(var(--_radius) - var(--_inset-inline)))
85
+ );
82
86
  --_font-size: var(--slotted-control-font-size-md, 13px);
83
87
  --_secondary-font-size: var(--slotted-control-font-size-sm, 12px);
84
88
  --_icon-size: var(--slotted-control-icon-size-md, 16px);
@@ -18,7 +18,6 @@
18
18
  "--slotted-control-padding-inline-lg",
19
19
  "--slotted-control-padding-inline-md",
20
20
  "--slotted-control-padding-inline-sm",
21
- "--slotted-control-radius",
22
21
  "--slotted-control-shadow",
23
22
  "--slotted-control-transition-duration",
24
23
  "--slotted-control-transition-easing",
package/src/menu/menu.css CHANGED
@@ -86,7 +86,11 @@
86
86
  --_item-padding: var(--slotted-control-padding-inline-md, 0.8125rem);
87
87
  --_item-inset: calc(var(--_item-padding) - var(--_inset-inline));
88
88
  --_item-height: var(--slotted-control-height-md, 34px);
89
- --_item-radius: var(--slotted-menu-item-radius, var(--slotted-control-radius));
89
+ /* Concentric with the panel: its radius less the inset, floored at 0. */
90
+ --_item-radius: var(
91
+ --slotted-menu-item-radius,
92
+ max(0px, calc(var(--_radius) - var(--_inset-inline)))
93
+ );
90
94
  --_font-size: var(--slotted-control-font-size-md, 13px);
91
95
  --_secondary-font-size: var(--slotted-control-font-size-sm, 12px);
92
96
  --_icon-size: var(--slotted-control-icon-size-md, 16px);
@@ -16,7 +16,6 @@
16
16
  "--slotted-control-padding-inline-lg",
17
17
  "--slotted-control-padding-inline-md",
18
18
  "--slotted-control-padding-inline-sm",
19
- "--slotted-control-radius",
20
19
  "--slotted-control-transition-duration",
21
20
  "--slotted-control-transition-easing",
22
21
  "--slotted-disabled-foreground",
@@ -889,7 +889,11 @@
889
889
  );
890
890
  --_item-inset: var(--slotted-control-padding-inline-md, 0.8125rem);
891
891
  --_item-height: var(--slotted-control-height-md, 34px);
892
- --_item-radius: var(--slotted-multi-select-item-radius, var(--slotted-control-radius));
892
+ /* Concentric with the panel: its radius less the inset, floored at 0. */
893
+ --_item-radius: var(
894
+ --slotted-multi-select-item-radius,
895
+ max(0px, calc(var(--_radius) - var(--_inset-inline)))
896
+ );
893
897
  --_content-font-size: var(--slotted-control-font-size-md, 13px);
894
898
  --_secondary-font-size: var(--slotted-control-font-size-sm, 12px);
895
899
  --_content-icon-size: var(--slotted-control-icon-size-md, 16px);
@@ -808,7 +808,11 @@
808
808
  --_inset-inline: var(--slotted-select-content-padding-inline, var(--slotted-space-2, 0.25rem));
809
809
  --_item-inset: var(--slotted-control-padding-inline-md, 0.8125rem);
810
810
  --_item-height: var(--slotted-control-height-md, 34px);
811
- --_item-radius: var(--slotted-select-item-radius, var(--slotted-control-radius));
811
+ /* Concentric with the panel: its radius less the inset, floored at 0. */
812
+ --_item-radius: var(
813
+ --slotted-select-item-radius,
814
+ max(0px, calc(var(--_radius) - var(--_inset-inline)))
815
+ );
812
816
  --_content-font-size: var(--slotted-control-font-size-md, 13px);
813
817
  --_secondary-font-size: var(--slotted-control-font-size-sm, 12px);
814
818
  --_content-icon-size: var(--slotted-control-icon-size-md, 16px);
@@ -740,14 +740,18 @@
740
740
  /* The ground the row is painted with, whatever state it is in, so a
741
741
  hovered, striped or selected row keeps one colour across the seam — over
742
742
  the page's own surface, so a row on a transparent table surface still
743
- covers what scrolls under it. `inherit` copied a transparent row as is. */
743
+ covers what scrolls under it. `inherit` copied a transparent row as is.
744
+ The layer under the row is the family's token, so a table drawn over a
745
+ card states the card's ground. It is painted whether the table overflows
746
+ or not: the overflow is known only after a measurement, and a column
747
+ pinned to the end has content under it from the first frame. */
744
748
  [data-ui-table] [data-sticky] {
745
749
  background:
746
750
  linear-gradient(
747
751
  var(--_pinned-ground, var(--_row-ground)),
748
752
  var(--_pinned-ground, var(--_row-ground))
749
753
  ),
750
- var(--slotted-surface, Canvas);
754
+ var(--slotted-table-sticky-surface, var(--slotted-surface, Canvas));
751
755
  }
752
756
 
753
757
  [data-ui-table] [data-sticky='start'] {
@@ -61,6 +61,7 @@
61
61
  "--slotted-table-sticky-inset",
62
62
  "--slotted-table-sticky-offset",
63
63
  "--slotted-table-sticky-offset-end",
64
+ "--slotted-table-sticky-surface",
64
65
  "--slotted-table-surface",
65
66
  "--slotted-target-comfortable",
66
67
  "--slotted-target-min",
@@ -306,10 +306,21 @@
306
306
  * does not stretch one column of times across a page.
307
307
  */
308
308
  [data-ui-time-picker] [data-part-content] {
309
+ --_content-radius: var(--slotted-time-picker-content-radius, var(--slotted-radius-lg, 8px));
310
+ --_content-padding: var(
311
+ --slotted-time-picker-content-padding,
312
+ var(--slotted-space-3, 0.375rem)
313
+ );
314
+ /* Concentric with the panel: its radius less the inset, floored at 0. */
315
+ --_option-radius: var(
316
+ --slotted-time-picker-option-radius,
317
+ max(0px, calc(var(--_content-radius) - var(--_content-padding)))
318
+ );
319
+
309
320
  background-color: var(--slotted-time-picker-surface, var(--slotted-surface-raised, Canvas));
310
321
  border: var(--slotted-border-width-thin, 1px) solid
311
322
  var(--slotted-time-picker-content-border-color, var(--slotted-border-subtle, ButtonBorder));
312
- border-radius: var(--slotted-time-picker-content-radius, var(--slotted-radius-lg, 8px));
323
+ border-radius: var(--_content-radius);
313
324
  box-shadow: var(--slotted-time-picker-content-shadow, var(--slotted-shadow-md));
314
325
  box-sizing: border-box;
315
326
  color: var(--slotted-time-picker-content-color, var(--slotted-text, CanvasText));
@@ -349,7 +360,7 @@
349
360
  var(--slotted-time-picker-content-min-inline-size, 11rem),
350
361
  min(var(--slotted-positioner-anchor-width, 11rem), 20rem)
351
362
  );
352
- padding: var(--slotted-time-picker-content-padding, var(--slotted-space-3, 0.375rem));
363
+ padding: var(--_content-padding);
353
364
  /* The layer above gave up the pointer; the surface takes it back. */
354
365
  pointer-events: auto;
355
366
  }
@@ -386,7 +397,7 @@
386
397
  appearance: none;
387
398
  background-color: transparent;
388
399
  border: 0;
389
- border-radius: var(--slotted-time-picker-option-radius, var(--slotted-radius-sm, 4px));
400
+ border-radius: var(--_option-radius);
390
401
  color: var(--slotted-time-picker-now-color, var(--slotted-tone-accent-text));
391
402
  cursor: pointer;
392
403
  font: inherit;
@@ -471,7 +482,7 @@
471
482
  [data-ui-time-picker] [data-part-option] {
472
483
  align-items: center;
473
484
  background-color: transparent;
474
- border-radius: var(--slotted-time-picker-option-radius, var(--slotted-radius-sm, 4px));
485
+ border-radius: var(--_option-radius);
475
486
  color: inherit;
476
487
  cursor: pointer;
477
488
  display: flex;
@@ -21,7 +21,6 @@
21
21
  "--slotted-focus-ring-offset",
22
22
  "--slotted-focus-ring-width",
23
23
  "--slotted-radius-lg",
24
- "--slotted-radius-sm",
25
24
  "--slotted-shadow-md",
26
25
  "--slotted-space-1",
27
26
  "--slotted-space-2",