viewkitjs 0.30.1 → 0.32.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 +143 -0
- package/MIGRATION.md +40 -6
- package/README.md +1 -1
- package/fields/dist/query/index.d.ts +2 -0
- package/fields/dist/query/index.js +2 -0
- package/fields/dist/query/list-request.d.ts +148 -0
- package/fields/dist/query/list-request.js +125 -0
- package/fields/dist/query/saved-view.d.ts +15 -0
- package/fields/dist/query/saved-view.js +11 -0
- package/fields/dist/query/settings.d.ts +9 -0
- package/fields/dist/query/settings.js +9 -0
- package/fields/docs/reference/query.md +66 -0
- package/package.json +8 -2
- package/postgres/README.md +1 -0
- package/postgres/dist/handler.d.ts +53 -0
- package/postgres/dist/handler.js +211 -0
- package/postgres/dist/ids.d.ts +1 -1
- package/postgres/dist/ids.js +19 -1
- package/postgres/dist/index.d.ts +1 -0
- package/postgres/dist/index.js +1 -0
- package/postgres/dist/limits.d.ts +3 -1
- package/postgres/dist/limits.js +1 -1
- package/postgres/dist/list-fields.d.ts +10 -0
- package/postgres/dist/list-fields.js +36 -0
- package/postgres/dist/readable.d.ts +4 -0
- package/postgres/dist/readable.js +4 -0
- package/postgres/dist/refusals.d.ts +9 -2
- package/postgres/dist/refusals.js +6 -0
- package/postgres/docs/guides/field-map.md +2 -2
- package/postgres/docs/guides/list-handler.md +99 -0
- package/postgres/docs/index.md +1 -0
- package/postgres/docs/reference/postgres.md +11 -3
- package/views/README.md +2 -2
- package/views/dist/atoms/RowMenu.d.ts +7 -0
- package/views/dist/atoms/RowMenu.js +18 -16
- package/views/dist/atoms/carried.d.ts +5 -0
- package/views/dist/atoms/carried.js +7 -0
- package/views/dist/atoms/types.d.ts +3 -0
- package/views/dist/contract.d.ts +26 -6
- package/views/dist/contract.js +25 -0
- package/views/dist/controls/alert-dialog/alert-dialog.js +2 -1
- package/views/dist/controls/atoms.d.ts +2 -0
- package/views/dist/controls/atoms.js +2 -0
- package/views/dist/controls/avatar/avatar.d.ts +10 -4
- package/views/dist/controls/avatar/avatar.js +5 -3
- package/views/dist/controls/avatar/tokens.d.ts +104 -0
- package/views/dist/controls/avatar/tokens.js +26 -0
- package/views/dist/controls/avatar.css +46 -15
- package/views/dist/controls/choice/tokens.d.ts +0 -4
- package/views/dist/controls/choice/tokens.js +0 -1
- package/views/dist/controls/choice.css +3 -3
- package/views/dist/controls/controls.d.ts +6 -0
- package/views/dist/controls/controls.js +10 -2
- package/views/dist/controls/customize/map-customize-body.js +1 -1
- package/views/dist/controls/field/field.d.ts +19 -4
- package/views/dist/controls/field/field.js +63 -5
- package/views/dist/controls/field/tokens.d.ts +4 -0
- package/views/dist/controls/field/tokens.js +1 -0
- package/views/dist/controls/field.css +41 -16
- package/views/dist/controls/glyphs/glyphs.d.ts +10 -0
- package/views/dist/controls/glyphs/glyphs.js +173 -0
- package/views/dist/controls/index.d.ts +4 -2
- package/views/dist/controls/index.js +3 -1
- package/views/dist/controls/input/input.d.ts +12 -1
- package/views/dist/controls/input/input.js +10 -6
- package/views/dist/controls/input/save-mark.d.ts +8 -0
- package/views/dist/controls/input/save-mark.js +26 -0
- package/views/dist/controls/input/tokens.d.ts +20 -0
- package/views/dist/controls/input/tokens.js +5 -0
- package/views/dist/controls/input.css +49 -3
- package/views/dist/controls/internal/icons.js +10 -0
- package/views/dist/controls/internal/keep-focus.d.ts +2 -0
- package/views/dist/controls/internal/keep-focus.js +17 -0
- package/views/dist/controls/internal/watch-frame.d.ts +2 -0
- package/views/dist/controls/internal/watch-frame.js +33 -0
- package/views/dist/controls/markdown/map-markdown.d.ts +4 -0
- package/views/dist/controls/markdown/map-markdown.js +5 -0
- package/views/dist/controls/menu/map-menu.js +2 -2
- package/views/dist/controls/menu-list/menu-list.d.ts +3 -0
- package/views/dist/controls/menu-list/menu-list.js +5 -4
- package/views/dist/controls/modal/modal.js +5 -1
- package/views/dist/controls/pane/pane.js +2 -1
- package/views/dist/controls/phone-header/header-bar.d.ts +5 -1
- package/views/dist/controls/phone-header/header-bar.js +2 -2
- package/views/dist/controls/phone-header.css +11 -1
- package/views/dist/controls/picker/map-picker.js +3 -0
- package/views/dist/controls/picker/picker.d.ts +14 -0
- package/views/dist/controls/picker/picker.js +30 -10
- package/views/dist/controls/picker.css +2 -0
- package/views/dist/controls/popover/popover.js +2 -1
- package/views/dist/controls/radio/radio.d.ts +12 -3
- package/views/dist/controls/radio/radio.js +25 -5
- package/views/dist/controls/radio/tokens.d.ts +84 -0
- package/views/dist/controls/radio/tokens.js +21 -0
- package/views/dist/controls/radio.css +130 -3
- package/views/dist/controls/select/select.d.ts +12 -2
- package/views/dist/controls/select/select.js +15 -7
- package/views/dist/controls/select/tokens.d.ts +8 -0
- package/views/dist/controls/select/tokens.js +2 -0
- package/views/dist/controls/select.css +17 -0
- package/views/dist/controls/setting-row/looks.d.ts +10 -0
- package/views/dist/controls/setting-row/looks.js +22 -0
- package/views/dist/controls/setting-row/setting-row.d.ts +100 -0
- package/views/dist/controls/setting-row/setting-row.js +133 -0
- package/views/dist/controls/setting-row/tokens.d.ts +156 -0
- package/views/dist/controls/setting-row/tokens.js +41 -0
- package/views/dist/controls/setting-row.css +215 -0
- package/views/dist/controls/sheet/bottom-sheet.d.ts +10 -2
- package/views/dist/controls/sheet/bottom-sheet.js +6 -3
- package/views/dist/controls/sheet.css +4 -1
- package/views/dist/controls/sort-editor/sort-editor.js +3 -2
- package/views/dist/controls/sort-editor.css +8 -2
- package/views/dist/controls/switch-row/switch-row.d.ts +1 -15
- package/views/dist/controls/switch-row/switch-row.js +1 -9
- package/views/dist/controls/switch-row/tokens.d.ts +0 -12
- package/views/dist/controls/switch-row/tokens.js +0 -3
- package/views/dist/controls/switch-row.css +3 -7
- package/views/dist/controls/switch.css +17 -7
- package/views/dist/controls/tag/tag.d.ts +3 -1
- package/views/dist/controls/tag/tag.js +2 -2
- package/views/dist/controls/tag/tokens.d.ts +4 -0
- package/views/dist/controls/tag/tokens.js +1 -0
- package/views/dist/controls/tag-field/tag-field.d.ts +5 -1
- package/views/dist/controls/tag-field/tag-field.js +11 -5
- package/views/dist/controls/tag-field/tokens.d.ts +16 -0
- package/views/dist/controls/tag-field/tokens.js +4 -0
- package/views/dist/controls/tag-field.css +19 -0
- package/views/dist/controls/tag.css +2 -0
- package/views/dist/controls/tokens.js +2 -0
- package/views/dist/controls/toolbar/toolbar.d.ts +15 -3
- package/views/dist/controls/toolbar/toolbar.js +22 -15
- package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +14 -0
- package/views/dist/controls/toolbar-button/atom-toolbar-button.js +51 -0
- package/views/dist/controls/toolbar-button/toolbar-button.d.ts +1 -1
- package/views/dist/controls/toolbar-button/toolbar-button.js +2 -3
- package/views/dist/controls/toolbar-button.css +4 -0
- package/views/dist/controls/toolbar.css +5 -0
- package/views/dist/controls/views-list/map-view-menu.d.ts +3 -0
- package/views/dist/controls/views-list/map-view-menu.js +25 -0
- package/views/dist/controls/views-list/map-views-list-body.d.ts +28 -1
- package/views/dist/controls/views-list/map-views-list-body.js +39 -21
- package/views/dist/controls/views-list/rules.d.ts +2 -0
- package/views/dist/controls/views-list/view-menu.d.ts +7 -0
- package/views/dist/controls/views-list/view-menu.js +28 -24
- package/views/dist/controls/views-list/words.d.ts +2 -0
- package/views/dist/controls/views-list/words.js +1 -1
- package/views/dist/editors/EditorPanel.js +2 -1
- package/views/dist/editors/edit-session.js +2 -5
- package/views/dist/field-row/FieldRow.d.ts +4 -2
- package/views/dist/field-row/FieldRow.js +67 -20
- package/views/dist/field-row/FieldRowLane.d.ts +7 -2
- package/views/dist/field-row/FieldRowLane.js +4 -3
- package/views/dist/field-row/editors/RowEditor.d.ts +12 -0
- package/views/dist/field-row/editors/RowEditor.js +31 -1
- package/views/dist/field-row/editors/RowValueListEditor.d.ts +5 -1
- package/views/dist/field-row/editors/RowValueListEditor.js +4 -1
- package/views/dist/field-row/field-row-button.d.ts +5 -0
- package/views/dist/field-row/field-row-button.js +2 -0
- package/views/dist/fields/binding.d.ts +3 -2
- package/views/dist/fields/binding.js +38 -5
- package/views/dist/grid/chrome/GridColumnMenu.d.ts +4 -2
- package/views/dist/grid/chrome/GridColumnMenu.js +3 -2
- package/views/dist/grid/chrome/GridGroupMenu.d.ts +4 -1
- package/views/dist/grid/chrome/GridGroupMenu.js +4 -3
- package/views/dist/grid/chrome/GridHeader.d.ts +4 -1
- package/views/dist/grid/chrome/GridHeader.js +2 -2
- package/views/dist/grid/chrome/GridRow.js +6 -5
- package/views/dist/grid/chrome/GridRowCells.js +6 -9
- package/views/dist/grid/chrome/GridStructure.d.ts +4 -1
- package/views/dist/grid/chrome/GridStructure.js +4 -4
- package/views/dist/grid/chrome/GridTable.js +5 -2
- package/views/dist/grid/chrome/grid-column-menu-items.js +1 -1
- package/views/dist/grid/chrome/grid-row-menu-items.d.ts +27 -3
- package/views/dist/grid/chrome/grid-row-menu-items.js +92 -6
- package/views/dist/grid/chrome/grid-row-props.d.ts +7 -2
- package/views/dist/grid/chrome/grid-rows-menu.js +34 -6
- package/views/dist/grid/chrome/grid-table-props.d.ts +38 -7
- package/views/dist/grid/chrome/useGridBatchApi.d.ts +3 -1
- package/views/dist/grid/chrome/useGridBatchApi.js +4 -2
- package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -2
- package/views/dist/grid/chrome/useGridKeyboard.js +15 -9
- package/views/dist/grid/chrome/useGridPendingReconciliation.js +1 -2
- package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +1 -1
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +11 -5
- package/views/dist/grid/core/commit-model.d.ts +20 -2
- package/views/dist/grid/core/editing-controller.d.ts +18 -0
- package/views/dist/grid/core/editing-controller.js +188 -42
- package/views/dist/grid/core/editing-model.d.ts +3 -0
- package/views/dist/grid/core/editing-model.js +3 -0
- package/views/dist/grid/core/save-path.d.ts +24 -0
- package/views/dist/grid/core/save-path.js +122 -0
- package/views/dist/grid/core/spreadsheet-operations.d.ts +3 -0
- package/views/dist/grid/core/spreadsheet-operations.js +23 -0
- package/views/dist/grid/index.d.ts +3 -2
- package/views/dist/grid/index.js +1 -0
- package/views/dist/internal/field-rows.d.ts +26 -0
- package/views/dist/internal/field-rows.js +8 -0
- package/views/dist/internal/page-close.d.ts +7 -0
- package/views/dist/internal/page-close.js +43 -0
- package/views/dist/list/browser-views-store.d.ts +10 -0
- package/views/dist/list/browser-views-store.js +182 -0
- package/views/dist/list/index.d.ts +23 -0
- package/views/dist/list/index.js +8 -0
- package/views/dist/list/menu.d.ts +31 -0
- package/views/dist/list/menu.js +76 -0
- package/views/dist/list/parts.d.ts +6 -0
- package/views/dist/list/parts.js +59 -0
- package/views/dist/list/registry.d.ts +11 -0
- package/views/dist/list/registry.js +31 -0
- package/views/dist/list/root.d.ts +40 -0
- package/views/dist/list/root.js +128 -0
- package/views/dist/list/slot.d.ts +14 -0
- package/views/dist/list/slot.js +22 -0
- package/views/dist/list/source.d.ts +11 -0
- package/views/dist/list/source.js +31 -0
- package/views/dist/list/store.d.ts +87 -0
- package/views/dist/list/store.js +115 -0
- package/views/dist/list/toolbar.d.ts +6 -0
- package/views/dist/list/toolbar.js +359 -0
- package/views/dist/list/views-axis.d.ts +5 -0
- package/views/dist/list/views-axis.js +96 -0
- package/views/dist/list/views-store.d.ts +41 -0
- package/views/dist/list/views-store.js +1 -0
- package/views/dist/list/views.d.ts +67 -0
- package/views/dist/list/views.js +400 -0
- package/views/dist/looks/index.d.ts +1 -0
- package/views/dist/looks/index.js +1 -0
- package/views/dist/looks/pieces.js +2 -0
- package/views/dist/model/preferences.js +1 -1
- package/views/dist/model/prefs-buckets.js +1 -1
- package/views/dist/panels/index.d.ts +3 -1
- package/views/dist/panels/index.js +1 -0
- package/views/dist/panels/react/customize-body.js +1 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +41 -4
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +6 -326
- package/views/dist/panels/react/toolbar/Toolbar.d.ts +9 -1
- package/views/dist/panels/react/toolbar/Toolbar.js +34 -23
- package/views/dist/panels/react/toolbar/ToolbarButton.js +4 -1
- package/views/dist/panels/react/toolbar/ToolbarNew.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +2 -2
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +3 -1
- package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
- package/views/dist/panels/react/toolbar/context.d.ts +10 -2
- package/views/dist/panels/react/toolbar/context.js +3 -1
- package/views/dist/panels/react/views-row/FoldingViewRow.d.ts +1 -1
- package/views/dist/panels/react/views-row/FoldingViewRow.js +15 -4
- package/views/dist/panels/react/views-row/PillGroup.d.ts +5 -2
- package/views/dist/panels/react/views-row/PillGroup.js +16 -7
- package/views/dist/panels/react/views-row/ViewPicker.js +2 -12
- package/views/dist/panels/react/views-row/ViewPickerRow.d.ts +4 -2
- package/views/dist/panels/react/views-row/ViewPickerRow.js +9 -5
- package/views/dist/panels/react.d.ts +2 -2
- package/views/dist/panels/toolbar/edit-view.d.ts +7 -1
- package/views/dist/panels/toolbar/edit-view.js +14 -0
- package/views/dist/panels/toolbar/model.d.ts +5 -0
- package/views/dist/panels/toolbar/model.js +7 -3
- package/views/dist/panels/view-state.d.ts +5 -3
- package/views/dist/panels/views-row/model.d.ts +19 -2
- package/views/dist/panels/views-row/model.js +14 -0
- package/views/dist/provider/ViewsProvider.d.ts +16 -7
- package/views/dist/provider/ViewsProvider.js +23 -5
- package/views/dist/provider/components.d.ts +43 -2
- package/views/dist/provider/context.d.ts +2 -1
- package/views/dist/provider/context.js +1 -1
- package/views/dist/provider/ports.d.ts +19 -12
- package/views/dist/provider/ports.js +69 -1
- package/views/dist/react.d.ts +1 -1
- package/views/dist/styles.css +583 -61
- package/views/dist/styles.unlayered.css +583 -61
- package/views/docs/contract.md +42 -31
- package/views/docs/controls/avatar.md +26 -0
- package/views/docs/controls/choice.md +0 -1
- package/views/docs/controls/field.md +3 -0
- package/views/docs/controls/input.md +9 -0
- package/views/docs/controls/radio.md +33 -0
- package/views/docs/controls/select.md +6 -0
- package/views/docs/controls/setting-row.md +44 -0
- package/views/docs/controls/switch-row.md +0 -3
- package/views/docs/controls/tag-field.md +4 -0
- package/views/docs/controls/tag.md +1 -0
- package/views/docs/getting-started.md +2 -2
- package/views/docs/guides/atoms.md +2 -2
- package/views/docs/guides/columns.md +1 -1
- package/views/docs/guides/ports.md +1 -1
- package/views/docs/guides/the-grid.md +34 -7
- package/views/docs/guides/the-provider.md +4 -2
- package/views/docs/index.md +1 -0
- package/views/docs/reference/controls.md +54 -27
- package/views/docs/reference/editors-session.md +1 -1
- package/views/docs/reference/field-row.md +9 -1
- package/views/docs/reference/grid.md +14 -8
- package/views/docs/reference/list.md +227 -0
- package/views/docs/reference/looks.md +3 -0
- package/views/docs/reference/panels-react.md +17 -12
- package/views/docs/reference/panels.md +8 -5
- package/views/docs/reference/react.md +11 -9
- package/views/docs/reference/views.md +2 -2
- package/views/skills/views/SKILL.md +9 -6
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
import { type OptionColour } from "../option/looks.js";
|
|
3
|
+
export type AvatarSize = 16 | 20 | 24 | 32 | 40 | 56 | 64 | 96;
|
|
4
|
+
/** A square's own colour: one of the label hues, or grey, the Option's list. */
|
|
5
|
+
export type AvatarColour = OptionColour;
|
|
3
6
|
/** The initials of a name: the first letters of the first and last names; a first name of two joined
|
|
4
7
|
* parts gives both ("Maximiliane-Theodora von Hohenberg-Lichtenstein" is MT); one name gives one ("Jo" is J). */
|
|
5
8
|
export declare function initials(name: string): string;
|
|
@@ -15,12 +18,15 @@ export interface AvatarProps {
|
|
|
15
18
|
* fills, or with neither its first letter. */
|
|
16
19
|
kind?: "person" | "thing" | "workspace" | "agent";
|
|
17
20
|
/** 16 in a chip (a typed Select's), with no badge; 20 in chips and text, 24 in dense rows and stacks, 32 in list rows,
|
|
18
|
-
* 40 in headers, 64 on a record's own page. */
|
|
21
|
+
* 40 in headers, 56 at a settings page's head, 64 on a record's own page, 96 a photo on a phone. */
|
|
19
22
|
size?: AvatarSize;
|
|
20
23
|
/** A stable id, for a person's tone. */
|
|
21
24
|
id?: string;
|
|
22
25
|
/** The tone itself, where the app keeps it. */
|
|
23
26
|
tone?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
27
|
+
/** A square's own colour (a team's letter, an app's or an object's icon, the workspace's initials on the colour picked
|
|
28
|
+
* for it): the square on the hue's fill, what it holds in the hue's strong ink, with no edge. A person keeps their tone. */
|
|
29
|
+
colour?: AvatarColour;
|
|
24
30
|
/** A photo or a logo, filling the same shape. */
|
|
25
31
|
src?: string;
|
|
26
32
|
/** A record with no name: its kind's icon instead of a letter. */
|
|
@@ -32,7 +38,7 @@ export interface AvatarProps {
|
|
|
32
38
|
className?: string;
|
|
33
39
|
}
|
|
34
40
|
/** Who or what a row is about, at a glance. */
|
|
35
|
-
export declare function Avatar({ name, kind, size, id, tone, src, icon, presence, badge, className }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare function Avatar({ name, kind, size, id, tone, colour, src, icon, presence, badge, className }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
36
42
|
/** One person on a stack. */
|
|
37
43
|
export type AvatarStackPerson = Omit<AvatarProps, "size" | "kind">;
|
|
38
44
|
export interface AvatarStackProps {
|
|
@@ -40,7 +46,7 @@ export interface AvatarStackProps {
|
|
|
40
46
|
people: AvatarStackPerson[];
|
|
41
47
|
/** How many to show before the rest become a count. */
|
|
42
48
|
max?: number;
|
|
43
|
-
size?: Exclude<AvatarSize, 16>;
|
|
49
|
+
size?: Exclude<AvatarSize, 16 | 56 | 96>;
|
|
44
50
|
className?: string;
|
|
45
51
|
/** What everyone is on ("Acme Robotics renewal"): the list's name to a screen reader. Left out, the stack's own words. */
|
|
46
52
|
label?: string;
|
|
@@ -5,9 +5,10 @@ import { cx } from "../../internal/cx.js";
|
|
|
5
5
|
import { Button } from "../button/button.js";
|
|
6
6
|
import { MENU_LIST_CARD_FRAME } from "../menu-list/looks.js";
|
|
7
7
|
import { Menu } from "../menu/menu.js";
|
|
8
|
+
import { optionColours } from "../option/looks.js";
|
|
8
9
|
import { Icon } from "../internal/icons.js";
|
|
9
10
|
import { PhoneHost, usePhone } from "../internal/phone.js";
|
|
10
|
-
const SIZE = { 16: "o-avatar-2xs", 20: "o-avatar-xs", 24: "o-avatar-sm", 32: "", 40: "o-avatar-lg", 64: "o-avatar-xl" };
|
|
11
|
+
const SIZE = { 16: "o-avatar-2xs", 20: "o-avatar-xs", 24: "o-avatar-sm", 32: "", 40: "o-avatar-lg", 56: "o-avatar-56", 64: "o-avatar-xl", 96: "o-avatar-96" };
|
|
11
12
|
export function initials(name) {
|
|
12
13
|
const words = name.split(/\s+/).filter((w) => /^\p{L}/u.test(w));
|
|
13
14
|
if (!words.length)
|
|
@@ -23,10 +24,11 @@ export function toneOf(id) {
|
|
|
23
24
|
h = (h * 31 + c.charCodeAt(0)) >>> 0;
|
|
24
25
|
return (h % 6) + 1;
|
|
25
26
|
}
|
|
26
|
-
export function Avatar({ name, kind = "person", size = 32, id, tone, src, icon, presence, badge, className }) {
|
|
27
|
+
export function Avatar({ name, kind = "person", size = 32, id, tone, colour, src, icon, presence, badge, className }) {
|
|
27
28
|
const person = kind === "person";
|
|
29
|
+
const coloured = !person && colour && optionColours.includes(colour) ? colour : undefined;
|
|
28
30
|
const letters = icon ? null : kind === "thing" || kind === "agent" ? initials(name).slice(0, 1) : initials(name);
|
|
29
|
-
const avatar = (_jsxs(BaseAvatar.Root, { role: "img", "aria-label": presence ? `${name}, ${presence}` : name, "data-kit": "avatar", "data-tone": person ? tone ?? toneOf(id ?? name) : undefined, className: cx("o-avatar", SIZE[size], !person && "o-avatar-thing o-smooth o-smooth-ease", kind === "workspace" && "o-avatar-workspace", kind === "agent" && "o-avatar-agent", className), children: [src && _jsx(BaseAvatar.Image, { className: "o-avatar-image", src: src, alt: "" }), _jsx(BaseAvatar.Fallback, { className: "o-avatar-letters", "aria-hidden": "true", children: icon ?? letters })] }));
|
|
31
|
+
const avatar = (_jsxs(BaseAvatar.Root, { role: "img", "aria-label": presence ? `${name}, ${presence}` : name, "data-kit": "avatar", "data-tone": person ? tone ?? toneOf(id ?? name) : undefined, "data-colour": coloured, className: cx("o-avatar", SIZE[size], !person && "o-avatar-thing o-smooth o-smooth-ease", kind === "workspace" && "o-avatar-workspace", kind === "agent" && "o-avatar-agent", className), children: [src && _jsx(BaseAvatar.Image, { className: "o-avatar-image", src: src, alt: "" }), _jsx(BaseAvatar.Fallback, { className: "o-avatar-letters", "aria-hidden": "true", children: icon ?? letters })] }));
|
|
30
32
|
if (size === 16 || (!presence && (badge == null || badge === false)))
|
|
31
33
|
return avatar;
|
|
32
34
|
return (_jsxs("span", { className: "o-avatar-badged", "data-size": size, "data-thing": person ? undefined : "", children: [avatar, presence ? _jsx("span", { className: "o-avatar-badge", "data-presence": presence, "aria-hidden": "true" })
|
|
@@ -22,6 +22,94 @@ export declare const AVATAR_TOKENS: readonly [{
|
|
|
22
22
|
readonly name: "--vk-fg-subtlest";
|
|
23
23
|
readonly kind: "colour";
|
|
24
24
|
readonly outright: "--text-subtlest";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-fg-inverse";
|
|
27
|
+
readonly kind: "colour";
|
|
28
|
+
readonly outright: "--text-inverse";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-label-amber-fill";
|
|
31
|
+
readonly kind: "colour";
|
|
32
|
+
readonly outright: "--label-amber-fill";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-label-amber-strong";
|
|
35
|
+
readonly kind: "colour";
|
|
36
|
+
readonly outright: "--label-amber-strong";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-label-blue-fill";
|
|
39
|
+
readonly kind: "colour";
|
|
40
|
+
readonly outright: "--label-blue-fill";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-label-blue-strong";
|
|
43
|
+
readonly kind: "colour";
|
|
44
|
+
readonly outright: "--label-blue-strong";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-label-green-fill";
|
|
47
|
+
readonly kind: "colour";
|
|
48
|
+
readonly outright: "--label-green-fill";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "--vk-label-green-strong";
|
|
51
|
+
readonly kind: "colour";
|
|
52
|
+
readonly outright: "--label-green-strong";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "--vk-label-pink-fill";
|
|
55
|
+
readonly kind: "colour";
|
|
56
|
+
readonly outright: "--label-pink-fill";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "--vk-label-pink-strong";
|
|
59
|
+
readonly kind: "colour";
|
|
60
|
+
readonly outright: "--label-pink-strong";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "--vk-label-purple-fill";
|
|
63
|
+
readonly kind: "colour";
|
|
64
|
+
readonly outright: "--label-purple-fill";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "--vk-label-purple-strong";
|
|
67
|
+
readonly kind: "colour";
|
|
68
|
+
readonly outright: "--label-purple-strong";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "--vk-label-red-fill";
|
|
71
|
+
readonly kind: "colour";
|
|
72
|
+
readonly outright: "--label-red-fill";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "--vk-label-red-strong";
|
|
75
|
+
readonly kind: "colour";
|
|
76
|
+
readonly outright: "--label-red-strong";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "--vk-label-teal-fill";
|
|
79
|
+
readonly kind: "colour";
|
|
80
|
+
readonly outright: "--label-teal-fill";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "--vk-label-teal-strong";
|
|
83
|
+
readonly kind: "colour";
|
|
84
|
+
readonly outright: "--label-teal-strong";
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "--vk-label-blue";
|
|
87
|
+
readonly kind: "colour";
|
|
88
|
+
readonly outright: "--label-blue";
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "--vk-label-green";
|
|
91
|
+
readonly kind: "colour";
|
|
92
|
+
readonly outright: "--label-green";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "--vk-label-amber";
|
|
95
|
+
readonly kind: "colour";
|
|
96
|
+
readonly outright: "--label-amber";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "--vk-label-red";
|
|
99
|
+
readonly kind: "colour";
|
|
100
|
+
readonly outright: "--label-red";
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "--vk-label-purple";
|
|
103
|
+
readonly kind: "colour";
|
|
104
|
+
readonly outright: "--label-purple";
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "--vk-label-pink";
|
|
107
|
+
readonly kind: "colour";
|
|
108
|
+
readonly outright: "--label-pink";
|
|
109
|
+
}, {
|
|
110
|
+
readonly name: "--vk-label-teal";
|
|
111
|
+
readonly kind: "colour";
|
|
112
|
+
readonly outright: "--label-teal";
|
|
25
113
|
}, {
|
|
26
114
|
readonly name: "--vk-neutral";
|
|
27
115
|
readonly kind: "colour";
|
|
@@ -78,10 +166,18 @@ export declare const AVATAR_TOKENS: readonly [{
|
|
|
78
166
|
readonly name: "--vk-font-size-3xs";
|
|
79
167
|
readonly kind: "size";
|
|
80
168
|
readonly outright: "--text-3xs";
|
|
169
|
+
}, {
|
|
170
|
+
readonly name: "--vk-font-size-4xl";
|
|
171
|
+
readonly kind: "size";
|
|
172
|
+
readonly outright: "--text-4xl";
|
|
81
173
|
}, {
|
|
82
174
|
readonly name: "--vk-font-size-sm";
|
|
83
175
|
readonly kind: "size";
|
|
84
176
|
readonly outright: "--text-sm";
|
|
177
|
+
}, {
|
|
178
|
+
readonly name: "--vk-font-size-xl";
|
|
179
|
+
readonly kind: "size";
|
|
180
|
+
readonly outright: "--text-xl";
|
|
85
181
|
}, {
|
|
86
182
|
readonly name: "--vk-font-size-xs";
|
|
87
183
|
readonly kind: "size";
|
|
@@ -94,6 +190,14 @@ export declare const AVATAR_TOKENS: readonly [{
|
|
|
94
190
|
readonly name: "--vk-radius-2xl";
|
|
95
191
|
readonly kind: "size";
|
|
96
192
|
readonly outright: "--radius-2xl";
|
|
193
|
+
}, {
|
|
194
|
+
readonly name: "--vk-radius-3xl";
|
|
195
|
+
readonly kind: "size";
|
|
196
|
+
readonly outright: "--radius-3xl";
|
|
197
|
+
}, {
|
|
198
|
+
readonly name: "--vk-radius-4xl";
|
|
199
|
+
readonly kind: "size";
|
|
200
|
+
readonly outright: "--radius-4xl";
|
|
97
201
|
}, {
|
|
98
202
|
readonly name: "--vk-radius-full";
|
|
99
203
|
readonly kind: "size";
|
|
@@ -5,6 +5,28 @@ export const AVATAR_TOKENS = [
|
|
|
5
5
|
{ name: "--vk-fg-on-brand", kind: "colour", outright: "--text-brand-inverse" },
|
|
6
6
|
{ name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
|
|
7
7
|
{ name: "--vk-fg-subtlest", kind: "colour", outright: "--text-subtlest" },
|
|
8
|
+
{ name: "--vk-fg-inverse", kind: "colour", outright: "--text-inverse" },
|
|
9
|
+
{ name: "--vk-label-amber-fill", kind: "colour", outright: "--label-amber-fill" },
|
|
10
|
+
{ name: "--vk-label-amber-strong", kind: "colour", outright: "--label-amber-strong" },
|
|
11
|
+
{ name: "--vk-label-blue-fill", kind: "colour", outright: "--label-blue-fill" },
|
|
12
|
+
{ name: "--vk-label-blue-strong", kind: "colour", outright: "--label-blue-strong" },
|
|
13
|
+
{ name: "--vk-label-green-fill", kind: "colour", outright: "--label-green-fill" },
|
|
14
|
+
{ name: "--vk-label-green-strong", kind: "colour", outright: "--label-green-strong" },
|
|
15
|
+
{ name: "--vk-label-pink-fill", kind: "colour", outright: "--label-pink-fill" },
|
|
16
|
+
{ name: "--vk-label-pink-strong", kind: "colour", outright: "--label-pink-strong" },
|
|
17
|
+
{ name: "--vk-label-purple-fill", kind: "colour", outright: "--label-purple-fill" },
|
|
18
|
+
{ name: "--vk-label-purple-strong", kind: "colour", outright: "--label-purple-strong" },
|
|
19
|
+
{ name: "--vk-label-red-fill", kind: "colour", outright: "--label-red-fill" },
|
|
20
|
+
{ name: "--vk-label-red-strong", kind: "colour", outright: "--label-red-strong" },
|
|
21
|
+
{ name: "--vk-label-teal-fill", kind: "colour", outright: "--label-teal-fill" },
|
|
22
|
+
{ name: "--vk-label-teal-strong", kind: "colour", outright: "--label-teal-strong" },
|
|
23
|
+
{ name: "--vk-label-blue", kind: "colour", outright: "--label-blue" },
|
|
24
|
+
{ name: "--vk-label-green", kind: "colour", outright: "--label-green" },
|
|
25
|
+
{ name: "--vk-label-amber", kind: "colour", outright: "--label-amber" },
|
|
26
|
+
{ name: "--vk-label-red", kind: "colour", outright: "--label-red" },
|
|
27
|
+
{ name: "--vk-label-purple", kind: "colour", outright: "--label-purple" },
|
|
28
|
+
{ name: "--vk-label-pink", kind: "colour", outright: "--label-pink" },
|
|
29
|
+
{ name: "--vk-label-teal", kind: "colour", outright: "--label-teal" },
|
|
8
30
|
{ name: "--vk-neutral", kind: "colour", outright: "--background-neutral" },
|
|
9
31
|
{ name: "--vk-person-1", kind: "colour", outright: "--person-1" },
|
|
10
32
|
{ name: "--vk-person-2", kind: "colour", outright: "--person-2" },
|
|
@@ -19,10 +41,14 @@ export const AVATAR_TOKENS = [
|
|
|
19
41
|
{ name: "--vk-font-size-2xl", kind: "size", outright: "--text-2xl" },
|
|
20
42
|
{ name: "--vk-font-size-2xs", kind: "size", outright: "--text-2xs" },
|
|
21
43
|
{ name: "--vk-font-size-3xs", kind: "size", outright: "--text-3xs" },
|
|
44
|
+
{ name: "--vk-font-size-4xl", kind: "size", outright: "--text-4xl" },
|
|
22
45
|
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
46
|
+
{ name: "--vk-font-size-xl", kind: "size", outright: "--text-xl" },
|
|
23
47
|
{ name: "--vk-font-size-xs", kind: "size", outright: "--text-xs" },
|
|
24
48
|
{ name: "--vk-font-weight-semibold", kind: "size", outright: "--font-weight-semibold" },
|
|
25
49
|
{ name: "--vk-radius-2xl", kind: "size", outright: "--radius-2xl" },
|
|
50
|
+
{ name: "--vk-radius-3xl", kind: "size", outright: "--radius-3xl" },
|
|
51
|
+
{ name: "--vk-radius-4xl", kind: "size", outright: "--radius-4xl" },
|
|
26
52
|
{ name: "--vk-radius-full", kind: "size", outright: "--radius-full" },
|
|
27
53
|
{ name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
|
|
28
54
|
{ name: "--vk-radius-md", kind: "size", outright: "--radius-md" },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* The Avatar. Every value it draws with is a
|
|
2
2
|
token (control tokens); this file only says which token each kind and size takes. People are circles on
|
|
3
3
|
their own tone (data-tone, 1 to 6); things are squares on a quiet ground; the workspace is the brand; an agent is a thing's
|
|
4
|
-
square holding its own icon. Its options, on the frame around it (looks.ts), are its squares' alone:
|
|
4
|
+
square holding its own icon; a square handed its own colour (data-colour, a label hue) stands on that hue instead. Its options, on the frame around it (looks.ts), are its squares' alone:
|
|
5
5
|
|
|
6
6
|
data-avatar-corners small · medium · large · xlarge a radius token per size; nothing set is Medium
|
|
7
7
|
data-avatar-smoothing round · smooth how a square's corners bend; nothing set is Smooth
|
|
@@ -27,48 +27,77 @@
|
|
|
27
27
|
.o-avatar-letters svg { width: 55%; height: 55%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
|
|
28
28
|
|
|
29
29
|
/* ── Sizes: 16 in a typed Select's chip, its initials at the 3xs type size; 20 in chips and text, 24 in dense rows and stacks,
|
|
30
|
-
40 in headers, 64 on a record's page ── */
|
|
30
|
+
40 in headers, 56 at a settings page's head, 64 on a record's page, 96 a photo on a phone ── */
|
|
31
31
|
.o-avatar.o-avatar-2xs { width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); font-size: var(--vk-font-size-3xs); }
|
|
32
32
|
.o-avatar.o-avatar-xs { width: calc(var(--vk-spacing) * 5); height: calc(var(--vk-spacing) * 5); font-size: var(--vk-font-size-2xs); }
|
|
33
33
|
.o-avatar.o-avatar-sm { width: calc(var(--vk-spacing) * 6); height: calc(var(--vk-spacing) * 6); font-size: var(--vk-font-size-2xs); }
|
|
34
34
|
.o-avatar.o-avatar-lg { width: calc(var(--vk-spacing) * 10); height: calc(var(--vk-spacing) * 10); font-size: var(--vk-font-size-sm); }
|
|
35
|
+
.o-avatar.o-avatar-56 { width: calc(var(--vk-spacing) * 14); height: calc(var(--vk-spacing) * 14); font-size: var(--vk-font-size-xl); }
|
|
35
36
|
.o-avatar.o-avatar-xl { width: calc(var(--vk-spacing) * 16); height: calc(var(--vk-spacing) * 16); font-size: var(--vk-font-size-2xl); }
|
|
37
|
+
.o-avatar.o-avatar-96 { width: calc(var(--vk-spacing) * 24); height: calc(var(--vk-spacing) * 24); font-size: var(--vk-font-size-4xl); }
|
|
36
38
|
|
|
37
39
|
/* ── A thing: a square, its corners a step that grows with it, on the neutral ground, its edge inside ─ */
|
|
38
40
|
.o-avatar.o-avatar-thing { border-radius: var(--avatar-r); background-color: var(--vk-neutral); color: var(--vk-fg-subtle); box-shadow: inset 0 0 0 var(--vk-border-width) var(--vk-border-subtle); }
|
|
39
41
|
/* The workspace: the one square in the brand. */
|
|
40
42
|
.o-avatar.o-avatar-workspace { background-color: var(--vk-brand); color: var(--vk-fg-on-brand); box-shadow: none; }
|
|
43
|
+
/* A square's own colour, the workspace's included: on the hue's fill, what it holds in the hue's strong ink, with no edge; grey
|
|
44
|
+
the neutral ground in the quieter ink. */
|
|
45
|
+
.o-avatar.o-avatar-thing[data-colour] { box-shadow: none; }
|
|
46
|
+
.o-avatar.o-avatar-thing[data-colour="blue"] { background-color: var(--vk-label-blue-fill); color: var(--vk-label-blue-strong); }
|
|
47
|
+
.o-avatar.o-avatar-thing[data-colour="green"] { background-color: var(--vk-label-green-fill); color: var(--vk-label-green-strong); }
|
|
48
|
+
.o-avatar.o-avatar-thing[data-colour="amber"] { background-color: var(--vk-label-amber-fill); color: var(--vk-label-amber-strong); }
|
|
49
|
+
.o-avatar.o-avatar-thing[data-colour="red"] { background-color: var(--vk-label-red-fill); color: var(--vk-label-red-strong); }
|
|
50
|
+
.o-avatar.o-avatar-thing[data-colour="purple"] { background-color: var(--vk-label-purple-fill); color: var(--vk-label-purple-strong); }
|
|
51
|
+
.o-avatar.o-avatar-thing[data-colour="pink"] { background-color: var(--vk-label-pink-fill); color: var(--vk-label-pink-strong); }
|
|
52
|
+
.o-avatar.o-avatar-thing[data-colour="teal"] { background-color: var(--vk-label-teal-fill); color: var(--vk-label-teal-strong); }
|
|
53
|
+
.o-avatar.o-avatar-thing[data-colour="grey"] { background-color: var(--vk-neutral); color: var(--vk-fg-subtle); }
|
|
41
54
|
/* An agent: a thing's square holding its own icon. Its mark comes in its own fills, so it is filled, never drawn as a
|
|
42
55
|
line as a record's icon is; a mark with no colour of its own (Codex's, Grok's) takes the text's ink, as the canvas drew it. */
|
|
43
56
|
.o-avatar-agent .o-avatar-letters svg { fill: var(--vk-fg); stroke: none; }
|
|
57
|
+
/* On a phone an agent's square on its own colour stands bold, as iOS draws an app's tile (round 3 of the settings canvas): the hue
|
|
58
|
+
under a white letter, as the setting row's Tile draws its icons; grey the quietest ink. A thing's, the workspace's included,
|
|
59
|
+
keeps the hue's fill. */
|
|
60
|
+
.o-avatar.o-avatar-agent[data-colour]:where([data-vk-phone] *) { color: var(--vk-fg-inverse); }
|
|
61
|
+
.o-avatar.o-avatar-agent[data-colour="blue"]:where([data-vk-phone] *) { background-color: var(--vk-label-blue); }
|
|
62
|
+
.o-avatar.o-avatar-agent[data-colour="green"]:where([data-vk-phone] *) { background-color: var(--vk-label-green); }
|
|
63
|
+
.o-avatar.o-avatar-agent[data-colour="amber"]:where([data-vk-phone] *) { background-color: var(--vk-label-amber); }
|
|
64
|
+
.o-avatar.o-avatar-agent[data-colour="red"]:where([data-vk-phone] *) { background-color: var(--vk-label-red); }
|
|
65
|
+
.o-avatar.o-avatar-agent[data-colour="purple"]:where([data-vk-phone] *) { background-color: var(--vk-label-purple); }
|
|
66
|
+
.o-avatar.o-avatar-agent[data-colour="pink"]:where([data-vk-phone] *) { background-color: var(--vk-label-pink); }
|
|
67
|
+
.o-avatar.o-avatar-agent[data-colour="teal"]:where([data-vk-phone] *) { background-color: var(--vk-label-teal); }
|
|
68
|
+
.o-avatar.o-avatar-agent[data-colour="grey"]:where([data-vk-phone] *) { background-color: var(--vk-fg-subtlest); }
|
|
44
69
|
|
|
45
|
-
/* ── Corners: a radius token per size, in steps; Medium with nothing set: xs at 20, sm at 24 and 32, md at 40, lg at 64,
|
|
70
|
+
/* ── Corners: a radius token per size, in steps, 56 taking 64's; Medium with nothing set: xs at 20, sm at 24 and 32, md at 40, lg at 56 and 64, 2xl at 96 (two steps past 64's, as round 3's photo draws it),
|
|
46
71
|
between Small and Large, the tokens holding nothing between xs and sm ────────────────────────────── */
|
|
47
72
|
.o-avatar.o-avatar-thing { --avatar-r: var(--vk-radius-sm); }
|
|
48
73
|
.o-avatar.o-avatar-thing:is(.o-avatar-2xs, .o-avatar-xs) { --avatar-r: var(--vk-radius-xs); }
|
|
49
74
|
.o-avatar.o-avatar-thing.o-avatar-lg { --avatar-r: var(--vk-radius-md); }
|
|
50
|
-
.o-avatar.o-avatar-thing.o-avatar-xl { --avatar-r: var(--vk-radius-lg); }
|
|
51
|
-
|
|
75
|
+
.o-avatar.o-avatar-thing:is(.o-avatar-56, .o-avatar-xl) { --avatar-r: var(--vk-radius-lg); }
|
|
76
|
+
.o-avatar.o-avatar-thing.o-avatar-96 { --avatar-r: var(--vk-radius-2xl); }
|
|
77
|
+
/* Small: xs at 20 and 24, sm at 32 and 40, md at 56 and 64, xl at 96. */
|
|
52
78
|
[data-avatar-corners="small"] .o-avatar.o-avatar-thing { --avatar-r: var(--vk-radius-sm); }
|
|
53
79
|
[data-avatar-corners="small"] .o-avatar.o-avatar-thing:is(.o-avatar-2xs, .o-avatar-xs, .o-avatar-sm) { --avatar-r: var(--vk-radius-xs); }
|
|
54
|
-
[data-avatar-corners="small"] .o-avatar.o-avatar-thing.o-avatar-xl { --avatar-r: var(--vk-radius-md); }
|
|
55
|
-
|
|
80
|
+
[data-avatar-corners="small"] .o-avatar.o-avatar-thing:is(.o-avatar-56, .o-avatar-xl) { --avatar-r: var(--vk-radius-md); }
|
|
81
|
+
[data-avatar-corners="small"] .o-avatar.o-avatar-thing.o-avatar-96 { --avatar-r: var(--vk-radius-xl); }
|
|
82
|
+
/* Large, the radii before Medium came: sm at 20 and 24, md at 32, lg at 40, xl at 56 and 64, 3xl at 96. */
|
|
56
83
|
[data-avatar-corners="large"] .o-avatar.o-avatar-thing { --avatar-r: var(--vk-radius-md); }
|
|
57
84
|
[data-avatar-corners="large"] .o-avatar.o-avatar-thing:is(.o-avatar-2xs, .o-avatar-xs, .o-avatar-sm) { --avatar-r: var(--vk-radius-sm); }
|
|
58
85
|
[data-avatar-corners="large"] .o-avatar.o-avatar-thing.o-avatar-lg { --avatar-r: var(--vk-radius-lg); }
|
|
59
|
-
[data-avatar-corners="large"] .o-avatar.o-avatar-thing.o-avatar-xl { --avatar-r: var(--vk-radius-xl); }
|
|
60
|
-
|
|
86
|
+
[data-avatar-corners="large"] .o-avatar.o-avatar-thing:is(.o-avatar-56, .o-avatar-xl) { --avatar-r: var(--vk-radius-xl); }
|
|
87
|
+
[data-avatar-corners="large"] .o-avatar.o-avatar-thing.o-avatar-96 { --avatar-r: var(--vk-radius-3xl); }
|
|
88
|
+
/* Extra large: md at 20 and 24, lg at 32, xl at 40, 2xl at 56 and 64, 4xl at 96. */
|
|
61
89
|
[data-avatar-corners="xlarge"] .o-avatar.o-avatar-thing { --avatar-r: var(--vk-radius-lg); }
|
|
62
90
|
[data-avatar-corners="xlarge"] .o-avatar.o-avatar-thing:is(.o-avatar-2xs, .o-avatar-xs, .o-avatar-sm) { --avatar-r: var(--vk-radius-md); }
|
|
63
91
|
[data-avatar-corners="xlarge"] .o-avatar.o-avatar-thing.o-avatar-lg { --avatar-r: var(--vk-radius-xl); }
|
|
64
|
-
[data-avatar-corners="xlarge"] .o-avatar.o-avatar-thing.o-avatar-xl { --avatar-r: var(--vk-radius-2xl); }
|
|
92
|
+
[data-avatar-corners="xlarge"] .o-avatar.o-avatar-thing:is(.o-avatar-56, .o-avatar-xl) { --avatar-r: var(--vk-radius-2xl); }
|
|
93
|
+
[data-avatar-corners="xlarge"] .o-avatar.o-avatar-thing.o-avatar-96 { --avatar-r: var(--vk-radius-4xl); }
|
|
65
94
|
|
|
66
95
|
/* ── Corner smoothing: Smooth, with nothing set, draws a square's corners with the smooth outline (smooth.css),
|
|
67
96
|
every browser that knows shape() showing it; one that doesn't keeps the quarter circles above, and so does Round. Its
|
|
68
97
|
smoothing eases off where a side is too short for 1.7 radii at each end, as the canvas drew it (o-smooth-ease, from its size and
|
|
69
98
|
its radius, both tokens, so it follows Corner radius). The outline would cut the edge drawn inside the square, so under it the
|
|
70
99
|
edge is a ring of its own (::before), between the outline and the same outline drawn a hairline in, under whatever the square
|
|
71
|
-
holds; the workspace
|
|
100
|
+
holds; the workspace and a square on its own colour have none. Its smoothing is its own Corner smoothing, never a host's: the outline's amount inherits, and a
|
|
72
101
|
crumb, a tab or a list's card that follows the token sets it on itself, so the square sets it back. ─────── */
|
|
73
102
|
@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)) {
|
|
74
103
|
.o-avatar.o-avatar-thing { --smooth-amount: initial; }
|
|
@@ -76,8 +105,9 @@
|
|
|
76
105
|
--avatar-rr: min(var(--avatar-r), var(--avatar-size) / 2); --smooth-t: var(--avatar-rr); --smooth-side: var(--avatar-size);
|
|
77
106
|
position: relative; box-shadow: none; clip-path: shape(var(--smooth-outline));
|
|
78
107
|
}
|
|
79
|
-
/* Its edge, a hairline ring along the outline, under the picture or the letters it holds; the workspace
|
|
80
|
-
|
|
108
|
+
/* Its edge, a hairline ring along the outline, under the picture or the letters it holds; the workspace and a square on its
|
|
109
|
+
own colour have none. */
|
|
110
|
+
.o-avatar.o-avatar-thing:not(.o-avatar-workspace):not([data-colour]):not([data-avatar-smoothing="round"] *)::before {
|
|
81
111
|
--smooth-t: calc(var(--avatar-rr) - var(--vk-border-width)); --smooth-in: var(--vk-border-width);
|
|
82
112
|
content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-color: var(--vk-border-subtle);
|
|
83
113
|
clip-path: shape(var(--smooth-ring));
|
|
@@ -123,13 +153,14 @@
|
|
|
123
153
|
/* The rest, as a count in a neutral circle. */
|
|
124
154
|
.o-avatar.o-avatar-more { background-color: var(--vk-neutral); color: var(--vk-fg-subtle); font-variant-numeric: tabular-nums; }
|
|
125
155
|
/* ── Presence and the badge: a dot on the corner, its size stepping with the avatar's (6,
|
|
126
|
-
8, 10, 12, 16), cut out of whatever the avatar stands on by a mask, never a ring painted in the page's colour. The mask stands
|
|
156
|
+
8, 10, 12, 14, 16), cut out of whatever the avatar stands on by a mask, never a ring painted in the page's colour. The mask stands
|
|
127
157
|
only on a badged avatar and a stack's faces: a mask clips what is outside the box and makes a stacking context. ──────── */
|
|
128
158
|
:is(.o-avatar, .o-avatar-badged) { --avatar-size: calc(var(--vk-spacing) * 8); --avatar-dot: calc(var(--vk-spacing) * 2.5); --avatar-cut: calc(var(--vk-spacing) * 0.5); --avatar-dot-inset: 0px; }
|
|
129
159
|
.o-avatar.o-avatar-2xs { --avatar-size: calc(var(--vk-spacing) * 4); }
|
|
130
160
|
:is(.o-avatar.o-avatar-xs, .o-avatar-badged[data-size="20"]) { --avatar-size: calc(var(--vk-spacing) * 5); --avatar-dot: var(--vk-dot-size); --avatar-cut: calc(var(--vk-spacing) * 0.375); }
|
|
131
161
|
:is(.o-avatar.o-avatar-sm, .o-avatar-badged[data-size="24"]) { --avatar-size: calc(var(--vk-spacing) * 6); --avatar-dot: calc(var(--vk-spacing) * 2); }
|
|
132
162
|
:is(.o-avatar.o-avatar-lg, .o-avatar-badged[data-size="40"]) { --avatar-size: calc(var(--vk-spacing) * 10); --avatar-dot: calc(var(--vk-spacing) * 3); }
|
|
163
|
+
:is(.o-avatar.o-avatar-56, .o-avatar-badged[data-size="56"]) { --avatar-size: calc(var(--vk-spacing) * 14); --avatar-dot: calc(var(--vk-spacing) * 3.5); --avatar-dot-inset: calc(var(--vk-spacing) * 0.5); }
|
|
133
164
|
:is(.o-avatar.o-avatar-xl, .o-avatar-badged[data-size="64"]) { --avatar-size: calc(var(--vk-spacing) * 16); --avatar-dot: calc(var(--vk-spacing) * 4); --avatar-dot-inset: calc(var(--vk-spacing) * 0.5); }
|
|
134
165
|
:is(.o-avatar.o-avatar-thing, .o-avatar-badged[data-thing]) { --avatar-dot-inset: calc(var(--vk-spacing) * -0.75); }
|
|
135
166
|
.o-avatar-badged { position: relative; display: inline-flex; flex: none; vertical-align: middle; isolation: isolate; }
|
|
@@ -141,7 +172,7 @@
|
|
|
141
172
|
background-color: var(--vk-brand); color: var(--vk-fg-on-brand);
|
|
142
173
|
}
|
|
143
174
|
.o-avatar-badge > svg { display: none; width: 70%; height: 70%; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
|
|
144
|
-
.o-avatar-badged:is([data-size="32"], [data-size="40"], [data-size="64"]) > .o-avatar-badge > svg { display: block; }
|
|
175
|
+
.o-avatar-badged:is([data-size="32"], [data-size="40"], [data-size="56"], [data-size="64"]) > .o-avatar-badge > svg { display: block; }
|
|
145
176
|
/* Here, a green dot; away, a hollow ring whose middle shows the ground. */
|
|
146
177
|
.o-avatar-badge[data-presence="here"] { background-color: var(--vk-success-bold); }
|
|
147
178
|
.o-avatar-badge[data-presence="away"] { background-color: transparent; box-shadow: inset 0 0 0 calc(var(--vk-border-width) * 2) var(--vk-fg-subtlest); }
|
|
@@ -30,10 +30,6 @@ export declare const CHOICE_TOKENS: readonly [{
|
|
|
30
30
|
readonly name: "--vk-hovered";
|
|
31
31
|
readonly kind: "colour";
|
|
32
32
|
readonly outright: "--surface-hovered";
|
|
33
|
-
}, {
|
|
34
|
-
readonly name: "--vk-selected";
|
|
35
|
-
readonly kind: "colour";
|
|
36
|
-
readonly outright: "--surface-selected";
|
|
37
33
|
}, {
|
|
38
34
|
readonly name: "--vk-border-width";
|
|
39
35
|
readonly kind: "size";
|
|
@@ -7,7 +7,6 @@ export const CHOICE_TOKENS = [
|
|
|
7
7
|
{ name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
|
|
8
8
|
{ name: "--vk-ground", kind: "colour", outright: "--surface" },
|
|
9
9
|
{ name: "--vk-hovered", kind: "colour", outright: "--surface-hovered" },
|
|
10
|
-
{ name: "--vk-selected", kind: "colour", outright: "--surface-selected" },
|
|
11
10
|
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
12
11
|
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
13
12
|
{ name: "--vk-font-size-xs", kind: "size", outright: "--text-xs" },
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
.o-choice-note { 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); }
|
|
11
11
|
|
|
12
12
|
/* ── A choice as a card: an edge round it, the whole card pressing it; under the pointer the hovered
|
|
13
|
-
ground; chosen, the selected edge and ground; off, the softer edge and no hover ─────────────────── */
|
|
13
|
+
ground; chosen, the selected edge and a hairline ring just outside it, on the card's own ground, as a marked card; off, the softer edge and no hover ─────────────────── */
|
|
14
14
|
.o-choice-card {
|
|
15
15
|
box-sizing: border-box; display: flex; width: 100%; padding: calc(var(--vk-spacing) * 3) calc(var(--vk-spacing) * 3.5);
|
|
16
16
|
border: var(--vk-border-width) solid var(--vk-border); border-radius: var(--vk-radius-lg); corner-shape: squircle;
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
}
|
|
19
19
|
/* A hover only on a screen with a pointer (iOS keeps :hover on what was last tapped); a press and the forced state stay out. */
|
|
20
20
|
@media (hover: hover) { .o-choice-card:hover { background-color: var(--vk-hovered); } }
|
|
21
|
-
.o-choice-card:has(> [data-checked]) { border-color: var(--vk-border-selected); background-color: var(--vk-
|
|
22
|
-
.o-choice-card:has(> [data-disabled]) { border-color: var(--vk-border-subtle); background-color: transparent; }
|
|
21
|
+
.o-choice-card:has(> [data-checked]) { border-color: var(--vk-border-selected); box-shadow: 0 0 0 var(--vk-border-width) var(--vk-border-selected); background-color: var(--vk-ground); }
|
|
22
|
+
.o-choice-card:has(> [data-disabled]) { border-color: var(--vk-border-subtle); box-shadow: none; background-color: transparent; }
|
|
23
23
|
.o-choice-card .o-choice-label { font-weight: var(--vk-font-weight-medium); }
|
|
24
24
|
/* In error, the card's edge is red too. */
|
|
25
25
|
.o-choice-card:is(:has(> :is([aria-invalid="true"], [data-invalid])), .o-fieldset[data-invalid] *):not(:has(> [data-disabled])) { border-color: var(--vk-border-danger); }
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { MapButton } from "./button/map-button.js";
|
|
2
|
+
import { MapAppIcon } from "./glyphs/glyphs.js";
|
|
3
|
+
import { MapMarkdown } from "./markdown/map-markdown.js";
|
|
2
4
|
import { MapTooltip } from "./tooltip/map-tooltip.js";
|
|
3
5
|
import { MapPopover } from "./popover/map-popover.js";
|
|
4
6
|
import { MapSheet } from "./sheet/map-sheet.js";
|
|
@@ -7,6 +9,7 @@ import { MapInput } from "./input/map-input.js";
|
|
|
7
9
|
import { MapMenu } from "./menu/map-menu.js";
|
|
8
10
|
import { MapSortBody } from "./sort-editor/map-sort-body.js";
|
|
9
11
|
import { MapViewsListBody } from "./views-list/map-views-list-body.js";
|
|
12
|
+
import { MapViewMenu } from "./views-list/map-view-menu.js";
|
|
10
13
|
import { MapFilterBody, MapFilterPartBody } from "./filter-editor/map-filter-body.js";
|
|
11
14
|
import { MapGroupBody } from "./group-editor/map-group-body.js";
|
|
12
15
|
import { MapCustomizeBody } from "./customize/map-customize-body.js";
|
|
@@ -25,6 +28,8 @@ import { MapValuesBody } from "./values-editor/map-values-body.js";
|
|
|
25
28
|
import { MapLinksBody } from "./links-editor/map-links-body.js";
|
|
26
29
|
export declare const CONTROLS: {
|
|
27
30
|
Button: typeof MapButton;
|
|
31
|
+
AppIcon: typeof MapAppIcon;
|
|
32
|
+
Markdown: typeof MapMarkdown;
|
|
28
33
|
Tooltip: typeof MapTooltip;
|
|
29
34
|
Popover: typeof MapPopover;
|
|
30
35
|
Sheet: typeof MapSheet;
|
|
@@ -33,6 +38,7 @@ export declare const CONTROLS: {
|
|
|
33
38
|
Menu: typeof MapMenu;
|
|
34
39
|
SortBody: typeof MapSortBody;
|
|
35
40
|
ViewsListBody: typeof MapViewsListBody;
|
|
41
|
+
ViewMenu: typeof MapViewMenu;
|
|
36
42
|
FilterBody: typeof MapFilterBody;
|
|
37
43
|
FilterPartBody: typeof MapFilterPartBody;
|
|
38
44
|
GroupBody: typeof MapGroupBody;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { carryAtoms } from "../atoms/carried.js";
|
|
2
|
+
import { CONTROL_ATOMS } from "./atoms.js";
|
|
1
3
|
import { MapButton } from "./button/map-button.js";
|
|
4
|
+
import { MapAppIcon } from "./glyphs/glyphs.js";
|
|
5
|
+
import { MapMarkdown } from "./markdown/map-markdown.js";
|
|
2
6
|
import { MapTooltip } from "./tooltip/map-tooltip.js";
|
|
3
7
|
import { MapPopover } from "./popover/map-popover.js";
|
|
4
8
|
import { MapSheet } from "./sheet/map-sheet.js";
|
|
@@ -7,6 +11,7 @@ import { MapInput } from "./input/map-input.js";
|
|
|
7
11
|
import { MapMenu } from "./menu/map-menu.js";
|
|
8
12
|
import { MapSortBody } from "./sort-editor/map-sort-body.js";
|
|
9
13
|
import { MapViewsListBody } from "./views-list/map-views-list-body.js";
|
|
14
|
+
import { MapViewMenu } from "./views-list/map-view-menu.js";
|
|
10
15
|
import { MapFilterBody, MapFilterPartBody } from "./filter-editor/map-filter-body.js";
|
|
11
16
|
import { MapGroupBody } from "./group-editor/map-group-body.js";
|
|
12
17
|
import { MapCustomizeBody } from "./customize/map-customize-body.js";
|
|
@@ -23,8 +28,10 @@ import { MapPartsBody } from "./compound-editor/map-parts-body.js";
|
|
|
23
28
|
import { MapNumberBody } from "./number-editor/map-number-body.js";
|
|
24
29
|
import { MapValuesBody } from "./values-editor/map-values-body.js";
|
|
25
30
|
import { MapLinksBody } from "./links-editor/map-links-body.js";
|
|
26
|
-
export const CONTROLS = {
|
|
31
|
+
export const CONTROLS = carryAtoms({
|
|
27
32
|
Button: MapButton,
|
|
33
|
+
AppIcon: MapAppIcon,
|
|
34
|
+
Markdown: MapMarkdown,
|
|
28
35
|
Tooltip: MapTooltip,
|
|
29
36
|
Popover: MapPopover,
|
|
30
37
|
Sheet: MapSheet,
|
|
@@ -33,6 +40,7 @@ export const CONTROLS = {
|
|
|
33
40
|
Menu: MapMenu,
|
|
34
41
|
SortBody: MapSortBody,
|
|
35
42
|
ViewsListBody: MapViewsListBody,
|
|
43
|
+
ViewMenu: MapViewMenu,
|
|
36
44
|
FilterBody: MapFilterBody,
|
|
37
45
|
FilterPartBody: MapFilterPartBody,
|
|
38
46
|
GroupBody: MapGroupBody,
|
|
@@ -50,4 +58,4 @@ export const CONTROLS = {
|
|
|
50
58
|
NumberBody: MapNumberBody,
|
|
51
59
|
ValuesBody: MapValuesBody,
|
|
52
60
|
LinksBody: MapLinksBody,
|
|
53
|
-
};
|
|
61
|
+
}, CONTROL_ATOMS);
|
|
@@ -142,7 +142,7 @@ export function MapCustomizeBody(props) {
|
|
|
142
142
|
const shared = p.view, kit = p.foot === "kit";
|
|
143
143
|
const foot = shared ? (shared.changes > 0 && p.foot !== "none" ? {
|
|
144
144
|
changed: true, onReset: shared.onReset, ...(shared.canPublish && { onSave: shared.onPublish }), pending: shared.pending, stale: shared.stale,
|
|
145
|
-
words: { reset: say({ key: kit ? "views.panels.view-clear" : "views.panels.view-reset" }), save: say({ key: kit ? "views.panels.view-save" : "views.panels.view-publish" }) },
|
|
145
|
+
words: { reset: say({ key: kit ? "views.panels.view-clear" : "views.panels.view-reset" }), save: say({ key: kit ? "views.panels.view-save" : shared.own ? "views.panels.view-save-own" : "views.panels.view-publish" }) },
|
|
146
146
|
} : {}) : p.onClear && p.foot !== "none" ? { changed: true, onReset: p.onClear, words: { reset: say({ key: "views.panels.view-clear" }) } } : {};
|
|
147
147
|
const { words: footWords, ...footProps } = foot;
|
|
148
148
|
const timeField = p.fields?.items.find((f) => f.time);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { type FieldRowsCard } from "../../internal/field-rows.js";
|
|
2
3
|
import { type FieldRowsLook } from "./looks.js";
|
|
3
4
|
/** A field's error, or several: none, one (written as it is), or a list (each once). */
|
|
4
5
|
export type FieldError = React.ReactNode | React.ReactNode[];
|
|
@@ -37,8 +38,12 @@ export interface FieldProps {
|
|
|
37
38
|
className?: string;
|
|
38
39
|
children: React.ReactNode;
|
|
39
40
|
}
|
|
40
|
-
/** A field: its label, its control (an Input or InputGroup, a select, a tag field), and under it its note or its error.
|
|
41
|
-
|
|
41
|
+
/** A field: its label, its control (an Input or InputGroup, a select, a tag field), and under it its note or its error. Placed in
|
|
42
|
+
* Field rows (VK-960), it is the card's row instead: its label in the row's column, its control beside it (an Input or InputGroup
|
|
43
|
+
* typed in place, their save mark at the row's end), and its note and error under the card. Placed in a computer's SettingRows
|
|
44
|
+
* under its Fields option's At the end (VK-985), it is one of its setting rows: its label and note on the left, its control at the
|
|
45
|
+
* row's end. */
|
|
46
|
+
export declare function Field(props: FieldProps): import("react/jsx-runtime").JSX.Element;
|
|
42
47
|
export interface FieldSetProps {
|
|
43
48
|
/** What the group asks or holds, above it ("Who can see this deal", "Billing address"). */
|
|
44
49
|
legend: React.ReactNode;
|
|
@@ -72,9 +77,19 @@ export interface FieldRowsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
72
77
|
/** The look its place hands it, whole (an editor's look), winning over the frame's pick; left out, the frame's. */
|
|
73
78
|
look?: FieldRowsLook;
|
|
74
79
|
}
|
|
75
|
-
/** Field rows' card: fields that belong together, as rows of one card on a phone, or each its own card. Its rows are FieldRowsRows
|
|
76
|
-
* anything else stands in it as its place
|
|
80
|
+
/** Field rows' card: fields that belong together, as rows of one card on a phone, or each its own card. Its rows are FieldRowsRows,
|
|
81
|
+
* or Fields, each then the card's row (VK-960), their notes and errors under the card; anything else stands in it as its place
|
|
82
|
+
* puts it. */
|
|
77
83
|
export declare function FieldRows({ look, className, children, ...props }: FieldRowsProps): import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
/** Field rows' card as its Fields see it, and the foot to draw after it: FieldRows', and a setting rows' card on a phone (VK-979).
|
|
85
|
+
* Its Fields in the order they came (VK-960), and those with a note or an error to show; while any has one, its foot stands
|
|
86
|
+
* after the card, the card first, so a foot coming or going never redraws the card or moves the focus in it. In the foot each
|
|
87
|
+
* such Field has its own place, in the order the Fields came (the rows' order, unless a row came later), whatever order their
|
|
88
|
+
* notes came in. The card is handed to its Fields through FieldRowsCardContext by the one that draws it. */
|
|
89
|
+
export declare function useFieldRowsCard(): {
|
|
90
|
+
card: FieldRowsCard;
|
|
91
|
+
foot: React.ReactNode;
|
|
92
|
+
};
|
|
78
93
|
export type FieldRowsRowProps = {
|
|
79
94
|
label?: React.ReactNode;
|
|
80
95
|
labelClassName?: string;
|