@luxalgo/vela-ui 0.0.0-stage → 0.2.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 +91 -0
- package/LICENSE +201 -0
- package/NOTICE +28 -0
- package/README.md +86 -3
- package/cli/engine.mjs +282 -0
- package/cli/index.mjs +154 -0
- package/dist/badge.d.ts +26 -0
- package/dist/badge.js +44 -0
- package/dist/bar-chart.d.ts +40 -0
- package/dist/bar-chart.js +105 -0
- package/dist/button.d.ts +55 -0
- package/dist/button.js +11 -0
- package/dist/calendar.d.ts +24 -0
- package/dist/calendar.js +1 -0
- package/dist/callout-bubble.d.ts +103 -0
- package/dist/callout-bubble.js +177 -0
- package/dist/chart.d.ts +30 -0
- package/dist/chart.js +1 -0
- package/dist/checkbox.d.ts +60 -0
- package/dist/checkbox.js +12 -0
- package/dist/chunk-2GQIZM5Z.js +28 -0
- package/dist/chunk-3Q32K4PE.js +85 -0
- package/dist/chunk-6QCILIT2.js +52 -0
- package/dist/chunk-7VMN7NKJ.js +133 -0
- package/dist/chunk-A2FJ7Y7D.js +55 -0
- package/dist/chunk-A72NWYNP.js +26 -0
- package/dist/chunk-B5ZSRUDQ.js +227 -0
- package/dist/chunk-BXMWQIBO.js +66 -0
- package/dist/chunk-C3ICYMI3.js +25 -0
- package/dist/chunk-CC3DDNFC.js +117 -0
- package/dist/chunk-E2FE6V2N.js +81 -0
- package/dist/chunk-FN2BUFNM.js +10 -0
- package/dist/chunk-FVH6L7FM.js +18 -0
- package/dist/chunk-G7IQLY3A.js +183 -0
- package/dist/chunk-GVRX3UAV.js +82 -0
- package/dist/chunk-J2QJATCD.js +12 -0
- package/dist/chunk-LZWZV2ZS.js +18 -0
- package/dist/chunk-MJ4RUGX7.js +403 -0
- package/dist/chunk-MMTMOV6R.js +31 -0
- package/dist/chunk-P4MTEMT7.js +23 -0
- package/dist/chunk-Q6WTDVH6.js +31 -0
- package/dist/chunk-S7USVSYP.js +50 -0
- package/dist/chunk-TAKSIV57.js +90 -0
- package/dist/chunk-U3EH42YY.js +72 -0
- package/dist/chunk-V2Q4MRMS.js +573 -0
- package/dist/chunk-VMCR3S2A.js +22 -0
- package/dist/chunk-WBGSYCV2.js +101 -0
- package/dist/chunk-WGULXRWD.js +351 -0
- package/dist/chunk-WXH3EFV5.js +219 -0
- package/dist/chunk-X66RJAIS.js +14 -0
- package/dist/chunk-XBEL4K33.js +142 -0
- package/dist/chunk-Z5PINFQO.js +280 -0
- package/dist/collapsible.d.ts +49 -0
- package/dist/collapsible.js +106 -0
- package/dist/color-picker.d.ts +103 -0
- package/dist/color-picker.js +19 -0
- package/dist/color.d.ts +24 -0
- package/dist/color.js +1 -0
- package/dist/context-menu.d.ts +72 -0
- package/dist/context-menu.js +161 -0
- package/dist/css.d.ts +17 -0
- package/dist/css.js +4 -0
- package/dist/data-table.d.ts +40 -0
- package/dist/data-table.js +88 -0
- package/dist/date-picker.d.ts +90 -0
- package/dist/date-picker.js +257 -0
- package/dist/define-D5u3F5Dj.d.ts +21 -0
- package/dist/dialog.d.ts +89 -0
- package/dist/dialog.js +258 -0
- package/dist/dispose.d.ts +9 -0
- package/dist/dispose.js +2 -0
- package/dist/donut.d.ts +27 -0
- package/dist/donut.js +67 -0
- package/dist/drawer.d.ts +119 -0
- package/dist/drawer.js +326 -0
- package/dist/dropdown-menu.d.ts +114 -0
- package/dist/dropdown-menu.js +18 -0
- package/dist/empty.d.ts +21 -0
- package/dist/empty.js +38 -0
- package/dist/field.d.ts +147 -0
- package/dist/field.js +328 -0
- package/dist/glyph-select.d.ts +57 -0
- package/dist/glyph-select.js +17 -0
- package/dist/h-Bl37qUis.d.ts +24 -0
- package/dist/headless.d.ts +6 -0
- package/dist/headless.js +9 -0
- package/dist/hover-card.d.ts +43 -0
- package/dist/hover-card.js +97 -0
- package/dist/i18n.d.ts +20 -0
- package/dist/i18n.js +1 -0
- package/dist/icons.d.ts +20 -0
- package/dist/icons.js +2 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +13 -0
- package/dist/input-group.d.ts +57 -0
- package/dist/input-group.js +87 -0
- package/dist/input.d.ts +54 -0
- package/dist/input.js +9 -0
- package/dist/item.d.ts +72 -0
- package/dist/item.js +131 -0
- package/dist/kbd.d.ts +19 -0
- package/dist/kbd.js +8 -0
- package/dist/kit-text.d.ts +8 -0
- package/dist/kit-text.js +2 -0
- package/dist/line-chart.d.ts +32 -0
- package/dist/line-chart.js +120 -0
- package/dist/manifest.json +4508 -0
- package/dist/month-grid.d.ts +45 -0
- package/dist/month-grid.js +157 -0
- package/dist/number-input.d.ts +99 -0
- package/dist/number-input.js +14 -0
- package/dist/page.d.ts +7 -0
- package/dist/page.js +1 -0
- package/dist/palette.d.ts +55 -0
- package/dist/palette.js +1 -0
- package/dist/placement.d.ts +98 -0
- package/dist/placement.js +1 -0
- package/dist/popover.d.ts +107 -0
- package/dist/popover.js +15 -0
- package/dist/scatter-chart.d.ts +32 -0
- package/dist/scatter-chart.js +121 -0
- package/dist/select.d.ts +112 -0
- package/dist/select.js +19 -0
- package/dist/slider.d.ts +46 -0
- package/dist/slider.js +111 -0
- package/dist/sort-button.d.ts +41 -0
- package/dist/sort-button.js +88 -0
- package/dist/sparkline.d.ts +22 -0
- package/dist/sparkline.js +72 -0
- package/dist/stat.d.ts +29 -0
- package/dist/stat.js +41 -0
- package/dist/styles.d.ts +22 -0
- package/dist/styles.js +2 -0
- package/dist/surface-events.d.ts +17 -0
- package/dist/surface-events.js +1 -0
- package/dist/surface-exit.d.ts +25 -0
- package/dist/surface-exit.js +1 -0
- package/dist/switch.d.ts +54 -0
- package/dist/switch.js +92 -0
- package/dist/t.d.ts +89 -0
- package/dist/t.js +1 -0
- package/dist/tabs.d.ts +65 -0
- package/dist/tabs.js +155 -0
- package/dist/text-area.d.ts +54 -0
- package/dist/text-area.js +9 -0
- package/dist/theme.d.ts +199 -0
- package/dist/theme.js +8 -0
- package/dist/theme.schema.json +1994 -0
- package/dist/themes/dark.css +3 -0
- package/dist/themes/light.css +3 -0
- package/dist/toggle-group.d.ts +56 -0
- package/dist/toggle-group.js +130 -0
- package/dist/tokens.d.ts +16 -0
- package/dist/tokens.js +3 -0
- package/dist/tooltip.d.ts +47 -0
- package/dist/tooltip.js +74 -0
- package/dist/variants-B4stUBnY.d.ts +16 -0
- package/dist/zag.d.ts +19 -0
- package/dist/zag.js +2 -0
- package/docs/theming.md +217 -0
- package/docs/what-to-change.md +20 -0
- package/docs/writing-a-component.md +250 -0
- package/llms.txt +71 -0
- package/package.json +90 -6
- package/registry/badge.ts +119 -0
- package/registry/bar-chart.ts +215 -0
- package/registry/button.ts +379 -0
- package/registry/callout-bubble.ts +347 -0
- package/registry/checkbox.ts +234 -0
- package/registry/collapsible.ts +271 -0
- package/registry/color-picker.ts +582 -0
- package/registry/context-menu.ts +208 -0
- package/registry/data-table.ts +215 -0
- package/registry/date-picker.ts +483 -0
- package/registry/dialog.ts +535 -0
- package/registry/donut.ts +145 -0
- package/registry/drawer.ts +636 -0
- package/registry/dropdown-menu.ts +762 -0
- package/registry/empty.ts +91 -0
- package/registry/field.ts +585 -0
- package/registry/glyph-select.ts +268 -0
- package/registry/hover-card.ts +222 -0
- package/registry/input-group.ts +229 -0
- package/registry/input.ts +181 -0
- package/registry/item.ts +376 -0
- package/registry/kbd.ts +64 -0
- package/registry/line-chart.ts +218 -0
- package/registry/month-grid.ts +328 -0
- package/registry/number-input.ts +443 -0
- package/registry/popover.ts +368 -0
- package/registry/scatter-chart.ts +221 -0
- package/registry/select.ts +620 -0
- package/registry/slider.ts +259 -0
- package/registry/sort-button.ts +189 -0
- package/registry/sparkline.ts +114 -0
- package/registry/stat.ts +96 -0
- package/registry/switch.ts +205 -0
- package/registry/tabs.ts +426 -0
- package/registry/text-area.ts +186 -0
- package/registry/toggle-group.ts +295 -0
- package/registry/tooltip.ts +156 -0
- package/skills/theming-vela-ui/SKILL.md +137 -0
- package/skills/using-vela-ui-components/SKILL.md +137 -0
- package/skills/writing-vela-ui-components/SKILL.md +163 -0
- package/src/components/badge.ts +119 -0
- package/src/components/bar-chart.ts +215 -0
- package/src/components/button.ts +379 -0
- package/src/components/callout-bubble.ts +347 -0
- package/src/components/checkbox.ts +234 -0
- package/src/components/collapsible.ts +271 -0
- package/src/components/color-picker.ts +582 -0
- package/src/components/context-menu.ts +208 -0
- package/src/components/data-table.ts +215 -0
- package/src/components/date-picker.ts +483 -0
- package/src/components/dialog.ts +535 -0
- package/src/components/donut.ts +145 -0
- package/src/components/drawer.ts +636 -0
- package/src/components/dropdown-menu.ts +762 -0
- package/src/components/empty.ts +91 -0
- package/src/components/field.ts +585 -0
- package/src/components/glyph-select.ts +268 -0
- package/src/components/hover-card.ts +222 -0
- package/src/components/input-group.ts +229 -0
- package/src/components/input.ts +181 -0
- package/src/components/item.ts +376 -0
- package/src/components/kbd.ts +64 -0
- package/src/components/line-chart.ts +218 -0
- package/src/components/month-grid.ts +328 -0
- package/src/components/number-input.ts +443 -0
- package/src/components/popover.ts +368 -0
- package/src/components/scatter-chart.ts +221 -0
- package/src/components/select.ts +620 -0
- package/src/components/slider.ts +259 -0
- package/src/components/sort-button.ts +189 -0
- package/src/components/sparkline.ts +114 -0
- package/src/components/stat.ts +96 -0
- package/src/components/switch.ts +205 -0
- package/src/components/tabs.ts +426 -0
- package/src/components/text-area.ts +186 -0
- package/src/components/toggle-group.ts +295 -0
- package/src/components/tooltip.ts +156 -0
- package/src/index.ts +24 -0
- package/src/lib/calendar.ts +117 -0
- package/src/lib/chart.ts +72 -0
- package/src/lib/color.ts +89 -0
- package/src/lib/component-index.ts +151 -0
- package/src/lib/css.ts +48 -0
- package/src/lib/define.ts +45 -0
- package/src/lib/dispose.ts +36 -0
- package/src/lib/h.ts +55 -0
- package/src/lib/headless.ts +16 -0
- package/src/lib/i18n.ts +30 -0
- package/src/lib/icons.ts +237 -0
- package/src/lib/kit-text.ts +26 -0
- package/src/lib/page.ts +24 -0
- package/src/lib/palette.ts +81 -0
- package/src/lib/placement.ts +188 -0
- package/src/lib/scope.ts +135 -0
- package/src/lib/styles.ts +53 -0
- package/src/lib/surface-events.ts +31 -0
- package/src/lib/surface-exit.ts +87 -0
- package/src/lib/t.ts +68 -0
- package/src/lib/theme.ts +664 -0
- package/src/lib/tokens.ts +111 -0
- package/src/lib/variants.ts +32 -0
- package/src/lib/zag.ts +46 -0
- package/stylelint/index.mjs +60 -0
- package/stylelint/lint.mjs +81 -0
- package/stylelint/plugin.mjs +115 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
// TextArea: a multi-line text input that commits on blur, and can grow with its content up to
|
|
2
|
+
// a number of lines before it scrolls.
|
|
3
|
+
import { css, defineStyles } from '../lib/css';
|
|
4
|
+
import { defineComponent } from '../lib/define';
|
|
5
|
+
import { h } from '../lib/h';
|
|
6
|
+
import { t } from '../lib/t';
|
|
7
|
+
import { variants } from '../lib/variants';
|
|
8
|
+
|
|
9
|
+
export type TextAreaSize = 'sm' | 'md';
|
|
10
|
+
|
|
11
|
+
export interface TextAreaControllerOptions {
|
|
12
|
+
value?: string;
|
|
13
|
+
/** The text it starts with when `value` is not given. */
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
size?: TextAreaSize;
|
|
16
|
+
rows?: number;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
onChange?: (value: string) => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface TextAreaController {
|
|
22
|
+
value: string;
|
|
23
|
+
size: TextAreaSize;
|
|
24
|
+
rows: number;
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
commit(next: string): string | null;
|
|
27
|
+
sync(next: string): void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** The text area's last committed string, without DOM. */
|
|
31
|
+
export function textAreaController(opts: TextAreaControllerOptions = {}): TextAreaController {
|
|
32
|
+
let value = opts.value ?? opts.defaultValue ?? '';
|
|
33
|
+
return {
|
|
34
|
+
get value() {
|
|
35
|
+
return value;
|
|
36
|
+
},
|
|
37
|
+
size: opts.size ?? 'md',
|
|
38
|
+
rows: opts.rows ?? 3,
|
|
39
|
+
disabled: opts.disabled ?? false,
|
|
40
|
+
commit(next: string) {
|
|
41
|
+
if (next === value) return null;
|
|
42
|
+
value = next;
|
|
43
|
+
opts.onChange?.(next);
|
|
44
|
+
return next;
|
|
45
|
+
},
|
|
46
|
+
sync(next: string) {
|
|
47
|
+
value = next;
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const textAreaDef = defineComponent({
|
|
53
|
+
name: 'text-area',
|
|
54
|
+
parts: ['root', 'input'],
|
|
55
|
+
settings: { radius: t.radius.md, 'focus-ring': `0 0 0 3px ${t.focus.soft}` },
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export const textAreaVariants = variants({ size: ['md', 'sm'] });
|
|
59
|
+
|
|
60
|
+
export interface TextAreaOptions extends TextAreaControllerOptions {
|
|
61
|
+
/** Submitted with its form under this name. */
|
|
62
|
+
name?: string;
|
|
63
|
+
required?: boolean;
|
|
64
|
+
id?: string;
|
|
65
|
+
placeholder?: string;
|
|
66
|
+
/** Grow with content up to `maxLines`, then scroll. */
|
|
67
|
+
autoGrow?: boolean;
|
|
68
|
+
maxLines?: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type TextAreaProps = TextAreaOptions;
|
|
72
|
+
|
|
73
|
+
const injectStyles = defineStyles(
|
|
74
|
+
'vela-ui-textarea',
|
|
75
|
+
css`
|
|
76
|
+
@layer vela.ui {
|
|
77
|
+
[data-slot='text-area-input'] {
|
|
78
|
+
display: block;
|
|
79
|
+
width: 100%;
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
min-height: 64px;
|
|
82
|
+
background: transparent;
|
|
83
|
+
border: 1px solid ${t.border.strong};
|
|
84
|
+
border-radius: ${textAreaDef.vars.radius};
|
|
85
|
+
color: ${t.fg.bright};
|
|
86
|
+
padding: 8px;
|
|
87
|
+
font-size: 14px;
|
|
88
|
+
font-family: inherit;
|
|
89
|
+
line-height: 1.4;
|
|
90
|
+
resize: vertical;
|
|
91
|
+
outline: 2px solid transparent;
|
|
92
|
+
transition:
|
|
93
|
+
border-color ${t.dur.fast} ease,
|
|
94
|
+
box-shadow ${t.dur.fast} ease;
|
|
95
|
+
/* Selectable even under a user-select:none host (chart wrapper, .vela-ui). */
|
|
96
|
+
user-select: text;
|
|
97
|
+
-webkit-user-select: text;
|
|
98
|
+
|
|
99
|
+
&:hover {
|
|
100
|
+
border-color: ${t.fg.muted};
|
|
101
|
+
}
|
|
102
|
+
&:focus {
|
|
103
|
+
border-color: ${t.focus};
|
|
104
|
+
box-shadow: ${textAreaDef.vars['focus-ring']};
|
|
105
|
+
}
|
|
106
|
+
&::placeholder {
|
|
107
|
+
color: currentColor;
|
|
108
|
+
opacity: 0.4;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
[data-slot='text-area'] {
|
|
112
|
+
width: 100%;
|
|
113
|
+
min-width: 0;
|
|
114
|
+
|
|
115
|
+
&:where(:not([hidden])) {
|
|
116
|
+
display: block;
|
|
117
|
+
}
|
|
118
|
+
&[data-autogrow] [data-slot='text-area-input'] {
|
|
119
|
+
resize: none;
|
|
120
|
+
overflow-y: hidden;
|
|
121
|
+
min-height: 46px;
|
|
122
|
+
}
|
|
123
|
+
&[data-size='sm'] [data-slot='text-area-input'] {
|
|
124
|
+
font-size: 13px;
|
|
125
|
+
min-height: 46px;
|
|
126
|
+
padding: 6px 9px;
|
|
127
|
+
line-height: 18px;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
`,
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
export class TextArea {
|
|
135
|
+
readonly el: HTMLElement;
|
|
136
|
+
readonly input: HTMLTextAreaElement;
|
|
137
|
+
private readonly ctrl: TextAreaController;
|
|
138
|
+
private readonly autoGrow: boolean;
|
|
139
|
+
private readonly maxLines: number;
|
|
140
|
+
|
|
141
|
+
constructor(opts: TextAreaOptions = {}) {
|
|
142
|
+
injectStyles(document);
|
|
143
|
+
this.ctrl = textAreaController(opts);
|
|
144
|
+
this.autoGrow = opts.autoGrow === true;
|
|
145
|
+
this.maxLines = opts.maxLines ?? 4;
|
|
146
|
+
|
|
147
|
+
const ta = h('textarea', { className: 'vela-textarea-field', slot: textAreaDef.slot('input'), attrs: { id: opts.id, placeholder: opts.placeholder, name: opts.name } });
|
|
148
|
+
ta.required = opts.required === true;
|
|
149
|
+
ta.rows = this.ctrl.rows;
|
|
150
|
+
ta.value = this.ctrl.value;
|
|
151
|
+
ta.disabled = this.ctrl.disabled;
|
|
152
|
+
ta.addEventListener('blur', () => {
|
|
153
|
+
this.ctrl.commit(ta.value);
|
|
154
|
+
});
|
|
155
|
+
if (this.autoGrow) ta.addEventListener('input', () => this.grow());
|
|
156
|
+
this.el = h('div', { className: 'vela-textarea', slot: textAreaDef.slot('root'), attrs: textAreaVariants({ size: this.ctrl.size }), data: { autogrow: this.autoGrow } }, ta);
|
|
157
|
+
this.input = ta;
|
|
158
|
+
if (this.autoGrow) this.grow();
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
get value(): string {
|
|
162
|
+
return this.ctrl.value;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
setValue(v: string): void {
|
|
166
|
+
this.ctrl.sync(v);
|
|
167
|
+
this.input.value = v;
|
|
168
|
+
if (this.autoGrow) this.grow();
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
destroy(): void {}
|
|
172
|
+
|
|
173
|
+
private grow(): void {
|
|
174
|
+
const ta = this.input;
|
|
175
|
+
const lh = parseFloat(getComputedStyle(ta).lineHeight) || 18;
|
|
176
|
+
const pad = ta.clientHeight - (ta.offsetHeight ? lh * (ta.rows || 1) : 0);
|
|
177
|
+
const max = lh * this.maxLines + (Number.isFinite(pad) && pad > 0 ? pad : 12);
|
|
178
|
+
ta.style.height = 'auto';
|
|
179
|
+
ta.style.height = `${Math.min(ta.scrollHeight, max)}px`;
|
|
180
|
+
ta.style.overflowY = ta.scrollHeight > max ? 'auto' : 'hidden';
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export function createTextArea(props: TextAreaProps = {}): TextArea {
|
|
185
|
+
return new TextArea(props);
|
|
186
|
+
}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
// ToggleGroup: a few options side by side on one track, over Zag's toggle-group machine.
|
|
2
|
+
// `single` (default): one option is always chosen (a radio group, a segmented control);
|
|
3
|
+
// `multiple`: each option toggles on its own. The arrow keys move focus; Space and Enter
|
|
4
|
+
// press. The track and the chosen option are tints of the foreground, so both read on a dark
|
|
5
|
+
// and a light theme.
|
|
6
|
+
import * as toggleGroup from '@zag-js/toggle-group';
|
|
7
|
+
import { iconEl } from '../lib/icons';
|
|
8
|
+
import { css, defineStyles } from '../lib/css';
|
|
9
|
+
import { defineComponent } from '../lib/define';
|
|
10
|
+
import { ownTeardown } from '../lib/dispose';
|
|
11
|
+
import { h } from '../lib/h';
|
|
12
|
+
import { t } from '../lib/t';
|
|
13
|
+
import { variants, type VariantProps } from '../lib/variants';
|
|
14
|
+
import { nextUid, normalizeProps, runMachine, spreadProps, type HandleOf } from '../lib/zag';
|
|
15
|
+
|
|
16
|
+
export const toggleGroupDef = defineComponent({
|
|
17
|
+
name: 'toggle-group',
|
|
18
|
+
parts: ['root', 'item', 'icon'],
|
|
19
|
+
settings: { radius: '8px', 'radius-sm': '7px', 'item-radius': t.radius.md, 'item-radius-sm': '5px' },
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
/** `default` = 32px; `sm` = 28px. */
|
|
23
|
+
export const toggleGroupVariants = variants({ size: ['default', 'sm'] });
|
|
24
|
+
|
|
25
|
+
export interface ToggleGroupItem {
|
|
26
|
+
value: string;
|
|
27
|
+
/** Visible text, or the accessible name of an icon-only option. */
|
|
28
|
+
label: string;
|
|
29
|
+
icon?: string;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** Fill the option with a market color while it is on (buy and sell). */
|
|
32
|
+
tone?: 'up' | 'down';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface ToggleGroupCommonProps extends VariantProps<typeof toggleGroupVariants> {
|
|
36
|
+
items: readonly ToggleGroupItem[];
|
|
37
|
+
/** Accessible name of the group. */
|
|
38
|
+
label?: string;
|
|
39
|
+
/** Options show their icon only; each label becomes its option's accessible name. */
|
|
40
|
+
iconOnly?: boolean;
|
|
41
|
+
dir?: 'ltr' | 'rtl';
|
|
42
|
+
/** Stretch across the parent, options sharing the width. */
|
|
43
|
+
fill?: boolean;
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ToggleGroupSingleProps extends ToggleGroupCommonProps {
|
|
48
|
+
type?: 'single';
|
|
49
|
+
/** The chosen option (default: the first enabled one). */
|
|
50
|
+
defaultValue?: string;
|
|
51
|
+
onValueChange?: (value: string) => void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface ToggleGroupMultipleProps extends ToggleGroupCommonProps {
|
|
55
|
+
type: 'multiple';
|
|
56
|
+
/** The options turned on (default: none). */
|
|
57
|
+
defaultValue?: readonly string[];
|
|
58
|
+
onValueChange?: (value: string[]) => void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type ToggleGroupProps = ToggleGroupSingleProps | ToggleGroupMultipleProps;
|
|
62
|
+
|
|
63
|
+
export interface ToggleGroupHandle {
|
|
64
|
+
readonly el: HTMLElement;
|
|
65
|
+
/** The options turned on. */
|
|
66
|
+
readonly values: readonly string[];
|
|
67
|
+
/** Show options as on without calling `onValueChange`. */
|
|
68
|
+
setValue(value: string | readonly string[] | null): void;
|
|
69
|
+
setItems(items: readonly ToggleGroupItem[]): void;
|
|
70
|
+
destroy(): void;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const TOGGLE_GROUP_STYLE_ID = 'vela-ui-toggle-group';
|
|
74
|
+
|
|
75
|
+
export const TOGGLE_GROUP_CSS = css`
|
|
76
|
+
@layer vela.ui {
|
|
77
|
+
[data-slot='toggle-group-item'] {
|
|
78
|
+
all: unset;
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
gap: 6px;
|
|
84
|
+
min-width: 0;
|
|
85
|
+
padding: 0 10px;
|
|
86
|
+
border-radius: ${toggleGroupDef.vars['item-radius']};
|
|
87
|
+
color: ${t.fg.muted};
|
|
88
|
+
font-size: 13px;
|
|
89
|
+
font-weight: 500;
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
-webkit-tap-highlight-color: transparent;
|
|
93
|
+
transition:
|
|
94
|
+
background ${t.dur.fast} ease,
|
|
95
|
+
color ${t.dur.fast} ease;
|
|
96
|
+
|
|
97
|
+
& > [data-slot='toggle-group-icon'] {
|
|
98
|
+
width: 16px;
|
|
99
|
+
height: 16px;
|
|
100
|
+
flex: none;
|
|
101
|
+
}
|
|
102
|
+
&[data-icon-only] {
|
|
103
|
+
padding: 0 8px;
|
|
104
|
+
}
|
|
105
|
+
&[data-state='off']:not([data-disabled]):hover {
|
|
106
|
+
color: ${t.fg.bright};
|
|
107
|
+
}
|
|
108
|
+
&[data-state='on'] {
|
|
109
|
+
background: color-mix(in srgb, ${t.fg.bright} 12%, transparent);
|
|
110
|
+
color: ${t.fg.bright};
|
|
111
|
+
}
|
|
112
|
+
&[data-state='on'][data-tone='up'] {
|
|
113
|
+
background: ${t.up};
|
|
114
|
+
color: ${t.fg.onFill};
|
|
115
|
+
}
|
|
116
|
+
&[data-state='on'][data-tone='down'] {
|
|
117
|
+
background: ${t.down};
|
|
118
|
+
color: ${t.fg.onFill};
|
|
119
|
+
}
|
|
120
|
+
&[data-disabled] {
|
|
121
|
+
cursor: default;
|
|
122
|
+
opacity: 0.45;
|
|
123
|
+
}
|
|
124
|
+
&:focus-visible {
|
|
125
|
+
outline: 2px solid ${t.focus};
|
|
126
|
+
outline-offset: -2px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
[data-slot='toggle-group'] {
|
|
130
|
+
align-items: stretch;
|
|
131
|
+
gap: 2px;
|
|
132
|
+
padding: 3px;
|
|
133
|
+
box-sizing: border-box;
|
|
134
|
+
height: 32px;
|
|
135
|
+
border-radius: ${toggleGroupDef.vars.radius};
|
|
136
|
+
background: color-mix(in srgb, ${t.fg.bright} 6%, transparent);
|
|
137
|
+
|
|
138
|
+
&:where(:not([hidden])) {
|
|
139
|
+
display: inline-flex;
|
|
140
|
+
}
|
|
141
|
+
&[data-size='sm'] {
|
|
142
|
+
height: 28px;
|
|
143
|
+
padding: 2px;
|
|
144
|
+
border-radius: ${toggleGroupDef.vars['radius-sm']};
|
|
145
|
+
}
|
|
146
|
+
&[data-fill] {
|
|
147
|
+
width: 100%;
|
|
148
|
+
}
|
|
149
|
+
&[data-fill]:where(:not([hidden])) {
|
|
150
|
+
display: flex;
|
|
151
|
+
}
|
|
152
|
+
&[data-fill] > [data-slot='toggle-group-item'] {
|
|
153
|
+
flex: 1 1 0;
|
|
154
|
+
}
|
|
155
|
+
&[data-size='sm'] > [data-slot='toggle-group-item'] {
|
|
156
|
+
padding: 0 8px;
|
|
157
|
+
border-radius: ${toggleGroupDef.vars['item-radius-sm']};
|
|
158
|
+
font-size: 12px;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
`;
|
|
163
|
+
|
|
164
|
+
const injectStyles = defineStyles(TOGGLE_GROUP_STYLE_ID, TOGGLE_GROUP_CSS);
|
|
165
|
+
|
|
166
|
+
const keyOf = (values: readonly string[]): string => values.join('\u0000');
|
|
167
|
+
|
|
168
|
+
class ToggleGroupImpl implements ToggleGroupHandle {
|
|
169
|
+
readonly el: HTMLElement;
|
|
170
|
+
private readonly machine: HandleOf<typeof toggleGroup.machine>;
|
|
171
|
+
private readonly mid: string;
|
|
172
|
+
private readonly release: () => void;
|
|
173
|
+
private readonly iconOnly: boolean;
|
|
174
|
+
private readonly label: string | undefined;
|
|
175
|
+
private items: ToggleGroupItem[];
|
|
176
|
+
private readonly buttons = new Map<string, HTMLButtonElement>();
|
|
177
|
+
/** The options on as of the last write or report: the machine applies events on a
|
|
178
|
+
* microtask, so its own value lags a write. */
|
|
179
|
+
private current: string[];
|
|
180
|
+
/** A host write the machine has yet to report: that report is not the user's change. */
|
|
181
|
+
private silentNext: string | undefined;
|
|
182
|
+
|
|
183
|
+
constructor(props: ToggleGroupProps) {
|
|
184
|
+
injectStyles(document);
|
|
185
|
+
this.iconOnly = props.iconOnly ?? false;
|
|
186
|
+
this.label = props.label;
|
|
187
|
+
this.items = [...props.items];
|
|
188
|
+
const multiple = props.type === 'multiple';
|
|
189
|
+
this.current =
|
|
190
|
+
props.type === 'multiple' ? [...(props.defaultValue ?? [])] : [props.defaultValue ?? props.items.find((i) => !i.disabled)?.value].filter((v): v is string => v !== undefined);
|
|
191
|
+
this.mid = nextUid('vela-toggle-group');
|
|
192
|
+
this.el = h('div', {
|
|
193
|
+
className: props.className ? `vela-toggle-group ${props.className}` : 'vela-toggle-group',
|
|
194
|
+
slot: toggleGroupDef.slot('root'),
|
|
195
|
+
attrs: toggleGroupVariants(props),
|
|
196
|
+
data: { fill: props.fill === true },
|
|
197
|
+
});
|
|
198
|
+
this.build();
|
|
199
|
+
const onValueChange = props.onValueChange as ((v: string | string[]) => void) | undefined;
|
|
200
|
+
this.machine = runMachine(
|
|
201
|
+
toggleGroup.machine,
|
|
202
|
+
{
|
|
203
|
+
id: this.mid,
|
|
204
|
+
multiple,
|
|
205
|
+
// A single group never empties: pressing the chosen option keeps it chosen.
|
|
206
|
+
deselectable: false,
|
|
207
|
+
defaultValue: [...this.current],
|
|
208
|
+
dir: props.dir ?? 'ltr',
|
|
209
|
+
loopFocus: true,
|
|
210
|
+
rovingFocus: true,
|
|
211
|
+
onValueChange: ({ value }) => {
|
|
212
|
+
if (!multiple && value[0] === undefined) return;
|
|
213
|
+
const next = multiple ? [...value] : [value[0]!];
|
|
214
|
+
const key = keyOf(next);
|
|
215
|
+
// The machine compares arrays by identity: a press that changes nothing reports too.
|
|
216
|
+
if (key === keyOf(this.current)) {
|
|
217
|
+
if (this.silentNext === key) this.silentNext = undefined;
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
this.current = next;
|
|
221
|
+
if (this.silentNext === key) {
|
|
222
|
+
this.silentNext = undefined;
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
onValueChange?.(multiple ? [...next] : next[0]!);
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
(service) => this.render(service),
|
|
229
|
+
);
|
|
230
|
+
this.release = ownTeardown(this.el, () => this.machine.stop());
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
get values(): readonly string[] {
|
|
234
|
+
return this.current;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
setValue(value: string | readonly string[] | null): void {
|
|
238
|
+
const next = value === null ? [] : typeof value === 'string' ? [value] : [...value];
|
|
239
|
+
const key = keyOf(next);
|
|
240
|
+
if (key === keyOf(this.current)) return;
|
|
241
|
+
this.current = next;
|
|
242
|
+
this.silentNext = key;
|
|
243
|
+
this.api().setValue(next);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
setItems(items: readonly ToggleGroupItem[]): void {
|
|
247
|
+
this.items = [...items];
|
|
248
|
+
this.build();
|
|
249
|
+
const kept = this.current.filter((v) => this.items.some((i) => i.value === v));
|
|
250
|
+
if (kept.length !== this.current.length) this.setValue(kept);
|
|
251
|
+
this.machine.flush();
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
destroy(): void {
|
|
255
|
+
this.release();
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
private api(): toggleGroup.Api {
|
|
259
|
+
return toggleGroup.connect(this.machine.service, normalizeProps);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
private build(): void {
|
|
263
|
+
this.buttons.clear();
|
|
264
|
+
const doc = this.el.ownerDocument;
|
|
265
|
+
this.el.replaceChildren(
|
|
266
|
+
...this.items.map((item) => {
|
|
267
|
+
const icon = item.icon ? iconEl(item.icon, doc) : null;
|
|
268
|
+
if (icon) icon.dataset.slot = toggleGroupDef.slot('icon');
|
|
269
|
+
const iconOnly = this.iconOnly && icon !== null;
|
|
270
|
+
const b = h(
|
|
271
|
+
'button',
|
|
272
|
+
{ className: 'vela-toggle-group-item', slot: toggleGroupDef.slot('item'), data: { 'icon-only': iconOnly, tone: item.tone ?? null }, attrs: { 'aria-label': iconOnly ? item.label : null } },
|
|
273
|
+
icon,
|
|
274
|
+
iconOnly ? null : item.label,
|
|
275
|
+
);
|
|
276
|
+
this.buttons.set(item.value, b);
|
|
277
|
+
return b;
|
|
278
|
+
}),
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
private render(service: toggleGroup.Service): void {
|
|
283
|
+
const api = toggleGroup.connect(service, normalizeProps);
|
|
284
|
+
spreadProps(this.el, api.getRootProps(), this.mid);
|
|
285
|
+
if (this.label) this.el.setAttribute('aria-label', this.label);
|
|
286
|
+
for (const item of this.items) {
|
|
287
|
+
const b = this.buttons.get(item.value);
|
|
288
|
+
if (b) spreadProps(b, api.getItemProps({ value: item.value, disabled: item.disabled }), this.mid);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export function createToggleGroup(props: ToggleGroupProps): ToggleGroupHandle {
|
|
294
|
+
return new ToggleGroupImpl(props);
|
|
295
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// Tooltip: a floating label over Zag's tooltip machine (floating-ui placement). The floating
|
|
2
|
+
// layer mounts into `host` (default: the trigger's nearest `.vela-ui` ancestor, else <body>)
|
|
3
|
+
// so the design tokens inherit. The trigger is the host's own element and keeps its slot.
|
|
4
|
+
import * as tooltip from '@zag-js/tooltip';
|
|
5
|
+
import { css, defineStyles } from '../lib/css';
|
|
6
|
+
import { defineComponent } from '../lib/define';
|
|
7
|
+
import { ownTeardown } from '../lib/dispose';
|
|
8
|
+
import { h } from '../lib/h';
|
|
9
|
+
import { t } from '../lib/t';
|
|
10
|
+
import { nextUid, normalizeProps, runMachine, spreadProps, type HandleOf } from '../lib/zag';
|
|
11
|
+
import { splitPlacement, zagPositioning, type PlacementProps } from '../lib/placement';
|
|
12
|
+
|
|
13
|
+
export interface TooltipControllerOptions extends PlacementProps {
|
|
14
|
+
/** @deprecated Use `side` and `align`. */
|
|
15
|
+
placement?: tooltip.Placement;
|
|
16
|
+
/** ms before opening on hover (default 0 — the reference tooltips are instant). */
|
|
17
|
+
openDelay?: number;
|
|
18
|
+
closeDelay?: number;
|
|
19
|
+
/** Keep open while the pointer is over the content (rich tooltips). */
|
|
20
|
+
interactive?: boolean;
|
|
21
|
+
/** Share the trigger's DOM id with other machines composed on the SAME element
|
|
22
|
+
* (each Zag machine otherwise stamps its own id — last one wins and breaks the rest). */
|
|
23
|
+
triggerId?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type TooltipService = tooltip.Service;
|
|
27
|
+
export type TooltipApi = tooltip.Api;
|
|
28
|
+
|
|
29
|
+
export interface TooltipController {
|
|
30
|
+
machine: typeof tooltip.machine;
|
|
31
|
+
props: Partial<tooltip.Props>;
|
|
32
|
+
connect(service: TooltipService): TooltipApi;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Zag's tooltip machine with the options mapped onto it, for any view layer. */
|
|
36
|
+
export function tooltipController(opts: TooltipControllerOptions = {}): TooltipController {
|
|
37
|
+
return {
|
|
38
|
+
machine: tooltip.machine,
|
|
39
|
+
props: {
|
|
40
|
+
id: nextUid('vela-tooltip'),
|
|
41
|
+
openDelay: opts.openDelay ?? 0,
|
|
42
|
+
closeDelay: opts.closeDelay ?? 0,
|
|
43
|
+
interactive: opts.interactive ?? false,
|
|
44
|
+
ids: opts.triggerId ? { trigger: opts.triggerId } : undefined,
|
|
45
|
+
positioning: zagPositioning(opts, opts.placement ? splitPlacement(opts.placement) : { side: 'top', align: 'center' }),
|
|
46
|
+
} satisfies Partial<tooltip.Props>,
|
|
47
|
+
connect: (service: TooltipService): TooltipApi => tooltip.connect(service, normalizeProps),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const tooltipDef = defineComponent({
|
|
52
|
+
name: 'tooltip',
|
|
53
|
+
parts: ['positioner', 'content'],
|
|
54
|
+
settings: { radius: t.radius.md },
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export interface TooltipOptions extends TooltipControllerOptions {
|
|
58
|
+
content: string | Node | (() => Node);
|
|
59
|
+
host?: HTMLElement;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface TooltipProps extends TooltipOptions {
|
|
63
|
+
trigger: HTMLElement;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const injectStyles = defineStyles(
|
|
67
|
+
'vela-ui-tooltip',
|
|
68
|
+
css`
|
|
69
|
+
@layer vela.ui {
|
|
70
|
+
[data-slot='tooltip-content'] {
|
|
71
|
+
background: ${t.bg};
|
|
72
|
+
color: ${t.fg};
|
|
73
|
+
border: 1px solid ${t.border.soft};
|
|
74
|
+
border-radius: ${tooltipDef.vars.radius};
|
|
75
|
+
box-shadow: ${t.shadow};
|
|
76
|
+
font-size: ${t.fontSize.md};
|
|
77
|
+
line-height: 1.4;
|
|
78
|
+
padding: ${t.space[1]} ${t.space[2]};
|
|
79
|
+
max-width: 280px;
|
|
80
|
+
pointer-events: none;
|
|
81
|
+
z-index: ${t.z.tooltip};
|
|
82
|
+
|
|
83
|
+
&[data-interactive] {
|
|
84
|
+
pointer-events: auto;
|
|
85
|
+
}
|
|
86
|
+
&[data-state='open'] {
|
|
87
|
+
animation: vela-tooltip-in ${t.dur.fast} ease;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
@keyframes vela-tooltip-in {
|
|
91
|
+
from {
|
|
92
|
+
opacity: 0;
|
|
93
|
+
transform: scale(0.97);
|
|
94
|
+
}
|
|
95
|
+
to {
|
|
96
|
+
opacity: 1;
|
|
97
|
+
transform: scale(1);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
`,
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
function resolveHost(trigger: HTMLElement, host?: HTMLElement): HTMLElement {
|
|
105
|
+
return host ?? (trigger.closest('.vela-ui') as HTMLElement | null) ?? trigger.ownerDocument.body;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export class Tooltip {
|
|
109
|
+
private readonly positioner: HTMLElement;
|
|
110
|
+
private readonly content: HTMLElement;
|
|
111
|
+
private readonly handle: HandleOf<typeof tooltip.machine>;
|
|
112
|
+
private readonly trigger: HTMLElement;
|
|
113
|
+
private readonly release: () => void;
|
|
114
|
+
|
|
115
|
+
constructor(trigger: HTMLElement, opts: TooltipOptions) {
|
|
116
|
+
this.trigger = trigger;
|
|
117
|
+
const doc = trigger.ownerDocument;
|
|
118
|
+
injectStyles(doc);
|
|
119
|
+
this.content = h('div', { className: 'vela-tooltip', slot: tooltipDef.slot('content') });
|
|
120
|
+
this.positioner = h('div', { className: 'vela-ui-layer', slot: tooltipDef.slot('positioner') }, this.content);
|
|
121
|
+
resolveHost(trigger, opts.host).appendChild(this.positioner);
|
|
122
|
+
this.setContent(opts.content);
|
|
123
|
+
|
|
124
|
+
const ctrl = tooltipController(opts);
|
|
125
|
+
// Scope every spread by this machine's id so several kit components can share a
|
|
126
|
+
// node (e.g. tooltip + menu on one button) without wiping each other's listeners.
|
|
127
|
+
const mid = String(ctrl.props.id);
|
|
128
|
+
if (opts.triggerId) trigger.id = opts.triggerId;
|
|
129
|
+
this.handle = runMachine(ctrl.machine, ctrl.props, (service) => {
|
|
130
|
+
const api = ctrl.connect(service);
|
|
131
|
+
spreadProps(trigger, api.getTriggerProps(), mid);
|
|
132
|
+
spreadProps(this.positioner, api.getPositionerProps(), mid);
|
|
133
|
+
spreadProps(this.content, api.getContentProps(), mid);
|
|
134
|
+
});
|
|
135
|
+
// On the trigger: discarding the trigger's subtree takes the tooltip, and the layer it
|
|
136
|
+
// mounted elsewhere, with it.
|
|
137
|
+
this.release = ownTeardown(trigger, () => {
|
|
138
|
+
this.handle.stop();
|
|
139
|
+
this.positioner.remove();
|
|
140
|
+
// Zag leaves aria-describedby etc. on the trigger; harmless, but drop the hook.
|
|
141
|
+
this.trigger.removeAttribute('data-scope');
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
setContent(content: string | Node | (() => Node)): void {
|
|
146
|
+
this.content.replaceChildren(typeof content === 'function' ? content() : content);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
destroy(): void {
|
|
150
|
+
this.release();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function createTooltip(props: TooltipProps): Tooltip {
|
|
155
|
+
return new Tooltip(props.trigger, props);
|
|
156
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { h, append, addSlot, type Child, type ElementProps } from './lib/h';
|
|
2
|
+
export { css, defineStyles, injectLayerOrder, LAYER_ORDER } from './lib/css';
|
|
3
|
+
export { t, tokenNames, type Token } from './lib/t';
|
|
4
|
+
export { variants, type VariantFn, type VariantProps, type VariantSpec, type VariantValues } from './lib/variants';
|
|
5
|
+
export { defineComponent, type ComponentDef } from './lib/define';
|
|
6
|
+
export { disposeWithin, ownTeardown } from './lib/dispose';
|
|
7
|
+
export { placePopover, zagPositioning, type Align, type CollisionBoundary, type PlacementProps, type Side } from './lib/placement';
|
|
8
|
+
export {
|
|
9
|
+
createTheme,
|
|
10
|
+
applyTheme,
|
|
11
|
+
checkTheme,
|
|
12
|
+
DARK_CHART,
|
|
13
|
+
LIGHT_CHART,
|
|
14
|
+
TOKEN_NAMES,
|
|
15
|
+
type UiTheme,
|
|
16
|
+
type ThemeInput,
|
|
17
|
+
type ThemeSettings,
|
|
18
|
+
type CreateThemeOptions,
|
|
19
|
+
type ThemedChart,
|
|
20
|
+
type ComponentDefs,
|
|
21
|
+
type ComponentSettings,
|
|
22
|
+
type TokenName,
|
|
23
|
+
} from './lib/theme';
|
|
24
|
+
export type { ChartTheme } from './lib/tokens';
|