@techsio/ui-kit 0.61.0 → 0.63.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 +101 -4
- package/dist/atoms/action-icon.js +9 -4
- package/dist/atoms/badge.js +59 -33
- package/dist/atoms/button.js +73 -54
- package/dist/atoms/checkbox.js +5 -1
- package/dist/atoms/hotkeys.js +5 -1
- package/dist/atoms/icon.js +9 -4
- package/dist/atoms/image.js +9 -2
- package/dist/atoms/input.js +10 -6
- package/dist/atoms/label.js +6 -1
- package/dist/atoms/link-button.js +9 -4
- package/dist/atoms/link.js +6 -1
- package/dist/atoms/numeric-input.js +11 -7
- package/dist/atoms/rating.js +5 -1
- package/dist/atoms/skeleton.js +22 -15
- package/dist/atoms/status-text.js +6 -1
- package/dist/atoms/textarea.js +23 -12
- package/dist/atoms/tooltip.js +10 -5
- package/dist/internal/molecules/vertical-navigation.styles.js +7 -7
- package/dist/molecules/accordion.js +20 -14
- package/dist/molecules/availability-status.js +2 -1
- package/dist/molecules/breadcrumb.js +9 -4
- package/dist/molecules/carousel.js +5 -1
- package/dist/molecules/cascade-select.js +8 -4
- package/dist/molecules/color-select.js +5 -1
- package/dist/molecules/combobox.js +8 -4
- package/dist/molecules/date-picker.js +26 -22
- package/dist/molecules/dialog.js +7 -3
- package/dist/molecules/drawer.js +9 -5
- package/dist/molecules/file-upload.js +9 -5
- package/dist/molecules/form-checkbox.js +5 -1
- package/dist/molecules/form-input.js +12 -2
- package/dist/molecules/form-numeric-input.js +11 -1
- package/dist/molecules/form-textarea.js +12 -2
- package/dist/molecules/menu.js +17 -7
- package/dist/molecules/pagination.js +13 -8
- package/dist/molecules/phone-input.js +5 -1
- package/dist/molecules/popover.js +10 -6
- package/dist/molecules/price-block.js +1 -1
- package/dist/molecules/product-card.js +5 -5
- package/dist/molecules/quantity-field.js +5 -1
- package/dist/molecules/radio-card.js +26 -21
- package/dist/molecules/radio-group.js +24 -19
- package/dist/molecules/search-form.js +8 -4
- package/dist/molecules/select.js +8 -4
- package/dist/molecules/slider.js +5 -1
- package/dist/molecules/steps.js +24 -14
- package/dist/molecules/switch.js +5 -1
- package/dist/molecules/tabs.js +13 -8
- package/dist/molecules/toast.js +3 -3
- package/dist/molecules/totals-summary.js +5 -5
- package/dist/molecules/tree-view.js +7 -2
- package/dist/molecules/vertical-navigation.js +23 -13
- package/dist/organisms/data-table.fields.js +2 -2
- package/dist/organisms/data-table.js +41 -23
- package/dist/organisms/footer.js +5 -1
- package/dist/organisms/gallery.js +1 -1
- package/dist/organisms/header.js +7 -3
- package/dist/organisms/line-item.js +2 -2
- package/dist/organisms/sidebar.js +5 -6
- package/dist/organisms/table.js +10 -5
- package/dist/src/atoms/action-icon.d.ts +5 -5
- package/dist/src/atoms/action-icon.d.ts.map +1 -1
- package/dist/src/atoms/badge.d.ts +55 -40
- package/dist/src/atoms/badge.d.ts.map +1 -1
- package/dist/src/atoms/button.d.ts +29 -18
- package/dist/src/atoms/button.d.ts.map +1 -1
- package/dist/src/atoms/checkbox.d.ts +2 -2
- package/dist/src/atoms/checkbox.d.ts.map +1 -1
- package/dist/src/atoms/hotkeys.d.ts +2 -2
- package/dist/src/atoms/hotkeys.d.ts.map +1 -1
- package/dist/src/atoms/icon.d.ts +5 -5
- package/dist/src/atoms/icon.d.ts.map +1 -1
- package/dist/src/atoms/image.d.ts +2 -2
- package/dist/src/atoms/image.d.ts.map +1 -1
- package/dist/src/atoms/input.d.ts +5 -5
- package/dist/src/atoms/input.d.ts.map +1 -1
- package/dist/src/atoms/label.d.ts +2 -2
- package/dist/src/atoms/label.d.ts.map +1 -1
- package/dist/src/atoms/link-button.d.ts +34 -29
- package/dist/src/atoms/link-button.d.ts.map +1 -1
- package/dist/src/atoms/link.d.ts +2 -2
- package/dist/src/atoms/link.d.ts.map +1 -1
- package/dist/src/atoms/numeric-input.d.ts +9 -8
- package/dist/src/atoms/numeric-input.d.ts.map +1 -1
- package/dist/src/atoms/rating.d.ts +2 -2
- package/dist/src/atoms/rating.d.ts.map +1 -1
- package/dist/src/atoms/skeleton.d.ts +9 -9
- package/dist/src/atoms/skeleton.d.ts.map +1 -1
- package/dist/src/atoms/status-text.d.ts +2 -2
- package/dist/src/atoms/status-text.d.ts.map +1 -1
- package/dist/src/atoms/textarea.d.ts +17 -8
- package/dist/src/atoms/textarea.d.ts.map +1 -1
- package/dist/src/atoms/tooltip.d.ts +7 -7
- package/dist/src/atoms/tooltip.d.ts.map +1 -1
- package/dist/src/internal/molecules/vertical-navigation.context.d.ts +2 -2
- package/dist/src/internal/molecules/vertical-navigation.context.d.ts.map +1 -1
- package/dist/src/internal/molecules/vertical-navigation.styles.d.ts +9 -9
- package/dist/src/internal/molecules/vertical-navigation.styles.d.ts.map +1 -1
- package/dist/src/molecules/accordion.d.ts +25 -14
- package/dist/src/molecules/accordion.d.ts.map +1 -1
- package/dist/src/molecules/availability-status.d.ts +1 -1
- package/dist/src/molecules/availability-status.d.ts.map +1 -1
- package/dist/src/molecules/breadcrumb.d.ts +6 -6
- package/dist/src/molecules/breadcrumb.d.ts.map +1 -1
- package/dist/src/molecules/carousel.d.ts +2 -2
- package/dist/src/molecules/carousel.d.ts.map +1 -1
- package/dist/src/molecules/cascade-select.d.ts +3 -3
- package/dist/src/molecules/cascade-select.d.ts.map +1 -1
- package/dist/src/molecules/color-select.d.ts +2 -2
- package/dist/src/molecules/color-select.d.ts.map +1 -1
- package/dist/src/molecules/combobox.d.ts +2 -2
- package/dist/src/molecules/combobox.d.ts.map +1 -1
- package/dist/src/molecules/command.d.ts +1 -1
- package/dist/src/molecules/date-picker.d.ts +5 -5
- package/dist/src/molecules/date-picker.d.ts.map +1 -1
- package/dist/src/molecules/dialog.d.ts +1 -1
- package/dist/src/molecules/dialog.d.ts.map +1 -1
- package/dist/src/molecules/drawer.d.ts +1 -1
- package/dist/src/molecules/drawer.d.ts.map +1 -1
- package/dist/src/molecules/file-upload.d.ts +2 -2
- package/dist/src/molecules/file-upload.d.ts.map +1 -1
- package/dist/src/molecules/form-checkbox.d.ts +1 -1
- package/dist/src/molecules/form-checkbox.d.ts.map +1 -1
- package/dist/src/molecules/form-input.d.ts +2 -2
- package/dist/src/molecules/form-input.d.ts.map +1 -1
- package/dist/src/molecules/form-numeric-input.d.ts +2 -2
- package/dist/src/molecules/form-numeric-input.d.ts.map +1 -1
- package/dist/src/molecules/form-textarea.d.ts +2 -2
- package/dist/src/molecules/form-textarea.d.ts.map +1 -1
- package/dist/src/molecules/menu.d.ts +2 -2
- package/dist/src/molecules/menu.d.ts.map +1 -1
- package/dist/src/molecules/pagination.d.ts +15 -15
- package/dist/src/molecules/pagination.d.ts.map +1 -1
- package/dist/src/molecules/phone-input.d.ts +2 -2
- package/dist/src/molecules/phone-input.d.ts.map +1 -1
- package/dist/src/molecules/popover.d.ts +4 -4
- package/dist/src/molecules/popover.d.ts.map +1 -1
- package/dist/src/molecules/price-block.d.ts +1 -1
- package/dist/src/molecules/product-card.d.ts +7 -7
- package/dist/src/molecules/product-card.d.ts.map +1 -1
- package/dist/src/molecules/quantity-field.d.ts +2 -2
- package/dist/src/molecules/quantity-field.d.ts.map +1 -1
- package/dist/src/molecules/radio-card.d.ts +7 -7
- package/dist/src/molecules/radio-card.d.ts.map +1 -1
- package/dist/src/molecules/radio-group.d.ts +7 -7
- package/dist/src/molecules/radio-group.d.ts.map +1 -1
- package/dist/src/molecules/search-form.d.ts +3 -3
- package/dist/src/molecules/search-form.d.ts.map +1 -1
- package/dist/src/molecules/select.d.ts +1 -1
- package/dist/src/molecules/select.d.ts.map +1 -1
- package/dist/src/molecules/slider.d.ts +1 -1
- package/dist/src/molecules/slider.d.ts.map +1 -1
- package/dist/src/molecules/steps.d.ts +7 -7
- package/dist/src/molecules/steps.d.ts.map +1 -1
- package/dist/src/molecules/switch.d.ts +1 -1
- package/dist/src/molecules/switch.d.ts.map +1 -1
- package/dist/src/molecules/tabs.d.ts +8 -8
- package/dist/src/molecules/tabs.d.ts.map +1 -1
- package/dist/src/molecules/totals-summary.d.ts +2 -2
- package/dist/src/molecules/tour.d.ts +1 -1
- package/dist/src/molecules/tree-view.d.ts +1 -1
- package/dist/src/molecules/tree-view.d.ts.map +1 -1
- package/dist/src/molecules/vertical-navigation.d.ts +13 -11
- package/dist/src/molecules/vertical-navigation.d.ts.map +1 -1
- package/dist/src/organisms/data-table.d.ts +5 -5
- package/dist/src/organisms/data-table.d.ts.map +1 -1
- package/dist/src/organisms/footer.d.ts +2 -2
- package/dist/src/organisms/footer.d.ts.map +1 -1
- package/dist/src/organisms/gallery.d.ts +1 -1
- package/dist/src/organisms/header.d.ts +2 -2
- package/dist/src/organisms/header.d.ts.map +1 -1
- package/dist/src/organisms/line-item.d.ts +2 -2
- package/dist/src/organisms/line-item.d.ts.map +1 -1
- package/dist/src/organisms/sidebar.d.ts +4 -3
- package/dist/src/organisms/sidebar.d.ts.map +1 -1
- package/dist/src/organisms/table.d.ts +5 -5
- package/dist/src/organisms/table.d.ts.map +1 -1
- package/dist/src/templates/accordion.d.ts +2 -2
- package/dist/src/templates/accordion.d.ts.map +1 -1
- package/dist/src/templates/breadcrumb.d.ts +1 -1
- package/dist/src/templates/carousel.d.ts +1 -1
- package/dist/src/templates/facet-filter-panel.d.ts +1 -1
- package/dist/src/templates/facet-filter-panel.d.ts.map +1 -1
- package/dist/src/templates/gallery.d.ts +1 -1
- package/dist/src/templates/numeric-input.d.ts +1 -1
- package/dist/src/templates/popover.d.ts +1 -1
- package/dist/src/templates/product-card.d.ts +1 -1
- package/dist/src/templates/select.d.ts +1 -1
- package/dist/src/templates/tabs.d.ts +2 -2
- package/dist/src/templates/tabs.d.ts.map +1 -1
- package/dist/src/theme/theme-config.d.ts +11 -0
- package/dist/src/theme/theme-config.d.ts.map +1 -1
- package/dist/src/theme/theme-provider.d.ts.map +1 -1
- package/dist/src/theme/ui-provider.d.ts +48 -0
- package/dist/src/theme/ui-provider.d.ts.map +1 -0
- package/dist/templates/accordion.js +1 -3
- package/dist/templates/facet-filter-panel.js +20 -9
- package/dist/templates/product-card.js +3 -3
- package/dist/templates/tabs.js +1 -3
- package/dist/theme/theme-config.js +12 -1
- package/dist/theme/theme-provider.js +6 -2
- package/dist/theme/theme-toggle.js +4 -4
- package/dist/theme/ui-provider.js +53 -0
- package/package.json +1 -2
- package/src/tokens/_foundation-overrides.css +1 -1
- package/src/tokens/_scheme-scopes.css +9 -0
- package/src/tokens/_semantic.css +1 -1
- package/src/tokens/_shape.css +125 -0
- package/src/tokens/_tokens-base.css +1 -0
- package/src/tokens/components/atoms/_action-icon.css +1 -1
- package/src/tokens/components/atoms/_badge.css +13 -0
- package/src/tokens/components/atoms/_icon.css +1 -1
- package/src/tokens/components/molecules/_chart.css +1 -1
- package/src/tokens/components/molecules/_combobox.css +1 -1
package/README.md
CHANGED
|
@@ -132,6 +132,101 @@ do not access those members on a client reference from a server page. Callbacks
|
|
|
132
132
|
and render functions belong in client code. Ordinary SSR and RSC are separate
|
|
133
133
|
integration contracts.
|
|
134
134
|
|
|
135
|
+
## Global size and appearance (`UIProvider`)
|
|
136
|
+
|
|
137
|
+
Every component uses the same names for the same visual axis:
|
|
138
|
+
|
|
139
|
+
| Prop | Meaning | Values |
|
|
140
|
+
|---|---|---|
|
|
141
|
+
| `appearance` | fill style | `solid` · `subtle` · `outline` · `ghost` (no frame — buttons, Pagination, Accordion, Textarea) · `plain` (Breadcrumb, VerticalNavigation) (+ component extras such as Tabs `line`) |
|
|
142
|
+
| `severity` | color intent | `primary` · `secondary` · `tertiary` · `neutral` · `info` · `success` · `warning` · `danger` · `discount` |
|
|
143
|
+
| `validateStatus` | validation state | `default` · `error` · `success` · `warning` |
|
|
144
|
+
| `size` | size scale | the component's subset of `xs`…`2xl`, plus `full` / `current` |
|
|
145
|
+
|
|
146
|
+
`UIProvider` sets `size` and `appearance` for every component below it:
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
'use client'
|
|
150
|
+
|
|
151
|
+
import { UIProvider } from '@techsio/ui-kit/theme/ui-provider'
|
|
152
|
+
|
|
153
|
+
export function Defaults({ children }: PropsWithChildren) {
|
|
154
|
+
return (
|
|
155
|
+
<UIProvider
|
|
156
|
+
size="md"
|
|
157
|
+
appearance="solid"
|
|
158
|
+
components={{ Button: { appearance: 'outline' }, Dialog: { size: 'lg' } }}
|
|
159
|
+
>
|
|
160
|
+
{children}
|
|
161
|
+
</UIProvider>
|
|
162
|
+
)
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
A value resolves as: the prop on the component → `components[Name]` of the
|
|
167
|
+
nearest provider → its global value → the same for each parent provider →
|
|
168
|
+
the component's own default. A value a component does not support (for example
|
|
169
|
+
`appearance="ghost"` on Tabs) is skipped, so the component keeps its default.
|
|
170
|
+
Providers nest, so a dense toolbar can wrap its controls in `size="sm"`.
|
|
171
|
+
|
|
172
|
+
`AppThemeProvider` already renders a root `UIProvider` with the
|
|
173
|
+
`size="md" appearance="solid"` baseline, merged with the active brand's
|
|
174
|
+
optional `defaults` from `theme-config.ts`. Without any provider every
|
|
175
|
+
component keeps its own default.
|
|
176
|
+
|
|
177
|
+
### Migrating from `variant` / `theme` / `tone`
|
|
178
|
+
|
|
179
|
+
```sh
|
|
180
|
+
# from a new-engine checkout, against the app's sources
|
|
181
|
+
node <new-engine>/libs/ui/codemods/unified-style-props/index.mjs <app>/src # rewrite
|
|
182
|
+
node <new-engine>/libs/ui/codemods/unified-style-props/index.mjs <app>/src --dry # preview
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
The codemod rewrites JSX props and literal values (`theme="outlined"` →
|
|
186
|
+
`appearance="outline"`, Button `variant` → `severity`, Badge
|
|
187
|
+
`variant="outline"` → `appearance="outline" severity="neutral"`, Input
|
|
188
|
+
`variant` → `validateStatus`, …) and lists what it could not map: computed values, and object literals (it
|
|
189
|
+
never rewrites data such as stored settings).
|
|
190
|
+
Run your type checker afterwards; story `args`, wrapper components and
|
|
191
|
+
data objects are reported there. The full table is in
|
|
192
|
+
`codemods/unified-style-props/README.md`.
|
|
193
|
+
## Shape utilities (`corner-shape`, `border-shape`)
|
|
194
|
+
|
|
195
|
+
The kit ships utilities for two CSS properties that Tailwind and Figma do not
|
|
196
|
+
cover yet. They are defined in `src/tokens/_shape.css` and included in the
|
|
197
|
+
`tokens` and `tokens-with-tailwind` entry points (through `_tokens-base`). The
|
|
198
|
+
`tokens/*` export maps to single files, so if you compose individual token
|
|
199
|
+
files instead, import `@techsio/ui-kit/tokens/_shape` explicitly to get the
|
|
200
|
+
`corner-*` and `border-shape-*` utilities.
|
|
201
|
+
|
|
202
|
+
`corner-*` sets [`corner-shape`](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/corner-shape)
|
|
203
|
+
(Chrome/Edge 139+, Safari 27.3+). It reshapes the curve that `rounded-*`
|
|
204
|
+
draws; background, border, outline and shadow follow it:
|
|
205
|
+
|
|
206
|
+
```tsx
|
|
207
|
+
<div className="rounded-2xl corner-squircle" /> {/* all corners */}
|
|
208
|
+
<div className="rounded-lg corner-t-bevel" /> {/* top side */}
|
|
209
|
+
<div className="rounded-lg corner-ss-scoop" /> {/* logical start-start corner */}
|
|
210
|
+
<div className="rounded-2xl corner-[superellipse(1.5)]" /> {/* any curve */}
|
|
211
|
+
<div className="rounded-lg corner-base" /> {/* brand default */}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
- Values: `round` (default), `squircle`, `bevel`, `scoop`, `notch`, `square`,
|
|
215
|
+
or `superellipse(<number>)`. Sides `t r b l s e`, corners `tl tr br bl ss se es ee`.
|
|
216
|
+
- Without a radius it does nothing. Browsers without support ignore it and keep
|
|
217
|
+
the rounded corner. Use `supports-[corner-shape:squircle]:` for another fallback.
|
|
218
|
+
- `corner-base` reads `--corner-shape-base`; override it per brand to reshape
|
|
219
|
+
everything that uses it (see the `app-token-overrides` skill).
|
|
220
|
+
- Figma's corner smoothing (~60%, iOS) is the nearest look: use `corner-squircle`.
|
|
221
|
+
|
|
222
|
+
`border-shape-*` sets [`border-shape`](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/border-shape)
|
|
223
|
+
and is **experimental** (Chrome 147+ only): `border-shape-[circle(50%)]` strokes
|
|
224
|
+
the border along a shape, `border-shape-[<outer>_<inner>]` fills between two,
|
|
225
|
+
`border-shape-none` resets it. It ignores `rounded-*`/`corner-*`, renders solid
|
|
226
|
+
and changes the hit area; other browsers show the normal rectangular border.
|
|
227
|
+
|
|
228
|
+
Live examples: Storybook → Overview → Shape.
|
|
229
|
+
|
|
135
230
|
## Source layout and token ownership
|
|
136
231
|
|
|
137
232
|
```text
|
|
@@ -209,6 +304,8 @@ Pick the smallest run that answers your question:
|
|
|
209
304
|
| The change is intended and I need new baselines | let CI fail, then `pnpm -C libs/ui baselines:pull --pr <number>` | one CI run |
|
|
210
305
|
|
|
211
306
|
CI renders the committed Linux baselines on `linux/amd64` and is the authority for them.
|
|
307
|
+
Each screenshot story owns a fresh browser context and gets one capture attempt.
|
|
308
|
+
Neither full nor changed CI accepts a successful fallback after a failed first render.
|
|
212
309
|
|
|
213
310
|
To keep screenshots stable across machines, comparisons against the committed baselines run inside Docker.
|
|
214
311
|
|
|
@@ -244,7 +341,7 @@ Optional environment overrides:
|
|
|
244
341
|
- `TEST_STORIES` (comma-separated Storybook story ids to run, e.g. `atoms-button--states,molecules-productcard--layout-variants`)
|
|
245
342
|
- `PLAYWRIGHT_WORKERS` (override worker count for parallel runs)
|
|
246
343
|
- `VISUAL_ASSET_HAR_PATH` (absolute path to an alternative HAR; its directory and attachments mount read-only)
|
|
247
|
-
- `PLAYWRIGHT_DOCKER_IMAGE` (default: `new-engine-ui-playwright:<Playwright version>-<Dockerfile hash>`, with an `-arm64` suffix on `linux/arm64
|
|
344
|
+
- `PLAYWRIGHT_DOCKER_IMAGE` (default: `new-engine-ui-playwright:<Playwright version>-<Dockerfile hash>`, with an `-arm64` suffix on `linux/arm64`; CI caches the image by Dockerfile content, and a cache miss builds it from that Dockerfile)
|
|
248
345
|
- `PLAYWRIGHT_DOCKER_PLATFORM` (`linux/amd64` or `linux/arm64`; default: host architecture, or `linux/amd64` for snapshot updates and release runs)
|
|
249
346
|
- `PLAYWRIGHT_DOCKER_SHM_SIZE` (default: `2g`, improves Playwright stability in Docker)
|
|
250
347
|
- `PLAYWRIGHT_DOCKER_IPC` (default: `host`, improves Playwright stability in Docker)
|
|
@@ -258,8 +355,8 @@ Optional environment overrides:
|
|
|
258
355
|
|
|
259
356
|
Example: `VISUAL_CHANGED_SINCE=origin/master pnpm -C libs/ui test:components`
|
|
260
357
|
|
|
261
|
-
Extra arguments are passed to `playwright test`, e.g. `pnpm -C libs/ui test:components -- --project=n1-mobile-light`.
|
|
262
|
-
Comparison runs use the host architecture (native arm64 on Apple Silicon); snapshot updates and release runs always use `linux/amd64`, matching the committed baselines. `PLAYWRIGHT_DOCKER_PLATFORM` overrides both. A full run must cover every story in every visual project; component behavior specs (`test/*.spec.ts`) run once in the `desktop` and `mobile` projects.
|
|
358
|
+
Extra arguments are passed to `playwright test`, e.g. `VISUAL_BRANDS=n1 pnpm -C libs/ui test:components -- --project=n1-mobile-light`.
|
|
359
|
+
Comparison runs use the host architecture (native arm64 on Apple Silicon); snapshot updates and release runs always use `linux/amd64`, matching the committed baselines. `PLAYWRIGHT_DOCKER_PLATFORM` overrides both. CI checks every story on all three desktop brands and on business mobile WebKit; brand-locked stories retain their own brand on mobile. Brand × phone cross-products are not gated. Set `VISUAL_BRANDS=akros` or `VISUAL_BRANDS=n1` to diagnose those phone projects locally. A full run must cover every story in every declared visual project; component behavior specs (`test/*.spec.ts`) run once in the `desktop` and `mobile` projects.
|
|
263
360
|
|
|
264
361
|
### Known differences on `linux/arm64`
|
|
265
362
|
|
|
@@ -315,7 +412,7 @@ and serial Docker wrapper, never concurrent ad hoc browser launches.
|
|
|
315
412
|
- Exports only, no barrel: import from explicit subpaths (e.g. `@techsio/ui-kit/atoms/button`, `@techsio/ui-kit/templates/accordion`, `@techsio/ui-kit/utils`). The package root is intentionally not exported.
|
|
316
413
|
- Automated releases: `libs/ui/release.config.mjs` uses semantic-release (tag format `ui-kit-v<version>`) to publish to npm and create GitHub releases without pushing generated version/changelog commits back to the protected branch. While we are <1.0.0, `BREAKING CHANGE` commits are forced to “minor” bumps to stay in 0.x; remove that release rule when stabilizing for 1.0.0+ to restore SemVer majors.
|
|
317
414
|
- Security posture: releases are restricted to GitHub Actions (`GITHUB_ACTIONS` required), npm publishes use trusted publishing through GitHub OIDC (`id-token: write`) and do not require an npm token.
|
|
318
|
-
- CI
|
|
415
|
+
- CI's `main` job checks the workspace on Node 24 and the UI package's types, unit/SSR/tooling tests, tokens and package output on Node 26. `.github/workflows/ui-quality.yml` plans the Docker component and three-theme accessibility checks. Results append once per story; summaries are generated after the workers finish. Release follows successful master push CI for the exact SHA instead of repeating validation. Manual `force_release` changes affected detection only; it cannot bypass the exact-SHA CI gate.
|
|
319
416
|
- Local semantic-release (including `--dry-run`) is intentionally unsupported. Use `pnpm -C libs/ui typecheck`, `test`, and `check:package` locally; never set `GITHUB_ACTIONS=true` to impersonate CI.
|
|
320
417
|
- Commit format: follow Conventional Commits (`feat:`, `fix:`, `chore:`, `BREAKING CHANGE:`) so semantic-release can infer the correct version bump.
|
|
321
418
|
- Required CI secrets: none for npm publishing; npm trusted publishing must be configured on npmjs.com for this repository and workflow path.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
2
4
|
import { tv } from "../utils.js";
|
|
3
5
|
import { Icon } from "./icon.js";
|
|
4
6
|
const actionIconVariants = tv({
|
|
@@ -16,7 +18,7 @@ const actionIconVariants = tv({
|
|
|
16
18
|
md: "size-icon-control-md text-action-icon-md",
|
|
17
19
|
lg: "size-action-icon-lg text-action-icon-lg"
|
|
18
20
|
},
|
|
19
|
-
|
|
21
|
+
severity: {
|
|
20
22
|
neutral: [
|
|
21
23
|
"not-disabled:hover:bg-icon-control-bg-hover",
|
|
22
24
|
"not-disabled:active:bg-icon-control-bg-active"
|
|
@@ -30,14 +32,17 @@ const actionIconVariants = tv({
|
|
|
30
32
|
},
|
|
31
33
|
defaultVariants: {
|
|
32
34
|
size: "md",
|
|
33
|
-
|
|
35
|
+
severity: "neutral"
|
|
34
36
|
}
|
|
35
37
|
});
|
|
36
|
-
function ActionIcon({ icon, size,
|
|
38
|
+
function ActionIcon({ icon, size: sizeProp, severity, type = "button", className, ref, ...props }) {
|
|
39
|
+
const { size } = useUIDefaults("ActionIcon", {
|
|
40
|
+
size: sizeProp
|
|
41
|
+
}, actionIconVariants);
|
|
37
42
|
return /*#__PURE__*/ jsx("button", {
|
|
38
43
|
className: actionIconVariants({
|
|
39
44
|
size,
|
|
40
|
-
|
|
45
|
+
severity,
|
|
41
46
|
className
|
|
42
47
|
}),
|
|
43
48
|
ref: ref,
|
package/dist/atoms/badge.js
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
2
4
|
import { tv } from "../utils.js";
|
|
5
|
+
const SOLID_SEVERITY = {
|
|
6
|
+
primary: "border-badge-border-primary bg-badge-bg-primary text-badge-fg-primary",
|
|
7
|
+
secondary: "border-badge-border-secondary bg-badge-bg-secondary text-badge-fg-secondary",
|
|
8
|
+
tertiary: "border-badge-border-tertiary bg-badge-bg-tertiary text-badge-fg-tertiary",
|
|
9
|
+
discount: "border-badge-border-discount bg-badge-bg-discount text-badge-fg-discount",
|
|
10
|
+
info: "border-badge-border-info bg-badge-bg-info text-badge-fg-info",
|
|
11
|
+
success: "border-badge-border-success bg-badge-bg-success text-badge-fg-success",
|
|
12
|
+
warning: "border-badge-border-warning bg-badge-bg-warning text-badge-fg-warning",
|
|
13
|
+
danger: "border-badge-border-danger bg-badge-bg-danger text-badge-fg-danger"
|
|
14
|
+
};
|
|
15
|
+
const OUTLINE_BORDER = {
|
|
16
|
+
primary: "border-badge-border-outline-primary",
|
|
17
|
+
secondary: "border-badge-border-outline-secondary",
|
|
18
|
+
tertiary: "border-badge-border-outline-tertiary",
|
|
19
|
+
discount: "border-badge-border-outline-discount",
|
|
20
|
+
info: "border-badge-border-outline-info",
|
|
21
|
+
success: "border-badge-border-outline-success",
|
|
22
|
+
warning: "border-badge-border-outline-warning",
|
|
23
|
+
danger: "border-badge-border-outline-danger"
|
|
24
|
+
};
|
|
3
25
|
const badgeVariants = tv({
|
|
4
26
|
base: [
|
|
5
27
|
"inline-flex items-center justify-center",
|
|
@@ -7,35 +29,21 @@ const badgeVariants = tv({
|
|
|
7
29
|
"border-(length:--border-width-badge)"
|
|
8
30
|
],
|
|
9
31
|
variants: {
|
|
10
|
-
|
|
11
|
-
primary:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
],
|
|
26
|
-
success: [
|
|
27
|
-
"border-badge-border-success bg-badge-bg-success text-badge-fg-success"
|
|
28
|
-
],
|
|
29
|
-
warning: [
|
|
30
|
-
"border-badge-border-warning bg-badge-bg-warning text-badge-fg-warning"
|
|
31
|
-
],
|
|
32
|
-
danger: [
|
|
33
|
-
"border-badge-border-danger bg-badge-bg-danger text-badge-fg-danger"
|
|
34
|
-
],
|
|
35
|
-
outline: [
|
|
36
|
-
"border-badge-border-outline bg-badge-bg-outline text-badge-fg-outline"
|
|
37
|
-
],
|
|
38
|
-
dynamic: []
|
|
32
|
+
severity: {
|
|
33
|
+
primary: "",
|
|
34
|
+
secondary: "",
|
|
35
|
+
tertiary: "",
|
|
36
|
+
discount: "",
|
|
37
|
+
info: "",
|
|
38
|
+
success: "",
|
|
39
|
+
warning: "",
|
|
40
|
+
danger: "",
|
|
41
|
+
neutral: "border-badge-border-outline bg-badge-bg-outline text-badge-fg-outline",
|
|
42
|
+
custom: ""
|
|
43
|
+
},
|
|
44
|
+
appearance: {
|
|
45
|
+
solid: "",
|
|
46
|
+
outline: "bg-badge-bg-outline text-badge-fg-outline"
|
|
39
47
|
},
|
|
40
48
|
size: {
|
|
41
49
|
sm: [
|
|
@@ -56,13 +64,30 @@ const badgeVariants = tv({
|
|
|
56
64
|
]
|
|
57
65
|
}
|
|
58
66
|
},
|
|
67
|
+
compoundVariants: [
|
|
68
|
+
...Object.entries(SOLID_SEVERITY).map(([severity, className])=>({
|
|
69
|
+
severity: severity,
|
|
70
|
+
appearance: "solid",
|
|
71
|
+
className
|
|
72
|
+
})),
|
|
73
|
+
...Object.entries(OUTLINE_BORDER).map(([severity, className])=>({
|
|
74
|
+
severity: severity,
|
|
75
|
+
appearance: "outline",
|
|
76
|
+
className
|
|
77
|
+
}))
|
|
78
|
+
],
|
|
59
79
|
defaultVariants: {
|
|
60
|
-
|
|
80
|
+
severity: "info",
|
|
81
|
+
appearance: "solid",
|
|
61
82
|
size: "md"
|
|
62
83
|
}
|
|
63
84
|
});
|
|
64
|
-
function Badge({
|
|
65
|
-
const
|
|
85
|
+
function Badge({ severity, size: sizeProp, appearance: appearanceProp, className, children, style, ...props }) {
|
|
86
|
+
const { size, appearance } = useUIDefaults("Badge", {
|
|
87
|
+
size: sizeProp,
|
|
88
|
+
appearance: appearanceProp
|
|
89
|
+
}, badgeVariants);
|
|
90
|
+
const isDynamic = "custom" === severity;
|
|
66
91
|
const { bgColor, fgColor, borderColor, ...restProps } = props;
|
|
67
92
|
const dynamicStyles = isDynamic ? {
|
|
68
93
|
...style,
|
|
@@ -72,7 +97,8 @@ function Badge({ variant, size, className, children, style, ...props }) {
|
|
|
72
97
|
} : style;
|
|
73
98
|
return /*#__PURE__*/ jsx("span", {
|
|
74
99
|
className: badgeVariants({
|
|
75
|
-
|
|
100
|
+
severity,
|
|
101
|
+
appearance,
|
|
76
102
|
size,
|
|
77
103
|
className
|
|
78
104
|
}),
|
package/dist/atoms/button.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useImperativeHandle, useRef } from "react";
|
|
4
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
4
5
|
import { tv } from "../utils.js";
|
|
5
6
|
import { Icon } from "./icon.js";
|
|
6
7
|
const buttonVariants = tv({
|
|
@@ -26,18 +27,18 @@ const buttonVariants = tv({
|
|
|
26
27
|
default: "",
|
|
27
28
|
compact: ""
|
|
28
29
|
},
|
|
29
|
-
|
|
30
|
+
severity: {
|
|
30
31
|
primary: "",
|
|
31
32
|
secondary: "",
|
|
32
33
|
tertiary: "",
|
|
33
34
|
danger: "",
|
|
34
35
|
warning: ""
|
|
35
36
|
},
|
|
36
|
-
|
|
37
|
+
appearance: {
|
|
37
38
|
solid: "disabled:bg-button-bg-disabled",
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
subtle: "disabled:bg-button-bg-disabled",
|
|
40
|
+
ghost: "button-disabled-borderless bg-button-bg-borderless-base hover:bg-button-bg-borderless-hover hover:text-button-fg-interacting active:bg-button-bg-borderless-active active:text-button-fg-interacting",
|
|
41
|
+
outline: "button-disabled-outlined border bg-button-bg-outlined",
|
|
41
42
|
unstyled: ""
|
|
42
43
|
},
|
|
43
44
|
uppercase: {
|
|
@@ -85,8 +86,8 @@ const buttonVariants = tv({
|
|
|
85
86
|
className: "h-button-compact-lg p-button-compact-lg"
|
|
86
87
|
},
|
|
87
88
|
{
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
severity: "primary",
|
|
90
|
+
appearance: "solid",
|
|
90
91
|
className: [
|
|
91
92
|
"bg-button-bg-primary-base",
|
|
92
93
|
"hover:bg-button-bg-primary-hover",
|
|
@@ -95,8 +96,8 @@ const buttonVariants = tv({
|
|
|
95
96
|
]
|
|
96
97
|
},
|
|
97
98
|
{
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
severity: "secondary",
|
|
100
|
+
appearance: "solid",
|
|
100
101
|
className: [
|
|
101
102
|
"bg-button-bg-secondary-base",
|
|
102
103
|
"hover:bg-button-bg-secondary-hover",
|
|
@@ -105,8 +106,8 @@ const buttonVariants = tv({
|
|
|
105
106
|
]
|
|
106
107
|
},
|
|
107
108
|
{
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
severity: "tertiary",
|
|
110
|
+
appearance: "solid",
|
|
110
111
|
className: [
|
|
111
112
|
"bg-button-bg-tertiary-base",
|
|
112
113
|
"hover:bg-button-bg-tertiary-hover",
|
|
@@ -115,8 +116,8 @@ const buttonVariants = tv({
|
|
|
115
116
|
]
|
|
116
117
|
},
|
|
117
118
|
{
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
severity: "warning",
|
|
120
|
+
appearance: "solid",
|
|
120
121
|
className: [
|
|
121
122
|
"bg-button-bg-warning-base",
|
|
122
123
|
"hover:bg-button-bg-warning-hover",
|
|
@@ -125,8 +126,8 @@ const buttonVariants = tv({
|
|
|
125
126
|
]
|
|
126
127
|
},
|
|
127
128
|
{
|
|
128
|
-
|
|
129
|
-
|
|
129
|
+
severity: "danger",
|
|
130
|
+
appearance: "solid",
|
|
130
131
|
className: [
|
|
131
132
|
"bg-button-bg-danger-base",
|
|
132
133
|
"hover:bg-button-bg-danger-hover",
|
|
@@ -135,8 +136,8 @@ const buttonVariants = tv({
|
|
|
135
136
|
]
|
|
136
137
|
},
|
|
137
138
|
{
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
severity: "primary",
|
|
140
|
+
appearance: "subtle",
|
|
140
141
|
className: [
|
|
141
142
|
"bg-button-bg-primary-light-base",
|
|
142
143
|
"hover:bg-button-bg-primary-light-hover",
|
|
@@ -145,8 +146,8 @@ const buttonVariants = tv({
|
|
|
145
146
|
]
|
|
146
147
|
},
|
|
147
148
|
{
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
severity: "secondary",
|
|
150
|
+
appearance: "subtle",
|
|
150
151
|
className: [
|
|
151
152
|
"bg-button-bg-secondary-light-base",
|
|
152
153
|
"hover:bg-button-bg-secondary-light-hover",
|
|
@@ -155,8 +156,8 @@ const buttonVariants = tv({
|
|
|
155
156
|
]
|
|
156
157
|
},
|
|
157
158
|
{
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
severity: "tertiary",
|
|
160
|
+
appearance: "subtle",
|
|
160
161
|
className: [
|
|
161
162
|
"bg-button-bg-tertiary-light-base",
|
|
162
163
|
"hover:bg-button-bg-tertiary-light-hover",
|
|
@@ -165,8 +166,8 @@ const buttonVariants = tv({
|
|
|
165
166
|
]
|
|
166
167
|
},
|
|
167
168
|
{
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
severity: "warning",
|
|
170
|
+
appearance: "subtle",
|
|
170
171
|
className: [
|
|
171
172
|
"bg-button-bg-warning-light-base",
|
|
172
173
|
"hover:bg-button-bg-warning-light-hover",
|
|
@@ -175,8 +176,8 @@ const buttonVariants = tv({
|
|
|
175
176
|
]
|
|
176
177
|
},
|
|
177
178
|
{
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
severity: "danger",
|
|
180
|
+
appearance: "subtle",
|
|
180
181
|
className: [
|
|
181
182
|
"bg-button-bg-danger-light-base",
|
|
182
183
|
"hover:bg-button-bg-danger-light-hover",
|
|
@@ -185,8 +186,8 @@ const buttonVariants = tv({
|
|
|
185
186
|
]
|
|
186
187
|
},
|
|
187
188
|
{
|
|
188
|
-
|
|
189
|
-
|
|
189
|
+
severity: "primary",
|
|
190
|
+
appearance: "outline",
|
|
190
191
|
className: [
|
|
191
192
|
"border-button-border-primary",
|
|
192
193
|
"hover:bg-button-bg-outlined-primary-hover",
|
|
@@ -195,8 +196,8 @@ const buttonVariants = tv({
|
|
|
195
196
|
]
|
|
196
197
|
},
|
|
197
198
|
{
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
severity: "secondary",
|
|
200
|
+
appearance: "outline",
|
|
200
201
|
className: [
|
|
201
202
|
"border-button-border-secondary",
|
|
202
203
|
"hover:bg-button-bg-outlined-secondary-hover",
|
|
@@ -205,8 +206,8 @@ const buttonVariants = tv({
|
|
|
205
206
|
]
|
|
206
207
|
},
|
|
207
208
|
{
|
|
208
|
-
|
|
209
|
-
|
|
209
|
+
severity: "tertiary",
|
|
210
|
+
appearance: "outline",
|
|
210
211
|
className: [
|
|
211
212
|
"border-button-border-tertiary",
|
|
212
213
|
"hover:bg-button-bg-outlined-tertiary-hover",
|
|
@@ -215,8 +216,8 @@ const buttonVariants = tv({
|
|
|
215
216
|
]
|
|
216
217
|
},
|
|
217
218
|
{
|
|
218
|
-
|
|
219
|
-
|
|
219
|
+
severity: "warning",
|
|
220
|
+
appearance: "outline",
|
|
220
221
|
className: [
|
|
221
222
|
"border-button-border-warning",
|
|
222
223
|
"hover:bg-button-bg-outlined-warning-hover",
|
|
@@ -225,8 +226,8 @@ const buttonVariants = tv({
|
|
|
225
226
|
]
|
|
226
227
|
},
|
|
227
228
|
{
|
|
228
|
-
|
|
229
|
-
|
|
229
|
+
severity: "danger",
|
|
230
|
+
appearance: "outline",
|
|
230
231
|
className: [
|
|
231
232
|
"border-button-border-danger",
|
|
232
233
|
"hover:bg-button-bg-outlined-danger-hover",
|
|
@@ -235,52 +236,52 @@ const buttonVariants = tv({
|
|
|
235
236
|
]
|
|
236
237
|
},
|
|
237
238
|
{
|
|
238
|
-
|
|
239
|
-
|
|
239
|
+
severity: "primary",
|
|
240
|
+
appearance: "ghost",
|
|
240
241
|
className: [
|
|
241
242
|
"text-button-fg-primary-borderless"
|
|
242
243
|
]
|
|
243
244
|
},
|
|
244
245
|
{
|
|
245
|
-
|
|
246
|
-
|
|
246
|
+
severity: "secondary",
|
|
247
|
+
appearance: "ghost",
|
|
247
248
|
className: [
|
|
248
249
|
"text-button-fg-secondary-borderless"
|
|
249
250
|
]
|
|
250
251
|
},
|
|
251
252
|
{
|
|
252
|
-
|
|
253
|
-
|
|
253
|
+
severity: "tertiary",
|
|
254
|
+
appearance: "ghost",
|
|
254
255
|
className: [
|
|
255
256
|
"text-button-fg-tertiary-borderless"
|
|
256
257
|
]
|
|
257
258
|
},
|
|
258
259
|
{
|
|
259
|
-
|
|
260
|
-
|
|
260
|
+
severity: "warning",
|
|
261
|
+
appearance: "ghost",
|
|
261
262
|
className: [
|
|
262
263
|
"text-button-fg-warning-readable"
|
|
263
264
|
]
|
|
264
265
|
},
|
|
265
266
|
{
|
|
266
|
-
|
|
267
|
-
|
|
267
|
+
severity: "danger",
|
|
268
|
+
appearance: "ghost",
|
|
268
269
|
className: [
|
|
269
270
|
"text-button-fg-danger-borderless"
|
|
270
271
|
]
|
|
271
272
|
},
|
|
272
273
|
{
|
|
273
|
-
|
|
274
|
+
appearance: "outline",
|
|
274
275
|
size: "sm",
|
|
275
276
|
className: "border-(length:--border-width-button-sm)"
|
|
276
277
|
},
|
|
277
278
|
{
|
|
278
|
-
|
|
279
|
+
appearance: "outline",
|
|
279
280
|
size: "md",
|
|
280
281
|
className: "border-(length:--border-width-button-md)"
|
|
281
282
|
},
|
|
282
283
|
{
|
|
283
|
-
|
|
284
|
+
appearance: "outline",
|
|
284
285
|
size: "lg",
|
|
285
286
|
className: "border-(length:--border-width-button-lg)"
|
|
286
287
|
}
|
|
@@ -288,12 +289,26 @@ const buttonVariants = tv({
|
|
|
288
289
|
defaultVariants: {
|
|
289
290
|
composition: false,
|
|
290
291
|
density: "default",
|
|
291
|
-
|
|
292
|
-
|
|
292
|
+
severity: "primary",
|
|
293
|
+
appearance: "solid",
|
|
293
294
|
size: "md",
|
|
294
295
|
light: false
|
|
295
296
|
}
|
|
296
297
|
});
|
|
298
|
+
const buttonStyleValues = {
|
|
299
|
+
size: [
|
|
300
|
+
"sm",
|
|
301
|
+
"md",
|
|
302
|
+
"lg",
|
|
303
|
+
"current"
|
|
304
|
+
],
|
|
305
|
+
appearance: [
|
|
306
|
+
"solid",
|
|
307
|
+
"subtle",
|
|
308
|
+
"outline",
|
|
309
|
+
"ghost"
|
|
310
|
+
]
|
|
311
|
+
};
|
|
297
312
|
const buttonIconVariants = tv({
|
|
298
313
|
variants: {
|
|
299
314
|
size: {
|
|
@@ -307,7 +322,7 @@ const buttonIconVariants = tv({
|
|
|
307
322
|
size: "md"
|
|
308
323
|
}
|
|
309
324
|
});
|
|
310
|
-
function Button({ density,
|
|
325
|
+
function Button({ density, severity, appearance: appearanceProp, unstyled = false, size: sizeProp, block, isLoading, loadingText, icon, iconPosition = "left", iconSize, uppercase = false, children, className, disabled, composition, ref, onClick, type = "button", ...props }) {
|
|
311
326
|
const buttonRef = useRef(null);
|
|
312
327
|
useImperativeHandle(ref, ()=>buttonRef.current, []);
|
|
313
328
|
useEffect(()=>{
|
|
@@ -327,6 +342,10 @@ function Button({ density, variant, theme, size, block, isLoading, loadingText,
|
|
|
327
342
|
type,
|
|
328
343
|
props.form
|
|
329
344
|
]);
|
|
345
|
+
const { size, appearance } = useUIDefaults("Button", {
|
|
346
|
+
size: sizeProp,
|
|
347
|
+
appearance: appearanceProp
|
|
348
|
+
}, buttonStyleValues);
|
|
330
349
|
const iconClassName = buttonIconVariants({
|
|
331
350
|
size
|
|
332
351
|
});
|
|
@@ -336,8 +355,8 @@ function Button({ density, variant, theme, size, block, isLoading, loadingText,
|
|
|
336
355
|
"aria-disabled": disabled || isLoading || props["aria-disabled"] || void 0,
|
|
337
356
|
className: buttonVariants({
|
|
338
357
|
density,
|
|
339
|
-
|
|
340
|
-
|
|
358
|
+
severity,
|
|
359
|
+
appearance: unstyled ? "unstyled" : appearance,
|
|
341
360
|
size,
|
|
342
361
|
block,
|
|
343
362
|
uppercase,
|
|
@@ -382,4 +401,4 @@ function Button({ density, variant, theme, size, block, isLoading, loadingText,
|
|
|
382
401
|
})
|
|
383
402
|
});
|
|
384
403
|
}
|
|
385
|
-
export { Button, buttonVariants };
|
|
404
|
+
export { Button, buttonStyleValues, buttonVariants };
|
package/dist/atoms/checkbox.js
CHANGED
|
@@ -3,6 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useLayoutEffect, useMemo, useRef } from "react";
|
|
4
4
|
import { useChoiceInputRef } from "../internal/choice-control.js";
|
|
5
5
|
import { subscribeOwnerFormReset, syncReactFormControl } from "../internal/form-control-lifecycle.js";
|
|
6
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
6
7
|
import { tv } from "../utils.js";
|
|
7
8
|
const checkboxVariants = tv({
|
|
8
9
|
base: [
|
|
@@ -48,7 +49,10 @@ const checkboxVariants = tv({
|
|
|
48
49
|
size: "md"
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
|
-
function Checkbox({ className, size
|
|
52
|
+
function Checkbox({ className, size: sizeProp, indeterminate, invalid, ref, readOnly = false, onClick, onChange, onKeyDown, ...props }) {
|
|
53
|
+
const { size = "md" } = useUIDefaults("Checkbox", {
|
|
54
|
+
size: sizeProp
|
|
55
|
+
}, checkboxVariants);
|
|
52
56
|
const inputRef = useRef(null);
|
|
53
57
|
const currentValue = useRef({
|
|
54
58
|
checked: props.checked,
|
package/dist/atoms/hotkeys.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useFormatHotkey } from "../hotkeys.js";
|
|
4
|
+
import { useUIDefaults } from "../theme/ui-provider.js";
|
|
4
5
|
import { tv } from "../utils.js";
|
|
5
6
|
const hotkeysStyles = tv({
|
|
6
7
|
slots: {
|
|
@@ -25,7 +26,10 @@ const hotkeysStyles = tv({
|
|
|
25
26
|
size: "md"
|
|
26
27
|
}
|
|
27
28
|
});
|
|
28
|
-
function Hotkeys({ hotkey, size, formatOptions, children, className, ref, ...props }) {
|
|
29
|
+
function Hotkeys({ hotkey, size: sizeProp, formatOptions, children, className, ref, ...props }) {
|
|
30
|
+
const { size } = useUIDefaults("Hotkeys", {
|
|
31
|
+
size: sizeProp
|
|
32
|
+
}, hotkeysStyles);
|
|
29
33
|
const format = useFormatHotkey();
|
|
30
34
|
return /*#__PURE__*/ jsx("span", {
|
|
31
35
|
...props,
|