viewkitjs 0.21.0 → 0.23.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 +49 -0
- package/MIGRATION.md +1 -1
- package/README.md +1 -1
- package/fields/dist/conventions.d.ts +15 -3
- package/fields/dist/conventions.js +25 -0
- package/fields/dist/design/category-colors.d.ts +12 -5
- package/fields/dist/design/category-colors.js +7 -7
- package/fields/dist/query/buckets.js +42 -35
- package/fields/dist/query/date.js +2 -13
- package/fields/docs/guides/conventions.md +1 -1
- package/fields/docs/guides/options.md +2 -1
- package/fields/docs/reference/design-category-colors.md +2 -2
- package/fields/docs/reference/fields.md +1 -1
- package/package.json +13 -1
- package/views/dist/atoms/tones.js +7 -7
- package/views/dist/contract.d.ts +6 -1
- package/views/dist/contract.js +1 -0
- package/views/dist/controls/atoms.d.ts +8 -0
- package/views/dist/controls/atoms.js +8 -0
- package/views/dist/controls/button/button.d.ts +40 -0
- package/views/dist/controls/button/button.js +40 -0
- package/views/dist/controls/button/looks.d.ts +4 -0
- package/views/dist/controls/button/looks.js +20 -0
- package/views/dist/controls/button/map-button.d.ts +11 -0
- package/views/dist/controls/button/map-button.js +20 -0
- package/views/dist/controls/button/own-look.d.ts +59 -0
- package/views/dist/controls/button/own-look.js +33 -0
- package/views/dist/controls/button/tokens.d.ts +351 -0
- package/views/dist/controls/button/tokens.js +90 -0
- package/views/dist/controls/button.css +530 -0
- package/views/dist/controls/checkbox/checkbox.d.ts +28 -0
- package/views/dist/controls/checkbox/checkbox.js +15 -0
- package/views/dist/controls/checkbox/looks.d.ts +3 -0
- package/views/dist/controls/checkbox/looks.js +8 -0
- package/views/dist/controls/checkbox/map-checkbox.d.ts +2 -0
- package/views/dist/controls/checkbox/map-checkbox.js +5 -0
- package/views/dist/controls/checkbox/tokens.d.ts +131 -0
- package/views/dist/controls/checkbox/tokens.js +35 -0
- package/views/dist/controls/checkbox.css +133 -0
- package/views/dist/controls/controls.d.ts +14 -0
- package/views/dist/controls/controls.js +14 -0
- package/views/dist/controls/field/field.d.ts +94 -0
- package/views/dist/controls/field/field.js +46 -0
- package/views/dist/controls/field/looks.d.ts +13 -0
- package/views/dist/controls/field/looks.js +22 -0
- package/views/dist/controls/field/tokens.d.ts +75 -0
- package/views/dist/controls/field/tokens.js +21 -0
- package/views/dist/controls/field.css +98 -0
- package/views/dist/controls/glass-button/glass-button.d.ts +40 -0
- package/views/dist/controls/glass-button/glass-button.js +16 -0
- package/views/dist/controls/glass-button/looks.d.ts +4 -0
- package/views/dist/controls/glass-button/looks.js +4 -0
- package/views/dist/controls/glass-button/tokens.d.ts +127 -0
- package/views/dist/controls/glass-button/tokens.js +34 -0
- package/views/dist/controls/glass-button.css +111 -0
- package/views/dist/controls/index.d.ts +37 -0
- package/views/dist/controls/index.js +31 -0
- package/views/dist/controls/inline-input/inline-input.d.ts +14 -0
- package/views/dist/controls/inline-input/inline-input.js +10 -0
- package/views/dist/controls/inline-input/looks.d.ts +3 -0
- package/views/dist/controls/inline-input/looks.js +16 -0
- package/views/dist/controls/inline-input/tokens.d.ts +79 -0
- package/views/dist/controls/inline-input/tokens.js +22 -0
- package/views/dist/controls/inline-input.css +78 -0
- package/views/dist/controls/input/autofill.d.ts +25 -0
- package/views/dist/controls/input/autofill.js +17 -0
- package/views/dist/controls/input/input.d.ts +119 -0
- package/views/dist/controls/input/input.js +127 -0
- package/views/dist/controls/input/looks.d.ts +41 -0
- package/views/dist/controls/input/looks.js +48 -0
- package/views/dist/controls/input/map-input.d.ts +2 -0
- package/views/dist/controls/input/map-input.js +5 -0
- package/views/dist/controls/input/tokens.d.ts +171 -0
- package/views/dist/controls/input/tokens.js +45 -0
- package/views/dist/controls/input.css +381 -0
- package/views/dist/controls/internal/anchor.d.ts +16 -0
- package/views/dist/controls/internal/anchor.js +8 -0
- package/views/dist/controls/internal/close-reason.d.ts +5 -0
- package/views/dist/controls/internal/close-reason.js +2 -0
- package/views/dist/controls/internal/popup-host.d.ts +7 -0
- package/views/dist/controls/internal/popup-host.js +10 -0
- package/views/dist/controls/internal/scroll.d.ts +11 -0
- package/views/dist/controls/internal/scroll.js +14 -0
- package/views/dist/controls/kbd/kbd.d.ts +13 -0
- package/views/dist/controls/kbd/kbd.js +10 -0
- package/views/dist/controls/kbd/looks.d.ts +4 -0
- package/views/dist/controls/kbd/looks.js +4 -0
- package/views/dist/controls/kbd/tokens.d.ts +47 -0
- package/views/dist/controls/kbd/tokens.js +14 -0
- package/views/dist/controls/kbd.css +46 -0
- package/views/dist/controls/number-field/number-field.d.ts +48 -0
- package/views/dist/controls/number-field/number-field.js +34 -0
- package/views/dist/controls/number-field/tokens.d.ts +47 -0
- package/views/dist/controls/number-field/tokens.js +14 -0
- package/views/dist/controls/number-field.css +54 -0
- package/views/dist/controls/option/atom-tag.d.ts +6 -0
- package/views/dist/controls/option/atom-tag.js +6 -0
- package/views/dist/controls/option/looks.d.ts +7 -0
- package/views/dist/controls/option/looks.js +21 -0
- package/views/dist/controls/option/option.d.ts +35 -0
- package/views/dist/controls/option/option.js +32 -0
- package/views/dist/controls/option/tokens.d.ts +223 -0
- package/views/dist/controls/option/tokens.js +58 -0
- package/views/dist/controls/option.css +92 -0
- package/views/dist/controls/phone-header/header-bar.d.ts +18 -0
- package/views/dist/controls/phone-header/header-bar.js +9 -0
- package/views/dist/controls/phone-header/looks.d.ts +4 -0
- package/views/dist/controls/phone-header/looks.js +4 -0
- package/views/dist/controls/phone-header/soft-edge.d.ts +5 -0
- package/views/dist/controls/phone-header/soft-edge.js +3 -0
- package/views/dist/controls/phone-header/tokens.d.ts +59 -0
- package/views/dist/controls/phone-header/tokens.js +17 -0
- package/views/dist/controls/phone-header.css +51 -0
- package/views/dist/controls/popover/looks.d.ts +4 -0
- package/views/dist/controls/popover/looks.js +10 -0
- package/views/dist/controls/popover/map-popover.d.ts +3 -0
- package/views/dist/controls/popover/map-popover.js +5 -0
- package/views/dist/controls/popover/popover.d.ts +74 -0
- package/views/dist/controls/popover/popover.js +106 -0
- package/views/dist/controls/popover/tokens.d.ts +83 -0
- package/views/dist/controls/popover/tokens.js +23 -0
- package/views/dist/controls/popover.css +94 -0
- package/views/dist/controls/scrollbar/scrollbar.d.ts +10 -0
- package/views/dist/controls/scrollbar/scrollbar.js +143 -0
- package/views/dist/controls/scrollbar/tokens.d.ts +43 -0
- package/views/dist/controls/scrollbar/tokens.js +13 -0
- package/views/dist/controls/scrollbar.css +47 -0
- package/views/dist/controls/sheet/bottom-sheet.d.ts +98 -0
- package/views/dist/controls/sheet/bottom-sheet.js +372 -0
- package/views/dist/controls/sheet/forms.d.ts +38 -0
- package/views/dist/controls/sheet/forms.js +26 -0
- package/views/dist/controls/sheet/looks.d.ts +4 -0
- package/views/dist/controls/sheet/looks.js +10 -0
- package/views/dist/controls/sheet/map-sheet.d.ts +3 -0
- package/views/dist/controls/sheet/map-sheet.js +12 -0
- package/views/dist/controls/sheet/spring.d.ts +22 -0
- package/views/dist/controls/sheet/spring.js +48 -0
- package/views/dist/controls/sheet/tokens.d.ts +143 -0
- package/views/dist/controls/sheet/tokens.js +38 -0
- package/views/dist/controls/sheet.css +220 -0
- package/views/dist/controls/smooth.css +101 -0
- package/views/dist/controls/spinner/looks.d.ts +4 -0
- package/views/dist/controls/spinner/looks.js +32 -0
- package/views/dist/controls/spinner/spinner.d.ts +23 -0
- package/views/dist/controls/spinner/spinner.js +16 -0
- package/views/dist/controls/spinner/tokens.d.ts +55 -0
- package/views/dist/controls/spinner/tokens.js +16 -0
- package/views/dist/controls/spinner.css +147 -0
- package/views/dist/controls/status/atom-status-badge.d.ts +10 -0
- package/views/dist/controls/status/atom-status-badge.js +13 -0
- package/views/dist/controls/status/looks.d.ts +4 -0
- package/views/dist/controls/status/looks.js +22 -0
- package/views/dist/controls/status/marks.d.ts +26 -0
- package/views/dist/controls/status/marks.js +73 -0
- package/views/dist/controls/status/status.d.ts +43 -0
- package/views/dist/controls/status/status.js +26 -0
- package/views/dist/controls/status/tokens.d.ts +407 -0
- package/views/dist/controls/status/tokens.js +104 -0
- package/views/dist/controls/status.css +164 -0
- package/views/dist/controls/switch/looks.d.ts +4 -0
- package/views/dist/controls/switch/looks.js +19 -0
- package/views/dist/controls/switch/switch.d.ts +15 -0
- package/views/dist/controls/switch/switch.js +11 -0
- package/views/dist/controls/switch/tokens.d.ts +139 -0
- package/views/dist/controls/switch/tokens.js +37 -0
- package/views/dist/controls/switch.css +169 -0
- package/views/dist/controls/tag/atom-cell-more.d.ts +3 -0
- package/views/dist/controls/tag/atom-cell-more.js +5 -0
- package/views/dist/controls/tag/looks.d.ts +4 -0
- package/views/dist/controls/tag/looks.js +4 -0
- package/views/dist/controls/tag/tag.d.ts +25 -0
- package/views/dist/controls/tag/tag.js +19 -0
- package/views/dist/controls/tag/tokens.d.ts +63 -0
- package/views/dist/controls/tag/tokens.js +18 -0
- package/views/dist/controls/tag.css +81 -0
- package/views/dist/controls/toggle/looks.d.ts +3 -0
- package/views/dist/controls/toggle/looks.js +12 -0
- package/views/dist/controls/toggle/toggle.d.ts +47 -0
- package/views/dist/controls/toggle/toggle.js +23 -0
- package/views/dist/controls/toggle/tokens.d.ts +55 -0
- package/views/dist/controls/toggle/tokens.js +16 -0
- package/views/dist/controls/toggle.css +67 -0
- package/views/dist/controls/tokens.d.ts +16 -0
- package/views/dist/controls/tokens.js +45 -0
- package/views/dist/controls/tooltip/looks.d.ts +4 -0
- package/views/dist/controls/tooltip/looks.js +4 -0
- package/views/dist/controls/tooltip/map-tooltip.d.ts +3 -0
- package/views/dist/controls/tooltip/map-tooltip.js +5 -0
- package/views/dist/controls/tooltip/tokens.d.ts +75 -0
- package/views/dist/controls/tooltip/tokens.js +21 -0
- package/views/dist/controls/tooltip/tooltip.d.ts +54 -0
- package/views/dist/controls/tooltip/tooltip.js +78 -0
- package/views/dist/controls/tooltip.css +94 -0
- package/views/dist/display/date.js +15 -2
- package/views/dist/grid/chrome/GridTable.js +21 -19
- package/views/dist/grid/chrome/grid-row-window.js +3 -0
- package/views/dist/grid/chrome/useGridColumnLayout.d.ts +4 -1
- package/views/dist/grid/chrome/useGridColumnLayout.js +17 -2
- package/views/dist/grid/chrome/useGridFittedWidths.d.ts +29 -0
- package/views/dist/grid/chrome/useGridFittedWidths.js +46 -0
- package/views/dist/looks/index.d.ts +17 -0
- package/views/dist/looks/index.js +17 -0
- package/views/dist/looks/looks.d.ts +2 -1
- package/views/dist/looks/pieces.js +37 -1
- package/views/dist/model/column-schema.d.ts +3 -2
- package/views/dist/model/column-state.d.ts +11 -1
- package/views/dist/model/column-state.js +8 -2
- package/views/dist/panels/react/views-row/FoldingViewRow.js +8 -8
- package/views/dist/styles.css +2748 -56
- package/views/dist/styles.unlayered.css +2765 -56
- package/views/docs/contract.md +39 -8
- package/views/docs/controls/button.md +93 -0
- package/views/docs/controls/checkbox.md +38 -0
- package/views/docs/controls/field.md +26 -0
- package/views/docs/controls/glass-button.md +37 -0
- package/views/docs/controls/inline-input.md +27 -0
- package/views/docs/controls/input.md +48 -0
- package/views/docs/controls/kbd.md +17 -0
- package/views/docs/controls/number-field.md +17 -0
- package/views/docs/controls/option.md +61 -0
- package/views/docs/controls/phone-header.md +20 -0
- package/views/docs/controls/popover.md +26 -0
- package/views/docs/controls/scrollbar.md +16 -0
- package/views/docs/controls/sheet.md +41 -0
- package/views/docs/controls/spinner.md +19 -0
- package/views/docs/controls/status.md +107 -0
- package/views/docs/controls/switch.md +40 -0
- package/views/docs/controls/tag.md +21 -0
- package/views/docs/controls/toggle.md +19 -0
- package/views/docs/controls/tooltip.md +24 -0
- package/views/docs/getting-started.md +1 -1
- package/views/docs/guides/the-provider.md +1 -1
- package/views/docs/index.md +1 -0
- package/views/docs/install.md +2 -0
- package/views/docs/reference/controls.md +207 -0
- package/views/docs/reference/looks.md +77 -2
- package/views/docs/reference/views.md +10 -2
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Button as BaseButton } from "@base-ui/react/button";
|
|
4
|
+
import { cx } from "../../internal/cx.js";
|
|
5
|
+
import { Spinner } from "../spinner/spinner.js";
|
|
6
|
+
import { buttonOwnAttrs } from "./own-look.js";
|
|
7
|
+
const KIND = {
|
|
8
|
+
primary: "o-button-primary", outline: "o-button-outline", soft: "o-button-soft", quiet: "o-button-quiet", danger: "o-button-danger",
|
|
9
|
+
information: "o-button-information", success: "o-button-success", warning: "o-button-warning", link: "o-button-link", text: "o-button-text",
|
|
10
|
+
};
|
|
11
|
+
const SIZE = {
|
|
12
|
+
"2xs": "o-button-2xs", xs: "o-button-xs", sm: "o-button-sm", md: "", lg: "o-button-lg", "44": "o-button-44",
|
|
13
|
+
"20": "o-button-20", "22": "o-button-22", "26": "o-button-26", "20x24": "o-button-20x24", "32x44": "o-button-32x44", "40x44": "o-button-40x44", line: "o-button-line",
|
|
14
|
+
};
|
|
15
|
+
const SHAPE = { default: "", icon: "o-button-icon", round: "o-button-round" };
|
|
16
|
+
export function buttonClass(kind, size, shape) {
|
|
17
|
+
return cx("o-button", KIND[kind ?? "outline"], SIZE[size ?? "md"], SHAPE[shape ?? "default"]);
|
|
18
|
+
}
|
|
19
|
+
export const Button = React.forwardRef(function Button({ kind, size, shape, loading = false, icon, iconEnd, look, className, children, onClick, ...props }, ref) {
|
|
20
|
+
if (process.env.NODE_ENV !== "production" && (shape === "icon" || shape === "round") && !props["aria-label"] && !props["aria-labelledby"])
|
|
21
|
+
console.warn("ViewKit Button: an icon-only button needs an aria-label, the name its tooltip shows too.");
|
|
22
|
+
const link = React.isValidElement(props.render) && props.render.props.href != null;
|
|
23
|
+
const linkKeys = link ? {
|
|
24
|
+
role: props.role,
|
|
25
|
+
onKeyDown: (e) => { if (e.key === " ")
|
|
26
|
+
e.preventBaseUIHandler?.(); props.onKeyDown?.(e); },
|
|
27
|
+
onKeyUp: (e) => { if (e.key === " ")
|
|
28
|
+
e.preventBaseUIHandler?.(); props.onKeyUp?.(e); },
|
|
29
|
+
} : {};
|
|
30
|
+
return (_jsxs(BaseButton, { ref: ref, className: cx(buttonClass(kind, size, shape), className), "aria-busy": loading || undefined, onClick: loading ? (e) => e.preventDefault() : onClick, "data-kit": "button", ...(look ? buttonOwnAttrs(look) : {}), ...props, ...linkKeys, children: [icon != null && _jsx("span", { "data-slot": "vk-button-icon", children: icon }), children != null && _jsx("span", { "data-slot": "vk-button-label", children: children }), iconEnd != null && _jsx("span", { "data-slot": "vk-button-icon", children: iconEnd }), loading && _jsx("span", { "data-slot": "vk-button-spinner", children: _jsx(Spinner, { size: size === "sm" ? 14 : size == null || size === "md" || size === "lg" || size === "44" || size === "32x44" || size === "40x44" ? 16 : 12, label: "" }) }), _jsx("span", { className: "o-button-cut", "aria-hidden": "true", children: _jsx("span", { className: "o-smooth o-smooth-ease" }) })] }));
|
|
31
|
+
});
|
|
32
|
+
export function ButtonGroup({ orientation = "horizontal", className, children, ...props }) {
|
|
33
|
+
return _jsx("div", { role: "group", "data-orientation": orientation, className: cx("o-button-group", className), ...props, children: children });
|
|
34
|
+
}
|
|
35
|
+
export function ButtonGroupText({ className, children, ...props }) {
|
|
36
|
+
return _jsx("div", { className: cx("o-button-group-text", className), ...props, children: children });
|
|
37
|
+
}
|
|
38
|
+
export function ButtonGroupSeparator({ className }) {
|
|
39
|
+
return _jsx("span", { role: "separator", className: cx("o-button-group-sep", className) });
|
|
40
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PieceLooks } from "../../looks/looks.js";
|
|
2
|
+
export type ButtonLookOptionId = "radius" | "smoothing" | "depth" | "hover" | "press" | "soft" | "weight";
|
|
3
|
+
/** The Button's options and looks. */
|
|
4
|
+
export declare const BUTTON_LOOKS: PieceLooks<ButtonLookOptionId>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const options = [
|
|
2
|
+
{ id: "radius", name: "Corners", def: "lg", kind: "steps", values: ["xs", "sm", "md", "lg", "xl", "2xl", "full"].map((id) => ({ id, name: id === "full" ? "Full" : id })) },
|
|
3
|
+
{ id: "smoothing", name: "Corner smoothing", def: "app", values: [{ id: "app", name: "The app's" }, { id: "smooth", name: "Smooth" }, { id: "round", name: "Round" }] },
|
|
4
|
+
{ id: "depth", name: "Depth", def: "flat", values: [{ id: "flat", name: "Flat" }, { id: "edged", name: "Edged" }, { id: "lifted", name: "Lifted" }] },
|
|
5
|
+
{ id: "hover", name: "Under the pointer", def: "tone", values: [{ id: "tone", name: "A tone" }, { id: "brighter", name: "Brighter" }, { id: "rises", name: "Rises" }] },
|
|
6
|
+
{ id: "press", name: "Press", def: "settles", values: [{ id: "settles", name: "Settles" }, { id: "sinks", name: "Sinks" }, { id: "springs", name: "Springs" }, { id: "lands", name: "Lands" }] },
|
|
7
|
+
{ id: "soft", name: "The soft kind", def: "grey", values: [{ id: "grey", name: "Grey" }, { id: "tint", name: "Brand tint" }] },
|
|
8
|
+
{ id: "weight", name: "Label weight", def: "medium", values: [{ id: "medium", name: "Medium" }, { id: "semibold", name: "Semibold" }] },
|
|
9
|
+
];
|
|
10
|
+
export const BUTTON_LOOKS = {
|
|
11
|
+
id: "button",
|
|
12
|
+
name: "Button",
|
|
13
|
+
options,
|
|
14
|
+
looks: [
|
|
15
|
+
{ id: "classic", name: "Classic", picks: { radius: "lg", smoothing: "app", depth: "flat", hover: "tone", press: "settles", soft: "grey", weight: "medium" } },
|
|
16
|
+
{ id: "keycap", name: "Keycap", picks: { radius: "lg", smoothing: "app", depth: "edged", hover: "brighter", press: "sinks", soft: "grey", weight: "medium" } },
|
|
17
|
+
{ id: "pill", name: "Pill", picks: { radius: "full", smoothing: "app", depth: "flat", hover: "tone", press: "springs", soft: "tint", weight: "medium" } },
|
|
18
|
+
{ id: "soft-lift", name: "Soft lift", picks: { radius: "lg", smoothing: "app", depth: "lifted", hover: "rises", press: "lands", soft: "grey", weight: "medium" } },
|
|
19
|
+
],
|
|
20
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ViewsButtonProps } from "../../provider/components.js";
|
|
3
|
+
/** A glyph ViewKit hands before a button's words (+ Add column's "+", its icon in a fragment with the words) is the Button's
|
|
4
|
+
* icon, so it stands before the words on one line, never stacked over them in the label. The glyph is an svg or one of the
|
|
5
|
+
* app's icons (`glyphs`), never another component; a glyph alone stays the children. */
|
|
6
|
+
export declare function leadingGlyph(children: React.ReactNode, glyphs: ReadonlySet<unknown>): {
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
label: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/** ViewKit's button, drawn as the kit's Button. Outside a provider (an app drawing it on its own) only an svg is a glyph. */
|
|
11
|
+
export declare function MapButton({ variant, size, type, children, ...rest }: ViewsButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { ViewsContext } from "../../provider/context.js";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
const KIND = {
|
|
6
|
+
default: "primary", ghost: "quiet", outline: "outline", destructive: "danger", secondary: "soft",
|
|
7
|
+
};
|
|
8
|
+
export function leadingGlyph(children, glyphs) {
|
|
9
|
+
const inner = React.isValidElement(children) && children.type === React.Fragment ? children.props.children : children;
|
|
10
|
+
const parts = React.Children.toArray(inner);
|
|
11
|
+
const first = parts[0];
|
|
12
|
+
const glyph = React.isValidElement(first) && (first.type === "svg" || glyphs.has(first.type));
|
|
13
|
+
return parts.length > 1 && glyph ? { icon: first, label: parts.slice(1) } : { label: children };
|
|
14
|
+
}
|
|
15
|
+
export function MapButton({ variant = "default", size = "default", type = "button", children, ...rest }) {
|
|
16
|
+
const icons = React.useContext(ViewsContext)?.icons;
|
|
17
|
+
const glyphs = React.useMemo(() => new Set(icons ? Object.values(icons) : []), [icons]);
|
|
18
|
+
const { icon, label } = size === "icon" ? { icon: undefined, label: children } : leadingGlyph(children, glyphs);
|
|
19
|
+
return _jsx(Button, { kind: KIND[variant], size: size === "default" ? "md" : "sm", shape: size === "icon" ? "icon" : "default", type: type, icon: icon, ...rest, children: label });
|
|
20
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export interface ButtonOwnLook {
|
|
2
|
+
/** Its radius step; none, square. */
|
|
3
|
+
radius?: "none" | "xs" | "sm" | "md" | "lg";
|
|
4
|
+
/** Its corners round, never the smooth corner. */
|
|
5
|
+
corner?: "round";
|
|
6
|
+
/** No edge: none of the Button's 1px border. */
|
|
7
|
+
edge?: "none";
|
|
8
|
+
/** Its words: the place's (size, weight, line), or the place's at xs or sm, or xs at medium. */
|
|
9
|
+
words?: "inherit" | "xs" | "sm" | "xs-medium" | "lg";
|
|
10
|
+
/** Its colour, kept in every state but disabled: faint, the link's, the text's, or the place's. */
|
|
11
|
+
colour?: "faint" | "link" | "text" | "inherit";
|
|
12
|
+
/** Its icons' size, px. */
|
|
13
|
+
icon?: "12" | "14" | "15" | "16" | "20";
|
|
14
|
+
/** Its icons' colour apart from its words: faint, in every state; or subtle, the quiet kind's rest, kept while its words
|
|
15
|
+
* take the text's colour under the pointer, in every state but disabled; or the brand's. */
|
|
16
|
+
iconColour?: "faint" | "subtle" | "brand";
|
|
17
|
+
/** Its room left and right, px: none, the same each side, or 6 at its start and 4 at its end. */
|
|
18
|
+
pad?: "0" | "4" | "6" | "8" | "6-4";
|
|
19
|
+
/** The room between its words and its icons, px. */
|
|
20
|
+
gap?: "3" | "4" | "6" | "8" | "10";
|
|
21
|
+
/** Under the pointer: nothing changes; or its words alone take the text's colour, no ground under them; or a ground of its
|
|
22
|
+
* own: the popup's hover (overlay), or the neutral ground, pressed too. */
|
|
23
|
+
hover?: "none" | "words" | "overlay" | "neutral";
|
|
24
|
+
/** Open (aria-expanded="true"): the ground it has under the pointer; its words and icons in the brand's colour; or the
|
|
25
|
+
* neutral ground. */
|
|
26
|
+
open?: "hovered" | "brand" | "neutral";
|
|
27
|
+
/** Standing pressed (aria-pressed="true"): the popup's hover as its ground, its words the text's. */
|
|
28
|
+
pressed?: "hovered";
|
|
29
|
+
/** Disabled, it keeps its colour and the arrow: plain, never the disabled grey. With a colour named; a quiet Button keeps no
|
|
30
|
+
* ground. */
|
|
31
|
+
disabled?: "plain";
|
|
32
|
+
/** The hand that grabs: a grip's. */
|
|
33
|
+
cursor?: "grab";
|
|
34
|
+
/** Pressed on a card in a popup: the card's pressed step. */
|
|
35
|
+
press?: "card";
|
|
36
|
+
/** Its words at its start, its label growing so an end icon stands at its end. */
|
|
37
|
+
align?: "start";
|
|
38
|
+
/** Its words semibold, over its words' own weight. The frame's Label weight is read from around it, never from it. */
|
|
39
|
+
weight?: "semibold" | "medium";
|
|
40
|
+
/** Its digits one width each (tabular), a month and a year that change in place. */
|
|
41
|
+
digits?: "tabular";
|
|
42
|
+
/** Its last icon turned while what it opens is open or shut (aria-expanded): a quarter clockwise while open (an arrow drawn
|
|
43
|
+
* pointing right), or a quarter back while shut (an arrow drawn pointing down). */
|
|
44
|
+
turn?: "quarter" | "back";
|
|
45
|
+
/** A dot in the brand's colour at its top end corner, saying something is on: set it while it is. */
|
|
46
|
+
dot?: "brand";
|
|
47
|
+
/** Its words cut with … at their end when its place is narrower than they are. */
|
|
48
|
+
cut?: "end";
|
|
49
|
+
/** Room at its end, px, for something laid over it. */
|
|
50
|
+
endRoom?: "30";
|
|
51
|
+
}
|
|
52
|
+
/** Each own option, the attribute it sets (data-button-<attr>) and its values. */
|
|
53
|
+
export declare const buttonOwnOptions: {
|
|
54
|
+
id: keyof ButtonOwnLook;
|
|
55
|
+
attr: string;
|
|
56
|
+
values: string[];
|
|
57
|
+
}[];
|
|
58
|
+
/** The attributes of a Button's own look, on the Button: data-button-own, then each option it names, and only those. */
|
|
59
|
+
export declare function buttonOwnAttrs(look: ButtonOwnLook): Record<string, string>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const buttonOwnOptions = [
|
|
2
|
+
{ id: "radius", attr: "radius", values: ["none", "xs", "sm", "md", "lg"] },
|
|
3
|
+
{ id: "corner", attr: "corner", values: ["round"] },
|
|
4
|
+
{ id: "edge", attr: "edge", values: ["none"] },
|
|
5
|
+
{ id: "words", attr: "words", values: ["inherit", "xs", "sm", "xs-medium", "lg"] },
|
|
6
|
+
{ id: "colour", attr: "colour", values: ["faint", "link", "text", "inherit"] },
|
|
7
|
+
{ id: "icon", attr: "icon", values: ["12", "14", "15", "16", "20"] },
|
|
8
|
+
{ id: "iconColour", attr: "icon-colour", values: ["faint", "subtle", "brand"] },
|
|
9
|
+
{ id: "pad", attr: "pad", values: ["0", "4", "6", "8", "6-4"] },
|
|
10
|
+
{ id: "gap", attr: "gap", values: ["3", "4", "6", "8", "10"] },
|
|
11
|
+
{ id: "hover", attr: "hover", values: ["none", "words", "overlay", "neutral"] },
|
|
12
|
+
{ id: "open", attr: "open", values: ["hovered", "brand", "neutral"] },
|
|
13
|
+
{ id: "pressed", attr: "pressed", values: ["hovered"] },
|
|
14
|
+
{ id: "disabled", attr: "disabled", values: ["plain"] },
|
|
15
|
+
{ id: "cursor", attr: "cursor", values: ["grab"] },
|
|
16
|
+
{ id: "press", attr: "press", values: ["card"] },
|
|
17
|
+
{ id: "align", attr: "align", values: ["start"] },
|
|
18
|
+
{ id: "weight", attr: "weight", values: ["semibold", "medium"] },
|
|
19
|
+
{ id: "digits", attr: "digits", values: ["tabular"] },
|
|
20
|
+
{ id: "turn", attr: "turn", values: ["quarter", "back"] },
|
|
21
|
+
{ id: "dot", attr: "dot", values: ["brand"] },
|
|
22
|
+
{ id: "cut", attr: "cut", values: ["end"] },
|
|
23
|
+
{ id: "endRoom", attr: "end-room", values: ["30"] },
|
|
24
|
+
];
|
|
25
|
+
export function buttonOwnAttrs(look) {
|
|
26
|
+
const attrs = { "data-button-own": "" };
|
|
27
|
+
for (const o of buttonOwnOptions) {
|
|
28
|
+
const v = look[o.id];
|
|
29
|
+
if (v != null)
|
|
30
|
+
attrs[`data-button-${o.attr}`] = v;
|
|
31
|
+
}
|
|
32
|
+
return attrs;
|
|
33
|
+
}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
export declare const BUTTON_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-brand";
|
|
3
|
+
readonly kind: "colour";
|
|
4
|
+
readonly outright: "--background-brand-bold";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-neutral";
|
|
7
|
+
readonly kind: "colour";
|
|
8
|
+
readonly outright: "--background-neutral";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "--vk-neutral-hovered";
|
|
11
|
+
readonly kind: "colour";
|
|
12
|
+
readonly outright: "--background-neutral-hovered";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-border";
|
|
15
|
+
readonly kind: "colour";
|
|
16
|
+
readonly outright: "--border";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-border-bold";
|
|
19
|
+
readonly kind: "colour";
|
|
20
|
+
readonly outright: "--border-bold";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-border-brand";
|
|
23
|
+
readonly kind: "colour";
|
|
24
|
+
readonly outright: "--border-focused";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-border-subtle";
|
|
27
|
+
readonly kind: "colour";
|
|
28
|
+
readonly outright: "--border-subtle";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-fg-brand";
|
|
31
|
+
readonly kind: "colour";
|
|
32
|
+
readonly outright: "--link";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-ground";
|
|
35
|
+
readonly kind: "colour";
|
|
36
|
+
readonly outright: "--surface";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-hovered";
|
|
39
|
+
readonly kind: "colour";
|
|
40
|
+
readonly outright: "--surface-hovered";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-pressed";
|
|
43
|
+
readonly kind: "colour";
|
|
44
|
+
readonly outright: "--surface-pressed";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-fg";
|
|
47
|
+
readonly kind: "colour";
|
|
48
|
+
readonly outright: "--text";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "--vk-fg-on-brand";
|
|
51
|
+
readonly kind: "colour";
|
|
52
|
+
readonly outright: "--text-brand-inverse";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "--vk-fg-inverse";
|
|
55
|
+
readonly kind: "colour";
|
|
56
|
+
readonly outright: "--text-inverse";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "--vk-fg-subtle";
|
|
59
|
+
readonly kind: "colour";
|
|
60
|
+
readonly outright: "--text-subtle";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "--vk-fg-subtlest";
|
|
63
|
+
readonly kind: "colour";
|
|
64
|
+
readonly outright: "--text-subtlest";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "--vk-brand-hovered";
|
|
67
|
+
readonly kind: "colour";
|
|
68
|
+
readonly outright: "--background-brand-bold-hovered";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "--vk-brand-pressed";
|
|
71
|
+
readonly kind: "colour";
|
|
72
|
+
readonly outright: "--background-brand-bold-pressed";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "--vk-brand-subtler";
|
|
75
|
+
readonly kind: "colour";
|
|
76
|
+
readonly outright: "--background-brand-subtler";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "--vk-brand-subtler-hovered";
|
|
79
|
+
readonly kind: "colour";
|
|
80
|
+
readonly outright: "--background-brand-subtler-hovered";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "--vk-brand-subtler-pressed";
|
|
83
|
+
readonly kind: "colour";
|
|
84
|
+
readonly outright: "--background-brand-subtler-pressed";
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "--vk-danger-bold";
|
|
87
|
+
readonly kind: "colour";
|
|
88
|
+
readonly outright: "--background-danger-bold";
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "--vk-danger-bold-hovered";
|
|
91
|
+
readonly kind: "colour";
|
|
92
|
+
readonly outright: "--background-danger-bold-hovered";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "--vk-danger-bold-pressed";
|
|
95
|
+
readonly kind: "colour";
|
|
96
|
+
readonly outright: "--background-danger-bold-pressed";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "--vk-info-bold";
|
|
99
|
+
readonly kind: "colour";
|
|
100
|
+
readonly outright: "--background-information-bold";
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "--vk-info-bold-hovered";
|
|
103
|
+
readonly kind: "colour";
|
|
104
|
+
readonly outright: "--background-information-bold-hovered";
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "--vk-info-bold-pressed";
|
|
107
|
+
readonly kind: "colour";
|
|
108
|
+
readonly outright: "--background-information-bold-pressed";
|
|
109
|
+
}, {
|
|
110
|
+
readonly name: "--vk-success-bold";
|
|
111
|
+
readonly kind: "colour";
|
|
112
|
+
readonly outright: "--background-success-bold";
|
|
113
|
+
}, {
|
|
114
|
+
readonly name: "--vk-success-bold-hovered";
|
|
115
|
+
readonly kind: "colour";
|
|
116
|
+
readonly outright: "--background-success-bold-hovered";
|
|
117
|
+
}, {
|
|
118
|
+
readonly name: "--vk-success-bold-pressed";
|
|
119
|
+
readonly kind: "colour";
|
|
120
|
+
readonly outright: "--background-success-bold-pressed";
|
|
121
|
+
}, {
|
|
122
|
+
readonly name: "--vk-warning-bold";
|
|
123
|
+
readonly kind: "colour";
|
|
124
|
+
readonly outright: "--background-warning-bold";
|
|
125
|
+
}, {
|
|
126
|
+
readonly name: "--vk-warning-bold-hovered";
|
|
127
|
+
readonly kind: "colour";
|
|
128
|
+
readonly outright: "--background-warning-bold-hovered";
|
|
129
|
+
}, {
|
|
130
|
+
readonly name: "--vk-warning-bold-pressed";
|
|
131
|
+
readonly kind: "colour";
|
|
132
|
+
readonly outright: "--background-warning-bold-pressed";
|
|
133
|
+
}, {
|
|
134
|
+
readonly name: "--vk-brighten";
|
|
135
|
+
readonly kind: "colour";
|
|
136
|
+
readonly outright: "--background-brighten";
|
|
137
|
+
}, {
|
|
138
|
+
readonly name: "--vk-darken";
|
|
139
|
+
readonly kind: "colour";
|
|
140
|
+
readonly outright: "--background-darken";
|
|
141
|
+
}, {
|
|
142
|
+
readonly name: "--vk-border-input";
|
|
143
|
+
readonly kind: "colour";
|
|
144
|
+
readonly outright: "--border-input";
|
|
145
|
+
}, {
|
|
146
|
+
readonly name: "--vk-border-input-hovered";
|
|
147
|
+
readonly kind: "colour";
|
|
148
|
+
readonly outright: "--border-input-hovered";
|
|
149
|
+
}, {
|
|
150
|
+
readonly name: "--vk-raised";
|
|
151
|
+
readonly kind: "colour";
|
|
152
|
+
readonly outright: "--surface-raised";
|
|
153
|
+
}, {
|
|
154
|
+
readonly name: "--vk-raised-hovered";
|
|
155
|
+
readonly kind: "colour";
|
|
156
|
+
readonly outright: "--surface-raised-hovered";
|
|
157
|
+
}, {
|
|
158
|
+
readonly name: "--vk-overlay-hovered";
|
|
159
|
+
readonly kind: "colour";
|
|
160
|
+
readonly outright: "--surface-overlay-hovered";
|
|
161
|
+
}, {
|
|
162
|
+
readonly name: "--vk-overlay-pressed";
|
|
163
|
+
readonly kind: "colour";
|
|
164
|
+
readonly outright: "--surface-overlay-pressed";
|
|
165
|
+
}, {
|
|
166
|
+
readonly name: "--vk-overlay-card-pressed";
|
|
167
|
+
readonly kind: "colour";
|
|
168
|
+
readonly outright: "--surface-overlay-card-pressed";
|
|
169
|
+
}, {
|
|
170
|
+
readonly name: "--vk-fg-disabled";
|
|
171
|
+
readonly kind: "colour";
|
|
172
|
+
readonly outright: "--text-disabled";
|
|
173
|
+
}, {
|
|
174
|
+
readonly name: "--vk-fg-accent";
|
|
175
|
+
readonly kind: "colour";
|
|
176
|
+
readonly outright: "--text-brand";
|
|
177
|
+
}, {
|
|
178
|
+
readonly name: "--vk-border-width";
|
|
179
|
+
readonly kind: "size";
|
|
180
|
+
readonly outright: "--border-width";
|
|
181
|
+
}, {
|
|
182
|
+
readonly name: "--vk-corner-smoothing";
|
|
183
|
+
readonly kind: "size";
|
|
184
|
+
readonly outright: "--corner-smoothing";
|
|
185
|
+
}, {
|
|
186
|
+
readonly name: "--vk-dot-size";
|
|
187
|
+
readonly kind: "size";
|
|
188
|
+
readonly outright: "--dot-size";
|
|
189
|
+
}, {
|
|
190
|
+
readonly name: "--vk-duration-instant";
|
|
191
|
+
readonly kind: "motion";
|
|
192
|
+
readonly outright: "--duration-instant";
|
|
193
|
+
}, {
|
|
194
|
+
readonly name: "--vk-duration-fast";
|
|
195
|
+
readonly kind: "motion";
|
|
196
|
+
readonly outright: "--duration-fast";
|
|
197
|
+
}, {
|
|
198
|
+
readonly name: "--vk-duration-base";
|
|
199
|
+
readonly kind: "motion";
|
|
200
|
+
readonly outright: "--duration-base";
|
|
201
|
+
}, {
|
|
202
|
+
readonly name: "--vk-duration-slow";
|
|
203
|
+
readonly kind: "motion";
|
|
204
|
+
readonly outright: "--duration-slow";
|
|
205
|
+
}, {
|
|
206
|
+
readonly name: "--vk-ease-out";
|
|
207
|
+
readonly kind: "motion";
|
|
208
|
+
readonly outright: "--ease-out";
|
|
209
|
+
}, {
|
|
210
|
+
readonly name: "--vk-ease-spring";
|
|
211
|
+
readonly kind: "motion";
|
|
212
|
+
readonly outright: "--ease-spring";
|
|
213
|
+
}, {
|
|
214
|
+
readonly name: "--vk-focus-width";
|
|
215
|
+
readonly kind: "size";
|
|
216
|
+
readonly outright: "--focus-width";
|
|
217
|
+
}, {
|
|
218
|
+
readonly name: "--vk-focus-offset";
|
|
219
|
+
readonly kind: "size";
|
|
220
|
+
readonly outright: "--focus-offset";
|
|
221
|
+
}, {
|
|
222
|
+
readonly name: "--vk-font-weight-medium";
|
|
223
|
+
readonly kind: "size";
|
|
224
|
+
readonly outright: "--font-weight-medium";
|
|
225
|
+
}, {
|
|
226
|
+
readonly name: "--vk-font-weight-semibold";
|
|
227
|
+
readonly kind: "size";
|
|
228
|
+
readonly outright: "--font-weight-semibold";
|
|
229
|
+
}, {
|
|
230
|
+
readonly name: "--vk-hover-lift";
|
|
231
|
+
readonly kind: "motion";
|
|
232
|
+
readonly outright: "--hover-lift";
|
|
233
|
+
}, {
|
|
234
|
+
readonly name: "--vk-press-scale";
|
|
235
|
+
readonly kind: "motion";
|
|
236
|
+
readonly outright: "--press-scale";
|
|
237
|
+
}, {
|
|
238
|
+
readonly name: "--vk-press-squash";
|
|
239
|
+
readonly kind: "motion";
|
|
240
|
+
readonly outright: "--press-squash";
|
|
241
|
+
}, {
|
|
242
|
+
readonly name: "--vk-press-travel";
|
|
243
|
+
readonly kind: "motion";
|
|
244
|
+
readonly outright: "--press-travel";
|
|
245
|
+
}, {
|
|
246
|
+
readonly name: "--vk-press-travel-lg";
|
|
247
|
+
readonly kind: "motion";
|
|
248
|
+
readonly outright: "--press-travel-lg";
|
|
249
|
+
}, {
|
|
250
|
+
readonly name: "--vk-radius-xs";
|
|
251
|
+
readonly kind: "size";
|
|
252
|
+
readonly outright: "--radius-xs";
|
|
253
|
+
}, {
|
|
254
|
+
readonly name: "--vk-radius-sm";
|
|
255
|
+
readonly kind: "size";
|
|
256
|
+
readonly outright: "--radius-sm";
|
|
257
|
+
}, {
|
|
258
|
+
readonly name: "--vk-radius-md";
|
|
259
|
+
readonly kind: "size";
|
|
260
|
+
readonly outright: "--radius-md";
|
|
261
|
+
}, {
|
|
262
|
+
readonly name: "--vk-radius-lg";
|
|
263
|
+
readonly kind: "size";
|
|
264
|
+
readonly outright: "--radius-lg";
|
|
265
|
+
}, {
|
|
266
|
+
readonly name: "--vk-radius-xl";
|
|
267
|
+
readonly kind: "size";
|
|
268
|
+
readonly outright: "--radius-xl";
|
|
269
|
+
}, {
|
|
270
|
+
readonly name: "--vk-radius-2xl";
|
|
271
|
+
readonly kind: "size";
|
|
272
|
+
readonly outright: "--radius-2xl";
|
|
273
|
+
}, {
|
|
274
|
+
readonly name: "--vk-radius-full";
|
|
275
|
+
readonly kind: "size";
|
|
276
|
+
readonly outright: "--radius-full";
|
|
277
|
+
}, {
|
|
278
|
+
readonly name: "--vk-shadow-key";
|
|
279
|
+
readonly kind: "shadow";
|
|
280
|
+
readonly outright: "--shadow-key";
|
|
281
|
+
}, {
|
|
282
|
+
readonly name: "--vk-shadow-key-pressed";
|
|
283
|
+
readonly kind: "shadow";
|
|
284
|
+
readonly outright: "--shadow-key-pressed";
|
|
285
|
+
}, {
|
|
286
|
+
readonly name: "--vk-shadow-key-pressed-bold";
|
|
287
|
+
readonly kind: "shadow";
|
|
288
|
+
readonly outright: "--shadow-key-pressed-bold";
|
|
289
|
+
}, {
|
|
290
|
+
readonly name: "--vk-shadow-key-shallow";
|
|
291
|
+
readonly kind: "shadow";
|
|
292
|
+
readonly outright: "--shadow-key-shallow";
|
|
293
|
+
}, {
|
|
294
|
+
readonly name: "--vk-shadow-key-soft";
|
|
295
|
+
readonly kind: "shadow";
|
|
296
|
+
readonly outright: "--shadow-key-soft";
|
|
297
|
+
}, {
|
|
298
|
+
readonly name: "--vk-shadow-key-subtle";
|
|
299
|
+
readonly kind: "shadow";
|
|
300
|
+
readonly outright: "--shadow-key-subtle";
|
|
301
|
+
}, {
|
|
302
|
+
readonly name: "--vk-shadow-key-subtle-raised";
|
|
303
|
+
readonly kind: "shadow";
|
|
304
|
+
readonly outright: "--shadow-key-subtle-raised";
|
|
305
|
+
}, {
|
|
306
|
+
readonly name: "--vk-shadow-lift";
|
|
307
|
+
readonly kind: "shadow";
|
|
308
|
+
readonly outright: "--shadow-lift";
|
|
309
|
+
}, {
|
|
310
|
+
readonly name: "--vk-shadow-lift-raised";
|
|
311
|
+
readonly kind: "shadow";
|
|
312
|
+
readonly outright: "--shadow-lift-raised";
|
|
313
|
+
}, {
|
|
314
|
+
readonly name: "--vk-shadow-rim";
|
|
315
|
+
readonly kind: "shadow";
|
|
316
|
+
readonly outright: "--shadow-rim";
|
|
317
|
+
}, {
|
|
318
|
+
readonly name: "--vk-shadow-rim-bold";
|
|
319
|
+
readonly kind: "shadow";
|
|
320
|
+
readonly outright: "--shadow-rim-bold";
|
|
321
|
+
}, {
|
|
322
|
+
readonly name: "--vk-shadow-rim-bold-raised";
|
|
323
|
+
readonly kind: "shadow";
|
|
324
|
+
readonly outright: "--shadow-rim-bold-raised";
|
|
325
|
+
}, {
|
|
326
|
+
readonly name: "--vk-shadow-rim-raised";
|
|
327
|
+
readonly kind: "shadow";
|
|
328
|
+
readonly outright: "--shadow-rim-raised";
|
|
329
|
+
}, {
|
|
330
|
+
readonly name: "--vk-spacing";
|
|
331
|
+
readonly kind: "size";
|
|
332
|
+
readonly outright: "--spacing";
|
|
333
|
+
}, {
|
|
334
|
+
readonly name: "--vk-font-size-xs";
|
|
335
|
+
readonly kind: "size";
|
|
336
|
+
readonly outright: "--text-xs";
|
|
337
|
+
}, {
|
|
338
|
+
readonly name: "--vk-font-size-sm";
|
|
339
|
+
readonly kind: "size";
|
|
340
|
+
readonly outright: "--text-sm";
|
|
341
|
+
}, {
|
|
342
|
+
readonly name: "--vk-font-size-base";
|
|
343
|
+
readonly kind: "size";
|
|
344
|
+
readonly outright: "--text-base";
|
|
345
|
+
}, {
|
|
346
|
+
readonly name: "--vk-font-size-lg";
|
|
347
|
+
readonly kind: "size";
|
|
348
|
+
readonly outright: "--text-lg";
|
|
349
|
+
}];
|
|
350
|
+
/** The prefixes of the button's own machinery, set and read by it alone: not public. */
|
|
351
|
+
export declare const BUTTON_PRIVATE: readonly ["--button-"];
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export const BUTTON_TOKENS = [
|
|
2
|
+
{ name: "--vk-brand", kind: "colour", outright: "--background-brand-bold" },
|
|
3
|
+
{ name: "--vk-neutral", kind: "colour", outright: "--background-neutral" },
|
|
4
|
+
{ name: "--vk-neutral-hovered", kind: "colour", outright: "--background-neutral-hovered" },
|
|
5
|
+
{ name: "--vk-border", kind: "colour", outright: "--border" },
|
|
6
|
+
{ name: "--vk-border-bold", kind: "colour", outright: "--border-bold" },
|
|
7
|
+
{ name: "--vk-border-brand", kind: "colour", outright: "--border-focused" },
|
|
8
|
+
{ name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
|
|
9
|
+
{ name: "--vk-fg-brand", kind: "colour", outright: "--link" },
|
|
10
|
+
{ name: "--vk-ground", kind: "colour", outright: "--surface" },
|
|
11
|
+
{ name: "--vk-hovered", kind: "colour", outright: "--surface-hovered" },
|
|
12
|
+
{ name: "--vk-pressed", kind: "colour", outright: "--surface-pressed" },
|
|
13
|
+
{ name: "--vk-fg", kind: "colour", outright: "--text" },
|
|
14
|
+
{ name: "--vk-fg-on-brand", kind: "colour", outright: "--text-brand-inverse" },
|
|
15
|
+
{ name: "--vk-fg-inverse", kind: "colour", outright: "--text-inverse" },
|
|
16
|
+
{ name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
|
|
17
|
+
{ name: "--vk-fg-subtlest", kind: "colour", outright: "--text-subtlest" },
|
|
18
|
+
{ name: "--vk-brand-hovered", kind: "colour", outright: "--background-brand-bold-hovered" },
|
|
19
|
+
{ name: "--vk-brand-pressed", kind: "colour", outright: "--background-brand-bold-pressed" },
|
|
20
|
+
{ name: "--vk-brand-subtler", kind: "colour", outright: "--background-brand-subtler" },
|
|
21
|
+
{ name: "--vk-brand-subtler-hovered", kind: "colour", outright: "--background-brand-subtler-hovered" },
|
|
22
|
+
{ name: "--vk-brand-subtler-pressed", kind: "colour", outright: "--background-brand-subtler-pressed" },
|
|
23
|
+
{ name: "--vk-danger-bold", kind: "colour", outright: "--background-danger-bold" },
|
|
24
|
+
{ name: "--vk-danger-bold-hovered", kind: "colour", outright: "--background-danger-bold-hovered" },
|
|
25
|
+
{ name: "--vk-danger-bold-pressed", kind: "colour", outright: "--background-danger-bold-pressed" },
|
|
26
|
+
{ name: "--vk-info-bold", kind: "colour", outright: "--background-information-bold" },
|
|
27
|
+
{ name: "--vk-info-bold-hovered", kind: "colour", outright: "--background-information-bold-hovered" },
|
|
28
|
+
{ name: "--vk-info-bold-pressed", kind: "colour", outright: "--background-information-bold-pressed" },
|
|
29
|
+
{ name: "--vk-success-bold", kind: "colour", outright: "--background-success-bold" },
|
|
30
|
+
{ name: "--vk-success-bold-hovered", kind: "colour", outright: "--background-success-bold-hovered" },
|
|
31
|
+
{ name: "--vk-success-bold-pressed", kind: "colour", outright: "--background-success-bold-pressed" },
|
|
32
|
+
{ name: "--vk-warning-bold", kind: "colour", outright: "--background-warning-bold" },
|
|
33
|
+
{ name: "--vk-warning-bold-hovered", kind: "colour", outright: "--background-warning-bold-hovered" },
|
|
34
|
+
{ name: "--vk-warning-bold-pressed", kind: "colour", outright: "--background-warning-bold-pressed" },
|
|
35
|
+
{ name: "--vk-brighten", kind: "colour", outright: "--background-brighten" },
|
|
36
|
+
{ name: "--vk-darken", kind: "colour", outright: "--background-darken" },
|
|
37
|
+
{ name: "--vk-border-input", kind: "colour", outright: "--border-input" },
|
|
38
|
+
{ name: "--vk-border-input-hovered", kind: "colour", outright: "--border-input-hovered" },
|
|
39
|
+
{ name: "--vk-raised", kind: "colour", outright: "--surface-raised" },
|
|
40
|
+
{ name: "--vk-raised-hovered", kind: "colour", outright: "--surface-raised-hovered" },
|
|
41
|
+
{ name: "--vk-overlay-hovered", kind: "colour", outright: "--surface-overlay-hovered" },
|
|
42
|
+
{ name: "--vk-overlay-pressed", kind: "colour", outright: "--surface-overlay-pressed" },
|
|
43
|
+
{ name: "--vk-overlay-card-pressed", kind: "colour", outright: "--surface-overlay-card-pressed" },
|
|
44
|
+
{ name: "--vk-fg-disabled", kind: "colour", outright: "--text-disabled" },
|
|
45
|
+
{ name: "--vk-fg-accent", kind: "colour", outright: "--text-brand" },
|
|
46
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
47
|
+
{ name: "--vk-corner-smoothing", kind: "size", outright: "--corner-smoothing" },
|
|
48
|
+
{ name: "--vk-dot-size", kind: "size", outright: "--dot-size" },
|
|
49
|
+
{ name: "--vk-duration-instant", kind: "motion", outright: "--duration-instant" },
|
|
50
|
+
{ name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
|
|
51
|
+
{ name: "--vk-duration-base", kind: "motion", outright: "--duration-base" },
|
|
52
|
+
{ name: "--vk-duration-slow", kind: "motion", outright: "--duration-slow" },
|
|
53
|
+
{ name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
|
|
54
|
+
{ name: "--vk-ease-spring", kind: "motion", outright: "--ease-spring" },
|
|
55
|
+
{ name: "--vk-focus-width", kind: "size", outright: "--focus-width" },
|
|
56
|
+
{ name: "--vk-focus-offset", kind: "size", outright: "--focus-offset" },
|
|
57
|
+
{ name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
|
|
58
|
+
{ name: "--vk-font-weight-semibold", kind: "size", outright: "--font-weight-semibold" },
|
|
59
|
+
{ name: "--vk-hover-lift", kind: "motion", outright: "--hover-lift" },
|
|
60
|
+
{ name: "--vk-press-scale", kind: "motion", outright: "--press-scale" },
|
|
61
|
+
{ name: "--vk-press-squash", kind: "motion", outright: "--press-squash" },
|
|
62
|
+
{ name: "--vk-press-travel", kind: "motion", outright: "--press-travel" },
|
|
63
|
+
{ name: "--vk-press-travel-lg", kind: "motion", outright: "--press-travel-lg" },
|
|
64
|
+
{ name: "--vk-radius-xs", kind: "size", outright: "--radius-xs" },
|
|
65
|
+
{ name: "--vk-radius-sm", kind: "size", outright: "--radius-sm" },
|
|
66
|
+
{ name: "--vk-radius-md", kind: "size", outright: "--radius-md" },
|
|
67
|
+
{ name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
|
|
68
|
+
{ name: "--vk-radius-xl", kind: "size", outright: "--radius-xl" },
|
|
69
|
+
{ name: "--vk-radius-2xl", kind: "size", outright: "--radius-2xl" },
|
|
70
|
+
{ name: "--vk-radius-full", kind: "size", outright: "--radius-full" },
|
|
71
|
+
{ name: "--vk-shadow-key", kind: "shadow", outright: "--shadow-key" },
|
|
72
|
+
{ name: "--vk-shadow-key-pressed", kind: "shadow", outright: "--shadow-key-pressed" },
|
|
73
|
+
{ name: "--vk-shadow-key-pressed-bold", kind: "shadow", outright: "--shadow-key-pressed-bold" },
|
|
74
|
+
{ name: "--vk-shadow-key-shallow", kind: "shadow", outright: "--shadow-key-shallow" },
|
|
75
|
+
{ name: "--vk-shadow-key-soft", kind: "shadow", outright: "--shadow-key-soft" },
|
|
76
|
+
{ name: "--vk-shadow-key-subtle", kind: "shadow", outright: "--shadow-key-subtle" },
|
|
77
|
+
{ name: "--vk-shadow-key-subtle-raised", kind: "shadow", outright: "--shadow-key-subtle-raised" },
|
|
78
|
+
{ name: "--vk-shadow-lift", kind: "shadow", outright: "--shadow-lift" },
|
|
79
|
+
{ name: "--vk-shadow-lift-raised", kind: "shadow", outright: "--shadow-lift-raised" },
|
|
80
|
+
{ name: "--vk-shadow-rim", kind: "shadow", outright: "--shadow-rim" },
|
|
81
|
+
{ name: "--vk-shadow-rim-bold", kind: "shadow", outright: "--shadow-rim-bold" },
|
|
82
|
+
{ name: "--vk-shadow-rim-bold-raised", kind: "shadow", outright: "--shadow-rim-bold-raised" },
|
|
83
|
+
{ name: "--vk-shadow-rim-raised", kind: "shadow", outright: "--shadow-rim-raised" },
|
|
84
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
85
|
+
{ name: "--vk-font-size-xs", kind: "size", outright: "--text-xs" },
|
|
86
|
+
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
87
|
+
{ name: "--vk-font-size-base", kind: "size", outright: "--text-base" },
|
|
88
|
+
{ name: "--vk-font-size-lg", kind: "size", outright: "--text-lg" },
|
|
89
|
+
];
|
|
90
|
+
export const BUTTON_PRIVATE = ["--button-"];
|