@scalewing/react 1.40.0 → 1.42.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 (191) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +274 -7
  3. package/dist/calendar-labels.d.ts +2 -0
  4. package/dist/calendar-labels.js +7 -0
  5. package/dist/components/Article.d.ts +60 -0
  6. package/dist/components/Article.js +42 -0
  7. package/dist/components/BarChart.d.ts +20 -4
  8. package/dist/components/BarChart.js +13 -6
  9. package/dist/components/ButtonGroup.d.ts +8 -1
  10. package/dist/components/ButtonGroup.js +11 -2
  11. package/dist/components/DateField.d.ts +14 -2
  12. package/dist/components/DateField.js +14 -11
  13. package/dist/components/DenominationGrid.d.ts +3 -2
  14. package/dist/components/DenominationGrid.js +21 -3
  15. package/dist/components/Dialog.d.ts +29 -13
  16. package/dist/components/Dialog.js +22 -20
  17. package/dist/components/DocumentViewer.d.ts +41 -0
  18. package/dist/components/DocumentViewer.js +72 -0
  19. package/dist/components/Field.d.ts +13 -2
  20. package/dist/components/Field.js +14 -38
  21. package/dist/components/FileField.d.ts +44 -0
  22. package/dist/components/FileField.js +66 -0
  23. package/dist/components/FilterChips.d.ts +7 -37
  24. package/dist/components/FilterChips.js +32 -24
  25. package/dist/components/ListRow.d.ts +33 -3
  26. package/dist/components/ListRow.js +18 -17
  27. package/dist/components/MarkdownView.d.ts +39 -0
  28. package/dist/components/MarkdownView.js +30 -0
  29. package/dist/components/NavCount.d.ts +15 -2
  30. package/dist/components/NavCount.js +16 -6
  31. package/dist/components/SegmentedControl.d.ts +17 -1
  32. package/dist/components/SegmentedControl.js +11 -3
  33. package/dist/components/Switch.d.ts +16 -1
  34. package/dist/components/Switch.js +17 -6
  35. package/dist/components/action-bar/ActionBarSummary.d.ts +10 -2
  36. package/dist/components/action-bar/ActionBarSummary.js +11 -2
  37. package/dist/components/chart/use-chart-width.js +2 -24
  38. package/dist/components/date-field/CalendarEntryButton.d.ts +24 -0
  39. package/dist/components/date-field/CalendarEntryButton.js +16 -0
  40. package/dist/components/date-field/TypedEntry.d.ts +26 -0
  41. package/dist/components/date-field/TypedEntry.js +13 -0
  42. package/dist/components/denomination-grid/CountCell.d.ts +16 -0
  43. package/dist/components/denomination-grid/CountCell.js +14 -0
  44. package/dist/components/denomination-grid/DenominationStrip.d.ts +4 -1
  45. package/dist/components/denomination-grid/DenominationStrip.js +2 -2
  46. package/dist/components/denomination-grid/EntryCell.d.ts +3 -1
  47. package/dist/components/denomination-grid/EntryCell.js +2 -2
  48. package/dist/components/denomination-grid/StripRow.js +1 -10
  49. package/dist/components/denomination-grid/TransposedStrip.d.ts +17 -0
  50. package/dist/components/denomination-grid/TransposedStrip.js +43 -0
  51. package/dist/components/denomination-grid/types.d.ts +31 -0
  52. package/dist/components/denomination-grid/types.js +7 -1
  53. package/dist/components/denomination-grid/validate-options.d.ts +7 -0
  54. package/dist/components/denomination-grid/validate-options.js +27 -0
  55. package/dist/components/dialog/DialogFooter.d.ts +6 -5
  56. package/dist/components/dialog/DialogFooter.js +6 -6
  57. package/dist/components/dialog/validate.d.ts +24 -0
  58. package/dist/components/dialog/validate.js +23 -0
  59. package/dist/components/document-viewer/document-viewer-labels.d.ts +23 -0
  60. package/dist/components/document-viewer/document-viewer-labels.js +23 -0
  61. package/dist/components/document-viewer/page-box.d.ts +8 -0
  62. package/dist/components/document-viewer/page-box.js +12 -0
  63. package/dist/components/document-viewer/pdf-document.d.ts +32 -0
  64. package/dist/components/document-viewer/pdf-document.js +66 -0
  65. package/dist/components/document-viewer/pdf-options.d.ts +36 -0
  66. package/dist/components/document-viewer/pdf-options.js +46 -0
  67. package/dist/components/document-viewer/render-pdf-page.d.ts +20 -0
  68. package/dist/components/document-viewer/render-pdf-page.js +38 -0
  69. package/dist/components/document-viewer/scroll-chain.d.ts +6 -0
  70. package/dist/components/document-viewer/scroll-chain.js +23 -0
  71. package/dist/components/document-viewer/use-error-report.d.ts +5 -0
  72. package/dist/components/document-viewer/use-error-report.js +13 -0
  73. package/dist/components/document-viewer/use-page-render.d.ts +21 -0
  74. package/dist/components/document-viewer/use-page-render.js +70 -0
  75. package/dist/components/document-viewer/use-pdf-document.d.ts +22 -0
  76. package/dist/components/document-viewer/use-pdf-document.js +47 -0
  77. package/dist/components/document-viewer/use-pinch-zoom.d.ts +12 -0
  78. package/dist/components/document-viewer/use-pinch-zoom.js +67 -0
  79. package/dist/components/document-viewer/use-zoom.d.ts +23 -0
  80. package/dist/components/document-viewer/use-zoom.js +70 -0
  81. package/dist/components/document-viewer/zoom.d.ts +29 -0
  82. package/dist/components/document-viewer/zoom.js +37 -0
  83. package/dist/components/field/field-checks.d.ts +34 -0
  84. package/dist/components/field/field-checks.js +42 -0
  85. package/dist/components/file-field/file-field-checks.d.ts +13 -0
  86. package/dist/components/file-field/file-field-checks.js +21 -0
  87. package/dist/components/file-field/use-file-drop.d.ts +34 -0
  88. package/dist/components/file-field/use-file-drop.js +78 -0
  89. package/dist/components/file-field/use-swap-focus.d.ts +15 -0
  90. package/dist/components/file-field/use-swap-focus.js +40 -0
  91. package/dist/components/filter-chips/FilterChip.d.ts +16 -0
  92. package/dist/components/filter-chips/FilterChip.js +20 -0
  93. package/dist/components/filter-chips/options.d.ts +75 -0
  94. package/dist/components/filter-chips/options.js +11 -0
  95. package/dist/components/filter-chips/validate.d.ts +9 -0
  96. package/dist/components/filter-chips/validate.js +48 -0
  97. package/dist/components/list/ListRowContent.d.ts +8 -2
  98. package/dist/components/list/ListRowContent.js +6 -3
  99. package/dist/components/list/ListRowItem.d.ts +10 -0
  100. package/dist/components/list/ListRowItem.js +17 -0
  101. package/dist/components/list/row-naming.d.ts +17 -0
  102. package/dist/components/list/row-naming.js +19 -0
  103. package/dist/components/list/row-slot.d.ts +8 -0
  104. package/dist/components/list/row-slot.js +12 -0
  105. package/dist/components/markdown/markdown-limits.d.ts +14 -0
  106. package/dist/components/markdown/markdown-limits.js +14 -0
  107. package/dist/components/markdown/markdown-model.d.ts +94 -0
  108. package/dist/components/markdown/markdown-model.js +8 -0
  109. package/dist/components/markdown/markdown-options.d.ts +18 -0
  110. package/dist/components/markdown/markdown-options.js +10 -0
  111. package/dist/components/markdown/markdown-rules.d.ts +28 -0
  112. package/dist/components/markdown/markdown-rules.js +81 -0
  113. package/dist/components/markdown/markdown-text.d.ts +17 -0
  114. package/dist/components/markdown/markdown-text.js +86 -0
  115. package/dist/components/markdown/parse-markdown.d.ts +4 -0
  116. package/dist/components/markdown/parse-markdown.js +21 -0
  117. package/dist/components/markdown/read-blocks.d.ts +8 -0
  118. package/dist/components/markdown/read-blocks.js +168 -0
  119. package/dist/components/markdown/read-inlines.d.ts +12 -0
  120. package/dist/components/markdown/read-inlines.js +126 -0
  121. package/dist/components/markdown/read-markdown.d.ts +9 -0
  122. package/dist/components/markdown/read-markdown.js +27 -0
  123. package/dist/components/markdown/reading-context.d.ts +18 -0
  124. package/dist/components/markdown/reading-context.js +35 -0
  125. package/dist/components/markdown/render-markdown.d.ts +10 -0
  126. package/dist/components/markdown/render-markdown.js +52 -0
  127. package/dist/components/use-element-width.d.ts +11 -0
  128. package/dist/components/use-element-width.js +38 -0
  129. package/dist/css/chart-tones.d.ts +2 -0
  130. package/dist/css/chart-tones.js +5 -1
  131. package/dist/css/css-article.d.ts +2 -0
  132. package/dist/css/css-article.js +110 -0
  133. package/dist/css/css-bar-chart.d.ts +17 -2
  134. package/dist/css/css-bar-chart.js +38 -7
  135. package/dist/css/css-button-group-attached.d.ts +3 -0
  136. package/dist/css/css-button-group-attached.js +18 -1
  137. package/dist/css/css-canvas-grouped.d.ts +17 -0
  138. package/dist/css/css-canvas-grouped.js +40 -0
  139. package/dist/css/css-components.js +18 -0
  140. package/dist/css/css-count-pill.js +14 -1
  141. package/dist/css/css-date-field-calendar-entry.d.ts +11 -0
  142. package/dist/css/css-date-field-calendar-entry.js +50 -0
  143. package/dist/css/css-date-field.js +4 -0
  144. package/dist/css/css-denomination-grid.js +4 -0
  145. package/dist/css/css-denomination-transposed.d.ts +4 -0
  146. package/dist/css/css-denomination-transposed.js +178 -0
  147. package/dist/css/css-dialog-canvas.d.ts +3 -0
  148. package/dist/css/css-dialog-canvas.js +20 -0
  149. package/dist/css/css-dialog-frame.js +19 -2
  150. package/dist/css/css-dialog-grabber.d.ts +4 -0
  151. package/dist/css/css-dialog-grabber.js +56 -0
  152. package/dist/css/css-dialog.js +3 -2
  153. package/dist/css/css-document-viewer.d.ts +2 -0
  154. package/dist/css/css-document-viewer.js +186 -0
  155. package/dist/css/css-document.js +3 -0
  156. package/dist/css/css-field-width.d.ts +12 -0
  157. package/dist/css/css-field-width.js +49 -0
  158. package/dist/css/css-field.js +4 -0
  159. package/dist/css/css-file-field.d.ts +2 -0
  160. package/dist/css/css-file-field.js +180 -0
  161. package/dist/css/css-filter-chips-layout.d.ts +2 -0
  162. package/dist/css/css-filter-chips-layout.js +42 -0
  163. package/dist/css/css-filter-chips.js +4 -0
  164. package/dist/css/css-list-row-trailing.d.ts +2 -0
  165. package/dist/css/css-list-row-trailing.js +91 -0
  166. package/dist/css/css-list-row.d.ts +6 -0
  167. package/dist/css/css-list-row.js +19 -3
  168. package/dist/css/css-list.js +5 -1
  169. package/dist/css/css-markdown.d.ts +2 -0
  170. package/dist/css/css-markdown.js +144 -0
  171. package/dist/css/css-segmented-sizing.d.ts +13 -0
  172. package/dist/css/css-segmented-sizing.js +66 -0
  173. package/dist/css/css-segmented.js +4 -0
  174. package/dist/css/css-switch.d.ts +6 -0
  175. package/dist/css/css-switch.js +39 -0
  176. package/dist/css/css-variables.js +1 -0
  177. package/dist/css/stacking.d.ts +1 -0
  178. package/dist/css/stacking.js +4 -1
  179. package/dist/css/stylesheet.js +12 -0
  180. package/dist/date-field-labels.d.ts +5 -0
  181. package/dist/date-field-labels.js +1 -0
  182. package/dist/document-viewer-worker.d.ts +9 -0
  183. package/dist/document-viewer-worker.js +9 -0
  184. package/dist/index.d.ts +15 -9
  185. package/dist/index.js +13 -7
  186. package/dist/list-options.d.ts +11 -7
  187. package/dist/list-options.js +20 -8
  188. package/dist/styles.css +889 -44
  189. package/dist/theme/ThemeProvider.d.ts +11 -1
  190. package/dist/theme/ThemeProvider.js +4 -2
  191. package/package.json +10 -2
