@voidable/ui 0.11.0 → 0.12.1
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/README.md +1 -1
- package/dist/angular/index.d.ts +2 -2
- package/dist/angular/index.js +2 -1
- package/dist/chunks/activation-B8aBarKd.js +4 -0
- package/dist/chunks/carousel-C9u0bg5l.js +10 -0
- package/dist/chunks/choice-BTrsi7OW.js +16 -0
- package/dist/chunks/data-Baycjoo4.js +96 -0
- package/dist/chunks/fields-MEqz-olE.js +21 -0
- package/dist/chunks/{form-control-C0vH6gii.js → form-control-fL-Hhy91.js} +49 -48
- package/dist/chunks/{keyboard-CEhMSkws.js → keyboard-ChtDvhB_.js} +4 -23
- package/dist/chunks/{keyboard-activation-CV0m4hkn.js → keyboard-activation-BfEyoaMT.js} +4 -6
- package/dist/chunks/menu-CxRRgkJI.js +21 -0
- package/dist/chunks/{modal-DWGkNdNG.js → modal-Cz2-Ov76.js} +23 -15
- package/dist/chunks/nav-menu-Bx284Dk6.js +12 -0
- package/dist/chunks/{overlay-CH7L4N-h.js → overlay-BuV-4Yvt.js} +75 -68
- package/dist/chunks/overlay-K1ilWC1p.js +4 -0
- package/dist/chunks/pickers-CjlFgNke.js +36 -0
- package/dist/chunks/table-BBpqwWEi.js +4 -0
- package/dist/chunks/tabs-Buf3EBWq.js +10 -0
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/accordion.js +22 -14
- package/dist/components/action-input.d.ts +2 -1
- package/dist/components/action-input.js +59 -55
- package/dist/components/bar-chart.js +41 -40
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +15 -11
- package/dist/components/button.d.ts +7 -0
- package/dist/components/button.js +23 -16
- package/dist/components/calendar.d.ts +45 -10
- package/dist/components/calendar.js +183 -129
- package/dist/components/carousel.d.ts +22 -0
- package/dist/components/carousel.js +64 -35
- package/dist/components/charts/data.d.ts +2 -2
- package/dist/components/checkbox-group.js +22 -21
- package/dist/components/checkbox.d.ts +7 -0
- package/dist/components/checkbox.js +29 -24
- package/dist/components/collapsible.d.ts +7 -0
- package/dist/components/collapsible.js +19 -11
- package/dist/components/color-picker.js +28 -27
- package/dist/components/combobox.d.ts +13 -1
- package/dist/components/combobox.js +54 -41
- package/dist/components/compose-input.d.ts +9 -1
- package/dist/components/compose-input.js +28 -16
- package/dist/components/dialog.js +1 -1
- package/dist/components/donut-chart.js +57 -56
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.d.ts +22 -0
- package/dist/components/dropdown-menu.js +54 -39
- package/dist/components/editable.d.ts +11 -1
- package/dist/components/editable.js +35 -22
- package/dist/components/error-fallback.d.ts +4 -2
- package/dist/components/error-fallback.js +34 -28
- package/dist/components/file-upload.d.ts +9 -0
- package/dist/components/file-upload.js +54 -28
- package/dist/components/gauge.js +108 -107
- package/dist/components/hamburger.d.ts +7 -0
- package/dist/components/hamburger.js +28 -19
- package/dist/components/hover-card.d.ts +7 -0
- package/dist/components/hover-card.js +22 -14
- package/dist/components/indicator.js +15 -14
- package/dist/components/input.js +1 -1
- package/dist/components/line-chart.js +43 -42
- package/dist/components/menu.d.ts +25 -0
- package/dist/components/menu.js +55 -33
- package/dist/components/multiselect.d.ts +17 -1
- package/dist/components/multiselect.js +96 -74
- package/dist/components/nav-menu.d.ts +9 -0
- package/dist/components/nav-menu.js +30 -23
- package/dist/components/number-input.d.ts +15 -1
- package/dist/components/number-input.js +71 -37
- package/dist/components/pagination.js +25 -24
- package/dist/components/pin-input.d.ts +11 -0
- package/dist/components/pin-input.js +46 -32
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.js +21 -13
- package/dist/components/radio-group.js +1 -1
- package/dist/components/radio.d.ts +10 -1
- package/dist/components/radio.js +37 -32
- package/dist/components/segmented-control.d.ts +14 -0
- package/dist/components/segmented-control.js +40 -28
- package/dist/components/sidebar.d.ts +1 -0
- package/dist/components/sidebar.js +14 -10
- package/dist/components/slider.js +1 -1
- package/dist/components/spinner.d.ts +5 -3
- package/dist/components/spinner.js +21 -14
- package/dist/components/stat.js +1 -1
- package/dist/components/status-dot.d.ts +2 -2
- package/dist/components/status-dot.js +12 -14
- package/dist/components/stepper.d.ts +2 -0
- package/dist/components/stepper.js +20 -13
- package/dist/components/switch.d.ts +7 -0
- package/dist/components/switch.js +24 -16
- package/dist/components/table.d.ts +77 -1
- package/dist/components/table.js +562 -73
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +42 -33
- package/dist/components/tag.js +12 -11
- package/dist/components/tags-input.d.ts +10 -1
- package/dist/components/tags-input.js +42 -30
- package/dist/components/textarea.js +1 -1
- package/dist/components/toast.d.ts +2 -0
- package/dist/components/toast.js +35 -28
- package/dist/components/toggle-group.d.ts +8 -0
- package/dist/components/toggle-group.js +24 -17
- package/dist/components/toggle.d.ts +7 -0
- package/dist/components/toggle.js +23 -15
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.js +20 -12
- package/dist/components.json +96 -74
- package/dist/custom-elements.json +4213 -131
- package/dist/dev/rules.d.ts +0 -1
- package/dist/dev/types.d.ts +3 -1
- package/dist/dev.js +244 -113
- package/dist/index.d.ts +4 -0
- package/dist/index.js +68 -66
- package/dist/keyboard-activation.d.ts +9 -9
- package/dist/keyboard.d.ts +2 -10
- package/dist/keymaps/activation.d.ts +8 -0
- package/dist/keymaps/carousel.d.ts +9 -0
- package/dist/keymaps/choice.d.ts +21 -0
- package/dist/keymaps/fields.d.ts +31 -0
- package/dist/keymaps/index.d.ts +2 -0
- package/dist/keymaps/menu.d.ts +36 -0
- package/dist/keymaps/nav-menu.d.ts +11 -0
- package/dist/keymaps/overlay.d.ts +4 -0
- package/dist/keymaps/pickers.d.ts +36 -0
- package/dist/keymaps/table.d.ts +8 -0
- package/dist/keymaps/tabs.d.ts +7 -0
- package/dist/keymaps.js +51 -0
- package/dist/keys.d.ts +46 -0
- package/dist/keys.js +57 -0
- package/dist/llms.txt +11 -3
- package/dist/messages/ar.d.ts +1 -0
- package/dist/messages/ar.js +130 -0
- package/dist/messages/fr.d.ts +1 -0
- package/dist/messages/fr.js +109 -0
- package/dist/messages.d.ts +213 -0
- package/dist/messages.js +190 -0
- package/dist/modal.d.ts +7 -0
- package/dist/reference.md +817 -17
- package/dist/testing/index.d.ts +46 -0
- package/dist/testing.js +79 -0
- package/dist/types/elements.d.ts +89 -73
- package/dist/types/react.d.ts +5 -1
- package/dist/types/solid.d.ts +5 -1
- package/dist/types/solid2.d.ts +4 -0
- package/dist/types/svelte.d.ts +5 -1
- package/dist/types/vue.d.ts +5 -1
- package/dist/vscode.html-custom-data.json +384 -18
- package/dist/web-types.json +830 -69
- package/package.json +22 -2
- package/dist/chunks/data-BpiiNapL.js +0 -95
package/dist/index.d.ts
CHANGED
|
@@ -71,3 +71,7 @@ export { VoidDonutChart } from './components/donut-chart.js';
|
|
|
71
71
|
export type { DonutChartData, DonutChartSegment } from './components/donut-chart.js';
|
|
72
72
|
export { VoidGauge } from './components/gauge.js';
|
|
73
73
|
export type { GaugeData, GaugeSegment, GaugeZone } from './components/gauge.js';
|
|
74
|
+
export { configureKeys } from './keys.js';
|
|
75
|
+
export type { KeyMap, KeyOverrides } from './keys.js';
|
|
76
|
+
export { registerMessages, msg, langOf, localeOf } from './messages.js';
|
|
77
|
+
export type { Message, MessageKey, MessageParameters, MessageContext, Messages } from './messages.js';
|
package/dist/index.js
CHANGED
|
@@ -1,68 +1,70 @@
|
|
|
1
1
|
import { t as e } from "./chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { VoidBadge as t } from "./components/badge.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
|
|
3
|
+
import { configureKeys as n } from "./keys.js";
|
|
4
|
+
import { langOf as r, localeOf as i, msg as a, registerMessages as o } from "./messages.js";
|
|
5
|
+
import { VoidButton as s } from "./components/button.js";
|
|
6
|
+
import { VoidDivider as c } from "./components/divider.js";
|
|
7
|
+
import { VoidSpinner as l } from "./components/spinner.js";
|
|
8
|
+
import { VoidSkeleton as u } from "./components/skeleton.js";
|
|
9
|
+
import { VoidStatusDot as d } from "./components/status-dot.js";
|
|
10
|
+
import { VoidSwitch as f } from "./components/switch.js";
|
|
11
|
+
import { VoidAvatar as p } from "./components/avatar.js";
|
|
12
|
+
import { VoidAlert as m } from "./components/alert.js";
|
|
13
|
+
import { VoidTag as h } from "./components/tag.js";
|
|
14
|
+
import { VoidProgress as g } from "./components/progress.js";
|
|
15
|
+
import { VoidPanel as _ } from "./components/panel.js";
|
|
16
|
+
import { VoidInput as v } from "./components/input.js";
|
|
17
|
+
import { VoidTextarea as y } from "./components/textarea.js";
|
|
18
|
+
import { VoidSelect as b } from "./components/select.js";
|
|
19
|
+
import { VoidCheckbox as x } from "./components/checkbox.js";
|
|
20
|
+
import { VoidRadio as S } from "./components/radio.js";
|
|
21
|
+
import { VoidRadioGroup as C } from "./components/radio-group.js";
|
|
22
|
+
import { VoidField as w } from "./components/field.js";
|
|
23
|
+
import { VoidMultiselect as T, VoidOption as E } from "./components/multiselect.js";
|
|
24
|
+
import { VoidDialog as D } from "./components/dialog.js";
|
|
25
|
+
import { VoidTabs as O } from "./components/tabs.js";
|
|
26
|
+
import { VoidAccordion as k, VoidAccordionItem as A } from "./components/accordion.js";
|
|
27
|
+
import { VoidBreadcrumbs as j } from "./components/breadcrumbs.js";
|
|
28
|
+
import { VoidList as M, VoidListItem as N } from "./components/list.js";
|
|
29
|
+
import { VoidToast as P, VoidToastContainer as F, toast as I } from "./components/toast.js";
|
|
30
|
+
import { VoidStepper as L } from "./components/stepper.js";
|
|
31
|
+
import { VoidDrawer as R } from "./components/drawer.js";
|
|
32
|
+
import { VoidCard as z } from "./components/card.js";
|
|
33
|
+
import { VoidPopover as B } from "./components/popover.js";
|
|
34
|
+
import { VoidTooltip as V } from "./components/tooltip.js";
|
|
35
|
+
import { VoidBanner as H } from "./components/banner.js";
|
|
36
|
+
import { VoidScrollArea as U } from "./components/scroll-area.js";
|
|
37
|
+
import { VoidTable as W } from "./components/table.js";
|
|
38
|
+
import { VoidPagination as G } from "./components/pagination.js";
|
|
39
|
+
import { VoidErrorFallback as K } from "./components/error-fallback.js";
|
|
40
|
+
import { VoidCheckboxGroup as q } from "./components/checkbox-group.js";
|
|
41
|
+
import { VoidCombobox as J } from "./components/combobox.js";
|
|
42
|
+
import { VoidSlider as Y } from "./components/slider.js";
|
|
43
|
+
import { VoidFileUpload as X } from "./components/file-upload.js";
|
|
44
|
+
import { VoidNavBar as Z } from "./components/nav-bar.js";
|
|
45
|
+
import { VoidHamburger as Q } from "./components/hamburger.js";
|
|
46
|
+
import { VoidComposeInput as $ } from "./components/compose-input.js";
|
|
47
|
+
import { VoidSidebar as ee } from "./components/sidebar.js";
|
|
48
|
+
import { VoidToggle as te } from "./components/toggle.js";
|
|
49
|
+
import { VoidToggleGroup as ne } from "./components/toggle-group.js";
|
|
50
|
+
import { VoidSegmentedControl as re, VoidSegmentedControlItem as ie } from "./components/segmented-control.js";
|
|
51
|
+
import { VoidStat as ae } from "./components/stat.js";
|
|
52
|
+
import { VoidCalendar as oe, VoidDatePicker as se } from "./components/calendar.js";
|
|
53
|
+
import { VoidCarousel as ce, VoidCarouselNext as le, VoidCarouselPrevious as ue } from "./components/carousel.js";
|
|
54
|
+
import { VoidDropdownMenu as de, VoidDropdownMenuItem as fe } from "./components/dropdown-menu.js";
|
|
55
|
+
import { VoidIndicator as pe } from "./components/indicator.js";
|
|
56
|
+
import { VoidMenu as me, VoidMenuGroup as he, VoidMenuItem as ge } from "./components/menu.js";
|
|
57
|
+
import { VoidNumberInput as _e } from "./components/number-input.js";
|
|
58
|
+
import { VoidCollapsible as ve } from "./components/collapsible.js";
|
|
59
|
+
import { VoidEditable as ye } from "./components/editable.js";
|
|
60
|
+
import { VoidHoverCard as be } from "./components/hover-card.js";
|
|
61
|
+
import { VoidPinInput as xe } from "./components/pin-input.js";
|
|
62
|
+
import { VoidTagsInput as Se } from "./components/tags-input.js";
|
|
63
|
+
import { VoidNavMenu as Ce, VoidNavMenuItem as we } from "./components/nav-menu.js";
|
|
64
|
+
import { VoidColorPicker as Te } from "./components/color-picker.js";
|
|
65
|
+
import { VoidActionInput as Ee } from "./components/action-input.js";
|
|
66
|
+
import { VoidBarChart as De } from "./components/bar-chart.js";
|
|
67
|
+
import { VoidLineChart as Oe } from "./components/line-chart.js";
|
|
68
|
+
import { VoidDonutChart as ke } from "./components/donut-chart.js";
|
|
69
|
+
import { VoidGauge as Ae } from "./components/gauge.js";
|
|
70
|
+
export { k as VoidAccordion, A as VoidAccordionItem, Ee as VoidActionInput, m as VoidAlert, p as VoidAvatar, t as VoidBadge, H as VoidBanner, De as VoidBarChart, j as VoidBreadcrumbs, s as VoidButton, oe as VoidCalendar, z as VoidCard, ce as VoidCarousel, le as VoidCarouselNext, ue as VoidCarouselPrevious, x as VoidCheckbox, q as VoidCheckboxGroup, ve as VoidCollapsible, Te as VoidColorPicker, J as VoidCombobox, $ as VoidComposeInput, se as VoidDatePicker, D as VoidDialog, c as VoidDivider, ke as VoidDonutChart, R as VoidDrawer, de as VoidDropdownMenu, fe as VoidDropdownMenuItem, ye as VoidEditable, e as VoidElement, K as VoidErrorFallback, w as VoidField, X as VoidFileUpload, Ae as VoidGauge, Q as VoidHamburger, be as VoidHoverCard, pe as VoidIndicator, v as VoidInput, Oe as VoidLineChart, M as VoidList, N as VoidListItem, me as VoidMenu, he as VoidMenuGroup, ge as VoidMenuItem, T as VoidMultiselect, Z as VoidNavBar, Ce as VoidNavMenu, we as VoidNavMenuItem, _e as VoidNumberInput, E as VoidOption, G as VoidPagination, _ as VoidPanel, xe as VoidPinInput, B as VoidPopover, g as VoidProgress, S as VoidRadio, C as VoidRadioGroup, U as VoidScrollArea, re as VoidSegmentedControl, ie as VoidSegmentedControlItem, b as VoidSelect, ee as VoidSidebar, u as VoidSkeleton, Y as VoidSlider, l as VoidSpinner, ae as VoidStat, d as VoidStatusDot, L as VoidStepper, f as VoidSwitch, W as VoidTable, O as VoidTabs, h as VoidTag, Se as VoidTagsInput, y as VoidTextarea, P as VoidToast, F as VoidToastContainer, te as VoidToggle, ne as VoidToggleGroup, V as VoidTooltip, n as configureKeys, r as langOf, i as localeOf, a as msg, o as registerMessages, I as toast };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
2
|
export interface KeyboardActivationOptions {
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
/** Space activates, on keyup, as a native button does. Default true. */
|
|
6
|
-
space?: boolean | (() => boolean);
|
|
3
|
+
/** False while the host leaves the keys to an element inside it (a link button). Default: always on. */
|
|
4
|
+
when?: () => boolean;
|
|
7
5
|
/** True while the element is disabled: no key does anything. */
|
|
8
6
|
disabled?: () => boolean;
|
|
9
7
|
/** What activation does. Default: `host.click()`, a real `click` event that bubbles. */
|
|
10
8
|
activate?: (e: KeyboardEvent) => void;
|
|
11
9
|
}
|
|
12
10
|
/**
|
|
13
|
-
* Makes a custom element activate like a native `<button>`:
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `@click`, Turbo, a form's submit)
|
|
17
|
-
*
|
|
11
|
+
* Makes a custom element activate like a native `<button>`: the keys of its `activate` action (Enter and Space by
|
|
12
|
+
* default; see `keymaps/activation.ts`) fire a real `click`, Enter on keydown and Space on keyup (and only when the
|
|
13
|
+
* same element saw the keydown), and a disabled or `aria-disabled` element does nothing. Everything that listens
|
|
14
|
+
* for `click` (an overlay trigger, `onClick`, `phx-click`, `wire:click`, Alpine `@click`, Turbo, a form's submit)
|
|
15
|
+
* therefore works the same for the keyboard as for the mouse. Keys that land on an element inside the host (a
|
|
16
|
+
* native `<a>`, `<button>` or `<input>` it contains) are left to that element. The host's class says which keys
|
|
17
|
+
* (`static keyMap`) and an application can rebind or switch them off (`keys`, `configureKeys`).
|
|
18
18
|
*/
|
|
19
19
|
export declare class KeyboardActivation implements ReactiveController {
|
|
20
20
|
private readonly _host;
|
package/dist/keyboard.d.ts
CHANGED
|
@@ -28,15 +28,7 @@ export declare class Typeahead {
|
|
|
28
28
|
match(char: string, labels: readonly string[], disabled: readonly boolean[], current: number): number;
|
|
29
29
|
reset(): void;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
export
|
|
33
|
-
/**
|
|
34
|
-
* The keys that move along the inline axis for `el`: `next` is ArrowRight in
|
|
35
|
-
* left-to-right and ArrowLeft in right-to-left; `prev` is the opposite.
|
|
36
|
-
*/
|
|
37
|
-
export declare function inlineKeys(el: Element): {
|
|
38
|
-
next: 'ArrowLeft' | 'ArrowRight';
|
|
39
|
-
prev: 'ArrowLeft' | 'ArrowRight';
|
|
40
|
-
};
|
|
31
|
+
export { actionFor, inlineKeys, isRtl } from './keys.js';
|
|
32
|
+
export type { KeyMap, KeyOverrides } from './keys.js';
|
|
41
33
|
/** A document-unique id for ARIA relationships. */
|
|
42
34
|
export declare function uid(prefix: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Enter and Space press a button-like control (Space on release, as a native button does). */
|
|
2
|
+
export declare const activateKeys: {
|
|
3
|
+
activate: string[];
|
|
4
|
+
};
|
|
5
|
+
/** Space alone presses it, as on a native checkbox or radio. */
|
|
6
|
+
export declare const pressKeys: {
|
|
7
|
+
activate: string[];
|
|
8
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** A group whose items are chosen by moving among them (segmented control, radios, toggle group): both axes. */
|
|
2
|
+
export declare const choiceKeys: {
|
|
3
|
+
next: string[];
|
|
4
|
+
previous: string[];
|
|
5
|
+
};
|
|
6
|
+
/** A toggle group moves along its own axis only: the reading direction when horizontal. */
|
|
7
|
+
export declare const toggleGroupKeys: {
|
|
8
|
+
next: string[];
|
|
9
|
+
previous: string[];
|
|
10
|
+
};
|
|
11
|
+
/** What a vertical toggle group starts with. */
|
|
12
|
+
export declare const toggleGroupVerticalKeys: {
|
|
13
|
+
next: string[];
|
|
14
|
+
previous: string[];
|
|
15
|
+
};
|
|
16
|
+
/** A radio also checks on Space. */
|
|
17
|
+
export declare const radioKeys: {
|
|
18
|
+
activate: string[];
|
|
19
|
+
next: string[];
|
|
20
|
+
previous: string[];
|
|
21
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const numberInputKeys: {
|
|
2
|
+
increment: string[];
|
|
3
|
+
decrement: string[];
|
|
4
|
+
};
|
|
5
|
+
export declare const pinInputKeys: {
|
|
6
|
+
previous: string[];
|
|
7
|
+
next: string[];
|
|
8
|
+
deleteBackward: string[];
|
|
9
|
+
deleteForward: string[];
|
|
10
|
+
};
|
|
11
|
+
export declare const tagsInputKeys: {
|
|
12
|
+
add: string[];
|
|
13
|
+
removeLast: string[];
|
|
14
|
+
};
|
|
15
|
+
export declare const composeInputKeys: {
|
|
16
|
+
send: string[];
|
|
17
|
+
};
|
|
18
|
+
/** The preview of an editable (not yet editing). */
|
|
19
|
+
export declare const editablePreviewKeys: {
|
|
20
|
+
activate: string[];
|
|
21
|
+
};
|
|
22
|
+
/** The field of an editable (editing). */
|
|
23
|
+
export declare const editableFieldKeys: {
|
|
24
|
+
submit: string[];
|
|
25
|
+
cancel: string[];
|
|
26
|
+
};
|
|
27
|
+
export declare const editableKeys: {
|
|
28
|
+
submit: string[];
|
|
29
|
+
cancel: string[];
|
|
30
|
+
activate: string[];
|
|
31
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const menuKeys: {
|
|
2
|
+
next: string[];
|
|
3
|
+
previous: string[];
|
|
4
|
+
first: string[];
|
|
5
|
+
last: string[];
|
|
6
|
+
typeahead: string[];
|
|
7
|
+
close: string[];
|
|
8
|
+
};
|
|
9
|
+
/** On the trigger of a dropdown menu. */
|
|
10
|
+
export declare const dropdownTriggerKeys: {
|
|
11
|
+
open: string[];
|
|
12
|
+
openLast: string[];
|
|
13
|
+
activate: string[];
|
|
14
|
+
};
|
|
15
|
+
/** Inside a dropdown menu's panel. */
|
|
16
|
+
export declare const dropdownPanelKeys: {
|
|
17
|
+
leave: string[];
|
|
18
|
+
next: string[];
|
|
19
|
+
previous: string[];
|
|
20
|
+
first: string[];
|
|
21
|
+
last: string[];
|
|
22
|
+
typeahead: string[];
|
|
23
|
+
close: string[];
|
|
24
|
+
};
|
|
25
|
+
export declare const dropdownMenuKeys: {
|
|
26
|
+
leave: string[];
|
|
27
|
+
next: string[];
|
|
28
|
+
previous: string[];
|
|
29
|
+
first: string[];
|
|
30
|
+
last: string[];
|
|
31
|
+
typeahead: string[];
|
|
32
|
+
close: string[];
|
|
33
|
+
open: string[];
|
|
34
|
+
openLast: string[];
|
|
35
|
+
activate: string[];
|
|
36
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare const comboboxKeys: {
|
|
2
|
+
next: string[];
|
|
3
|
+
previous: string[];
|
|
4
|
+
open: string[];
|
|
5
|
+
activate: string[];
|
|
6
|
+
close: string[];
|
|
7
|
+
};
|
|
8
|
+
export declare const multiselectKeys: {
|
|
9
|
+
next: string[];
|
|
10
|
+
previous: string[];
|
|
11
|
+
first: string[];
|
|
12
|
+
last: string[];
|
|
13
|
+
nextPage: string[];
|
|
14
|
+
previousPage: string[];
|
|
15
|
+
activate: string[];
|
|
16
|
+
typeahead: string[];
|
|
17
|
+
close: string[];
|
|
18
|
+
};
|
|
19
|
+
export declare const calendarKeys: {
|
|
20
|
+
previousDay: string[];
|
|
21
|
+
nextDay: string[];
|
|
22
|
+
previousWeek: string[];
|
|
23
|
+
nextWeek: string[];
|
|
24
|
+
startOfWeek: string[];
|
|
25
|
+
endOfWeek: string[];
|
|
26
|
+
previousMonth: string[];
|
|
27
|
+
nextMonth: string[];
|
|
28
|
+
previousYear: string[];
|
|
29
|
+
nextYear: string[];
|
|
30
|
+
activate: string[];
|
|
31
|
+
};
|
|
32
|
+
export declare const datePickerKeys: {
|
|
33
|
+
activate: string[];
|
|
34
|
+
open: string[];
|
|
35
|
+
close: string[];
|
|
36
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selecting every row shown is a shortcut, so it has no default key (shortcuts are opt-in); an application enables
|
|
3
|
+
* it with `keys='{"selectAll":["Control+a","Meta+a"]}'`. The table's other keys are the keys of its controls
|
|
4
|
+
* (Space on a checkbox, Enter on a sort button, Shift + Space for a range) and are the browser's, not actions.
|
|
5
|
+
*/
|
|
6
|
+
export declare const tableKeys: {
|
|
7
|
+
selectAll: never[];
|
|
8
|
+
};
|
package/dist/keymaps.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { n as e, t } from "./chunks/activation-B8aBarKd.js";
|
|
2
|
+
import { n, r, t as i } from "./chunks/choice-BTrsi7OW.js";
|
|
3
|
+
import { i as a, n as o, r as s, t as c } from "./chunks/pickers-CjlFgNke.js";
|
|
4
|
+
import { t as l } from "./chunks/overlay-K1ilWC1p.js";
|
|
5
|
+
import { t as u } from "./chunks/tabs-Buf3EBWq.js";
|
|
6
|
+
import { t as d } from "./chunks/table-BBpqwWEi.js";
|
|
7
|
+
import { a as f, o as p, r as m, s as h, t as g } from "./chunks/fields-MEqz-olE.js";
|
|
8
|
+
import { t as _ } from "./chunks/carousel-C9u0bg5l.js";
|
|
9
|
+
import { i as v, t as y } from "./chunks/menu-CxRRgkJI.js";
|
|
10
|
+
import { t as b } from "./chunks/nav-menu-Bx284Dk6.js";
|
|
11
|
+
//#region src/keymaps/index.ts
|
|
12
|
+
var x = {
|
|
13
|
+
"void-accordion-item": t,
|
|
14
|
+
"void-button": t,
|
|
15
|
+
"void-calendar": c,
|
|
16
|
+
"void-carousel": _,
|
|
17
|
+
"void-carousel-next": t,
|
|
18
|
+
"void-carousel-previous": t,
|
|
19
|
+
"void-checkbox": e,
|
|
20
|
+
"void-collapsible": t,
|
|
21
|
+
"void-combobox": o,
|
|
22
|
+
"void-compose-input": g,
|
|
23
|
+
"void-date-picker": s,
|
|
24
|
+
"void-dialog": l,
|
|
25
|
+
"void-drawer": l,
|
|
26
|
+
"void-dropdown-menu": y,
|
|
27
|
+
"void-dropdown-menu-item": t,
|
|
28
|
+
"void-editable": m,
|
|
29
|
+
"void-file-upload": t,
|
|
30
|
+
"void-hamburger": t,
|
|
31
|
+
"void-hover-card": l,
|
|
32
|
+
"void-menu": v,
|
|
33
|
+
"void-menu-item": t,
|
|
34
|
+
"void-multiselect": a,
|
|
35
|
+
"void-nav-menu": b,
|
|
36
|
+
"void-number-input": f,
|
|
37
|
+
"void-pin-input": p,
|
|
38
|
+
"void-popover": l,
|
|
39
|
+
"void-radio": n,
|
|
40
|
+
"void-segmented-control": i,
|
|
41
|
+
"void-segmented-control-item": e,
|
|
42
|
+
"void-switch": t,
|
|
43
|
+
"void-table": d,
|
|
44
|
+
"void-tabs": u,
|
|
45
|
+
"void-tags-input": h,
|
|
46
|
+
"void-toggle": t,
|
|
47
|
+
"void-toggle-group": r,
|
|
48
|
+
"void-tooltip": l
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { x as keyMaps };
|
package/dist/keys.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Key actions (#90): every key a component handles is the default binding of a named action, and a handler asks
|
|
3
|
+
* `actionFor(el, event)` which action (if any) the event is.
|
|
4
|
+
*
|
|
5
|
+
* A binding is a key name as `KeyboardEvent.key` spells it, with modifiers in front: `"ArrowRight"`,
|
|
6
|
+
* `"Shift+Tab"`, `"Control+a"`, `"Meta+k"`. `"Space"` is the space bar. A single character matches either case
|
|
7
|
+
* unless `Shift` is named; Control, Alt and Meta must match exactly, and so must Shift for every other key.
|
|
8
|
+
* `"Printable"` stands for any character key (type-ahead). Two default-only names follow reading direction:
|
|
9
|
+
* `"ArrowInlineEnd"` is ArrowRight (ArrowLeft in right-to-left text) and `"ArrowInlineStart"` the opposite. A key an
|
|
10
|
+
* application writes is taken literally: it does not mirror.
|
|
11
|
+
*
|
|
12
|
+
* Overrides, most specific first: the element's `keys` property or attribute, `configureKeys(tag, …)`, then
|
|
13
|
+
* `configureKeys('*', …)`, then the component's default. An action bound to `[]` or `null` is off. The registry is
|
|
14
|
+
* kept on `globalThis` so that two copies of the library share it. Nothing here runs until a key is pressed.
|
|
15
|
+
*/
|
|
16
|
+
/** A component's actions: name -> default bindings. */
|
|
17
|
+
export type KeyMap = Readonly<Record<string, readonly string[]>>;
|
|
18
|
+
/** What an application may bind: an action name -> one binding, a list of them, or `null` (off). */
|
|
19
|
+
export type KeyOverrides = Record<string, string | readonly string[] | null>;
|
|
20
|
+
/** True when `el` renders right-to-left (`dir`, `lang`-derived direction or CSS `direction`). */
|
|
21
|
+
export declare function isRtl(el: Element): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The keys that move along the inline axis for `el`: `next` is ArrowRight in
|
|
24
|
+
* left-to-right and ArrowLeft in right-to-left; `prev` is the opposite.
|
|
25
|
+
*/
|
|
26
|
+
export declare function inlineKeys(el: Element): {
|
|
27
|
+
next: 'ArrowLeft' | 'ArrowRight';
|
|
28
|
+
prev: 'ArrowLeft' | 'ArrowRight';
|
|
29
|
+
};
|
|
30
|
+
/** The `keys` attribute: JSON. Anything else is no override (`voidable check` and `@voidable/ui/dev` report it). */
|
|
31
|
+
export declare const keysConverter: {
|
|
32
|
+
fromAttribute(value: string | null): KeyOverrides | null;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* The action of `map` (default: the `keyMap` of `el`'s class) that `e` is, or `undefined`. An event that is
|
|
36
|
+
* already `defaultPrevented`, or that is part of an IME composition, is no action: this is how a capture-phase
|
|
37
|
+
* `keydown` listener switches a key off. The best match wins (`Shift+Tab` over `Tab`).
|
|
38
|
+
*/
|
|
39
|
+
export declare function actionFor(el: HTMLElement, e: KeyboardEvent, map?: KeyMap): string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Binds actions for every `<tag>` on the page (`configureKeys('void-tabs', { next: ['ArrowRight', 'l'] })`), or
|
|
42
|
+
* for an action name in every component (`configureKeys('*', { close: ['Escape'] })`). A later call for the same
|
|
43
|
+
* tag replaces the earlier one; `null` clears it. An element's own `keys` wins over both; `[]` or `null` turns an
|
|
44
|
+
* action off. An action name the component does not have is a warning when `@voidable/ui/dev` is loaded.
|
|
45
|
+
*/
|
|
46
|
+
export declare function configureKeys(tag: string, overrides: KeyOverrides | null): void;
|
package/dist/keys.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//#region src/keys.ts
|
|
2
|
+
var e = Symbol.for("voidable.keys");
|
|
3
|
+
function t(e) {
|
|
4
|
+
try {
|
|
5
|
+
if (e.matches(":dir(rtl)")) return !0;
|
|
6
|
+
} catch {}
|
|
7
|
+
return getComputedStyle(e).direction === "rtl";
|
|
8
|
+
}
|
|
9
|
+
function n(e) {
|
|
10
|
+
return t(e) ? {
|
|
11
|
+
next: "ArrowLeft",
|
|
12
|
+
prev: "ArrowRight"
|
|
13
|
+
} : {
|
|
14
|
+
next: "ArrowRight",
|
|
15
|
+
prev: "ArrowLeft"
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
var r = { fromAttribute(e) {
|
|
19
|
+
try {
|
|
20
|
+
let t = e && JSON.parse(e);
|
|
21
|
+
return t && typeof t == "object" && !Array.isArray(t) ? t : null;
|
|
22
|
+
} catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
} };
|
|
26
|
+
function i(e, t, r) {
|
|
27
|
+
let i = e.length > 1 ? e.lastIndexOf("+", e.length - 2) : -1, a = e.slice(i + 1), o = i < 0 ? "" : e.slice(0, i), s = (...e) => e.some((e) => o.split("+").includes(e)), c = s("Control", "Ctrl"), l = s("Alt"), u = s("Meta"), d = s("Shift");
|
|
28
|
+
if (t.ctrlKey !== c || t.altKey !== l || t.metaKey !== u) return 0;
|
|
29
|
+
let f = +!!c + +!!l + +!!u + +!!d;
|
|
30
|
+
return a === "Printable" ? t.key.length === 1 && !d && !c && !l && !u ? .5 : 0 : (a === "Space" ? a = " " : a === "ArrowInlineEnd" ? a = n(r).next : a === "ArrowInlineStart" && (a = n(r).prev), a.length === 1 && t.key.length === 1 ? d && !t.shiftKey ? 0 : a.toLowerCase() === t.key.toLowerCase() ? 1 + f : 0 : t.shiftKey === d && a === t.key ? 1 + f : 0);
|
|
31
|
+
}
|
|
32
|
+
function a(t, n, a) {
|
|
33
|
+
if (a ??= t.constructor.keyMap, !a || n.defaultPrevented || n.isComposing) return;
|
|
34
|
+
let o = t.keys, s = typeof o == "string" ? r.fromAttribute(o) : o, c = globalThis[e], l = [
|
|
35
|
+
s,
|
|
36
|
+
c?.[t.localName],
|
|
37
|
+
c?.["*"]
|
|
38
|
+
], u, d = 0;
|
|
39
|
+
for (let e in a) {
|
|
40
|
+
let r = a[e];
|
|
41
|
+
for (let t of l) if (t && e in t) {
|
|
42
|
+
r = t[e];
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
for (let a of typeof r == "string" ? [r] : r ?? []) {
|
|
46
|
+
let r = i(a, n, t);
|
|
47
|
+
r > d && (d = r, u = e);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return u;
|
|
51
|
+
}
|
|
52
|
+
function o(t, n) {
|
|
53
|
+
let r = globalThis, i = r[e] ??= {};
|
|
54
|
+
n ? i[t] = n : delete i[t], n && t !== "*" && globalThis[Symbol.for("voidable.dev")]?.keys?.(t, n);
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { a as actionFor, o as configureKeys, n as inlineKeys, t as isRtl, r as keysConverter };
|
package/dist/llms.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Voidable UI (@voidable/ui 0.
|
|
1
|
+
# Voidable UI (@voidable/ui 0.12.1)
|
|
2
2
|
|
|
3
3
|
> Lit 3 web components in the light DOM, `<void-*>` tags with no visual CSS of their own: `@voidable/theme` supplies every look through `--void-*` custom properties. They work in plain HTML, React, Vue, Svelte, Solid, Angular, Rails/Hotwire, Phoenix LiveView and Laravel/Livewire.
|
|
4
4
|
|
|
@@ -37,6 +37,14 @@ Without the theme loaded the components are unstyled. Development warnings for m
|
|
|
37
37
|
- `@voidable/ui/llms.txt`: this file. The docs site serves the same in `/llms.txt` and `/llms-full.txt`: https://voidable.dev
|
|
38
38
|
- `voidable ref <tag>` prints one element offline; `voidable check <file>` checks markup (https://voidable.dev/getting-started/for-agents/).
|
|
39
39
|
|
|
40
|
+
## Testing
|
|
41
|
+
|
|
42
|
+
- Find components by role, accessible name and reflected attributes (`aria-checked`, `open`, `value`), never by class names; wait for `void-*` events, not for time.
|
|
43
|
+
- `@voidable/ui/testing` (a test build only; it adds nothing to any element): `import '@voidable/ui/testing'` in the page sets `data-void-ready` on `<html>` while every `void-*` element is defined and has rendered, so any tool can wait for `html[data-void-ready]` (Capybara `have_css`, Wallaby `assert_has`, Dusk `waitFor`, Cypress, Playwright). `whenReady()` does it from a script in the page.
|
|
44
|
+
- Playwright, with nothing loaded in the page: `import { animationsOff, gotoReady, voidReady } from '@voidable/ui/testing'`; `await animationsOff(page)` before `page.goto`, then `await gotoReady(page, url)`, and `await voidReady(page)` after a change that adds components.
|
|
45
|
+
- Animation off: `data-anim-speed="off"` on `<html>` (or Playwright `reducedMotion: 'reduce'`). Transitions, accordion and collapsible height changes and chart draw-in become immediate; timers do not (a toast still closes after its `duration`, tooltip and hover-card delays remain): wait for `void-close` and `void-open`.
|
|
46
|
+
- Recipes for Rails (Capybara), Phoenix (Wallaby, LiveViewTest) and Laravel (Dusk, Pest): https://voidable.dev/guides/testing/
|
|
47
|
+
|
|
40
48
|
## Elements (78)
|
|
41
49
|
|
|
42
50
|
- `<void-accordion>`: Collapsible section container for FAQs, settings panels, and long-form content organized into expandable items.
|
|
@@ -118,8 +126,8 @@ Without the theme loaded the components are unstyled. Development warnings for m
|
|
|
118
126
|
- `<void-toggle-group>`: Multi-button toggle set for text editor toolbars and filter chips where one or many options can be active.
|
|
119
127
|
- `<void-tooltip>`: Hover hint for icon buttons and truncated text that need a label without cluttering the visible interface.
|
|
120
128
|
|
|
121
|
-
## CSS-only parts and patterns (
|
|
129
|
+
## CSS-only parts and patterns (90)
|
|
122
130
|
|
|
123
131
|
Styled by `@voidable/theme`, registered by no JavaScript; write them as plain markup. Each is described in `reference.md`.
|
|
124
132
|
|
|
125
|
-
`<void-accordion-content>`, `<void-accordion-trigger>`, `<void-actions>`, `<void-alert-close>`, `<void-alert-description>`, `<void-alert-title>`, `<void-banner-actions>`, `<void-banner-close>`, `<void-banner-description>`, `<void-banner-title>`, `<void-brand>`, `<void-breadcrumbs-item>`, `<void-breadcrumbs-list>`, `<void-card-body>`, `<void-card-description>`, `<void-card-footer>`, `<void-card-header>`, `<void-card-title>`, `<void-carousel-content>`, `<void-carousel-indicators>`, `<void-carousel-item>`, `<void-collapsible-content>`, `<void-collapsible-trigger>`, `<void-combobox-content>`, `<void-delta>`, `<void-description-list>`, `<void-dialog-actions>`, `<void-dialog-body>`, `<void-dialog-description>`, `<void-dialog-title>`, `<void-drawer-actions>`, `<void-drawer-body>`, `<void-drawer-description>`, `<void-drawer-title>`, `<void-dropdown-menu-content>`, `<void-dropdown-menu-separator>`, `<void-dropdown-menu-trigger>`, `<void-empty>`, `<void-error-fallback-actions>`, `<void-error-fallback-description>`, `<void-error-fallback-title>`, `<void-figure>`, `<void-figures>`, `<void-glass>`, `<void-hover-card-content>`, `<void-hover-card-trigger>`, `<void-media>`, `<void-media-content>`, `<void-menu-content>`, `<void-menu-empty>`, `<void-menu-group-label>`, `<void-menu-item-icon>`, `<void-menu-item-shortcut>`, `<void-menu-search>`, `<void-multiselect-content>`, `<void-nav-links>`, `<void-nav-menu-content>`, `<void-nav-menu-trigger>`, `<void-page>`, `<void-page-head>`, `<void-panel-body>`, `<void-panel-description>`, `<void-panel-header>`, `<void-panel-title>`, `<void-popover-content>`, `<void-popover-trigger>`, `<void-row>`, `<void-row-text>`, `<void-rows>`, `<void-section>`, `<void-section-head>`, `<void-shell>`, `<void-spacer>`, `<void-split>`, `<void-stack>`, `<void-state>`, `<void-tabs-content>`, `<void-tabs-list>`, `<void-tabs-trigger>`, `<void-toast-actions>`, `<void-toast-close>`, `<void-toast-description>`, `<void-toast-title>`, `<void-toolbar>`, `<void-tooltip-content>`, `<void-tooltip-trigger>`
|
|
133
|
+
`<void-accordion-content>`, `<void-accordion-trigger>`, `<void-actions>`, `<void-alert-close>`, `<void-alert-description>`, `<void-alert-title>`, `<void-banner-actions>`, `<void-banner-close>`, `<void-banner-description>`, `<void-banner-title>`, `<void-brand>`, `<void-breadcrumbs-item>`, `<void-breadcrumbs-list>`, `<void-card-body>`, `<void-card-description>`, `<void-card-footer>`, `<void-card-header>`, `<void-card-title>`, `<void-carousel-content>`, `<void-carousel-indicators>`, `<void-carousel-item>`, `<void-collapsible-content>`, `<void-collapsible-trigger>`, `<void-combobox-content>`, `<void-delta>`, `<void-description-list>`, `<void-dialog-actions>`, `<void-dialog-body>`, `<void-dialog-description>`, `<void-dialog-title>`, `<void-drawer-actions>`, `<void-drawer-body>`, `<void-drawer-description>`, `<void-drawer-title>`, `<void-dropdown-menu-content>`, `<void-dropdown-menu-separator>`, `<void-dropdown-menu-trigger>`, `<void-empty>`, `<void-error-fallback-actions>`, `<void-error-fallback-description>`, `<void-error-fallback-title>`, `<void-figure>`, `<void-figures>`, `<void-glass>`, `<void-hover-card-content>`, `<void-hover-card-trigger>`, `<void-media>`, `<void-media-content>`, `<void-menu-content>`, `<void-menu-empty>`, `<void-menu-group-label>`, `<void-menu-item-icon>`, `<void-menu-item-shortcut>`, `<void-menu-search>`, `<void-multiselect-content>`, `<void-nav-links>`, `<void-nav-menu-content>`, `<void-nav-menu-trigger>`, `<void-page>`, `<void-page-head>`, `<void-panel-body>`, `<void-panel-description>`, `<void-panel-header>`, `<void-panel-title>`, `<void-popover-content>`, `<void-popover-trigger>`, `<void-row>`, `<void-row-text>`, `<void-rows>`, `<void-section>`, `<void-section-head>`, `<void-shell>`, `<void-spacer>`, `<void-split>`, `<void-stack>`, `<void-state>`, `<void-table-empty>`, `<void-table-filter>`, `<void-table-select-all>`, `<void-table-selection>`, `<void-tabs-content>`, `<void-tabs-list>`, `<void-tabs-trigger>`, `<void-toast-actions>`, `<void-toast-close>`, `<void-toast-description>`, `<void-toast-title>`, `<void-toolbar>`, `<void-tooltip-content>`, `<void-tooltip-trigger>`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|