@citrusworx/juiceui 0.9.2 → 0.9.4
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 +367 -224
- package/dist/components/accordion/accordion.d.ts +2 -1
- package/dist/index.css +1897 -127
- package/dist/index.d.ts +37 -25
- package/dist/index.js +3473 -2256
- package/dist/js/juice.d.ts +37 -25
- package/dist/js/src/accordion/accordion-runtime.d.ts +6 -0
- package/dist/js/src/avatar/avatar-runtime.d.ts +74 -0
- package/dist/js/src/banner/banner-runtime.d.ts +5 -0
- package/dist/js/src/breadcrumb/breadcrumb-runtime.d.ts +6 -0
- package/dist/js/src/checkbox/checkbox-runtime.d.ts +4 -0
- package/dist/js/src/combobox/combobox-runtime.d.ts +6 -0
- package/dist/js/src/disclosure/disclosure-runtime.d.ts +5 -0
- package/dist/js/src/drawer/drawer-runtime.d.ts +5 -0
- package/dist/js/src/field/field-runtime.d.ts +5 -0
- package/dist/js/src/icon-button/icon-button-runtime.d.ts +67 -0
- package/dist/js/src/input/input-runtime.d.ts +8 -0
- package/dist/js/src/menu/menu-runtime.d.ts +5 -0
- package/dist/js/src/modal/modal-runtime.d.ts +5 -0
- package/dist/js/src/nav/navigation.d.ts +5 -0
- package/dist/js/src/pagination/pagination-runtime.d.ts +6 -0
- package/dist/js/src/popover/popover-runtime.d.ts +5 -0
- package/dist/js/src/pressable/pressable-runtime.d.ts +106 -0
- package/dist/js/src/progress/progress-runtime.d.ts +5 -0
- package/dist/js/src/radio/radio-runtime.d.ts +7 -0
- package/dist/js/src/select/select-runtime.d.ts +9 -0
- package/dist/js/src/shared/change.d.ts +33 -0
- package/dist/js/src/slider/slider-runtime.d.ts +4 -0
- package/dist/js/src/spinner/spinner-runtime.d.ts +4 -0
- package/dist/js/src/switch/switch-runtime.d.ts +4 -0
- package/dist/js/src/table/table-runtime.d.ts +99 -0
- package/dist/js/src/tabs/tabs-runtime.d.ts +6 -0
- package/dist/js/src/textarea/textarea-runtime.d.ts +8 -0
- package/dist/js/src/toast/toast-runtime.d.ts +5 -0
- package/dist/js/src/tooltip/tooltip-runtime.d.ts +5 -0
- package/dist/js/src/touchable-row/touchable-row-runtime.d.ts +123 -0
- package/dist/js/src/wizard/wizard-runtime.d.ts +4 -0
- package/dist/themes/tide.css +7 -0
- package/package.json +2 -2
|
@@ -42,9 +42,18 @@ export type SelectOptions = {
|
|
|
42
42
|
root?: ParentNode;
|
|
43
43
|
selectSelector?: string;
|
|
44
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* Value changes stay on the native `input` and `change` events.
|
|
47
|
+
* This runtime does not dispatch `juice:change`.
|
|
48
|
+
* `value` is `HTMLSelectElement.value` (the first selected option).
|
|
49
|
+
*/
|
|
50
|
+
export type SelectState = {
|
|
51
|
+
value: string;
|
|
52
|
+
};
|
|
45
53
|
export type SelectController = {
|
|
46
54
|
destroy: () => void;
|
|
47
55
|
sync: () => void;
|
|
56
|
+
getState: (target?: HTMLElement | null) => SelectState | null;
|
|
48
57
|
};
|
|
49
58
|
export declare const createSelect: (options?: SelectOptions) => SelectController;
|
|
50
59
|
export declare const initSelect: (options?: SelectOptions) => SelectController;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Observable state for Juice runtimes.
|
|
3
|
+
*
|
|
4
|
+
* A runtime dispatches `juice:change` from the widget host when its
|
|
5
|
+
* observable state actually changes. The event bubbles. Detail is
|
|
6
|
+
* `{ runtime, state }`. The first observation of a host is recorded
|
|
7
|
+
* and does not dispatch, so init can normalize ARIA without looking
|
|
8
|
+
* like a change. Pass `baseline` when this note is the first look and
|
|
9
|
+
* it follows a real mutation.
|
|
10
|
+
*
|
|
11
|
+
* Select, input, and textarea do not use this event. Their value
|
|
12
|
+
* changes stay on the native `input` and `change` events.
|
|
13
|
+
*/
|
|
14
|
+
export declare const JUICE_CHANGE_EVENT = "juice:change";
|
|
15
|
+
export type JuiceChangeDetail<TState> = {
|
|
16
|
+
runtime: string;
|
|
17
|
+
state: TState;
|
|
18
|
+
};
|
|
19
|
+
export declare const juiceStatesEqual: (left: unknown, right: unknown) => boolean;
|
|
20
|
+
export declare const dispatchJuiceChange: <TState>(host: EventTarget, runtime: string, state: TState) => void;
|
|
21
|
+
export type JuiceChangeNoteOptions<TState> = {
|
|
22
|
+
/**
|
|
23
|
+
* State from before this mutation. Used only when the host has not
|
|
24
|
+
* been observed yet, so the first real change still dispatches.
|
|
25
|
+
*/
|
|
26
|
+
baseline?: TState;
|
|
27
|
+
};
|
|
28
|
+
export declare const createJuiceChanges: <TState>(runtime: string) => {
|
|
29
|
+
has: (host: EventTarget) => boolean;
|
|
30
|
+
prime: (host: EventTarget, state: TState) => void;
|
|
31
|
+
note: (host: EventTarget, state: TState, options?: JuiceChangeNoteOptions<TState>) => void;
|
|
32
|
+
adopt: (host: EventTarget, state: TState) => void;
|
|
33
|
+
};
|
|
@@ -41,6 +41,9 @@ export type SliderOptions = {
|
|
|
41
41
|
root?: ParentNode;
|
|
42
42
|
sliderSelector?: string;
|
|
43
43
|
};
|
|
44
|
+
export type SliderState = {
|
|
45
|
+
value: number;
|
|
46
|
+
};
|
|
44
47
|
export type SliderController = {
|
|
45
48
|
destroy: () => void;
|
|
46
49
|
sync: () => void;
|
|
@@ -48,6 +51,7 @@ export type SliderController = {
|
|
|
48
51
|
getValue: (target?: HTMLElement | null) => number;
|
|
49
52
|
increment: (target?: HTMLElement | null) => void;
|
|
50
53
|
decrement: (target?: HTMLElement | null) => void;
|
|
54
|
+
getState: (target?: HTMLElement | null) => SliderState | null;
|
|
51
55
|
};
|
|
52
56
|
export declare const createSlider: (options?: SliderOptions) => SliderController;
|
|
53
57
|
export declare const initSlider: (options?: SliderOptions) => SliderController;
|
|
@@ -38,12 +38,16 @@ export type SpinnerOptions = {
|
|
|
38
38
|
root?: ParentNode;
|
|
39
39
|
spinnerSelector?: string;
|
|
40
40
|
};
|
|
41
|
+
export type SpinnerState = {
|
|
42
|
+
shown: boolean;
|
|
43
|
+
};
|
|
41
44
|
export type SpinnerController = {
|
|
42
45
|
destroy: () => void;
|
|
43
46
|
sync: () => void;
|
|
44
47
|
show: (target?: HTMLElement | null) => void;
|
|
45
48
|
hide: (target?: HTMLElement | null) => void;
|
|
46
49
|
isShown: (target?: HTMLElement | null) => boolean;
|
|
50
|
+
getState: (target?: HTMLElement | null) => SpinnerState | null;
|
|
47
51
|
};
|
|
48
52
|
export declare const createSpinner: (options?: SpinnerOptions) => SpinnerController;
|
|
49
53
|
export declare const initSpinner: (options?: SpinnerOptions) => SpinnerController;
|
|
@@ -35,6 +35,9 @@ export type SwitchOptions = {
|
|
|
35
35
|
root?: ParentNode;
|
|
36
36
|
switchSelector?: string;
|
|
37
37
|
};
|
|
38
|
+
export type SwitchState = {
|
|
39
|
+
checked: boolean;
|
|
40
|
+
};
|
|
38
41
|
export type SwitchController = {
|
|
39
42
|
destroy: () => void;
|
|
40
43
|
sync: () => void;
|
|
@@ -43,6 +46,7 @@ export type SwitchController = {
|
|
|
43
46
|
uncheck: (target?: HTMLElement | null) => void;
|
|
44
47
|
setChecked: (checked: boolean, target?: HTMLElement | null) => void;
|
|
45
48
|
isChecked: (target?: HTMLElement | null) => boolean;
|
|
49
|
+
getState: (target?: HTMLElement | null) => SwitchState | null;
|
|
46
50
|
};
|
|
47
51
|
export declare const createSwitch: (options?: SwitchOptions) => SwitchController;
|
|
48
52
|
export declare const initSwitch: (options?: SwitchOptions) => SwitchController;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM-first sortable headers for Juice table chrome.
|
|
3
|
+
*
|
|
4
|
+
* Markup contract (Slice A — do not rename attrs):
|
|
5
|
+
* [table] host. A real <table>. <div table> is not a
|
|
6
|
+
* host. Sync does not rewrite [table].
|
|
7
|
+
* th[sortable] opt-in header inside that table. [sortable]
|
|
8
|
+
* was free (no other Juice attribute uses it),
|
|
9
|
+
* so the name did not need a [table-sortable]
|
|
10
|
+
* fallback. A sortable cell outside [table] is
|
|
11
|
+
* left alone.
|
|
12
|
+
* [numeric] on the th or on a cell in that column. The
|
|
13
|
+
* column compares as numbers. One numeric cell
|
|
14
|
+
* makes the whole column numeric, including
|
|
15
|
+
* every tbody. Slice A still owns tabular nums.
|
|
16
|
+
* [data-sort-value] on a body cell. Compared instead of the
|
|
17
|
+
* visible text. Parsed as a number when the
|
|
18
|
+
* column is numeric.
|
|
19
|
+
*
|
|
20
|
+
* The runtime wraps each sortable header's contents in
|
|
21
|
+
* <button type="button"> so the header is keyboard and screen-reader
|
|
22
|
+
* operable. Enter and Space stay with the browser: a native button
|
|
23
|
+
* turns them into a click, and a key handler here would sort twice.
|
|
24
|
+
* Wrapping is idempotent. destroy moves the original nodes back out
|
|
25
|
+
* and removes that button. An accessible name is the header text.
|
|
26
|
+
* This runtime does not invent one.
|
|
27
|
+
*
|
|
28
|
+
* Activation cycles that column ascending -> descending -> none.
|
|
29
|
+
* Single-column sort. The active th gets aria-sort="ascending" or
|
|
30
|
+
* "descending". Every other sortable th in the table gets
|
|
31
|
+
* aria-sort="none". An author aria-sort of ascending or descending is
|
|
32
|
+
* adopted as the initial state and is not a client reorder (server
|
|
33
|
+
* HTML can already be sorted). The next activation continues the cycle.
|
|
34
|
+
*
|
|
35
|
+
* Each tbody is reordered on its own. The original row order is the
|
|
36
|
+
* DOM order first observed while this runtime is not itself holding a
|
|
37
|
+
* client sort. Rows first seen during a client sort are appended to
|
|
38
|
+
* that memory. direction "none" puts the memory back. Sort is stable:
|
|
39
|
+
* equal keys keep original order.
|
|
40
|
+
*
|
|
41
|
+
* Comparison, in order:
|
|
42
|
+
* 1. data-sort-value when that attribute is present (trimmed).
|
|
43
|
+
* 2. Otherwise the cell's text, whitespace collapsed and trimmed.
|
|
44
|
+
* 3. Numeric columns use a finite decimal parse (commas removed).
|
|
45
|
+
* Values that do not parse sort after every number, in both
|
|
46
|
+
* directions, and tie with each other.
|
|
47
|
+
* 4. Text columns use Intl.Collator numeric: true, sensitivity:
|
|
48
|
+
* "base" (case-insensitive, natural numeric).
|
|
49
|
+
*
|
|
50
|
+
* Column identity is the header's cellIndex. Colspan and rowspan are
|
|
51
|
+
* not expanded into a visual grid. A body cell is the cell at that
|
|
52
|
+
* same cellIndex, or empty when the row has no cell there. A colspan
|
|
53
|
+
* on an earlier cell shifts later cellIndexes, so the sorted value can
|
|
54
|
+
* disagree with the painted column. Put one cell per column in each
|
|
55
|
+
* body row when the sort must follow the painted grid. Sortable
|
|
56
|
+
* headers belong in thead. A th[sortable] inside tbody is not special:
|
|
57
|
+
* its row is sorted with the other rows of that tbody.
|
|
58
|
+
*
|
|
59
|
+
* Before a reorder, the table dispatches a bubbling cancelable
|
|
60
|
+
* juice:sort CustomEvent. detail is { column, direction } where column
|
|
61
|
+
* is the activated header's cellIndex even when direction is "none".
|
|
62
|
+
* If defaultPrevented, aria-sort and state still update and rows stay
|
|
63
|
+
* put (server-side sort). sync() while that canceled sort is current
|
|
64
|
+
* refreshes the remembered order from the DOM and still does not
|
|
65
|
+
* reorder. The next activation that is not canceled sorts from the
|
|
66
|
+
* DOM order at that moment.
|
|
67
|
+
*
|
|
68
|
+
* State is { column: number | null, direction }. column is null when
|
|
69
|
+
* direction is "none", and is the header cellIndex otherwise. The
|
|
70
|
+
* first observation does not dispatch. Later changes dispatch a
|
|
71
|
+
* bubbling juice:change CustomEvent with detail
|
|
72
|
+
* { runtime: "table", state }. sync() re-reads headers and rows,
|
|
73
|
+
* wraps new sortable headers, and re-applies a client sort so rows
|
|
74
|
+
* added later join it.
|
|
75
|
+
*
|
|
76
|
+
* destroy restores original contents, restores row order when this
|
|
77
|
+
* runtime had reordered them, and puts author aria-sort back. Shared
|
|
78
|
+
* sort memory is cleared, so a second live controller re-reads the
|
|
79
|
+
* restored DOM on its next sync. No Sig Table factory.
|
|
80
|
+
*/
|
|
81
|
+
export type TableOptions = {
|
|
82
|
+
root?: ParentNode;
|
|
83
|
+
tableSelector?: string;
|
|
84
|
+
sortableSelector?: string;
|
|
85
|
+
};
|
|
86
|
+
export type TableSortDirection = 'ascending' | 'descending' | 'none';
|
|
87
|
+
export type TableState = {
|
|
88
|
+
column: number | null;
|
|
89
|
+
direction: TableSortDirection;
|
|
90
|
+
};
|
|
91
|
+
export type TableController = {
|
|
92
|
+
destroy: () => void;
|
|
93
|
+
sync: () => void;
|
|
94
|
+
getState: (target?: HTMLElement | null) => TableState | null;
|
|
95
|
+
};
|
|
96
|
+
export declare const createTable: (options?: TableOptions) => TableController;
|
|
97
|
+
export declare const initTable: (options?: TableOptions) => TableController;
|
|
98
|
+
export declare const startTableRuntime: () => TableController | null;
|
|
99
|
+
export declare const stopTableRuntime: () => void;
|
|
@@ -5,10 +5,16 @@ export type TabsOptions = {
|
|
|
5
5
|
triggerSelector?: string;
|
|
6
6
|
panelSelector?: string;
|
|
7
7
|
};
|
|
8
|
+
/** `selected` is the trigger index. `-1` when the tab list is empty. */
|
|
9
|
+
export type TabsState = {
|
|
10
|
+
selected: number;
|
|
11
|
+
};
|
|
8
12
|
export type TabsController = {
|
|
9
13
|
destroy: () => void;
|
|
10
14
|
sync: () => void;
|
|
11
15
|
select: (trigger?: HTMLElement | null) => void;
|
|
16
|
+
selected: (target?: HTMLElement | null) => HTMLElement | null;
|
|
17
|
+
getState: (target?: HTMLElement | null) => TabsState | null;
|
|
12
18
|
};
|
|
13
19
|
export declare const createTabs: (options?: TabsOptions) => TabsController;
|
|
14
20
|
export declare const initTabs: (options?: TabsOptions) => TabsController;
|
|
@@ -41,9 +41,17 @@ export type TextareaOptions = {
|
|
|
41
41
|
root?: ParentNode;
|
|
42
42
|
textareaSelector?: string;
|
|
43
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Value changes stay on the native `input` and `change` events.
|
|
46
|
+
* This runtime does not dispatch `juice:change`.
|
|
47
|
+
*/
|
|
48
|
+
export type TextareaState = {
|
|
49
|
+
value: string;
|
|
50
|
+
};
|
|
44
51
|
export type TextareaController = {
|
|
45
52
|
destroy: () => void;
|
|
46
53
|
sync: () => void;
|
|
54
|
+
getState: (target?: HTMLElement | null) => TextareaState | null;
|
|
47
55
|
};
|
|
48
56
|
export declare const createTextarea: (options?: TextareaOptions) => TextareaController;
|
|
49
57
|
export declare const initTextarea: (options?: TextareaOptions) => TextareaController;
|
|
@@ -41,11 +41,16 @@ export type ToastOptions = {
|
|
|
41
41
|
closeSelector?: string;
|
|
42
42
|
defaultDuration?: number;
|
|
43
43
|
};
|
|
44
|
+
export type ToastState = {
|
|
45
|
+
shown: boolean;
|
|
46
|
+
};
|
|
44
47
|
export type ToastController = {
|
|
45
48
|
destroy: () => void;
|
|
46
49
|
sync: () => void;
|
|
47
50
|
show: (target?: HTMLElement | null) => void;
|
|
48
51
|
dismiss: (target?: HTMLElement | null) => void;
|
|
52
|
+
isShown: (target?: HTMLElement | null) => boolean;
|
|
53
|
+
getState: (target?: HTMLElement | null) => ToastState | null;
|
|
49
54
|
};
|
|
50
55
|
export declare const createToast: (options?: ToastOptions) => ToastController;
|
|
51
56
|
export declare const initToast: (options?: ToastOptions) => ToastController;
|
|
@@ -48,11 +48,16 @@ export type TooltipOptions = {
|
|
|
48
48
|
gap?: number;
|
|
49
49
|
hideDelay?: number;
|
|
50
50
|
};
|
|
51
|
+
export type TooltipState = {
|
|
52
|
+
shown: boolean;
|
|
53
|
+
};
|
|
51
54
|
export type TooltipController = {
|
|
52
55
|
destroy: () => void;
|
|
53
56
|
sync: () => void;
|
|
54
57
|
show: (target?: HTMLElement | null) => void;
|
|
55
58
|
hide: (target?: HTMLElement | null) => void;
|
|
59
|
+
isShown: (target?: HTMLElement | null) => boolean;
|
|
60
|
+
getState: (target?: HTMLElement | null) => TooltipState | null;
|
|
56
61
|
};
|
|
57
62
|
export declare const createTooltip: (options?: TooltipOptions) => TooltipController;
|
|
58
63
|
export declare const initTooltip: (options?: TooltipOptions) => TooltipController;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM-first runtime for Juice touchable-row chrome.
|
|
3
|
+
*
|
|
4
|
+
* Markup contract (Slice A — do not rename attrs):
|
|
5
|
+
* [touchable-row] host. Any value is still a row. Words
|
|
6
|
+
* compose, same as the CSS: dense,
|
|
7
|
+
* chevron, undivided, plus the two words
|
|
8
|
+
* this runtime owns.
|
|
9
|
+
* [touchable-row~="select"] opt-in. Activation toggles selection.
|
|
10
|
+
* Absent, the row does not toggle.
|
|
11
|
+
* getState().selected still reports the
|
|
12
|
+
* CSS selected state.
|
|
13
|
+
* [touchable-row~="activate"] explicit opt-in for keyboard chrome
|
|
14
|
+
* when the row is not [pressable] and
|
|
15
|
+
* not selectable. See below.
|
|
16
|
+
* [selected] selected signal, with aria-selected
|
|
17
|
+
* or aria-current. CSS paints the start
|
|
18
|
+
* bar from any of the three.
|
|
19
|
+
* [pressable] press feedback stays on Pressable.
|
|
20
|
+
* This runtime does not set [pressed].
|
|
21
|
+
*
|
|
22
|
+
* Why those words, and not [touchable-row-select]: dense, chevron,
|
|
23
|
+
* and undivided already compose on the host attribute. Selection and
|
|
24
|
+
* the keyboard opt-in are host behavior, not slots.
|
|
25
|
+
* [touchable-row-leading], [touchable-row-content], [touchable-row-title],
|
|
26
|
+
* [touchable-row-subtitle], and [touchable-row-trailing] are the parts.
|
|
27
|
+
* A [touchable-row-select] attribute would read as another part.
|
|
28
|
+
*
|
|
29
|
+
* Keyboard activation:
|
|
30
|
+
* Enter or Space on a non-native host (not `a` or `button`) dispatches
|
|
31
|
+
* one bubbling click. Repeat keydowns do not. Enter is never
|
|
32
|
+
* preventDefault'd. Space is preventDefault'd only on those
|
|
33
|
+
* non-native hosts, so the page does not scroll (the same reason as
|
|
34
|
+
* the Pressable Space fix, applied to every li/div row rather than
|
|
35
|
+
* only to a button-like role). Native `a` and `button` already
|
|
36
|
+
* activate from the platform — Enter on a link, Enter and Space on
|
|
37
|
+
* a button — and this runtime does not dispatch a second click and
|
|
38
|
+
* does not preventDefault Space on them. An `<a>` without href is
|
|
39
|
+
* still native: give it an href, or use a div with select / activate
|
|
40
|
+
* / pressable. An editing host is left alone so Space can type.
|
|
41
|
+
* A [menuitem] host (the attribute, or a menuitem role) is left
|
|
42
|
+
* alone on the key. The menu runtime owns Enter and Space and clicks
|
|
43
|
+
* the item once. This runtime still sees that click.
|
|
44
|
+
*
|
|
45
|
+
* Keys and clicks that start in an interactive descendant do not
|
|
46
|
+
* activate the row, so a trailing control works on its own. The
|
|
47
|
+
* descendant is a button, a, input, textarea, select, summary,
|
|
48
|
+
* [switch], [icon-button], [menuitem], an editing host, or an
|
|
49
|
+
* element whose first role token is button, switch, checkbox, radio,
|
|
50
|
+
* link, menuitem, menuitemcheckbox, menuitemradio, option, tab,
|
|
51
|
+
* textbox, searchbox, combobox, slider, or spinbutton.
|
|
52
|
+
*
|
|
53
|
+
* Role and tabindex:
|
|
54
|
+
* A plain row is a layout shell. Sync does not give it a role or a
|
|
55
|
+
* tabindex, or it would enter the tab order just by being drawn.
|
|
56
|
+
* Chrome is added only when the row is interactive, the author has
|
|
57
|
+
* not set that attribute, the host is not native, and the host is
|
|
58
|
+
* not a menuitem:
|
|
59
|
+
* [pressable] the row is a press target
|
|
60
|
+
* [touchable-row~="select"] the row toggles selection
|
|
61
|
+
* [touchable-row~="activate"] explicit opt-in
|
|
62
|
+
* The added role is "button" and the added tabindex is "0". An
|
|
63
|
+
* author role or tabindex is kept, including role="link". Native
|
|
64
|
+
* links and buttons already have a platform role and tab stop.
|
|
65
|
+
* Menuitems keep the role the menu runtime writes. A disabled row
|
|
66
|
+
* is not given a tab stop it did not already have. Destroy does
|
|
67
|
+
* not remove a role or tabindex this runtime added.
|
|
68
|
+
*
|
|
69
|
+
* Selection:
|
|
70
|
+
* Independent toggles. There is no single-select group. List has
|
|
71
|
+
* no runtime, and its [selected] wash is author state. Tabs are a
|
|
72
|
+
* different widget (panels and a roving tabindex). Radio groups use
|
|
73
|
+
* the native name on inputs. This row has no container. Activating
|
|
74
|
+
* one selectable row does not clear its siblings.
|
|
75
|
+
* Activation is the click, including the click this runtime
|
|
76
|
+
* dispatches for a non-native host. The written signal is [selected]
|
|
77
|
+
* plus aria-selected on a host that is not a link, or aria-current
|
|
78
|
+
* on `a` and role="link". CSS treats aria-current other than "false"
|
|
79
|
+
* as selected, which is the link-shaped signal. Turning a row off
|
|
80
|
+
* clears [selected] and writes the chosen aria attribute to "false",
|
|
81
|
+
* and clears the other aria signal when that signal is still
|
|
82
|
+
* selected, so one toggle fully unselects the row. Rows without
|
|
83
|
+
* [touchable-row~="select"] do not toggle.
|
|
84
|
+
*
|
|
85
|
+
* Long-press:
|
|
86
|
+
* Not implemented here. A row with [pressable][pressable-longpress]
|
|
87
|
+
* uses Pressable's juice:longpress. Pressable suppresses the click
|
|
88
|
+
* that follows a long-press on the capture phase (preventDefault
|
|
89
|
+
* and stopPropagation) unless that event was canceled. Selection
|
|
90
|
+
* listens for click on the bubble phase, so the suppressed click
|
|
91
|
+
* never toggles. A later click does.
|
|
92
|
+
*
|
|
93
|
+
* Disabled:
|
|
94
|
+
* :disabled (the disabled property), [disabled], and
|
|
95
|
+
* [aria-disabled="true"] are ignored entirely. No click is
|
|
96
|
+
* synthesized, selection does not change, and the attempt does not
|
|
97
|
+
* dispatch juice:change.
|
|
98
|
+
*
|
|
99
|
+
* State is { selected, disabled }. selected is the CSS selected
|
|
100
|
+
* state, not the select word. The first observation is recorded and
|
|
101
|
+
* does not dispatch. Later changes dispatch a bubbling juice:change
|
|
102
|
+
* CustomEvent with detail { runtime: "touchable-row", state }.
|
|
103
|
+
*
|
|
104
|
+
* No Sig TouchableRow factory. Touchable-row is the thirtieth
|
|
105
|
+
* Emerging auto-enhance runtime.
|
|
106
|
+
*/
|
|
107
|
+
export type TouchableRowOptions = {
|
|
108
|
+
root?: ParentNode;
|
|
109
|
+
touchableRowSelector?: string;
|
|
110
|
+
};
|
|
111
|
+
export type TouchableRowState = {
|
|
112
|
+
selected: boolean;
|
|
113
|
+
disabled: boolean;
|
|
114
|
+
};
|
|
115
|
+
export type TouchableRowController = {
|
|
116
|
+
destroy: () => void;
|
|
117
|
+
sync: () => void;
|
|
118
|
+
getState: (target?: HTMLElement | null) => TouchableRowState | null;
|
|
119
|
+
};
|
|
120
|
+
export declare const createTouchableRow: (options?: TouchableRowOptions) => TouchableRowController;
|
|
121
|
+
export declare const initTouchableRow: (options?: TouchableRowOptions) => TouchableRowController;
|
|
122
|
+
export declare const startTouchableRowRuntime: () => TouchableRowController | null;
|
|
123
|
+
export declare const stopTouchableRowRuntime: () => void;
|
|
@@ -40,6 +40,9 @@ export type WizardOptions = {
|
|
|
40
40
|
prevSelector?: string;
|
|
41
41
|
completeSelector?: string;
|
|
42
42
|
};
|
|
43
|
+
export type WizardState = {
|
|
44
|
+
current: number;
|
|
45
|
+
};
|
|
43
46
|
export type WizardController = {
|
|
44
47
|
destroy: () => void;
|
|
45
48
|
sync: () => void;
|
|
@@ -47,6 +50,7 @@ export type WizardController = {
|
|
|
47
50
|
prev: (target?: HTMLElement | null) => void;
|
|
48
51
|
goTo: (step: number | string, target?: HTMLElement | null) => void;
|
|
49
52
|
current: (target?: HTMLElement | null) => number;
|
|
53
|
+
getState: (target?: HTMLElement | null) => WizardState | null;
|
|
50
54
|
};
|
|
51
55
|
export declare const createWizard: (options?: WizardOptions) => WizardController;
|
|
52
56
|
export declare const initWizard: (options?: WizardOptions) => WizardController;
|
package/dist/themes/tide.css
CHANGED
|
@@ -217,6 +217,13 @@
|
|
|
217
217
|
--juice-banner-info-soft: var(--tide-banner-info-soft);
|
|
218
218
|
--juice-banner-warning: var(--tide-banner-warning);
|
|
219
219
|
--juice-banner-warning-soft: var(--tide-banner-warning-soft);
|
|
220
|
+
/* Avatar away dot. Core maps away to banner warning, which on Tide is
|
|
221
|
+
lagoon-800. That step sits on the muted surface (the same hue at low
|
|
222
|
+
alpha) and the dot disappears (about 1.6:1). Lift the warning hue
|
|
223
|
+
toward the text color so the dot stays in-family and readable.
|
|
224
|
+
Online, busy, and offline already clear the surface. No other
|
|
225
|
+
--juice-avatar-* override. */
|
|
226
|
+
--juice-avatar-status-away: color-mix(in srgb, var(--tide-banner-warning) 45%, var(--tide-text));
|
|
220
227
|
/* Popover chrome — dark panel, not white glass. Close is a surface
|
|
221
228
|
control, not the CTA gradient. Distinct from modal/drawer/toast. */
|
|
222
229
|
--tide-popover-panel: var(--tide-surface-strong);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citrusworx/juiceui",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
"access": "public"
|
|
175
175
|
},
|
|
176
176
|
"dependencies": {
|
|
177
|
-
"@citrusworx/sigjs": "^0.
|
|
177
|
+
"@citrusworx/sigjs": "^1.0.0"
|
|
178
178
|
},
|
|
179
179
|
"devDependencies": {
|
|
180
180
|
"@testing-library/jest-dom": "^6.9.1",
|