@@ -70,6 +70,10 @@ export const chartStrokeColors = {
70
70
  danger: { semantic: 'danger' },
71
71
  neutral: { semantic: 'muted' },
72
72
  };
73
+ /** A stroke tone's colour as CSS, such as a line's or a bar's. */
74
+ export function chartStroke(tone) {
75
+ return sourceProperty(chartStrokeColors[tone]);
76
+ }
73
77
  /**
74
78
  * How much of a line's stroke the area under it takes, over transparency:
75
79
  * a quiet tint behind the line, decorative (the line carries the values).
@@ -115,7 +119,7 @@ function toneDeclarations(tone) {
115
119
  if (isOneOf(chartFillTones, tone))
116
120
  declarations.push(`--sw-chart-fill: ${chartFill(tone)};`);
117
121
  if (isOneOf(chartStrokeTones, tone))
118
- declarations.push(`--sw-chart-stroke: ${sourceProperty(chartStrokeColors[tone])};`);
122
+ declarations.push(`--sw-chart-stroke: ${chartStroke(tone)};`);
119
123
  if (isOneOf(chartInkTones, tone))
120
124
  declarations.push(`--sw-chart-ink: ${chartColorMix(chartInkMixes[tone])};`);
121
125
  return declarations.join(' ');
@@ -0,0 +1,2 @@
1
+ export declare function cssArticleClasses(): string;
2
+ export declare function articleClassCatalog(): string[];
@@ -0,0 +1,110 @@
1
+ import { typographyVariants } from '@scalewing/tokens';
2
+ import { breakpointQuery } from './breakpoints.js';
3
+ const { caption, label } = typographyVariants;
4
+ /*
5
+ * An article is a card at the reading width (--sw-reading-max): its cover
6
+ * photo edge to edge across the top at 3:1 (2:1 on a phone), rounded with
7
+ * the card's top corners, then its words a space-6 below and above and a
8
+ * space-8 in from the sides (space-5 all round on a phone). The eyebrow
9
+ * is caption type at the label's weight, muted, with the actions at its
10
+ * row's end (when the row is too narrow they wrap under it, at its
11
+ * start); the title a space-3 under it; the meta line muted caption type
12
+ * a space-3 under the title; a hairline a space-3 under that, and the
13
+ * body a space-4 under the hairline. The card sits at the start of a
14
+ * wider column, as a page's main column does.
15
+ */
16
+ export function cssArticleClasses() {
17
+ return `.sw-article {
18
+ box-sizing: border-box;
19
+ display: flex;
20
+ flex-direction: column;
21
+ max-inline-size: var(--sw-reading-max);
22
+ min-width: 0;
23
+ }
24
+
25
+ .sw-article-cover {
26
+ aspect-ratio: 3 / 1;
27
+ background: var(--sw-color-subtle);
28
+ border-start-end-radius: inherit;
29
+ border-start-start-radius: inherit;
30
+ display: block;
31
+ inline-size: 100%;
32
+ object-fit: cover;
33
+ }
34
+
35
+ .sw-article-body {
36
+ display: flex;
37
+ flex-direction: column;
38
+ min-width: 0;
39
+ padding: var(--sw-space-6) var(--sw-space-8);
40
+ }
41
+
42
+ .sw-article-header {
43
+ display: flex;
44
+ flex-direction: column;
45
+ margin-block-end: var(--sw-space-3);
46
+ min-width: 0;
47
+ }
48
+
49
+ .sw-article-top {
50
+ align-items: center;
51
+ display: flex;
52
+ flex-wrap: wrap;
53
+ gap: var(--sw-space-3);
54
+ justify-content: space-between;
55
+ margin-block-end: var(--sw-space-3);
56
+ }
57
+
58
+ .sw-article-eyebrow {
59
+ color: var(--sw-color-muted);
60
+ font-size: ${caption.fontSize}px;
61
+ font-weight: ${label.fontWeight};
62
+ letter-spacing: ${caption.letterSpacing}px;
63
+ line-height: ${caption.lineHeight}px;
64
+ min-width: 0;
65
+ overflow-wrap: anywhere;
66
+ }
67
+
68
+ .sw-article-actions {
69
+ display: flex;
70
+ flex-wrap: wrap;
71
+ gap: var(--sw-space-2);
72
+ }
73
+
74
+ .sw-article-actions:only-child { margin-inline-start: auto; }
75
+
76
+ .sw-article-title { overflow-wrap: anywhere; }
77
+
78
+ .sw-article-meta {
79
+ color: var(--sw-color-muted);
80
+ font-size: ${caption.fontSize}px;
81
+ letter-spacing: ${caption.letterSpacing}px;
82
+ line-height: ${caption.lineHeight}px;
83
+ margin-block-start: var(--sw-space-3);
84
+ overflow-wrap: anywhere;
85
+ }
86
+
87
+ .sw-article-content {
88
+ margin-block-start: var(--sw-space-4);
89
+ min-width: 0;
90
+ }
91
+
92
+ @media ${breakpointQuery('below', 'md')} {
93
+ .sw-article-cover { aspect-ratio: 2 / 1; }
94
+ .sw-article-body { padding: var(--sw-space-5); }
95
+ }`;
96
+ }
97
+ export function articleClassCatalog() {
98
+ return [
99
+ 'sw-article',
100
+ 'sw-article-cover',
101
+ 'sw-article-body',
102
+ 'sw-article-header',
103
+ 'sw-article-top',
104
+ 'sw-article-eyebrow',
105
+ 'sw-article-actions',
106
+ 'sw-article-title',
107
+ 'sw-article-meta',
108
+ 'sw-article-content',
109
+ ];
110
+ }
@@ -1,9 +1,24 @@
1
+ import { type ChartStrokeTone } from './chart-tones.js';
1
2
  /**
2
3
  * The meanings a bar's fill can take in place of its sign's default (the
3
4
  * accent, or danger for a negative value), such as a diverging chart whose
4
5
  * overage is a warning and whose shortage is danger.
5
6
  */
