@scalewing/react 1.65.0 → 1.67.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 (42) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +9 -0
  3. package/dist/components/Checkbox.d.ts +13 -1
  4. package/dist/components/Checkbox.js +6 -2
  5. package/dist/components/DenominationGrid.d.ts +1 -1
  6. package/dist/components/DenominationGrid.js +4 -2
  7. package/dist/components/Field.js +1 -0
  8. package/dist/components/RadioGroup.d.ts +12 -1
  9. package/dist/components/RadioGroup.js +6 -2
  10. package/dist/components/TaskList.d.ts +21 -2
  11. package/dist/components/TaskList.js +11 -6
  12. package/dist/components/checkbox/checkbox-appearance.d.ts +12 -0
  13. package/dist/components/checkbox/checkbox-appearance.js +16 -0
  14. package/dist/components/denomination-grid/TransposedStrip.d.ts +5 -3
  15. package/dist/components/denomination-grid/TransposedStrip.js +17 -9
  16. package/dist/components/denomination-grid/types.d.ts +9 -0
  17. package/dist/components/field/field-checks.d.ts +1 -1
  18. package/dist/components/field/field-checks.js +18 -1
  19. package/dist/components/field/field-props.d.ts +8 -0
  20. package/dist/components/radio-group/radio-group-description-layout.d.ts +9 -0
  21. package/dist/components/radio-group/radio-group-description-layout.js +11 -0
  22. package/dist/components/task-list/assert-task-list.d.ts +3 -0
  23. package/dist/components/task-list/assert-task-list.js +7 -0
  24. package/dist/css/css-checkbox-tile.d.ts +2 -0
  25. package/dist/css/css-checkbox-tile.js +67 -0
  26. package/dist/css/css-checkbox.js +4 -0
  27. package/dist/css/css-denomination-pin-end.d.ts +2 -0
  28. package/dist/css/css-denomination-pin-end.js +36 -0
  29. package/dist/css/css-denomination-transposed.js +4 -0
  30. package/dist/css/css-field-read-only.d.ts +2 -0
  31. package/dist/css/css-field-read-only.js +26 -0
  32. package/dist/css/css-field.js +4 -0
  33. package/dist/css/css-radio-group.js +5 -1
  34. package/dist/css/css-scroll-region.d.ts +6 -0
  35. package/dist/css/css-scroll-region.js +27 -0
  36. package/dist/css/css-task-list-layout.d.ts +6 -0
  37. package/dist/css/css-task-list-layout.js +67 -0
  38. package/dist/css/css-task-list.js +5 -1
  39. package/dist/index.d.ts +2 -2
  40. package/dist/index.js +2 -2
  41. package/dist/styles.css +128 -0
  42. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @scalewing/react
2
2
 
3
+ ## 1.67.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 17f6237: `DenominationGrid pinEnd`: while transposed, the last column (the last grid row's value line with its total, else its counts and total) stays in view at the inline end, with the end shade before it, while the columns between scroll (Teisoro F-001, request `docs/requests/teisoro-denomination-pin-end.md`). Needs `transposeBelow`; the default is unchanged. New classes `sw-denomination-scroll-pin-end`, `sw-denomination-transposed-end`. No new tokens or dependencies.
8
+
9
+ ## 1.66.0
10
+
11
+ ### Minor Changes
12
+
13
+ - ce2cb82: Four opt-in options for a form's choices and a setup checklist (Teisoro F-001, request `docs/requests/teisoro-choice-layouts.md`). Every default is unchanged.
14
+
15
+ - `Checkbox appearance="tile"` (`checkboxAppearances`): the box, label and description in a bordered tile as wide as its column, the whole tile one press target, with the accent edge while chosen and the danger edge while invalid. New classes `sw-checkbox-tile`, `sw-checkbox-tile-checked`, `sw-checkbox-tile-invalid`.
16
+ - `RadioGroup descriptionLayout="stacked"` (`radioGroupDescriptionLayouts`): every option's description on its own line under its label at every width. New class `sw-radio-group-stacked`.
17
+ - `Field variant="read-only"`: a value shown, not typed, on the subtle fill with no edge; needs one `readOnly` native input or textarea. New class `sw-field-read-only`.
18
+ - `TaskList numbered` and `actionBelow="md"`: open tasks show their place in their ring, and below md each action takes a full-width line under the words. New classes `sw-task-list-numbered`, `sw-task-list-action-below-md`.
19
+
20
+ No new tokens or dependencies.
21
+
3
22
  ## 1.65.0
4
23
 
5
24
  ### Minor Changes
package/README.md CHANGED
@@ -140,6 +140,8 @@ Import the CSS once at the application entry. Do not copy it into your source tr
140
140
 
141
141
  `TaskList` is a setup checklist: an `ol` (with `role="list"`, which Safari drops from a list without bullets) named by `label` holding one row per item of `items`, in order, a hairline between rows. Each item is `{ id, title, detail?, status, action? }` (`TaskListItem`): `status` (`taskListStatuses`: `'done' | 'next' | 'todo' | 'waiting'`, type `TaskListStatus`) draws a 24 px marker hidden from assistive technology, a different shape for each so colour is never the only cue: `done` a check on the success fill, `next` an accent ring round an accent dot, `todo` the grey hairline ring of a step ahead, and `waiting` a lock in the muted colour (waiting is not work that needs the person, so it is grey, not the warning amber). Then the `title` (label type, a waiting task's muted at the body weight), a muted caption `detail` under it, and `action` at the row's end, such as a small `Button`; the marker and the action sit on the row's middle, and on a narrow column an action that would leave the words less than half the row wraps to a line of its own at the row's end. Each title is read with its status word after a comma, as one visually hidden line ("Season, Done"; the drawn title is `aria-hidden`, as in a folded `Step`), then the detail, then the action. The words are English by default (`defaultTaskListLabels`: Done, Next step, To do, Waiting); `labels` (`Partial<TaskListLabels>`) takes yours, any you leave out or pass as `undefined` staying English. A row's text content holds the title twice (drawn, then spoken), so find a task in tests by its spoken line or by role. `action` may be a function given `{ titleId }`, the id of the drawn title, for the action's `aria-describedby` (or its `aria-labelledby` with its own id), so two "Change" buttons are told apart by their tasks out of the list. Scalewing holds no order rules and adds no `aria-current`: you set every status, and which action is the page's primary (the next task's, by convention) and which are `neutral`. On a coarse pointer the row's Buttons are 44 px like every Button, so rows grow. Forced colours draw every ring as a `CanvasText` border (the next one `Highlight`) and keep the check, dot and lock, which are borders. A blank `label`, status word, id, title or `detail`, a repeated id, or an unknown status throws a `RangeError`; an empty `items` draws an empty list. Other `ol` attributes (`className`, `id`, `data-*`, `aria-describedby`) pass through.
142
142
 
143
+ `TaskList` `numbered` (opt-in) draws each open task's place in the list (1, 2, …) inside its marker, so a step can be pointed at: a `todo` task's number in the muted colour on its grey ring, the `next` task's in the accent on the accent ring with its dot dropped (`CanvasText` in forced colours); `done` and `waiting` keep the check and the lock. The numbers are drawn only, as the list's own order says them. `actionBelow` (a layout breakpoint, `md`) moves each action, below that width, to a line of its own under the task's words, from where they start to the row's end, its control stretched to fill it: one full-width button per task on a phone. An unknown breakpoint throws a `RangeError`. New classes `sw-task-list-numbered`, `sw-task-list-action-below-md`.
144
+
143
145
  ```tsx
144
146
  <TaskList
145
147
  label="Get the spring survey ready"
@@ -242,6 +244,8 @@ A disabled native text control (`<input>`, `<select>` or `<textarea>` on the can
242
244
 
243
245
  `Field` `variant="search"` (default `"outlined"`; `fieldVariants`) is a search box over one native `<input>` child with a `value`: the `label` is not drawn but still names the input, which becomes `type="search"` (a `searchbox`); `leading` is your glyph at the frame's start, such as a magnifier, hidden from assistive technology; and while the input holds text and is enabled and not read-only, a clear button named `clearLabel` ("Clear search") ends the frame, puts focus back in the input and calls `onClear` (set the value to `''`); Escape with text calls `onClear` too. The browser's own clear button is hidden, so there is one. The input gets `enterKeyHint="search"` unless you pass one. The frame is the adorned field's, so focus, `error`, `description`, `invalid` and the disabled look work as on any field; a press on the glyph focuses the input; the clear button is the 44 px target on a coarse pointer. A search field without a nonempty `clearLabel` or `onClear`, with `prefix` or `suffix`, or with a child that is not an `<input>` with a `value` throws; `leading`, `clearLabel` and `onClear` on an outlined field, or an unknown `variant`, throw too.
244
246
 
247
+ `Field` `variant="read-only"` is a value shown in a form that the person cannot change there, such as the email an invitation went to: the label stays above, and the control keeps its size but drops its edge for the subtle fill, in the text colour with a plain cursor, so it reads as given rather than as a field to type in, and apart from a disabled field's dashed edge. The native control stays focusable, selectable and sent with the form; `description` works as on any field. Forced colours keep a dotted `CanvasText` edge. It needs one native `<input>` or `<textarea>` child with `readOnly`, and takes no `prefix`, `suffix`, `error`, `invalid` or `changed` (a `TypeError` otherwise): a value the person cannot change is never marked invalid or changed. New class `sw-field-read-only`.
248
+
245
249
  ```tsx
246
250
  <Field label="Drop amount" prefix="$">
247
251
  <input inputMode="decimal" name="drop" />
@@ -597,8 +601,12 @@ A toast can also be a corner card that confirms a save: `placement="top-end"` pu
597
601
 
598
602
  `Checkbox` `labelVisuallyHidden` (opt-in) keeps `label` as the checkbox's name but does not draw it, for a box that stands alone, such as a table's select column ("Select Mallard"); the box is then its own target, its drawn size (24 px) on a fine pointer and at least 44 × 44 px on a coarse one. `indeterminate` (opt-in) is the mixed state, such as "Select all" while only some rows are chosen: a dash on the accent fill (Highlight in forced colours), the native `indeterminate` property and `aria-checked="mixed"`, so Playwright's `toBeChecked({ indeterminate: true })` and `getByRole('checkbox', { checked: 'mixed' })` find it (Testing Library's `checked` query ignores the mixed state of a native checkbox; assert `aria-checked="mixed"` or the `indeterminate` property there). It wins over `checked` in the drawing and the state read out. A press reports `!checked` (with `checked` false: `true`, choose all); the box stays mixed until the props change.
