@getaster/elements 0.0.0-stage → 0.1.0-preview.1
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/LICENSE +202 -0
- package/NOTICE +10 -0
- package/README.md +6 -2
- package/bin/aster-theme-check.js +317 -0
- package/dist/base/drag.d.ts +45 -0
- package/dist/base/drag.js +139 -0
- package/dist/base/element.d.ts +51 -0
- package/dist/base/element.js +133 -0
- package/dist/breadcrumbs/breadcrumbs.d.ts +23 -0
- package/dist/breadcrumbs/breadcrumbs.js +51 -0
- package/dist/button/button.d.ts +37 -0
- package/dist/button/button.js +108 -0
- package/dist/caret/caret-group.d.ts +14 -0
- package/dist/caret/caret-group.js +71 -0
- package/dist/carousel/carousel.d.ts +28 -0
- package/dist/carousel/carousel.js +134 -0
- package/dist/component/component.d.ts +73 -0
- package/dist/component/component.js +190 -0
- package/dist/component/echarts.d.ts +46 -0
- package/dist/component/echarts.js +95 -0
- package/dist/composition/authoring.d.ts +157 -0
- package/dist/composition/authoring.js +291 -0
- package/dist/composition/builtins.d.ts +1130 -0
- package/dist/composition/builtins.js +318 -0
- package/dist/composition/command-bar.d.ts +18 -0
- package/dist/composition/command-bar.js +34 -0
- package/dist/composition/commands.d.ts +14 -0
- package/dist/composition/commands.js +59 -0
- package/dist/composition/composite.d.ts +48 -0
- package/dist/composition/composite.js +409 -0
- package/dist/composition/contracts.d.ts +63 -0
- package/dist/composition/contracts.js +97 -0
- package/dist/composition/definition.d.ts +94 -0
- package/dist/composition/definition.js +291 -0
- package/dist/composition/element.d.ts +35 -0
- package/dist/composition/element.js +51 -0
- package/dist/composition/registry.d.ts +83 -0
- package/dist/composition/registry.js +99 -0
- package/dist/composition/schema.d.ts +9 -0
- package/dist/composition/schema.js +139 -0
- package/dist/composition/sessions.d.ts +15 -0
- package/dist/composition/sessions.js +61 -0
- package/dist/dashboard/dashboard.d.ts +26 -0
- package/dist/dashboard/dashboard.js +296 -0
- package/dist/dashboard/layout.d.ts +19 -0
- package/dist/dashboard/layout.js +48 -0
- package/dist/dashboard/widget.d.ts +42 -0
- package/dist/dashboard/widget.js +165 -0
- package/dist/date/calendar.d.ts +34 -0
- package/dist/date/calendar.js +137 -0
- package/dist/date/date-field.d.ts +18 -0
- package/dist/date/date-field.js +81 -0
- package/dist/date/dates.d.ts +22 -0
- package/dist/date/dates.js +80 -0
- package/dist/dialog/dialog.d.ts +23 -0
- package/dist/dialog/dialog.js +70 -0
- package/dist/field/bound-field.d.ts +55 -0
- package/dist/field/bound-field.js +139 -0
- package/dist/field/check.d.ts +11 -0
- package/dist/field/check.js +26 -0
- package/dist/field/composite-field.d.ts +35 -0
- package/dist/field/composite-field.js +88 -0
- package/dist/field/field.d.ts +29 -0
- package/dist/field/field.js +75 -0
- package/dist/field/input.d.ts +15 -0
- package/dist/field/input.js +18 -0
- package/dist/field/number-field.d.ts +33 -0
- package/dist/field/number-field.js +179 -0
- package/dist/field/numeric.d.ts +4 -0
- package/dist/field/numeric.js +57 -0
- package/dist/field/values.d.ts +14 -0
- package/dist/field/values.js +60 -0
- package/dist/filter/filter-builder.d.ts +18 -0
- package/dist/filter/filter-builder.js +305 -0
- package/dist/form/controls.d.ts +20 -0
- package/dist/form/controls.js +34 -0
- package/dist/form/form.d.ts +46 -0
- package/dist/form/form.js +85 -0
- package/dist/format.d.ts +10 -0
- package/dist/format.js +57 -0
- package/dist/grid/filters.d.ts +16 -0
- package/dist/grid/filters.js +66 -0
- package/dist/grid/grid.d.ts +209 -0
- package/dist/grid/grid.js +2587 -0
- package/dist/grid/rows.d.ts +32 -0
- package/dist/grid/rows.js +89 -0
- package/dist/grid/view.d.ts +69 -0
- package/dist/grid/view.js +172 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +61 -0
- package/dist/layout/stack.d.ts +112 -0
- package/dist/layout/stack.js +21 -0
- package/dist/list-edit/list-edit.d.ts +42 -0
- package/dist/list-edit/list-edit.js +220 -0
- package/dist/listbox/listbox.d.ts +45 -0
- package/dist/listbox/listbox.js +187 -0
- package/dist/menu/menu.d.ts +55 -0
- package/dist/menu/menu.js +286 -0
- package/dist/motion.d.ts +8 -0
- package/dist/motion.js +23 -0
- package/dist/overlay/anchor.d.ts +18 -0
- package/dist/overlay/anchor.js +41 -0
- package/dist/picker/options.d.ts +59 -0
- package/dist/picker/options.js +97 -0
- package/dist/picker/picker.d.ts +46 -0
- package/dist/picker/picker.js +492 -0
- package/dist/picker/tree-choices.d.ts +38 -0
- package/dist/picker/tree-choices.js +72 -0
- package/dist/picker/tree-picker.d.ts +29 -0
- package/dist/picker/tree-picker.js +282 -0
- package/dist/progress/policy.d.ts +5 -0
- package/dist/progress/policy.js +28 -0
- package/dist/progress/status.d.ts +20 -0
- package/dist/progress/status.js +38 -0
- package/dist/rule/operators.d.ts +8 -0
- package/dist/rule/operators.js +9 -0
- package/dist/rule/rule-editor.d.ts +57 -0
- package/dist/rule/rule-editor.js +290 -0
- package/dist/section/accordion.d.ts +24 -0
- package/dist/section/accordion.js +90 -0
- package/dist/section/section.d.ts +30 -0
- package/dist/section/section.js +99 -0
- package/dist/select/choice-element.d.ts +20 -0
- package/dist/select/choice-element.js +55 -0
- package/dist/select/choice.d.ts +34 -0
- package/dist/select/choice.js +122 -0
- package/dist/select/many.d.ts +13 -0
- package/dist/select/many.js +20 -0
- package/dist/select/select.d.ts +16 -0
- package/dist/select/select.js +40 -0
- package/dist/sidebar/sidebar.d.ts +47 -0
- package/dist/sidebar/sidebar.js +105 -0
- package/dist/slicer/slicer.d.ts +26 -0
- package/dist/slicer/slicer.js +140 -0
- package/dist/split/split.d.ts +41 -0
- package/dist/split/split.js +237 -0
- package/dist/styles/contract.d.ts +36 -0
- package/dist/styles/contract.js +39 -0
- package/dist/switch/switch.d.ts +22 -0
- package/dist/switch/switch.js +69 -0
- package/dist/tabs/tabs.d.ts +30 -0
- package/dist/tabs/tabs.js +202 -0
- package/dist/tile-grid/scroll.d.ts +9 -0
- package/dist/tile-grid/scroll.js +21 -0
- package/dist/tile-grid/tile-grid.d.ts +64 -0
- package/dist/tile-grid/tile-grid.js +734 -0
- package/dist/toast/toast.d.ts +25 -0
- package/dist/toast/toast.js +92 -0
- package/dist/tree/navigator.d.ts +41 -0
- package/dist/tree/navigator.js +228 -0
- package/dist/window/chrome.d.ts +3 -0
- package/dist/window/chrome.js +7 -0
- package/dist/window/window.d.ts +46 -0
- package/dist/window/window.js +347 -0
- package/dist/window/workspace.d.ts +29 -0
- package/dist/window/workspace.js +137 -0
- package/package.json +45 -4
- package/styles/aster-ui.css +1147 -0
- package/styles/base.css +88 -0
- package/styles/contract.ts +41 -0
- package/styles/elements.css +1058 -0
- package/styles/harbour.css +126 -0
- package/styles/lamplight.css +118 -0
package/styles/base.css
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/* Polish primitives every screen gets without asking: one focus ring,
|
|
2
|
+
cursor by role, selectable text by role, themed platform details, and
|
|
3
|
+
reduced motion. Components never set a cursor or a focus ring themselves. */
|
|
4
|
+
@layer aster.identity, aster.base, aster.elements, app;
|
|
5
|
+
|
|
6
|
+
@layer aster.base {
|
|
7
|
+
/* Density: standard, unless chosen or the pointer is coarse. */
|
|
8
|
+
:root, :root[data-density="standard"] { --aster-ctl: 30px; --aster-ctl-tight: 26px; --aster-pad-y: 9px; --aster-row-y: 6px; --aster-pad: 12px; --aster-gap: 14px; }
|
|
9
|
+
:root[data-density="compact"] { --aster-ctl: 26px; --aster-ctl-tight: 22px; --aster-pad-y: 5px; --aster-row-y: 3px; --aster-pad: 8px; --aster-gap: 10px; }
|
|
10
|
+
:root[data-density="comfortable"] { --aster-ctl: 38px; --aster-ctl-tight: 32px; --aster-pad-y: 12px; --aster-row-y: 9px; --aster-pad: 16px; --aster-gap: 18px; }
|
|
11
|
+
@media (pointer: coarse) {
|
|
12
|
+
:root:not([data-density]) { --aster-ctl: 38px; --aster-ctl-tight: 32px; --aster-pad-y: 12px; --aster-row-y: 9px; --aster-pad: 16px; --aster-gap: 18px; }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
16
|
+
html, body { margin: 0; height: 100%; }
|
|
17
|
+
html {
|
|
18
|
+
-webkit-tap-highlight-color: transparent;
|
|
19
|
+
scrollbar-color: oklch(from var(--aster-text) l c h / .22) transparent;
|
|
20
|
+
}
|
|
21
|
+
body {
|
|
22
|
+
font: var(--aster-weight) var(--aster-font-size) / var(--aster-line) var(--aster-font-ui);
|
|
23
|
+
font-optical-sizing: auto;
|
|
24
|
+
color: var(--aster-text);
|
|
25
|
+
background: var(--aster-backdrop);
|
|
26
|
+
-webkit-font-smoothing: antialiased;
|
|
27
|
+
transition: --aster-glow 600ms var(--aster-ease), background-color 400ms ease, color 300ms ease;
|
|
28
|
+
}
|
|
29
|
+
/* Texture over everything, never intercepting input. */
|
|
30
|
+
body::after {
|
|
31
|
+
content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none;
|
|
32
|
+
background: var(--aster-texture, none);
|
|
33
|
+
opacity: var(--aster-texture-opacity, 0);
|
|
34
|
+
mix-blend-mode: var(--aster-texture-blend, normal);
|
|
35
|
+
}
|
|
36
|
+
button, input, select, textarea { font: inherit; color: inherit; }
|
|
37
|
+
/* Native controls inherit ink, so their surfaces must follow the same theme. */
|
|
38
|
+
select, option, optgroup { background-color: var(--aster-sunk); }
|
|
39
|
+
button { background: none; border: 0; padding: 0; margin: 0; text-align: inherit; }
|
|
40
|
+
h1, h2, h3 { text-wrap: balance; }
|
|
41
|
+
p { text-wrap: pretty; }
|
|
42
|
+
|
|
43
|
+
[hidden] { display: none !important; }
|
|
44
|
+
.aster-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
45
|
+
|
|
46
|
+
/* One focus ring: an outline, so it follows each element's radius and
|
|
47
|
+
never disturbs its elevation. Pointer focus shows none. */
|
|
48
|
+
:focus { outline: none; }
|
|
49
|
+
:focus-visible { outline: 2px solid var(--aster-focus); outline-offset: var(--aster-focus-offset); }
|
|
50
|
+
/* A frame that owns its ring hides the inner control's. */
|
|
51
|
+
[data-ring-owner] :focus-visible { outline: none; }
|
|
52
|
+
[data-ring-owner]:focus-within { outline: 2px solid var(--aster-focus); outline-offset: var(--aster-focus-offset); }
|
|
53
|
+
|
|
54
|
+
::selection { background: oklch(from var(--aster-accent) l c h / .2); }
|
|
55
|
+
input, textarea { caret-color: var(--aster-accent); }
|
|
56
|
+
|
|
57
|
+
/* Cursor follows behaviour, by role. Passive rows keep the arrow. */
|
|
58
|
+
button, label:not([data-ring-owner]), select, summary, a[href], [data-click], input[type="checkbox"],
|
|
59
|
+
[role="tab"], [role="option"], [role="switch"], [role="menuitem"], [role="menuitemradio"] { cursor: pointer; }
|
|
60
|
+
input:not([type]), input[type="text"], input[type="email"], input[type="search"], textarea,
|
|
61
|
+
[contenteditable], [data-ring-owner] { cursor: text; }
|
|
62
|
+
[role="separator"][tabindex] { cursor: col-resize; }
|
|
63
|
+
[role="row"][aria-expanded] > [role="gridcell"] { cursor: pointer; }
|
|
64
|
+
[data-ring-owner]:has([aria-haspopup="listbox"]), [aria-haspopup="listbox"] { cursor: pointer; }
|
|
65
|
+
[data-ring-owner]:has([aria-haspopup="listbox"][aria-readonly="true"]) { cursor: default; }
|
|
66
|
+
:disabled, [aria-disabled="true"] { cursor: not-allowed; }
|
|
67
|
+
[aria-busy="true"] { cursor: progress; }
|
|
68
|
+
|
|
69
|
+
/* Controls are for clicking; content is for reading and copying. */
|
|
70
|
+
button, [role="tab"], [role="switch"], [role="menuitem"], [role="option"], label { user-select: none; -webkit-user-select: none; }
|
|
71
|
+
input, textarea, [data-copyable] { user-select: text; -webkit-user-select: text; }
|
|
72
|
+
|
|
73
|
+
.aster-figure-text {
|
|
74
|
+
font-family: var(--aster-font-figure);
|
|
75
|
+
font-variant-numeric: tabular-nums lining-nums;
|
|
76
|
+
font-variation-settings: var(--aster-figure-settings);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* No transition at all: even a 1 ms one shows its end state a frame late. */
|
|
81
|
+
@media (prefers-reduced-motion: reduce) {
|
|
82
|
+
:root {
|
|
83
|
+
--aster-t-morph: 0s; --aster-t-ink: 0s; --aster-t-micro: 0s;
|
|
84
|
+
--aster-t-caret: 0s; --aster-t-scheme: 0s;
|
|
85
|
+
}
|
|
86
|
+
body { transition: none !important; }
|
|
87
|
+
::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
|
|
88
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The token contract: every custom property an identity must define, by
|
|
3
|
+
* role. Elements and apps style themselves only through these, so an
|
|
4
|
+
* identity is a complete set of values and nothing else.
|
|
5
|
+
*
|
|
6
|
+
* A dark scheme (`:root[data-scheme="dark"]`) may override any of them and
|
|
7
|
+
* needs to define none.
|
|
8
|
+
*/
|
|
9
|
+
export const TOKENS = {
|
|
10
|
+
type: [
|
|
11
|
+
"font-ui", "font-figure", "font-size", "line", "weight", "weight-strong", "weight-label",
|
|
12
|
+
"figure-settings", "title-settings", "heading-settings", "prose-settings",
|
|
13
|
+
],
|
|
14
|
+
surfaces: ["page", "surface", "sunk", "pane", "backdrop", "frame", "texture", "texture-blend", "texture-opacity"],
|
|
15
|
+
text: ["text", "text-2", "text-3"],
|
|
16
|
+
/** `mark-ring` outlines identity dots and avatars so a pale hue still shows. */
|
|
17
|
+
edges: ["rule", "rule-2", "mark-ring"],
|
|
18
|
+
/** Accent acts (buttons, links, focus); indicator only marks where to look (the caret). */
|
|
19
|
+
accent: ["accent", "accent-hi", "accent-soft", "on-accent", "accent-sheen", "focus", "focus-offset", "indicator"],
|
|
20
|
+
status: ["positive", "negative", "caution"],
|
|
21
|
+
/** Identity colours take their hue from data and lightness and chroma from here. */
|
|
22
|
+
identity: ["identity-l", "identity-c"],
|
|
23
|
+
/** `press` is the inset shadow colour of a pressed primary button. */
|
|
24
|
+
elevation: ["shadow", "highlight", "ring", "e1", "e2", "e3", "well", "scrim", "press"],
|
|
25
|
+
shape: ["r-ctl", "r-card", "r-pop", "r-dialog"],
|
|
26
|
+
motion: ["ease", "t-morph", "t-ink", "t-micro", "t-caret", "t-scheme"],
|
|
27
|
+
toast: ["toast-bg", "toast-text", "toast-action", "toast-mark"],
|
|
28
|
+
/** Lamplight's lamp, which other identities set to something neutral; `lamp-bulb` is the glow round the switch's bulb. */
|
|
29
|
+
light: ["lamp", "glow", "lamp-bulb"],
|
|
30
|
+
} as const;
|
|
31
|
+
|
|
32
|
+
export const TOKEN_NAMES: readonly string[] = Object.values(TOKENS).flat().map((t) => `--aster-${t}`);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Sizes that follow density rather than identity: control height, a tighter
|
|
36
|
+
* control for grids, vertical padding of grid cells and listbox rows, of
|
|
37
|
+
* single-line rows, and of panels and bars, and the gap between fields. `base.css` defines them for each density.
|
|
38
|
+
*/
|
|
39
|
+
export const DENSITY = ["ctl", "ctl-tight", "pad-y", "row-y", "pad", "gap"] as const;
|
|
40
|
+
export const DENSITIES = ["compact", "standard", "comfortable"] as const;
|
|
41
|
+
export const DENSITY_NAMES: readonly string[] = DENSITY.map((t) => `--aster-${t}`);
|