6
- export declare const barChartTones: readonly ["accent", "success", "warning", "danger"];
7
- export type BarChartTone = (typeof barChartTones)[number];
7
+ export declare const barChartTones: readonly ["accent", "success", "warning", "danger", "neutral"];
8
+ export type BarChartTone = ChartStrokeTone;
9
+ /**
10
+ * A tone's colour: the charts' stroke colour of that tone (`chart-tones.ts`),
11
+ * a semantic colour at 3:1 or more, the muted grey for `neutral`, a bar
12
+ * that is counted but not the point (the other days beside the busiest
13
+ * ones). Not the lighter fill mix a column takes, which is 1.5:1.
14
+ */
15
+ export declare function barChartToneColor(tone: BarChartTone): string;
16
+ /**
17
+ * `track` (the default) draws each bar in a track with the value axis
18
+ * under the bars; `bare` draws the bars alone, with no track and no axis,
19
+ * for bars whose values are all written beside them.
20
+ */
21
+ export declare const barChartAppearances: readonly ["track", "bare"];
22
+ export type BarChartAppearance = (typeof barChartAppearances)[number];
8
23
  export declare function cssBarChartClasses(): string;
9
24
  export declare function barChartClassCatalog(): string[];
@@ -1,4 +1,5 @@
1
1
  import { typographyVariants } from '@scalewing/tokens';
