@scalewing/react 1.40.0 → 1.41.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 (105) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +154 -6
  3. package/dist/calendar-labels.d.ts +2 -0
  4. package/dist/calendar-labels.js +7 -0
  5. package/dist/components/BarChart.d.ts +20 -4
  6. package/dist/components/BarChart.js +13 -6
  7. package/dist/components/ButtonGroup.d.ts +8 -1
  8. package/dist/components/ButtonGroup.js +11 -2
  9. package/dist/components/DateField.d.ts +14 -2
  10. package/dist/components/DateField.js +14 -11
  11. package/dist/components/DenominationGrid.d.ts +3 -2
  12. package/dist/components/DenominationGrid.js +21 -3
  13. package/dist/components/Dialog.d.ts +29 -13
  14. package/dist/components/Dialog.js +22 -20
  15. package/dist/components/Field.d.ts +13 -2
  16. package/dist/components/Field.js +14 -38
  17. package/dist/components/FilterChips.d.ts +7 -37
  18. package/dist/components/FilterChips.js +32 -24
  19. package/dist/components/ListRow.d.ts +11 -2
  20. package/dist/components/ListRow.js +3 -2
  21. package/dist/components/SegmentedControl.d.ts +17 -1
  22. package/dist/components/SegmentedControl.js +11 -3
  23. package/dist/components/Switch.d.ts +16 -1
  24. package/dist/components/Switch.js +17 -6
  25. package/dist/components/action-bar/ActionBarSummary.d.ts +10 -2
  26. package/dist/components/action-bar/ActionBarSummary.js +11 -2
  27. package/dist/components/date-field/CalendarEntryButton.d.ts +24 -0
  28. package/dist/components/date-field/CalendarEntryButton.js +16 -0
  29. package/dist/components/date-field/TypedEntry.d.ts +26 -0
  30. package/dist/components/date-field/TypedEntry.js +13 -0
  31. package/dist/components/denomination-grid/CountCell.d.ts +16 -0
  32. package/dist/components/denomination-grid/CountCell.js +14 -0
  33. package/dist/components/denomination-grid/DenominationStrip.d.ts +4 -1
  34. package/dist/components/denomination-grid/DenominationStrip.js +2 -2
  35. package/dist/components/denomination-grid/EntryCell.d.ts +3 -1
  36. package/dist/components/denomination-grid/EntryCell.js +2 -2
  37. package/dist/components/denomination-grid/StripRow.js +1 -10
  38. package/dist/components/denomination-grid/TransposedStrip.d.ts +17 -0
  39. package/dist/components/denomination-grid/TransposedStrip.js +43 -0
  40. package/dist/components/denomination-grid/types.d.ts +31 -0
  41. package/dist/components/denomination-grid/types.js +7 -1
  42. package/dist/components/denomination-grid/validate-options.d.ts +7 -0
  43. package/dist/components/denomination-grid/validate-options.js +27 -0
  44. package/dist/components/dialog/DialogFooter.d.ts +6 -5
  45. package/dist/components/dialog/DialogFooter.js +6 -6
  46. package/dist/components/dialog/validate.d.ts +24 -0
  47. package/dist/components/dialog/validate.js +23 -0
  48. package/dist/components/field/field-checks.d.ts +34 -0
  49. package/dist/components/field/field-checks.js +42 -0
  50. package/dist/components/filter-chips/FilterChip.d.ts +16 -0
  51. package/dist/components/filter-chips/FilterChip.js +20 -0
  52. package/dist/components/filter-chips/options.d.ts +75 -0
  53. package/dist/components/filter-chips/options.js +11 -0
  54. package/dist/components/filter-chips/validate.d.ts +9 -0
  55. package/dist/components/filter-chips/validate.js +48 -0
  56. package/dist/components/list/ListRowContent.d.ts +3 -1
  57. package/dist/components/list/ListRowContent.js +3 -2
  58. package/dist/css/chart-tones.d.ts +2 -0
  59. package/dist/css/chart-tones.js +5 -1
  60. package/dist/css/css-bar-chart.d.ts +17 -2
  61. package/dist/css/css-bar-chart.js +38 -7
  62. package/dist/css/css-button-group-attached.d.ts +3 -0
  63. package/dist/css/css-button-group-attached.js +18 -1
  64. package/dist/css/css-canvas-grouped.d.ts +17 -0
  65. package/dist/css/css-canvas-grouped.js +40 -0
  66. package/dist/css/css-components.js +6 -0
  67. package/dist/css/css-date-field-calendar-entry.d.ts +11 -0
  68. package/dist/css/css-date-field-calendar-entry.js +50 -0
  69. package/dist/css/css-date-field.js +4 -0
  70. package/dist/css/css-denomination-grid.js +4 -0
  71. package/dist/css/css-denomination-transposed.d.ts +4 -0
  72. package/dist/css/css-denomination-transposed.js +178 -0
  73. package/dist/css/css-dialog-canvas.d.ts +3 -0
  74. package/dist/css/css-dialog-canvas.js +20 -0
  75. package/dist/css/css-dialog-frame.js +19 -2
  76. package/dist/css/css-dialog-grabber.d.ts +4 -0
  77. package/dist/css/css-dialog-grabber.js +56 -0
  78. package/dist/css/css-dialog.js +3 -2
  79. package/dist/css/css-document.js +3 -0
  80. package/dist/css/css-field-width.d.ts +12 -0
  81. package/dist/css/css-field-width.js +49 -0
  82. package/dist/css/css-field.js +4 -0
  83. package/dist/css/css-filter-chips-layout.d.ts +2 -0
  84. package/dist/css/css-filter-chips-layout.js +42 -0
  85. package/dist/css/css-filter-chips.js +4 -0
  86. package/dist/css/css-list-row.d.ts +6 -0
  87. package/dist/css/css-list-row.js +19 -3
  88. package/dist/css/css-segmented-sizing.d.ts +13 -0
  89. package/dist/css/css-segmented-sizing.js +66 -0
  90. package/dist/css/css-segmented.js +4 -0
  91. package/dist/css/css-switch.d.ts +6 -0
  92. package/dist/css/css-switch.js +39 -0
  93. package/dist/css/stacking.d.ts +1 -0
  94. package/dist/css/stacking.js +4 -1
  95. package/dist/css/stylesheet.js +4 -0
  96. package/dist/date-field-labels.d.ts +5 -0
  97. package/dist/date-field-labels.js +1 -0
  98. package/dist/index.d.ts +10 -8
  99. package/dist/index.js +8 -6
  100. package/dist/list-options.d.ts +8 -7
  101. package/dist/list-options.js +15 -8
  102. package/dist/styles.css +343 -2
  103. package/dist/theme/ThemeProvider.d.ts +11 -1
  104. package/dist/theme/ThemeProvider.js +4 -2
  105. package/package.json +1 -1
