@cloudgrid-io/ui 0.54.1 → 0.56.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/dist/blocks/chip-list.d.ts +35 -0
- package/dist/blocks/chip-list.d.ts.map +1 -0
- package/dist/blocks/chip-list.js +37 -0
- package/dist/blocks/chip-list.js.map +1 -0
- package/dist/blocks/confirm-delete-dialog.d.ts +6 -1
- package/dist/blocks/confirm-delete-dialog.d.ts.map +1 -1
- package/dist/blocks/confirm-delete-dialog.js +2 -2
- package/dist/blocks/confirm-delete-dialog.js.map +1 -1
- package/dist/blocks/danger-zone.d.ts.map +1 -1
- package/dist/blocks/danger-zone.js +5 -1
- package/dist/blocks/danger-zone.js.map +1 -1
- package/dist/blocks/grid-profile.d.ts +15 -1
- package/dist/blocks/grid-profile.d.ts.map +1 -1
- package/dist/blocks/grid-profile.js +14 -2
- package/dist/blocks/grid-profile.js.map +1 -1
- package/dist/blocks/settings-frame.d.ts +48 -1
- package/dist/blocks/settings-frame.d.ts.map +1 -1
- package/dist/blocks/settings-frame.js +37 -1
- package/dist/blocks/settings-frame.js.map +1 -1
- package/dist/blocks/settings-row.d.ts +20 -4
- package/dist/blocks/settings-row.d.ts.map +1 -1
- package/dist/blocks/settings-row.js +30 -10
- package/dist/blocks/settings-row.js.map +1 -1
- package/dist/blocks/side-nav.d.ts.map +1 -1
- package/dist/blocks/side-nav.js +20 -4
- package/dist/blocks/side-nav.js.map +1 -1
- package/dist/blocks/usage-meter.d.ts +2 -2
- package/dist/blocks/usage-meter.js +3 -3
- package/dist/blocks/usage-meter.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +8 -0
- package/dist/ui/badge.js.map +1 -1
- package/dist/ui/combobox.d.ts +10 -1
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +10 -2
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/dialog.d.ts +13 -2
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +13 -3
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/input.d.ts +3 -1
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +14 -3
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/select.d.ts +1 -1
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +12 -1
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/table.d.ts +6 -1
- package/dist/ui/table.d.ts.map +1 -1
- package/dist/ui/table.js +6 -3
- package/dist/ui/table.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* THE CHOSEN ITEMS UNDER A FIELD (ui#500): New Space's "Add members", where
|
|
4
|
+
* the design draws the people already picked as chips under the search field,
|
|
5
|
+
* not inside it (`ComboboxChips` is the in-field kind).
|
|
6
|
+
*
|
|
7
|
+
* ```
|
|
8
|
+
* [ Search Grid members v ]
|
|
9
|
+
* 24, the caller's
|
|
10
|
+
* ( Asaf Cohen x ) ( Nataly Cohen x )
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* - `ChipList` is a `<ul>`; name it (`aria-label="Members to add"`) so a
|
|
14
|
+
* screen reader hears what the list is. The chips wrap, 8 apart.
|
|
15
|
+
* - `Chip` is one item, as the design measures it: 36 tall, radius 8, the page
|
|
16
|
+
* grey (N1), the name 16 in steel-strong, 14 in from the left. With
|
|
17
|
+
* `onRemove` it ends with a 24px button holding a 16px x in steel, 12 from
|
|
18
|
+
* the right edge, named "Remove <name>" (or `removeLabel`). Without it the
|
|
19
|
+
* chip is a plain item, 14 each side.
|
|
20
|
+
* - On the panel and on ink the ground and the words fall back to the scope's
|
|
21
|
+
* wash and its strong muted text.
|
|
22
|
+
*
|
|
23
|
+
* The space between the field and the list (24 in the pop-up) is the caller's.
|
|
24
|
+
*/
|
|
25
|
+
declare function ChipList({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
|
|
26
|
+
declare function Chip({ children, onRemove, removeLabel, className, ...props }: Omit<React.ComponentProps<"li">, "children"> & {
|
|
27
|
+
/** What was chosen: a person's name. */
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
/** The x was pressed. No handler, no x. */
|
|
30
|
+
onRemove?: () => void;
|
|
31
|
+
/** The x's name, when the chip's words are not plain text. Default "Remove <name>". */
|
|
32
|
+
removeLabel?: string;
|
|
33
|
+
}): React.JSX.Element;
|
|
34
|
+
export { Chip, ChipList };
|
|
35
|
+
//# sourceMappingURL=chip-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip-list.d.ts","sourceRoot":"","sources":["../../src/blocks/chip-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,qBAQpE;AAED,iBAAS,IAAI,CAAC,EACZ,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,GAAG;IAChD,wCAAwC;IACxC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,uFAAuF;IACvF,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,qBA6BA;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../lib/cloudgrid-cn.js";
|
|
5
|
+
import { CloseIcon } from "./icons.js";
|
|
6
|
+
/**
|
|
7
|
+
* THE CHOSEN ITEMS UNDER A FIELD (ui#500): New Space's "Add members", where
|
|
8
|
+
* the design draws the people already picked as chips under the search field,
|
|
9
|
+
* not inside it (`ComboboxChips` is the in-field kind).
|
|
10
|
+
*
|
|
11
|
+
* ```
|
|
12
|
+
* [ Search Grid members v ]
|
|
13
|
+
* 24, the caller's
|
|
14
|
+
* ( Asaf Cohen x ) ( Nataly Cohen x )
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* - `ChipList` is a `<ul>`; name it (`aria-label="Members to add"`) so a
|
|
18
|
+
* screen reader hears what the list is. The chips wrap, 8 apart.
|
|
19
|
+
* - `Chip` is one item, as the design measures it: 36 tall, radius 8, the page
|
|
20
|
+
* grey (N1), the name 16 in steel-strong, 14 in from the left. With
|
|
21
|
+
* `onRemove` it ends with a 24px button holding a 16px x in steel, 12 from
|
|
22
|
+
* the right edge, named "Remove <name>" (or `removeLabel`). Without it the
|
|
23
|
+
* chip is a plain item, 14 each side.
|
|
24
|
+
* - On the panel and on ink the ground and the words fall back to the scope's
|
|
25
|
+
* wash and its strong muted text.
|
|
26
|
+
*
|
|
27
|
+
* The space between the field and the list (24 in the pop-up) is the caller's.
|
|
28
|
+
*/
|
|
29
|
+
function ChipList({ className, ...props }) {
|
|
30
|
+
return (_jsx("ul", { "data-slot": "chip-list", className: cn("m-0 flex min-w-0 list-none flex-wrap gap-2 p-0", className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
function Chip({ children, onRemove, removeLabel, className, ...props }) {
|
|
33
|
+
const name = removeLabel ?? (typeof children === "string" || typeof children === "number" ? `Remove ${children}` : "Remove");
|
|
34
|
+
return (_jsxs("li", { "data-slot": "chip", className: cn("inline-flex h-9 max-w-full min-w-0 items-center gap-1 rounded-xs bg-page ps-3.5 text-body-md text-steel-strong", "in-data-[cg-surface=panel]:bg-(--cg-hover) in-data-[cg-surface=panel]:text-faint-strong in-data-[cg-surface=ink]:bg-(--cg-hover) in-data-[cg-surface=ink]:text-faint-strong", onRemove ? "pe-2" : "pe-3.5", className), ...props, children: [_jsx("span", { "data-slot": "chip-label", className: "min-w-0 truncate", children: children }), onRemove ? (_jsx("button", { type: "button", "aria-label": name, "data-slot": "chip-remove", onClick: onRemove, className: "inline-flex size-6 shrink-0 items-center justify-center rounded-xs text-steel transition-colors hover:text-ink focus-line in-data-[cg-surface=panel]:text-faint in-data-[cg-surface=ink]:text-faint", children: _jsx(CloseIcon, { className: "size-4" }) })) : null] }));
|
|
35
|
+
}
|
|
36
|
+
export { Chip, ChipList };
|
|
37
|
+
//# sourceMappingURL=chip-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip-list.js","sourceRoot":"","sources":["../../src/blocks/chip-list.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA8B;IACnE,OAAO,CACL,0BACY,WAAW,EACrB,SAAS,EAAE,EAAE,CAAC,gDAAgD,EAAE,SAAS,CAAC,KACtE,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,IAAI,CAAC,EACZ,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,SAAS,EACT,GAAG,KAAK,EAQT;IACC,MAAM,IAAI,GAAG,WAAW,IAAI,CAAC,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IAC5H,OAAO,CACL,2BACY,MAAM,EAChB,SAAS,EAAE,EAAE,CACX,gHAAgH,EAChH,6KAA6K,EAC7K,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAC5B,SAAS,CACV,KACG,KAAK,aAET,4BAAgB,YAAY,EAAC,SAAS,EAAC,kBAAkB,YACtD,QAAQ,GACJ,EACN,QAAQ,CAAC,CAAC,CAAC,CACV,iBACE,IAAI,EAAC,QAAQ,gBACD,IAAI,eACN,aAAa,EACvB,OAAO,EAAE,QAAQ,EACjB,SAAS,EAAC,qMAAqM,YAE/M,KAAC,SAAS,IAAC,SAAS,EAAC,QAAQ,GAAG,GACzB,CACV,CAAC,CAAC,CAAC,IAAI,IACL,CACN,CAAA;AACH,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -90,6 +90,11 @@ export type ConfirmDeleteDialogProps = {
|
|
|
90
90
|
error?: React.ReactNode;
|
|
91
91
|
/** Overrides the title. */
|
|
92
92
|
title?: React.ReactNode;
|
|
93
|
+
/**
|
|
94
|
+
* The title's size (ui#500). `default` keeps this dialog's own 17; `lg` is
|
|
95
|
+
* `DialogTitle size="lg"`, the 26 of the Grid settings pop-ups (Delete Grid).
|
|
96
|
+
*/
|
|
97
|
+
titleSize?: "default" | "lg";
|
|
93
98
|
/** Overrides the consequence line. */
|
|
94
99
|
description?: React.ReactNode;
|
|
95
100
|
/** The armed button's word. */
|
|
@@ -111,6 +116,6 @@ export type ConfirmDeleteDialogProps = {
|
|
|
111
116
|
/** Why it cannot be deleted now: no field, no Delete, only this reason (ui#494). */
|
|
112
117
|
blocked?: React.ReactNode;
|
|
113
118
|
};
|
|
114
|
-
declare function ConfirmDeleteDialog({ open, onOpenChange, name, confirmText, onConfirm, pending, error, title, description, confirmLabel, pendingLabel, cancelLabel, className, subject, children, placeholder, hint, blocked, confirmTextStyle, }: ConfirmDeleteDialogProps): React.JSX.Element;
|
|
119
|
+
declare function ConfirmDeleteDialog({ open, onOpenChange, name, confirmText, onConfirm, pending, error, title, titleSize, description, confirmLabel, pendingLabel, cancelLabel, className, subject, children, placeholder, hint, blocked, confirmTextStyle, }: ConfirmDeleteDialogProps): React.JSX.Element;
|
|
115
120
|
export { ConfirmDeleteDialog };
|
|
116
121
|
//# sourceMappingURL=confirm-delete-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-delete-dialog.d.ts","sourceRoot":"","sources":["../../src/blocks/confirm-delete-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAa9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH;;;;;;;;;;;;;;;;;;;;;;;8EAuB8E;AAC9E,eAAO,MAAM,0BAA0B,kGAC0D,CAAA;AAEjG,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAA;IACZ,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,sFAAsF;IACtF,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,oDAAoD;IACpD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,sCAAsC;IACtC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,+BAA+B;IAC/B,YAAY,CAAC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,EACvB,YAAyB,EACzB,WAAsB,EACtB,SAAS,EACT,OAAO,EACP,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,OAAO,EACP,gBAAyB,GAC1B,EAAE,wBAAwB,qBA4H1B;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -81,7 +81,7 @@ import { Input } from "../ui/input.js";
|
|
|
81
81
|
*
|
|
82
82
|
* The consequence line under the title, when the caller does not pass one. */
|
|
83
83
|
export const CONFIRM_DELETE_DESCRIPTION = "This removes it from CloudGrid for good. Its link stops working and it can't be brought back.";
|
|
84
|
-
function ConfirmDeleteDialog({ open, onOpenChange, name, confirmText, onConfirm, pending = false, error, title, description = CONFIRM_DELETE_DESCRIPTION, confirmLabel = "Delete", pendingLabel = "Deleting", cancelLabel = "Cancel", className, subject, children, placeholder, hint, blocked, confirmTextStyle = "code", }) {
|
|
84
|
+
function ConfirmDeleteDialog({ open, onOpenChange, name, confirmText, onConfirm, pending = false, error, title, titleSize = "default", description = CONFIRM_DELETE_DESCRIPTION, confirmLabel = "Delete", pendingLabel = "Deleting", cancelLabel = "Cancel", className, subject, children, placeholder, hint, blocked, confirmTextStyle = "code", }) {
|
|
85
85
|
const target = confirmText ?? name;
|
|
86
86
|
const [typed, setTyped] = React.useState("");
|
|
87
87
|
const fieldId = React.useId();
|
|
@@ -108,7 +108,7 @@ function ConfirmDeleteDialog({ open, onOpenChange, name, confirmText, onConfirm,
|
|
|
108
108
|
return;
|
|
109
109
|
void onConfirm();
|
|
110
110
|
}
|
|
111
|
-
return (_jsx(Dialog, { open: open, onOpenChange: changeOpen, children: _jsxs(DialogContent, { "data-slot": "confirm-delete-dialog", initialFocus: field, className: cn("gap-5 p-6 sm:max-w-md", className), children: [_jsxs(DialogHeader, { className: "gap-3 pr-8", children: [_jsx(DialogTitle, { className: "text-heading-sm leading-tight", children: title ?? `Delete ${name}?` }), subject ? _jsx("div", { "data-slot": "confirm-delete-subject", children: subject }) : null, _jsx(DialogDescription, { className: "text-body-sm text-body", children: description })] }), children ? (_jsx("div", { "data-slot": "confirm-delete-details", className: "grid gap-4", children: children })) : null, blocked ? (_jsxs("div", { className: "grid gap-5", children: [_jsx("p", { "data-slot": "confirm-delete-blocked", className: "m-0 text-body-sm text-danger-strong", children: blocked }), _jsx("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: _jsx(Button, { type: "button", variant: "quiet", onClick: () => changeOpen(false), children: cancelLabel }) })] })) : (_jsxs("form", { className: "grid gap-5", onSubmit: submit, noValidate: true, children: [_jsxs("div", { className: "grid gap-2", children: [_jsxs("label", { htmlFor: fieldId, className: "text-body-sm font-medium text-ink", children: ["Type", " ", _jsx("span", { "data-slot": "confirm-delete-target", className: confirmTextStyle === "text" ? undefined : "font-mono text-mono", children: target }), " ", "to confirm"] }), _jsx(Input, { ref: field, id: fieldId, value: typed, onChange: (event) => setTyped(event.target.value), disabled: pending, autoComplete: "off", autoCapitalize: "off", spellCheck: false, "aria-describedby": describedBy, placeholder: placeholder, "data-slot": "confirm-delete-field" }), hint ? (_jsx("p", { id: hintId, "data-slot": "confirm-delete-hint", className: "m-0 text-caption text-faint-strong", children: hint })) : null, error ? (_jsx("p", { id: errorId, role: "alert", className: "m-0 text-caption text-danger-strong", children: error })) : null] }), _jsxs("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [_jsx(Button, { type: "button", variant: "quiet", disabled: pending, onClick: () => changeOpen(false), children: cancelLabel }), _jsx(Button, { type: "submit",
|
|
111
|
+
return (_jsx(Dialog, { open: open, onOpenChange: changeOpen, children: _jsxs(DialogContent, { "data-slot": "confirm-delete-dialog", initialFocus: field, className: cn("gap-5 p-6 sm:max-w-md", className), children: [_jsxs(DialogHeader, { className: "gap-3 pr-8", children: [_jsx(DialogTitle, { size: titleSize === "lg" ? "lg" : "default", className: titleSize === "lg" ? undefined : "text-heading-sm leading-tight", children: title ?? `Delete ${name}?` }), subject ? _jsx("div", { "data-slot": "confirm-delete-subject", children: subject }) : null, _jsx(DialogDescription, { className: "text-body-sm text-body", children: description })] }), children ? (_jsx("div", { "data-slot": "confirm-delete-details", className: "grid gap-4", children: children })) : null, blocked ? (_jsxs("div", { className: "grid gap-5", children: [_jsx("p", { "data-slot": "confirm-delete-blocked", className: "m-0 text-body-sm text-danger-strong", children: blocked }), _jsx("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: _jsx(Button, { type: "button", variant: "quiet", onClick: () => changeOpen(false), children: cancelLabel }) })] })) : (_jsxs("form", { className: "grid gap-5", onSubmit: submit, noValidate: true, children: [_jsxs("div", { className: "grid gap-2", children: [_jsxs("label", { htmlFor: fieldId, className: "text-body-sm font-medium text-ink", children: ["Type", " ", _jsx("span", { "data-slot": "confirm-delete-target", className: confirmTextStyle === "text" ? undefined : "font-mono text-mono", children: target }), " ", "to confirm"] }), _jsx(Input, { ref: field, id: fieldId, value: typed, onChange: (event) => setTyped(event.target.value), disabled: pending, autoComplete: "off", autoCapitalize: "off", spellCheck: false, "aria-describedby": describedBy, placeholder: placeholder, "data-slot": "confirm-delete-field" }), hint ? (_jsx("p", { id: hintId, "data-slot": "confirm-delete-hint", className: "m-0 text-caption text-faint-strong", children: hint })) : null, error ? (_jsx("p", { id: errorId, role: "alert", className: "m-0 text-caption text-danger-strong", children: error })) : null] }), _jsxs("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [_jsx(Button, { type: "button", variant: "quiet", disabled: pending, onClick: () => changeOpen(false), children: cancelLabel }), _jsx(Button, { type: "submit",
|
|
112
112
|
// ui#494 (Asaf): 40 tall as designed, beside a quiet Cancel at the
|
|
113
113
|
// same 40, both on the one button radius. `danger` is the danger
|
|
114
114
|
// pair this button used to paint by hand over `primary`'s 32px.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-delete-dialog.js","sourceRoot":"","sources":["../../src/blocks/confirm-delete-dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ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C,OAAO,IAAI,OAAO,eACnB,uBAAuB,YAEhC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,GAC/B,IACL,IACD,CACR,IACa,GACT,CACV,CAAA;AACH,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"danger-zone.d.ts","sourceRoot":"","sources":["../../src/blocks/danger-zone.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"danger-zone.d.ts","sourceRoot":"","sources":["../../src/blocks/danger-zone.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA8B9B,iBAAS,UAAU,CAAC,EAClB,KAAqB,EACrB,WAAW,EACX,IAAI,EACJ,WAAmB,EACnB,YAAY,EACZ,SAAS,EACT,QAAQ,GACT,EAAE;IACD,uBAAuB;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,8BAA8B;IAC9B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,+CAA+C;IAC/C,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,qBA0BA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -20,11 +20,15 @@ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "..
|
|
|
20
20
|
* accordion's hover underline, which belongs to a text link. The rows inside
|
|
21
21
|
* are the caller's `SettingsRow`s, under a hairline.
|
|
22
22
|
*
|
|
23
|
+
* It also drops the accordion's 1px transparent border (ui#500): the border
|
|
24
|
+
* pushed the label 1px right of the rows' and the headings' left edge, where
|
|
25
|
+
* the design puts it. The focus line is an outline, so it does not need it.
|
|
26
|
+
*
|
|
23
27
|
* `open` / `onOpenChange` control it; `defaultOpen` starts it open.
|
|
24
28
|
*/
|
|
25
29
|
const ITEM = "danger-zone";
|
|
26
30
|
function DangerZone({ title = "Danger zone", description, open, defaultOpen = false, onOpenChange, className, children, }) {
|
|
27
|
-
return (_jsx(Accordion, { "data-slot": "danger-zone", className: cn("text-ink", className), ...(open !== undefined ? { value: open ? [ITEM] : [] } : {}), defaultValue: defaultOpen ? [ITEM] : [], onValueChange: (value) => onOpenChange?.(value.includes(ITEM)), children: _jsxs(AccordionItem, { value: ITEM, children: [_jsx(AccordionTrigger, { indicator: "right", className: "items-center gap-8 rounded-md py-4 hover:no-underline", children: _jsxs("span", { className: "grid min-w-0 gap-1", children: [_jsx("span", { className: "text-body-sm font-medium text-ink", children: title }), description ? (_jsx("span", { className: "text-caption font-normal text-faint-strong", children: description })) : null] }) }), _jsx(AccordionContent, { children: _jsx("div", { "data-slot": "danger-zone-rows", className: "flex flex-col border-t border-hairline", children: children }) })] }) }));
|
|
31
|
+
return (_jsx(Accordion, { "data-slot": "danger-zone", className: cn("text-ink", className), ...(open !== undefined ? { value: open ? [ITEM] : [] } : {}), defaultValue: defaultOpen ? [ITEM] : [], onValueChange: (value) => onOpenChange?.(value.includes(ITEM)), children: _jsxs(AccordionItem, { value: ITEM, children: [_jsx(AccordionTrigger, { indicator: "right", className: "items-center gap-8 rounded-md border-0 py-4 hover:no-underline", children: _jsxs("span", { className: "grid min-w-0 gap-1", children: [_jsx("span", { className: "text-body-sm font-medium text-ink", children: title }), description ? (_jsx("span", { className: "text-caption font-normal text-faint-strong", children: description })) : null] }) }), _jsx(AccordionContent, { children: _jsx("div", { "data-slot": "danger-zone-rows", className: "flex flex-col border-t border-hairline", children: children }) })] }) }));
|
|
28
32
|
}
|
|
29
33
|
export { DangerZone };
|
|
30
34
|
//# sourceMappingURL=danger-zone.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"danger-zone.js","sourceRoot":"","sources":["../../src/blocks/danger-zone.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAEtG
|
|
1
|
+
{"version":3,"file":"danger-zone.js","sourceRoot":"","sources":["../../src/blocks/danger-zone.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAEtG;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,IAAI,GAAG,aAAa,CAAA;AAE1B,SAAS,UAAU,CAAC,EAClB,KAAK,GAAG,aAAa,EACrB,WAAW,EACX,IAAI,EACJ,WAAW,GAAG,KAAK,EACnB,YAAY,EACZ,SAAS,EACT,QAAQ,GAaT;IACC,OAAO,CACL,KAAC,SAAS,iBACE,aAAa,EACvB,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,KAChC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC7D,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EACvC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,YAE9D,MAAC,aAAa,IAAC,KAAK,EAAE,IAAI,aACxB,KAAC,gBAAgB,IAAC,SAAS,EAAC,OAAO,EAAC,SAAS,EAAC,gEAAgE,YAC5G,gBAAM,SAAS,EAAC,oBAAoB,aAClC,eAAM,SAAS,EAAC,mCAAmC,YAAE,KAAK,GAAQ,EACjE,WAAW,CAAC,CAAC,CAAC,CACb,eAAM,SAAS,EAAC,4CAA4C,YAAE,WAAW,GAAQ,CAClF,CAAC,CAAC,CAAC,IAAI,IACH,GACU,EACnB,KAAC,gBAAgB,cACf,2BAAe,kBAAkB,EAAC,SAAS,EAAC,wCAAwC,YACjF,QAAQ,GACL,GACW,IACL,GACN,CACb,CAAA;AACH,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -27,8 +27,20 @@ import * as React from "react";
|
|
|
27
27
|
* With no handler a pencil is not drawn at all: a pencil that does nothing
|
|
28
28
|
* would say the value can be changed when it cannot. The tile and the text are
|
|
29
29
|
* centred on one line, 24 apart.
|
|
30
|
+
*
|
|
31
|
+
* ui#500:
|
|
32
|
+
*
|
|
33
|
+
* - `logoComingSoon`: the logo upload is designed and not built. The pencil
|
|
34
|
+
* badge is drawn, as the design draws it, greyed to 50% and `inert`, with
|
|
35
|
+
* `aria-disabled`, the way a Coming soon row's control is; a handler does not
|
|
36
|
+
* make it live. The section's heading carries the tag
|
|
37
|
+
* (`SettingsSection comingSoon="partial"`).
|
|
38
|
+
* - No description, and `onEditDescription`: the line reads "Add description"
|
|
39
|
+
* in the faint tone, with its pencil, so one can be added. No handler, no line.
|
|
40
|
+
* - The description wraps onto more lines rather than being cut with an
|
|
41
|
+
* ellipsis (it was cut on one line at phone width). The name stays one line.
|
|
30
42
|
*/
|
|
31
|
-
declare function GridProfile({ name, description, logoSrc, seed, onEditLogo, onEditName, onEditDescription, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
43
|
+
declare function GridProfile({ name, description, logoSrc, seed, onEditLogo, onEditName, onEditDescription, logoComingSoon, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
32
44
|
/** The grid's name: the tile's letter, and the large line. */
|
|
33
45
|
name: string;
|
|
34
46
|
/** The line under the name. */
|
|
@@ -39,6 +51,8 @@ declare function GridProfile({ name, description, logoSrc, seed, onEditLogo, onE
|
|
|
39
51
|
seed?: string;
|
|
40
52
|
/** The badge on the tile was pressed. No handler, no badge. */
|
|
41
53
|
onEditLogo?: () => void;
|
|
54
|
+
/** The upload is not built yet: the badge is drawn, greyed and inert. */
|
|
55
|
+
logoComingSoon?: boolean;
|
|
42
56
|
onEditName?: () => void;
|
|
43
57
|
onEditDescription?: () => void;
|
|
44
58
|
}): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-profile.d.ts","sourceRoot":"","sources":["../../src/blocks/grid-profile.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B
|
|
1
|
+
{"version":3,"file":"grid-profile.d.ts","sourceRoot":"","sources":["../../src/blocks/grid-profile.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,iBAAS,WAAW,CAAC,EACnB,IAAI,EACJ,WAAW,EACX,OAAO,EACP,IAAI,EACJ,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,cAAsB,EACtB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACjD,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAA;IACZ,+BAA+B;IAC/B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,yEAAyE;IACzE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAA;CAC/B,qBA8CA;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -33,9 +33,21 @@ import { EditableValue } from "./settings-row.js";
|
|
|
33
33
|
* With no handler a pencil is not drawn at all: a pencil that does nothing
|
|
34
34
|
* would say the value can be changed when it cannot. The tile and the text are
|
|
35
35
|
* centred on one line, 24 apart.
|
|
36
|
+
*
|
|
37
|
+
* ui#500:
|
|
38
|
+
*
|
|
39
|
+
* - `logoComingSoon`: the logo upload is designed and not built. The pencil
|
|
40
|
+
* badge is drawn, as the design draws it, greyed to 50% and `inert`, with
|
|
41
|
+
* `aria-disabled`, the way a Coming soon row's control is; a handler does not
|
|
42
|
+
* make it live. The section's heading carries the tag
|
|
43
|
+
* (`SettingsSection comingSoon="partial"`).
|
|
44
|
+
* - No description, and `onEditDescription`: the line reads "Add description"
|
|
45
|
+
* in the faint tone, with its pencil, so one can be added. No handler, no line.
|
|
46
|
+
* - The description wraps onto more lines rather than being cut with an
|
|
47
|
+
* ellipsis (it was cut on one line at phone width). The name stays one line.
|
|
36
48
|
*/
|
|
37
|
-
function GridProfile({ name, description, logoSrc, seed, onEditLogo, onEditName, onEditDescription, className, ...props }) {
|
|
38
|
-
return (_jsxs("div", { "data-slot": "grid-profile", className: cn("flex min-w-0 flex-wrap items-center gap-6 text-ink", className), ...props, children: [_jsxs("span", { "data-slot": "grid-profile-logo", className: "relative inline-flex shrink-0", children: [_jsx(Avatar, { name: name, seed: seed, src: logoSrc, size: 80, shape: "square", look: "pastel" }), onEditLogo ? (_jsx("button", { type: "button", "aria-label": "Change the Grid logo", onClick: onEditLogo, className: "absolute -right-1.5 -bottom-1.5 inline-flex size-7 items-center justify-center rounded-pill border border-hairline bg-card text-body shadow-sm transition-colors hover:text-ink focus-line", children: _jsx(EditIcon, { className: "size-3.5" }) })) : null] }), _jsxs("div", { className: "grid min-w-0 flex-1 gap-2", children: [_jsx(EditableValue, { "data-slot": "grid-profile-name", value: name, label: "Grid name", onEdit: onEditName, valueClassName: "text-heading-lg font-normal leading-tight" }), description ? (_jsx(EditableValue, { "data-slot": "grid-profile-description", value: description, label: "Grid description", onEdit: onEditDescription, valueClassName: "text-body" })) : null] })] }));
|
|
49
|
+
function GridProfile({ name, description, logoSrc, seed, onEditLogo, onEditName, onEditDescription, logoComingSoon = false, className, ...props }) {
|
|
50
|
+
return (_jsxs("div", { "data-slot": "grid-profile", className: cn("flex min-w-0 flex-wrap items-center gap-6 text-ink", className), ...props, children: [_jsxs("span", { "data-slot": "grid-profile-logo", className: "relative inline-flex shrink-0", children: [_jsx(Avatar, { name: name, seed: seed, src: logoSrc, size: 80, shape: "square", look: "pastel" }), onEditLogo || logoComingSoon ? (_jsx("button", { type: "button", "aria-label": "Change the Grid logo", onClick: logoComingSoon ? undefined : onEditLogo, inert: logoComingSoon, "aria-disabled": logoComingSoon ? "true" : undefined, className: cn("absolute -right-1.5 -bottom-1.5 inline-flex size-7 items-center justify-center rounded-pill border border-hairline bg-card text-body shadow-sm transition-colors hover:text-ink focus-line", logoComingSoon && "opacity-50 select-none"), children: _jsx(EditIcon, { className: "size-3.5" }) })) : null] }), _jsxs("div", { className: "grid min-w-0 flex-1 gap-2", children: [_jsx(EditableValue, { "data-slot": "grid-profile-name", value: name, label: "Grid name", onEdit: onEditName, valueClassName: "text-heading-lg font-normal leading-tight" }), description || onEditDescription ? (_jsx(EditableValue, { "data-slot": "grid-profile-description", value: description || _jsx("span", { className: "text-faint-strong", children: "Add description" }), label: "Grid description", onEdit: onEditDescription, valueClassName: "text-body", wrap: true })) : null] })] }));
|
|
39
51
|
}
|
|
40
52
|
export { GridProfile };
|
|
41
53
|
//# sourceMappingURL=grid-profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-profile.js","sourceRoot":"","sources":["../../src/blocks/grid-profile.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D
|
|
1
|
+
{"version":3,"file":"grid-profile.js","sourceRoot":"","sources":["../../src/blocks/grid-profile.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,SAAS,WAAW,CAAC,EACnB,IAAI,EACJ,WAAW,EACX,OAAO,EACP,IAAI,EACJ,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,cAAc,GAAG,KAAK,EACtB,SAAS,EACT,GAAG,KAAK,EAgBT;IACC,OAAO,CACL,4BACY,cAAc,EACxB,SAAS,EAAE,EAAE,CAAC,oDAAoD,EAAE,SAAS,CAAC,KAC1E,KAAK,aAET,6BAAgB,mBAAmB,EAAC,SAAS,EAAC,+BAA+B,aAC3E,KAAC,MAAM,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,GAAG,EACtF,UAAU,IAAI,cAAc,CAAC,CAAC,CAAC,CAC9B,iBACE,IAAI,EAAC,QAAQ,gBACF,sBAAsB,EACjC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,EAChD,KAAK,EAAE,cAAc,mBACN,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAClD,SAAS,EAAE,EAAE,CACX,4LAA4L,EAC5L,cAAc,IAAI,wBAAwB,CAC3C,YAED,KAAC,QAAQ,IAAC,SAAS,EAAC,UAAU,GAAG,GAC1B,CACV,CAAC,CAAC,CAAC,IAAI,IACH,EACP,eAAK,SAAS,EAAC,2BAA2B,aACxC,KAAC,aAAa,iBACF,mBAAmB,EAC7B,KAAK,EAAE,IAAI,EACX,KAAK,EAAC,WAAW,EACjB,MAAM,EAAE,UAAU,EAClB,cAAc,EAAC,2CAA2C,GAC1D,EACD,WAAW,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAClC,KAAC,aAAa,iBACF,0BAA0B,EACpC,KAAK,EAAE,WAAW,IAAI,eAAM,SAAS,EAAC,mBAAmB,gCAAuB,EAChF,KAAK,EAAC,kBAAkB,EACxB,MAAM,EAAE,iBAAiB,EACzB,cAAc,EAAC,WAAW,EAC1B,IAAI,SACJ,CACH,CAAC,CAAC,CAAC,IAAI,IACJ,IACF,CACP,CAAA;AACH,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -47,5 +47,52 @@ declare function SettingsFrame({ menu, title, current, menuLabel, defaultMenuOpe
|
|
|
47
47
|
/** Start with the phone fold open. */
|
|
48
48
|
defaultMenuOpen?: boolean;
|
|
49
49
|
}): React.JSX.Element;
|
|
50
|
-
|
|
50
|
+
/**
|
|
51
|
+
* THE SETTINGS PAGE (ui#498): what goes in the frame's settings column.
|
|
52
|
+
*
|
|
53
|
+
* ```
|
|
54
|
+
* Usage This month
|
|
55
|
+
* 12
|
|
56
|
+
* See what your Grid uses and the limits it runs within.
|
|
57
|
+
* 32
|
|
58
|
+
* [ block ]
|
|
59
|
+
* 32
|
|
60
|
+
* [ block ]
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* One stack with the page's spacing in it, so a page gets the design's rhythm
|
|
64
|
+
* without classes of its own. The numbers are the design's, measured on
|
|
65
|
+
* cloudgrid-console#1081 and on the 4px scale: 12 from the title's line to the
|
|
66
|
+
* subtitle (`gap-3`; the design measures 45 from cap to cap, which is 44 with
|
|
67
|
+
* 12), 32 from the subtitle to the first block and between blocks (`gap-8`; the
|
|
68
|
+
* design measures 30 to 37).
|
|
69
|
+
*
|
|
70
|
+
* - `title`: the page's h1, the title role (`text-title-32`, Medium).
|
|
71
|
+
* - `action`: an optional control or note on the title's line, centred on it
|
|
72
|
+
* ("This month", "Invite members").
|
|
73
|
+
* - `subtitle`: the page's one line, `text-body-md` in the body tone.
|
|
74
|
+
* - `eyebrow` above the title, in the accent text, and `note` under the
|
|
75
|
+
* subtitle, in the caption role; both optional.
|
|
76
|
+
* - `children`: the blocks, each one child of the stack. A block that should
|
|
77
|
+
* sit closer than 32 (Usage's alerts line under its rule) says so itself.
|
|
78
|
+
* - `tabbed` (ui#500): the first block is a tab row (Members 9 / Invited 3).
|
|
79
|
+
* The design leaves more air above tabs: 71 from the subtitle's caps to the
|
|
80
|
+
* tabs', where 32 gives 60. It is 44 under the header (`mb-3` on the 32),
|
|
81
|
+
* 72 cap to cap; only the space before the first block changes.
|
|
82
|
+
*/
|
|
83
|
+
declare function SettingsPage({ title, subtitle, action, eyebrow, note, tabbed, className, children, ...props }: Omit<React.ComponentProps<"div">, "title"> & {
|
|
84
|
+
/** The page's name, its h1: "Usage". */
|
|
85
|
+
title: React.ReactNode;
|
|
86
|
+
/** The line under the title. */
|
|
87
|
+
subtitle?: React.ReactNode;
|
|
88
|
+
/** On the title's line, at its end. */
|
|
89
|
+
action?: React.ReactNode;
|
|
90
|
+
/** A small line above the title. */
|
|
91
|
+
eyebrow?: React.ReactNode;
|
|
92
|
+
/** A caption under the subtitle. */
|
|
93
|
+
note?: React.ReactNode;
|
|
94
|
+
/** The first block is a tab row: 44 under the header, not 32. */
|
|
95
|
+
tabbed?: boolean;
|
|
96
|
+
}): React.JSX.Element;
|
|
97
|
+
export { SettingsFrame, SettingsPage };
|
|
51
98
|
//# sourceMappingURL=settings-frame.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-frame.d.ts","sourceRoot":"","sources":["../../src/blocks/settings-frame.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,iBAAS,aAAa,CAAC,EACrB,IAAI,EACJ,KAAK,EACL,OAAO,EACP,SAAkB,EAClB,eAAuB,EACvB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,GAAG;IAC9C,8DAA8D;IAC9D,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,gDAAgD;IAChD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sCAAsC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,qBAiEA;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"settings-frame.d.ts","sourceRoot":"","sources":["../../src/blocks/settings-frame.tsx"],"names":[],"mappings":"AAEA,OAAO,KA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A;AAED,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -49,5 +49,41 @@ function SettingsFrame({ menu, title, current, menuLabel = "Menu", defaultMenuOp
|
|
|
49
49
|
}
|
|
50
50
|
return (_jsxs("div", { "data-slot": "settings-frame", className: cn("flex min-h-0 w-full min-w-0 flex-col overflow-hidden rounded-container border border-hairline bg-card text-ink md:h-full md:flex-row", className), ...props, children: [_jsxs("div", { "data-slot": "settings-frame-menu", className: "flex min-w-0 flex-col gap-4 border-b border-hairline p-5 md:w-66 md:shrink-0 md:overflow-y-auto md:border-r md:border-b-0 md:pt-8", children: [title ? (_jsx("div", { "data-slot": "settings-frame-title", className: "text-heading-lg font-medium text-ink", children: title })) : null, _jsxs("button", { type: "button", "data-slot": "settings-frame-toggle", "aria-expanded": open, "aria-controls": menuId, onClick: () => setOpen((v) => !v), className: "flex h-10 w-full min-w-0 items-center gap-3 rounded-md border border-hairline px-[19px] text-left text-body-sm text-ink transition-colors hover:bg-(--cg-hover) focus-line md:hidden", children: [_jsx(MenuIcon, { className: "size-5 shrink-0 text-steel in-data-[cg-surface=panel]:text-faint in-data-[cg-surface=ink]:text-faint" }), _jsxs("span", { className: "min-w-0 flex-1 truncate", children: [menuLabel, current ? _jsxs("span", { className: "text-faint-strong", children: [" \u00B7 ", current] }) : null] }), _jsx(ChevronDownIcon, { className: cn("size-4 shrink-0 transition-transform duration-(--cg-duration)", open ? "rotate-180" : "rotate-0") })] }), _jsx("div", { id: menuId, "data-slot": "settings-frame-menu-panel", onClick: closeOnChoice, className: cn("min-w-0 flex-col gap-4 md:flex", open ? "flex" : "hidden"), children: menu })] }), _jsx("div", { "data-slot": "settings-frame-content", className: "min-w-0 flex-1 p-5 md:overflow-y-auto md:px-14 md:py-12", children: children })] }));
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
|
+
* THE SETTINGS PAGE (ui#498): what goes in the frame's settings column.
|
|
54
|
+
*
|
|
55
|
+
* ```
|
|
56
|
+
* Usage This month
|
|
57
|
+
* 12
|
|
58
|
+
* See what your Grid uses and the limits it runs within.
|
|
59
|
+
* 32
|
|
60
|
+
* [ block ]
|
|
61
|
+
* 32
|
|
62
|
+
* [ block ]
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* One stack with the page's spacing in it, so a page gets the design's rhythm
|
|
66
|
+
* without classes of its own. The numbers are the design's, measured on
|
|
67
|
+
* cloudgrid-console#1081 and on the 4px scale: 12 from the title's line to the
|
|
68
|
+
* subtitle (`gap-3`; the design measures 45 from cap to cap, which is 44 with
|
|
69
|
+
* 12), 32 from the subtitle to the first block and between blocks (`gap-8`; the
|
|
70
|
+
* design measures 30 to 37).
|
|
71
|
+
*
|
|
72
|
+
* - `title`: the page's h1, the title role (`text-title-32`, Medium).
|
|
73
|
+
* - `action`: an optional control or note on the title's line, centred on it
|
|
74
|
+
* ("This month", "Invite members").
|
|
75
|
+
* - `subtitle`: the page's one line, `text-body-md` in the body tone.
|
|
76
|
+
* - `eyebrow` above the title, in the accent text, and `note` under the
|
|
77
|
+
* subtitle, in the caption role; both optional.
|
|
78
|
+
* - `children`: the blocks, each one child of the stack. A block that should
|
|
79
|
+
* sit closer than 32 (Usage's alerts line under its rule) says so itself.
|
|
80
|
+
* - `tabbed` (ui#500): the first block is a tab row (Members 9 / Invited 3).
|
|
81
|
+
* The design leaves more air above tabs: 71 from the subtitle's caps to the
|
|
82
|
+
* tabs', where 32 gives 60. It is 44 under the header (`mb-3` on the 32),
|
|
83
|
+
* 72 cap to cap; only the space before the first block changes.
|
|
84
|
+
*/
|
|
85
|
+
function SettingsPage({ title, subtitle, action, eyebrow, note, tabbed = false, className, children, ...props }) {
|
|
86
|
+
return (_jsxs("div", { "data-slot": "settings-page", className: cn("flex min-w-0 flex-col gap-8", className), ...props, children: [_jsxs("header", { "data-slot": "settings-page-header", className: cn("grid min-w-0 gap-3", tabbed && "mb-3"), children: [eyebrow ? (_jsx("p", { "data-slot": "settings-page-eyebrow", className: "m-0 text-body-sm text-(--cg-text-accent)", children: eyebrow })) : null, _jsxs("div", { "data-slot": "settings-page-title-row", className: "flex min-w-0 flex-wrap items-center justify-between gap-4", children: [_jsx("h1", { "data-slot": "settings-page-title", className: "m-0 font-ui text-title-32 font-medium tracking-normal normal-case text-ink", children: title }), action ? (_jsx("div", { "data-slot": "settings-page-action", className: "flex shrink-0 items-center", children: action })) : null] }), subtitle ? (_jsx("p", { "data-slot": "settings-page-subtitle", className: "m-0 text-body-md text-body", children: subtitle })) : null, note ? (_jsx("p", { "data-slot": "settings-page-note", className: "m-0 text-caption text-faint-strong", children: note })) : null] }), children] }));
|
|
87
|
+
}
|
|
88
|
+
export { SettingsFrame, SettingsPage };
|
|
53
89
|
//# sourceMappingURL=settings-frame.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-frame.js","sourceRoot":"","sources":["../../src/blocks/settings-frame.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,SAAS,aAAa,CAAC,EACrB,IAAI,EACJ,KAAK,EACL,OAAO,EACP,SAAS,GAAG,MAAM,EAClB,eAAe,GAAG,KAAK,EACvB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EAYT;IACC,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,EAAE,CAAA;IAC5B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAA;IAEvD,SAAS,aAAa,CAAC,KAAuC;QAC5D,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB,CAAA;QAC1C,IAAI,MAAM,CAAC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EACJ,MAAM,CAAC,CAAC,CAAC,CACR,2BAAe,sBAAsB,EAAC,SAAS,EAAC,4BAA4B,YACzE,MAAM,GACH,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,QAAQ,CAAC,CAAC,CAAC,CACV,yBAAa,wBAAwB,EAAC,SAAS,EAAC,4BAA4B,YACzE,QAAQ,GACP,CACL,CAAC,CAAC,CAAC,IAAI,EACP,IAAI,CAAC,CAAC,CAAC,CACN,yBAAa,oBAAoB,EAAC,SAAS,EAAC,oCAAoC,YAC7E,IAAI,GACH,CACL,CAAC,CAAC,CAAC,IAAI,IACD,EACR,QAAQ,IACL,CACP,CAAA;AACH,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -27,15 +27,25 @@ declare function SettingsRow({ label, description, link, control, comingSoon, hi
|
|
|
27
27
|
* A section of settings: its heading, then its rows. `title`, `icon`,
|
|
28
28
|
* `description` and `action` are `SectionHeading`'s; the heading level is the
|
|
29
29
|
* caller's, as there.
|
|
30
|
+
*
|
|
31
|
+
* `divider` (ui#498) draws the hairline under the section, with its content
|
|
32
|
+
* ending 24 above it (`pb-6`): Usage's Run power and AI blocks, as the design
|
|
33
|
+
* measures them. Without it the section has no rule and no padding of its own.
|
|
30
34
|
*/
|
|
31
|
-
declare function SettingsSection({ title, icon, description, action, level, comingSoon, className, children, ...props }: Omit<React.ComponentProps<"section">, "title"> & {
|
|
35
|
+
declare function SettingsSection({ title, icon, description, action, level, comingSoon, divider, className, children, ...props }: Omit<React.ComponentProps<"section">, "title"> & {
|
|
32
36
|
title: React.ReactNode;
|
|
33
37
|
icon?: React.ReactNode;
|
|
34
38
|
description?: React.ReactNode;
|
|
35
39
|
action?: React.ReactNode;
|
|
36
40
|
level?: 2 | 3 | 4;
|
|
37
|
-
/**
|
|
38
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Designed, not built. `true`: one tag on the heading, every row and the
|
|
43
|
+
* action unusable. `"partial"`: one tag on the heading, and only the rows
|
|
44
|
+
* marked `comingSoon` unusable, untagged.
|
|
45
|
+
*/
|
|
46
|
+
comingSoon?: boolean | "partial";
|
|
47
|
+
/** A hairline under the section, its content ending 24 above it. */
|
|
48
|
+
divider?: boolean;
|
|
39
49
|
}): React.JSX.Element;
|
|
40
50
|
/**
|
|
41
51
|
* The brand text link with the leave-arrow: "Manage plan", "Manage spaces",
|
|
@@ -53,11 +63,17 @@ declare function SettingsLink({ render, className, children, ...props }: useRend
|
|
|
53
63
|
* the rows above and below. No `onEdit`, no pencil: a pencil that does nothing
|
|
54
64
|
* would say the value can be changed when it cannot.
|
|
55
65
|
*/
|
|
56
|
-
declare function EditableValue({ value, label, onEdit, valueClassName, className, ...props }: Omit<React.ComponentProps<"span">, "children"> & {
|
|
66
|
+
declare function EditableValue({ value, label, onEdit, valueClassName, wrap, className, ...props }: Omit<React.ComponentProps<"span">, "children"> & {
|
|
57
67
|
/** What is shown. */
|
|
58
68
|
value: React.ReactNode;
|
|
59
69
|
/** The value's type and colour, when it is not a row's 15px ink (the Grid's name). */
|
|
60
70
|
valueClassName?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Wrap a long value onto more lines instead of cutting it with an ellipsis
|
|
73
|
+
* (ui#500: the Grid's description at phone width). The pencil stays on the
|
|
74
|
+
* first line. Off, the value is one line, as before.
|
|
75
|
+
*/
|
|
76
|
+
wrap?: boolean;
|
|
61
77
|
/** What the pencil edits, in words: "administrative contact". */
|
|
62
78
|
label: string;
|
|
63
79
|
onEdit?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-row.d.ts","sourceRoot":"","sources":["../../src/blocks/settings-row.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"settings-row.d.ts","sourceRoot":"","sources":["../../src/blocks/settings-row.tsx"],"names":[],"m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EAAE,IAAI,GAAG,IAAI,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB,qBAmDA;AAED;;;;GAIG;AACH,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,GAAG;IAChD,KAAK,EAAE,SAAS;QAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE,EAAE,CAAA;CACrE,qBAeA;AAED,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,CAAA;AACjG,YAAY,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -79,6 +79,14 @@ import { SectionHeading } from "./section-heading.js";
|
|
|
79
79
|
* section stays a region, so it carries no `aria-disabled` of its own; its
|
|
80
80
|
* name says Coming soon.
|
|
81
81
|
*
|
|
82
|
+
* ## Some rows Coming soon (`SettingsSection comingSoon="partial"`, ui#500)
|
|
83
|
+
*
|
|
84
|
+
* A working section with a few unbuilt rows (General's Creation defaults, the
|
|
85
|
+
* Grid profile with its logo upload to come): one tag on the heading, never one
|
|
86
|
+
* per row. The section is named with the tag; its rows and its action work;
|
|
87
|
+
* only the rows marked `comingSoon` are greyed, inert and `aria-disabled`, and
|
|
88
|
+
* they carry no tag of their own.
|
|
89
|
+
*
|
|
82
90
|
* ## The highlight (`highlighted`)
|
|
83
91
|
*
|
|
84
92
|
* The settings search opens a page and points at one row ("Timezone ·
|
|
@@ -89,31 +97,43 @@ import { SectionHeading } from "./section-heading.js";
|
|
|
89
97
|
* the surface's own wash on the panel and on ink, where the tint is a light
|
|
90
98
|
* colour under light text.
|
|
91
99
|
*/
|
|
92
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Inside a `SettingsSection` that is Coming soon: `all`, every row is
|
|
102
|
+
* unavailable; `partial`, the heading carries the tag and only the rows marked
|
|
103
|
+
* `comingSoon` are unavailable, without a tag of their own.
|
|
104
|
+
*/
|
|
93
105
|
const SettingsSectionComingSoon = React.createContext(false);
|
|
94
106
|
function SettingsRow({ label, description, link, control, comingSoon = false, highlighted = false, align = "center", className, ...props }) {
|
|
95
107
|
const labelId = React.useId();
|
|
96
108
|
const tagId = React.useId();
|
|
97
109
|
const descriptionId = React.useId();
|
|
98
110
|
const sectionComingSoon = React.useContext(SettingsSectionComingSoon);
|
|
99
|
-
// Unavailable on its own
|
|
100
|
-
|
|
111
|
+
// Unavailable on its own or because its whole section is. In a `partial`
|
|
112
|
+
// section the heading carries the one tag, so the row has none of its own.
|
|
113
|
+
const unavailable = comingSoon || sectionComingSoon === "all";
|
|
114
|
+
const tagged = comingSoon && sectionComingSoon !== "partial";
|
|
101
115
|
const hasDescription = description !== undefined && description !== null && description !== false;
|
|
102
116
|
const describedBy = hasDescription ? descriptionId : undefined;
|
|
103
117
|
const rendered = typeof control === "function" ? control({ labelId, descriptionId: describedBy }) : control;
|
|
104
|
-
return (_jsxs("div", { "data-slot": "settings-row", role: "group", "aria-labelledby":
|
|
118
|
+
return (_jsxs("div", { "data-slot": "settings-row", role: "group", "aria-labelledby": tagged ? `${labelId} ${tagId}` : labelId, "aria-describedby": describedBy, "aria-disabled": unavailable ? "true" : undefined, "data-coming-soon": unavailable ? "" : undefined, "data-highlighted": highlighted ? "" : undefined, className: cn("relative isolate flex scroll-mt-6 flex-col gap-3 border-b border-hairline py-4 last:border-b-0", "sm:flex-row sm:justify-between sm:gap-8", align === "start" ? "sm:items-start" : "sm:items-center",
|
|
105
119
|
// The highlight, outside the text box: see the module note.
|
|
106
|
-
"before:pointer-events-none before:absolute before:inset-y-0 before:-inset-x-3 before:-z-10 before:rounded-md before:bg-brand-tint before:opacity-0 before:transition-opacity before:duration-(--cg-duration)", "in-data-[cg-surface=panel]:before:bg-(--cg-hover) in-data-[cg-surface=ink]:before:bg-(--cg-hover)", "data-highlighted:before:opacity-100", className), ...props, children: [_jsxs("div", { "data-slot": "settings-row-text", className: "grid min-w-0 flex-1 gap-1", children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [_jsx("span", { id: labelId, "data-slot": "settings-row-label", className: "text-body-sm font-medium text-ink", children: label }),
|
|
120
|
+
"before:pointer-events-none before:absolute before:inset-y-0 before:-inset-x-3 before:-z-10 before:rounded-md before:bg-brand-tint before:opacity-0 before:transition-opacity before:duration-(--cg-duration)", "in-data-[cg-surface=panel]:before:bg-(--cg-hover) in-data-[cg-surface=ink]:before:bg-(--cg-hover)", "data-highlighted:before:opacity-100", className), ...props, children: [_jsxs("div", { "data-slot": "settings-row-text", className: "grid min-w-0 flex-1 gap-1", children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [_jsx("span", { id: labelId, "data-slot": "settings-row-label", className: "text-body-sm font-medium text-ink", children: label }), tagged ? _jsx(ComingSoonTag, { id: tagId }) : null] }), hasDescription ? (_jsx("p", { id: descriptionId, "data-slot": "settings-row-description", className: "m-0 text-caption text-faint-strong", children: description })) : null, link ? (_jsx("div", { "data-slot": "settings-row-link", className: "pt-1", children: link })) : null] }), rendered !== undefined && rendered !== null && rendered !== false ? (_jsx("div", { "data-slot": "settings-row-control", inert: unavailable, className: cn("flex min-w-0 shrink-0 items-center gap-3 sm:justify-end", unavailable && "opacity-50 select-none"), children: rendered })) : null] }));
|
|
107
121
|
}
|
|
108
122
|
/**
|
|
109
123
|
* A section of settings: its heading, then its rows. `title`, `icon`,
|
|
110
124
|
* `description` and `action` are `SectionHeading`'s; the heading level is the
|
|
111
125
|
* caller's, as there.
|
|
126
|
+
*
|
|
127
|
+
* `divider` (ui#498) draws the hairline under the section, with its content
|
|
128
|
+
* ending 24 above it (`pb-6`): Usage's Run power and AI blocks, as the design
|
|
129
|
+
* measures them. Without it the section has no rule and no padding of its own.
|
|
112
130
|
*/
|
|
113
|
-
function SettingsSection({ title, icon, description, action, level = 2, comingSoon = false, className, children, ...props }) {
|
|
131
|
+
function SettingsSection({ title, icon, description, action, level = 2, comingSoon = false, divider = false, className, children, ...props }) {
|
|
114
132
|
const headingId = React.useId();
|
|
115
133
|
const tagId = React.useId();
|
|
116
|
-
|
|
134
|
+
const partial = comingSoon === "partial";
|
|
135
|
+
const whole = comingSoon === true;
|
|
136
|
+
return (_jsxs("section", { "aria-labelledby": comingSoon ? `${headingId} ${tagId}` : headingId, "data-coming-soon": partial ? "partial" : whole ? "" : undefined, "data-slot": "settings-section", className: cn("grid min-w-0 scroll-mt-6 gap-2 text-ink", divider && "border-b border-hairline pb-6", className), ...props, children: [_jsx(SectionHeading, { title: title, icon: icon, description: description, inline: comingSoon ? _jsx(ComingSoonTag, { id: tagId }) : undefined, action: action ? (_jsx("span", { "data-slot": "settings-section-action", inert: whole, className: cn("inline-flex", whole && "opacity-50 select-none"), children: action })) : undefined, level: level, headingId: headingId }), _jsx("div", { "data-slot": "settings-section-rows", className: "flex min-w-0 flex-col", children: _jsx(SettingsSectionComingSoon.Provider, { value: partial ? "partial" : whole ? "all" : false, children: children }) })] }));
|
|
117
137
|
}
|
|
118
138
|
/**
|
|
119
139
|
* The brand text link with the leave-arrow: "Manage plan", "Manage spaces",
|
|
@@ -142,8 +162,8 @@ function SettingsLink({ render, className, children, ...props }) {
|
|
|
142
162
|
* the rows above and below. No `onEdit`, no pencil: a pencil that does nothing
|
|
143
163
|
* would say the value can be changed when it cannot.
|
|
144
164
|
*/
|
|
145
|
-
function EditableValue({ value, label, onEdit, valueClassName, className, ...props }) {
|
|
146
|
-
return (_jsxs("span", { "data-slot": "editable-value", className: cn("inline-flex min-w-0 items-center gap-2", className), ...props, children: [_jsx("span", { "data-slot": "editable-value-text", className: cn("min-w-0
|
|
165
|
+
function EditableValue({ value, label, onEdit, valueClassName, wrap = false, className, ...props }) {
|
|
166
|
+
return (_jsxs("span", { "data-slot": "editable-value", className: cn("inline-flex min-w-0 items-center gap-2", wrap && "items-start", className), ...props, children: [_jsx("span", { "data-slot": "editable-value-text", className: cn("min-w-0 text-body-sm text-ink", wrap ? "whitespace-normal break-words" : "truncate", valueClassName), children: value }), onEdit ? (_jsx("button", { type: "button", "aria-label": `Edit ${label}`, onClick: onEdit, className: "-me-1 inline-flex size-6 shrink-0 items-center justify-center rounded-xs text-body transition-colors hover:bg-(--cg-hover) hover:text-ink focus-line", children: _jsx(EditIcon, { className: "size-4" }) })) : null] }));
|
|
147
167
|
}
|
|
148
168
|
/**
|
|
149
169
|
* A SUMMARY BLOCK (ui#494): Billing's plan and payment method, as the design
|
|
@@ -160,7 +180,7 @@ function EditableValue({ value, label, onEdit, valueClassName, className, ...pro
|
|
|
160
180
|
* a Coming soon section the action is inert and greyed, as a row's control is.
|
|
161
181
|
*/
|
|
162
182
|
function SettingsSummary({ glyph, title, description, figure, figureNote, action, size = "lg", className, ...props }) {
|
|
163
|
-
const unavailable = React.useContext(SettingsSectionComingSoon);
|
|
183
|
+
const unavailable = React.useContext(SettingsSectionComingSoon) === "all";
|
|
164
184
|
return (_jsxs("div", { "data-slot": "settings-summary", className: cn("flex min-w-0 flex-wrap items-center gap-x-8 gap-y-4 py-4 text-ink", className), ...props, children: [_jsxs("div", { className: "flex min-w-0 items-center gap-5 sm:w-80", children: [glyph ? (_jsx("span", { "data-slot": "settings-summary-glyph", "aria-hidden": "true", className: "flex shrink-0 items-center justify-center", children: glyph })) : null, _jsxs("div", { className: "grid min-w-0 gap-1", children: [_jsx("span", { "data-slot": "settings-summary-title", className: cn(size === "md" ? "text-body-18" : "text-title-24", "font-medium tracking-normal"), children: title }), description ? (_jsx("span", { "data-slot": "settings-summary-description", className: "text-body-sm text-body", children: description })) : null] })] }), figure ? (_jsxs("div", { className: "grid min-w-0 gap-1", children: [_jsx("span", { "data-slot": "settings-summary-figure", className: "text-title-24 font-medium tracking-normal tabular-nums", children: figure }), figureNote ? (_jsx("span", { "data-slot": "settings-summary-figure-note", className: "text-body-sm text-body", children: figureNote })) : null] })) : null, action ? (_jsx("div", { "data-slot": "settings-summary-action", inert: unavailable, className: cn("ms-auto flex shrink-0 items-center gap-3", unavailable && "opacity-50 select-none"), children: action })) : null] }));
|
|
165
185
|
}
|
|
166
186
|
/**
|