2
+ import { chartStroke, chartStrokeTones, } from './chart-tones.js';
2
3
  const caption = typographyVariants.caption;
3
4
  const data = typographyVariants.data;
4
5
  /**
@@ -6,12 +7,22 @@ const data = typographyVariants.data;
6
7
  * accent, or danger for a negative value), such as a diverging chart whose
7
8
  * overage is a warning and whose shortage is danger.
8
9
  */
9
- export const barChartTones = [
10
- 'accent',
11
- 'success',
12
- 'warning',
13
- 'danger',
14
- ];
10
+ export const barChartTones = chartStrokeTones;
11
+ /**
12
+ * A tone's colour: the charts' stroke colour of that tone (`chart-tones.ts`),
13
+ * a semantic colour at 3:1 or more, the muted grey for `neutral`, a bar
14
+ * that is counted but not the point (the other days beside the busiest
15
+ * ones). Not the lighter fill mix a column takes, which is 1.5:1.
16
+ */
17
+ export function barChartToneColor(tone) {
18
+ return chartStroke(tone);
19
+ }
20
+ /**
21
+ * `track` (the default) draws each bar in a track with the value axis
22
+ * under the bars; `bare` draws the bars alone, with no track and no axis,
23
+ * for bars whose values are all written beside them.
24
+ */
25
+ export const barChartAppearances = ['track', 'bare'];
15
26
  /*
16
27
  * A tone's rule follows the negative fill's, at the same specificity, so a
17
28
  * toned negative bar keeps its diverging geometry and takes the tone's
@@ -22,7 +33,7 @@ export const barChartTones = [
22
33
  */