599
603
 
604
+ `Checkbox` `appearance="tile"` (default `"plain"`; `checkboxAppearances`, `CheckboxAppearance`) draws the box, the label and the description inside a bordered tile (the md radius, a hairline in the border colour) as wide as its column, at least 52 px tall, for a set of choices laid out in a `Grid`, such as a store's services. The label's `::after` covers the whole tile, so a press anywhere on it, the description included, toggles the box; the name and description are unchanged. A chosen or mixed tile takes the accent edge and an invalid one the danger edge (which wins), each twice the hairline through an inset shadow so nothing moves; a disabled tile keeps its edge with its words faded. Forced colours draw the edges in `CanvasText`, `Highlight` and `Mark`. A tile with `labelVisuallyHidden`, or an unknown appearance, throws a `RangeError`. New classes `sw-checkbox-tile`, `sw-checkbox-tile-checked`, `sw-checkbox-tile-invalid`.
605
+
600
606
  `RadioGroup` is a controlled fieldset of native radio choices. Supply a unique nonempty `value` for each option, one selected `value` or an empty value for no selection, a `legend`, and `onChange`. Long labels wrap in a vertical group. The consumer provides localized option labels and validation `error`; `required` keeps native form semantics. An option's optional `icon` (a `ReactNode`, such as a Lucide glyph) sits between the radio and the label, in the text color and the option's gap; it is `aria-hidden`, so the radio's accessible name stays the `label` text, and a press on it chooses the option as the label does.
601
607
 
