@citrusworx/juiceui 0.6.0 → 0.8.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
@@ -85,6 +85,38 @@ import {
85
85
  initModal,
86
86
  startModalRuntime,
87
87
  stopModalRuntime,
88
+ createDrawer,
89
+ initDrawer,
90
+ startDrawerRuntime,
91
+ stopDrawerRuntime,
92
+ createToast,
93
+ initToast,
94
+ startToastRuntime,
95
+ stopToastRuntime,
96
+ createPopover,
97
+ initPopover,
98
+ startPopoverRuntime,
99
+ stopPopoverRuntime,
100
+ createWizard,
101
+ initWizard,
102
+ startWizardRuntime,
103
+ stopWizardRuntime,
104
+ createTooltip,
105
+ initTooltip,
106
+ startTooltipRuntime,
107
+ stopTooltipRuntime,
108
+ createCombobox,
109
+ initCombobox,
110
+ startComboboxRuntime,
111
+ stopComboboxRuntime,
112
+ createBanner,
113
+ initBanner,
114
+ startBannerRuntime,
115
+ stopBannerRuntime,
116
+ createMenu,
117
+ initMenu,
118
+ startMenuRuntime,
119
+ stopMenuRuntime,
88
120
  createNavigation,
89
121
  initNavigation,
90
122
  startNavigationRuntime,
@@ -95,7 +127,7 @@ import {
95
127
 
96
128
  The top-level JS entrypoint is intentionally small. Those named exports are the stable runtime API Juice currently promises.
97
129
 
98
- Importing that entry auto-starts the navigation, accordion, tabs, and modal runtimes in the browser. Valid `[accordion]`, `[tabs]`, and `[modal-overlay]` 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), and [docs/juice/juice-modal-runtime.md](../../docs/juice/juice-modal-runtime.md).
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.
99
131
 
100
132
  ## Use the built files directly
101
133
 
@@ -147,6 +179,14 @@ Juice keeps styling attribute-first, but interactive patterns still need accessi
147
179
  - tab chrome colors come from `--juice-tabs-*` roles bound by the active theme (Aquaflux, KiwiPress, Citrusmint, Tide, and generated `--jx-tabs-*` aliases)
148
180
  - visible vs hidden tab panels use the native `hidden` attribute; do not use `content="active"` or `content="hidden"` for panel state
149
181
  - 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).
182
+ - 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).
183
+ - 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).
184
+ - 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).
185
+ - 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).
186
+ - 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
+ - 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
+ - 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.
150
190
 
151
191
  ```html
152
192
  <div tabs name="settings">
@@ -189,6 +229,78 @@ Juice keeps styling attribute-first, but interactive patterns still need accessi
189
229
  </div>
190
230
  </div>
191
231
  <button type="button" aria-controls="demo-modal">Open account</button>
232
+
233
+ <div drawer-overlay id="demo-drawer" hidden>
234
+ <div drawer role="dialog" aria-modal="true" aria-labelledby="demo-drawer-title">
235
+ <button type="button" drawer-close aria-label="Close">×</button>
236
+ <div drawer-header><h2 id="demo-drawer-title">Filters</h2></div>
237
+ <div drawer-body>Refine results from the catalog.</div>
238
+ </div>
239
+ </div>
240
+ <button type="button" aria-controls="demo-drawer">Open filters</button>
241
+
242
+ <div toast-region>
243
+ <div toast id="demo-toast">
244
+ <div toast-title>Saved</div>
245
+ <div toast-body>Your changes were written.</div>
246
+ <button type="button" toast-close aria-label="Dismiss">×</button>
247
+ </div>
248
+ </div>
249
+
250
+ <button type="button" aria-controls="demo-pop">Open help</button>
251
+ <div popover-root id="demo-pop" hidden>
252
+ <div popover-panel role="dialog">
253
+ <button type="button" popover-close aria-label="Close">×</button>
254
+ <div popover-header><h2>Help</h2></div>
255
+ <div popover-body>Account details live on this page.</div>
256
+ </div>
257
+ </div>
258
+
259
+ <div wizard-shell name="onboard">
260
+ <ol steps>
261
+ <li step="active" data-step="welcome">Welcome</li>
262
+ <li step="pending" data-step="plan">Plan</li>
263
+ </ol>
264
+ <main wizard-content>
265
+ <section step-page="welcome">Welcome page</section>
266
+ <section step-page="plan" hidden>Plan page</section>
267
+ <div step-nav>
268
+ <button type="button" wizard-prev>Back</button>
269
+ <button type="button" wizard-next>Continue</button>
270
+ </div>
271
+ </main>
272
+ </div>
273
+
274
+ <button type="button" aria-describedby="demo-tip">Save</button>
275
+ <div tooltip-root id="demo-tip" hidden>
276
+ <div tooltip-panel role="tooltip">Saves the current draft.</div>
277
+ </div>
278
+
279
+ <label for="fruit-input">Fruit</label>
280
+ <div combobox name="fruit">
281
+ <input id="fruit-input" combobox-input type="text" />
282
+ <button type="button" combobox-trigger aria-label="Show fruits"></button>
283
+ <ul combobox-list hidden>
284
+ <li combobox-option>Apple</li>
285
+ <li combobox-option>Banana</li>
286
+ </ul>
287
+ </div>
288
+
289
+ <div banner="full" banner-tone="warning" name="maintenance" banner-persist="session">
290
+ <div banner-body>Scheduled maintenance tonight.</div>
291
+ <button type="button" banner-close aria-label="Dismiss">×</button>
292
+ </div>
293
+
294
+ <div menu-root>
295
+ <button type="button" menu-button aria-haspopup="menu" aria-controls="file-menu">File</button>
296
+ <div menu id="file-menu">
297
+ <button type="button" menuitem>New</button>
298
+ <button type="button" menuitem>Open…</button>
299
+ <div menu-separator></div>
300
+ <div menu-label>Recent</div>
301
+ <button type="button" menuitem="active">Report.pdf</button>
302
+ </div>
303
+ </div>
192
304
  ```
193
305
 
194
306
  ## Browser Support