23
34
  function toneRules() {
24
35
  return barChartTones
25
- .map((tone) => `.sw-bar-chart-fill-${tone} { background: var(--sw-color-${tone}); }`)
36
+ .map((tone) => `.sw-bar-chart-fill-${tone} { background: ${barChartToneColor(tone)}; }`)
26
37
  .join('\n');
27
38
  }
28
39
  /*
@@ -66,6 +77,23 @@ function divergingRules() {
66
77
  .sw-bar-chart-diverging .sw-bar-chart-track::before { background: CanvasText; }
67
78
  }`;
68
79
  }
80
+ /*
81
+ * A bare chart draws no track: the bar sits on the surface around it, the
82
+ * track's room kept so the labels and values line up as before (in forced
83
+ * colours its edge is the canvas colour, as forcing replaces a transparent
84
+ * one). A diverging bare chart keeps its zero hairline.
85
+ */
86
+ function bareRules() {
87
+ return `.sw-bar-chart-bare .sw-bar-chart-track {
88
+ background: transparent;
89
+ border-color: transparent;
90
+ }
91
+
92
+ /* Forced colours replace a transparent edge; the canvas colour hides it. */
93
+ @media (forced-colors: active) {
94
+ .sw-bar-chart-bare .sw-bar-chart-track { border-color: Canvas; }
95
+ }`;
96
+ }
69
97
  export function cssBarChartClasses() {
70
98
  return `.sw-bar-chart {
71
99
  display: grid;
@@ -151,6 +179,8 @@ ${toneRules()}
151
179
 
152
180
  ${divergingRules()}
153
181
 
182
+ ${bareRules()}
183
+
154
184
  @media (forced-colors: active) {
155
185
  .sw-bar-chart-fill { background: CanvasText; }
156
186
  }`;
@@ -169,5 +199,6 @@ export function barChartClassCatalog() {
169
199
  'sw-bar-chart-value',
170
200
  'sw-bar-chart-axis-track',
171
201
  'sw-bar-chart-diverging',
202
+ 'sw-bar-chart-bare',
172
203
  ];
173
204
  }
@@ -1,2 +1,5 @@
1
+ import { type Breakpoint } from './breakpoints.js';
2
+ /** The class that stretches an attached group below a breakpoint. */
3
+ export declare function buttonGroupFullWidthClass(breakpoint: Breakpoint): string;
1
4
  export declare function cssButtonGroupAttachedClasses(): string;
2
5
  export declare function buttonGroupAttachedClassCatalog(): string[];
@@ -1,6 +1,10 @@
1
1
  import { breakpointQuery } from './breakpoints.js';
2
2
  import { buttonGroupTrackClassCatalog, cssButtonGroupTrackClasses, } from './css-button-group-track.js';
3
3
  import { joinedZIndex } from './stacking.js';
