@ac-kit/ui-common 0.2.0 → 0.3.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 (190) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +59 -3
  3. package/dist/adapter/_anchor.d.ts.map +1 -0
  4. package/dist/adapter/_anchor.js.map +1 -0
  5. package/dist/adapter/_dom.d.ts.map +1 -0
  6. package/dist/adapter/_dom.js.map +1 -0
  7. package/dist/{preact → adapter}/_live-announcer.d.ts +1 -1
  8. package/dist/adapter/_live-announcer.d.ts.map +1 -0
  9. package/dist/{preact → adapter}/_live-announcer.js +1 -1
  10. package/dist/adapter/_live-announcer.js.map +1 -0
  11. package/dist/adapter/join-classes.d.ts.map +1 -0
  12. package/dist/adapter/join-classes.js.map +1 -0
  13. package/dist/bit-grid/bit-grid.d.ts +151 -0
  14. package/dist/bit-grid/bit-grid.d.ts.map +1 -0
  15. package/dist/bit-grid/bit-grid.js +201 -0
  16. package/dist/bit-grid/bit-grid.js.map +1 -0
  17. package/dist/index.d.ts +2 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +2 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/preact/bit-grid.d.ts +39 -0
  22. package/dist/preact/bit-grid.d.ts.map +1 -0
  23. package/dist/preact/bit-grid.js +72 -0
  24. package/dist/preact/bit-grid.js.map +1 -0
  25. package/dist/preact/button.d.ts.map +1 -1
  26. package/dist/preact/button.js +1 -1
  27. package/dist/preact/button.js.map +1 -1
  28. package/dist/preact/dialog.d.ts.map +1 -1
  29. package/dist/preact/dialog.js +1 -1
  30. package/dist/preact/dialog.js.map +1 -1
  31. package/dist/preact/index.d.ts +3 -1
  32. package/dist/preact/index.d.ts.map +1 -1
  33. package/dist/preact/index.js +3 -1
  34. package/dist/preact/index.js.map +1 -1
  35. package/dist/preact/knob.d.ts.map +1 -1
  36. package/dist/preact/knob.js +1 -1
  37. package/dist/preact/knob.js.map +1 -1
  38. package/dist/preact/menu-button.d.ts.map +1 -1
  39. package/dist/preact/menu-button.js +3 -3
  40. package/dist/preact/menu-button.js.map +1 -1
  41. package/dist/preact/meter.d.ts.map +1 -1
  42. package/dist/preact/meter.js +1 -1
  43. package/dist/preact/meter.js.map +1 -1
  44. package/dist/preact/progress-ring.d.ts.map +1 -1
  45. package/dist/preact/progress-ring.js +1 -1
  46. package/dist/preact/progress-ring.js.map +1 -1
  47. package/dist/preact/radio-group.d.ts.map +1 -1
  48. package/dist/preact/radio-group.js +1 -1
  49. package/dist/preact/radio-group.js.map +1 -1
  50. package/dist/preact/readout.d.ts.map +1 -1
  51. package/dist/preact/readout.js +1 -1
  52. package/dist/preact/readout.js.map +1 -1
  53. package/dist/preact/slider.d.ts.map +1 -1
  54. package/dist/preact/slider.js +1 -1
  55. package/dist/preact/slider.js.map +1 -1
  56. package/dist/preact/spin-button.d.ts.map +1 -1
  57. package/dist/preact/spin-button.js +2 -2
  58. package/dist/preact/spin-button.js.map +1 -1
  59. package/dist/preact/swatch-strip.d.ts +30 -0
  60. package/dist/preact/swatch-strip.d.ts.map +1 -0
  61. package/dist/preact/swatch-strip.js +17 -0
  62. package/dist/preact/swatch-strip.js.map +1 -0
  63. package/dist/preact/switch.js +1 -1
  64. package/dist/preact/switch.js.map +1 -1
  65. package/dist/preact/tabs.d.ts.map +1 -1
  66. package/dist/preact/tabs.js +2 -2
  67. package/dist/preact/tabs.js.map +1 -1
  68. package/dist/preact/toaster.d.ts.map +1 -1
  69. package/dist/preact/toaster.js +2 -2
  70. package/dist/preact/toaster.js.map +1 -1
  71. package/dist/preact/toggle-button.d.ts.map +1 -1
  72. package/dist/preact/toggle-button.js +1 -1
  73. package/dist/preact/toggle-button.js.map +1 -1
  74. package/dist/preact/toolbar.d.ts.map +1 -1
  75. package/dist/preact/toolbar.js +2 -2
  76. package/dist/preact/toolbar.js.map +1 -1
  77. package/dist/preact/tooltip.d.ts.map +1 -1
  78. package/dist/preact/tooltip.js +2 -2
  79. package/dist/preact/tooltip.js.map +1 -1
  80. package/dist/preact/tree.d.ts.map +1 -1
  81. package/dist/preact/tree.js +2 -2
  82. package/dist/preact/tree.js.map +1 -1
  83. package/dist/react/_props.d.ts +22 -0
  84. package/dist/react/_props.d.ts.map +1 -0
  85. package/dist/react/_props.js +14 -0
  86. package/dist/react/_props.js.map +1 -0
  87. package/dist/react/bit-grid.d.ts +40 -0
  88. package/dist/react/bit-grid.d.ts.map +1 -0
  89. package/dist/react/bit-grid.js +71 -0
  90. package/dist/react/bit-grid.js.map +1 -0
  91. package/dist/react/button.d.ts +60 -0
  92. package/dist/react/button.d.ts.map +1 -0
  93. package/dist/react/button.js +34 -0
  94. package/dist/react/button.js.map +1 -0
  95. package/dist/react/dialog.d.ts +44 -0
  96. package/dist/react/dialog.d.ts.map +1 -0
  97. package/dist/react/dialog.js +91 -0
  98. package/dist/react/dialog.js.map +1 -0
  99. package/dist/react/index.d.ts +22 -0
  100. package/dist/react/index.d.ts.map +1 -0
  101. package/dist/react/index.js +22 -0
  102. package/dist/react/index.js.map +1 -0
  103. package/dist/react/knob.d.ts +55 -0
  104. package/dist/react/knob.d.ts.map +1 -0
  105. package/dist/react/knob.js +144 -0
  106. package/dist/react/knob.js.map +1 -0
  107. package/dist/react/menu-button.d.ts +147 -0
  108. package/dist/react/menu-button.d.ts.map +1 -0
  109. package/dist/react/menu-button.js +342 -0
  110. package/dist/react/menu-button.js.map +1 -0
  111. package/dist/react/meter.d.ts +34 -0
  112. package/dist/react/meter.d.ts.map +1 -0
  113. package/dist/react/meter.js +23 -0
  114. package/dist/react/meter.js.map +1 -0
  115. package/dist/react/progress-ring.d.ts +42 -0
  116. package/dist/react/progress-ring.d.ts.map +1 -0
  117. package/dist/react/progress-ring.js +28 -0
  118. package/dist/react/progress-ring.js.map +1 -0
  119. package/dist/react/radio-group.d.ts +52 -0
  120. package/dist/react/radio-group.d.ts.map +1 -0
  121. package/dist/react/radio-group.js +30 -0
  122. package/dist/react/radio-group.js.map +1 -0
  123. package/dist/react/readout.d.ts +23 -0
  124. package/dist/react/readout.d.ts.map +1 -0
  125. package/dist/react/readout.js +13 -0
  126. package/dist/react/readout.js.map +1 -0
  127. package/dist/react/slider.d.ts +44 -0
  128. package/dist/react/slider.d.ts.map +1 -0
  129. package/dist/react/slider.js +167 -0
  130. package/dist/react/slider.js.map +1 -0
  131. package/dist/react/spin-button.d.ts +71 -0
  132. package/dist/react/spin-button.d.ts.map +1 -0
  133. package/dist/react/spin-button.js +132 -0
  134. package/dist/react/spin-button.js.map +1 -0
  135. package/dist/react/swatch-strip.d.ts +31 -0
  136. package/dist/react/swatch-strip.d.ts.map +1 -0
  137. package/dist/react/swatch-strip.js +17 -0
  138. package/dist/react/swatch-strip.js.map +1 -0
  139. package/dist/react/switch.d.ts +26 -0
  140. package/dist/react/switch.d.ts.map +1 -0
  141. package/dist/react/switch.js +19 -0
  142. package/dist/react/switch.js.map +1 -0
  143. package/dist/react/tabs.d.ts +95 -0
  144. package/dist/react/tabs.d.ts.map +1 -0
  145. package/dist/react/tabs.js +274 -0
  146. package/dist/react/tabs.js.map +1 -0
  147. package/dist/react/toaster.d.ts +43 -0
  148. package/dist/react/toaster.d.ts.map +1 -0
  149. package/dist/react/toaster.js +368 -0
  150. package/dist/react/toaster.js.map +1 -0
  151. package/dist/react/toggle-button.d.ts +37 -0
  152. package/dist/react/toggle-button.d.ts.map +1 -0
  153. package/dist/react/toggle-button.js +22 -0
  154. package/dist/react/toggle-button.js.map +1 -0
  155. package/dist/react/toolbar.d.ts +25 -0
  156. package/dist/react/toolbar.d.ts.map +1 -0
  157. package/dist/react/toolbar.js +143 -0
  158. package/dist/react/toolbar.js.map +1 -0
  159. package/dist/react/tooltip.d.ts +68 -0
  160. package/dist/react/tooltip.d.ts.map +1 -0
  161. package/dist/react/tooltip.js +165 -0
  162. package/dist/react/tooltip.js.map +1 -0
  163. package/dist/react/tree.d.ts +94 -0
  164. package/dist/react/tree.d.ts.map +1 -0
  165. package/dist/react/tree.js +422 -0
  166. package/dist/react/tree.js.map +1 -0
  167. package/dist/react/use-element-binding.d.ts +35 -0
  168. package/dist/react/use-element-binding.d.ts.map +1 -0
  169. package/dist/react/use-element-binding.js +51 -0
  170. package/dist/react/use-element-binding.js.map +1 -0
  171. package/dist/swatch-strip/swatch-strip.d.ts +60 -0
  172. package/dist/swatch-strip/swatch-strip.d.ts.map +1 -0
  173. package/dist/swatch-strip/swatch-strip.js +60 -0
  174. package/dist/swatch-strip/swatch-strip.js.map +1 -0
  175. package/package.json +38 -15
  176. package/styles.css +191 -1
  177. package/dist/preact/_anchor.d.ts.map +0 -1
  178. package/dist/preact/_anchor.js.map +0 -1
  179. package/dist/preact/_dom.d.ts.map +0 -1
  180. package/dist/preact/_dom.js.map +0 -1
  181. package/dist/preact/_live-announcer.d.ts.map +0 -1
  182. package/dist/preact/_live-announcer.js.map +0 -1
  183. package/dist/preact/join-classes.d.ts.map +0 -1
  184. package/dist/preact/join-classes.js.map +0 -1
  185. /package/dist/{preact → adapter}/_anchor.d.ts +0 -0
  186. /package/dist/{preact → adapter}/_anchor.js +0 -0
  187. /package/dist/{preact → adapter}/_dom.d.ts +0 -0
  188. /package/dist/{preact → adapter}/_dom.js +0 -0
  189. /package/dist/{preact → adapter}/join-classes.d.ts +0 -0
  190. /package/dist/{preact → adapter}/join-classes.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # @ac-kit/ui-common
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5c203e7: Two displays join the controls.
8
+
9
+ - `BitGrid` (`/preact`, `/react`) shows bytes as a grid of bits or hex bytes.
10
+ Cells that differ from a `reference` are filled, named byte ranges
11
+ (`fields`) are tinted and listed in a legend, and with `onActivate` a cell
12
+ can be clicked or activated with Enter or Space, the chosen one marked by
13
+ `selectedIndex`. It is a WAI-ARIA `grid` with one tab stop, the arrows,
14
+ Home and End, read-only without `onActivate`. The core exports
15
+ `bitGridCells`, `bitGridCellLabel`, `bitGridKeyIndex`, `bitGridAttributes`
16
+ and `BIT_GRID_FIELD_TONES`.
17
+ - `SwatchStrip` (`/preact`, `/react`) shows a row of colours as named swatches
18
+ or as one gradient, with hard stops unless an `interpolation` space is given.
19
+ The core exports `swatchStripGradient`, `swatchStripItemLabel` and
20
+ `swatchStripSummary`.
21
+
22
+ `styles.css` styles both through `--ack-bit-grid-*` and `--ack-swatch-strip-*`
23
+ custom properties.
24
+ - 5c203e7: New `@ac-kit/ui-common/react` subpath: every Preact component (`Knob`, `Slider`, `ToggleButton`, `Readout`, `Meter`, `Switch`, `RadioGroup`, `Button`, `IconButton`, `Toolbar`, `Dialog`, `MenuButton` and its items, `Tooltip`, `Toaster`, `Tabs` and its parts, `ProgressRing`, `SpinButton`, `Tree`) for React 18 and 19, with the same props, classes, `data-*` and ARIA attributes, plus `useElementBinding`, `useLatest` and `joinClasses`. Components take `className` beside `class`; `onChange` keeps its once-per-gesture meaning; `Button`, `IconButton`, `ToggleButton` and `MenuButton` forward a `ref` to their button. `react` and `react-dom` are optional peer dependencies, as `@types/react` is. Single taps and long presses now settle 32 ms after their deadline, through `@ac-kit/ui-gesture`'s new `deadlineGrace`.
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [5c203e7]
29
+ - Updated dependencies [5c203e7]
30
+ - Updated dependencies [5c203e7]
31
+ - Updated dependencies [5c203e7]
32
+ - Updated dependencies [5c203e7]
33
+ - Updated dependencies [5c203e7]
34
+ - Updated dependencies [5c203e7]
35
+ - Updated dependencies [5c203e7]
36
+ - Updated dependencies [5c203e7]
37
+ - Updated dependencies [5c203e7]
38
+ - Updated dependencies [5c203e7]
39
+ - Updated dependencies [5c203e7]
40
+ - Updated dependencies [5c203e7]
41
+ - Updated dependencies [5c203e7]
42
+ - Updated dependencies [5c203e7]
43
+ - Updated dependencies [5c203e7]
44
+ - Updated dependencies [5c203e7]
45
+ - Updated dependencies [5c203e7]
46
+ - Updated dependencies [5c203e7]
47
+ - Updated dependencies [5c203e7]
48
+ - Updated dependencies [5c203e7]
49
+ - @ac-kit/algo@0.7.0
50
+ - @ac-kit/core@0.14.0
51
+ - @ac-kit/format-svg@0.2.0
52
+ - @ac-kit/math-geometry@0.5.0
53
+ - @ac-kit/math-linear@0.5.0
54
+ - @ac-kit/math-scalar@0.5.0
55
+ - @ac-kit/ui-gesture@0.2.0
56
+ - @ac-kit/browser@0.4.1
57
+
3
58
  ## 0.2.0
