@luxalgo/vela-ui 0.2.0 → 0.3.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 +41 -0
- 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 +4 -4
- package/dist/{chunk-WGULXRWD.js → chunk-B2EZB5ZG.js} +3 -3
- package/dist/{chunk-G7IQLY3A.js → chunk-C3PXY2SW.js} +5 -0
- package/dist/{chunk-CC3DDNFC.js → chunk-DXDCKZ2M.js} +4 -4
- package/dist/{chunk-WBGSYCV2.js → chunk-IOOYDSSK.js} +3 -3
- package/dist/{chunk-B5ZSRUDQ.js → chunk-KKS6NEGI.js} +2 -2
- package/dist/{chunk-7VMN7NKJ.js → chunk-OJ2SEMN6.js} +3 -3
- package/dist/{chunk-MJ4RUGX7.js → chunk-OQXFQMZM.js} +2 -2
- package/dist/{chunk-V2Q4MRMS.js → chunk-TBXUF5YX.js} +12 -0
- package/dist/{chunk-WXH3EFV5.js → chunk-UEO6W37Z.js} +3 -3
- package/dist/{chunk-Z5PINFQO.js → chunk-WWHNUKSZ.js} +4 -4
- package/dist/collapsible.d.ts +1 -1
- package/dist/collapsible.js +3 -3
- package/dist/color-picker.js +4 -4
- package/dist/context-menu.js +4 -4
- 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 +14 -4
- package/dist/donut.d.ts +1 -1
- package/dist/donut.js +1 -1
- package/dist/drawer.d.ts +1 -1
- package/dist/drawer.js +1 -1
- 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/hover-card.d.ts +1 -1
- package/dist/hover-card.js +3 -3
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +3 -1
- 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 +618 -1
- package/dist/month-grid.js +1 -1
- package/dist/number-input.d.ts +1 -1
- package/dist/number-input.js +4 -4
- package/dist/popover.js +3 -3
- package/dist/scatter-chart.d.ts +1 -1
- package/dist/scatter-chart.js +1 -1
- package/dist/select.js +6 -6
- package/dist/slider.d.ts +1 -1
- package/dist/slider.js +1 -1
- package/dist/sort-button.js +3 -3
- package/dist/sparkline.d.ts +1 -1
- package/dist/sparkline.js +1 -1
- package/dist/stat.d.ts +1 -1
- package/dist/stat.js +1 -1
- package/dist/switch.d.ts +1 -1
- package/dist/switch.js +2 -2
- package/dist/tabs.d.ts +1 -1
- package/dist/tabs.js +3 -3
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js +2 -2
- package/dist/theme-Ct-q58xz.d.ts +341 -0
- package/dist/theme.d.ts +42 -192
- package/dist/theme.js +1 -1
- package/dist/theme.schema.json +292 -1
- 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 +3 -3
- package/dist/tooltip.js +1 -1
- package/dist/treemap.d.ts +80 -0
- package/dist/treemap.js +470 -0
- package/llms.txt +5 -2
- package/package.json +1 -1
- package/registry/button.ts +8 -0
- package/registry/card.ts +379 -0
- package/registry/dialog.ts +16 -0
- package/registry/toast.ts +965 -0
- package/registry/treemap.ts +847 -0
- package/skills/using-vela-ui-components/SKILL.md +4 -2
- package/src/components/button.ts +8 -0
- package/src/components/card.ts +379 -0
- package/src/components/dialog.ts +16 -0
- package/src/components/toast.ts +965 -0
- package/src/components/treemap.ts +847 -0
- package/src/lib/component-index.ts +12 -0
- package/src/lib/icons.ts +7 -0
- package/src/lib/theme.ts +6 -0
- 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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,47 @@
|
|
|
3
3
|
All notable changes to `@luxalgo/vela-ui`, newest first. Vela's own changes, including how it
|
|
4
4
|
uses the kit, are in [Vela's changelog](../../CHANGELOG.md).
|
|
5
5
|
|
|
6
|
+
## [0.3.0]
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- **Toasts.** `@luxalgo/vela-ui/toast` shows short notices that stack in a corner and leave on
|
|
11
|
+
their own, with the same calls and options as shadcn's toast. `toast('Saved')` raises one
|
|
12
|
+
from anywhere on the page, `toast.success`, `.info`, `.warning`, `.error` and `.loading` give
|
|
13
|
+
it its kind's icon, and `toast.promise` follows a task from loading to its result. A toast
|
|
14
|
+
takes a description, an action and a cancel button, its own icon and duration, and raising
|
|
15
|
+
it again with the same `id` updates it in place; `toast.dismiss` takes one or all away.
|
|
16
|
+
`createToaster` shows them, over the page or inside a host: the newest in front with the
|
|
17
|
+
older ones folded behind it, spread out while hovered (or with Alt+T), and swiped away
|
|
18
|
+
towards their edge. It takes the corner, the number shown, rich colors per kind, close
|
|
19
|
+
buttons and the toasts' defaults, and a theme sets its width, colors and radius.
|
|
20
|
+
- **A treemap.** `@luxalgo/vela-ui/treemap` lays weighted items out as tiles close to square,
|
|
21
|
+
each tinted by its value on a diverging scale (a watchlist's moves of the day, sized equally
|
|
22
|
+
or by market cap). Items with children form groups headed by their name and the median of
|
|
23
|
+
their values, or the mean, the sum or a figure of your own. Tiles show their label and value
|
|
24
|
+
as their size allows, a readout follows the pointer and the keyboard focus, the arrow keys
|
|
25
|
+
move between tiles, and a click reports the tile with its groups. New values repaint the
|
|
26
|
+
tiles in place, and a resize moves them. With `drill`, a group's header zooms into it and a
|
|
27
|
+
breadcrumb, or Esc, leads back. An optional legend shows the scale, and `squarify` lays out
|
|
28
|
+
rectangles of your own.
|
|
29
|
+
- **A card.** `@luxalgo/vela-ui/card` holds one subject on a surface of its own: a header with
|
|
30
|
+
an eyebrow over the title and a description under it, an action at its end, then the
|
|
31
|
+
content and a footer past a line. `inset` is the sunken tile for figures inside another
|
|
32
|
+
card, and `sm` is tighter. Its title is a heading, so screen readers move from card to card.
|
|
33
|
+
With `onSelect` the whole card is clickable while a press on a button inside it stays the
|
|
34
|
+
button's, and `selected` marks the current one. Its padding, radius, background and border
|
|
35
|
+
are settings a theme can change.
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- **Key caps read on every button.** On the `default`, `up` and `down` buttons, key caps
|
|
40
|
+
(`keys`, `keysEnd`) drew their label in the button's own fill color, so only an empty cap
|
|
41
|
+
showed. Inside a button a key cap now takes the button's text color and draws only its
|
|
42
|
+
outline, on every variant.
|
|
43
|
+
- **A dialog's close button has a name.** Screen readers announced it as an unnamed button;
|
|
44
|
+
it is now "Close", in the language of the dialog's new `i18n` option, else the kit build's
|
|
45
|
+
translator. `setI18n` renames it when the language changes while the dialog is open.
|
|
46
|
+
|
|
6
47
|
## [0.2.0]
|
|
7
48
|
|
|
8
49
|
### Added
|
package/dist/badge.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';
|
|
3
4
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
4
5
|
import { css, defineStyles } from './chunk-XBEL4K33.js';
|
|
5
6
|
import './chunk-2GQIZM5Z.js';
|
|
6
7
|
import './chunk-BXMWQIBO.js';
|
|
7
8
|
import './chunk-X66RJAIS.js';
|
|
8
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
9
9
|
|
|
10
10
|
// src/components/badge.ts
|
|
11
11
|
var badgeDef = defineComponent({
|
package/dist/bar-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 barChartDef: ComponentDef<"bar-chart", "
|
|
4
|
+
declare const barChartDef: ComponentDef<"bar-chart", "label" | "marker" | "root" | "grid" | "bar" | "tip", "tip-radius" | "tip-shadow" | "tip-z" | "tip-bg">;
|
|
5
5
|
interface BarDatum {
|
|
6
6
|
label: string;
|
|
7
7
|
value: number;
|
package/dist/bar-chart.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { chartFrame, showTip, valueAxis, compactNumber, escapeXml } from './chunk-A2FJ7Y7D.js';
|
|
2
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
2
3
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
3
4
|
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
4
5
|
import './chunk-2GQIZM5Z.js';
|
|
5
6
|
import './chunk-BXMWQIBO.js';
|
|
6
7
|
import './chunk-X66RJAIS.js';
|
|
7
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
8
8
|
|
|
9
9
|
// src/components/bar-chart.ts
|
|
10
10
|
var barChartDef = defineComponent({
|
package/dist/button.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { a as VariantProps, V as VariantFn } from './variants-B4stUBnY.js';
|
|
|
2
2
|
import { C as ComponentDef } from './define-D5u3F5Dj.js';
|
|
3
3
|
import './t.js';
|
|
4
4
|
|
|
5
|
-
declare const buttonDef: ComponentDef<"button", "
|
|
5
|
+
declare const buttonDef: ComponentDef<"button", "keys" | "root" | "icon", "height" | "font-size-sm" | "radius" | "height-xs" | "height-sm" | "height-lg" | "font-size" | "font-size-xs">;
|
|
6
6
|
declare const buttonVariants: VariantFn<{
|
|
7
7
|
readonly variant: readonly ["default", "outline", "secondary", "ghost", "destructive", "link", "up", "down", "favorite"];
|
|
8
8
|
readonly size: readonly ["default", "xs", "sm", "lg", "icon", "icon-xs", "icon-sm", "icon-lg"];
|
package/dist/button.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { BUTTON_CSS, BUTTON_STYLE_ID, buttonDef, buttonVariants, createButton } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { BUTTON_CSS, BUTTON_STYLE_ID, buttonDef, buttonVariants, createButton } from './chunk-DXDCKZ2M.js';
|
|
2
|
+
import './chunk-FYVQO5TN.js';
|
|
3
|
+
import './chunk-C3PXY2SW.js';
|
|
3
4
|
import './chunk-LZWZV2ZS.js';
|
|
4
|
-
import './chunk-G7IQLY3A.js';
|
|
5
5
|
import './chunk-Q6WTDVH6.js';
|
|
6
|
+
import './chunk-6QCILIT2.js';
|
|
6
7
|
import './chunk-VMCR3S2A.js';
|
|
7
8
|
import './chunk-XBEL4K33.js';
|
|
8
9
|
import './chunk-2GQIZM5Z.js';
|
|
9
10
|
import './chunk-BXMWQIBO.js';
|
|
10
11
|
import './chunk-X66RJAIS.js';
|
|
11
|
-
import './chunk-6QCILIT2.js';
|
package/dist/callout-bubble.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ type CalloutPanelRow = {
|
|
|
55
55
|
* stand alone. Pure — unit-tested apart from the DOM.
|
|
56
56
|
*/
|
|
57
57
|
declare function calloutPanelRows(items: CalloutPanelItem[]): CalloutPanelRow[];
|
|
58
|
-
declare const calloutBubbleDef: ComponentDef<"callout-bubble", "
|
|
58
|
+
declare const calloutBubbleDef: ComponentDef<"callout-bubble", "button" | "title" | "text" | "root" | "panel" | "actions", "panel-radius" | "button-radius">;
|
|
59
59
|
/** The panel opens where the placement props say (default below and start-aligned, 6px away,
|
|
60
60
|
* flipping above near the bottom edge). */
|
|
61
61
|
interface CalloutBubbleOptions extends CalloutBubbleSpec, PlacementProps {
|
package/dist/callout-bubble.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Popover } from './chunk-B5ZSRUDQ.js';
|
|
1
|
+
import { Popover } from './chunk-KKS6NEGI.js';
|
|
3
2
|
import './chunk-J2QJATCD.js';
|
|
4
3
|
import './chunk-S7USVSYP.js';
|
|
5
|
-
import './chunk-
|
|
4
|
+
import './chunk-TBXUF5YX.js';
|
|
6
5
|
import './chunk-TAKSIV57.js';
|
|
7
6
|
import './chunk-MMTMOV6R.js';
|
|
8
7
|
import './chunk-3Q32K4PE.js';
|
|
9
8
|
import './chunk-A72NWYNP.js';
|
|
9
|
+
import { iconAt } from './chunk-C3PXY2SW.js';
|
|
10
10
|
import { addSlot } from './chunk-Q6WTDVH6.js';
|
|
11
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
11
12
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
12
13
|
import { css, defineStyles } from './chunk-XBEL4K33.js';
|
|
13
14
|
import './chunk-2GQIZM5Z.js';
|
|
14
15
|
import './chunk-BXMWQIBO.js';
|
|
15
16
|
import './chunk-X66RJAIS.js';
|
|
16
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
17
17
|
|
|
18
18
|
// src/components/callout-bubble.ts
|
|
19
19
|
function closesPanel(item) {
|
package/dist/card.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { C as Child } from './h-Bl37qUis.js';
|
|
2
|
+
import { a as VariantProps, V as VariantFn } from './variants-B4stUBnY.js';
|
|
3
|
+
import { C as ComponentDef } from './define-D5u3F5Dj.js';
|
|
4
|
+
import './t.js';
|
|
5
|
+
|
|
6
|
+
declare const cardDef: ComponentDef<"card", "footer" | "header" | "title" | "root" | "trigger" | "content" | "heading" | "eyebrow" | "description" | "action", "border" | "radius" | "gap" | "background" | "padding" | "padding-sm" | "gap-sm" | "inset-background">;
|
|
7
|
+
declare const cardVariants: VariantFn<{
|
|
8
|
+
readonly variant: readonly ["default", "inset"];
|
|
9
|
+
readonly size: readonly ["default", "sm"];
|
|
10
|
+
}>;
|
|
11
|
+
type CardVariant = (typeof cardVariants.spec.variant)[number];
|
|
12
|
+
type CardSize = (typeof cardVariants.spec.size)[number];
|
|
13
|
+
interface CardProps extends VariantProps<typeof cardVariants> {
|
|
14
|
+
/** Small capitals over the title: what kind of card it is ("Market pulse"). */
|
|
15
|
+
eyebrow?: string | Node;
|
|
16
|
+
/** The heading: text, or an element (a name with a badge after it). */
|
|
17
|
+
title?: string | Node;
|
|
18
|
+
/** The muted line under the title. */
|
|
19
|
+
description?: string | Node;
|
|
20
|
+
/** At the header's end: its buttons, a toggle group. */
|
|
21
|
+
action?: Child;
|
|
22
|
+
/** The body. More can be appended to the handle's `content` later. */
|
|
23
|
+
content?: Child;
|
|
24
|
+
/** Under the body, past a line: notes, a source, a time. */
|
|
25
|
+
footer?: Child;
|
|
26
|
+
/** The title's heading level (default 3). */
|
|
27
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
28
|
+
/** The current card (the one a detail view shows). */
|
|
29
|
+
selected?: boolean;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** Makes the card clickable: a click on it, or Enter or Space on its title, runs it. */
|
|
32
|
+
onSelect?: (e: MouseEvent | KeyboardEvent) => void;
|
|
33
|
+
/** Extra class names (layout hooks). */
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
interface CardHandle {
|
|
37
|
+
readonly el: HTMLElement;
|
|
38
|
+
/** The body: append the card's content here. */
|
|
39
|
+
readonly content: HTMLElement;
|
|
40
|
+
/** A new title; null removes it. */
|
|
41
|
+
setTitle(title: string | Node | null): void;
|
|
42
|
+
/** A new description; null removes it. */
|
|
43
|
+
setDescription(description: string | Node | null): void;
|
|
44
|
+
/** A new footer; null removes it. */
|
|
45
|
+
setFooter(footer: Child | null): void;
|
|
46
|
+
setSelected(selected: boolean): void;
|
|
47
|
+
setDisabled(disabled: boolean): void;
|
|
48
|
+
destroy(): void;
|
|
49
|
+
}
|
|
50
|
+
declare function createCard(props?: CardProps): CardHandle;
|
|
51
|
+
|
|
52
|
+
export { type CardHandle, type CardProps, type CardSize, type CardVariant, cardDef, cardVariants, createCard };
|
package/dist/card.js
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { variants } from './chunk-LZWZV2ZS.js';
|
|
2
|
+
import { h, append } from './chunk-Q6WTDVH6.js';
|
|
3
|
+
import { t } from './chunk-6QCILIT2.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
|
+
|
|
10
|
+
// src/components/card.ts
|
|
11
|
+
var cardDef = defineComponent({
|
|
12
|
+
name: "card",
|
|
13
|
+
parts: ["root", "header", "heading", "eyebrow", "title", "trigger", "description", "action", "content", "footer"],
|
|
14
|
+
settings: {
|
|
15
|
+
radius: t.radius.lg,
|
|
16
|
+
padding: "16px",
|
|
17
|
+
"padding-sm": "10px 12px",
|
|
18
|
+
gap: "12px",
|
|
19
|
+
"gap-sm": "8px",
|
|
20
|
+
background: t.surface,
|
|
21
|
+
border: t.border,
|
|
22
|
+
"inset-background": `color-mix(in srgb, ${t.fg.bright} 2.5%, ${t.surface})`
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var cardVariants = variants({ variant: ["default", "inset"], size: ["default", "sm"] });
|
|
26
|
+
var CONTROL = 'button, a[href], input, select, textarea, label, summary, [role="button"], [role="checkbox"], [role="switch"], [role="menuitem"], [role="option"], [role="link"], [role="tab"], [role="radio"], [contenteditable]:not([contenteditable="false"])';
|
|
27
|
+
var injectStyles = defineStyles(
|
|
28
|
+
"vela-ui-card",
|
|
29
|
+
css`@layer vela.ui{[data-slot=card]{box-sizing:border-box;min-width:0;padding:${cardDef.vars.padding};border:1px solid ${cardDef.vars.border};border-radius:${cardDef.vars.radius};background:${cardDef.vars.background};color:${t.fg};text-align:start;transition:background ${t.dur.fast} ease, border-color ${t.dur.fast} ease;font-size:13px;position:relative}[data-slot=card]:where(:not([hidden])){gap:${cardDef.vars.gap};flex-direction:column;display:flex}[data-slot=card][data-size=sm]{gap:${cardDef.vars["gap-sm"]};padding:${cardDef.vars["padding-sm"]};font-size:12px}[data-slot=card][data-variant=inset]{background:${cardDef.vars["inset-background"]}}[data-slot=card][data-clickable]{cursor:pointer;-webkit-tap-highlight-color:transparent}[data-slot=card][data-clickable]:not([data-disabled]):hover{border-color:${t.border.strong}}[data-slot=card][data-selected],[data-slot=card][data-selected][data-clickable]:hover{border-color:${t.fg.bright}}[data-slot=card]:focus-visible{outline:2px solid ${t.focus};outline-offset:2px}[data-slot=card][data-disabled]{cursor:default;opacity:.5}[data-slot=card-header]{gap:12px;min-width:0}[data-slot=card-header]:where(:not([hidden])){align-items:flex-start;display:flex}[data-slot=card-heading]{flex:auto;min-width:0}[data-slot=card-heading]:where(:not([hidden])){flex-direction:column;gap:2px;display:flex}[data-slot=card-eyebrow]{color:${t.fg.muted};letter-spacing:.08em;text-transform:uppercase;font-size:10px;font-weight:500;line-height:14px}[data-slot=card-title]{color:${t.fg.bright};overflow-wrap:anywhere;margin:0;font-size:15px;font-weight:600;line-height:1.3}[data-slot=card-title]:is([data-size=sm] *){font-size:13px}[data-slot=card-trigger]{all:unset;border-radius:${t.radius.sm};cursor:pointer}[data-slot=card-trigger]:focus-visible{outline:2px solid ${t.focus};outline-offset:2px}[data-slot=card-trigger]:disabled{cursor:default}[data-slot=card-description]{color:${t.fg.muted};margin:0;font-size:12px;line-height:1.45}[data-slot=card-action]{flex:none;gap:6px;margin-inline-start:auto}[data-slot=card-action]:where(:not([hidden])){align-items:center;display:inline-flex}[data-slot=card-content]{flex:auto;min-width:0}[data-slot=card-footer]{border-top:1px solid ${cardDef.vars.border};color:${t.fg.muted};flex-wrap:wrap;gap:8px 16px;padding-top:10px;font-size:11px;line-height:1.5}[data-slot=card-footer]:where(:not([hidden])){justify-content:space-between;align-items:center;display:flex}}`
|
|
30
|
+
);
|
|
31
|
+
var CardImpl = class {
|
|
32
|
+
constructor(props) {
|
|
33
|
+
this.props = props;
|
|
34
|
+
this.header = null;
|
|
35
|
+
this.heading = null;
|
|
36
|
+
this.titleEl = null;
|
|
37
|
+
this.trigger = null;
|
|
38
|
+
this.descriptionEl = null;
|
|
39
|
+
this.footerEl = null;
|
|
40
|
+
this.disabled = false;
|
|
41
|
+
this.selected = false;
|
|
42
|
+
this.onClick = (e) => {
|
|
43
|
+
if (this.disabled) return;
|
|
44
|
+
const control = e.target instanceof Element ? e.target.closest(CONTROL) : null;
|
|
45
|
+
if (control && control !== this.trigger && control !== this.el && this.el.contains(control)) return;
|
|
46
|
+
this.props.onSelect?.(e);
|
|
47
|
+
};
|
|
48
|
+
this.onKey = (e) => {
|
|
49
|
+
if (this.disabled || e.target !== this.el || e.key !== "Enter" && e.key !== " ") return;
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
this.props.onSelect?.(e);
|
|
52
|
+
};
|
|
53
|
+
injectStyles(document);
|
|
54
|
+
this.content = h("div", { slot: cardDef.slot("content") });
|
|
55
|
+
append(this.content, [props.content]);
|
|
56
|
+
this.el = h(
|
|
57
|
+
"div",
|
|
58
|
+
{ className: props.className, slot: cardDef.slot("root"), attrs: cardVariants(props), data: { clickable: props.onSelect ? true : null } },
|
|
59
|
+
this.content
|
|
60
|
+
);
|
|
61
|
+
if (props.eyebrow !== void 0) this.ensureHeading().prepend(h("div", { slot: cardDef.slot("eyebrow") }, props.eyebrow));
|
|
62
|
+
if (props.title !== void 0) this.setTitle(props.title);
|
|
63
|
+
if (props.description !== void 0) this.setDescription(props.description);
|
|
64
|
+
if (props.action !== void 0 && props.action !== null) {
|
|
65
|
+
const action = h("div", { slot: cardDef.slot("action") });
|
|
66
|
+
append(action, [props.action]);
|
|
67
|
+
this.ensureHeader().append(action);
|
|
68
|
+
}
|
|
69
|
+
if (props.footer !== void 0) this.setFooter(props.footer);
|
|
70
|
+
if (props.onSelect) this.el.addEventListener("click", this.onClick);
|
|
71
|
+
this.disabled = props.disabled ?? false;
|
|
72
|
+
this.selected = props.selected ?? false;
|
|
73
|
+
this.syncControl();
|
|
74
|
+
this.setDisabled(this.disabled);
|
|
75
|
+
this.setSelected(this.selected);
|
|
76
|
+
}
|
|
77
|
+
setTitle(title) {
|
|
78
|
+
if (title === null) {
|
|
79
|
+
this.titleEl?.remove();
|
|
80
|
+
this.titleEl = null;
|
|
81
|
+
this.trigger = null;
|
|
82
|
+
this.syncControl();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (!this.titleEl) {
|
|
86
|
+
this.titleEl = h(`h${this.props.headingLevel ?? 3}`, { slot: cardDef.slot("title") });
|
|
87
|
+
const heading = this.ensureHeading();
|
|
88
|
+
const eyebrow = heading.querySelector(`:scope > [data-slot="${cardDef.slot("eyebrow")}"]`);
|
|
89
|
+
if (eyebrow) eyebrow.after(this.titleEl);
|
|
90
|
+
else heading.prepend(this.titleEl);
|
|
91
|
+
if (this.props.onSelect) {
|
|
92
|
+
this.trigger = h("button", { slot: cardDef.slot("trigger"), attrs: { type: "button" } });
|
|
93
|
+
this.titleEl.append(this.trigger);
|
|
94
|
+
}
|
|
95
|
+
this.syncControl();
|
|
96
|
+
}
|
|
97
|
+
(this.trigger ?? this.titleEl).replaceChildren(title);
|
|
98
|
+
}
|
|
99
|
+
setDescription(description) {
|
|
100
|
+
if (description === null) {
|
|
101
|
+
this.descriptionEl?.remove();
|
|
102
|
+
this.descriptionEl = null;
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
this.descriptionEl ?? (this.descriptionEl = this.ensureHeading().appendChild(h("p", { slot: cardDef.slot("description") })));
|
|
106
|
+
this.descriptionEl.replaceChildren(description);
|
|
107
|
+
}
|
|
108
|
+
setFooter(footer) {
|
|
109
|
+
if (footer === null) {
|
|
110
|
+
this.footerEl?.remove();
|
|
111
|
+
this.footerEl = null;
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
this.footerEl ?? (this.footerEl = this.el.appendChild(h("div", { slot: cardDef.slot("footer") })));
|
|
115
|
+
this.footerEl.replaceChildren();
|
|
116
|
+
append(this.footerEl, [footer]);
|
|
117
|
+
}
|
|
118
|
+
setSelected(selected) {
|
|
119
|
+
this.selected = selected;
|
|
120
|
+
this.el.toggleAttribute("data-selected", selected);
|
|
121
|
+
this.el.removeAttribute("aria-current");
|
|
122
|
+
this.trigger?.removeAttribute("aria-current");
|
|
123
|
+
if (selected) this.control()?.setAttribute("aria-current", "true");
|
|
124
|
+
}
|
|
125
|
+
setDisabled(disabled) {
|
|
126
|
+
this.disabled = disabled;
|
|
127
|
+
this.el.toggleAttribute("data-disabled", disabled);
|
|
128
|
+
if (this.trigger) this.trigger.disabled = disabled;
|
|
129
|
+
else if (this.props.onSelect) {
|
|
130
|
+
this.el.tabIndex = disabled ? -1 : 0;
|
|
131
|
+
if (disabled) this.el.setAttribute("aria-disabled", "true");
|
|
132
|
+
else this.el.removeAttribute("aria-disabled");
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
destroy() {
|
|
136
|
+
this.el.removeEventListener("click", this.onClick);
|
|
137
|
+
this.el.removeEventListener("keydown", this.onKey);
|
|
138
|
+
this.el.remove();
|
|
139
|
+
}
|
|
140
|
+
/** What the keyboard and screen readers press: the title's button, or the card itself without a title. */
|
|
141
|
+
control() {
|
|
142
|
+
if (!this.props.onSelect) return null;
|
|
143
|
+
return this.trigger ?? this.el;
|
|
144
|
+
}
|
|
145
|
+
/** Give the card the button's role while it has no title to carry it, and take it back once it has one. */
|
|
146
|
+
syncControl() {
|
|
147
|
+
if (!this.props.onSelect) return;
|
|
148
|
+
if (this.trigger === null) {
|
|
149
|
+
this.el.setAttribute("role", "button");
|
|
150
|
+
this.el.addEventListener("keydown", this.onKey);
|
|
151
|
+
} else {
|
|
152
|
+
this.el.removeAttribute("role");
|
|
153
|
+
this.el.removeAttribute("tabindex");
|
|
154
|
+
this.el.removeAttribute("aria-disabled");
|
|
155
|
+
this.el.removeEventListener("keydown", this.onKey);
|
|
156
|
+
}
|
|
157
|
+
this.setDisabled(this.disabled);
|
|
158
|
+
this.setSelected(this.selected);
|
|
159
|
+
}
|
|
160
|
+
ensureHeader() {
|
|
161
|
+
if (!this.header) {
|
|
162
|
+
this.header = h("div", { slot: cardDef.slot("header") });
|
|
163
|
+
this.el.prepend(this.header);
|
|
164
|
+
}
|
|
165
|
+
return this.header;
|
|
166
|
+
}
|
|
167
|
+
ensureHeading() {
|
|
168
|
+
if (!this.heading) {
|
|
169
|
+
this.heading = h("div", { slot: cardDef.slot("heading") });
|
|
170
|
+
this.ensureHeader().prepend(this.heading);
|
|
171
|
+
}
|
|
172
|
+
return this.heading;
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
function createCard(props = {}) {
|
|
176
|
+
return new CardImpl(props);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export { cardDef, cardVariants, createCard };
|
package/dist/checkbox.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { Checkbox, checkboxController, checkboxDef, checkboxVariants, createCheckbox } from './chunk-
|
|
2
|
-
import './chunk-LZWZV2ZS.js';
|
|
3
|
-
import './chunk-G7IQLY3A.js';
|
|
1
|
+
export { Checkbox, checkboxController, checkboxDef, checkboxVariants, createCheckbox } from './chunk-IOOYDSSK.js';
|
|
4
2
|
import './chunk-A72NWYNP.js';
|
|
5
3
|
import './chunk-P4MTEMT7.js';
|
|
4
|
+
import './chunk-C3PXY2SW.js';
|
|
5
|
+
import './chunk-LZWZV2ZS.js';
|
|
6
6
|
import './chunk-Q6WTDVH6.js';
|
|
7
|
+
import './chunk-6QCILIT2.js';
|
|
7
8
|
import './chunk-VMCR3S2A.js';
|
|
8
9
|
import './chunk-XBEL4K33.js';
|
|
9
10
|
import './chunk-2GQIZM5Z.js';
|
|
10
11
|
import './chunk-BXMWQIBO.js';
|
|
11
12
|
import './chunk-X66RJAIS.js';
|
|
12
|
-
import './chunk-6QCILIT2.js';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { iconEl } from './chunk-G7IQLY3A.js';
|
|
2
1
|
import { kitTranslator } from './chunk-FVH6L7FM.js';
|
|
3
2
|
import { msg, textOf } from './chunk-FN2BUFNM.js';
|
|
4
3
|
import { announceSurface } from './chunk-J2QJATCD.js';
|
|
5
4
|
import { holdForExit } from './chunk-S7USVSYP.js';
|
|
6
|
-
import { floatingLayerHost } from './chunk-
|
|
5
|
+
import { floatingLayerHost } from './chunk-TBXUF5YX.js';
|
|
7
6
|
import { zagPositioning, splitPlacement } from './chunk-3Q32K4PE.js';
|
|
8
7
|
import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-P4MTEMT7.js';
|
|
8
|
+
import { iconEl } from './chunk-C3PXY2SW.js';
|
|
9
9
|
import { addSlot } from './chunk-Q6WTDVH6.js';
|
|
10
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
10
11
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
11
12
|
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
12
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
13
13
|
import * as zagMenu from '@zag-js/menu';
|
|
14
14
|
|
|
15
15
|
function dropdownMenuController(opts) {
|
|
@@ -127,6 +127,11 @@ registerIcon("kebab", S('<circle cx="8" cy="3.2" r="1.2"/><circle cx="8" cy="8"
|
|
|
127
127
|
registerIcon("burger", S('<path d="M2.5 4.5h11M2.5 8h11M2.5 11.5h11"/>'));
|
|
128
128
|
registerIcon("info", S('<path d="M8 7.4v4.4"/><circle cx="8" cy="4.6" r="0.9" fill="currentColor" stroke="none"/>'));
|
|
129
129
|
registerIcon("reset", S('<path d="M2 8a6 6 0 1 0 6-6 6.5 6.5 0 0 0-4.5 1.83L2 5.33"/><path d="M2 2v3.33h3.33"/>'));
|
|
130
|
+
registerIcon("circle-check", S('<circle cx="8" cy="8" r="6.2"/><path d="m5.4 8.2 1.8 1.8 3.4-3.7"/>'));
|
|
131
|
+
registerIcon("circle-info", S('<circle cx="8" cy="8" r="6.2"/><path d="M8 7.4v3.6"/><circle cx="8" cy="5.1" r="0.8" fill="currentColor" stroke="none"/>'));
|
|
132
|
+
registerIcon("triangle-alert", S('<path d="M7.1 2.6a1 1 0 0 1 1.8 0l5.3 9.6a1 1 0 0 1-.9 1.5H2.7a1 1 0 0 1-.9-1.5z"/><path d="M8 6.3v3.2"/><circle cx="8" cy="11.4" r="0.8" fill="currentColor" stroke="none"/>'));
|
|
133
|
+
registerIcon("circle-x", S('<circle cx="8" cy="8" r="6.2"/><path d="m5.9 5.9 4.2 4.2M10.1 5.9l-4.2 4.2"/>'));
|
|
134
|
+
registerIcon("loader", S('<path d="M8 1.8a6.2 6.2 0 1 0 6.2 6.2"/>'));
|
|
130
135
|
registerIcon("pane-collapse", S('<path d="M2.6 9.4h4v4M13.4 6.6h-4v-4"/><path d="m9.4 6.6 4.2-4.2M2.4 13.6l4.2-4.2"/>'));
|
|
131
136
|
registerIcon("pane-expand", S('<path d="M9.8 2.4h3.8v3.8M6.2 13.6H2.4V9.8"/><path d="m13.6 2.4-4.4 4.4M2.4 13.6l4.4-4.4"/>'));
|
|
132
137
|
registerIcon("cursor", svg24('<path d="M5 3l6 16 2-6 6-2z"/>', 'fill="currentColor" stroke="none"'));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createKbd } from './chunk-
|
|
1
|
+
import { createKbd } from './chunk-FYVQO5TN.js';
|
|
2
|
+
import { iconEl } from './chunk-C3PXY2SW.js';
|
|
2
3
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
3
|
-
import { iconEl } from './chunk-G7IQLY3A.js';
|
|
4
4
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
5
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
5
6
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
6
7
|
import { css, defineStyles } from './chunk-XBEL4K33.js';
|
|
7
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
8
8
|
|
|
9
9
|
// src/components/button.ts
|
|
10
10
|
var buttonDef = defineComponent({
|
|
@@ -26,7 +26,7 @@ var buttonVariants = variants({
|
|
|
26
26
|
size: ["default", "xs", "sm", "lg", "icon", "icon-xs", "icon-sm", "icon-lg"]
|
|
27
27
|
});
|
|
28
28
|
var BUTTON_STYLE_ID = "vela-ui-button";
|
|
29
|
-
var BUTTON_CSS = css`@layer vela.ui{[data-slot=button]{cursor:pointer;height:${buttonDef.vars.height};border-radius:${buttonDef.vars.radius};border:1px solid ${t.border.strong};color:${t.fg};font-weight:400;font-size:${buttonDef.vars["font-size"]};white-space:nowrap;transition:background ${t.dur.fast} ease, color ${t.dur.fast} ease, opacity ${t.dur.fast} ease, border-color ${t.dur.fast} ease;background:0 0;padding:0 11px;font-family:inherit}[data-slot=button]:where(:not([hidden])){justify-content:center;align-items:center;gap:6px;display:inline-flex}[data-slot=button]>[data-icon]{flex:none;width:1em;height:1em;font-size:16px}[data-slot=button]>[data-icon]>svg{width:100%;height:100%}[data-slot=button][data-size=xs]>[data-icon],[data-slot=button][data-size=icon-xs]>[data-icon]{font-size:12px}[data-slot=button]>[data-keys]{flex:none;gap:2px}[data-slot=button]>[data-keys]:where(:not([hidden])){display:inline-flex}[data-slot=button][data-size=sm],[data-slot=button][data-size=icon-sm]{height:${buttonDef.vars["height-sm"]};font-size:${buttonDef.vars["font-size-sm"]}}[data-slot=button][data-size=xs],[data-slot=button][data-size=icon-xs]{height:${buttonDef.vars["height-xs"]};font-size:${buttonDef.vars["font-size-xs"]};border-radius:${t.radius.sm};padding:0 8px}[data-slot=button][data-size=lg],[data-slot=button][data-size=icon-lg]{height:${buttonDef.vars["height-lg"]};padding:0 14px}[data-slot=button][data-size=icon]{width:${buttonDef.vars.height};padding:0}[data-slot=button][data-size=icon-sm]{width:${buttonDef.vars["height-sm"]};padding:0}[data-slot=button][data-size=icon-xs]{width:${buttonDef.vars["height-xs"]};padding:0}[data-slot=button][data-size=icon-lg]{width:${buttonDef.vars["height-lg"]};padding:0}[data-slot=button]:disabled{cursor:default;opacity:.5}[data-slot=button]:focus-visible{outline:2px solid ${t.focus};outline-offset:1px}[data-slot=button]:not(:disabled):hover,[data-slot=button][aria-expanded=true]{background:${t.hover};color:${t.fg.bright};border-color:${t.fg.muted}}[data-slot=button][data-variant=default]{border-color:${t.selected.bg};background:${t.selected.bg};color:${t.selected.fg}}[data-slot=button][data-variant=default]:not(:disabled):hover,[data-slot=button][data-variant=default][aria-expanded=true]{background:${t.selected.bg};color:${t.selected.fg};opacity:.85;border-color:${t.selected.bg}}[data-slot=button][data-variant=secondary]{background:${t.surface.sunken};border-color:${t.border}}[data-slot=button][data-variant=secondary]:not(:disabled):hover,[data-slot=button][data-variant=secondary][aria-expanded=true]{border-color:${t.border.strong}}[data-slot=button][data-variant=ghost]{color:${t.fg.muted};border-color:#0000}[data-slot=button][data-variant=ghost]:not(:disabled):hover,[data-slot=button][data-variant=ghost][aria-expanded=true]{border-color:#0000}[data-slot=button][data-variant=destructive]{background:color-mix(in srgb, ${t.danger} 14%, transparent);color:${t.danger};border-color:#0000}[data-slot=button][data-variant=destructive]:not(:disabled):hover{background:color-mix(in srgb, ${t.danger} 24%, transparent);color:${t.danger};border-color:#0000}[data-slot=button][data-variant=link]{color:${t.accent};text-underline-offset:4px;background:0 0;border-color:#0000;padding-inline:0}[data-slot=button][data-variant=link]:not(:disabled):hover{color:${t.accent};background:0 0;border-color:#0000;text-decoration:underline}[data-slot=button][data-variant=up],[data-slot=button][data-variant=up]:not(:disabled):hover{background:${t.up};color:${t.fg.onFill};border-color:#0000}[data-slot=button][data-variant=down],[data-slot=button][data-variant=down]:not(:disabled):hover{background:${t.down};color:${t.fg.onFill};border-color:#0000}[data-slot=button][data-variant=up]:not(:disabled):hover,[data-slot=button][data-variant=down]:not(:disabled):hover{opacity:.88}[data-slot=button][data-pressed]{background:${t.active};color:${t.fg.bright}}[data-slot=button][data-variant=favorite]{color:${t.fg.muted};border-color:#0000}[data-slot=button][data-variant=favorite]:not(:disabled):hover{border-color:#0000}[data-slot=button][data-variant=favorite][data-pressed]{color:${t.highlight};background:0 0}[data-slot=button][data-variant=favorite][data-pressed]:where(:not(:disabled)):hover{background:${t.hover};color:${t.highlight}}}`;
|
|
29
|
+
var BUTTON_CSS = css`@layer vela.ui{[data-slot=button]{cursor:pointer;height:${buttonDef.vars.height};border-radius:${buttonDef.vars.radius};border:1px solid ${t.border.strong};color:${t.fg};font-weight:400;font-size:${buttonDef.vars["font-size"]};white-space:nowrap;transition:background ${t.dur.fast} ease, color ${t.dur.fast} ease, opacity ${t.dur.fast} ease, border-color ${t.dur.fast} ease;background:0 0;padding:0 11px;font-family:inherit}[data-slot=button]:where(:not([hidden])){justify-content:center;align-items:center;gap:6px;display:inline-flex}[data-slot=button]>[data-icon]{flex:none;width:1em;height:1em;font-size:16px}[data-slot=button]>[data-icon]>svg{width:100%;height:100%}[data-slot=button][data-size=xs]>[data-icon],[data-slot=button][data-size=icon-xs]>[data-icon]{font-size:12px}[data-slot=button]>[data-keys]{flex:none;gap:2px}[data-slot=button]>[data-keys]:where(:not([hidden])){display:inline-flex}[data-slot=button]>[data-keys]>[data-slot=kbd]{border-color:${t.border};color:inherit;box-shadow:none;background:0 0}[data-slot=button][data-size=sm],[data-slot=button][data-size=icon-sm]{height:${buttonDef.vars["height-sm"]};font-size:${buttonDef.vars["font-size-sm"]}}[data-slot=button][data-size=xs],[data-slot=button][data-size=icon-xs]{height:${buttonDef.vars["height-xs"]};font-size:${buttonDef.vars["font-size-xs"]};border-radius:${t.radius.sm};padding:0 8px}[data-slot=button][data-size=lg],[data-slot=button][data-size=icon-lg]{height:${buttonDef.vars["height-lg"]};padding:0 14px}[data-slot=button][data-size=icon]{width:${buttonDef.vars.height};padding:0}[data-slot=button][data-size=icon-sm]{width:${buttonDef.vars["height-sm"]};padding:0}[data-slot=button][data-size=icon-xs]{width:${buttonDef.vars["height-xs"]};padding:0}[data-slot=button][data-size=icon-lg]{width:${buttonDef.vars["height-lg"]};padding:0}[data-slot=button]:disabled{cursor:default;opacity:.5}[data-slot=button]:focus-visible{outline:2px solid ${t.focus};outline-offset:1px}[data-slot=button]:not(:disabled):hover,[data-slot=button][aria-expanded=true]{background:${t.hover};color:${t.fg.bright};border-color:${t.fg.muted}}[data-slot=button][data-variant=default]{border-color:${t.selected.bg};background:${t.selected.bg};color:${t.selected.fg}}[data-slot=button][data-variant=default]:not(:disabled):hover,[data-slot=button][data-variant=default][aria-expanded=true]{background:${t.selected.bg};color:${t.selected.fg};opacity:.85;border-color:${t.selected.bg}}[data-slot=button][data-variant=secondary]{background:${t.surface.sunken};border-color:${t.border}}[data-slot=button][data-variant=secondary]:not(:disabled):hover,[data-slot=button][data-variant=secondary][aria-expanded=true]{border-color:${t.border.strong}}[data-slot=button][data-variant=ghost]{color:${t.fg.muted};border-color:#0000}[data-slot=button][data-variant=ghost]:not(:disabled):hover,[data-slot=button][data-variant=ghost][aria-expanded=true]{border-color:#0000}[data-slot=button][data-variant=destructive]{background:color-mix(in srgb, ${t.danger} 14%, transparent);color:${t.danger};border-color:#0000}[data-slot=button][data-variant=destructive]:not(:disabled):hover{background:color-mix(in srgb, ${t.danger} 24%, transparent);color:${t.danger};border-color:#0000}[data-slot=button][data-variant=link]{color:${t.accent};text-underline-offset:4px;background:0 0;border-color:#0000;padding-inline:0}[data-slot=button][data-variant=link]:not(:disabled):hover{color:${t.accent};background:0 0;border-color:#0000;text-decoration:underline}[data-slot=button][data-variant=up],[data-slot=button][data-variant=up]:not(:disabled):hover{background:${t.up};color:${t.fg.onFill};border-color:#0000}[data-slot=button][data-variant=down],[data-slot=button][data-variant=down]:not(:disabled):hover{background:${t.down};color:${t.fg.onFill};border-color:#0000}[data-slot=button][data-variant=up]:not(:disabled):hover,[data-slot=button][data-variant=down]:not(:disabled):hover{opacity:.88}[data-slot=button][data-pressed]{background:${t.active};color:${t.fg.bright}}[data-slot=button][data-variant=favorite]{color:${t.fg.muted};border-color:#0000}[data-slot=button][data-variant=favorite]:not(:disabled):hover{border-color:#0000}[data-slot=button][data-variant=favorite][data-pressed]{color:${t.highlight};background:0 0}[data-slot=button][data-variant=favorite][data-pressed]:where(:not(:disabled)):hover{background:${t.hover};color:${t.highlight}}}`;
|
|
30
30
|
var injectStyles = defineStyles(BUTTON_STYLE_ID, BUTTON_CSS);
|
|
31
31
|
var iconPart = (id, side) => {
|
|
32
32
|
const el = iconEl(id, document);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { variants } from './chunk-LZWZV2ZS.js';
|
|
2
|
-
import { iconEl } from './chunk-G7IQLY3A.js';
|
|
3
1
|
import { ownTeardown } from './chunk-A72NWYNP.js';
|
|
4
2
|
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-P4MTEMT7.js';
|
|
3
|
+
import { iconEl } from './chunk-C3PXY2SW.js';
|
|
4
|
+
import { variants } from './chunk-LZWZV2ZS.js';
|
|
5
5
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
6
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
6
7
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
7
8
|
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
8
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
9
9
|
import * as zagSwitch from '@zag-js/switch';
|
|
10
10
|
|
|
11
11
|
function checkboxController(opts = {}) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { announceSurface } from './chunk-J2QJATCD.js';
|
|
2
2
|
import { holdForExit } from './chunk-S7USVSYP.js';
|
|
3
|
-
import { floatingLayerHost, ensureUIHost } from './chunk-
|
|
3
|
+
import { floatingLayerHost, ensureUIHost } from './chunk-TBXUF5YX.js';
|
|
4
4
|
import { viewportRect, insetRect, intersectRects, placePopover } from './chunk-3Q32K4PE.js';
|
|
5
5
|
import { disposeWithin } from './chunk-A72NWYNP.js';
|
|
6
6
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
7
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
7
8
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
8
9
|
import { css, defineStyles } from './chunk-XBEL4K33.js';
|
|
9
10
|
import { pageState } from './chunk-X66RJAIS.js';
|
|
10
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
11
11
|
|
|
12
12
|
// src/components/popover.ts
|
|
13
13
|
function popoverController(opts = {}) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-KKS6NEGI.js';
|
|
2
|
+
import { iconEl } from './chunk-C3PXY2SW.js';
|
|
3
3
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
4
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
4
5
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
5
6
|
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
6
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
7
7
|
|
|
8
8
|
// src/components/glyph-select.ts
|
|
9
9
|
function glyphSelectController(opts) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { kitTranslator } from './chunk-FVH6L7FM.js';
|
|
2
2
|
import { msg, textOf } from './chunk-FN2BUFNM.js';
|
|
3
|
-
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-
|
|
3
|
+
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-KKS6NEGI.js';
|
|
4
4
|
import { ACCENT_BRIGHT, ACCENT, BULLISH, BEARISH, WARNING, NEUTRAL } from './chunk-MMTMOV6R.js';
|
|
5
5
|
import { ownTeardown, disposeWithin } from './chunk-A72NWYNP.js';
|
|
6
6
|
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-P4MTEMT7.js';
|
|
7
7
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
8
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
8
9
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
9
10
|
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
10
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
11
11
|
import * as zagSlider from '@zag-js/slider';
|
|
12
12
|
|
|
13
13
|
function splitColor(color) {
|
|
@@ -23,6 +23,10 @@ var KIT_COMPONENTS = {
|
|
|
23
23
|
parts: ["root", "panel", "title", "text", "actions", "button"],
|
|
24
24
|
settings: ["panel-radius", "button-radius"]
|
|
25
25
|
},
|
|
26
|
+
card: {
|
|
27
|
+
parts: ["root", "header", "heading", "eyebrow", "title", "trigger", "description", "action", "content", "footer"],
|
|
28
|
+
settings: ["radius", "padding", "padding-sm", "gap", "gap-sm", "background", "border", "inset-background"]
|
|
29
|
+
},
|
|
26
30
|
checkbox: {
|
|
27
31
|
parts: ["root", "icon"],
|
|
28
32
|
settings: ["radius"]
|
|
@@ -143,6 +147,10 @@ var KIT_COMPONENTS = {
|
|
|
143
147
|
parts: ["root", "input"],
|
|
144
148
|
settings: ["radius", "focus-ring"]
|
|
145
149
|
},
|
|
150
|
+
toast: {
|
|
151
|
+
parts: ["root", "list", "item", "close", "icon", "content", "title", "description", "cancel", "action"],
|
|
152
|
+
settings: ["width", "radius", "background", "border", "foreground", "description-color", "shadow", "success", "info", "warning", "error"]
|
|
153
|
+
},
|
|
146
154
|
"toggle-group": {
|
|
147
155
|
parts: ["root", "item", "icon"],
|
|
148
156
|
settings: ["radius", "radius-sm", "item-radius", "item-radius-sm"]
|
|
@@ -150,6 +158,10 @@ var KIT_COMPONENTS = {
|
|
|
150
158
|
tooltip: {
|
|
151
159
|
parts: ["positioner", "content"],
|
|
152
160
|
settings: ["radius"]
|
|
161
|
+
},
|
|
162
|
+
treemap: {
|
|
163
|
+
parts: ["root", "crumbs", "crumb", "map", "group", "group-name", "group-value", "tile", "tile-label", "tile-value", "legend", "legend-bar", "tip"],
|
|
164
|
+
settings: ["radius", "up", "down", "tile-bg", "tint-min", "tint-max", "hover-z", "tip-radius", "tip-bg", "tip-shadow", "tip-z"]
|
|
153
165
|
}
|
|
154
166
|
};
|
|
155
167
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { variants } from './chunk-LZWZV2ZS.js';
|
|
2
|
-
import { iconEl } from './chunk-G7IQLY3A.js';
|
|
3
1
|
import { kitTranslator } from './chunk-FVH6L7FM.js';
|
|
4
2
|
import { msg, textOf } from './chunk-FN2BUFNM.js';
|
|
5
3
|
import { ownTeardown } from './chunk-A72NWYNP.js';
|
|
6
4
|
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-P4MTEMT7.js';
|
|
5
|
+
import { iconEl } from './chunk-C3PXY2SW.js';
|
|
6
|
+
import { variants } from './chunk-LZWZV2ZS.js';
|
|
7
7
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
8
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
8
9
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
9
10
|
import { css, defineStyles } from './chunk-XBEL4K33.js';
|
|
10
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
11
11
|
import * as zagNumber from '@zag-js/number-input';
|
|
12
12
|
|
|
13
13
|
function clampNumber(n, opts) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { iconEl } from './chunk-G7IQLY3A.js';
|
|
3
|
-
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-B5ZSRUDQ.js';
|
|
1
|
+
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-KKS6NEGI.js';
|
|
4
2
|
import { ownTeardown } from './chunk-A72NWYNP.js';
|
|
5
3
|
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-P4MTEMT7.js';
|
|
4
|
+
import { iconEl } from './chunk-C3PXY2SW.js';
|
|
5
|
+
import { variants } from './chunk-LZWZV2ZS.js';
|
|
6
6
|
import { addSlot, h } from './chunk-Q6WTDVH6.js';
|
|
7
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
7
8
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
8
9
|
import { css, defineStyles } from './chunk-XBEL4K33.js';
|
|
9
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
10
10
|
import * as zagListbox from '@zag-js/listbox';
|
|
11
11
|
|
|
12
12
|
function selectController(opts) {
|
package/dist/collapsible.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { a as VariantProps, V as VariantFn } from './variants-B4stUBnY.js';
|
|
|
2
2
|
import { C as ComponentDef } from './define-D5u3F5Dj.js';
|
|
3
3
|
import './t.js';
|
|
4
4
|
|
|
5
|
-
declare const collapsibleDef: ComponentDef<"collapsible", "
|
|
5
|
+
declare const collapsibleDef: ComponentDef<"collapsible", "title" | "root" | "count" | "icon" | "trigger" | "content" | "chevron", "radius" | "trigger-height">;
|
|
6
6
|
declare const collapsibleVariants: VariantFn<{
|
|
7
7
|
readonly variant: readonly ["default", "label"];
|
|
8
8
|
}>;
|