4
+ /** The class that stretches an attached group below a breakpoint. */
5
+ export function buttonGroupFullWidthClass(breakpoint) {
6
+ return `sw-button-group-full-below-${breakpoint}`;
7
+ }
4
8
  /*
5
9
  * An attached ButtonGroup is one joined control, such as Previous, Today
6
10
  * and Next: its direct Button children side by side with no gap and one
@@ -17,6 +21,9 @@ import { joinedZIndex } from './stacking.js';
17
21
  * button renders beside itself (CalendarButton, DateRangeButton) does not
18
22
  * cost the next button its divider or the last one its rounded corners.
19
23
  *
24
+ * With `fullWidthBelow`, below that breakpoint the group fills its column
25
+ * and its buttons share the width equally.
26
+ *
20
27
  * The group is its own stacking context: a pressed button's ring paints
21
28
  * over its neighbours and the focused button's standard outer ring over
22
29
  * both, so neither is covered by the next button.
@@ -70,8 +77,18 @@ ${group} > .sw-button:focus-visible {
70
77
  ${group} > * { width: auto; }
71
78
  }
72
79
 
80
+ /* Its own block, after the phone row's, so a group that does not fill is unchanged. */
81
+ @media ${breakpointQuery('below', 'md')} {
82
+ ${group}.${buttonGroupFullWidthClass('md')} { width: 100%; }
83
+ ${group}.${buttonGroupFullWidthClass('md')} > .sw-button { flex: 1 1 0; min-width: 0; }
84
+ }
85
+
73
86
  ${cssButtonGroupTrackClasses()}`;
74
87
  }
75
88
  export function buttonGroupAttachedClassCatalog() {
76
- return ['sw-button-group-attached', ...buttonGroupTrackClassCatalog()];
89
+ return [
90
+ 'sw-button-group-attached',
91
+ buttonGroupFullWidthClass('md'),
92
+ ...buttonGroupTrackClassCatalog(),
93
+ ];
77
94
  }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The page tones a canvas can take: `default`, the theme's background, and
3
+ * `grouped`, a quieter grey so white cards stand apart from the page, as a
4
+ * settings or report page groups its content in cards.
5
+ */
6
+ export declare const themeCanvases: readonly ["default", "grouped"];
7
+ export type ThemeCanvas = (typeof themeCanvases)[number];
8
+ /**
9
+ * How much of the muted colour the light grouped canvas mixes into the
10
+ * background: a grey a step off white that keeps the text and muted
11
+ * colours at 4.5:1 or more in every palette (`canvas-grouped.test.tsx`).
12
+ */
13
+ export declare const groupedCanvasMutedShare = 0.07;
14
+ /** The grouped canvas's colour, for a surface that sits on it, such as a dialog's body. */
15
+ export declare const groupedCanvasFill = "var(--sw-canvas-grouped)";
16
+ export declare function cssCanvasGroupedRules(): string;
17
+ export declare function assertThemeCanvas(canvas: unknown): void;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The page tones a canvas can take: `default`, the theme's background, and
3
+ * `grouped`, a quieter grey so white cards stand apart from the page, as a
4
+ * settings or report page groups its content in cards.
5
+ */
6
+ export const themeCanvases = ['default', 'grouped'];
7
+ /**
8
+ * How much of the muted colour the light grouped canvas mixes into the
9
+ * background: a grey a step off white that keeps the text and muted
10
+ * colours at 4.5:1 or more in every palette (`canvas-grouped.test.tsx`).
11
+ */
12
+ export const groupedCanvasMutedShare = 0.07;
13
+ /** The grouped canvas's colour, for a surface that sits on it, such as a dialog's body. */
14
+ export const groupedCanvasFill = 'var(--sw-canvas-grouped)';
15
+ /*
16
+ * The grouped canvas: in the light scheme the background with a little of
17
+ * the muted colour, in the dark scheme the background itself, which is
18
+ * already darker than its surface. The colour is declared on every themed
19
+ * node (a nested one recomputes it from its own colours) and painted only
20
+ * where `data-canvas="grouped"` asks for it, so no other page changes.
21
+ * Forced colours paint the system canvas as they do the default page.
22
+ */
23
+ export function cssCanvasGroupedRules() {
24
+ const share = Math.round(groupedCanvasMutedShare * 100);
25
+ return `[data-theme] {
26
+ --sw-canvas-grouped: color-mix(in srgb, var(--sw-color-muted) ${share}%, var(--sw-color-background));
27
+ }
28
+
29
+ [data-theme='dark'] {
30
+ --sw-canvas-grouped: var(--sw-color-background);
31
+ }
32
+
33
+ [data-theme][data-canvas='grouped'] {
34
+ background-color: ${groupedCanvasFill};
35
+ }`;
36
+ }
37
+ export function assertThemeCanvas(canvas) {
38
+ if (!themeCanvases.includes(canvas))
39
+ throw new RangeError(`Unknown ThemeProvider canvas: ${String(canvas)}`);
40
+ }
@@ -5,7 +5,11 @@ import { cssAccordionClasses } from './css-accordion.js';
5
5
  import { cssButtonClasses } from './css-button.js';
6
6
  import { cssCalendarButtonClasses } from './css-calendar-button.js';
7
7
  import { cssDateRangeClasses } from './css-date-range.js';
8
+ import { cssFileFieldClasses } from './css-file-field.js';
9
+ import { cssArticleClasses } from './css-article.js';
10
+ import { cssDocumentViewerClasses } from './css-document-viewer.js';
8
11
  import { cssListClasses } from './css-list.js';
12
+ import { cssMarkdownClasses } from './css-markdown.js';
9
13
  import { cssCountPillClasses } from './css-count-pill.js';
10
14
  import { cssBarChartClasses } from './css-bar-chart.js';
11
15
  import { cssChartLegendClasses } from './css-chart-legend.js';
@@ -24,6 +28,8 @@ import { cssDateFieldClasses } from './css-date-field.js';
24
28
  import { cssDialogClasses } from './css-dialog.js';
25
29
  import { cssDialogBandedClasses } from './css-dialog-banded.js';
26
30
  import { cssDialogFrameClasses } from './css-dialog-frame.js';
31
+ import { cssDialogCanvasClasses } from './css-dialog-canvas.js';
32
+ import { cssDialogGrabberClasses } from './css-dialog-grabber.js';
27
33
  import { cssComboboxClasses } from './css-combobox.js';
28
34
  import { cssSelectClasses } from './css-select.js';
29
35
  import { cssMultiSelectClasses } from './css-multi-select.js';
@@ -148,6 +154,14 @@ ${cssDateRangeClasses()}
148
154
 
149
155
  ${cssListClasses()}
150
156
 
157
+ ${cssFileFieldClasses()}
158
+
159
+ ${cssArticleClasses()}
160
+
161
+ ${cssDocumentViewerClasses()}
162
+
163
+ ${cssMarkdownClasses()}
164
+
151
165
  ${cssCountPillClasses()}
152
166
 
153
167
  ${cssBarChartClasses()}
@@ -174,6 +188,10 @@ ${cssDialogFrameClasses()}
174
188
 
175
189
  ${cssDialogBandedClasses()}
176
190
 
191
+ ${cssDialogCanvasClasses()}
192
+
193
+ ${cssDialogGrabberClasses()}
194
+
177
195
  ${cssAccordionClasses()}
178
196
 
179
197
  ${cssSelectClasses()}
@@ -2,6 +2,8 @@ import { typographyVariants } from '@scalewing/tokens';
2
2
  const caption = typographyVariants.caption;
3
3
  /** The counts drawn as the pill: SectionNav's and a Nav word's. */
4
4
  const pills = ['sw-section-nav-count', 'sw-nav-count'];
5
+ /** NavCount's news tone, a modifier of its pill. */
6
+ const accentPill = 'sw-nav-count-accent';
5
7
  /*
6
8
  * A count after a destination's words (a number waiting there, such as
7
9
  * tasks to do) is a filled pill: the danger colour with its on-colour
@@ -30,6 +32,17 @@ export function cssCountPillClasses() {
30
32
  padding-inline: var(--sw-space-1);
31
33
  }
32
34
 
35
+ /*
36
+ * NavCount's \`tone="accent"\`: a count that is news, not work waiting (what
37
+ * was added since the person last looked), is the accent fill with its
38
+ * on-colour figures (4.5:1 in every palette, as a primary Button's label).
39
+ * One class more specific than the pill, so it wins in any order.
40
+ */
41
+ [data-theme] .sw-nav-count.${accentPill} {
42
+ background: var(--sw-color-accent);
43
+ color: var(--sw-color-onAccent);
44
+ }
45
+
33
46
  /*
34
47
  * A Nav link holding a count lays out as SectionNav's link does: the words
35
48
  * and the pill centred on one line a space-2 apart (the space text node
@@ -50,5 +63,5 @@ export function cssCountPillClasses() {
50
63
  }`;
