@luxalgo/vela-ui 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +91 -0
- package/LICENSE +201 -0
- package/NOTICE +28 -0
- package/README.md +86 -3
- package/cli/engine.mjs +282 -0
- package/cli/index.mjs +154 -0
- package/dist/badge.d.ts +26 -0
- package/dist/badge.js +44 -0
- package/dist/bar-chart.d.ts +40 -0
- package/dist/bar-chart.js +105 -0
- package/dist/button.d.ts +55 -0
- package/dist/button.js +11 -0
- package/dist/calendar.d.ts +24 -0
- package/dist/calendar.js +1 -0
- package/dist/callout-bubble.d.ts +103 -0
- package/dist/callout-bubble.js +177 -0
- package/dist/chart.d.ts +30 -0
- package/dist/chart.js +1 -0
- package/dist/checkbox.d.ts +60 -0
- package/dist/checkbox.js +12 -0
- package/dist/chunk-2GQIZM5Z.js +28 -0
- package/dist/chunk-3Q32K4PE.js +85 -0
- package/dist/chunk-6QCILIT2.js +52 -0
- package/dist/chunk-7VMN7NKJ.js +133 -0
- package/dist/chunk-A2FJ7Y7D.js +55 -0
- package/dist/chunk-A72NWYNP.js +26 -0
- package/dist/chunk-B5ZSRUDQ.js +227 -0
- package/dist/chunk-BXMWQIBO.js +66 -0
- package/dist/chunk-C3ICYMI3.js +25 -0
- package/dist/chunk-CC3DDNFC.js +117 -0
- package/dist/chunk-E2FE6V2N.js +81 -0
- package/dist/chunk-FN2BUFNM.js +10 -0
- package/dist/chunk-FVH6L7FM.js +18 -0
- package/dist/chunk-G7IQLY3A.js +183 -0
- package/dist/chunk-GVRX3UAV.js +82 -0
- package/dist/chunk-J2QJATCD.js +12 -0
- package/dist/chunk-LZWZV2ZS.js +18 -0
- package/dist/chunk-MJ4RUGX7.js +403 -0
- package/dist/chunk-MMTMOV6R.js +31 -0
- package/dist/chunk-P4MTEMT7.js +23 -0
- package/dist/chunk-Q6WTDVH6.js +31 -0
- package/dist/chunk-S7USVSYP.js +50 -0
- package/dist/chunk-TAKSIV57.js +90 -0
- package/dist/chunk-U3EH42YY.js +72 -0
- package/dist/chunk-V2Q4MRMS.js +573 -0
- package/dist/chunk-VMCR3S2A.js +22 -0
- package/dist/chunk-WBGSYCV2.js +101 -0
- package/dist/chunk-WGULXRWD.js +351 -0
- package/dist/chunk-WXH3EFV5.js +219 -0
- package/dist/chunk-X66RJAIS.js +14 -0
- package/dist/chunk-XBEL4K33.js +142 -0
- package/dist/chunk-Z5PINFQO.js +280 -0
- package/dist/collapsible.d.ts +49 -0
- package/dist/collapsible.js +106 -0
- package/dist/color-picker.d.ts +103 -0
- package/dist/color-picker.js +19 -0
- package/dist/color.d.ts +24 -0
- package/dist/color.js +1 -0
- package/dist/context-menu.d.ts +72 -0
- package/dist/context-menu.js +161 -0
- package/dist/css.d.ts +17 -0
- package/dist/css.js +4 -0
- package/dist/data-table.d.ts +40 -0
- package/dist/data-table.js +88 -0
- package/dist/date-picker.d.ts +90 -0
- package/dist/date-picker.js +257 -0
- package/dist/define-D5u3F5Dj.d.ts +21 -0
- package/dist/dialog.d.ts +89 -0
- package/dist/dialog.js +258 -0
- package/dist/dispose.d.ts +9 -0
- package/dist/dispose.js +2 -0
- package/dist/donut.d.ts +27 -0
- package/dist/donut.js +67 -0
- package/dist/drawer.d.ts +119 -0
- package/dist/drawer.js +326 -0
- package/dist/dropdown-menu.d.ts +114 -0
- package/dist/dropdown-menu.js +18 -0
- package/dist/empty.d.ts +21 -0
- package/dist/empty.js +38 -0
- package/dist/field.d.ts +147 -0
- package/dist/field.js +328 -0
- package/dist/glyph-select.d.ts +57 -0
- package/dist/glyph-select.js +17 -0
- package/dist/h-Bl37qUis.d.ts +24 -0
- package/dist/headless.d.ts +6 -0
- package/dist/headless.js +9 -0
- package/dist/hover-card.d.ts +43 -0
- package/dist/hover-card.js +97 -0
- package/dist/i18n.d.ts +20 -0
- package/dist/i18n.js +1 -0
- package/dist/icons.d.ts +20 -0
- package/dist/icons.js +2 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +13 -0
- package/dist/input-group.d.ts +57 -0
- package/dist/input-group.js +87 -0
- package/dist/input.d.ts +54 -0
- package/dist/input.js +9 -0
- package/dist/item.d.ts +72 -0
- package/dist/item.js +131 -0
- package/dist/kbd.d.ts +19 -0
- package/dist/kbd.js +8 -0
- package/dist/kit-text.d.ts +8 -0
- package/dist/kit-text.js +2 -0
- package/dist/line-chart.d.ts +32 -0
- package/dist/line-chart.js +120 -0
- package/dist/manifest.json +4508 -0
- package/dist/month-grid.d.ts +45 -0
- package/dist/month-grid.js +157 -0
- package/dist/number-input.d.ts +99 -0
- package/dist/number-input.js +14 -0
- package/dist/page.d.ts +7 -0
- package/dist/page.js +1 -0
- package/dist/palette.d.ts +55 -0
- package/dist/palette.js +1 -0
- package/dist/placement.d.ts +98 -0
- package/dist/placement.js +1 -0
- package/dist/popover.d.ts +107 -0
- package/dist/popover.js +15 -0
- package/dist/scatter-chart.d.ts +32 -0
- package/dist/scatter-chart.js +121 -0
- package/dist/select.d.ts +112 -0
- package/dist/select.js +19 -0
- package/dist/slider.d.ts +46 -0
- package/dist/slider.js +111 -0
- package/dist/sort-button.d.ts +41 -0
- package/dist/sort-button.js +88 -0
- package/dist/sparkline.d.ts +22 -0
- package/dist/sparkline.js +72 -0
- package/dist/stat.d.ts +29 -0
- package/dist/stat.js +41 -0
- package/dist/styles.d.ts +22 -0
- package/dist/styles.js +2 -0
- package/dist/surface-events.d.ts +17 -0
- package/dist/surface-events.js +1 -0
- package/dist/surface-exit.d.ts +25 -0
- package/dist/surface-exit.js +1 -0
- package/dist/switch.d.ts +54 -0
- package/dist/switch.js +92 -0
- package/dist/t.d.ts +89 -0
- package/dist/t.js +1 -0
- package/dist/tabs.d.ts +65 -0
- package/dist/tabs.js +155 -0
- package/dist/text-area.d.ts +54 -0
- package/dist/text-area.js +9 -0
- package/dist/theme.d.ts +199 -0
- package/dist/theme.js +8 -0
- package/dist/theme.schema.json +1994 -0
- package/dist/themes/dark.css +3 -0
- package/dist/themes/light.css +3 -0
- package/dist/toggle-group.d.ts +56 -0
- package/dist/toggle-group.js +130 -0
- package/dist/tokens.d.ts +16 -0
- package/dist/tokens.js +3 -0
- package/dist/tooltip.d.ts +47 -0
- package/dist/tooltip.js +74 -0
- package/dist/variants-B4stUBnY.d.ts +16 -0
- package/dist/zag.d.ts +19 -0
- package/dist/zag.js +2 -0
- package/docs/theming.md +217 -0
- package/docs/what-to-change.md +20 -0
- package/docs/writing-a-component.md +250 -0
- package/llms.txt +71 -0
- package/package.json +90 -6
- package/registry/badge.ts +119 -0
- package/registry/bar-chart.ts +215 -0
- package/registry/button.ts +379 -0
- package/registry/callout-bubble.ts +347 -0
- package/registry/checkbox.ts +234 -0
- package/registry/collapsible.ts +271 -0
- package/registry/color-picker.ts +582 -0
- package/registry/context-menu.ts +208 -0
- package/registry/data-table.ts +215 -0
- package/registry/date-picker.ts +483 -0
- package/registry/dialog.ts +535 -0
- package/registry/donut.ts +145 -0
- package/registry/drawer.ts +636 -0
- package/registry/dropdown-menu.ts +762 -0
- package/registry/empty.ts +91 -0
- package/registry/field.ts +585 -0
- package/registry/glyph-select.ts +268 -0
- package/registry/hover-card.ts +222 -0
- package/registry/input-group.ts +229 -0
- package/registry/input.ts +181 -0
- package/registry/item.ts +376 -0
- package/registry/kbd.ts +64 -0
- package/registry/line-chart.ts +218 -0
- package/registry/month-grid.ts +328 -0
- package/registry/number-input.ts +443 -0
- package/registry/popover.ts +368 -0
- package/registry/scatter-chart.ts +221 -0
- package/registry/select.ts +620 -0
- package/registry/slider.ts +259 -0
- package/registry/sort-button.ts +189 -0
- package/registry/sparkline.ts +114 -0
- package/registry/stat.ts +96 -0
- package/registry/switch.ts +205 -0
- package/registry/tabs.ts +426 -0
- package/registry/text-area.ts +186 -0
- package/registry/toggle-group.ts +295 -0
- package/registry/tooltip.ts +156 -0
- package/skills/theming-vela-ui/SKILL.md +137 -0
- package/skills/using-vela-ui-components/SKILL.md +137 -0
- package/skills/writing-vela-ui-components/SKILL.md +163 -0
- package/src/components/badge.ts +119 -0
- package/src/components/bar-chart.ts +215 -0
- package/src/components/button.ts +379 -0
- package/src/components/callout-bubble.ts +347 -0
- package/src/components/checkbox.ts +234 -0
- package/src/components/collapsible.ts +271 -0
- package/src/components/color-picker.ts +582 -0
- package/src/components/context-menu.ts +208 -0
- package/src/components/data-table.ts +215 -0
- package/src/components/date-picker.ts +483 -0
- package/src/components/dialog.ts +535 -0
- package/src/components/donut.ts +145 -0
- package/src/components/drawer.ts +636 -0
- package/src/components/dropdown-menu.ts +762 -0
- package/src/components/empty.ts +91 -0
- package/src/components/field.ts +585 -0
- package/src/components/glyph-select.ts +268 -0
- package/src/components/hover-card.ts +222 -0
- package/src/components/input-group.ts +229 -0
- package/src/components/input.ts +181 -0
- package/src/components/item.ts +376 -0
- package/src/components/kbd.ts +64 -0
- package/src/components/line-chart.ts +218 -0
- package/src/components/month-grid.ts +328 -0
- package/src/components/number-input.ts +443 -0
- package/src/components/popover.ts +368 -0
- package/src/components/scatter-chart.ts +221 -0
- package/src/components/select.ts +620 -0
- package/src/components/slider.ts +259 -0
- package/src/components/sort-button.ts +189 -0
- package/src/components/sparkline.ts +114 -0
- package/src/components/stat.ts +96 -0
- package/src/components/switch.ts +205 -0
- package/src/components/tabs.ts +426 -0
- package/src/components/text-area.ts +186 -0
- package/src/components/toggle-group.ts +295 -0
- package/src/components/tooltip.ts +156 -0
- package/src/index.ts +24 -0
- package/src/lib/calendar.ts +117 -0
- package/src/lib/chart.ts +72 -0
- package/src/lib/color.ts +89 -0
- package/src/lib/component-index.ts +151 -0
- package/src/lib/css.ts +48 -0
- package/src/lib/define.ts +45 -0
- package/src/lib/dispose.ts +36 -0
- package/src/lib/h.ts +55 -0
- package/src/lib/headless.ts +16 -0
- package/src/lib/i18n.ts +30 -0
- package/src/lib/icons.ts +237 -0
- package/src/lib/kit-text.ts +26 -0
- package/src/lib/page.ts +24 -0
- package/src/lib/palette.ts +81 -0
- package/src/lib/placement.ts +188 -0
- package/src/lib/scope.ts +135 -0
- package/src/lib/styles.ts +53 -0
- package/src/lib/surface-events.ts +31 -0
- package/src/lib/surface-exit.ts +87 -0
- package/src/lib/t.ts +68 -0
- package/src/lib/theme.ts +664 -0
- package/src/lib/tokens.ts +111 -0
- package/src/lib/variants.ts +32 -0
- package/src/lib/zag.ts +46 -0
- package/stylelint/index.mjs +60 -0
- package/stylelint/lint.mjs +81 -0
- package/stylelint/plugin.mjs +115 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@luxalgo/vela-ui`, newest first. Vela's own changes, including how it
|
|
4
|
+
uses the kit, are in [Vela's changelog](../../CHANGELOG.md).
|
|
5
|
+
|
|
6
|
+
## [0.2.0]
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- **A slider.** `@luxalgo/vela-ui/slider` holds a value on a track, dragged or moved with the
|
|
11
|
+
arrow keys, Page Up/Down and Home/End. It reports every move, and once a drag ends it
|
|
12
|
+
reports the settled value through `onValueCommit`, the moment for costly work such as a
|
|
13
|
+
replay's seek.
|
|
14
|
+
- **Collapsible sections.** `@luxalgo/vela-ui/collapsible` shows and hides its content from a
|
|
15
|
+
header: a section header with a count (a panel's drawers) or a small group label (a list's
|
|
16
|
+
groups). A button of the host's, such as a row's chevron, can toggle it instead.
|
|
17
|
+
- **List rows.** `@luxalgo/vela-ui/item` is a row of a list (a watchlist, alerts, search
|
|
18
|
+
results): media, a title over a description, figures, and buttons that can stay hidden
|
|
19
|
+
until the row is hovered. A clickable row works with the keyboard and screen readers like
|
|
20
|
+
a button, while the buttons inside it keep their own presses; a row with actions makes its
|
|
21
|
+
text the button, as a button cannot hold other buttons. `createItemGroup` stacks rows, with
|
|
22
|
+
a line between them on request; a labelled group is a `group` to screen readers, or the
|
|
23
|
+
`role` you give it (`listbox` for option rows).
|
|
24
|
+
- **Sort buttons for lists that are not tables.** `@luxalgo/vela-ui/sort-button` is a column
|
|
25
|
+
header that steps through its sort directions on each press, shows the current one with an
|
|
26
|
+
arrow, and says it to screen readers.
|
|
27
|
+
- **A month grid.** `@luxalgo/vela-ui/month-grid` lays out a month of days with a figure each,
|
|
28
|
+
tinted by its tone (a trading journal's P&L by day). Weeks start on the locale's first day,
|
|
29
|
+
and the arrow keys walk the days.
|
|
30
|
+
- **Two-line tabs.** A tab's `description` puts a second line under its label, such as a day
|
|
31
|
+
strip's date under its weekday.
|
|
32
|
+
- **Key caps and favorite stars in buttons.** A button's `keys` and `keysEnd` show key caps
|
|
33
|
+
before or after its text (`↵ Open`). The `favorite` variant is a star that takes the
|
|
34
|
+
favorites color while pressed. A toggle button can now flip itself (`defaultPressed`,
|
|
35
|
+
`onPressedChange`) and show another icon while pressed (`iconPressed`).
|
|
36
|
+
- **A callout panel without a bubble.** `calloutPart(el, part)` makes an element a part of the
|
|
37
|
+
callout bubble's deployed panel (`panel`, `title`, `text`, `actions`, `button`) and gives it
|
|
38
|
+
that part's look, so a panel built elsewhere, such as a chart's timeline-mark popup, matches
|
|
39
|
+
the bubble's, and a theme's `callout-bubble` parts restyle both.
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- **What is on or chosen reads in the theme's selected colors.** A dropdown's switch rows, when
|
|
44
|
+
on, fill like the Switch (`selected.bg`, the knob in `selected.fg`) instead of the accent,
|
|
45
|
+
as does the slider's range and thumb, and a month grid marks today in bright, bold type:
|
|
46
|
+
white on a dark theme, black on a light one.
|
|
47
|
+
- **The kit's styles stay inside the kit.** Once a page created a kit component, the kit's
|
|
48
|
+
styles also reached the page's own components that use the same part names, such as a
|
|
49
|
+
shadcn/ui select, switch or button, and restyled them. A component's styles now apply only
|
|
50
|
+
inside kit hosts (`ensureUIHost`), the menus, dialogs and tooltips they open, and themed
|
|
51
|
+
hosts, so the page's own components keep their look. A component mounted outside any kit
|
|
52
|
+
host gets none of the kit's styles: mount it in one, as the README shows.
|
|
53
|
+
|
|
54
|
+
## [0.1.0]
|
|
55
|
+
|
|
56
|
+
### Added
|
|
57
|
+
|
|
58
|
+
- **The first release of Vela's component kit as a package of its own.** Buttons, badges,
|
|
59
|
+
tabs, toggle groups, dialogs, drawers, dropdown and context menus, tooltips, hover cards,
|
|
60
|
+
popovers, form controls (checkbox, switch, input and input group, text area, number field,
|
|
61
|
+
select, color picker, date picker, the settings field layer) and data components (data
|
|
62
|
+
table, stat, sparkline, donut, bar, line and scatter charts, key caps, empty states), one
|
|
63
|
+
import path each (`@luxalgo/vela-ui/<name>`), so a bundle holds only what it imports. Every
|
|
64
|
+
component is `create<Name>(props)`, returning a handle with its element and `destroy()`;
|
|
65
|
+
overlays and composite controls run Zag state machines for their keyboard behavior and
|
|
66
|
+
accessibility. `disposeWithin(root)` releases every control in a subtree you discard.
|
|
67
|
+
- **One typed theme config.** `createTheme` builds a theme from a brand color, a radius
|
|
68
|
+
scale, a font, any token by name, each component's settings and, when settings are not
|
|
69
|
+
enough, a component's CSS by part; `applyTheme` writes it once per document as a rule in
|
|
70
|
+
the `vela.theme` cascade layer. `checkTheme` lists what a theme gets wrong, a theme of
|
|
71
|
+
colors alone is plain JSON checked by the shipped JSON Schema, and the dark and light
|
|
72
|
+
themes also ship as plain CSS files.
|
|
73
|
+
- **Styles that give way to yours.** Component CSS sits in the `vela.ui` cascade layer and
|
|
74
|
+
styles parts by their `data-slot`, variants by `data-variant` and `data-size`, so a page's
|
|
75
|
+
own CSS overrides it without `!important`. Every scroller inside a kit host shows one
|
|
76
|
+
themeable scrollbar (`scroll`, `scroll-size`).
|
|
77
|
+
- **A reference inside the package.** `manifest.json` (every component's import, props,
|
|
78
|
+
variants, parts, settings, the tokens it reads and an example), `theme.schema.json`, the
|
|
79
|
+
guides (theming, what to change and where, writing a component) and `llms.txt` for coding
|
|
80
|
+
agents, all generated from the source.
|
|
81
|
+
- **Agent skills.** Three skills in `skills/` teach a coding agent to use the components,
|
|
82
|
+
theme them and write new ones, in the Agent Skills format: `npx skills experimental_sync`
|
|
83
|
+
links them into a project once the package is installed, and `npx skills add LuxAlgo/Vela`
|
|
84
|
+
installs them from the repository. `llms.txt` and the `AGENTS.md` block `add` writes point
|
|
85
|
+
at them.
|
|
86
|
+
- **A command line and a lint config.** `npx @luxalgo/vela-ui add`, `diff`, `check` and
|
|
87
|
+
`list`; `@luxalgo/vela-ui/stylelint` checks CSS written with the kit's `css` tag against the
|
|
88
|
+
kit's rules.
|
|
89
|
+
|
|
90
|
+
ES modules only, for the browsers with `color-mix()`: Chrome and Edge 111, Firefox 113,
|
|
91
|
+
Safari 16.2.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Vela
|
|
2
|
+
Copyright (c) 2026 LuxAlgo
|
|
3
|
+
https://velacharts.dev
|
|
4
|
+
|
|
5
|
+
This product includes the Vela charting library, developed by LuxAlgo.
|
|
6
|
+
|
|
7
|
+
ATTRIBUTION REQUIREMENT
|
|
8
|
+
|
|
9
|
+
Any product, website, or application that displays charts rendered by this
|
|
10
|
+
software must show a visible attribution to the Vela project on every page or
|
|
11
|
+
screen where such a chart is displayed.
|
|
12
|
+
|
|
13
|
+
The library satisfies this requirement automatically: it renders an attribution
|
|
14
|
+
mark (the project logomark linking to the Vela project page) on the chart
|
|
15
|
+
itself, enabled by default. You may restyle or reposition this mark to fit your
|
|
16
|
+
design.
|
|
17
|
+
|
|
18
|
+
You may disable the built-in mark (renderer feature `attribution`) ONLY if you
|
|
19
|
+
display an equivalent visible attribution — the name "Vela" together with a
|
|
20
|
+
link to the project page above — elsewhere on the same page or screen, in a
|
|
21
|
+
place available to your users.
|
|
22
|
+
|
|
23
|
+
Removing, hiding, or obscuring the attribution without providing the
|
|
24
|
+
equivalent notice described above is not permitted.
|
|
25
|
+
|
|
26
|
+
This file constitutes the NOTICE file described in Section 4(d) of the Apache
|
|
27
|
+
License, Version 2.0: redistributions of this software, in source or binary
|
|
28
|
+
form, must include a readable copy of these attribution notices.
|
package/README.md
CHANGED
|
@@ -1,3 +1,86 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# @luxalgo/vela-ui
|
|
2
|
+
|
|
3
|
+
The component kit of Vela: buttons, tabs, toggle groups, badges, dialogs, drawers, menus,
|
|
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
|
|
6
|
+
behavior, CSS in cascade layers over design tokens, and one typed theme config. It works
|
|
7
|
+
without the chart.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { createButton } from '@luxalgo/vela-ui/button';
|
|
11
|
+
import { createTheme, ensureUIHost } from '@luxalgo/vela-ui/theme';
|
|
12
|
+
|
|
13
|
+
const app = document.getElementById('app')!;
|
|
14
|
+
ensureUIHost(app, createTheme({ accent: '#7c3aed' }));
|
|
15
|
+
|
|
16
|
+
const save = createButton({ text: 'Save', variant: 'default' });
|
|
17
|
+
app.append(save.el);
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`ensureUIHost` makes the element a kit host: it carries the theme and the kit's base styles,
|
|
21
|
+
and menus, dialogs and tooltips opened from inside it mount there, themed. `applyTheme(app,
|
|
22
|
+
theme)` switches a host to another theme later.
|
|
23
|
+
|
|
24
|
+
- **One import path per component** (`@luxalgo/vela-ui/<name>`), so a bundle holds only the
|
|
25
|
+
components it imports. Every component is `create<Name>(props)`, returning a handle with
|
|
26
|
+
`el` and `destroy()`. When you discard a whole subtree, `disposeWithin(root)`
|
|
27
|
+
(`@luxalgo/vela-ui/dispose`) releases every control in it, handles kept or not: controls
|
|
28
|
+
that run a state machine must be released, not only removed, or their page-wide listeners
|
|
29
|
+
stay behind. A destroyed dialog, drawer or popover releases its content itself.
|
|
30
|
+
- **Styles give way to yours.** Component CSS sits in the `vela.ui` cascade layer, so a
|
|
31
|
+
page's own CSS overrides it without `!important`. Every part carries a `data-slot`;
|
|
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.
|
|
35
|
+
- **One theme config.** `createTheme` sets the brand color, radius and font, any token by
|
|
36
|
+
name, each component's settings, or a component's whole look; a wrong name fails the
|
|
37
|
+
typecheck. See [Theming](docs/theming.md) and [What to change, and where](docs/what-to-change.md).
|
|
38
|
+
|
|
39
|
+
## Command line
|
|
40
|
+
|
|
41
|
+
| Command | Result |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `npx @luxalgo/vela-ui add button` | makes `@luxalgo/vela-ui` a direct dependency and prints the button's import and an example |
|
|
44
|
+
| `npx @luxalgo/vela-ui add button --source` | copies the button's source into the project (`src/ui` by default) as a component of your own, `app-button` (`--as` names it), which never styles the package's button |
|
|
45
|
+
| `npx @luxalgo/vela-ui diff app-button` | what changed upstream since the copy was made; `--accept` records the copy as up to date |
|
|
46
|
+
| `npx @luxalgo/vela-ui check` | one copy of the package installed, no copy behind it, the theme file valid |
|
|
47
|
+
| `npx @luxalgo/vela-ui list` | the components |
|
|
48
|
+
|
|
49
|
+
A `vela-ui.json` at the project's root says where copies go and which theme file to check:
|
|
50
|
+
`{ "aliases": { "ui": "#ui" }, "theme": "brand.theme.json" }` (`#ui` is a package.json
|
|
51
|
+
`imports` alias, or write a folder). Copies are recorded in `vela-ui.lock.json`, with their
|
|
52
|
+
upstream version kept under `.vela-ui/`: commit both. The first `add` offers to add a note to
|
|
53
|
+
the project's `AGENTS.md` pointing coding agents at this package's reference.
|
|
54
|
+
|
|
55
|
+
## For coding agents
|
|
56
|
+
|
|
57
|
+
Three agent skills ship in `skills/`: [using the components](skills/using-vela-ui-components/SKILL.md),
|
|
58
|
+
[theming](skills/theming-vela-ui/SKILL.md) and [writing components](skills/writing-vela-ui-components/SKILL.md).
|
|
59
|
+
`npx skills experimental_sync` links them into a project's agent once the package is installed
|
|
60
|
+
(Vela's own package pulls them in too), and `npx skills add LuxAlgo/Vela` installs them from
|
|
61
|
+
the repository. [`llms.txt`](llms.txt) indexes them with the rest of the reference.
|
|
62
|
+
|
|
63
|
+
## Reference
|
|
64
|
+
|
|
65
|
+
- `dist/manifest.json` (`@luxalgo/vela-ui/manifest.json`): every component's import, props,
|
|
66
|
+
variants, parts and slots, settings, the tokens it reads and an example, generated from
|
|
67
|
+
the source.
|
|
68
|
+
- `dist/theme.schema.json` (`@luxalgo/vela-ui/theme.schema.json`): the JSON Schema of a theme
|
|
69
|
+
written to a file.
|
|
70
|
+
- `llms.txt`: a short index of the above, for coding agents.
|
|
71
|
+
- [Writing a component](docs/writing-a-component.md): the one-file shape and its rules.
|
|
72
|
+
- `@luxalgo/vela-ui/stylelint`: the shared stylelint config for CSS written with the `css`
|
|
73
|
+
tag (tokens through `t`, no raw colors, logical directions, parts not classes). Extend it
|
|
74
|
+
and name your layer: `vela.ui` for components of your own, so themes restyle them like the
|
|
75
|
+
kit's, and `vela.custom` for CSS that restyles components
|
|
76
|
+
(`{ extends: ['@luxalgo/vela-ui/stylelint'], rules: { 'vela/layer': 'vela.ui' } }`). It
|
|
77
|
+
needs `stylelint`, `postcss-lit` and `stylelint-config-recommended`.
|
|
78
|
+
CSS outside the kit takes the tag and the tokens from `@luxalgo/vela-ui/css` and
|
|
79
|
+
`@luxalgo/vela-ui/t`.
|
|
80
|
+
- `@luxalgo/vela-ui/stylelint/lint`: `lintCss({ files, baseline?, update? })` runs that config
|
|
81
|
+
and fails when postcss-lit skips a template (it would pass while checking nothing). With a
|
|
82
|
+
`baseline` file, CSS written before the rules keeps its known violations, counted per file
|
|
83
|
+
and rule: the run fails when a count grows, and when one shrinks until `update: true`
|
|
84
|
+
rewrites the file, so the baseline only tightens.
|
|
85
|
+
|
|
86
|
+
ES modules only. Licensed under Apache-2.0.
|