4
59
 
5
60
  ### Minor Changes
package/README.md CHANGED
@@ -4,7 +4,8 @@ Generic controls for the browser, touch first: a knob turned by dragging up
4
4
  and down, a slider, a toggle button, a hardware-style readout, a level meter,
5
5
  a switch, a radio group, buttons, a toolbar with roving focus, a modal
6
6
  dialog, a menu button, a tooltip, toasts, tabs, a progress ring, a spin
7
- button and a tree view. Each one is a headless core — its
7
+ button and a tree view, and two displays: a bit grid and a swatch strip. Each
8
+ one is a headless core — its
8
9
  state and behaviour as plain functions and data, with no framework and no
9
10
  DOM — and a component per framework over it, styled only through CSS custom
10
11
  properties.
@@ -100,6 +101,17 @@ tests anywhere. Every function is pure and every time is passed in.
100
101
  - **Meter.** `meterAttributes` — the `meter` role with its range and a value
101
102
  kept inside it; `meterLitCount` maps a level to the lit segments of a scale
102
103
  of `MeterSegment`s (a threshold and a tone each), in O(log n).
104
+ - **Bit grid.** `bitGridCells` — bytes as cells of bits (most or least
105
+ significant first) or hex bytes, each marked `changed` against a reference
106
+ and with the named field (`BitGridField`, a byte range) that holds it, in
107
+ O(n); `bitGridCellLabel`, what a screen reader says for a cell;
108
+ `bitGridKeyIndex`, the WAI-ARIA grid key map (arrows without wrapping,
109
+ Home and End, with Control the grid's ends); `bitGridAttributes`, the
110
+ `grid` role, read-only unless a cell can be activated.
111
+ - **Swatch strip.** `swatchStripGradient` — the CSS `linear-gradient()` of a
112
+ row of colours, with hard stops so the browser blends nothing, or blended in
113
+ a named colour space; `swatchStripItemLabel` and `swatchStripSummary`, the
114
+ names a screen reader reads for a swatch and for a whole gradient.
103
115
  - **Tabs.** `tabListAttributes` (the `tablist` role, named,
104
116
  `aria-orientation` when vertical), `tabAttributes` (`aria-selected`,
105
117
  `aria-controls`, one tab stop, disabled but focusable),
@@ -151,7 +163,20 @@ peer dependency: install the one you use, and nothing else is pulled in.
151
163
 
152
164
  | subpath | framework | components |
153
165
  | -------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------- |
154
- | `@ac-kit/ui-common/preact` | Preact 11 | `Knob`, `Slider`, `ToggleButton`, `Readout`, `Meter`, `Switch`, `RadioGroup`, `Button`, `IconButton`, `Toolbar`, `Dialog`, `MenuButton` (with `MenuItem`, `MenuItemCheckbox`, `MenuItemRadio`, `MenuGroup`, `MenuSeparator`), `Tooltip`, `Toaster`, `Tabs` (with `TabList`, `Tab`, `TabPanel`), `ProgressRing`, `SpinButton`, `Tree` |
166
+ | `@ac-kit/ui-common/preact` | Preact 11 | `Knob`, `Slider`, `ToggleButton`, `Readout`, `Meter`, `Switch`, `RadioGroup`, `Button`, `IconButton`, `Toolbar`, `Dialog`, `MenuButton` (with `MenuItem`, `MenuItemCheckbox`, `MenuItemRadio`, `MenuGroup`, `MenuSeparator`), `Tooltip`, `Toaster`, `Tabs` (with `TabList`, `Tab`, `TabPanel`), `ProgressRing`, `SpinButton`, `Tree`, `BitGrid`, `SwatchStrip` |
167
+ | `@ac-kit/ui-common/react` | React 18 and 19, with `react-dom` | the same components, props and anatomy |
168
+
169
+ Both subpaths also export `useElementBinding`, `useLatest` and `joinClasses`
170
+ for components of your own.
171
+
172
+ The React components take the Preact ones' props, `className` beside `class`
173
+ (both are added after the control's own classes), and render the same
174
+ classes, `data-*` and ARIA attributes. `onChange` keeps the meaning it has
175
+ here — once per gesture, a key or a committed entry — not React's form-field
176
+ one of every input; `onInput` follows a drag. `Button`, `IconButton`,
177
+ `ToggleButton` and `MenuButton` pass a `ref` to their button under React 18
178
+ too. Under `StrictMode`, a gesture binding is disposed and made again with its
179
+ element, as any effect is.
155
180
 
156
181
  Every component is controlled: it shows `value` (or `isOn`) and reports what
157
182
  the person asks for through a callback, typed with `@ac-kit/core`'s
@@ -169,6 +194,14 @@ the person asks for through a callback, typed with `@ac-kit/core`'s
169
194
  changes.
170
195
  - `Meter` — `value`, `min`, `max` (finite), a `label`, optional `segments` and
171
196
  `valueText`; read-only.
197
+ - `BitGrid` — `label`, `bytes`, `unit` (`bit` or `byte`), `bitOrder`,
198
+ `columns`, a `reference` whose differing cells are filled, `fields` (named
199
+ byte ranges, tinted and listed in a legend), `selectedIndex`, and
200
+ `onActivate(index)` for a cell clicked or activated with Enter or Space;
201
+ without `onActivate` it is read-only and still navigable.
202
+ - `SwatchStrip` — `label`, `items` (`color`, optional `label` drawn under the
203
+ swatch and `description` read instead), `appearance` `swatches` (a list) or
204
+ `gradient` (one image, hard stops unless `interpolation` names a space).
172
205
  - `Switch` — `label`, optional `description`, `isOn`, `onToggle(nextIsOn)`: a
173
206
  setting that applies as it is flipped.
174
207
  - `RadioGroup` — `label` (the legend, visually hidden unless `isLabelShown`),
@@ -374,7 +407,8 @@ panel, or on one control.
374
407
  Every control root carries `ack-control` beside its own class (`ack-knob`,
375
408
  `ack-slider`, …): the hook for what they share — the tone, the focus ring, the
376
409
  disabled look, the touch target of the interactive ones (a `Readout`, a
377
- `Meter` and a `ProgressRing` are displays and keep their own size) and, on the
410
+ `Meter`, a `ProgressRing`, a `BitGrid` and a `SwatchStrip` are displays and
411
+ keep their own size) and, on the
378
412
  controls a finger drags, no text
379
413
  selection. The components also render stable part classes (`ack-knob-arc`,
380
414
  `ack-slider-thumb`, …) and state attributes (`data-tone`, `data-state`,
@@ -433,6 +467,16 @@ Per control:
433
467
  | `--ack-meter-gap` | `2px` | the space between segments |
434
468
  | `--ack-meter-track` | `--ack-surface-raised` | an unlit bar or segment |
435
469
  | `--ack-meter-fraction` | set by the component | the value from 0 to 1; read it, do not set it |
470
+ | `--ack-bit-grid-font-size` | `0.8125rem` | a bit grid's digits |
471
+ | `--ack-bit-grid-cell-min` | `1.1em` | a cell's least width |
472
+ | `--ack-bit-grid-cell-height` | `1.7em` | a cell's least height |
473
+ | `--ack-bit-grid-byte-gap` | `3px` | the extra space before each byte |
474
+ | `--ack-bit-grid-row-gap` | `2px` | the space between rows |
475
+ | `--ack-bit-grid-field-0` … `-5` | six distinct inks | the field tints, cycled by field |
476
+ | `--ack-bit-grid-columns` | set by the component | cells per row; read it, do not set it |
477
+ | `--ack-swatch-strip-height` | `2.25em` | a swatch's or a gradient's height |
478
+ | `--ack-swatch-strip-gap` | `2px` | the space between swatches |
479
+ | `--ack-swatch-strip-label-width` | `8em` | the column of the strip's name |
436
480
  | `--ack-button-background` | `--ack-surface` | a button's body |
437
481
  | `--ack-button-ink` | `--ack-lit-ink` | a primary button's text |
438
482
  | `--ack-button-icon-size` | `20px` | the icon of a button, an icon button or a radio |
@@ -556,6 +600,18 @@ thumb and the meter's bar depend on it for their position.
556
600
  - `Readout` is a group named once by its caption.
557
601
  - `Meter` has the `meter` role with its range and value (and `valueText`), and
558
602
  no keyboard.
603
+ - `BitGrid` follows the WAI-ARIA grid pattern: a named `grid` of `row`s and
604
+ `gridcell`s, one tab stop, the arrows within and between rows without
605
+ wrapping, Home and End to the row's ends and with Control to the grid's.
606
+ Every cell is named by its position, value, change and field; a changed
607
+ cell is filled, not only coloured. It is `aria-readonly` without
608
+ `onActivate`; with it, Enter, Space or a click activates a cell and the
609
+ selected one is `aria-selected`. A cell is smaller than a 24-pixel target,
610
+ so give an activatable grid an equivalent control of normal size (a field
611
+ or a slider for the index), as WCAG 2.5.8 allows.
612
+ - `SwatchStrip` is a named list whose swatches are each named by their label
613
+ and colour (or description); a gradient is one `img` named by its colours in
614
+ order. Colour is the content here, so every name says it in text.
559
615
  - `Tabs` follow the WAI-ARIA tabs pattern: a named `tablist` of `tab`s with
560
616
  `aria-selected` and `aria-controls`, each `tabpanel` named by its tab. The
561
617
  tab list is one tab stop, on the selected tab; the arrows along it move
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_anchor.d.ts","sourceRoot":"","sources":["../../src/adapter/_anchor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEvD;AAkBD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAc7E"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_anchor.js","sourceRoot":"","sources":["../../src/adapter/_anchor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC9C,OAAO,gBAAgB,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;AAChD,CAAC;AAED,SAAS,YAAY,CAAC,OAAoB;IACzC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC;IAEnE,OAAO,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,MAAM;QACtC,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,eAAe,CAAC,OAAoB,EAAE,KAAwB;IACtE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;IAC7C,CAAC;SAAM,CAAC;QACP,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5D,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,OAAoB,EAAE,IAAY;IAChE,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,eAAe,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO;QACN,CAAC,MAAM,CAAC,OAAO,CAAC;YACf,eAAe,CACd,OAAO,EACP,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,KAAK,IAAI,CAAC,CAC/D,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_dom.d.ts","sourceRoot":"","sources":["../../src/adapter/_dom.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,oIAC8F,CAAC;AAE/H,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAO1D;AAED,yDAAyD;AACzD,wBAAgB,YAAY,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAU5D;AAED,uDAAuD;AACvD,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,KAAK,GAAG,KAAK,CAE5D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAI/D"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_dom.js","sourceRoot":"","sources":["../../src/adapter/_dom.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,CAAC,MAAM,mBAAmB,GAC/B,6HAA6H,CAAC;AAE/H,kFAAkF;AAClF,MAAM,UAAU,YAAY,CAAC,OAAoB;IAChD,OAAO,CACN,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;QAC7B,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,MAAM;QAChD,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,IAAI;QACnC,OAAO,CAAC,eAAe,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CACrD,CAAC;AACH,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,YAAY,CAAC,SAAsB;IAClD,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,gBAAgB,CAC/C,mBAAmB,CACnB,EAAE,CAAC;QACH,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;YACpD,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC5C,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB;IAC1C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAc,QAAQ,CAAC,EAAE,IAAI,CAAC;IAE1D,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;AACvC,CAAC"}
@@ -9,7 +9,7 @@ import type { ToastUrgency } from "../toast/toast-queue.js";
9
9
  * assistive technology, live regions included: the announcement then goes to a
10
10
  * region inside the open dialog that holds focus.
11
11
  *
12
- * Framework-free; it belongs in `@ac-kit/browser/dom` (`TODO.md`).
12
+ * Framework-free.
13
13
  */
14
14
  export declare class LiveAnnouncer_ implements Disposable {
15
15
  private readonly document_;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_live-announcer.d.ts","sourceRoot":"","sources":["../../src/adapter/_live-announcer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAiB5D;;;;;;;;;;;GAWG;AACH,qBAAa,cAAe,YAAW,UAAU;IAChD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAW;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgC;IACzD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4C;IAEpE,YAAY,QAAQ,EAAE,QAAQ,EAE7B;IAED,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAsB9D;IAED,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAUvB;IAED,uDAAuD;IACvD,OAAO,CAAC,KAAK;IAab,OAAO,CAAC,cAAc;IAoBtB,OAAO,CAAC,MAAM;CAOd"}
@@ -17,7 +17,7 @@ const VISUALLY_HIDDEN_ = "position:absolute;width:1px;height:1px;margin:-1px;pad
17
17
  * assistive technology, live regions included: the announcement then goes to a
18
18
  * region inside the open dialog that holds focus.
19
19
  *
20
- * Framework-free; it belongs in `@ac-kit/browser/dom` (`TODO.md`).
20
+ * Framework-free.
21
21
  */
22
22
  export class LiveAnnouncer_ {
23
23
  document_;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_live-announcer.js","sourceRoot":"","sources":["../../src/adapter/_live-announcer.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B,yEAAyE;AACzE,MAAM,eAAe,GAAG,IAAI,CAAC;AAI7B,MAAM,gBAAgB,GACrB,+HAA+H,CAAC;AAEjI;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,cAAc;IACT,SAAS,CAAW;IACpB,QAAQ,GAAG,IAAI,GAAG,EAAqB,CAAC;IACxC,OAAO,GAAG,IAAI,GAAG,EAAiC,CAAC;IAEpE,YAAY,QAAkB;QAC7B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,QAAQ,CAAC,KAAwB,EAAE,OAAq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CAAC;QACF,MAAM,OAAO,GAAG;YACf,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC;YACxB,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC;SAC9B,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEjC,OAAO,OAAO,CAAC;IAChB,CAAC;IAEO,MAAM,CAAC,MAAsB,EAAE,OAAe;QACrD,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC7B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC3B,MAAM,EAAE,CAAC;QACV,CAAC,EAAE,OAAO,CAAC,CAAC;QACZ,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;CACD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"join-classes.d.ts","sourceRoot":"","sources":["../../src/adapter/join-classes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAE3E"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"join-classes.js","sourceRoot":"","sources":["../../src/adapter/join-classes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,KAAyB;IAClE,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC;AACxE,CAAC"}
@@ -0,0 +1,151 @@
1
+ /** What one cell of a {@link bitGridCells} grid shows: a bit, or a whole byte. */
2
+ export type BitGridUnit = "bit" | "byte";
3
+ /**
4
+ * The order of a byte's bits across the grid: most significant first (`msb`,
5
+ * how a byte is written in binary), or least significant first (`lsb`, how a
6
+ * bit field is numbered in many protocols).
7
+ */
8
+ export type BitGridBitOrder = "msb" | "lsb";
9
+ /**
10
+ * A named run of bytes, `[start, end)`, coloured as one field: a header, a
11
+ * nonce, a length.
12
+ */
13
+ export type BitGridField = {
14
+ readonly label: string;
15
+ readonly start: number;
16
+ readonly end: number;
17
+ };
18
+ /**
19
+ * How many field colours the default stylesheet defines. A field's
20
+ * {@link BitGridCell.fieldTone} cycles through them, so neighbouring fields
21
+ * differ.
22
+ */
23
+ export declare const BIT_GRID_FIELD_TONES = 6;
24
+ /** One cell of a bit grid. */
25
+ export type BitGridCell = {
26
+ /** The cell's position in the grid, counted in its unit. */
27
+ readonly index: number;
28
+ /** The byte it shows, or the byte its bit belongs to. */
29
+ readonly byteIndex: number;
30
+ /**
31
+ * For a bit, its weight in its byte: 7 for the most significant bit, 0 for
32
+ * the least. `undefined` for a byte cell.
33
+ */
34
+ readonly bit: number | undefined;
35
+ /** 0 or 1 for a bit, 0 to 255 for a byte. */
36
+ readonly value: number;
37
+ /** What the cell draws: `"0"` or `"1"`, or two lower-case hex digits. */
38
+ readonly text: string;
39
+ /**
40
+ * Whether it differs from the reference at the same position; a position past
41
+ * the reference's end counts as changed. `false` without a reference.
42
+ */
43
+ readonly changed: boolean;
44
+ /** The index of the field it belongs to, `undefined` for none. */
45
+ readonly field: number | undefined;
46
+ /** The field's colour slot, `field` modulo {@link BIT_GRID_FIELD_TONES}. */
47
+ readonly fieldTone: number | undefined;
48
+ };
49
+ /** Input of {@link bitGridCells}. */
50
+ export type BitGridCellsInput = {
51
+ bytes: Uint8Array;
52
+ /** Defaults to `bit`. */
53
+ unit?: BitGridUnit;
54
+ /** Defaults to `msb`. Ignored for byte cells. */
55
+ bitOrder?: BitGridBitOrder;
56
+ /** What the bytes are compared with, to mark the cells that changed. */
57
+ reference?: Uint8Array;
58
+ /** Non-overlapping byte ranges inside `bytes`. */
59
+ fields?: readonly BitGridField[];
60
+ };
61
+ /**
62
+ * The cells of a grid showing `bytes` bit by bit or byte by byte, each marked
63
+ * with whether it differs from `reference` and which field holds it.
64
+ *
65
+ * Time complexity: O(n) in the number of cells plus the bytes the fields span.
66
+ * Memory: O(n).
67
+ *
68
+ * @example
69
+ * const cells = bitGridCells({
70
+ * bytes: Uint8Array.of(0b1010_0000),
71
+ * reference: Uint8Array.of(0b1000_0000),
72
+ * });
73
+ * cells.map((cell) => cell.text).join(""); // "10100000"
74
+ * cells[2]!.changed; // true
75
+ *
76
+ * @throws {RangeError} When a field is not a non-empty range of whole bytes
77
+ * inside `bytes`, or two fields share a byte.
78
+ */
79
+ export declare function bitGridCells(input: BitGridCellsInput): BitGridCell[];
80
+ /**
81
+ * What a screen reader says for one cell: its position, its value, and whether
82
+ * it changed and which field holds it, as `"bit 3 of byte 0: 1, changed,
83
+ * header"` or `"byte 4: hex 1f"`. The value is the cell's visible text as a
84
+ * word of its own, so the name contains the label a sighted user reads (WCAG
85
+ * 2.5.3).
86
+ *
87
+ * Time complexity: O(1). Memory: O(1).
88
+ *
89
+ * @example
90
+ * const [cell] = bitGridCells({ bytes: Uint8Array.of(0x1f), unit: "byte" });
91
+ * bitGridCellLabel(cell!); // "byte 0: hex 1f"
92
+ */
93
+ export declare function bitGridCellLabel(cell: BitGridCell, fields?: readonly BitGridField[]): string;
94
+ /** Options of {@link bitGridKeyIndex}. */
95
+ export type BitGridKeyOptions = {
96
+ /**
97
+ * Whether Control (or Command) is held: Home and End then reach the grid's
98
+ * ends.
99
+ */
100
+ ctrlKey?: boolean;
101
+ };
102
+ /**
103
+ * The cell a key moves focus to in a grid of `count` cells laid out `columns`
104
+ * to a row, per the WAI-ARIA grid pattern: Left and Right within a row, Up and
105
+ * Down to the same column of the next row, Home and End to the row's ends,
106
+ * Control with Home or End to the first and last cell. The grid reads left to
107
+ * right whatever the page's direction, as bytes are written. `undefined` for
108
+ * another key, or when no cell lies that way.
109
+ *
110
+ * Time complexity: O(1). Memory: O(1).
111
+ *
112
+ * @example
113
+ * bitGridKeyIndex(0, "ArrowDown", 64, 32); // 32
114
+ * bitGridKeyIndex(31, "ArrowRight", 64, 32); // undefined: the row ends
115
+ * bitGridKeyIndex(40, "End", 64, 32, { ctrlKey: true }); // 63
116
+ *
117
+ * @throws {RangeError} When `count` is not a non-negative safe integer,
118
+ * `columns` not a positive one, or `current` lies outside [0, count).
119
+ */
120
+ export declare function bitGridKeyIndex(current: number, key: string, count: number, columns: number, options?: BitGridKeyOptions): number | undefined;
121
+ /** The ARIA attributes of a bit grid's root (WAI-ARIA 1.2 `grid` role). */
122
+ export type BitGridAttributes = {
123
+ role: "grid";
124
+ "aria-label": string;
125
+ "aria-rowcount": number;
126
+ "aria-colcount": number;
127
+ "aria-readonly"?: true;
128
+ };
129
+ /** Input of {@link bitGridAttributes}. */
130
+ export type BitGridAttributesInput = {
131
+ label: string;
132
+ count: number;
133
+ columns: number;
134
+ /** Whether a cell can be activated; a grid that cannot is read-only. */
135
+ isActivatable: boolean;
136
+ };
137
+ /**
138
+ * The attributes of a bit grid's root: the `grid` role with its name and size,
139
+ * read-only unless a cell can be activated.
140
+ *
141
+ * Time complexity: O(1). Memory: O(1).
142
+ *
143
+ * @example
144
+ * bitGridAttributes({ label: "Digest", count: 256, columns: 32, isActivatable: false });
145
+ * // { role: "grid", "aria-label": "Digest", "aria-rowcount": 8,
146
+ * // "aria-colcount": 32, "aria-readonly": true }
147
+ *
148
+ * @throws {RangeError} When `columns` is not a positive safe integer.
149
+ */
150
+ export declare function bitGridAttributes(input: BitGridAttributesInput): BitGridAttributes;
151
+ //# sourceMappingURL=bit-grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bit-grid.d.ts","sourceRoot":"","sources":["../../src/bit-grid/bit-grid.ts"],"names":[],"mappings":"AAEA,kFAAkF;AAClF,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;AAEzC;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,KAAK,CAAC;AAE5C;;;GAGG;AACH,MAAM,MAAM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/B,IAAI,EAAE,WAAW,EACjB,MAAM,GAAE,SAAS,YAAY,EAAO,GAClC,MAAM,CAcR;AAED,0CAA0C;AAC1C,MAAM,MAAM,iBAAiB,GAAG;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,iBAAsB,GAC7B,MAAM,GAAG,SAAS,CA+CpB;AAED,2EAA2E;AAC3E,MAAM,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,IAAI,CAAC;CACvB,CAAC;AAEF,0CAA0C;AAC1C,MAAM,MAAM,sBAAsB,GAAG;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,aAAa,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,sBAAsB,GAC3B,iBAAiB,CAkBnB"}
@@ -0,0 +1,201 @@
1
+ import { describeValue } from "@ac-kit/core";
2
+ /**
3
+ * How many field colours the default stylesheet defines. A field's
4
+ * {@link BitGridCell.fieldTone} cycles through them, so neighbouring fields
5
+ * differ.
6
+ */
7
+ export const BIT_GRID_FIELD_TONES = 6;
8
+ function byteFields_(length, fields) {
9
+ const owner = Array.from({ length });
10
+ for (const [index, field] of fields.entries()) {
11
+ const { start, end } = field;
12
+ if (!(Number.isSafeInteger(start) &&
13
+ Number.isSafeInteger(end) &&
14
+ start >= 0 &&
15
+ start < end &&
16
+ end <= length)) {
17
+ throw new RangeError(`A bit grid field must be a non-empty range of whole bytes inside the ${length} given, got "${field.label}" from ${describeValue(start)} to ${describeValue(end)}.`);
18
+ }
19
+ for (let byte = start; byte < end; byte++) {
20
+ const previous = owner[byte];
21
+ if (previous !== undefined) {
22
+ throw new RangeError(`Bit grid fields must not overlap: "${field.label}" and "${fields[previous].label}" both hold byte ${byte}.`);
23
+ }
24
+ owner[byte] = index;
25
+ }
26
+ }
27
+ return owner;
28
+ }
29
+ /**
30
+ * The cells of a grid showing `bytes` bit by bit or byte by byte, each marked
31
+ * with whether it differs from `reference` and which field holds it.
32
+ *
33
+ * Time complexity: O(n) in the number of cells plus the bytes the fields span.
34
+ * Memory: O(n).
35
+ *
36
+ * @example
37
+ * const cells = bitGridCells({
38
+ * bytes: Uint8Array.of(0b1010_0000),
39
+ * reference: Uint8Array.of(0b1000_0000),
40
+ * });
41
+ * cells.map((cell) => cell.text).join(""); // "10100000"
42
+ * cells[2]!.changed; // true
43
+ *
44
+ * @throws {RangeError} When a field is not a non-empty range of whole bytes
45
+ * inside `bytes`, or two fields share a byte.
46
+ */
47
+ export function bitGridCells(input) {
48
+ const { bytes, unit = "bit", bitOrder = "msb", reference, fields = [], } = input;
49
+ const owner = byteFields_(bytes.length, fields);
50
+ const cells = [];
51
+ for (const [byteIndex, byte] of bytes.entries()) {
52
+ const field = owner[byteIndex];
53
+ const fieldTone = field === undefined ? undefined : field % BIT_GRID_FIELD_TONES;
54
+ const referenceByte = reference?.[byteIndex];
55
+ if (unit === "byte") {
56
+ cells.push({
57
+ index: byteIndex,
58
+ byteIndex,
59
+ bit: undefined,
60
+ value: byte,
61
+ text: byte.toString(16).padStart(2, "0"),
62
+ changed: reference !== undefined && referenceByte !== byte,
63
+ field,
64
+ fieldTone,
65
+ });
66
+ continue;
67
+ }
68
+ for (let position = 0; position < 8; position++) {
69
+ const bit = bitOrder === "msb" ? 7 - position : position;
70
+ const value = (byte >> bit) & 1;
71
+ cells.push({
72
+ index: byteIndex * 8 + position,
73
+ byteIndex,
74
+ bit,
75
+ value,
76
+ text: String(value),
77
+ changed: reference !== undefined &&
78
+ (referenceByte === undefined ||
79
+ ((referenceByte >> bit) & 1) !== value),
80
+ field,
81
+ fieldTone,
82
+ });
83
+ }
84
+ }
85
+ return cells;
86
+ }
87
+ /**
88
+ * What a screen reader says for one cell: its position, its value, and whether
89
+ * it changed and which field holds it, as `"bit 3 of byte 0: 1, changed,
90
+ * header"` or `"byte 4: hex 1f"`. The value is the cell's visible text as a
91
+ * word of its own, so the name contains the label a sighted user reads (WCAG
92
+ * 2.5.3).
93
+ *
94
+ * Time complexity: O(1). Memory: O(1).
95
+ *
96
+ * @example
97
+ * const [cell] = bitGridCells({ bytes: Uint8Array.of(0x1f), unit: "byte" });
98
+ * bitGridCellLabel(cell!); // "byte 0: hex 1f"
99
+ */
100
+ export function bitGridCellLabel(cell, fields = []) {
101
+ const parts = [
102
+ cell.bit === undefined
103
+ ? `byte ${cell.byteIndex}: hex ${cell.text}`
104
+ : `bit ${cell.bit} of byte ${cell.byteIndex}: ${cell.text}`,
105
+ ];
106
+ if (cell.changed) {
107
+ parts.push("changed");
108
+ }
109
+ if (cell.field !== undefined) {
110
+ parts.push(fields[cell.field]?.label ?? `field ${cell.field}`);
111
+ }
112
+ return parts.join(", ");
113
+ }
114
+ /**
115
+ * The cell a key moves focus to in a grid of `count` cells laid out `columns`
116
+ * to a row, per the WAI-ARIA grid pattern: Left and Right within a row, Up and
117
+ * Down to the same column of the next row, Home and End to the row's ends,
118
+ * Control with Home or End to the first and last cell. The grid reads left to
119
+ * right whatever the page's direction, as bytes are written. `undefined` for
120
+ * another key, or when no cell lies that way.
121
+ *
122
+ * Time complexity: O(1). Memory: O(1).
123
+ *
124
+ * @example
125
+ * bitGridKeyIndex(0, "ArrowDown", 64, 32); // 32
126
+ * bitGridKeyIndex(31, "ArrowRight", 64, 32); // undefined: the row ends
127
+ * bitGridKeyIndex(40, "End", 64, 32, { ctrlKey: true }); // 63
128
+ *
129
+ * @throws {RangeError} When `count` is not a non-negative safe integer,
130
+ * `columns` not a positive one, or `current` lies outside [0, count).
131
+ */
132
+ export function bitGridKeyIndex(current, key, count, columns, options = {}) {
133
+ if (!(Number.isSafeInteger(count) && count >= 0)) {
134
+ throw new RangeError(`A bit grid's cell count must be a non-negative safe integer, got ${describeValue(count)}.`);
135
+ }
136
+ if (!(Number.isSafeInteger(columns) && columns > 0)) {
137
+ throw new RangeError(`A bit grid's column count must be a positive safe integer, got ${describeValue(columns)}.`);
138
+ }
139
+ if (!(Number.isSafeInteger(current) && current >= 0 && current < count)) {
140
+ throw new RangeError(`The focused cell must lie in [0, ${count}), got ${describeValue(current)}.`);
141
+ }
142
+ const column = current % columns;
143
+ const rowStart = current - column;
144
+ let next;
145
+ switch (key) {
146
+ case "ArrowLeft":
147
+ next = column === 0 ? -1 : current - 1;
148
+ break;
149
+ case "ArrowRight":
150
+ next = column === columns - 1 ? -1 : current + 1;
151
+ break;
152
+ case "ArrowUp":
153
+ next = current - columns;
154
+ break;
155
+ case "ArrowDown":
156
+ next = current + columns;
157
+ break;
158
+ case "Home":
159
+ next = options.ctrlKey === true ? 0 : rowStart;
160
+ break;
161
+ case "End":
162
+ next =
163
+ options.ctrlKey === true
164
+ ? count - 1
165
+ : Math.min(rowStart + columns, count) - 1;
166
+ break;
167
+ default:
168
+ return undefined;
169
+ }
170
+ return next >= 0 && next < count && next !== current ? next : undefined;
171
+ }
172
+ /**
173
+ * The attributes of a bit grid's root: the `grid` role with its name and size,
174
+ * read-only unless a cell can be activated.
175
+ *
176
+ * Time complexity: O(1). Memory: O(1).
177
+ *
178
+ * @example
179
+ * bitGridAttributes({ label: "Digest", count: 256, columns: 32, isActivatable: false });
180
+ * // { role: "grid", "aria-label": "Digest", "aria-rowcount": 8,
181
+ * // "aria-colcount": 32, "aria-readonly": true }
182
+ *
183
+ * @throws {RangeError} When `columns` is not a positive safe integer.
184
+ */
185
+ export function bitGridAttributes(input) {
186
+ const { label, count, columns, isActivatable } = input;
187
+ if (!(Number.isSafeInteger(columns) && columns > 0)) {
188
+ throw new RangeError(`A bit grid's column count must be a positive safe integer, got ${describeValue(columns)}.`);
189
+ }
190
+ const attributes = {
191
+ role: "grid",
192
+ "aria-label": label,
193
+ "aria-rowcount": Math.ceil(count / columns),
194
+ "aria-colcount": Math.min(columns, count),
195
+ };
196
+ if (!isActivatable) {
197
+ attributes["aria-readonly"] = true;
198
+ }
199
+ return attributes;
200
+ }
201
+ //# sourceMappingURL=bit-grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bit-grid.js","sourceRoot":"","sources":["../../src/bit-grid/bit-grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAsB7C;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAyCtC,SAAS,WAAW,CACnB,MAAc,EACd,MAA+B;IAE/B,MAAM,KAAK,GAA2B,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7D,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;QAC/C,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;QAC7B,IACC,CAAC,CACA,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC;YAC3B,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC;YACzB,KAAK,IAAI,CAAC;YACV,KAAK,GAAG,GAAG;YACX,GAAG,IAAI,MAAM,CACb,EACA,CAAC;YACF,MAAM,IAAI,UAAU,CACnB,wEAAwE,MAAM,gBAAgB,KAAK,CAAC,KAAK,UAAU,aAAa,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,GAAG,CAAC,GAAG,CACnK,CAAC;QACH,CAAC;QACD,KAAK,IAAI,IAAI,GAAG,KAAK,EAAE,IAAI,GAAG,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O,CAAC,GAAG,CAC3F,CAAC;IACH,CAAC;IACD,MAAM,UAAU,GAAsB;QACrC,IAAI,EAAE,MAAM;QACZ,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC;QAC3C,eAAe,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC;KACzC,CAAC;IACF,IAAI,CAAC,aAAa,EAAE,CAAC;QACpB,UAAU,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC;IACpC,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./anchored/anchored.js";
2
+ export * from "./bit-grid/bit-grid.js";
2
3
  export * from "./button/button.js";
3
4
  export * from "./dialog/dialog.js";
4
5
  export * from "./focus/owns-arrow-keys.js";
@@ -14,6 +15,7 @@ export * from "./slider/slider-range.js";
14
15
  export * from "./slider/slider-track.js";
15
16
  export * from "./slider/stepped-value.js";
16
17
  export * from "./spin-button/spin-button.js";
18
+ export * from "./swatch-strip/swatch-strip.js";
17
19
  export * from "./switch/switch.js";
18
20
  export * from "./tabs/tabs.js";
19
21
  export * from "./toast/toast-queue.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./anchored/anchored.js";
2
+ export * from "./bit-grid/bit-grid.js";
2
3
  export * from "./button/button.js";
3
4
  export * from "./dialog/dialog.js";
4
5
  export * from "./focus/owns-arrow-keys.js";
@@ -14,6 +15,7 @@ export * from "./slider/slider-range.js";
14
15
  export * from "./slider/slider-track.js";
15
16
  export * from "./slider/stepped-value.js";
16
17
  export * from "./spin-button/spin-button.js";
18
+ export * from "./swatch-strip/swatch-strip.js";
17
19
  export * from "./switch/switch.js";
18
20
  export * from "./tabs/tabs.js";
19
21
  export * from "./toast/toast-queue.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAy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