@citrusworx/juiceui 0.9.3 → 0.9.5
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 +345 -242
- package/dist/index.css +465 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +605 -2
- package/dist/js/juice.d.ts +6 -0
- package/dist/js/src/keyboard-avoider/keyboard-avoider-runtime.d.ts +96 -0
- package/dist/js/src/pressable/pressable-runtime.d.ts +106 -0
- package/dist/js/src/shared/change.d.ts +1 -0
- package/dist/js/src/touchable-row/touchable-row-runtime.d.ts +123 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,50 +1,31 @@
|
|
|
1
1
|
# @citrusworx/juiceui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## What Juice is
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Juice is an attribute-first styling library for CitrusWorx apps. Structure lives in markup (`stack`, `row`, `gap`, `card`), and themes own identity. The package ships the compiled stylesheet and a small JS entry so an app can import shared tokens, styles, and the optional runtimes from one place.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
The Juice workspace also contains internal-only material that is not part of the published runtime contract:
|
|
19
|
-
|
|
20
|
-
- `src/native/` playground and experiments
|
|
21
|
-
- `src/templates/` HTML examples
|
|
22
|
-
- `src/tools/` compiler helpers
|
|
23
|
-
- `.mockups/` and `test-results/`
|
|
24
|
-
- local build tooling like `gulp.ts`, `vite.config.ts`, and `juice.config.yaml`
|
|
25
|
-
|
|
26
|
-
Those are useful for monorepo development, but they are not part of the public API of `@citrusworx/juiceui`.
|
|
7
|
+
```html
|
|
8
|
+
<body theme="aquaflux">
|
|
9
|
+
<section card stack gap="1" padding="1rem">
|
|
10
|
+
<div row gap="1">
|
|
11
|
+
<h1>Harbor</h1>
|
|
12
|
+
<p>Attribute-first structure. The theme owns the color.</p>
|
|
13
|
+
</div>
|
|
14
|
+
</section>
|
|
15
|
+
</body>
|
|
16
|
+
```
|
|
27
17
|
|
|
28
18
|
## Install
|
|
29
19
|
|
|
30
20
|
```bash
|
|
31
21
|
npm install @citrusworx/juiceui
|
|
32
|
-
pnpm add @citrusworx/juiceui
|
|
33
|
-
yarn add @citrusworx/juiceui
|
|
34
|
-
bun add @citrusworx/juiceui
|
|
35
22
|
```
|
|
36
23
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Core utilities and components (no theme identity):
|
|
24
|
+
The same package name works with `pnpm add`, `yarn add`, and `bun add`.
|
|
40
25
|
|
|
41
|
-
|
|
42
|
-
import "@citrusworx/juiceui/styles";
|
|
43
|
-
```
|
|
26
|
+
## Quick start
|
|
44
27
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
**Breaking change:** `@citrusworx/juiceui/styles` is **core only**. Import a theme stylesheet explicitly:
|
|
28
|
+
`@citrusworx/juiceui/styles` is core only: utilities and components, with no theme identity. Import a theme stylesheet next to it, and set `theme` on `<body>` (or another root).
|
|
48
29
|
|
|
49
30
|
```ts
|
|
50
31
|
import "@citrusworx/juiceui/styles";
|
|
@@ -53,240 +34,184 @@ import "@citrusworx/juiceui/styles/themes/aquaflux";
|
|
|
53
34
|
|
|
54
35
|
```html
|
|
55
36
|
<body theme="aquaflux">
|
|
56
|
-
|
|
37
|
+
<main stack gap="2rem" padding="2rem">
|
|
38
|
+
<h1 font="bebas-neue" fontColor="obsidian-900">Juice</h1>
|
|
39
|
+
<p font="lato" fontColor="gray-700">
|
|
40
|
+
Attribute-driven styling from shared design tokens.
|
|
41
|
+
</p>
|
|
42
|
+
<button bgColor="green-500" hover="green-600" fontColor="white-100" padding="1rem">
|
|
43
|
+
Get started
|
|
44
|
+
</button>
|
|
45
|
+
</main>
|
|
57
46
|
</body>
|
|
58
47
|
```
|
|
59
48
|
|
|
60
|
-
|
|
49
|
+
A page that sets `theme` and never imports a theme stylesheet has structure and no brand. The JS module is optional when the page is CSS only. See [Migration](#migration) for the core-only split.
|
|
61
50
|
|
|
62
|
-
##
|
|
51
|
+
## Themes
|
|
63
52
|
|
|
64
|
-
|
|
53
|
+
Themes are Beta. Set `theme="<id>"` on the root and import that id.
|
|
65
54
|
|
|
66
|
-
|
|
55
|
+
Core:
|
|
56
|
+
|
|
57
|
+
| Id | Import |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| `aquaflux` | `@citrusworx/juiceui/styles/themes/aquaflux` |
|
|
60
|
+
| `kiwipress` | `@citrusworx/juiceui/styles/themes/kiwipress` |
|
|
61
|
+
| `citrusmint` | `@citrusworx/juiceui/styles/themes/citrusmint` |
|
|
62
|
+
| `tide` | `@citrusworx/juiceui/styles/themes/tide` |
|
|
63
|
+
|
|
64
|
+
Retro:
|
|
65
|
+
|
|
66
|
+
| Id | Import |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| `retro-afterburn` | `@citrusworx/juiceui/styles/themes/retro-afterburn` |
|
|
69
|
+
| `retro-arcade-glow` | `@citrusworx/juiceui/styles/themes/retro-arcade-glow` |
|
|
70
|
+
| `retro-boardwalk` | `@citrusworx/juiceui/styles/themes/retro-boardwalk` |
|
|
71
|
+
| `retro-denim-dial` | `@citrusworx/juiceui/styles/themes/retro-denim-dial` |
|
|
72
|
+
| `retro-forest-radio` | `@citrusworx/juiceui/styles/themes/retro-forest-radio` |
|
|
73
|
+
| `retro-orchard-club` | `@citrusworx/juiceui/styles/themes/retro-orchard-club` |
|
|
74
|
+
| `retro-poolside-pop` | `@citrusworx/juiceui/styles/themes/retro-poolside-pop` |
|
|
75
|
+
| `retro-signal-garden` | `@citrusworx/juiceui/styles/themes/retro-signal-garden` |
|
|
76
|
+
| `retro-sunset-motel` | `@citrusworx/juiceui/styles/themes/retro-sunset-motel` |
|
|
77
|
+
| `retro-violet-parlor` | `@citrusworx/juiceui/styles/themes/retro-violet-parlor` |
|
|
78
|
+
|
|
79
|
+
Built files are `dist/index.css` (core) and `dist/themes/<id>.css`. Each theme is authored as `<themeId>.scss` + `<themeId>.yaml` under `src/themes/<themeId>/`. Drafts under `src/themes/_draft/` are blocked from package `exports` and left out of the published tarball. See [Theme authoring](../../docs/juice/juice-theme-authoring.md).
|
|
80
|
+
|
|
81
|
+
## Components and runtimes
|
|
82
|
+
|
|
83
|
+
The top-level JS entry is small. Thirty-one runtimes stay Emerging.
|
|
84
|
+
|
|
85
|
+
Navigation through field (twenty-five) shipped in `@citrusworx/juiceui@0.9.2`. Icon button, avatar, table, pressable, touchable row, and keyboard avoider are on master and are not in that release. Rows marked **master** are those six.
|
|
86
|
+
|
|
87
|
+
The full index, including how to choose between similar components, is [Runtime behavior](../../docs/juice/juice-runtime-behavior.md#components).
|
|
67
88
|
|
|
68
|
-
|
|
89
|
+
### Overlays
|
|
69
90
|
|
|
70
|
-
|
|
91
|
+
| Component | Markup | What it is | Docs |
|
|
92
|
+
| --- | --- | --- | --- |
|
|
93
|
+
| Modal | `[modal-overlay]` | Dialog. Open and close, Escape, focus trap, one open at a time. | [Modal](../../docs/juice/juice-modal-runtime.md) |
|
|
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
|
+
| Popover | `[popover-root]` | Anchored non-modal dialog. The surface is `[popover-panel]`, never a bare `popover` attribute. | [Popover](../../docs/juice/juice-popover-runtime.md) |
|
|
96
|
+
| 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) |
|
|
97
|
+
| 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) |
|
|
71
98
|
|
|
72
|
-
|
|
99
|
+
### Navigation
|
|
73
100
|
|
|
74
|
-
|
|
101
|
+
| Component | Markup | What it is | Docs |
|
|
102
|
+
| --- | --- | --- | --- |
|
|
103
|
+
| Navigation | `nav[type="mobile"]` | Mobile toggle for `nav[type="sidebar"]`. Also watches `nav[type="bar"]` and `nav[type="links"]`. | [Navigation](../../docs/juice/juice-navigation-runtime.md) |
|
|
104
|
+
| Menu | `[menu-root]` | APG menu button (`open` / `close` / `toggle` / `select`). Not a popover and not a menubar. | [Menu](../../docs/juice/juice-menu-runtime.md) |
|
|
105
|
+
| Tabs | `[tabs]` | One selected panel. Orphan `[tab]` triggers and `[tab-panel]` panels are ignored. | [Tabs](../../docs/juice/juice-tabs-runtime.md) |
|
|
106
|
+
| Breadcrumb | `[breadcrumb]` | Light trail (`sync` / `setCurrent`). Not a router. | [Breadcrumb](../../docs/juice/juice-breadcrumb-runtime.md) |
|
|
107
|
+
| Pagination | `[pagination]` | Page set (`sync` / `setCurrent`). One current page, prev/next disabled at inferable ends, Arrow / Home / End among enabled controls. The nineteenth Emerging runtime. | [Pagination](../../docs/juice/juice-pagination-runtime.md) |
|
|
108
|
+
|
|
109
|
+
### Forms
|
|
110
|
+
|
|
111
|
+
| Component | Markup | What it is | Docs |
|
|
112
|
+
| --- | --- | --- | --- |
|
|
113
|
+
| Input | `<input input>` | Text-like native field (`sync`). Not a combobox and not a select. The twenty-third Emerging runtime. Shipped in 0.9.2. | [Input](../../docs/juice/juice-input-runtime.md) |
|
|
114
|
+
| Textarea | `<textarea textarea>` | Native multiline field (`sync`). Not an input, not a select, and not a combobox. The twenty-fourth Emerging runtime. Shipped in 0.9.2. | [Textarea](../../docs/juice/juice-textarea-runtime.md) |
|
|
115
|
+
| Select | `<select select>` | Native dropdown (`sync`). The open list stays the platform popup. Not a combobox. The twenty-second Emerging runtime. Shipped in 0.9.2. | [Select](../../docs/juice/juice-select-runtime.md) |
|
|
116
|
+
| Combobox | `[combobox]` | Input plus listbox (`open` / `close` / `toggle` / `select`). Distinct from native `<select>`. | [Combobox](../../docs/juice/juice-combobox-runtime.md) |
|
|
117
|
+
| Checkbox | `[checkbox]` | APG checkbox (`toggle` / `check` / `uncheck` / `setChecked`). Not a layered overlay. Checkbox and radio are two runtimes. | [Checkbox](../../docs/juice/juice-checkbox-runtime.md) |
|
|
118
|
+
| Radio | `[radiogroup]` | APG radio group (`select` / `getChecked`). `[radio]` outside the group is ignored. Not a layered overlay. | [Radio](../../docs/juice/juice-radio-runtime.md) |
|
|
119
|
+
| Switch | `[switch]` | APG switch (`toggle` / `check` / `uncheck` / `setChecked`). Not a layered overlay. | [Switch](../../docs/juice/juice-switch-runtime.md) |
|
|
120
|
+
| Slider | `[slider]` | APG slider (`setValue` / `getValue` / `increment` / `decrement`). Not a layered overlay. | [Slider](../../docs/juice/juice-slider-runtime.md) |
|
|
121
|
+
| 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) |
|
|
122
|
+
| Icon button (**master**) | `[icon-button]` | Square control on button chrome (`sync` / `toggle` / `getState`). Not a switch and not a checkbox. The twenty-sixth Emerging runtime. Not in npm 0.9.2. | [Icon button](../../docs/juice/juice-icon-button-runtime.md) |
|
|
123
|
+
| Pressable (**master**) | `[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. Not in npm 0.9.2. | [Pressable](../../docs/juice/juice-pressable.md) |
|
|
124
|
+
| Touchable row (**master**) | `[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. Not in npm 0.9.2. | [Touchable row](../../docs/juice/juice-touchable-row.md) |
|
|
125
|
+
|
|
126
|
+
### Feedback
|
|
127
|
+
|
|
128
|
+
| Component | Markup | What it is | Docs |
|
|
129
|
+
| --- | --- | --- | --- |
|
|
130
|
+
| Banner | `[banner]` | Inline alert / callout (`show` / `dismiss`, `[banner-close]`). Not a toast stack. | [Banner](../../docs/juice/juice-banner-runtime.md) |
|
|
131
|
+
| Progress | `[progress]` | APG-inspired progressbar (`setValue` / `getValue` / `setIndeterminate`). Not a slider. | [Progress](../../docs/juice/juice-progress-runtime.md) |
|
|
132
|
+
| Spinner | `[spinner]` | Indeterminate busy indicator (`show` / `hide`). Not a progress bar and not a disclosure. The twenty-first Emerging runtime. Shipped in 0.9.2. | [Spinner](../../docs/juice/juice-spinner-runtime.md) |
|
|
133
|
+
|
|
134
|
+
### Disclosure
|
|
135
|
+
|
|
136
|
+
| Component | Markup | What it is | Docs |
|
|
137
|
+
| --- | --- | --- | --- |
|
|
138
|
+
| Accordion | `[accordion]` | Multi-item expand and collapse. Open panels use native `hidden`. | [Accordion](../../docs/juice/juice-accordion-runtime.md) |
|
|
139
|
+
| Disclosure | `[disclosure]` | One trigger, one panel. Distinct from accordion. The twentieth Emerging runtime. Shipped in 0.9.2. | [Disclosure](../../docs/juice/juice-disclosure-runtime.md) |
|
|
140
|
+
| Wizard | `[wizard-shell]` | Multi-step shell. One `[step-page]` visible. Not a dialog and not tabs. | [Wizard](../../docs/juice/juice-wizard-runtime.md) |
|
|
141
|
+
|
|
142
|
+
### Data display
|
|
143
|
+
|
|
144
|
+
| Component | Markup | What it is | Docs |
|
|
145
|
+
| --- | --- | --- | --- |
|
|
146
|
+
| Avatar (**master**) | `[avatar]` | Initials or photo (`sync` / `getState`). Not a badge and not `[skeleton="circle"]`. The twenty-seventh Emerging runtime. Not in npm 0.9.2. | [Avatar](../../docs/juice/juice-avatar.md) |
|
|
147
|
+
| Table (**master**) | `<table table>` | Sortable grid. The twenty-eighth runtime. Not in npm 0.9.2. | [Table](../../docs/juice/juice-table.md) |
|
|
148
|
+
|
|
149
|
+
### Page chrome
|
|
150
|
+
|
|
151
|
+
| Component | Markup | What it is | Docs |
|
|
152
|
+
| --- | --- | --- | --- |
|
|
153
|
+
| Keyboard avoider (**master**) | `[keyboard-avoider]` | Inset while the software keyboard is open. The thirty-first runtime. Not in npm 0.9.2. Not a `JuiceRuntimeName`. | [Keyboard avoider](../../docs/juice/juice-keyboard-avoider-runtime.md) |
|
|
154
|
+
|
|
155
|
+
### Auto-start
|
|
156
|
+
|
|
157
|
+
Importing `@citrusworx/juiceui` enhances the hooks in the tables above. Most apps need no `init` call.
|
|
158
|
+
|
|
159
|
+
The JS module is optional. Core CSS plus a theme is enough when the page does not use a runtime.
|
|
160
|
+
|
|
161
|
+
### Naming pattern
|
|
162
|
+
|
|
163
|
+
Every runtime exports the same four functions. `<Name>` is the component stem, such as `Modal` or `KeyboardAvoider`.
|
|
164
|
+
|
|
165
|
+
| Export | What it does |
|
|
166
|
+
| --- | --- |
|
|
167
|
+
| `create<Name>(options?)` | Builds a controller for markup in the document, or under `options.root`. |
|
|
168
|
+
| `init<Name>(options?)` | Calls `create<Name>` with the same options. |
|
|
169
|
+
| `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. |
|
|
170
|
+
| `stop<Name>Runtime()` | Destroys that document-level controller. |
|
|
171
|
+
|
|
172
|
+
Modal shows the four export names. The other thirty use the same `create` / `init` / `start` / `stop` names. Controller methods differ by runtime.
|
|
75
173
|
|
|
76
174
|
```ts
|
|
77
175
|
import {
|
|
78
176
|
Accordion,
|
|
79
|
-
createAccordion,
|
|
80
|
-
initAccordion,
|
|
81
|
-
startAccordionRuntime,
|
|
82
|
-
stopAccordionRuntime,
|
|
83
|
-
createTabs,
|
|
84
|
-
initTabs,
|
|
85
|
-
startTabsRuntime,
|
|
86
|
-
stopTabsRuntime,
|
|
87
177
|
createModal,
|
|
88
178
|
initModal,
|
|
89
179
|
startModalRuntime,
|
|
90
180
|
stopModalRuntime,
|
|
91
|
-
|
|
92
|
-
initDrawer,
|
|
93
|
-
startDrawerRuntime,
|
|
94
|
-
stopDrawerRuntime,
|
|
95
|
-
createToast,
|
|
96
|
-
initToast,
|
|
97
|
-
startToastRuntime,
|
|
98
|
-
stopToastRuntime,
|
|
99
|
-
createPopover,
|
|
100
|
-
initPopover,
|
|
101
|
-
startPopoverRuntime,
|
|
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,
|
|
147
|
-
createPagination,
|
|
148
|
-
initPagination,
|
|
149
|
-
startPaginationRuntime,
|
|
150
|
-
stopPaginationRuntime,
|
|
151
|
-
createDisclosure,
|
|
152
|
-
initDisclosure,
|
|
153
|
-
startDisclosureRuntime,
|
|
154
|
-
stopDisclosureRuntime,
|
|
155
|
-
createSpinner,
|
|
156
|
-
initSpinner,
|
|
157
|
-
startSpinnerRuntime,
|
|
158
|
-
stopSpinnerRuntime,
|
|
159
|
-
createSelect,
|
|
160
|
-
initSelect,
|
|
161
|
-
startSelectRuntime,
|
|
162
|
-
stopSelectRuntime,
|
|
163
|
-
createInput,
|
|
164
|
-
initInput,
|
|
165
|
-
startInputRuntime,
|
|
166
|
-
stopInputRuntime,
|
|
167
|
-
createTextarea,
|
|
168
|
-
initTextarea,
|
|
169
|
-
startTextareaRuntime,
|
|
170
|
-
stopTextareaRuntime,
|
|
171
|
-
createField,
|
|
172
|
-
initField,
|
|
173
|
-
startFieldRuntime,
|
|
174
|
-
stopFieldRuntime,
|
|
175
|
-
createIconButton,
|
|
176
|
-
initIconButton,
|
|
177
|
-
startIconButtonRuntime,
|
|
178
|
-
stopIconButtonRuntime,
|
|
179
|
-
createAvatar,
|
|
180
|
-
initAvatar,
|
|
181
|
-
startAvatarRuntime,
|
|
182
|
-
stopAvatarRuntime,
|
|
183
|
-
createTable,
|
|
184
|
-
initTable,
|
|
185
|
-
startTableRuntime,
|
|
186
|
-
stopTableRuntime,
|
|
187
|
-
createNavigation,
|
|
188
|
-
initNavigation,
|
|
189
|
-
startNavigationRuntime,
|
|
190
|
-
stopNavigationRuntime,
|
|
191
|
-
tokens
|
|
181
|
+
tokens,
|
|
192
182
|
} from "@citrusworx/juiceui";
|
|
193
|
-
```
|
|
194
183
|
|
|
195
|
-
|
|
184
|
+
const modal = createModal(); // initModal() is this same call
|
|
185
|
+
startModalRuntime();
|
|
186
|
+
stopModalRuntime();
|
|
187
|
+
```
|
|
196
188
|
|
|
197
|
-
|
|
189
|
+
`createModal()` returns a controller with `open`, `close`, `toggle`, `isOpen`, `getState`, `sync`, and `destroy`. `initModal()` is that same call. A normal page never calls them: importing the entry already started the runtime.
|
|
198
190
|
|
|
199
|
-
|
|
191
|
+
`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`.
|
|
200
192
|
|
|
201
|
-
|
|
193
|
+
Icon button, avatar, table, pressable, touchable row, and keyboard avoider export the same four names on master. Those twenty-four functions are not in `@citrusworx/juiceui@0.9.2`.
|
|
202
194
|
|
|
203
|
-
|
|
195
|
+
### `juice:change` and `getState`
|
|
204
196
|
|
|
205
|
-
|
|
206
|
-
- `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`
|
|
207
|
-
- `dist/index.js`
|
|
197
|
+
Interactive runtimes dispatch a bubbling `juice:change` from the widget host when observable state changes. `detail` is `{ runtime, state }`. `getState()` reads that shape.
|
|
208
198
|
|
|
209
|
-
|
|
199
|
+
Select, input, and textarea publish through native `input` and `change`. They still expose `getState()`.
|
|
210
200
|
|
|
211
|
-
|
|
201
|
+
The contract covers all thirty-one runtimes. It is on master, unreleased after 0.9.2. `JUICE_CHANGE_EVENT` is not in the published 0.9.2 types.
|
|
212
202
|
|
|
213
|
-
|
|
214
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.2/dist/index.css" />
|
|
215
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.2/dist/themes/kiwipress.css" />
|
|
216
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.2/dist/index.js"></script>
|
|
217
|
-
```
|
|
203
|
+
`@citrusworx/sigjs/juice` `bind` names twenty-eight runtimes, through `table`, on master and in `@citrusworx/sigjs@0.7.2`.
|
|
218
204
|
|
|
219
|
-
|
|
205
|
+
- `icon-button`, `avatar`, and `table` are `JuiceRuntimeName` values.
|
|
206
|
+
- Pressable, touchable row, and keyboard avoider are not.
|
|
207
|
+
- `@citrusworx/sigjs@0.7.0` and `@citrusworx/sigjs@0.7.1` stop at twenty-five names, through `textarea`.
|
|
208
|
+
- Binding `icon-button`, `avatar`, or `table` against `@citrusworx/juiceui@0.9.2` throws. That cut does not export their start functions.
|
|
220
209
|
|
|
221
|
-
|
|
210
|
+
Juice works without Sig. The optional adapter is `@citrusworx/sigjs/juice` only.
|
|
222
211
|
|
|
223
|
-
|
|
224
|
-
<section stack gap="1" padding="2rem">
|
|
225
|
-
<h1 font="bebas-neue" fontColor="obsidian-900">Juice</h1>
|
|
226
|
-
<p font="lato" fontColor="gray-700">
|
|
227
|
-
Attribute-driven styling from shared design tokens.
|
|
228
|
-
</p>
|
|
229
|
-
<button bgColor="green-500" hover="green-600" fontColor="white-100" padding="1rem">
|
|
230
|
-
Get started
|
|
231
|
-
</button>
|
|
232
|
-
</section>
|
|
233
|
-
```
|
|
212
|
+
See [`juice:change`](../../docs/juice/juice-runtime-behavior.md#juicechange) and [Sig.js + Juice](../../docs/sigjs/sig-juice-integration.md#runtime-binding).
|
|
234
213
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
- compiled CSS output at `dist/index.css`
|
|
238
|
-
- compiled JS output at `dist/index.js`
|
|
239
|
-
- color tokens and swatches
|
|
240
|
-
- Google and Adobe font selectors
|
|
241
|
-
- attribute selectors for color, spacing, width, height, gradients, shadows, and icons
|
|
242
|
-
- layout primitives for `stack`, `row`, `grid`, `gap`, and `span`
|
|
243
|
-
- FontAwesome Free icon integration across the solid, regular, and brands sets
|
|
244
|
-
- CSS-only `[skeleton]` loading chrome in core CSS (rect, text, circle). On master, not in the published npm 0.9.2 release. Not a runtime. See [docs/juice/juice-skeleton.md](../../docs/juice/juice-skeleton.md)
|
|
245
|
-
- CSS-only `[list]` stacked rows in core CSS (`ul` / `ol` / `div`, `[divided]`, `[dense]`, `[list-item]` slots). On master, not in the published npm 0.9.2 release. Not a runtime. See [docs/juice/juice-list.md](../../docs/juice/juice-list.md)
|
|
246
|
-
- CSS-only `[badge]` pill (`[badge="square"]`, `[badge="ribbon"]`). The base layout shipped in npm 0.9.2. Core `--juice-badge-*` roles are on master and are not in that cut. Not a runtime. See [docs/juice/juice-badge.md](../../docs/juice/juice-badge.md)
|
|
247
|
-
- `[avatar]` initials-or-photo chrome and image-fallback runtime (`createAvatar` / `initAvatar` / `startAvatarRuntime` / `stopAvatarRuntime`). On master, not in the published npm 0.9.2 release. The twenty-seventh Emerging auto-enhance runtime. See [docs/juice/juice-avatar.md](../../docs/juice/juice-avatar.md)
|
|
248
|
-
- `[table]` sortable grid chrome and runtime (`createTable` / `initTable` / `startTableRuntime` / `stopTableRuntime`). On master, not in the published npm 0.9.2 release. The twenty-eighth Emerging auto-enhance runtime. See [docs/juice/juice-table.md](../../docs/juice/juice-table.md)
|
|
249
|
-
|
|
250
|
-
## Accessibility
|
|
251
|
-
|
|
252
|
-
Juice keeps styling attribute-first, but interactive patterns still need accessible relationships and names.
|
|
253
|
-
|
|
254
|
-
- mobile nav toggles should expose an accessible name and control a sidebar with `aria-controls`
|
|
255
|
-
- accordion triggers should use `aria-expanded` and `aria-controls`
|
|
256
|
-
- accordion panels should be labeled regions when they contain meaningful content
|
|
257
|
-
- accordion chrome colors come from `--juice-accordion-*` roles bound by the active theme (Aquaflux, KiwiPress, Citrusmint, and Tide)
|
|
258
|
-
- group FAQ stacks in a card/panel surface (`[aqua-card]` / `[aqua-panel]` under Aquaflux, `[tide-card]` / `[tide-panel]` under Tide) so the accordion wrapper stays structural
|
|
259
|
-
- open/closed accordion panels use the native `hidden` attribute; do not use `content="active"` or `content="hidden"` for accordion state (those clash with layout `[content]`)
|
|
260
|
-
- optional `[motion="accordion"]` is height easing, not required for show/hide
|
|
261
|
-
- tabs live under a `[tabs]` root with `[tabs-list]`, `[tab]` triggers, and `[tab-panel]` panels; orphan triggers and panels are ignored
|
|
262
|
-
- tab selection dual-writes Juice `[active]` and `aria-selected`; the runtime also wires `role="tablist"` / `tab` / `tabpanel`, roving tabindex, and labeled panels
|
|
263
|
-
- tab chrome colors come from `--juice-tabs-*` roles bound by the active theme (Aquaflux, KiwiPress, Citrusmint, Tide, and generated `--jx-tabs-*` aliases)
|
|
264
|
-
- visible vs hidden tab panels use the native `hidden` attribute; do not use `content="active"` or `content="hidden"` for panel state
|
|
265
|
-
- 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).
|
|
266
|
-
- 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).
|
|
267
|
-
- 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).
|
|
268
|
-
- 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).
|
|
269
|
-
- 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).
|
|
270
|
-
- 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).
|
|
271
|
-
- 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).
|
|
272
|
-
- 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).
|
|
273
|
-
- 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).
|
|
274
|
-
- 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).
|
|
275
|
-
- 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).
|
|
276
|
-
- 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).
|
|
277
|
-
- 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).
|
|
278
|
-
- 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.
|
|
279
|
-
- 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.
|
|
280
|
-
- 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. No Sig Pagination factory.
|
|
281
|
-
- 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. See [docs/juice/juice-disclosure-runtime.md](../../docs/juice/juice-disclosure-runtime.md). Disclosure is the twentieth Emerging auto-enhance runtime. Shipped in 0.9.2. No Sig Disclosure factory.
|
|
282
|
-
- 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. It is not a progress bar and not a disclosure. Inline status chrome — no overlay, no focus trap, no Escape. See [docs/juice/juice-spinner-runtime.md](../../docs/juice/juice-spinner-runtime.md). Spinner is the twenty-first Emerging auto-enhance runtime. Shipped in 0.9.2. No Sig Spinner factory.
|
|
283
|
-
- 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. Inline field chrome — no overlay, no listbox, no focus trap, no Escape. See [docs/juice/juice-select-runtime.md](../../docs/juice/juice-select-runtime.md). Select is the twenty-second Emerging auto-enhance runtime. Shipped in 0.9.2. No Sig Select factory.
|
|
284
|
-
- 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. Inline field chrome — no overlay, no mask, no validation, no floating label, no focus trap, no Escape. See [docs/juice/juice-input-runtime.md](../../docs/juice/juice-input-runtime.md). Input is the twenty-third Emerging auto-enhance runtime. Shipped in 0.9.2. No Sig Input factory.
|
|
285
|
-
- 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. Inline field chrome — no overlay, no auto-grow, no character count, no validation, no floating label, no focus trap, no Escape. See [docs/juice/juice-textarea-runtime.md](../../docs/juice/juice-textarea-runtime.md). Textarea is the twenty-fourth Emerging auto-enhance runtime. Shipped in 0.9.2. No Sig Textarea factory.
|
|
286
|
-
- skeleton chrome is CSS-only. `[skeleton]` is a loading placeholder (boolean and `skeleton="rect"` are the rectangle, `skeleton="text"` is a line, `skeleton="circle"` is a circle). `[lines="1"`…`"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. There is no runtime and no auto-enhance. On master, not in the published npm 0.9.2 release. Not one of the twenty-eight Emerging auto-enhance runtimes. See [docs/juice/juice-skeleton.md](../../docs/juice/juice-skeleton.md)
|
|
287
|
-
- badge chrome is CSS-only. `[badge]` is a pill (`inline-flex`, radius `999px`, `0.8125rem` at weight 600). `[badge="square"]` uses radius `0.375rem`. `[badge="ribbon"]` is absolutely positioned (`top: -0.75rem`, centered). There is no `[scale]`. Color roles are `--juice-badge-bg` (currentColor at 1%), `--juice-badge-ink` (`currentColor`), and `--juice-badge-border` (currentColor at 24%), on `:root` and again on `[theme]`. Layout roles stay on `:root`. Shipped themes are not required to bind them. Outside `[cta]`, KiwiPress still paints the default, `[warm]`, ribbon, and `[wizard-header] [brand] [badge]`. `[card="pricing"]` is the positioned parent for a ribbon. `[dev-hero-header] > [badge]` switches that child to `inline-block`. There is no runtime, no `juice:change`, no `getState()`, and no auto-enhance. The base layout shipped in npm 0.9.2. The roles are on master and are not in that cut. Not one of the twenty-eight Emerging auto-enhance runtimes. See [docs/juice/juice-badge.md](../../docs/juice/juice-badge.md)
|
|
288
|
-
- list chrome is CSS-only. `[list]` on `ul`, `ol`, or `div` stacks rows (`:where(ul, ol, div)[list]`, so `<input list>` is left alone). `[divided]` is a hairline between direct children. `[dense]` tightens row padding and the slot margin and does not change the stack gap. `[list-item]` holds `[list-leading]`, `[list-content]`, `[list-secondary]`, and `[list-trailing]`. `[leading]` stays letter-spacing. An `a` or `button` row hovers, presses, and takes a 2px `currentColor` `:focus-visible` outline, offset 2px. `[selected]` and `aria-current` other than `"false"` share the selected wash. Disabled interactive rows are `opacity: 0.5`. `[selected]` is visual only. Color roles are `--juice-list-*` mixes of `currentColor`, restated on `[theme]`. Layout roles stay on `:root`. Shipped themes are not required to bind them. Background and color use `--juice-motion-duration-fast` and `--juice-motion-ease-standard`, and `prefers-reduced-motion` sets `transition: none`. There is no runtime, no `juice:change`, no `getState()`, and no auto-enhance. On master, not in the published npm 0.9.2 release. Not one of the twenty-eight Emerging auto-enhance runtimes. See [docs/juice/juice-list.md](../../docs/juice/juice-list.md)
|
|
289
|
-
- field chrome colors come from `--juice-field-*` roles bound by the active theme. `[field]` is a wrapper around a control. Optional `[field-label]`, `[field-help]`, and `[field-error]` are parts. `[invalid]` paints the wrapper border. The runtime auto-enhances `[field]` (`sync` / `destroy`): 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`. Hidden or empty parts are skipped, and missing ids are added only for parts the runtime references. `[invalid]` sets `aria-invalid="true"` on that control when the author has not set `aria-invalid`. 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. Inline wrapper chrome — no overlay, no focus trap, no Escape. See [docs/juice/juice-field-runtime.md](../../docs/juice/juice-field-runtime.md). Field is the twenty-fifth Emerging auto-enhance runtime. Shipped in 0.9.2. No Sig Field factory.
|
|
214
|
+
### Markup examples
|
|
290
215
|
|
|
291
216
|
```html
|
|
292
217
|
<div tabs name="settings">
|
|
@@ -405,7 +330,125 @@ Juice keeps styling attribute-first, but interactive patterns still need accessi
|
|
|
405
330
|
<button type="button" switch aria-label="Notifications"></button>
|
|
406
331
|
```
|
|
407
332
|
|
|
408
|
-
|
|
333
|
+
### Notes
|
|
334
|
+
|
|
335
|
+
Open and closed state uses native `hidden`, not layout `content="active"` or `content="hidden"`.
|
|
336
|
+
|
|
337
|
+
Nav hooks are `nav[type="bar"]`, `nav[type="links"]`, `nav[type="mobile"]`, and `nav[type="sidebar"]`.
|
|
338
|
+
|
|
339
|
+
All 14 shipped themes bind `--juice-accordion-*` and `--juice-tabs-*`.
|
|
340
|
+
|
|
341
|
+
Attributes, keyboard behavior, and theme roles for each component are on the page linked from the tables above.
|
|
342
|
+
|
|
343
|
+
[Choosing between similar components](../../docs/juice/juice-runtime-behavior.md#choosing-between-similar-components).
|
|
344
|
+
|
|
345
|
+
### CSS-only chrome
|
|
346
|
+
|
|
347
|
+
These do not auto-enhance, do not dispatch `juice:change`, and are not part of the thirty-one runtimes.
|
|
348
|
+
|
|
349
|
+
| Chrome | Hook | Release | Docs |
|
|
350
|
+
| --- | --- | --- | --- |
|
|
351
|
+
| Skeleton | `[skeleton]` | On master, not in npm 0.9.2 | [Skeleton](../../docs/juice/juice-skeleton.md) |
|
|
352
|
+
| List | `[list]` | On master, not in npm 0.9.2 | [List](../../docs/juice/juice-list.md) |
|
|
353
|
+
| Badge | `[badge]` | Layout shipped in npm 0.9.2. `--juice-badge-*` roles are on master, not in that cut | [Badge](../../docs/juice/juice-badge.md) |
|
|
354
|
+
| Safe area | `[safe-area]` | On master, not in npm 0.9.2 | [Safe area](../../docs/juice/juice-safe-area.md) |
|
|
355
|
+
|
|
356
|
+
## Layout
|
|
357
|
+
|
|
358
|
+
Layout primitives are `stack`, `row`, `grid`, `gap`, and `span`. The [quick start](#quick-start) markup uses `stack`, `gap`, `padding`, `font`, `fontColor`, `bgColor`, and `hover`. See [Layout](../../docs/juice/juice-layout.md).
|
|
359
|
+
|
|
360
|
+
## Responsive behavior
|
|
361
|
+
|
|
362
|
+
Built-in breakpoints, `row` collapse, and scaled spacing are documented in [Responsive reference](../../docs/juice/juice-responsive-reference.md).
|
|
363
|
+
|
|
364
|
+
## Surfaces
|
|
365
|
+
|
|
366
|
+
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
|
+
|
|
368
|
+
Variant recipes compose those same roles. Standalone blur uses fixed `6px` / `16px` lengths.
|
|
369
|
+
|
|
370
|
+
See [Surfaces](../../docs/juice/juice-surfaces.md).
|
|
371
|
+
|
|
372
|
+
## Motion
|
|
373
|
+
|
|
374
|
+
Motion is Beta. Use the `motion` attribute for animations (for example `motion="fade.in"`, `motion="spin::fast"`). See [Animations](../../docs/juice/juice-animations.md).
|
|
375
|
+
|
|
376
|
+
## Package surface
|
|
377
|
+
|
|
378
|
+
The production package surface is intentionally small. The stable consumer-facing entrypoints are:
|
|
379
|
+
|
|
380
|
+
- `@citrusworx/juiceui` (`.`)
|
|
381
|
+
- `@citrusworx/juiceui/styles` (`./styles`, core CSS only)
|
|
382
|
+
- `@citrusworx/juiceui/styles/themes/<id>` (`./styles/themes/<id>`, per-theme CSS)
|
|
383
|
+
- the built artifacts in `dist/`
|
|
384
|
+
|
|
385
|
+
`package.json` also exports `./themes/<id>.css`. That path is the same file as `dist/themes/<id>.css`.
|
|
386
|
+
|
|
387
|
+
### Built files
|
|
388
|
+
|
|
389
|
+
If you are hosting Juice assets yourself, the main built files are:
|
|
390
|
+
|
|
391
|
+
- `dist/index.css` (core)
|
|
392
|
+
- `dist/themes/aquaflux.css`
|
|
393
|
+
- `dist/themes/kiwipress.css`
|
|
394
|
+
- `dist/themes/citrusmint.css`
|
|
395
|
+
- `dist/themes/tide.css`
|
|
396
|
+
- `dist/themes/retro-afterburn.css`
|
|
397
|
+
- `dist/themes/retro-arcade-glow.css`
|
|
398
|
+
- `dist/themes/retro-boardwalk.css`
|
|
399
|
+
- `dist/themes/retro-denim-dial.css`
|
|
400
|
+
- `dist/themes/retro-forest-radio.css`
|
|
401
|
+
- `dist/themes/retro-orchard-club.css`
|
|
402
|
+
- `dist/themes/retro-poolside-pop.css`
|
|
403
|
+
- `dist/themes/retro-signal-garden.css`
|
|
404
|
+
- `dist/themes/retro-sunset-motel.css`
|
|
405
|
+
- `dist/themes/retro-violet-parlor.css`
|
|
406
|
+
- `dist/index.js`
|
|
407
|
+
|
|
408
|
+
Load core plus at least one theme CSS file when using `theme="..."` on the root element.
|
|
409
|
+
|
|
410
|
+
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.2`):
|
|
411
|
+
|
|
412
|
+
```html
|
|
413
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.2/dist/index.css" />
|
|
414
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.2/dist/themes/kiwipress.css" />
|
|
415
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@citrusworx/juiceui@0.9.2/dist/index.js"></script>
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
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.2/`.
|
|
419
|
+
|
|
420
|
+
### What the build contains
|
|
421
|
+
|
|
422
|
+
- compiled CSS output at `dist/index.css`
|
|
423
|
+
- compiled JS output at `dist/index.js`
|
|
424
|
+
- color tokens and swatches
|
|
425
|
+
- Google and Adobe font selectors
|
|
426
|
+
- attribute selectors for color, spacing, width, height, gradients, shadows, and icons
|
|
427
|
+
- layout primitives for `stack`, `row`, `grid`, `gap`, and `span`
|
|
428
|
+
- FontAwesome Free icon integration across the solid, regular, and brands sets
|
|
429
|
+
- CSS-only `[skeleton]`, `[list]`, `[badge]` (base layout in 0.9.2; `--juice-badge-*` roles on master), and `[safe-area]`, described above
|
|
430
|
+
- `[avatar]`, `[table]`, `[pressable]`, and `[touchable-row]` runtimes, on master, not in npm 0.9.2
|
|
431
|
+
|
|
432
|
+
<details>
|
|
433
|
+
<summary>Internal workspace assets</summary>
|
|
434
|
+
|
|
435
|
+
The Juice workspace also contains internal-only material that is not part of the published runtime contract:
|
|
436
|
+
|
|
437
|
+
- `src/native/` playground and experiments
|
|
438
|
+
- `src/templates/` HTML examples
|
|
439
|
+
- `src/tools/` compiler helpers
|
|
440
|
+
- `.mockups/` and `test-results/`
|
|
441
|
+
- local build tooling like `gulp.ts`, `vite.config.ts`, and `juice.config.yaml`
|
|
442
|
+
|
|
443
|
+
Those are useful for monorepo development. They are not part of the public API of `@citrusworx/juiceui`.
|
|
444
|
+
|
|
445
|
+
</details>
|
|
446
|
+
|
|
447
|
+
## Migration
|
|
448
|
+
|
|
449
|
+
`@citrusworx/juiceui/styles` is core only. Older packages put theme identity in that entry. That was a breaking change. Import a theme stylesheet explicitly, then set `theme` on the root, as in [Quick start](#quick-start). The split shipped in 0.4.0.
|
|
450
|
+
|
|
451
|
+
## Browser support
|
|
409
452
|
|
|
410
453
|
Juice currently targets modern evergreen browsers:
|
|
411
454
|
|
|
@@ -417,7 +460,7 @@ Juice currently targets modern evergreen browsers:
|
|
|
417
460
|
|
|
418
461
|
The CSS build runs through `autoprefixer` against that package-level browserslist target, so supported-browser behavior is part of the build contract rather than an assumption.
|
|
419
462
|
|
|
420
|
-
## Asset
|
|
463
|
+
## Asset policy
|
|
421
464
|
|
|
422
465
|
Juice ships a large compiled stylesheet plus the icon assets it references.
|
|
423
466
|
|
|
@@ -456,7 +499,7 @@ That lets an app keep its brand config while still relying on Juice for spacing,
|
|
|
456
499
|
|
|
457
500
|
Config is not required to use Juice. The most stable current entrypoint is still the compiled stylesheet plus the existing attribute system.
|
|
458
501
|
|
|
459
|
-
Generate
|
|
502
|
+
Generate or discover themes directly with:
|
|
460
503
|
|
|
461
504
|
```bash
|
|
462
505
|
yarn workspace @citrusworx/juiceui generate:themes
|
|
@@ -485,6 +528,66 @@ That is the minimum publish gate for Juice right now. It rebuilds the package an
|
|
|
485
528
|
|
|
486
529
|
Release notes and versioning should continue to flow through Changesets. The package changelog is consumer-facing and should describe behavior, package contract changes, and dependency updates in plain language instead of internal-only notes.
|
|
487
530
|
|
|
488
|
-
##
|
|
489
|
-
|
|
490
|
-
Internal project docs live in `docs/juice/`.
|
|
531
|
+
## Learn more
|
|
532
|
+
|
|
533
|
+
Internal project docs live in `docs/juice/`. Start with the course. The pages under it are the lookup set.
|
|
534
|
+
|
|
535
|
+
### Course
|
|
536
|
+
|
|
537
|
+
- [Design systems through Juice](../../docs/juice/course/README.md). Do this first.
|
|
538
|
+
- [See it in 10 minutes](../../docs/juice/course/00-first-look.md)
|
|
539
|
+
|
|
540
|
+
### Using Juice
|
|
541
|
+
|
|
542
|
+
- [Docs index](../../docs/juice/README.md)
|
|
543
|
+
- [Getting started](../../docs/juice/juice-getting-started.md)
|
|
544
|
+
- [Attributes](../../docs/juice/juice-attributes.md)
|
|
545
|
+
- [Layout](../../docs/juice/juice-layout.md)
|
|
546
|
+
- [Styles](../../docs/juice/juice-styles.md)
|
|
547
|
+
- [Responsive reference](../../docs/juice/juice-responsive-reference.md)
|
|
548
|
+
- [Surfaces](../../docs/juice/juice-surfaces.md)
|
|
549
|
+
- [Animations](../../docs/juice/juice-animations.md)
|
|
550
|
+
|
|
551
|
+
### Themes
|
|
552
|
+
|
|
553
|
+
- [Theme authoring](../../docs/juice/juice-theme-authoring.md)
|
|
554
|
+
|
|
555
|
+
### Runtimes
|
|
556
|
+
|
|
557
|
+
- [Runtime behavior](../../docs/juice/juice-runtime-behavior.md#juicechange) (`juice:change` and `getState`)
|
|
558
|
+
- [Sig.js + Juice](../../docs/sigjs/sig-juice-integration.md#runtime-binding)
|
|
559
|
+
- [Navigation](../../docs/juice/juice-navigation-runtime.md)
|
|
560
|
+
- [Accordion](../../docs/juice/juice-accordion-runtime.md)
|
|
561
|
+
- [Tabs](../../docs/juice/juice-tabs-runtime.md)
|
|
562
|
+
- [Modal](../../docs/juice/juice-modal-runtime.md)
|
|
563
|
+
- [Drawer](../../docs/juice/juice-drawer-runtime.md)
|
|
564
|
+
- [Toast](../../docs/juice/juice-toast-runtime.md)
|
|
565
|
+
- [Popover](../../docs/juice/juice-popover-runtime.md)
|
|
566
|
+
- [Wizard](../../docs/juice/juice-wizard-runtime.md)
|
|
567
|
+
- [Tooltip](../../docs/juice/juice-tooltip-runtime.md)
|
|
568
|
+
- [Combobox](../../docs/juice/juice-combobox-runtime.md)
|
|
569
|
+
- [Banner](../../docs/juice/juice-banner-runtime.md)
|
|
570
|
+
- [Menu](../../docs/juice/juice-menu-runtime.md)
|
|
571
|
+
- [Switch](../../docs/juice/juice-switch-runtime.md)
|
|
572
|
+
- [Slider](../../docs/juice/juice-slider-runtime.md)
|
|
573
|
+
- [Checkbox](../../docs/juice/juice-checkbox-runtime.md)
|
|
574
|
+
- [Radio](../../docs/juice/juice-radio-runtime.md)
|
|
575
|
+
- [Breadcrumb](../../docs/juice/juice-breadcrumb-runtime.md)
|
|
576
|
+
- [Progress](../../docs/juice/juice-progress-runtime.md)
|
|
577
|
+
- [Pagination](../../docs/juice/juice-pagination-runtime.md)
|
|
578
|
+
- [Disclosure](../../docs/juice/juice-disclosure-runtime.md)
|
|
579
|
+
- [Spinner](../../docs/juice/juice-spinner-runtime.md)
|
|
580
|
+
- [Select](../../docs/juice/juice-select-runtime.md)
|
|
581
|
+
- [Input](../../docs/juice/juice-input-runtime.md)
|
|
582
|
+
- [Textarea](../../docs/juice/juice-textarea-runtime.md)
|
|
583
|
+
- [Field](../../docs/juice/juice-field-runtime.md)
|
|
584
|
+
- [Icon button](../../docs/juice/juice-icon-button-runtime.md)
|
|
585
|
+
- [Avatar](../../docs/juice/juice-avatar.md)
|
|
586
|
+
- [Table](../../docs/juice/juice-table.md)
|
|
587
|
+
|
|
588
|
+
### CSS-only
|
|
589
|
+
|
|
590
|
+
- [Skeleton](../../docs/juice/juice-skeleton.md)
|
|
591
|
+
- [List](../../docs/juice/juice-list.md)
|
|
592
|
+
- [Badge](../../docs/juice/juice-badge.md)
|
|
593
|
+
- [Safe area](../../docs/juice/juice-safe-area.md)
|