608
+ `RadioGroup` `descriptionLayout="stacked"` (default `"auto"`; `radioGroupDescriptionLayouts`, `RadioGroupDescriptionLayout`) puts every option's description on a second line under its label at every width, starting under the label's words, for long descriptions (what a role may do) that would otherwise sit far from their radio at the row's end on a wide screen. An unknown layout throws a `RangeError`. New class `sw-radio-group-stacked`.
609
+
602
610
  ```tsx
603
611
  <RadioGroup
604
612
  legend="Check type"
@@ -1661,6 +1669,7 @@ Values outside the catalog throw a `RangeError`. There is no per-breakpoint span
1661
1669
 
1662
1670
  - A row's `negativeAppearance="plain"` (`denominationNegativeAppearances`, default `"danger"`) sets its negative counts in the text colour with their minus. Use it for counts that go out by design, such as bills paid out: going out is not an error, so never red. `"danger"` stays for a shortage.
1663
1671
  - `transposeBelow="md"` (or `"lg"`; `denominationTransposeBreakpoints`; the strip layout only) draws the strip transposed below that width, for a phone. Each denomination is a row (its label and caption, pinned while the columns scroll), each grid row a column (its label over its counts, entry steppers or value line), and the totals a last row named by `totalLabel`. Names, entry, cell tones, the zero label and quiet and disabled rows are the strip's; a disabled row says so on its column heads. It reads the width with the breakpoint's media query, so a server render draws the strip, and crossing the breakpoint (turning a phone) remounts the grid, so a count being typed loses focus.
1672
+ - `pinEnd` (opt-in; needs `transposeBelow`, a `TypeError` otherwise) keeps the transposed grid's last column in view at the inline end while the columns between scroll: the last grid row's value line with its total (or, without one, its counts and total), on the glass fill with the end shade before it while there is more to scroll, so a phone always sees each denomination's worth and the total, as a long table keeps its total pinned. It changes nothing while the strip is not transposed. New classes `sw-denomination-scroll-pin-end`, `sw-denomination-transposed-end`.
1664
1673
  - `countDigits` (3 to 6, entry rows only) keeps that many digits' room in every entry count before the strip scrolls, such as 4 for counts in the thousands in seven columns. The default room is 3.
1665
1674
  - An unknown appearance or breakpoint, `transposeBelow` on tiles, or a `countDigits` out of range or without entry rows throws a `RangeError`.
1666
1675
 
@@ -1,3 +1,5 @@
1
+ import { type CheckboxAppearance } from './checkbox/checkbox-appearance.js';
2
+ export { checkboxAppearances, type CheckboxAppearance, } from './checkbox/checkbox-appearance.js';
1
3
  export type CheckboxProps = {
2
4
  label: string;
3
5
  checked: boolean;
@@ -23,5 +25,15 @@ export type CheckboxProps = {
23
25
  * stays mixed.
24
26
  */
25
27
  indeterminate?: boolean;
28
+ /**
29
+ * `plain` (default) draws the box beside its words. `tile` draws the box,
30
+ * the label and the description inside a bordered tile as wide as its
31
+ * column, the whole tile one press target, so a set of tiles in a `Grid`
32
+ * reads as a set of choices (a store's services, say). A chosen (or
33
+ * mixed) tile takes the accent edge, an invalid one the danger edge. A
34
+ * tile needs its label drawn: with `labelVisuallyHidden`, or with an
35
+ * unknown appearance, it throws a `RangeError`.
36
+ */
37
+ appearance?: CheckboxAppearance;
26
38
  };
27
- export declare function Checkbox({ label, checked, onCheckedChange, disabled, required, description, error, labelVisuallyHidden, indeterminate, }: CheckboxProps): import("react").JSX.Element;
39
+ export declare function Checkbox({ label, checked, onCheckedChange, disabled, required, description, error, labelVisuallyHidden, indeterminate, appearance, }: CheckboxProps): import("react").JSX.Element;
@@ -2,9 +2,13 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useId, useLayoutEffect, useRef } from 'react';
4
4
  import { cx } from '../class-names.js';
5
+ import { assertCheckboxAppearance, } from './checkbox/checkbox-appearance.js';
5
6
  import { CheckboxControl } from './checkbox/CheckboxControl.js';
6
7
  import { FieldErrorRegion } from './FieldErrorRegion.js';
7
- export function Checkbox({ label, checked, onCheckedChange, disabled = false, required = false, description, error, labelVisuallyHidden = false, indeterminate = false, }) {
8
+ export { checkboxAppearances, } from './checkbox/checkbox-appearance.js';
9
+ export function Checkbox({ label, checked, onCheckedChange, disabled = false, required = false, description, error, labelVisuallyHidden = false, indeterminate = false, appearance = 'plain', }) {
10
+ assertCheckboxAppearance(appearance, labelVisuallyHidden);
11
+ const tile = appearance === 'tile';
8
12
  const descriptionId = useId();
9
13
  const errorId = useId();
10
14
  const inputRef = useRef(null);
@@ -19,7 +23,7 @@ export function Checkbox({ label, checked, onCheckedChange, disabled = false, re
19
23
  if (inputRef.current)
20
24
  inputRef.current.indeterminate = indeterminate;
21
25
  });
22
- return (_jsxs("div", { className: "sw-checkbox", children: [_jsxs("label", { className: cx('sw-checkbox-label', labelVisuallyHidden && 'sw-checkbox-label-hidden'), children: [_jsx(CheckboxControl, { ref: inputRef, "aria-checked": indeterminate ? 'mixed' : undefined, "aria-describedby": describedBy || undefined, "aria-invalid": Boolean(error), checked: checked, disabled: disabled, onChange: (event) => {
26
+ return (_jsxs("div", { className: cx('sw-checkbox', tile && 'sw-checkbox-tile', tile && (checked || indeterminate) && 'sw-checkbox-tile-checked', tile && Boolean(error) && 'sw-checkbox-tile-invalid'), children: [_jsxs("label", { className: cx('sw-checkbox-label', labelVisuallyHidden && 'sw-checkbox-label-hidden'), children: [_jsx(CheckboxControl, { ref: inputRef, "aria-checked": indeterminate ? 'mixed' : undefined, "aria-describedby": describedBy || undefined, "aria-invalid": Boolean(error), checked: checked, disabled: disabled, onChange: (event) => {
23
27
  const input = event.currentTarget;
24
28
  // The press cleared the mixed state; keep it until the props say.
25
29
  input.indeterminate = indeterminate;
@@ -6,4 +6,4 @@ export type { DenominationCellToneAppearance, DenominationGridColumn, Denominati
6
6
  export { denominationNegativeAppearances, denominationTransposeBreakpoints, } from './denomination-grid/types.js';
7
7
  export type { DenominationLabelAppearance } from '../css/css-denomination-label.js';
8
8
  export { denominationCellToneAppearances, denominationGridFrames, denominationLabelAppearances, denominationTotalEmphases, };
9
- export declare function DenominationGrid({ label, columns, rows, layout, subtotal, zeroLabel, totalLabel, rowRole, labelWidth, labelAppearance, frame, totalEmphasis, cellToneAppearance, transposeBelow, countDigits, }: DenominationGridProps): import("react").JSX.Element;
9
+ export declare function DenominationGrid({ label, columns, rows, layout, subtotal, zeroLabel, totalLabel, rowRole, labelWidth, labelAppearance, frame, totalEmphasis, cellToneAppearance, transposeBelow, pinEnd, countDigits, }: DenominationGridProps): import("react").JSX.Element;
@@ -22,12 +22,14 @@ function assertOneOf(values, value, prop) {
22
22
  if (!values.includes(value))
23
23
  throw new RangeError(`Unknown ${prop}: ${String(value)}`);
24
24
  }
25
- export function DenominationGrid({ label, columns, rows, layout = 'strip', subtotal, zeroLabel = '—', totalLabel, rowRole = 'region', labelWidth, labelAppearance = 'tone', frame = 'none', totalEmphasis = 'default', cellToneAppearance = 'text', transposeBelow, countDigits, }) {
25
+ export function DenominationGrid({ label, columns, rows, layout = 'strip', subtotal, zeroLabel = '—', totalLabel, rowRole = 'region', labelWidth, labelAppearance = 'tone', frame = 'none', totalEmphasis = 'default', cellToneAppearance = 'text', transposeBelow, pinEnd = false, countDigits, }) {
26
26
  assertDenominationGrid(label, columns, rows);
27
27
  assertDenominationExtras(layout, columns, rows);
28
28
  assertDenominationEntries(layout, columns, rows);
29
29
  assertDenominationValueRows(layout, columns, rows);
30
30
  assertDenominationOptions(layout, rows, transposeBelow, countDigits);
31
+ if (pinEnd && transposeBelow === undefined)
32
+ throw new TypeError('DenominationGrid pinEnd needs transposeBelow');
31
33
  if (typeof zeroLabel !== 'string')
32
34
  throw new RangeError('zeroLabel must be a string');
33
35
  if (totalLabel !== undefined && !totalLabel.trim())
@@ -52,6 +54,6 @@ export function DenominationGrid({ label, columns, rows, layout = 'strip', subto
52
54
  if (layout === 'tiles')
53
55
  return (_jsx(DenominationTiles, { className: appearanceClass || undefined, columns: columns, label: label, rowRole: rowRole, rows: rows, subtotal: subtotal, zeroLabel: zeroLabel }));
54
56
  if (transposeBelow !== undefined && transposed)
55
- return (_jsx(TransposedStrip, { className: appearanceClass || undefined, columns: columns, label: label, rows: rows, style: countStyle, totalLabel: totalLabel, zeroLabel: zeroLabel }));
57
+ return (_jsx(TransposedStrip, { className: appearanceClass || undefined, columns: columns, label: label, rows: rows, pinEnd: pinEnd, style: countStyle, totalLabel: totalLabel, zeroLabel: zeroLabel }));
56
58
  return (_jsx(DenominationStrip, { className: appearanceClass || undefined, countStyle: countStyle, columns: columns, framed: frame === 'table', label: label, labelWidth: labelWidth, rows: rows, totalLabel: totalLabel, zeroLabel: zeroLabel }));
57
59
  }
@@ -36,6 +36,7 @@ export function Field(props) {
36
36
  size === 'xs' && 'sw-field-xs',
37
37
  marksInvalid && 'sw-field-invalid',
38
38
  search && 'sw-field-search-field',
39
+ variant === 'read-only' && 'sw-field-read-only',
39
40
  changed && !marksInvalid && 'sw-field-changed',
40
41
  width && 'sw-field-sized',
41
42
  width && fieldWidthClass(width),
@@ -1,5 +1,7 @@
1
1
  import { type RadioGroupOption } from './radio-group/RadioGroupOptionLabel.js';
2
+ import { type RadioGroupDescriptionLayout } from './radio-group/radio-group-description-layout.js';
2
3
  export type { RadioGroupOption };
4
+ export { radioGroupDescriptionLayouts, type RadioGroupDescriptionLayout, } from './radio-group/radio-group-description-layout.js';
3
5
  export type RadioGroupProps = {
4
6
  legend: string;
5
7
  value: string;
@@ -9,5 +11,14 @@ export type RadioGroupProps = {
9
11
  disabled?: boolean;
10
12
  description?: string;
11
13
  error?: string;
14
+ /**
15
+ * Where an option's description goes. `auto` (default): at the row's
16
+ * inline end while it fits beside the label, on a second line under the
17
+ * label when it does not or below md. `stacked`: always on a second line,
18
+ * starting under the label's words, so a long description (what a role
19
+ * may do, say) stays beside its radio on a wide screen. An unknown
20
+ * layout throws a `RangeError`.
21
+ */
22
+ descriptionLayout?: RadioGroupDescriptionLayout;
12
23
  };
13
- export declare function RadioGroup({ legend, value, onChange, options, required, disabled, description, error, }: RadioGroupProps): import("react").JSX.Element;
24
+ export declare function RadioGroup({ legend, value, onChange, options, required, disabled, description, error, descriptionLayout, }: RadioGroupProps): import("react").JSX.Element;
@@ -1,10 +1,14 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useId } from 'react';
4
+ import { cx } from '../class-names.js';
4
5
  import { FieldErrorRegion } from './FieldErrorRegion.js';
5
6
  import { RadioGroupOptionLabel, } from './radio-group/RadioGroupOptionLabel.js';
7
+ import { assertRadioGroupDescriptionLayout, } from './radio-group/radio-group-description-layout.js';
6
8
  import { radioTabStopValue } from '../tab-stop.js';
7
- export function RadioGroup({ legend, value, onChange, options, required = false, disabled = false, description, error, }) {
9
+ export { radioGroupDescriptionLayouts, } from './radio-group/radio-group-description-layout.js';
10
+ export function RadioGroup({ legend, value, onChange, options, required = false, disabled = false, description, error, descriptionLayout = 'auto', }) {
11
+ assertRadioGroupDescriptionLayout(descriptionLayout);
8
12
  const name = useId();
9
13
  const descriptionId = useId();
10
14
  const errorId = useId();
@@ -22,7 +26,7 @@ export function RadioGroup({ legend, value, onChange, options, required = false,
22
26
  if (value !== '' && !values.includes(value))
23
27
  throw new RangeError('value must match an option or be empty');
24
28
  const entry = radioTabStopValue(options, value);
25
- return (_jsxs("fieldset", { "aria-describedby": describedBy || undefined, "aria-invalid": Boolean(error), className: "sw-radio-group", disabled: disabled, children: [_jsx("legend", { className: "sw-radio-group-legend", children: legend }), description ? (_jsx("span", { className: "sw-radio-group-description", id: descriptionId, children: description })) : null, _jsx("span", { className: "sw-radio-group-options", children: options.map((option) => (_jsx(RadioGroupOptionLabel, { checked: value === option.value, name: name, onSelect: () => {
29
+ return (_jsxs("fieldset", { "aria-describedby": describedBy || undefined, "aria-invalid": Boolean(error), className: cx('sw-radio-group', descriptionLayout === 'stacked' && 'sw-radio-group-stacked'), disabled: disabled, children: [_jsx("legend", { className: "sw-radio-group-legend", children: legend }), description ? (_jsx("span", { className: "sw-radio-group-description", id: descriptionId, children: description })) : null, _jsx("span", { className: "sw-radio-group-options", children: options.map((option) => (_jsx(RadioGroupOptionLabel, { checked: value === option.value, name: name, onSelect: () => {
26
30
  if (!disabled && !option.disabled)
27
31
  onChange(option.value);
28
32
  }, option: option, required: required, isTabStop: option.value === entry }, option.value))) }), _jsx(FieldErrorRegion, { className: "sw-radio-group-error", id: errorId, message: error })] }));
@@ -1,4 +1,5 @@
1
1
  import { type HTMLAttributes } from 'react';
2
+ import { type Breakpoint } from '../css/breakpoints.js';
2
3
  import type { TaskListItem } from './task-list/task-list-item.js';
3
4
  import { type TaskListLabels } from './task-list/task-list-status.js';
4
5
  export type { TaskListActionContext, TaskListItem, } from './task-list/task-list-item.js';
@@ -10,13 +11,31 @@ export type TaskListProps = Omit<HTMLAttributes<HTMLOListElement>, 'aria-label'
10
11
  items: readonly TaskListItem[];
11
12
  /** The status words heard after each title. English by default. */
12
13
  labels?: Partial<TaskListLabels>;
14
+ /**
15
+ * Numbers the open tasks: a `todo` or `next` task's marker shows its
16
+ * place in the list (1, 2, …) inside its ring, in place of the empty ring
17
+ * and the dot, so "step 3" can be pointed at. Done and waiting markers
18
+ * keep their check and lock. The number is drawn only; the list's own
19
+ * order says it to assistive technology. Default `false`.
20
+ */
21
+ numbered?: boolean;
22
+ /**
23
+ * Below this breakpoint each action leaves the row's end for a line of its
24
+ * own under the task's words, as wide as them, its control stretched to
25
+ * fill it, so a phone shows one full-width button per task. Left out, an
26
+ * action stays at the row's end (wrapping only when it would squeeze the
27
+ * words). An unknown breakpoint throws a `RangeError`.
28
+ */
29
+ actionBelow?: Breakpoint;
13
30
  };
14
31
  /**
15
32
  * A setup checklist: an ordered list of tasks, each with a status marker
16
33
  * (done: a check on the success fill; next: an accent ring round a dot;
17
34
  * todo: a grey ring; waiting: a muted lock), its title, a muted detail
18
- * line and an optional action at the row's end. Each title is followed by
35
+ * line and an optional action at the row's end (or, with `actionBelow`,
36
+ * under the words on a narrow screen), the open tasks optionally numbered
37
+ * (`numbered`). Each title is followed by
19
38
  * its status word for assistive technology. Scalewing holds no order
20
39
  * rules: the consumer sets every task's status and action.
21
40
  */
22
- export declare function TaskList({ label, items, labels, className, ...rest }: TaskListProps): import("react").JSX.Element;
41
+ export declare function TaskList({ label, items, labels, numbered, actionBelow, className, ...rest }: TaskListProps): import("react").JSX.Element;
@@ -2,26 +2,31 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useId } from 'react';
4
4
  import { cx } from '../class-names.js';
5
- import { assertTaskList } from './task-list/assert-task-list.js';
5
+ import { taskListActionBelowClass } from '../css/css-task-list-layout.js';
6
+ import { assertActionBelow, assertTaskList, } from './task-list/assert-task-list.js';
6
7
  import { taskListWords, taskSpokenTitle, } from './task-list/task-list-status.js';
7
8
  export { defaultTaskListLabels, taskListStatuses, } from './task-list/task-list-status.js';
8
- function TaskRow({ item, labels, titleId, }) {
9
+ function TaskRow({ item, labels, titleId, number, }) {
9
10
  const action = typeof item.action === 'function' ? item.action({ titleId }) : item.action;
10
11
  const hasAction = action !== undefined && action !== null && action !== false;
11
- return (_jsxs("li", { className: cx('sw-task-list-item', `sw-task-list-item-${item.status}`), children: [_jsx("span", { "aria-hidden": "true", className: "sw-task-list-marker" }), _jsxs("span", { className: "sw-task-list-body", children: [_jsxs("span", { className: "sw-task-list-title", children: [_jsx("span", { "aria-hidden": "true", id: titleId, children: item.title }), _jsx("span", { className: "sw-sr-only", children: taskSpokenTitle(item.title, item.status, labels) })] }), item.detail !== undefined ? (_jsx("span", { className: "sw-task-list-detail", children: item.detail })) : null] }), hasAction ? _jsx("span", { className: "sw-task-list-action", children: action }) : null] }));
12
+ const open = item.status === 'todo' || item.status === 'next';
13
+ return (_jsxs("li", { className: cx('sw-task-list-item', `sw-task-list-item-${item.status}`), children: [_jsx("span", { "aria-hidden": "true", className: "sw-task-list-marker", children: number !== null && open ? number : null }), _jsxs("span", { className: "sw-task-list-body", children: [_jsxs("span", { className: "sw-task-list-title", children: [_jsx("span", { "aria-hidden": "true", id: titleId, children: item.title }), _jsx("span", { className: "sw-sr-only", children: taskSpokenTitle(item.title, item.status, labels) })] }), item.detail !== undefined ? (_jsx("span", { className: "sw-task-list-detail", children: item.detail })) : null] }), hasAction ? _jsx("span", { className: "sw-task-list-action", children: action }) : null] }));
12
14
  }
13
15
  /**
14
16
  * A setup checklist: an ordered list of tasks, each with a status marker
15
17
  * (done: a check on the success fill; next: an accent ring round a dot;
16
18
  * todo: a grey ring; waiting: a muted lock), its title, a muted detail
17
- * line and an optional action at the row's end. Each title is followed by
19
+ * line and an optional action at the row's end (or, with `actionBelow`,
20
+ * under the words on a narrow screen), the open tasks optionally numbered
21
+ * (`numbered`). Each title is followed by
18
22
  * its status word for assistive technology. Scalewing holds no order
19
23
  * rules: the consumer sets every task's status and action.
20
24
  */
21
- export function TaskList({ label, items, labels, className, ...rest }) {
25
+ export function TaskList({ label, items, labels, numbered = false, actionBelow, className, ...rest }) {
22
26
  const words = taskListWords(labels);
23
27
  assertTaskList(label, items, words);
28
+ assertActionBelow(actionBelow);
24
29
  const baseId = useId();
25
30
  // role="list" keeps the list a list where list-style: none drops it (Safari).
26
- return (_jsx("ol", { "aria-label": label, className: cx('sw-task-list', className), role: "list", ...rest, children: items.map((item, index) => (_jsx(TaskRow, { item: item, labels: words, titleId: `${baseId}-${index}` }, item.id))) }));
31
+ return (_jsx("ol", { "aria-label": label, className: cx('sw-task-list', numbered && 'sw-task-list-numbered', actionBelow && taskListActionBelowClass(actionBelow), className), role: "list", ...rest, children: items.map((item, index) => (_jsx(TaskRow, { item: item, labels: words, number: numbered ? index + 1 : null, titleId: `${baseId}-${index}` }, item.id))) }));
27
32
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * How a Checkbox is drawn: `plain` (the box beside its words) or `tile`
3
+ * (the box and its words inside a bordered tile that is one press target).
4
+ */
5
+ export declare const checkboxAppearances: readonly ["plain", "tile"];
6
+ export type CheckboxAppearance = (typeof checkboxAppearances)[number];
7
+ /**
8
+ * Fails closed on a Checkbox it cannot draw: an unknown appearance, or a
9
+ * tile whose words are hidden (a tile is a press target named by the words
10
+ * it draws).
11
+ */
12
+ export declare function assertCheckboxAppearance(appearance: CheckboxAppearance, labelVisuallyHidden: boolean): void;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * How a Checkbox is drawn: `plain` (the box beside its words) or `tile`
3
+ * (the box and its words inside a bordered tile that is one press target).
4
+ */
5
+ export const checkboxAppearances = ['plain', 'tile'];
6
+ /**
7
+ * Fails closed on a Checkbox it cannot draw: an unknown appearance, or a
8
+ * tile whose words are hidden (a tile is a press target named by the words
9
+ * it draws).
10
+ */
11
+ export function assertCheckboxAppearance(appearance, labelVisuallyHidden) {
12
+ if (!checkboxAppearances.includes(appearance))
13
+ throw new RangeError(`Unknown Checkbox appearance: ${String(appearance)}`);
14
+ if (appearance === 'tile' && labelVisuallyHidden)
15
+ throw new RangeError('A tile Checkbox draws its label');
16
+ }
@@ -1,6 +1,6 @@
1
1
  import { type CSSProperties } from 'react';
2
2
  import { type DenominationGridProps } from './types.js';
3
- type TransposedProps = Required<Pick<DenominationGridProps, 'label' | 'columns' | 'rows' | 'zeroLabel'>> & Pick<DenominationGridProps, 'totalLabel'> & {
3
+ type TransposedProps = Required<Pick<DenominationGridProps, 'label' | 'columns' | 'rows' | 'zeroLabel'>> & Pick<DenominationGridProps, 'totalLabel' | 'pinEnd'> & {
4
4
  /** The grid's appearance classes (cell tones), if any. */
5
5
  className?: string;
6
6
  /** The entry counts' room, as the strip's. */
@@ -11,7 +11,9 @@ type TransposedProps = Required<Pick<DenominationGridProps, 'label' | 'columns'
11
11
  * caption), a column per grid row (its counts, read-only or entered, then
12
12
  * its value line's values), and the totals in a last row named by
13
13
  * `totalLabel`. Names, entry, tones and the zero label are the strip's;
14
- * the denomination column stays in view while the columns scroll under it.
14
+ * the denomination column stays in view while the columns scroll under it,
15
+ * and with `pinEnd` the last column (the last grid row's value line, which
16
+ * holds its total, else its counts and total) stays in view at the end.
15
17
  */
16
- export declare function TransposedStrip({ className, style, label, columns, rows, zeroLabel, totalLabel, }: TransposedProps): import("react").JSX.Element;
18
+ export declare function TransposedStrip({ className, style, label, columns, rows, zeroLabel, totalLabel, pinEnd, }: TransposedProps): import("react").JSX.Element;
17
19
  export {};
@@ -7,6 +7,8 @@ import { CountCell } from './CountCell.js';
7
7
  import { EntryCell } from './EntryCell.js';
8
8
  import { RowLabelLine } from './RowLabelLine.js';
9
9
  import { hasValue, valueCellId } from './StripValueRow.js';
10
+ /** The class of the cells of the column pinned at the inline end. */
11
+ const endClass = 'sw-denomination-transposed-end';
10
12
  /** The look a grid row lends each of its cells in a column. */
11
13
  function columnClass(row) {
12
14
  return (cx(row.emphasis === 'quiet' && 'sw-denomination-transposed-quiet', row.disabled && 'sw-denomination-transposed-disabled') || undefined);
@@ -17,12 +19,12 @@ function columnClass(row) {
17
19
  * `aria-disabled`), as the strip's row does, since a column has no element
18
20
  * of its own.
19
21
  */
20
- function RowHeads({ row }) {
21
- return (_jsxs(_Fragment, { children: [_jsx("th", { "aria-disabled": row.disabled || undefined, className: cx('sw-denomination-head sw-denomination-transposed-head', columnClass(row)), scope: "col", children: _jsx(RowLabelLine, { row: row }) }), row.valueRow ? (_jsx("th", { "aria-disabled": row.disabled || undefined, "aria-label": `${row.label} ${row.valueRow.label}`, className: cx('sw-denomination-head sw-denomination-transposed-head', columnClass(row)), scope: "col", children: row.valueRow.label })) : null] }));
22
+ function RowHeads({ row, pinned, }) {
23
+ return (_jsxs(_Fragment, { children: [_jsx("th", { "aria-disabled": row.disabled || undefined, className: cx('sw-denomination-head sw-denomination-transposed-head', columnClass(row), pinned && !row.valueRow && endClass), scope: "col", children: _jsx(RowLabelLine, { row: row }) }), row.valueRow ? (_jsx("th", { "aria-disabled": row.disabled || undefined, "aria-label": `${row.label} ${row.valueRow.label}`, className: cx('sw-denomination-head sw-denomination-transposed-head', columnClass(row), pinned && endClass), scope: "col", children: row.valueRow.label })) : null] }));
22
24
  }
23
25
  /** A grid row's total: under its value line when it has one, else under its counts. */
24
- function RowTotal({ row }) {
25
- const total = (_jsx("td", { className: cx('sw-denomination-transposed-total', `sw-denomination-row-${row.tone ?? 'neutral'}`, columnClass(row)), children: row.total ?? '' }));
26
+ function RowTotal({ row, pinned, }) {
27
+ const total = (_jsx("td", { className: cx('sw-denomination-transposed-total', `sw-denomination-row-${row.tone ?? 'neutral'}`, columnClass(row), pinned && endClass), children: row.total ?? '' }));
26
28
  return row.valueRow ? (_jsxs(_Fragment, { children: [_jsx("td", { className: columnClass(row) }), total] })) : (total);
27
29
  }
28
30
  /**
@@ -30,14 +32,20 @@ function RowTotal({ row }) {
30
32
  * caption), a column per grid row (its counts, read-only or entered, then
31
33
  * its value line's values), and the totals in a last row named by
32
34
  * `totalLabel`. Names, entry, tones and the zero label are the strip's;
33
- * the denomination column stays in view while the columns scroll under it.
35
+ * the denomination column stays in view while the columns scroll under it,
36
+ * and with `pinEnd` the last column (the last grid row's value line, which
37
+ * holds its total, else its counts and total) stays in view at the end.
34
38
  */
35
- export function TransposedStrip({ className, style, label, columns, rows, zeroLabel, totalLabel, }) {
39
+ export function TransposedStrip({ className, style, label, columns, rows, zeroLabel, totalLabel, pinEnd = false, }) {
36
40
  const idPrefix = useId();
41
+ const last = rows.length - 1;
42
+ const pinned = (rowIndex) => pinEnd && rowIndex === last;
43
+ /** A count cell is the pinned one when its row has no value line after it. */
44
+ const countEnd = (row, rowIndex) => pinned(rowIndex) && !row.valueRow && endClass;
37
45
  const hasTotals = rows.some((row) => row.total !== undefined);
38
- return (_jsx(ScrollRegion, { "aria-label": label, className: "sw-denomination-scroll sw-denomination-scroll-transposed", children: _jsxs("table", { className: cx('sw-denomination-grid sw-denomination-transposed', rows.some((row) => row.entry) && 'sw-denomination-transposed-entry', className), style: style, children: [_jsx("caption", { className: "sw-sr-only", children: label }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("td", { className: "sw-denomination-corner" }), rows.map((row) => (_jsx(RowHeads, { row: row }, row.id)))] }) }), _jsx("tbody", { children: columns.map((column, index) => (_jsxs("tr", { className: "sw-denomination-row", children: [_jsx("th", { className: "sw-denomination-transposed-label", scope: "row", children: _jsx(ColumnHeadText, { column: column }) }), rows.map((row, rowIndex) => {
46
+ return (_jsx(ScrollRegion, { "aria-label": label, className: cx('sw-denomination-scroll sw-denomination-scroll-transposed', pinEnd && 'sw-denomination-scroll-pin-end'), children: _jsxs("table", { className: cx('sw-denomination-grid sw-denomination-transposed', rows.some((row) => row.entry) && 'sw-denomination-transposed-entry', className), style: style, children: [_jsx("caption", { className: "sw-sr-only", children: label }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("td", { className: "sw-denomination-corner" }), rows.map((row, rowIndex) => (_jsx(RowHeads, { pinned: pinned(rowIndex), row: row }, row.id)))] }) }), _jsx("tbody", { children: columns.map((column, index) => (_jsxs("tr", { className: "sw-denomination-row", children: [_jsx("th", { className: "sw-denomination-transposed-label", scope: "row", children: _jsx(ColumnHeadText, { column: column }) }), rows.map((row, rowIndex) => {
39
47
  const value = row.valueRow?.cells[index];
40
48
  const valueId = valueCellId(idPrefix, rowIndex, index);
41
- return (_jsxs(Fragment, { children: [row.entry ? (_jsx(EntryCell, { className: columnClass(row), column: column, describedBy: hasValue(value) ? valueId : undefined, entry: row.entry, index: index, row: row })) : (_jsx(CountCell, { className: columnClass(row), index: index, row: row, zeroLabel: zeroLabel })), row.valueRow ? (_jsx("td", { className: cx('sw-denomination-transposed-value', columnClass(row)), id: valueId, children: hasValue(value) ? value : '' })) : null] }, row.id));
42
- })] }, column.key))) }), hasTotals ? (_jsx("tfoot", { children: _jsxs("tr", { className: "sw-denomination-row", children: [totalLabel === undefined ? (_jsx("td", { className: "sw-denomination-corner" })) : (_jsx("th", { className: "sw-denomination-transposed-label", scope: "row", children: totalLabel })), rows.map((row) => (_jsx(RowTotal, { row: row }, row.id)))] }) })) : null] }) }));
49
+ return (_jsxs(Fragment, { children: [row.entry ? (_jsx(EntryCell, { className: cx(columnClass(row), countEnd(row, rowIndex)), column: column, describedBy: hasValue(value) ? valueId : undefined, entry: row.entry, index: index, row: row })) : (_jsx(CountCell, { className: cx(columnClass(row), countEnd(row, rowIndex)), index: index, row: row, zeroLabel: zeroLabel })), row.valueRow ? (_jsx("td", { className: cx('sw-denomination-transposed-value', columnClass(row), pinned(rowIndex) && endClass), id: valueId, children: hasValue(value) ? value : '' })) : null] }, row.id));
50
+ })] }, column.key))) }), hasTotals ? (_jsx("tfoot", { children: _jsxs("tr", { className: "sw-denomination-row", children: [totalLabel === undefined ? (_jsx("td", { className: "sw-denomination-corner" })) : (_jsx("th", { className: "sw-denomination-transposed-label", scope: "row", children: totalLabel })), rows.map((row, rowIndex) => (_jsx(RowTotal, { pinned: pinned(rowIndex), row: row }, row.id)))] }) })) : null] }) }));
43
51
  }
@@ -188,6 +188,15 @@ export type DenominationGridProps = {
188
188
  * and zero label are the strip's. The `strip` layout only.
189
189
  */
190
190
  transposeBelow?: DenominationTransposeBreakpoint;
191
+ /**
192
+ * While transposed, the last column (the last grid row's value line,
193
+ * which holds its total, else its counts and total) stays in view at the
194
+ * inline end, as the denomination column does at the start, and only the
195
+ * columns between them scroll, so a phone always sees each row's worth
196
+ * and the total. It needs `transposeBelow` (a `TypeError` otherwise) and
197
+ * changes nothing while the strip is not transposed.
198
+ */
199
+ pinEnd?: boolean;
191
200
  /**
192
201
  * The digits an entry count holds without clipping, from 3 (the
193
202
  * default room) to 6: a column of steppers keeps that many digits'
@@ -1,6 +1,6 @@
1
1
  import { type KeyboardEvent } from 'react';
2
2
  import type { FieldProps } from './field-props.js';
3
- export declare const fieldVariants: readonly ["outlined", "search"];
3
+ export declare const fieldVariants: readonly ["outlined", "search", "read-only"];
4
4
  export type FieldVariant = (typeof fieldVariants)[number];
5
5
  /** The props Field reads from, and sets on, its native control child. */
6
6
  export type FieldControlProps = {
@@ -1,7 +1,14 @@
1
1
  import { isValidElement } from 'react';
2
2
  import { assertFieldWidth } from '../../css/css-field-width.js';
3
3
  import { assertFieldDescriptionTone } from './FieldDescription.js';
4
- export const fieldVariants = ['outlined', 'search'];
4
+ export const fieldVariants = ['outlined', 'search', 'read-only'];
5
+ /** A read-only field draws one native input or textarea that is `readOnly`. */
6
+ function assertReadOnlyChild(child) {
7
+ if (!isValidElement(child) ||
8
+ (child.type !== 'input' && child.type !== 'textarea') ||
9
+ child.props.readOnly !== true)
10
+ throw new TypeError('A read-only Field needs one native input or textarea child with readOnly');
11
+ }
5
12
  /**
6
13
  * Fails closed on a Field it cannot draw: an unknown variant, width or
7
14
  * description tone, search props on an outlined field, and a search field
@@ -13,6 +20,16 @@ export function assertFieldProps(props, child) {
13
20
  assertFieldDescriptionTone(descriptionTone);
14
21
  if (!fieldVariants.includes(variant))
15
22
  throw new RangeError(`Unknown Field variant: ${String(variant)}`);
23
+ if (variant === 'read-only') {
24
+ assertReadOnlyChild(child);
25
+ if (props.prefix || props.suffix)
26
+ throw new TypeError('A read-only Field takes no prefix or suffix');
27
+ // A value the person cannot change cannot be invalid or changed here.
28
+ if (props.error !== undefined ||
29
+ props.invalid !== undefined ||
30
+ props.changed !== undefined)
31
+ throw new TypeError('A read-only Field takes no error, invalid or changed');
32
+ }
16
33
  if (variant !== 'search') {
17
34
  if (props.leading !== undefined ||
18
35
  props.clearLabel !== undefined ||
@@ -61,6 +61,14 @@ export type FieldProps = {
61
61
  * clear button named `clearLabel` shows while the input holds text and
62
62
  * is enabled; it calls `onClear` (set the value to `''`) and puts focus
63
63
  * back in the input. Needs one native `input` child with a `value`.
64
+ * `read-only` is a value shown in a form that the person cannot change
65
+ * there, such as the email an invitation was sent to: the label above a
66
+ * borderless box on the subtle fill, in the text colour, so it reads as
67
+ * given rather than as a field to type in (and apart from a disabled
68
+ * field's dashed edge). It keeps the native control, so the value is
69
+ * still focusable, selectable and sent with the form. Needs one native
70
+ * `input` or `textarea` child with `readOnly` and takes no prefix,
71
+ * suffix, `error`, `invalid` or `changed` (a `TypeError` otherwise).
64
72
  */
65
73
  variant?: FieldVariant;
66
74
  /** A search field's glyph at its start, such as a magnifier; hidden from assistive technology. */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Where a RadioGroup option's description goes: `auto` (at the row's end
3
+ * while it fits, under the label otherwise and below md) or `stacked`
4
+ * (always under the label).
5
+ */
6
+ export declare const radioGroupDescriptionLayouts: readonly ["auto", "stacked"];
7
+ export type RadioGroupDescriptionLayout = (typeof radioGroupDescriptionLayouts)[number];
8
+ /** Fails closed on a description layout RadioGroup does not have. */
9
+ export declare function assertRadioGroupDescriptionLayout(layout: RadioGroupDescriptionLayout): void;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Where a RadioGroup option's description goes: `auto` (at the row's end
3
+ * while it fits, under the label otherwise and below md) or `stacked`
4
+ * (always under the label).
5
+ */
6
+ export const radioGroupDescriptionLayouts = ['auto', 'stacked'];
7
+ /** Fails closed on a description layout RadioGroup does not have. */
8
+ export function assertRadioGroupDescriptionLayout(layout) {
9
+ if (!radioGroupDescriptionLayouts.includes(layout))
10
+ throw new RangeError(`Unknown RadioGroup descriptionLayout: ${String(layout)}`);
11
+ }
@@ -1,5 +1,8 @@
1
+ import { type Breakpoint } from '../../css/breakpoints.js';
1
2
  import { type TaskListLabels } from './task-list-status.js';
2
3
  import type { TaskListItem } from './task-list-item.js';
4
+ /** Fails closed on an `actionBelow` that is not a layout breakpoint. */
5
+ export declare function assertActionBelow(actionBelow: Breakpoint | undefined): void;
3
6
  /**
4
7
  * Fails closed on what would leave a task unnamed or unread: a blank list
5
8
  * label or status word, a blank or repeated id, a blank title or detail,
@@ -1,4 +1,11 @@
1
+ import { breakpoints } from '../../css/breakpoints.js';
1
2
  import { isTaskListStatus, taskListStatuses, } from './task-list-status.js';
3
+ /** Fails closed on an `actionBelow` that is not a layout breakpoint. */
4
+ export function assertActionBelow(actionBelow) {
5
+ if (actionBelow !== undefined &&
6
+ !breakpoints.includes(actionBelow))
7
+ throw new RangeError(`TaskList actionBelow must be one of ${breakpoints.join(', ')}`);
8
+ }
2
9
  function isBlank(value) {
3
10
  return typeof value !== 'string' || !value.trim();
4
11
  }
@@ -0,0 +1,2 @@
1
+ export declare function cssCheckboxTileClasses(): string;
2
+ export declare function checkboxTileClassCatalog(): string[];
@@ -0,0 +1,67 @@
1
+ /** Where a tile's description and error start: under the label's words. */
2
+ const besideBox = 'calc(var(--sw-space-5) + var(--sw-space-2))';
3
+ /** A tile's chosen or invalid edge: its border plus an inset hairline, so nothing moves. */
4
+ function edge(color) {
5
+ return `border-color: ${color};
6
+ box-shadow: inset 0 0 0 1px ${color};`;
7
+ }
8
+ /*
9
+ * A tile Checkbox: the box, the label and the description inside one
10
+ * bordered tile as wide as its column, at least the 44 px target plus its
11
+ * padding. The label's `::after` stretches over the whole tile, so a press
12
+ * anywhere on it (the description included) toggles the box. A chosen or
13
+ * mixed tile takes the accent edge, an invalid one the danger edge (which
14
+ * wins), twice the hairline through an inset shadow. The description and
15
+ * the error start under the label's words. Forced colours keep the edges
16
+ * as CanvasText, Highlight and Mark.
17
+ */
18
+ export function cssCheckboxTileClasses() {
19
+ return `.sw-checkbox-tile {
20
+ border: 1px solid var(--sw-color-border);
21
+ border-radius: var(--sw-radius-md);
22
+ box-sizing: border-box;
23
+ gap: 0;
24
+ padding: var(--sw-space-2) var(--sw-space-3);
25
+ position: relative;
26
+ width: 100%;
27
+ }
28
+
29
+ .sw-checkbox-tile .sw-checkbox-label {
30
+ min-height: var(--sw-control-sm-min-height);
31
+ width: 100%;
32
+ }
33
+
34
+ .sw-checkbox-tile .sw-checkbox-label::after {
35
+ border-radius: inherit;
36
+ content: '';
37
+ inset: 0;
38
+ position: absolute;
39
+ }
40
+
41
+ .sw-checkbox-tile :is(.sw-checkbox-description, .sw-checkbox-error) {
42
+ padding-inline-start: ${besideBox};
43
+ }
44
+
45
+ .sw-checkbox-tile-checked {
46
+ ${edge('var(--sw-color-accent)')}
47
+ }
48
+
49
+ .sw-checkbox-tile-invalid {
50
+ ${edge('var(--sw-color-danger)')}
51
+ }
52
+
53
+ .sw-checkbox-tile:has(.sw-checkbox-input:disabled) { cursor: not-allowed; }
54
+
55
+ @media (forced-colors: active) {
56
+ .sw-checkbox-tile { border-color: CanvasText; }
57
+ .sw-checkbox-tile-checked { border-color: Highlight; box-shadow: inset 0 0 0 1px Highlight; }
58
+ .sw-checkbox-tile-invalid { border-color: Mark; box-shadow: inset 0 0 0 1px Mark; }
59
+ }`;
60
+ }
61
+ export function checkboxTileClassCatalog() {
62
+ return [
63
+ 'sw-checkbox-tile',
64
+ 'sw-checkbox-tile-checked',
65
+ 'sw-checkbox-tile-invalid',
66
+ ];
67
+ }
@@ -1,5 +1,6 @@
1
1
  import { typographyVariants } from '@scalewing/tokens';
2
2
  import { checkStrokeIn } from './chevron.js';
3
+ import { checkboxTileClassCatalog, cssCheckboxTileClasses, } from './css-checkbox-tile.js';
3
4
  import { coarsePointerQuery, touchTarget } from './touch-target.js';
4
5
  const label = typographyVariants.label;
5
6
  const caption = typographyVariants.caption;
@@ -135,6 +136,8 @@ export function cssCheckboxClasses() {
135
136
  .sw-checkbox-error { color: var(--sw-color-danger); }
136
137
  .sw-checkbox-error:empty { position: absolute; }
137
138
 
139
+ ${cssCheckboxTileClasses()}
140
+
138
141
  @media (prefers-reduced-transparency: reduce) {
139
142
  .sw-checkbox-mark { background: var(--sw-color-surface); }
140
143
  .sw-checkbox-input:is(:checked, :indeterminate) + .sw-checkbox-mark { background: var(--sw-color-accent); }
@@ -158,5 +161,6 @@ export function checkboxClassCatalog() {
158
161
  'sw-checkbox-text',
159
162
  'sw-checkbox-description',
160
163
  'sw-checkbox-error',
164
+ ...checkboxTileClassCatalog(),
161
165
  ];
162
166
  }
@@ -0,0 +1,2 @@
1
+ export declare function cssDenominationPinEndClasses(): string;
2
+ export declare function denominationPinEndClassCatalog(): string[];
@@ -0,0 +1,36 @@
1
+ import { pinnedEndShadeRules } from './css-scroll-region.js';
2
+ import { zIndex } from './stacking.js';
3
+ const region = '.sw-denomination-scroll-pin-end';
4
+ const end = '.sw-denomination-transposed-end';
5
+ /*
6
+ * A transposed strip with `pinEnd`: the last column stays in view at the
7
+ * inline end, on the glass fill as the pinned denomination column is (its
8
+ * value cells and a quiet row's cells keep their subtle fill over the
9
+ * blur), and casts the end shade just before it while there is more to
10
+ * scroll to. A disabled last row cannot fade its pinned cells (the columns
11
+ * scrolling under them would show through), so they stay opaque and their
12
+ * words take the muted colour instead.
13
+ */
14
+ export function cssDenominationPinEndClasses() {
15
+ return `${region} ${end} {
16
+ backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
17
+ -webkit-backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
18
+ inset-inline-end: 0;
19
+ position: sticky;
20
+ ${zIndex('stickyCell')}
21
+ }
22
+
23
+ ${region} ${end}:not(.sw-denomination-transposed-value, .sw-denomination-transposed-quiet) {
24
+ background-color: var(--sw-glass-fill);
25
+ }
26
+
27
+ ${region} .sw-denomination-grid.sw-denomination-transposed ${end}.sw-denomination-transposed-disabled {
28
+ color: var(--sw-color-muted);
29
+ opacity: 1;
30
+ }
31
+
32
+ ${pinnedEndShadeRules(region, [end])}`;
33
+ }
34
+ export function denominationPinEndClassCatalog() {
35
+ return ['sw-denomination-scroll-pin-end', 'sw-denomination-transposed-end'];
36
+ }
@@ -1,4 +1,5 @@
1
1
  import { typographyVariants } from '@scalewing/tokens';
2
+ import { cssDenominationPinEndClasses, denominationPinEndClassCatalog, } from './css-denomination-pin-end.js';
2
3
  import { pinnedStartShadeRules } from './css-scroll-region.js';
3
4
  import { zIndex } from './stacking.js';
4
5
  const body = typographyVariants.body;
@@ -158,6 +159,8 @@ function countRules() {
158
159
  export function cssDenominationTransposedClasses() {
159
160
  return `${transposedRules()}
