@citrusworx/juiceui 0.9.4 → 0.9.6
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 +73 -89
- package/dist/index.css +385 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1772 -1104
- package/dist/js/juice.d.ts +4 -0
- package/dist/js/src/keyboard-avoider/keyboard-avoider-runtime.d.ts +96 -0
- package/dist/js/src/shared/overlays.d.ts +3 -2
- package/dist/js/src/sheet/sheet-runtime.d.ts +94 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,9 +80,11 @@ Built files are `dist/index.css` (core) and `dist/themes/<id>.css`. Each theme i
|
|
|
80
80
|
|
|
81
81
|
## Components and runtimes
|
|
82
82
|
|
|
83
|
-
The top-level JS entry is
|
|
83
|
+
The top-level JS entry is small. Thirty-two runtimes stay Emerging.
|
|
84
84
|
|
|
85
|
-
Navigation through field (twenty-five
|
|
85
|
+
Navigation through field (twenty-five) shipped in `@citrusworx/juiceui@0.9.2`. Icon button, avatar, and table shipped in 0.9.3. Pressable and touchable row shipped in 0.9.4. Keyboard avoider shipped in 0.9.5. Sheet is the thirty-second, on master, and not in that npm cut.
|
|
86
|
+
|
|
87
|
+
The full index, including how to choose between similar components, is [Runtime behavior](../../docs/juice/juice-runtime-behavior.md#components).
|
|
86
88
|
|
|
87
89
|
### Overlays
|
|
88
90
|
|
|
@@ -90,6 +92,7 @@ Navigation through field (twenty-five runtimes) are in the published `@citruswor
|
|
|
90
92
|
| --- | --- | --- | --- |
|
|
91
93
|
| Modal | `[modal-overlay]` | Dialog. Open and close, Escape, focus trap, one open at a time. | [Modal](../../docs/juice/juice-modal-runtime.md) |
|
|
92
94
|
| 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) |
|
|
95
|
+
| Sheet | `[sheet-overlay]` | Bottom dialog. Detents `peek`, `half`, `full`. The thirty-second runtime. On master, not in npm 0.9.5. Not a `JuiceRuntimeName`. | [Sheet](../../docs/juice/juice-sheet-runtime.md) |
|
|
93
96
|
| 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
97
|
| 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
98
|
| 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) |
|
|
@@ -117,9 +120,9 @@ Navigation through field (twenty-five runtimes) are in the published `@citruswor
|
|
|
117
120
|
| Switch | `[switch]` | APG switch (`toggle` / `check` / `uncheck` / `setChecked`). Not a layered overlay. | [Switch](../../docs/juice/juice-switch-runtime.md) |
|
|
118
121
|
| Slider | `[slider]` | APG slider (`setValue` / `getValue` / `increment` / `decrement`). Not a layered overlay. | [Slider](../../docs/juice/juice-slider-runtime.md) |
|
|
119
122
|
| 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
|
|
121
|
-
| Pressable
|
|
122
|
-
| Touchable row
|
|
123
|
+
| Icon button | `[icon-button]` | Square control on button chrome (`sync` / `toggle` / `getState`). Not a switch and not a checkbox. The twenty-sixth Emerging runtime. Shipped in 0.9.3. | [Icon button](../../docs/juice/juice-icon-button-runtime.md) |
|
|
124
|
+
| Pressable | `[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. Shipped in 0.9.4. | [Pressable](../../docs/juice/juice-pressable.md) |
|
|
125
|
+
| Touchable row | `[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. Shipped in 0.9.4. | [Touchable row](../../docs/juice/juice-touchable-row.md) |
|
|
123
126
|
|
|
124
127
|
### Feedback
|
|
125
128
|
|
|
@@ -141,20 +144,24 @@ Navigation through field (twenty-five runtimes) are in the published `@citruswor
|
|
|
141
144
|
|
|
142
145
|
| Component | Markup | What it is | Docs |
|
|
143
146
|
| --- | --- | --- | --- |
|
|
144
|
-
| Avatar
|
|
145
|
-
| Table
|
|
147
|
+
| Avatar | `[avatar]` | Initials or photo (`sync` / `getState`). Not a badge and not `[skeleton="circle"]`. The twenty-seventh Emerging runtime. Shipped in 0.9.3. | [Avatar](../../docs/juice/juice-avatar.md) |
|
|
148
|
+
| Table | `<table table>` | Sortable grid. The twenty-eighth runtime. Shipped in 0.9.3. | [Table](../../docs/juice/juice-table.md) |
|
|
146
149
|
|
|
147
|
-
###
|
|
150
|
+
### Page chrome
|
|
151
|
+
|
|
152
|
+
| Component | Markup | What it is | Docs |
|
|
153
|
+
| --- | --- | --- | --- |
|
|
154
|
+
| Keyboard avoider | `[keyboard-avoider]` | Inset while the software keyboard is open. The thirty-first runtime. Shipped in 0.9.5. Workspace `@citrusworx/sigjs` **1.1.0** (not published) names it. npm **1.0.0** does not. | [Keyboard avoider](../../docs/juice/juice-keyboard-avoider-runtime.md) |
|
|
148
155
|
|
|
149
|
-
|
|
156
|
+
### Auto-start
|
|
150
157
|
|
|
151
|
-
|
|
158
|
+
Importing `@citrusworx/juiceui` enhances the hooks in the tables above. Most apps need no `init` call.
|
|
152
159
|
|
|
153
160
|
The JS module is optional. Core CSS plus a theme is enough when the page does not use a runtime.
|
|
154
161
|
|
|
155
162
|
### Naming pattern
|
|
156
163
|
|
|
157
|
-
Every runtime exports the same four functions. `<Name>` is the stem
|
|
164
|
+
Every runtime exports the same four functions. `<Name>` is the component stem, such as `Modal` or `KeyboardAvoider`.
|
|
158
165
|
|
|
159
166
|
| Export | What it does |
|
|
160
167
|
| --- | --- |
|
|
@@ -163,7 +170,7 @@ Every runtime exports the same four functions. `<Name>` is the stem: Navigation,
|
|
|
163
170
|
| `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
171
|
| `stop<Name>Runtime()` | Destroys that document-level controller. |
|
|
165
172
|
|
|
166
|
-
Modal shows the four export names. The other
|
|
173
|
+
Modal shows the four export names. The other thirty-one use the same `create` / `init` / `start` / `stop` names. Controller methods differ by runtime.
|
|
167
174
|
|
|
168
175
|
```ts
|
|
169
176
|
import {
|
|
@@ -184,13 +191,26 @@ stopModalRuntime();
|
|
|
184
191
|
|
|
185
192
|
`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`.
|
|
186
193
|
|
|
187
|
-
Icon button, avatar, table, pressable,
|
|
194
|
+
Icon button, avatar, table, pressable, touchable row, keyboard avoider, and sheet export the same four names. Icon button, avatar, and table shipped in 0.9.3. Pressable and touchable row shipped in 0.9.4. Keyboard avoider shipped in 0.9.5. Sheet is on master and is not in that npm cut.
|
|
188
195
|
|
|
189
196
|
### `juice:change` and `getState`
|
|
190
197
|
|
|
191
|
-
Interactive runtimes dispatch a bubbling `juice:change`
|
|
198
|
+
Interactive runtimes dispatch a bubbling `juice:change` from the widget host when observable state changes. `detail` is `{ runtime, state }`. `getState()` reads that shape.
|
|
199
|
+
|
|
200
|
+
Select, input, and textarea publish through native `input` and `change`. They still expose `getState()`.
|
|
201
|
+
|
|
202
|
+
The contract covers all thirty-two runtimes. `juice:change` and `JUICE_CHANGE_EVENT` shipped in 0.9.3. Pressable and touchable row dispatch that contract from 0.9.4. Keyboard avoider dispatches it from 0.9.5. Sheet dispatches it on master and is not in the 0.9.5 npm cut.
|
|
203
|
+
|
|
204
|
+
npm `@citrusworx/sigjs` **1.0.0** and **0.7.2** `bind` names twenty-eight runtimes, through `table`. Workspace `@citrusworx/sigjs` **1.1.0** (not published) names thirty-one, through keyboard-avoider. `sheet` is not a `JuiceRuntimeName`.
|
|
205
|
+
|
|
206
|
+
- `icon-button`, `avatar`, and `table` are `JuiceRuntimeName` values on npm **1.0.0** and on the workspace tree.
|
|
207
|
+
- Pressable, touchable row, and keyboard avoider are `JuiceRuntimeName` values on workspace **1.1.0** and are not names on npm **1.0.0**. Sheet is not a name on either tree.
|
|
208
|
+
- `@citrusworx/sigjs@0.7.0` and `@citrusworx/sigjs@0.7.1` stop at twenty-five names, through `textarea`.
|
|
209
|
+
- Binding `icon-button`, `avatar`, or `table` against `@citrusworx/juiceui@0.9.1` or `@citrusworx/juiceui@0.9.2` throws. Those cuts do not export their start functions. The three exports shipped in 0.9.3. Pressable and touchable row shipped in 0.9.4. Keyboard avoider shipped in 0.9.5.
|
|
210
|
+
|
|
211
|
+
Juice works without Sig. The optional adapter is `@citrusworx/sigjs/juice` only.
|
|
192
212
|
|
|
193
|
-
|
|
213
|
+
See [`juice:change`](../../docs/juice/juice-runtime-behavior.md#juicechange) and [Sig.js + Juice](../../docs/sigjs/sig-juice-integration.md#runtime-binding).
|
|
194
214
|
|
|
195
215
|
### Markup examples
|
|
196
216
|
|
|
@@ -313,79 +333,26 @@ Interactive runtimes dispatch a bubbling `juice:change` event from the widget ho
|
|
|
313
333
|
|
|
314
334
|
### Notes
|
|
315
335
|
|
|
316
|
-
|
|
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.
|
|
336
|
+
Open and closed state uses native `hidden`, not layout `content="active"` or `content="hidden"`.
|
|
339
337
|
|
|
340
|
-
|
|
338
|
+
Nav hooks are `nav[type="bar"]`, `nav[type="links"]`, `nav[type="mobile"]`, and `nav[type="sidebar"]`.
|
|
341
339
|
|
|
342
|
-
|
|
340
|
+
All 14 shipped themes bind `--juice-accordion-*` and `--juice-tabs-*`.
|
|
343
341
|
|
|
344
|
-
|
|
342
|
+
Attributes, keyboard behavior, and theme roles for each component are on the page linked from the tables above.
|
|
345
343
|
|
|
346
|
-
|
|
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).
|
|
344
|
+
[Choosing between similar components](../../docs/juice/juice-runtime-behavior.md#choosing-between-similar-components).
|
|
377
345
|
|
|
378
346
|
### CSS-only chrome
|
|
379
347
|
|
|
380
|
-
These
|
|
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).
|
|
348
|
+
These do not auto-enhance, do not dispatch `juice:change`, and are not part of the thirty-two runtimes.
|
|
383
349
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
350
|
+
| Chrome | Hook | Release | Docs |
|
|
351
|
+
| --- | --- | --- | --- |
|
|
352
|
+
| Skeleton | `[skeleton]` | Shipped in 0.9.3 | [Skeleton](../../docs/juice/juice-skeleton.md) |
|
|
353
|
+
| List | `[list]` | Shipped in 0.9.3 | [List](../../docs/juice/juice-list.md) |
|
|
354
|
+
| Badge | `[badge]` | Layout shipped in npm 0.9.2. `--juice-badge-*` roles shipped in 0.9.3 | [Badge](../../docs/juice/juice-badge.md) |
|
|
355
|
+
| Safe area | `[safe-area]` | Shipped in 0.9.3 | [Safe area](../../docs/juice/juice-safe-area.md) |
|
|
389
356
|
|
|
390
357
|
## Layout
|
|
391
358
|
|
|
@@ -397,7 +364,11 @@ Built-in breakpoints, `row` collapse, and scaled spacing are documented in [Resp
|
|
|
397
364
|
|
|
398
365
|
## Surfaces
|
|
399
366
|
|
|
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.
|
|
367
|
+
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.
|
|
368
|
+
|
|
369
|
+
Variant recipes compose those same roles. Standalone blur uses fixed `6px` / `16px` lengths.
|
|
370
|
+
|
|
371
|
+
See [Surfaces](../../docs/juice/juice-surfaces.md).
|
|
401
372
|
|
|
402
373
|
## Motion
|
|
403
374
|
|
|
@@ -419,20 +390,33 @@ The production package surface is intentionally small. The stable consumer-facin
|
|
|
419
390
|
If you are hosting Juice assets yourself, the main built files are:
|
|
420
391
|
|
|
421
392
|
- `dist/index.css` (core)
|
|
422
|
-
- `dist/themes/aquaflux.css
|
|
393
|
+
- `dist/themes/aquaflux.css`
|
|
394
|
+
- `dist/themes/kiwipress.css`
|
|
395
|
+
- `dist/themes/citrusmint.css`
|
|
396
|
+
- `dist/themes/tide.css`
|
|
397
|
+
- `dist/themes/retro-afterburn.css`
|
|
398
|
+
- `dist/themes/retro-arcade-glow.css`
|
|
399
|
+
- `dist/themes/retro-boardwalk.css`
|
|
400
|
+
- `dist/themes/retro-denim-dial.css`
|
|
401
|
+
- `dist/themes/retro-forest-radio.css`
|
|
402
|
+
- `dist/themes/retro-orchard-club.css`
|
|
403
|
+
- `dist/themes/retro-poolside-pop.css`
|
|
404
|
+
- `dist/themes/retro-signal-garden.css`
|
|
405
|
+
- `dist/themes/retro-sunset-motel.css`
|
|
406
|
+
- `dist/themes/retro-violet-parlor.css`
|
|
423
407
|
- `dist/index.js`
|
|
424
408
|
|
|
425
409
|
Load core plus at least one theme CSS file when using `theme="..."` on the root element.
|
|
426
410
|
|
|
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.
|
|
411
|
+
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.5`):
|
|
428
412
|
|
|
429
413
|
```html
|
|
430
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.
|
|
431
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.
|
|
432
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.
|
|
414
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.5/dist/index.css" />
|
|
415
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.5/dist/themes/kiwipress.css" />
|
|
416
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.5/dist/index.js"></script>
|
|
433
417
|
```
|
|
434
418
|
|
|
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.
|
|
419
|
+
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.5/`.
|
|
436
420
|
|
|
437
421
|
### What the build contains
|
|
438
422
|
|
|
@@ -443,8 +427,8 @@ The JS module is optional. Pin a version. You can also copy the same files out o
|
|
|
443
427
|
- attribute selectors for color, spacing, width, height, gradients, shadows, and icons
|
|
444
428
|
- layout primitives for `stack`, `row`, `grid`, `gap`, and `span`
|
|
445
429
|
- 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
|
|
447
|
-
- `[avatar]
|
|
430
|
+
- CSS-only `[skeleton]`, `[list]`, `[badge]` (base layout in 0.9.2; `--juice-badge-*` roles in 0.9.3), and `[safe-area]` (shipped in 0.9.3), described above
|
|
431
|
+
- `[avatar]` and `[table]` runtimes shipped in 0.9.3. `[pressable]` and `[touchable-row]` shipped in 0.9.4
|
|
448
432
|
|
|
449
433
|
<details>
|
|
450
434
|
<summary>Internal workspace assets</summary>
|