51
64
  }
52
65
  export function countPillClassCatalog() {
53
- return [...pills];
66
+ return [...pills, accentPill];
54
67
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * DateField's calendar entry: one neutral Button showing the chosen day (or
3
+ * the words that ask for one) after the calendar glyph, shaped as a field's
4
+ * control rather than a pill, sized to its words on one line at the
5
+ * column's start, the danger edge while the field is invalid.
6
+ */
7
+ export declare const dateFieldEntries: readonly ["typed", "calendar"];
8
+ export type DateFieldEntry = (typeof dateFieldEntries)[number];
9
+ export declare function assertDateFieldEntry(entry: unknown): void;
10
+ export declare function cssDateFieldCalendarEntryClasses(): string;
11
+ export declare function dateFieldCalendarEntryClassCatalog(): string[];
@@ -0,0 +1,50 @@
1
+ /**
2
+ * DateField's calendar entry: one neutral Button showing the chosen day (or
3
+ * the words that ask for one) after the calendar glyph, shaped as a field's
4
+ * control rather than a pill, sized to its words on one line at the
5
+ * column's start, the danger edge while the field is invalid.
6
+ */
7
+ export const dateFieldEntries = ['typed', 'calendar'];
8
+ export function assertDateFieldEntry(entry) {
9
+ if (!dateFieldEntries.includes(entry))
10
+ throw new RangeError(`Unknown DateField entry: ${String(entry)}`);
11
+ }
12
+ const entry = '.sw-button.sw-date-field-calendar-entry';
13
+ export function cssDateFieldCalendarEntryClasses() {
14
+ return `${entry} {
15
+ align-self: flex-start;
16
+ border-radius: var(--sw-radius-sm);
17
+ flex: none;
18
+ justify-content: flex-start;
19
+ max-width: 100%;
20
+ text-align: start;
21
+ white-space: nowrap;
22
+ }
23
+
24
+ /* A long day or word in a narrow column ends in an ellipsis; the name keeps it whole. */
25
+ .sw-date-field-calendar-entry-text {
26
+ min-width: 0;
27
+ overflow: hidden;
28
+ text-overflow: ellipsis;
29
+ }
30
+
31
+ ${entry} .sw-date-field-glyph {
32
+ height: var(--sw-space-4);
33
+ width: var(--sw-space-4);
34
+ }
35
+
36
+ ${entry}.sw-date-field-calendar-entry-invalid {
37
+ border-color: var(--sw-color-danger);
38
+ }
39
+
40
+ @media (forced-colors: active) {
41
+ ${entry}.sw-date-field-calendar-entry-invalid { border-color: Mark; }
42
+ }`;
43
+ }
44
+ export function dateFieldCalendarEntryClassCatalog() {
45
+ return [
46
+ 'sw-date-field-calendar-entry',
47
+ 'sw-date-field-calendar-entry-text',
48
+ 'sw-date-field-calendar-entry-invalid',
49
+ ];
50
+ }
@@ -1,5 +1,6 @@
1
1
  import { typographyVariants } from '@scalewing/tokens';