160
161
 
162
+ ${cssDenominationPinEndClasses()}
163
+
161
164
  ${countRules()}`;
162
165
  }
163
166
  export function denominationTransposedClassCatalog() {
@@ -174,5 +177,6 @@ export function denominationTransposedClassCatalog() {
174
177
  'sw-denomination-cell-signed',
175
178
  'sw-denomination-cell-plain',
176
179
  denominationCountDigitsClass,
180
+ ...denominationPinEndClassCatalog(),
177
181
  ];
178
182
  }
@@ -0,0 +1,2 @@
1
+ export declare function cssFieldReadOnlyClasses(): string;
2
+ export declare function fieldReadOnlyClassCatalog(): string[];
@@ -0,0 +1,26 @@
1
+ /*
2
+ * A read-only Field: a value shown, not typed. The control keeps its size
3
+ * and padding but drops the edge for the subtle fill, in the text colour
4
+ * with a plain cursor, so it reads apart from an editable field (an edge
5
+ * on the glass fill) and a disabled one (a dashed edge). Focus keeps the
6
+ * canvas ring. Forced colours drop the fill, so the edge stays, dotted, in
7
+ * CanvasText.
8
+ */
9
+ export function cssFieldReadOnlyClasses() {
10
+ return `[data-theme] .sw-field-read-only > :is(input, textarea) {
11
+ background-color: var(--sw-color-subtle);
12
+ border-color: transparent;
13
+ color: var(--sw-color-text);
14
+ cursor: default;
15
+ }
16
+
17
+ @media (forced-colors: active) {
18
+ [data-theme] .sw-field-read-only > :is(input, textarea) {
19
+ border-color: CanvasText;
20
+ border-style: dotted;
21
+ }
22
+ }`;
23
+ }
24
+ export function fieldReadOnlyClassCatalog() {
25
+ return ['sw-field-read-only'];
26
+ }
@@ -2,6 +2,7 @@ import { typographyVariants } from '@scalewing/tokens';
2
2
  import { controlSurface, disabledControlForcedColors, disabledControlSurface, } from './css-document.js';
3
3
  import { cssFieldChangedClasses } from './css-field-changed.js';
4
4
  import { cssFieldDescriptionClasses, fieldDescriptionClassCatalog, } from './css-field-description.js';
5
+ import { cssFieldReadOnlyClasses, fieldReadOnlyClassCatalog, } from './css-field-read-only.js';
5
6
  import { cssFieldWidthClasses, fieldWidthClassCatalog, } from './css-field-width.js';
6
7
  import { cssFieldSearchClasses, fieldSearchClassCatalog, } from './css-field-search.js';
7
8
  const caption = typographyVariants.caption;
@@ -88,6 +89,8 @@ ${cssFieldDescriptionClasses()}
88
89
 
89
90
  ${adornmentRules()}
90
91
 
92
+ ${cssFieldReadOnlyClasses()}
93
+
91
94
  ${cssFieldSearchClasses()}
92
95
 
93
96
  ${cssFieldChangedClasses()}
@@ -117,6 +120,7 @@ export function fieldClassCatalog() {
117
120
  'sw-field-prefix',
118
121
  'sw-field-suffix',
119
122
  ...fieldSearchClassCatalog(),
123
+ ...fieldReadOnlyClassCatalog(),
120
124
  ...fieldWidthClassCatalog(),
121
125
  ];
122
126
  }
@@ -193,11 +193,15 @@ function optionDescriptionRules() {
193
193
 
194
194
  @media ${breakpointQuery('below', 'md')} {
195
195
  .sw-radio-group-option-description { flex-basis: 100%; }
196
- }`;
196
+ }
197
+
198
+ /* Stacked: every description on its own line under its label, at any width. */
199
+ .sw-radio-group-stacked .sw-radio-group-option-description { flex-basis: 100%; }`;
197
200
  }
198
201
  export function radioGroupClassCatalog() {
199
202
  return [
200
203
  'sw-radio-group',
204
+ 'sw-radio-group-stacked',
201
205
  'sw-radio-group-legend',
202
206
  'sw-radio-group-options',
203
207
  'sw-radio-group-option',
@@ -51,3 +51,9 @@ export declare function scrollRegionClassCatalog(): string[];
51
51
  * draw no shade here either.
52
52
  */
53
53
  export declare function pinnedStartShadeRules(region: string, pinned: readonly string[]): string;
54
+ /**
55
+ * The end-side twin of `pinnedStartShadeRules`: a region whose end column
56
+ * is pinned hides its end shade under that column, so the column casts the
57
+ * shade just before its inline start, drawn by its `::before`.
58
+ */
59
+ export declare function pinnedEndShadeRules(region: string, pinned: readonly string[]): string;
@@ -139,3 +139,30 @@ ${after(':dir(rtl)')} {
139
139
  ${after('').replaceAll('\n', '\n ')} { display: none; }
140
140
  }`;
