@citrusworx/juiceui 0.8.0 → 0.9.1

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
@@ -50,7 +53,7 @@ import "@citrusworx/juiceui/styles/themes/aquaflux";
50
53
 
51
54
  ```html
52
55
  <body theme="aquaflux">
53
- <!-- or theme="kiwipress" | theme="citrusmint" | theme="tide" -->
56
+ <!-- or theme="kiwipress" | theme="citrusmint" | theme="tide" | theme="retro-afterburn" | theme="retro-arcade-glow" | theme="retro-boardwalk" | theme="retro-denim-dial" | theme="retro-forest-radio" | theme="retro-orchard-club" | theme="retro-poolside-pop" | theme="retro-signal-garden" | theme="retro-sunset-motel" | theme="retro-violet-parlor" -->
54
57
  </body>
55
58
  ```
56
59
 
@@ -117,6 +120,34 @@ import {
117
120
  initMenu,
118
121
  startMenuRuntime,
119
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,
120
151
  createNavigation,
121
152
  initNavigation,
122
153
  startNavigationRuntime,
@@ -127,18 +158,27 @@ import {
127
158
 
128
159
  The top-level JS entrypoint is intentionally small. Those named exports are the stable runtime API Juice currently promises.
129
160
 
130
- Importing that entry auto-starts the navigation, accordion, tabs, modal, drawer, toast, popover, wizard, tooltip, combobox, banner, and menu runtimes in the browser. Valid `[accordion]`, `[tabs]`, `[modal-overlay]`, `[drawer-overlay]`, `[toast-region]`, `[popover-root]`, `[wizard-shell]`, `[tooltip-root]`, `[combobox]`, `[banner]`, and `[menu-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), [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), and [docs/juice/juice-banner-runtime.md](../../docs/juice/juice-banner-runtime.md). Banner is an inline alert / callout (`show` / `dismiss`, `[banner-close]`), not a toast stack.
131
-
161
+ Importing that entry auto-starts the navigation, accordion, tabs, modal, drawer, toast, popover, wizard, tooltip, combobox, banner, menu, switch, slider, checkbox, radio, breadcrumb, progress, and pagination 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]`, `[progress]`, and `[pagination]` 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), [docs/juice/juice-progress-runtime.md](../../docs/juice/juice-progress-runtime.md), and [docs/juice/juice-pagination-runtime.md](../../docs/juice/juice-pagination-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. Pagination is a page set (`sync` / `setCurrent`): one current page, prev/next disabled at inferable ends, and Arrow/Home/End among enabled controls. Pagination is the nineteenth Emerging auto-enhance runtime and is unpublished versus 0.9.0. Checkbox and radio are two runtimes. Breadcrumb is a light trail. Progress is a progressbar. Pagination is a page set.
132
162
  ## Use the built files directly
133
163
 
134
164
  If you are hosting Juice assets yourself, the main built files are:
135
165
 
136
166
  - `dist/index.css` (core)
137
- - `dist/themes/aquaflux.css`, `dist/themes/kiwipress.css`, `dist/themes/citrusmint.css`, `dist/themes/tide.css`
167
+ - `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`
138
168
  - `dist/index.js`
139
169
 
140
170
  Load core plus at least one theme CSS file when using `theme="..."` on the root element.
141
171
 
172
+ 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.0`):
173
+
174
+ ```html
175
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.0/dist/index.css" />
176
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.0/dist/themes/kiwipress.css" />
177
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.0/dist/index.js"></script>
178
+ ```
179
+
180
+ 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.
181
+
142
182
  ## Example
143
183
 
144
184
  ```html
@@ -186,7 +226,14 @@ Juice keeps styling attribute-first, but interactive patterns still need accessi
186
226
  - 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).
187
227
  - 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).
188
228
  - 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).
189
- - 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"`). Runtime is later.
229
+ - 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).
230
+ - 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).
231
+ - 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).
232
+ - 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).
233
+ - 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).
234
+ - 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.
235
+ - 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.
236
+ - 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. Unpublished versus 0.9.0. No Sig Pagination factory.
190
237
 
191
238
  ```html
192
239
  <div tabs name="settings">
@@ -301,6 +348,8 @@ Juice keeps styling attribute-first, but interactive patterns still need accessi
301
348
  <button type="button" menuitem="active">Report.pdf</button>
302
349
  </div>
303
350
  </div>
351
+
352
+ <button type="button" switch aria-label="Notifications"></button>
304
353
  ```
305
354
 
306
355
  ## Browser Support