@luxalgo/vela-ui 0.1.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 +89 -0
- package/README.md +5 -2
- package/dist/badge.js +1 -1
- package/dist/bar-chart.js +1 -1
- 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 +6 -1
- package/dist/callout-bubble.js +12 -8
- package/dist/card.d.ts +52 -0
- package/dist/card.js +179 -0
- package/dist/checkbox.js +5 -5
- package/dist/{chunk-X4YPSIW6.js → chunk-5BJV5FY5.js} +1 -1
- package/dist/{chunk-FCO3YZLT.js → chunk-ALAHGSLC.js} +1 -1
- package/dist/{chunk-5QHXOAZA.js → chunk-B2EZB5ZG.js} +4 -4
- package/dist/{chunk-G7IQLY3A.js → chunk-C3PXY2SW.js} +5 -0
- package/dist/chunk-DXDCKZ2M.js +117 -0
- package/dist/{chunk-6NXY62JS.js → chunk-FYVQO5TN.js} +1 -1
- package/dist/{chunk-V6TTTMTE.js → chunk-GVRX3UAV.js} +4 -1
- package/dist/{chunk-XJAPCCOJ.js → chunk-IOOYDSSK.js} +4 -4
- package/dist/{chunk-OBLIX3VN.js → chunk-KKS6NEGI.js} +2 -2
- package/dist/{chunk-SAPURP46.js → chunk-OJ2SEMN6.js} +3 -3
- package/dist/{chunk-2Q4JRINP.js → chunk-OQXFQMZM.js} +3 -3
- package/dist/{chunk-AJ2IYSOI.js → chunk-TBXUF5YX.js} +35 -3
- package/dist/{chunk-ZB3BZHSN.js → chunk-UEO6W37Z.js} +4 -4
- package/dist/{chunk-CH3DV6FD.js → chunk-WWHNUKSZ.js} +5 -5
- package/dist/chunk-XBEL4K33.js +142 -0
- package/dist/collapsible.d.ts +49 -0
- package/dist/collapsible.js +106 -0
- package/dist/color-picker.js +5 -5
- 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 +1 -1
- package/dist/date-picker.js +3 -3
- package/dist/dialog.d.ts +8 -0
- package/dist/dialog.js +15 -5
- package/dist/donut.js +1 -1
- package/dist/drawer.js +2 -2
- package/dist/dropdown-menu.js +4 -4
- package/dist/empty.js +2 -2
- package/dist/field.js +13 -13
- 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/icons.js +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.js +3 -3
- package/dist/input-group.js +4 -3
- package/dist/input.js +2 -2
- package/dist/item.d.ts +72 -0
- package/dist/item.js +131 -0
- package/dist/kbd.js +2 -2
- package/dist/line-chart.js +1 -1
- package/dist/manifest.json +1336 -65
- package/dist/month-grid.d.ts +45 -0
- package/dist/month-grid.js +157 -0
- package/dist/number-input.js +5 -5
- package/dist/popover.js +3 -3
- package/dist/scatter-chart.js +1 -1
- package/dist/select.js +7 -7
- 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.js +1 -1
- package/dist/stat.js +1 -1
- package/dist/switch.js +3 -3
- package/dist/tabs.d.ts +3 -1
- package/dist/tabs.js +13 -8
- package/dist/text-area.js +2 -2
- package/dist/theme-Ct-q58xz.d.ts +341 -0
- package/dist/theme.d.ts +42 -181
- package/dist/theme.js +2 -2
- package/dist/theme.schema.json +541 -1
- package/dist/toast.d.ts +49 -0
- package/dist/toast.js +463 -0
- package/dist/toggle-group.js +4 -4
- package/dist/tooltip.js +2 -2
- package/dist/treemap.d.ts +80 -0
- package/dist/treemap.js +470 -0
- package/docs/theming.md +6 -0
- package/docs/writing-a-component.md +4 -1
- package/llms.txt +11 -3
- package/package.json +1 -1
- package/registry/button.ts +105 -21
- package/registry/callout-bubble.ts +14 -3
- package/registry/card.ts +379 -0
- package/registry/collapsible.ts +271 -0
- package/registry/dialog.ts +16 -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/registry/toast.ts +965 -0
- package/registry/treemap.ts +847 -0
- package/skills/using-vela-ui-components/SKILL.md +14 -9
- package/src/components/button.ts +105 -21
- package/src/components/callout-bubble.ts +14 -3
- package/src/components/card.ts +379 -0
- package/src/components/collapsible.ts +271 -0
- package/src/components/dialog.ts +16 -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/components/toast.ts +965 -0
- package/src/components/treemap.ts +847 -0
- package/src/lib/calendar.ts +5 -0
- package/src/lib/component-index.ts +34 -2
- package/src/lib/css.ts +6 -2
- package/src/lib/icons.ts +7 -0
- package/src/lib/scope.ts +135 -0
- package/src/lib/theme.ts +21 -5
- package/dist/chunk-EZQXTO6K.js +0 -89
- package/dist/chunk-IDA2BT7D.js +0 -29
- package/dist/data-table-DtU3FX9j.d.ts +0 -61
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,95 @@
|
|
|
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
|
+
|
|
47
|
+
## [0.2.0]
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
|
|
51
|
+
- **A slider.** `@luxalgo/vela-ui/slider` holds a value on a track, dragged or moved with the
|
|
52
|
+
arrow keys, Page Up/Down and Home/End. It reports every move, and once a drag ends it
|
|
53
|
+
reports the settled value through `onValueCommit`, the moment for costly work such as a
|
|
54
|
+
replay's seek.
|
|
55
|
+
- **Collapsible sections.** `@luxalgo/vela-ui/collapsible` shows and hides its content from a
|
|
56
|
+
header: a section header with a count (a panel's drawers) or a small group label (a list's
|
|
57
|
+
groups). A button of the host's, such as a row's chevron, can toggle it instead.
|
|
58
|
+
- **List rows.** `@luxalgo/vela-ui/item` is a row of a list (a watchlist, alerts, search
|
|
59
|
+
results): media, a title over a description, figures, and buttons that can stay hidden
|
|
60
|
+
until the row is hovered. A clickable row works with the keyboard and screen readers like
|
|
61
|
+
a button, while the buttons inside it keep their own presses; a row with actions makes its
|
|
62
|
+
text the button, as a button cannot hold other buttons. `createItemGroup` stacks rows, with
|
|
63
|
+
a line between them on request; a labelled group is a `group` to screen readers, or the
|
|
64
|
+
`role` you give it (`listbox` for option rows).
|
|
65
|
+
- **Sort buttons for lists that are not tables.** `@luxalgo/vela-ui/sort-button` is a column
|
|
66
|
+
header that steps through its sort directions on each press, shows the current one with an
|
|
67
|
+
arrow, and says it to screen readers.
|
|
68
|
+
- **A month grid.** `@luxalgo/vela-ui/month-grid` lays out a month of days with a figure each,
|
|
69
|
+
tinted by its tone (a trading journal's P&L by day). Weeks start on the locale's first day,
|
|
70
|
+
and the arrow keys walk the days.
|
|
71
|
+
- **Two-line tabs.** A tab's `description` puts a second line under its label, such as a day
|
|
72
|
+
strip's date under its weekday.
|
|
73
|
+
- **Key caps and favorite stars in buttons.** A button's `keys` and `keysEnd` show key caps
|
|
74
|
+
before or after its text (`↵ Open`). The `favorite` variant is a star that takes the
|
|
75
|
+
favorites color while pressed. A toggle button can now flip itself (`defaultPressed`,
|
|
76
|
+
`onPressedChange`) and show another icon while pressed (`iconPressed`).
|
|
77
|
+
- **A callout panel without a bubble.** `calloutPart(el, part)` makes an element a part of the
|
|
78
|
+
callout bubble's deployed panel (`panel`, `title`, `text`, `actions`, `button`) and gives it
|
|
79
|
+
that part's look, so a panel built elsewhere, such as a chart's timeline-mark popup, matches
|
|
80
|
+
the bubble's, and a theme's `callout-bubble` parts restyle both.
|
|
81
|
+
|
|
82
|
+
### Fixed
|
|
83
|
+
|
|
84
|
+
- **What is on or chosen reads in the theme's selected colors.** A dropdown's switch rows, when
|
|
85
|
+
on, fill like the Switch (`selected.bg`, the knob in `selected.fg`) instead of the accent,
|
|
86
|
+
as does the slider's range and thumb, and a month grid marks today in bright, bold type:
|
|
87
|
+
white on a dark theme, black on a light one.
|
|
88
|
+
- **The kit's styles stay inside the kit.** Once a page created a kit component, the kit's
|
|
89
|
+
styles also reached the page's own components that use the same part names, such as a
|
|
90
|
+
shadcn/ui select, switch or button, and restyled them. A component's styles now apply only
|
|
91
|
+
inside kit hosts (`ensureUIHost`), the menus, dialogs and tooltips they open, and themed
|
|
92
|
+
hosts, so the page's own components keep their look. A component mounted outside any kit
|
|
93
|
+
host gets none of the kit's styles: mount it in one, as the README shows.
|
|
94
|
+
|
|
6
95
|
## [0.1.0]
|
|
7
96
|
|
|
8
97
|
### Added
|
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# @luxalgo/vela-ui
|
|
2
2
|
|
|
3
3
|
The component kit of Vela: buttons, tabs, toggle groups, badges, dialogs, drawers, menus,
|
|
4
|
-
tooltips, popovers
|
|
4
|
+
tooltips, popovers, form controls, collapsible sections, list rows and data components (a
|
|
5
|
+
data table, sort buttons, a month grid, charts). One file per component, Zag state machines for
|
|
5
6
|
behavior, CSS in cascade layers over design tokens, and one typed theme config. It works
|
|
6
7
|
without the chart.
|
|
7
8
|
|
|
@@ -28,7 +29,9 @@ theme)` switches a host to another theme later.
|
|
|
28
29
|
stay behind. A destroyed dialog, drawer or popover releases its content itself.
|
|
29
30
|
- **Styles give way to yours.** Component CSS sits in the `vela.ui` cascade layer, so a
|
|
30
31
|
page's own CSS overrides it without `!important`. Every part carries a `data-slot`;
|
|
31
|
-
variants and sizes are `data-variant` and `data-size`.
|
|
32
|
+
variants and sizes are `data-variant` and `data-size`. The kit's CSS applies inside kit
|
|
33
|
+
hosts only, so the page's own components keep their look, even those that use the same
|
|
34
|
+
part names.
|
|
32
35
|
- **One theme config.** `createTheme` sets the brand color, radius and font, any token by
|
|
33
36
|
name, each component's settings, or a component's whole look; a wrong name fails the
|
|
34
37
|
typecheck. See [Theming](docs/theming.md) and [What to change, and where](docs/what-to-change.md).
|
package/dist/badge.js
CHANGED
|
@@ -2,7 +2,7 @@ import { variants } from './chunk-LZWZV2ZS.js';
|
|
|
2
2
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
3
3
|
import { t } from './chunk-6QCILIT2.js';
|
|
4
4
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
5
|
-
import { css, defineStyles } from './chunk-
|
|
5
|
+
import { css, defineStyles } from './chunk-XBEL4K33.js';
|
|
6
6
|
import './chunk-2GQIZM5Z.js';
|
|
7
7
|
import './chunk-BXMWQIBO.js';
|
|
8
8
|
import './chunk-X66RJAIS.js';
|
package/dist/bar-chart.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { chartFrame, showTip, valueAxis, compactNumber, escapeXml } from './chunk-A2FJ7Y7D.js';
|
|
2
2
|
import { t } from './chunk-6QCILIT2.js';
|
|
3
3
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
4
|
-
import { defineStyles, css } from './chunk-
|
|
4
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
5
5
|
import './chunk-2GQIZM5Z.js';
|
|
6
6
|
import './chunk-BXMWQIBO.js';
|
|
7
7
|
import './chunk-X66RJAIS.js';
|
package/dist/button.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ 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", "root" | "icon", "height" | "font-size-sm" | "radius" | "height-xs" | "height-sm" | "height-lg" | "font-size" | "font-size-xs">;
|
|
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
|
-
readonly variant: readonly ["default", "outline", "secondary", "ghost", "destructive", "link", "up", "down"];
|
|
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"];
|
|
9
9
|
}>;
|
|
10
10
|
type ButtonVariant = (typeof buttonVariants.spec.variant)[number];
|
|
@@ -12,14 +12,27 @@ type ButtonSize = (typeof buttonVariants.spec.size)[number];
|
|
|
12
12
|
interface ButtonProps extends VariantProps<typeof buttonVariants> {
|
|
13
13
|
/** The visible text (the `icon*` sizes show none; `label` names them). */
|
|
14
14
|
text?: string;
|
|
15
|
-
/** Icon id from the kit's registry, before the text (the icon of an `icon*` size).
|
|
15
|
+
/** Icon id from the kit's registry, before the text (the icon of an `icon*` size).
|
|
16
|
+
* `favorite` defaults to `star`. */
|
|
16
17
|
icon?: string;
|
|
18
|
+
/** The icon while pressed (`star-filled` for `star`). `favorite` defaults to `star-filled`. */
|
|
19
|
+
iconPressed?: string;
|
|
17
20
|
/** Icon id after the text (a menu trigger's chevron). */
|
|
18
21
|
iconEnd?: string;
|
|
22
|
+
/** Key caps before the text, one per key (`['↑', '↓']`). */
|
|
23
|
+
keys?: readonly string[];
|
|
24
|
+
/** Key caps after the text. */
|
|
25
|
+
keysEnd?: readonly string[];
|
|
19
26
|
/** Accessible name; required for the `icon*` sizes, defaults to `text`. */
|
|
20
27
|
label?: string;
|
|
21
|
-
/** A toggle
|
|
28
|
+
/** A controlled toggle's state (`aria-pressed`): a press only calls `onPressedChange`, and
|
|
29
|
+
* `setPressed` moves it. Omitted with `defaultPressed` and `onPressedChange`: not a toggle. */
|
|
22
30
|
pressed?: boolean;
|
|
31
|
+
/** An uncontrolled toggle's first state: a press flips it and calls `onPressedChange`. */
|
|
32
|
+
defaultPressed?: boolean;
|
|
33
|
+
/** A press asked for this state (a toggle without `pressed` or `defaultPressed` starts
|
|
34
|
+
* unpressed). */
|
|
35
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
23
36
|
disabled?: boolean;
|
|
24
37
|
onClick?: (e: MouseEvent) => void;
|
|
25
38
|
/** Extra class names (layout hooks). */
|
|
@@ -28,6 +41,7 @@ interface ButtonProps extends VariantProps<typeof buttonVariants> {
|
|
|
28
41
|
interface ButtonHandle {
|
|
29
42
|
readonly el: HTMLButtonElement;
|
|
30
43
|
readonly pressed: boolean | undefined;
|
|
44
|
+
/** Show a toggle's state, without calling `onPressedChange`. */
|
|
31
45
|
setPressed(pressed: boolean): void;
|
|
32
46
|
setDisabled(disabled: boolean): void;
|
|
33
47
|
/** New text (or, for an `icon*` size, a new accessible name). */
|
package/dist/button.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export { BUTTON_CSS, BUTTON_STYLE_ID, buttonDef, buttonVariants, createButton } from './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';
|
|
2
4
|
import './chunk-LZWZV2ZS.js';
|
|
3
|
-
import './chunk-G7IQLY3A.js';
|
|
4
5
|
import './chunk-Q6WTDVH6.js';
|
|
5
6
|
import './chunk-6QCILIT2.js';
|
|
6
7
|
import './chunk-VMCR3S2A.js';
|
|
7
|
-
import './chunk-
|
|
8
|
+
import './chunk-XBEL4K33.js';
|
|
8
9
|
import './chunk-2GQIZM5Z.js';
|
|
9
10
|
import './chunk-BXMWQIBO.js';
|
|
10
11
|
import './chunk-X66RJAIS.js';
|
package/dist/calendar.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ declare function calendarSettings(i18n: Translator | null | undefined): Calendar
|
|
|
12
12
|
declare function monthNames(settings: CalendarSettings, width: 'long' | 'short'): string[];
|
|
13
13
|
/** Seven short weekday names, Sunday first (index = `Date#getDay()`). */
|
|
14
14
|
declare function weekdayNames(settings: CalendarSettings): string[];
|
|
15
|
+
/** A day in words, for a screen reader (`Friday, November 6, 2026`). `month` counts from 0. */
|
|
16
|
+
declare function longDate(settings: CalendarSettings, year: number, month: number, day: number): string;
|
|
15
17
|
/** A year as a header label (`2026`, `2026年`). */
|
|
16
18
|
declare function yearLabel(settings: CalendarSettings, year: number): string;
|
|
17
19
|
/** An integer in the settings' digits, without grouping (`2026`, `٢٠٢٦`). */
|
|
@@ -19,4 +21,4 @@ declare function plainInteger(settings: CalendarSettings, n: number): string;
|
|
|
19
21
|
/** Whether the locale writes the year before the month (`2026年9月`, not `September 2026`). */
|
|
20
22
|
declare function yearBeforeMonth(settings: CalendarSettings): boolean;
|
|
21
23
|
|
|
22
|
-
export { type CalendarSettings, calendarSettings, monthNames, plainInteger, weekdayNames, yearBeforeMonth, yearLabel };
|
|
24
|
+
export { type CalendarSettings, calendarSettings, longDate, monthNames, plainInteger, weekdayNames, yearBeforeMonth, yearLabel };
|
package/dist/calendar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { calendarSettings, monthNames, plainInteger, weekdayNames, yearBeforeMonth, yearLabel } from './chunk-
|
|
1
|
+
export { calendarSettings, longDate, monthNames, plainInteger, weekdayNames, yearBeforeMonth, yearLabel } from './chunk-GVRX3UAV.js';
|
package/dist/callout-bubble.d.ts
CHANGED
|
@@ -73,6 +73,11 @@ interface CalloutBubbleOptions extends CalloutBubbleSpec, PlacementProps {
|
|
|
73
73
|
type CalloutBubbleProps = CalloutBubbleOptions;
|
|
74
74
|
declare const CALLOUT_STYLE_ID = "vela-ui-callout-bubble";
|
|
75
75
|
declare const CALLOUT_CSS: string;
|
|
76
|
+
/** A part of the deployed panel, as {@link calloutPart} gives it. */
|
|
77
|
+
type CalloutPanelPart = Exclude<(typeof calloutBubbleDef.parts)[number], 'root'>;
|
|
78
|
+
/** Make `el` a part of a deployed panel, with the panel's look: for a panel built without a
|
|
79
|
+
* bubble, such as a chart's timeline-mark popup. Returns `el`. */
|
|
80
|
+
declare function calloutPart<E extends HTMLElement>(el: E, part: CalloutPanelPart): E;
|
|
76
81
|
declare class CalloutBubble {
|
|
77
82
|
readonly el: HTMLElement;
|
|
78
83
|
private spec;
|
|
@@ -95,4 +100,4 @@ declare class CalloutBubble {
|
|
|
95
100
|
}
|
|
96
101
|
declare function createCalloutBubble(props: CalloutBubbleProps): CalloutBubble;
|
|
97
102
|
|
|
98
|
-
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, type CalloutBubbleOptions, type CalloutBubbleProps, type CalloutBubbleSpec, type CalloutPanel, type CalloutPanelItem, type CalloutPanelRow, calloutBubbleDef, calloutPanelRows, closesPanel, createCalloutBubble };
|
|
103
|
+
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, type CalloutBubbleOptions, type CalloutBubbleProps, type CalloutBubbleSpec, type CalloutPanel, type CalloutPanelItem, type CalloutPanelPart, type CalloutPanelRow, calloutBubbleDef, calloutPanelRows, calloutPart, closesPanel, createCalloutBubble };
|
package/dist/callout-bubble.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Popover } from './chunk-
|
|
2
|
-
import { iconAt } from './chunk-G7IQLY3A.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';
|
|
10
|
-
import './chunk-
|
|
9
|
+
import { iconAt } from './chunk-C3PXY2SW.js';
|
|
10
|
+
import { addSlot } from './chunk-Q6WTDVH6.js';
|
|
11
11
|
import { t } from './chunk-6QCILIT2.js';
|
|
12
12
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
13
|
-
import { css, defineStyles } from './chunk-
|
|
13
|
+
import { css, defineStyles } from './chunk-XBEL4K33.js';
|
|
14
14
|
import './chunk-2GQIZM5Z.js';
|
|
15
15
|
import './chunk-BXMWQIBO.js';
|
|
16
16
|
import './chunk-X66RJAIS.js';
|
|
@@ -40,6 +40,11 @@ var calloutBubbleDef = defineComponent({
|
|
|
40
40
|
var CALLOUT_STYLE_ID = "vela-ui-callout-bubble";
|
|
41
41
|
var CALLOUT_CSS = css`@layer vela.ui{[data-slot=callout-bubble]{box-sizing:border-box;cursor:default;-webkit-user-select:none;user-select:none;border-radius:50%;flex:none;place-items:center;line-height:0}[data-slot=callout-bubble]:where(:not([hidden])){display:inline-grid}[data-slot=callout-bubble][role=button]{cursor:pointer}[data-slot=callout-bubble] svg{display:block}[data-slot=callout-bubble-panel]{box-sizing:border-box;background:${t.surface.elev};border:1px solid ${t.border.strong};border-radius:${calloutBubbleDef.vars["panel-radius"]};max-width:280px;box-shadow:${t.shadow};color:${t.fg};font:${t.fontSize.md} ${t.font};flex-direction:column;gap:8px;padding:10px 12px;display:flex}[data-slot=callout-bubble-title]{color:${t.fg.bright};font-weight:600}[data-slot=callout-bubble-text]{color:${t.fg.muted};white-space:pre-line;line-height:1.45}[data-slot=callout-bubble-actions]{flex-wrap:wrap;gap:8px;display:flex}[data-slot=callout-bubble-button]{cursor:pointer;border-radius:${calloutBubbleDef.vars["button-radius"]};border:1px solid ${t.border};height:26px;color:${t.fg};font-size:${t.fontSize.md};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 10px;font-family:inherit}[data-slot=callout-bubble-button]:where([data-primary]){border-color:${t.selected.bg};background:${t.selected.bg};color:${t.selected.fg}}[data-slot=callout-bubble-button]:hover{background:${t.hover};color:${t.fg.bright};border-color:${t.fg.muted}}[data-slot=callout-bubble-button]:where([data-primary]):hover{background:${t.selected.bg};color:${t.selected.fg};opacity:.85;border-color:${t.selected.bg}}}`;
|
|
42
42
|
var injectStyles = defineStyles(CALLOUT_STYLE_ID, CALLOUT_CSS);
|
|
43
|
+
function calloutPart(el, part) {
|
|
44
|
+
injectStyles(el.ownerDocument);
|
|
45
|
+
addSlot(el, calloutBubbleDef.slot(part));
|
|
46
|
+
return el;
|
|
47
|
+
}
|
|
43
48
|
var CalloutBubble = class {
|
|
44
49
|
constructor(opts) {
|
|
45
50
|
this.pop = null;
|
|
@@ -133,8 +138,7 @@ var CalloutBubble = class {
|
|
|
133
138
|
const part = (tag, className, name) => {
|
|
134
139
|
const el = doc.createElement(tag);
|
|
135
140
|
el.className = className;
|
|
136
|
-
el
|
|
137
|
-
return el;
|
|
141
|
+
return calloutPart(el, name);
|
|
138
142
|
};
|
|
139
143
|
const root = part("div", "vela-callout-panel", "panel");
|
|
140
144
|
if (panel.title) {
|
|
@@ -170,4 +174,4 @@ function createCalloutBubble(props) {
|
|
|
170
174
|
return new CalloutBubble(props);
|
|
171
175
|
}
|
|
172
176
|
|
|
173
|
-
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, calloutBubbleDef, calloutPanelRows, closesPanel, createCalloutBubble };
|
|
177
|
+
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, calloutBubbleDef, calloutPanelRows, calloutPart, closesPanel, createCalloutBubble };
|
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';
|
|
4
|
-
import './chunk-P4MTEMT7.js';
|
|
1
|
+
export { Checkbox, checkboxController, checkboxDef, checkboxVariants, createCheckbox } from './chunk-IOOYDSSK.js';
|
|
5
2
|
import './chunk-A72NWYNP.js';
|
|
3
|
+
import './chunk-P4MTEMT7.js';
|
|
4
|
+
import './chunk-C3PXY2SW.js';
|
|
5
|
+
import './chunk-LZWZV2ZS.js';
|
|
6
6
|
import './chunk-Q6WTDVH6.js';
|
|
7
7
|
import './chunk-6QCILIT2.js';
|
|
8
8
|
import './chunk-VMCR3S2A.js';
|
|
9
|
-
import './chunk-
|
|
9
|
+
import './chunk-XBEL4K33.js';
|
|
10
10
|
import './chunk-2GQIZM5Z.js';
|
|
11
11
|
import './chunk-BXMWQIBO.js';
|
|
12
12
|
import './chunk-X66RJAIS.js';
|
|
@@ -2,7 +2,7 @@ import { variants } from './chunk-LZWZV2ZS.js';
|
|
|
2
2
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
3
3
|
import { t } from './chunk-6QCILIT2.js';
|
|
4
4
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
5
|
-
import { css, defineStyles } from './chunk-
|
|
5
|
+
import { css, defineStyles } from './chunk-XBEL4K33.js';
|
|
6
6
|
|
|
7
7
|
// src/components/input.ts
|
|
8
8
|
function inputController(opts = {}) {
|
|
@@ -2,7 +2,7 @@ import { variants } from './chunk-LZWZV2ZS.js';
|
|
|
2
2
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
3
3
|
import { t } from './chunk-6QCILIT2.js';
|
|
4
4
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
5
|
-
import { defineStyles, css } from './chunk-
|
|
5
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
6
6
|
|
|
7
7
|
// src/components/text-area.ts
|
|
8
8
|
function textAreaController(opts = {}) {
|
|
@@ -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
10
|
import { t } from './chunk-6QCILIT2.js';
|
|
11
11
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
12
|
-
import { defineStyles, css } from './chunk-
|
|
12
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
13
13
|
import * as zagMenu from '@zag-js/menu';
|
|
14
14
|
|
|
15
15
|
function dropdownMenuController(opts) {
|
|
@@ -35,7 +35,7 @@ var dropdownMenuDef = defineComponent({
|
|
|
35
35
|
});
|
|
36
36
|
var injectStyles = defineStyles(
|
|
37
37
|
"vela-ui-menu",
|
|
38
|
-
css`@layer vela.ui{[data-slot~=dropdown-menu-content]{background:${t.surface};color:${t.fg};border:1px solid ${t.border.strong};border-radius:${dropdownMenuDef.vars.radius};box-shadow:${t.shadow};min-width:180px;max-height:min(60vh, var(--available-height,60vh));z-index:${t.z.menu};outline:2px solid #0000;margin:0;padding:6px;font-size:13px;list-style:none;overflow-y:auto}[data-slot~=dropdown-menu-content][data-state=open]{animation:vela-menu-in ${t.dur.fast} ${t.ease}}@keyframes vela-menu-in{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}[data-slot~=dropdown-menu-item]{border-radius:${t.radius.sm};cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;align-items:center;gap:10px;padding:7px 10px;display:flex}[data-slot~=dropdown-menu-item][data-highlighted]{background:${t.hover}}[data-slot~=dropdown-menu-item][data-disabled]{opacity:.4;cursor:default}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-icon]{width:16px;height:16px;color:${t.fg.muted};justify-content:center;font-size:16px}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-label]{flex:auto}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-hint]{color:${t.fg.faint};font-size:${t.fontSize.sm}}[data-slot~=dropdown-menu-item][data-checked]{background:${t.hover.strong};color:${t.fg.bright}}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-mark]{flex:none;justify-content:center;align-items:center;width:14px;display:inline-flex}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-mark] [data-slot~=dropdown-menu-icon]{width:14px;height:14px;color:${t.fg.bright};font-size:14px}[data-slot~=dropdown-menu-item][data-checkmark]{color:${t.fg.bright}}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-badge]{box-sizing:border-box;border-radius:${t.radius.md};background:${t.hover};border:1px solid ${t.border};width:24px;height:24px;color:${t.fg.muted};transition:background ${t.dur.fast} ${t.ease}, border-color ${t.dur.fast} ${t.ease}, color ${t.dur.fast} ${t.ease};flex:none;justify-content:center;align-items:center;padding:3px;display:inline-flex}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-badge]:empty{background:0 0;border-color:#0000}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-badge] [data-slot~=dropdown-menu-icon]{color:inherit}[data-slot~=dropdown-menu-item][data-highlighted] [data-slot~=dropdown-menu-badge]:not(:empty){color:${t.fg.bright}}[data-slot~=dropdown-menu-item][data-checked] [data-slot~=dropdown-menu-badge]:not(:empty),[data-slot~=dropdown-menu-item][data-checkmark] [data-slot~=dropdown-menu-badge]:not(:empty){background:color-mix(in srgb, ${t.fg.bright} 83%, ${t.surface});border-color:color-mix(in srgb, ${t.fg.bright} 40%, transparent);color:${t.surface}}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-star]{border-radius:${t.radius.sm};opacity:0;width:26px;height:22px;transition:opacity ${t.dur.fast} ease, background ${t.dur.fast} ease;order:98;margin-block:-3px;margin-inline:0 -5px;padding:3px 5px}[data-slot~=dropdown-menu-item][data-highlighted] [data-slot~=dropdown-menu-star]{opacity:.55}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-star]:hover{opacity:1;background:${t.hover.strong}}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-star][data-fav]{opacity:.95;color:${t.highlight}}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-arrow]{width:12px;color:${t.fg.faint};flex:none;order:99;margin-inline-start:auto;font-size:11px}[data-slot~=dropdown-menu-item][data-state=open]{background:${t.hover}}[data-slot~=dropdown-menu-content][data-badges]>[data-slot~=dropdown-menu-item]{padding-block:5px;padding-inline:6px 10px}[data-slot~=dropdown-menu-switch]{border-radius:${dropdownMenuDef.vars["switch-radius"]};background:${t.surface.overlay};border:1px solid ${t.border.soft};width:34px;height:18px;transition:background ${t.dur.med} ease, border-color ${t.dur.med} ease;flex:none;order:99;margin-inline-start:auto;position:relative}[data-slot~=dropdown-menu-switch]:after{content:"";top:2px;background:${t.fg.muted};width:12px;height:12px;transition:transform ${t.dur.med} ease, background ${t.dur.med} ease;border-radius:50%;position:absolute;inset-inline-start:2px}[data-slot~=dropdown-menu-switch][data-on]{background
|
|
38
|
+
css`@layer vela.ui{[data-slot~=dropdown-menu-content]{background:${t.surface};color:${t.fg};border:1px solid ${t.border.strong};border-radius:${dropdownMenuDef.vars.radius};box-shadow:${t.shadow};min-width:180px;max-height:min(60vh, var(--available-height,60vh));z-index:${t.z.menu};outline:2px solid #0000;margin:0;padding:6px;font-size:13px;list-style:none;overflow-y:auto}[data-slot~=dropdown-menu-content][data-state=open]{animation:vela-menu-in ${t.dur.fast} ${t.ease}}@keyframes vela-menu-in{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}[data-slot~=dropdown-menu-item]{border-radius:${t.radius.sm};cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;align-items:center;gap:10px;padding:7px 10px;display:flex}[data-slot~=dropdown-menu-item][data-highlighted]{background:${t.hover}}[data-slot~=dropdown-menu-item][data-disabled]{opacity:.4;cursor:default}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-icon]{width:16px;height:16px;color:${t.fg.muted};justify-content:center;font-size:16px}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-label]{flex:auto}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-hint]{color:${t.fg.faint};font-size:${t.fontSize.sm}}[data-slot~=dropdown-menu-item][data-checked]{background:${t.hover.strong};color:${t.fg.bright}}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-mark]{flex:none;justify-content:center;align-items:center;width:14px;display:inline-flex}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-mark] [data-slot~=dropdown-menu-icon]{width:14px;height:14px;color:${t.fg.bright};font-size:14px}[data-slot~=dropdown-menu-item][data-checkmark]{color:${t.fg.bright}}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-badge]{box-sizing:border-box;border-radius:${t.radius.md};background:${t.hover};border:1px solid ${t.border};width:24px;height:24px;color:${t.fg.muted};transition:background ${t.dur.fast} ${t.ease}, border-color ${t.dur.fast} ${t.ease}, color ${t.dur.fast} ${t.ease};flex:none;justify-content:center;align-items:center;padding:3px;display:inline-flex}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-badge]:empty{background:0 0;border-color:#0000}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-badge] [data-slot~=dropdown-menu-icon]{color:inherit}[data-slot~=dropdown-menu-item][data-highlighted] [data-slot~=dropdown-menu-badge]:not(:empty){color:${t.fg.bright}}[data-slot~=dropdown-menu-item][data-checked] [data-slot~=dropdown-menu-badge]:not(:empty),[data-slot~=dropdown-menu-item][data-checkmark] [data-slot~=dropdown-menu-badge]:not(:empty){background:color-mix(in srgb, ${t.fg.bright} 83%, ${t.surface});border-color:color-mix(in srgb, ${t.fg.bright} 40%, transparent);color:${t.surface}}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-star]{border-radius:${t.radius.sm};opacity:0;width:26px;height:22px;transition:opacity ${t.dur.fast} ease, background ${t.dur.fast} ease;order:98;margin-block:-3px;margin-inline:0 -5px;padding:3px 5px}[data-slot~=dropdown-menu-item][data-highlighted] [data-slot~=dropdown-menu-star]{opacity:.55}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-star]:hover{opacity:1;background:${t.hover.strong}}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-star][data-fav]{opacity:.95;color:${t.highlight}}[data-slot~=dropdown-menu-item] [data-slot~=dropdown-menu-arrow]{width:12px;color:${t.fg.faint};flex:none;order:99;margin-inline-start:auto;font-size:11px}[data-slot~=dropdown-menu-item][data-state=open]{background:${t.hover}}[data-slot~=dropdown-menu-content][data-badges]>[data-slot~=dropdown-menu-item]{padding-block:5px;padding-inline:6px 10px}[data-slot~=dropdown-menu-switch]{border-radius:${dropdownMenuDef.vars["switch-radius"]};background:${t.surface.overlay};border:1px solid ${t.border.soft};width:34px;height:18px;transition:background ${t.dur.med} ease, border-color ${t.dur.med} ease;flex:none;order:99;margin-inline-start:auto;position:relative}[data-slot~=dropdown-menu-switch]:after{content:"";top:2px;background:${t.fg.muted};width:12px;height:12px;transition:transform ${t.dur.med} ease, background ${t.dur.med} ease;border-radius:50%;position:absolute;inset-inline-start:2px}[data-slot~=dropdown-menu-switch][data-on]{background:${t.selected.bg};border-color:${t.selected.bg}}[data-slot~=dropdown-menu-switch][data-on]:after{background:${t.selected.fg};transform:translate(16px)}[data-slot~=dropdown-menu-separator]{background:${t.border};height:1px;margin:4px 6px}}`
|
|
39
39
|
);
|
|
40
40
|
function menuIcon(id, doc) {
|
|
41
41
|
const el = iconEl(id, doc);
|
|
@@ -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"'));
|