141
141
  }
142
+ /**
143
+ * The end-side twin of `pinnedStartShadeRules`: a region whose end column
144
+ * is pinned hides its end shade under that column, so the column casts the
145
+ * shade just before its inline start, drawn by its `::before`.
146
+ */
147
+ export function pinnedEndShadeRules(region, pinned) {
148
+ const before = (direction) => pinned
149
+ .map((cell) => `${region}.sw-scroll-more-end${direction} ${cell}::before`)
150
+ .join(',\n');
151
+ return `${before('')} {
152
+ background: linear-gradient(to left, ${scrollShadeColor}, transparent);
153
+ content: '';
154
+ inset-block: 0;
155
+ inset-inline-end: 100%;
156
+ pointer-events: none;
157
+ position: absolute;
158
+ width: var(--sw-space-5);
159
+ }
160
+
161
+ ${before(':dir(rtl)')} {
162
+ background: linear-gradient(to right, ${scrollShadeColor}, transparent);
163
+ }
164
+
165
+ @media (forced-colors: active) {
166
+ ${before('').replaceAll('\n', '\n ')} { display: none; }
167
+ }`;
168
+ }
@@ -0,0 +1,6 @@
1
+ import { type Breakpoint } from './breakpoints.js';
2
+ /** The class that puts a TaskList's actions under the words below `breakpoint`. */
3
+ export declare function taskListActionBelowClass(breakpoint: Breakpoint): string;
4
+ /** A TaskList's optional layouts: numbered open tasks, actions under the words. */
5
+ export declare function cssTaskListLayoutClasses(): string;
6
+ export declare function taskListLayoutClassCatalog(): string[];
@@ -0,0 +1,67 @@
1
+ import { typographyVariants } from '@scalewing/tokens';
2
+ import { breakpointQuery, breakpoints, } from './breakpoints.js';
3
+ const label = typographyVariants.label;
4
+ const caption = typographyVariants.caption;
5
+ /** Where the words start: the marker's side (space 5) and the row's gap (space 3). */
6
+ const wordsStart = 'calc(var(--sw-space-5) + var(--sw-space-3))';
7
+ const openMarker = ':is(.sw-task-list-item-todo, .sw-task-list-item-next) .sw-task-list-marker';
8
+ /** The class that puts a TaskList's actions under the words below `breakpoint`. */
9
+ export function taskListActionBelowClass(breakpoint) {
10
+ return `sw-task-list-action-below-${breakpoint}`;
11
+ }
12
+ /*
13
+ * A numbered list draws an open task's place inside its ring, at the
14
+ * caption size and the label weight: a todo task's number in the muted
15
+ * colour on the hairline ring, the next task's in the accent on the accent
16
+ * ring, its dot dropped. Forced colours draw the numbers in CanvasText.
17
+ */
18
+ function numberedRules() {
19
+ return `.sw-task-list-numbered ${openMarker} {
20
+ font-family: var(--sw-font-sans);
21
+ font-size: ${caption.fontSize}px;
22
+ font-weight: ${label.fontWeight};
23
+ line-height: 1;
24
+ }
25
+
26
+ .sw-task-list-numbered .sw-task-list-item-todo .sw-task-list-marker {
27
+ color: var(--sw-color-muted);
28
+ }
29
+
30
+ .sw-task-list-numbered .sw-task-list-item-next .sw-task-list-marker {
31
+ color: var(--sw-color-accent);
32
+ }
33
+
34
+ .sw-task-list-numbered .sw-task-list-item-next .sw-task-list-marker::after {
35
+ content: none;
36
+ }
37
+
38
+ @media (forced-colors: active) {
39
+ .sw-task-list-numbered ${openMarker} { color: CanvasText; }
40
+ }`;
41
+ }
42
+ /*
43
+ * Below the breakpoint each action takes a line of its own under the
44
+ * words, starting where they start and as wide as them, and its control
45
+ * stretches to fill that line.
46
+ */
47
+ function actionBelowRules(breakpoint) {
48
+ const list = `.${taskListActionBelowClass(breakpoint)}`;
49
+ return `@media ${breakpointQuery('below', breakpoint)} {
50
+ ${list} .sw-task-list-action {
51
+ display: flex;
52
+ flex-basis: calc(100% - ${wordsStart});
53
+ margin-inline-start: ${wordsStart};
54
+ }
55
+ ${list} .sw-task-list-action > * { flex: 1 1 auto; }
56
+ }`;
57
+ }
58
+ /** A TaskList's optional layouts: numbered open tasks, actions under the words. */
59
+ export function cssTaskListLayoutClasses() {
60
+ return [numberedRules(), ...breakpoints.map(actionBelowRules)].join('\n\n');
61
+ }
62
+ export function taskListLayoutClassCatalog() {
63
+ return [
64
+ 'sw-task-list-numbered',
65
+ ...breakpoints.map(taskListActionBelowClass),
66
+ ];
67
+ }
@@ -1,5 +1,6 @@
1
1
  import { typographyVariants } from '@scalewing/tokens';
