@espressif/dashboard-ui-components 1.13.0 → 1.14.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/.claude/rules/dashboard-ui-consumption.md +41 -0
- package/.cursor/rules/dashboard-ui-consumption.mdc +39 -1
- package/CHANGELOG.md +222 -0
- package/README.md +50 -4
- package/dist/{alert.props-CcKo49Rb.d.ts → alert.props-BuLuWmXA.d.ts} +3 -3
- package/dist/common/copyright-card/copyright-card.js +1 -1
- package/dist/common/footer-card/footer-card.js +2 -2
- package/dist/common/index.d.ts +3 -0
- package/dist/common/my-account-menu/my-account-menu.js +2 -2
- package/dist/common/page-loader/page-loader.js +4 -1
- package/dist/common/profile-card/profile-card.js +2 -2
- package/dist/components/accordion/accordion.js +6 -11
- package/dist/components/alert/index.d.ts +5 -5
- package/dist/components/anchored-panel/anchored-panel.js +4 -4
- package/dist/components/async-multi-select/async-multi-select.js +8 -8
- package/dist/components/badge/index.d.ts +1 -1
- package/dist/components/bottom-sheet/_hooks/use-sheet-drag.js +112 -0
- package/dist/components/bottom-sheet/bottom-sheet.js +84 -0
- package/dist/components/bottom-sheet/index.d.ts +50 -0
- package/dist/components/bottom-sheet/index.js +3 -0
- package/dist/components/bubble/bubble.js +1 -1
- package/dist/components/calendar/calendar.js +5 -5
- package/dist/components/cards/animated-card/animated-card.js +1 -1
- package/dist/components/cards/basic-details-card.js +2 -2
- package/dist/components/cards/collapsible-card.js +1 -1
- package/dist/components/cards/index.d.ts +2 -2
- package/dist/components/cards/no-data-card/no-data-card.js +2 -2
- package/dist/components/cards/section-card.js +12 -12
- package/dist/components/cards/simple-card.js +2 -5
- package/dist/components/category-card/category-card.js +2 -2
- package/dist/components/chart/chart.js +4 -4
- package/dist/components/chart/donut-chart.js +1 -1
- package/dist/components/chart/treemap-chart.js +1 -1
- package/dist/components/choice-card/choice-card.js +3 -3
- package/dist/components/code-editor/code-editor.js +4 -3
- package/dist/components/data-table/table-header.js +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +3 -3
- package/dist/components/dynamic-list/dynamic-list.js +14 -13
- package/dist/components/dynamic-list/index.d.ts +1 -1
- package/dist/components/error-display/full-size-error/full-size-error.js +2 -2
- package/dist/components/expandable-text/expandable-text-overlay.js +1 -1
- package/dist/components/facet-filters/filter-group.js +2 -2
- package/dist/components/feature-grid/feature-grid.js +3 -3
- package/dist/components/file-input/file-input.js +8 -8
- package/dist/components/file-upload/file-upload.js +4 -4
- package/dist/components/fullscreen-dialog/fullscreen-dialog.js +1 -1
- package/dist/components/gradient-ring-button/_hooks/use-ring-geometry.js +116 -0
- package/dist/components/gradient-ring-button/gradient-ring-button.js +44 -0
- package/dist/components/gradient-ring-button/gradient-ring.js +77 -0
- package/dist/components/gradient-ring-button/index.d.ts +66 -0
- package/dist/components/gradient-ring-button/index.js +3 -0
- package/dist/components/horizontal-stepper/horizontal-stepper.js +2 -6
- package/dist/components/horizontal-stepper/index.d.ts +1 -1
- package/dist/components/icon-avatar/index.d.ts +3 -3
- package/dist/components/icon-text-action-card/index.d.ts +4 -4
- package/dist/components/index.d.ts +9 -7
- package/dist/components/index.js +5 -1
- package/dist/components/key-value-manager/key-value-manager-add-popover.js +1 -1
- package/dist/components/key-value-manager/key-value-manager-table.js +1 -1
- package/dist/components/link/link.js +7 -7
- package/dist/components/list/list-item.utils.js +5 -4
- package/dist/components/list/list.js +1 -1
- package/dist/components/list-details/index.d.ts +2 -2
- package/dist/components/markdown-content/markdown-content.components.js +2 -2
- package/dist/components/media-card/media-card-reveal.js +2 -2
- package/dist/components/media-card/media-card.js +2 -2
- package/dist/components/monospace-content/index.d.ts +4 -4
- package/dist/components/monospace-content/monospace-content.js +9 -11
- package/dist/components/nav-bar/nav-bar-mobile-menu.js +3 -3
- package/dist/components/nav-bar/nav-bar.js +4 -4
- package/dist/components/notice-strip/notice-strip.js +1 -1
- package/dist/components/option-card-group/option-card-group.js +2 -2
- package/dist/components/overflow-badge-list/index.d.ts +2 -2
- package/dist/components/overflow-badge-list/overflow-badge-list.js +3 -3
- package/dist/components/page-banner/page-banner.js +1 -1
- package/dist/components/page-container/page-container.js +1 -1
- package/dist/components/pagination/pagination.js +1 -1
- package/dist/components/progress-bar/progress-bar.js +2 -2
- package/dist/components/qr-code/qr-code.js +2 -2
- package/dist/components/radio-group/radio-group.js +3 -3
- package/dist/components/range-field/range-field.js +9 -12
- package/dist/components/readout/readout.js +1 -1
- package/dist/components/requirement-list/requirement-list.js +5 -10
- package/dist/components/scrollable-sections/scrollable-sections.js +1 -1
- package/dist/components/search-field-shell.js +8 -8
- package/dist/components/selectable-card-list/selectable-card-list-shared.js +6 -6
- package/dist/components/showcase-card/showcase-card.js +2 -2
- package/dist/components/sidebar/sidebar.js +13 -15
- package/dist/components/simple-clickable-card/index.d.ts +4 -4
- package/dist/components/simple-clickable-card/simple-clickable-card-shared.js +17 -23
- package/dist/components/simple-info-card/index.d.ts +3 -3
- package/dist/components/simple-list/index.d.ts +1 -1
- package/dist/components/simple-list/simple-list.js +8 -8
- package/dist/components/simple-paginated-list/simple-paginated-list.js +1 -4
- package/dist/components/stat-card/stat-card.js +7 -13
- package/dist/components/status-badge/index.d.ts +3 -3
- package/dist/components/status-badge/status-badge.js +4 -4
- package/dist/components/status-card-list/status-card-list.js +6 -6
- package/dist/components/tag/index.d.ts +1 -1
- package/dist/components/tag/tag.js +4 -4
- package/dist/components/tag-input/tag-input.js +12 -12
- package/dist/components/timeline/timeline.js +2 -2
- package/dist/components/toast/index.d.ts +1 -1
- package/dist/components/toast/toast.js +2 -2
- package/dist/components/toolbar/index.d.ts +5 -2
- package/dist/components/toolbar/toolbar-button.js +1 -1
- package/dist/components/toolbar/toolbar.js +9 -3
- package/dist/components/trace/trace.js +1 -1
- package/dist/components/transfer-list/transfer-list.js +2 -2
- package/dist/components/typography/index.d.ts +12 -3
- package/dist/components/typography/typography-variants.js +98 -13
- package/dist/components/typography/typography.js +4 -2
- package/dist/components/user-type-badge/user-type-badge.js +4 -4
- package/dist/components/vertical-stepper/vertical-stepper.js +11 -7
- package/dist/core/alert.js +3 -3
- package/dist/core/animate-ui/components/animate/code-header.js +1 -1
- package/dist/core/animate-ui/components/animate/code.js +1 -1
- package/dist/core/animate-ui/components/animate/tabs.js +6 -6
- package/dist/core/animate-ui/components/animate/tooltip.js +1 -1
- package/dist/core/animate-ui/components/base/progress.js +2 -2
- package/dist/core/animate-ui/components/radix/accordion.js +2 -2
- package/dist/core/animate-ui/components/radix/dialog.js +2 -2
- package/dist/core/animate-ui/components/radix/dropdown-menu.js +6 -6
- package/dist/core/animate-ui/components/radix/sheet.js +2 -2
- package/dist/core/animate-ui/components/radix/sidebar.js +8 -8
- package/dist/core/animate-ui/components/radix/toggle.js +1 -1
- package/dist/core/badge.js +1 -1
- package/dist/core/breadcrumb.js +1 -1
- package/dist/core/button/button.js +2 -2
- package/dist/core/button-group.js +1 -1
- package/dist/core/button.js +2 -2
- package/dist/core/card.js +2 -2
- package/dist/core/combobox/combobox.js +3 -3
- package/dist/core/command.js +5 -5
- package/dist/core/field-label-row.js +4 -4
- package/dist/core/form.js +2 -2
- package/dist/core/index.d.ts +1 -1
- package/dist/core/input/input.js +11 -11
- package/dist/core/input-otp/input-otp.js +12 -12
- package/dist/core/label.js +1 -1
- package/dist/core/select.js +6 -6
- package/dist/core/separator.js +1 -1
- package/dist/core/table.js +2 -2
- package/dist/core/textarea/textarea.js +9 -9
- package/dist/{icon-avatar.props-RYtw2eSW.d.ts → icon-avatar.props-BJe0-vva.d.ts} +1 -1
- package/dist/{icon-text-action-card.props-B2ggncUK.d.ts → icon-text-action-card.props-BU7yFi2Q.d.ts} +2 -2
- package/dist/index.d.ts +9 -7
- package/dist/index.js +6 -2
- package/dist/layouts/entry-layout/entry-layout.js +1 -1
- package/dist/layouts/index.d.ts +21 -6
- package/dist/layouts/index.js +1 -1
- package/dist/layouts/minimal-workspace-layout/minimal-workspace-layout.js +10 -18
- package/dist/layouts/minimal-workspace-layout/sidebar-trigger.js +35 -7
- package/dist/layouts/workspace-layout/footer/footer.js +1 -1
- package/dist/markdown/index.d.ts +4 -4
- package/dist/{section-card-B7c5uc08.d.ts → section-card-DqQeQkzU.d.ts} +1 -1
- package/dist/{simple-clickable-card.props-BrPCw7CR.d.ts → simple-clickable-card.props-BhhotZMp.d.ts} +2 -2
- package/dist/{status-badge.props-lKlEOfRt.d.ts → status-badge.props-BVe8CmQZ.d.ts} +1 -1
- package/dist/styles/type-scale.js +153 -0
- package/dist/tailwind-preset.js +120 -1
- package/dist/toast/index.d.ts +1 -1
- package/dist/utils/cn.js +16 -5
- package/dist/utils/index.d.ts +31 -2
- package/dist/utils/index.js +2 -1
- package/dist/utils/variant.js +47 -47
- package/dist/{variant-D81RhpbR.d.ts → variant-DjdaxfIA.d.ts} +6 -1
- package/package.json +3 -1
- package/src/styles/theme.css +8 -3
- package/src/styles/type-scale.css +152 -0
- package/tailwind.preset.ts +23 -0
package/dist/tailwind-preset.js
CHANGED
|
@@ -1,4 +1,122 @@
|
|
|
1
1
|
// tailwind.preset.ts
|
|
2
|
+
import plugin from "tailwindcss/plugin";
|
|
3
|
+
|
|
4
|
+
// src/styles/type-scale.ts
|
|
5
|
+
var TYPE_ROLES = [
|
|
6
|
+
"display",
|
|
7
|
+
"lead",
|
|
8
|
+
"title",
|
|
9
|
+
"headline",
|
|
10
|
+
"heading",
|
|
11
|
+
"subheading",
|
|
12
|
+
"prose",
|
|
13
|
+
"body",
|
|
14
|
+
"secondary",
|
|
15
|
+
"caption",
|
|
16
|
+
"label",
|
|
17
|
+
"input",
|
|
18
|
+
"code"
|
|
19
|
+
];
|
|
20
|
+
var TYPE_SCALE_MD = "48rem";
|
|
21
|
+
var TYPE_SCALE = {
|
|
22
|
+
display: {
|
|
23
|
+
use: "Marketing headline",
|
|
24
|
+
phone: { size: "clamp(2.5rem, 7vw, 5.5rem)", line: "1.04", weight: "800" },
|
|
25
|
+
token: { size: "var(--text-display)", line: "var(--text-display--line-height)", weight: "var(--text-display--font-weight)" }
|
|
26
|
+
},
|
|
27
|
+
lead: {
|
|
28
|
+
use: "The paragraph under a display headline",
|
|
29
|
+
phone: { size: "clamp(1.0625rem, 1.5vw, 1.3125rem)", line: "1.6", weight: "400" },
|
|
30
|
+
token: { size: "var(--text-lead)", line: "var(--text-lead--line-height)" }
|
|
31
|
+
},
|
|
32
|
+
title: {
|
|
33
|
+
use: "A page's heading",
|
|
34
|
+
phone: { size: "1.375rem", line: "1.75rem", weight: "700" },
|
|
35
|
+
md: { size: "1.625rem", line: "2rem" }
|
|
36
|
+
},
|
|
37
|
+
headline: {
|
|
38
|
+
use: "A section of a page (the step between a page and a card)",
|
|
39
|
+
phone: { size: "1.125rem", line: "1.5rem", weight: "600" },
|
|
40
|
+
md: { size: "1.25rem", line: "1.75rem" }
|
|
41
|
+
},
|
|
42
|
+
heading: {
|
|
43
|
+
use: "A card, panel or dialog title",
|
|
44
|
+
phone: { size: "1rem", line: "1.375rem", weight: "600" }
|
|
45
|
+
},
|
|
46
|
+
subheading: {
|
|
47
|
+
use: "A smaller title (an alert's, a list group's)",
|
|
48
|
+
phone: { size: "0.875rem", line: "1.25rem", weight: "600" }
|
|
49
|
+
},
|
|
50
|
+
prose: {
|
|
51
|
+
use: "Long reading text (a description page, a document)",
|
|
52
|
+
phone: { size: "1rem", line: "1.5rem", weight: "400" },
|
|
53
|
+
md: { line: "1.625rem" }
|
|
54
|
+
},
|
|
55
|
+
body: {
|
|
56
|
+
use: "Running text in an interface: descriptions, alert bodies, messages",
|
|
57
|
+
phone: { size: "0.875rem", line: "1.3125rem", weight: "400" }
|
|
58
|
+
},
|
|
59
|
+
secondary: {
|
|
60
|
+
use: "A supporting line under a title, card meta",
|
|
61
|
+
phone: { size: "0.8125rem", line: "1.125rem", weight: "400" }
|
|
62
|
+
},
|
|
63
|
+
caption: {
|
|
64
|
+
use: "Timestamps, counts, hints, badges, footnotes",
|
|
65
|
+
phone: { size: "0.75rem", line: "1rem", weight: "400" }
|
|
66
|
+
},
|
|
67
|
+
label: {
|
|
68
|
+
use: "Form labels, tab, menu and button text",
|
|
69
|
+
phone: { size: "0.875rem", line: "1.25rem", weight: "500" }
|
|
70
|
+
},
|
|
71
|
+
input: {
|
|
72
|
+
use: "What a person types, and its placeholder",
|
|
73
|
+
phone: { size: "1rem", line: "1.5rem", weight: "400" },
|
|
74
|
+
md: { size: "0.875rem", line: "1.25rem" }
|
|
75
|
+
},
|
|
76
|
+
code: {
|
|
77
|
+
use: "Code, logs, file paths (with font-mono)",
|
|
78
|
+
phone: { size: "0.75rem", line: "1.125rem", weight: "400" },
|
|
79
|
+
md: { size: "0.8125rem", line: "1.25rem" }
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
var PROPS = ["size", "line", "weight"];
|
|
83
|
+
function typeToken(role, prop) {
|
|
84
|
+
return `--espd-type-${role}-${prop}`;
|
|
85
|
+
}
|
|
86
|
+
function typeScaleRootTokens() {
|
|
87
|
+
const out = {};
|
|
88
|
+
for (const role of TYPE_ROLES) {
|
|
89
|
+
const spec = TYPE_SCALE[role];
|
|
90
|
+
for (const prop of PROPS) out[typeToken(role, prop)] = spec.token?.[prop] ?? spec.phone[prop];
|
|
91
|
+
}
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
94
|
+
function typeScaleMdTokens() {
|
|
95
|
+
const out = {};
|
|
96
|
+
for (const role of TYPE_ROLES) {
|
|
97
|
+
const md = TYPE_SCALE[role].md;
|
|
98
|
+
if (!md) continue;
|
|
99
|
+
for (const prop of PROPS) if (md[prop] !== void 0) out[typeToken(role, prop)] = md[prop];
|
|
100
|
+
}
|
|
101
|
+
return out;
|
|
102
|
+
}
|
|
103
|
+
function typeUtilityDeclarations(role) {
|
|
104
|
+
const { phone } = TYPE_SCALE[role];
|
|
105
|
+
return {
|
|
106
|
+
"font-size": `var(${typeToken(role, "size")}, ${phone.size})`,
|
|
107
|
+
"line-height": `var(--tw-leading, var(${typeToken(role, "line")}, ${phone.line}))`,
|
|
108
|
+
"font-weight": `var(--tw-font-weight, var(${typeToken(role, "weight")}, ${phone.weight}))`
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// tailwind.preset.ts
|
|
113
|
+
var typeScale = plugin(({ addBase, addUtilities }) => {
|
|
114
|
+
addBase({
|
|
115
|
+
":root": typeScaleRootTokens(),
|
|
116
|
+
[`@media (width >= ${TYPE_SCALE_MD})`]: { ":root": typeScaleMdTokens() }
|
|
117
|
+
});
|
|
118
|
+
addUtilities(Object.fromEntries(TYPE_ROLES.map((role) => [`.type-${role}`, typeUtilityDeclarations(role)])));
|
|
119
|
+
});
|
|
2
120
|
var espPreset = {
|
|
3
121
|
darkMode: "class",
|
|
4
122
|
theme: {
|
|
@@ -108,7 +226,8 @@ var espPreset = {
|
|
|
108
226
|
sm: "var(--radius-sm)"
|
|
109
227
|
}
|
|
110
228
|
}
|
|
111
|
-
}
|
|
229
|
+
},
|
|
230
|
+
plugins: [typeScale]
|
|
112
231
|
};
|
|
113
232
|
var tailwind_preset_default = espPreset;
|
|
114
233
|
export {
|
package/dist/toast/index.d.ts
CHANGED
package/dist/utils/cn.js
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
|
+
import { TYPE_ROLES } from "../styles/type-scale.js";
|
|
1
2
|
import { clsx } from "clsx";
|
|
2
3
|
import { extendTailwindMerge } from "tailwind-merge";
|
|
3
4
|
//#region src/utils/cn.ts
|
|
4
|
-
var twMerge = extendTailwindMerge({ extend: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
var twMerge = extendTailwindMerge({ extend: {
|
|
6
|
+
classGroups: {
|
|
7
|
+
shadow: [{ shadow: [
|
|
8
|
+
(value) => /^\[shadow:.+\]$/.test(value),
|
|
9
|
+
"glow",
|
|
10
|
+
"float"
|
|
11
|
+
] }],
|
|
12
|
+
"type-role": [{ type: [...TYPE_ROLES] }],
|
|
13
|
+
"font-weight": [{ font: [(value) => /^\[weight:.+\]$/.test(value)] }]
|
|
14
|
+
},
|
|
15
|
+
conflictingClassGroups: {
|
|
16
|
+
"type-role": ["font-size"],
|
|
17
|
+
"font-size": ["type-role"]
|
|
18
|
+
}
|
|
19
|
+
} });
|
|
9
20
|
function cn(...inputs) {
|
|
10
21
|
return twMerge(clsx(inputs));
|
|
11
22
|
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
export { c as cn } from '../cn-Cbsgs0XP.js';
|
|
2
2
|
import { C as Color } from '../index-BQANnKs9.js';
|
|
3
|
-
export { V as VARIANTS, f as Variant, g as VariantRecipe, h as VariantRegistry, i as VariantStyles, l as listVariants, r as registerVariant, k as resolveVariantStyles } from '../variant-
|
|
3
|
+
export { V as VARIANTS, f as Variant, g as VariantRecipe, h as VariantRegistry, i as VariantStyles, l as listVariants, r as registerVariant, k as resolveVariantStyles } from '../variant-DjdaxfIA.js';
|
|
4
4
|
export { B as BORDERS, a as Border, b as BorderRegistry, D as DENSITIES, c as Density, d as DensityProps, e as DensityRegistry, f as DensityTokens, E as ELEVATIONS, g as Elevation, h as ElevationRegistry, R as RADII, i as Radius, j as RadiusRegistry, S as StyleAxis, k as StyleAxisProps, l as StyleValueAxis, m as densityStyle, n as listStyleValues, r as registerDensity, o as registerStyleValue, p as resolveDensity, q as resolveStyleValue, u as useStyleAxes } from '../style-axes-DSQ2DGc5.js';
|
|
5
5
|
import 'clsx';
|
|
6
6
|
import 'react';
|
|
7
7
|
|
|
8
|
+
/** Every text role, largest first. */
|
|
9
|
+
declare const TYPE_ROLES: readonly ["display", "lead", "title", "headline", "heading", "subheading", "prose", "body", "secondary", "caption", "label", "input", "code"];
|
|
10
|
+
type TypeRole = (typeof TYPE_ROLES)[number];
|
|
11
|
+
interface TypeRoleValue {
|
|
12
|
+
/** `font-size`. */
|
|
13
|
+
size: string;
|
|
14
|
+
/** `line-height`. */
|
|
15
|
+
line: string;
|
|
16
|
+
/** `font-weight`. */
|
|
17
|
+
weight: string;
|
|
18
|
+
}
|
|
19
|
+
interface TypeRoleSpec {
|
|
20
|
+
/** What the role is for, in a few words (docs and the demo). */
|
|
21
|
+
use: string;
|
|
22
|
+
/** The phone value, and the fallback inside every `var()` that reads it. */
|
|
23
|
+
phone: TypeRoleValue;
|
|
24
|
+
/** What changes from 768px (`md`) up. Omitted: the phone value holds. */
|
|
25
|
+
md?: Partial<TypeRoleValue>;
|
|
26
|
+
/**
|
|
27
|
+
* The value the token is declared with, when it points at another token
|
|
28
|
+
* (`display` and `lead` take the marketing sizes the theme already ships).
|
|
29
|
+
* Omitted: the token is declared with the phone value.
|
|
30
|
+
*/
|
|
31
|
+
token?: Partial<TypeRoleValue>;
|
|
32
|
+
}
|
|
33
|
+
/** The breakpoint where `md` values start: Tailwind's `md`, as `useIsMobile` and the inputs use. */
|
|
34
|
+
declare const TYPE_SCALE_MD = "48rem";
|
|
35
|
+
declare const TYPE_SCALE: Record<TypeRole, TypeRoleSpec>;
|
|
36
|
+
|
|
8
37
|
declare function isPresetColor(color: Color): color is Exclude<Color, string & {}>;
|
|
9
38
|
/**
|
|
10
39
|
* What the colour paints: a fill (`bg`), text or icons in that colour
|
|
@@ -33,4 +62,4 @@ declare function resolveColor(color: Color, target: ColorTarget): ColorResult;
|
|
|
33
62
|
*/
|
|
34
63
|
declare function startViewTransition(update: () => void): void;
|
|
35
64
|
|
|
36
|
-
export { isPresetColor, resolveColor, startViewTransition };
|
|
65
|
+
export { TYPE_ROLES, TYPE_SCALE, TYPE_SCALE_MD, type TypeRole, type TypeRoleSpec, type TypeRoleValue, isPresetColor, resolveColor, startViewTransition };
|
package/dist/utils/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { TYPE_ROLES, TYPE_SCALE, TYPE_SCALE_MD } from "../styles/type-scale.js";
|
|
1
2
|
import { cn } from "./cn.js";
|
|
2
3
|
import { isPresetColor, resolveColor } from "./color.js";
|
|
3
4
|
import { VARIANTS, listVariants, registerVariant, resolveVariantStyles } from "./variant.js";
|
|
4
5
|
import { BORDERS, DENSITIES, ELEVATIONS, RADII, densityStyle, listStyleValues, registerDensity, registerStyleValue, resolveDensity, resolveStyleValue, useStyleAxes } from "./style-axes.js";
|
|
5
6
|
import { startViewTransition } from "./view-transition.js";
|
|
6
|
-
export { BORDERS, DENSITIES, ELEVATIONS, RADII, VARIANTS, cn, densityStyle, isPresetColor, listStyleValues, listVariants, registerDensity, registerStyleValue, registerVariant, resolveColor, resolveDensity, resolveStyleValue, resolveVariantStyles, startViewTransition, useStyleAxes };
|
|
7
|
+
export { BORDERS, DENSITIES, ELEVATIONS, RADII, TYPE_ROLES, TYPE_SCALE, TYPE_SCALE_MD, VARIANTS, cn, densityStyle, isPresetColor, listStyleValues, listVariants, registerDensity, registerStyleValue, registerVariant, resolveColor, resolveDensity, resolveStyleValue, resolveVariantStyles, startViewTransition, useStyleAxes };
|
package/dist/utils/variant.js
CHANGED
|
@@ -125,81 +125,81 @@ var PRESET_VARIANT_STYLES = {
|
|
|
125
125
|
soft: {
|
|
126
126
|
container: "border border-primary/10 bg-primary/5 text-primary [&>svg]:text-primary",
|
|
127
127
|
foreground: "text-primary",
|
|
128
|
-
description: "text-primary
|
|
128
|
+
description: "text-primary"
|
|
129
129
|
},
|
|
130
130
|
outline: {
|
|
131
131
|
container: "bg-transparent border border-primary/50 dark:border-primary/30 text-primary [&>svg]:text-primary",
|
|
132
132
|
foreground: "text-primary",
|
|
133
|
-
description: "text-primary
|
|
133
|
+
description: "text-primary"
|
|
134
134
|
},
|
|
135
135
|
solid: {
|
|
136
136
|
container: "border border-transparent bg-primary text-primary-foreground [&>svg]:text-primary-foreground",
|
|
137
137
|
foreground: "text-primary-foreground",
|
|
138
|
-
description: "text-primary-foreground
|
|
138
|
+
description: "text-primary-foreground"
|
|
139
139
|
},
|
|
140
140
|
gradient: {
|
|
141
141
|
container: "",
|
|
142
142
|
foreground: "text-primary",
|
|
143
|
-
description: "text-primary
|
|
143
|
+
description: "text-primary"
|
|
144
144
|
},
|
|
145
145
|
glow: {
|
|
146
146
|
container: "border border-primary/15 bg-primary/4 text-primary shadow-glow shadow-primary/45 [&>svg]:text-primary",
|
|
147
147
|
foreground: "text-primary",
|
|
148
|
-
description: "text-primary
|
|
148
|
+
description: "text-primary"
|
|
149
149
|
}
|
|
150
150
|
},
|
|
151
151
|
secondary: {
|
|
152
152
|
soft: {
|
|
153
153
|
container: "border border-secondary/10 bg-secondary/5 text-secondary [&>svg]:text-secondary",
|
|
154
154
|
foreground: "text-secondary",
|
|
155
|
-
description: "text-secondary
|
|
155
|
+
description: "text-secondary"
|
|
156
156
|
},
|
|
157
157
|
outline: {
|
|
158
158
|
container: "bg-transparent border border-secondary/50 dark:border-secondary/30 text-secondary [&>svg]:text-secondary",
|
|
159
159
|
foreground: "text-secondary",
|
|
160
|
-
description: "text-secondary
|
|
160
|
+
description: "text-secondary"
|
|
161
161
|
},
|
|
162
162
|
solid: {
|
|
163
163
|
container: "border border-transparent bg-secondary text-secondary-foreground [&>svg]:text-secondary-foreground",
|
|
164
164
|
foreground: "text-secondary-foreground",
|
|
165
|
-
description: "text-secondary-foreground
|
|
165
|
+
description: "text-secondary-foreground"
|
|
166
166
|
},
|
|
167
167
|
gradient: {
|
|
168
168
|
container: "",
|
|
169
169
|
foreground: "text-secondary",
|
|
170
|
-
description: "text-secondary
|
|
170
|
+
description: "text-secondary"
|
|
171
171
|
},
|
|
172
172
|
glow: {
|
|
173
173
|
container: "border border-secondary/15 bg-secondary/4 text-secondary shadow-glow shadow-secondary/45 [&>svg]:text-secondary",
|
|
174
174
|
foreground: "text-secondary",
|
|
175
|
-
description: "text-secondary
|
|
175
|
+
description: "text-secondary"
|
|
176
176
|
}
|
|
177
177
|
},
|
|
178
178
|
info: {
|
|
179
179
|
soft: {
|
|
180
180
|
container: "border border-info/10 bg-info/5 text-info [&>svg]:text-info",
|
|
181
181
|
foreground: "text-info",
|
|
182
|
-
description: "text-info
|
|
182
|
+
description: "text-info"
|
|
183
183
|
},
|
|
184
184
|
outline: {
|
|
185
185
|
container: "bg-transparent border border-info/50 dark:border-info/30 text-info [&>svg]:text-info",
|
|
186
186
|
foreground: "text-info",
|
|
187
|
-
description: "text-info
|
|
187
|
+
description: "text-info"
|
|
188
188
|
},
|
|
189
189
|
solid: {
|
|
190
190
|
container: "border border-transparent bg-info text-info-foreground [&>svg]:text-info-foreground",
|
|
191
191
|
foreground: "text-info-foreground",
|
|
192
|
-
description: "text-info-foreground
|
|
192
|
+
description: "text-info-foreground"
|
|
193
193
|
},
|
|
194
194
|
gradient: {
|
|
195
195
|
container: "",
|
|
196
196
|
foreground: "text-info",
|
|
197
|
-
description: "text-info
|
|
197
|
+
description: "text-info"
|
|
198
198
|
},
|
|
199
199
|
glow: {
|
|
200
200
|
container: "border border-info/15 bg-info/4 text-info shadow-glow shadow-info/45 [&>svg]:text-info",
|
|
201
201
|
foreground: "text-info",
|
|
202
|
-
description: "text-info
|
|
202
|
+
description: "text-info"
|
|
203
203
|
}
|
|
204
204
|
},
|
|
205
205
|
warning: {
|
|
@@ -216,12 +216,12 @@ var PRESET_VARIANT_STYLES = {
|
|
|
216
216
|
solid: {
|
|
217
217
|
container: "border border-transparent bg-warning text-warning-foreground [&>svg]:text-warning-foreground",
|
|
218
218
|
foreground: "text-warning-foreground",
|
|
219
|
-
description: "text-warning-foreground
|
|
219
|
+
description: "text-warning-foreground"
|
|
220
220
|
},
|
|
221
221
|
gradient: {
|
|
222
222
|
container: "",
|
|
223
223
|
foreground: "text-warning",
|
|
224
|
-
description: "text-warning
|
|
224
|
+
description: "text-warning"
|
|
225
225
|
},
|
|
226
226
|
glow: {
|
|
227
227
|
container: "border border-warning/15 bg-warning/4 text-warning shadow-glow shadow-warning/45 [&>svg]:text-warning",
|
|
@@ -233,108 +233,108 @@ var PRESET_VARIANT_STYLES = {
|
|
|
233
233
|
soft: {
|
|
234
234
|
container: "border border-error/10 bg-error/5 text-error [&>svg]:text-error",
|
|
235
235
|
foreground: "text-error",
|
|
236
|
-
description: "text-error
|
|
236
|
+
description: "text-error"
|
|
237
237
|
},
|
|
238
238
|
outline: {
|
|
239
239
|
container: "bg-transparent border border-error/50 dark:border-error/30 text-error [&>svg]:text-error",
|
|
240
240
|
foreground: "text-error",
|
|
241
|
-
description: "text-error
|
|
241
|
+
description: "text-error"
|
|
242
242
|
},
|
|
243
243
|
solid: {
|
|
244
244
|
container: "border border-transparent bg-error text-error-foreground [&>svg]:text-error-foreground",
|
|
245
245
|
foreground: "text-error-foreground",
|
|
246
|
-
description: "text-error-foreground
|
|
246
|
+
description: "text-error-foreground"
|
|
247
247
|
},
|
|
248
248
|
gradient: {
|
|
249
249
|
container: "",
|
|
250
250
|
foreground: "text-error",
|
|
251
|
-
description: "text-error
|
|
251
|
+
description: "text-error"
|
|
252
252
|
},
|
|
253
253
|
glow: {
|
|
254
254
|
container: "border border-error/15 bg-error/4 text-error shadow-glow shadow-error/45 [&>svg]:text-error",
|
|
255
255
|
foreground: "text-error",
|
|
256
|
-
description: "text-error
|
|
256
|
+
description: "text-error"
|
|
257
257
|
}
|
|
258
258
|
},
|
|
259
259
|
success: {
|
|
260
260
|
soft: {
|
|
261
261
|
container: "border border-success/10 bg-success/5 text-success [&>svg]:text-success",
|
|
262
262
|
foreground: "text-success",
|
|
263
|
-
description: "text-success
|
|
263
|
+
description: "text-success"
|
|
264
264
|
},
|
|
265
265
|
outline: {
|
|
266
266
|
container: "bg-transparent border border-success/50 dark:border-success/30 text-success [&>svg]:text-success",
|
|
267
267
|
foreground: "text-success",
|
|
268
|
-
description: "text-success
|
|
268
|
+
description: "text-success"
|
|
269
269
|
},
|
|
270
270
|
solid: {
|
|
271
271
|
container: "border border-transparent bg-success text-success-foreground [&>svg]:text-success-foreground",
|
|
272
272
|
foreground: "text-success-foreground",
|
|
273
|
-
description: "text-success-foreground
|
|
273
|
+
description: "text-success-foreground"
|
|
274
274
|
},
|
|
275
275
|
gradient: {
|
|
276
276
|
container: "",
|
|
277
277
|
foreground: "text-success",
|
|
278
|
-
description: "text-success
|
|
278
|
+
description: "text-success"
|
|
279
279
|
},
|
|
280
280
|
glow: {
|
|
281
281
|
container: "border border-success/15 bg-success/4 text-success shadow-glow shadow-success/45 [&>svg]:text-success",
|
|
282
282
|
foreground: "text-success",
|
|
283
|
-
description: "text-success
|
|
283
|
+
description: "text-success"
|
|
284
284
|
}
|
|
285
285
|
},
|
|
286
286
|
disabled: {
|
|
287
287
|
soft: {
|
|
288
288
|
container: "border border-disabled/10 bg-disabled/5 text-disabled [&>svg]:text-disabled",
|
|
289
289
|
foreground: "text-disabled",
|
|
290
|
-
description: "text-disabled
|
|
290
|
+
description: "text-disabled"
|
|
291
291
|
},
|
|
292
292
|
outline: {
|
|
293
293
|
container: "bg-transparent border border-disabled/50 dark:border-disabled/30 text-disabled [&>svg]:text-disabled",
|
|
294
294
|
foreground: "text-disabled",
|
|
295
|
-
description: "text-disabled
|
|
295
|
+
description: "text-disabled"
|
|
296
296
|
},
|
|
297
297
|
solid: {
|
|
298
298
|
container: "border border-transparent bg-disabled text-disabled-foreground [&>svg]:text-disabled-foreground",
|
|
299
299
|
foreground: "text-disabled-foreground",
|
|
300
|
-
description: "text-disabled-foreground
|
|
300
|
+
description: "text-disabled-foreground"
|
|
301
301
|
},
|
|
302
302
|
gradient: {
|
|
303
303
|
container: "",
|
|
304
304
|
foreground: "text-disabled",
|
|
305
|
-
description: "text-disabled
|
|
305
|
+
description: "text-disabled"
|
|
306
306
|
},
|
|
307
307
|
glow: {
|
|
308
308
|
container: "border border-disabled/15 bg-disabled/4 text-disabled shadow-glow shadow-disabled/45 [&>svg]:text-disabled",
|
|
309
309
|
foreground: "text-disabled",
|
|
310
|
-
description: "text-disabled
|
|
310
|
+
description: "text-disabled"
|
|
311
311
|
}
|
|
312
312
|
},
|
|
313
313
|
gray: {
|
|
314
314
|
soft: {
|
|
315
315
|
container: "border border-gray/10 bg-gray/5 text-gray [&>svg]:text-gray",
|
|
316
316
|
foreground: "text-gray",
|
|
317
|
-
description: "text-gray
|
|
317
|
+
description: "text-gray"
|
|
318
318
|
},
|
|
319
319
|
outline: {
|
|
320
320
|
container: "bg-transparent border border-gray/50 dark:border-gray/30 text-gray [&>svg]:text-gray",
|
|
321
321
|
foreground: "text-gray",
|
|
322
|
-
description: "text-gray
|
|
322
|
+
description: "text-gray"
|
|
323
323
|
},
|
|
324
324
|
solid: {
|
|
325
325
|
container: "border border-transparent bg-gray text-gray-foreground [&>svg]:text-gray-foreground",
|
|
326
326
|
foreground: "text-gray-foreground",
|
|
327
|
-
description: "text-gray-foreground
|
|
327
|
+
description: "text-gray-foreground"
|
|
328
328
|
},
|
|
329
329
|
gradient: {
|
|
330
330
|
container: "",
|
|
331
331
|
foreground: "text-gray",
|
|
332
|
-
description: "text-gray
|
|
332
|
+
description: "text-gray"
|
|
333
333
|
},
|
|
334
334
|
glow: {
|
|
335
335
|
container: "border border-gray/15 bg-gray/4 text-gray shadow-glow shadow-gray/45 [&>svg]:text-gray",
|
|
336
336
|
foreground: "text-gray",
|
|
337
|
-
description: "text-gray
|
|
337
|
+
description: "text-gray"
|
|
338
338
|
}
|
|
339
339
|
},
|
|
340
340
|
mist: {
|
|
@@ -374,29 +374,29 @@ var SILVER_VARIANT_ROWS = {
|
|
|
374
374
|
soft: {
|
|
375
375
|
container: "border border-gray/5 bg-gray/2 text-gray [&>svg]:text-gray",
|
|
376
376
|
foreground: "text-gray",
|
|
377
|
-
description: "text-gray
|
|
377
|
+
description: "text-gray"
|
|
378
378
|
},
|
|
379
379
|
outline: {
|
|
380
380
|
/** No `border-*` here — the metallic ring is painted by `SilverMetallicBorderOverlay`. */
|
|
381
381
|
container: "bg-transparent border-0 text-gray [&>svg]:text-gray",
|
|
382
382
|
foreground: "text-gray",
|
|
383
|
-
description: "text-gray
|
|
383
|
+
description: "text-gray"
|
|
384
384
|
},
|
|
385
385
|
solid: {
|
|
386
386
|
/** Metallic surface gradient layered on top of `bg-gray` via `SILVER_SOLID_SURFACE_STYLE`. */
|
|
387
387
|
container: "border border-transparent bg-gray text-gray-foreground [&>svg]:text-gray-foreground",
|
|
388
388
|
foreground: "text-gray-foreground",
|
|
389
|
-
description: "text-gray-foreground
|
|
389
|
+
description: "text-gray-foreground"
|
|
390
390
|
},
|
|
391
391
|
gradient: {
|
|
392
392
|
container: "",
|
|
393
393
|
foreground: "text-gray",
|
|
394
|
-
description: "text-gray
|
|
394
|
+
description: "text-gray"
|
|
395
395
|
},
|
|
396
396
|
glow: {
|
|
397
397
|
container: "border border-gray/15 bg-gray/4 text-gray shadow-glow shadow-gray/45 [&>svg]:text-gray",
|
|
398
398
|
foreground: "text-gray",
|
|
399
|
-
description: "text-gray
|
|
399
|
+
description: "text-gray"
|
|
400
400
|
}
|
|
401
401
|
};
|
|
402
402
|
/**
|
|
@@ -411,7 +411,7 @@ function getArbitraryVariantStyles(variant, color) {
|
|
|
411
411
|
container: cn("border [&>svg]:text-current", text.className),
|
|
412
412
|
foreground: text.className ?? "",
|
|
413
413
|
foregroundStyle: text.style,
|
|
414
|
-
description: "text-current
|
|
414
|
+
description: "text-current",
|
|
415
415
|
containerStyle: {
|
|
416
416
|
backgroundColor: `color-mix(in srgb, ${color} 5%, transparent)`,
|
|
417
417
|
borderColor: `color-mix(in srgb, ${color} 10%, transparent)`,
|
|
@@ -422,7 +422,7 @@ function getArbitraryVariantStyles(variant, color) {
|
|
|
422
422
|
container: cn("bg-transparent border [&>svg]:text-current", border.className, text.className),
|
|
423
423
|
foreground: text.className ?? "",
|
|
424
424
|
foregroundStyle: text.style,
|
|
425
|
-
description: "text-current
|
|
425
|
+
description: "text-current",
|
|
426
426
|
containerStyle: {
|
|
427
427
|
borderColor: `light-dark(
|
|
428
428
|
color-mix(in srgb, ${color} 50%, transparent),
|
|
@@ -435,7 +435,7 @@ function getArbitraryVariantStyles(variant, color) {
|
|
|
435
435
|
container: cn("border [&>svg]:text-current", text.className),
|
|
436
436
|
foreground: text.className ?? "",
|
|
437
437
|
foregroundStyle: text.style,
|
|
438
|
-
description: "text-current
|
|
438
|
+
description: "text-current",
|
|
439
439
|
containerStyle: {
|
|
440
440
|
backgroundColor: `color-mix(in oklab, ${color} 4%, transparent)`,
|
|
441
441
|
borderColor: `color-mix(in oklab, ${color} 15%, transparent)`,
|
|
@@ -447,7 +447,7 @@ function getArbitraryVariantStyles(variant, color) {
|
|
|
447
447
|
container: "border border-transparent text-[color:var(--espd-on-solid-foreground,#fff)] [&>svg]:text-[color:var(--espd-on-solid-foreground,#fff)]",
|
|
448
448
|
foreground: "text-[color:var(--espd-on-solid-foreground,#fff)]",
|
|
449
449
|
foregroundStyle: { color: ON_SOLID_FOREGROUND },
|
|
450
|
-
description: "text-[color:var(--espd-on-solid-foreground,#fff)]
|
|
450
|
+
description: "text-[color:var(--espd-on-solid-foreground,#fff)]",
|
|
451
451
|
containerStyle: {
|
|
452
452
|
backgroundColor: color,
|
|
453
453
|
color: ON_SOLID_FOREGROUND
|
|
@@ -457,7 +457,7 @@ function getArbitraryVariantStyles(variant, color) {
|
|
|
457
457
|
container: cn("relative isolate overflow-hidden group border [&>svg]:text-current", text.className),
|
|
458
458
|
foreground: text.className ?? "",
|
|
459
459
|
foregroundStyle: text.style,
|
|
460
|
-
description: "text-current
|
|
460
|
+
description: "text-current",
|
|
461
461
|
containerStyle: {
|
|
462
462
|
borderColor: `color-mix(in srgb, ${color} 20%, transparent)`,
|
|
463
463
|
...text.style
|
|
@@ -62,7 +62,12 @@ interface VariantStyles {
|
|
|
62
62
|
/** Foreground/text classes (use on labels, icons not living inside the container). */
|
|
63
63
|
foreground: string;
|
|
64
64
|
foregroundStyle?: React.CSSProperties;
|
|
65
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Description/secondary text classes. Built-in variants draw it at the full
|
|
67
|
+
* strength of the variant's text colour (an alpha such as `/60` or `/80`
|
|
68
|
+
* dropped the text under WCAG AA's 4.5:1 on the tinted surfaces); it reads as
|
|
69
|
+
* secondary through its lighter weight, not a fainter colour.
|
|
70
|
+
*/
|
|
66
71
|
description: string;
|
|
67
72
|
descriptionStyle?: React.CSSProperties;
|
|
68
73
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@espressif/dashboard-ui-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "Reusable React UI components, page layouts, and utilities — Espressif's dashboard design system.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"files": [
|
|
117
117
|
"dist",
|
|
118
118
|
"src/styles",
|
|
119
|
+
"!src/styles/**/*.ts",
|
|
119
120
|
"src/assets",
|
|
120
121
|
"tailwind.preset.ts",
|
|
121
122
|
"LICENSE",
|
|
@@ -130,6 +131,7 @@
|
|
|
130
131
|
"build": "node scripts/gen-entries.mjs && vite build --config vite.lib.config.ts && npm run build:types",
|
|
131
132
|
"build:types": "node --max-old-space-size=4096 node_modules/tsup/dist/cli-default.js",
|
|
132
133
|
"gen:entries": "node scripts/gen-entries.mjs",
|
|
134
|
+
"gen:type-scale": "node scripts/gen-type-scale.mjs",
|
|
133
135
|
"dev:lib": "node scripts/gen-entries.mjs && npm run build:types && vite build --config vite.lib.config.ts --watch",
|
|
134
136
|
"prepublishOnly": "npm run build",
|
|
135
137
|
"typecheck": "tsc --noEmit",
|
package/src/styles/theme.css
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
@import "./colors.css";
|
|
19
19
|
@import "./style-axes.css";
|
|
20
|
+
@import "./type-scale.css";
|
|
20
21
|
|
|
21
22
|
@source "../../dist";
|
|
22
23
|
/* Utilities the components generated before 1.12 and no longer use since
|
|
@@ -37,6 +38,9 @@
|
|
|
37
38
|
@source inline("bg-black/50 bg-black/80");
|
|
38
39
|
/* The NavBar details panel's shadow, now on the navbar elevation token (1.12). */
|
|
39
40
|
@source inline("shadow-lg");
|
|
41
|
+
/* The raw text sizes (and the leading / weight classes that only went with
|
|
42
|
+
them) the components generated before they moved onto the type roles (1.14). */
|
|
43
|
+
@source inline("text-base text-lg text-[0.8rem] text-[11px] text-[16px] md:text-sm md:text-xs md:text-[13px] @[12rem]:text-base @[12rem]:text-sm @md:text-lg [&>div]:text-sm [&>span]:text-xs [&_[cmdk-group-heading]]:text-xs [&_code]:!text-[13px] [&_p]:leading-relaxed peer-focus:text-xs peer-placeholder-shown:text-sm file:text-sm file:font-medium data-[active=true]:font-medium leading-4 leading-[var(--tw-leading,var(--text-sm--line-height))]");
|
|
40
44
|
/* Footer heights and the AppLogo cap before the shell / workspace-layout
|
|
41
45
|
token names (1.12). */
|
|
42
46
|
@source inline("h-[var(--espd-footer-height)] h-[var(--espd-hidden-footer-height)] max-h-[calc(var(--espd-header-height)-16px)]");
|
|
@@ -595,11 +599,12 @@
|
|
|
595
599
|
--text-sm: 0.875rem;
|
|
596
600
|
--text-sm--line-height: 1.25rem;
|
|
597
601
|
|
|
598
|
-
/** Every sidebar nav row: group labels and menu item labels share one scale
|
|
599
|
-
|
|
602
|
+
/** Every sidebar nav row: group labels and menu item labels share one scale,
|
|
603
|
+
the `label` role's size by default. */
|
|
604
|
+
--espd-sidebar-item-font-size: var(--espd-type-label-size);
|
|
600
605
|
/** Collapsed-sidebar flyout: group title row. Matches the rows above by default;
|
|
601
606
|
raise it if you want the flyout title to stand out from its submenu items. */
|
|
602
|
-
--espd-sidebar-flyout-group-label-font-size:
|
|
607
|
+
--espd-sidebar-flyout-group-label-font-size: var(--espd-type-label-size);
|
|
603
608
|
|
|
604
609
|
/* ─── Semantic tokens beyond colour ───
|
|
605
610
|
Each default reproduces the value the components used before it existed,
|