@espressif/dashboard-ui-components 1.14.0 → 1.14.1
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/.claude/rules/dashboard-ui-consumption.md +1 -0
- package/.cursor/rules/dashboard-ui-consumption.mdc +1 -0
- package/CHANGELOG.md +51 -1
- package/README.md +18 -2
- package/dist/components/avatar/avatar.js +1 -1
- package/dist/components/bottom-sheet/_hooks/use-sheet-drag.js +1 -1
- package/dist/components/button/button.js +2 -2
- package/dist/components/button/flash-button.js +4 -4
- package/dist/components/horizontal-stepper/horizontal-stepper.js +2 -2
- package/dist/core/animate-ui/components/radix/toggle-group.js +4 -4
- package/dist/core/animate-ui/primitives/animate/tooltip.js +3 -0
- package/dist/core/button/craft-button.js +4 -4
- package/dist/utils/color.js +10 -1
- package/dist/utils/index.d.ts +6 -1
- package/dist/utils/variant.js +38 -38
- package/package.json +4 -2
- package/src/styles/colors.css +23 -2
|
@@ -73,6 +73,7 @@ export function Example() {
|
|
|
73
73
|
|
|
74
74
|
- Add the library's styles once in your Tailwind v4 entry CSS: `@import "@espressif/dashboard-ui-components/styles";`. That file already declares the `@source` for the compiled `dist/`, so no extra `content`/`@source` entry is needed.
|
|
75
75
|
- Retheme by redeclaring the CSS custom properties (design tokens) **after** the `@import`, in both `:root` and `.dark` (or `[data-theme="dark"]`). Override `--font-sans` / `--font-mono` inside an `@theme` block.
|
|
76
|
+
- `primary`, `warning` and `disabled` have a text token, `--color-{primary,warning,disabled}-text`: variants draw text and icons in it, fills keep the base colour. When an app re-colours one of those three, it sets the matching `-text` token too (light and dark), at 4.5:1 on the page and on the colour's `/5` and `/10` tints. For text in those colours in app markup use `text-warning-text` (etc.), not `text-warning`, which is the fill colour. Solid `warning` and `disabled` surfaces (white text) fill with `--color-{warning,disabled}-solid`, a shade deeper than the base colour; retheme those with the base colour too.
|
|
76
77
|
- Layout heights: use `--espd-shell-header-height`, `--espd-workspace-layout-footer-height` and
|
|
77
78
|
`--espd-workspace-layout-hidden-footer-height`. The old names (`--espd-header-height`,
|
|
78
79
|
`--espd-footer-height`, `--espd-hidden-footer-height`) are deprecated fallbacks: do not use them
|
|
@@ -67,6 +67,7 @@ export function Example() {
|
|
|
67
67
|
|
|
68
68
|
- Add the library's styles once in your Tailwind v4 entry CSS: `@import "@espressif/dashboard-ui-components/styles";`. It already declares the `@source` for `dist/`.
|
|
69
69
|
- Retheme by redeclaring the CSS custom properties (design tokens) **after** the `@import`, in both `:root` and `.dark` (or `[data-theme="dark"]`). Override `--font-sans` / `--font-mono` inside an `@theme` block.
|
|
70
|
+
- `primary`, `warning` and `disabled` have a text token, `--color-{primary,warning,disabled}-text`: variants draw text and icons in it, fills keep the base colour. When an app re-colours one of those three, it sets the matching `-text` token too (light and dark), at 4.5:1 on the page and on the colour's `/5` and `/10` tints. For text in those colours in app markup use `text-warning-text` (etc.), not `text-warning`, which is the fill colour. Solid `warning` and `disabled` surfaces (white text) fill with `--color-{warning,disabled}-solid`, a shade deeper than the base colour; retheme those with the base colour too.
|
|
70
71
|
- Pick `./theme.css` instead of `./styles` only when the app has its own `@import "tailwindcss"` (or legacy CSS a reset would break); then the app styles `body` itself.
|
|
71
72
|
- Dark mode applies under `.dark` **or** `[data-theme="dark"]` on an ancestor; override dark tokens under the selector the app uses. The library has no `prefers-color-scheme` handling.
|
|
72
73
|
- `MinimalWorkspaceLayout` (from `/layouts`) is the header-less alternative to `WorkspaceLayout` with the same props: switch by renaming the component. It has no header bar or status footer (`footerConfig`, `hideBreadcrumbs`, `sidebarConfig.allowCollapsible` / `variant` do not exist on it), starts collapsed (`defaultSidebarOpen` defaults to `false`), and puts `topRightContent` (fallback `headerConfig.rightContent`) over the content. Theme it with the `--espd-minimal-workspace-layout-*` tokens, not `className` overrides on its parts: the sidebar surface defaults to the page background (`-sidebar-background`, `-sidebar-background-expanded`), and its border, shadow and row accent are derived from that surface unless `-sidebar-border-color`, `-sidebar-elevation` or `-sidebar-accent` are set. Keep `-sidebar-width-collapsed` within 48–56px. With `sidebarConfig.hideWhenCollapsed` the collapsed sidebar is hidden instead of a rail: a click on the content's left edge peeks it over the content until the pointer leaves it, and `MinimalWorkspaceSidebarTrigger` (from `/layouts`, placed in `topRightContent`) opens it inline; a peek never reaches `onSidebarOpenChange`. Do not build an edge or trigger in the app. The edge strip and the peek shadow are `-edge-color`, `-edge-width` and `-sidebar-overlay-elevation`. A page with a toolbar of its own passes `hideMobileTopBar`: the layout then draws no phone top bar, and a `MinimalWorkspaceSidebarTrigger` in that toolbar is the phone's menu button (it renders nothing on a phone otherwise). Do not build a phone menu button in the app.
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,56 @@ All notable changes to this project are documented here. The format is based on
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres
|
|
5
5
|
to [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [1.14.1] - 2026-11-26
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Text tokens for colours too light to read as text:** `--color-primary-text`,
|
|
11
|
+
`--color-warning-text` and `--color-disabled-text`, with their `text-*-text`
|
|
12
|
+
utilities. They keep the colour's hue and only darken it (lighten in dark mode)
|
|
13
|
+
until text in it reaches WCAG AA's 4.5:1 on the page, a card and the colour's
|
|
14
|
+
own tints. In dark mode `primary` and `warning` already pass, so their text
|
|
15
|
+
tokens follow the base colour.
|
|
16
|
+
- **Solid fill tokens:** `--color-warning-solid` and `--color-disabled-solid`, the
|
|
17
|
+
fill under white text on a solid surface (see Changed), and a `"solid"` target
|
|
18
|
+
for `resolveColor`, which returns that fill (`"bg"` stays the colour itself).
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- **Text in `primary`, `warning` and `disabled` is darker in the light theme**, in
|
|
22
|
+
every `soft`, `outline`, `gradient` and `glow` variant (Alert, Badge, Tag, Toast,
|
|
23
|
+
cards and anything else that takes `color` and `variant`). Fills, borders,
|
|
24
|
+
rings and glows keep their colours. Worst contrast before → after:
|
|
25
|
+
|
|
26
|
+
| Text | Light value | Before | After |
|
|
27
|
+
|------|-------------|--------|-------|
|
|
28
|
+
| `primary` | `#0071e3` → `#0065d6` | 4.0:1 | 4.7:1 |
|
|
29
|
+
| `warning` | `#c0993c` → `#8d6700` | 2.4:1 | 4.6:1 |
|
|
30
|
+
| `disabled` | `#9e9e9e` → `#6d6d6d` | 2.4:1 | 4.6:1 |
|
|
31
|
+
| `disabled` (dark) | `#616161` → `#7b7b7b` | 3.2:1 | 4.6:1 |
|
|
32
|
+
|
|
33
|
+
- **Solid `warning` and `disabled` fills are a shade deeper in the light theme**,
|
|
34
|
+
so their white text reads: `#956f00` (was `#c0993c`) and `#757575` (was
|
|
35
|
+
`#9e9e9e`), 4.6:1 (was 2.7:1). This shows wherever a solid warning or disabled
|
|
36
|
+
surface carries text or an icon: the `solid` variant (Badge, Alert's icon
|
|
37
|
+
circle, Tag, Toast), Button, CraftButton, FlashButton, ToggleGroup's selected
|
|
38
|
+
item, Avatar and HorizontalStepper. Tints, borders, progress bars, timeline
|
|
39
|
+
dots and charts keep the base colour. Dark mode is unchanged.
|
|
40
|
+
- **`--color-mist-secondary` is `#5a616f`** (was `#6B7280`) in the light theme,
|
|
41
|
+
so `mist` descriptions reach 4.5:1 (were 3.6:1) on the mist fill and border.
|
|
42
|
+
- An app that re-colours `primary`, `warning` or `disabled` should set the
|
|
43
|
+
matching `-text` (and, for warning and disabled, `-solid`) token too. To keep
|
|
44
|
+
the 1.14.0 look, set those tokens back to the base colour.
|
|
45
|
+
- Components that use `text-primary`, `text-warning` or `text-disabled` directly
|
|
46
|
+
(outside the variants) are not changed yet; that follows in a later release.
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
- **Tooltips** no longer leave a timer running after their provider unmounts.
|
|
50
|
+
A tooltip that was opening or closing at that moment updated the state of an
|
|
51
|
+
unmounted component; in a test run the timer fired after the DOM environment
|
|
52
|
+
had been torn down and failed the run with `window is not defined`.
|
|
53
|
+
- **BottomSheet**: after a touch drag, the first tap on ✕ (or on the handle) no
|
|
54
|
+
longer gets swallowed. The sheet now swallows only the click a drag ends in,
|
|
55
|
+
which a mouse fires and a touch swipe does not.
|
|
56
|
+
|
|
7
57
|
## [1.14.0] - 2026-11-22
|
|
8
58
|
|
|
9
59
|
**Text sizes now come from roles, and the defaults change some sizes.** Nothing
|
|
@@ -101,7 +151,7 @@ move. Stay on 1.13.x until you are ready.
|
|
|
101
151
|
`body` (14px) otherwise.
|
|
102
152
|
- **What moves, by component** (default size, px; phone / from 768px where they
|
|
103
153
|
differ). The full list, one row per class, is in
|
|
104
|
-
`docs/plans/2026-11-22-type-scale-
|
|
154
|
+
`docs/plans/2026-11-22-type-scale-inventory__done.md` in the repository, and
|
|
105
155
|
before/after screenshots of eight demo pages (Typography, Alert, Input,
|
|
106
156
|
Button, Card, Dialog, Badge, List) at 360px and 1280px are in
|
|
107
157
|
`docs/plans/type-scale-screenshots/`.
|
package/README.md
CHANGED
|
@@ -193,10 +193,14 @@ Use Tailwind v4's `@theme` block to declare a new token. Tailwind will generate
|
|
|
193
193
|
|
|
194
194
|
All tokens live in the library's [`src/styles/colors.css`](./src/styles/colors.css) and [`src/styles/globals.css`](./src/styles/globals.css). Grouped for reference:
|
|
195
195
|
|
|
196
|
-
**Brand colours** — `--color-primary` + `-light` / `-dark` / `-foreground`, `--color-secondary` + `-foreground` / `-container` / `-container-foreground`, `--color-tertiary` (same shape as secondary)
|
|
196
|
+
**Brand colours** — `--color-primary` + `-light` / `-dark` / `-foreground` / `-text`, `--color-secondary` + `-foreground` / `-container` / `-container-foreground`, `--color-tertiary` (same shape as secondary)
|
|
197
197
|
|
|
198
198
|
**Status colours** — `--color-error`, `--color-warning`, `--color-success`, `--color-info` (each with `-light` / `-dark` / `-foreground`), plus `--color-destructive` + `-foreground`, `--color-disabled` + `-foreground`
|
|
199
199
|
|
|
200
|
+
**Text in a colour** — `--color-primary-text`, `--color-warning-text`, `--color-disabled-text`: the colour as text on the page and on that colour's own tints, where the fill colour itself is too light to read (WCAG AA, 4.5:1). Variants (`soft`, `outline`, `gradient`, `glow`) draw their text and icons with them; fills, borders and glows keep the base colour. In dark mode the first two follow the base colour. When you retheme `--color-primary`, `--color-warning` or `--color-disabled`, set the matching `-text` token too, light and dark.
|
|
201
|
+
|
|
202
|
+
**Solid fills that carry text** — `--color-warning-solid` and `--color-disabled-solid`: the fill under white text on a solid `warning` or `disabled` surface (the `solid` variant, Button, Avatar, ToggleGroup, a solid IconAvatar). The base amber and grey are too light for white text (2.7:1), so these are a shade deeper (4.6:1). Tints, borders, progress bars and charts keep the base colour; `resolveColor(color, "solid")` returns this fill, `"bg"` the colour itself. In dark mode they follow the base colour and its dark ink.
|
|
203
|
+
|
|
200
204
|
**Surface / neutral colours** — `--color-background`, `--color-foreground` (+ `-secondary`, `-muted`, `-disabled`), `--color-card`, `--color-popover`, `--color-muted`, `--color-accent` (each with `-foreground`), `--color-surface` (+ `-foreground`, `-variant`, `-variant-foreground`, `-container-lowest`, `-container-low`, `-container`, `-container-high`, `-container-highest`), `--color-border`, `--color-input`, `--color-ring`
|
|
201
205
|
|
|
202
206
|
**Sidebar** — `--color-sidebar`, `-foreground`, `-primary`, `-primary-foreground`, `-accent`, `-accent-foreground`, `-border`, `-ring`
|
|
@@ -942,7 +946,7 @@ optimizeDeps: {
|
|
|
942
946
|
To deploy the demo to AWS (S3 + CloudFront):
|
|
943
947
|
|
|
944
948
|
1. In `demo/`, copy `.env.example` to `.env` and set `S3_BUCKET` and `CLOUDFRONT_ID`.
|
|
945
|
-
2. Ensure AWS credentials are configured
|
|
949
|
+
2. Ensure AWS credentials are configured: the default profile, or `AWS_PROFILE` in `demo/.env`.
|
|
946
950
|
3. From the repo root:
|
|
947
951
|
|
|
948
952
|
```bash
|
|
@@ -951,6 +955,18 @@ npm run deploy:demo
|
|
|
951
955
|
|
|
952
956
|
This builds the demo, syncs `demo/dist` to the S3 bucket, and creates a CloudFront invalidation. The live demo is served from [https://dqsptdnp5qxr0.cloudfront.net](https://dqsptdnp5qxr0.cloudfront.net).
|
|
953
957
|
|
|
958
|
+
**Deep links.** The demo routes in the browser (`/components/bottom-sheet` has no file in the bucket). A CloudFront Function, `esp-ui-component-library-demo-spa-routing`, runs on every viewer request of the distribution: a path whose last segment has no dot gets `/index.html` with status 200, and a path with an extension goes to S3 unchanged, so a missing file still answers 404. Its source is [`demo/cloudfront/spa-routing.js`](demo/cloudfront/spa-routing.js). `deploy:demo` does not touch it. After changing the file, update and publish the function (the second `--if-match` is the ETag the first command prints):
|
|
959
|
+
|
|
960
|
+
```bash
|
|
961
|
+
aws cloudfront update-function --name esp-ui-component-library-demo-spa-routing \
|
|
962
|
+
--if-match "$(aws cloudfront describe-function --name esp-ui-component-library-demo-spa-routing --query ETag --output text)" \
|
|
963
|
+
--function-config "Comment=esp-ui-component-library demo: serve index.html for client-side routes,Runtime=cloudfront-js-2.0" \
|
|
964
|
+
--function-code fileb://demo/cloudfront/spa-routing.js
|
|
965
|
+
aws cloudfront publish-function --name esp-ui-component-library-demo-spa-routing --if-match <ETag from update-function>
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
Do not route deep links with a CloudFront custom error response (404 → `/index.html` as 200): it turns every missing file into a 200 as well.
|
|
969
|
+
|
|
954
970
|
Build the library:
|
|
955
971
|
|
|
956
972
|
```bash
|
|
@@ -15,7 +15,7 @@ function Avatar({ name, imageUrl, size = "default", className, badgeColor, badge
|
|
|
15
15
|
const showIconBadge = badgeIcon != null && badgeIcon !== false;
|
|
16
16
|
const colorResolved = !showIconBadge && badgeColor != null ? resolveColor(badgeColor, "bg") : void 0;
|
|
17
17
|
const hasBadge = showIconBadge || Boolean(colorResolved);
|
|
18
|
-
const fill = resolveColor(color, "
|
|
18
|
+
const fill = resolveColor(color, "solid");
|
|
19
19
|
const onFill = resolveColor(color, "fg");
|
|
20
20
|
const avatar = /* @__PURE__ */ jsxs(Avatar$1, {
|
|
21
21
|
className: cn(sizeClasses[size], className),
|
|
@@ -66,9 +66,9 @@ function useSheetDrag(sheet, rest, onRest) {
|
|
|
66
66
|
}
|
|
67
67
|
return {
|
|
68
68
|
onPointerDown(event) {
|
|
69
|
+
swallowClick.current = false;
|
|
69
70
|
const control = event.target.closest("button, a, input");
|
|
70
71
|
if (event.button !== 0 || !sheet.current || control && !control.hasAttribute("data-sheet-grip")) return;
|
|
71
|
-
swallowClick.current = false;
|
|
72
72
|
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
73
73
|
const startHeight = sheet.current.getBoundingClientRect().height;
|
|
74
74
|
gesture.current = {
|
|
@@ -45,14 +45,14 @@ var presetButtonColors = {
|
|
|
45
45
|
link: "text-success"
|
|
46
46
|
},
|
|
47
47
|
warning: {
|
|
48
|
-
default: "bg-warning text-warning-foreground hover:bg-warning/90",
|
|
48
|
+
default: "bg-warning-solid text-warning-foreground hover:bg-warning-solid/90",
|
|
49
49
|
outline: "border-warning/30 text-warning hover:bg-warning/5 hover:border-warning",
|
|
50
50
|
glow: "border-warning/30 text-warning hover:bg-warning/5 hover:border-warning shadow-glow shadow-warning/45",
|
|
51
51
|
ghost: "text-warning hover:bg-warning/10",
|
|
52
52
|
link: "text-warning"
|
|
53
53
|
},
|
|
54
54
|
disabled: {
|
|
55
|
-
default: "bg-disabled text-disabled-foreground",
|
|
55
|
+
default: "bg-disabled-solid text-disabled-foreground",
|
|
56
56
|
outline: "border-disabled/30 text-disabled",
|
|
57
57
|
glow: "border-disabled/30 text-disabled shadow-glow shadow-disabled/45",
|
|
58
58
|
ghost: "text-disabled",
|
|
@@ -14,8 +14,8 @@ var flashButtonBgClasses = {
|
|
|
14
14
|
error: "bg-error hover:bg-background text-error-foreground",
|
|
15
15
|
info: "bg-info hover:bg-background text-info-foreground",
|
|
16
16
|
success: "bg-success hover:bg-background text-success-foreground",
|
|
17
|
-
warning: "bg-warning hover:bg-background text-warning-foreground",
|
|
18
|
-
disabled: "bg-disabled hover:bg-background text-disabled-foreground",
|
|
17
|
+
warning: "bg-warning-solid hover:bg-background text-warning-foreground",
|
|
18
|
+
disabled: "bg-disabled-solid hover:bg-background text-disabled-foreground",
|
|
19
19
|
gray: "bg-gray hover:bg-background text-gray-foreground",
|
|
20
20
|
mist: "bg-mist hover:bg-background text-mist-foreground"
|
|
21
21
|
};
|
|
@@ -26,8 +26,8 @@ var flashOverlayClasses = {
|
|
|
26
26
|
error: "bg-error",
|
|
27
27
|
info: "bg-info",
|
|
28
28
|
success: "bg-success",
|
|
29
|
-
warning: "bg-warning",
|
|
30
|
-
disabled: "bg-disabled",
|
|
29
|
+
warning: "bg-warning-solid",
|
|
30
|
+
disabled: "bg-disabled-solid",
|
|
31
31
|
gray: "bg-gray",
|
|
32
32
|
mist: "bg-mist"
|
|
33
33
|
};
|
|
@@ -56,7 +56,7 @@ function sized(icon, className) {
|
|
|
56
56
|
function HorizontalStepper({ steps, color = "primary", size = "default", tone = "default", animateIn, ariaLabel = "Progress", align = "center", semantics = "image", className }) {
|
|
57
57
|
const s = sizes[size];
|
|
58
58
|
const t = tones[tone];
|
|
59
|
-
const fill = resolveColor(color, "
|
|
59
|
+
const fill = resolveColor(color, "solid");
|
|
60
60
|
const onFill = resolveColor(color, "fg");
|
|
61
61
|
const animate = animateIn === "media-card-reveal";
|
|
62
62
|
const start = align === "start";
|
|
@@ -94,7 +94,7 @@ function HorizontalStepper({ steps, color = "primary", size = "default", tone =
|
|
|
94
94
|
/* @__PURE__ */ jsx("span", {
|
|
95
95
|
"data-status": step.status,
|
|
96
96
|
"aria-hidden": asList ? true : void 0,
|
|
97
|
-
className: cn("relative z-10 flex shrink-0 items-center justify-center rounded-full border-2", s.node, stale && "border-transparent bg-warning text-warning-foreground", failed && "border-transparent bg-error text-error-foreground", !stale && !failed && (reached ? cn("border-transparent", fill.className, onFill.className) : t.upcoming), animate && cn(NODE_POP, NODE_DELAYS[Math.min(index, NODE_DELAYS.length - 1)])),
|
|
97
|
+
className: cn("relative z-10 flex shrink-0 items-center justify-center rounded-full border-2", s.node, stale && "border-transparent bg-warning-solid text-warning-foreground", failed && "border-transparent bg-error text-error-foreground", !stale && !failed && (reached ? cn("border-transparent", fill.className, onFill.className) : t.upcoming), animate && cn(NODE_POP, NODE_DELAYS[Math.min(index, NODE_DELAYS.length - 1)])),
|
|
98
98
|
style: reached && !stale && !failed && (fill.style || onFill.style) ? {
|
|
99
99
|
...fill.style,
|
|
100
100
|
...onFill.style
|
|
@@ -76,8 +76,8 @@ var presetSolidFill = {
|
|
|
76
76
|
error: "bg-error shadow-sm",
|
|
77
77
|
info: "bg-info shadow-sm",
|
|
78
78
|
success: "bg-success shadow-sm",
|
|
79
|
-
warning: "bg-warning shadow-sm",
|
|
80
|
-
disabled: "bg-disabled shadow-sm",
|
|
79
|
+
warning: "bg-warning-solid shadow-sm",
|
|
80
|
+
disabled: "bg-disabled-solid shadow-sm",
|
|
81
81
|
gray: "bg-gray shadow-sm",
|
|
82
82
|
mist: "bg-mist shadow-sm border border-mist-border"
|
|
83
83
|
};
|
|
@@ -99,8 +99,8 @@ var presetMultipleSolidSurface = {
|
|
|
99
99
|
error: "data-[state=on]:bg-error",
|
|
100
100
|
info: "data-[state=on]:bg-info",
|
|
101
101
|
success: "data-[state=on]:bg-success",
|
|
102
|
-
warning: "data-[state=on]:bg-warning",
|
|
103
|
-
disabled: "data-[state=on]:bg-disabled",
|
|
102
|
+
warning: "data-[state=on]:bg-warning-solid",
|
|
103
|
+
disabled: "data-[state=on]:bg-disabled-solid",
|
|
104
104
|
gray: "data-[state=on]:bg-gray",
|
|
105
105
|
mist: "data-[state=on]:bg-mist data-[state=on]:border-mist-border"
|
|
106
106
|
};
|
|
@@ -73,6 +73,9 @@ function TooltipProvider({ children, id, openDelay = 700, closeDelay = 300, tran
|
|
|
73
73
|
window.removeEventListener("resize", hideImmediate, true);
|
|
74
74
|
};
|
|
75
75
|
}, [hideImmediate]);
|
|
76
|
+
React$1.useEffect(() => () => {
|
|
77
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
78
|
+
}, []);
|
|
76
79
|
return /* @__PURE__ */ jsx(GlobalTooltipProvider, {
|
|
77
80
|
value: {
|
|
78
81
|
showTooltip,
|
|
@@ -12,8 +12,8 @@ var craftButtonBgClasses = {
|
|
|
12
12
|
error: "bg-error text-error-foreground",
|
|
13
13
|
info: "bg-info text-info-foreground",
|
|
14
14
|
success: "bg-success text-success-foreground",
|
|
15
|
-
warning: "bg-warning text-warning-foreground",
|
|
16
|
-
disabled: "bg-disabled text-disabled-foreground",
|
|
15
|
+
warning: "bg-warning-solid text-warning-foreground",
|
|
16
|
+
disabled: "bg-disabled-solid text-disabled-foreground",
|
|
17
17
|
gray: "bg-gray text-gray-foreground",
|
|
18
18
|
mist: "bg-mist text-mist-foreground"
|
|
19
19
|
};
|
|
@@ -36,8 +36,8 @@ var craftIconColorClasses = {
|
|
|
36
36
|
error: "text-error group-hover:bg-error group-hover:text-error-foreground",
|
|
37
37
|
info: "text-info group-hover:bg-info group-hover:text-info-foreground",
|
|
38
38
|
success: "text-success group-hover:bg-success group-hover:text-success-foreground",
|
|
39
|
-
warning: "text-warning group-hover:bg-warning group-hover:text-warning-foreground",
|
|
40
|
-
disabled: "text-disabled group-hover:bg-disabled group-hover:text-disabled-foreground",
|
|
39
|
+
warning: "text-warning group-hover:bg-warning-solid group-hover:text-warning-foreground",
|
|
40
|
+
disabled: "text-disabled group-hover:bg-disabled-solid group-hover:text-disabled-foreground",
|
|
41
41
|
gray: "text-gray group-hover:bg-gray group-hover:text-gray-foreground",
|
|
42
42
|
mist: "text-mist-foreground group-hover:bg-mist group-hover:text-mist-foreground"
|
|
43
43
|
};
|
package/dist/utils/color.js
CHANGED
|
@@ -16,54 +16,63 @@ function isPresetColor(color) {
|
|
|
16
16
|
var presetClassMap = {
|
|
17
17
|
primary: {
|
|
18
18
|
bg: "bg-primary",
|
|
19
|
+
solid: "bg-primary",
|
|
19
20
|
text: "text-primary",
|
|
20
21
|
border: "border-primary",
|
|
21
22
|
fg: "text-primary-foreground"
|
|
22
23
|
},
|
|
23
24
|
secondary: {
|
|
24
25
|
bg: "bg-secondary",
|
|
26
|
+
solid: "bg-secondary",
|
|
25
27
|
text: "text-secondary",
|
|
26
28
|
border: "border-secondary",
|
|
27
29
|
fg: "text-secondary-foreground"
|
|
28
30
|
},
|
|
29
31
|
error: {
|
|
30
32
|
bg: "bg-error",
|
|
33
|
+
solid: "bg-error",
|
|
31
34
|
text: "text-error",
|
|
32
35
|
border: "border-error",
|
|
33
36
|
fg: "text-error-foreground"
|
|
34
37
|
},
|
|
35
38
|
info: {
|
|
36
39
|
bg: "bg-info",
|
|
40
|
+
solid: "bg-info",
|
|
37
41
|
text: "text-info",
|
|
38
42
|
border: "border-info",
|
|
39
43
|
fg: "text-info-foreground"
|
|
40
44
|
},
|
|
41
45
|
success: {
|
|
42
46
|
bg: "bg-success",
|
|
47
|
+
solid: "bg-success",
|
|
43
48
|
text: "text-success",
|
|
44
49
|
border: "border-success",
|
|
45
50
|
fg: "text-success-foreground"
|
|
46
51
|
},
|
|
47
52
|
warning: {
|
|
48
53
|
bg: "bg-warning",
|
|
54
|
+
solid: "bg-warning-solid",
|
|
49
55
|
text: "text-warning",
|
|
50
56
|
border: "border-warning",
|
|
51
57
|
fg: "text-warning-foreground"
|
|
52
58
|
},
|
|
53
59
|
disabled: {
|
|
54
60
|
bg: "bg-disabled",
|
|
61
|
+
solid: "bg-disabled-solid",
|
|
55
62
|
text: "text-disabled",
|
|
56
63
|
border: "border-disabled",
|
|
57
64
|
fg: "text-disabled-foreground"
|
|
58
65
|
},
|
|
59
66
|
gray: {
|
|
60
67
|
bg: "bg-gray",
|
|
68
|
+
solid: "bg-gray",
|
|
61
69
|
text: "text-gray",
|
|
62
70
|
border: "border-input",
|
|
63
71
|
fg: "text-gray-foreground"
|
|
64
72
|
},
|
|
65
73
|
mist: {
|
|
66
74
|
bg: "bg-mist",
|
|
75
|
+
solid: "bg-mist",
|
|
67
76
|
text: "text-mist",
|
|
68
77
|
border: "border-mist-border",
|
|
69
78
|
fg: "text-mist-foreground"
|
|
@@ -81,7 +90,7 @@ var ON_ARBITRARY_FILL = "var(--espd-on-solid-foreground, #fff)";
|
|
|
81
90
|
function resolveColor(color, target) {
|
|
82
91
|
if (isPresetColor(color)) return { className: presetClassMap[color][target] };
|
|
83
92
|
if (target === "fg") return { style: { color: ON_ARBITRARY_FILL } };
|
|
84
|
-
return { style: { [target === "bg" ? "backgroundColor" : target === "text" ? "color" : "borderColor"]: color } };
|
|
93
|
+
return { style: { [target === "bg" || target === "solid" ? "backgroundColor" : target === "text" ? "color" : "borderColor"]: color } };
|
|
85
94
|
}
|
|
86
95
|
var SUPPORTS_RELATIVE_COLOR = typeof CSS !== "undefined" && typeof CSS.supports === "function" && CSS.supports("color", "lch(from red l c h)");
|
|
87
96
|
/**
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -40,7 +40,12 @@ declare function isPresetColor(color: Color): color is Exclude<Color, string & {
|
|
|
40
40
|
* (`text`), a border (`border`), or the text that reads ON a fill of that
|
|
41
41
|
* colour (`fg` — the preset's `-foreground` token).
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
/**
|
|
44
|
+
* `bg` is the colour itself (tints, bars, dots); `solid` is the fill that
|
|
45
|
+
* carries text or an icon in `fg` (deeper for `warning` and `disabled`, so
|
|
46
|
+
* white reads on it).
|
|
47
|
+
*/
|
|
48
|
+
type ColorTarget = "bg" | "solid" | "text" | "border" | "fg";
|
|
44
49
|
type ColorResult = {
|
|
45
50
|
className: string;
|
|
46
51
|
style?: undefined;
|
package/dist/utils/variant.js
CHANGED
|
@@ -48,13 +48,13 @@ var VARIANT_GRADIENT_BACKDROP_BASE = "pointer-events-none absolute inset-0 -z-10
|
|
|
48
48
|
var VARIANT_GRADIENT_HOVER_OVERLAY_CLASS = cn("opacity-0 transition-opacity ease-in-out group-hover:opacity-100", VARIANT_GRADIENT_DURATION_CLASS);
|
|
49
49
|
/** Transparent frame + text/icon tint — gradients paint on {@link PRESET_GRADIENT_BACKDROP} layers. */
|
|
50
50
|
var PRESET_GRADIENT_FRAME = {
|
|
51
|
-
primary: "border border-primary/20 bg-transparent text-primary [&>svg]:text-primary",
|
|
51
|
+
primary: "border border-primary/20 bg-transparent text-primary-text [&>svg]:text-primary-text",
|
|
52
52
|
secondary: "border border-secondary/20 bg-transparent text-secondary [&>svg]:text-secondary",
|
|
53
53
|
info: "border border-info/20 bg-transparent text-info [&>svg]:text-info",
|
|
54
|
-
warning: "border border-warning/20 bg-transparent text-warning [&>svg]:text-warning",
|
|
54
|
+
warning: "border border-warning/20 bg-transparent text-warning-text [&>svg]:text-warning-text",
|
|
55
55
|
error: "border border-error/20 bg-transparent text-error [&>svg]:text-error",
|
|
56
56
|
success: "border border-success/20 bg-transparent text-success [&>svg]:text-success",
|
|
57
|
-
disabled: "border border-disabled/20 bg-transparent text-disabled [&>svg]:text-disabled",
|
|
57
|
+
disabled: "border border-disabled/20 bg-transparent text-disabled-text [&>svg]:text-disabled-text",
|
|
58
58
|
gray: "border border-gray/20 bg-transparent text-gray [&>svg]:text-gray",
|
|
59
59
|
mist: "border border-mist-border bg-transparent text-mist-foreground [&>svg]:text-mist-foreground"
|
|
60
60
|
};
|
|
@@ -123,14 +123,14 @@ function arbitraryGradientBackgroundImage(color, emphasis) {
|
|
|
123
123
|
var PRESET_VARIANT_STYLES = {
|
|
124
124
|
primary: {
|
|
125
125
|
soft: {
|
|
126
|
-
container: "border border-primary/10 bg-primary/5 text-primary [&>svg]:text-primary",
|
|
127
|
-
foreground: "text-primary",
|
|
128
|
-
description: "text-primary"
|
|
126
|
+
container: "border border-primary/10 bg-primary/5 text-primary-text [&>svg]:text-primary-text",
|
|
127
|
+
foreground: "text-primary-text",
|
|
128
|
+
description: "text-primary-text"
|
|
129
129
|
},
|
|
130
130
|
outline: {
|
|
131
|
-
container: "bg-transparent border border-primary/50 dark:border-primary/30 text-primary [&>svg]:text-primary",
|
|
132
|
-
foreground: "text-primary",
|
|
133
|
-
description: "text-primary"
|
|
131
|
+
container: "bg-transparent border border-primary/50 dark:border-primary/30 text-primary-text [&>svg]:text-primary-text",
|
|
132
|
+
foreground: "text-primary-text",
|
|
133
|
+
description: "text-primary-text"
|
|
134
134
|
},
|
|
135
135
|
solid: {
|
|
136
136
|
container: "border border-transparent bg-primary text-primary-foreground [&>svg]:text-primary-foreground",
|
|
@@ -139,13 +139,13 @@ var PRESET_VARIANT_STYLES = {
|
|
|
139
139
|
},
|
|
140
140
|
gradient: {
|
|
141
141
|
container: "",
|
|
142
|
-
foreground: "text-primary",
|
|
143
|
-
description: "text-primary"
|
|
142
|
+
foreground: "text-primary-text",
|
|
143
|
+
description: "text-primary-text"
|
|
144
144
|
},
|
|
145
145
|
glow: {
|
|
146
|
-
container: "border border-primary/15 bg-primary/4 text-primary shadow-glow shadow-primary/45 [&>svg]:text-primary",
|
|
147
|
-
foreground: "text-primary",
|
|
148
|
-
description: "text-primary"
|
|
146
|
+
container: "border border-primary/15 bg-primary/4 text-primary-text shadow-glow shadow-primary/45 [&>svg]:text-primary-text",
|
|
147
|
+
foreground: "text-primary-text",
|
|
148
|
+
description: "text-primary-text"
|
|
149
149
|
}
|
|
150
150
|
},
|
|
151
151
|
secondary: {
|
|
@@ -204,29 +204,29 @@ var PRESET_VARIANT_STYLES = {
|
|
|
204
204
|
},
|
|
205
205
|
warning: {
|
|
206
206
|
soft: {
|
|
207
|
-
container: "border border-warning/10 bg-warning/5 text-warning [&>svg]:text-warning",
|
|
208
|
-
foreground: "text-warning",
|
|
209
|
-
description: "text-warning"
|
|
207
|
+
container: "border border-warning/10 bg-warning/5 text-warning-text [&>svg]:text-warning-text",
|
|
208
|
+
foreground: "text-warning-text",
|
|
209
|
+
description: "text-warning-text"
|
|
210
210
|
},
|
|
211
211
|
outline: {
|
|
212
|
-
container: "bg-transparent border border-warning/50 dark:border-warning/30 text-warning [&>svg]:text-warning",
|
|
213
|
-
foreground: "text-warning",
|
|
214
|
-
description: "text-warning"
|
|
212
|
+
container: "bg-transparent border border-warning/50 dark:border-warning/30 text-warning-text [&>svg]:text-warning-text",
|
|
213
|
+
foreground: "text-warning-text",
|
|
214
|
+
description: "text-warning-text"
|
|
215
215
|
},
|
|
216
216
|
solid: {
|
|
217
|
-
container: "border border-transparent bg-warning text-warning-foreground [&>svg]:text-warning-foreground",
|
|
217
|
+
container: "border border-transparent bg-warning-solid text-warning-foreground [&>svg]:text-warning-foreground",
|
|
218
218
|
foreground: "text-warning-foreground",
|
|
219
219
|
description: "text-warning-foreground"
|
|
220
220
|
},
|
|
221
221
|
gradient: {
|
|
222
222
|
container: "",
|
|
223
|
-
foreground: "text-warning",
|
|
224
|
-
description: "text-warning"
|
|
223
|
+
foreground: "text-warning-text",
|
|
224
|
+
description: "text-warning-text"
|
|
225
225
|
},
|
|
226
226
|
glow: {
|
|
227
|
-
container: "border border-warning/15 bg-warning/4 text-warning shadow-glow shadow-warning/45 [&>svg]:text-warning",
|
|
228
|
-
foreground: "text-warning",
|
|
229
|
-
description: "text-warning"
|
|
227
|
+
container: "border border-warning/15 bg-warning/4 text-warning-text shadow-glow shadow-warning/45 [&>svg]:text-warning-text",
|
|
228
|
+
foreground: "text-warning-text",
|
|
229
|
+
description: "text-warning-text"
|
|
230
230
|
}
|
|
231
231
|
},
|
|
232
232
|
error: {
|
|
@@ -285,29 +285,29 @@ var PRESET_VARIANT_STYLES = {
|
|
|
285
285
|
},
|
|
286
286
|
disabled: {
|
|
287
287
|
soft: {
|
|
288
|
-
container: "border border-disabled/10 bg-disabled/5 text-disabled [&>svg]:text-disabled",
|
|
289
|
-
foreground: "text-disabled",
|
|
290
|
-
description: "text-disabled"
|
|
288
|
+
container: "border border-disabled/10 bg-disabled/5 text-disabled-text [&>svg]:text-disabled-text",
|
|
289
|
+
foreground: "text-disabled-text",
|
|
290
|
+
description: "text-disabled-text"
|
|
291
291
|
},
|
|
292
292
|
outline: {
|
|
293
|
-
container: "bg-transparent border border-disabled/50 dark:border-disabled/30 text-disabled [&>svg]:text-disabled",
|
|
294
|
-
foreground: "text-disabled",
|
|
295
|
-
description: "text-disabled"
|
|
293
|
+
container: "bg-transparent border border-disabled/50 dark:border-disabled/30 text-disabled-text [&>svg]:text-disabled-text",
|
|
294
|
+
foreground: "text-disabled-text",
|
|
295
|
+
description: "text-disabled-text"
|
|
296
296
|
},
|
|
297
297
|
solid: {
|
|
298
|
-
container: "border border-transparent bg-disabled text-disabled-foreground [&>svg]:text-disabled-foreground",
|
|
298
|
+
container: "border border-transparent bg-disabled-solid text-disabled-foreground [&>svg]:text-disabled-foreground",
|
|
299
299
|
foreground: "text-disabled-foreground",
|
|
300
300
|
description: "text-disabled-foreground"
|
|
301
301
|
},
|
|
302
302
|
gradient: {
|
|
303
303
|
container: "",
|
|
304
|
-
foreground: "text-disabled",
|
|
305
|
-
description: "text-disabled"
|
|
304
|
+
foreground: "text-disabled-text",
|
|
305
|
+
description: "text-disabled-text"
|
|
306
306
|
},
|
|
307
307
|
glow: {
|
|
308
|
-
container: "border border-disabled/15 bg-disabled/4 text-disabled shadow-glow shadow-disabled/45 [&>svg]:text-disabled",
|
|
309
|
-
foreground: "text-disabled",
|
|
310
|
-
description: "text-disabled"
|
|
308
|
+
container: "border border-disabled/15 bg-disabled/4 text-disabled-text shadow-glow shadow-disabled/45 [&>svg]:text-disabled-text",
|
|
309
|
+
foreground: "text-disabled-text",
|
|
310
|
+
description: "text-disabled-text"
|
|
311
311
|
}
|
|
312
312
|
},
|
|
313
313
|
gray: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@espressif/dashboard-ui-components",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.1",
|
|
4
4
|
"description": "Reusable React UI components, page layouts, and utilities — Espressif's dashboard design system.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -145,7 +145,9 @@
|
|
|
145
145
|
"dev:demo": "cd demo && npm run dev",
|
|
146
146
|
"build:demo": "cd demo && npm run build",
|
|
147
147
|
"deploy:demo": "bash scripts/deploy-demo.sh",
|
|
148
|
-
"release": "bash scripts/release.sh"
|
|
148
|
+
"release": "bash scripts/release.sh",
|
|
149
|
+
"release:active": "node scripts/active-release-branch.mjs",
|
|
150
|
+
"task:start": "node scripts/task-start.mjs"
|
|
149
151
|
},
|
|
150
152
|
"overrides": {
|
|
151
153
|
"esbuild": "^0.28.1"
|
package/src/styles/colors.css
CHANGED
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
--color-primary-light: #b9ebff;
|
|
12
12
|
--color-primary-dark: #000064;
|
|
13
13
|
--color-primary-foreground: #ffffff;
|
|
14
|
+
/* Text in primary on light surfaces and primary tints: the brand blue itself
|
|
15
|
+
is 4.0:1 on a /5 tint, under WCAG AA's 4.5:1. Fills keep --color-primary. */
|
|
16
|
+
--color-primary-text: #0065d6;
|
|
14
17
|
|
|
15
18
|
/* ─── Brand: Secondary ─── */
|
|
16
19
|
--color-secondary: #2a5a9a;
|
|
@@ -47,6 +50,13 @@
|
|
|
47
50
|
--color-warning-light: #fef9c3;
|
|
48
51
|
--color-warning-dark: #854d0e;
|
|
49
52
|
--color-warning-foreground: #ffffff;
|
|
53
|
+
/* Text in warning on light surfaces and warning tints (the amber itself is
|
|
54
|
+
2.4:1 there). Fills keep --color-warning. */
|
|
55
|
+
--color-warning-text: #8d6700;
|
|
56
|
+
/* A solid warning fill that carries text (solid variant, Button, Avatar…):
|
|
57
|
+
a deeper gold, so white text on it reaches 4.6:1 (2.7:1 on the amber).
|
|
58
|
+
Tints, borders, bars and charts keep --color-warning. */
|
|
59
|
+
--color-warning-solid: #956f00;
|
|
50
60
|
|
|
51
61
|
/* ─── Status: Success ─── */
|
|
52
62
|
--color-success: #007406;
|
|
@@ -63,6 +73,11 @@
|
|
|
63
73
|
/* ─── Status: Disabled ─── */
|
|
64
74
|
--color-disabled: #9e9e9e;
|
|
65
75
|
--color-disabled-foreground: #ffffff;
|
|
76
|
+
/* Text in disabled (a "Disabled" status, an outside-month day) on light
|
|
77
|
+
surfaces and disabled tints (the grey itself is 2.4:1 there). */
|
|
78
|
+
--color-disabled-text: #6d6d6d;
|
|
79
|
+
/* A solid disabled fill that carries text: white on it reaches 4.6:1. */
|
|
80
|
+
--color-disabled-solid: #757575;
|
|
66
81
|
|
|
67
82
|
/* ─── Neutral: Gray (darker than disabled for non-disabled UI) ─── */
|
|
68
83
|
--color-gray: #333333;
|
|
@@ -71,7 +86,7 @@
|
|
|
71
86
|
/* ─── Neutral: Mist ─── */
|
|
72
87
|
--color-mist: #F3F5F7;
|
|
73
88
|
--color-mist-foreground: #1F2937;
|
|
74
|
-
--color-mist-secondary: #
|
|
89
|
+
--color-mist-secondary: #5a616f;
|
|
75
90
|
--color-mist-border: #D9DEE5;
|
|
76
91
|
|
|
77
92
|
/* ─── Destructive (alias → error) ─── */
|
|
@@ -233,6 +248,7 @@
|
|
|
233
248
|
--color-primary-light: #b9ebff;
|
|
234
249
|
--color-primary-dark: #000064;
|
|
235
250
|
--color-primary-foreground: #000071;
|
|
251
|
+
--color-primary-text: var(--color-primary);
|
|
236
252
|
|
|
237
253
|
/* Brand: Secondary */
|
|
238
254
|
--color-secondary: #a5dbff;
|
|
@@ -260,7 +276,9 @@
|
|
|
260
276
|
--color-warning-light: #fef08a;
|
|
261
277
|
--color-warning-dark: #a16207;
|
|
262
278
|
--color-warning-foreground: #422006;
|
|
263
|
-
|
|
279
|
+
--color-warning-text: var(--color-warning);
|
|
280
|
+
--color-warning-solid: var(--color-warning);
|
|
281
|
+
|
|
264
282
|
--color-success: #69f991;
|
|
265
283
|
--color-success-light: #b5fcc3;
|
|
266
284
|
--color-success-dark: #002100;
|
|
@@ -273,6 +291,9 @@
|
|
|
273
291
|
/* Disabled */
|
|
274
292
|
--color-disabled: #616161;
|
|
275
293
|
--color-disabled-foreground: #e0e0e0;
|
|
294
|
+
/* The fill grey is 3.2:1 as text on dark tints. */
|
|
295
|
+
--color-disabled-text: #7b7b7b;
|
|
296
|
+
--color-disabled-solid: var(--color-disabled);
|
|
276
297
|
|
|
277
298
|
/* Neutral: Gray (lighter than disabled fill for contrast on dark surfaces) */
|
|
278
299
|
--color-gray: #b0b0b0;
|