viewkitjs 0.22.0 → 0.24.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 +38 -0
- package/package.json +2 -4
- package/views/dist/contract.d.ts +6 -289
- package/views/dist/contract.js +1 -96
- package/views/dist/controls/atoms.d.ts +8 -0
- package/views/dist/controls/atoms.js +8 -0
- package/views/dist/controls/button/tokens.d.ts +351 -0
- package/views/dist/controls/button/tokens.js +90 -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 +12 -3
- package/views/dist/controls/controls.js +13 -1
- 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/grip/grip.d.ts +14 -0
- package/views/dist/controls/grip/grip.js +9 -0
- package/views/dist/controls/index.d.ts +32 -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/hold.d.ts +25 -0
- package/views/dist/controls/internal/hold.js +81 -0
- package/views/dist/controls/internal/icons.d.ts +8 -0
- package/views/dist/controls/internal/icons.js +65 -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/read-token.d.ts +6 -0
- package/views/dist/controls/internal/read-token.js +11 -0
- package/views/dist/controls/internal/reorder.d.ts +44 -0
- package/views/dist/controls/internal/reorder.js +83 -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/list/tokens.d.ts +139 -0
- package/views/dist/controls/list/tokens.js +37 -0
- package/views/dist/controls/list.css +188 -0
- package/views/dist/controls/menu-list/keys.d.ts +7 -0
- package/views/dist/controls/menu-list/keys.js +29 -0
- package/views/dist/controls/menu-list/looks.d.ts +4 -0
- package/views/dist/controls/menu-list/looks.js +20 -0
- package/views/dist/controls/menu-list/menu-list.d.ts +196 -0
- package/views/dist/controls/menu-list/menu-list.js +346 -0
- package/views/dist/controls/menu-list/tokens.d.ts +187 -0
- package/views/dist/controls/menu-list/tokens.js +49 -0
- package/views/dist/controls/menu-list.css +259 -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 +375 -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 +223 -0
- package/views/dist/controls/spinner/tokens.d.ts +55 -0
- package/views/dist/controls/spinner/tokens.js +16 -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 +49 -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/grid/chrome/GridTable.js +21 -19
- package/views/dist/grid/chrome/grid-caret-keys.d.ts +7 -0
- package/views/dist/grid/chrome/grid-caret-keys.js +22 -0
- 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 +32 -0
- package/views/dist/grid/chrome/useGridFittedWidths.js +59 -0
- package/views/dist/grid/chrome/useGridKeyboard.js +3 -0
- package/views/dist/looks/index.d.ts +16 -0
- package/views/dist/looks/index.js +16 -0
- package/views/dist/looks/looks.d.ts +10 -9
- package/views/dist/looks/pieces.js +38 -2
- 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/styles.css +2362 -7
- package/views/dist/styles.unlayered.css +2362 -7
- package/views/docs/contract.md +5 -97
- 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/list.md +40 -0
- package/views/docs/controls/menu-list.md +52 -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/reference/controls.md +213 -2
- package/views/docs/reference/looks.md +70 -3
- package/views/docs/reference/views.md +7 -2
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Button as BaseButton } from "@base-ui/react/button";
|
|
3
|
+
export interface GlassButtonProps extends Omit<BaseButton.Props, "className" | "children" | "nativeButton" | "render"> {
|
|
4
|
+
/** What it does, to a screen reader, when it has no word of its own. */
|
|
5
|
+
"aria-label"?: string;
|
|
6
|
+
/** Its icon: 28 alone, 22 before a word. One of its icon and its word is always there. */
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
/** Its word ("Cancel", "New deal"): it is then a capsule as wide as what it holds. */
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
/** Primary: what confirms, Save or Apply, in the brand's glass. Danger: what takes something away, its word and icon in the
|
|
11
|
+
* danger text. */
|
|
12
|
+
kind?: "primary" | "danger";
|
|
13
|
+
/** On or off, for one that stays pressed (a filter in use, Select): said to screen readers, and tinted with the brand while on. */
|
|
14
|
+
pressed?: boolean;
|
|
15
|
+
/** A count after its icon or its word: the filters in use, the rows picked. */
|
|
16
|
+
count?: number;
|
|
17
|
+
/** A dot in its corner: something new. */
|
|
18
|
+
dot?: boolean;
|
|
19
|
+
/** sm: 36, for an island on a computer; md, 44, everywhere else. */
|
|
20
|
+
size?: "md" | "sm";
|
|
21
|
+
/** The link it is drawn as: an `<a>`, or the app's own Link. */
|
|
22
|
+
render?: React.ReactElement;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/** A button made of glass, for a control that floats over a page: 44 round with one icon, or a capsule holding a word, an icon and
|
|
26
|
+
* a word, a count or a dot (after iOS 26's bar buttons). Primary for what confirms, danger
|
|
27
|
+
* for what takes something away, `pressed` for one that is on or off. `render` draws it as a link (an `<a>`, or the app's own
|
|
28
|
+
* Link). Never in a toolbar, a row or a card, and never glass on glass. */
|
|
29
|
+
export declare const GlassButton: React.ForwardRefExoticComponent<Omit<GlassButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
30
|
+
export interface GlassButtonGroupProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
31
|
+
/** How two stand together, said here: apart, or on one piece of glass. Left out, the Glass button's own option decides (Two
|
|
32
|
+
* buttons, on the frame or the app around it; looks.ts), apart unless it says together. */
|
|
33
|
+
pair?: "separate" | "together";
|
|
34
|
+
/** Its Glass buttons: one, or two. What else stands among them (a sheet's quiet twin of each) is left as it is. */
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
}
|
|
37
|
+
/** Glass buttons standing together: two apart, each with a lighter shadow, since their shadows add up between them; or
|
|
38
|
+
* the same two touching on the glass pill, one piece of glass they share, wearing none of their own, so it is never glass on
|
|
39
|
+
* glass. A primary stays in the pill, a solid brand disc in its slot. With one button it draws nothing of its own. */
|
|
40
|
+
export declare function GlassButtonGroup({ pair, className, children, ...props }: GlassButtonGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, 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 { mergeProps } from "@base-ui/react/merge-props";
|
|
5
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
+
import { cx } from "../../internal/cx.js";
|
|
7
|
+
export const GlassButton = React.forwardRef(function GlassButton({ icon, children, kind, pressed, count, dot, size = "md", render, className, ...props }, ref) {
|
|
8
|
+
const worded = children != null || count != null;
|
|
9
|
+
const classes = cx("o-glass o-glass-button", worded && "o-glass-button-worded", kind === "primary" && "o-glass-button-primary", kind === "danger" && "o-glass-button-danger", pressed && "o-glass-button-on", size === "sm" && "o-glass-button-sm", className);
|
|
10
|
+
const holds = _jsxs(_Fragment, { children: [icon, children != null && _jsx("span", { className: "o-glass-button-word", children: children }), count != null && _jsx("span", { className: "o-glass-button-count", children: count }), dot && _jsx("i", { className: "o-glass-button-dot", "aria-hidden": "true" })] });
|
|
11
|
+
const link = useRender({ defaultTagName: "a", render, enabled: !!render, ref: ref, props: mergeProps({ className: classes, children: holds, "data-kit": "glass-button" }, props) });
|
|
12
|
+
return render ? link : _jsx(BaseButton, { ref: ref, className: classes, "data-kit": "glass-button", "aria-pressed": pressed, ...props, children: holds });
|
|
13
|
+
});
|
|
14
|
+
export function GlassButtonGroup({ pair, className, children, ...props }) {
|
|
15
|
+
return _jsxs("span", { className: cx("o-glass-group", className), "data-pair": pair, ...props, children: [_jsx("i", { className: "o-glass o-glass-pill", "aria-hidden": "true" }), children] });
|
|
16
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
export declare const GLASS_BUTTON_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-glass";
|
|
3
|
+
readonly kind: "colour";
|
|
4
|
+
readonly outright: "--glass";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-glass-rim-soft";
|
|
7
|
+
readonly kind: "colour";
|
|
8
|
+
readonly outright: "--glass-rim-soft";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "--vk-glass-rim-faint";
|
|
11
|
+
readonly kind: "colour";
|
|
12
|
+
readonly outright: "--glass-rim-faint";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-glass-rim";
|
|
15
|
+
readonly kind: "colour";
|
|
16
|
+
readonly outright: "--glass-rim";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-fg";
|
|
19
|
+
readonly kind: "colour";
|
|
20
|
+
readonly outright: "--text";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-brand";
|
|
23
|
+
readonly kind: "colour";
|
|
24
|
+
readonly outright: "--background-brand-bold";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-fg-on-brand";
|
|
27
|
+
readonly kind: "colour";
|
|
28
|
+
readonly outright: "--text-brand-inverse";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-fg-disabled";
|
|
31
|
+
readonly kind: "colour";
|
|
32
|
+
readonly outright: "--text-disabled";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-border-brand";
|
|
35
|
+
readonly kind: "colour";
|
|
36
|
+
readonly outright: "--border-focused";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-ground";
|
|
39
|
+
readonly kind: "colour";
|
|
40
|
+
readonly outright: "--surface";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-danger";
|
|
43
|
+
readonly kind: "colour";
|
|
44
|
+
readonly outright: "--text-danger";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-fg-accent";
|
|
47
|
+
readonly kind: "colour";
|
|
48
|
+
readonly outright: "--text-brand";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "--vk-brand-hovered";
|
|
51
|
+
readonly kind: "colour";
|
|
52
|
+
readonly outright: "--background-brand-bold-hovered";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "--vk-shadow-glass";
|
|
55
|
+
readonly kind: "shadow";
|
|
56
|
+
readonly outright: "--shadow-glass";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "--vk-shadow-glass-pair";
|
|
59
|
+
readonly kind: "shadow";
|
|
60
|
+
readonly outright: "--shadow-glass-pair";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "--vk-shadow-glass-pill";
|
|
63
|
+
readonly kind: "shadow";
|
|
64
|
+
readonly outright: "--shadow-glass-pill";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "--vk-blur-md";
|
|
67
|
+
readonly kind: "size";
|
|
68
|
+
readonly outright: "--blur-md";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "--vk-border-width";
|
|
71
|
+
readonly kind: "size";
|
|
72
|
+
readonly outright: "--border-width";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "--vk-spacing";
|
|
75
|
+
readonly kind: "size";
|
|
76
|
+
readonly outright: "--spacing";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "--vk-radius-full";
|
|
79
|
+
readonly kind: "size";
|
|
80
|
+
readonly outright: "--radius-full";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "--vk-glass-icon-stroke";
|
|
83
|
+
readonly kind: "size";
|
|
84
|
+
readonly outright: "--glass-icon-stroke";
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "--vk-focus-width";
|
|
87
|
+
readonly kind: "size";
|
|
88
|
+
readonly outright: "--focus-width";
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "--vk-focus-offset";
|
|
91
|
+
readonly kind: "size";
|
|
92
|
+
readonly outright: "--focus-offset";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "--vk-font-size-base";
|
|
95
|
+
readonly kind: "size";
|
|
96
|
+
readonly outright: "--text-base";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "--vk-font-weight-medium";
|
|
99
|
+
readonly kind: "size";
|
|
100
|
+
readonly outright: "--font-weight-medium";
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "--vk-font-size-sm";
|
|
103
|
+
readonly kind: "size";
|
|
104
|
+
readonly outright: "--text-sm";
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "--vk-font-weight-semibold";
|
|
107
|
+
readonly kind: "size";
|
|
108
|
+
readonly outright: "--font-weight-semibold";
|
|
109
|
+
}, {
|
|
110
|
+
readonly name: "--vk-font-size-xs";
|
|
111
|
+
readonly kind: "size";
|
|
112
|
+
readonly outright: "--text-xs";
|
|
113
|
+
}, {
|
|
114
|
+
readonly name: "--vk-duration-fast";
|
|
115
|
+
readonly kind: "motion";
|
|
116
|
+
readonly outright: "--duration-fast";
|
|
117
|
+
}, {
|
|
118
|
+
readonly name: "--vk-ease-out";
|
|
119
|
+
readonly kind: "motion";
|
|
120
|
+
readonly outright: "--ease-out";
|
|
121
|
+
}, {
|
|
122
|
+
readonly name: "--vk-press-scale";
|
|
123
|
+
readonly kind: "motion";
|
|
124
|
+
readonly outright: "--press-scale";
|
|
125
|
+
}];
|
|
126
|
+
/** The prefixes of its own machinery, set and read by it alone: not public. */
|
|
127
|
+
export declare const GLASS_BUTTON_PRIVATE: readonly [];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const GLASS_BUTTON_TOKENS = [
|
|
2
|
+
{ name: "--vk-glass", kind: "colour", outright: "--glass" },
|
|
3
|
+
{ name: "--vk-glass-rim-soft", kind: "colour", outright: "--glass-rim-soft" },
|
|
4
|
+
{ name: "--vk-glass-rim-faint", kind: "colour", outright: "--glass-rim-faint" },
|
|
5
|
+
{ name: "--vk-glass-rim", kind: "colour", outright: "--glass-rim" },
|
|
6
|
+
{ name: "--vk-fg", kind: "colour", outright: "--text" },
|
|
7
|
+
{ name: "--vk-brand", kind: "colour", outright: "--background-brand-bold" },
|
|
8
|
+
{ name: "--vk-fg-on-brand", kind: "colour", outright: "--text-brand-inverse" },
|
|
9
|
+
{ name: "--vk-fg-disabled", kind: "colour", outright: "--text-disabled" },
|
|
10
|
+
{ name: "--vk-border-brand", kind: "colour", outright: "--border-focused" },
|
|
11
|
+
{ name: "--vk-ground", kind: "colour", outright: "--surface" },
|
|
12
|
+
{ name: "--vk-danger", kind: "colour", outright: "--text-danger" },
|
|
13
|
+
{ name: "--vk-fg-accent", kind: "colour", outright: "--text-brand" },
|
|
14
|
+
{ name: "--vk-brand-hovered", kind: "colour", outright: "--background-brand-bold-hovered" },
|
|
15
|
+
{ name: "--vk-shadow-glass", kind: "shadow", outright: "--shadow-glass" },
|
|
16
|
+
{ name: "--vk-shadow-glass-pair", kind: "shadow", outright: "--shadow-glass-pair" },
|
|
17
|
+
{ name: "--vk-shadow-glass-pill", kind: "shadow", outright: "--shadow-glass-pill" },
|
|
18
|
+
{ name: "--vk-blur-md", kind: "size", outright: "--blur-md" },
|
|
19
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
20
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
21
|
+
{ name: "--vk-radius-full", kind: "size", outright: "--radius-full" },
|
|
22
|
+
{ name: "--vk-glass-icon-stroke", kind: "size", outright: "--glass-icon-stroke" },
|
|
23
|
+
{ name: "--vk-focus-width", kind: "size", outright: "--focus-width" },
|
|
24
|
+
{ name: "--vk-focus-offset", kind: "size", outright: "--focus-offset" },
|
|
25
|
+
{ name: "--vk-font-size-base", kind: "size", outright: "--text-base" },
|
|
26
|
+
{ name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
|
|
27
|
+
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
28
|
+
{ name: "--vk-font-weight-semibold", kind: "size", outright: "--font-weight-semibold" },
|
|
29
|
+
{ name: "--vk-font-size-xs", kind: "size", outright: "--text-xs" },
|
|
30
|
+
{ name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
|
|
31
|
+
{ name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
|
|
32
|
+
{ name: "--vk-press-scale", kind: "motion", outright: "--press-scale" },
|
|
33
|
+
];
|
|
34
|
+
export const GLASS_BUTTON_PRIVATE = [];
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/* The Glass button, measured on Apple's sheet, and the glass it is made of. Every value it draws with is a public name
|
|
2
|
+
(controls/glass-button/tokens.ts); this file only says which name each part takes: 44 round, 16 from what it stands in.
|
|
3
|
+
data-force draws a state for a page that shows it. What an app sets once is a data attribute on the frame around it
|
|
4
|
+
(looks.ts):
|
|
5
|
+
|
|
6
|
+
data-glass-button-pair separate · together how two stand together: apart, or on one piece of glass
|
|
7
|
+
|
|
8
|
+
The rules sit in the components layer, so a utility class on one still wins. */
|
|
9
|
+
@layer components {
|
|
10
|
+
|
|
11
|
+
/* ── Glass, written once: what a control floating over a page is made of. What wears it gives it its shape, and stands
|
|
12
|
+
positioned, for its rim: the Glass button, and the glass pill. ── */
|
|
13
|
+
.o-glass {
|
|
14
|
+
background-color: var(--vk-glass); box-shadow: var(--vk-shadow-glass);
|
|
15
|
+
-webkit-backdrop-filter: blur(var(--vk-blur-md)); backdrop-filter: blur(var(--vk-blur-md));
|
|
16
|
+
}
|
|
17
|
+
/* Its rim: a ring of its own, since a border can't change round a curve. Brightest top left and bottom right, fading at the other
|
|
18
|
+
two corners, in light and dark, so it reads as light catching an edge and never as a border. */
|
|
19
|
+
.o-glass::after {
|
|
20
|
+
content: ""; position: absolute; inset: 0; box-sizing: border-box; border-radius: inherit; padding: var(--vk-border-width); pointer-events: none;
|
|
21
|
+
background: conic-gradient(var(--vk-glass-rim-soft) 0deg, var(--vk-glass-rim-faint) 40deg, var(--vk-glass-rim-soft) 85deg, var(--vk-glass-rim) 140deg, var(--vk-glass-rim-soft) 180deg, var(--vk-glass-rim-faint) 220deg, var(--vk-glass-rim-soft) 265deg, var(--vk-glass-rim) 315deg, var(--vk-glass-rim-soft) 360deg);
|
|
22
|
+
-webkit-mask: linear-gradient(black 0 0) content-box, linear-gradient(black 0 0); -webkit-mask-composite: xor;
|
|
23
|
+
mask: linear-gradient(black 0 0) content-box exclude, linear-gradient(black 0 0);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
.o-glass-button {
|
|
28
|
+
position: relative; flex: none; display: grid; place-items: center; box-sizing: border-box;
|
|
29
|
+
width: calc(var(--vk-spacing) * 11); height: calc(var(--vk-spacing) * 11); margin: 0; padding: 0;
|
|
30
|
+
border: 0; border-radius: var(--vk-radius-full); color: var(--vk-fg);
|
|
31
|
+
cursor: pointer; outline: none; text-decoration: none; -webkit-tap-highlight-color: transparent;
|
|
32
|
+
transition: scale var(--vk-duration-fast) var(--vk-ease-out);
|
|
33
|
+
}
|
|
34
|
+
/* Its icon, 28 with a line 2 thick, so an X stands 16 wide. */
|
|
35
|
+
.o-glass-button svg { width: calc(var(--vk-spacing) * 7); height: calc(var(--vk-spacing) * 7); stroke-width: var(--vk-glass-icon-stroke); }
|
|
36
|
+
|
|
37
|
+
/* Primary: what confirms, Save or Apply. The same glass tinted with the brand, mixed as the soft edge mixes its ground, so it
|
|
38
|
+
follows the brand picked; its icon in the inverse text. Disabled, it is plain glass again. */
|
|
39
|
+
.o-glass.o-glass-button-primary { background-color: color-mix(in oklab, var(--vk-brand) 90%, transparent); color: var(--vk-fg-on-brand); }
|
|
40
|
+
.o-glass.o-glass-button-primary:is(:disabled, [data-disabled]) { background-color: var(--vk-glass); color: var(--vk-fg-disabled); }
|
|
41
|
+
|
|
42
|
+
/* A dot in an icon is a small ring: filled, so the thinner line leaves no hole in it. */
|
|
43
|
+
.o-glass-button path[d*="a1 1 0 1 0 2 0"] { fill: currentColor; }
|
|
44
|
+
|
|
45
|
+
/* Pressed, it settles. */
|
|
46
|
+
.o-glass-button:is(:active, [data-force="press"]):not(:disabled, [data-disabled]) { scale: var(--vk-press-scale); }
|
|
47
|
+
/* Focus: the outline 2px outside it. */
|
|
48
|
+
.o-glass-button:is(:focus-visible, [data-force="focus"]) { outline: var(--vk-focus-width) solid var(--vk-border-brand); outline-offset: var(--vk-focus-offset); }
|
|
49
|
+
/* Disabled: its icon greyed, no shadow. */
|
|
50
|
+
.o-glass-button:is(:disabled, [data-disabled]) { box-shadow: none; color: var(--vk-fg-disabled); cursor: not-allowed; }
|
|
51
|
+
|
|
52
|
+
@media (prefers-reduced-motion: reduce) { .o-glass-button { transition: none; } .o-glass-button:is(:active, [data-force="press"]) { scale: none; } }
|
|
53
|
+
|
|
54
|
+
/* ── What it can hold. A word, or a count: a
|
|
55
|
+
capsule as wide as what it holds, 16 in from each end, its word text-base at medium weight; an icon before the word is 22 on
|
|
56
|
+
a line 2 thick, 6 from it, and stands 14 in. An icon alone is as it was, 28 in its 44 round. ──────────────────────────── */
|
|
57
|
+
.o-glass-button.o-glass-button-worded {
|
|
58
|
+
display: inline-flex; align-items: center; justify-content: center; gap: calc(var(--vk-spacing) * 1.5);
|
|
59
|
+
width: auto; min-width: calc(var(--vk-spacing) * 11); padding-inline: calc(var(--vk-spacing) * 4);
|
|
60
|
+
font: inherit; font-size: var(--vk-font-size-base); line-height: 1; font-weight: var(--vk-font-weight-medium); white-space: nowrap;
|
|
61
|
+
}
|
|
62
|
+
.o-glass-button.o-glass-button-worded:has(svg) { padding-inline-start: calc(var(--vk-spacing) * 3.5); }
|
|
63
|
+
.o-glass-button.o-glass-button-worded svg { flex: none; width: calc(var(--vk-spacing) * 5.5); height: calc(var(--vk-spacing) * 5.5); stroke-width: 2; }
|
|
64
|
+
/* Its count: the filters in use, the rows picked, a step smaller and semibold, its figures of one width. */
|
|
65
|
+
.o-glass-button-count { font-size: var(--vk-font-size-sm); font-weight: var(--vk-font-weight-semibold); font-variant-numeric: tabular-nums; }
|
|
66
|
+
/* Its dot, something new: 8 in the brand, in its corner, ringed in the page's ground so it reads over the glass. */
|
|
67
|
+
.o-glass-button-dot {
|
|
68
|
+
position: absolute; top: calc(var(--vk-spacing) * 2.25); right: calc(var(--vk-spacing) * 2.25); width: calc(var(--vk-spacing) * 2); height: calc(var(--vk-spacing) * 2);
|
|
69
|
+
border-radius: var(--vk-radius-full); background-color: var(--vk-brand); box-shadow: 0 0 0 calc(var(--vk-border-width) * 2) var(--vk-ground);
|
|
70
|
+
}
|
|
71
|
+
/* Danger: what takes something away, its word and icon in the danger text, on the same glass. */
|
|
72
|
+
.o-glass-button.o-glass-button-danger:not(:disabled, [data-disabled]) { color: var(--vk-danger); }
|
|
73
|
+
/* On: one that stays pressed. The glass tinted with the brand, lighter than a primary's, its word and icon the brand's text. */
|
|
74
|
+
.o-glass.o-glass-button-on:not(:disabled, [data-disabled]) { background-color: color-mix(in oklab, var(--vk-brand) 18%, var(--vk-glass)); color: var(--vk-fg-accent); }
|
|
75
|
+
/* sm: 36, for an island on a computer. Its icon 22 alone and 18 before a word, its word text-sm, 14 in from each end. */
|
|
76
|
+
.o-glass-button.o-glass-button-sm { width: calc(var(--vk-spacing) * 9); height: calc(var(--vk-spacing) * 9); }
|
|
77
|
+
.o-glass-button.o-glass-button-sm svg { width: calc(var(--vk-spacing) * 5.5); height: calc(var(--vk-spacing) * 5.5); }
|
|
78
|
+
.o-glass-button.o-glass-button-worded.o-glass-button-sm { width: auto; min-width: calc(var(--vk-spacing) * 9); padding-inline: calc(var(--vk-spacing) * 3.5); font-size: var(--vk-font-size-sm); }
|
|
79
|
+
.o-glass-button.o-glass-button-worded.o-glass-button-sm:has(svg) { padding-inline-start: calc(var(--vk-spacing) * 3); }
|
|
80
|
+
.o-glass-button.o-glass-button-worded.o-glass-button-sm svg { width: calc(var(--vk-spacing) * 4.5); height: calc(var(--vk-spacing) * 4.5); }
|
|
81
|
+
.o-glass-button-sm > .o-glass-button-dot { top: calc(var(--vk-spacing) * 1.5); right: calc(var(--vk-spacing) * 1.5); }
|
|
82
|
+
.o-glass-button-sm > .o-glass-button-count { font-size: var(--vk-font-size-xs); }
|
|
83
|
+
|
|
84
|
+
/* ── The Glass button group: Glass buttons standing together, 8
|
|
85
|
+
apart. Its own layout weighs nothing (:where), so a place that is the group (the phone header's right place) lays it out itself.
|
|
86
|
+
How two stand is said by the group (data-pair), or else by the Glass button's own option, Two buttons, on the frame or the app
|
|
87
|
+
around it (data-glass-button-pair, looks.ts; together unless it says separate), where the phone's surface is Glass (the phone header's Surface, which a
|
|
88
|
+
sheet's head reads too): under Flat nothing shares glass. ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
89
|
+
:where(.o-glass-group) { position: relative; display: inline-flex; align-items: center; gap: calc(var(--vk-spacing) * 2); }
|
|
90
|
+
/* Two side by side: their shadows add up between them, so each is lighter, and the two read as strong as one. */
|
|
91
|
+
:is(.o-glass-group:not([data-phone-header-surface="flat"] *), .o-glass-group[data-pair]):has(.o-glass-button ~ .o-glass-button) > .o-glass-button { box-shadow: var(--vk-shadow-glass-pair); }
|
|
92
|
+
/* The glass pill: one piece of glass two buttons share. The group stands as wide as they do, and they touch, wearing no glass of
|
|
93
|
+
their own, so it is never glass on glass. A primary stays in it, a solid brand disc in its slot, the pill's glass round it,
|
|
94
|
+
darker pressed and under the pointer, as the Button's primary; disabled, the pill's plain glass and a greyed icon. */
|
|
95
|
+
.o-glass.o-glass-pill { display: none; position: absolute; inset: 0; border-radius: var(--vk-radius-full); box-shadow: var(--vk-shadow-glass-pill); }
|
|
96
|
+
:is(.o-glass-group:not([data-phone-header-surface="flat"] .o-glass-group):not([data-glass-button-pair="separate"] .o-glass-group, [data-pair="separate"]), .o-glass-group[data-pair="together"]):has(.o-glass-button ~ .o-glass-button) {
|
|
97
|
+
gap: 0;
|
|
98
|
+
> .o-glass.o-glass-pill { display: block; }
|
|
99
|
+
> .o-glass-button { background-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
|
|
100
|
+
> .o-glass-button::after { display: none; }
|
|
101
|
+
> .o-glass-button.o-glass-button-primary:not(:disabled, [data-disabled]) { background-color: var(--vk-brand); background-clip: content-box; padding: calc(var(--vk-spacing) * 1); }
|
|
102
|
+
> .o-glass-button.o-glass-button-primary:is(:active, [data-force="press"]):not(:disabled, [data-disabled]) { background-color: var(--vk-brand-hovered); }
|
|
103
|
+
@media (hover: hover) { > .o-glass-button.o-glass-button-primary:hover:not(:disabled, [data-disabled]) { background-color: var(--vk-brand-hovered); } }
|
|
104
|
+
/* A primary that holds a word is a brand capsule in its slot, 4 from the pill's edge, its word 12 in. One that is on
|
|
105
|
+
keeps the brand's text and takes no glass of its own: the pill is the one piece of glass. */
|
|
106
|
+
> .o-glass-button.o-glass-button-worded.o-glass-button-primary:not(:disabled, [data-disabled]) {
|
|
107
|
+
background-clip: border-box; height: calc(var(--vk-spacing) * 9); min-width: calc(var(--vk-spacing) * 9); margin: calc(var(--vk-spacing) * 1); padding: 0 calc(var(--vk-spacing) * 3);
|
|
108
|
+
}
|
|
109
|
+
> .o-glass-button.o-glass-button-sm.o-glass-button-primary:not(:disabled, [data-disabled]) { padding: calc(var(--vk-spacing) * 0.75); }
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Button } from "../button/button.js";
|
|
3
|
+
import type { ButtonOwnLook } from "../button/own-look.js";
|
|
4
|
+
/** Its six dots. */
|
|
5
|
+
export declare const GRIP: string[];
|
|
6
|
+
/** Its look: md and round, no edge, faint, the grabbing hand, nothing under the pointer, its icon 14. */
|
|
7
|
+
export declare const GRIP_LOOK: ButtonOwnLook;
|
|
8
|
+
type GripProps = Omit<React.ComponentProps<typeof Button>, "kind" | "shape" | "size" | "look" | "icon" | "aria-label" | "children"> & {
|
|
9
|
+
/** What a press moves, to a screen reader: "Move Amount". */
|
|
10
|
+
label: string;
|
|
11
|
+
};
|
|
12
|
+
/** The grip: the Button a row is moved by, with useReorder's gripProps spread on it. */
|
|
13
|
+
export declare const Grip: React.ForwardRefExoticComponent<Omit<GripProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Button } from "../button/button.js";
|
|
4
|
+
const dot = (x, y) => `M${x} ${y}m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`;
|
|
5
|
+
export const GRIP = [dot(9, 5), dot(9, 12), dot(9, 19), dot(15, 5), dot(15, 12), dot(15, 19)];
|
|
6
|
+
export const GRIP_LOOK = { radius: "md", corner: "round", edge: "none", words: "inherit", colour: "faint", cursor: "grab", hover: "none", icon: "14" };
|
|
7
|
+
export const Grip = React.forwardRef(function Grip({ label, ...props }, ref) {
|
|
8
|
+
return (_jsx(Button, { ref: ref, kind: "quiet", shape: "icon", size: "20x24", look: GRIP_LOOK, "aria-label": label, ...props, icon: _jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: GRIP.map((d) => _jsx("path", { d: d }, d)) }) }));
|
|
9
|
+
});
|
|
@@ -9,3 +9,35 @@ export { Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonClass
|
|
|
9
9
|
export { leadingGlyph } from "./button/map-button.js";
|
|
10
10
|
export { buttonOwnAttrs, buttonOwnOptions, type ButtonOwnLook } from "./button/own-look.js";
|
|
11
11
|
export { LoadingBar, Spinner, type LoadingBarProps, type SpinnerProps } from "./spinner/spinner.js";
|
|
12
|
+
export { POPUP_HOST, popupHostOf } from "./internal/popup-host.js";
|
|
13
|
+
export type { Anchor } from "./internal/anchor.js";
|
|
14
|
+
export { Scrollbar } from "./scrollbar/scrollbar.js";
|
|
15
|
+
export { Kbd, type KbdProps } from "./kbd/kbd.js";
|
|
16
|
+
export { TOOLTIP_TIMING, Tooltip, TooltipGroup, TooltipShown, type TooltipGroupProps, type TooltipProps } from "./tooltip/tooltip.js";
|
|
17
|
+
export { GlassButton, GlassButtonGroup, type GlassButtonGroupProps, type GlassButtonProps } from "./glass-button/glass-button.js";
|
|
18
|
+
export { Popover, PopoverClose, PopoverDescription, PopoverTitle, type PopoverAnchor, type PopoverChangeDetails, type PopoverCloseReason, type PopoverProps, } from "./popover/popover.js";
|
|
19
|
+
export { HeaderBar, type HeaderBarProps } from "./phone-header/header-bar.js";
|
|
20
|
+
export { SoftEdge } from "./phone-header/soft-edge.js";
|
|
21
|
+
export { Sheet, SheetBody, SheetButton, SheetClose, SheetFoot, SheetHead, SheetStep, useSheetCloseAll, type SheetChangeDetails, type SheetForm, type SheetHeadProps, type SheetProps, type SheetStop, } from "./sheet/bottom-sheet.js";
|
|
22
|
+
export { STOPS } from "./sheet/forms.js";
|
|
23
|
+
export { Checkbox, CheckboxList, CheckboxMark, type CheckboxListProps, type CheckboxProps, } from "./checkbox/checkbox.js";
|
|
24
|
+
export { ErrorWords, Field, FieldRowsRow, FieldRows, FieldSeparator, FieldSet, errorsOf, type FieldError, type FieldProps, type FieldRowsRowProps, type FieldRowsProps, type FieldSetProps, } from "./field/field.js";
|
|
25
|
+
export { InlineInput, InlineInputGroup, type InlineInputGroupProps, type InlineInputProps } from "./inline-input/inline-input.js";
|
|
26
|
+
export { OFF_WORD, autofillOff, offWord, useAutofill } from "./input/autofill.js";
|
|
27
|
+
export { Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupContext, InputGroupSegment, pressGroup, type InputChrome, type InputComboboxProps, type InputGroupAddonProps, type InputGroupProps, type InputProps, type InputSize, } from "./input/input.js";
|
|
28
|
+
export { NumberField, type NumberFieldProps } from "./number-field/number-field.js";
|
|
29
|
+
export { Toggle, ToggleGroup, type ToggleGroupProps, type ToggleProps } from "./toggle/toggle.js";
|
|
30
|
+
export { Option, Options, type OptionProps } from "./option/option.js";
|
|
31
|
+
export { Tag, TagCut, TagRemove, type TagProps } from "./tag/tag.js";
|
|
32
|
+
export { Status, StatusGlyph, type DealPlace, type HealthPlace, type PublishedPlace, type RunPlace, type StatusPlace, type StatusProps, type StatusSize, } from "./status/status.js";
|
|
33
|
+
export { MARKS, isDealPlace, markOf, stepOf, type MarkDrawing, type MarkId } from "./status/marks.js";
|
|
34
|
+
export { Switch, type SwitchProps } from "./switch/switch.js";
|
|
35
|
+
export { CONTROL_ATOMS } from "./atoms.js";
|
|
36
|
+
export { colourOf } from "./option/atom-tag.js";
|
|
37
|
+
export { quartersOf, statusPlaceOf } from "./status/atom-status-badge.js";
|
|
38
|
+
export { Icon, iconPaths } from "./internal/icons.js";
|
|
39
|
+
export { GRIP, GRIP_LOOK, Grip } from "./grip/grip.js";
|
|
40
|
+
export { useHoldDrag, type HoldDragProps, type HoldReads } from "./internal/hold.js";
|
|
41
|
+
export { dragAt, gapOf, moved, useReorder, type ReorderDrag, type RowEdges } from "./internal/reorder.js";
|
|
42
|
+
export { rowFor, rowStarting } from "./menu-list/keys.js";
|
|
43
|
+
export { MenuList, MenuListPanelRows, MenuListRow, MenuListRows, MenuListShown, MenuScroll, menuListCloseOf, menuListRowsOf, sheetFormOf, tilesOf, useMenuListOption, useMenuListRows, type MenuChoice, type MenuEntry, type MenuListEntry, type MenuListPanelRowsProps, type MenuListProps, type MenuListTile, } from "./menu-list/menu-list.js";
|
|
@@ -4,3 +4,34 @@ export { Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonClass
|
|
|
4
4
|
export { leadingGlyph } from "./button/map-button.js";
|
|
5
5
|
export { buttonOwnAttrs, buttonOwnOptions } from "./button/own-look.js";
|
|
6
6
|
export { LoadingBar, Spinner } from "./spinner/spinner.js";
|
|
7
|
+
export { POPUP_HOST, popupHostOf } from "./internal/popup-host.js";
|
|
8
|
+
export { Scrollbar } from "./scrollbar/scrollbar.js";
|
|
9
|
+
export { Kbd } from "./kbd/kbd.js";
|
|
10
|
+
export { TOOLTIP_TIMING, Tooltip, TooltipGroup, TooltipShown } from "./tooltip/tooltip.js";
|
|
11
|
+
export { GlassButton, GlassButtonGroup } from "./glass-button/glass-button.js";
|
|
12
|
+
export { Popover, PopoverClose, PopoverDescription, PopoverTitle, } from "./popover/popover.js";
|
|
13
|
+
export { HeaderBar } from "./phone-header/header-bar.js";
|
|
14
|
+
export { SoftEdge } from "./phone-header/soft-edge.js";
|
|
15
|
+
export { Sheet, SheetBody, SheetButton, SheetClose, SheetFoot, SheetHead, SheetStep, useSheetCloseAll, } from "./sheet/bottom-sheet.js";
|
|
16
|
+
export { STOPS } from "./sheet/forms.js";
|
|
17
|
+
export { Checkbox, CheckboxList, CheckboxMark, } from "./checkbox/checkbox.js";
|
|
18
|
+
export { ErrorWords, Field, FieldRowsRow, FieldRows, FieldSeparator, FieldSet, errorsOf, } from "./field/field.js";
|
|
19
|
+
export { InlineInput, InlineInputGroup } from "./inline-input/inline-input.js";
|
|
20
|
+
export { OFF_WORD, autofillOff, offWord, useAutofill } from "./input/autofill.js";
|
|
21
|
+
export { Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupContext, InputGroupSegment, pressGroup, } from "./input/input.js";
|
|
22
|
+
export { NumberField } from "./number-field/number-field.js";
|
|
23
|
+
export { Toggle, ToggleGroup } from "./toggle/toggle.js";
|
|
24
|
+
export { Option, Options } from "./option/option.js";
|
|
25
|
+
export { Tag, TagCut, TagRemove } from "./tag/tag.js";
|
|
26
|
+
export { Status, StatusGlyph, } from "./status/status.js";
|
|
27
|
+
export { MARKS, isDealPlace, markOf, stepOf } from "./status/marks.js";
|
|
28
|
+
export { Switch } from "./switch/switch.js";
|
|
29
|
+
export { CONTROL_ATOMS } from "./atoms.js";
|
|
30
|
+
export { colourOf } from "./option/atom-tag.js";
|
|
31
|
+
export { quartersOf, statusPlaceOf } from "./status/atom-status-badge.js";
|
|
32
|
+
export { Icon, iconPaths } from "./internal/icons.js";
|
|
33
|
+
export { GRIP, GRIP_LOOK, Grip } from "./grip/grip.js";
|
|
34
|
+
export { useHoldDrag } from "./internal/hold.js";
|
|
35
|
+
export { dragAt, gapOf, moved, useReorder } from "./internal/reorder.js";
|
|
36
|
+
export { rowFor, rowStarting } from "./menu-list/keys.js";
|
|
37
|
+
export { MenuList, MenuListPanelRows, MenuListRow, MenuListRows, MenuListShown, MenuScroll, menuListCloseOf, menuListRowsOf, sheetFormOf, tilesOf, useMenuListOption, useMenuListRows, } from "./menu-list/menu-list.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type InputProps } from "../input/input.js";
|
|
3
|
+
export type InlineInputProps = Omit<InputProps, "chrome" | "look" | "size" | "fills" | "grow" | "maxLines" | "minLines" | "lines" | "combobox">;
|
|
4
|
+
/** A box alone: the control itself is the box, its words one line centred in its row. Long text (multiline) stands at the height
|
|
5
|
+
* its place gives it, as a text editor grows its box over the rows below; it never grows by itself. */
|
|
6
|
+
export declare const InlineInput: React.ForwardRefExoticComponent<Omit<InlineInputProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
7
|
+
export interface InlineInputGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Its Input and its InputGroupAddons, as its own children: the Input is its bare control, an InputGroupButton xs (28). */
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/** A box with something beside the value, in one row: a country and its dial code, a currency's code, a unit, a label, a button.
|
|
13
|
+
* A press anywhere in it but a button puts the cursor in its Input, as the InputGroup's does. */
|
|
14
|
+
export declare function InlineInputGroup({ className, children, onMouseDown, ...props }: InlineInputGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cx } from "../../internal/cx.js";
|
|
4
|
+
import { Input, InputGroupContext, pressGroup } from "../input/input.js";
|
|
5
|
+
export const InlineInput = React.forwardRef(function InlineInput({ className, multiline = false, autofill = false, ...props }, ref) {
|
|
6
|
+
return _jsx(Input, { ref: ref, chrome: "bare", fills: false, multiline: multiline, ...(multiline ? { lines: 1 } : {}), autofill: autofill, className: cx("o-inline-input", className), "data-kit": "inline-input", ...props });
|
|
7
|
+
});
|
|
8
|
+
export function InlineInputGroup({ className, children, onMouseDown, ...props }) {
|
|
9
|
+
return (_jsx(InputGroupContext.Provider, { value: { size: "md", cell: true }, children: _jsx("div", { role: "group", className: cx("o-inline-input o-inline-input-group", className), "data-kit": "inline-input", onMouseDown: (e) => { onMouseDown?.(e); pressGroup(e); }, ...props, children: children }) }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const options = [
|
|
2
|
+
{ id: "edge", name: "Edge", def: "line", values: [{ id: "line", name: "Line" }, { id: "ring", name: "Ring" }] },
|
|
3
|
+
{ id: "corners", name: "Corners", def: "md", kind: "steps", values: ["none", "xs", "sm", "md", "lg", "xl", "full"].map((id) => ({ id, name: id === "none" ? "None" : id === "full" ? "Full" : id })) },
|
|
4
|
+
{ id: "ground", name: "Ground", def: "tint", values: [{ id: "plain", name: "Plain" }, { id: "tint", name: "Tint" }, { id: "none", name: "None" }] },
|
|
5
|
+
{ id: "tint", name: "Tint", def: "2", kind: "steps", unless: ["ground", ["plain", "none"]], values: Array.from({ length: 10 }, (_, i) => ({ id: String(i + 1), name: `${(i + 1) * 10}%` })) },
|
|
6
|
+
];
|
|
7
|
+
export const INLINE_INPUT_LOOKS = {
|
|
8
|
+
id: "inline-input",
|
|
9
|
+
name: "Inline input",
|
|
10
|
+
options,
|
|
11
|
+
looks: [
|
|
12
|
+
{ id: "attio", name: "Attio", picks: { edge: "line", corners: "sm", ground: "plain", tint: "3" } },
|
|
13
|
+
{ id: "mihais", name: "Mihai's", picks: { edge: "ring", corners: "md", ground: "plain", tint: "3" } },
|
|
14
|
+
{ id: "tinted", name: "Tinted", picks: { edge: "line", corners: "none", ground: "tint", tint: "3" } },
|
|
15
|
+
],
|
|
16
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export declare const INLINE_INPUT_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-border-brand";
|
|
3
|
+
readonly kind: "colour";
|
|
4
|
+
readonly outright: "--border-focused";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-border-danger";
|
|
7
|
+
readonly kind: "colour";
|
|
8
|
+
readonly outright: "--border-danger";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "--vk-border-width";
|
|
11
|
+
readonly kind: "size";
|
|
12
|
+
readonly outright: "--border-width";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-brand-300";
|
|
15
|
+
readonly kind: "colour";
|
|
16
|
+
readonly outright: "--brand-300";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-fg";
|
|
19
|
+
readonly kind: "colour";
|
|
20
|
+
readonly outright: "--text";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-focus-width";
|
|
23
|
+
readonly kind: "size";
|
|
24
|
+
readonly outright: "--focus-width";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-font-size-base";
|
|
27
|
+
readonly kind: "size";
|
|
28
|
+
readonly outright: "--text-base";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-font-size-sm";
|
|
31
|
+
readonly kind: "size";
|
|
32
|
+
readonly outright: "--text-sm";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-input";
|
|
35
|
+
readonly kind: "colour";
|
|
36
|
+
readonly outright: "--background-input";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-line-height-sm";
|
|
39
|
+
readonly kind: "size";
|
|
40
|
+
readonly outright: "--text-sm--line-height";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-overlay";
|
|
43
|
+
readonly kind: "colour";
|
|
44
|
+
readonly outright: "--surface-overlay";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-radius-2xl";
|
|
47
|
+
readonly kind: "size";
|
|
48
|
+
readonly outright: "--radius-2xl";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "--vk-radius-full";
|
|
51
|
+
readonly kind: "size";
|
|
52
|
+
readonly outright: "--radius-full";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "--vk-radius-lg";
|
|
55
|
+
readonly kind: "size";
|
|
56
|
+
readonly outright: "--radius-lg";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "--vk-radius-md";
|
|
59
|
+
readonly kind: "size";
|
|
60
|
+
readonly outright: "--radius-md";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "--vk-radius-sm";
|
|
63
|
+
readonly kind: "size";
|
|
64
|
+
readonly outright: "--radius-sm";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "--vk-radius-xl";
|
|
67
|
+
readonly kind: "size";
|
|
68
|
+
readonly outright: "--radius-xl";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "--vk-radius-xs";
|
|
71
|
+
readonly kind: "size";
|
|
72
|
+
readonly outright: "--radius-xs";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "--vk-spacing";
|
|
75
|
+
readonly kind: "size";
|
|
76
|
+
readonly outright: "--spacing";
|
|
77
|
+
}];
|
|
78
|
+
/** The prefixes of the inline input's own machinery, set and read by it alone: not public. */
|
|
79
|
+
export declare const INLINE_INPUT_PRIVATE: readonly ["--inline-input-"];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const INLINE_INPUT_TOKENS = [
|
|
2
|
+
{ name: "--vk-border-brand", kind: "colour", outright: "--border-focused" },
|
|
3
|
+
{ name: "--vk-border-danger", kind: "colour", outright: "--border-danger" },
|
|
4
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
5
|
+
{ name: "--vk-brand-300", kind: "colour", outright: "--brand-300" },
|
|
6
|
+
{ name: "--vk-fg", kind: "colour", outright: "--text" },
|
|
7
|
+
{ name: "--vk-focus-width", kind: "size", outright: "--focus-width" },
|
|
8
|
+
{ name: "--vk-font-size-base", kind: "size", outright: "--text-base" },
|
|
9
|
+
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
10
|
+
{ name: "--vk-input", kind: "colour", outright: "--background-input" },
|
|
11
|
+
{ name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
|
|
12
|
+
{ name: "--vk-overlay", kind: "colour", outright: "--surface-overlay" },
|
|
13
|
+
{ name: "--vk-radius-2xl", kind: "size", outright: "--radius-2xl" },
|
|
14
|
+
{ name: "--vk-radius-full", kind: "size", outright: "--radius-full" },
|
|
15
|
+
{ name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
|
|
16
|
+
{ name: "--vk-radius-md", kind: "size", outright: "--radius-md" },
|
|
17
|
+
{ name: "--vk-radius-sm", kind: "size", outright: "--radius-sm" },
|
|
18
|
+
{ name: "--vk-radius-xl", kind: "size", outright: "--radius-xl" },
|
|
19
|
+
{ name: "--vk-radius-xs", kind: "size", outright: "--radius-xs" },
|
|
20
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
21
|
+
];
|
|
22
|
+
export const INLINE_INPUT_PRIVATE = ["--inline-input-"];
|