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,75 @@
|
|
|
1
|
+
export declare const FIELD_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-border-overlay-card";
|
|
3
|
+
readonly kind: "colour";
|
|
4
|
+
readonly outright: "--border-overlay-card";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-border-subtle";
|
|
7
|
+
readonly kind: "colour";
|
|
8
|
+
readonly outright: "--border-subtle";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "--vk-border-width";
|
|
11
|
+
readonly kind: "size";
|
|
12
|
+
readonly outright: "--border-width";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-danger";
|
|
15
|
+
readonly kind: "colour";
|
|
16
|
+
readonly outright: "--text-danger";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-fg";
|
|
19
|
+
readonly kind: "colour";
|
|
20
|
+
readonly outright: "--text";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-fg-disabled";
|
|
23
|
+
readonly kind: "colour";
|
|
24
|
+
readonly outright: "--text-disabled";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-fg-subtle";
|
|
27
|
+
readonly kind: "colour";
|
|
28
|
+
readonly outright: "--text-subtle";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-font-size-base";
|
|
31
|
+
readonly kind: "size";
|
|
32
|
+
readonly outright: "--text-base";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-font-size-sm";
|
|
35
|
+
readonly kind: "size";
|
|
36
|
+
readonly outright: "--text-sm";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-font-size-xs";
|
|
39
|
+
readonly kind: "size";
|
|
40
|
+
readonly outright: "--text-xs";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-font-weight-medium";
|
|
43
|
+
readonly kind: "size";
|
|
44
|
+
readonly outright: "--font-weight-medium";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-font-weight-normal";
|
|
47
|
+
readonly kind: "size";
|
|
48
|
+
readonly outright: "--font-weight-normal";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "--vk-line-height-base";
|
|
51
|
+
readonly kind: "size";
|
|
52
|
+
readonly outright: "--text-base--line-height";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "--vk-line-height-sm";
|
|
55
|
+
readonly kind: "size";
|
|
56
|
+
readonly outright: "--text-sm--line-height";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "--vk-line-height-xs";
|
|
59
|
+
readonly kind: "size";
|
|
60
|
+
readonly outright: "--text-xs--line-height";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "--vk-overlay-card";
|
|
63
|
+
readonly kind: "colour";
|
|
64
|
+
readonly outright: "--surface-overlay-card";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "--vk-radius-xl";
|
|
67
|
+
readonly kind: "size";
|
|
68
|
+
readonly outright: "--radius-xl";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "--vk-spacing";
|
|
71
|
+
readonly kind: "size";
|
|
72
|
+
readonly outright: "--spacing";
|
|
73
|
+
}];
|
|
74
|
+
/** The prefixes of the Field's own machinery, set and read by it alone: not public. */
|
|
75
|
+
export declare const FIELD_PRIVATE: readonly ["--field-"];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const FIELD_TOKENS = [
|
|
2
|
+
{ name: "--vk-border-overlay-card", kind: "colour", outright: "--border-overlay-card" },
|
|
3
|
+
{ name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
|
|
4
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
5
|
+
{ name: "--vk-danger", kind: "colour", outright: "--text-danger" },
|
|
6
|
+
{ name: "--vk-fg", kind: "colour", outright: "--text" },
|
|
7
|
+
{ name: "--vk-fg-disabled", kind: "colour", outright: "--text-disabled" },
|
|
8
|
+
{ name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
|
|
9
|
+
{ name: "--vk-font-size-base", kind: "size", outright: "--text-base" },
|
|
10
|
+
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
11
|
+
{ name: "--vk-font-size-xs", kind: "size", outright: "--text-xs" },
|
|
12
|
+
{ name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
|
|
13
|
+
{ name: "--vk-font-weight-normal", kind: "size", outright: "--font-weight-normal" },
|
|
14
|
+
{ name: "--vk-line-height-base", kind: "size", outright: "--text-base--line-height" },
|
|
15
|
+
{ name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
|
|
16
|
+
{ name: "--vk-line-height-xs", kind: "size", outright: "--text-xs--line-height" },
|
|
17
|
+
{ name: "--vk-overlay-card", kind: "colour", outright: "--surface-overlay-card" },
|
|
18
|
+
{ name: "--vk-radius-xl", kind: "size", outright: "--radius-xl" },
|
|
19
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
20
|
+
];
|
|
21
|
+
export const FIELD_PRIVATE = ["--field-"];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/* A field (its label, note and error), a group of fields (FieldSet), a field's list of errors, the line between
|
|
2
|
+
fields, and a field beside its label, as shadcn's Field draws them, on public names. A field's label and a group's
|
|
3
|
+
legend (which reads as one) are both .o-field-label; a field's label can be quiet instead.
|
|
4
|
+
|
|
5
|
+
The rules sit in the components layer, so a utility class still wins. */
|
|
6
|
+
@layer components {
|
|
7
|
+
|
|
8
|
+
/* ── A field: its label, then its control, then its note or its error ──────────────────────────────── */
|
|
9
|
+
/* Its one column never wider than the field: a control holding a long value (a Select's chosen country) ends in its "…",
|
|
10
|
+
never widening what holds it, as the field beside its label already does. */
|
|
11
|
+
.o-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--vk-spacing) * 1.5); min-width: 0; }
|
|
12
|
+
.o-field-label { font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); font-weight: var(--vk-font-weight-medium); color: var(--vk-fg); }
|
|
13
|
+
/* A quiet label, as a body's parts wear it over their boxes: 12px, regular, subtle; 14px in the phone's form. */
|
|
14
|
+
.o-field[data-field-label="quiet"] > .o-field-label { font-size: var(--vk-font-size-xs); line-height: calc(var(--vk-font-size-xs) * var(--vk-line-height-xs)); font-weight: var(--vk-font-weight-normal); color: var(--vk-fg-subtle); }
|
|
15
|
+
.o-field[data-field-label="quiet"][data-field-form="phone"] > .o-field-label { font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); }
|
|
16
|
+
/* A required field's asterisk, after its label. */
|
|
17
|
+
.o-field-req { margin-left: calc(var(--vk-spacing) * 0.5); color: var(--vk-danger); }
|
|
18
|
+
/* The note says what the field is for or why it is locked; an error takes its place and says the fix. */
|
|
19
|
+
.o-field-note, .o-field-error { margin: 0; font-size: var(--vk-font-size-xs); line-height: calc(var(--vk-font-size-xs) * var(--vk-line-height-xs)); color: var(--vk-fg-subtle); }
|
|
20
|
+
.o-field-error { color: var(--vk-danger); }
|
|
21
|
+
|
|
22
|
+
/* ── A group: its legend, a note under it, the choices or fields, then its error ───────────────────── */
|
|
23
|
+
.o-fieldset { display: grid; gap: calc(var(--vk-spacing) * 3); min-width: 0; margin: 0; padding: 0; border: 0; }
|
|
24
|
+
/* The legend is drawn as a field's label (.o-field-label); with a note under it, the note sits as close as a
|
|
25
|
+
field's does. */
|
|
26
|
+
.o-fieldset-legend:has(+ .o-field-note) { margin-bottom: calc(var(--vk-spacing) * -1.5); }
|
|
27
|
+
.o-fieldset-body { display: grid; min-width: 0; }
|
|
28
|
+
.o-fieldset[disabled] .o-fieldset-legend { color: var(--vk-fg-disabled); }
|
|
29
|
+
/* A part of a form: the legend a heading over its fields, the fields 20px apart. */
|
|
30
|
+
.o-fieldset-section .o-fieldset-legend { font-size: var(--vk-font-size-base); line-height: calc(var(--vk-font-size-base) * var(--vk-line-height-base)); }
|
|
31
|
+
.o-fieldset-section > .o-fieldset-body { gap: calc(var(--vk-spacing) * 5); }
|
|
32
|
+
|
|
33
|
+
/* ── Several errors: a list, each on its own line ──────────────────────────────────────────────────── */
|
|
34
|
+
.o-field-errors { display: grid; gap: calc(var(--vk-spacing) * 0.5); margin: 0; padding-left: calc(var(--vk-spacing) * 4); list-style: disc; }
|
|
35
|
+
|
|
36
|
+
/* ── A line between fields, its word in the middle ─────────────────────────────────────────────────── */
|
|
37
|
+
.o-field-sep { display: flex; align-items: center; gap: calc(var(--vk-spacing) * 3); min-height: calc(var(--vk-spacing) * 5); }
|
|
38
|
+
.o-field-sep-line { flex: 1; height: var(--vk-border-width); background-color: var(--vk-border-subtle); }
|
|
39
|
+
.o-field-sep-words { font-size: var(--vk-font-size-xs); line-height: calc(var(--vk-font-size-xs) * var(--vk-line-height-xs)); color: var(--vk-fg-subtle); }
|
|
40
|
+
|
|
41
|
+
/* ── A field beside its label: the label and its note on the left, the field and its error on the right,
|
|
42
|
+
the label's words on the field's line. Responsive does so on a computer, and stands above the
|
|
43
|
+
field on the phone (the phone switch). ───────────────────────────────────────────────────────────── */
|
|
44
|
+
.o-field:is([data-orientation="horizontal"], [data-orientation="responsive"]) { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: baseline; column-gap: calc(var(--vk-spacing) * 4); }
|
|
45
|
+
.o-field:is([data-orientation="horizontal"], [data-orientation="responsive"]) > * { grid-column: 2; }
|
|
46
|
+
.o-field:is([data-orientation="horizontal"], [data-orientation="responsive"]) > :is(.o-field-label, .o-field-note) { grid-column: 1; }
|
|
47
|
+
@media (width < 640px) {
|
|
48
|
+
.o-field[data-orientation="responsive"]:where(:not([data-computer-host], [data-computer-host] *)) { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
|
|
49
|
+
.o-field[data-orientation="responsive"] > :is(*, .o-field-label, .o-field-note):where(:not([data-computer-host], [data-computer-host] *)) { grid-column: 1; }
|
|
50
|
+
}
|
|
51
|
+
@container o-phone (width < 640px) {
|
|
52
|
+
.o-field[data-orientation="responsive"] { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
|
|
53
|
+
.o-field[data-orientation="responsive"] > :is(*, .o-field-label, .o-field-note) { grid-column: 1; }
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* ── Field rows: on a phone, fields as rows of a card ──────────────────────────────────────────
|
|
57
|
+
Each option, on a frame or on the card itself (the look its place hands it, whole, which wins), sets the card's and
|
|
58
|
+
its rows' variables; nothing set is Card: one card on the overlay's card ground, its edge, rows 52, the label 104, the line
|
|
59
|
+
between rows from the words. What stands inside a row and where is its place's: a place may set a row's inset and gap. A row
|
|
60
|
+
typed into shows the caret alone. */
|
|
61
|
+
[data-field-rows-edge="on"] { --field-rows-edge: var(--vk-border-width) solid var(--vk-border-subtle); }
|
|
62
|
+
[data-field-rows-edge="off"] { --field-rows-edge: 0 none; }
|
|
63
|
+
[data-field-rows-cards="one"] {
|
|
64
|
+
--field-rows-card-display: block; --field-rows-card-gap: 0px; --field-rows-card-overflow: hidden; --field-rows-card-edge: var(--field-rows-edge);
|
|
65
|
+
--field-rows-card-corners: var(--vk-radius-xl); --field-rows-card-ground: var(--vk-overlay-card);
|
|
66
|
+
--field-rows-row-edge: 0 none; --field-rows-row-corners: 0px; --field-rows-row-ground: transparent;
|
|
67
|
+
}
|
|
68
|
+
[data-field-rows-cards="each"] {
|
|
69
|
+
--field-rows-card-display: grid; --field-rows-card-gap: calc(var(--vk-spacing) * 2.5); --field-rows-card-overflow: visible; --field-rows-card-edge: 0 none;
|
|
70
|
+
--field-rows-card-corners: 0px; --field-rows-card-ground: transparent;
|
|
71
|
+
--field-rows-row-edge: var(--field-rows-edge); --field-rows-row-corners: var(--vk-radius-xl); --field-rows-row-ground: var(--vk-overlay-card);
|
|
72
|
+
}
|
|
73
|
+
[data-field-rows-height="48"] { --field-rows-row: calc(var(--vk-spacing) * 12); }
|
|
74
|
+
[data-field-rows-height="52"] { --field-rows-row: calc(var(--vk-spacing) * 13); }
|
|
75
|
+
[data-field-rows-height="56"] { --field-rows-row: calc(var(--vk-spacing) * 14); }
|
|
76
|
+
[data-field-rows-label="104"] { --field-rows-label: block; }
|
|
77
|
+
[data-field-rows-label="none"] { --field-rows-label: none; }
|
|
78
|
+
[data-field-rows-lines="words"] { --field-rows-line-image: linear-gradient(var(--vk-border-overlay-card), var(--vk-border-overlay-card)); --field-rows-line-shadow: none; }
|
|
79
|
+
[data-field-rows-lines="across"] { --field-rows-line-image: none; --field-rows-line-shadow: inset 0 var(--vk-border-width) 0 var(--vk-border-overlay-card); }
|
|
80
|
+
[data-field-rows-lines="none"] { --field-rows-line-image: none; --field-rows-line-shadow: none; }
|
|
81
|
+
|
|
82
|
+
.o-field-rows {
|
|
83
|
+
display: var(--field-rows-card-display, block); grid-template-columns: minmax(0, 1fr); gap: var(--field-rows-card-gap, 0px); min-width: 0;
|
|
84
|
+
font-size: var(--vk-font-size-base); line-height: calc(var(--vk-font-size-base) * var(--vk-line-height-base)); overflow: var(--field-rows-card-overflow, hidden); border: var(--field-rows-card-edge, var(--vk-border-width) solid var(--vk-border-subtle));
|
|
85
|
+
border-radius: var(--field-rows-card-corners, var(--vk-radius-xl)); background-color: var(--field-rows-card-ground, var(--vk-overlay-card));
|
|
86
|
+
}
|
|
87
|
+
.o-field-row {
|
|
88
|
+
display: flex; align-items: center; gap: calc(var(--vk-spacing) * 3); box-sizing: border-box; width: 100%; min-height: var(--field-rows-row, calc(var(--vk-spacing) * 13));
|
|
89
|
+
margin: 0; padding: 0 calc(var(--vk-spacing) * 4); border: var(--field-rows-row-edge, 0 none); border-radius: var(--field-rows-row-corners, 0px);
|
|
90
|
+
background-color: var(--field-rows-row-ground, transparent); color: var(--vk-fg); font: inherit; text-align: left;
|
|
91
|
+
}
|
|
92
|
+
button.o-field-row { cursor: pointer; }
|
|
93
|
+
.o-field-row + .o-field-row {
|
|
94
|
+
background-image: var(--field-rows-line-image, linear-gradient(var(--vk-border-overlay-card), var(--vk-border-overlay-card))); background-size: calc(100% - var(--vk-spacing) * 4) var(--vk-border-width);
|
|
95
|
+
background-position: calc(var(--vk-spacing) * 4) 0; background-repeat: no-repeat; box-shadow: var(--field-rows-line-shadow, none);
|
|
96
|
+
}
|
|
97
|
+
.o-field-row-label { display: var(--field-rows-label, block); flex: none; width: calc(var(--vk-spacing) * 26); color: var(--vk-fg-subtle); }
|
|
98
|
+
}
|
|
@@ -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,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VIEWKIT'S DEFAULT CONTROLS, on Base UI (`@base-ui/react`, an optional peer): the one part of the package that imports
|
|
3
|
+
* it. An app takes the defaults by spreading `CONTROLS` into its components map, its own controls after it, and draws them
|
|
4
|
+
* with the ready stylesheet (or this part's CSS doors). An app that hands every control never imports this door and never
|
|
5
|
+
* needs Base UI. Each control's options and looks are on `viewkitjs/views/looks`.
|
|
6
|
+
*/
|
|
7
|
+
export { CONTROLS } from "./controls.js";
|
|
8
|
+
export { Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonClass, type ButtonKind, type ButtonProps, type ButtonShape, type ButtonSize, } from "./button/button.js";
|
|
9
|
+
export { leadingGlyph } from "./button/map-button.js";
|
|
10
|
+
export { buttonOwnAttrs, buttonOwnOptions, type ButtonOwnLook } from "./button/own-look.js";
|
|
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";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
export { CONTROLS } from "./controls.js";
|
|
3
|
+
export { Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonClass, } from "./button/button.js";
|
|
4
|
+
export { leadingGlyph } from "./button/map-button.js";
|
|
5
|
+
export { buttonOwnAttrs, buttonOwnOptions } from "./button/own-look.js";
|
|
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";
|