@citrusworx/juiceui 0.9.3 → 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 -247
- package/dist/index.css +360 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +437 -2
- package/dist/js/juice.d.ts +4 -0
- package/dist/js/src/pressable/pressable-runtime.d.ts +106 -0
- package/dist/js/src/shared/change.d.ts +1 -0
- package/dist/js/src/touchable-row/touchable-row-runtime.d.ts +123 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,50 +1,31 @@
|
|
|
1
1
|
# @citrusworx/juiceui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## What Juice is
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Juice is an attribute-first styling library for CitrusWorx apps. Structure lives in markup (`stack`, `row`, `gap`, `card`), and themes own identity. The package ships the compiled stylesheet and a small JS entry so an app can import shared tokens, styles, and the optional runtimes from one place.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
The Juice workspace also contains internal-only material that is not part of the published runtime contract:
|
|
19
|
-
|
|
20
|
-
- `src/native/` playground and experiments
|
|
21
|
-
- `src/templates/` HTML examples
|
|
22
|
-
- `src/tools/` compiler helpers
|
|
23
|
-
- `.mockups/` and `test-results/`
|
|
24
|
-
- local build tooling like `gulp.ts`, `vite.config.ts`, and `juice.config.yaml`
|
|
25
|
-
|
|
26
|
-
Those are useful for monorepo development, but they are not part of the public API of `@citrusworx/juiceui`.
|
|
7
|
+
```html
|
|
8
|
+
<body theme="aquaflux">
|
|
9
|
+
<section card stack gap="1" padding="1rem">
|
|
10
|
+
<div row gap="1">
|
|
11
|
+
<h1>Harbor</h1>
|
|
12
|
+
<p>Attribute-first structure. The theme owns the color.</p>
|
|
13
|
+
</div>
|
|
14
|
+
</section>
|
|
15
|
+
</body>
|
|
16
|
+
```
|
|
27
17
|
|
|
28
18
|
## Install
|
|
29
19
|
|
|
30
20
|
```bash
|
|
31
21
|
npm install @citrusworx/juiceui
|
|
32
|
-
pnpm add @citrusworx/juiceui
|
|
33
|
-
yarn add @citrusworx/juiceui
|
|
34
|
-
bun add @citrusworx/juiceui
|
|
35
22
|
```
|
|
36
23
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Core utilities and components (no theme identity):
|
|
40
|
-
|
|
41
|
-
```ts
|
|
42
|
-
import "@citrusworx/juiceui/styles";
|
|
43
|
-
```
|
|
24
|
+
The same package name works with `pnpm add`, `yarn add`, and `bun add`.
|
|
44
25
|
|
|
45
|
-
##
|
|
26
|
+
## Quick start
|
|
46
27
|
|
|
47
|
-
|
|
28
|
+
`@citrusworx/juiceui/styles` is core only: utilities and components, with no theme identity. Import a theme stylesheet next to it, and set `theme` on `<body>` (or another root).
|
|
48
29
|
|
|
49
30
|
```ts
|
|
50
31
|
import "@citrusworx/juiceui/styles";
|
|
@@ -53,240 +34,165 @@ import "@citrusworx/juiceui/styles/themes/aquaflux";
|
|
|
53
34
|
|
|
54
35
|
```html
|
|
55
36
|
<body theme="aquaflux">
|
|
56
|
-
|
|
37
|
+
<main stack gap="2rem" padding="2rem">
|
|
38
|
+
<h1 font="bebas-neue" fontColor="obsidian-900">Juice</h1>
|
|
39
|
+
<p font="lato" fontColor="gray-700">
|
|
40
|
+
Attribute-driven styling from shared design tokens.
|
|
41
|
+
</p>
|
|
42
|
+
<button bgColor="green-500" hover="green-600" fontColor="white-100" padding="1rem">
|
|
43
|
+
Get started
|
|
44
|
+
</button>
|
|
45
|
+
</main>
|
|
57
46
|
</body>
|
|
58
47
|
```
|
|
59
48
|
|
|
60
|
-
|
|
49
|
+
A page that sets `theme` and never imports a theme stylesheet has structure and no brand. The JS module is optional when the page is CSS only. See [Migration](#migration) for the core-only split.
|
|
61
50
|
|
|
62
|
-
##
|
|
51
|
+
## Themes
|
|
63
52
|
|
|
64
|
-
|
|
53
|
+
Themes are Beta. Set `theme="<id>"` on the root and import that id.
|
|
65
54
|
|
|
66
|
-
|
|
55
|
+
Core:
|
|
56
|
+
|
|
57
|
+
| Id | Import |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| `aquaflux` | `@citrusworx/juiceui/styles/themes/aquaflux` |
|
|
60
|
+
| `kiwipress` | `@citrusworx/juiceui/styles/themes/kiwipress` |
|
|
61
|
+
| `citrusmint` | `@citrusworx/juiceui/styles/themes/citrusmint` |
|
|
62
|
+
| `tide` | `@citrusworx/juiceui/styles/themes/tide` |
|
|
63
|
+
|
|
64
|
+
Retro:
|
|
65
|
+
|
|
66
|
+
| Id | Import |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| `retro-afterburn` | `@citrusworx/juiceui/styles/themes/retro-afterburn` |
|
|
69
|
+
| `retro-arcade-glow` | `@citrusworx/juiceui/styles/themes/retro-arcade-glow` |
|
|
70
|
+
| `retro-boardwalk` | `@citrusworx/juiceui/styles/themes/retro-boardwalk` |
|
|
71
|
+
| `retro-denim-dial` | `@citrusworx/juiceui/styles/themes/retro-denim-dial` |
|
|
72
|
+
| `retro-forest-radio` | `@citrusworx/juiceui/styles/themes/retro-forest-radio` |
|
|
73
|
+
| `retro-orchard-club` | `@citrusworx/juiceui/styles/themes/retro-orchard-club` |
|
|
74
|
+
| `retro-poolside-pop` | `@citrusworx/juiceui/styles/themes/retro-poolside-pop` |
|
|
75
|
+
| `retro-signal-garden` | `@citrusworx/juiceui/styles/themes/retro-signal-garden` |
|
|
76
|
+
| `retro-sunset-motel` | `@citrusworx/juiceui/styles/themes/retro-sunset-motel` |
|
|
77
|
+
| `retro-violet-parlor` | `@citrusworx/juiceui/styles/themes/retro-violet-parlor` |
|
|
78
|
+
|
|
79
|
+
Built files are `dist/index.css` (core) and `dist/themes/<id>.css`. Each theme is authored as `<themeId>.scss` + `<themeId>.yaml` under `src/themes/<themeId>/`. Drafts under `src/themes/_draft/` are blocked from package `exports` and left out of the published tarball. See [Theme authoring](../../docs/juice/juice-theme-authoring.md).
|
|
80
|
+
|
|
81
|
+
## Components and runtimes
|
|
82
|
+
|
|
83
|
+
The top-level JS entry is intentionally small. The named exports below are the stable runtime API Juice currently promises. All thirty stay Emerging.
|
|
84
|
+
|
|
85
|
+
Navigation through field (twenty-five runtimes) are in the published `@citrusworx/juiceui@0.9.2` release. Icon button, avatar, table, pressable, and touchable row are on master and are not in that release. Rows marked **master** are those five.
|
|
86
|
+
|
|
87
|
+
### Overlays
|
|
88
|
+
|
|
89
|
+
| Component | Markup | What it is | Docs |
|
|
90
|
+
| --- | --- | --- | --- |
|
|
91
|
+
| Modal | `[modal-overlay]` | Dialog. Open and close, Escape, focus trap, one open at a time. | [Modal](../../docs/juice/juice-modal-runtime.md) |
|
|
92
|
+
| Drawer | `[drawer-overlay]` | Edge dialog (`left` or `right`, optional `drawer-size` of `sm` or `lg`). Escape, focus trap, exclusive. | [Drawer](../../docs/juice/juice-drawer-runtime.md) |
|
|
93
|
+
| Popover | `[popover-root]` | Anchored non-modal dialog. The surface is `[popover-panel]`, never a bare `popover` attribute. | [Popover](../../docs/juice/juice-popover-runtime.md) |
|
|
94
|
+
| Tooltip | `[tooltip-root]` | Hover and focus tip. The surface is `[tooltip-panel]`, never a bare `tooltip` attribute or native `title`. | [Tooltip](../../docs/juice/juice-tooltip-runtime.md) |
|
|
95
|
+
| Toast | `[toast-region]` | Non-modal stack (default `top-right`). Not a dialog: no focus trap, no `aria-modal`, stacking is allowed. | [Toast](../../docs/juice/juice-toast-runtime.md) |
|
|
96
|
+
|
|
97
|
+
### Navigation
|
|
98
|
+
|
|
99
|
+
| Component | Markup | What it is | Docs |
|
|
100
|
+
| --- | --- | --- | --- |
|
|
101
|
+
| Navigation | `nav[type="mobile"]` | Mobile toggle for `nav[type="sidebar"]`. Also watches `nav[type="bar"]` and `nav[type="links"]`. | [Navigation](../../docs/juice/juice-navigation-runtime.md) |
|
|
102
|
+
| Menu | `[menu-root]` | APG menu button (`open` / `close` / `toggle` / `select`). Not a popover and not a menubar. | [Menu](../../docs/juice/juice-menu-runtime.md) |
|
|
103
|
+
| Tabs | `[tabs]` | One selected panel. Orphan `[tab]` triggers and `[tab-panel]` panels are ignored. | [Tabs](../../docs/juice/juice-tabs-runtime.md) |
|
|
104
|
+
| Breadcrumb | `[breadcrumb]` | Light trail (`sync` / `setCurrent`). Not a router. | [Breadcrumb](../../docs/juice/juice-breadcrumb-runtime.md) |
|
|
105
|
+
| Pagination | `[pagination]` | Page set (`sync` / `setCurrent`). One current page, prev/next disabled at inferable ends, Arrow / Home / End among enabled controls. The nineteenth Emerging runtime. | [Pagination](../../docs/juice/juice-pagination-runtime.md) |
|
|
106
|
+
|
|
107
|
+
### Forms
|
|
108
|
+
|
|
109
|
+
| Component | Markup | What it is | Docs |
|
|
110
|
+
| --- | --- | --- | --- |
|
|
111
|
+
| Input | `<input input>` | Text-like native field (`sync`). Not a combobox and not a select. The twenty-third Emerging runtime. Shipped in 0.9.2. | [Input](../../docs/juice/juice-input-runtime.md) |
|
|
112
|
+
| Textarea | `<textarea textarea>` | Native multiline field (`sync`). Not an input, not a select, and not a combobox. The twenty-fourth Emerging runtime. Shipped in 0.9.2. | [Textarea](../../docs/juice/juice-textarea-runtime.md) |
|
|
113
|
+
| Select | `<select select>` | Native dropdown (`sync`). The open list stays the platform popup. Not a combobox. The twenty-second Emerging runtime. Shipped in 0.9.2. | [Select](../../docs/juice/juice-select-runtime.md) |
|
|
114
|
+
| Combobox | `[combobox]` | Input plus listbox (`open` / `close` / `toggle` / `select`). Distinct from native `<select>`. | [Combobox](../../docs/juice/juice-combobox-runtime.md) |
|
|
115
|
+
| Checkbox | `[checkbox]` | APG checkbox (`toggle` / `check` / `uncheck` / `setChecked`). Not a layered overlay. Checkbox and radio are two runtimes. | [Checkbox](../../docs/juice/juice-checkbox-runtime.md) |
|
|
116
|
+
| Radio | `[radiogroup]` | APG radio group (`select` / `getChecked`). `[radio]` outside the group is ignored. Not a layered overlay. | [Radio](../../docs/juice/juice-radio-runtime.md) |
|
|
117
|
+
| Switch | `[switch]` | APG switch (`toggle` / `check` / `uncheck` / `setChecked`). Not a layered overlay. | [Switch](../../docs/juice/juice-switch-runtime.md) |
|
|
118
|
+
| Slider | `[slider]` | APG slider (`setValue` / `getValue` / `increment` / `decrement`). Not a layered overlay. | [Slider](../../docs/juice/juice-slider-runtime.md) |
|
|
119
|
+
| Field | `[field]` | Wrapper. Visible help and error describe the first input, textarea, or select. The twenty-fifth Emerging runtime. Shipped in 0.9.2. | [Field](../../docs/juice/juice-field-runtime.md) |
|
|
120
|
+
| Icon button (**master**) | `[icon-button]` | Square control on button chrome (`sync` / `toggle` / `getState`). Not a switch and not a checkbox. The twenty-sixth Emerging runtime. Not in npm 0.9.2. | [Icon button](../../docs/juice/juice-icon-button-runtime.md) |
|
|
121
|
+
| Pressable (**master**) | `[pressable]` | Transient press (`sync` / `getState`). Sets `[pressed]` for the gesture. `[pressable-longpress]` opts into `juice:longpress`. Not a latched toggle. The twenty-ninth Emerging runtime. Not in npm 0.9.2. | [Pressable](../../docs/juice/juice-pressable.md) |
|
|
122
|
+
| Touchable row (**master**) | `[touchable-row]` | 44px row (`sync` / `getState`). `[touchable-row~="select"]` toggles selection. Enter and Space activate an `li` or `div`. Not a single-select group. The thirtieth Emerging runtime. Not in npm 0.9.2. | [Touchable row](../../docs/juice/juice-touchable-row.md) |
|
|
123
|
+
|
|
124
|
+
### Feedback
|
|
125
|
+
|
|
126
|
+
| Component | Markup | What it is | Docs |
|
|
127
|
+
| --- | --- | --- | --- |
|
|
128
|
+
| Banner | `[banner]` | Inline alert / callout (`show` / `dismiss`, `[banner-close]`). Not a toast stack. | [Banner](../../docs/juice/juice-banner-runtime.md) |
|
|
129
|
+
| Progress | `[progress]` | APG-inspired progressbar (`setValue` / `getValue` / `setIndeterminate`). Not a slider. | [Progress](../../docs/juice/juice-progress-runtime.md) |
|
|
130
|
+
| Spinner | `[spinner]` | Indeterminate busy indicator (`show` / `hide`). Not a progress bar and not a disclosure. The twenty-first Emerging runtime. Shipped in 0.9.2. | [Spinner](../../docs/juice/juice-spinner-runtime.md) |
|
|
131
|
+
|
|
132
|
+
### Disclosure
|
|
67
133
|
|
|
68
|
-
|
|
134
|
+
| Component | Markup | What it is | Docs |
|
|
135
|
+
| --- | --- | --- | --- |
|
|
136
|
+
| Accordion | `[accordion]` | Multi-item expand and collapse. Open panels use native `hidden`. | [Accordion](../../docs/juice/juice-accordion-runtime.md) |
|
|
137
|
+
| Disclosure | `[disclosure]` | One trigger, one panel. Distinct from accordion. The twentieth Emerging runtime. Shipped in 0.9.2. | [Disclosure](../../docs/juice/juice-disclosure-runtime.md) |
|
|
138
|
+
| Wizard | `[wizard-shell]` | Multi-step shell. One `[step-page]` visible. Not a dialog and not tabs. | [Wizard](../../docs/juice/juice-wizard-runtime.md) |
|
|
69
139
|
|
|
70
|
-
|
|
140
|
+
### Data display
|
|
71
141
|
|
|
72
|
-
|
|
142
|
+
| Component | Markup | What it is | Docs |
|
|
143
|
+
| --- | --- | --- | --- |
|
|
144
|
+
| Avatar (**master**) | `[avatar]` | Initials or photo (`sync` / `getState`). Not a badge and not `[skeleton="circle"]`. The twenty-seventh Emerging runtime. Not in npm 0.9.2. | [Avatar](../../docs/juice/juice-avatar.md) |
|
|
145
|
+
| Table (**master**) | `<table table>` | Sortable grid (`createTable` / `sync` / `getState`). The twenty-eighth Emerging runtime. Not in npm 0.9.2. | [Table](../../docs/juice/juice-table.md) |
|
|
73
146
|
|
|
74
|
-
|
|
147
|
+
### Auto-start
|
|
148
|
+
|
|
149
|
+
Importing `@citrusworx/juiceui` enhances valid markup in the browser. The entry auto-starts navigation, accordion, tabs, modal, drawer, toast, popover, wizard, tooltip, combobox, banner, menu, switch, slider, checkbox, radio, breadcrumb, progress, pagination, disclosure, spinner, select, input, textarea, field, icon button, avatar, table, pressable, and touchable row. Most apps need no `init` call.
|
|
150
|
+
|
|
151
|
+
These hooks work without app init: `[accordion]`, `[tabs]`, `[modal-overlay]`, `[drawer-overlay]`, `[toast-region]`, `[popover-root]`, `[wizard-shell]`, `[tooltip-root]`, `[combobox]`, `[banner]`, `[menu-root]`, `[switch]`, `[slider]`, `[checkbox]`, `[radiogroup]`, `[breadcrumb]`, `[progress]`, `[pagination]`, `[disclosure]`, `[spinner]`, `<select select>`, `<input input>`, `<textarea textarea>`, `[field]`, `[icon-button]`, `[avatar]`, `[table]`, `[pressable]`, `[touchable-row]`, and navigation (`nav[type="bar"]`, `nav[type="links"]`, `nav[type="mobile"]`, `nav[type="sidebar"]`).
|
|
152
|
+
|
|
153
|
+
The JS module is optional. Core CSS plus a theme is enough when the page does not use a runtime.
|
|
154
|
+
|
|
155
|
+
### Naming pattern
|
|
156
|
+
|
|
157
|
+
Every runtime exports the same four functions. `<Name>` is the stem: Navigation, Accordion, Tabs, Modal, Drawer, Toast, Popover, Wizard, Tooltip, Combobox, Banner, Menu, Switch, Slider, Checkbox, Radio, Breadcrumb, Progress, Pagination, Disclosure, Spinner, Select, Input, Textarea, Field, IconButton, Avatar, Table, Pressable, TouchableRow.
|
|
158
|
+
|
|
159
|
+
| Export | What it does |
|
|
160
|
+
| --- | --- |
|
|
161
|
+
| `create<Name>(options?)` | Builds a controller for markup in the document, or under `options.root`. |
|
|
162
|
+
| `init<Name>(options?)` | Calls `create<Name>` with the same options. |
|
|
163
|
+
| `start<Name>Runtime()` | Boots the document-level controller that enhances matching markup. A second call syncs and returns that controller. Returns `null` when there is no document. |
|
|
164
|
+
| `stop<Name>Runtime()` | Destroys that document-level controller. |
|
|
165
|
+
|
|
166
|
+
Modal shows the four export names. The other twenty-nine use the same `create` / `init` / `start` / `stop` names. Controller methods differ by runtime.
|
|
75
167
|
|
|
76
168
|
```ts
|
|
77
169
|
import {
|
|
78
170
|
Accordion,
|
|
79
|
-
createAccordion,
|
|
80
|
-
initAccordion,
|
|
81
|
-
startAccordionRuntime,
|
|
82
|
-
stopAccordionRuntime,
|
|
83
|
-
createTabs,
|
|
84
|
-
initTabs,
|
|
85
|
-
startTabsRuntime,
|
|
86
|
-
stopTabsRuntime,
|
|
87
171
|
createModal,
|
|
88
172
|
initModal,
|
|
89
173
|
startModalRuntime,
|
|
90
174
|
stopModalRuntime,
|
|
91
|
-
|
|
92
|
-
initDrawer,
|
|
93
|
-
startDrawerRuntime,
|
|
94
|
-
stopDrawerRuntime,
|
|
95
|
-
createToast,
|
|
96
|
-
initToast,
|
|
97
|
-
startToastRuntime,
|
|
98
|
-
stopToastRuntime,
|
|
99
|
-
createPopover,
|
|
100
|
-
initPopover,
|
|
101
|
-
startPopoverRuntime,
|
|
102
|
-
stopPopoverRuntime,
|
|
103
|
-
createWizard,
|
|
104
|
-
initWizard,
|
|
105
|
-
startWizardRuntime,
|
|
106
|
-
stopWizardRuntime,
|
|
107
|
-
createTooltip,
|
|
108
|
-
initTooltip,
|
|
109
|
-
startTooltipRuntime,
|
|
110
|
-
stopTooltipRuntime,
|
|
111
|
-
createCombobox,
|
|
112
|
-
initCombobox,
|
|
113
|
-
startComboboxRuntime,
|
|
114
|
-
stopComboboxRuntime,
|
|
115
|
-
createBanner,
|
|
116
|
-
initBanner,
|
|
117
|
-
startBannerRuntime,
|
|
118
|
-
stopBannerRuntime,
|
|
119
|
-
createMenu,
|
|
120
|
-
initMenu,
|
|
121
|
-
startMenuRuntime,
|
|
122
|
-
stopMenuRuntime,
|
|
123
|
-
createSwitch,
|
|
124
|
-
initSwitch,
|
|
125
|
-
startSwitchRuntime,
|
|
126
|
-
stopSwitchRuntime,
|
|
127
|
-
createSlider,
|
|
128
|
-
initSlider,
|
|
129
|
-
startSliderRuntime,
|
|
130
|
-
stopSliderRuntime,
|
|
131
|
-
createCheckbox,
|
|
132
|
-
initCheckbox,
|
|
133
|
-
startCheckboxRuntime,
|
|
134
|
-
stopCheckboxRuntime,
|
|
135
|
-
createRadio,
|
|
136
|
-
initRadio,
|
|
137
|
-
startRadioRuntime,
|
|
138
|
-
stopRadioRuntime,
|
|
139
|
-
createBreadcrumb,
|
|
140
|
-
initBreadcrumb,
|
|
141
|
-
startBreadcrumbRuntime,
|
|
142
|
-
stopBreadcrumbRuntime,
|
|
143
|
-
createProgress,
|
|
144
|
-
initProgress,
|
|
145
|
-
startProgressRuntime,
|
|
146
|
-
stopProgressRuntime,
|
|
147
|
-
createPagination,
|
|
148
|
-
initPagination,
|
|
149
|
-
startPaginationRuntime,
|
|
150
|
-
stopPaginationRuntime,
|
|
151
|
-
createDisclosure,
|
|
152
|
-
initDisclosure,
|
|
153
|
-
startDisclosureRuntime,
|
|
154
|
-
stopDisclosureRuntime,
|
|
155
|
-
createSpinner,
|
|
156
|
-
initSpinner,
|
|
157
|
-
startSpinnerRuntime,
|
|
158
|
-
stopSpinnerRuntime,
|
|
159
|
-
createSelect,
|
|
160
|
-
initSelect,
|
|
161
|
-
startSelectRuntime,
|
|
162
|
-
stopSelectRuntime,
|
|
163
|
-
createInput,
|
|
164
|
-
initInput,
|
|
165
|
-
startInputRuntime,
|
|
166
|
-
stopInputRuntime,
|
|
167
|
-
createTextarea,
|
|
168
|
-
initTextarea,
|
|
169
|
-
startTextareaRuntime,
|
|
170
|
-
stopTextareaRuntime,
|
|
171
|
-
createField,
|
|
172
|
-
initField,
|
|
173
|
-
startFieldRuntime,
|
|
174
|
-
stopFieldRuntime,
|
|
175
|
-
createIconButton,
|
|
176
|
-
initIconButton,
|
|
177
|
-
startIconButtonRuntime,
|
|
178
|
-
stopIconButtonRuntime,
|
|
179
|
-
createAvatar,
|
|
180
|
-
initAvatar,
|
|
181
|
-
startAvatarRuntime,
|
|
182
|
-
stopAvatarRuntime,
|
|
183
|
-
createTable,
|
|
184
|
-
initTable,
|
|
185
|
-
startTableRuntime,
|
|
186
|
-
stopTableRuntime,
|
|
187
|
-
createNavigation,
|
|
188
|
-
initNavigation,
|
|
189
|
-
startNavigationRuntime,
|
|
190
|
-
stopNavigationRuntime,
|
|
191
|
-
tokens
|
|
175
|
+
tokens,
|
|
192
176
|
} from "@citrusworx/juiceui";
|
|
177
|
+
|
|
178
|
+
const modal = createModal(); // initModal() is this same call
|
|
179
|
+
startModalRuntime();
|
|
180
|
+
stopModalRuntime();
|
|
193
181
|
```
|
|
194
182
|
|
|
195
|
-
|
|
183
|
+
`createModal()` returns a controller with `open`, `close`, `toggle`, `isOpen`, `getState`, `sync`, and `destroy`. `initModal()` is that same call. A normal page never calls them: importing the entry already started the runtime.
|
|
196
184
|
|
|
197
|
-
|
|
185
|
+
`tokens` is the shared token object: color families and swatches, and the `adobe` and `google` font providers. `Accordion` is a Sig component that renders one `[accordion]` section (trigger plus panel). It is not the document runtime. The runtime is `createAccordion` / `startAccordionRuntime`.
|
|
198
186
|
|
|
199
|
-
|
|
187
|
+
Icon button, avatar, table, pressable, and touchable row export the same four names on master. Those twenty functions are not in the published `@citrusworx/juiceui@0.9.2` build: `createIconButton`, `initIconButton`, `startIconButtonRuntime`, `stopIconButtonRuntime`, `createAvatar`, `initAvatar`, `startAvatarRuntime`, `stopAvatarRuntime`, `createTable`, `initTable`, `startTableRuntime`, `stopTableRuntime`, `createPressable`, `initPressable`, `startPressableRuntime`, `stopPressableRuntime`, `createTouchableRow`, `initTouchableRow`, `startTouchableRowRuntime`, and `stopTouchableRowRuntime`.
|
|
200
188
|
|
|
201
|
-
|
|
189
|
+
### `juice:change` and `getState`
|
|
202
190
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
- `dist/index.css` (core)
|
|
206
|
-
- `dist/themes/aquaflux.css`, `dist/themes/kiwipress.css`, `dist/themes/citrusmint.css`, `dist/themes/tide.css`, `dist/themes/retro-afterburn.css`, `dist/themes/retro-arcade-glow.css`, `dist/themes/retro-boardwalk.css`, `dist/themes/retro-denim-dial.css`, `dist/themes/retro-forest-radio.css`, `dist/themes/retro-orchard-club.css`, `dist/themes/retro-poolside-pop.css`, `dist/themes/retro-signal-garden.css`, `dist/themes/retro-sunset-motel.css`, `dist/themes/retro-violet-parlor.css`
|
|
207
|
-
- `dist/index.js`
|
|
191
|
+
Interactive runtimes dispatch a bubbling `juice:change` event from the widget host when observable state actually changes. `detail` is `{ runtime, state }`. `getState()` reads that same shape. Select, input, and textarea publish value changes through the native `input` and `change` events and still expose `getState()`. The contract stays Emerging, covers all thirty runtimes, and is on master, unreleased after 0.9.2. `JUICE_CHANGE_EVENT` is not in the published 0.9.2 types.
|
|
208
192
|
|
|
209
|
-
|
|
193
|
+
`@citrusworx/sigjs/juice` `bind` names twenty-eight runtimes, through `table`. Pressable is the twenty-ninth Emerging runtime and touchable row is the thirtieth. Neither is a `JuiceRuntimeName` yet. `icon-button`, `avatar`, and `table` are `JuiceRuntimeName` values, and `bind` accepts them. That is this workspace and published `@citrusworx/sigjs@0.7.2`. Published `@citrusworx/sigjs@0.7.0` and `@citrusworx/sigjs@0.7.1` still stop at twenty-five names, through `textarea`. Binding `icon-button`, `avatar`, or `table` against `@citrusworx/juiceui@0.9.2` throws, because that cut does not export `startIconButtonRuntime`, `startAvatarRuntime`, or `startTableRuntime`. Juice works without Sig: any page can listen or call `getState()`. The optional Sig adapter is `@citrusworx/sigjs/juice` only. See [`juice:change`](../../docs/juice/juice-runtime-behavior.md#juicechange) and [Sig.js + Juice](../../docs/sigjs/sig-juice-integration.md#runtime-binding).
|
|
210
194
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
```html
|
|
214
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.2/dist/index.css" />
|
|
215
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.2/dist/themes/kiwipress.css" />
|
|
216
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.2/dist/index.js"></script>
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
The JS module is optional. Pin a version. You can also copy the same files out of `node_modules/@citrusworx/juiceui/dist/` next to a plain HTML page.
|
|
220
|
-
|
|
221
|
-
## Example
|
|
222
|
-
|
|
223
|
-
```html
|
|
224
|
-
<section stack gap="1" padding="2rem">
|
|
225
|
-
<h1 font="bebas-neue" fontColor="obsidian-900">Juice</h1>
|
|
226
|
-
<p font="lato" fontColor="gray-700">
|
|
227
|
-
Attribute-driven styling from shared design tokens.
|
|
228
|
-
</p>
|
|
229
|
-
<button bgColor="green-500" hover="green-600" fontColor="white-100" padding="1rem">
|
|
230
|
-
Get started
|
|
231
|
-
</button>
|
|
232
|
-
</section>
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
## What is implemented today
|
|
236
|
-
|
|
237
|
-
- compiled CSS output at `dist/index.css`
|
|
238
|
-
- compiled JS output at `dist/index.js`
|
|
239
|
-
- color tokens and swatches
|
|
240
|
-
- Google and Adobe font selectors
|
|
241
|
-
- attribute selectors for color, spacing, width, height, gradients, shadows, and icons
|
|
242
|
-
- layout primitives for `stack`, `row`, `grid`, `gap`, and `span`
|
|
243
|
-
- FontAwesome Free icon integration across the solid, regular, and brands sets
|
|
244
|
-
- CSS-only `[skeleton]` loading chrome in core CSS (rect, text, circle). On master, not in the published npm 0.9.2 release. Not a runtime. See [docs/juice/juice-skeleton.md](../../docs/juice/juice-skeleton.md)
|
|
245
|
-
- CSS-only `[list]` stacked rows in core CSS (`ul` / `ol` / `div`, `[divided]`, `[dense]`, `[list-item]` slots). On master, not in the published npm 0.9.2 release. Not a runtime. See [docs/juice/juice-list.md](../../docs/juice/juice-list.md)
|
|
246
|
-
- CSS-only `[badge]` pill (`[badge="square"]`, `[badge="ribbon"]`). The base layout shipped in npm 0.9.2. Core `--juice-badge-*` roles are on master and are not in that cut. Not a runtime. See [docs/juice/juice-badge.md](../../docs/juice/juice-badge.md)
|
|
247
|
-
- `[avatar]` initials-or-photo chrome and image-fallback runtime (`createAvatar` / `initAvatar` / `startAvatarRuntime` / `stopAvatarRuntime`). On master, not in the published npm 0.9.2 release. The twenty-seventh Emerging auto-enhance runtime. See [docs/juice/juice-avatar.md](../../docs/juice/juice-avatar.md)
|
|
248
|
-
- `[table]` sortable grid chrome and runtime (`createTable` / `initTable` / `startTableRuntime` / `stopTableRuntime`). On master, not in the published npm 0.9.2 release. The twenty-eighth Emerging auto-enhance runtime. See [docs/juice/juice-table.md](../../docs/juice/juice-table.md)
|
|
249
|
-
|
|
250
|
-
## Accessibility
|
|
251
|
-
|
|
252
|
-
Juice keeps styling attribute-first, but interactive patterns still need accessible relationships and names.
|
|
253
|
-
|
|
254
|
-
- mobile nav toggles should expose an accessible name and control a sidebar with `aria-controls`
|
|
255
|
-
- accordion triggers should use `aria-expanded` and `aria-controls`
|
|
256
|
-
- accordion panels should be labeled regions when they contain meaningful content
|
|
257
|
-
- accordion chrome colors come from `--juice-accordion-*` roles bound by the active theme (Aquaflux, KiwiPress, Citrusmint, and Tide)
|
|
258
|
-
- group FAQ stacks in a card/panel surface (`[aqua-card]` / `[aqua-panel]` under Aquaflux, `[tide-card]` / `[tide-panel]` under Tide) so the accordion wrapper stays structural
|
|
259
|
-
- open/closed accordion panels use the native `hidden` attribute; do not use `content="active"` or `content="hidden"` for accordion state (those clash with layout `[content]`)
|
|
260
|
-
- optional `[motion="accordion"]` is height easing, not required for show/hide
|
|
261
|
-
- tabs live under a `[tabs]` root with `[tabs-list]`, `[tab]` triggers, and `[tab-panel]` panels; orphan triggers and panels are ignored
|
|
262
|
-
- tab selection dual-writes Juice `[active]` and `aria-selected`; the runtime also wires `role="tablist"` / `tab` / `tabpanel`, roving tabindex, and labeled panels
|
|
263
|
-
- tab chrome colors come from `--juice-tabs-*` roles bound by the active theme (Aquaflux, KiwiPress, Citrusmint, Tide, and generated `--jx-tabs-*` aliases)
|
|
264
|
-
- visible vs hidden tab panels use the native `hidden` attribute; do not use `content="active"` or `content="hidden"` for panel state
|
|
265
|
-
- modal chrome colors come from `--juice-modal-*` roles bound by the active theme; hide `[modal-overlay]` with the native `hidden` attribute. Openers use `aria-controls` pointing at the overlay id. The dialog runtime auto-enhances that markup (open/close, Escape, focus trap, exclusive). See [docs/juice/juice-modal-runtime.md](../../docs/juice/juice-modal-runtime.md).
|
|
266
|
-
- toast chrome colors come from `--juice-toast-*` roles bound by the active theme. `[toast-region]` is a non-modal stack (default `top-right`); hide an individual `[toast]` with the native `hidden` attribute. Status is `[toast="success|error|info|warning"]`. The runtime auto-enhances that markup (`show` / `dismiss`, `[toast-close]`, `toast-duration`, live-region ARIA). It is not a dialog: no focus trap, no `aria-modal`, and stacking is allowed. See [docs/juice/juice-toast-runtime.md](../../docs/juice/juice-toast-runtime.md).
|
|
267
|
-
- drawer chrome colors come from `--juice-drawer-*` roles bound by the active theme; hide `[drawer-overlay]` with the native `hidden` attribute. Openers use `aria-controls` pointing at the overlay id. The dialog runtime auto-enhances that markup (open/close, Escape, focus trap, exclusive). Edge is `[drawer]` / `[drawer="left"|"right"]`; optional width is `[drawer-size="sm|lg"]`. See [docs/juice/juice-drawer-runtime.md](../../docs/juice/juice-drawer-runtime.md).
|
|
268
|
-
- popover chrome colors come from `--juice-popover-*` roles bound by the active theme; hide `[popover-root]` with the native `hidden` attribute. Openers use `aria-controls` pointing at the root id. The runtime auto-enhances that markup (open/close, Escape, outside click, Tab trap, exclusive, one-axis flip). The panel is a non-modal dialog (`role="dialog"`, no `aria-modal`). Never use a bare `popover` attribute — the surface is `[popover-panel]`. Placement is `[popover-root]` / `[popover-root="bottom"]` (default), `"top"`, `"left"`, `"right"`. See [docs/juice/juice-popover-runtime.md](../../docs/juice/juice-popover-runtime.md).
|
|
269
|
-
- wizard chrome colors come from `--juice-wizard-*` roles bound by the active theme. Scope is `[wizard-shell]`. The runtime paints `[step="pending"|"active"|"completed"]`, shows one `[step-page]` with native `hidden`, and wires `[wizard-prev]` / `[wizard-next]` (or unmarked buttons in `[step-nav]`). Default navigation jumps to completed + current; `wizard-shell="linear"` is prev/next only; `wizard-shell="free"` jumps to any step. Do not use `content="active"` or `content="hidden"` for page state. See [docs/juice/juice-wizard-runtime.md](../../docs/juice/juice-wizard-runtime.md).
|
|
270
|
-
- tooltip chrome colors come from `--juice-tooltip-*` roles bound by the active theme; hide `[tooltip-root]` with the native `hidden` attribute. Triggers prefer `aria-describedby` pointing at the root id (`aria-controls` is also accepted). The runtime auto-enhances that markup (show/hide, Escape, exclusive, one-axis flip). There is no focus trap; focus never moves into the tip. Never use a bare `tooltip` attribute or native `title` — the surface is `[tooltip-panel]`. Placement is `[tooltip-root]` / `[tooltip-root="top"]` (default), `"bottom"`, `"left"`, `"right"`. See [docs/juice/juice-tooltip-runtime.md](../../docs/juice/juice-tooltip-runtime.md).
|
|
271
|
-
- combobox chrome colors come from `--juice-combobox-*` roles bound by the active theme; hide `[combobox-list]` with the native `hidden` attribute. Scope is `[combobox]` with `[combobox-input]`, optional `[combobox-trigger]`, `[combobox-list]`, and `[combobox-option]`. The runtime auto-enhances that markup (`open` / `close` / `toggle` / `select`, case-insensitive substring filter, Arrow/Home/End/Enter/Escape/Tab). `aria-expanded` is written on the input and trigger; `aria-activedescendant` tracks the active option. Select writes option text or `data-value`. Distinct from native `<select>`. Placement is CSS-only (absolute under the field). See [docs/juice/juice-combobox-runtime.md](../../docs/juice/juice-combobox-runtime.md).
|
|
272
|
-
- banner chrome colors come from `--juice-banner-*` roles bound by the active theme. `[banner]` is an inline alert / callout, not a toast stack and not a dialog. Hide with the native `hidden` attribute. Layout is `[banner]` / `[banner="full"]`; optional status is `[banner-tone="info|success|warning|error"]`. The runtime auto-enhances that markup (`show` / `dismiss`, `[banner-close]`, optional `banner-persist="session|local"` with `name` / `id`). It is not a dialog: no focus trap, no `aria-modal`, no Escape steal. See [docs/juice/juice-banner-runtime.md](../../docs/juice/juice-banner-runtime.md).
|
|
273
|
-
- menu chrome colors come from `--juice-menu-*` roles bound by the active theme. `[menu-root]` wraps an opener plus `[menu]`; hide the panel with the native `hidden` attribute. Optional `[menu-button]` is surface paint, not a CTA. Items are `[menuitem]` (value `"active"` is keyboard focus); optional `[menu-separator]` / `[menu-label]`. APG Menu Button, not a popover, combobox, or native `<select>`. Placement is CSS-only (`[menu-root]` / `"bottom"` default, `"top"`, `"left"`, `"right"`). The runtime auto-enhances that markup (`open` / `close` / `toggle` / `select`, roving tabindex, Escape with popover). See [docs/juice/juice-menu-runtime.md](../../docs/juice/juice-menu-runtime.md).
|
|
274
|
-
- switch chrome colors come from `--juice-switch-*` roles bound by the active theme. `[switch]` is an APG switch on a button host (checkbox-backed hosts are a secondary story). The runtime auto-enhances that markup (`toggle` / `check` / `uncheck` / `setChecked`, `role="switch"`, binary `aria-checked`). Authors supply the accessible name. It is not a form checkbox as the only story, not menuitemcheckbox, and not a layered overlay: no focus trap, no Escape steal, no tri-state. See [docs/juice/juice-switch-runtime.md](../../docs/juice/juice-switch-runtime.md).
|
|
275
|
-
- slider chrome colors come from `--juice-slider-*` roles bound by the active theme. `[slider]` is the track host; `[slider-thumb]` is the APG slider (`role="slider"`). The runtime auto-enhances that markup (`setValue` / `getValue` / `increment` / `decrement`, arrows / Home / End / PageUp / PageDown, pointer jump and drag, `--juice-slider-ratio`). Authors supply the accessible name. It is horizontal and single-thumb: no vertical, no multi-thumb, no native `<input type="range">` restyle, no focus trap, and no Escape. See [docs/juice/juice-slider-runtime.md](../../docs/juice/juice-slider-runtime.md).
|
|
276
|
-
- checkbox chrome colors come from `--juice-checkbox-*` roles bound by the active theme. `[checkbox]` is a binary APG checkbox on a button host (a native `<input type="checkbox" checkbox>` is allowed). The runtime auto-enhances that markup (`toggle` / `check` / `uncheck` / `setChecked`, `role="checkbox"`, binary `aria-checked`). Authors supply the accessible name. It is not `[switch]`, not menuitemcheckbox, and not a layered overlay: no focus trap, no Escape steal, no tri-state. See [docs/juice/juice-checkbox-runtime.md](../../docs/juice/juice-checkbox-runtime.md).
|
|
277
|
-
- radio chrome colors come from `--juice-radio-*` roles bound by the active theme. `[radio]` is an APG radio on a button host inside `[radiogroup]` (a native `<input type="radio" radio>` is allowed). `[radiogroup]` is layout only. The runtime auto-enhances exclusive selection (`select` / `getChecked`, roving tabindex, arrows plus Space/Enter/click). Orphans outside `[radiogroup]` are ignored. Authors supply the accessible name. It is not `[switch]`, not `[checkbox]`, and not a layered overlay: no focus trap and no Escape. See [docs/juice/juice-radio-runtime.md](../../docs/juice/juice-radio-runtime.md).
|
|
278
|
-
- breadcrumb chrome colors come from `--juice-breadcrumb-*` roles bound by the active theme. `[breadcrumb]` is an APG-inspired trail on `<nav>` or `<ol>`, with `[breadcrumb-item]` crumbs. Current page is `aria-current="page"` inside the trail. `surface` stays transparent unless crumbs sit on a bar. It is not site nav, `nav[type="breadcrumb"]`, tabs, a wizard step tracker, or pagination, and it is not a layered overlay. The light runtime auto-enhances `[breadcrumb]` (`sync` / `setCurrent`): an unlabeled navigation landmark is named `Breadcrumb`, and a single `aria-current="page"` is filled on the last crumb when none is set. It does not remove `href`, trap focus, steal Escape, or listen to history. `<ol breadcrumb>` stays a list. See [docs/juice/juice-breadcrumb-runtime.md](../../docs/juice/juice-breadcrumb-runtime.md). No Sig Breadcrumb factory.
|
|
279
|
-
- progress chrome colors come from `--juice-progress-*` roles bound by the active theme. `[progress]` is an APG-inspired progressbar track on `<div progress>`, with `[progress-fill]` for the completed portion and optional `[progress-label]`. The runtime auto-enhances that markup (`setValue` / `getValue` / `setIndeterminate`, `role="progressbar"`, `aria-valuemin` / `aria-valuemax` / `aria-valuenow`, `--juice-progress-ratio`). `progress="indeterminate"` slides the fill and omits `aria-valuenow`. Authors supply the accessible name; `aria-valuetext` is kept when the author set it. It is not a slider, not a spinner, and not a native `<progress>` restyle. Authors do not style the HTML `<progress>` element alone. Inline status chrome — no overlay, no focus trap, no Escape. See [docs/juice/juice-progress-runtime.md](../../docs/juice/juice-progress-runtime.md). No Sig Progress factory.
|
|
280
|
-
- pagination chrome colors come from `--juice-pagination-*` roles bound by the active theme. `[pagination]` is an APG-inspired page set on `<nav pagination>` or `<ol pagination>`, with `[pagination-item]` cells, `[pagination-prev]` / `[pagination-next]`, and optional `[pagination-link]`, `[pagination-ellipsis]`, and `[pagination-status]`. Current page is `aria-current="page"` on the control. Disabled prev/next use `aria-disabled="true"`, native `disabled`, or `[disabled]`. The trail stays transparent; `surface` is the page control, not a bar. It is not site nav, `nav[type="pagination"]`, a breadcrumb, tabs, or a wizard step tracker, and it is not a layered overlay. The runtime auto-enhances `[pagination]` (`sync` / `setCurrent`): an unlabeled navigation landmark is named `Pagination`, a single `aria-current="page"` is kept (author current wins; otherwise the first page control), and prev/next are disabled at ends when page controls and optional ellipsis make that inferable. Author-owned disabled is kept. Arrow / Home / End move focus among enabled controls. It does not remove `href`, trap focus, steal Escape, or activate links on Enter/Space. `<ol pagination>` stays a list. See [docs/juice/juice-pagination-runtime.md](../../docs/juice/juice-pagination-runtime.md). Pagination is the nineteenth Emerging auto-enhance runtime. No Sig Pagination factory.
|
|
281
|
-
- disclosure chrome colors come from `--juice-disclosure-*` roles bound by the active theme. `[disclosure]` is a standalone APG disclosure: one `[disclosure-trigger]` and one `[disclosure-panel]`. Pair the panel with `aria-controls`, or place it as the next sibling of the trigger. Expanded state is `aria-expanded` on the trigger plus native `hidden` and `aria-hidden` on the panel. The runtime never writes layout `content=`. Orphans outside `[disclosure]` are ignored. Click toggles. Enter and Space toggle non-button triggers. Escape collapses the focused or last-opened disclosure and yields to an open modal, drawer, or popover. There is no exclusive group and no arrow roving. It is not an accordion (`[accordion]` / `[accordion-item]` stays multi-item and multi-open) and not a layered overlay. See [docs/juice/juice-disclosure-runtime.md](../../docs/juice/juice-disclosure-runtime.md). Disclosure is the twentieth Emerging auto-enhance runtime. Shipped in 0.9.2. No Sig Disclosure factory.
|
|
282
|
-
- spinner chrome colors come from `--juice-spinner-*` roles bound by the active theme. `[spinner]` is a standalone indeterminate busy indicator. The ring is `::before` on the host. Optional `[spinner-label]` is author text. CSS owns the spin (`juice-spinner-spin`). `prefers-reduced-motion` stops that animation and leaves the indicator. The runtime auto-enhances `[spinner]` (`sync` / `show` / `hide` / `isShown`): a shown host is `role="status"` and `aria-busy="true"`, and `hide` sets native `hidden` and clears both so a hidden spinner does not announce as busy. The runtime does not invent `aria-label` when there is no visible label, and it does not copy a label into a name. It is not a progress bar and not a disclosure. Inline status chrome — no overlay, no focus trap, no Escape. See [docs/juice/juice-spinner-runtime.md](../../docs/juice/juice-spinner-runtime.md). Spinner is the twenty-first Emerging auto-enhance runtime. Shipped in 0.9.2. No Sig Spinner factory.
|
|
283
|
-
- select chrome colors come from `--juice-select-*` roles bound by the active theme. `<select select>` is a styled native dropdown. Optional `[select-label]` is a visible label. The chevron is a `background-image`. `[multiple]` and `size` listboxes stay native selects. `[multiple]` and `size` other than `1` drop the chevron. The open list stays the platform popup. The runtime auto-enhances `<select select>` (`sync`): a visible associated label, wrapping label, or `[select-label]` names the control when the author has not set `aria-label` or `aria-labelledby`. A separate label is referenced with `aria-labelledby`. A wrapping label is copied into `aria-label` as its visible text excluding the select, so the selected option is not part of the name. Hidden or empty labels are skipped. No name is invented when nothing visible is there. Change events and the keyboard stay native. It is not a combobox. Inline field chrome — no overlay, no listbox, no focus trap, no Escape. See [docs/juice/juice-select-runtime.md](../../docs/juice/juice-select-runtime.md). Select is the twenty-second Emerging auto-enhance runtime. Shipped in 0.9.2. No Sig Select factory.
|
|
284
|
-
- input chrome colors come from `--juice-input-*` roles bound by the active theme. `<input input>` is a styled native text field. Optional `[input-label]` is a visible label. Text-like controls only: missing type, empty type, text, email, password, search, tel, url, and number. Checkbox, radio, range, file, date, time, datetime-local, month, week, color, hidden, button, submit, reset, and image are ignored. The runtime auto-enhances `<input input>` (`sync`): a visible associated label, wrapping label, or `[input-label]` names the control when the author has not set `aria-label` or `aria-labelledby`. A separate label is referenced with `aria-labelledby`. A wrapping label is copied into `aria-label` as its visible text excluding the input's own value. Hidden or empty labels are skipped. No name is invented when nothing visible is there. Typing, change, and the keyboard stay native. It is not a combobox and not a select. Textarea and the field wrapper are not this runtime. Inline field chrome — no overlay, no mask, no validation, no floating label, no focus trap, no Escape. See [docs/juice/juice-input-runtime.md](../../docs/juice/juice-input-runtime.md). Input is the twenty-third Emerging auto-enhance runtime. Shipped in 0.9.2. No Sig Input factory.
|
|
285
|
-
- textarea chrome colors come from `--juice-textarea-*` roles bound by the active theme. `<textarea textarea>` is a styled native multiline field. Optional `[textarea-label]` is a visible label. The runtime auto-enhances `<textarea textarea>` (`sync`): a visible associated label, wrapping label, or `[textarea-label]` names the control when the author has not set `aria-label` or `aria-labelledby`. A separate label is referenced with `aria-labelledby`. A wrapping label is copied into `aria-label` as its visible text excluding the textarea's own value. Hidden or empty labels are skipped. No name is invented when nothing visible is there. Typing, change, and the keyboard stay native. It is not an input, not a select, and not a combobox. The field wrapper is not this runtime. Inline field chrome — no overlay, no auto-grow, no character count, no validation, no floating label, no focus trap, no Escape. See [docs/juice/juice-textarea-runtime.md](../../docs/juice/juice-textarea-runtime.md). Textarea is the twenty-fourth Emerging auto-enhance runtime. Shipped in 0.9.2. No Sig Textarea factory.
|
|
286
|
-
- skeleton chrome is CSS-only. `[skeleton]` is a loading placeholder (boolean and `skeleton="rect"` are the rectangle, `skeleton="text"` is a line, `skeleton="circle"` is a circle). `[lines="1"`…`"8"]` or stacked element children supply the lines. A `width` on the last child shortens it. `[scale="sm"|"lg"]` steps the shape. `[static]` and `prefers-reduced-motion` remove the sheen and keep the base. Roles are `--juice-skeleton-*` on core. Color is restated on `[theme]` (inherited ink mixed into the muted surface). The highlight is a translucent white sheen; tune `--juice-skeleton-highlight` on a pale surface. Shipped themes are not required to bind the roles. Copy stays in the accessibility tree and does not paint. Authors own `aria-busy` on the loading region. There is no runtime and no auto-enhance. On master, not in the published npm 0.9.2 release. Not one of the twenty-eight Emerging auto-enhance runtimes. See [docs/juice/juice-skeleton.md](../../docs/juice/juice-skeleton.md)
|
|
287
|
-
- badge chrome is CSS-only. `[badge]` is a pill (`inline-flex`, radius `999px`, `0.8125rem` at weight 600). `[badge="square"]` uses radius `0.375rem`. `[badge="ribbon"]` is absolutely positioned (`top: -0.75rem`, centered). There is no `[scale]`. Color roles are `--juice-badge-bg` (currentColor at 1%), `--juice-badge-ink` (`currentColor`), and `--juice-badge-border` (currentColor at 24%), on `:root` and again on `[theme]`. Layout roles stay on `:root`. Shipped themes are not required to bind them. Outside `[cta]`, KiwiPress still paints the default, `[warm]`, ribbon, and `[wizard-header] [brand] [badge]`. `[card="pricing"]` is the positioned parent for a ribbon. `[dev-hero-header] > [badge]` switches that child to `inline-block`. There is no runtime, no `juice:change`, no `getState()`, and no auto-enhance. The base layout shipped in npm 0.9.2. The roles are on master and are not in that cut. Not one of the twenty-eight Emerging auto-enhance runtimes. See [docs/juice/juice-badge.md](../../docs/juice/juice-badge.md)
|
|
288
|
-
- list chrome is CSS-only. `[list]` on `ul`, `ol`, or `div` stacks rows (`:where(ul, ol, div)[list]`, so `<input list>` is left alone). `[divided]` is a hairline between direct children. `[dense]` tightens row padding and the slot margin and does not change the stack gap. `[list-item]` holds `[list-leading]`, `[list-content]`, `[list-secondary]`, and `[list-trailing]`. `[leading]` stays letter-spacing. An `a` or `button` row hovers, presses, and takes a 2px `currentColor` `:focus-visible` outline, offset 2px. `[selected]` and `aria-current` other than `"false"` share the selected wash. Disabled interactive rows are `opacity: 0.5`. `[selected]` is visual only. Color roles are `--juice-list-*` mixes of `currentColor`, restated on `[theme]`. Layout roles stay on `:root`. Shipped themes are not required to bind them. Background and color use `--juice-motion-duration-fast` and `--juice-motion-ease-standard`, and `prefers-reduced-motion` sets `transition: none`. There is no runtime, no `juice:change`, no `getState()`, and no auto-enhance. On master, not in the published npm 0.9.2 release. Not one of the twenty-eight Emerging auto-enhance runtimes. See [docs/juice/juice-list.md](../../docs/juice/juice-list.md)
|
|
289
|
-
- field chrome colors come from `--juice-field-*` roles bound by the active theme. `[field]` is a wrapper around a control. Optional `[field-label]`, `[field-help]`, and `[field-error]` are parts. `[invalid]` paints the wrapper border. The runtime auto-enhances `[field]` (`sync` / `destroy`): the first input, textarea, or select inside the wrapper is described by visible `[field-help]` and `[field-error]` when the author has not set `aria-describedby`. Hidden or empty parts are skipped, and missing ids are added only for parts the runtime references. `[invalid]` sets `aria-invalid="true"` on that control when the author has not set `aria-invalid`. Clearing `[invalid]`, removing a part, or calling `destroy` removes only what the runtime wrote. `[field-label]` is chrome only. Naming stays with the input, textarea, and select runtimes. Typing, change, and the keyboard stay native. It is not a validation engine, not a floating label, and not a restyle of input, textarea, select, or combobox. Inline wrapper chrome — no overlay, no focus trap, no Escape. See [docs/juice/juice-field-runtime.md](../../docs/juice/juice-field-runtime.md). Field is the twenty-fifth Emerging auto-enhance runtime. Shipped in 0.9.2. No Sig Field factory.
|
|
195
|
+
### Markup examples
|
|
290
196
|
|
|
291
197
|
```html
|
|
292
198
|
<div tabs name="settings">
|
|
@@ -405,7 +311,161 @@ Juice keeps styling attribute-first, but interactive patterns still need accessi
|
|
|
405
311
|
<button type="button" switch aria-label="Notifications"></button>
|
|
406
312
|
```
|
|
407
313
|
|
|
408
|
-
|
|
314
|
+
### Notes
|
|
315
|
+
|
|
316
|
+
Juice keeps styling attribute-first. Interactive patterns still need accessible relationships and names.
|
|
317
|
+
|
|
318
|
+
**Navigation.** A mobile nav toggle should expose an accessible name and control a sidebar with `aria-controls`. The runtime watches `nav[type="bar"]`, `nav[type="links"]`, `nav[type="mobile"]` (the toggle), and `nav[type="sidebar"]`.
|
|
319
|
+
|
|
320
|
+
**Accordion.** Triggers should use `aria-expanded` and `aria-controls`. Panels should be labeled regions when they contain meaningful content. Chrome colors come from `--juice-accordion-*` roles bound by the active theme. Every shipped theme binds them, including the retro family. Group FAQ stacks in a card or panel surface (`[aqua-card]` / `[aqua-panel]` under Aquaflux, `[tide-card]` / `[tide-panel]` under Tide) so the accordion wrapper stays structural. Open and closed panels use the native `hidden` attribute. Do not use `content="active"` or `content="hidden"` for accordion state. Those clash with layout `[content]`. Optional `[motion="accordion"]` is height easing, not required for show and hide.
|
|
321
|
+
|
|
322
|
+
**Tabs.** Tabs live under a `[tabs]` root with `[tabs-list]`, `[tab]` triggers, and `[tab-panel]` panels. Orphan triggers and panels are ignored. Selection dual-writes Juice `[active]` and `aria-selected`. The runtime also wires `role="tablist"` / `tab` / `tabpanel`, roving tabindex, and labeled panels. Chrome colors come from `--juice-tabs-*` roles bound by the active theme. Every shipped theme binds them, and generated themes bind `--jx-tabs-*` aliases. Visible and hidden panels use the native `hidden` attribute. Do not use `content="active"` or `content="hidden"` for panel state.
|
|
323
|
+
|
|
324
|
+
**Modal.** Chrome colors come from `--juice-modal-*` roles bound by the active theme. Hide `[modal-overlay]` with the native `hidden` attribute. Openers use `aria-controls` pointing at the overlay id. The dialog runtime auto-enhances that markup (open/close, Escape, focus trap, exclusive).
|
|
325
|
+
|
|
326
|
+
**Drawer.** Chrome colors come from `--juice-drawer-*` roles bound by the active theme. Hide `[drawer-overlay]` with the native `hidden` attribute. Openers use `aria-controls` pointing at the overlay id. The dialog runtime auto-enhances that markup (open/close, Escape, focus trap, exclusive). Edge is `[drawer]` / `[drawer="left"|"right"]`. Optional width is `[drawer-size="sm|lg"]`.
|
|
327
|
+
|
|
328
|
+
**Toast.** Chrome colors come from `--juice-toast-*` roles bound by the active theme. `[toast-region]` is a non-modal stack (default `top-right`). Hide an individual `[toast]` with the native `hidden` attribute. Status is `[toast="success|error|info|warning"]`. The runtime auto-enhances that markup (`show` / `dismiss`, `[toast-close]`, `toast-duration`, live-region ARIA). It is not a dialog: no focus trap, no `aria-modal`, and stacking is allowed.
|
|
329
|
+
|
|
330
|
+
**Popover.** Chrome colors come from `--juice-popover-*` roles bound by the active theme. Hide `[popover-root]` with the native `hidden` attribute. Openers use `aria-controls` pointing at the root id. The runtime auto-enhances that markup (open/close, Escape, outside click, Tab trap, exclusive, one-axis flip). The panel is a non-modal dialog (`role="dialog"`, no `aria-modal`). Never use a bare `popover` attribute. The surface is `[popover-panel]`. Placement is `[popover-root]` / `[popover-root="bottom"]` (default), `"top"`, `"left"`, `"right"`.
|
|
331
|
+
|
|
332
|
+
**Wizard.** Chrome colors come from `--juice-wizard-*` roles bound by the active theme. Scope is `[wizard-shell]`. The runtime paints `[step="pending"|"active"|"completed"]`, shows one `[step-page]` with native `hidden`, and wires `[wizard-prev]` / `[wizard-next]` (or unmarked buttons in `[step-nav]`). Default navigation jumps to completed plus current. `wizard-shell="linear"` is prev/next only. `wizard-shell="free"` jumps to any step. Do not use `content="active"` or `content="hidden"` for page state.
|
|
333
|
+
|
|
334
|
+
**Tooltip.** Chrome colors come from `--juice-tooltip-*` roles bound by the active theme. Hide `[tooltip-root]` with the native `hidden` attribute. Triggers prefer `aria-describedby` pointing at the root id (`aria-controls` is also accepted). The runtime auto-enhances that markup (show/hide, Escape, exclusive, one-axis flip). There is no focus trap. Focus never moves into the tip. Never use a bare `tooltip` attribute or native `title`. The surface is `[tooltip-panel]`. Placement is `[tooltip-root]` / `[tooltip-root="top"]` (default), `"bottom"`, `"left"`, `"right"`.
|
|
335
|
+
|
|
336
|
+
**Combobox.** Chrome colors come from `--juice-combobox-*` roles bound by the active theme. Hide `[combobox-list]` with the native `hidden` attribute. Scope is `[combobox]` with `[combobox-input]`, optional `[combobox-trigger]`, `[combobox-list]`, and `[combobox-option]`. The runtime auto-enhances that markup (`open` / `close` / `toggle` / `select`, case-insensitive substring filter, Arrow/Home/End/Enter/Escape/Tab). `aria-expanded` is written on the input and trigger. `aria-activedescendant` tracks the active option. Select writes option text or `data-value`. Distinct from native `<select>`. Placement is CSS-only (absolute under the field).
|
|
337
|
+
|
|
338
|
+
**Banner.** Chrome colors come from `--juice-banner-*` roles bound by the active theme. `[banner]` is an inline alert / callout, not a toast stack and not a dialog. Hide with the native `hidden` attribute. Layout is `[banner]` / `[banner="full"]`. Optional status is `[banner-tone="info|success|warning|error"]`. The runtime auto-enhances that markup (`show` / `dismiss`, `[banner-close]`, optional `banner-persist="session|local"` with `name` / `id`). It is not a dialog: no focus trap, no `aria-modal`, no Escape steal.
|
|
339
|
+
|
|
340
|
+
**Menu.** Chrome colors come from `--juice-menu-*` roles bound by the active theme. `[menu-root]` wraps an opener plus `[menu]`. Hide the panel with the native `hidden` attribute. Optional `[menu-button]` is surface paint, not a CTA. Items are `[menuitem]` (value `"active"` is keyboard focus). Optional `[menu-separator]` / `[menu-label]`. APG Menu Button, not a popover, combobox, native `<select>`, or menubar. Placement is CSS-only (`[menu-root]` / `"bottom"` default, `"top"`, `"left"`, `"right"`). The runtime auto-enhances that markup (`open` / `close` / `toggle` / `select`, roving tabindex, Escape with popover).
|
|
341
|
+
|
|
342
|
+
**Switch.** Chrome colors come from `--juice-switch-*` roles bound by the active theme. `[switch]` is an APG switch on a button host (checkbox-backed hosts are a secondary story). The runtime auto-enhances that markup (`toggle` / `check` / `uncheck` / `setChecked`, `role="switch"`, binary `aria-checked`). Authors supply the accessible name. It is not a form checkbox as the only story, not menuitemcheckbox, and not a layered overlay: no focus trap, no Escape steal, no tri-state.
|
|
343
|
+
|
|
344
|
+
**Slider.** Chrome colors come from `--juice-slider-*` roles bound by the active theme. `[slider]` is the track host. `[slider-thumb]` is the APG slider (`role="slider"`). The runtime auto-enhances that markup (`setValue` / `getValue` / `increment` / `decrement`, arrows / Home / End / PageUp / PageDown, pointer jump and drag, `--juice-slider-ratio`). Authors supply the accessible name. It is horizontal and single-thumb: no vertical, no multi-thumb, no native `<input type="range">` restyle, no focus trap, and no Escape.
|
|
345
|
+
|
|
346
|
+
**Checkbox.** Chrome colors come from `--juice-checkbox-*` roles bound by the active theme. `[checkbox]` is a binary APG checkbox on a button host (a native `<input type="checkbox" checkbox>` is allowed). The runtime auto-enhances that markup (`toggle` / `check` / `uncheck` / `setChecked`, `role="checkbox"`, binary `aria-checked`). Authors supply the accessible name. It is not `[switch]`, not menuitemcheckbox, and not a layered overlay: no focus trap, no Escape steal, no tri-state. Checkbox and radio are two runtimes.
|
|
347
|
+
|
|
348
|
+
**Radio.** Chrome colors come from `--juice-radio-*` roles bound by the active theme. `[radio]` is an APG radio on a button host inside `[radiogroup]` (a native `<input type="radio" radio>` is allowed). `[radiogroup]` is layout only. The runtime auto-enhances exclusive selection (`select` / `getChecked`, roving tabindex, arrows plus Space/Enter/click). Orphans outside `[radiogroup]` are ignored. Authors supply the accessible name. It is not `[switch]`, not `[checkbox]`, and not a layered overlay: no focus trap and no Escape.
|
|
349
|
+
|
|
350
|
+
**Breadcrumb.** Chrome colors come from `--juice-breadcrumb-*` roles bound by the active theme. `[breadcrumb]` is an APG-inspired trail on `<nav>` or `<ol>`, with `[breadcrumb-item]` crumbs. Current page is `aria-current="page"` inside the trail. `surface` stays transparent unless crumbs sit on a bar. It is not site nav, `nav[type="breadcrumb"]`, tabs, a wizard step tracker, or pagination, and it is not a layered overlay. The light runtime auto-enhances `[breadcrumb]` (`sync` / `setCurrent`): an unlabeled navigation landmark is named `Breadcrumb`, and a single `aria-current="page"` is filled on the last crumb when none is set. It does not remove `href`, trap focus, steal Escape, or listen to history. `<ol breadcrumb>` stays a list. Not a router. No Sig Breadcrumb factory.
|
|
351
|
+
|
|
352
|
+
**Progress.** Chrome colors come from `--juice-progress-*` roles bound by the active theme. `[progress]` is an APG-inspired progressbar track on `<div progress>`, with `[progress-fill]` for the completed portion and optional `[progress-label]`. The runtime auto-enhances that markup (`setValue` / `getValue` / `setIndeterminate`, `role="progressbar"`, `aria-valuemin` / `aria-valuemax` / `aria-valuenow`, `--juice-progress-ratio`). `progress="indeterminate"` slides the fill and omits `aria-valuenow`. Authors supply the accessible name. `aria-valuetext` is kept when the author set it. It is not a slider, not a spinner, and not a native `<progress>` restyle. Authors do not style the HTML `<progress>` element alone. Inline status chrome: no overlay, no focus trap, no Escape. No Sig Progress factory.
|
|
353
|
+
|
|
354
|
+
**Pagination.** Chrome colors come from `--juice-pagination-*` roles bound by the active theme. `[pagination]` is an APG-inspired page set on `<nav pagination>` or `<ol pagination>`, with `[pagination-item]` cells, `[pagination-prev]` / `[pagination-next]`, and optional `[pagination-link]`, `[pagination-ellipsis]`, and `[pagination-status]`. Current page is `aria-current="page"` on the control. Disabled prev/next use `aria-disabled="true"`, native `disabled`, or `[disabled]`. The trail stays transparent. `surface` is the page control, not a bar. It is not site nav, `nav[type="pagination"]`, a breadcrumb, tabs, or a wizard step tracker, and it is not a layered overlay. The runtime auto-enhances `[pagination]` (`sync` / `setCurrent`): an unlabeled navigation landmark is named `Pagination`, a single `aria-current="page"` is kept (author current wins; otherwise the first page control), and prev/next are disabled at ends when page controls and optional ellipsis make that inferable. Author-owned disabled is kept. Arrow / Home / End move focus among enabled controls. It does not remove `href`, trap focus, steal Escape, or activate links on Enter/Space. `<ol pagination>` stays a list. Pagination is the nineteenth Emerging auto-enhance runtime. No Sig Pagination factory.
|
|
355
|
+
|
|
356
|
+
**Disclosure.** Chrome colors come from `--juice-disclosure-*` roles bound by the active theme. `[disclosure]` is a standalone APG disclosure: one `[disclosure-trigger]` and one `[disclosure-panel]`. Pair the panel with `aria-controls`, or place it as the next sibling of the trigger. Expanded state is `aria-expanded` on the trigger plus native `hidden` and `aria-hidden` on the panel. The runtime never writes layout `content=`. Orphans outside `[disclosure]` are ignored. Click toggles. Enter and Space toggle non-button triggers. Escape collapses the focused or last-opened disclosure and yields to an open modal, drawer, or popover. There is no exclusive group and no arrow roving. It is not an accordion (`[accordion]` / `[accordion-item]` stays multi-item and multi-open) and not a layered overlay. Disclosure is the twentieth Emerging auto-enhance runtime. Shipped in 0.9.2. No Sig Disclosure factory.
|
|
357
|
+
|
|
358
|
+
**Spinner.** Chrome colors come from `--juice-spinner-*` roles bound by the active theme. `[spinner]` is a standalone indeterminate busy indicator. The ring is `::before` on the host. Optional `[spinner-label]` is author text. CSS owns the spin (`juice-spinner-spin`). `prefers-reduced-motion` stops that animation and leaves the indicator. The runtime auto-enhances `[spinner]` (`sync` / `show` / `hide` / `isShown`): a shown host is `role="status"` and `aria-busy="true"`, and `hide` sets native `hidden` and clears both so a hidden spinner does not announce as busy. The runtime does not invent `aria-label` when there is no visible label, and it does not copy a label into a name. Authors supply the accessible name when there is no visible `[spinner-label]`. It is not a progress bar and not a disclosure. No value, no keyboard, no Escape, no focus trap, and no Sig Spinner factory. Inline status chrome: no overlay. Spinner is the twenty-first Emerging auto-enhance runtime. Shipped in 0.9.2.
|
|
359
|
+
|
|
360
|
+
**Select.** Chrome colors come from `--juice-select-*` roles bound by the active theme. `<select select>` is a styled native dropdown. Optional `[select-label]` is a visible label. The chevron is a `background-image`. `[multiple]` and `size` listboxes stay native selects. `[multiple]` and `size` other than `1` drop the chevron. The open list stays the platform popup. The runtime auto-enhances `<select select>` (`sync`): a visible associated label, wrapping label, or `[select-label]` names the control when the author has not set `aria-label` or `aria-labelledby`. A separate label is referenced with `aria-labelledby`. A wrapping label is copied into `aria-label` as its visible text excluding the select, so the selected option is not part of the name. Hidden or empty labels are skipped. No name is invented when nothing visible is there. Change events and the keyboard stay native. It is not a combobox. No keyboard rewrite, no Escape, no focus trap, and no Sig Select factory. Inline field chrome: no overlay, no listbox. Select is the twenty-second Emerging auto-enhance runtime. Shipped in 0.9.2.
|
|
361
|
+
|
|
362
|
+
**Input.** Chrome colors come from `--juice-input-*` roles bound by the active theme. `<input input>` is a styled native text field. Optional `[input-label]` is a visible label. Text-like controls only: missing type, empty type, text, email, password, search, tel, url, and number. Checkbox, radio, range, file, date, time, datetime-local, month, week, color, hidden, button, submit, reset, and image are ignored. The runtime auto-enhances `<input input>` (`sync`): a visible associated label, wrapping label, or `[input-label]` names the control when the author has not set `aria-label` or `aria-labelledby`. A separate label is referenced with `aria-labelledby`. A wrapping label is copied into `aria-label` as its visible text excluding the input's own value. Hidden or empty labels are skipped. No name is invented when nothing visible is there. Typing, change, and the keyboard stay native. It is not a combobox and not a select. Textarea and the field wrapper are not this runtime. No mask, no validation engine, no floating label, no keyboard rewrite, no Escape, no focus trap, and no Sig Input factory. Inline field chrome: no overlay. Input is the twenty-third Emerging auto-enhance runtime. Shipped in 0.9.2.
|
|
363
|
+
|
|
364
|
+
**Textarea.** Chrome colors come from `--juice-textarea-*` roles bound by the active theme. `<textarea textarea>` is a styled native multiline field. Optional `[textarea-label]` is a visible label. The runtime auto-enhances `<textarea textarea>` (`sync`): a visible associated label, wrapping label, or `[textarea-label]` names the control when the author has not set `aria-label` or `aria-labelledby`. A separate label is referenced with `aria-labelledby`. A wrapping label is copied into `aria-label` as its visible text excluding the textarea's own value. Hidden or empty labels are skipped. No name is invented when nothing visible is there. Typing, change, and the keyboard stay native. It is not an input, not a select, and not a combobox. The field wrapper is not this runtime. No auto-grow, no character count, no validation, no floating label, no keyboard rewrite, no Escape, no focus trap, and no Sig Textarea factory. Inline field chrome: no overlay. Textarea is the twenty-fourth Emerging auto-enhance runtime. Shipped in 0.9.2.
|
|
365
|
+
|
|
366
|
+
**Field.** Chrome colors come from `--juice-field-*` roles bound by the active theme. `[field]` is a wrapper around a control (`sync`). Optional `[field-label]`, `[field-help]`, and `[field-error]` are parts. `[invalid]` paints the wrapper border. The first input, textarea, or select inside the wrapper is described by visible `[field-help]` and `[field-error]` when the author has not set `aria-describedby`, and `[invalid]` sets `aria-invalid="true"` when the author has not set it. Hidden or empty help and error text are skipped, and missing ids are added only for parts the runtime references. Author `aria-describedby` and `aria-invalid` are kept. Clearing `[invalid]`, removing a part, or calling `destroy` removes only what the runtime wrote. `[field-label]` is chrome only. Naming stays with the input, textarea, and select runtimes. Typing, change, and the keyboard stay native. It is not a validation engine, not a floating label, and not a restyle of input, textarea, select, or combobox. No focus trap, no Escape, and no Sig Field factory. Inline wrapper chrome: no overlay. Field is the twenty-fifth Emerging auto-enhance runtime. Shipped in 0.9.2.
|
|
367
|
+
|
|
368
|
+
**Icon button.** Square `[icon-button]` on button chrome (`sync` / `toggle` / `getState`). `[toggle]` keeps `aria-pressed` and `[pressed]` in sync. Disabled hosts do not flip. A missing accessible name warns once in development. `title` does not count. No name is invented. It is not a switch and not a checkbox. No focus trap, no Escape, and no Sig IconButton factory. `bind` on current Sig accepts `icon-button`. The published npm 0.9.2 package does not export this runtime, so binding it there throws. Icon button is the twenty-sixth Emerging auto-enhance runtime and is on master, not in the published npm 0.9.2 release.
|
|
369
|
+
|
|
370
|
+
**Avatar.** Initials-or-photo mark (`[avatar]`, `sync` / `getState`). A broken, empty, or already-failed image sets `[fallback]` and hides the image. A later load clears both. An empty `src` with a real `srcset` waits. `getState()` is `{ loaded, fallback, hasImage }`. `destroy()` keeps the fallback. The runtime does not touch `alt`, labels, or initials. `[avatar-more]` stays plain text. It is not a badge and not `[skeleton="circle"]`. No keyboard, no Escape, and no Sig Avatar factory. `bind` on current Sig accepts `avatar`. The published npm 0.9.2 package does not export this runtime, so binding it there throws. Avatar is the twenty-seventh Emerging auto-enhance runtime and is on master, not in the published npm 0.9.2 release.
|
|
371
|
+
|
|
372
|
+
**Table.** Native `<table table>` grid (`createTable` / `sync` / `getState`). `th[sortable]` cycles ascending, descending, and none, sets `aria-sort`, and reorders each `tbody`. `column` is null when direction is none. A canceled `juice:sort` updates state without reordering. `cellIndex` is not a visual column. No Sig Table factory. `bind` on current Sig accepts `table`. The published npm 0.9.2 package does not export this runtime, so binding it there throws. Table is the twenty-eighth Emerging auto-enhance runtime and is on master, not in the published npm 0.9.2 release.
|
|
373
|
+
|
|
374
|
+
**Pressable.** Transient press on `[pressable]` (`createPressable` / `sync` / `getState`). Primary pointerdown sets `[pressed]` until pointerup, pointercancel, pointerleave, a move outside the host, lostpointercapture, or blur. Enter and Space do the same while held, including on a native button. Enter is not `preventDefault`'d, so a native click still fires. Space is `preventDefault`'d on a custom button-like host (`role="button"`, and `switch`, `checkbox`, `radio`, `menuitem`, `menuitemcheckbox`, `menuitemradio`, `option`, `tab`, `treeitem`) that is not a native control which already owns Space (`button`, any `input`, `textarea`, `select`, `summary`, or contenteditable). A move past the slop (default 10px, `[pressable-slop]` or `moveSlop`) or a scroll on the host or an ancestor cancels the press and the long-press timer. `[pressable-longpress]` arms `juice:longpress` (default 500ms, a numeric value or `longPressDelay`). If that event is not canceled, the following click is suppressed once. Disabled hosts (`:disabled`, `[disabled]`, `[aria-disabled="true"]`) do not press. `[icon-button][toggle]` and any host with `aria-pressed` keep their latched `[pressed]`; this runtime does not write that attribute there. `getState()` is `{ pressed, longPressed }`. It is not a toggle and not an icon button. Reduced motion stays in CSS. No Sig Pressable factory. `bind` does not name pressable or touchable-row yet. Pressable is the twenty-ninth Emerging auto-enhance runtime and is on master, not in the published npm 0.9.2 release. See [Pressable](../../docs/juice/juice-pressable.md).
|
|
375
|
+
|
|
376
|
+
**Touchable row.** 44px row on `[touchable-row]` (`createTouchableRow` / `sync` / `getState`). Hosts are `a`, `button`, `li`, and `div`. `dense` tightens padding and gap and keeps the 44px minimum. `chevron` draws the disclosure mark with `::after`. `undivided` drops the hairline on that boundary. `[touchable-row~="select"]` toggles `[selected]` plus `aria-selected`, or `aria-current` on a link or `role="link"`. Sibling rows stay selected. `[touchable-row~="activate"]` and `[pressable]` add `role="button"` and `tabindex="0"` on a non-native host when the author has not set them. Enter and Space on an `li` or `div` dispatch one click. Enter is not `preventDefault`'d. Space is, on those hosts, so the page does not scroll. Native `a` and `button` keep the platform click. A trailing button, switch, or icon button does not activate the row. A `[pressable-longpress]` that is not canceled suppresses the click, so the row does not select. Canceling `juice:longpress` still selects. `getState()` is `{ selected, disabled }`. Disabled hosts are ignored. There is no motion role. No Sig TouchableRow factory. `bind` does not name pressable or touchable-row yet. Touchable row is the thirtieth Emerging auto-enhance runtime and is on master, not in the published npm 0.9.2 release. See [Touchable row](../../docs/juice/juice-touchable-row.md).
|
|
377
|
+
|
|
378
|
+
### CSS-only chrome
|
|
379
|
+
|
|
380
|
+
These are not runtimes. They do not auto-enhance, they do not dispatch `juice:change`, and they are not part of the thirty.
|
|
381
|
+
|
|
382
|
+
**Skeleton.** `[skeleton]` is a loading placeholder (boolean and `skeleton="rect"` are the rectangle, `skeleton="text"` is a line, `skeleton="circle"` is a circle). `[lines="1"` through `"8"]` or stacked element children supply the lines. A `width` on the last child shortens it. `[scale="sm"|"lg"]` steps the shape. `[static]` and `prefers-reduced-motion` remove the sheen and keep the base. Roles are `--juice-skeleton-*` on core. Color is restated on `[theme]` (inherited ink mixed into the muted surface). The highlight is a translucent white sheen. Tune `--juice-skeleton-highlight` on a pale surface. Shipped themes are not required to bind the roles. Copy stays in the accessibility tree and does not paint. Authors own `aria-busy` on the loading region. On master, not in the published npm 0.9.2 release. See [Skeleton](../../docs/juice/juice-skeleton.md).
|
|
383
|
+
|
|
384
|
+
**List.** `[list]` on `ul`, `ol`, or `div` stacks rows (`:where(ul, ol, div)[list]`, so `<input list>` is left alone). `[divided]` is a hairline between direct children. `[dense]` tightens row padding and the slot margin and does not change the stack gap. `[list-item]` holds `[list-leading]`, `[list-content]`, `[list-secondary]`, and `[list-trailing]`. `[leading]` stays letter-spacing. An `a` or `button` row hovers, presses, and takes a 2px `currentColor` `:focus-visible` outline, offset 2px. `[selected]` and `aria-current` other than `"false"` share the selected wash. Disabled interactive rows are `opacity: 0.5`. `[selected]` is visual only. Color roles are `--juice-list-*` mixes of `currentColor`, restated on `[theme]`. Layout roles stay on `:root`. Shipped themes are not required to bind them. Background and color use `--juice-motion-duration-fast` and `--juice-motion-ease-standard`, and `prefers-reduced-motion` sets `transition: none`. On master, not in the published npm 0.9.2 release. See [List](../../docs/juice/juice-list.md).
|
|
385
|
+
|
|
386
|
+
**Badge.** `[badge]` is a pill (`inline-flex`, radius `999px`, `0.8125rem` at weight 600). `[badge="square"]` uses radius `0.375rem`. `[badge="ribbon"]` is absolutely positioned (`top: -0.75rem`, centered). There is no `[scale]`. Color roles are `--juice-badge-bg` (currentColor at 1%), `--juice-badge-ink` (`currentColor`), and `--juice-badge-border` (currentColor at 24%), on `:root` and again on `[theme]`. Layout roles stay on `:root`. Shipped themes are not required to bind them. Outside `[cta]`, KiwiPress still paints the default, `[warm]`, ribbon, and `[wizard-header] [brand] [badge]`. `[card="pricing"]` is the positioned parent for a ribbon. `[dev-hero-header] > [badge]` switches that child to `inline-block`. The base layout shipped in npm 0.9.2. The roles are on master and are not in that cut. See [Badge](../../docs/juice/juice-badge.md).
|
|
387
|
+
|
|
388
|
+
**Safe area.** `[safe-area]` pads a host clear of the notch and the home indicator. Boolean `[safe-area]` and any value other than `top`, `bottom`, `x`, or `y` pad all four edges. `x` is left and right. `y` is top and bottom. Both are physical. Each edge is `max(var(--juice-safe-area-pad), env(safe-area-inset-*, 0px))`. `--juice-safe-area-pad` is `1rem` on `:root` only and is not restated on `[theme]`. Shipped themes are not required to bind it. The viewport meta tag needs `viewport-fit=cover`. There is no `[safe-area-margin]`. On master, not in the published npm 0.9.2 release. See [Safe area](../../docs/juice/juice-safe-area.md).
|
|
389
|
+
|
|
390
|
+
## Layout
|
|
391
|
+
|
|
392
|
+
Layout primitives are `stack`, `row`, `grid`, `gap`, and `span`. The [quick start](#quick-start) markup uses `stack`, `gap`, `padding`, `font`, `fontColor`, `bgColor`, and `hover`. See [Layout](../../docs/juice/juice-layout.md).
|
|
393
|
+
|
|
394
|
+
## Responsive behavior
|
|
395
|
+
|
|
396
|
+
Built-in breakpoints, `row` collapse, and scaled spacing are documented in [Responsive reference](../../docs/juice/juice-responsive-reference.md).
|
|
397
|
+
|
|
398
|
+
## Surfaces
|
|
399
|
+
|
|
400
|
+
Beta-stable: `surfaceTone="soft|strong|muted"`, `borderStrength="soft|bold"`, `blur="sm|md"`, `shadowTone="cool|warm"`, `overlay="frost|tint"`, and `variant="monochromatic|glass|tinted"`. Themes bind `--juice-surface-*`, `--juice-border-strength-*`, `--juice-shadow-tone-*`, and `--juice-overlay-*` roles. Variant recipes compose those same roles. Standalone blur uses fixed `6px` / `16px` lengths. See [Surfaces](../../docs/juice/juice-surfaces.md).
|
|
401
|
+
|
|
402
|
+
## Motion
|
|
403
|
+
|
|
404
|
+
Motion is Beta. Use the `motion` attribute for animations (for example `motion="fade.in"`, `motion="spin::fast"`). See [Animations](../../docs/juice/juice-animations.md).
|
|
405
|
+
|
|
406
|
+
## Package surface
|
|
407
|
+
|
|
408
|
+
The production package surface is intentionally small. The stable consumer-facing entrypoints are:
|
|
409
|
+
|
|
410
|
+
- `@citrusworx/juiceui` (`.`)
|
|
411
|
+
- `@citrusworx/juiceui/styles` (`./styles`, core CSS only)
|
|
412
|
+
- `@citrusworx/juiceui/styles/themes/<id>` (`./styles/themes/<id>`, per-theme CSS)
|
|
413
|
+
- the built artifacts in `dist/`
|
|
414
|
+
|
|
415
|
+
`package.json` also exports `./themes/<id>.css`. That path is the same file as `dist/themes/<id>.css`.
|
|
416
|
+
|
|
417
|
+
### Built files
|
|
418
|
+
|
|
419
|
+
If you are hosting Juice assets yourself, the main built files are:
|
|
420
|
+
|
|
421
|
+
- `dist/index.css` (core)
|
|
422
|
+
- `dist/themes/aquaflux.css`, `dist/themes/kiwipress.css`, `dist/themes/citrusmint.css`, `dist/themes/tide.css`, `dist/themes/retro-afterburn.css`, `dist/themes/retro-arcade-glow.css`, `dist/themes/retro-boardwalk.css`, `dist/themes/retro-denim-dial.css`, `dist/themes/retro-forest-radio.css`, `dist/themes/retro-orchard-club.css`, `dist/themes/retro-poolside-pop.css`, `dist/themes/retro-signal-garden.css`, `dist/themes/retro-sunset-motel.css`, `dist/themes/retro-violet-parlor.css`
|
|
423
|
+
- `dist/index.js`
|
|
424
|
+
|
|
425
|
+
Load core plus at least one theme CSS file when using `theme="..."` on the root element.
|
|
426
|
+
|
|
427
|
+
There is no first-party Juice CDN. Those `dist/` files are on npm, so jsDelivr and unpkg serve them (verified for `@citrusworx/juiceui@0.9.2`):
|
|
428
|
+
|
|
429
|
+
```html
|
|
430
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.2/dist/index.css" />
|
|
431
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.2/dist/themes/kiwipress.css" />
|
|
432
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.2/dist/index.js"></script>
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
The JS module is optional. Pin a version. You can also copy the same files out of `node_modules/@citrusworx/juiceui/dist/` next to a plain HTML page. unpkg uses the same paths under `https://unpkg.com/@citrusworx/juiceui@0.9.2/`.
|
|
436
|
+
|
|
437
|
+
### What the build contains
|
|
438
|
+
|
|
439
|
+
- compiled CSS output at `dist/index.css`
|
|
440
|
+
- compiled JS output at `dist/index.js`
|
|
441
|
+
- color tokens and swatches
|
|
442
|
+
- Google and Adobe font selectors
|
|
443
|
+
- attribute selectors for color, spacing, width, height, gradients, shadows, and icons
|
|
444
|
+
- layout primitives for `stack`, `row`, `grid`, `gap`, and `span`
|
|
445
|
+
- FontAwesome Free icon integration across the solid, regular, and brands sets
|
|
446
|
+
- CSS-only `[skeleton]`, `[list]`, `[badge]` (base layout in 0.9.2; `--juice-badge-*` roles on master), and `[safe-area]`, described above
|
|
447
|
+
- `[avatar]`, `[table]`, `[pressable]`, and `[touchable-row]` runtimes, on master, not in npm 0.9.2
|
|
448
|
+
|
|
449
|
+
<details>
|
|
450
|
+
<summary>Internal workspace assets</summary>
|
|
451
|
+
|
|
452
|
+
The Juice workspace also contains internal-only material that is not part of the published runtime contract:
|
|
453
|
+
|
|
454
|
+
- `src/native/` playground and experiments
|
|
455
|
+
- `src/templates/` HTML examples
|
|
456
|
+
- `src/tools/` compiler helpers
|
|
457
|
+
- `.mockups/` and `test-results/`
|
|
458
|
+
- local build tooling like `gulp.ts`, `vite.config.ts`, and `juice.config.yaml`
|
|
459
|
+
|
|
460
|
+
Those are useful for monorepo development. They are not part of the public API of `@citrusworx/juiceui`.
|
|
461
|
+
|
|
462
|
+
</details>
|
|
463
|
+
|
|
464
|
+
## Migration
|
|
465
|
+
|
|
466
|
+
`@citrusworx/juiceui/styles` is core only. Older packages put theme identity in that entry. That was a breaking change. Import a theme stylesheet explicitly, then set `theme` on the root, as in [Quick start](#quick-start). The split shipped in 0.4.0.
|
|
467
|
+
|
|
468
|
+
## Browser support
|
|
409
469
|
|
|
410
470
|
Juice currently targets modern evergreen browsers:
|
|
411
471
|
|
|
@@ -417,7 +477,7 @@ Juice currently targets modern evergreen browsers:
|
|
|
417
477
|
|
|
418
478
|
The CSS build runs through `autoprefixer` against that package-level browserslist target, so supported-browser behavior is part of the build contract rather than an assumption.
|
|
419
479
|
|
|
420
|
-
## Asset
|
|
480
|
+
## Asset policy
|
|
421
481
|
|
|
422
482
|
Juice ships a large compiled stylesheet plus the icon assets it references.
|
|
423
483
|
|
|
@@ -456,7 +516,7 @@ That lets an app keep its brand config while still relying on Juice for spacing,
|
|
|
456
516
|
|
|
457
517
|
Config is not required to use Juice. The most stable current entrypoint is still the compiled stylesheet plus the existing attribute system.
|
|
458
518
|
|
|
459
|
-
Generate
|
|
519
|
+
Generate or discover themes directly with:
|
|
460
520
|
|
|
461
521
|
```bash
|
|
462
522
|
yarn workspace @citrusworx/juiceui generate:themes
|
|
@@ -485,6 +545,66 @@ That is the minimum publish gate for Juice right now. It rebuilds the package an
|
|
|
485
545
|
|
|
486
546
|
Release notes and versioning should continue to flow through Changesets. The package changelog is consumer-facing and should describe behavior, package contract changes, and dependency updates in plain language instead of internal-only notes.
|
|
487
547
|
|
|
488
|
-
##
|
|
489
|
-
|
|
490
|
-
Internal project docs live in `docs/juice/`.
|
|
548
|
+
## Learn more
|
|
549
|
+
|
|
550
|
+
Internal project docs live in `docs/juice/`. Start with the course. The pages under it are the lookup set.
|
|
551
|
+
|
|
552
|
+
### Course
|
|
553
|
+
|
|
554
|
+
- [Design systems through Juice](../../docs/juice/course/README.md). Do this first.
|
|
555
|
+
- [See it in 10 minutes](../../docs/juice/course/00-first-look.md)
|
|
556
|
+
|
|
557
|
+
### Using Juice
|
|
558
|
+
|
|
559
|
+
- [Docs index](../../docs/juice/README.md)
|
|
560
|
+
- [Getting started](../../docs/juice/juice-getting-started.md)
|
|
561
|
+
- [Attributes](../../docs/juice/juice-attributes.md)
|
|
562
|
+
- [Layout](../../docs/juice/juice-layout.md)
|
|
563
|
+
- [Styles](../../docs/juice/juice-styles.md)
|
|
564
|
+
- [Responsive reference](../../docs/juice/juice-responsive-reference.md)
|
|
565
|
+
- [Surfaces](../../docs/juice/juice-surfaces.md)
|
|
566
|
+
- [Animations](../../docs/juice/juice-animations.md)
|
|
567
|
+
|
|
568
|
+
### Themes
|
|
569
|
+
|
|
570
|
+
- [Theme authoring](../../docs/juice/juice-theme-authoring.md)
|
|
571
|
+
|
|
572
|
+
### Runtimes
|
|
573
|
+
|
|
574
|
+
- [Runtime behavior](../../docs/juice/juice-runtime-behavior.md#juicechange) (`juice:change` and `getState`)
|
|
575
|
+
- [Sig.js + Juice](../../docs/sigjs/sig-juice-integration.md#runtime-binding)
|
|
576
|
+
- [Navigation](../../docs/juice/juice-navigation-runtime.md)
|
|
577
|
+
- [Accordion](../../docs/juice/juice-accordion-runtime.md)
|
|
578
|
+
- [Tabs](../../docs/juice/juice-tabs-runtime.md)
|
|
579
|
+
- [Modal](../../docs/juice/juice-modal-runtime.md)
|
|
580
|
+
- [Drawer](../../docs/juice/juice-drawer-runtime.md)
|
|
581
|
+
- [Toast](../../docs/juice/juice-toast-runtime.md)
|
|
582
|
+
- [Popover](../../docs/juice/juice-popover-runtime.md)
|
|
583
|
+
- [Wizard](../../docs/juice/juice-wizard-runtime.md)
|
|
584
|
+
- [Tooltip](../../docs/juice/juice-tooltip-runtime.md)
|
|
585
|
+
- [Combobox](../../docs/juice/juice-combobox-runtime.md)
|
|
586
|
+
- [Banner](../../docs/juice/juice-banner-runtime.md)
|
|
587
|
+
- [Menu](../../docs/juice/juice-menu-runtime.md)
|
|
588
|
+
- [Switch](../../docs/juice/juice-switch-runtime.md)
|
|
589
|
+
- [Slider](../../docs/juice/juice-slider-runtime.md)
|
|
590
|
+
- [Checkbox](../../docs/juice/juice-checkbox-runtime.md)
|
|
591
|
+
- [Radio](../../docs/juice/juice-radio-runtime.md)
|
|
592
|
+
- [Breadcrumb](../../docs/juice/juice-breadcrumb-runtime.md)
|
|
593
|
+
- [Progress](../../docs/juice/juice-progress-runtime.md)
|
|
594
|
+
- [Pagination](../../docs/juice/juice-pagination-runtime.md)
|
|
595
|
+
- [Disclosure](../../docs/juice/juice-disclosure-runtime.md)
|
|
596
|
+
- [Spinner](../../docs/juice/juice-spinner-runtime.md)
|
|
597
|
+
- [Select](../../docs/juice/juice-select-runtime.md)
|
|
598
|
+
- [Input](../../docs/juice/juice-input-runtime.md)
|
|
599
|
+
- [Textarea](../../docs/juice/juice-textarea-runtime.md)
|
|
600
|
+
- [Field](../../docs/juice/juice-field-runtime.md)
|
|
601
|
+
- [Icon button](../../docs/juice/juice-icon-button-runtime.md)
|
|
602
|
+
- [Avatar](../../docs/juice/juice-avatar.md)
|
|
603
|
+
- [Table](../../docs/juice/juice-table.md)
|
|
604
|
+
|
|
605
|
+
### CSS-only
|
|
606
|
+
|
|
607
|
+
- [Skeleton](../../docs/juice/juice-skeleton.md)
|
|
608
|
+
- [List](../../docs/juice/juice-list.md)
|
|
609
|
+
- [Badge](../../docs/juice/juice-badge.md)
|
|
610
|
+
- [Safe area](../../docs/juice/juice-safe-area.md)
|