@luxalgo/vela-ui 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/README.md +5 -2
- package/dist/badge.js +2 -2
- package/dist/bar-chart.d.ts +1 -1
- package/dist/bar-chart.js +2 -2
- package/dist/button.d.ts +18 -4
- package/dist/button.js +4 -3
- package/dist/calendar.d.ts +3 -1
- package/dist/calendar.js +1 -1
- package/dist/callout-bubble.d.ts +7 -2
- package/dist/callout-bubble.js +12 -8
- package/dist/checkbox.js +4 -4
- package/dist/{chunk-SAPURP46.js → chunk-7VMN7NKJ.js} +3 -3
- package/dist/{chunk-OBLIX3VN.js → chunk-B5ZSRUDQ.js} +3 -3
- package/dist/{chunk-6NXY62JS.js → chunk-C3ICYMI3.js} +2 -2
- package/dist/chunk-CC3DDNFC.js +117 -0
- package/dist/{chunk-FCO3YZLT.js → chunk-E2FE6V2N.js} +2 -2
- package/dist/{chunk-V6TTTMTE.js → chunk-GVRX3UAV.js} +4 -1
- package/dist/{chunk-2Q4JRINP.js → chunk-MJ4RUGX7.js} +4 -4
- package/dist/{chunk-X4YPSIW6.js → chunk-U3EH42YY.js} +2 -2
- package/dist/{chunk-AJ2IYSOI.js → chunk-V2Q4MRMS.js} +23 -3
- package/dist/{chunk-XJAPCCOJ.js → chunk-WBGSYCV2.js} +3 -3
- package/dist/{chunk-5QHXOAZA.js → chunk-WGULXRWD.js} +4 -4
- package/dist/{chunk-ZB3BZHSN.js → chunk-WXH3EFV5.js} +3 -3
- package/dist/chunk-XBEL4K33.js +142 -0
- package/dist/{chunk-CH3DV6FD.js → chunk-Z5PINFQO.js} +4 -4
- package/dist/collapsible.d.ts +49 -0
- package/dist/collapsible.js +106 -0
- package/dist/color-picker.js +6 -6
- package/dist/context-menu.js +5 -5
- package/dist/css.d.ts +3 -1
- package/dist/css.js +1 -1
- package/dist/data-table.d.ts +39 -2
- package/dist/data-table.js +2 -2
- package/dist/date-picker.d.ts +1 -1
- package/dist/date-picker.js +3 -3
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.js +5 -5
- package/dist/donut.d.ts +1 -1
- package/dist/donut.js +2 -2
- package/dist/drawer.d.ts +1 -1
- package/dist/drawer.js +3 -3
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/dropdown-menu.js +4 -4
- package/dist/empty.d.ts +1 -1
- package/dist/empty.js +2 -2
- package/dist/field.js +12 -12
- package/dist/glyph-select.js +5 -5
- package/dist/h-Bl37qUis.d.ts +24 -0
- package/dist/hover-card.d.ts +1 -1
- package/dist/hover-card.js +3 -3
- package/dist/index.d.ts +7 -1
- package/dist/index.js +3 -3
- package/dist/input-group.d.ts +1 -1
- package/dist/input-group.js +4 -3
- package/dist/input.js +3 -3
- package/dist/item.d.ts +72 -0
- package/dist/item.js +131 -0
- package/dist/kbd.d.ts +1 -1
- package/dist/kbd.js +3 -3
- package/dist/line-chart.d.ts +1 -1
- package/dist/line-chart.js +2 -2
- package/dist/manifest.json +665 -11
- package/dist/month-grid.d.ts +45 -0
- package/dist/month-grid.js +157 -0
- package/dist/number-input.d.ts +1 -1
- package/dist/number-input.js +4 -4
- package/dist/popover.js +4 -4
- package/dist/scatter-chart.d.ts +1 -1
- package/dist/scatter-chart.js +2 -2
- package/dist/select.js +6 -6
- package/dist/slider.d.ts +46 -0
- package/dist/slider.js +111 -0
- package/dist/sort-button.d.ts +41 -0
- package/dist/sort-button.js +88 -0
- package/dist/sparkline.d.ts +1 -1
- package/dist/sparkline.js +2 -2
- package/dist/stat.d.ts +1 -1
- package/dist/stat.js +2 -2
- package/dist/switch.d.ts +1 -1
- package/dist/switch.js +3 -3
- package/dist/tabs.d.ts +3 -1
- package/dist/tabs.js +12 -7
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js +3 -3
- package/dist/theme.d.ts +17 -6
- package/dist/theme.js +2 -2
- package/dist/theme.schema.json +250 -1
- package/dist/toggle-group.d.ts +1 -1
- package/dist/toggle-group.js +3 -3
- package/dist/tooltip.js +3 -3
- package/docs/theming.md +6 -0
- package/docs/writing-a-component.md +4 -1
- package/llms.txt +8 -3
- package/package.json +1 -1
- package/registry/button.ts +97 -21
- package/registry/callout-bubble.ts +14 -3
- package/registry/collapsible.ts +271 -0
- package/registry/dropdown-menu.ts +3 -3
- package/registry/item.ts +376 -0
- package/registry/month-grid.ts +328 -0
- package/registry/slider.ts +259 -0
- package/registry/sort-button.ts +189 -0
- package/registry/tabs.ts +38 -4
- package/skills/using-vela-ui-components/SKILL.md +12 -9
- package/src/components/button.ts +97 -21
- package/src/components/callout-bubble.ts +14 -3
- package/src/components/collapsible.ts +271 -0
- package/src/components/dropdown-menu.ts +3 -3
- package/src/components/item.ts +376 -0
- package/src/components/month-grid.ts +328 -0
- package/src/components/slider.ts +259 -0
- package/src/components/sort-button.ts +189 -0
- package/src/components/tabs.ts +38 -4
- package/src/lib/calendar.ts +5 -0
- package/src/lib/component-index.ts +22 -2
- package/src/lib/css.ts +6 -2
- package/src/lib/scope.ts +135 -0
- package/src/lib/theme.ts +15 -5
- package/dist/chunk-EZQXTO6K.js +0 -89
- package/dist/chunk-IDA2BT7D.js +0 -29
- package/dist/data-table-DtU3FX9j.d.ts +0 -61
package/dist/dropdown-menu.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export { DropdownMenu, createDropdownMenu, dropdownMenuController, dropdownMenuDef } from './chunk-
|
|
1
|
+
export { DropdownMenu, createDropdownMenu, dropdownMenuController, dropdownMenuDef } from './chunk-WGULXRWD.js';
|
|
2
2
|
import './chunk-G7IQLY3A.js';
|
|
3
3
|
import './chunk-FVH6L7FM.js';
|
|
4
4
|
import './chunk-FN2BUFNM.js';
|
|
5
5
|
import './chunk-J2QJATCD.js';
|
|
6
6
|
import './chunk-S7USVSYP.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-V2Q4MRMS.js';
|
|
8
8
|
import './chunk-TAKSIV57.js';
|
|
9
9
|
import './chunk-MMTMOV6R.js';
|
|
10
10
|
import './chunk-3Q32K4PE.js';
|
|
11
11
|
import './chunk-P4MTEMT7.js';
|
|
12
12
|
import './chunk-Q6WTDVH6.js';
|
|
13
|
-
import './chunk-6QCILIT2.js';
|
|
14
13
|
import './chunk-VMCR3S2A.js';
|
|
15
|
-
import './chunk-
|
|
14
|
+
import './chunk-XBEL4K33.js';
|
|
16
15
|
import './chunk-2GQIZM5Z.js';
|
|
17
16
|
import './chunk-BXMWQIBO.js';
|
|
18
17
|
import './chunk-X66RJAIS.js';
|
|
18
|
+
import './chunk-6QCILIT2.js';
|
package/dist/empty.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 emptyDef: ComponentDef<"empty", "
|
|
4
|
+
declare const emptyDef: ComponentDef<"empty", "root" | "title" | "icon" | "description", "icon-radius">;
|
|
5
5
|
interface EmptyProps {
|
|
6
6
|
/** Icon id from the kit's registry, shown in a tile above the title. */
|
|
7
7
|
icon?: string;
|
package/dist/empty.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { iconEl } from './chunk-G7IQLY3A.js';
|
|
2
2
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
3
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
4
3
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
5
|
-
import { defineStyles, css } from './chunk-
|
|
4
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
6
5
|
import './chunk-2GQIZM5Z.js';
|
|
7
6
|
import './chunk-BXMWQIBO.js';
|
|
8
7
|
import './chunk-X66RJAIS.js';
|
|
8
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
9
9
|
|
|
10
10
|
// src/components/empty.ts
|
|
11
11
|
var emptyDef = defineComponent({
|
package/dist/field.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { Checkbox } from './chunk-
|
|
1
|
+
import { TextArea } from './chunk-E2FE6V2N.js';
|
|
2
|
+
import { NumberInput } from './chunk-WXH3EFV5.js';
|
|
3
|
+
import { Select } from './chunk-Z5PINFQO.js';
|
|
4
|
+
import { widthField } from './chunk-7VMN7NKJ.js';
|
|
5
|
+
import { Input } from './chunk-U3EH42YY.js';
|
|
6
|
+
import { Checkbox } from './chunk-WBGSYCV2.js';
|
|
7
7
|
import './chunk-LZWZV2ZS.js';
|
|
8
|
-
import { ColorField } from './chunk-2Q4JRINP.js';
|
|
9
|
-
import './chunk-OBLIX3VN.js';
|
|
10
8
|
import './chunk-G7IQLY3A.js';
|
|
9
|
+
import { ColorField } from './chunk-MJ4RUGX7.js';
|
|
11
10
|
import './chunk-FVH6L7FM.js';
|
|
12
11
|
import './chunk-FN2BUFNM.js';
|
|
12
|
+
import './chunk-B5ZSRUDQ.js';
|
|
13
13
|
import './chunk-J2QJATCD.js';
|
|
14
14
|
import './chunk-S7USVSYP.js';
|
|
15
|
-
import './chunk-
|
|
15
|
+
import './chunk-V2Q4MRMS.js';
|
|
16
16
|
import './chunk-TAKSIV57.js';
|
|
17
17
|
import './chunk-MMTMOV6R.js';
|
|
18
18
|
import './chunk-3Q32K4PE.js';
|
|
19
|
-
import './chunk-P4MTEMT7.js';
|
|
20
19
|
import { disposeWithin } from './chunk-A72NWYNP.js';
|
|
20
|
+
import './chunk-P4MTEMT7.js';
|
|
21
21
|
import './chunk-Q6WTDVH6.js';
|
|
22
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
23
22
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
24
|
-
import { defineStyles, css } from './chunk-
|
|
23
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
25
24
|
import { injectStyles } from './chunk-2GQIZM5Z.js';
|
|
26
25
|
import './chunk-BXMWQIBO.js';
|
|
27
26
|
import './chunk-X66RJAIS.js';
|
|
27
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
28
28
|
|
|
29
29
|
// src/components/field.ts
|
|
30
30
|
var FIELD_GAP_PX = 16;
|
package/dist/glyph-select.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { GlyphSelect, WIDTH_FIELD_OPTIONS, closeWidthPopover, createGlyphSelect, glyphSelectController, glyphSelectDef, lineWidthGlyph, widthField, widthFieldOptions } from './chunk-
|
|
2
|
-
import './chunk-OBLIX3VN.js';
|
|
1
|
+
export { GlyphSelect, WIDTH_FIELD_OPTIONS, closeWidthPopover, createGlyphSelect, glyphSelectController, glyphSelectDef, lineWidthGlyph, widthField, widthFieldOptions } from './chunk-7VMN7NKJ.js';
|
|
3
2
|
import './chunk-G7IQLY3A.js';
|
|
3
|
+
import './chunk-B5ZSRUDQ.js';
|
|
4
4
|
import './chunk-J2QJATCD.js';
|
|
5
5
|
import './chunk-S7USVSYP.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-V2Q4MRMS.js';
|
|
7
7
|
import './chunk-TAKSIV57.js';
|
|
8
8
|
import './chunk-MMTMOV6R.js';
|
|
9
9
|
import './chunk-3Q32K4PE.js';
|
|
10
10
|
import './chunk-A72NWYNP.js';
|
|
11
11
|
import './chunk-Q6WTDVH6.js';
|
|
12
|
-
import './chunk-6QCILIT2.js';
|
|
13
12
|
import './chunk-VMCR3S2A.js';
|
|
14
|
-
import './chunk-
|
|
13
|
+
import './chunk-XBEL4K33.js';
|
|
15
14
|
import './chunk-2GQIZM5Z.js';
|
|
16
15
|
import './chunk-BXMWQIBO.js';
|
|
17
16
|
import './chunk-X66RJAIS.js';
|
|
17
|
+
import './chunk-6QCILIT2.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type Child = Node | string | number | null | undefined | false | readonly Child[];
|
|
2
|
+
type AttrValue = string | number | boolean | null | undefined;
|
|
3
|
+
interface ElementProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
/** The part's `data-slot` (take it from the component's `defineComponent`). */
|
|
6
|
+
slot?: string;
|
|
7
|
+
/** `data-*` attributes (`{ icon: 'inline-start' }` → `data-icon="inline-start"`). `true`
|
|
8
|
+
* writes an empty value; `false`, `null` and `undefined` write nothing. */
|
|
9
|
+
data?: Record<string, AttrValue>;
|
|
10
|
+
/** Plain attributes, with the same value rules as `data`. */
|
|
11
|
+
attrs?: Record<string, AttrValue>;
|
|
12
|
+
style?: string;
|
|
13
|
+
text?: string;
|
|
14
|
+
on?: {
|
|
15
|
+
[K in keyof HTMLElementEventMap]?: (e: HTMLElementEventMap[K]) => void;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
declare function h<K extends keyof HTMLElementTagNameMap>(tag: K, props?: ElementProps, ...children: Child[]): HTMLElementTagNameMap[K];
|
|
19
|
+
declare function append(el: Node, children: readonly Child[]): void;
|
|
20
|
+
/** Add a part to an element's slot, keeping the ones it has: a shell one component owns and
|
|
21
|
+
* another builds on carries both (`data-slot="popover-content select-content"`). */
|
|
22
|
+
declare function addSlot(el: Element, slot: string): void;
|
|
23
|
+
|
|
24
|
+
export { type Child as C, type ElementProps as E, addSlot as a, append as b, h };
|
package/dist/hover-card.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { C as ComponentDef } from './define-D5u3F5Dj.js';
|
|
|
2
2
|
import { PlacementProps, Side } from './placement.js';
|
|
3
3
|
import './t.js';
|
|
4
4
|
|
|
5
|
-
declare const hoverCardDef: ComponentDef<"hover-card", "
|
|
5
|
+
declare const hoverCardDef: ComponentDef<"hover-card", "root" | "body" | "title" | "icon" | "description" | "heading" | "hint", "radius" | "shadow" | "width" | "icon-radius" | "wide-width">;
|
|
6
6
|
interface HoverCardContent {
|
|
7
7
|
title: string;
|
|
8
8
|
description?: string;
|
package/dist/hover-card.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { shortcutKeys } from './chunk-
|
|
1
|
+
import { shortcutKeys } from './chunk-C3ICYMI3.js';
|
|
2
2
|
import { iconEl } from './chunk-G7IQLY3A.js';
|
|
3
3
|
import { viewportRect, placePopover, intersectRects } from './chunk-3Q32K4PE.js';
|
|
4
4
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
5
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
6
5
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
7
|
-
import { defineStyles, css } from './chunk-
|
|
6
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
8
7
|
import './chunk-2GQIZM5Z.js';
|
|
9
8
|
import './chunk-BXMWQIBO.js';
|
|
10
9
|
import './chunk-X66RJAIS.js';
|
|
10
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
11
11
|
|
|
12
12
|
// src/components/hover-card.ts
|
|
13
13
|
var hoverCardDef = defineComponent({
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as Child, E as ElementProps, a as addSlot, b as append, h } from './
|
|
1
|
+
export { C as Child, E as ElementProps, a as addSlot, b as append, h } from './h-Bl37qUis.js';
|
|
2
2
|
export { css, defineStyles } from './css.js';
|
|
3
3
|
export { Token, t, tokenNames } from './t.js';
|
|
4
4
|
export { V as VariantFn, a as VariantProps, b as VariantSpec, c as VariantValues, v as variants } from './variants-B4stUBnY.js';
|
|
@@ -15,6 +15,7 @@ import './callout-bubble.js';
|
|
|
15
15
|
import './popover.js';
|
|
16
16
|
import './color-picker.js';
|
|
17
17
|
import './i18n.js';
|
|
18
|
+
import './data-table.js';
|
|
18
19
|
import './date-picker.js';
|
|
19
20
|
import './dialog.js';
|
|
20
21
|
import '@zag-js/dialog';
|
|
@@ -34,10 +35,15 @@ import './scatter-chart.js';
|
|
|
34
35
|
import './sparkline.js';
|
|
35
36
|
import './stat.js';
|
|
36
37
|
import './checkbox.js';
|
|
38
|
+
import './collapsible.js';
|
|
37
39
|
import './tabs.js';
|
|
38
40
|
import './text-area.js';
|
|
39
41
|
import './input.js';
|
|
40
42
|
import './input-group.js';
|
|
43
|
+
import './item.js';
|
|
44
|
+
import './month-grid.js';
|
|
45
|
+
import './slider.js';
|
|
46
|
+
import './sort-button.js';
|
|
41
47
|
import './switch.js';
|
|
42
48
|
import './toggle-group.js';
|
|
43
49
|
import './tooltip.js';
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { variants } from './chunk-LZWZV2ZS.js';
|
|
2
|
-
export { DARK_CHART, LIGHT_CHART, TOKEN_NAMES, applyTheme, checkTheme, createTheme } from './chunk-
|
|
2
|
+
export { DARK_CHART, LIGHT_CHART, TOKEN_NAMES, applyTheme, checkTheme, createTheme } from './chunk-V2Q4MRMS.js';
|
|
3
3
|
import './chunk-TAKSIV57.js';
|
|
4
4
|
import './chunk-MMTMOV6R.js';
|
|
5
5
|
export { placePopover, zagPositioning } from './chunk-3Q32K4PE.js';
|
|
6
6
|
export { disposeWithin, ownTeardown } from './chunk-A72NWYNP.js';
|
|
7
7
|
export { addSlot, append, h } from './chunk-Q6WTDVH6.js';
|
|
8
|
-
export { t, tokenNames } from './chunk-6QCILIT2.js';
|
|
9
8
|
export { defineComponent } from './chunk-VMCR3S2A.js';
|
|
10
|
-
export { css, defineStyles } from './chunk-
|
|
9
|
+
export { css, defineStyles } from './chunk-XBEL4K33.js';
|
|
11
10
|
export { LAYER_ORDER, injectLayerOrder } from './chunk-2GQIZM5Z.js';
|
|
12
11
|
import './chunk-BXMWQIBO.js';
|
|
13
12
|
import './chunk-X66RJAIS.js';
|
|
13
|
+
export { t, tokenNames } from './chunk-6QCILIT2.js';
|
package/dist/input-group.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ interface InputGroupAddon {
|
|
|
20
20
|
onClick: (e: MouseEvent) => void;
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
declare const inputGroupDef: ComponentDef<"input-group", "
|
|
23
|
+
declare const inputGroupDef: ComponentDef<"input-group", "root" | "text" | "control" | "addon", "radius" | "height" | "height-sm" | "focus-ring">;
|
|
24
24
|
declare const inputGroupVariants: VariantFn<{
|
|
25
25
|
readonly size: readonly ["md", "sm"];
|
|
26
26
|
}>;
|
package/dist/input-group.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { createButton } from './chunk-
|
|
1
|
+
import { createButton } from './chunk-CC3DDNFC.js';
|
|
2
|
+
import './chunk-C3ICYMI3.js';
|
|
2
3
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
3
4
|
import { iconEl } from './chunk-G7IQLY3A.js';
|
|
4
5
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
5
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
6
6
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
7
|
-
import { defineStyles, css } from './chunk-
|
|
7
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
8
8
|
import './chunk-2GQIZM5Z.js';
|
|
9
9
|
import './chunk-BXMWQIBO.js';
|
|
10
10
|
import './chunk-X66RJAIS.js';
|
|
11
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
11
12
|
|
|
12
13
|
// src/components/input-group.ts
|
|
13
14
|
var inputGroupDef = defineComponent({
|
package/dist/input.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { Input, TEXT_CSS, TEXT_STYLE_ID, createInput, inputController, inputDef, inputVariants } from './chunk-
|
|
1
|
+
export { Input, TEXT_CSS, TEXT_STYLE_ID, createInput, inputController, inputDef, inputVariants } from './chunk-U3EH42YY.js';
|
|
2
2
|
import './chunk-LZWZV2ZS.js';
|
|
3
3
|
import './chunk-Q6WTDVH6.js';
|
|
4
|
-
import './chunk-6QCILIT2.js';
|
|
5
4
|
import './chunk-VMCR3S2A.js';
|
|
6
|
-
import './chunk-
|
|
5
|
+
import './chunk-XBEL4K33.js';
|
|
7
6
|
import './chunk-2GQIZM5Z.js';
|
|
8
7
|
import './chunk-BXMWQIBO.js';
|
|
9
8
|
import './chunk-X66RJAIS.js';
|
|
9
|
+
import './chunk-6QCILIT2.js';
|
package/dist/item.d.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
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 itemDef: ComponentDef<"item", "root" | "meta" | "title" | "group" | "content" | "actions" | "description" | "media", "radius" | "gap">;
|
|
7
|
+
declare const itemVariants: VariantFn<{
|
|
8
|
+
readonly variant: readonly ["default", "outline", "muted"];
|
|
9
|
+
readonly size: readonly ["default", "sm"];
|
|
10
|
+
}>;
|
|
11
|
+
type ItemVariant = (typeof itemVariants.spec.variant)[number];
|
|
12
|
+
type ItemSize = (typeof itemVariants.spec.size)[number];
|
|
13
|
+
interface ItemProps extends VariantProps<typeof itemVariants> {
|
|
14
|
+
/** The first line: text, or an element (a ticker with a chip after it). */
|
|
15
|
+
title: string | Node;
|
|
16
|
+
/** The muted line under the title. */
|
|
17
|
+
description?: string | Node;
|
|
18
|
+
/** Before the text: an icon id from the kit's registry, or an element (a logo, an
|
|
19
|
+
* avatar, a favorite star). */
|
|
20
|
+
media?: string | Node;
|
|
21
|
+
/** After the text, always shown: figures and badges (a price and its change). */
|
|
22
|
+
meta?: Child;
|
|
23
|
+
/** At the row's end: its buttons. */
|
|
24
|
+
actions?: Child;
|
|
25
|
+
/** Show the actions only while the row is hovered or holds focus (on touch screens they
|
|
26
|
+
* always show). The meta stays. */
|
|
27
|
+
revealActions?: boolean;
|
|
28
|
+
/** The current row (the open symbol, the highlighted result). */
|
|
29
|
+
selected?: boolean;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** Makes the row clickable: a click, Enter or Space runs it. */
|
|
32
|
+
onSelect?: (e: MouseEvent | KeyboardEvent) => void;
|
|
33
|
+
/** The row's role (default `button` when it has `onSelect` and no actions, its text being
|
|
34
|
+
* the button when it has actions); `option` in a listbox, where `selected` is
|
|
35
|
+
* `aria-selected`. */
|
|
36
|
+
role?: string;
|
|
37
|
+
/** Extra class names (layout hooks). */
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
interface ItemHandle {
|
|
41
|
+
readonly el: HTMLElement;
|
|
42
|
+
setSelected(selected: boolean): void;
|
|
43
|
+
setDisabled(disabled: boolean): void;
|
|
44
|
+
setTitle(title: string | Node): void;
|
|
45
|
+
/** A new description; null removes it. */
|
|
46
|
+
setDescription(description: string | Node | null): void;
|
|
47
|
+
destroy(): void;
|
|
48
|
+
}
|
|
49
|
+
interface ItemGroupProps {
|
|
50
|
+
/** The rows, as elements or as the handles `createItem` returns. */
|
|
51
|
+
items?: ReadonlyArray<HTMLElement | ItemHandle>;
|
|
52
|
+
/** A line between the rows, edge to edge (default: separate rounded rows). */
|
|
53
|
+
separated?: boolean;
|
|
54
|
+
/** The list's accessible name. */
|
|
55
|
+
label?: string;
|
|
56
|
+
/** The group's role: default `group` when it has a `label` (the name needs a role to be
|
|
57
|
+
* read), none otherwise; `listbox` for rows whose role is `option`. */
|
|
58
|
+
role?: string;
|
|
59
|
+
/** Extra class names (layout hooks). */
|
|
60
|
+
className?: string;
|
|
61
|
+
}
|
|
62
|
+
interface ItemGroupHandle {
|
|
63
|
+
readonly el: HTMLElement;
|
|
64
|
+
/** Replace the rows. */
|
|
65
|
+
setItems(items: ReadonlyArray<HTMLElement | ItemHandle>): void;
|
|
66
|
+
destroy(): void;
|
|
67
|
+
}
|
|
68
|
+
declare function createItem(props: ItemProps): ItemHandle;
|
|
69
|
+
/** Rows stacked as one list. */
|
|
70
|
+
declare function createItemGroup(props?: ItemGroupProps): ItemGroupHandle;
|
|
71
|
+
|
|
72
|
+
export { type ItemGroupHandle, type ItemGroupProps, type ItemHandle, type ItemProps, type ItemSize, type ItemVariant, createItem, createItemGroup, itemDef, itemVariants };
|
package/dist/item.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { variants } from './chunk-LZWZV2ZS.js';
|
|
2
|
+
import { iconEl } from './chunk-G7IQLY3A.js';
|
|
3
|
+
import { h, append } from './chunk-Q6WTDVH6.js';
|
|
4
|
+
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
5
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
6
|
+
import './chunk-2GQIZM5Z.js';
|
|
7
|
+
import './chunk-BXMWQIBO.js';
|
|
8
|
+
import './chunk-X66RJAIS.js';
|
|
9
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
10
|
+
|
|
11
|
+
// src/components/item.ts
|
|
12
|
+
var itemDef = defineComponent({
|
|
13
|
+
name: "item",
|
|
14
|
+
parts: ["root", "media", "content", "title", "description", "meta", "actions", "group"],
|
|
15
|
+
settings: { radius: t.radius.md, gap: "10px" }
|
|
16
|
+
});
|
|
17
|
+
var itemVariants = variants({ variant: ["default", "outline", "muted"], size: ["default", "sm"] });
|
|
18
|
+
var CONTROL = 'button, a[href], input, select, textarea, label, summary, [role="button"], [role="checkbox"], [role="switch"], [role="menuitem"], [role="option"], [role="link"], [contenteditable]:not([contenteditable="false"])';
|
|
19
|
+
var injectStyles = defineStyles(
|
|
20
|
+
"vela-ui-item",
|
|
21
|
+
css`@layer vela.ui{[data-slot=item]{box-sizing:border-box;border-radius:${itemDef.vars.radius};min-width:0;color:${t.fg};text-align:start;transition:background ${t.dur.fast} ease, border-color ${t.dur.fast} ease;border:1px solid #0000;padding:8px 10px;font-size:13px;position:relative}[data-slot=item]:where(:not([hidden])){align-items:center;gap:${itemDef.vars.gap};display:flex}[data-slot=item][data-size=sm]{gap:8px;padding:4px 8px;font-size:12px}[data-slot=item][data-variant=outline]{border-color:${t.border}}[data-slot=item][data-variant=muted]{background:${t.surface.sunken}}[data-slot=item][data-clickable]{cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}[data-slot=item][data-clickable]:not([data-disabled]):hover{background:${t.hover}}[data-slot=item][data-selected],[data-slot=item][data-selected][data-clickable]:hover{background:${t.active}}[data-slot=item]:focus-visible{outline:2px solid ${t.focus};outline-offset:-2px}[data-slot=item][data-disabled]{cursor:default;opacity:.5}[data-slot=item-media]{color:${t.fg.muted};flex:none}[data-slot=item-media]:where(:not([hidden])){justify-content:center;align-items:center;display:inline-flex}[data-slot=item-media]>[data-icon]{width:1em;height:1em;font-size:16px;line-height:0}[data-slot=item-media]>[data-icon]>svg{width:100%;height:100%}[data-slot=item-content]{flex:auto;min-width:0}[data-slot=item-content]:where(:not([hidden])){flex-direction:column;gap:2px;display:flex}[data-slot=item-content][role=button]:focus-visible{outline:2px solid ${t.focus};outline-offset:2px;border-radius:${t.radius.sm}}[data-slot=item-title],[data-slot=item-description]{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}[data-slot=item-title]{color:${t.fg.bright};font-weight:500;line-height:18px}[data-slot=item-description]{color:${t.fg.muted};font-size:12px;line-height:16px}[data-slot=item-description]:is([data-size=sm] *){font-size:11px;line-height:14px}[data-slot=item-meta]{color:${t.fg};font-variant-numeric:tabular-nums;text-align:end;white-space:nowrap;flex:none;gap:8px}[data-slot=item-meta]:where(:not([hidden])){align-items:center;display:inline-flex}[data-slot=item-actions]{flex:none;gap:4px}[data-slot=item-actions]:where(:not([hidden])){align-items:center;display:inline-flex}[data-slot=item-actions]:is([data-reveal-actions]>*){opacity:0;transition:opacity ${t.dur.fast} ease}[data-slot=item-actions]:is([data-reveal-actions]:hover>*,[data-reveal-actions]:focus-within>*){opacity:1}@media (hover:none){[data-slot=item-actions]:is([data-reveal-actions]>*){opacity:1}}[data-slot=item-group]{min-width:0}[data-slot=item-group]:where(:not([hidden])){flex-direction:column;gap:2px;display:flex}[data-slot=item-group][data-separated]{gap:0}[data-slot=item-group][data-separated]>[data-slot=item]{border-bottom-color:${t.border.faint};border-radius:0}}`
|
|
22
|
+
);
|
|
23
|
+
var ItemImpl = class {
|
|
24
|
+
constructor(props) {
|
|
25
|
+
this.props = props;
|
|
26
|
+
this.descriptionEl = null;
|
|
27
|
+
this.disabled = false;
|
|
28
|
+
this.onClick = (e) => {
|
|
29
|
+
if (this.disabled) return;
|
|
30
|
+
const control = e.target instanceof Element ? e.target.closest(CONTROL) : null;
|
|
31
|
+
if (control && control !== this.control && control !== this.el && this.el.contains(control)) return;
|
|
32
|
+
this.props.onSelect?.(e);
|
|
33
|
+
};
|
|
34
|
+
this.onKey = (e) => {
|
|
35
|
+
if (this.disabled || e.target !== this.control || e.key !== "Enter" && e.key !== " ") return;
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
this.props.onSelect?.(e);
|
|
38
|
+
};
|
|
39
|
+
injectStyles(document);
|
|
40
|
+
const clickable = !!props.onSelect;
|
|
41
|
+
const textControl = clickable && props.role === void 0 && props.actions !== void 0 && props.actions !== null;
|
|
42
|
+
const role = props.role ?? (clickable ? "button" : null);
|
|
43
|
+
this.option = role === "option";
|
|
44
|
+
let media = null;
|
|
45
|
+
if (props.media !== void 0) {
|
|
46
|
+
media = h("div", { slot: itemDef.slot("media") });
|
|
47
|
+
if (typeof props.media === "string") {
|
|
48
|
+
const icon = iconEl(props.media, document);
|
|
49
|
+
icon.dataset.icon = "";
|
|
50
|
+
media.appendChild(icon);
|
|
51
|
+
} else media.appendChild(props.media);
|
|
52
|
+
}
|
|
53
|
+
this.titleEl = h("div", { slot: itemDef.slot("title") }, props.title);
|
|
54
|
+
this.content = h("div", { slot: itemDef.slot("content"), attrs: textControl ? { role, tabindex: "0" } : void 0 }, this.titleEl);
|
|
55
|
+
const trailing = (part, children) => {
|
|
56
|
+
if (children === void 0 || children === null) return null;
|
|
57
|
+
const el = h("div", { slot: itemDef.slot(part) });
|
|
58
|
+
append(el, [children]);
|
|
59
|
+
return el;
|
|
60
|
+
};
|
|
61
|
+
this.el = h(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
className: props.className,
|
|
65
|
+
slot: itemDef.slot("root"),
|
|
66
|
+
attrs: { ...itemVariants(props), role: textControl ? null : role, tabindex: clickable && !textControl ? "0" : null },
|
|
67
|
+
data: { clickable: clickable || null, "reveal-actions": props.revealActions || null }
|
|
68
|
+
},
|
|
69
|
+
media,
|
|
70
|
+
this.content,
|
|
71
|
+
trailing("meta", props.meta),
|
|
72
|
+
trailing("actions", props.actions)
|
|
73
|
+
);
|
|
74
|
+
this.control = textControl ? this.content : this.el;
|
|
75
|
+
if (props.description !== void 0) this.setDescription(props.description);
|
|
76
|
+
if (clickable) {
|
|
77
|
+
this.el.addEventListener("click", this.onClick);
|
|
78
|
+
this.control.addEventListener("keydown", this.onKey);
|
|
79
|
+
}
|
|
80
|
+
this.setSelected(props.selected ?? false);
|
|
81
|
+
this.setDisabled(props.disabled ?? false);
|
|
82
|
+
}
|
|
83
|
+
setSelected(selected) {
|
|
84
|
+
this.el.toggleAttribute("data-selected", selected);
|
|
85
|
+
if (this.option) this.control.setAttribute("aria-selected", String(selected));
|
|
86
|
+
else if (selected) this.control.setAttribute("aria-current", "true");
|
|
87
|
+
else this.control.removeAttribute("aria-current");
|
|
88
|
+
}
|
|
89
|
+
setDisabled(disabled) {
|
|
90
|
+
this.disabled = disabled;
|
|
91
|
+
this.el.toggleAttribute("data-disabled", disabled);
|
|
92
|
+
if (disabled) this.control.setAttribute("aria-disabled", "true");
|
|
93
|
+
else this.control.removeAttribute("aria-disabled");
|
|
94
|
+
if (this.props.onSelect) this.control.tabIndex = disabled ? -1 : 0;
|
|
95
|
+
}
|
|
96
|
+
setTitle(title) {
|
|
97
|
+
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.content.appendChild(h("div", { slot: itemDef.slot("description") })));
|
|
106
|
+
this.descriptionEl.replaceChildren(description);
|
|
107
|
+
}
|
|
108
|
+
destroy() {
|
|
109
|
+
this.el.removeEventListener("click", this.onClick);
|
|
110
|
+
this.control.removeEventListener("keydown", this.onKey);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
function createItem(props) {
|
|
114
|
+
return new ItemImpl(props);
|
|
115
|
+
}
|
|
116
|
+
function createItemGroup(props = {}) {
|
|
117
|
+
injectStyles(document);
|
|
118
|
+
const el = h("div", {
|
|
119
|
+
className: props.className,
|
|
120
|
+
slot: itemDef.slot("group"),
|
|
121
|
+
attrs: { role: props.role ?? (props.label ? "group" : null), "aria-label": props.label ?? null },
|
|
122
|
+
data: { separated: props.separated || null }
|
|
123
|
+
});
|
|
124
|
+
const setItems = (items) => {
|
|
125
|
+
el.replaceChildren(...items.map((item) => item instanceof HTMLElement ? item : item.el));
|
|
126
|
+
};
|
|
127
|
+
setItems(props.items ?? []);
|
|
128
|
+
return { el, setItems, destroy: () => el.remove() };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { createItem, createItemGroup, itemDef, itemVariants };
|
package/dist/kbd.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 kbdDef: ComponentDef<"kbd", "root", "
|
|
4
|
+
declare const kbdDef: ComponentDef<"kbd", "root", "radius" | "shadow">;
|
|
5
5
|
interface KbdProps {
|
|
6
6
|
/** The key's label (`Alt`, `⌘`, `K`). */
|
|
7
7
|
text: string;
|
package/dist/kbd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { createKbd, kbdDef, shortcutKeys } from './chunk-
|
|
1
|
+
export { createKbd, kbdDef, shortcutKeys } from './chunk-C3ICYMI3.js';
|
|
2
2
|
import './chunk-Q6WTDVH6.js';
|
|
3
|
-
import './chunk-6QCILIT2.js';
|
|
4
3
|
import './chunk-VMCR3S2A.js';
|
|
5
|
-
import './chunk-
|
|
4
|
+
import './chunk-XBEL4K33.js';
|
|
6
5
|
import './chunk-2GQIZM5Z.js';
|
|
7
6
|
import './chunk-BXMWQIBO.js';
|
|
8
7
|
import './chunk-X66RJAIS.js';
|
|
8
|
+
import './chunk-6QCILIT2.js';
|
package/dist/line-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 lineChartDef: ComponentDef<"line-chart", "
|
|
4
|
+
declare const lineChartDef: ComponentDef<"line-chart", "root" | "line" | "area" | "label" | "tip" | "dot", "tip-radius" | "tip-shadow" | "tip-z" | "tip-bg" | "stroke-width">;
|
|
5
5
|
interface LinePoint {
|
|
6
6
|
x: number;
|
|
7
7
|
y: number;
|
package/dist/line-chart.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { chartFrame, niceStep, showTip, escapeXml } from './chunk-A2FJ7Y7D.js';
|
|
2
|
-
import { t } from './chunk-6QCILIT2.js';
|
|
3
2
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
4
|
-
import { defineStyles, css } from './chunk-
|
|
3
|
+
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
|
5
4
|
import './chunk-2GQIZM5Z.js';
|
|
6
5
|
import './chunk-BXMWQIBO.js';
|
|
7
6
|
import { pageUid } from './chunk-X66RJAIS.js';
|
|
7
|
+
import { t } from './chunk-6QCILIT2.js';
|
|
8
8
|
|
|
9
9
|
// src/components/line-chart.ts
|
|
10
10
|
var lineChartDef = defineComponent({
|