@citrusworx/juiceui 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -3
- package/dist/index.css +2361 -76
- package/dist/index.d.ts +12 -0
- package/dist/index.js +986 -196
- package/dist/js/juice.d.ts +12 -0
- package/dist/js/src/breadcrumb/breadcrumb-runtime.d.ts +64 -0
- package/dist/js/src/checkbox/checkbox-runtime.d.ts +51 -0
- package/dist/js/src/progress/progress-runtime.d.ts +51 -0
- package/dist/js/src/radio/radio-runtime.d.ts +52 -0
- package/dist/js/src/slider/slider-runtime.d.ts +55 -0
- package/dist/js/src/switch/switch-runtime.d.ts +50 -0
- package/dist/themes/aquaflux.css +298 -0
- package/dist/themes/citrusmint.css +260 -0
- package/dist/themes/kiwipress.css +313 -0
- package/dist/themes/tide.css +301 -0
- package/package.json +1 -1
package/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
|
|
@@ -117,6 +120,30 @@ 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,
|
|
120
147
|
createNavigation,
|
|
121
148
|
initNavigation,
|
|
122
149
|
startNavigationRuntime,
|
|
@@ -127,8 +154,7 @@ import {
|
|
|
127
154
|
|
|
128
155
|
The top-level JS entrypoint is intentionally small. Those named exports are the stable runtime API Juice currently promises.
|
|
129
156
|
|
|
130
|
-
Importing that entry auto-starts the navigation, accordion, tabs, modal, drawer, toast, popover, wizard, tooltip, combobox, banner, and
|
|
131
|
-
|
|
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.
|
|
132
158
|
## Use the built files directly
|
|
133
159
|
|
|
134
160
|
If you are hosting Juice assets yourself, the main built files are:
|
|
@@ -139,6 +165,16 @@ If you are hosting Juice assets yourself, the main built files are:
|
|
|
139
165
|
|
|
140
166
|
Load core plus at least one theme CSS file when using `theme="..."` on the root element.
|
|
141
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
|
+
|
|
142
178
|
## Example
|
|
143
179
|
|
|
144
180
|
```html
|
|
@@ -186,7 +222,13 @@ Juice keeps styling attribute-first, but interactive patterns still need accessi
|
|
|
186
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).
|
|
187
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).
|
|
188
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).
|
|
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"`).
|
|
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.
|
|
190
232
|
|
|
191
233
|
```html
|
|
192
234
|
<div tabs name="settings">
|
|
@@ -301,6 +343,8 @@ Juice keeps styling attribute-first, but interactive patterns still need accessi
|
|
|
301
343
|
<button type="button" menuitem="active">Report.pdf</button>
|
|
302
344
|
</div>
|
|
303
345
|
</div>
|
|
346
|
+
|
|
347
|
+
<button type="button" switch aria-label="Notifications"></button>
|
|
304
348
|
```
|
|
305
349
|
|
|
306
350
|
## Browser Support
|