viewkitjs 0.39.0 → 0.40.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 +65 -0
- package/MIGRATION.md +25 -0
- package/fields/dist/derived.d.ts +7 -0
- package/fields/dist/derived.js +4 -0
- package/fields/dist/index.d.ts +1 -1
- package/fields/dist/index.js +1 -1
- package/fields/dist/messages.d.ts +5 -1
- package/fields/dist/messages.js +3 -0
- package/fields/dist/query/evaluate.d.ts +7 -1
- package/fields/dist/query/evaluate.js +8 -5
- package/fields/dist/query/filter.d.ts +7 -0
- package/fields/dist/query/filter.js +7 -1
- package/fields/dist/query/kit.d.ts +3 -2
- package/fields/dist/query/kit.js +1 -1
- package/fields/dist/query/layer.d.ts +6 -0
- package/fields/dist/query/layer.js +3 -0
- package/fields/dist/query/number.d.ts +3 -2
- package/fields/dist/query/number.js +5 -3
- package/fields/dist/query/read-rule.d.ts +1 -1
- package/fields/dist/query/read-rule.js +3 -0
- package/fields/docs/guides/queries.md +28 -24
- package/fields/docs/reference/fields.md +1 -0
- package/fields/docs/reference/query.md +6 -4
- package/package.json +2 -4
- package/postgres/dist/check.js +3 -1
- package/postgres/dist/definitions/storage.d.ts +3 -1
- package/postgres/dist/definitions/storage.js +3 -1
- package/postgres/dist/definitions/stored.js +13 -2
- package/postgres/dist/map.d.ts +5 -1
- package/postgres/dist/map.js +4 -0
- package/postgres/dist/records.js +6 -1
- package/postgres/docs/guides/definitions.md +1 -1
- package/postgres/docs/guides/field-map.md +2 -2
- package/postgres/docs/reference/postgres.md +1 -1
- package/views/dist/contract.d.ts +20 -2
- package/views/dist/contract.js +27 -0
- package/views/dist/controls/avatar.css +1 -1
- package/views/dist/controls/customize/map-customize-body.js +1 -1
- package/views/dist/controls/field/field.d.ts +2 -14
- package/views/dist/controls/field/field.js +4 -9
- package/views/dist/controls/filter-editor/filter-editor.d.ts +2 -0
- package/views/dist/controls/filter-editor/filter-editor.js +5 -2
- package/views/dist/controls/filter-editor/how.d.ts +8 -0
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +4 -2
- package/views/dist/controls/filter-editor/map-filter-body.js +17 -8
- package/views/dist/controls/filter-editor/map-rules.d.ts +4 -3
- package/views/dist/controls/filter-editor/map-rules.js +5 -2
- package/views/dist/controls/filter-editor/parts.d.ts +14 -1
- package/views/dist/controls/filter-editor/parts.js +14 -0
- package/views/dist/controls/filter-editor.css +4 -1
- package/views/dist/controls/index.d.ts +0 -3
- package/views/dist/controls/index.js +0 -3
- package/views/dist/controls/input.css +1 -1
- package/views/dist/controls/menu-list.css +1 -1
- package/views/dist/controls/picker/looks.d.ts +1 -1
- package/views/dist/controls/picker.css +2 -2
- package/views/dist/controls/press.css +0 -1
- package/views/dist/controls/radio/radio.d.ts +1 -1
- package/views/dist/controls/radio/radio.js +1 -16
- package/views/dist/controls/sheet/bottom-sheet.d.ts +2 -2
- package/views/dist/controls/sheet/bottom-sheet.js +31 -24
- package/views/dist/controls/text-editor.css +5 -3
- package/views/dist/controls/tokens.js +0 -6
- package/views/dist/controls/toolbar/toolbar.js +2 -2
- package/views/dist/field-row/editors/RowTextEditor.js +4 -1
- package/views/dist/filters/duration-bound.d.ts +7 -0
- package/views/dist/filters/duration-bound.js +9 -0
- package/views/dist/filters/filter-model.d.ts +4 -0
- package/views/dist/filters/number-refused.d.ts +8 -0
- package/views/dist/filters/number-refused.js +4 -0
- package/views/dist/grid/chrome/grid-table-props.d.ts +4 -1
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +12 -2
- package/views/dist/grid/core/clipboard-model.js +42 -8
- package/views/dist/grid/core/commit-model.d.ts +3 -0
- package/views/dist/grid/core/editing-controller.d.ts +29 -1
- package/views/dist/grid/core/editing-controller.js +142 -12
- package/views/dist/grid/core/pending-reconciliation.d.ts +14 -0
- package/views/dist/grid/core/pending-reconciliation.js +20 -8
- package/views/dist/grid/core/save-path.d.ts +4 -2
- package/views/dist/grid/core/save-path.js +1 -1
- package/views/dist/grid/core/spreadsheet-operations.js +43 -5
- package/views/dist/grid/core/useGridEditing.d.ts +5 -1
- package/views/dist/grid/core/useGridEditing.js +4 -4
- package/views/dist/grid/core/written-alongside.d.ts +16 -0
- package/views/dist/grid/core/written-alongside.js +30 -0
- package/views/dist/grid/grid.css +1 -1
- package/views/dist/grid/index.d.ts +1 -1
- package/views/dist/grid/looks.d.ts +2 -2
- package/views/dist/internal/before-paint.d.ts +5 -0
- package/views/dist/internal/before-paint.js +17 -0
- package/views/dist/internal/field-rows.d.ts +0 -8
- package/views/dist/internal/field-rows.js +1 -3
- package/views/dist/list/bar-keys.d.ts +3 -0
- package/views/dist/list/bar-keys.js +1 -0
- package/views/dist/list/buttons/clear-save.js +6 -2
- package/views/dist/list/buttons/new.d.ts +1 -1
- package/views/dist/list/buttons/new.js +14 -2
- package/views/dist/list/buttons/shared.d.ts +7 -1
- package/views/dist/list/buttons/shared.js +8 -2
- package/views/dist/list/buttons/views.js +6 -4
- package/views/dist/list/edits.d.ts +3 -1
- package/views/dist/list/layer.d.ts +13 -3
- package/views/dist/list/layer.js +13 -3
- package/views/dist/list/line.d.ts +5 -2
- package/views/dist/list/line.js +11 -3
- package/views/dist/list/list.d.ts +7 -1
- package/views/dist/list/list.js +2 -2
- package/views/dist/list/panels/filter-bar.d.ts +1 -1
- package/views/dist/list/panels/filter-bar.js +9 -3
- package/views/dist/list/panels/shared.d.ts +3 -2
- package/views/dist/list/panels/shared.js +5 -2
- package/views/dist/list/root-base.d.ts +2 -1
- package/views/dist/list/root-base.js +5 -3
- package/views/dist/list/root.d.ts +1 -1
- package/views/dist/list/store.d.ts +10 -0
- package/views/dist/list/store.js +8 -1
- package/views/dist/list/toolbar-model.d.ts +4 -0
- package/views/dist/list/toolbar-model.js +19 -1
- package/views/dist/list/toolbar.js +2 -1
- package/views/dist/list/views.d.ts +1 -1
- package/views/dist/list/views.js +4 -1
- package/views/dist/looks/index.d.ts +0 -1
- package/views/dist/looks/index.js +0 -1
- package/views/dist/looks/looks.d.ts +1 -1
- package/views/dist/looks/pieces.js +0 -2
- package/views/dist/model/column-filters.js +10 -3
- package/views/dist/model/view-rules.js +1 -0
- package/views/dist/panels/filter/NumberFilterBody.js +6 -8
- package/views/dist/panels/labels.js +7 -2
- package/views/dist/panels/model.d.ts +3 -0
- package/views/dist/panels/react/filter/filter-body.js +5 -1
- package/views/dist/panels/react/toolbar/ToolbarBarSorts.js +28 -1
- package/views/dist/panels/react/toolbar/ToolbarButton.d.ts +1 -1
- package/views/dist/panels/react/toolbar/ToolbarButton.js +5 -3
- package/views/dist/panels/react/toolbar/context.d.ts +4 -0
- package/views/dist/panels/react/toolbar/context.js +1 -0
- package/views/dist/panels/react/toolbar/use-give-way.js +2 -2
- package/views/dist/panels/settings/filter-groups.js +5 -0
- package/views/dist/panels/settings/input.d.ts +11 -0
- package/views/dist/panels/settings/layout.js +26 -0
- package/views/dist/panels/settings/person.d.ts +15 -0
- package/views/dist/panels/settings/person.js +6 -0
- package/views/dist/panels/toolbar/page-resets.js +14 -3
- package/views/dist/provider/components.d.ts +12 -3
- package/views/dist/styles.css +16 -260
- package/views/dist/styles.unlayered.css +16 -260
- package/views/docs/contract.md +9 -7
- package/views/docs/controls/field.md +1 -1
- package/views/docs/guides/looks.md +1 -1
- package/views/docs/guides/the-grid.md +4 -2
- package/views/docs/guides/toolbar-parts.md +337 -0
- package/views/docs/index.md +4 -0
- package/views/docs/reference/controls.md +3 -41
- package/views/docs/reference/grid.md +4 -3
- package/views/docs/reference/list.md +24 -13
- package/views/docs/reference/looks.md +12 -15
- package/views/docs/reference/panels.md +1 -1
- package/views/docs/reference/react.md +3 -3
- package/views/docs/reference/views.md +1 -1
- package/views/dist/controls/setting-row/looks.d.ts +0 -10
- package/views/dist/controls/setting-row/looks.js +0 -22
- package/views/dist/controls/setting-row/setting-row.d.ts +0 -102
- package/views/dist/controls/setting-row/setting-row.js +0 -135
- package/views/dist/controls/setting-row/tokens.d.ts +0 -156
- package/views/dist/controls/setting-row/tokens.js +0 -41
- package/views/dist/controls/setting-row.css +0 -216
- package/views/dist/controls/switch-row/switch-row.d.ts +0 -1
- package/views/dist/controls/switch-row/switch-row.js +0 -1
- package/views/dist/controls/switch-row/tokens.d.ts +0 -39
- package/views/dist/controls/switch-row/tokens.js +0 -12
- package/views/dist/controls/switch-row.css +0 -35
- package/views/dist/controls/tag-field/tag-field.d.ts +0 -24
- package/views/dist/controls/tag-field/tag-field.js +0 -25
- package/views/dist/controls/tag-field/tokens.d.ts +0 -23
- package/views/dist/controls/tag-field/tokens.js +0 -8
- package/views/dist/controls/tag-field.css +0 -32
- package/views/docs/controls/setting-row.md +0 -44
- package/views/docs/controls/switch-row.md +0 -15
- package/views/docs/controls/tag-field.md +0 -11
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import { cx } from "../../internal/cx.js";
|
|
4
|
-
import { FieldRowsCardContext, OutOfFieldRows, SettingRowField } from "../../internal/field-rows.js";
|
|
5
|
-
import { Button } from "../button/button.js";
|
|
6
|
-
import { useFieldRowsCard } from "../field/field.js";
|
|
7
|
-
import { phoneMark, usePhoneForm } from "../internal/phone.js";
|
|
8
|
-
import { Option } from "../option/option.js";
|
|
9
|
-
import { Select } from "../select/select.js";
|
|
10
|
-
import { Switch } from "../switch/switch.js";
|
|
11
|
-
import { SETTING_ROW_ATTRS, settingRowWornOf } from "./looks.js";
|
|
12
|
-
const Rows = React.createContext(null);
|
|
13
|
-
const useBeforePaint = typeof window === "undefined" ? React.useEffect : React.useLayoutEffect;
|
|
14
|
-
const DEF = settingRowWornOf(null);
|
|
15
|
-
const sameWorn = (a, b) => Object.keys(a).every((k) => a[k] === b[k]);
|
|
16
|
-
export function useSettingRowWorn(el) {
|
|
17
|
-
const [worn, setWorn] = React.useState(DEF);
|
|
18
|
-
useBeforePaint(() => {
|
|
19
|
-
const read = () => setWorn((was) => { const now = settingRowWornOf(el); return sameWorn(was, now) ? was : now; });
|
|
20
|
-
read();
|
|
21
|
-
if (!el)
|
|
22
|
-
return;
|
|
23
|
-
const watch = new MutationObserver(read);
|
|
24
|
-
watch.observe(document.documentElement, { attributes: true, subtree: true, attributeFilter: SETTING_ROW_ATTRS });
|
|
25
|
-
return () => watch.disconnect();
|
|
26
|
-
}, [el]);
|
|
27
|
-
return worn;
|
|
28
|
-
}
|
|
29
|
-
export function useSettingRowsRow() {
|
|
30
|
-
return React.useContext(SettingRowField);
|
|
31
|
-
}
|
|
32
|
-
export function SettingIcon({ colour, children }) {
|
|
33
|
-
return _jsx("span", { className: "o-setting-row-icon", "data-colour": colour, "aria-hidden": "true", ...phoneMark(usePhoneForm()), children: children });
|
|
34
|
-
}
|
|
35
|
-
const PHONE_CHEVRON = (_jsx("svg", { className: "o-setting-row-chevron", "data-phone": "", viewBox: "0 0 9 15", fill: "none", stroke: "currentColor", strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M1.5 1.5 7.5 7.5 1.5 13.5" }) }));
|
|
36
|
-
export function SettingChevron() {
|
|
37
|
-
return PHONE_CHEVRON;
|
|
38
|
-
}
|
|
39
|
-
const CHEVRON = (_jsx("svg", { className: "o-setting-row-chevron", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M6 3.5 10.5 8 6 12.5" }) }));
|
|
40
|
-
export function SettingRows({ danger = false, form, className, children }) {
|
|
41
|
-
const phone = usePhoneForm(form), { card, foot } = useFieldRowsCard();
|
|
42
|
-
const [el, setEl] = React.useState(null), worn = useSettingRowWorn(phone ? null : el);
|
|
43
|
-
const rows = React.useMemo(() => ({ danger, phone, worn }), [danger, phone, worn]);
|
|
44
|
-
return (_jsxs(FieldRowsCardContext.Provider, { value: phone ? card : null, children: [_jsx(SettingRowField.Provider, { value: !phone && worn.fields === "end", children: _jsx("div", { ref: setEl, className: cx("o-setting-rows o-smooth o-smooth-ease", danger && "o-setting-rows-danger", phone && "o-field-rows", className), "data-kit": "setting-row", ...phoneMark(phone), children: _jsx(Rows.Provider, { value: rows, children: children }) }) }), phone && foot] }));
|
|
45
|
-
}
|
|
46
|
-
export function SettingRow(props) {
|
|
47
|
-
return _jsx(OutOfFieldRows, { children: _jsx(SettingRowOf, { ...props }) });
|
|
48
|
-
}
|
|
49
|
-
function SettingRowOf(props) {
|
|
50
|
-
const rows = React.useContext(Rows), device = usePhoneForm(), danger = !!rows?.danger;
|
|
51
|
-
const { label, note, icon, mark, locked, alone, className } = props;
|
|
52
|
-
const id = React.useId();
|
|
53
|
-
const [own, setOwn] = React.useState(null), ownWorn = useSettingRowWorn(rows || device ? null : own);
|
|
54
|
-
if (alone && !rows && device)
|
|
55
|
-
return _jsx(SettingRows, { form: "phone", children: _jsx(SettingRow, { ...props }) });
|
|
56
|
-
const phone = !!rows?.phone, worn = rows ? rows.worn : ownWorn, inWords = !phone && worn.end === "words";
|
|
57
|
-
const shut = locked != null && locked !== false;
|
|
58
|
-
const reason = shut && locked !== true ? locked : null;
|
|
59
|
-
const kind = props.switch ? "switch" : props.select ? "select" : props.action ? "action" : props.onOpen ? "open" : "plain";
|
|
60
|
-
const begins = mark != null ? "mark" : icon != null || (phone && danger && props.action?.icon != null) ? "icon" : undefined;
|
|
61
|
-
const ownCard = alone && !rows && !device && worn.card === "edged";
|
|
62
|
-
const root = { className: cx("o-setting-row", phone && "o-field-row", props.switch && "o-switch-row", ownCard && "o-smooth o-smooth-ease", className), "data-setting-row-kind": kind,
|
|
63
|
-
"data-setting-row-start": begins, "data-locked": shut ? "" : undefined, "data-alone": alone ? "" : undefined, ...(rows ? {} : { ref: setOwn }) };
|
|
64
|
-
const start = mark ?? (icon != null ? _jsx(SettingIcon, { colour: props.colour, children: icon }) : null);
|
|
65
|
-
const chevron = phone ? PHONE_CHEVRON : CHEVRON;
|
|
66
|
-
const line = phone && reason != null ? reason : note;
|
|
67
|
-
const words = (_jsxs("span", { className: "o-choice-text", children: [_jsx("span", { className: "o-choice-label", id: `${id}-label`, children: label }), line != null && _jsx("span", { className: "o-choice-note", id: `${id}-note`, children: line })] }));
|
|
68
|
-
const why = !phone && reason != null ? _jsx("span", { className: "o-setting-row-reason", children: reason }) : null;
|
|
69
|
-
const name = typeof label === "string" ? label : undefined;
|
|
70
|
-
const s = props.state;
|
|
71
|
-
const said = phone || !s ? null : inWords
|
|
72
|
-
? _jsxs("span", { className: "o-setting-row-said", children: [s.colour && _jsx("span", { className: "o-setting-row-dot", "data-colour": s.colour, "aria-hidden": "true" }), s.label] })
|
|
73
|
-
: _jsx(Option, { colour: s.colour, children: s.label });
|
|
74
|
-
const lead = said != null || why != null ? _jsxs(_Fragment, { children: [said, why] }) : null;
|
|
75
|
-
if (inWords && why != null)
|
|
76
|
-
return _jsxs("div", { ...root, children: [start, words, _jsxs("span", { className: "o-setting-row-end", children: [said, why] })] });
|
|
77
|
-
if (props.switch) {
|
|
78
|
-
const toggle = _jsx(Switch, { "aria-labelledby": `${id}-label`, "aria-describedby": line != null ? `${id}-note` : undefined, ...props.switch, locked: shut });
|
|
79
|
-
return (_jsxs("div", { ...root, children: [start, words, said == null ? _jsxs(_Fragment, { children: [why, toggle] }) : _jsxs("span", { className: "o-setting-row-end", children: [said, why, toggle] })] }));
|
|
80
|
-
}
|
|
81
|
-
if (props.select)
|
|
82
|
-
return _jsx(SelectRow, { root: root, start: start, words: words, why: lead, name: name, select: props.select, shut: shut, phone: phone });
|
|
83
|
-
if (props.action) {
|
|
84
|
-
const a = props.action;
|
|
85
|
-
if (phone) {
|
|
86
|
-
const off = shut || a.disabled;
|
|
87
|
-
if (alone)
|
|
88
|
-
return _jsxs("button", { type: "button", ...root, disabled: off, onClick: a.onClick, children: [start, words] });
|
|
89
|
-
if (danger)
|
|
90
|
-
return _jsxs("button", { type: "button", ...root, disabled: off, onClick: a.onClick, children: [a.icon != null ? _jsx(SettingIcon, { children: a.icon }) : start, words] });
|
|
91
|
-
if (props.state)
|
|
92
|
-
return (_jsxs("button", { type: "button", ...root, disabled: off, onClick: a.onClick, children: [start, words, _jsxs("span", { className: "o-setting-row-end", children: [_jsx("span", { className: "o-setting-row-value", children: props.state.label }), chevron] })] }));
|
|
93
|
-
const about = line != null ? `${id}-label ${id}-note` : `${id}-label`;
|
|
94
|
-
return _jsxs("div", { ...root, children: [start, words, _jsx("span", { className: "o-setting-row-end", children: _jsx("button", { type: "button", className: "o-setting-row-act", "aria-describedby": about, disabled: off, onClick: a.onClick, children: a.label }) })] });
|
|
95
|
-
}
|
|
96
|
-
const kindOf = a.kind ?? (danger ? "danger" : "outline");
|
|
97
|
-
const value = props.value != null ? _jsx("span", { className: "o-setting-row-value", children: props.value }) : null;
|
|
98
|
-
const act = inWords
|
|
99
|
-
? _jsx("button", { type: "button", className: "o-setting-row-act", "data-kind": kindOf === "danger" ? "danger" : undefined, "data-icon": a.iconOnly ? "" : undefined, "aria-label": a.iconOnly ? a.label : undefined, disabled: shut || a.disabled, onClick: a.onClick, children: a.iconOnly ? a.icon : a.label })
|
|
100
|
-
: a.iconOnly
|
|
101
|
-
? _jsx(Button, { kind: kindOf, size: "sm", shape: "icon", icon: a.icon, "aria-label": a.label, disabled: shut || a.disabled, onClick: a.onClick })
|
|
102
|
-
: _jsx(Button, { kind: kindOf, size: "sm", icon: a.icon, disabled: shut || a.disabled, onClick: a.onClick, children: a.label });
|
|
103
|
-
return (_jsxs("div", { ...root, children: [start, words, _jsxs("span", { className: "o-setting-row-end", children: [value, lead, act] })] }));
|
|
104
|
-
}
|
|
105
|
-
if (!props.onOpen)
|
|
106
|
-
return _jsxs("div", { ...root, children: [start, words, lead != null && _jsx("span", { className: "o-setting-row-end", children: lead })] });
|
|
107
|
-
return (_jsxs("button", { type: "button", ...root, disabled: shut, onClick: shut ? undefined : props.onOpen, children: [start, words, _jsxs("span", { className: "o-setting-row-end", children: [lead, props.value != null && _jsx("span", { className: "o-setting-row-value", children: props.value }), chevron] })] }));
|
|
108
|
-
}
|
|
109
|
-
const firstOf = (v) => (Array.isArray(v) ? v : v == null ? [] : [v]);
|
|
110
|
-
function SelectRow({ root, start, words, why, name, select, shut, phone }) {
|
|
111
|
-
const [own, setOwn] = React.useState(select.defaultValue ?? null), [open, setOpen] = React.useState(false);
|
|
112
|
-
const value = select.value !== undefined ? select.value : own;
|
|
113
|
-
const changed = (v) => { setOwn(v); select.onValueChange?.(v); };
|
|
114
|
-
const field = _jsx(Select, { ...select, value: value, onValueChange: changed, size: "md", disabled: shut || select.disabled, "aria-label": select["aria-label"] ?? name, className: cx("o-setting-row-select", select.className), ...(phone ? { open, onOpenChange: setOpen } : {}) });
|
|
115
|
-
if (!phone)
|
|
116
|
-
return _jsxs("div", { ...root, children: [start, words, _jsxs("span", { className: "o-setting-row-end", children: [why, field] })] });
|
|
117
|
-
const shown = firstOf(value).map((v) => findItem(select.items, v)?.label ?? v);
|
|
118
|
-
return (_jsxs("div", { ...root, children: [_jsxs("button", { type: "button", className: "o-setting-row-press", disabled: shut || select.disabled, onClick: () => setOpen(true), children: [start, words, _jsxs("span", { className: "o-setting-row-end", children: [shown.length > 0 && _jsx("span", { className: "o-setting-row-value", children: shown.join(", ") }), PHONE_CHEVRON] })] }), _jsx("span", { hidden: true, children: field })] }));
|
|
119
|
-
}
|
|
120
|
-
const findItem = (items, v) => {
|
|
121
|
-
for (const i of items) {
|
|
122
|
-
if (i.value === v)
|
|
123
|
-
return i;
|
|
124
|
-
const deep = i.level && findItem(i.level, v);
|
|
125
|
-
if (deep)
|
|
126
|
-
return deep;
|
|
127
|
-
}
|
|
128
|
-
return undefined;
|
|
129
|
-
};
|
|
130
|
-
export function SwitchRow({ label, note, locked, ...props }) {
|
|
131
|
-
return _jsx(SettingRow, { label: label, note: note, locked: locked || undefined, switch: props });
|
|
132
|
-
}
|
|
133
|
-
export function SwitchRows({ className, children }) {
|
|
134
|
-
return _jsx(SettingRows, { form: "computer", className: cx("o-switch-rows", className), children: children });
|
|
135
|
-
}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
export declare const SETTING_ROW_TOKENS: readonly [{
|
|
2
|
-
readonly name: "--vk-border";
|
|
3
|
-
readonly kind: "colour";
|
|
4
|
-
readonly outright: "--border";
|
|
5
|
-
}, {
|
|
6
|
-
readonly name: "--vk-border-subtle";
|
|
7
|
-
readonly kind: "colour";
|
|
8
|
-
readonly outright: "--border-subtle";
|
|
9
|
-
}, {
|
|
10
|
-
readonly name: "--vk-border-danger";
|
|
11
|
-
readonly kind: "colour";
|
|
12
|
-
readonly outright: "--border-danger";
|
|
13
|
-
}, {
|
|
14
|
-
readonly name: "--vk-hovered";
|
|
15
|
-
readonly kind: "colour";
|
|
16
|
-
readonly outright: "--surface-hovered";
|
|
17
|
-
}, {
|
|
18
|
-
readonly name: "--vk-raised";
|
|
19
|
-
readonly kind: "colour";
|
|
20
|
-
readonly outright: "--surface-raised";
|
|
21
|
-
}, {
|
|
22
|
-
readonly name: "--vk-danger";
|
|
23
|
-
readonly kind: "colour";
|
|
24
|
-
readonly outright: "--text-danger";
|
|
25
|
-
}, {
|
|
26
|
-
readonly name: "--vk-fg";
|
|
27
|
-
readonly kind: "colour";
|
|
28
|
-
readonly outright: "--text";
|
|
29
|
-
}, {
|
|
30
|
-
readonly name: "--vk-fg-subtle";
|
|
31
|
-
readonly kind: "colour";
|
|
32
|
-
readonly outright: "--text-subtle";
|
|
33
|
-
}, {
|
|
34
|
-
readonly name: "--vk-fg-subtlest";
|
|
35
|
-
readonly kind: "colour";
|
|
36
|
-
readonly outright: "--text-subtlest";
|
|
37
|
-
}, {
|
|
38
|
-
readonly name: "--vk-fg-brand";
|
|
39
|
-
readonly kind: "colour";
|
|
40
|
-
readonly outright: "--link";
|
|
41
|
-
}, {
|
|
42
|
-
readonly name: "--vk-border-brand";
|
|
43
|
-
readonly kind: "colour";
|
|
44
|
-
readonly outright: "--border-focused";
|
|
45
|
-
}, {
|
|
46
|
-
readonly name: "--vk-label-blue";
|
|
47
|
-
readonly kind: "colour";
|
|
48
|
-
readonly outright: "--label-blue";
|
|
49
|
-
}, {
|
|
50
|
-
readonly name: "--vk-label-green";
|
|
51
|
-
readonly kind: "colour";
|
|
52
|
-
readonly outright: "--label-green";
|
|
53
|
-
}, {
|
|
54
|
-
readonly name: "--vk-label-amber";
|
|
55
|
-
readonly kind: "colour";
|
|
56
|
-
readonly outright: "--label-amber";
|
|
57
|
-
}, {
|
|
58
|
-
readonly name: "--vk-label-red";
|
|
59
|
-
readonly kind: "colour";
|
|
60
|
-
readonly outright: "--label-red";
|
|
61
|
-
}, {
|
|
62
|
-
readonly name: "--vk-label-purple";
|
|
63
|
-
readonly kind: "colour";
|
|
64
|
-
readonly outright: "--label-purple";
|
|
65
|
-
}, {
|
|
66
|
-
readonly name: "--vk-label-pink";
|
|
67
|
-
readonly kind: "colour";
|
|
68
|
-
readonly outright: "--label-pink";
|
|
69
|
-
}, {
|
|
70
|
-
readonly name: "--vk-label-teal";
|
|
71
|
-
readonly kind: "colour";
|
|
72
|
-
readonly outright: "--label-teal";
|
|
73
|
-
}, {
|
|
74
|
-
readonly name: "--vk-fg-inverse";
|
|
75
|
-
readonly kind: "colour";
|
|
76
|
-
readonly outright: "--text-inverse";
|
|
77
|
-
}, {
|
|
78
|
-
readonly name: "--vk-neutral";
|
|
79
|
-
readonly kind: "colour";
|
|
80
|
-
readonly outright: "--background-neutral";
|
|
81
|
-
}, {
|
|
82
|
-
readonly name: "--vk-icon-disclosure";
|
|
83
|
-
readonly kind: "colour";
|
|
84
|
-
readonly outright: "--icon-disclosure";
|
|
85
|
-
}, {
|
|
86
|
-
readonly name: "--vk-border-width";
|
|
87
|
-
readonly kind: "size";
|
|
88
|
-
readonly outright: "--border-width";
|
|
89
|
-
}, {
|
|
90
|
-
readonly name: "--vk-corner-smoothing";
|
|
91
|
-
readonly kind: "size";
|
|
92
|
-
readonly outright: "--corner-smoothing";
|
|
93
|
-
}, {
|
|
94
|
-
readonly name: "--vk-font-size-sm";
|
|
95
|
-
readonly kind: "size";
|
|
96
|
-
readonly outright: "--text-sm";
|
|
97
|
-
}, {
|
|
98
|
-
readonly name: "--vk-font-size-xs";
|
|
99
|
-
readonly kind: "size";
|
|
100
|
-
readonly outright: "--text-xs";
|
|
101
|
-
}, {
|
|
102
|
-
readonly name: "--vk-focus-width";
|
|
103
|
-
readonly kind: "size";
|
|
104
|
-
readonly outright: "--focus-width";
|
|
105
|
-
}, {
|
|
106
|
-
readonly name: "--vk-focus-offset";
|
|
107
|
-
readonly kind: "size";
|
|
108
|
-
readonly outright: "--focus-offset";
|
|
109
|
-
}, {
|
|
110
|
-
readonly name: "--vk-font-weight-medium";
|
|
111
|
-
readonly kind: "size";
|
|
112
|
-
readonly outright: "--font-weight-medium";
|
|
113
|
-
}, {
|
|
114
|
-
readonly name: "--vk-line-height-sm";
|
|
115
|
-
readonly kind: "size";
|
|
116
|
-
readonly outright: "--text-sm--line-height";
|
|
117
|
-
}, {
|
|
118
|
-
readonly name: "--vk-line-height-xs";
|
|
119
|
-
readonly kind: "size";
|
|
120
|
-
readonly outright: "--text-xs--line-height";
|
|
121
|
-
}, {
|
|
122
|
-
readonly name: "--vk-radius-lg";
|
|
123
|
-
readonly kind: "size";
|
|
124
|
-
readonly outright: "--radius-lg";
|
|
125
|
-
}, {
|
|
126
|
-
readonly name: "--vk-radius-md";
|
|
127
|
-
readonly kind: "size";
|
|
128
|
-
readonly outright: "--radius-md";
|
|
129
|
-
}, {
|
|
130
|
-
readonly name: "--vk-radius-sm";
|
|
131
|
-
readonly kind: "size";
|
|
132
|
-
readonly outright: "--radius-sm";
|
|
133
|
-
}, {
|
|
134
|
-
readonly name: "--vk-radius-full";
|
|
135
|
-
readonly kind: "size";
|
|
136
|
-
readonly outright: "--radius-full";
|
|
137
|
-
}, {
|
|
138
|
-
readonly name: "--vk-spacing";
|
|
139
|
-
readonly kind: "size";
|
|
140
|
-
readonly outright: "--spacing";
|
|
141
|
-
}, {
|
|
142
|
-
readonly name: "--vk-opacity-off";
|
|
143
|
-
readonly kind: "size";
|
|
144
|
-
readonly outright: "--opacity-off";
|
|
145
|
-
}, {
|
|
146
|
-
readonly name: "--vk-duration-fast";
|
|
147
|
-
readonly kind: "motion";
|
|
148
|
-
readonly outright: "--duration-fast";
|
|
149
|
-
}, {
|
|
150
|
-
readonly name: "--vk-ease-out";
|
|
151
|
-
readonly kind: "motion";
|
|
152
|
-
readonly outright: "--ease-out";
|
|
153
|
-
}];
|
|
154
|
-
/** The card's own machinery: its edge and ground by the card picked, its rows' room by the rows picked, the size its smooth
|
|
155
|
-
* corner is fitted to; a tile's colour, by the colour its icon was given; and a state's dot's, by its colour. */
|
|
156
|
-
export declare const SETTING_ROW_PRIVATE: readonly ["--setting-rows-", "--setting-row-tile", "--setting-row-dot"];
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export const SETTING_ROW_TOKENS = [
|
|
2
|
-
{ name: "--vk-border", kind: "colour", outright: "--border" },
|
|
3
|
-
{ name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
|
|
4
|
-
{ name: "--vk-border-danger", kind: "colour", outright: "--border-danger" },
|
|
5
|
-
{ name: "--vk-hovered", kind: "colour", outright: "--surface-hovered" },
|
|
6
|
-
{ name: "--vk-raised", kind: "colour", outright: "--surface-raised" },
|
|
7
|
-
{ name: "--vk-danger", kind: "colour", outright: "--text-danger" },
|
|
8
|
-
{ name: "--vk-fg", kind: "colour", outright: "--text" },
|
|
9
|
-
{ name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
|
|
10
|
-
{ name: "--vk-fg-subtlest", kind: "colour", outright: "--text-subtlest" },
|
|
11
|
-
{ name: "--vk-fg-brand", kind: "colour", outright: "--link" },
|
|
12
|
-
{ name: "--vk-border-brand", kind: "colour", outright: "--border-focused" },
|
|
13
|
-
{ name: "--vk-label-blue", kind: "colour", outright: "--label-blue" },
|
|
14
|
-
{ name: "--vk-label-green", kind: "colour", outright: "--label-green" },
|
|
15
|
-
{ name: "--vk-label-amber", kind: "colour", outright: "--label-amber" },
|
|
16
|
-
{ name: "--vk-label-red", kind: "colour", outright: "--label-red" },
|
|
17
|
-
{ name: "--vk-label-purple", kind: "colour", outright: "--label-purple" },
|
|
18
|
-
{ name: "--vk-label-pink", kind: "colour", outright: "--label-pink" },
|
|
19
|
-
{ name: "--vk-label-teal", kind: "colour", outright: "--label-teal" },
|
|
20
|
-
{ name: "--vk-fg-inverse", kind: "colour", outright: "--text-inverse" },
|
|
21
|
-
{ name: "--vk-neutral", kind: "colour", outright: "--background-neutral" },
|
|
22
|
-
{ name: "--vk-icon-disclosure", kind: "colour", outright: "--icon-disclosure" },
|
|
23
|
-
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
24
|
-
{ name: "--vk-corner-smoothing", kind: "size", outright: "--corner-smoothing" },
|
|
25
|
-
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
26
|
-
{ name: "--vk-font-size-xs", kind: "size", outright: "--text-xs" },
|
|
27
|
-
{ name: "--vk-focus-width", kind: "size", outright: "--focus-width" },
|
|
28
|
-
{ name: "--vk-focus-offset", kind: "size", outright: "--focus-offset" },
|
|
29
|
-
{ name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
|
|
30
|
-
{ name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
|
|
31
|
-
{ name: "--vk-line-height-xs", kind: "size", outright: "--text-xs--line-height" },
|
|
32
|
-
{ name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
|
|
33
|
-
{ name: "--vk-radius-md", kind: "size", outright: "--radius-md" },
|
|
34
|
-
{ name: "--vk-radius-sm", kind: "size", outright: "--radius-sm" },
|
|
35
|
-
{ name: "--vk-radius-full", kind: "size", outright: "--radius-full" },
|
|
36
|
-
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
37
|
-
{ name: "--vk-opacity-off", kind: "size", outright: "--opacity-off" },
|
|
38
|
-
{ name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
|
|
39
|
-
{ name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
|
|
40
|
-
];
|
|
41
|
-
export const SETTING_ROW_PRIVATE = ["--setting-rows-", "--setting-row-tile", "--setting-row-dot"];
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
/* The setting row and its card, as the Outright kit draws them (setting-row/setting-row.tsx): one setting as a row, its words
|
|
2
|
-
(choice.css) on the left, its control at its end (the Switch, the Select, a Button, or its value and ›), its mark or icon at
|
|
3
|
-
its start; the rows in a card, a line between each; the danger zone's card with a red edge; a lone row bare. Two options, each
|
|
4
|
-
a computer's, picked on the frame or the app around it (looks.ts): the card (outlined, or raised on its ground, the default)
|
|
5
|
-
and the rows (snug, or roomy, 64 tall, the default). The defaults are Attio's look, which lookAttrs writes when nothing is
|
|
6
|
-
picked (VK-1035); a frame with no attribute at all still draws outlined and snug, as SwitchRows did (switch-row.css); a switch's row is no
|
|
7
|
-
press of its own, only its Switch is (KIT-969). On a phone the card and its rows are
|
|
8
|
-
Field rows' (field.css), and this sheet adds what a setting puts in them, as iOS's Settings draws it (KIT-972): the name taking
|
|
9
|
-
the room; the value in the quietest grey, cut with …, before iOS's ›; a button's words in the link colour at the end; a lone
|
|
10
|
-
row's name in the link colour; a danger row's name and icon in red; a locked row faded but for its line; and its icon by the
|
|
11
|
-
phone's Icon option, a line icon (Line, nothing picked) or a white glyph on a tile of the colour the app passed (Tile).
|
|
12
|
-
|
|
13
|
-
Linear's look (VK-985; round 4 of the Outright kit's settings canvas) is four more values, each a computer's, drawn only under
|
|
14
|
-
its own attribute, so nothing picked and Attio's draw as before: Card's Edged (the card on its ground with a firm edge, the
|
|
15
|
-
danger zone's card plain, a lone row a card of its own, an icon on a grey tile, no edge); Rows' Inset (60 tall at least, 15 by
|
|
16
|
-
16, the line between rows from the words' start to 16 short of the end); End's Words (an action as its words, 28 tall, in the
|
|
17
|
-
text colour or red, a state as a dot and its words, a locked row's words greyed and its reason in its control's place); and
|
|
18
|
-
Fields' At the end (a Field placed in the card its row, its Input 256 at the end, a select as wide as its value).
|
|
19
|
-
|
|
20
|
-
The rules sit in the components layer, so a utility class on a row still wins. */
|
|
21
|
-
@layer components {
|
|
22
|
-
|
|
23
|
-
/* ── The options: each value sets the card's or the rows' own names, read below ─────────────────────────────────────── */
|
|
24
|
-
:where([data-setting-row-card="raised"]) .o-setting-rows { --setting-rows-edge: var(--vk-border-subtle); --setting-rows-ground: var(--vk-raised); }
|
|
25
|
-
:where([data-setting-row-rows="roomy"]) :is(.o-setting-rows, .o-setting-row) {
|
|
26
|
-
--setting-rows-pad: calc(var(--vk-spacing) * 3) calc(var(--vk-spacing) * 4.5); --setting-rows-height: calc(var(--vk-spacing) * 16);
|
|
27
|
-
--setting-rows-side: calc(var(--vk-spacing) * 16);
|
|
28
|
-
}
|
|
29
|
-
.o-setting-rows.o-setting-rows-danger { --setting-rows-edge: var(--vk-border-danger); }
|
|
30
|
-
/* Edged (Linear's): the card on its ground with a firm edge; its danger zone's plain, only its action red. */
|
|
31
|
-
:where([data-setting-row-card="edged"]) .o-setting-rows { --setting-rows-edge: var(--vk-border); --setting-rows-ground: var(--vk-raised); }
|
|
32
|
-
:where([data-setting-row-card="edged"]) .o-setting-rows.o-setting-rows-danger { --setting-rows-edge: var(--vk-border); }
|
|
33
|
-
/* Inset (Linear's): 60 tall at least, 15 by 16, the line between rows inset 16 at each end. */
|
|
34
|
-
:where([data-setting-row-rows="inset"]) :is(.o-setting-rows, .o-setting-row) {
|
|
35
|
-
--setting-rows-pad: calc(var(--vk-spacing) * 3.75) calc(var(--vk-spacing) * 4); --setting-rows-height: calc(var(--vk-spacing) * 15);
|
|
36
|
-
--setting-rows-side: calc(var(--vk-spacing) * 15);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/* ── The card, on a computer: the rows in a box, a line between each ───────────────────────────────────────────────── */
|
|
40
|
-
.o-setting-rows:not(.o-field-rows) {
|
|
41
|
-
display: grid; border: var(--vk-border-width) solid var(--setting-rows-edge, var(--vk-border)); border-radius: var(--vk-radius-lg); overflow: hidden;
|
|
42
|
-
background-color: var(--setting-rows-ground, transparent);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/* ── A row, on a computer: its start, its words, its end ───────────────────────────────────────────────────────────── */
|
|
46
|
-
.o-setting-row:not(.o-field-row) {
|
|
47
|
-
display: flex; align-items: center; justify-content: space-between; gap: calc(var(--vk-spacing) * 4); box-sizing: border-box;
|
|
48
|
-
min-height: var(--setting-rows-height, auto); margin: 0; padding: var(--setting-rows-pad, calc(var(--vk-spacing) * 3.5) calc(var(--vk-spacing) * 4));
|
|
49
|
-
border: 0; border-top: var(--vk-border-width) solid var(--vk-border-subtle);
|
|
50
|
-
-webkit-tap-highlight-color: transparent; transition: background-color var(--vk-duration-fast) var(--vk-ease-out);
|
|
51
|
-
}
|
|
52
|
-
.o-setting-row:not(.o-field-row):first-child { border-top: 0; }
|
|
53
|
-
.o-setting-row:not(.o-field-row) > .o-choice-text { flex: 1 1 auto; }
|
|
54
|
-
.o-setting-row:not(.o-field-row) .o-choice-label { font-weight: var(--vk-font-weight-medium); }
|
|
55
|
-
/* The row that is a press as a whole: the one opening its page (a button). A switch's row is not: only its Switch switches it
|
|
56
|
-
(KIT-969), so it takes no pointer and no ground under it. */
|
|
57
|
-
button.o-setting-row { width: 100%; font: inherit; color: inherit; text-align: left; background-color: transparent; }
|
|
58
|
-
.o-setting-row[data-setting-row-kind="open"]:not(.o-field-row) { cursor: pointer; }
|
|
59
|
-
@media (hover: hover) { .o-setting-row[data-setting-row-kind="open"]:not(.o-field-row):hover { background-color: var(--vk-hovered); } }
|
|
60
|
-
.o-setting-row[data-setting-row-kind="open"]:not(.o-field-row)[data-locked] { cursor: not-allowed; background-color: transparent; }
|
|
61
|
-
|
|
62
|
-
/* Its start: a mark as given; an icon in its box. */
|
|
63
|
-
.o-setting-row > :not(.o-choice-text, .o-setting-row-press) { flex: none; }
|
|
64
|
-
.o-setting-row-icon {
|
|
65
|
-
display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: calc(var(--vk-spacing) * 8); height: calc(var(--vk-spacing) * 8);
|
|
66
|
-
border: var(--vk-border-width) solid var(--vk-border-subtle); border-radius: var(--vk-radius-md); background-color: var(--vk-raised); color: var(--vk-fg-subtle);
|
|
67
|
-
}
|
|
68
|
-
.o-setting-row-icon > svg { width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); }
|
|
69
|
-
|
|
70
|
-
/* Its end: the reason, then the control; the Select 220 wide; the value and ›. */
|
|
71
|
-
.o-setting-row-end { display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2); margin-left: auto; min-width: 0; }
|
|
72
|
-
.o-setting-row-select { width: calc(var(--vk-spacing) * 55); }
|
|
73
|
-
.o-setting-row-select .o-select-field { width: 100%; }
|
|
74
|
-
.o-setting-row-reason { font-size: var(--vk-font-size-xs); line-height: calc(var(--vk-font-size-xs) * var(--vk-line-height-xs)); color: var(--vk-fg-subtlest); }
|
|
75
|
-
.o-setting-row-reason + .o-switch { margin-left: calc(var(--vk-spacing) * -2); }
|
|
76
|
-
.o-setting-row-value { font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); color: var(--vk-fg-subtle); }
|
|
77
|
-
.o-setting-row-chevron { flex: none; width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); color: var(--vk-fg-subtlest); }
|
|
78
|
-
/* Locked: its control greyed (a switch keeps its own locked state), its words as they are. */
|
|
79
|
-
.o-setting-row[data-locked] :is(.o-setting-row-select, .o-button, .o-setting-row-value, .o-setting-row-chevron) { opacity: var(--vk-opacity-off); }
|
|
80
|
-
|
|
81
|
-
/* A lone row: bare, no card, no line, no room round it. */
|
|
82
|
-
.o-setting-row[data-alone]:not(.o-field-row) { min-height: 0; padding: 0; border-top: 0; background-color: transparent; }
|
|
83
|
-
|
|
84
|
-
/* ── Linear's values on a computer ─────────────────────────────────────────────────────────────────────────────────── */
|
|
85
|
-
/* Edged: a lone row a card of its own, the rows' room in it; an icon on a grey tile, no edge. */
|
|
86
|
-
:where([data-setting-row-card="edged"]) .o-setting-row[data-alone]:not(.o-field-row) {
|
|
87
|
-
min-height: var(--setting-rows-height, auto); padding: var(--setting-rows-pad, calc(var(--vk-spacing) * 3.5) calc(var(--vk-spacing) * 4));
|
|
88
|
-
border: var(--vk-border-width) solid var(--vk-border); border-radius: var(--vk-radius-lg); background-color: var(--vk-raised);
|
|
89
|
-
}
|
|
90
|
-
:where([data-setting-row-card="edged"]) .o-setting-row-icon:not(:where([data-vk-phone], [data-vk-phone] *)) {
|
|
91
|
-
border: 0; border-radius: var(--vk-radius-sm); background-color: var(--vk-neutral);
|
|
92
|
-
}
|
|
93
|
-
:where([data-setting-row-card="edged"]) .o-setting-row-icon:not(:where([data-vk-phone], [data-vk-phone] *)) > svg { width: calc(var(--vk-spacing) * 3.5); height: calc(var(--vk-spacing) * 3.5); }
|
|
94
|
-
/* Inset: the line between rows from 16 in to 16 short, drawn under a row's own ground. */
|
|
95
|
-
:where([data-setting-row-rows="inset"]) .o-setting-rows:not(.o-field-rows) > :is(.o-setting-row, .o-field) { border-top: 0; }
|
|
96
|
-
:where([data-setting-row-rows="inset"]) .o-setting-rows:not(.o-field-rows) > * + :is(.o-setting-row, .o-field) {
|
|
97
|
-
background-image: linear-gradient(var(--vk-border-subtle), var(--vk-border-subtle)); background-repeat: no-repeat;
|
|
98
|
-
background-size: calc(100% - var(--vk-spacing) * 8) var(--vk-border-width); background-position: calc(var(--vk-spacing) * 4) 0;
|
|
99
|
-
}
|
|
100
|
-
/* Words: an action as its words, the row's own press, 28 tall, in the text colour, red where it can't be undone; its icon alone
|
|
101
|
-
a 24 press in the subtle text. */
|
|
102
|
-
.o-setting-row:not(.o-field-row) .o-setting-row-act {
|
|
103
|
-
display: inline-flex; align-items: center; justify-content: center; min-height: calc(var(--vk-spacing) * 7); margin: 0;
|
|
104
|
-
padding: 0 calc(var(--vk-spacing) * 1.75); border: 0; border-radius: var(--vk-radius-sm); font: inherit; font-size: var(--vk-font-size-sm);
|
|
105
|
-
line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); font-weight: var(--vk-font-weight-medium); white-space: nowrap;
|
|
106
|
-
color: var(--vk-fg); background-color: transparent; cursor: pointer; transition: background-color var(--vk-duration-fast) var(--vk-ease-out);
|
|
107
|
-
}
|
|
108
|
-
.o-setting-row:not(.o-field-row) .o-setting-row-act[data-kind="danger"] { color: var(--vk-danger); }
|
|
109
|
-
.o-setting-row:not(.o-field-row) .o-setting-row-act[data-icon] { width: calc(var(--vk-spacing) * 6); min-height: calc(var(--vk-spacing) * 6); padding: 0; color: var(--vk-fg-subtle); }
|
|
110
|
-
.o-setting-row:not(.o-field-row) .o-setting-row-act > svg { width: calc(var(--vk-spacing) * 3.5); height: calc(var(--vk-spacing) * 3.5); }
|
|
111
|
-
@media (hover: hover) { .o-setting-row:not(.o-field-row) .o-setting-row-act:hover:not(:disabled) { background-color: var(--vk-hovered); } }
|
|
112
|
-
.o-setting-row:not(.o-field-row) .o-setting-row-act:disabled { cursor: not-allowed; opacity: var(--vk-opacity-off); }
|
|
113
|
-
/* A state as a dot in its colour and its words in the text colour; with no colour, its words alone. */
|
|
114
|
-
.o-setting-row-said {
|
|
115
|
-
display: inline-flex; align-items: center; gap: calc(var(--vk-spacing) * 1.5); white-space: nowrap; color: var(--vk-fg);
|
|
116
|
-
font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm));
|
|
117
|
-
}
|
|
118
|
-
.o-setting-row-dot { flex: none; width: calc(var(--vk-spacing) * 1.5); height: calc(var(--vk-spacing) * 1.5); border-radius: var(--vk-radius-full); background-color: var(--setting-row-dot, var(--vk-fg-subtlest)); }
|
|
119
|
-
.o-setting-row-dot[data-colour="blue"] { --setting-row-dot: var(--vk-label-blue); }
|
|
120
|
-
.o-setting-row-dot[data-colour="green"] { --setting-row-dot: var(--vk-label-green); }
|
|
121
|
-
.o-setting-row-dot[data-colour="amber"] { --setting-row-dot: var(--vk-label-amber); }
|
|
122
|
-
.o-setting-row-dot[data-colour="red"] { --setting-row-dot: var(--vk-label-red); }
|
|
123
|
-
.o-setting-row-dot[data-colour="purple"] { --setting-row-dot: var(--vk-label-purple); }
|
|
124
|
-
.o-setting-row-dot[data-colour="pink"] { --setting-row-dot: var(--vk-label-pink); }
|
|
125
|
-
.o-setting-row-dot[data-colour="teal"] { --setting-row-dot: var(--vk-label-teal); }
|
|
126
|
-
/* A locked row under Words: its words greyed, its reason at the row's size. */
|
|
127
|
-
:where([data-setting-row-end="words"]) .o-setting-row[data-locked]:not(.o-field-row) :is(.o-choice-label, .o-choice-note) { color: var(--vk-fg-subtlest); }
|
|
128
|
-
:where([data-setting-row-end="words"]) .o-setting-row:not(.o-field-row) .o-setting-row-reason { font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); }
|
|
129
|
-
/* At the end: a Field in the card is its row (field.tsx), its error red in its note's place, its Input or InputGroup 256 wide at
|
|
130
|
-
the row's end, 64 tall at least under Inset, 16 above and below; every select at a row's end as wide as its value. */
|
|
131
|
-
.o-setting-row-field > .o-choice-text { flex: 1 1 auto; min-width: 0; }
|
|
132
|
-
.o-setting-row-field .o-setting-row-error { color: var(--vk-danger); }
|
|
133
|
-
.o-setting-row-field > .o-setting-row-end > :is(.o-input, .o-input-group) { width: calc(var(--vk-spacing) * 64); }
|
|
134
|
-
:where([data-setting-row-rows="inset"]) .o-setting-row-field { --setting-rows-height: calc(var(--vk-spacing) * 16); --setting-rows-pad: calc(var(--vk-spacing) * 4); }
|
|
135
|
-
:where([data-setting-row-fields="end"]) :is(.o-setting-row-select, .o-setting-row-end .o-select) { width: auto; }
|
|
136
|
-
:where([data-setting-row-fields="end"]) :is(.o-setting-row-select, .o-setting-row-end .o-select) .o-select-field { width: auto; }
|
|
137
|
-
/* Boxes: a Field placed in a computer's card stands as a row, the rows' room round it and the line above it. */
|
|
138
|
-
.o-setting-rows:not(.o-field-rows) > .o-field { box-sizing: border-box; padding: var(--setting-rows-pad, calc(var(--vk-spacing) * 3.5) calc(var(--vk-spacing) * 4)); border-top: var(--vk-border-width) solid var(--vk-border-subtle); }
|
|
139
|
-
.o-setting-rows:not(.o-field-rows) > .o-field:first-child { border-top: 0; }
|
|
140
|
-
|
|
141
|
-
/* ── On a phone: Field rows' card and rows; a setting's words, value and › in them ─────────────────────────────────── */
|
|
142
|
-
.o-setting-row.o-field-row > .o-choice-text { flex: 1 1 auto; }
|
|
143
|
-
.o-setting-row-press {
|
|
144
|
-
display: flex; flex: 1 1 auto; align-items: center; gap: calc(var(--vk-spacing) * 3); align-self: stretch; min-width: 0; margin: 0; padding: 0;
|
|
145
|
-
border: 0; font: inherit; color: inherit; text-align: left; background-color: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
|
|
146
|
-
}
|
|
147
|
-
.o-setting-row.o-field-row .o-setting-row-end { flex: 0 1 auto; }
|
|
148
|
-
.o-setting-row.o-field-row .o-setting-row-value { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
149
|
-
.o-setting-rows-danger.o-field-rows :is(.o-choice-label, .o-setting-row-icon) { color: var(--vk-danger); }
|
|
150
|
-
.o-setting-row.o-field-row .o-setting-row-end { gap: calc(var(--vk-spacing) * 3); }
|
|
151
|
-
.o-setting-row.o-field-row .o-setting-row-value { max-width: calc(var(--vk-spacing) * 47.5); color: var(--vk-fg-subtlest); }
|
|
152
|
-
.o-setting-row-chevron[data-phone] {
|
|
153
|
-
width: calc(var(--vk-spacing) * 2.25); height: calc(var(--vk-spacing) * 3.75); margin: 0 calc(var(--vk-spacing) * 0.5) 0 calc(var(--vk-spacing) * 0.25); color: var(--vk-icon-disclosure);
|
|
154
|
-
}
|
|
155
|
-
/* One group, one way: a card where any row has a start (an icon, or a mark) gives every row the start's room, 28 an icon's or 32
|
|
156
|
-
when a mark stands in it, so every row's words stand in one line; and each row's rule starts at the words, as iOS's Settings. */
|
|
157
|
-
.o-setting-rows.o-field-rows:has(> .o-setting-row[data-setting-row-start]) { --setting-rows-start: calc(var(--vk-spacing) * 7); }
|
|
158
|
-
.o-setting-rows.o-field-rows:has(> .o-setting-row[data-setting-row-start="mark"]) { --setting-rows-start: calc(var(--vk-spacing) * 8); }
|
|
159
|
-
.o-setting-rows.o-field-rows:has(> .o-setting-row[data-setting-row-start]) > .o-setting-row:not([data-setting-row-start]) { padding-left: calc(var(--vk-spacing) * 7 + var(--setting-rows-start)); }
|
|
160
|
-
.o-setting-rows.o-field-rows:has(> .o-setting-row[data-setting-row-start]) > .o-setting-row + .o-setting-row {
|
|
161
|
-
background-position: calc(var(--vk-spacing) * 7 + var(--setting-rows-start)) 0;
|
|
162
|
-
background-size: calc(100% - var(--vk-spacing) * 7 - var(--setting-rows-start) - var(--field-rows-line-end, 0px)) var(--vk-border-width);
|
|
163
|
-
}
|
|
164
|
-
/* A button's words at the row's end, a press of their own, a finger's height. */
|
|
165
|
-
.o-setting-row-act {
|
|
166
|
-
display: inline-flex; align-items: center; min-height: calc(var(--vk-spacing) * 11); margin: 0; padding: 0; border: 0; border-radius: var(--vk-radius-md);
|
|
167
|
-
font: inherit; font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); white-space: nowrap; color: var(--vk-fg-brand); background-color: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
|
|
168
|
-
}
|
|
169
|
-
.o-setting-row-act:focus-visible { outline: var(--vk-focus-width) solid var(--vk-border-brand); outline-offset: var(--vk-focus-offset); }
|
|
170
|
-
.o-setting-row-act:disabled { cursor: not-allowed; }
|
|
171
|
-
/* A lone row: the row the press, its name in the link colour. */
|
|
172
|
-
.o-setting-row.o-field-row[data-alone] .o-choice-label { color: var(--vk-fg-brand); }
|
|
173
|
-
/* Locked: faded, but its line (the reason) kept; its Switch fades itself (switch.css). */
|
|
174
|
-
.o-setting-row.o-field-row[data-locked] :is(.o-choice-label, .o-setting-row-icon, .o-setting-row-value, .o-setting-row-chevron, .o-setting-row-act),
|
|
175
|
-
.o-setting-row.o-field-row[data-locked] > :first-child:not(.o-choice-text, .o-setting-row-press),
|
|
176
|
-
.o-setting-row.o-field-row[data-locked] > .o-setting-row-press > :first-child:not(.o-choice-text) { opacity: var(--vk-opacity-off); }
|
|
177
|
-
|
|
178
|
-
/* ── Its icon on a phone, by the Icon option: Line, nothing picked, the glyph alone in the subtle text in a 28 box; Tile, a white
|
|
179
|
-
glyph on a 28 tile of the colour the app passed (data-colour, a label colour), grey when it passed none. The danger zone's
|
|
180
|
-
icons stay lines. Drawn wherever it stands on a phone, a row's start or a list's (SettingIcon). ─────────────────────────── */
|
|
181
|
-
.o-setting-row-icon:where([data-vk-phone], [data-vk-phone] *) {
|
|
182
|
-
width: calc(var(--vk-spacing) * 7); height: calc(var(--vk-spacing) * 7); border: 0; border-radius: 0; background-color: transparent; color: var(--vk-fg-subtle);
|
|
183
|
-
}
|
|
184
|
-
.o-setting-row-icon:where([data-vk-phone], [data-vk-phone] *) > svg { width: calc(var(--vk-spacing) * 5.5); height: calc(var(--vk-spacing) * 5.5); stroke-width: calc(var(--vk-spacing) * 0.4); }
|
|
185
|
-
:where([data-setting-row-icon="tile"]) .o-setting-row-icon:where([data-vk-phone], [data-vk-phone] *):not(.o-setting-rows-danger *) {
|
|
186
|
-
border-radius: var(--vk-radius-md); background-color: var(--setting-row-tile, var(--vk-fg-subtlest)); color: var(--vk-fg-inverse);
|
|
187
|
-
}
|
|
188
|
-
:where([data-setting-row-icon="tile"]) .o-setting-row-icon:where([data-vk-phone], [data-vk-phone] *):not(.o-setting-rows-danger *) > svg { width: calc(var(--vk-spacing) * 4.5); height: calc(var(--vk-spacing) * 4.5); stroke-width: calc(var(--vk-spacing) * 0.5); }
|
|
189
|
-
.o-setting-row-icon[data-colour="blue"] { --setting-row-tile: var(--vk-label-blue); }
|
|
190
|
-
.o-setting-row-icon[data-colour="green"] { --setting-row-tile: var(--vk-label-green); }
|
|
191
|
-
.o-setting-row-icon[data-colour="amber"] { --setting-row-tile: var(--vk-label-amber); }
|
|
192
|
-
.o-setting-row-icon[data-colour="red"] { --setting-row-tile: var(--vk-label-red); }
|
|
193
|
-
.o-setting-row-icon[data-colour="purple"] { --setting-row-tile: var(--vk-label-purple); }
|
|
194
|
-
.o-setting-row-icon[data-colour="pink"] { --setting-row-tile: var(--vk-label-pink); }
|
|
195
|
-
.o-setting-row-icon[data-colour="teal"] { --setting-row-tile: var(--vk-label-teal); }
|
|
196
|
-
|
|
197
|
-
@media (prefers-reduced-motion: reduce) { .o-setting-row { transition: none; } }
|
|
198
|
-
|
|
199
|
-
/* ── The card's corners smooth: following the token corner-smoothing, drawn with the smooth outline (smooth.css) in every
|
|
200
|
-
browser that knows shape(); one that doesn't keeps the corners above. Its round part is fitted to its smallest row, as a
|
|
201
|
-
control's is. Nothing stands outside it (its rows were hidden past its edge), so it is clipped itself, its rows with it; its
|
|
202
|
-
edge is a ring along the curve over its rows (::after), in the card's edge colour. ── */
|
|
203
|
-
@supports (clip-path: shape(evenodd from 0 0, curve by 1px 1px with 1px 0 / 1px 0, close, move to 0 0, hline to 1px, close)) and (width: calc(tan(atan2(1px, 1px)) * 1px)) {
|
|
204
|
-
.o-setting-rows:not(.o-field-rows), :where([data-setting-row-card="edged"]) .o-setting-row[data-alone]:not(.o-field-row) {
|
|
205
|
-
--smooth-amount: var(--vk-corner-smoothing);
|
|
206
|
-
--setting-rows-fit: min(var(--vk-radius-lg), var(--setting-rows-side, calc(var(--vk-spacing) * 7 + var(--vk-font-size-sm) * var(--vk-line-height-sm))) / (2 + 2 * var(--smooth-amount, 0.7)));
|
|
207
|
-
--smooth-t: var(--setting-rows-fit); --smooth-side: var(--setting-rows-side, calc(var(--vk-spacing) * 7 + var(--vk-font-size-sm) * var(--vk-line-height-sm)));
|
|
208
|
-
position: relative; overflow: visible; border-color: transparent; border-radius: var(--setting-rows-fit); clip-path: shape(var(--smooth-outline));
|
|
209
|
-
}
|
|
210
|
-
.o-setting-rows:not(.o-field-rows)::after, :where([data-setting-row-card="edged"]) .o-setting-row[data-alone]:not(.o-field-row)::after {
|
|
211
|
-
--smooth-t: max(0px, var(--setting-rows-fit) - var(--vk-border-width)); --smooth-in: var(--vk-border-width);
|
|
212
|
-
content: ""; position: absolute; inset: calc(var(--vk-border-width) * -1); z-index: 1; pointer-events: none;
|
|
213
|
-
background-color: var(--setting-rows-edge, var(--vk-border)); clip-path: shape(var(--smooth-ring));
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SwitchRow, SwitchRows, type SwitchRowProps } from "../setting-row/setting-row.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { SwitchRow, SwitchRows } from "../setting-row/setting-row.js";
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export declare const SWITCH_ROW_TOKENS: readonly [{
|
|
2
|
-
readonly name: "--vk-border";
|
|
3
|
-
readonly kind: "colour";
|
|
4
|
-
readonly outright: "--border";
|
|
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-corner-smoothing";
|
|
15
|
-
readonly kind: "size";
|
|
16
|
-
readonly outright: "--corner-smoothing";
|
|
17
|
-
}, {
|
|
18
|
-
readonly name: "--vk-font-size-sm";
|
|
19
|
-
readonly kind: "size";
|
|
20
|
-
readonly outright: "--text-sm";
|
|
21
|
-
}, {
|
|
22
|
-
readonly name: "--vk-font-weight-medium";
|
|
23
|
-
readonly kind: "size";
|
|
24
|
-
readonly outright: "--font-weight-medium";
|
|
25
|
-
}, {
|
|
26
|
-
readonly name: "--vk-line-height-sm";
|
|
27
|
-
readonly kind: "size";
|
|
28
|
-
readonly outright: "--text-sm--line-height";
|
|
29
|
-
}, {
|
|
30
|
-
readonly name: "--vk-radius-lg";
|
|
31
|
-
readonly kind: "size";
|
|
32
|
-
readonly outright: "--radius-lg";
|
|
33
|
-
}, {
|
|
34
|
-
readonly name: "--vk-spacing";
|
|
35
|
-
readonly kind: "size";
|
|
36
|
-
readonly outright: "--spacing";
|
|
37
|
-
}];
|
|
38
|
-
/** The rows' card's own machinery: the size its smooth corner is fitted to. */
|
|
39
|
-
export declare const SWITCH_ROW_PRIVATE: readonly ["--rows-card-"];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export const SWITCH_ROW_TOKENS = [
|
|
2
|
-
{ name: "--vk-border", kind: "colour", outright: "--border" },
|
|
3
|
-
{ name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
|
|
4
|
-
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
5
|
-
{ name: "--vk-corner-smoothing", kind: "size", outright: "--corner-smoothing" },
|
|
6
|
-
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
7
|
-
{ name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
|
|
8
|
-
{ name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
|
|
9
|
-
{ name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
|
|
10
|
-
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
11
|
-
];
|
|
12
|
-
export const SWITCH_ROW_PRIVATE = ["--rows-card-"];
|