@citrusworx/juiceui 0.3.0 → 0.6.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
@@ -1,233 +1,276 @@
1
- # @citrusworx/juiceui
2
-
3
- Juice is an attribute-driven styling library for CitrusWorx apps. It packages the compiled Juice stylesheet and a small JS entrypoint so applications can import shared tokens and styles from one place.
4
-
5
- ## Published Surface
6
-
7
- The production package surface is intentionally small:
8
-
9
- - `@citrusworx/juiceui`
10
- - `@citrusworx/juiceui/styles` (core CSS only)
11
- - `@citrusworx/juiceui/styles/themes/<id>` (per-theme CSS)
12
- - the built artifacts in `dist/`
13
-
14
- These are the stable consumer-facing entrypoints for the package.
15
-
16
- ## Internal Workspace Assets
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`.
27
-
28
- ## Install
29
-
30
- ```bash
31
- yarn add @citrusworx/juiceui
32
- ```
33
-
34
- ## Use the stylesheet
35
-
36
- Core utilities and components (no theme identity):
37
-
38
- ```ts
39
- import "@citrusworx/juiceui/styles";
40
- ```
41
-
42
- ## Themes (Beta)
43
-
44
- **Breaking change:** `@citrusworx/juiceui/styles` is **core only**. Import a theme stylesheet explicitly:
45
-
46
- ```ts
47
- import "@citrusworx/juiceui/styles";
48
- import "@citrusworx/juiceui/styles/themes/aquaflux";
49
- ```
50
-
51
- ```html
52
- <body theme="aquaflux">
53
- <!-- or theme="kiwipress" | theme="citrusmint" -->
54
- </body>
55
- ```
56
-
57
- Built files: `dist/index.css` (core), `dist/themes/<id>.css` (theme). Each theme is authored as `<themeId>.scss` + `<themeId>.yaml` under `src/themes/<themeId>/`. See [docs/juice/juice-theme-authoring.md](../../docs/juice/juice-theme-authoring.md).
58
-
59
- ## Responsive behavior
60
-
61
- Built-in breakpoints, `row` collapse, and scaled spacing are documented in [docs/juice/juice-responsive-reference.md](../../docs/juice/juice-responsive-reference.md).
62
-
63
- ## Surfaces
64
-
65
- Beta-stable: `surfaceTone="soft"`. See [docs/juice/juice-surfaces.md](../../docs/juice/juice-surfaces.md).
66
-
67
- ## Motion (Beta)
68
-
69
- Use the `motion` attribute for animations (for example `motion="fade.in"`, `motion="spin::fast"`). See [docs/juice/juice-animations.md](../../docs/juice/juice-animations.md).
70
-
71
- ## Use the JS API
72
-
73
- ```ts
74
- import {
75
- Accordion,
76
- createNavigation,
77
- initNavigation,
78
- startNavigationRuntime,
79
- stopNavigationRuntime,
80
- tokens
81
- } from "@citrusworx/juiceui";
82
- ```
83
-
84
- The top-level JS entrypoint is intentionally small. Those named exports are the stable runtime API Juice currently promises.
85
-
86
- ## Use the built files directly
87
-
88
- If you are hosting Juice assets yourself, the main built files are:
89
-
90
- - `dist/index.css` (core)
91
- - `dist/themes/aquaflux.css`, `dist/themes/kiwipress.css`, `dist/themes/citrusmint.css`
92
- - `dist/index.js`
93
-
94
- Load core plus at least one theme CSS file when using `theme="..."` on the root element.
95
-
96
- ## Example
97
-
98
- ```html
99
- <section stack gap="1" padding="2rem">
100
- <h1 font="bebas-neue" fontColor="obsidian-900">Juice</h1>
101
- <p font="lato" fontColor="gray-700">
102
- Attribute-driven styling from shared design tokens.
103
- </p>
104
- <button bgColor="green-500" hover="green-600" fontColor="white-100" padding="1rem">
105
- Get started
106
- </button>
107
- </section>
108
- ```
109
-
110
- ## What is implemented today
111
-
112
- - compiled CSS output at `dist/index.css`
113
- - compiled JS output at `dist/index.js`
114
- - color tokens and swatches
115
- - Google and Adobe font selectors
116
- - attribute selectors for color, spacing, width, height, gradients, shadows, and icons
117
- - layout primitives for `stack`, `row`, `grid`, `gap`, and `span`
118
- - FontAwesome Free icon integration across the solid, regular, and brands sets
119
-
120
- ## Accessibility
121
-
122
- Juice keeps styling attribute-first, but interactive patterns still need accessible relationships and names.
123
-
124
- - mobile nav toggles should expose an accessible name and control a sidebar with `aria-controls`
125
- - accordion triggers should use `aria-expanded` and `aria-controls`
126
- - accordion panels should be labeled regions when they contain meaningful content
127
-
128
- ```html
129
- <section accordion name="faq-account">
130
- <button
131
- id="faq-account-trigger"
132
- type="button"
133
- accordion-item
134
- aria-expanded="false"
135
- aria-controls="faq-account-panel"
136
- >
137
- How do I update billing?
138
- </button>
139
-
140
- <div
141
- id="faq-account-panel"
142
- role="region"
143
- aria-labelledby="faq-account-trigger"
144
- hidden
145
- >
146
- Update billing from the account dashboard.
147
- </div>
148
- </section>
149
- ```
150
-
151
- ## Browser Support
152
-
153
- Juice currently targets modern evergreen browsers:
154
-
155
- - the last 2 Chrome versions
156
- - the last 2 Edge versions
157
- - the last 2 Firefox versions
158
- - the last 2 Safari major versions
159
- - iOS Safari `16.4+`
160
-
161
- 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.
162
-
163
- ## Asset Policy
164
-
165
- Juice ships a large compiled stylesheet plus the icon assets it references.
166
-
167
- - `dist/index.css` is the main published stylesheet artifact
168
- - `dist/icons/` is intentionally published and contains the icon SVG payload used by the stylesheet
169
- - texture SVGs are inlined into the compiled CSS during build, so they do not ship as separate runtime files
170
-
171
- Current release policy:
172
-
173
- - keep `dist/index.css` under the current artifact budget
174
- - keep `dist/icons/` under a separate icon payload budget
175
- - avoid adding new runtime asset directories unless they are part of the published package contract
176
-
177
- ## Optional config
178
-
179
- Juice also includes an optional config surface at `juice.config.yaml`.
180
-
181
- This is intended for describing project-level branding concerns like:
182
-
183
- - base colors and swatches
184
- - typography roles
185
- - experimental integration options
186
-
187
- Juice can also generate full theme artifacts from config.
188
-
189
- Library-owned themes can still come from `src/themes/<id>/<id>.config.yaml`.
190
- The generator writes those derived theme contracts into `src/.generated/themes/<id>/` and the build automatically compiles them into `dist/themes/<id>.css`.
191
-
192
- App-owned themes can be generated from an app config and committed or imported locally:
193
-
194
- ```bash
195
- yarn workspace @citrusworx/juiceui generate:themes --config ../../apps/blackwatersound/front/juice.theme.yaml --css-out ../../apps/blackwatersound/front/src/generated/blackwatersound-theme.css
196
- ```
197
-
198
- That lets an app keep its brand config while still relying on Juice for spacing, layout, surfaces, and responsive structure.
199
-
200
- Config is not required to use Juice. The most stable current entrypoint is still the compiled stylesheet plus the existing attribute system.
201
-
202
- Generate/discover themes directly with:
203
-
204
- ```bash
205
- yarn workspace @citrusworx/juiceui generate:themes
206
- ```
207
-
208
- ## Build
209
-
210
- ```bash
211
- yarn workspace @citrusworx/juiceui build
212
- ```
213
-
214
- The build runs:
215
-
216
- - `gulp.ts` to compile `src/juice.scss` into `dist/index.css`
217
- - `vite` to build the JS entrypoint into `dist/index.js`
218
-
219
- ## Release
220
-
221
- Before publishing a new Juice release, run:
222
-
223
- ```bash
224
- yarn workspace @citrusworx/juiceui verify
225
- ```
226
-
227
- That is the minimum publish gate for Juice right now. It rebuilds the package and reruns the package/runtime test suite so the published artifacts, accessibility runtime behavior, and package contract are all checked together.
228
-
229
- 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.
230
-
231
- ## Docs
232
-
233
- Internal project docs live in `docs/juice/`.
1
+ # @citrusworx/juiceui
2
+
3
+ Juice is an attribute-driven styling library for CitrusWorx apps. It packages the compiled Juice stylesheet and a small JS entrypoint so applications can import shared tokens and styles from one place.
4
+
5
+ ## Published Surface
6
+
7
+ The production package surface is intentionally small:
8
+
9
+ - `@citrusworx/juiceui`
10
+ - `@citrusworx/juiceui/styles` (core CSS only)
11
+ - `@citrusworx/juiceui/styles/themes/<id>` (per-theme CSS)
12
+ - the built artifacts in `dist/`
13
+
14
+ These are the stable consumer-facing entrypoints for the package.
15
+
16
+ ## Internal Workspace Assets
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`.
27
+
28
+ ## Install
29
+
30
+ ```bash
31
+ yarn add @citrusworx/juiceui
32
+ ```
33
+
34
+ ## Use the stylesheet
35
+
36
+ Core utilities and components (no theme identity):
37
+
38
+ ```ts
39
+ import "@citrusworx/juiceui/styles";
40
+ ```
41
+
42
+ ## Themes (Beta)
43
+
44
+ **Breaking change:** `@citrusworx/juiceui/styles` is **core only**. Import a theme stylesheet explicitly:
45
+
46
+ ```ts
47
+ import "@citrusworx/juiceui/styles";
48
+ import "@citrusworx/juiceui/styles/themes/aquaflux";
49
+ ```
50
+
51
+ ```html
52
+ <body theme="aquaflux">
53
+ <!-- or theme="kiwipress" | theme="citrusmint" | theme="tide" -->
54
+ </body>
55
+ ```
56
+
57
+ Built files: `dist/index.css` (core), `dist/themes/<id>.css` (theme). Each theme is authored as `<themeId>.scss` + `<themeId>.yaml` under `src/themes/<themeId>/`. See [docs/juice/juice-theme-authoring.md](../../docs/juice/juice-theme-authoring.md).
58
+
59
+ ## Responsive behavior
60
+
61
+ Built-in breakpoints, `row` collapse, and scaled spacing are documented in [docs/juice/juice-responsive-reference.md](../../docs/juice/juice-responsive-reference.md).
62
+
63
+ ## Surfaces
64
+
65
+ 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. Variant recipes compose those same roles. Standalone blur uses fixed `6px` / `16px` lengths. See [docs/juice/juice-surfaces.md](../../docs/juice/juice-surfaces.md).
66
+
67
+ ## Motion (Beta)
68
+
69
+ Use the `motion` attribute for animations (for example `motion="fade.in"`, `motion="spin::fast"`). See [docs/juice/juice-animations.md](../../docs/juice/juice-animations.md).
70
+
71
+ ## Use the JS API
72
+
73
+ ```ts
74
+ import {
75
+ Accordion,
76
+ createAccordion,
77
+ initAccordion,
78
+ startAccordionRuntime,
79
+ stopAccordionRuntime,
80
+ createTabs,
81
+ initTabs,
82
+ startTabsRuntime,
83
+ stopTabsRuntime,
84
+ createModal,
85
+ initModal,
86
+ startModalRuntime,
87
+ stopModalRuntime,
88
+ createNavigation,
89
+ initNavigation,
90
+ startNavigationRuntime,
91
+ stopNavigationRuntime,
92
+ tokens
93
+ } from "@citrusworx/juiceui";
94
+ ```
95
+
96
+ The top-level JS entrypoint is intentionally small. Those named exports are the stable runtime API Juice currently promises.
97
+
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).
99
+
100
+ ## Use the built files directly
101
+
102
+ If you are hosting Juice assets yourself, the main built files are:
103
+
104
+ - `dist/index.css` (core)
105
+ - `dist/themes/aquaflux.css`, `dist/themes/kiwipress.css`, `dist/themes/citrusmint.css`, `dist/themes/tide.css`
106
+ - `dist/index.js`
107
+
108
+ Load core plus at least one theme CSS file when using `theme="..."` on the root element.
109
+
110
+ ## Example
111
+
112
+ ```html
113
+ <section stack gap="1" padding="2rem">
114
+ <h1 font="bebas-neue" fontColor="obsidian-900">Juice</h1>
115
+ <p font="lato" fontColor="gray-700">
116
+ Attribute-driven styling from shared design tokens.
117
+ </p>
118
+ <button bgColor="green-500" hover="green-600" fontColor="white-100" padding="1rem">
119
+ Get started
120
+ </button>
121
+ </section>
122
+ ```
123
+
124
+ ## What is implemented today
125
+
126
+ - compiled CSS output at `dist/index.css`
127
+ - compiled JS output at `dist/index.js`
128
+ - color tokens and swatches
129
+ - Google and Adobe font selectors
130
+ - attribute selectors for color, spacing, width, height, gradients, shadows, and icons
131
+ - layout primitives for `stack`, `row`, `grid`, `gap`, and `span`
132
+ - FontAwesome Free icon integration across the solid, regular, and brands sets
133
+
134
+ ## Accessibility
135
+
136
+ Juice keeps styling attribute-first, but interactive patterns still need accessible relationships and names.
137
+
138
+ - mobile nav toggles should expose an accessible name and control a sidebar with `aria-controls`
139
+ - accordion triggers should use `aria-expanded` and `aria-controls`
140
+ - accordion panels should be labeled regions when they contain meaningful content
141
+ - accordion chrome colors come from `--juice-accordion-*` roles bound by the active theme (Aquaflux, KiwiPress, Citrusmint, and Tide)
142
+ - 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
143
+ - 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]`)
144
+ - optional `[motion="accordion"]` is height easing, not required for show/hide
145
+ - tabs live under a `[tabs]` root with `[tabs-list]`, `[tab]` triggers, and `[tab-panel]` panels; orphan triggers and panels are ignored
146
+ - tab selection dual-writes Juice `[active]` and `aria-selected`; the runtime also wires `role="tablist"` / `tab` / `tabpanel`, roving tabindex, and labeled panels
147
+ - tab chrome colors come from `--juice-tabs-*` roles bound by the active theme (Aquaflux, KiwiPress, Citrusmint, Tide, and generated `--jx-tabs-*` aliases)
148
+ - visible vs hidden tab panels use the native `hidden` attribute; do not use `content="active"` or `content="hidden"` for panel state
149
+ - 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).
150
+
151
+ ```html
152
+ <div tabs name="settings">
153
+ <div tabs-list>
154
+ <button type="button" tab active>Account</button>
155
+ <button type="button" tab>Billing</button>
156
+ </div>
157
+ <div tab-panel>Account panel</div>
158
+ <div tab-panel hidden>Billing panel</div>
159
+ </div>
160
+
161
+ <article aqua-card stack gap="0.5rem" padding="0.75rem">
162
+ <section accordion name="faq-account">
163
+ <button
164
+ id="faq-account-trigger"
165
+ type="button"
166
+ accordion-item
167
+ aria-expanded="false"
168
+ aria-controls="faq-account-panel"
169
+ >
170
+ How do I update billing?
171
+ </button>
172
+
173
+ <div
174
+ id="faq-account-panel"
175
+ role="region"
176
+ aria-labelledby="faq-account-trigger"
177
+ hidden
178
+ >
179
+ Update billing from the account dashboard.
180
+ </div>
181
+ </section>
182
+ </article>
183
+
184
+ <div modal-overlay id="demo-modal" hidden>
185
+ <div modal role="dialog" aria-modal="true" aria-labelledby="demo-title">
186
+ <button type="button" modal-close aria-label="Close">×</button>
187
+ <div modal-header><h2 id="demo-title">Account</h2></div>
188
+ <div modal-body>Update billing from the account dashboard.</div>
189
+ </div>
190
+ </div>
191
+ <button type="button" aria-controls="demo-modal">Open account</button>
192
+ ```
193
+
194
+ ## Browser Support
195
+
196
+ Juice currently targets modern evergreen browsers:
197
+
198
+ - the last 2 Chrome versions
199
+ - the last 2 Edge versions
200
+ - the last 2 Firefox versions
201
+ - the last 2 Safari major versions
202
+ - iOS Safari `16.4+`
203
+
204
+ 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.
205
+
206
+ ## Asset Policy
207
+
208
+ Juice ships a large compiled stylesheet plus the icon assets it references.
209
+
210
+ - `dist/index.css` is the main published stylesheet artifact
211
+ - `dist/icons/` is intentionally published and contains the icon SVG payload used by the stylesheet
212
+ - texture SVGs are inlined into the compiled CSS during build, so they do not ship as separate runtime files
213
+
214
+ Current release policy:
215
+
216
+ - keep `dist/index.css` under the current artifact budget
217
+ - keep `dist/icons/` under a separate icon payload budget
218
+ - avoid adding new runtime asset directories unless they are part of the published package contract
219
+
220
+ ## Optional config
221
+
222
+ Juice also includes an optional config surface at `juice.config.yaml`.
223
+
224
+ This is intended for describing project-level branding concerns like:
225
+
226
+ - base colors and swatches
227
+ - typography roles
228
+ - experimental integration options
229
+
230
+ Juice can also generate full theme artifacts from config.
231
+
232
+ Library-owned themes can still come from `src/themes/<id>/<id>.config.yaml`.
233
+ The generator writes those derived theme contracts into `src/.generated/themes/<id>/` and the build automatically compiles them into `dist/themes/<id>.css`.
234
+
235
+ App-owned themes can be generated from an app config and committed or imported locally:
236
+
237
+ ```bash
238
+ yarn workspace @citrusworx/juiceui generate:themes --config ../../apps/blackwatersound/front/juice.theme.yaml --css-out ../../apps/blackwatersound/front/src/generated/blackwatersound-theme.css
239
+ ```
240
+
241
+ That lets an app keep its brand config while still relying on Juice for spacing, layout, surfaces, and responsive structure.
242
+
243
+ Config is not required to use Juice. The most stable current entrypoint is still the compiled stylesheet plus the existing attribute system.
244
+
245
+ Generate/discover themes directly with:
246
+
247
+ ```bash
248
+ yarn workspace @citrusworx/juiceui generate:themes
249
+ ```
250
+
251
+ ## Build
252
+
253
+ ```bash
254
+ yarn workspace @citrusworx/juiceui build
255
+ ```
256
+
257
+ The build runs:
258
+
259
+ - `gulp.ts` to compile `src/juice.scss` into `dist/index.css`
260
+ - `vite` to build the JS entrypoint into `dist/index.js`
261
+
262
+ ## Release
263
+
264
+ Before publishing a new Juice release, run:
265
+
266
+ ```bash
267
+ yarn workspace @citrusworx/juiceui verify
268
+ ```
269
+
270
+ That is the minimum publish gate for Juice right now. It rebuilds the package and reruns the package/runtime test suite so the published artifacts, accessibility runtime behavior, and package contract are all checked together.
271
+
272
+ 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.
273
+
274
+ ## Docs
275
+
276
+ Internal project docs live in `docs/juice/`.