@ac-kit/ui-common 0.0.0-stage → 0.2.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 +244 -0
- package/LICENSE +28 -0
- package/README.md +633 -2
- 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/button/button.d.ts +35 -0
- package/dist/button/button.d.ts.map +1 -0
- package/dist/button/button.js +22 -0
- package/dist/button/button.js.map +1 -0
- package/dist/dialog/dialog.d.ts +33 -0
- package/dist/dialog/dialog.d.ts.map +1 -0
- package/dist/dialog/dialog.js +23 -0
- package/dist/dialog/dialog.js.map +1 -0
- package/dist/focus/owns-arrow-keys.d.ts +31 -0
- package/dist/focus/owns-arrow-keys.d.ts.map +1 -0
- package/dist/focus/owns-arrow-keys.js +64 -0
- package/dist/focus/owns-arrow-keys.js.map +1 -0
- package/dist/focus/roving-focus.d.ts +34 -0
- package/dist/focus/roving-focus.d.ts.map +1 -0
- package/dist/focus/roving-focus.js +72 -0
- package/dist/focus/roving-focus.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 +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/knob/knob.d.ts +106 -0
- package/dist/knob/knob.d.ts.map +1 -0
- package/dist/knob/knob.js +116 -0
- package/dist/knob/knob.js.map +1 -0
- 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/meter/meter.d.ts +63 -0
- package/dist/meter/meter.d.ts.map +1 -0
- package/dist/meter/meter.js +57 -0
- package/dist/meter/meter.js.map +1 -0
- package/dist/preact/_anchor.d.ts +13 -0
- package/dist/preact/_anchor.d.ts.map +1 -0
- package/dist/preact/_anchor.js +39 -0
- package/dist/preact/_anchor.js.map +1 -0
- package/dist/preact/_dom.d.ts +14 -0
- package/dist/preact/_dom.d.ts.map +1 -0
- package/dist/preact/_dom.js +31 -0
- package/dist/preact/_dom.js.map +1 -0
- package/dist/preact/_live-announcer.d.ts +26 -0
- package/dist/preact/_live-announcer.d.ts.map +1 -0
- package/dist/preact/_live-announcer.js +101 -0
- package/dist/preact/_live-announcer.js.map +1 -0
- package/dist/preact/button.d.ts +40 -0
- package/dist/preact/button.d.ts.map +1 -0
- package/dist/preact/button.js +22 -0
- package/dist/preact/button.js.map +1 -0
- package/dist/preact/dialog.d.ts +43 -0
- package/dist/preact/dialog.d.ts.map +1 -0
- package/dist/preact/dialog.js +89 -0
- package/dist/preact/dialog.js.map +1 -0
- package/dist/preact/index.d.ts +20 -0
- package/dist/preact/index.d.ts.map +1 -0
- package/dist/preact/index.js +20 -0
- package/dist/preact/index.js.map +1 -0
- package/dist/preact/join-classes.d.ts +10 -0
- package/dist/preact/join-classes.d.ts.map +1 -0
- package/dist/preact/join-classes.js +12 -0
- package/dist/preact/join-classes.js.map +1 -0
- package/dist/preact/knob.d.ts +51 -0
- package/dist/preact/knob.d.ts.map +1 -0
- package/dist/preact/knob.js +144 -0
- package/dist/preact/knob.js.map +1 -0
- 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 +34 -0
- package/dist/preact/meter.d.ts.map +1 -0
- package/dist/preact/meter.js +21 -0
- package/dist/preact/meter.js.map +1 -0
- 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 +50 -0
- package/dist/preact/radio-group.d.ts.map +1 -0
- package/dist/preact/radio-group.js +42 -0
- package/dist/preact/radio-group.js.map +1 -0
- package/dist/preact/readout.d.ts +22 -0
- package/dist/preact/readout.d.ts.map +1 -0
- package/dist/preact/readout.js +13 -0
- package/dist/preact/readout.js.map +1 -0
- package/dist/preact/slider.d.ts +40 -0
- package/dist/preact/slider.d.ts.map +1 -0
- package/dist/preact/slider.js +164 -0
- package/dist/preact/slider.js.map +1 -0
- 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/switch.d.ts +25 -0
- package/dist/preact/switch.d.ts.map +1 -0
- package/dist/preact/switch.js +19 -0
- package/dist/preact/switch.js.map +1 -0
- 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 +26 -0
- package/dist/preact/toggle-button.d.ts.map +1 -0
- package/dist/preact/toggle-button.js +16 -0
- package/dist/preact/toggle-button.js.map +1 -0
- package/dist/preact/toolbar.d.ts +24 -0
- package/dist/preact/toolbar.d.ts.map +1 -0
- package/dist/preact/toolbar.js +142 -0
- package/dist/preact/toolbar.js.map +1 -0
- 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/preact/use-element-binding.d.ts +32 -0
- package/dist/preact/use-element-binding.d.ts.map +1 -0
- package/dist/preact/use-element-binding.js +51 -0
- package/dist/preact/use-element-binding.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/readout/readout.d.ts +41 -0
- package/dist/readout/readout.d.ts.map +1 -0
- package/dist/readout/readout.js +26 -0
- package/dist/readout/readout.js.map +1 -0
- package/dist/slider/_clamped-value.d.ts +7 -0
- package/dist/slider/_clamped-value.d.ts.map +1 -0
- package/dist/slider/_clamped-value.js +9 -0
- package/dist/slider/_clamped-value.js.map +1 -0
- package/dist/slider/slider-attributes.d.ts +50 -0
- package/dist/slider/slider-attributes.d.ts.map +1 -0
- package/dist/slider/slider-attributes.js +38 -0
- package/dist/slider/slider-attributes.js.map +1 -0
- package/dist/slider/slider-range.d.ts +59 -0
- package/dist/slider/slider-range.d.ts.map +1 -0
- package/dist/slider/slider-range.js +73 -0
- package/dist/slider/slider-range.js.map +1 -0
- package/dist/slider/slider-track.d.ts +37 -0
- package/dist/slider/slider-track.d.ts.map +1 -0
- package/dist/slider/slider-track.js +35 -0
- package/dist/slider/slider-track.js.map +1 -0
- package/dist/slider/stepped-value.d.ts +31 -0
- package/dist/slider/stepped-value.d.ts.map +1 -0
- package/dist/slider/stepped-value.js +55 -0
- package/dist/slider/stepped-value.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/switch/switch.d.ts +30 -0
- package/dist/switch/switch.d.ts.map +1 -0
- package/dist/switch/switch.js +26 -0
- package/dist/switch/switch.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/toggle-button/toggle-button.d.ts +44 -0
- package/dist/toggle-button/toggle-button.d.ts.map +1 -0
- package/dist/toggle-button/toggle-button.js +31 -0
- package/dist/toggle-button/toggle-button.js.map +1 -0
- package/dist/tone.d.ts +8 -0
- package/dist/tone.d.ts.map +1 -0
- package/dist/tone.js +2 -0
- package/dist/tone.js.map +1 -0
- package/dist/toolbar/toolbar.d.ts +35 -0
- package/dist/toolbar/toolbar.d.ts.map +1 -0
- package/dist/toolbar/toolbar.js +23 -0
- package/dist/toolbar/toolbar.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 +110 -3
- package/styles.css +1883 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { CallableNoArgs } from "@ac-kit/core";
|
|
2
|
+
import type { ComponentChildren, JSX } from "preact";
|
|
3
|
+
import { type DialogPlacement } from "../dialog/dialog.js";
|
|
4
|
+
/** Props of {@link Dialog}. */
|
|
5
|
+
export type DialogProps = {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Asked to close: Escape, the close button, a backdrop click when
|
|
11
|
+
* dismissible, or a `<form method="dialog">` submitted. Called once, after
|
|
12
|
+
* the dialog has closed; set `isOpen` to false in answer.
|
|
13
|
+
*/
|
|
14
|
+
onClose: CallableNoArgs;
|
|
15
|
+
/** Defaults to `center`. */
|
|
16
|
+
placement?: DialogPlacement;
|
|
17
|
+
/** Escape and a backdrop click close it. Defaults to true. */
|
|
18
|
+
isDismissible?: boolean;
|
|
19
|
+
/** The close button's accessible name; without it, no close button is drawn. */
|
|
20
|
+
closeLabel?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The close button's icon. Defaults to a drawn ×, hidden from assistive
|
|
23
|
+
* technology.
|
|
24
|
+
*/
|
|
25
|
+
closeIcon?: ComponentChildren;
|
|
26
|
+
children: ComponentChildren;
|
|
27
|
+
/** A footer row of actions. */
|
|
28
|
+
actions?: ComponentChildren;
|
|
29
|
+
id?: string;
|
|
30
|
+
class?: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* A modal dialog on a native `<dialog>`: the rest of the page is inert, Escape
|
|
34
|
+
* closes it when dismissible, and focus returns to the opener. Rendered in
|
|
35
|
+
* place, with no portal: the top layer lifts it above the page.
|
|
36
|
+
*
|
|
37
|
+
* A press that starts and ends on the backdrop closes it too, a text selection
|
|
38
|
+
* dragged out of the panel does not.
|
|
39
|
+
*
|
|
40
|
+
* Keep `isOpen` the single source of truth: set it false in `onClose`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function Dialog(props: DialogProps): JSX.Element;
|
|
43
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/preact/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAGrD,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,qBAAqB,CAAC;AAI7E,+BAA+B;AAC/B,MAAM,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,OAAO,EAAE,cAAc,CAAC;IACxB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,8DAA8D;IAC9D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,+BAA+B;IAC/B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAiJtD"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { useId, useLayoutEffect, useRef } from "preact/hooks";
|
|
3
|
+
import { dialogAttributes } from "../dialog/dialog.js";
|
|
4
|
+
import { joinClasses } from "./join-classes.js";
|
|
5
|
+
import { useLatest } from "./use-element-binding.js";
|
|
6
|
+
/**
|
|
7
|
+
* A modal dialog on a native `<dialog>`: the rest of the page is inert, Escape
|
|
8
|
+
* closes it when dismissible, and focus returns to the opener. Rendered in
|
|
9
|
+
* place, with no portal: the top layer lifts it above the page.
|
|
10
|
+
*
|
|
11
|
+
* A press that starts and ends on the backdrop closes it too, a text selection
|
|
12
|
+
* dragged out of the panel does not.
|
|
13
|
+
*
|
|
14
|
+
* Keep `isOpen` the single source of truth: set it false in `onClose`.
|
|
15
|
+
*/
|
|
16
|
+
export function Dialog(props) {
|
|
17
|
+
const { title, description, isOpen, onClose, placement, isDismissible = true, closeLabel, closeIcon, children, actions, id, } = props;
|
|
18
|
+
const titleId = useId();
|
|
19
|
+
const descriptionId = useId();
|
|
20
|
+
const dialog = useRef(null);
|
|
21
|
+
const latestOnClose = useLatest(onClose);
|
|
22
|
+
const isPressOnBackdrop = useRef(false);
|
|
23
|
+
// Closes the effect below asked for: each one's close event is its own, even
|
|
24
|
+
// when the browser delivers it after a later reopening.
|
|
25
|
+
const pendingCloses = useRef(0);
|
|
26
|
+
const opener = useRef(undefined);
|
|
27
|
+
useLayoutEffect(() => {
|
|
28
|
+
const element = dialog.current;
|
|
29
|
+
if (element === null) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (isOpen && !element.open) {
|
|
33
|
+
opener.current =
|
|
34
|
+
document.activeElement instanceof HTMLElement
|
|
35
|
+
? document.activeElement
|
|
36
|
+
: undefined;
|
|
37
|
+
element.showModal();
|
|
38
|
+
}
|
|
39
|
+
else if (!isOpen && element.open) {
|
|
40
|
+
pendingCloses.current += 1;
|
|
41
|
+
element.close();
|
|
42
|
+
}
|
|
43
|
+
}, [isOpen]);
|
|
44
|
+
// Removed while open, the browser does not return focus: do it. The opener
|
|
45
|
+
// stays inert until the dialog closes, so close it first.
|
|
46
|
+
useLayoutEffect(() => () => {
|
|
47
|
+
const element = dialog.current;
|
|
48
|
+
if (element?.open !== true) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
pendingCloses.current += 1;
|
|
52
|
+
element.close();
|
|
53
|
+
if (opener.current?.isConnected === true) {
|
|
54
|
+
opener.current.focus();
|
|
55
|
+
}
|
|
56
|
+
}, []);
|
|
57
|
+
return (_jsx("dialog", { ...dialogAttributes({
|
|
58
|
+
titleId,
|
|
59
|
+
descriptionId: description === undefined ? undefined : descriptionId,
|
|
60
|
+
placement,
|
|
61
|
+
}), id: id, ref: dialog, closedby: isDismissible ? "closerequest" : "none", class: joinClasses("ack-dialog", props.class), onCancel: (event) => {
|
|
62
|
+
if (!isDismissible) {
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
}
|
|
65
|
+
}, onClose: () => {
|
|
66
|
+
if (pendingCloses.current > 0) {
|
|
67
|
+
pendingCloses.current -= 1;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
latestOnClose.current();
|
|
71
|
+
}, onPointerDown: (event) => {
|
|
72
|
+
isPressOnBackdrop.current = event.target === event.currentTarget;
|
|
73
|
+
}, onPointerUp: (event) => {
|
|
74
|
+
// A touch's implicit capture retargets its release to the dialog
|
|
75
|
+
// wherever it ends: hit-test where it ends instead.
|
|
76
|
+
const released = document.elementFromPoint(event.clientX, event.clientY);
|
|
77
|
+
if (event.target !== event.currentTarget ||
|
|
78
|
+
released !== event.currentTarget) {
|
|
79
|
+
isPressOnBackdrop.current = false;
|
|
80
|
+
}
|
|
81
|
+
}, onClick: (event) => {
|
|
82
|
+
const isBackdropClick = isPressOnBackdrop.current && event.target === event.currentTarget;
|
|
83
|
+
isPressOnBackdrop.current = false;
|
|
84
|
+
if (isBackdropClick && isDismissible) {
|
|
85
|
+
event.currentTarget.close();
|
|
86
|
+
}
|
|
87
|
+
}, children: _jsxs("div", { class: "ack-dialog-panel", children: [_jsxs("div", { class: "ack-dialog-header", children: [_jsx("h2", { id: titleId, class: "ack-dialog-title", children: title }), closeLabel !== undefined && (_jsx("button", { type: "button", class: "ack-control ack-dialog-close", "aria-label": closeLabel, title: closeLabel, onClick: () => dialog.current?.close(), children: _jsx("span", { class: "ack-dialog-close-icon", "aria-hidden": "true", children: closeIcon ?? (_jsx("svg", { viewBox: "0 0 16 16", focusable: "false", children: _jsx("path", { d: "M3 3l10 10M13 3L3 13" }) })) }) }))] }), description !== undefined && (_jsx("p", { id: descriptionId, class: "ack-dialog-description", children: description })), _jsx("div", { class: "ack-dialog-body", children: children }), actions !== undefined && (_jsx("div", { class: "ack-dialog-actions", children: actions }))] }) }));
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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AC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,YAEtC,eAAM,KAAK,EAAC,uBAAuB,iBAAa,MAAM,YACpD,SAAS,IAAI,CACb,cAAK,OAAO,EAAC,WAAW,EAAC,SAAS,EAAC,OAAO,YACzC,eAAM,CAAC,EAAC,sBAAsB,GAAG,GAC5B,CACN,GACK,GACC,CACT,IACI,EACL,WAAW,KAAK,SAAS,IAAI,CAC7B,YAAG,EAAE,EAAE,aAAa,EAAE,KAAK,EAAC,wBAAwB,YAClD,WAAW,GACT,CACJ,EACD,cAAK,KAAK,EAAC,iBAAiB,YAAE,QAAQ,GAAO,EAC5C,OAAO,KAAK,SAAS,IAAI,CACzB,cAAK,KAAK,EAAC,oBAAoB,YAAE,OAAO,GAAO,CAC/C,IACI,GACE,CACT,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from "./button.js";
|
|
2
|
+
export * from "./dialog.js";
|
|
3
|
+
export * from "./join-classes.js";
|
|
4
|
+
export * from "./knob.js";
|
|
5
|
+
export * from "./menu-button.js";
|
|
6
|
+
export * from "./meter.js";
|
|
7
|
+
export * from "./progress-ring.js";
|
|
8
|
+
export * from "./radio-group.js";
|
|
9
|
+
export * from "./readout.js";
|
|
10
|
+
export * from "./slider.js";
|
|
11
|
+
export * from "./spin-button.js";
|
|
12
|
+
export * from "./switch.js";
|
|
13
|
+
export * from "./tabs.js";
|
|
14
|
+
export * from "./toaster.js";
|
|
15
|
+
export * from "./toggle-button.js";
|
|
16
|
+
export * from "./toolbar.js";
|
|
17
|
+
export * from "./tooltip.js";
|
|
18
|
+
export * from "./tree.js";
|
|
19
|
+
export * from "./use-element-binding.js";
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/preact/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from "./button.js";
|
|
2
|
+
export * from "./dialog.js";
|
|
3
|
+
export * from "./join-classes.js";
|
|
4
|
+
export * from "./knob.js";
|
|
5
|
+
export * from "./menu-button.js";
|
|
6
|
+
export * from "./meter.js";
|
|
7
|
+
export * from "./progress-ring.js";
|
|
8
|
+
export * from "./radio-group.js";
|
|
9
|
+
export * from "./readout.js";
|
|
10
|
+
export * from "./slider.js";
|
|
11
|
+
export * from "./spin-button.js";
|
|
12
|
+
export * from "./switch.js";
|
|
13
|
+
export * from "./tabs.js";
|
|
14
|
+
export * from "./toaster.js";
|
|
15
|
+
export * from "./toggle-button.js";
|
|
16
|
+
export * from "./toolbar.js";
|
|
17
|
+
export * from "./tooltip.js";
|
|
18
|
+
export * from "./tree.js";
|
|
19
|
+
export * from "./use-element-binding.js";
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/preact/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A control's own classes, then the caller's: for the `class` of a component's
|
|
3
|
+
* root, so a caller's class never replaces the ones the stylesheet needs.
|
|
4
|
+
* `ui-music`'s components and the caller's use it for the same.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* joinClasses("ack-control ack-knob", props.class); // "ack-control ack-knob mine"
|
|
8
|
+
*/
|
|
9
|
+
export declare function joinClasses(base: string, extra: string | undefined): string;
|
|
10
|
+
//# sourceMappingURL=join-classes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"join-classes.d.ts","sourceRoot":"","sources":["../../src/preact/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,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A control's own classes, then the caller's: for the `class` of a component's
|
|
3
|
+
* root, so a caller's class never replaces the ones the stylesheet needs.
|
|
4
|
+
* `ui-music`'s components and the caller's use it for the same.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* joinClasses("ack-control ack-knob", props.class); // "ack-control ack-knob mine"
|
|
8
|
+
*/
|
|
9
|
+
export function joinClasses(base, extra) {
|
|
10
|
+
return extra === undefined || extra === "" ? base : `${base} ${extra}`;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=join-classes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"join-classes.js","sourceRoot":"","sources":["../../src/preact/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,51 @@
|
|
|
1
|
+
import type { Callable, CallableNoArgs } from "@ac-kit/core";
|
|
2
|
+
import type { JSX } from "preact";
|
|
3
|
+
import type { ControlTone } from "../tone.js";
|
|
4
|
+
/** Props of {@link Knob}. */
|
|
5
|
+
export type KnobProps = {
|
|
6
|
+
/** Its accessible name, also drawn under it. */
|
|
7
|
+
label: string;
|
|
8
|
+
value: number;
|
|
9
|
+
min: number;
|
|
10
|
+
max: number;
|
|
11
|
+
/** Defaults to 1. */
|
|
12
|
+
step?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The value a double tap goes back to. Without one, a double tap is two taps,
|
|
15
|
+
* and a tap requests entry at once instead of after the double-tap interval.
|
|
16
|
+
*/
|
|
17
|
+
resetValue?: number;
|
|
18
|
+
/**
|
|
19
|
+
* The value the lit arc grows from. Defaults to `min`; a bipolar knob (pan,
|
|
20
|
+
* detune) gives its centre.
|
|
21
|
+
*/
|
|
22
|
+
origin?: number;
|
|
23
|
+
tone?: ControlTone;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** The value as a person reads it, shown and announced. Defaults to `String`. */
|
|
26
|
+
format?: Callable<[value: number], string>;
|
|
27
|
+
/** A new value, once per gesture: at a drag's end, a key, a double tap. */
|
|
28
|
+
onChange: Callable<[value: number]>;
|
|
29
|
+
/** The value following a drag, before it is committed through `onChange`. */
|
|
30
|
+
onInput?: Callable<[value: number]>;
|
|
31
|
+
/**
|
|
32
|
+
* A tap, or Enter or Space while focused: the person wants to type or pick a
|
|
33
|
+
* value. Open your own surface for it — a dialog, a sheet, a large `Slider` —
|
|
34
|
+
* and report its result through `onChange`.
|
|
35
|
+
*/
|
|
36
|
+
onRequestEntry?: CallableNoArgs;
|
|
37
|
+
id?: string;
|
|
38
|
+
class?: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* A rotary control, as on a synthesizer: drag up or down to turn it (not
|
|
42
|
+
* around, which hides it under a finger), with Shift for fine control; tap it
|
|
43
|
+
* to request value entry; double-tap to reset it. Focused, the arrow keys step
|
|
44
|
+
* it, Page Up and Page Down by ten steps, Home and End to the ends. It reports
|
|
45
|
+
* a value once a gesture ends.
|
|
46
|
+
*
|
|
47
|
+
* For a compact panel of sound or tempo controls; a setting with room to spare
|
|
48
|
+
* reads better as a `Slider`.
|
|
49
|
+
*/
|
|
50
|
+
export declare function Knob(props: KnobProps): JSX.Element;
|
|
51
|
+
//# sourceMappingURL=knob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knob.d.ts","sourceRoot":"","sources":["../../src/preact/knob.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAclC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C,6BAA6B;AAC7B,MAAM,MAAM,SAAS,GAAG;IACvB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iFAAiF;IACjF,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IAC3C,2EAA2E;IAC3E,QAAQ,EAAE,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACpC,6EAA6E;IAC7E,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACpC;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAsBF;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CA0LlD"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { bindPressGesture } from "@ac-kit/ui-gesture/dom";
|
|
3
|
+
import { useRef, useState } from "preact/hooks";
|
|
4
|
+
import { KNOB_ARC, knobAngles, knobArcPath, knobDragValue, } from "../knob/knob.js";
|
|
5
|
+
import { clampedSliderValue_ } from "../slider/_clamped-value.js";
|
|
6
|
+
import { sliderAttributes } from "../slider/slider-attributes.js";
|
|
7
|
+
import { snapSliderValue } from "../slider/slider-range.js";
|
|
8
|
+
import { steppedValue } from "../slider/stepped-value.js";
|
|
9
|
+
import { joinClasses } from "./join-classes.js";
|
|
10
|
+
import { useElementBinding, useLatest } from "./use-element-binding.js";
|
|
11
|
+
// The dial's drawing, in its 52 × 52 view box.
|
|
12
|
+
const DIAL_ = { centerX: 26, centerY: 26, radius: 22 };
|
|
13
|
+
const CAP_RADIUS_ = 15;
|
|
14
|
+
const POINTER_LENGTH_ = 12;
|
|
15
|
+
// An arc shorter than this, in degrees, would draw as a dot under the round
|
|
16
|
+
// line caps, so none is drawn.
|
|
17
|
+
const MIN_ARC_DEGREES_ = 0.5;
|
|
18
|
+
const TRACK_PATH_ = knobArcPath(DIAL_, KNOB_ARC.startDegrees, KNOB_ARC.startDegrees + KNOB_ARC.sweepDegrees);
|
|
19
|
+
/**
|
|
20
|
+
* A rotary control, as on a synthesizer: drag up or down to turn it (not
|
|
21
|
+
* around, which hides it under a finger), with Shift for fine control; tap it
|
|
22
|
+
* to request value entry; double-tap to reset it. Focused, the arrow keys step
|
|
23
|
+
* it, Page Up and Page Down by ten steps, Home and End to the ends. It reports
|
|
24
|
+
* a value once a gesture ends.
|
|
25
|
+
*
|
|
26
|
+
* For a compact panel of sound or tempo controls; a setting with room to spare
|
|
27
|
+
* reads better as a `Slider`.
|
|
28
|
+
*/
|
|
29
|
+
export function Knob(props) {
|
|
30
|
+
const { label, value, min, max, step = 1, resetValue, origin, tone, disabled = false, format = String, onChange, onInput, onRequestEntry, id, } = props;
|
|
31
|
+
const range = { min, max, step };
|
|
32
|
+
const [dragged, setDragged] = useState(undefined);
|
|
33
|
+
const drag = useRef(undefined);
|
|
34
|
+
const latest = useLatest({
|
|
35
|
+
range,
|
|
36
|
+
value,
|
|
37
|
+
resetValue,
|
|
38
|
+
disabled,
|
|
39
|
+
onChange,
|
|
40
|
+
onInput,
|
|
41
|
+
onRequestEntry,
|
|
42
|
+
});
|
|
43
|
+
const shown = clampedSliderValue_(dragged ?? value, range);
|
|
44
|
+
const angles = knobAngles(shown, range, { origin });
|
|
45
|
+
const hasReset = resetValue !== undefined;
|
|
46
|
+
const commit = (next) => {
|
|
47
|
+
const { range, value, onChange } = latest.current;
|
|
48
|
+
const snapped = snapSliderValue(next, range);
|
|
49
|
+
if (snapped !== value) {
|
|
50
|
+
onChange(snapped);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const endDrag = () => {
|
|
54
|
+
drag.current = undefined;
|
|
55
|
+
setDragged(undefined);
|
|
56
|
+
};
|
|
57
|
+
const valueAt = (current, update) => knobDragValue(current.startValue, -update.movementY, latest.current.range, {
|
|
58
|
+
isFine: update.phase === "end" ? current.isFine : update.shiftKey,
|
|
59
|
+
});
|
|
60
|
+
const onDrag = (update) => {
|
|
61
|
+
const current = drag.current;
|
|
62
|
+
if (current === undefined) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (update.phase === "cancel" || latest.current.disabled) {
|
|
66
|
+
endDrag();
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const next = valueAt(current, update);
|
|
70
|
+
if (next !== (current.value ?? current.startValue)) {
|
|
71
|
+
latest.current.onInput?.(next);
|
|
72
|
+
}
|
|
73
|
+
if (update.phase === "end") {
|
|
74
|
+
// The release point decides, not the last move.
|
|
75
|
+
endDrag();
|
|
76
|
+
commit(next);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
current.value = next;
|
|
80
|
+
current.isFine = update.shiftKey;
|
|
81
|
+
setDragged(next);
|
|
82
|
+
};
|
|
83
|
+
const root = useElementBinding((element, signal) => {
|
|
84
|
+
const bound = bindPressGesture(element, {
|
|
85
|
+
onPress: () => {
|
|
86
|
+
drag.current = {
|
|
87
|
+
startValue: latest.current.value,
|
|
88
|
+
value: undefined,
|
|
89
|
+
isFine: false,
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
onDrag,
|
|
93
|
+
// A tap settles after the double-tap window, which a disabling can
|
|
94
|
+
// fall in.
|
|
95
|
+
onTap: () => {
|
|
96
|
+
if (!latest.current.disabled) {
|
|
97
|
+
latest.current.onRequestEntry?.();
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
onDoubleTap: () => {
|
|
101
|
+
const { resetValue, disabled } = latest.current;
|
|
102
|
+
if (resetValue !== undefined && !disabled) {
|
|
103
|
+
commit(resetValue);
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
}, {
|
|
107
|
+
doubleTap: hasReset,
|
|
108
|
+
touchAction: "none",
|
|
109
|
+
accept: () => !latest.current.disabled,
|
|
110
|
+
signal,
|
|
111
|
+
});
|
|
112
|
+
// A rebinding mid-drag drops the drag with the old binding, and one that
|
|
113
|
+
// disabling causes also drops a tap pending in the double-tap window.
|
|
114
|
+
return {
|
|
115
|
+
[Symbol.dispose]() {
|
|
116
|
+
bound[Symbol.dispose]();
|
|
117
|
+
endDrag();
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
}, [hasReset, disabled]);
|
|
121
|
+
const onKeyDown = (event) => {
|
|
122
|
+
if (disabled) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const next = steppedValue(clampedSliderValue_(value, range), event.key, range);
|
|
126
|
+
if (next !== undefined) {
|
|
127
|
+
event.preventDefault();
|
|
128
|
+
commit(next);
|
|
129
|
+
}
|
|
130
|
+
else if ((event.key === "Enter" || event.key === " ") &&
|
|
131
|
+
onRequestEntry !== undefined) {
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
onRequestEntry();
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
return (_jsxs("div", { ...sliderAttributes({
|
|
137
|
+
label,
|
|
138
|
+
value: shown,
|
|
139
|
+
range,
|
|
140
|
+
valueText: format(shown),
|
|
141
|
+
disabled,
|
|
142
|
+
}), ref: root, id: id, class: joinClasses("ack-control ack-knob", props.class), "data-tone": tone, "data-dragging": dragged === undefined ? undefined : "", tabIndex: disabled ? -1 : 0, onKeyDown: onKeyDown, children: [_jsxs("svg", { class: "ack-knob-dial", viewBox: "0 0 52 52", "aria-hidden": "true", children: [_jsx("path", { class: "ack-knob-track", d: TRACK_PATH_ }), angles.arcTo - angles.arcFrom > MIN_ARC_DEGREES_ && (_jsx("path", { class: "ack-knob-arc", d: knobArcPath(DIAL_, angles.arcFrom, angles.arcTo) })), _jsx("circle", { class: "ack-knob-cap", cx: DIAL_.centerX, cy: DIAL_.centerY, r: CAP_RADIUS_ }), _jsx("line", { class: "ack-knob-pointer", x1: DIAL_.centerX, y1: DIAL_.centerY, x2: DIAL_.centerX, y2: DIAL_.centerY - POINTER_LENGTH_, transform: `rotate(${angles.pointer} ${DIAL_.centerX} ${DIAL_.centerY})` })] }), _jsx("span", { class: "ack-knob-value", children: format(shown) }), _jsx("span", { class: "ack-knob-label", children: label })] }));
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=knob.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knob.js","sourceRoot":"","sources":["../../src/preact/knob.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EACN,QAAQ,EAER,UAAU,EACV,WAAW,EACX,aAAa,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAoB,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAuCxE,+CAA+C;AAC/C,MAAM,KAAK,GAAa,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AACjE,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,4EAA4E;AAC5E,+BAA+B;AAC/B,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AAC,OAAO,GAAG,gBAAgB,IAAI,CACpD,eACC,KAAK,EAAC,cAAc,EACpB,CAAC,EAAE,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,GAClD,CACF,EACD,iBACC,KAAK,EAAC,cAAc,EACpB,EAAE,EAAE,KAAK,CAAC,OAAO,EACjB,EAAE,EAAE,KAAK,CAAC,OAAO,EACjB,CAAC,EAAE,WAAW,GACb,EACF,eACC,KAAK,EAAC,kBAAkB,EACxB,EAAE,EAAE,KAAK,CAAC,OAAO,EACjB,EAAE,EAAE,KAAK,CAAC,OAAO,EACjB,EAAE,EAAE,KAAK,CAAC,OAAO,EACjB,EAAE,EAAE,KAAK,CAAC,OAAO,GAAG,eAAe,EACnC,SAAS,EAAE,UAAU,MAAM,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,GAAG,GACvE,IACG,EACN,eAAM,KAAK,EAAC,gBAAgB,YAAE,MAAM,CAAC,KAAK,CAAC,GAAQ,EACnD,eAAM,KAAK,EAAC,gBAAgB,YAAE,KAAK,GAAQ,IACtC,CACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { Callable, CallableNoArgs } from "@ac-kit/core";
|
|
2
|
+
import { type ButtonHTMLAttributes, type ComponentChildren, type JSX } from "preact";
|
|
3
|
+
import type { AnchoredAlign, AnchoredSide } from "../anchored/anchored.js";
|
|
4
|
+
import { type ButtonSize, type ButtonVariant } from "../button/button.js";
|
|
5
|
+
import type { ControlTone } from "../tone.js";
|
|
6
|
+
/** Props of {@link MenuButton}: its own, then any other `<button>` attribute. */
|
|
7
|
+
export type MenuButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "class" | "className" | "children" | "popovertarget" | "popoverTarget" | "popovertargetaction" | "popoverTargetAction"> & {
|
|
8
|
+
/** The button's text and the menu's name. */
|
|
9
|
+
label: string;
|
|
10
|
+
/**
|
|
11
|
+
* Draw the icon alone, `label` naming and titling the button. Defaults to
|
|
12
|
+
* false.
|
|
13
|
+
*/
|
|
14
|
+
isLabelHidden?: boolean;
|
|
15
|
+
/** Drawn before the label, hidden from assistive technology. */
|
|
16
|
+
icon?: ComponentChildren;
|
|
17
|
+
/** Defaults to `secondary`. */
|
|
18
|
+
variant?: ButtonVariant;
|
|
19
|
+
/** Defaults to `regular`. */
|
|
20
|
+
size?: ButtonSize;
|
|
21
|
+
tone?: ControlTone;
|
|
22
|
+
/** Defaults to `block-end`: below the button. */
|
|
23
|
+
side?: AnchoredSide;
|
|
24
|
+
/** Defaults to `start`. */
|
|
25
|
+
align?: AnchoredAlign;
|
|
26
|
+
/** Called once the menu has opened or closed. */
|
|
27
|
+
onOpenChange?: Callable<[isOpen: boolean]>;
|
|
28
|
+
/**
|
|
29
|
+
* The items: {@link MenuItem}, {@link MenuItemCheckbox}, {@link MenuItemRadio},
|
|
30
|
+
* grouped by {@link MenuGroup}, divided by {@link MenuSeparator}.
|
|
31
|
+
*/
|
|
32
|
+
children: ComponentChildren;
|
|
33
|
+
/** Added to the menu's classes. */
|
|
34
|
+
menuClass?: string;
|
|
35
|
+
class?: string;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* A button that opens a menu of actions and settings (WAI-ARIA menu button and
|
|
39
|
+
* menu patterns), over the Popover API: the menu sits in the top layer,
|
|
40
|
+
* anchored to the button by CSS anchor positioning, flipping to the other side
|
|
41
|
+
* when the viewport has no room; a press outside it or Escape closes it.
|
|
42
|
+
*
|
|
43
|
+
* Enter, Space and Arrow Down open it on its first item, Arrow Up on its last;
|
|
44
|
+
* in it, the arrows move round, Home and End go to the ends, typing a name
|
|
45
|
+
* moves to it, Enter and a click choose an item and close, Space checks a
|
|
46
|
+
* checkbox or radio item and keeps it open, Escape closes it and Tab moves on,
|
|
47
|
+
* focus going back to the button. A mouse moving over the items focuses them.
|
|
48
|
+
* The menu closes before an item's action runs, so an action that opens a
|
|
49
|
+
* dialog has the button as its opener.
|
|
50
|
+
*
|
|
51
|
+
* Its open state is its own (the browser's popover state): `onOpenChange`
|
|
52
|
+
* reports it. The items' checked states are the caller's.
|
|
53
|
+
*/
|
|
54
|
+
export declare function MenuButton(props: MenuButtonProps): JSX.Element;
|
|
55
|
+
type ItemBaseProps_ = {
|
|
56
|
+
/** Its label. */
|
|
57
|
+
children: ComponentChildren;
|
|
58
|
+
/** Drawn before the label, hidden from assistive technology. */
|
|
59
|
+
icon?: ComponentChildren;
|
|
60
|
+
/** Announced and focusable, but not chosen. Defaults to false. */
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
/** The name typeahead matches, when the label is not plain text. */
|
|
63
|
+
textValue?: string;
|
|
64
|
+
id?: string;
|
|
65
|
+
class?: string;
|
|
66
|
+
};
|
|
67
|
+
/** Props of {@link MenuItem}. */
|
|
68
|
+
export type MenuItemProps = ItemBaseProps_ & {
|
|
69
|
+
/** Called when it is chosen, once the menu has closed. */
|
|
70
|
+
onSelect: CallableNoArgs;
|
|
71
|
+
};
|
|
72
|
+
/** An action in a {@link MenuButton}'s menu: the `menuitem` role. */
|
|
73
|
+
export declare function MenuItem(props: MenuItemProps): JSX.Element;
|
|
74
|
+
/** Props of {@link MenuItemCheckbox}. */
|
|
75
|
+
export type MenuItemCheckboxProps = ItemBaseProps_ & {
|
|
76
|
+
isChecked: boolean;
|
|
77
|
+
/** Called with the state asked for: the opposite of `isChecked`. */
|
|
78
|
+
onCheckedChange: Callable<[isChecked: boolean]>;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* A setting turned on or off in a {@link MenuButton}'s menu: the
|
|
82
|
+
* `menuitemcheckbox` role, a check mark drawn while on. Space flips it and
|
|
83
|
+
* keeps the menu open; Enter and a click flip it and close the menu.
|
|
84
|
+
*/
|
|
85
|
+
export declare function MenuItemCheckbox(props: MenuItemCheckboxProps): JSX.Element;
|
|
86
|
+
/** Props of {@link MenuItemRadio}. */
|
|
87
|
+
export type MenuItemRadioProps = ItemBaseProps_ & {
|
|
88
|
+
isChecked: boolean;
|
|
89
|
+
/** Called when it is chosen while not checked. */
|
|
90
|
+
onSelect: CallableNoArgs;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* One choice among the radio items of a {@link MenuGroup}: the `menuitemradio`
|
|
94
|
+
* role, a dot drawn on the chosen one. Space chooses it and keeps the menu
|
|
95
|
+
* open; Enter and a click choose it and close the menu. Choosing the checked
|
|
96
|
+
* one reports nothing.
|
|
97
|
+
*/
|
|
98
|
+
export declare function MenuItemRadio(props: MenuItemRadioProps): JSX.Element;
|
|
99
|
+
/** Props of {@link MenuGroup}. */
|
|
100
|
+
export type MenuGroupProps = {
|
|
101
|
+
/** Its accessible name, drawn above its items unless `isLabelHidden`. */
|
|
102
|
+
label: string;
|
|
103
|
+
isLabelHidden?: boolean;
|
|
104
|
+
children: ComponentChildren;
|
|
105
|
+
class?: string;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* A named group of items in a {@link MenuButton}'s menu, such as the radio items
|
|
109
|
+
* of one choice: the `group` role.
|
|
110
|
+
*/
|
|
111
|
+
export declare function MenuGroup(props: MenuGroupProps): JSX.Element;
|
|
112
|
+
/** A line between items of a {@link MenuButton}'s menu: the `separator` role. */
|
|
113
|
+
export declare function MenuSeparator(props: {
|
|
114
|
+
class?: string;
|
|
115
|
+
}): JSX.Element;
|
|
116
|
+
export {};
|
|
117
|
+
//# sourceMappingURL=menu-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-button.d.ts","sourceRoot":"","sources":["../../src/preact/menu-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EAEtB,KAAK,GAAG,EAER,MAAM,QAAQ,CAAC;AAUhB,OAAO,KAAK,EAAE,aAAa,EAA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