@luxalgo/vela-ui 0.1.0 → 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 +48 -0
- package/README.md +5 -2
- package/dist/badge.js +2 -2
- package/dist/bar-chart.d.ts +1 -1
- package/dist/bar-chart.js +2 -2
- package/dist/button.d.ts +18 -4
- package/dist/button.js +4 -3
- package/dist/calendar.d.ts +3 -1
- package/dist/calendar.js +1 -1
- package/dist/callout-bubble.d.ts +7 -2
- package/dist/callout-bubble.js +12 -8
- package/dist/checkbox.js +4 -4
- package/dist/{chunk-SAPURP46.js → chunk-7VMN7NKJ.js} +3 -3
- package/dist/{chunk-OBLIX3VN.js → chunk-B5ZSRUDQ.js} +3 -3
- package/dist/{chunk-6NXY62JS.js → chunk-C3ICYMI3.js} +2 -2
- package/dist/chunk-CC3DDNFC.js +117 -0
- package/dist/{chunk-FCO3YZLT.js → chunk-E2FE6V2N.js} +2 -2
- package/dist/{chunk-V6TTTMTE.js → chunk-GVRX3UAV.js} +4 -1
- package/dist/{chunk-2Q4JRINP.js → chunk-MJ4RUGX7.js} +4 -4
- package/dist/{chunk-X4YPSIW6.js → chunk-U3EH42YY.js} +2 -2
- package/dist/{chunk-AJ2IYSOI.js → chunk-V2Q4MRMS.js} +23 -3
- package/dist/{chunk-XJAPCCOJ.js → chunk-WBGSYCV2.js} +3 -3
- package/dist/{chunk-5QHXOAZA.js → chunk-WGULXRWD.js} +4 -4
- package/dist/{chunk-ZB3BZHSN.js → chunk-WXH3EFV5.js} +3 -3
- package/dist/chunk-XBEL4K33.js +142 -0
- package/dist/{chunk-CH3DV6FD.js → chunk-Z5PINFQO.js} +4 -4
- package/dist/collapsible.d.ts +49 -0
- package/dist/collapsible.js +106 -0
- package/dist/color-picker.js +6 -6
- package/dist/context-menu.js +5 -5
- package/dist/css.d.ts +3 -1
- package/dist/css.js +1 -1
- package/dist/data-table.d.ts +39 -2
- package/dist/data-table.js +2 -2
- package/dist/date-picker.d.ts +1 -1
- package/dist/date-picker.js +3 -3
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.js +5 -5
- package/dist/donut.d.ts +1 -1
- package/dist/donut.js +2 -2
- package/dist/drawer.d.ts +1 -1
- package/dist/drawer.js +3 -3
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/dropdown-menu.js +4 -4
- package/dist/empty.d.ts +1 -1
- package/dist/empty.js +2 -2
- package/dist/field.js +12 -12
- package/dist/glyph-select.js +5 -5
- package/dist/h-Bl37qUis.d.ts +24 -0
- package/dist/hover-card.d.ts +1 -1
- package/dist/hover-card.js +3 -3
- package/dist/index.d.ts +7 -1
- package/dist/index.js +3 -3
- package/dist/input-group.d.ts +1 -1
- package/dist/input-group.js +4 -3
- package/dist/input.js +3 -3
- package/dist/item.d.ts +72 -0
- package/dist/item.js +131 -0
- package/dist/kbd.d.ts +1 -1
- package/dist/kbd.js +3 -3
- package/dist/line-chart.d.ts +1 -1
- package/dist/line-chart.js +2 -2
- package/dist/manifest.json +665 -11
- package/dist/month-grid.d.ts +45 -0
- package/dist/month-grid.js +157 -0
- package/dist/number-input.d.ts +1 -1
- package/dist/number-input.js +4 -4
- package/dist/popover.js +4 -4
- package/dist/scatter-chart.d.ts +1 -1
- package/dist/scatter-chart.js +2 -2
- package/dist/select.js +6 -6
- 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 +1 -1
- package/dist/sparkline.js +2 -2
- package/dist/stat.d.ts +1 -1
- package/dist/stat.js +2 -2
- package/dist/switch.d.ts +1 -1
- package/dist/switch.js +3 -3
- package/dist/tabs.d.ts +3 -1
- package/dist/tabs.js +12 -7
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js +3 -3
- package/dist/theme.d.ts +17 -6
- package/dist/theme.js +2 -2
- package/dist/theme.schema.json +250 -1
- package/dist/toggle-group.d.ts +1 -1
- package/dist/toggle-group.js +3 -3
- package/dist/tooltip.js +3 -3
- package/docs/theming.md +6 -0
- package/docs/writing-a-component.md +4 -1
- package/llms.txt +8 -3
- package/package.json +1 -1
- package/registry/button.ts +97 -21
- package/registry/callout-bubble.ts +14 -3
- package/registry/collapsible.ts +271 -0
- package/registry/dropdown-menu.ts +3 -3
- package/registry/item.ts +376 -0
- package/registry/month-grid.ts +328 -0
- package/registry/slider.ts +259 -0
- package/registry/sort-button.ts +189 -0
- package/registry/tabs.ts +38 -4
- package/skills/using-vela-ui-components/SKILL.md +12 -9
- package/src/components/button.ts +97 -21
- package/src/components/callout-bubble.ts +14 -3
- package/src/components/collapsible.ts +271 -0
- package/src/components/dropdown-menu.ts +3 -3
- package/src/components/item.ts +376 -0
- package/src/components/month-grid.ts +328 -0
- package/src/components/slider.ts +259 -0
- package/src/components/sort-button.ts +189 -0
- package/src/components/tabs.ts +38 -4
- package/src/lib/calendar.ts +5 -0
- package/src/lib/component-index.ts +22 -2
- package/src/lib/css.ts +6 -2
- package/src/lib/scope.ts +135 -0
- package/src/lib/theme.ts +15 -5
- package/dist/chunk-EZQXTO6K.js +0 -89
- package/dist/chunk-IDA2BT7D.js +0 -29
- package/dist/data-table-DtU3FX9j.d.ts +0 -61
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { C as ComponentDef } from './define-D5u3F5Dj.js';
|
|
2
|
+
import { Translator } from './i18n.js';
|
|
3
|
+
import './t.js';
|
|
4
|
+
|
|
5
|
+
declare const monthGridDef: ComponentDef<"month-grid", "root" | "value" | "day" | "weekday" | "date" | "blank" | "detail", "radius" | "gap" | "day-height" | "selected-ring">;
|
|
6
|
+
type MonthGridTone = 'profit' | 'loss' | 'neutral';
|
|
7
|
+
interface MonthGridDay {
|
|
8
|
+
/** The day's figure (`+1,240.50`). */
|
|
9
|
+
value?: string;
|
|
10
|
+
/** A line under the figure (`3 trades · 67%`). */
|
|
11
|
+
detail?: string;
|
|
12
|
+
/** Tints the cell and colors the figure. */
|
|
13
|
+
tone?: MonthGridTone;
|
|
14
|
+
/** What a screen reader hears for the day (default: the date, the figure and the line). */
|
|
15
|
+
label?: string;
|
|
16
|
+
}
|
|
17
|
+
interface MonthGridProps {
|
|
18
|
+
/** The month shown (`2026-11`). */
|
|
19
|
+
month: string;
|
|
20
|
+
/** The days with something to show, by date (`2026-11-06`). */
|
|
21
|
+
days?: Readonly<Record<string, MonthGridDay>>;
|
|
22
|
+
/** The selected day (`2026-11-06`), ringed. */
|
|
23
|
+
selected?: string | null;
|
|
24
|
+
/** Today (`2026-11-06`), its date bright and bold. */
|
|
25
|
+
today?: string | null;
|
|
26
|
+
/** A day was chosen: a click, Enter or Space. Without it the days are not buttons. */
|
|
27
|
+
onSelect?: (date: string) => void;
|
|
28
|
+
/** The translator whose locale names the weekdays, picks the first day of the week and
|
|
29
|
+
* the digits. Default: the kit build's, else English with weeks starting on Sunday. */
|
|
30
|
+
i18n?: Translator;
|
|
31
|
+
/** Extra class names (layout hooks). */
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
interface MonthGridHandle {
|
|
35
|
+
readonly el: HTMLElement;
|
|
36
|
+
/** The month shown (`2026-11`). */
|
|
37
|
+
readonly month: string;
|
|
38
|
+
setMonth(month: string): void;
|
|
39
|
+
setDays(days: Readonly<Record<string, MonthGridDay>>): void;
|
|
40
|
+
setSelected(date: string | null): void;
|
|
41
|
+
destroy(): void;
|
|
42
|
+
}
|
|
43
|
+
declare function createMonthGrid(props: MonthGridProps): MonthGridHandle;
|
|
44
|
+
|
|
45
|
+
export { type MonthGridDay, type MonthGridHandle, type MonthGridProps, type MonthGridTone, createMonthGrid, monthGridDef };
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { calendarSettings, weekdayNames, longDate, plainInteger } from './chunk-GVRX3UAV.js';
|
|
2
|
+
import { kitTranslator } from './chunk-FVH6L7FM.js';
|
|
3
|
+
import { h } from './chunk-Q6WTDVH6.js';
|
|
4
|
+
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
5
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
6
|
+
import './chunk-2GQIZM5Z.js';
|
|
7
|
+
import './chunk-BXMWQIBO.js';
|
|
8
|
+
import './chunk-X66RJAIS.js';
|
|
9
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
10
|
+
|
|
11
|
+
// src/components/month-grid.ts
|
|
12
|
+
var monthGridDef = defineComponent({
|
|
13
|
+
name: "month-grid",
|
|
14
|
+
parts: ["root", "weekday", "day", "date", "value", "detail", "blank"],
|
|
15
|
+
settings: { radius: "8px", "day-height": "56px", gap: "4px", "selected-ring": `inset 0 0 0 1px ${t.selected.bg}` }
|
|
16
|
+
});
|
|
17
|
+
var injectStyles = defineStyles(
|
|
18
|
+
"vela-ui-month-grid",
|
|
19
|
+
css`@layer vela.ui{[data-slot=month-grid]{min-width:0}[data-slot=month-grid]:where(:not([hidden])){gap:${monthGridDef.vars.gap};grid-template-columns:repeat(7,minmax(0,1fr));display:grid}[data-slot=month-grid-weekday]{color:${t.fg.muted};letter-spacing:.06em;text-align:center;text-transform:uppercase;padding:4px 0;font-size:10px;font-weight:500}[data-slot=month-grid-blank],[data-slot=month-grid-day]{min-width:0;min-height:${monthGridDef.vars["day-height"]};border-radius:${monthGridDef.vars.radius}}[data-slot=month-grid-day]{all:unset;box-sizing:border-box;min-width:0;min-height:${monthGridDef.vars["day-height"]};border:1px solid ${t.border.faint};border-radius:${monthGridDef.vars.radius};background:color-mix(in srgb, ${t.fg.bright} 2%, transparent);text-align:start;font-variant-numeric:tabular-nums;transition:border-color ${t.dur.fast} ease;padding:5px;overflow:hidden}[data-slot=month-grid-day]:where(:not([hidden])){flex-direction:column;gap:1px;display:flex}[data-slot=month-grid-day][data-tone=profit]{border-color:color-mix(in srgb, ${t.profit} 40%, transparent);background:color-mix(in srgb, ${t.profit} 10%, transparent)}[data-slot=month-grid-day][data-tone=loss]{border-color:color-mix(in srgb, ${t.loss} 40%, transparent);background:color-mix(in srgb, ${t.loss} 10%, transparent)}[data-slot=month-grid-day][data-tone=neutral]{border-color:${t.border};background:${t.hover}}[data-slot=month-grid-day][type=button]{cursor:pointer}[data-slot=month-grid-day][data-checked]{border-color:${t.selected.bg};box-shadow:${monthGridDef.vars["selected-ring"]}}[data-slot=month-grid-day]:focus-visible{outline:2px solid ${t.focus};outline-offset:1px}[data-slot=month-grid-day][type=button]:not([data-checked]):hover{border-color:${t.border.strong}}[data-slot=month-grid-date]{color:${t.fg.muted};font-size:10px;line-height:12px}[data-slot=month-grid-date]:is([data-today]>*){color:${t.fg.bright};font-weight:600}[data-slot=month-grid-value],[data-slot=month-grid-detail]{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}[data-slot=month-grid-value]{color:${t.fg.bright};margin-top:auto;font-size:11px;font-weight:500;line-height:14px}[data-slot=month-grid-value]:is([data-tone=profit]>*){color:${t.profit}}[data-slot=month-grid-value]:is([data-tone=loss]>*){color:${t.loss}}[data-slot=month-grid-detail]{color:${t.fg.muted};font-size:9px;line-height:12px}}`
|
|
20
|
+
);
|
|
21
|
+
var MONTH = /^(\d{4})-(\d{2})$/;
|
|
22
|
+
var pad = (n) => String(n).padStart(2, "0");
|
|
23
|
+
var MonthGridImpl = class {
|
|
24
|
+
constructor(props) {
|
|
25
|
+
this.props = props;
|
|
26
|
+
/** The day that takes Tab into the grid, and keeps it while the arrow keys move. */
|
|
27
|
+
this.focusDate = null;
|
|
28
|
+
this.onClick = (e) => {
|
|
29
|
+
const day = this.dayOf(e.target);
|
|
30
|
+
if (day) this.choose(day);
|
|
31
|
+
};
|
|
32
|
+
this.onKey = (e) => {
|
|
33
|
+
const day = this.dayOf(e.target);
|
|
34
|
+
if (!day) return;
|
|
35
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
this.choose(day);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const rtl = getComputedStyle(this.el).direction === "rtl";
|
|
41
|
+
const n = Number(day.dataset.date.slice(8));
|
|
42
|
+
const column = (Array.prototype.indexOf.call(this.el.children, day) - 7) % 7;
|
|
43
|
+
const moves = {
|
|
44
|
+
ArrowLeft: rtl ? 1 : -1,
|
|
45
|
+
ArrowRight: rtl ? -1 : 1,
|
|
46
|
+
ArrowUp: -7,
|
|
47
|
+
ArrowDown: 7,
|
|
48
|
+
Home: -column,
|
|
49
|
+
End: 6 - column
|
|
50
|
+
};
|
|
51
|
+
const move = moves[e.key];
|
|
52
|
+
if (move === void 0) return;
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
const last = this.el.querySelectorAll("[data-date]").length;
|
|
55
|
+
const next = e.key === "Home" || e.key === "End" ? Math.min(last, Math.max(1, n + move)) : n + move;
|
|
56
|
+
const target = this.el.querySelector(`[data-date="${this.shown}-${pad(next)}"]`);
|
|
57
|
+
if (!target) return;
|
|
58
|
+
this.roveTo(target.dataset.date);
|
|
59
|
+
target.focus();
|
|
60
|
+
};
|
|
61
|
+
injectStyles(document);
|
|
62
|
+
const i18n = props.i18n ?? kitTranslator();
|
|
63
|
+
this.settings = calendarSettings(i18n);
|
|
64
|
+
this.weekStart = i18n?.weekStart ?? 0;
|
|
65
|
+
this.shown = MONTH.test(props.month) ? props.month : props.month.slice(0, 7);
|
|
66
|
+
this.days = props.days ?? {};
|
|
67
|
+
this.selected = props.selected ?? null;
|
|
68
|
+
this.today = props.today ?? null;
|
|
69
|
+
this.el = h("div", { className: props.className, slot: monthGridDef.slot("root") });
|
|
70
|
+
if (props.onSelect) {
|
|
71
|
+
this.el.addEventListener("click", this.onClick);
|
|
72
|
+
this.el.addEventListener("keydown", this.onKey);
|
|
73
|
+
}
|
|
74
|
+
this.render();
|
|
75
|
+
}
|
|
76
|
+
get month() {
|
|
77
|
+
return this.shown;
|
|
78
|
+
}
|
|
79
|
+
setMonth(month) {
|
|
80
|
+
this.shown = month;
|
|
81
|
+
this.focusDate = null;
|
|
82
|
+
this.render();
|
|
83
|
+
}
|
|
84
|
+
setDays(days) {
|
|
85
|
+
this.days = days;
|
|
86
|
+
this.render();
|
|
87
|
+
}
|
|
88
|
+
setSelected(date) {
|
|
89
|
+
this.selected = date;
|
|
90
|
+
this.render();
|
|
91
|
+
}
|
|
92
|
+
destroy() {
|
|
93
|
+
this.el.removeEventListener("click", this.onClick);
|
|
94
|
+
this.el.removeEventListener("keydown", this.onKey);
|
|
95
|
+
}
|
|
96
|
+
dayOf(target) {
|
|
97
|
+
const day = target instanceof Element ? target.closest(`[data-slot="${monthGridDef.slot("day")}"]`) : null;
|
|
98
|
+
return day && this.el.contains(day) ? day : null;
|
|
99
|
+
}
|
|
100
|
+
choose(day) {
|
|
101
|
+
const date = day.dataset.date;
|
|
102
|
+
this.roveTo(date);
|
|
103
|
+
this.props.onSelect?.(date);
|
|
104
|
+
}
|
|
105
|
+
roveTo(date) {
|
|
106
|
+
this.focusDate = date;
|
|
107
|
+
for (const el of this.el.querySelectorAll("[data-date]")) el.tabIndex = el.dataset.date === date ? 0 : -1;
|
|
108
|
+
}
|
|
109
|
+
render() {
|
|
110
|
+
const m = MONTH.exec(this.shown);
|
|
111
|
+
if (!m) {
|
|
112
|
+
this.el.replaceChildren();
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const year = Number(m[1]);
|
|
116
|
+
const month = Number(m[2]) - 1;
|
|
117
|
+
const names = weekdayNames(this.settings);
|
|
118
|
+
const startPad = (new Date(Date.UTC(year, month, 1)).getUTCDay() - this.weekStart + 7) % 7;
|
|
119
|
+
const count = new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
|
|
120
|
+
const endPad = (7 - (startPad + count) % 7) % 7;
|
|
121
|
+
const clickable = !!this.props.onSelect;
|
|
122
|
+
const blank = () => h("div", { slot: monthGridDef.slot("blank"), attrs: { "aria-hidden": "true" } });
|
|
123
|
+
const cells = [];
|
|
124
|
+
for (let i = 0; i < 7; i++) cells.push(h("div", { slot: monthGridDef.slot("weekday"), attrs: { "aria-hidden": "true" }, text: names[(this.weekStart + i) % 7] }));
|
|
125
|
+
for (let i = 0; i < startPad; i++) cells.push(blank());
|
|
126
|
+
const inMonth = (date) => !!date && date.startsWith(`${this.shown}-`);
|
|
127
|
+
const rover = [this.focusDate, this.selected, this.today].find(inMonth) ?? `${this.shown}-01`;
|
|
128
|
+
for (let d = 1; d <= count; d++) {
|
|
129
|
+
const date = `${this.shown}-${pad(d)}`;
|
|
130
|
+
const day = this.days[date];
|
|
131
|
+
const label = day?.label ?? [longDate(this.settings, year, month, d), day?.value, day?.detail].filter(Boolean).join(", ");
|
|
132
|
+
const current = date === this.selected ? "true" : date === this.today ? "date" : null;
|
|
133
|
+
cells.push(
|
|
134
|
+
h(
|
|
135
|
+
clickable ? "button" : "div",
|
|
136
|
+
{
|
|
137
|
+
slot: monthGridDef.slot("day"),
|
|
138
|
+
data: { date, tone: day?.tone ?? null, today: date === this.today, checked: date === this.selected },
|
|
139
|
+
attrs: clickable ? { type: "button", tabindex: date === rover ? "0" : "-1", "aria-label": label, "aria-current": current } : void 0
|
|
140
|
+
},
|
|
141
|
+
h("span", { slot: monthGridDef.slot("date"), text: plainInteger(this.settings, d) }),
|
|
142
|
+
day?.value ? h("span", { slot: monthGridDef.slot("value"), text: day.value }) : null,
|
|
143
|
+
day?.detail ? h("span", { slot: monthGridDef.slot("detail"), text: day.detail }) : null
|
|
144
|
+
)
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
for (let i = 0; i < endPad; i++) cells.push(blank());
|
|
148
|
+
const hadFocus = this.el.contains(document.activeElement);
|
|
149
|
+
this.el.replaceChildren(...cells);
|
|
150
|
+
if (hadFocus) this.el.querySelector('[tabindex="0"]')?.focus();
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
function createMonthGrid(props) {
|
|
154
|
+
return new MonthGridImpl(props);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export { createMonthGrid, monthGridDef };
|
package/dist/number-input.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ interface NumberInputController {
|
|
|
47
47
|
}
|
|
48
48
|
/** The field's clamping, rounding and commit rules, without DOM. */
|
|
49
49
|
declare function numberInputController(opts: NumberInputControllerOptions): NumberInputController;
|
|
50
|
-
declare const numberInputDef: ComponentDef<"number-input", "
|
|
50
|
+
declare const numberInputDef: ComponentDef<"number-input", "root" | "input" | "step" | "steps", "radius" | "focus-ring" | "step-radius">;
|
|
51
51
|
declare const numberInputVariants: VariantFn<{
|
|
52
52
|
readonly size: readonly ["md", "sm"];
|
|
53
53
|
}>;
|
package/dist/number-input.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { NUMBER_CSS, NUMBER_STYLE_ID, NumberInput, clampNumber, createNumberInput, numberInputController, numberInputDef, numberInputVariants, snapToStep } from './chunk-
|
|
1
|
+
export { NUMBER_CSS, NUMBER_STYLE_ID, NumberInput, clampNumber, createNumberInput, numberInputController, numberInputDef, numberInputVariants, snapToStep } from './chunk-WXH3EFV5.js';
|
|
2
2
|
import './chunk-LZWZV2ZS.js';
|
|
3
3
|
import './chunk-G7IQLY3A.js';
|
|
4
4
|
import './chunk-FVH6L7FM.js';
|
|
5
5
|
import './chunk-FN2BUFNM.js';
|
|
6
|
-
import './chunk-P4MTEMT7.js';
|
|
7
6
|
import './chunk-A72NWYNP.js';
|
|
7
|
+
import './chunk-P4MTEMT7.js';
|
|
8
8
|
import './chunk-Q6WTDVH6.js';
|
|
9
|
-
import './chunk-6QCILIT2.js';
|
|
10
9
|
import './chunk-VMCR3S2A.js';
|
|
11
|
-
import './chunk-
|
|
10
|
+
import './chunk-XBEL4K33.js';
|
|
12
11
|
import './chunk-2GQIZM5Z.js';
|
|
13
12
|
import './chunk-BXMWQIBO.js';
|
|
14
13
|
import './chunk-X66RJAIS.js';
|
|
14
|
+
import './chunk-6QCILIT2.js';
|
package/dist/popover.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { POPOVER_CSS, POPOVER_STYLE_ID, Popover, closeOpenPopovers, createPopover, eventDismissedPopover, isPopoverOpen, openPopoverTrigger, popoverController, popoverDef } from './chunk-
|
|
1
|
+
export { POPOVER_CSS, POPOVER_STYLE_ID, Popover, closeOpenPopovers, createPopover, eventDismissedPopover, isPopoverOpen, openPopoverTrigger, popoverController, popoverDef } from './chunk-B5ZSRUDQ.js';
|
|
2
2
|
import './chunk-J2QJATCD.js';
|
|
3
3
|
import './chunk-S7USVSYP.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-V2Q4MRMS.js';
|
|
5
5
|
import './chunk-TAKSIV57.js';
|
|
6
6
|
import './chunk-MMTMOV6R.js';
|
|
7
7
|
export { insetRect, intersectRects, placePopover, viewportRect } from './chunk-3Q32K4PE.js';
|
|
8
8
|
import './chunk-A72NWYNP.js';
|
|
9
9
|
import './chunk-Q6WTDVH6.js';
|
|
10
|
-
import './chunk-6QCILIT2.js';
|
|
11
10
|
import './chunk-VMCR3S2A.js';
|
|
12
|
-
import './chunk-
|
|
11
|
+
import './chunk-XBEL4K33.js';
|
|
13
12
|
import './chunk-2GQIZM5Z.js';
|
|
14
13
|
import './chunk-BXMWQIBO.js';
|
|
15
14
|
import './chunk-X66RJAIS.js';
|
|
15
|
+
import './chunk-6QCILIT2.js';
|
package/dist/scatter-chart.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as ComponentDef } from './define-D5u3F5Dj.js';
|
|
2
2
|
import './t.js';
|
|
3
3
|
|
|
4
|
-
declare const scatterChartDef: ComponentDef<"scatter-chart", "
|
|
4
|
+
declare const scatterChartDef: ComponentDef<"scatter-chart", "root" | "focus" | "label" | "grid" | "tip" | "point" | "trend", "tip-radius" | "tip-shadow" | "tip-z" | "tip-bg">;
|
|
5
5
|
interface ScatterPoint {
|
|
6
6
|
x: number;
|
|
7
7
|
y: number;
|
package/dist/scatter-chart.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { chartFrame, compactNumber, escapeXml, showTip, niceStep } from './chunk-A2FJ7Y7D.js';
|
|
2
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
3
2
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
4
|
-
import { defineStyles, css } from './chunk-
|
|
3
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
5
4
|
import './chunk-2GQIZM5Z.js';
|
|
6
5
|
import './chunk-BXMWQIBO.js';
|
|
7
6
|
import './chunk-X66RJAIS.js';
|
|
7
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
8
8
|
|
|
9
9
|
// src/components/scatter-chart.ts
|
|
10
10
|
var scatterChartDef = defineComponent({
|
package/dist/select.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { SELECT_CSS, SELECT_STYLE_ID, Select, createSelect, decorateSelectScroll, fillSelectList, openSelectList, selectController, selectDef, selectVariants, toggleSelectList } from './chunk-
|
|
1
|
+
export { SELECT_CSS, SELECT_STYLE_ID, Select, createSelect, decorateSelectScroll, fillSelectList, openSelectList, selectController, selectDef, selectVariants, toggleSelectList } from './chunk-Z5PINFQO.js';
|
|
2
2
|
import './chunk-LZWZV2ZS.js';
|
|
3
|
-
import './chunk-OBLIX3VN.js';
|
|
4
3
|
import './chunk-G7IQLY3A.js';
|
|
4
|
+
import './chunk-B5ZSRUDQ.js';
|
|
5
5
|
import './chunk-J2QJATCD.js';
|
|
6
6
|
import './chunk-S7USVSYP.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-V2Q4MRMS.js';
|
|
8
8
|
import './chunk-TAKSIV57.js';
|
|
9
9
|
import './chunk-MMTMOV6R.js';
|
|
10
10
|
import './chunk-3Q32K4PE.js';
|
|
11
|
-
import './chunk-P4MTEMT7.js';
|
|
12
11
|
import './chunk-A72NWYNP.js';
|
|
12
|
+
import './chunk-P4MTEMT7.js';
|
|
13
13
|
import './chunk-Q6WTDVH6.js';
|
|
14
|
-
import './chunk-6QCILIT2.js';
|
|
15
14
|
import './chunk-VMCR3S2A.js';
|
|
16
|
-
import './chunk-
|
|
15
|
+
import './chunk-XBEL4K33.js';
|
|
17
16
|
import './chunk-2GQIZM5Z.js';
|
|
18
17
|
import './chunk-BXMWQIBO.js';
|
|
19
18
|
import './chunk-X66RJAIS.js';
|
|
19
|
+
import './chunk-6QCILIT2.js';
|
package/dist/slider.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { C as ComponentDef } from './define-D5u3F5Dj.js';
|
|
2
|
+
import './t.js';
|
|
3
|
+
|
|
4
|
+
declare const sliderDef: ComponentDef<"slider", "root" | "track" | "thumb" | "control" | "range", "radius" | "focus-ring" | "track-height" | "thumb-size">;
|
|
5
|
+
interface SliderProps {
|
|
6
|
+
/** The value it starts with (default `min`). */
|
|
7
|
+
defaultValue?: number;
|
|
8
|
+
/** Default 0. */
|
|
9
|
+
min?: number;
|
|
10
|
+
/** Default 100. */
|
|
11
|
+
max?: number;
|
|
12
|
+
/** Default 1. */
|
|
13
|
+
step?: number;
|
|
14
|
+
/** Every move: while dragging, and on each key. */
|
|
15
|
+
onValueChange?: (value: number) => void;
|
|
16
|
+
/** Once a move settles: the pointer lifted, or a key pressed. */
|
|
17
|
+
onValueCommit?: (value: number) => void;
|
|
18
|
+
/** Its accessible name, when no `<label>` names it. */
|
|
19
|
+
label?: string;
|
|
20
|
+
/** What a screen reader says for a value (`11 Jun 2024`, `35%`). Default: the number. */
|
|
21
|
+
valueText?: (value: number) => string;
|
|
22
|
+
/** Default `horizontal`. A vertical slider takes its height from its parent. */
|
|
23
|
+
orientation?: 'horizontal' | 'vertical';
|
|
24
|
+
/** The text direction the keys and the track follow (default `ltr`). */
|
|
25
|
+
dir?: 'ltr' | 'rtl';
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Submitted with its form under this name. */
|
|
28
|
+
name?: string;
|
|
29
|
+
/** The id of its thumb, so a `<label for>` reaches it. */
|
|
30
|
+
id?: string;
|
|
31
|
+
/** Extra class names (layout hooks). */
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
interface SliderHandle {
|
|
35
|
+
readonly el: HTMLElement;
|
|
36
|
+
readonly value: number;
|
|
37
|
+
/** While the thumb is held. */
|
|
38
|
+
readonly dragging: boolean;
|
|
39
|
+
/** Move it without reporting. */
|
|
40
|
+
setValue(value: number): void;
|
|
41
|
+
setDisabled(disabled: boolean): void;
|
|
42
|
+
destroy(): void;
|
|
43
|
+
}
|
|
44
|
+
declare function createSlider(props?: SliderProps): SliderHandle;
|
|
45
|
+
|
|
46
|
+
export { type SliderHandle, type SliderProps, createSlider, sliderDef };
|
package/dist/slider.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { ownTeardown } from './chunk-A72NWYNP.js';
|
|
2
|
+
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-P4MTEMT7.js';
|
|
3
|
+
import { h } from './chunk-Q6WTDVH6.js';
|
|
4
|
+
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
5
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
6
|
+
import './chunk-2GQIZM5Z.js';
|
|
7
|
+
import './chunk-BXMWQIBO.js';
|
|
8
|
+
import './chunk-X66RJAIS.js';
|
|
9
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
10
|
+
import * as zagSlider from '@zag-js/slider';
|
|
11
|
+
|
|
12
|
+
var sliderDef = defineComponent({
|
|
13
|
+
name: "slider",
|
|
14
|
+
parts: ["root", "control", "track", "range", "thumb"],
|
|
15
|
+
settings: { "track-height": "4px", "thumb-size": "14px", radius: "999px", "focus-ring": `0 0 0 3px ${t.focus.soft}` }
|
|
16
|
+
});
|
|
17
|
+
var injectStyles = defineStyles(
|
|
18
|
+
"vela-ui-slider",
|
|
19
|
+
css`@layer vela.ui{[data-slot=slider]{--_thumb:${sliderDef.vars["thumb-size"]};--_track:${sliderDef.vars["track-height"]};box-sizing:border-box;width:100%;min-width:0;padding-inline:calc(var(--_thumb) / 2);position:relative}[data-slot=slider]:where(:not([hidden])){align-items:center;display:flex}[data-slot=slider][data-orientation=vertical]{width:auto;height:100%;padding-inline:0;padding-block:calc(var(--_thumb) / 2);flex-direction:column}[data-slot=slider][data-disabled]{opacity:.5}[data-slot=slider-control]{min-height:var(--_thumb);cursor:pointer;flex:1;align-items:center;display:flex}[data-slot=slider-control][data-orientation=vertical]{min-width:var(--_thumb);flex-direction:column;min-height:0}[data-slot=slider-control][data-disabled]{cursor:default}[data-slot=slider-track]{height:var(--_track);border-radius:${sliderDef.vars.radius};background:${t.border};flex:1;position:relative;overflow:hidden}[data-slot=slider-track][data-orientation=vertical]{width:var(--_track);height:auto}[data-slot=slider-range]{border-radius:inherit;background:${t.selected.bg};height:100%}[data-slot=slider-range][data-orientation=vertical]{width:100%;height:auto}[data-slot=slider-thumb]{width:var(--_thumb);height:var(--_thumb);border:2px solid ${t.bg};background:${t.selected.bg};transition:box-shadow ${t.dur.fast} ease;border-radius:50%;outline:2px solid #0000}[data-slot=slider-thumb]:focus-visible{box-shadow:${sliderDef.vars["focus-ring"]}}}`
|
|
20
|
+
);
|
|
21
|
+
var SliderImpl = class {
|
|
22
|
+
constructor(props) {
|
|
23
|
+
/** A write from code is in the machine: its reports, down to the end of the change that
|
|
24
|
+
* always closes a write, are not the user's. */
|
|
25
|
+
this.silent = false;
|
|
26
|
+
injectStyles(document);
|
|
27
|
+
const min = this.min = props.min ?? 0;
|
|
28
|
+
const max = this.max = props.max ?? 100;
|
|
29
|
+
this.current = Math.min(max, Math.max(min, props.defaultValue ?? min));
|
|
30
|
+
this.disabled = props.disabled ?? false;
|
|
31
|
+
this.mid = nextUid("vela-slider");
|
|
32
|
+
this.thumb = h("div", { slot: sliderDef.slot("thumb") });
|
|
33
|
+
this.range = h("div", { slot: sliderDef.slot("range") });
|
|
34
|
+
this.track = h("div", { slot: sliderDef.slot("track") }, this.range);
|
|
35
|
+
this.control = h("div", { slot: sliderDef.slot("control") }, this.track, this.thumb);
|
|
36
|
+
this.input = props.name !== void 0 ? h("input", {}) : null;
|
|
37
|
+
this.el = h("div", { className: props.className ? `vela-slider ${props.className}` : "vela-slider", slot: sliderDef.slot("root") }, this.control, this.input);
|
|
38
|
+
this.machine = runMachine(
|
|
39
|
+
zagSlider.machine,
|
|
40
|
+
() => ({
|
|
41
|
+
id: this.mid,
|
|
42
|
+
...props.id ? { ids: { thumb: () => props.id } } : {},
|
|
43
|
+
min,
|
|
44
|
+
max,
|
|
45
|
+
step: props.step ?? 1,
|
|
46
|
+
defaultValue: [this.current],
|
|
47
|
+
orientation: props.orientation ?? "horizontal",
|
|
48
|
+
dir: props.dir ?? "ltr",
|
|
49
|
+
disabled: this.disabled,
|
|
50
|
+
// `contain` would measure the thumb, which a slider built before it is on the
|
|
51
|
+
// page cannot do.
|
|
52
|
+
thumbAlignment: "center",
|
|
53
|
+
...props.name !== void 0 ? { name: props.name } : {},
|
|
54
|
+
...props.label ? { "aria-label": [props.label] } : {},
|
|
55
|
+
...props.valueText ? { getAriaValueText: ({ value }) => props.valueText(value) } : {},
|
|
56
|
+
onValueChange: ({ value: [value] }) => {
|
|
57
|
+
if (value === void 0) return;
|
|
58
|
+
this.current = value;
|
|
59
|
+
if (!this.silent) props.onValueChange?.(value);
|
|
60
|
+
},
|
|
61
|
+
onValueChangeEnd: ({ value: [value] }) => {
|
|
62
|
+
if (this.silent) {
|
|
63
|
+
this.silent = false;
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (value !== void 0) props.onValueCommit?.(value);
|
|
67
|
+
}
|
|
68
|
+
}),
|
|
69
|
+
(service) => this.render(service)
|
|
70
|
+
);
|
|
71
|
+
this.release = ownTeardown(this.el, () => this.machine.stop());
|
|
72
|
+
}
|
|
73
|
+
get value() {
|
|
74
|
+
return this.current;
|
|
75
|
+
}
|
|
76
|
+
get dragging() {
|
|
77
|
+
return this.api().dragging;
|
|
78
|
+
}
|
|
79
|
+
setValue(value) {
|
|
80
|
+
const next = Math.min(this.max, Math.max(this.min, value));
|
|
81
|
+
if (next === this.current) return;
|
|
82
|
+
this.current = next;
|
|
83
|
+
this.silent = true;
|
|
84
|
+
this.api().setValue([next]);
|
|
85
|
+
}
|
|
86
|
+
setDisabled(disabled) {
|
|
87
|
+
if (disabled === this.disabled) return;
|
|
88
|
+
this.disabled = disabled;
|
|
89
|
+
this.machine.flush();
|
|
90
|
+
}
|
|
91
|
+
destroy() {
|
|
92
|
+
this.release();
|
|
93
|
+
}
|
|
94
|
+
api() {
|
|
95
|
+
return zagSlider.connect(this.machine.service, normalizeProps);
|
|
96
|
+
}
|
|
97
|
+
render(service) {
|
|
98
|
+
const api = zagSlider.connect(service, normalizeProps);
|
|
99
|
+
spreadProps(this.el, api.getRootProps(), this.mid);
|
|
100
|
+
spreadProps(this.control, api.getControlProps(), this.mid);
|
|
101
|
+
spreadProps(this.track, api.getTrackProps(), this.mid);
|
|
102
|
+
spreadProps(this.range, api.getRangeProps(), this.mid);
|
|
103
|
+
spreadProps(this.thumb, api.getThumbProps({ index: 0 }), this.mid);
|
|
104
|
+
if (this.input) spreadProps(this.input, api.getHiddenInputProps({ index: 0 }), this.mid);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
function createSlider(props = {}) {
|
|
108
|
+
return new SliderImpl(props);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export { createSlider, sliderDef };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { a as VariantProps, V as VariantFn } from './variants-B4stUBnY.js';
|
|
2
|
+
import { C as ComponentDef } from './define-D5u3F5Dj.js';
|
|
3
|
+
import { Translator } from './i18n.js';
|
|
4
|
+
import './t.js';
|
|
5
|
+
|
|
6
|
+
declare const sortButtonDef: ComponentDef<"sort-button", "root" | "icon" | "state", "radius">;
|
|
7
|
+
declare const sortButtonVariants: VariantFn<{
|
|
8
|
+
readonly align: readonly ["start", "end"];
|
|
9
|
+
}>;
|
|
10
|
+
type SortDirection = 'asc' | 'desc';
|
|
11
|
+
interface SortButtonProps extends VariantProps<typeof sortButtonVariants> {
|
|
12
|
+
/** The column's name. */
|
|
13
|
+
label: string;
|
|
14
|
+
/** The sort it starts with (default none). */
|
|
15
|
+
direction?: SortDirection | null;
|
|
16
|
+
/** What the first press sorts by (default `desc`: the largest first). */
|
|
17
|
+
firstDirection?: SortDirection;
|
|
18
|
+
/** A press after both directions clears the sort (default true). */
|
|
19
|
+
clearable?: boolean;
|
|
20
|
+
/** A press changed the sort; null: unsorted. */
|
|
21
|
+
onSortChange?: (direction: SortDirection | null) => void;
|
|
22
|
+
/** A tooltip (`Sort by Last`). */
|
|
23
|
+
title?: string;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** The translator of the words a screen reader hears ("sorted ascending"). Default: the
|
|
26
|
+
* kit build's, else English. */
|
|
27
|
+
i18n?: Translator;
|
|
28
|
+
/** Extra class names (layout hooks). */
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
interface SortButtonHandle {
|
|
32
|
+
readonly el: HTMLButtonElement;
|
|
33
|
+
readonly direction: SortDirection | null;
|
|
34
|
+
/** Show a sort without calling `onSortChange`. */
|
|
35
|
+
setDirection(direction: SortDirection | null): void;
|
|
36
|
+
setDisabled(disabled: boolean): void;
|
|
37
|
+
destroy(): void;
|
|
38
|
+
}
|
|
39
|
+
declare function createSortButton(props: SortButtonProps): SortButtonHandle;
|
|
40
|
+
|
|
41
|
+
export { type SortButtonHandle, type SortButtonProps, type SortDirection, createSortButton, sortButtonDef, sortButtonVariants };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { variants } from './chunk-LZWZV2ZS.js';
|
|
2
|
+
import { iconEl } from './chunk-G7IQLY3A.js';
|
|
3
|
+
import { kitTranslator } from './chunk-FVH6L7FM.js';
|
|
4
|
+
import { msg, textOf } from './chunk-FN2BUFNM.js';
|
|
5
|
+
import { nextUid } from './chunk-P4MTEMT7.js';
|
|
6
|
+
import { h } from './chunk-Q6WTDVH6.js';
|
|
7
|
+
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
8
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
9
|
+
import './chunk-2GQIZM5Z.js';
|
|
10
|
+
import './chunk-BXMWQIBO.js';
|
|
11
|
+
import './chunk-X66RJAIS.js';
|
|
12
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
13
|
+
|
|
14
|
+
// src/components/sort-button.ts
|
|
15
|
+
var sortButtonDef = defineComponent({
|
|
16
|
+
name: "sort-button",
|
|
17
|
+
parts: ["root", "icon", "state"],
|
|
18
|
+
settings: { radius: t.radius.sm }
|
|
19
|
+
});
|
|
20
|
+
var sortButtonVariants = variants({ align: ["start", "end"] });
|
|
21
|
+
var TEXT = {
|
|
22
|
+
asc: msg("ui.sortButton.ascending", "sorted ascending"),
|
|
23
|
+
desc: msg("ui.sortButton.descending", "sorted descending")
|
|
24
|
+
};
|
|
25
|
+
var injectStyles = defineStyles(
|
|
26
|
+
"vela-ui-sort-button",
|
|
27
|
+
css`@layer vela.ui{[data-slot=sort-button]:where(:not([hidden])){all:unset;box-sizing:border-box;border-radius:${sortButtonDef.vars.radius};max-width:100%;color:${t.fg.muted};white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;transition:color ${t.dur.fast} ease;align-items:center;gap:3px;font-size:11px;font-weight:500;display:inline-flex}[data-slot=sort-button]:where(:not([hidden]))[data-align=end]{text-align:end;justify-content:flex-end}[data-slot=sort-button]:where(:not([hidden])):disabled{cursor:default;opacity:.5}[data-slot=sort-button]:where(:not([hidden])):focus-visible{outline:2px solid ${t.focus};outline-offset:1px}[data-slot=sort-button]:where(:not([hidden])):not(:disabled):hover,[data-slot=sort-button]:where(:not([hidden]))[data-direction]{color:${t.fg.bright}}[data-slot=sort-button-icon]{flex:none;width:1em;height:1em;font-size:11px;line-height:0}[data-slot=sort-button-icon]>svg{width:100%;height:100%}[data-slot=sort-button-state]{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}}`
|
|
28
|
+
);
|
|
29
|
+
var SortButtonImpl = class {
|
|
30
|
+
constructor(props) {
|
|
31
|
+
this.props = props;
|
|
32
|
+
injectStyles(document);
|
|
33
|
+
this.i18n = props.i18n ?? kitTranslator();
|
|
34
|
+
this.current = props.direction ?? null;
|
|
35
|
+
const stateId = nextUid("vela-sort");
|
|
36
|
+
this.state = h("span", { slot: sortButtonDef.slot("state"), attrs: { id: stateId } });
|
|
37
|
+
this.el = h(
|
|
38
|
+
"button",
|
|
39
|
+
{
|
|
40
|
+
className: props.className,
|
|
41
|
+
slot: sortButtonDef.slot("root"),
|
|
42
|
+
attrs: { type: "button", title: props.title ?? null, "aria-label": props.label, "aria-describedby": stateId, ...sortButtonVariants(props) },
|
|
43
|
+
on: { click: () => this.step() }
|
|
44
|
+
},
|
|
45
|
+
props.label,
|
|
46
|
+
this.state
|
|
47
|
+
);
|
|
48
|
+
this.el.disabled = props.disabled ?? false;
|
|
49
|
+
this.paint();
|
|
50
|
+
}
|
|
51
|
+
get direction() {
|
|
52
|
+
return this.current;
|
|
53
|
+
}
|
|
54
|
+
setDirection(direction) {
|
|
55
|
+
this.current = direction;
|
|
56
|
+
this.paint();
|
|
57
|
+
}
|
|
58
|
+
setDisabled(disabled) {
|
|
59
|
+
this.el.disabled = disabled;
|
|
60
|
+
}
|
|
61
|
+
destroy() {
|
|
62
|
+
}
|
|
63
|
+
step() {
|
|
64
|
+
const first = this.props.firstDirection ?? "desc";
|
|
65
|
+
const second = first === "desc" ? "asc" : "desc";
|
|
66
|
+
const clearable = this.props.clearable ?? true;
|
|
67
|
+
this.current = this.current === null ? first : this.current === first ? second : clearable ? null : first;
|
|
68
|
+
this.paint();
|
|
69
|
+
this.props.onSortChange?.(this.current);
|
|
70
|
+
}
|
|
71
|
+
paint() {
|
|
72
|
+
const dir = this.current;
|
|
73
|
+
this.el.querySelector(`[data-slot="${sortButtonDef.slot("icon")}"]`)?.remove();
|
|
74
|
+
if (dir) {
|
|
75
|
+
const icon = iconEl(dir === "asc" ? "arrow-up" : "arrow-down", document);
|
|
76
|
+
icon.dataset.slot = sortButtonDef.slot("icon");
|
|
77
|
+
this.state.before(icon);
|
|
78
|
+
}
|
|
79
|
+
this.el.toggleAttribute("data-direction", dir !== null);
|
|
80
|
+
if (dir) this.el.dataset.direction = dir;
|
|
81
|
+
this.state.textContent = dir ? textOf(this.i18n, TEXT[dir]) : "";
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
function createSortButton(props) {
|
|
85
|
+
return new SortButtonImpl(props);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { createSortButton, sortButtonDef, sortButtonVariants };
|
package/dist/sparkline.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as ComponentDef } from './define-D5u3F5Dj.js';
|
|
2
2
|
import './t.js';
|
|
3
3
|
|
|
4
|
-
declare const sparklineDef: ComponentDef<"sparkline", "
|
|
4
|
+
declare const sparklineDef: ComponentDef<"sparkline", "root" | "line" | "area" | "baseline", "stroke-width">;
|
|
5
5
|
interface SparklineProps {
|
|
6
6
|
values: readonly number[];
|
|
7
7
|
/** px (default 56 × 20). */
|
package/dist/sparkline.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
2
1
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
3
|
-
import { defineStyles, css } from './chunk-
|
|
2
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
4
3
|
import './chunk-2GQIZM5Z.js';
|
|
5
4
|
import './chunk-BXMWQIBO.js';
|
|
6
5
|
import './chunk-X66RJAIS.js';
|
|
6
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
7
7
|
|
|
8
8
|
// src/components/sparkline.ts
|
|
9
9
|
var sparklineDef = defineComponent({
|
package/dist/stat.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { V as VariantFn, a as VariantProps } from './variants-B4stUBnY.js';
|
|
|
2
2
|
import { C as ComponentDef } from './define-D5u3F5Dj.js';
|
|
3
3
|
import './t.js';
|
|
4
4
|
|
|
5
|
-
declare const statDef: ComponentDef<"stat", "
|
|
5
|
+
declare const statDef: ComponentDef<"stat", "root" | "label" | "sub" | "value", never>;
|
|
6
6
|
declare const statVariants: VariantFn<{
|
|
7
7
|
readonly tone: readonly ["neutral", "profit", "loss"];
|
|
8
8
|
}>;
|
package/dist/stat.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
2
2
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
3
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
4
3
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
5
|
-
import { defineStyles, css } from './chunk-
|
|
4
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
6
5
|
import './chunk-2GQIZM5Z.js';
|
|
7
6
|
import './chunk-BXMWQIBO.js';
|
|
8
7
|
import './chunk-X66RJAIS.js';
|
|
8
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
9
9
|
|
|
10
10
|
// src/components/stat.ts
|
|
11
11
|
var statDef = defineComponent({
|
package/dist/switch.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import './t.js';
|
|
|
4
4
|
|
|
5
5
|
type SwitchSize = 'default' | 'sm';
|
|
6
6
|
type SwitchVariant = 'default' | 'destructive';
|
|
7
|
-
declare const switchDef: ComponentDef<"switch", "root" | "thumb" | "control", "height" | "
|
|
7
|
+
declare const switchDef: ComponentDef<"switch", "root" | "thumb" | "control", "height" | "height-sm" | "width" | "thumb-size" | "width-sm" | "thumb-size-sm">;
|
|
8
8
|
declare const switchVariants: VariantFn<{
|
|
9
9
|
readonly size: readonly ["default", "sm"];
|
|
10
10
|
readonly variant: readonly ["default", "destructive"];
|