@ac-kit/ui-common 0.1.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.
- package/CHANGELOG.md +210 -0
- package/README.md +383 -9
- package/dist/adapter/_anchor.d.ts +13 -0
- package/dist/adapter/_anchor.d.ts.map +1 -0
- package/dist/adapter/_anchor.js +39 -0
- package/dist/adapter/_anchor.js.map +1 -0
- package/dist/adapter/_dom.d.ts +14 -0
- package/dist/adapter/_dom.d.ts.map +1 -0
- package/dist/adapter/_dom.js +31 -0
- package/dist/adapter/_dom.js.map +1 -0
- package/dist/adapter/_live-announcer.d.ts +26 -0
- package/dist/adapter/_live-announcer.d.ts.map +1 -0
- package/dist/adapter/_live-announcer.js +101 -0
- package/dist/adapter/_live-announcer.js.map +1 -0
- package/dist/adapter/join-classes.d.ts.map +1 -0
- package/dist/adapter/join-classes.js.map +1 -0
- package/dist/anchored/anchored.d.ts +19 -0
- package/dist/anchored/anchored.d.ts.map +1 -0
- package/dist/anchored/anchored.js +2 -0
- package/dist/anchored/anchored.js.map +1 -0
- package/dist/bit-grid/bit-grid.d.ts +151 -0
- package/dist/bit-grid/bit-grid.d.ts.map +1 -0
- package/dist/bit-grid/bit-grid.js +201 -0
- package/dist/bit-grid/bit-grid.js.map +1 -0
- package/dist/focus/typeahead.d.ts +112 -0
- package/dist/focus/typeahead.d.ts.map +1 -0
- package/dist/focus/typeahead.js +178 -0
- package/dist/focus/typeahead.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/menu/menu.d.ts +157 -0
- package/dist/menu/menu.d.ts.map +1 -0
- package/dist/menu/menu.js +162 -0
- package/dist/menu/menu.js.map +1 -0
- package/dist/preact/bit-grid.d.ts +39 -0
- package/dist/preact/bit-grid.d.ts.map +1 -0
- package/dist/preact/bit-grid.js +72 -0
- package/dist/preact/bit-grid.js.map +1 -0
- package/dist/preact/button.d.ts.map +1 -1
- package/dist/preact/button.js +1 -1
- package/dist/preact/button.js.map +1 -1
- package/dist/preact/dialog.d.ts.map +1 -1
- package/dist/preact/dialog.js +1 -1
- package/dist/preact/dialog.js.map +1 -1
- package/dist/preact/index.d.ts +10 -1
- package/dist/preact/index.d.ts.map +1 -1
- package/dist/preact/index.js +10 -1
- package/dist/preact/index.js.map +1 -1
- package/dist/preact/knob.d.ts.map +1 -1
- package/dist/preact/knob.js +6 -14
- package/dist/preact/knob.js.map +1 -1
- package/dist/preact/menu-button.d.ts +117 -0
- package/dist/preact/menu-button.d.ts.map +1 -0
- package/dist/preact/menu-button.js +330 -0
- package/dist/preact/menu-button.js.map +1 -0
- package/dist/preact/meter.d.ts.map +1 -1
- package/dist/preact/meter.js +1 -1
- package/dist/preact/meter.js.map +1 -1
- package/dist/preact/progress-ring.d.ts +42 -0
- package/dist/preact/progress-ring.d.ts.map +1 -0
- package/dist/preact/progress-ring.js +26 -0
- package/dist/preact/progress-ring.js.map +1 -0
- package/dist/preact/radio-group.d.ts.map +1 -1
- package/dist/preact/radio-group.js +1 -1
- package/dist/preact/radio-group.js.map +1 -1
- package/dist/preact/readout.d.ts.map +1 -1
- package/dist/preact/readout.js +1 -1
- package/dist/preact/readout.js.map +1 -1
- package/dist/preact/slider.d.ts.map +1 -1
- package/dist/preact/slider.js +7 -5
- package/dist/preact/slider.js.map +1 -1
- package/dist/preact/spin-button.d.ts +67 -0
- package/dist/preact/spin-button.d.ts.map +1 -0
- package/dist/preact/spin-button.js +132 -0
- package/dist/preact/spin-button.js.map +1 -0
- package/dist/preact/swatch-strip.d.ts +30 -0
- package/dist/preact/swatch-strip.d.ts.map +1 -0
- package/dist/preact/swatch-strip.js +17 -0
- package/dist/preact/swatch-strip.js.map +1 -0
- package/dist/preact/switch.js +1 -1
- package/dist/preact/switch.js.map +1 -1
- package/dist/preact/tabs.d.ts +97 -0
- package/dist/preact/tabs.d.ts.map +1 -0
- package/dist/preact/tabs.js +264 -0
- package/dist/preact/tabs.js.map +1 -0
- package/dist/preact/toaster.d.ts +43 -0
- package/dist/preact/toaster.d.ts.map +1 -0
- package/dist/preact/toaster.js +356 -0
- package/dist/preact/toaster.js.map +1 -0
- package/dist/preact/toggle-button.d.ts.map +1 -1
- package/dist/preact/toggle-button.js +1 -1
- package/dist/preact/toggle-button.js.map +1 -1
- package/dist/preact/toolbar.d.ts.map +1 -1
- package/dist/preact/toolbar.js +3 -9
- package/dist/preact/toolbar.js.map +1 -1
- package/dist/preact/tooltip.d.ts +67 -0
- package/dist/preact/tooltip.d.ts.map +1 -0
- package/dist/preact/tooltip.js +165 -0
- package/dist/preact/tooltip.js.map +1 -0
- package/dist/preact/tree.d.ts +93 -0
- package/dist/preact/tree.d.ts.map +1 -0
- package/dist/preact/tree.js +399 -0
- package/dist/preact/tree.js.map +1 -0
- package/dist/progress/progress.d.ts +51 -0
- package/dist/progress/progress.d.ts.map +1 -0
- package/dist/progress/progress.js +43 -0
- package/dist/progress/progress.js.map +1 -0
- package/dist/react/_props.d.ts +22 -0
- package/dist/react/_props.d.ts.map +1 -0
- package/dist/react/_props.js +14 -0
- package/dist/react/_props.js.map +1 -0
- package/dist/react/bit-grid.d.ts +40 -0
- package/dist/react/bit-grid.d.ts.map +1 -0
- package/dist/react/bit-grid.js +71 -0
- package/dist/react/bit-grid.js.map +1 -0
- package/dist/react/button.d.ts +60 -0
- package/dist/react/button.d.ts.map +1 -0
- package/dist/react/button.js +34 -0
- package/dist/react/button.js.map +1 -0
- package/dist/react/dialog.d.ts +44 -0
- package/dist/react/dialog.d.ts.map +1 -0
- package/dist/react/dialog.js +91 -0
- package/dist/react/dialog.js.map +1 -0
- package/dist/react/index.d.ts +22 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +22 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/knob.d.ts +55 -0
- package/dist/react/knob.d.ts.map +1 -0
- package/dist/react/knob.js +144 -0
- package/dist/react/knob.js.map +1 -0
- package/dist/react/menu-button.d.ts +147 -0
- package/dist/react/menu-button.d.ts.map +1 -0
- package/dist/react/menu-button.js +342 -0
- package/dist/react/menu-button.js.map +1 -0
- package/dist/react/meter.d.ts +34 -0
- package/dist/react/meter.d.ts.map +1 -0
- package/dist/react/meter.js +23 -0
- package/dist/react/meter.js.map +1 -0
- package/dist/react/progress-ring.d.ts +42 -0
- package/dist/react/progress-ring.d.ts.map +1 -0
- package/dist/react/progress-ring.js +28 -0
- package/dist/react/progress-ring.js.map +1 -0
- package/dist/react/radio-group.d.ts +52 -0
- package/dist/react/radio-group.d.ts.map +1 -0
- package/dist/react/radio-group.js +30 -0
- package/dist/react/radio-group.js.map +1 -0
- package/dist/react/readout.d.ts +23 -0
- package/dist/react/readout.d.ts.map +1 -0
- package/dist/react/readout.js +13 -0
- package/dist/react/readout.js.map +1 -0
- package/dist/react/slider.d.ts +44 -0
- package/dist/react/slider.d.ts.map +1 -0
- package/dist/react/slider.js +167 -0
- package/dist/react/slider.js.map +1 -0
- package/dist/react/spin-button.d.ts +71 -0
- package/dist/react/spin-button.d.ts.map +1 -0
- package/dist/react/spin-button.js +132 -0
- package/dist/react/spin-button.js.map +1 -0
- package/dist/react/swatch-strip.d.ts +31 -0
- package/dist/react/swatch-strip.d.ts.map +1 -0
- package/dist/react/swatch-strip.js +17 -0
- package/dist/react/swatch-strip.js.map +1 -0
- package/dist/react/switch.d.ts +26 -0
- package/dist/react/switch.d.ts.map +1 -0
- package/dist/react/switch.js +19 -0
- package/dist/react/switch.js.map +1 -0
- package/dist/react/tabs.d.ts +95 -0
- package/dist/react/tabs.d.ts.map +1 -0
- package/dist/react/tabs.js +274 -0
- package/dist/react/tabs.js.map +1 -0
- package/dist/react/toaster.d.ts +43 -0
- package/dist/react/toaster.d.ts.map +1 -0
- package/dist/react/toaster.js +368 -0
- package/dist/react/toaster.js.map +1 -0
- package/dist/react/toggle-button.d.ts +37 -0
- package/dist/react/toggle-button.d.ts.map +1 -0
- package/dist/react/toggle-button.js +22 -0
- package/dist/react/toggle-button.js.map +1 -0
- package/dist/react/toolbar.d.ts +25 -0
- package/dist/react/toolbar.d.ts.map +1 -0
- package/dist/react/toolbar.js +143 -0
- package/dist/react/toolbar.js.map +1 -0
- package/dist/react/tooltip.d.ts +68 -0
- package/dist/react/tooltip.d.ts.map +1 -0
- package/dist/react/tooltip.js +165 -0
- package/dist/react/tooltip.js.map +1 -0
- package/dist/react/tree.d.ts +94 -0
- package/dist/react/tree.d.ts.map +1 -0
- package/dist/react/tree.js +422 -0
- package/dist/react/tree.js.map +1 -0
- package/dist/react/use-element-binding.d.ts +35 -0
- package/dist/react/use-element-binding.d.ts.map +1 -0
- package/dist/react/use-element-binding.js +51 -0
- package/dist/react/use-element-binding.js.map +1 -0
- package/dist/spin-button/spin-button.d.ts +110 -0
- package/dist/spin-button/spin-button.d.ts.map +1 -0
- package/dist/spin-button/spin-button.js +179 -0
- package/dist/spin-button/spin-button.js.map +1 -0
- package/dist/swatch-strip/swatch-strip.d.ts +60 -0
- package/dist/swatch-strip/swatch-strip.d.ts.map +1 -0
- package/dist/swatch-strip/swatch-strip.js +60 -0
- package/dist/swatch-strip/swatch-strip.js.map +1 -0
- package/dist/tabs/tabs.d.ts +157 -0
- package/dist/tabs/tabs.d.ts.map +1 -0
- package/dist/tabs/tabs.js +120 -0
- package/dist/tabs/tabs.js.map +1 -0
- package/dist/toast/toast-queue.d.ts +212 -0
- package/dist/toast/toast-queue.d.ts.map +1 -0
- package/dist/toast/toast-queue.js +290 -0
- package/dist/toast/toast-queue.js.map +1 -0
- package/dist/toast/toasts-obscure.d.ts +25 -0
- package/dist/toast/toasts-obscure.d.ts.map +1 -0
- package/dist/toast/toasts-obscure.js +30 -0
- package/dist/toast/toasts-obscure.js.map +1 -0
- package/dist/tooltip/tooltip.d.ts +183 -0
- package/dist/tooltip/tooltip.d.ts.map +1 -0
- package/dist/tooltip/tooltip.js +185 -0
- package/dist/tooltip/tooltip.js.map +1 -0
- package/dist/tree/tree.d.ts +302 -0
- package/dist/tree/tree.d.ts.map +1 -0
- package/dist/tree/tree.js +439 -0
- package/dist/tree/tree.js.map +1 -0
- package/package.json +47 -14
- package/styles.css +1084 -3
- package/dist/preact/join-classes.d.ts.map +0 -1
- package/dist/preact/join-classes.js.map +0 -1
- /package/dist/{preact → adapter}/join-classes.d.ts +0 -0
- /package/dist/{preact → adapter}/join-classes.js +0 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { bindPointers } from "@ac-kit/ui-gesture/dom";
|
|
3
|
+
import { createContext, forwardRef, useCallback, useContext, useId, useLayoutEffect, useRef, useState, } from "react";
|
|
4
|
+
import { addAnchorName_, anchorNameOf_ } from "../adapter/_anchor.js";
|
|
5
|
+
import { localesOf_ } from "../adapter/_dom.js";
|
|
6
|
+
import { buttonAttributes, } from "../button/button.js";
|
|
7
|
+
import { Typeahead } from "../focus/typeahead.js";
|
|
8
|
+
import { menuAttributes, menuButtonAttributes, menuButtonKeyAction, menuItemAttributes, menuKeyAction, } from "../menu/menu.js";
|
|
9
|
+
import { classOf_, reactAttributes_ } from "./_props.js";
|
|
10
|
+
import { useElementBinding, useLatest } from "./use-element-binding.js";
|
|
11
|
+
const MenuContext_ = createContext(undefined);
|
|
12
|
+
const ITEM_SELECTOR_ = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]';
|
|
13
|
+
function itemsOf_(menu) {
|
|
14
|
+
return [...menu.querySelectorAll(ITEM_SELECTOR_)].filter((item) => item.closest('[role="menu"]') === menu);
|
|
15
|
+
}
|
|
16
|
+
function textOf_(item) {
|
|
17
|
+
return item.dataset["textValue"] ?? item.textContent;
|
|
18
|
+
}
|
|
19
|
+
function kindOf_(item) {
|
|
20
|
+
switch (item.getAttribute("role")) {
|
|
21
|
+
case "menuitemcheckbox":
|
|
22
|
+
return "checkbox";
|
|
23
|
+
case "menuitemradio":
|
|
24
|
+
return "radio";
|
|
25
|
+
default:
|
|
26
|
+
return "item";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function assignRef_(ref, value) {
|
|
30
|
+
if (typeof ref === "function") {
|
|
31
|
+
ref(value);
|
|
32
|
+
}
|
|
33
|
+
else if (ref !== undefined && ref !== null) {
|
|
34
|
+
ref.current = value;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function menuChevron_() {
|
|
38
|
+
return (_jsx("span", { className: "ack-menu-button-chevron", "aria-hidden": "true", children: _jsx("svg", { viewBox: "0 0 16 16", focusable: "false", children: _jsx("path", { d: "M4 6l4 4 4-4" }) }) }));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A button that opens a menu of actions and settings (WAI-ARIA menu button and
|
|
42
|
+
* menu patterns), over the Popover API: the menu sits in the top layer,
|
|
43
|
+
* anchored to the button by CSS anchor positioning, flipping to the other side
|
|
44
|
+
* when the viewport has no room; a press outside it or Escape closes it.
|
|
45
|
+
*
|
|
46
|
+
* Enter, Space and Arrow Down open it on its first item, Arrow Up on its last;
|
|
47
|
+
* in it, the arrows move round, Home and End go to the ends, typing a name
|
|
48
|
+
* moves to it, Enter and a click choose an item and close, Space checks a
|
|
49
|
+
* checkbox or radio item and keeps it open, Escape closes it and Tab moves on,
|
|
50
|
+
* focus going back to the button. A mouse moving over the items focuses them.
|
|
51
|
+
* The menu closes before an item's action runs, so an action that opens a
|
|
52
|
+
* dialog has the button as its opener.
|
|
53
|
+
*
|
|
54
|
+
* Its open state is its own (the browser's popover state): `onOpenChange`
|
|
55
|
+
* reports it. The items' checked states are the caller's.
|
|
56
|
+
*/
|
|
57
|
+
export const MenuButton = forwardRef(MenuButton_);
|
|
58
|
+
function MenuButton_(props, callerRef) {
|
|
59
|
+
const { label, isLabelHidden = false, icon, variant, size, tone, side, align, onOpenChange, children, menuClass, class: extra, className, id: givenId, type = "button", onKeyDown, ...rest } = props;
|
|
60
|
+
const generatedButtonId = useId();
|
|
61
|
+
const buttonId = givenId ?? generatedButtonId;
|
|
62
|
+
const menuId = useId();
|
|
63
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
64
|
+
const button = useRef(null);
|
|
65
|
+
const menu = useRef(null);
|
|
66
|
+
const openFocus = useRef("first");
|
|
67
|
+
const typeahead = useRef(new Typeahead());
|
|
68
|
+
const activations = useRef(new WeakMap());
|
|
69
|
+
const latestOnOpenChange = useLatest(onOpenChange);
|
|
70
|
+
const latestOnKeyDown = useLatest(onKeyDown);
|
|
71
|
+
const anchorName = anchorNameOf_(menuId);
|
|
72
|
+
const setButton = useCallback((node) => {
|
|
73
|
+
button.current = node;
|
|
74
|
+
assignRef_(callerRef, node);
|
|
75
|
+
}, [callerRef]);
|
|
76
|
+
useLayoutEffect(() => {
|
|
77
|
+
const element = button.current;
|
|
78
|
+
if (element === null) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
const anchor = addAnchorName_(element, anchorName);
|
|
82
|
+
// Written here rather than as a prop: React 18 and 19 spell it differently,
|
|
83
|
+
// and each warns about the other's spelling.
|
|
84
|
+
element.setAttribute("popovertarget", menuId);
|
|
85
|
+
return () => {
|
|
86
|
+
anchor[Symbol.dispose]();
|
|
87
|
+
element.removeAttribute("popovertarget");
|
|
88
|
+
};
|
|
89
|
+
}, [anchorName, menuId]);
|
|
90
|
+
const latestOnToggle = useLatest((event) => {
|
|
91
|
+
const element = menu.current;
|
|
92
|
+
if (element === null) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const isNowOpen = event.newState === "open";
|
|
96
|
+
setIsOpen(isNowOpen);
|
|
97
|
+
if (isNowOpen) {
|
|
98
|
+
if (!element.contains(document.activeElement)) {
|
|
99
|
+
focusOpening();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
typeahead.current.reset();
|
|
104
|
+
const focused = document.activeElement;
|
|
105
|
+
if (focused === null ||
|
|
106
|
+
focused === document.body ||
|
|
107
|
+
element.contains(focused)) {
|
|
108
|
+
focusButton();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
latestOnOpenChange.current?.(isNowOpen);
|
|
112
|
+
});
|
|
113
|
+
const menuBinding = useElementBinding((element, signal) => {
|
|
114
|
+
menu.current = element;
|
|
115
|
+
element.style.setProperty("position-anchor", anchorName);
|
|
116
|
+
// A native listener: React 18 listens for `toggle` on `<details>` only.
|
|
117
|
+
element.addEventListener("toggle", (event) => {
|
|
118
|
+
latestOnToggle.current(event);
|
|
119
|
+
}, { signal });
|
|
120
|
+
const binding = bindPointers(element, {
|
|
121
|
+
onHover: (_sample, event) => {
|
|
122
|
+
const target = event.target instanceof Element
|
|
123
|
+
? event.target.closest(ITEM_SELECTOR_)
|
|
124
|
+
: null;
|
|
125
|
+
if (target !== null &&
|
|
126
|
+
target !== document.activeElement &&
|
|
127
|
+
target.closest('[role="menu"]') === element) {
|
|
128
|
+
target.focus({ preventScroll: true });
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
}, { coordinates: "client", signal });
|
|
132
|
+
return {
|
|
133
|
+
[Symbol.dispose]() {
|
|
134
|
+
binding[Symbol.dispose]();
|
|
135
|
+
element.style.removeProperty("position-anchor");
|
|
136
|
+
if (menu.current === element) {
|
|
137
|
+
menu.current = null;
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
}, [anchorName]);
|
|
142
|
+
const focusButton = () => {
|
|
143
|
+
button.current?.focus();
|
|
144
|
+
};
|
|
145
|
+
const close = () => {
|
|
146
|
+
typeahead.current.reset();
|
|
147
|
+
const element = menu.current;
|
|
148
|
+
// Focus first: the item it is on is about to be hidden.
|
|
149
|
+
focusButton();
|
|
150
|
+
element?.hidePopover();
|
|
151
|
+
};
|
|
152
|
+
const focusOpening = () => {
|
|
153
|
+
const element = menu.current;
|
|
154
|
+
if (element === null) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const items = itemsOf_(element);
|
|
158
|
+
const target = openFocus.current === "last" ? items.at(-1) : items[0];
|
|
159
|
+
openFocus.current = "first";
|
|
160
|
+
(target ?? element).focus({ preventScroll: true });
|
|
161
|
+
};
|
|
162
|
+
// Made once: it reads refs only, so the items register once.
|
|
163
|
+
const [context] = useState(() => ({
|
|
164
|
+
activate: (isDisabled, keepsOpen, action) => {
|
|
165
|
+
if (isDisabled) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if (!keepsOpen) {
|
|
169
|
+
typeahead.current.reset();
|
|
170
|
+
// Focus first: the item it is on is about to be hidden.
|
|
171
|
+
button.current?.focus();
|
|
172
|
+
menu.current?.hidePopover();
|
|
173
|
+
}
|
|
174
|
+
action();
|
|
175
|
+
},
|
|
176
|
+
register: (element, activate) => {
|
|
177
|
+
activations.current.set(element, activate);
|
|
178
|
+
return () => {
|
|
179
|
+
activations.current.delete(element);
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
}));
|
|
183
|
+
return (_jsxs(_Fragment, { children: [_jsxs("button", { ...rest, ...buttonAttributes({ variant, size, tone }), ...menuButtonAttributes({ menuId, isOpen }), id: buttonId, ref: setButton, type: type, "aria-label": isLabelHidden ? label : undefined, title: rest.title ?? (isLabelHidden ? label : undefined), className: classOf_(isLabelHidden
|
|
184
|
+
? "ack-control ack-button ack-icon-button ack-menu-button"
|
|
185
|
+
: "ack-control ack-button ack-menu-button", { class: extra, className }), onKeyDown: (event) => {
|
|
186
|
+
latestOnKeyDown.current?.(event);
|
|
187
|
+
if (event.defaultPrevented) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
const focus = menuButtonKeyAction(event);
|
|
191
|
+
if (focus === undefined) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
openFocus.current = focus;
|
|
195
|
+
// Enter and Space click the button, whose popover target opens it.
|
|
196
|
+
if (event.key !== "ArrowDown" && event.key !== "ArrowUp") {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
event.preventDefault();
|
|
200
|
+
const element = menu.current;
|
|
201
|
+
if (element === null) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (isOpen) {
|
|
205
|
+
focusOpening();
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
element.showPopover({ source: event.currentTarget });
|
|
209
|
+
focusOpening();
|
|
210
|
+
}
|
|
211
|
+
}, children: [icon !== undefined && (_jsx("span", { className: "ack-button-icon", "aria-hidden": "true", children: icon })), !isLabelHidden && label, !isLabelHidden && menuChevron_()] }), _jsx("div", { ...reactAttributes_(menuAttributes({ labelledBy: buttonId, side, align })), id: menuId, ref: menuBinding, popover: "auto", className: classOf_("ack-menu", { class: menuClass }), onKeyDown: (event) => {
|
|
212
|
+
const element = event.currentTarget;
|
|
213
|
+
const items = itemsOf_(element);
|
|
214
|
+
const focused = event.target instanceof HTMLElement
|
|
215
|
+
? event.target.closest(ITEM_SELECTOR_)
|
|
216
|
+
: null;
|
|
217
|
+
const index = focused === null ? -1 : items.indexOf(focused);
|
|
218
|
+
const current = index === -1 ? undefined : index;
|
|
219
|
+
const action = menuKeyAction({
|
|
220
|
+
key: event.key,
|
|
221
|
+
shiftKey: event.shiftKey,
|
|
222
|
+
ctrlKey: event.ctrlKey,
|
|
223
|
+
altKey: event.altKey,
|
|
224
|
+
metaKey: event.metaKey,
|
|
225
|
+
current,
|
|
226
|
+
count: items.length,
|
|
227
|
+
itemKind: current === undefined ? undefined : kindOf_(items[current]),
|
|
228
|
+
isTypingAhead: typeahead.current.isActive(event.timeStamp),
|
|
229
|
+
});
|
|
230
|
+
if (action === undefined) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
switch (action.kind) {
|
|
234
|
+
case "focus":
|
|
235
|
+
event.preventDefault();
|
|
236
|
+
items[action.index].focus({ preventScroll: true });
|
|
237
|
+
break;
|
|
238
|
+
case "activate":
|
|
239
|
+
event.preventDefault();
|
|
240
|
+
if (focused !== null) {
|
|
241
|
+
activations.current.get(focused)?.(action.keepsOpen);
|
|
242
|
+
}
|
|
243
|
+
break;
|
|
244
|
+
case "close":
|
|
245
|
+
event.preventDefault();
|
|
246
|
+
close();
|
|
247
|
+
break;
|
|
248
|
+
case "leave":
|
|
249
|
+
// Focus on the button first, so Tab moves on from it.
|
|
250
|
+
close();
|
|
251
|
+
break;
|
|
252
|
+
case "typeahead": {
|
|
253
|
+
event.preventDefault();
|
|
254
|
+
const next = typeahead.current.find(action.character, event.timeStamp, items.map(textOf_), current, { locales: localesOf_(element) });
|
|
255
|
+
if (next !== undefined) {
|
|
256
|
+
items[next].focus({ preventScroll: true });
|
|
257
|
+
}
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}, children: _jsx(MenuContext_.Provider, { value: context, children: children }) })] }));
|
|
262
|
+
}
|
|
263
|
+
function useMenuContext_(component) {
|
|
264
|
+
const context = useContext(MenuContext_);
|
|
265
|
+
if (context === undefined) {
|
|
266
|
+
throw new Error(`${component} must be inside a MenuButton`);
|
|
267
|
+
}
|
|
268
|
+
return context;
|
|
269
|
+
}
|
|
270
|
+
function MenuItemBase_(props) {
|
|
271
|
+
const { children, icon, textValue, id, attributes } = props;
|
|
272
|
+
const context = useMenuContext_("A menu item");
|
|
273
|
+
const latestActivate = useLatest(props.onActivate);
|
|
274
|
+
const unregister = useRef(undefined);
|
|
275
|
+
const ref = useCallback((node) => {
|
|
276
|
+
unregister.current?.();
|
|
277
|
+
unregister.current =
|
|
278
|
+
node === null
|
|
279
|
+
? undefined
|
|
280
|
+
: context.register(node, (keepsOpen) => {
|
|
281
|
+
latestActivate.current(keepsOpen);
|
|
282
|
+
});
|
|
283
|
+
}, [context.register]);
|
|
284
|
+
const isCheckable = attributes.kind !== "item";
|
|
285
|
+
return (_jsxs("div", { ...reactAttributes_(menuItemAttributes(attributes)), id: id, ref: ref, "data-text-value": textValue, className: classOf_("ack-menu-item", props), onClick: () => {
|
|
286
|
+
latestActivate.current(false);
|
|
287
|
+
}, children: [isCheckable && (_jsx("span", { className: "ack-menu-item-indicator", "aria-hidden": "true", children: _jsx("svg", { viewBox: "0 0 16 16", focusable: "false", children: attributes.kind === "radio" ? (_jsx("circle", { cx: "8", cy: "8", r: "3" })) : (_jsx("path", { d: "M3.5 8.5l3 3 6-7" })) }) })), icon !== undefined && (_jsx("span", { className: "ack-menu-item-icon", "aria-hidden": "true", children: icon })), _jsx("span", { className: "ack-menu-item-label", children: children })] }));
|
|
288
|
+
}
|
|
289
|
+
/** An action in a {@link MenuButton}'s menu: the `menuitem` role. */
|
|
290
|
+
export function MenuItem(props) {
|
|
291
|
+
const { disabled = false, onSelect } = props;
|
|
292
|
+
const context = useMenuContext_("MenuItem");
|
|
293
|
+
return (_jsx(MenuItemBase_, { ...props, attributes: { kind: "item", isDisabled: disabled }, onActivate: () => {
|
|
294
|
+
context.activate(disabled, false, onSelect);
|
|
295
|
+
} }));
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* A setting turned on or off in a {@link MenuButton}'s menu: the
|
|
299
|
+
* `menuitemcheckbox` role, a check mark drawn while on. Space flips it and
|
|
300
|
+
* keeps the menu open; Enter and a click flip it and close the menu.
|
|
301
|
+
*/
|
|
302
|
+
export function MenuItemCheckbox(props) {
|
|
303
|
+
const { disabled = false, isChecked, onCheckedChange } = props;
|
|
304
|
+
const context = useMenuContext_("MenuItemCheckbox");
|
|
305
|
+
return (_jsx(MenuItemBase_, { ...props, attributes: { kind: "checkbox", isChecked, isDisabled: disabled }, onActivate: (keepsOpen) => {
|
|
306
|
+
context.activate(disabled, keepsOpen, () => {
|
|
307
|
+
onCheckedChange(!isChecked);
|
|
308
|
+
});
|
|
309
|
+
} }));
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* One choice among the radio items of a {@link MenuGroup}: the `menuitemradio`
|
|
313
|
+
* role, a dot drawn on the chosen one. Space chooses it and keeps the menu
|
|
314
|
+
* open; Enter and a click choose it and close the menu. Choosing the checked
|
|
315
|
+
* one reports nothing.
|
|
316
|
+
*/
|
|
317
|
+
export function MenuItemRadio(props) {
|
|
318
|
+
const { disabled = false, isChecked, onSelect } = props;
|
|
319
|
+
const context = useMenuContext_("MenuItemRadio");
|
|
320
|
+
return (_jsx(MenuItemBase_, { ...props, attributes: { kind: "radio", isChecked, isDisabled: disabled }, onActivate: (keepsOpen) => {
|
|
321
|
+
context.activate(disabled, keepsOpen, () => {
|
|
322
|
+
if (!isChecked) {
|
|
323
|
+
onSelect();
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
} }));
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* A named group of items in a {@link MenuButton}'s menu, such as the radio items
|
|
330
|
+
* of one choice: the `group` role.
|
|
331
|
+
*/
|
|
332
|
+
export function MenuGroup(props) {
|
|
333
|
+
const { label, isLabelHidden = false, children } = props;
|
|
334
|
+
useMenuContext_("MenuGroup");
|
|
335
|
+
return (_jsxs("div", { role: "group", "aria-label": label, className: classOf_("ack-menu-group", props), children: [!isLabelHidden && (_jsx("div", { className: "ack-menu-group-label", "aria-hidden": "true", children: label })), children] }));
|
|
336
|
+
}
|
|
337
|
+
/** A line between items of a {@link MenuButton}'s menu: the `separator` role. */
|
|
338
|
+
export function MenuSeparator(props) {
|
|
339
|
+
useMenuContext_("MenuSeparator");
|
|
340
|
+
return (_jsx("div", { role: "separator", className: classOf_("ack-menu-separator", props) }));
|
|
341
|
+
}
|
|
342
|
+
//# sourceMappingURL=menu-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-button.js","sourceRoot":"","sources":["../../src/react/menu-button.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAEN,aAAa,EACb,UAAU,EAIV,WAAW,EACX,UAAU,EACV,KAAK,EACL,eAAe,EACf,MAAM,EACN,QAAQ,GACR,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE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AAC,aAE3C,CAAC,aAAa,IAAI,CAClB,cAAK,SAAS,EAAC,sBAAsB,iBAAa,MAAM,YACtD,KAAK,GACD,CACN,EACA,QAAQ,IACJ,CACN,CAAC;AACH,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,aAAa,CAAC,KAAkB;IAC/C,eAAe,CAAC,eAAe,CAAC,CAAC;IAEjC,OAAO,CACN,cAAK,IAAI,EAAC,WAAW,EAAC,SAAS,EAAE,QAAQ,CAAC,oBAAoB,EAAE,KAAK,CAAC,GAAI,CAC1E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import { type MeterSegment } from "../meter/meter.js";
|
|
3
|
+
import type { ControlTone } from "../tone.js";
|
|
4
|
+
import { type ClassProps_ } from "./_props.js";
|
|
5
|
+
/** Props of {@link Meter}. */
|
|
6
|
+
export type MeterProps = ClassProps_ & {
|
|
7
|
+
/** Its accessible name; it is not drawn. */
|
|
8
|
+
label: string;
|
|
9
|
+
value: number;
|
|
10
|
+
min: number;
|
|
11
|
+
max: number;
|
|
12
|
+
/**
|
|
13
|
+
* Segments lit from the bottom or the left by `value`, in the units of
|
|
14
|
+
* `value`. Without, a continuous bar.
|
|
15
|
+
*/
|
|
16
|
+
segments?: readonly MeterSegment[];
|
|
17
|
+
/** Defaults to `horizontal`. */
|
|
18
|
+
orientation?: "horizontal" | "vertical";
|
|
19
|
+
/** What a person reads, announced with the value: `"-12 dB"`. */
|
|
20
|
+
valueText?: string;
|
|
21
|
+
/** The colour of a continuous bar; segments carry their own. */
|
|
22
|
+
tone?: ControlTone;
|
|
23
|
+
id?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A read-only level meter: a continuous bar, or a row of segments that light in
|
|
27
|
+
* their tones as the level rises. The `meter` role, so it is announced with its
|
|
28
|
+
* value and range, not as a control.
|
|
29
|
+
*
|
|
30
|
+
* @throws {RangeError} When `min` or `max` is not finite, or `max` is not above
|
|
31
|
+
* `min`.
|
|
32
|
+
*/
|
|
33
|
+
export declare function Meter(props: MeterProps): JSX.Element;
|
|
34
|
+
//# sourceMappingURL=meter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meter.d.ts","sourceRoot":"","sources":["../../src/react/meter.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACN,KAAK,YAAY,EAGjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,KAAK,WAAW,EAA+B,MAAM,aAAa,CAAC;AAE5E,8BAA8B;AAC9B,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG;IACtC,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IACnC,gCAAgC;IAChC,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CA6CpD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource react */
|
|
3
|
+
import { inverseLerp } from "@ac-kit/math-scalar";
|
|
4
|
+
import { meterAttributes, meterLitCount, } from "../meter/meter.js";
|
|
5
|
+
import { classOf_ } from "./_props.js";
|
|
6
|
+
/**
|
|
7
|
+
* A read-only level meter: a continuous bar, or a row of segments that light in
|
|
8
|
+
* their tones as the level rises. The `meter` role, so it is announced with its
|
|
9
|
+
* value and range, not as a control.
|
|
10
|
+
*
|
|
11
|
+
* @throws {RangeError} When `min` or `max` is not finite, or `max` is not above
|
|
12
|
+
* `min`.
|
|
13
|
+
*/
|
|
14
|
+
export function Meter(props) {
|
|
15
|
+
const { label, value, min, max, segments, orientation = "horizontal", valueText, tone, id, } = props;
|
|
16
|
+
const attributes = meterAttributes({ label, value, min, max, valueText });
|
|
17
|
+
const litCount = segments === undefined ? 0 : meterLitCount(value, segments);
|
|
18
|
+
const style = {
|
|
19
|
+
"--ack-meter-fraction": inverseLerp(min, max, attributes["aria-valuenow"]),
|
|
20
|
+
};
|
|
21
|
+
return (_jsx("div", { ...attributes, id: id, className: classOf_("ack-control ack-meter", props), "data-orientation": orientation, "data-tone": tone, style: style, children: segments === undefined ? (_jsx("div", { className: "ack-meter-bar", children: _jsx("div", { className: "ack-meter-fill" }) })) : (_jsx("div", { className: "ack-meter-segments", children: segments.map((segment, index) => (_jsx("span", { className: "ack-meter-segment", "data-tone": segment.tone, "data-lit": index < litCount ? "" : undefined }, index))) })) }));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=meter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meter.js","sourceRoot":"","sources":["../../src/react/meter.tsx"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAEN,eAAe,EACf,aAAa,GACb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAoB,QAAQ,EAAqB,MAAM,aAAa,CAAC;AAuB5E;;;;;;;GAOG;AACH,MAAM,UAAU,KAAK,CAAC,KAAiB;IACtC,MAAM,EACL,KAAK,EACL,KAAK,EACL,GAAG,EACH,GAAG,EACH,QAAQ,EACR,WAAW,GAAG,YAAY,EAC1B,SAAS,EACT,IAAI,EACJ,EAAE,GACF,GAAG,KAAK,CAAC;IACV,MAAM,UAAU,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IAC1E,MAAM,QAAQ,GAAG,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC7E,MAAM,KAAK,GAAiB;QAC3B,sBAAsB,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;KAC1E,CAAC;IAEF,OAAO,CACN,iBACK,UAAU,EACd,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,QAAQ,CAAC,uBAAuB,EAAE,KAAK,CAAC,sBACjC,WAAW,eAClB,IAAI,EACf,KAAK,EAAE,KAAK,YAEX,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,CACzB,cAAK,SAAS,EAAC,eAAe,YAC7B,cAAK,SAAS,EAAC,gBAAgB,GAAG,GAC7B,CACN,CAAC,CAAC,CAAC,CACH,cAAK,SAAS,EAAC,oBAAoB,YACjC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CACjC,eAEC,SAAS,EAAC,mBAAmB,eAClB,OAAO,CAAC,IAAI,cACb,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,IAHtC,KAAK,CAIT,CACF,CAAC,GACG,CACN,GACI,CACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { ControlTone } from "../tone.js";
|
|
3
|
+
import { type ClassProps_ } from "./_props.js";
|
|
4
|
+
/** Props of {@link ProgressRing}. */
|
|
5
|
+
export type ProgressRingProps = ({
|
|
6
|
+
/** Its accessible name; it is not drawn. */
|
|
7
|
+
label: string;
|
|
8
|
+
labelledBy?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
label?: undefined;
|
|
11
|
+
/** The id of the element naming it, such as a heading. */
|
|
12
|
+
labelledBy: string;
|
|
13
|
+
}) & ClassProps_ & {
|
|
14
|
+
/** How far the task has gone; `undefined` while it cannot be told. */
|
|
15
|
+
value: number | undefined;
|
|
16
|
+
/** Defaults to 0. */
|
|
17
|
+
min?: number;
|
|
18
|
+
/** Defaults to 100. */
|
|
19
|
+
max?: number;
|
|
20
|
+
/**
|
|
21
|
+
* What a person reads, announced instead of the percentage: `"3 of 12
|
|
22
|
+
* files"`.
|
|
23
|
+
*/
|
|
24
|
+
valueText?: string;
|
|
25
|
+
/** Draw `valueText` inside the ring. Defaults to false. */
|
|
26
|
+
isValueShown?: boolean;
|
|
27
|
+
tone?: ControlTone;
|
|
28
|
+
id?: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* A circular progress indicator: an arc filling clockwise from twelve o'clock
|
|
32
|
+
* as `value` goes from `min` to `max`, or a turning arc while the progress
|
|
33
|
+
* cannot be told (`value` undefined), held still under `prefers-reduced-motion:
|
|
34
|
+
* reduce`. The `progressbar` role, so it is announced with its value, not as a
|
|
35
|
+
* control. Tie it to the region it reports on with `aria-busy` and
|
|
36
|
+
* `aria-describedby` there.
|
|
37
|
+
*
|
|
38
|
+
* @throws {RangeError} When `min` or `max` is not finite, or `max` is not above
|
|
39
|
+
* `min`.
|
|
40
|
+
*/
|
|
41
|
+
export declare function ProgressRing(props: ProgressRingProps): JSX.Element;
|
|
42
|
+
//# sourceMappingURL=progress-ring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-ring.d.ts","sourceRoot":"","sources":["../../src/react/progress-ring.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,KAAK,WAAW,EAA+B,MAAM,aAAa,CAAC;AAE5E,qCAAqC;AACrC,MAAM,MAAM,iBAAiB,GAAG,CAC7B;IACA,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,SAAS,CAAC;CACtB,GACD;IACA,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;CAClB,CACH,GACA,WAAW,GAAG;IACb,sEAAsE;IACtE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,qBAAqB;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AAEH;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CA+DlE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource react */
|
|
3
|
+
import { inverseLerp } from "@ac-kit/math-scalar";
|
|
4
|
+
import { progressAttributes } from "../progress/progress.js";
|
|
5
|
+
import { classOf_ } from "./_props.js";
|
|
6
|
+
/**
|
|
7
|
+
* A circular progress indicator: an arc filling clockwise from twelve o'clock
|
|
8
|
+
* as `value` goes from `min` to `max`, or a turning arc while the progress
|
|
9
|
+
* cannot be told (`value` undefined), held still under `prefers-reduced-motion:
|
|
10
|
+
* reduce`. The `progressbar` role, so it is announced with its value, not as a
|
|
11
|
+
* control. Tie it to the region it reports on with `aria-busy` and
|
|
12
|
+
* `aria-describedby` there.
|
|
13
|
+
*
|
|
14
|
+
* @throws {RangeError} When `min` or `max` is not finite, or `max` is not above
|
|
15
|
+
* `min`.
|
|
16
|
+
*/
|
|
17
|
+
export function ProgressRing(props) {
|
|
18
|
+
const { label, labelledBy, value, min, max, valueText, isValueShown = false, tone, id, } = props;
|
|
19
|
+
const attributes = progressAttributes({ label, value, min, max, valueText });
|
|
20
|
+
const now = attributes["aria-valuenow"];
|
|
21
|
+
const style = now === undefined
|
|
22
|
+
? undefined
|
|
23
|
+
: {
|
|
24
|
+
"--ack-progress-fraction": inverseLerp(attributes["aria-valuemin"], attributes["aria-valuemax"], now),
|
|
25
|
+
};
|
|
26
|
+
return (_jsxs("div", { ...attributes, "aria-labelledby": labelledBy, id: id, className: classOf_("ack-control ack-progress-ring", props), "data-state": now === undefined ? "indeterminate" : "determinate", "data-tone": tone, style: style, children: [_jsxs("svg", { className: "ack-progress-ring-dial", viewBox: "0 0 48 48", "aria-hidden": "true", focusable: "false", children: [_jsx("circle", { className: "ack-progress-ring-track", cx: "24", cy: "24", r: "20", pathLength: 1 }), _jsx("circle", { className: "ack-progress-ring-indicator", cx: "24", cy: "24", r: "20", pathLength: 1 })] }), isValueShown && valueText !== undefined && (_jsx("span", { className: "ack-progress-ring-value", "aria-hidden": "true", children: valueText }))] }));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=progress-ring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-ring.js","sourceRoot":"","sources":["../../src/react/progress-ring.tsx"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAoB,QAAQ,EAAqB,MAAM,aAAa,CAAC;AAiC5E;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,KAA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CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import type { Callable } from "@ac-kit/core";
|
|
3
|
+
import { type JSX, type ReactNode } from "react";
|
|
4
|
+
import type { ControlTone } from "../tone.js";
|
|
5
|
+
import { type ClassProps_ } from "./_props.js";
|
|
6
|
+
/** One choice of a {@link RadioGroup}. */
|
|
7
|
+
export type RadioOption<Value extends string> = {
|
|
8
|
+
value: Value;
|
|
9
|
+
/** Its accessible name, drawn on it. */
|
|
10
|
+
label: string;
|
|
11
|
+
/**
|
|
12
|
+
* A sentence under the label, linked by `aria-describedby`; drawn by the
|
|
13
|
+
* `cards` appearance.
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
16
|
+
/** Drawn before the label, hidden from assistive technology. */
|
|
17
|
+
icon?: ReactNode;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** The colour it lights in while chosen. */
|
|
20
|
+
tone?: ControlTone;
|
|
21
|
+
};
|
|
22
|
+
/** Props of {@link RadioGroup}. */
|
|
23
|
+
export type RadioGroupProps<Value extends string> = ClassProps_ & {
|
|
24
|
+
/** The `<legend>`; visually hidden unless `isLabelShown`. */
|
|
25
|
+
label: string;
|
|
26
|
+
isLabelShown?: boolean;
|
|
27
|
+
options: readonly RadioOption<Value>[];
|
|
28
|
+
/** The chosen option; `undefined` for none yet. */
|
|
29
|
+
value: Value | undefined;
|
|
30
|
+
/** The option chosen: by a pointer, or an arrow key. */
|
|
31
|
+
onChange: Callable<[value: Value]>;
|
|
32
|
+
/** Side-by-side segments, or cards with descriptions. Defaults to `segmented`. */
|
|
33
|
+
appearance?: "segmented" | "cards";
|
|
34
|
+
/** Defaults to `horizontal`. */
|
|
35
|
+
orientation?: "horizontal" | "vertical";
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
/** The radios' `name`. Defaults to a generated id. */
|
|
38
|
+
name?: string;
|
|
39
|
+
id?: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* One choice among a few, all shown at once: a segmented control, or a list of
|
|
43
|
+
* cards with descriptions. Native radios in a `<fieldset>`, so the browser
|
|
44
|
+
* provides the arrow keys (they move and choose), Tab leaving the group, and
|
|
45
|
+
* form participation. The radios are controlled: until the caller passes the
|
|
46
|
+
* chosen option back as `value`, React keeps the previous one checked.
|
|
47
|
+
*
|
|
48
|
+
* For more than about six options, use a select; for independent settings,
|
|
49
|
+
* switches.
|
|
50
|
+
*/
|
|
51
|
+
export declare function RadioGroup<Value extends string>(props: RadioGroupProps<Value>): JSX.Element;
|
|
52
|
+
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../src/react/radio-group.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAExD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,aAAa,CAAC;AAEzD,0CAA0C;AAC1C,MAAM,MAAM,WAAW,CAAC,KAAK,SAAS,MAAM,IAAI;IAC/C,KAAK,EAAE,KAAK,CAAC;IACb,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF,mCAAmC;AACnC,MAAM,MAAM,eAAe,CAAC,KAAK,SAAS,MAAM,IAAI,WAAW,GAAG;IACjE,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,SAAS,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;IACvC,mDAAmD;IACnD,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,wDAAwD;IACxD,QAAQ,EAAE,QAAQ,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IACnC,kFAAkF;IAClF,UAAU,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IACnC,gCAAgC;IAChC,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,KAAK,SAAS,MAAM,EAC9C,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,GAC3B,GAAG,CAAC,OAAO,CAiFb"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { classOf_ } from "./_props.js";
|
|
4
|
+
/**
|
|
5
|
+
* One choice among a few, all shown at once: a segmented control, or a list of
|
|
6
|
+
* cards with descriptions. Native radios in a `<fieldset>`, so the browser
|
|
7
|
+
* provides the arrow keys (they move and choose), Tab leaving the group, and
|
|
8
|
+
* form participation. The radios are controlled: until the caller passes the
|
|
9
|
+
* chosen option back as `value`, React keeps the previous one checked.
|
|
10
|
+
*
|
|
11
|
+
* For more than about six options, use a select; for independent settings,
|
|
12
|
+
* switches.
|
|
13
|
+
*/
|
|
14
|
+
export function RadioGroup(props) {
|
|
15
|
+
const { label, isLabelShown = false, options, value, onChange, appearance = "segmented", orientation = "horizontal", disabled = false, id, } = props;
|
|
16
|
+
const generatedName = useId();
|
|
17
|
+
const idPrefix = useId();
|
|
18
|
+
const name = props.name ?? generatedName;
|
|
19
|
+
return (_jsxs("fieldset", { id: id, disabled: disabled, "data-appearance": appearance, "data-orientation": orientation, className: classOf_("ack-control ack-radio-group", props), children: [_jsx("legend", { className: isLabelShown
|
|
20
|
+
? "ack-radio-group-legend"
|
|
21
|
+
: "ack-radio-group-legend ack-visually-hidden", children: label }), options.map((option, index) => {
|
|
22
|
+
const labelId = `${idPrefix}-${index}-label`;
|
|
23
|
+
const descriptionId = `${idPrefix}-${index}`;
|
|
24
|
+
const isChosen = option.value === value;
|
|
25
|
+
return (_jsxs("label", { className: "ack-control ack-radio", "data-state": isChosen ? "on" : "off", "data-tone": option.tone, "data-disabled": option.disabled === true ? "" : undefined, children: [_jsx("input", { type: "radio", className: "ack-radio-input", name: name, value: option.value, checked: isChosen, disabled: option.disabled, "aria-labelledby": labelId, "aria-describedby": option.description === undefined ? undefined : descriptionId, onChange: () => {
|
|
26
|
+
onChange(option.value);
|
|
27
|
+
} }), option.icon !== undefined && (_jsx("span", { className: "ack-radio-icon", "aria-hidden": "true", children: option.icon })), _jsxs("span", { className: "ack-radio-text", children: [_jsx("span", { id: labelId, className: "ack-radio-label", children: option.label }), option.description !== undefined && (_jsx("span", { id: descriptionId, className: "ack-radio-description", children: option.description }))] })] }, option.value));
|
|
28
|
+
})] }));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=radio-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../src/react/radio-group.tsx"],"names":[],"mappings":";AAEA,OAAO,EAA4B,KAAK,EAAE,MAAM,OAAO,CAAC;AAGxD,OAAO,EAAoB,QAAQ,EAAE,MAAM,aAAa,CAAC;AAuCzD;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CACzB,KAA6B;IAE7B,MAAM,EACL,KAAK,EACL,YAAY,GAAG,KAAK,EACpB,OAAO,EACP,KAAK,EACL,QAAQ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,SAAS,CAAC,CAAC,CAAC,aAAa,EAE7D,QAAQ,EAAE,GAAG,EAAE;gCACd,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;4BACxB,CAAC,GACA,EACD,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,CAC7B,eAAM,SAAS,EAAC,gBAAgB,iBAAa,MAAM,YACjD,MAAM,CAAC,IAAI,GACN,CACP,EACD,gBAAM,SAAS,EAAC,gBAAgB,aAC/B,eAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC,iBAAiB,YAC5C,MAAM,CAAC,KAAK,GACP,EACN,MAAM,CAAC,WAAW,KAAK,SAAS,IAAI,CACpC,eAAM,EAAE,EAAE,aAAa,EAAE,SAAS,EAAC,uBAAuB,YACxD,MAAM,CAAC,WAAW,GACb,CACP,IACK,KAnCF,MAAM,CAAC,KAAK,CAoCV,CACR,CAAC;YACH,CAAC,CAAC,IACQ,CACX,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import type { JSX, ReactNode } from "react";
|
|
3
|
+
import { type ReadoutLive } from "../readout/readout.js";
|
|
4
|
+
import type { ControlTone } from "../tone.js";
|
|
5
|
+
import { type ClassProps_ } from "./_props.js";
|
|
6
|
+
/** Props of {@link Readout}. */
|
|
7
|
+
export type ReadoutProps = ClassProps_ & {
|
|
8
|
+
/** What the value is, drawn as its caption and naming it. */
|
|
9
|
+
label: string;
|
|
10
|
+
tone?: ControlTone;
|
|
11
|
+
/** Defaults to `off`: changes are not announced. */
|
|
12
|
+
live?: ReadoutLive;
|
|
13
|
+
/** The value, as text. */
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
id?: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A lit value under a small caption, like a hardware display's: a tempo, a bar
|
|
19
|
+
* number, a program. Read-only; for a value the person sets, use a `Knob` or a
|
|
20
|
+
* `Slider`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function Readout(props: ReadoutProps): JSX.Element;
|
|
23
|
+
//# sourceMappingURL=readout.d.ts.map
|