2
2
  import { checkStrokeIn } from './chevron.js';
3
+ import { cssTaskListLayoutClasses, taskListLayoutClassCatalog, } from './css-task-list-layout.js';
3
4
  const body = typographyVariants.body;
4
5
  const caption = typographyVariants.caption;
5
6
  const label = typographyVariants.label;
@@ -163,7 +164,9 @@ export function cssTaskListClasses() {
163
164
 
164
165
  ${markerRules()}
165
166
 
166
- ${forcedColorRules()}`;
167
+ ${forcedColorRules()}
168
+
169
+ ${cssTaskListLayoutClasses()}`;
167
170
  }
168
171
  export function taskListClassCatalog() {
169
172
  return [
@@ -178,5 +181,6 @@ export function taskListClassCatalog() {
178
181
  'sw-task-list-title',
179
182
  'sw-task-list-detail',
180
183
  'sw-task-list-action',
184
+ ...taskListLayoutClassCatalog(),
181
185
  ];
182
186
  }
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ export { inspectMarkdown, markdownOmissionKinds, MarkdownView, type MarkdownHead
14
14
  export { ListRow, type ListRowProps } from './components/ListRow.js';
15
15
  export { listGroupVariants, listRowTitleAppearances, listRowTones, listRowValueTones, type ListGroupMaxHeight, type ListGroupVariant, type ListRowTitleAppearance, type ListRowTone, type ListRowValueTone, } from './list-options.js';
16
16
  export { listTileColumnCounts, type ListGroupTileColumns, } from './css/css-list-tiles.js';
17
- export { Checkbox, type CheckboxProps } from './components/Checkbox.js';
17
+ export { Checkbox, checkboxAppearances, type CheckboxAppearance, type CheckboxProps, } from './components/Checkbox.js';
18
18
  export { PasteRows, type PasteRowsColumn, type PasteRowsProps, } from './components/PasteRows.js';
19
19
  export { parsePastedRows, type PastedRows, type PastedRowsDelimiter, pastedRowsDelimiters, } from './components/paste-rows/parse-pasted-rows.js';
20
20
  export { Spinner, type SpinnerProps, type SpinnerSize, } from './components/Spinner.js';
@@ -26,7 +26,7 @@ export { Notice, noticeTones, noticeVariants, type NoticeProps, type NoticeRole,
26
26
  export { Progress, progressTones, type ProgressProps, type ProgressTone, } from './components/Progress.js';
27
27
  export { Tooltip, type TooltipProps, type TooltipRelationship, } from './components/Tooltip.js';
28
28
  export { InfoTip, type InfoTipProps } from './components/InfoTip.js';
29
- export { RadioGroup, type RadioGroupOption, type RadioGroupProps, } from './components/RadioGroup.js';
29
+ export { RadioGroup, radioGroupDescriptionLayouts, type RadioGroupDescriptionLayout, type RadioGroupOption, type RadioGroupProps, } from './components/RadioGroup.js';
30
30
  export { AppHeader, appHeaderAppearances, type AppHeaderAppearance, type AppHeaderProps, } from './components/AppHeader.js';
31
31
  export { Badge, type BadgeProps, type BadgeSize, type BadgeTone, badgeSizes, badgeTones, } from './components/Badge.js';
32
32
  export { BarChart, barChartAppearances, type BarChartAppearance, type BarChartItem, type BarChartProps, type BarChartTone, barChartTones, } from './components/BarChart.js';
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ export { inspectMarkdown, markdownOmissionKinds, MarkdownView, } from './compone
13
13
  export { ListRow } from './components/ListRow.js';
14
14
  export { listGroupVariants, listRowTitleAppearances, listRowTones, listRowValueTones, } from './list-options.js';
15
15
  export { listTileColumnCounts, } from './css/css-list-tiles.js';
16
- export { Checkbox } from './components/Checkbox.js';
16
+ export { Checkbox, checkboxAppearances, } from './components/Checkbox.js';
17
17
  export { PasteRows, } from './components/PasteRows.js';
18
18
  export { parsePastedRows, pastedRowsDelimiters, } from './components/paste-rows/parse-pasted-rows.js';
19
19
  export { Spinner, } from './components/Spinner.js';
@@ -25,7 +25,7 @@ export { Notice, noticeTones, noticeVariants, } from './components/Notice.js';
25
25
  export { Progress, progressTones, } from './components/Progress.js';
26
26
  export { Tooltip, } from './components/Tooltip.js';
27
27
  export { InfoTip } from './components/InfoTip.js';
28
- export { RadioGroup, } from './components/RadioGroup.js';
28
+ export { RadioGroup, radioGroupDescriptionLayouts, } from './components/RadioGroup.js';
29
29
  export { AppHeader, appHeaderAppearances, } from './components/AppHeader.js';
30
30
  export { Badge, badgeSizes, badgeTones, } from './components/Badge.js';
31
31
  export { BarChart, barChartAppearances, barChartTones, } from './components/BarChart.js';
package/dist/styles.css CHANGED
@@ -1296,6 +1296,50 @@ body {
1296
1296
  .sw-checkbox-error { color: var(--sw-color-danger); }
1297
1297
  .sw-checkbox-error:empty { position: absolute; }
1298
1298
 
1299
+ .sw-checkbox-tile {
1300
+ border: 1px solid var(--sw-color-border);
1301
+ border-radius: var(--sw-radius-md);
1302
+ box-sizing: border-box;
1303
+ gap: 0;
1304
+ padding: var(--sw-space-2) var(--sw-space-3);
1305
+ position: relative;
1306
+ width: 100%;
1307
+ }
1308
+
1309
+ .sw-checkbox-tile .sw-checkbox-label {
1310
+ min-height: var(--sw-control-sm-min-height);
1311
+ width: 100%;
1312
+ }
1313
+
1314
+ .sw-checkbox-tile .sw-checkbox-label::after {
1315
+ border-radius: inherit;
1316
+ content: '';
1317
+ inset: 0;
1318
+ position: absolute;
1319
+ }
1320
+
1321
+ .sw-checkbox-tile :is(.sw-checkbox-description, .sw-checkbox-error) {
1322
+ padding-inline-start: calc(var(--sw-space-5) + var(--sw-space-2));
1323
+ }
1324
+
1325
+ .sw-checkbox-tile-checked {
1326
+ border-color: var(--sw-color-accent);
1327
+ box-shadow: inset 0 0 0 1px var(--sw-color-accent);
1328
+ }
1329
+
1330
+ .sw-checkbox-tile-invalid {
1331
+ border-color: var(--sw-color-danger);
1332
+ box-shadow: inset 0 0 0 1px var(--sw-color-danger);
1333
+ }
1334
+
1335
+ .sw-checkbox-tile:has(.sw-checkbox-input:disabled) { cursor: not-allowed; }
1336
+
1337
+ @media (forced-colors: active) {
1338
+ .sw-checkbox-tile { border-color: CanvasText; }
1339
+ .sw-checkbox-tile-checked { border-color: Highlight; box-shadow: inset 0 0 0 1px Highlight; }
1340
+ .sw-checkbox-tile-invalid { border-color: Mark; box-shadow: inset 0 0 0 1px Mark; }
1341
+ }
1342
+
1299
1343
  @media (prefers-reduced-transparency: reduce) {
1300
1344
  .sw-checkbox-mark { background: var(--sw-color-surface); }
1301
1345
  .sw-checkbox-input:is(:checked, :indeterminate) + .sw-checkbox-mark { background: var(--sw-color-accent); }
@@ -1462,6 +1506,9 @@ body {
1462
1506
  .sw-radio-group-option-description { flex-basis: 100%; }
1463
1507
  }
1464
1508
 
1509
+ /* Stacked: every description on its own line under its label, at any width. */
1510
+ .sw-radio-group-stacked .sw-radio-group-option-description { flex-basis: 100%; }
1511
+
1465
1512
  .sw-radio-group-description,
1466
1513
  .sw-radio-group-error {
1467
1514
  font-family: var(--sw-font-sans);
@@ -10412,6 +10459,41 @@ html:has(.sw-site-header-sticky) .sw-docs-layout {
10412
10459
  .sw-denomination-transposed-total { color: CanvasText; }
10413
10460
  }
10414
10461
 
10462
+ .sw-denomination-scroll-pin-end .sw-denomination-transposed-end {
10463
+ backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
10464
+ -webkit-backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
10465
+ inset-inline-end: 0;
10466
+ position: sticky;
10467
+ z-index: 1;
10468
+ }
10469
+
10470
+ .sw-denomination-scroll-pin-end .sw-denomination-transposed-end:not(.sw-denomination-transposed-value, .sw-denomination-transposed-quiet) {
10471
+ background-color: var(--sw-glass-fill);
10472
+ }
10473
+
10474
+ .sw-denomination-scroll-pin-end .sw-denomination-grid.sw-denomination-transposed .sw-denomination-transposed-end.sw-denomination-transposed-disabled {
10475
+ color: var(--sw-color-muted);
10476
+ opacity: 1;
10477
+ }
10478
+
10479
+ .sw-denomination-scroll-pin-end.sw-scroll-more-end .sw-denomination-transposed-end::before {
10480
+ background: linear-gradient(to left, color-mix(in srgb, var(--sw-color-text) 28%, transparent), transparent);
10481
+ content: '';
10482
+ inset-block: 0;
10483
+ inset-inline-end: 100%;
10484
+ pointer-events: none;
10485
+ position: absolute;
10486
+ width: var(--sw-space-5);
10487
+ }
10488
+
10489
+ .sw-denomination-scroll-pin-end.sw-scroll-more-end:dir(rtl) .sw-denomination-transposed-end::before {
10490
+ background: linear-gradient(to right, color-mix(in srgb, var(--sw-color-text) 28%, transparent), transparent);
10491
+ }
10492
+
10493
+ @media (forced-colors: active) {
10494
+ .sw-denomination-scroll-pin-end.sw-scroll-more-end .sw-denomination-transposed-end::before { display: none; }
10495
+ }
10496
+
10415
10497
  .sw-denomination-cell-signed.sw-denomination-cell-positive {
10416
10498
  color: var(--sw-color-success);
10417
10499
  }
@@ -10547,6 +10629,20 @@ html:has(.sw-site-header-sticky) .sw-docs-layout {
10547
10629
 
10548
10630
  [data-theme] .sw-field-adorned > input:disabled { background: transparent; }
10549
10631
 
10632
+ [data-theme] .sw-field-read-only > :is(input, textarea) {
10633
+ background-color: var(--sw-color-subtle);
10634
+ border-color: transparent;
10635
+ color: var(--sw-color-text);
10636
+ cursor: default;
10637
+ }
10638
+
10639
+ @media (forced-colors: active) {
10640
+ [data-theme] .sw-field-read-only > :is(input, textarea) {
10641
+ border-color: CanvasText;
10642
+ border-style: dotted;
10643
+ }
10644
+ }
10645
+
10550
10646
  .sw-field-adorned.sw-field-search {
10551
10647
  gap: var(--sw-space-2);
10552
10648
  padding-inline-end: 0;
@@ -11233,6 +11329,38 @@ html:has(.sw-site-header-sticky) .sw-docs-layout {
11233
11329
  .sw-task-list-item-waiting .sw-task-list-title { color: GrayText; }
11234
11330
  }
11235
11331
 
11332
+ .sw-task-list-numbered :is(.sw-task-list-item-todo, .sw-task-list-item-next) .sw-task-list-marker {
11333
+ font-family: var(--sw-font-sans);
11334
+ font-size: 13px;
11335
+ font-weight: 600;
11336
+ line-height: 1;
11337
+ }
11338
+
11339
+ .sw-task-list-numbered .sw-task-list-item-todo .sw-task-list-marker {
11340
+ color: var(--sw-color-muted);
11341
+ }
11342
+
11343
+ .sw-task-list-numbered .sw-task-list-item-next .sw-task-list-marker {
11344
+ color: var(--sw-color-accent);
11345
+ }
11346
+
11347
+ .sw-task-list-numbered .sw-task-list-item-next .sw-task-list-marker::after {
11348
+ content: none;
11349
+ }
11350
+
11351
+ @media (forced-colors: active) {
11352
+ .sw-task-list-numbered :is(.sw-task-list-item-todo, .sw-task-list-item-next) .sw-task-list-marker { color: CanvasText; }
11353
+ }
11354
+
11355
+ @media not all and (min-width: 48rem) {
11356
+ .sw-task-list-action-below-md .sw-task-list-action {
11357
+ display: flex;
11358
+ flex-basis: calc(100% - calc(var(--sw-space-5) + var(--sw-space-3)));
11359
+ margin-inline-start: calc(var(--sw-space-5) + var(--sw-space-3));
11360
+ }
11361
+ .sw-task-list-action-below-md .sw-task-list-action > * { flex: 1 1 auto; }
11362
+ }
11363
+
11236
11364
  .sw-split {
11237
11365
  align-items: stretch;
11238
11366
  align-self: start;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalewing/react",
3
- "version": "1.65.0",
3
+ "version": "1.67.0",
4
4
  "description": "Scalewing DOM components and package-owned CSS utilities.",
5
5
  "type": "module",
6
6
  "license": "MIT",