@citrusworx/juiceui 0.8.0 → 0.9.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/README.md +47 -3
- package/dist/index.css +2361 -76
- package/dist/index.d.ts +12 -0
- package/dist/index.js +986 -196
- package/dist/js/juice.d.ts +12 -0
- package/dist/js/src/breadcrumb/breadcrumb-runtime.d.ts +64 -0
- package/dist/js/src/checkbox/checkbox-runtime.d.ts +51 -0
- package/dist/js/src/progress/progress-runtime.d.ts +51 -0
- package/dist/js/src/radio/radio-runtime.d.ts +52 -0
- package/dist/js/src/slider/slider-runtime.d.ts +55 -0
- package/dist/js/src/switch/switch-runtime.d.ts +50 -0
- package/dist/themes/aquaflux.css +298 -0
- package/dist/themes/citrusmint.css +260 -0
- package/dist/themes/kiwipress.css +313 -0
- package/dist/themes/tide.css +301 -0
- package/package.json +1 -1
package/dist/js/juice.d.ts
CHANGED
|
@@ -22,3 +22,15 @@ export { createBanner, initBanner, startBannerRuntime, stopBannerRuntime } from
|
|
|
22
22
|
export type { BannerController, BannerOptions } from "./src/banner/banner-runtime.js";
|
|
23
23
|
export { createMenu, initMenu, startMenuRuntime, stopMenuRuntime } from "./src/menu/menu-runtime.js";
|
|
24
24
|
export type { MenuController, MenuOptions } from "./src/menu/menu-runtime.js";
|
|
25
|
+
export { createSwitch, initSwitch, startSwitchRuntime, stopSwitchRuntime } from "./src/switch/switch-runtime.js";
|
|
26
|
+
export type { SwitchController, SwitchOptions } from "./src/switch/switch-runtime.js";
|
|
27
|
+
export { createSlider, initSlider, startSliderRuntime, stopSliderRuntime } from "./src/slider/slider-runtime.js";
|
|
28
|
+
export type { SliderController, SliderOptions } from "./src/slider/slider-runtime.js";
|
|
29
|
+
export { createCheckbox, initCheckbox, startCheckboxRuntime, stopCheckboxRuntime } from "./src/checkbox/checkbox-runtime.js";
|
|
30
|
+
export type { CheckboxController, CheckboxOptions } from "./src/checkbox/checkbox-runtime.js";
|
|
31
|
+
export { createRadio, initRadio, startRadioRuntime, stopRadioRuntime } from "./src/radio/radio-runtime.js";
|
|
32
|
+
export type { RadioController, RadioOptions } from "./src/radio/radio-runtime.js";
|
|
33
|
+
export { createBreadcrumb, initBreadcrumb, startBreadcrumbRuntime, stopBreadcrumbRuntime } from "./src/breadcrumb/breadcrumb-runtime.js";
|
|
34
|
+
export type { BreadcrumbController, BreadcrumbOptions } from "./src/breadcrumb/breadcrumb-runtime.js";
|
|
35
|
+
export { createProgress, initProgress, startProgressRuntime, stopProgressRuntime } from "./src/progress/progress-runtime.js";
|
|
36
|
+
export type { ProgressController, ProgressOptions } from "./src/progress/progress-runtime.js";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Light DOM-first breadcrumb runtime for Juice breadcrumb chrome.
|
|
3
|
+
*
|
|
4
|
+
* Markup contract (Slice A — do not rename attrs):
|
|
5
|
+
* [breadcrumb] trail root. Authors use <nav breadcrumb> or
|
|
6
|
+
* <ol breadcrumb>.
|
|
7
|
+
* [breadcrumb-item] one crumb. Separator is CSS on every item
|
|
8
|
+
* except the last.
|
|
9
|
+
* [breadcrumb-link] optional. Anchors inside the trail are enough.
|
|
10
|
+
* [breadcrumb-separator]
|
|
11
|
+
* optional explicit separator. Authors own it.
|
|
12
|
+
*
|
|
13
|
+
* This is chrome, not a router. v1 does not listen to history, clicks,
|
|
14
|
+
* or the keyboard. It claims no events (no createEventClaim). There is
|
|
15
|
+
* no Escape handler, no focus trap, and no overlay.
|
|
16
|
+
*
|
|
17
|
+
* Sync (markup-driven):
|
|
18
|
+
* 1. Make the root a navigation landmark only when that is safe.
|
|
19
|
+
* - <nav> is already a landmark. Do not add a redundant
|
|
20
|
+
* role="navigation".
|
|
21
|
+
* - An element with no role that is not a list (ol / ul / menu)
|
|
22
|
+
* gets role="navigation". role="navigation" on a list would
|
|
23
|
+
* drop the list semantics, so <ol breadcrumb> is left alone.
|
|
24
|
+
* - An author role is never overwritten.
|
|
25
|
+
* - Ancestor <nav> elements are not relabeled. A parent nav may
|
|
26
|
+
* be a larger landmark than this trail.
|
|
27
|
+
* 2. Name that landmark only when it has no accessible name.
|
|
28
|
+
* APG's breadcrumb pattern puts the trail in a navigation
|
|
29
|
+
* landmark labeled "Breadcrumb" (aria-label or aria-labelledby).
|
|
30
|
+
* When the root is a navigation landmark and aria-label,
|
|
31
|
+
* aria-labelledby, and title are all missing or blank, sync sets
|
|
32
|
+
* aria-label="Breadcrumb". A non-empty author name is kept.
|
|
33
|
+
* Lists and other non-navigation roots are not given that label.
|
|
34
|
+
* 3. Keep a single aria-current="page" inside the trail.
|
|
35
|
+
* Crumbs are owned [breadcrumb-item] elements. When a trail has
|
|
36
|
+
* none, direct-child anchors and [breadcrumb-link] elements are
|
|
37
|
+
* the crumbs (the same flat markup the chrome styles).
|
|
38
|
+
* If the author already set aria-current="page", the first one
|
|
39
|
+
* in tree order stays and any others in this trail are removed.
|
|
40
|
+
* If none is set and the trail has crumbs, the last crumb is
|
|
41
|
+
* marked. A crumb that contains a link is marked on that link
|
|
42
|
+
* (the last owned anchor or [breadcrumb-link]); otherwise the
|
|
43
|
+
* crumb element itself is marked.
|
|
44
|
+
* 4. Do not rewrite the current crumb's href, click behavior, or
|
|
45
|
+
* disabled state. Authors own whether the current page is a link.
|
|
46
|
+
*
|
|
47
|
+
* setCurrent(item | index, trail?) moves that single current. An index
|
|
48
|
+
* applies to the given trail, or the first trail when trail is omitted.
|
|
49
|
+
* It is not a navigation.
|
|
50
|
+
*/
|
|
51
|
+
export type BreadcrumbOptions = {
|
|
52
|
+
root?: ParentNode;
|
|
53
|
+
breadcrumbSelector?: string;
|
|
54
|
+
itemSelector?: string;
|
|
55
|
+
};
|
|
56
|
+
export type BreadcrumbController = {
|
|
57
|
+
destroy: () => void;
|
|
58
|
+
sync: () => void;
|
|
59
|
+
setCurrent: (itemOrIndex: HTMLElement | number, trail?: HTMLElement | null) => void;
|
|
60
|
+
};
|
|
61
|
+
export declare const createBreadcrumb: (options?: BreadcrumbOptions) => BreadcrumbController;
|
|
62
|
+
export declare const initBreadcrumb: (options?: BreadcrumbOptions) => BreadcrumbController;
|
|
63
|
+
export declare const startBreadcrumbRuntime: () => BreadcrumbController | null;
|
|
64
|
+
export declare const stopBreadcrumbRuntime: () => void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM-first APG Checkbox runtime for Juice checkbox chrome.
|
|
3
|
+
*
|
|
4
|
+
* Markup contract (Slice A — do not rename attrs):
|
|
5
|
+
* [checkbox] on the control host. Primary host is
|
|
6
|
+
* <button type="button" checkbox>. Visible labels live beside the
|
|
7
|
+
* control (wrapping <label>, aria-label, or aria-labelledby) — the
|
|
8
|
+
* host *is* the box. The checkmark is a CSS pseudo-element; there
|
|
9
|
+
* is no [checkbox-box] child.
|
|
10
|
+
*
|
|
11
|
+
* Hosts this runtime enhances:
|
|
12
|
+
* - HTMLButtonElement (primary). Sync fills role="checkbox",
|
|
13
|
+
* aria-checked "true"|"false", and type="button" when type is
|
|
14
|
+
* missing (so a form does not submit).
|
|
15
|
+
* - HTMLInputElement type="checkbox" (secondary). Chrome already
|
|
16
|
+
* paints :checked. Sync fills role="checkbox" and keeps
|
|
17
|
+
* aria-checked in lockstep with the native checked property
|
|
18
|
+
* (change events, and a static aria-checked="true" on an
|
|
19
|
+
* unchecked box is promoted onto .checked so :checked paint
|
|
20
|
+
* matches). This is not a form-checkbox restyle as the only
|
|
21
|
+
* story, and it is not menuitemcheckbox or [switch].
|
|
22
|
+
*
|
|
23
|
+
* Other [checkbox] hosts (div, span, text inputs, radios) are ignored.
|
|
24
|
+
* Do not invent accessible names — authors must supply aria-label,
|
|
25
|
+
* aria-labelledby, or visible text.
|
|
26
|
+
*
|
|
27
|
+
* v1 is binary. aria-checked="mixed" and any other value coerce to
|
|
28
|
+
* "false". There is no tri-state, no focus trap, and no Escape
|
|
29
|
+
* handling (not a layered overlay).
|
|
30
|
+
*
|
|
31
|
+
* Click and Enter/Space toggle. Native disabled or aria-disabled="true"
|
|
32
|
+
* is ignored. Button click preventDefault stops accidental submit when
|
|
33
|
+
* type is still the default.
|
|
34
|
+
*/
|
|
35
|
+
export type CheckboxOptions = {
|
|
36
|
+
root?: ParentNode;
|
|
37
|
+
checkboxSelector?: string;
|
|
38
|
+
};
|
|
39
|
+
export type CheckboxController = {
|
|
40
|
+
destroy: () => void;
|
|
41
|
+
sync: () => void;
|
|
42
|
+
toggle: (target?: HTMLElement | null) => void;
|
|
43
|
+
check: (target?: HTMLElement | null) => void;
|
|
44
|
+
uncheck: (target?: HTMLElement | null) => void;
|
|
45
|
+
setChecked: (checked: boolean, target?: HTMLElement | null) => void;
|
|
46
|
+
isChecked: (target?: HTMLElement | null) => boolean;
|
|
47
|
+
};
|
|
48
|
+
export declare const createCheckbox: (options?: CheckboxOptions) => CheckboxController;
|
|
49
|
+
export declare const initCheckbox: (options?: CheckboxOptions) => CheckboxController;
|
|
50
|
+
export declare const startCheckboxRuntime: () => CheckboxController | null;
|
|
51
|
+
export declare const stopCheckboxRuntime: () => void;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM-first APG Progressbar runtime for Juice progress chrome.
|
|
3
|
+
*
|
|
4
|
+
* Markup contract (Slice A — do not rename attrs):
|
|
5
|
+
* [progress] track host. Boolean (determinate) or
|
|
6
|
+
* progress="indeterminate". Any other value is
|
|
7
|
+
* determinate chrome; sync does not rewrite it.
|
|
8
|
+
* Authors write <div progress>, not <progress>.
|
|
9
|
+
* A native <progress> without the attribute is
|
|
10
|
+
* ignored. Native value / max are not the value hook.
|
|
11
|
+
* [progress-fill] filled portion. Optional for the runtime.
|
|
12
|
+
* [progress-label] optional visible value / status text. Authors own
|
|
13
|
+
* the accessible name. The label is not copied into
|
|
14
|
+
* aria-label, aria-labelledby, or aria-valuetext.
|
|
15
|
+
*
|
|
16
|
+
* Sync (markup-driven):
|
|
17
|
+
* 1. role="progressbar" on the host. An author role that is not
|
|
18
|
+
* progressbar is replaced. The host is not made focusable
|
|
19
|
+
* (no tabindex). There is no keyboard and no pointer handler.
|
|
20
|
+
* 2. Determinate: aria-valuemin (default 0), aria-valuemax (default
|
|
21
|
+
* 100), and aria-valuenow. A missing or non-numeric valuenow is
|
|
22
|
+
* min, which is an empty bar (ratio 0), not indeterminate.
|
|
23
|
+
* Values clamp to min/max. A max below min collapses to min.
|
|
24
|
+
* 3. The host inline custom property --juice-progress-ratio
|
|
25
|
+
* (unitless 0–1) stays in sync for every range, including ranges
|
|
26
|
+
* the 0–100 chrome selectors do not cover.
|
|
27
|
+
* 4. Indeterminate is progress="indeterminate" only. That flag wins.
|
|
28
|
+
* APG omits aria-valuenow while indeterminate; min/max stay.
|
|
29
|
+
* The last determinate value is remembered and restored when the
|
|
30
|
+
* flag clears. CSS owns the sliding fill.
|
|
31
|
+
* 5. aria-valuetext is never invented and never rewritten.
|
|
32
|
+
*
|
|
33
|
+
* Not a slider, not a spinner, and not a layered overlay: no focus
|
|
34
|
+
* trap, no Escape, no Sig Progress factory.
|
|
35
|
+
*/
|
|
36
|
+
export type ProgressOptions = {
|
|
37
|
+
root?: ParentNode;
|
|
38
|
+
progressSelector?: string;
|
|
39
|
+
};
|
|
40
|
+
export type ProgressController = {
|
|
41
|
+
destroy: () => void;
|
|
42
|
+
sync: () => void;
|
|
43
|
+
setValue: (value: number, target?: HTMLElement | null) => void;
|
|
44
|
+
getValue: (target?: HTMLElement | null) => number;
|
|
45
|
+
setIndeterminate: (indeterminate: boolean, target?: HTMLElement | null) => void;
|
|
46
|
+
isIndeterminate: (target?: HTMLElement | null) => boolean;
|
|
47
|
+
};
|
|
48
|
+
export declare const createProgress: (options?: ProgressOptions) => ProgressController;
|
|
49
|
+
export declare const initProgress: (options?: ProgressOptions) => ProgressController;
|
|
50
|
+
export declare const startProgressRuntime: () => ProgressController | null;
|
|
51
|
+
export declare const stopProgressRuntime: () => void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM-first APG Radio Group runtime for Juice radio chrome.
|
|
3
|
+
*
|
|
4
|
+
* Markup contract (Slice A — do not rename attrs):
|
|
5
|
+
* [radiogroup] is the group root (layout only — no group chrome).
|
|
6
|
+
* [radio] is one option. Primary host is
|
|
7
|
+
* <button type="button" radio> inside the group. Visible labels live
|
|
8
|
+
* beside the control (wrapping <label>, aria-label, or
|
|
9
|
+
* aria-labelledby) — the host *is* the disc. The dot is a CSS
|
|
10
|
+
* pseudo-element; there is no [radio-dot] child.
|
|
11
|
+
*
|
|
12
|
+
* Hosts this runtime enhances:
|
|
13
|
+
* - [radiogroup] roots. Sync fills role="radiogroup". Authors supply
|
|
14
|
+
* the group's accessible name. Radios outside a [radiogroup] are
|
|
15
|
+
* ignored (no solo exclusive group).
|
|
16
|
+
* - HTMLButtonElement [radio] descendants (primary). Sync fills
|
|
17
|
+
* role="radio", aria-checked "true"|"false", type="button" when
|
|
18
|
+
* type is missing, and a roving tabindex (one tab stop per group).
|
|
19
|
+
* - HTMLInputElement type="radio" (secondary). Chrome already paints
|
|
20
|
+
* :checked. Sync keeps aria-checked in lockstep with the native
|
|
21
|
+
* checked property. Exclusivity is the [radiogroup], not only the
|
|
22
|
+
* input name.
|
|
23
|
+
*
|
|
24
|
+
* Other [radio] hosts (div, span, text inputs, checkboxes) are ignored.
|
|
25
|
+
* A radio belongs to its nearest [radiogroup]. Do not invent accessible
|
|
26
|
+
* names.
|
|
27
|
+
*
|
|
28
|
+
* v1 is exclusive and binary. aria-checked="mixed" coerces to "false".
|
|
29
|
+
* When more than one radio is checked, sync keeps the first in document
|
|
30
|
+
* order. Zero checked is allowed until something is selected. There is
|
|
31
|
+
* no focus trap and no Escape handling (not a layered overlay).
|
|
32
|
+
*
|
|
33
|
+
* Click, Enter, and Space select the targeted radio. Arrow keys move
|
|
34
|
+
* the selection among enabled radios in the group and wrap, skipping
|
|
35
|
+
* disabled / aria-disabled radios. Native disabled or aria-disabled="true"
|
|
36
|
+
* is ignored.
|
|
37
|
+
*/
|
|
38
|
+
export type RadioOptions = {
|
|
39
|
+
root?: ParentNode;
|
|
40
|
+
radiogroupSelector?: string;
|
|
41
|
+
radioSelector?: string;
|
|
42
|
+
};
|
|
43
|
+
export type RadioController = {
|
|
44
|
+
destroy: () => void;
|
|
45
|
+
sync: () => void;
|
|
46
|
+
select: (radio?: HTMLElement | null) => void;
|
|
47
|
+
getChecked: (group?: HTMLElement | null) => HTMLElement | null;
|
|
48
|
+
};
|
|
49
|
+
export declare const createRadio: (options?: RadioOptions) => RadioController;
|
|
50
|
+
export declare const initRadio: (options?: RadioOptions) => RadioController;
|
|
51
|
+
export declare const startRadioRuntime: () => RadioController | null;
|
|
52
|
+
export declare const stopRadioRuntime: () => void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM-first APG Slider runtime for Juice slider chrome.
|
|
3
|
+
*
|
|
4
|
+
* Markup contract (Slice A — do not rename attrs):
|
|
5
|
+
* [slider] track host. Boolean or "horizontal".
|
|
6
|
+
* [slider="vertical"] is not painted and is not enhanced.
|
|
7
|
+
* [slider-fill] completed portion. Optional.
|
|
8
|
+
* [slider-thumb] real thumb. Required. Orphan thumbs are ignored.
|
|
9
|
+
* The first thumb whose nearest [slider] is the host
|
|
10
|
+
* is the control. Extra thumbs are not a multi-thumb
|
|
11
|
+
* slider in v1.
|
|
12
|
+
*
|
|
13
|
+
* Focus model: the thumb is the APG slider. Sync sets role="slider",
|
|
14
|
+
* tabindex="0" when the thumb is not natively focusable, type="button"
|
|
15
|
+
* when a button thumb omitted type, aria-valuemin (default 0),
|
|
16
|
+
* aria-valuemax (default 100), aria-valuenow, and
|
|
17
|
+
* aria-orientation="horizontal" on the thumb. The host stays the track.
|
|
18
|
+
* An author role="slider" on the host is removed so assistive tech sees
|
|
19
|
+
* one slider. Thumb aria-valuemin / aria-valuemax / aria-valuenow win
|
|
20
|
+
* over the same attributes on the host. A missing valuenow defaults to
|
|
21
|
+
* min. aria-valuetext is never invented and is never rewritten. Authors
|
|
22
|
+
* supply the accessible name.
|
|
23
|
+
*
|
|
24
|
+
* Paint: the host inline custom property --juice-slider-ratio (unitless
|
|
25
|
+
* 0–1) stays in sync for every range. Integer aria-valuenow 0–100 on the
|
|
26
|
+
* thumb also matches the chrome attribute selectors.
|
|
27
|
+
*
|
|
28
|
+
* Keyboard (thumb only): ArrowLeft / ArrowDown decrease, ArrowRight /
|
|
29
|
+
* ArrowUp increase, Home / End jump to min / max, PageUp / PageDown move
|
|
30
|
+
* by a larger step. Step is 1. Page step is 10. Values clamp to min/max.
|
|
31
|
+
* Pointer: primary pointerdown on the track, fill, or thumb jumps to that
|
|
32
|
+
* position and starts a drag; pointermove follows until pointerup or
|
|
33
|
+
* pointercancel. The thumb captures the pointer when the platform allows
|
|
34
|
+
* it. Disabled or aria-disabled="true" on the host or thumb is ignored.
|
|
35
|
+
*
|
|
36
|
+
* v1 is horizontal Juice markup only. There is no vertical orientation,
|
|
37
|
+
* no multi-thumb, no native <input type="range"> restyle, and no Escape
|
|
38
|
+
* handling (not a layered overlay).
|
|
39
|
+
*/
|
|
40
|
+
export type SliderOptions = {
|
|
41
|
+
root?: ParentNode;
|
|
42
|
+
sliderSelector?: string;
|
|
43
|
+
};
|
|
44
|
+
export type SliderController = {
|
|
45
|
+
destroy: () => void;
|
|
46
|
+
sync: () => void;
|
|
47
|
+
setValue: (value: number, target?: HTMLElement | null) => void;
|
|
48
|
+
getValue: (target?: HTMLElement | null) => number;
|
|
49
|
+
increment: (target?: HTMLElement | null) => void;
|
|
50
|
+
decrement: (target?: HTMLElement | null) => void;
|
|
51
|
+
};
|
|
52
|
+
export declare const createSlider: (options?: SliderOptions) => SliderController;
|
|
53
|
+
export declare const initSlider: (options?: SliderOptions) => SliderController;
|
|
54
|
+
export declare const startSliderRuntime: () => SliderController | null;
|
|
55
|
+
export declare const stopSliderRuntime: () => void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM-first APG Switch runtime for Juice switch chrome.
|
|
3
|
+
*
|
|
4
|
+
* Markup contract (Slice A — do not rename attrs):
|
|
5
|
+
* [switch] on the control host. Primary host is
|
|
6
|
+
* <button type="button" switch>. Visible labels live beside the
|
|
7
|
+
* control (wrapping <label>, aria-label, or aria-labelledby) — the
|
|
8
|
+
* host *is* the track. Track / thumb are CSS pseudo-elements; there
|
|
9
|
+
* are no [switch-track] / [switch-thumb] children.
|
|
10
|
+
*
|
|
11
|
+
* Hosts this runtime enhances:
|
|
12
|
+
* - HTMLButtonElement (primary). Sync fills role="switch",
|
|
13
|
+
* aria-checked "true"|"false", and type="button" when type is
|
|
14
|
+
* missing (so a form does not submit).
|
|
15
|
+
* - HTMLInputElement type="checkbox" (secondary). Chrome already
|
|
16
|
+
* paints :checked. Sync fills role="switch" and keeps aria-checked
|
|
17
|
+
* in lockstep with the native checked property (change events, and
|
|
18
|
+
* a static aria-checked="true" on an unchecked box is promoted onto
|
|
19
|
+
* .checked so :checked paint matches). This is not a form-checkbox
|
|
20
|
+
* restyle as the only story, and it is not menuitemcheckbox.
|
|
21
|
+
*
|
|
22
|
+
* Other [switch] hosts (div, span, text inputs, radios) are ignored.
|
|
23
|
+
* Do not invent accessible names — authors must supply aria-label,
|
|
24
|
+
* aria-labelledby, or visible text.
|
|
25
|
+
*
|
|
26
|
+
* v1 is binary. aria-checked="mixed" and any other value coerce to
|
|
27
|
+
* "false". There is no switch="on", no tri-state, no focus trap, and
|
|
28
|
+
* no Escape handling (not a layered overlay).
|
|
29
|
+
*
|
|
30
|
+
* Click and Enter/Space toggle. Native disabled or aria-disabled="true"
|
|
31
|
+
* is ignored. Button click preventDefault stops accidental submit when
|
|
32
|
+
* type is still the default.
|
|
33
|
+
*/
|
|
34
|
+
export type SwitchOptions = {
|
|
35
|
+
root?: ParentNode;
|
|
36
|
+
switchSelector?: string;
|
|
37
|
+
};
|
|
38
|
+
export type SwitchController = {
|
|
39
|
+
destroy: () => void;
|
|
40
|
+
sync: () => void;
|
|
41
|
+
toggle: (target?: HTMLElement | null) => void;
|
|
42
|
+
check: (target?: HTMLElement | null) => void;
|
|
43
|
+
uncheck: (target?: HTMLElement | null) => void;
|
|
44
|
+
setChecked: (checked: boolean, target?: HTMLElement | null) => void;
|
|
45
|
+
isChecked: (target?: HTMLElement | null) => boolean;
|
|
46
|
+
};
|
|
47
|
+
export declare const createSwitch: (options?: SwitchOptions) => SwitchController;
|
|
48
|
+
export declare const initSwitch: (options?: SwitchOptions) => SwitchController;
|
|
49
|
+
export declare const startSwitchRuntime: () => SwitchController | null;
|
|
50
|
+
export declare const stopSwitchRuntime: () => void;
|
package/dist/themes/aquaflux.css
CHANGED
|
@@ -341,6 +341,93 @@
|
|
|
341
341
|
--juice-menu-focus-ring: var(--aqua-menu-focus-ring);
|
|
342
342
|
--juice-menu-opener: var(--aqua-menu-opener);
|
|
343
343
|
--juice-menu-opener-ink: var(--aqua-menu-opener-ink);
|
|
344
|
+
/* Switch chrome — APG switch from existing tokens. The host is a
|
|
345
|
+
surface track, not a CTA. Distinct from checkbox / menuitemcheckbox. */
|
|
346
|
+
--aqua-switch-track: var(--aqua-surface-muted);
|
|
347
|
+
--aqua-switch-track-checked: var(--aqua-accent);
|
|
348
|
+
--aqua-switch-thumb: var(--aqua-page);
|
|
349
|
+
--aqua-switch-thumb-checked: var(--aqua-page);
|
|
350
|
+
--aqua-switch-focus-ring: var(--aqua-accent);
|
|
351
|
+
--juice-switch-track: var(--aqua-switch-track);
|
|
352
|
+
--juice-switch-track-checked: var(--aqua-switch-track-checked);
|
|
353
|
+
--juice-switch-thumb: var(--aqua-switch-thumb);
|
|
354
|
+
--juice-switch-thumb-checked: var(--aqua-switch-thumb-checked);
|
|
355
|
+
--juice-switch-focus-ring: var(--aqua-switch-focus-ring);
|
|
356
|
+
/* Slider chrome — APG slider from existing tokens. Horizontal only.
|
|
357
|
+
The track is a surface groove, not a CTA. Distinct from range
|
|
358
|
+
input, progress, and scrollbar. */
|
|
359
|
+
--aqua-slider-track: var(--aqua-surface-muted);
|
|
360
|
+
--aqua-slider-track-border: var(--aqua-border);
|
|
361
|
+
--aqua-slider-fill: var(--aqua-accent);
|
|
362
|
+
--aqua-slider-thumb: var(--aqua-page);
|
|
363
|
+
--aqua-slider-thumb-border: var(--aqua-border-strong);
|
|
364
|
+
--aqua-slider-thumb-shadow: 0 1px 2px var(--aqua-shadow);
|
|
365
|
+
--aqua-slider-focus-ring: var(--aqua-accent);
|
|
366
|
+
--juice-slider-track: var(--aqua-slider-track);
|
|
367
|
+
--juice-slider-track-border: var(--aqua-slider-track-border);
|
|
368
|
+
--juice-slider-fill: var(--aqua-slider-fill);
|
|
369
|
+
--juice-slider-thumb: var(--aqua-slider-thumb);
|
|
370
|
+
--juice-slider-thumb-border: var(--aqua-slider-thumb-border);
|
|
371
|
+
--juice-slider-thumb-shadow: var(--aqua-slider-thumb-shadow);
|
|
372
|
+
--juice-slider-focus-ring: var(--aqua-slider-focus-ring);
|
|
373
|
+
/* Checkbox chrome — APG checkbox from existing tokens. The host is a
|
|
374
|
+
surface box, not a CTA. Binary only. Distinct from switch and
|
|
375
|
+
menuitemcheckbox. */
|
|
376
|
+
--aqua-checkbox-control: var(--aqua-page);
|
|
377
|
+
--aqua-checkbox-control-checked: var(--aqua-accent);
|
|
378
|
+
--aqua-checkbox-border: var(--aqua-border-strong);
|
|
379
|
+
--aqua-checkbox-border-checked: var(--aqua-accent);
|
|
380
|
+
--aqua-checkbox-mark: var(--aqua-page);
|
|
381
|
+
--aqua-checkbox-focus-ring: var(--aqua-accent);
|
|
382
|
+
--juice-checkbox-control: var(--aqua-checkbox-control);
|
|
383
|
+
--juice-checkbox-control-checked: var(--aqua-checkbox-control-checked);
|
|
384
|
+
--juice-checkbox-border: var(--aqua-checkbox-border);
|
|
385
|
+
--juice-checkbox-border-checked: var(--aqua-checkbox-border-checked);
|
|
386
|
+
--juice-checkbox-mark: var(--aqua-checkbox-mark);
|
|
387
|
+
--juice-checkbox-focus-ring: var(--aqua-checkbox-focus-ring);
|
|
388
|
+
/* Radio chrome — APG radio from existing tokens. The host is a surface
|
|
389
|
+
disc, not a CTA. The group is layout-only. Distinct from switch
|
|
390
|
+
and checkbox. */
|
|
391
|
+
--aqua-radio-control: var(--aqua-page);
|
|
392
|
+
--aqua-radio-control-checked: var(--aqua-page);
|
|
393
|
+
--aqua-radio-border: var(--aqua-border-strong);
|
|
394
|
+
--aqua-radio-border-checked: var(--aqua-accent);
|
|
395
|
+
--aqua-radio-mark: var(--aqua-accent);
|
|
396
|
+
--aqua-radio-focus-ring: var(--aqua-accent);
|
|
397
|
+
--juice-radio-control: var(--aqua-radio-control);
|
|
398
|
+
--juice-radio-control-checked: var(--aqua-radio-control-checked);
|
|
399
|
+
--juice-radio-border: var(--aqua-radio-border);
|
|
400
|
+
--juice-radio-border-checked: var(--aqua-radio-border-checked);
|
|
401
|
+
--juice-radio-mark: var(--aqua-radio-mark);
|
|
402
|
+
--juice-radio-focus-ring: var(--aqua-radio-focus-ring);
|
|
403
|
+
/* Breadcrumb chrome — APG trail from existing tokens. Inline, not a
|
|
404
|
+
site nav bar and not a CTA. Surface stays transparent unless a bar
|
|
405
|
+
is wanted. Distinct from tabs, wizard steps, and pagination. */
|
|
406
|
+
--aqua-breadcrumb-ink: var(--aqua-text-muted);
|
|
407
|
+
--aqua-breadcrumb-ink-current: var(--aqua-heading);
|
|
408
|
+
--aqua-breadcrumb-ink-hover: var(--aqua-accent);
|
|
409
|
+
--aqua-breadcrumb-separator: var(--aqua-border-strong);
|
|
410
|
+
--aqua-breadcrumb-focus-ring: var(--aqua-accent);
|
|
411
|
+
--aqua-breadcrumb-surface: transparent;
|
|
412
|
+
--juice-breadcrumb-ink: var(--aqua-breadcrumb-ink);
|
|
413
|
+
--juice-breadcrumb-ink-current: var(--aqua-breadcrumb-ink-current);
|
|
414
|
+
--juice-breadcrumb-ink-hover: var(--aqua-breadcrumb-ink-hover);
|
|
415
|
+
--juice-breadcrumb-separator: var(--aqua-breadcrumb-separator);
|
|
416
|
+
--juice-breadcrumb-focus-ring: var(--aqua-breadcrumb-focus-ring);
|
|
417
|
+
--juice-breadcrumb-surface: var(--aqua-breadcrumb-surface);
|
|
418
|
+
/* Progress chrome — APG progressbar from existing tokens. The track
|
|
419
|
+
is a surface groove, not a CTA. Distinct from slider, spinner, and
|
|
420
|
+
a native <progress> restyle. Inline status — no overlay. */
|
|
421
|
+
--aqua-progress-track: var(--aqua-surface-muted);
|
|
422
|
+
--aqua-progress-track-border: var(--aqua-border);
|
|
423
|
+
--aqua-progress-fill: var(--aqua-accent);
|
|
424
|
+
--aqua-progress-ink: var(--aqua-text);
|
|
425
|
+
--aqua-progress-focus-ring: var(--aqua-accent);
|
|
426
|
+
--juice-progress-track: var(--aqua-progress-track);
|
|
427
|
+
--juice-progress-track-border: var(--aqua-progress-track-border);
|
|
428
|
+
--juice-progress-fill: var(--aqua-progress-fill);
|
|
429
|
+
--juice-progress-ink: var(--aqua-progress-ink);
|
|
430
|
+
--juice-progress-focus-ring: var(--aqua-progress-focus-ring);
|
|
344
431
|
background-color: var(--aqua-page);
|
|
345
432
|
background-image: var(--aqua-page-background);
|
|
346
433
|
color: var(--aqua-text);
|
|
@@ -1074,4 +1161,215 @@
|
|
|
1074
1161
|
|
|
1075
1162
|
[theme=aquaflux] [menu-label] {
|
|
1076
1163
|
color: var(--juice-menu-ink);
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
/* Switch chrome. Beat [theme] :where(button) CTA defaults.
|
|
1167
|
+
The host is a surface track, not a CTA. Runtime is later. */
|
|
1168
|
+
[theme=aquaflux] button[switch],
|
|
1169
|
+
[theme=aquaflux] [switch] {
|
|
1170
|
+
background-image: none;
|
|
1171
|
+
background-color: var(--juice-switch-track);
|
|
1172
|
+
box-shadow: none;
|
|
1173
|
+
transform: none;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
[theme=aquaflux] button[switch][aria-checked=true],
|
|
1177
|
+
[theme=aquaflux] [switch][aria-checked=true],
|
|
1178
|
+
[theme=aquaflux] [switch]:checked {
|
|
1179
|
+
background-image: none;
|
|
1180
|
+
background-color: var(--juice-switch-track-checked);
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
[theme=aquaflux] button[switch]:hover,
|
|
1184
|
+
[theme=aquaflux] [switch]:hover,
|
|
1185
|
+
[theme=aquaflux] button[switch]:focus-visible,
|
|
1186
|
+
[theme=aquaflux] [switch]:focus-visible {
|
|
1187
|
+
box-shadow: none;
|
|
1188
|
+
transform: none;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
[theme=aquaflux] button[switch]:focus-visible,
|
|
1192
|
+
[theme=aquaflux] [switch]:focus-visible {
|
|
1193
|
+
outline: 2px solid var(--juice-switch-focus-ring);
|
|
1194
|
+
outline-offset: 2px;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
/* Slider chrome. Beat [theme] :where(button) CTA defaults.
|
|
1198
|
+
Horizontal only. The thumb is a surface control, not a CTA.
|
|
1199
|
+
Runtime is later. */
|
|
1200
|
+
[theme=aquaflux] button[slider]:not([slider=vertical]),
|
|
1201
|
+
[theme=aquaflux] [slider]:not([slider=vertical]) {
|
|
1202
|
+
background-image: none;
|
|
1203
|
+
background-color: transparent;
|
|
1204
|
+
box-shadow: none;
|
|
1205
|
+
transform: none;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
[theme=aquaflux] button[slider-thumb],
|
|
1209
|
+
[theme=aquaflux] [slider-thumb] {
|
|
1210
|
+
background-image: none;
|
|
1211
|
+
background-color: var(--juice-slider-thumb);
|
|
1212
|
+
border-color: var(--juice-slider-thumb-border);
|
|
1213
|
+
box-shadow: var(--juice-slider-thumb-shadow);
|
|
1214
|
+
transform: translate(-50%, -50%);
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
[theme=aquaflux] button[slider-thumb]:hover,
|
|
1218
|
+
[theme=aquaflux] [slider-thumb]:hover,
|
|
1219
|
+
[theme=aquaflux] button[slider-thumb]:focus-visible,
|
|
1220
|
+
[theme=aquaflux] [slider-thumb]:focus-visible {
|
|
1221
|
+
background-image: none;
|
|
1222
|
+
background-color: var(--juice-slider-thumb);
|
|
1223
|
+
box-shadow: var(--juice-slider-thumb-shadow);
|
|
1224
|
+
transform: translate(-50%, -50%);
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
[theme=aquaflux] button[slider-thumb]:focus-visible,
|
|
1228
|
+
[theme=aquaflux] [slider-thumb]:focus-visible {
|
|
1229
|
+
outline: 2px solid var(--juice-slider-focus-ring);
|
|
1230
|
+
outline-offset: 2px;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
/* Checkbox chrome. Beat [theme] :where(button) CTA defaults.
|
|
1234
|
+
The host is a surface box, not a CTA. Binary only. Runtime is later. */
|
|
1235
|
+
[theme=aquaflux] button[checkbox],
|
|
1236
|
+
[theme=aquaflux] [checkbox] {
|
|
1237
|
+
background-image: none;
|
|
1238
|
+
background-color: var(--juice-checkbox-control);
|
|
1239
|
+
border-color: var(--juice-checkbox-border);
|
|
1240
|
+
box-shadow: none;
|
|
1241
|
+
transform: none;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
[theme=aquaflux] button[checkbox][aria-checked=true],
|
|
1245
|
+
[theme=aquaflux] [checkbox][aria-checked=true],
|
|
1246
|
+
[theme=aquaflux] [checkbox]:checked {
|
|
1247
|
+
background-image: none;
|
|
1248
|
+
background-color: var(--juice-checkbox-control-checked);
|
|
1249
|
+
border-color: var(--juice-checkbox-border-checked);
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
[theme=aquaflux] button[checkbox]:hover,
|
|
1253
|
+
[theme=aquaflux] [checkbox]:hover,
|
|
1254
|
+
[theme=aquaflux] button[checkbox]:focus-visible,
|
|
1255
|
+
[theme=aquaflux] [checkbox]:focus-visible {
|
|
1256
|
+
box-shadow: none;
|
|
1257
|
+
transform: none;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
[theme=aquaflux] button[checkbox]:focus-visible,
|
|
1261
|
+
[theme=aquaflux] [checkbox]:focus-visible {
|
|
1262
|
+
outline: 2px solid var(--juice-checkbox-focus-ring);
|
|
1263
|
+
outline-offset: 2px;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
/* Radio chrome. Beat [theme] :where(button) CTA defaults.
|
|
1267
|
+
The host is a surface disc, not a CTA. Group layout is author-owned.
|
|
1268
|
+
Runtime is later. */
|
|
1269
|
+
[theme=aquaflux] button[radio],
|
|
1270
|
+
[theme=aquaflux] [radio] {
|
|
1271
|
+
background-image: none;
|
|
1272
|
+
background-color: var(--juice-radio-control);
|
|
1273
|
+
border-color: var(--juice-radio-border);
|
|
1274
|
+
box-shadow: none;
|
|
1275
|
+
transform: none;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
[theme=aquaflux] button[radio][aria-checked=true],
|
|
1279
|
+
[theme=aquaflux] [radio][aria-checked=true],
|
|
1280
|
+
[theme=aquaflux] [radio]:checked {
|
|
1281
|
+
background-image: none;
|
|
1282
|
+
background-color: var(--juice-radio-control-checked);
|
|
1283
|
+
border-color: var(--juice-radio-border-checked);
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
[theme=aquaflux] button[radio]:hover,
|
|
1287
|
+
[theme=aquaflux] [radio]:hover,
|
|
1288
|
+
[theme=aquaflux] button[radio]:focus-visible,
|
|
1289
|
+
[theme=aquaflux] [radio]:focus-visible {
|
|
1290
|
+
box-shadow: none;
|
|
1291
|
+
transform: none;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
[theme=aquaflux] button[radio]:focus-visible,
|
|
1295
|
+
[theme=aquaflux] [radio]:focus-visible {
|
|
1296
|
+
outline: 2px solid var(--juice-radio-focus-ring);
|
|
1297
|
+
outline-offset: 2px;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
/* Breadcrumb chrome. Beat [theme] :where(nav) bars and :where(a) link color.
|
|
1301
|
+
Inline trail, not a site nav and not a CTA. Runtime is later. */
|
|
1302
|
+
[theme=aquaflux] [breadcrumb],
|
|
1303
|
+
[theme=aquaflux] nav[breadcrumb] {
|
|
1304
|
+
background-image: none;
|
|
1305
|
+
background-color: var(--juice-breadcrumb-surface);
|
|
1306
|
+
border: none;
|
|
1307
|
+
box-shadow: none;
|
|
1308
|
+
-webkit-backdrop-filter: none;
|
|
1309
|
+
backdrop-filter: none;
|
|
1310
|
+
color: var(--juice-breadcrumb-ink);
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
[theme=aquaflux] [breadcrumb] a,
|
|
1314
|
+
[theme=aquaflux] [breadcrumb-link],
|
|
1315
|
+
[theme=aquaflux] a[breadcrumb-link],
|
|
1316
|
+
[theme=aquaflux] button[breadcrumb-link] {
|
|
1317
|
+
background-image: none;
|
|
1318
|
+
background-color: transparent;
|
|
1319
|
+
color: var(--juice-breadcrumb-ink);
|
|
1320
|
+
box-shadow: none;
|
|
1321
|
+
transform: none;
|
|
1322
|
+
text-decoration: none;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
[theme=aquaflux] [breadcrumb] a:hover,
|
|
1326
|
+
[theme=aquaflux] [breadcrumb-link]:hover,
|
|
1327
|
+
[theme=aquaflux] a[breadcrumb-link]:hover,
|
|
1328
|
+
[theme=aquaflux] button[breadcrumb-link]:hover {
|
|
1329
|
+
background-image: none;
|
|
1330
|
+
background-color: transparent;
|
|
1331
|
+
color: var(--juice-breadcrumb-ink-hover);
|
|
1332
|
+
box-shadow: none;
|
|
1333
|
+
transform: none;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
[theme=aquaflux] [breadcrumb] [aria-current=page],
|
|
1337
|
+
[theme=aquaflux] [breadcrumb] [aria-current=page] :is(a, [breadcrumb-link]),
|
|
1338
|
+
[theme=aquaflux] [breadcrumb-link][aria-current=page] {
|
|
1339
|
+
color: var(--juice-breadcrumb-ink-current);
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
[theme=aquaflux] [breadcrumb] a:focus-visible,
|
|
1343
|
+
[theme=aquaflux] [breadcrumb-link]:focus-visible,
|
|
1344
|
+
[theme=aquaflux] button[breadcrumb-link]:focus-visible {
|
|
1345
|
+
outline: 2px solid var(--juice-breadcrumb-focus-ring);
|
|
1346
|
+
outline-offset: 2px;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
/* Progress chrome. Beat [theme] :where(div) fills.
|
|
1350
|
+
The track is a surface groove, not a CTA. Runtime is later. */
|
|
1351
|
+
[theme=aquaflux] [progress] {
|
|
1352
|
+
background-image: none;
|
|
1353
|
+
background-color: transparent;
|
|
1354
|
+
border: none;
|
|
1355
|
+
box-shadow: none;
|
|
1356
|
+
color: var(--juice-progress-ink);
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
[theme=aquaflux] [progress-fill] {
|
|
1360
|
+
background-image: none;
|
|
1361
|
+
background-color: var(--juice-progress-fill);
|
|
1362
|
+
box-shadow: none;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
[theme=aquaflux] [progress-label] {
|
|
1366
|
+
background-image: none;
|
|
1367
|
+
background-color: transparent;
|
|
1368
|
+
color: var(--juice-progress-ink);
|
|
1369
|
+
box-shadow: none;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
[theme=aquaflux] [progress]:focus-visible {
|
|
1373
|
+
outline: 2px solid var(--juice-progress-focus-ring);
|
|
1374
|
+
outline-offset: 2px;
|
|
1077
1375
|
}
|