@luxalgo/vela-ui 0.2.0 → 0.4.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/CHANGELOG.md +153 -91
- package/LICENSE +201 -201
- package/NOTICE +28 -28
- package/README.md +86 -86
- package/cli/engine.mjs +282 -282
- package/cli/index.mjs +154 -154
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +1 -1
- package/dist/bar-chart.js +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/button.js +4 -4
- package/dist/callout-bubble.d.ts +1 -1
- package/dist/callout-bubble.js +4 -4
- package/dist/card.d.ts +52 -0
- package/dist/card.js +179 -0
- package/dist/checkbox.js +5 -5
- package/dist/{chunk-B5ZSRUDQ.js → chunk-BWSOMG3G.js} +2 -2
- package/dist/{chunk-G7IQLY3A.js → chunk-C3PXY2SW.js} +5 -0
- package/dist/{chunk-CC3DDNFC.js → chunk-DXDCKZ2M.js} +4 -4
- package/dist/chunk-GUIYFQ27.js +30 -0
- package/dist/{chunk-WGULXRWD.js → chunk-KUWTI2PE.js} +4 -4
- package/dist/{chunk-Z5PINFQO.js → chunk-QGWAN3EP.js} +5 -5
- package/dist/{chunk-V2Q4MRMS.js → chunk-RH53NQGE.js} +30 -4
- package/dist/{chunk-WBGSYCV2.js → chunk-SKFAYTDK.js} +4 -4
- package/dist/{chunk-MJ4RUGX7.js → chunk-TGJNHUYV.js} +3 -3
- package/dist/{chunk-WXH3EFV5.js → chunk-VC7SVSDK.js} +4 -4
- package/dist/{chunk-7VMN7NKJ.js → chunk-YT2BSP7O.js} +3 -3
- package/dist/collapsible.d.ts +1 -1
- package/dist/collapsible.js +3 -3
- package/dist/color-picker.js +5 -5
- package/dist/context-menu.js +5 -5
- package/dist/data-table.d.ts +1 -1
- package/dist/data-table.js +1 -1
- package/dist/date-picker.d.ts +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/dialog.d.ts +9 -1
- package/dist/dialog.js +15 -5
- package/dist/donut.d.ts +1 -1
- package/dist/donut.js +1 -1
- package/dist/drawer.d.ts +1 -1
- package/dist/drawer.js +2 -2
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/dropdown-menu.js +5 -5
- package/dist/empty.d.ts +1 -1
- package/dist/empty.js +2 -2
- package/dist/field.js +13 -13
- package/dist/{stat.d.ts → figure.d.ts} +9 -9
- package/dist/figure.js +41 -0
- package/dist/glyph-select.js +5 -5
- package/dist/hover-card.d.ts +1 -1
- package/dist/hover-card.js +3 -3
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -3
- package/dist/input-group.d.ts +1 -1
- package/dist/input-group.js +4 -4
- package/dist/input.js +2 -2
- package/dist/item.d.ts +1 -1
- package/dist/item.js +2 -2
- package/dist/kbd.d.ts +1 -1
- package/dist/kbd.js +2 -2
- package/dist/line-chart.d.ts +1 -1
- package/dist/line-chart.js +1 -1
- package/dist/manifest.json +691 -74
- package/dist/month-grid.js +1 -1
- package/dist/number-input.d.ts +1 -1
- package/dist/number-input.js +5 -5
- package/dist/popover.js +3 -3
- package/dist/scatter-chart.d.ts +1 -1
- package/dist/scatter-chart.js +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.js +7 -7
- package/dist/slider.d.ts +1 -1
- package/dist/slider.js +2 -2
- package/dist/sort-button.js +4 -4
- package/dist/sparkline.d.ts +1 -1
- package/dist/sparkline.js +1 -1
- package/dist/switch.d.ts +1 -1
- package/dist/switch.js +3 -3
- package/dist/tabs.d.ts +1 -1
- package/dist/tabs.js +4 -4
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js +2 -2
- package/dist/theme-TefB8vtl.d.ts +341 -0
- package/dist/theme.d.ts +42 -192
- package/dist/theme.js +1 -1
- package/dist/theme.schema.json +321 -30
- package/dist/toast.d.ts +49 -0
- package/dist/toast.js +463 -0
- package/dist/toggle-group.d.ts +1 -1
- package/dist/toggle-group.js +4 -4
- package/dist/tooltip.js +2 -2
- package/dist/treemap.d.ts +80 -0
- package/dist/treemap.js +470 -0
- package/dist/zag.d.ts +11 -2
- package/dist/zag.js +1 -1
- package/docs/theming.md +217 -217
- package/docs/what-to-change.md +20 -20
- package/docs/writing-a-component.md +250 -250
- package/llms.txt +6 -3
- package/package.json +90 -90
- package/registry/badge.ts +119 -119
- package/registry/bar-chart.ts +215 -215
- package/registry/button.ts +387 -379
- package/registry/callout-bubble.ts +347 -347
- package/registry/card.ts +379 -0
- package/registry/checkbox.ts +234 -234
- package/registry/collapsible.ts +271 -271
- package/registry/color-picker.ts +582 -582
- package/registry/context-menu.ts +208 -208
- package/registry/data-table.ts +215 -215
- package/registry/date-picker.ts +483 -483
- package/registry/dialog.ts +551 -535
- package/registry/donut.ts +145 -145
- package/registry/drawer.ts +636 -636
- package/registry/dropdown-menu.ts +762 -762
- package/registry/empty.ts +91 -91
- package/registry/field.ts +584 -584
- package/registry/{stat.ts → figure.ts} +96 -96
- package/registry/glyph-select.ts +268 -268
- package/registry/hover-card.ts +222 -222
- package/registry/input-group.ts +229 -229
- package/registry/input.ts +181 -181
- package/registry/item.ts +376 -376
- package/registry/kbd.ts +64 -64
- package/registry/line-chart.ts +218 -218
- package/registry/month-grid.ts +328 -328
- package/registry/number-input.ts +443 -443
- package/registry/popover.ts +368 -368
- package/registry/scatter-chart.ts +221 -221
- package/registry/select.ts +620 -620
- package/registry/slider.ts +259 -259
- package/registry/sort-button.ts +189 -189
- package/registry/sparkline.ts +114 -114
- package/registry/switch.ts +205 -205
- package/registry/tabs.ts +426 -426
- package/registry/text-area.ts +186 -186
- package/registry/toast.ts +965 -0
- package/registry/toggle-group.ts +295 -295
- package/registry/tooltip.ts +156 -156
- package/registry/treemap.ts +847 -0
- package/skills/theming-vela-ui/SKILL.md +137 -137
- package/skills/using-vela-ui-components/SKILL.md +139 -137
- package/skills/writing-vela-ui-components/SKILL.md +163 -163
- package/src/components/badge.ts +119 -119
- package/src/components/bar-chart.ts +215 -215
- package/src/components/button.ts +387 -379
- package/src/components/callout-bubble.ts +347 -347
- package/src/components/card.ts +379 -0
- package/src/components/checkbox.ts +234 -234
- package/src/components/collapsible.ts +271 -271
- package/src/components/color-picker.ts +582 -582
- package/src/components/context-menu.ts +208 -208
- package/src/components/data-table.ts +215 -215
- package/src/components/date-picker.ts +483 -483
- package/src/components/dialog.ts +551 -535
- package/src/components/donut.ts +145 -145
- package/src/components/drawer.ts +636 -636
- package/src/components/dropdown-menu.ts +762 -762
- package/src/components/empty.ts +91 -91
- package/src/components/field.ts +584 -584
- package/src/components/{stat.ts → figure.ts} +96 -96
- package/src/components/glyph-select.ts +268 -268
- package/src/components/hover-card.ts +222 -222
- package/src/components/input-group.ts +229 -229
- package/src/components/input.ts +181 -181
- package/src/components/item.ts +376 -376
- package/src/components/kbd.ts +64 -64
- package/src/components/line-chart.ts +218 -218
- package/src/components/month-grid.ts +328 -328
- package/src/components/number-input.ts +443 -443
- package/src/components/popover.ts +368 -368
- package/src/components/scatter-chart.ts +221 -221
- package/src/components/select.ts +620 -620
- package/src/components/slider.ts +259 -259
- package/src/components/sort-button.ts +189 -189
- package/src/components/sparkline.ts +114 -114
- package/src/components/switch.ts +205 -205
- package/src/components/tabs.ts +426 -426
- package/src/components/text-area.ts +186 -186
- package/src/components/toast.ts +965 -0
- package/src/components/toggle-group.ts +295 -295
- package/src/components/tooltip.ts +156 -156
- package/src/components/treemap.ts +847 -0
- package/src/index.ts +24 -24
- package/src/lib/calendar.ts +117 -117
- package/src/lib/chart.ts +72 -72
- package/src/lib/color.ts +89 -89
- package/src/lib/component-index.ts +163 -151
- package/src/lib/css.ts +48 -48
- package/src/lib/define.ts +45 -45
- package/src/lib/dispose.ts +36 -36
- package/src/lib/h.ts +55 -55
- package/src/lib/headless.ts +16 -16
- package/src/lib/i18n.ts +30 -30
- package/src/lib/icons.ts +244 -237
- package/src/lib/kit-text.ts +26 -26
- package/src/lib/page.ts +24 -24
- package/src/lib/palette.ts +81 -81
- package/src/lib/placement.ts +188 -188
- package/src/lib/scope.ts +135 -135
- package/src/lib/styles.ts +53 -53
- package/src/lib/surface-events.ts +31 -31
- package/src/lib/surface-exit.ts +87 -87
- package/src/lib/t.ts +68 -68
- package/src/lib/theme.ts +684 -664
- package/src/lib/tokens.ts +110 -110
- package/src/lib/variants.ts +32 -32
- package/src/lib/zag.ts +61 -46
- package/stylelint/index.mjs +60 -60
- package/stylelint/lint.mjs +81 -81
- package/stylelint/plugin.mjs +115 -115
- package/dist/chunk-P4MTEMT7.js +0 -23
- package/dist/stat.js +0 -41
- package/dist/{chunk-U3EH42YY.js → chunk-5BJV5FY5.js} +1 -1
- package/dist/{chunk-E2FE6V2N.js → chunk-ALAHGSLC.js} +1 -1
- package/dist/{chunk-C3ICYMI3.js → chunk-FYVQO5TN.js} +1 -1
package/dist/theme.d.ts
CHANGED
|
@@ -1,199 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
|
|
37
|
-
import
|
|
38
|
-
import
|
|
1
|
+
import './badge.js';
|
|
2
|
+
import './bar-chart.js';
|
|
3
|
+
import './button.js';
|
|
4
|
+
import './callout-bubble.js';
|
|
5
|
+
import './card.js';
|
|
6
|
+
import './color-picker.js';
|
|
7
|
+
import './data-table.js';
|
|
8
|
+
import './date-picker.js';
|
|
9
|
+
import './dialog.js';
|
|
10
|
+
import './donut.js';
|
|
11
|
+
import './drawer.js';
|
|
12
|
+
import './empty.js';
|
|
13
|
+
import './field.js';
|
|
14
|
+
import './glyph-select.js';
|
|
15
|
+
import './hover-card.js';
|
|
16
|
+
import './kbd.js';
|
|
17
|
+
import './line-chart.js';
|
|
18
|
+
import './dropdown-menu.js';
|
|
19
|
+
import './number-input.js';
|
|
20
|
+
import './popover.js';
|
|
21
|
+
import './scatter-chart.js';
|
|
22
|
+
import './select.js';
|
|
23
|
+
import './sparkline.js';
|
|
24
|
+
import './figure.js';
|
|
25
|
+
import './checkbox.js';
|
|
26
|
+
import './collapsible.js';
|
|
27
|
+
import './tabs.js';
|
|
28
|
+
import './text-area.js';
|
|
29
|
+
import './input.js';
|
|
30
|
+
import './input-group.js';
|
|
31
|
+
import './item.js';
|
|
32
|
+
import './month-grid.js';
|
|
33
|
+
import './slider.js';
|
|
34
|
+
import './sort-button.js';
|
|
35
|
+
import './switch.js';
|
|
36
|
+
export { C as ComponentDefs, a as ComponentSettings, b as CreateThemeOptions, D as DARK_CHART, L as LIGHT_CHART, T as TOKEN_NAMES, c as ThemeInput, d as ThemeSettings, e as ThemedChart, f as TokenName, U as UiTheme, y as applyPlotOverlayTokens, g as applyTheme, z as applyThemeTokens, h as checkTheme, i as createTheme, A as ensureUIHost, B as floatingLayerHost, F as themeCss } from './theme-TefB8vtl.js';
|
|
37
|
+
import './toggle-group.js';
|
|
38
|
+
import './tooltip.js';
|
|
39
|
+
import './treemap.js';
|
|
40
|
+
import './define-D5u3F5Dj.js';
|
|
41
|
+
import './tokens.js';
|
|
39
42
|
import './variants-B4stUBnY.js';
|
|
40
43
|
import './t.js';
|
|
41
44
|
import './placement.js';
|
|
42
|
-
import './i18n.js';
|
|
43
45
|
import './h-Bl37qUis.js';
|
|
46
|
+
import './i18n.js';
|
|
44
47
|
import '@zag-js/dialog';
|
|
45
48
|
import '@zag-js/menu';
|
|
46
49
|
import '@zag-js/tooltip';
|
|
47
|
-
|
|
48
|
-
/** The built-in dark chart theme. */
|
|
49
|
-
declare const DARK_CHART: ChartTheme;
|
|
50
|
-
/** The built-in light chart theme. Candle hues are shared across themes: switching themes
|
|
51
|
-
* recolors surfaces and text, never the series. */
|
|
52
|
-
declare const LIGHT_CHART: ChartTheme;
|
|
53
|
-
/** Every token, by name without the `--vela-` prefix. A test checks the list against what
|
|
54
|
-
* `createTheme` writes. */
|
|
55
|
-
declare const TOKEN_NAMES: readonly ["space-1", "space-2", "space-3", "space-4", "radius-sm", "radius-md", "radius-lg", "z-tooltip", "z-menu", "z-dialog", "z-popover", "ease", "dur-fast", "dur-med", "font-size-sm", "font-size-md", "font-size-lg", "scroll-size", "font", "bg", "fg", "fg-muted", "fg-faint", "fg-bright", "surface", "surface-elev", "surface-overlay", "surface-sunken", "border", "border-strong", "border-soft", "border-faint", "hover", "active", "hover-strong", "focus", "focus-soft", "separator-hover-band", "separator-hover-line", "scroll", "accent", "accent-bright", "highlight", "selected-bg", "selected-fg", "fg-on-fill", "up", "down", "profit", "loss", "danger", "shadow", "shadow-dialog", "backdrop"];
|
|
56
|
-
type TokenName = (typeof TOKEN_NAMES)[number];
|
|
57
|
-
/** The components a theme can set, by name: each one's declaration. A package with
|
|
58
|
-
* components of its own adds them here by declaration merging. */
|
|
59
|
-
interface ComponentDefs {
|
|
60
|
-
badge: typeof badgeDef;
|
|
61
|
-
'bar-chart': typeof barChartDef;
|
|
62
|
-
button: typeof buttonDef;
|
|
63
|
-
'callout-bubble': typeof calloutBubbleDef;
|
|
64
|
-
checkbox: typeof checkboxDef;
|
|
65
|
-
collapsible: typeof collapsibleDef;
|
|
66
|
-
'color-picker': typeof colorPickerDef;
|
|
67
|
-
'data-table': typeof dataTableDef;
|
|
68
|
-
'date-picker': typeof datePickerDef;
|
|
69
|
-
dialog: typeof dialogDef;
|
|
70
|
-
donut: typeof donutDef;
|
|
71
|
-
drawer: typeof drawerDef;
|
|
72
|
-
'dropdown-menu': typeof dropdownMenuDef;
|
|
73
|
-
empty: typeof emptyDef;
|
|
74
|
-
field: typeof fieldDef;
|
|
75
|
-
'glyph-select': typeof glyphSelectDef;
|
|
76
|
-
'hover-card': typeof hoverCardDef;
|
|
77
|
-
'input-group': typeof inputGroupDef;
|
|
78
|
-
input: typeof inputDef;
|
|
79
|
-
item: typeof itemDef;
|
|
80
|
-
kbd: typeof kbdDef;
|
|
81
|
-
'line-chart': typeof lineChartDef;
|
|
82
|
-
'month-grid': typeof monthGridDef;
|
|
83
|
-
'number-input': typeof numberInputDef;
|
|
84
|
-
popover: typeof popoverDef;
|
|
85
|
-
'scatter-chart': typeof scatterChartDef;
|
|
86
|
-
select: typeof selectDef;
|
|
87
|
-
slider: typeof sliderDef;
|
|
88
|
-
'sort-button': typeof sortButtonDef;
|
|
89
|
-
sparkline: typeof sparklineDef;
|
|
90
|
-
stat: typeof statDef;
|
|
91
|
-
switch: typeof switchDef;
|
|
92
|
-
tabs: typeof tabsDef;
|
|
93
|
-
'text-area': typeof textAreaDef;
|
|
94
|
-
'toggle-group': typeof toggleGroupDef;
|
|
95
|
-
tooltip: typeof tooltipDef;
|
|
96
|
-
}
|
|
97
|
-
type SettingsOf<D> = D extends ComponentDef<string, string, infer S> ? S : never;
|
|
98
|
-
type PartsOf<D> = D extends ComponentDef<string, infer P, string> ? P : never;
|
|
99
|
-
/** Settings by component, then by setting (`{ button: { radius: '2px' } }`), each written
|
|
100
|
-
* as `--vela-<component>-<setting>`. `css` restyles the component's parts completely: each
|
|
101
|
-
* part's CSS, written with the `css` tag, applies to that part under the theme, after every
|
|
102
|
-
* other layer of the kit. */
|
|
103
|
-
type ComponentSettings = {
|
|
104
|
-
[K in keyof ComponentDefs]?: {
|
|
105
|
-
[S in SettingsOf<ComponentDefs[K]>]?: string;
|
|
106
|
-
} & {
|
|
107
|
-
css?: {
|
|
108
|
-
[P in PartsOf<ComponentDefs[K]>]?: string;
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
interface CreateThemeOptions {
|
|
113
|
-
/** Apply part CSS that was not written with the `css` tag (a theme loaded from data).
|
|
114
|
-
* Off by default: CSS from someone else can restyle the page to mislead, and load
|
|
115
|
-
* remote images that leak what the page shows. */
|
|
116
|
-
allowCss?: boolean;
|
|
117
|
-
}
|
|
118
|
-
/** A theme's settings beyond the chart's colors. */
|
|
119
|
-
interface ThemeSettings {
|
|
120
|
-
/** The brand color; its readable ink derives from it. */
|
|
121
|
-
accent?: string;
|
|
122
|
-
/** Scales every radius token: `none`, `sm`, `md` (default), `lg`. */
|
|
123
|
-
radius?: 'none' | 'sm' | 'md' | 'lg';
|
|
124
|
-
font?: string;
|
|
125
|
-
/** Any token, by name. */
|
|
126
|
-
tokens?: Partial<Record<TokenName, string>>;
|
|
127
|
-
components?: ComponentSettings;
|
|
128
|
-
}
|
|
129
|
-
/** The choices a theme is built from. Every field is optional: `createTheme()` is the dark theme. */
|
|
130
|
-
interface ThemeInput extends ThemeSettings {
|
|
131
|
-
/** The theme to start from: `dark` (default), `light`, or a chart theme's seven fields. */
|
|
132
|
-
base?: 'dark' | 'light' | ChartTheme;
|
|
133
|
-
/** A theme from colors alone: everything else derives from them, light or dark read
|
|
134
|
-
* from the background. */
|
|
135
|
-
colors?: {
|
|
136
|
-
background?: string;
|
|
137
|
-
text?: string;
|
|
138
|
-
grid?: string;
|
|
139
|
-
border?: string;
|
|
140
|
-
up?: string;
|
|
141
|
-
down?: string;
|
|
142
|
-
accent?: string;
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
/** A theme built by {@link createTheme}. */
|
|
146
|
-
interface UiTheme {
|
|
147
|
-
/** Derived from the values: equal themes share one rule. */
|
|
148
|
-
readonly id: string;
|
|
149
|
-
/** The chart's colors and font. */
|
|
150
|
-
readonly chart: ChartTheme;
|
|
151
|
-
/** Every token, by custom property (`--vela-accent`). */
|
|
152
|
-
readonly tokens: Readonly<Record<string, string>>;
|
|
153
|
-
/** Component settings, by component then setting. */
|
|
154
|
-
readonly components: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
155
|
-
/** Part CSS, by component then part. */
|
|
156
|
-
readonly css: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
157
|
-
/** Its settings beyond the chart's colors: with {@link chart}, they rebuild the theme. */
|
|
158
|
-
readonly settings: Readonly<ThemeSettings>;
|
|
159
|
-
}
|
|
160
|
-
/** A chart theme with optional settings: its seven fields seed the UI theme and `ui`
|
|
161
|
-
* adjusts it. Chrome that recolors its surface (an overlay following the plot's
|
|
162
|
-
* background) keeps the settings. */
|
|
163
|
-
type ThemedChart = ChartTheme & {
|
|
164
|
-
readonly ui?: ThemeSettings;
|
|
165
|
-
};
|
|
166
|
-
/** What is wrong with a theme's input: unknown tokens, components, settings and parts, colors
|
|
167
|
-
* the theme cannot derive from, text with too little contrast on its background, and part
|
|
168
|
-
* CSS that is left out or reaches past the component's contract. `createTheme` warns about
|
|
169
|
-
* each. */
|
|
170
|
-
declare function checkTheme(input?: ThemeInput, options?: CreateThemeOptions): string[];
|
|
171
|
-
/** Build a theme. Without overrides, `dark` and `light` give exactly the built-in tokens. */
|
|
172
|
-
declare function createTheme(input?: ThemeInput, options?: CreateThemeOptions): UiTheme;
|
|
173
|
-
/** The theme's rules: every token and component setting, by default on the hosts that carry
|
|
174
|
-
* its id; and the part CSS, on those parts inside them, in the last layer. */
|
|
175
|
-
declare function themeCss(theme: UiTheme, selector?: string): string;
|
|
176
|
-
/** Theme a host and everything inside it. A chart theme's seven fields build the theme on
|
|
177
|
-
* the way, keeping the choices of the UI theme it carries. */
|
|
178
|
-
declare function applyTheme(host: HTMLElement, theme: UiTheme | ThemedChart): UiTheme;
|
|
179
|
-
/** Theme a host from a chart theme's seven fields.
|
|
180
|
-
* @deprecated Use {@link applyTheme}, which also takes a theme from {@link createTheme}. */
|
|
181
|
-
declare function applyThemeTokens(el: HTMLElement, t: ThemedChart): void;
|
|
182
|
-
/** Re-token a chart-overlay host (statusline, watermark, toast — chrome floating OVER
|
|
183
|
-
* the plot) from the LIVE plot surface: a config edit can recolor the plot background
|
|
184
|
-
* independently of the app theme (a white plot typed into settings on the dark theme),
|
|
185
|
-
* and the overlay ink must stay readable either way. `config` is the renderer's
|
|
186
|
-
* `getConfig()` snapshot; a missing/shapeless one falls back to the base app theme.
|
|
187
|
-
* Floating menus and dropdowns do NOT use this — they mount on {@link floatingLayerHost}
|
|
188
|
-
* so their surface follows the app theme alone. */
|
|
189
|
-
declare function applyPlotOverlayTokens(host: HTMLElement, base: ThemedChart, config: unknown): void;
|
|
190
|
-
/** Mount floating kit layers (menus, select lists) on the nearest `.vela-ui` so they
|
|
191
|
-
* inherit the app-theme tokens. A plot-overlay host (the cell) retokens from
|
|
192
|
-
* `layout.background`; chrome panels must not follow that. Falls back to `fallback`
|
|
193
|
-
* (typically `document.body`) when no kit host is an ancestor. */
|
|
194
|
-
declare function floatingLayerHost(from: HTMLElement, fallback?: HTMLElement): HTMLElement;
|
|
195
|
-
/** Mark an element as a kit host (the `.vela-ui` class and the shared sheet), themed when
|
|
196
|
-
* a theme is given. */
|
|
197
|
-
declare function ensureUIHost(el: HTMLElement, theme?: UiTheme | ThemedChart): void;
|
|
198
|
-
|
|
199
|
-
export { type ComponentDefs, type ComponentSettings, type CreateThemeOptions, DARK_CHART, LIGHT_CHART, TOKEN_NAMES, type ThemeInput, type ThemeSettings, type ThemedChart, type TokenName, type UiTheme, applyPlotOverlayTokens, applyTheme, applyThemeTokens, checkTheme, createTheme, ensureUIHost, floatingLayerHost, themeCss };
|
package/dist/theme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DARK_CHART, LIGHT_CHART, TOKEN_NAMES, applyPlotOverlayTokens, applyTheme, applyThemeTokens, checkTheme, createTheme, ensureUIHost, floatingLayerHost, themeCss } from './chunk-
|
|
1
|
+
export { DARK_CHART, LIGHT_CHART, TOKEN_NAMES, applyPlotOverlayTokens, applyTheme, applyThemeTokens, checkTheme, createTheme, ensureUIHost, floatingLayerHost, themeCss } from './chunk-RH53NQGE.js';
|
|
2
2
|
import './chunk-TAKSIV57.js';
|
|
3
3
|
import './chunk-MMTMOV6R.js';
|
|
4
4
|
import './chunk-VMCR3S2A.js';
|
package/dist/theme.schema.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"title": "@luxalgo/vela-ui 0.
|
|
3
|
+
"title": "@luxalgo/vela-ui 0.4.0 theme",
|
|
4
4
|
"description": "The input of createTheme. Every field is optional: an empty theme is the dark theme.",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"additionalProperties": false,
|
|
@@ -476,6 +476,91 @@
|
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
478
|
},
|
|
479
|
+
"card": {
|
|
480
|
+
"type": "object",
|
|
481
|
+
"additionalProperties": false,
|
|
482
|
+
"properties": {
|
|
483
|
+
"radius": {
|
|
484
|
+
"type": "string",
|
|
485
|
+
"description": "--vela-card-radius, default var(--vela-radius-lg)"
|
|
486
|
+
},
|
|
487
|
+
"padding": {
|
|
488
|
+
"type": "string",
|
|
489
|
+
"description": "--vela-card-padding, default 16px"
|
|
490
|
+
},
|
|
491
|
+
"padding-sm": {
|
|
492
|
+
"type": "string",
|
|
493
|
+
"description": "--vela-card-padding-sm, default 10px 12px"
|
|
494
|
+
},
|
|
495
|
+
"gap": {
|
|
496
|
+
"type": "string",
|
|
497
|
+
"description": "--vela-card-gap, default 12px"
|
|
498
|
+
},
|
|
499
|
+
"gap-sm": {
|
|
500
|
+
"type": "string",
|
|
501
|
+
"description": "--vela-card-gap-sm, default 8px"
|
|
502
|
+
},
|
|
503
|
+
"background": {
|
|
504
|
+
"type": "string",
|
|
505
|
+
"description": "--vela-card-background, default var(--vela-surface)"
|
|
506
|
+
},
|
|
507
|
+
"border": {
|
|
508
|
+
"type": "string",
|
|
509
|
+
"description": "--vela-card-border, default var(--vela-border)"
|
|
510
|
+
},
|
|
511
|
+
"inset-background": {
|
|
512
|
+
"type": "string",
|
|
513
|
+
"description": "--vela-card-inset-background, default `color-mix(in srgb, ${t.fg.bright} 2.5%, ${t.surface})`"
|
|
514
|
+
},
|
|
515
|
+
"css": {
|
|
516
|
+
"type": "object",
|
|
517
|
+
"additionalProperties": false,
|
|
518
|
+
"description": "CSS by part, applied after every layer of the kit. From a file, it applies only when the host passes { allowCss: true }.",
|
|
519
|
+
"properties": {
|
|
520
|
+
"root": {
|
|
521
|
+
"type": "string",
|
|
522
|
+
"description": "[data-slot~=\"card\"]"
|
|
523
|
+
},
|
|
524
|
+
"header": {
|
|
525
|
+
"type": "string",
|
|
526
|
+
"description": "[data-slot~=\"card-header\"]"
|
|
527
|
+
},
|
|
528
|
+
"heading": {
|
|
529
|
+
"type": "string",
|
|
530
|
+
"description": "[data-slot~=\"card-heading\"]"
|
|
531
|
+
},
|
|
532
|
+
"eyebrow": {
|
|
533
|
+
"type": "string",
|
|
534
|
+
"description": "[data-slot~=\"card-eyebrow\"]"
|
|
535
|
+
},
|
|
536
|
+
"title": {
|
|
537
|
+
"type": "string",
|
|
538
|
+
"description": "[data-slot~=\"card-title\"]"
|
|
539
|
+
},
|
|
540
|
+
"trigger": {
|
|
541
|
+
"type": "string",
|
|
542
|
+
"description": "[data-slot~=\"card-trigger\"]"
|
|
543
|
+
},
|
|
544
|
+
"description": {
|
|
545
|
+
"type": "string",
|
|
546
|
+
"description": "[data-slot~=\"card-description\"]"
|
|
547
|
+
},
|
|
548
|
+
"action": {
|
|
549
|
+
"type": "string",
|
|
550
|
+
"description": "[data-slot~=\"card-action\"]"
|
|
551
|
+
},
|
|
552
|
+
"content": {
|
|
553
|
+
"type": "string",
|
|
554
|
+
"description": "[data-slot~=\"card-content\"]"
|
|
555
|
+
},
|
|
556
|
+
"footer": {
|
|
557
|
+
"type": "string",
|
|
558
|
+
"description": "[data-slot~=\"card-footer\"]"
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
},
|
|
479
564
|
"checkbox": {
|
|
480
565
|
"type": "object",
|
|
481
566
|
"additionalProperties": false,
|
|
@@ -1039,6 +1124,35 @@
|
|
|
1039
1124
|
}
|
|
1040
1125
|
}
|
|
1041
1126
|
},
|
|
1127
|
+
"figure": {
|
|
1128
|
+
"type": "object",
|
|
1129
|
+
"additionalProperties": false,
|
|
1130
|
+
"properties": {
|
|
1131
|
+
"css": {
|
|
1132
|
+
"type": "object",
|
|
1133
|
+
"additionalProperties": false,
|
|
1134
|
+
"description": "CSS by part, applied after every layer of the kit. From a file, it applies only when the host passes { allowCss: true }.",
|
|
1135
|
+
"properties": {
|
|
1136
|
+
"root": {
|
|
1137
|
+
"type": "string",
|
|
1138
|
+
"description": "[data-slot~=\"figure\"]"
|
|
1139
|
+
},
|
|
1140
|
+
"label": {
|
|
1141
|
+
"type": "string",
|
|
1142
|
+
"description": "[data-slot~=\"figure-label\"]"
|
|
1143
|
+
},
|
|
1144
|
+
"value": {
|
|
1145
|
+
"type": "string",
|
|
1146
|
+
"description": "[data-slot~=\"figure-value\"]"
|
|
1147
|
+
},
|
|
1148
|
+
"sub": {
|
|
1149
|
+
"type": "string",
|
|
1150
|
+
"description": "[data-slot~=\"figure-sub\"]"
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
},
|
|
1042
1156
|
"glyph-select": {
|
|
1043
1157
|
"type": "object",
|
|
1044
1158
|
"additionalProperties": false,
|
|
@@ -1710,35 +1824,6 @@
|
|
|
1710
1824
|
}
|
|
1711
1825
|
}
|
|
1712
1826
|
},
|
|
1713
|
-
"stat": {
|
|
1714
|
-
"type": "object",
|
|
1715
|
-
"additionalProperties": false,
|
|
1716
|
-
"properties": {
|
|
1717
|
-
"css": {
|
|
1718
|
-
"type": "object",
|
|
1719
|
-
"additionalProperties": false,
|
|
1720
|
-
"description": "CSS by part, applied after every layer of the kit. From a file, it applies only when the host passes { allowCss: true }.",
|
|
1721
|
-
"properties": {
|
|
1722
|
-
"root": {
|
|
1723
|
-
"type": "string",
|
|
1724
|
-
"description": "[data-slot~=\"stat\"]"
|
|
1725
|
-
},
|
|
1726
|
-
"label": {
|
|
1727
|
-
"type": "string",
|
|
1728
|
-
"description": "[data-slot~=\"stat-label\"]"
|
|
1729
|
-
},
|
|
1730
|
-
"value": {
|
|
1731
|
-
"type": "string",
|
|
1732
|
-
"description": "[data-slot~=\"stat-value\"]"
|
|
1733
|
-
},
|
|
1734
|
-
"sub": {
|
|
1735
|
-
"type": "string",
|
|
1736
|
-
"description": "[data-slot~=\"stat-sub\"]"
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
}
|
|
1740
|
-
}
|
|
1741
|
-
},
|
|
1742
1827
|
"switch": {
|
|
1743
1828
|
"type": "object",
|
|
1744
1829
|
"additionalProperties": false,
|
|
@@ -1878,6 +1963,103 @@
|
|
|
1878
1963
|
}
|
|
1879
1964
|
}
|
|
1880
1965
|
},
|
|
1966
|
+
"toast": {
|
|
1967
|
+
"type": "object",
|
|
1968
|
+
"additionalProperties": false,
|
|
1969
|
+
"properties": {
|
|
1970
|
+
"width": {
|
|
1971
|
+
"type": "string",
|
|
1972
|
+
"description": "--vela-toast-width, default 356px"
|
|
1973
|
+
},
|
|
1974
|
+
"radius": {
|
|
1975
|
+
"type": "string",
|
|
1976
|
+
"description": "--vela-toast-radius, default var(--vela-radius-lg)"
|
|
1977
|
+
},
|
|
1978
|
+
"background": {
|
|
1979
|
+
"type": "string",
|
|
1980
|
+
"description": "--vela-toast-background, default var(--vela-surface-elev)"
|
|
1981
|
+
},
|
|
1982
|
+
"border": {
|
|
1983
|
+
"type": "string",
|
|
1984
|
+
"description": "--vela-toast-border, default var(--vela-border)"
|
|
1985
|
+
},
|
|
1986
|
+
"foreground": {
|
|
1987
|
+
"type": "string",
|
|
1988
|
+
"description": "--vela-toast-foreground, default var(--vela-fg-bright)"
|
|
1989
|
+
},
|
|
1990
|
+
"description-color": {
|
|
1991
|
+
"type": "string",
|
|
1992
|
+
"description": "--vela-toast-description-color, default var(--vela-fg-muted)"
|
|
1993
|
+
},
|
|
1994
|
+
"shadow": {
|
|
1995
|
+
"type": "string",
|
|
1996
|
+
"description": "--vela-toast-shadow, default var(--vela-shadow)"
|
|
1997
|
+
},
|
|
1998
|
+
"success": {
|
|
1999
|
+
"type": "string",
|
|
2000
|
+
"description": "--vela-toast-success, default var(--vela-profit)"
|
|
2001
|
+
},
|
|
2002
|
+
"info": {
|
|
2003
|
+
"type": "string",
|
|
2004
|
+
"description": "--vela-toast-info, default var(--vela-accent)"
|
|
2005
|
+
},
|
|
2006
|
+
"warning": {
|
|
2007
|
+
"type": "string",
|
|
2008
|
+
"description": "--vela-toast-warning, default var(--vela-highlight)"
|
|
2009
|
+
},
|
|
2010
|
+
"error": {
|
|
2011
|
+
"type": "string",
|
|
2012
|
+
"description": "--vela-toast-error, default var(--vela-danger)"
|
|
2013
|
+
},
|
|
2014
|
+
"css": {
|
|
2015
|
+
"type": "object",
|
|
2016
|
+
"additionalProperties": false,
|
|
2017
|
+
"description": "CSS by part, applied after every layer of the kit. From a file, it applies only when the host passes { allowCss: true }.",
|
|
2018
|
+
"properties": {
|
|
2019
|
+
"root": {
|
|
2020
|
+
"type": "string",
|
|
2021
|
+
"description": "[data-slot~=\"toast\"]"
|
|
2022
|
+
},
|
|
2023
|
+
"list": {
|
|
2024
|
+
"type": "string",
|
|
2025
|
+
"description": "[data-slot~=\"toast-list\"]"
|
|
2026
|
+
},
|
|
2027
|
+
"item": {
|
|
2028
|
+
"type": "string",
|
|
2029
|
+
"description": "[data-slot~=\"toast-item\"]"
|
|
2030
|
+
},
|
|
2031
|
+
"close": {
|
|
2032
|
+
"type": "string",
|
|
2033
|
+
"description": "[data-slot~=\"toast-close\"]"
|
|
2034
|
+
},
|
|
2035
|
+
"icon": {
|
|
2036
|
+
"type": "string",
|
|
2037
|
+
"description": "[data-slot~=\"toast-icon\"]"
|
|
2038
|
+
},
|
|
2039
|
+
"content": {
|
|
2040
|
+
"type": "string",
|
|
2041
|
+
"description": "[data-slot~=\"toast-content\"]"
|
|
2042
|
+
},
|
|
2043
|
+
"title": {
|
|
2044
|
+
"type": "string",
|
|
2045
|
+
"description": "[data-slot~=\"toast-title\"]"
|
|
2046
|
+
},
|
|
2047
|
+
"description": {
|
|
2048
|
+
"type": "string",
|
|
2049
|
+
"description": "[data-slot~=\"toast-description\"]"
|
|
2050
|
+
},
|
|
2051
|
+
"cancel": {
|
|
2052
|
+
"type": "string",
|
|
2053
|
+
"description": "[data-slot~=\"toast-cancel\"]"
|
|
2054
|
+
},
|
|
2055
|
+
"action": {
|
|
2056
|
+
"type": "string",
|
|
2057
|
+
"description": "[data-slot~=\"toast-action\"]"
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
},
|
|
1881
2063
|
"toggle-group": {
|
|
1882
2064
|
"type": "object",
|
|
1883
2065
|
"additionalProperties": false,
|
|
@@ -1943,6 +2125,115 @@
|
|
|
1943
2125
|
}
|
|
1944
2126
|
}
|
|
1945
2127
|
}
|
|
2128
|
+
},
|
|
2129
|
+
"treemap": {
|
|
2130
|
+
"type": "object",
|
|
2131
|
+
"additionalProperties": false,
|
|
2132
|
+
"properties": {
|
|
2133
|
+
"radius": {
|
|
2134
|
+
"type": "string",
|
|
2135
|
+
"description": "--vela-treemap-radius, default var(--vela-radius-sm)"
|
|
2136
|
+
},
|
|
2137
|
+
"up": {
|
|
2138
|
+
"type": "string",
|
|
2139
|
+
"description": "--vela-treemap-up, default var(--vela-up)"
|
|
2140
|
+
},
|
|
2141
|
+
"down": {
|
|
2142
|
+
"type": "string",
|
|
2143
|
+
"description": "--vela-treemap-down, default var(--vela-down)"
|
|
2144
|
+
},
|
|
2145
|
+
"tile-bg": {
|
|
2146
|
+
"type": "string",
|
|
2147
|
+
"description": "--vela-treemap-tile-bg, default `color-mix(in srgb, ${t.fg.bright} 2.5%, ${t.surface})`"
|
|
2148
|
+
},
|
|
2149
|
+
"tint-min": {
|
|
2150
|
+
"type": "string",
|
|
2151
|
+
"description": "--vela-treemap-tint-min, default 3%"
|
|
2152
|
+
},
|
|
2153
|
+
"tint-max": {
|
|
2154
|
+
"type": "string",
|
|
2155
|
+
"description": "--vela-treemap-tint-max, default 25%"
|
|
2156
|
+
},
|
|
2157
|
+
"hover-z": {
|
|
2158
|
+
"type": "string",
|
|
2159
|
+
"description": "--vela-treemap-hover-z, default 1"
|
|
2160
|
+
},
|
|
2161
|
+
"tip-radius": {
|
|
2162
|
+
"type": "string",
|
|
2163
|
+
"description": "--vela-treemap-tip-radius, default var(--vela-radius-md)"
|
|
2164
|
+
},
|
|
2165
|
+
"tip-bg": {
|
|
2166
|
+
"type": "string",
|
|
2167
|
+
"description": "--vela-treemap-tip-bg, default var(--vela-surface-elev)"
|
|
2168
|
+
},
|
|
2169
|
+
"tip-shadow": {
|
|
2170
|
+
"type": "string",
|
|
2171
|
+
"description": "--vela-treemap-tip-shadow, default var(--vela-shadow)"
|
|
2172
|
+
},
|
|
2173
|
+
"tip-z": {
|
|
2174
|
+
"type": "string",
|
|
2175
|
+
"description": "--vela-treemap-tip-z, default 2"
|
|
2176
|
+
},
|
|
2177
|
+
"css": {
|
|
2178
|
+
"type": "object",
|
|
2179
|
+
"additionalProperties": false,
|
|
2180
|
+
"description": "CSS by part, applied after every layer of the kit. From a file, it applies only when the host passes { allowCss: true }.",
|
|
2181
|
+
"properties": {
|
|
2182
|
+
"root": {
|
|
2183
|
+
"type": "string",
|
|
2184
|
+
"description": "[data-slot~=\"treemap\"]"
|
|
2185
|
+
},
|
|
2186
|
+
"crumbs": {
|
|
2187
|
+
"type": "string",
|
|
2188
|
+
"description": "[data-slot~=\"treemap-crumbs\"]"
|
|
2189
|
+
},
|
|
2190
|
+
"crumb": {
|
|
2191
|
+
"type": "string",
|
|
2192
|
+
"description": "[data-slot~=\"treemap-crumb\"]"
|
|
2193
|
+
},
|
|
2194
|
+
"map": {
|
|
2195
|
+
"type": "string",
|
|
2196
|
+
"description": "[data-slot~=\"treemap-map\"]"
|
|
2197
|
+
},
|
|
2198
|
+
"group": {
|
|
2199
|
+
"type": "string",
|
|
2200
|
+
"description": "[data-slot~=\"treemap-group\"]"
|
|
2201
|
+
},
|
|
2202
|
+
"group-name": {
|
|
2203
|
+
"type": "string",
|
|
2204
|
+
"description": "[data-slot~=\"treemap-group-name\"]"
|
|
2205
|
+
},
|
|
2206
|
+
"group-value": {
|
|
2207
|
+
"type": "string",
|
|
2208
|
+
"description": "[data-slot~=\"treemap-group-value\"]"
|
|
2209
|
+
},
|
|
2210
|
+
"tile": {
|
|
2211
|
+
"type": "string",
|
|
2212
|
+
"description": "[data-slot~=\"treemap-tile\"]"
|
|
2213
|
+
},
|
|
2214
|
+
"tile-label": {
|
|
2215
|
+
"type": "string",
|
|
2216
|
+
"description": "[data-slot~=\"treemap-tile-label\"]"
|
|
2217
|
+
},
|
|
2218
|
+
"tile-value": {
|
|
2219
|
+
"type": "string",
|
|
2220
|
+
"description": "[data-slot~=\"treemap-tile-value\"]"
|
|
2221
|
+
},
|
|
2222
|
+
"legend": {
|
|
2223
|
+
"type": "string",
|
|
2224
|
+
"description": "[data-slot~=\"treemap-legend\"]"
|
|
2225
|
+
},
|
|
2226
|
+
"legend-bar": {
|
|
2227
|
+
"type": "string",
|
|
2228
|
+
"description": "[data-slot~=\"treemap-legend-bar\"]"
|
|
2229
|
+
},
|
|
2230
|
+
"tip": {
|
|
2231
|
+
"type": "string",
|
|
2232
|
+
"description": "[data-slot~=\"treemap-tip\"]"
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
1946
2237
|
}
|
|
1947
2238
|
}
|
|
1948
2239
|
}
|