@citrusworx/juiceui 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,7 +28,10 @@ Those are useful for monorepo development, but they are not part of the public A
28
28
  ## Install
29
29
 
30
30
  ```bash
31
+ npm install @citrusworx/juiceui
32
+ pnpm add @citrusworx/juiceui
31
33
  yarn add @citrusworx/juiceui
34
+ bun add @citrusworx/juiceui
32
35
  ```
33
36
 
34
37
  ## Use the stylesheet
@@ -97,6 +100,50 @@ import {
97
100
  initPopover,
98
101
  startPopoverRuntime,
99
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,
100
147
  createNavigation,
101
148
  initNavigation,
102
149
  startNavigationRuntime,
@@ -107,8 +154,7 @@ import {
107
154
 
108
155
  The top-level JS entrypoint is intentionally small. Those named exports are the stable runtime API Juice currently promises.
109
156
 
110
- Importing that entry auto-starts the navigation, accordion, tabs, modal, drawer, toast, and popover runtimes in the browser. Valid `[accordion]`, `[tabs]`, `[modal-overlay]`, `[drawer-overlay]`, `[toast-region]`, and `[popover-root]` markup work without app init. See [docs/juice/juice-accordion-runtime.md](../../docs/juice/juice-accordion-runtime.md), [docs/juice/juice-tabs-runtime.md](../../docs/juice/juice-tabs-runtime.md), [docs/juice/juice-modal-runtime.md](../../docs/juice/juice-modal-runtime.md), [docs/juice/juice-drawer-runtime.md](../../docs/juice/juice-drawer-runtime.md), [docs/juice/juice-toast-runtime.md](../../docs/juice/juice-toast-runtime.md), and [docs/juice/juice-popover-runtime.md](../../docs/juice/juice-popover-runtime.md).
111
-
157
+ Importing that entry auto-starts the navigation, accordion, tabs, modal, drawer, toast, popover, wizard, tooltip, combobox, banner, menu, switch, slider, checkbox, radio, breadcrumb, and progress runtimes in the browser. Valid `[accordion]`, `[tabs]`, `[modal-overlay]`, `[drawer-overlay]`, `[toast-region]`, `[popover-root]`, `[wizard-shell]`, `[tooltip-root]`, `[combobox]`, `[banner]`, `[menu-root]`, `[switch]`, `[slider]`, `[checkbox]`, `[radiogroup]`, `[breadcrumb]`, and `[progress]` markup work without app init. See [docs/juice/juice-accordion-runtime.md](../../docs/juice/juice-accordion-runtime.md), [docs/juice/juice-tabs-runtime.md](../../docs/juice/juice-tabs-runtime.md), [docs/juice/juice-modal-runtime.md](../../docs/juice/juice-modal-runtime.md), [docs/juice/juice-drawer-runtime.md](../../docs/juice/juice-drawer-runtime.md), [docs/juice/juice-toast-runtime.md](../../docs/juice/juice-toast-runtime.md), [docs/juice/juice-popover-runtime.md](../../docs/juice/juice-popover-runtime.md), [docs/juice/juice-wizard-runtime.md](../../docs/juice/juice-wizard-runtime.md), [docs/juice/juice-tooltip-runtime.md](../../docs/juice/juice-tooltip-runtime.md), [docs/juice/juice-combobox-runtime.md](../../docs/juice/juice-combobox-runtime.md), [docs/juice/juice-banner-runtime.md](../../docs/juice/juice-banner-runtime.md), [docs/juice/juice-menu-runtime.md](../../docs/juice/juice-menu-runtime.md), [docs/juice/juice-switch-runtime.md](../../docs/juice/juice-switch-runtime.md), [docs/juice/juice-slider-runtime.md](../../docs/juice/juice-slider-runtime.md), [docs/juice/juice-checkbox-runtime.md](../../docs/juice/juice-checkbox-runtime.md), [docs/juice/juice-radio-runtime.md](../../docs/juice/juice-radio-runtime.md), [docs/juice/juice-breadcrumb-runtime.md](../../docs/juice/juice-breadcrumb-runtime.md), and [docs/juice/juice-progress-runtime.md](../../docs/juice/juice-progress-runtime.md). Banner is an inline alert / callout (`show` / `dismiss`, `[banner-close]`), not a toast stack. Menu is an APG menu button (`open` / `close` / `toggle` / `select`), not a popover and not a menubar. Switch is an APG switch (`toggle` / `check` / `uncheck` / `setChecked`), not a layered overlay. Slider is an APG slider (`setValue` / `getValue` / `increment` / `decrement`), not a layered overlay. Checkbox is an APG checkbox (`toggle` / `check` / `uncheck` / `setChecked`), not a layered overlay. Radio is an APG radio group (`select` / `getChecked`), not a layered overlay. Breadcrumb is a light trail (`sync` / `setCurrent`), not a router. Progress is an APG-inspired progressbar (`setValue` / `getValue` / `setIndeterminate`), not a slider. Switch, slider, checkbox, radio, breadcrumb, and progress are on master and are not in the 0.8.0 npm cut. Checkbox and radio are two runtimes.
112
158
  ## Use the built files directly
113
159
 
114
160
  If you are hosting Juice assets yourself, the main built files are:
@@ -119,6 +165,16 @@ If you are hosting Juice assets yourself, the main built files are:
119
165
 
120
166
  Load core plus at least one theme CSS file when using `theme="..."` on the root element.
121
167
 
168
+ There is no first-party Juice CDN. Those `dist/` files are on npm, so jsDelivr and unpkg serve them (verified for `@citrusworx/juiceui@0.8.0`):
169
+
170
+ ```html
171
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.8.0/dist/index.css" />
172
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.8.0/dist/themes/kiwipress.css" />
173
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.8.0/dist/index.js"></script>
174
+ ```
175
+
176
+ 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.
177
+
122
178
  ## Example
123
179
 
124
180
  ```html
@@ -162,6 +218,17 @@ Juice keeps styling attribute-first, but interactive patterns still need accessi
162
218
  - 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).
163
219
  - 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).
164
220
  - 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).
221
+ - 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).
222
+ - 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).
223
+ - 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).
224
+ - 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).
225
+ - 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).
226
+ - 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).
227
+ - 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).
228
+ - 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).
229
+ - 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).
230
+ - 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.
231
+ - 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.
165
232
 
166
233
  ```html
167
234
  <div tabs name="settings">
@@ -230,6 +297,54 @@ Juice keeps styling attribute-first, but interactive patterns still need accessi
230
297
  <div popover-body>Account details live on this page.</div>
231
298
  </div>
232
299
  </div>
300
+
301
+ <div wizard-shell name="onboard">
302
+ <ol steps>
303
+ <li step="active" data-step="welcome">Welcome</li>
304
+ <li step="pending" data-step="plan">Plan</li>
305
+ </ol>
306
+ <main wizard-content>
307
+ <section step-page="welcome">Welcome page</section>
308
+ <section step-page="plan" hidden>Plan page</section>
309
+ <div step-nav>
310
+ <button type="button" wizard-prev>Back</button>
311
+ <button type="button" wizard-next>Continue</button>
312
+ </div>
313
+ </main>
314
+ </div>
315
+
316
+ <button type="button" aria-describedby="demo-tip">Save</button>
317
+ <div tooltip-root id="demo-tip" hidden>
318
+ <div tooltip-panel role="tooltip">Saves the current draft.</div>
319
+ </div>
320
+
321
+ <label for="fruit-input">Fruit</label>
322
+ <div combobox name="fruit">
323
+ <input id="fruit-input" combobox-input type="text" />
324
+ <button type="button" combobox-trigger aria-label="Show fruits"></button>
325
+ <ul combobox-list hidden>
326
+ <li combobox-option>Apple</li>
327
+ <li combobox-option>Banana</li>
328
+ </ul>
329
+ </div>
330
+
331
+ <div banner="full" banner-tone="warning" name="maintenance" banner-persist="session">
332
+ <div banner-body>Scheduled maintenance tonight.</div>
333
+ <button type="button" banner-close aria-label="Dismiss">×</button>
334
+ </div>
335
+
336
+ <div menu-root>
337
+ <button type="button" menu-button aria-haspopup="menu" aria-controls="file-menu">File</button>
338
+ <div menu id="file-menu">
339
+ <button type="button" menuitem>New</button>
340
+ <button type="button" menuitem>Open…</button>
341
+ <div menu-separator></div>
342
+ <div menu-label>Recent</div>
343
+ <button type="button" menuitem="active">Report.pdf</button>
344
+ </div>
345
+ </div>
346
+
347
+ <button type="button" switch aria-label="Notifications"></button>
233
348
  ```
234
349
 
235
350
  ## Browser Support