2
2
  import { disabledControlForcedColors, disabledControlSurface, } from './css-document.js';
3
+ import { cssDateFieldCalendarEntryClasses, dateFieldCalendarEntryClassCatalog, } from './css-date-field-calendar-entry.js';
3
4
  import { zIndex } from './stacking.js';
4
5
  import { quietFill } from './quiet-fill.js';
5
6
  import { rangeBand, rangeBandHover } from './range-band.js';
@@ -334,12 +335,15 @@ function adaptiveRules() {
334
335
  export function cssDateFieldClasses() {
335
336
  return `${fieldRules()}
336
337
 
338
+ ${cssDateFieldCalendarEntryClasses()}
339
+
337
340
  ${calendarRules()}
338
341
 
339
342
  ${adaptiveRules()}`;
340
343
  }
341
344
  export function dateFieldClassCatalog() {
342
345
  return [
346
+ ...dateFieldCalendarEntryClassCatalog(),
343
347
  'sw-date-field',
344
348
  'sw-date-field-label',
345
349
  'sw-date-field-control',
@@ -6,6 +6,7 @@ import { cssDenominationLabelClasses, denominationLabelClassCatalog, } from './c
6
6
  import { cssDenominationAlignedClasses, denominationAlignedClassCatalog, } from './css-denomination-aligned.js';
7
7
  import { cssDenominationEntryClasses, denominationEntryClassCatalog, } from './css-denomination-entry.js';
8
8
  import { cssDenominationValueRowClasses, denominationValueRowClassCatalog, } from './css-denomination-value-row.js';
9
+ import { cssDenominationTransposedClasses, denominationTransposedClassCatalog, } from './css-denomination-transposed.js';
9
10
  import { cssDenominationCellToneClasses, denominationCellToneClassCatalog, } from './css-denomination-cell-tones.js';
10
11
  import { pinnedStartShadeRules, scrollRegionRules, } from './css-scroll-region.js';
11
12
  import { visuallyHiddenDeclarations } from './css-utilities.js';
@@ -263,6 +264,8 @@ ${cssDenominationAppearanceClasses()}
263
264
 
264
265
  ${cssDenominationValueRowClasses()}
265
266
 
267
+ ${cssDenominationTransposedClasses()}
268
+
266
269
  @media (forced-colors: active) {
267
270
  .sw-denomination-label { border-inline-start-color: CanvasText; color: CanvasText; }
268
271
  .sw-denomination-strip .sw-denomination-label::before { background: CanvasText; forced-color-adjust: none; }
@@ -307,5 +310,6 @@ export function denominationGridClassCatalog() {
307
310
  ...denominationLabelClassCatalog(),
308
311
  ...denominationAppearanceClassCatalog(),
309
312
  ...denominationValueRowClassCatalog(),
313
+ ...denominationTransposedClassCatalog(),
310
314
  ];
311
315
  }
@@ -0,0 +1,4 @@
1
+ /** A grid whose entry counts keep room for `--sw-denomination-count-digits` digits. */
2
+ export declare const denominationCountDigitsClass = "sw-denomination-count-digits";
3
+ export declare function cssDenominationTransposedClasses(): string;
4
+ export declare function denominationTransposedClassCatalog(): string[];