package/dist/styles.css CHANGED
@@ -614,6 +614,18 @@ body {
614
614
  color-scheme: dark;
615
615
  }
616
616
 
617
+ [data-theme] {
618
+ --sw-canvas-grouped: color-mix(in srgb, var(--sw-color-muted) 7%, var(--sw-color-background));
619
+ }
620
+
621
+ [data-theme='dark'] {
622
+ --sw-canvas-grouped: var(--sw-color-background);
623
+ }
624
+
625
+ [data-theme][data-canvas='grouped'] {
626
+ background-color: var(--sw-canvas-grouped);
627
+ }
628
+
617
629
  [data-theme] a {
618
630
  color: var(--sw-color-accent);
619
631
  text-decoration: none;
@@ -1003,6 +1015,12 @@ body {
1003
1015
  .sw-button-group.sw-button-group-attached > * { width: auto; }
1004
1016
  }
1005
1017
 
1018
+ /* Its own block, after the phone row's, so a group that does not fill is unchanged. */
1019
+ @media not all and (min-width: 48rem) {
1020
+ .sw-button-group.sw-button-group-attached.sw-button-group-full-below-md { width: 100%; }
1021
+ .sw-button-group.sw-button-group-attached.sw-button-group-full-below-md > .sw-button { flex: 1 1 0; min-width: 0; }
1022
+ }
1023
+
1006
1024
  .sw-button-group.sw-button-group-attached.sw-button-group-track {
1007
1025
  background: color-mix(in srgb, var(--sw-color-muted) 16%, transparent);
1008
1026
  border-radius: var(--sw-radius-sm);
@@ -1545,6 +1563,37 @@ body {
1545
1563
  .sw-segmented.sw-segmented-raised[aria-invalid='true'] { border-color: Mark; }
1546
1564
  }
1547
1565
 
1566
+ @media not all and (min-width: 48rem) {
1567
+ .sw-segmented-field.sw-segmented-field-full-below-md {
1568
+ align-self: stretch;
1569
+ display: flex;
1570
+ width: 100%;
1571
+ }
1572
+ .sw-segmented-field.sw-segmented-field-full-below-md > .sw-segmented {
1573
+ align-self: stretch;
1574
+ display: grid;
1575
+ grid-auto-columns: minmax(0, 1fr);
1576
+ grid-auto-flow: column;
1577
+ }
1578
+ }
1579
+
1580
+ .sw-segmented.sw-segmented-sm .sw-segmented-item {
1581
+ min-width: 0;
1582
+ overflow: hidden;
1583
+ white-space: nowrap;
1584
+ }
1585
+
1586
+ .sw-segmented.sw-segmented-sm:not(.sw-segmented-with-icons) .sw-segmented-item {
1587
+ padding-inline: var(--sw-space-2);
1588
+ }
1589
+
1590
+ .sw-segmented-sm .sw-segmented-item-label {
1591
+ display: block;
1592
+ min-width: 0;
1593
+ overflow: hidden;
1594
+ text-overflow: ellipsis;
1595
+ }
1596
+
1548
1597
  .sw-segmented-disabled {
1549
1598
  opacity: var(--sw-disabled-opacity);
1550
1599
  }
@@ -2191,6 +2240,36 @@ body {
2191
2240
  .sw-date-field-error { color: var(--sw-color-danger); }
2192
2241
  .sw-date-field-error:empty { position: absolute; }
2193
2242
 
2243
+ .sw-button.sw-date-field-calendar-entry {
2244
+ align-self: flex-start;
2245
+ border-radius: var(--sw-radius-sm);
2246
+ flex: none;
2247
+ justify-content: flex-start;
2248
+ max-width: 100%;
2249
+ text-align: start;
2250
+ white-space: nowrap;
2251
+ }
2252
+
2253
+ /* A long day or word in a narrow column ends in an ellipsis; the name keeps it whole. */
2254
+ .sw-date-field-calendar-entry-text {
2255
+ min-width: 0;
2256
+ overflow: hidden;
2257
+ text-overflow: ellipsis;
2258
+ }
2259
+
2260
+ .sw-button.sw-date-field-calendar-entry .sw-date-field-glyph {
2261
+ height: var(--sw-space-4);
2262
+ width: var(--sw-space-4);
2263
+ }
2264
+
2265
+ .sw-button.sw-date-field-calendar-entry.sw-date-field-calendar-entry-invalid {
2266
+ border-color: var(--sw-color-danger);
2267
+ }
2268
+
2269
+ @media (forced-colors: active) {
2270
+ .sw-button.sw-date-field-calendar-entry.sw-date-field-calendar-entry-invalid { border-color: Mark; }
2271
+ }
2272
+
2194
2273
  .sw-date-field-calendar {
2195
2274
  background: var(--sw-glass-fill);
2196
2275
  border: 1px solid var(--sw-glass-border);
@@ -2829,6 +2908,7 @@ body {
2829
2908
  .sw-list-row-value-danger { color: var(--sw-color-danger); }
2830
2909
  .sw-list-row-value-muted { color: var(--sw-color-muted); }
2831
2910
  .sw-list-row-value-accent { color: var(--sw-color-accent); }
2911
+ .sw-list-row-value-warning { color: color-mix(in srgb, var(--sw-color-warning) 50%, var(--sw-color-text)); }
2832
2912
 
2833
2913
  .sw-list-row-chevron {
2834
2914
  border-bottom: 2px solid var(--sw-color-muted);
@@ -2958,6 +3038,7 @@ body {
2958
3038
  .sw-bar-chart-fill-success { background: var(--sw-color-success); }
2959
3039
  .sw-bar-chart-fill-warning { background: var(--sw-color-warning); }
2960
3040
  .sw-bar-chart-fill-danger { background: var(--sw-color-danger); }
3041
+ .sw-bar-chart-fill-neutral { background: var(--sw-color-muted); }
2961
3042
 
2962
3043
  .sw-bar-chart-value {
2963
3044
  color: var(--sw-color-text);
@@ -3016,6 +3097,16 @@ body {
3016
3097
  .sw-bar-chart-diverging .sw-bar-chart-track::before { background: CanvasText; }
3017
3098
  }
3018
3099
 
3100
+ .sw-bar-chart-bare .sw-bar-chart-track {
3101
+ background: transparent;
3102
+ border-color: transparent;
3103
+ }
3104
+
3105
+ /* Forced colours replace a transparent edge; the canvas colour hides it. */
3106
+ @media (forced-colors: active) {
3107
+ .sw-bar-chart-bare .sw-bar-chart-track { border-color: Canvas; }
3108
+ }
3109
+
3019
3110
  @media (forced-colors: active) {
3020
3111
  .sw-bar-chart-fill { background: CanvasText; }
3021
3112
  }
@@ -3698,13 +3789,27 @@ body {
3698
3789
 
3699
3790
  .sw-dialog-footer-status {
3700
3791
  align-items: center;
3792
+ column-gap: var(--sw-space-2);
3701
3793
  display: flex;
3702
3794
  flex: 1 1 auto;
3795
+ flex-wrap: wrap;
3703
3796
  min-width: 0;
3704
3797
  }
3705
3798
 
3706
- /* With no summary the live region stays in the dialog, so a first figure
3707
- is still announced, but it takes no room in the footer. */
3799
+ /* The status line: muted caption words beside the actions. Its children
3800
+ sit on one row and wrap as one phrase. */
3801
+ .sw-dialog-footer-note {
3802
+ color: var(--sw-color-muted);
3803
+ font-family: var(--sw-font-sans);
3804
+ font-size: 13px;
3805
+ line-height: 18px;
3806
+ min-width: 0;
3807
+ overflow-wrap: anywhere;
3808
+ }
3809
+
3810
+ /* With no figure and no status line the live region stays in the
3811
+ dialog, so a first figure is still announced, but it takes no room in
3812
+ the footer. */
3708
3813
  .sw-dialog-footer-status:empty {
3709
3814
  clip-path: inset(50%);
3710
3815
  height: 1px;
@@ -3772,6 +3877,36 @@ body {
3772
3877
  .sw-dialog-banded .sw-dialog-header { border-bottom-color: CanvasText; }
3773
3878
  }
3774
3879
 
3880
+ .sw-dialog.sw-dialog-canvas-grouped {
3881
+ backdrop-filter: none;
3882
+ -webkit-backdrop-filter: none;
3883
+ background: var(--sw-canvas-grouped);
3884
+ }
3885
+
3886
+ .sw-dialog-grabber { display: none; }
3887
+
3888
+ @media not all and (min-width: 48rem) {
3889
+ .sw-dialog-sheet-below-md .sw-dialog-grabber {
3890
+ background: color-mix(in srgb, var(--sw-color-muted) 40%, transparent);
3891
+ border-radius: var(--sw-radius-pill);
3892
+ display: block;
3893
+ height: var(--sw-space-1);
3894
+ margin: calc(var(--sw-space-2) - var(--sw-space-5)) auto var(--sw-space-3);
3895
+ position: sticky;
3896
+ top: calc(var(--sw-space-2) - var(--sw-space-5));
3897
+ width: var(--sw-space-6);
3898
+ z-index: 6;
3899
+ }
3900
+
3901
+ .sw-dialog-sheet-below-md.sw-dialog-banded.sw-dialog-has-grabber .sw-dialog-header {
3902
+ padding-top: var(--sw-space-5);
3903
+ }
3904
+
3905
+ @media (forced-colors: active) {
3906
+ .sw-dialog-sheet-below-md .sw-dialog-grabber { background: CanvasText; forced-color-adjust: none; }
3907
+ }
3908
+ }
3909
+
3775
3910
  .sw-accordion {
3776
3911
  background: var(--sw-glass-fill);
3777
3912
  border: 1px solid var(--sw-glass-border);
@@ -4660,6 +4795,29 @@ body {
4660
4795
  line-height: 18px;
4661
4796
  }
4662
4797
 
4798
+ .sw-switch-trailing {
4799
+ align-items: flex-start;
4800
+ display: flex;
4801
+ gap: var(--sw-space-3);
4802
+ justify-content: space-between;
4803
+ width: 100%;
4804
+ }
4805
+
4806
+ .sw-switch-trailing .sw-switch-copy {
4807
+ flex: 1 1 auto;
4808
+ min-width: 0;
4809
+ padding-block: calc((var(--sw-control-md-min-height) - 20px) / 2);
4810
+ }
4811
+
4812
+ .sw-switch-success .sw-switch-input:checked + .sw-switch-track {
4813
+ background: var(--sw-color-success);
4814
+ border-color: var(--sw-color-success);
4815
+ }
4816
+
4817
+ @media (forced-colors: active) {
4818
+ .sw-switch-success .sw-switch-input:checked + .sw-switch-track { background: Highlight; border-color: Highlight; }
4819
+ }
4820
+
4663
4821
  @media (prefers-reduced-motion: reduce) {
4664
4822
  .sw-switch-thumb { transition: none; }
4665
4823
  }
@@ -5288,6 +5446,28 @@ body {
5288
5446
  border-color: var(--sw-color-danger);
5289
5447
  }
5290
5448
 
5449
+ .sw-filter-chip-count-inline {
5450
+ font-variant-numeric: tabular-nums;
5451
+ }
5452
+
5453
+ .sw-filter-chips-scroll .sw-filter-chips-options {
5454
+ flex-wrap: nowrap;
5455
+ margin: calc(-1 * calc(var(--sw-focus-ring-width) + var(--sw-focus-ring-offset)));
5456
+ overflow-x: auto;
5457
+ overscroll-behavior-x: contain;
5458
+ padding: calc(var(--sw-focus-ring-width) + var(--sw-focus-ring-offset));
5459
+ scrollbar-width: thin;
5460
+ }
5461
+
5462
+ .sw-filter-chips-scroll .sw-filter-chip {
5463
+ flex: none;
5464
+ max-width: none;
5465
+ }
5466
+
5467
+ .sw-filter-chips-scroll .sw-filter-chip-face {
5468
+ white-space: nowrap;
5469
+ }
5470
+
5291
5471
  @media (forced-colors: active) {
5292
5472
  .sw-filter-chip-face { background: Canvas; border-color: CanvasText; color: CanvasText; }
5293
5473
  .sw-filter-chips-error { color: Mark; }
@@ -5865,6 +6045,146 @@ body {
5865
6045
  .sw-denomination-strip .sw-denomination-value-row .sw-denomination-value { color: CanvasText; }
5866
6046
  }
5867
6047
 
6048
+ .sw-denomination-transposed {
6049
+ border-collapse: collapse;
6050
+ width: 100%;
6051
+ }
6052
+
6053
+ .sw-denomination-transposed th,
6054
+ .sw-denomination-transposed td {
6055
+ padding: var(--sw-space-1) var(--sw-space-2);
6056
+ vertical-align: middle;
6057
+ }
6058
+
6059
+ .sw-denomination-transposed tbody tr,
6060
+ .sw-denomination-transposed tfoot tr {
6061
+ border-top: 1px solid var(--sw-color-border);
6062
+ }
6063
+
6064
+ .sw-denomination-transposed .sw-denomination-transposed-head {
6065
+ vertical-align: bottom;
6066
+ white-space: nowrap;
6067
+ }
6068
+
6069
+ .sw-denomination-transposed .sw-denomination-label-line {
6070
+ justify-content: flex-end;
6071
+ }
6072
+
6073
+ .sw-denomination-transposed-label {
6074
+ color: var(--sw-color-text);
6075
+ font-size: 15px;
6076
+ font-weight: 600;
6077
+ letter-spacing: -0.2px;
6078
+ line-height: 20px;
6079
+ text-align: start;
6080
+ white-space: nowrap;
6081
+ }
6082
+
6083
+ .sw-denomination-transposed td.sw-denomination-entry {
6084
+ padding: var(--sw-space-1);
6085
+ }
6086
+
6087
+ .sw-denomination-transposed-entry .sw-denomination-transposed-head,
6088
+ .sw-denomination-transposed-entry .sw-denomination-cell {
6089
+ text-align: center;
6090
+ }
6091
+
6092
+ .sw-denomination-transposed-entry .sw-denomination-label-line {
6093
+ justify-content: center;
6094
+ }
6095
+
6096
+ .sw-denomination-transposed-value {
6097
+ background: var(--sw-color-subtle);
6098
+ font-size: 15px;
6099
+ font-variant-numeric: tabular-nums;
6100
+ font-weight: 500;
6101
+ letter-spacing: -0.2px;
6102
+ line-height: 20px;
6103
+ text-align: center;
6104
+ white-space: nowrap;
6105
+ }
6106
+
6107
+ .sw-denomination-transposed-total {
6108
+ color: var(--sw-denomination-tone);
6109
+ font-size: 13px;
6110
+ font-variant-numeric: tabular-nums;
6111
+ font-weight: 600;
6112
+ letter-spacing: -0.08px;
6113
+ line-height: 18px;
6114
+ text-align: end;
6115
+ white-space: nowrap;
6116
+ }
6117
+
6118
+ .sw-denomination-transposed-entry .sw-denomination-transposed-total {
6119
+ text-align: center;
6120
+ }
6121
+
6122
+ /* The denomination column and its corner stay in view, as the strip's labels do. */
6123
+ .sw-denomination-transposed .sw-denomination-transposed-label,
6124
+ .sw-denomination-transposed :is(thead, tfoot) .sw-denomination-corner:first-child {
6125
+ background: var(--sw-glass-fill);
6126
+ backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
6127
+ -webkit-backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
6128
+ inset-inline-start: 0;
6129
+ position: sticky;
6130
+ z-index: 1;
6131
+ }
6132
+
6133
+ .sw-denomination-scroll-transposed.sw-scroll-more-start .sw-denomination-transposed-label::after {
6134
+ background: linear-gradient(to right, color-mix(in srgb, var(--sw-color-text) 28%, transparent), transparent);
6135
+ content: '';
6136
+ inset-block: 0;
6137
+ inset-inline-start: 100%;
6138
+ pointer-events: none;
6139
+ position: absolute;
6140
+ width: var(--sw-space-5);
6141
+ }
6142
+
6143
+ .sw-denomination-scroll-transposed.sw-scroll-more-start:dir(rtl) .sw-denomination-transposed-label::after {
6144
+ background: linear-gradient(to left, color-mix(in srgb, var(--sw-color-text) 28%, transparent), transparent);
6145
+ }
6146
+
6147
+ @media (forced-colors: active) {
6148
+ .sw-denomination-scroll-transposed.sw-scroll-more-start .sw-denomination-transposed-label::after { display: none; }
6149
+ }
6150
+
6151
+ .sw-denomination-transposed-quiet {
6152
+ background: var(--sw-color-subtle);
6153
+ }
6154
+
6155
+ /* Over a toned count's full strength (three classes, emitted later). */
6156
+ .sw-denomination-grid.sw-denomination-transposed .sw-denomination-transposed-disabled:is(.sw-denomination-cell, .sw-denomination-transposed-value, .sw-denomination-transposed-total, .sw-denomination-transposed-head) {
6157
+ opacity: var(--sw-disabled-opacity);
6158
+ }
6159
+
6160
+ @media (forced-colors: active) {
6161
+ .sw-denomination-transposed-value,
6162
+ .sw-denomination-transposed-quiet { background: Canvas; }
6163
+ .sw-denomination-transposed-label,
6164
+ .sw-denomination-transposed-value,
6165
+ .sw-denomination-transposed-total { color: CanvasText; }
6166
+ }
6167
+
6168
+ .sw-denomination-cell-signed.sw-denomination-cell-positive {
6169
+ color: var(--sw-color-success);
6170
+ }
6171
+
6172
+ .sw-denomination-cell-negative.sw-denomination-cell-plain {
6173
+ color: var(--sw-color-text);
6174
+ }
6175
+
6176
+ .sw-denomination-count-digits .sw-denomination-entry .sw-stepper-full .sw-stepper-track {
6177
+ font-size: 17px;
6178
+ font-variant-numeric: tabular-nums;
6179
+ font-weight: 600;
6180
+ grid-template-columns: var(--sw-space-6) minmax(calc(var(--sw-denomination-count-digits) * 1ch + 2 * var(--sw-space-1) + 2px), 1fr) var(--sw-space-6);
6181
+ }
6182
+
6183
+ @media (forced-colors: active) {
6184
+ .sw-denomination-cell-signed.sw-denomination-cell-positive,
6185
+ .sw-denomination-cell-negative.sw-denomination-cell-plain { color: CanvasText; }
6186
+ }
6187
+
5868
6188
  @media (forced-colors: active) {
5869
6189
  .sw-denomination-label { border-inline-start-color: CanvasText; color: CanvasText; }
5870
6190
  .sw-denomination-strip .sw-denomination-label::before { background: CanvasText; forced-color-adjust: none; }
@@ -6093,6 +6413,27 @@ body {
6093
6413
  linear-gradient(135deg, var(--sw-color-muted) 50%, transparent 50%); }
6094
6414
  }
6095
6415
 
6416
+ .sw-field-width-xs { --sw-field-width: 4rem; }
6417
+ .sw-field-width-sm { --sw-field-width: 6rem; }
6418
+ .sw-field-width-md { --sw-field-width: 8rem; }
6419
+ .sw-field-width-lg { --sw-field-width: 12rem; }
6420
+ .sw-field-width-xl { --sw-field-width: 16rem; }
6421
+
6422
+ .sw-field-sized > :is(input[type='text'], input[type='email'], input[type='number'], input[type='search'], input[type='url'], input[type='password'], input:not([type]), textarea, select, .sw-field-adorned, .sw-field-search) {
6423
+ align-self: flex-start;
6424
+ box-sizing: border-box;
6425
+ inline-size: min(100%, var(--sw-field-width));
6426
+ max-inline-size: 100%;
6427
+ }
6428
+
6429
+ [data-theme] .sw-field-sized > select {
6430
+ height: var(--sw-control-md-min-height);
6431
+ }
6432
+
6433
+ [data-theme] .sw-field-xs.sw-field-sized > select {
6434
+ height: var(--sw-control-xs-min-height);
6435
+ }
6436
+
6096
6437
  @media (forced-colors: active) {
6097
6438
  [data-theme] .sw-field-invalid :is(input, select, textarea),
6098
6439
  .sw-field-invalid .sw-field-adorned { border-color: Mark; }
@@ -1,10 +1,20 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type ColorScheme, type PaletteId, type Theme, type ThemeColors } from '@scalewing/tokens';
3
+ import { type ThemeCanvas } from '../css/css-canvas-grouped.js';
3
4
  export type ThemeProviderProps = {
4
5
  colorScheme?: ColorScheme | 'system';
5
6
  palette?: PaletteId;
6
7
  colors?: ThemeColors;
8
+ /**
9
+ * The page's tone: `default` is the theme's background; `grouped` (opt-in)
10
+ * is a quiet grey in the light scheme (the background in the dark one,
11
+ * already darker than its surface), so white cards stand apart from the
12
+ * page. Put links and accent words in the cards: on the grouped grey the
13
+ * accent falls under 4.5:1 in some palettes, while the text and muted
14
+ * colours keep it. An unknown value throws a `RangeError`.
15
+ */
16
+ canvas?: ThemeCanvas;
7
17
  children: ReactNode;
8
18
  };
9
- export declare function ThemeProvider({ colorScheme, palette, colors, children, }: ThemeProviderProps): import("react").JSX.Element;
19
+ export declare function ThemeProvider({ colorScheme, palette, colors, canvas, children, }: ThemeProviderProps): import("react").JSX.Element;
10
20
  export declare function useTheme(): Theme;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createContext, useContext, useEffect, useMemo, useState, } from 'react';
3
3
  import { createTheme, secondaryActionBorder, semanticColorKeys, } from '@scalewing/tokens';
4
+ import { assertThemeCanvas, } from '../css/css-canvas-grouped.js';
4
5
  const ThemeContext = createContext(null);
5
6
  function schemeFromMedia() {
6
7
  if (typeof window === 'undefined' ||
@@ -24,7 +25,8 @@ function themeCssVars(theme) {
24
25
  vars['--sw-glass-specular'] = theme.glass.specular;
25
26
  return vars;
26
27
  }
27
- export function ThemeProvider({ colorScheme = 'system', palette, colors, children, }) {
28
+ export function ThemeProvider({ colorScheme = 'system', palette, colors, canvas = 'default', children, }) {
29
+ assertThemeCanvas(canvas);
28
30
  const [systemScheme, setSystemScheme] = useState(schemeFromMedia);
29
31
  useEffect(() => {
30
32
  if (colorScheme !== 'system' || typeof window.matchMedia !== 'function') {
@@ -40,7 +42,7 @@ export function ThemeProvider({ colorScheme = 'system', palette, colors, childre
40
42
  }, [colorScheme]);
41
43
  const resolvedScheme = colorScheme === 'system' ? systemScheme : colorScheme;
42
44
  const theme = useMemo(() => createTheme({ colorScheme: resolvedScheme, palette, colors }), [colors, palette, resolvedScheme]);
43
- return (_jsx(ThemeContext.Provider, { value: theme, children: _jsx("div", { "data-palette": palette, "data-theme": theme.colorScheme, style: themeCssVars(theme), children: children }) }));
45
+ return (_jsx(ThemeContext.Provider, { value: theme, children: _jsx("div", { "data-canvas": canvas === 'default' ? undefined : canvas, "data-palette": palette, "data-theme": theme.colorScheme, style: themeCssVars(theme), children: children }) }));
44
46
  }
45
47
  export function useTheme() {
46
48
  const theme = useContext(ThemeContext);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalewing/react",
3
- "version": "1.40.0",
3
+ "version": "1.41.0",
4
4
  "description": "Scalewing DOM components and package-owned CSS utilities.",
5
5
  "type": "module",
6
6
  "license": "MIT",