@cloudgrid-io/ui 0.56.0 → 0.58.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/badge/shared.d.ts +6 -0
- package/dist/badge/shared.d.ts.map +1 -1
- package/dist/badge/shared.js +6 -0
- package/dist/badge/shared.js.map +1 -1
- package/dist/blocks/confirm-delete-dialog.d.ts +7 -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 +9 -1
- package/dist/blocks/danger-zone.js.map +1 -1
- package/dist/blocks/dialog-subject.d.ts +34 -0
- package/dist/blocks/dialog-subject.d.ts.map +1 -0
- package/dist/blocks/dialog-subject.js +30 -0
- package/dist/blocks/dialog-subject.js.map +1 -0
- package/dist/blocks/field-label.d.ts +31 -0
- package/dist/blocks/field-label.d.ts.map +1 -0
- package/dist/blocks/field-label.js +29 -0
- package/dist/blocks/field-label.js.map +1 -0
- package/dist/blocks/filter-bar.d.ts +7 -5
- package/dist/blocks/filter-bar.d.ts.map +1 -1
- package/dist/blocks/filter-bar.js +13 -6
- package/dist/blocks/filter-bar.js.map +1 -1
- package/dist/blocks/grid-profile.d.ts +19 -43
- package/dist/blocks/grid-profile.d.ts.map +1 -1
- package/dist/blocks/grid-profile.js +64 -10
- package/dist/blocks/grid-profile.js.map +1 -1
- package/dist/blocks/impact-list.d.ts.map +1 -1
- package/dist/blocks/impact-list.js +1 -1
- package/dist/blocks/impact-list.js.map +1 -1
- package/dist/blocks/search-field.d.ts +4 -1
- package/dist/blocks/search-field.d.ts.map +1 -1
- package/dist/blocks/search-field.js +2 -2
- package/dist/blocks/search-field.js.map +1 -1
- package/dist/blocks/section-heading.d.ts +12 -1
- package/dist/blocks/section-heading.d.ts.map +1 -1
- package/dist/blocks/section-heading.js +12 -3
- package/dist/blocks/section-heading.js.map +1 -1
- package/dist/blocks/settings-frame.d.ts.map +1 -1
- package/dist/blocks/settings-frame.js +4 -1
- package/dist/blocks/settings-frame.js.map +1 -1
- package/dist/blocks/settings-row.d.ts +25 -4
- package/dist/blocks/settings-row.d.ts.map +1 -1
- package/dist/blocks/settings-row.js +32 -6
- package/dist/blocks/settings-row.js.map +1 -1
- package/dist/blocks/side-nav.d.ts +31 -1
- package/dist/blocks/side-nav.d.ts.map +1 -1
- package/dist/blocks/side-nav.js +38 -20
- package/dist/blocks/side-nav.js.map +1 -1
- package/dist/blocks/usage-meter.d.ts +7 -1
- package/dist/blocks/usage-meter.d.ts.map +1 -1
- package/dist/blocks/usage-meter.js +9 -3
- package/dist/blocks/usage-meter.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +6 -1
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/input.d.ts +18 -1
- package/dist/ui/input.d.ts.map +1 -1
- package/dist/ui/input.js +9 -3
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/select.d.ts +22 -2
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +32 -3
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/switch.d.ts +13 -0
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +14 -1
- package/dist/ui/switch.js.map +1 -1
- package/dist/ui/textarea.d.ts +10 -1
- package/dist/ui/textarea.d.ts.map +1 -1
- package/dist/ui/textarea.js +10 -2
- package/dist/ui/textarea.js.map +1 -1
- package/package.json +1 -1
package/dist/badge/shared.d.ts
CHANGED
|
@@ -47,6 +47,12 @@ export interface SelectOptions {
|
|
|
47
47
|
* Select's look (`ui/select.tsx`): a 32px trigger with a chevron, and a list
|
|
48
48
|
* that opens with the selected option laid over the trigger, as Select's
|
|
49
49
|
* `alignItemWithTrigger` places it. Items are 30px, so the offset is exact.
|
|
50
|
+
*
|
|
51
|
+
* Since ui#504 that is Select's opt-in placement, not its default (the
|
|
52
|
+
* library's menu now opens under its field, on its left edge). The badge keeps
|
|
53
|
+
* it: this is not the library Select but an HTML string in the badge's own
|
|
54
|
+
* small panel, its list end-aligned on its trigger (`right: 0`), and it ships
|
|
55
|
+
* with the live badge, so moving it is the badge's own decision.
|
|
50
56
|
*/
|
|
51
57
|
export declare function select({ label, options, value, action, open, attrs }: SelectOptions): string;
|
|
52
58
|
/** A switch: `role="switch"` with `aria-checked`, the library Switch's 32x18 track. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/badge/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;AAExC,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,oHAAoH;IACpH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC3B,+BAA+B;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAc,EAAE,UAAoB,EAAE,KAAU,EAAE,EAAE,YAAY,GAAG,MAAM,CAO7G;AAED,4FAA4F;AAC5F,eAAO,MAAM,KAAK,QAAO,MAAgF,CAAA;AAEzG,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,SAAS,YAAY,EAA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;GAUG;AACH,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAiB,EAAE,IAAY,EAAE,KAAU,EAAE,EAAE,aAAa,GAAG,MAAM,CAuBpH;AAED,uFAAuF;AACvF,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,UAAQ,GAAG,MAAM,CAEvG;AAED,iGAAiG;AACjG,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,SAAK,GAAG,MAAM,CAE3F"}
|
package/dist/badge/shared.js
CHANGED
|
@@ -25,6 +25,12 @@ export const scrim = () => `<div class="cgb-scrim" data-action="close" aria-hidd
|
|
|
25
25
|
* Select's look (`ui/select.tsx`): a 32px trigger with a chevron, and a list
|
|
26
26
|
* that opens with the selected option laid over the trigger, as Select's
|
|
27
27
|
* `alignItemWithTrigger` places it. Items are 30px, so the offset is exact.
|
|
28
|
+
*
|
|
29
|
+
* Since ui#504 that is Select's opt-in placement, not its default (the
|
|
30
|
+
* library's menu now opens under its field, on its left edge). The badge keeps
|
|
31
|
+
* it: this is not the library Select but an HTML string in the badge's own
|
|
32
|
+
* small panel, its list end-aligned on its trigger (`right: 0`), and it ships
|
|
33
|
+
* with the live badge, so moving it is the badge's own decision.
|
|
28
34
|
*/
|
|
29
35
|
export function select({ label, options, value, action = "select", open = false, attrs = "" }) {
|
|
30
36
|
const index = Math.max(0, options.findIndex((o) => o.value === value));
|
package/dist/badge/shared.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/badge/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAA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,KAAK,CAAC,KAAK,CAAC,QAAQ,CACtD;aACA,IAAI,CAAC,EAAE,CAAC;QACX,cAAc,CACf,CAAA;AACH,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,OAAgB,EAAE,MAAc,EAAE,QAAQ,GAAG,KAAK;IAC7F,OAAO,wEAAwE,OAAO,kBAAkB,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,GAAG,CAAC,KAAK,CAAC,GAAG,YAAY,CAAA;AAC7K,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,SAAS,CAAC,KAAa,EAAE,OAAgB,EAAE,MAAc,EAAE,GAAG,GAAG,EAAE;IACjF,OAAO,2BAA2B,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,KAAK,CAAC,UAAU,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,UAAU,CAAA;AACtI,CAAC"}
|
|
@@ -95,6 +95,12 @@ export type ConfirmDeleteDialogProps = {
|
|
|
95
95
|
* `DialogTitle size="lg"`, the 26 of the Grid settings pop-ups (Delete Grid).
|
|
96
96
|
*/
|
|
97
97
|
titleSize?: "default" | "lg";
|
|
98
|
+
/**
|
|
99
|
+
* `lg` (ui#502): the name field as the Grid settings Delete pop-up draws it,
|
|
100
|
+
* 48 tall with the text 16 from the outer edge (the final audit's D1). The
|
|
101
|
+
* default is the 40 field.
|
|
102
|
+
*/
|
|
103
|
+
fieldSize?: "default" | "lg";
|
|
98
104
|
/** Overrides the consequence line. */
|
|
99
105
|
description?: React.ReactNode;
|
|
100
106
|
/** The armed button's word. */
|
|
@@ -116,6 +122,6 @@ export type ConfirmDeleteDialogProps = {
|
|
|
116
122
|
/** Why it cannot be deleted now: no field, no Delete, only this reason (ui#494). */
|
|
117
123
|
blocked?: React.ReactNode;
|
|
118
124
|
};
|
|
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;
|
|
125
|
+
declare function ConfirmDeleteDialog({ open, onOpenChange, name, confirmText, onConfirm, pending, error, title, titleSize, fieldSize, description, confirmLabel, pendingLabel, cancelLabel, className, subject, children, placeholder, hint, blocked, confirmTextStyle, }: ConfirmDeleteDialogProps): React.JSX.Element;
|
|
120
126
|
export { ConfirmDeleteDialog };
|
|
121
127
|
//# 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;;;OAGG;IACH,S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C1B,CAAA;AAED,iBAAS,mBAAmB,CAAC,EAC3B,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,SAAS,EACT,OAAe,EACf,KAAK,EACL,KAAK,EACL,SAAqB,EACrB,SAAqB,EACrB,WAAwC,EACxC,YAAuB,EACvB,YAAyB,EACzB,WAAsB,EACtB,SAAS,EACT,OAAO,EACP,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,OAAO,EACP,gBAAyB,GAC1B,EAAE,wBAAwB,qBA6H1B;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, titleSize = "default", 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", fieldSize = "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, { 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",
|
|
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", className: fieldSize === "lg" ? "h-12 ps-[15px] pe-[15px]" : undefined }), 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,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,WAAW,GACZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH;;;;;;;;;;;;;;;;;;;;;;;8EAuB8E;AAC9E,MAAM,CAAC,MAAM,0BAA0B,GACrC,+FAA+F,CAAA;
|
|
1
|
+
{"version":3,"file":"confirm-delete-dialog.js","sourceRoot":"","sources":["../../src/blocks/confirm-delete-dialog.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,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,WAAW,GACZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;G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AC,qCAAqC,YACzE,KAAK,GACJ,CACL,CAAC,CAAC,CAAC,IAAI,IACJ,EAEN,eAAK,SAAS,EAAC,wDAAwD,aACrE,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,OAAO,EACf,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,YAE/B,WAAW,GACL,EACT,KAAC,MAAM,IACL,IAAI,EAAC,QAAQ;oCACb,mEAAmE;oCACnE,iEAAiE;oCACjE,gEAAgE;oCAChE,OAAO,EAAC,QAAQ,EAChB,QAAQ,EAAE,CAAC,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;AAsC9B,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,qBAgCA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -24,11 +24,19 @@ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "..
|
|
|
24
24
|
* pushed the label 1px right of the rows' and the headings' left edge, where
|
|
25
25
|
* the design puts it. The focus line is an outline, so it does not need it.
|
|
26
26
|
*
|
|
27
|
+
* Inside, the actions are drawn larger than a setting (ui#502, the final
|
|
28
|
+
* audit's G1, measured on the Delete pop-up's page behind it at 1:1): each
|
|
29
|
+
* row's label is 18 Medium (`text-body-18`; "Delete Grid" is 98 wide, 18
|
|
30
|
+
* renders 94 and 20 renders 105, cap 13.5), and the rows are 144 apart, so a
|
|
31
|
+
* row has 48 above and below its text (`py-12`, from `sm`; a phone keeps the
|
|
32
|
+
* row's 16, where the button stacks under the text). The rows stay the caller's
|
|
33
|
+
* `SettingsRow`s; the zone sets those two things on them.
|
|
34
|
+
*
|
|
27
35
|
* `open` / `onOpenChange` control it; `defaultOpen` starts it open.
|
|
28
36
|
*/
|
|
29
37
|
const ITEM = "danger-zone";
|
|
30
38
|
function DangerZone({ title = "Danger zone", description, open, defaultOpen = false, onOpenChange, className, 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 }) })] }) }));
|
|
39
|
+
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: cn("flex flex-col border-t border-hairline", "[&_[data-slot=settings-row-label]]:text-body-18 sm:[&>[data-slot=settings-row]]:py-12"), children: children }) })] }) }));
|
|
32
40
|
}
|
|
33
41
|
export { DangerZone };
|
|
34
42
|
//# 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;AAC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AACH,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* WHAT A POP-UP IS ABOUT (ui#502): the Grid settings Archive and Delete
|
|
4
|
+
* pop-ups open on the thing they act on, its tile, name and line, then the
|
|
5
|
+
* question.
|
|
6
|
+
*
|
|
7
|
+
* ```
|
|
8
|
+
* [A] Atomic Labs
|
|
9
|
+
* Organization Grid · Owner: Gilad Cohen
|
|
10
|
+
*
|
|
11
|
+
* Delete Atomic Labs permanently?
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* The question is the H4 role, 22 Medium (`text-heading-lg`): the design draws
|
|
15
|
+
* "Delete Atomic Labs permanently?" 333 wide, which is 21.2 in the UI face; 22
|
|
16
|
+
* renders 345 and 20 renders 314, so the nearest role (the final audit's A2;
|
|
17
|
+
* the Console drew it at 17). The name is 16 Medium in ink, the line the
|
|
18
|
+
* caption role in `faint-strong`, the tile the caller's (`Avatar`), 16 before
|
|
19
|
+
* the name. 20 between the subject and the question.
|
|
20
|
+
*
|
|
21
|
+
* The question is a heading (`level`, default 3: under the pop-up's title).
|
|
22
|
+
*/
|
|
23
|
+
declare function DialogSubject({ media, name, meta, question, level, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
24
|
+
/** The tile: an `Avatar`. Decorative beside the name. */
|
|
25
|
+
media?: React.ReactNode;
|
|
26
|
+
name: React.ReactNode;
|
|
27
|
+
/** The line under the name: "Organization Grid · Owner: Gilad Cohen". */
|
|
28
|
+
meta?: React.ReactNode;
|
|
29
|
+
/** "Delete Atomic Labs permanently?" */
|
|
30
|
+
question?: React.ReactNode;
|
|
31
|
+
level?: 2 | 3 | 4;
|
|
32
|
+
}): React.JSX.Element;
|
|
33
|
+
export { DialogSubject };
|
|
34
|
+
//# sourceMappingURL=dialog-subject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog-subject.d.ts","sourceRoot":"","sources":["../../src/blocks/dialog-subject.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,iBAAS,aAAa,CAAC,EACrB,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,KAAS,EACT,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACjD,yDAAyD;IACzD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,yEAAyE;IACzE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CAClB,qBA4BA;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../lib/cloudgrid-cn.js";
|
|
4
|
+
/**
|
|
5
|
+
* WHAT A POP-UP IS ABOUT (ui#502): the Grid settings Archive and Delete
|
|
6
|
+
* pop-ups open on the thing they act on, its tile, name and line, then the
|
|
7
|
+
* question.
|
|
8
|
+
*
|
|
9
|
+
* ```
|
|
10
|
+
* [A] Atomic Labs
|
|
11
|
+
* Organization Grid · Owner: Gilad Cohen
|
|
12
|
+
*
|
|
13
|
+
* Delete Atomic Labs permanently?
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* The question is the H4 role, 22 Medium (`text-heading-lg`): the design draws
|
|
17
|
+
* "Delete Atomic Labs permanently?" 333 wide, which is 21.2 in the UI face; 22
|
|
18
|
+
* renders 345 and 20 renders 314, so the nearest role (the final audit's A2;
|
|
19
|
+
* the Console drew it at 17). The name is 16 Medium in ink, the line the
|
|
20
|
+
* caption role in `faint-strong`, the tile the caller's (`Avatar`), 16 before
|
|
21
|
+
* the name. 20 between the subject and the question.
|
|
22
|
+
*
|
|
23
|
+
* The question is a heading (`level`, default 3: under the pop-up's title).
|
|
24
|
+
*/
|
|
25
|
+
function DialogSubject({ media, name, meta, question, level = 3, className, ...props }) {
|
|
26
|
+
const Heading = `h${level}`;
|
|
27
|
+
return (_jsxs("div", { "data-slot": "dialog-subject", className: cn("grid gap-5 pt-2 text-ink", className), ...props, children: [_jsxs("div", { className: "flex min-w-0 items-center gap-4", children: [media ? (_jsx("span", { "data-slot": "dialog-subject-media", "aria-hidden": "true", className: "flex shrink-0", children: media })) : null, _jsxs("div", { className: "grid min-w-0 gap-1", children: [_jsx("span", { "data-slot": "dialog-subject-name", className: "text-body-md font-medium text-ink", children: name }), meta ? (_jsx("span", { "data-slot": "dialog-subject-meta", className: "text-caption text-faint-strong", children: meta })) : null] })] }), question ? (_jsx(Heading, { "data-slot": "dialog-subject-question", className: "m-0 text-heading-lg font-medium text-ink", children: question })) : null] }));
|
|
28
|
+
}
|
|
29
|
+
export { DialogSubject };
|
|
30
|
+
//# sourceMappingURL=dialog-subject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog-subject.js","sourceRoot":"","sources":["../../src/blocks/dialog-subject.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAS,aAAa,CAAC,EACrB,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,KAAK,GAAG,CAAC,EACT,SAAS,EACT,GAAG,KAAK,EAUT;IACC,MAAM,OAAO,GAAG,IAAI,KAAK,EAAwB,CAAA;IACjD,OAAO,CACL,4BAAe,gBAAgB,EAAC,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAAM,KAAK,aAC7F,eAAK,SAAS,EAAC,iCAAiC,aAC7C,KAAK,CAAC,CAAC,CAAC,CACP,4BAAgB,sBAAsB,iBAAa,MAAM,EAAC,SAAS,EAAC,eAAe,YAChF,KAAK,GACD,CACR,CAAC,CAAC,CAAC,IAAI,EACR,eAAK,SAAS,EAAC,oBAAoB,aACjC,4BAAgB,qBAAqB,EAAC,SAAS,EAAC,mCAAmC,YAChF,IAAI,GACA,EACN,IAAI,CAAC,CAAC,CAAC,CACN,4BAAgB,qBAAqB,EAAC,SAAS,EAAC,gCAAgC,YAC7E,IAAI,GACA,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,IACF,EACL,QAAQ,CAAC,CAAC,CAAC,CACV,KAAC,OAAO,iBAAW,yBAAyB,EAAC,SAAS,EAAC,0CAA0C,YAC9F,QAAQ,GACD,CACX,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAA;AACH,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* A POP-UP FIELD'S LABEL (ui#502), as the Grid settings pop-ups draw it (New
|
|
4
|
+
* Space: Name, Space address, Description, Add members; the final audit's N2,
|
|
5
|
+
* measured at 1:1): the body size at SemiBold ("Name" is 40 wide; 15 at 600
|
|
6
|
+
* renders 41, at 500 renders 40.6, so the weight is read from the strokes) in
|
|
7
|
+
* steel-strong (#5F6874, 5.6:1 on white), and "· Optional" after it at the
|
|
8
|
+
* same weight and colour, not a lighter one.
|
|
9
|
+
*
|
|
10
|
+
* ```
|
|
11
|
+
* Description · Optional
|
|
12
|
+
* [ ]
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* The body size is the Console's 14 under its preset (15 elsewhere), Body Bold
|
|
16
|
+
* as the roles name it. Steel is declared at :root only, so on the panel and on
|
|
17
|
+
* ink the label takes the surface's body text.
|
|
18
|
+
*
|
|
19
|
+
* A `<label>` by default; `as="span"` with an `id` names a control that takes
|
|
20
|
+
* `aria-labelledby` instead (a combobox).
|
|
21
|
+
*/
|
|
22
|
+
declare function FieldLabel({ optional, optionalLabel, as, className, children, ...props }: React.ComponentProps<"label"> & {
|
|
23
|
+
/** Say the field can be left empty: "· Optional" after the label. */
|
|
24
|
+
optional?: boolean;
|
|
25
|
+
/** The word after the dot. Default "Optional". */
|
|
26
|
+
optionalLabel?: string;
|
|
27
|
+
/** `span` for a control named with `aria-labelledby`. */
|
|
28
|
+
as?: "label" | "span";
|
|
29
|
+
}): React.JSX.Element;
|
|
30
|
+
export { FieldLabel };
|
|
31
|
+
//# sourceMappingURL=field-label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-label.d.ts","sourceRoot":"","sources":["../../src/blocks/field-label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,UAAU,CAAC,EAClB,QAAgB,EAChB,aAA0B,EAC1B,EAAY,EACZ,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG;IACjC,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,yDAAyD;IACzD,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CACtB,qBAoBA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../lib/cloudgrid-cn.js";
|
|
4
|
+
/**
|
|
5
|
+
* A POP-UP FIELD'S LABEL (ui#502), as the Grid settings pop-ups draw it (New
|
|
6
|
+
* Space: Name, Space address, Description, Add members; the final audit's N2,
|
|
7
|
+
* measured at 1:1): the body size at SemiBold ("Name" is 40 wide; 15 at 600
|
|
8
|
+
* renders 41, at 500 renders 40.6, so the weight is read from the strokes) in
|
|
9
|
+
* steel-strong (#5F6874, 5.6:1 on white), and "· Optional" after it at the
|
|
10
|
+
* same weight and colour, not a lighter one.
|
|
11
|
+
*
|
|
12
|
+
* ```
|
|
13
|
+
* Description · Optional
|
|
14
|
+
* [ ]
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* The body size is the Console's 14 under its preset (15 elsewhere), Body Bold
|
|
18
|
+
* as the roles name it. Steel is declared at :root only, so on the panel and on
|
|
19
|
+
* ink the label takes the surface's body text.
|
|
20
|
+
*
|
|
21
|
+
* A `<label>` by default; `as="span"` with an `id` names a control that takes
|
|
22
|
+
* `aria-labelledby` instead (a combobox).
|
|
23
|
+
*/
|
|
24
|
+
function FieldLabel({ optional = false, optionalLabel = "Optional", as = "label", className, children, ...props }) {
|
|
25
|
+
const Tag = as;
|
|
26
|
+
return (_jsxs(Tag, { "data-slot": "field-label", className: cn("text-body-sm font-bold text-steel-strong in-data-[cg-surface=panel]:text-body in-data-[cg-surface=ink]:text-body", className), ...props, children: [children, optional ? (_jsxs(_Fragment, { children: [" ", _jsxs("span", { "data-slot": "field-label-optional", children: ["\u00B7 ", optionalLabel] })] })) : null] }));
|
|
27
|
+
}
|
|
28
|
+
export { FieldLabel };
|
|
29
|
+
//# sourceMappingURL=field-label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-label.js","sourceRoot":"","sources":["../../src/blocks/field-label.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAS,UAAU,CAAC,EAClB,QAAQ,GAAG,KAAK,EAChB,aAAa,GAAG,UAAU,EAC1B,EAAE,GAAG,OAAO,EACZ,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EAQT;IACC,MAAM,GAAG,GAAG,EAAE,CAAA;IACd,OAAO,CACL,MAAC,GAAG,iBACQ,aAAa,EACvB,SAAS,EAAE,EAAE,CACX,kHAAkH,EAClH,SAAS,CACV,KACI,KAAuC,aAE3C,QAAQ,EACR,QAAQ,CAAC,CAAC,CAAC,CACV,8BACG,GAAG,EACJ,6BAAgB,sBAAsB,wBAAI,aAAa,IAAQ,IAC9D,CACJ,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAA;AACH,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -14,11 +14,13 @@ import * as React from "react";
|
|
|
14
14
|
* Every field and dropdown in the library is radius 12 (ui#494, Asaf's
|
|
15
15
|
* decision). They still disagree on one thing, each for its own frame: `Input`
|
|
16
16
|
* sets 16px text under `md`, `Select` 15px. Inside this row every field and
|
|
17
|
-
* dropdown is 40 tall, 15px text, and the first thing drawn in it
|
|
18
|
-
* edge: a dropdown's value (1px border,
|
|
19
|
-
* which
|
|
20
|
-
*
|
|
21
|
-
*
|
|
17
|
+
* dropdown is 40 tall, 15px text, and the first thing drawn in it 15px from the box's outer
|
|
18
|
+
* edge: a dropdown's value (1px border, 14 of padding) and the search mark, 16
|
|
19
|
+
* square, which this row places at 15. So every box starts its content at one
|
|
20
|
+
* x from its edge and every label sits on one baseline. The search's text
|
|
21
|
+
* starts 44 in. (ui#502: these were 20 and 56 with a 20 mark; Members and
|
|
22
|
+
* Spaces draw a 16 mark 16 in, the text 44 in and the dropdowns' values 15
|
|
23
|
+
* in, the final audit's S7. The e2e measures each.)
|
|
22
24
|
*
|
|
23
25
|
* ## Layout
|
|
24
26
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-bar.d.ts","sourceRoot":"","sources":["../../src/blocks/filter-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B
|
|
1
|
+
{"version":3,"file":"filter-bar.d.ts","sourceRoot":"","sources":["../../src/blocks/filter-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,iBAAS,SAAS,CAAC,EACjB,QAAQ,EACR,GAAG,EACH,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG;IAC7C,gDAAgD;IAChD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,6CAA6C;IAC7C,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACtB,qBAgCA;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -16,11 +16,13 @@ import { cn } from "../lib/cloudgrid-cn.js";
|
|
|
16
16
|
* Every field and dropdown in the library is radius 12 (ui#494, Asaf's
|
|
17
17
|
* decision). They still disagree on one thing, each for its own frame: `Input`
|
|
18
18
|
* sets 16px text under `md`, `Select` 15px. Inside this row every field and
|
|
19
|
-
* dropdown is 40 tall, 15px text, and the first thing drawn in it
|
|
20
|
-
* edge: a dropdown's value (1px border,
|
|
21
|
-
* which
|
|
22
|
-
*
|
|
23
|
-
*
|
|
19
|
+
* dropdown is 40 tall, 15px text, and the first thing drawn in it 15px from the box's outer
|
|
20
|
+
* edge: a dropdown's value (1px border, 14 of padding) and the search mark, 16
|
|
21
|
+
* square, which this row places at 15. So every box starts its content at one
|
|
22
|
+
* x from its edge and every label sits on one baseline. The search's text
|
|
23
|
+
* starts 44 in. (ui#502: these were 20 and 56 with a 20 mark; Members and
|
|
24
|
+
* Spaces draw a 16 mark 16 in, the text 44 in and the dropdowns' values 15
|
|
25
|
+
* in, the final audit's S7. The e2e measures each.)
|
|
24
26
|
*
|
|
25
27
|
* ## Layout
|
|
26
28
|
*
|
|
@@ -31,7 +33,12 @@ import { cn } from "../lib/cloudgrid-cn.js";
|
|
|
31
33
|
* a `role="group"`; name it with `aria-label` ("Filter members").
|
|
32
34
|
*/
|
|
33
35
|
function FilterBar({ trailing, end, className, children, ...props }) {
|
|
34
|
-
return (_jsxs("div", { "data-slot": "filter-bar", role: "group", className: cn("flex min-w-0 flex-wrap items-center gap-3 text-ink",
|
|
36
|
+
return (_jsxs("div", { "data-slot": "filter-bar", role: "group", className: cn("flex min-w-0 flex-wrap items-center gap-3 text-ink",
|
|
37
|
+
// ui#502: the search's mark 16, 15 in, its text 44 in; the selects'
|
|
38
|
+
// value 15 in, where the mark starts, and in steel, as every filter
|
|
39
|
+
// row draws it. Steel is :root only, so the panel and ink keep their
|
|
40
|
+
// body text.
|
|
41
|
+
"[&_[data-slot=input]]:text-body-sm [&_[data-slot=input-leading]]:start-[15px] [&_[data-slot=input-leading]_svg]:size-4 [&_[data-slot=input]]:ps-[43px]", "[&_[data-slot=select-trigger]]:h-10 [&_[data-slot=select-trigger]]:px-3.5 [&_[data-slot=select-trigger]]:text-body-sm", "[&_[data-slot=select-trigger]]:text-steel-strong in-data-[cg-surface=panel]:[&_[data-slot=select-trigger]]:text-body in-data-[cg-surface=ink]:[&_[data-slot=select-trigger]]:text-body", "[&>[data-slot=search-field]]:w-full sm:[&>[data-slot=search-field]]:w-80", className), ...props, children: [children, trailing ? (_jsx("span", { "data-slot": "filter-bar-trailing", className: "text-body-sm text-faint-strong", children: trailing })) : null, end ? (_jsx("div", { "data-slot": "filter-bar-end", className: "ms-auto flex items-center gap-3", children: end })) : null] }));
|
|
35
42
|
}
|
|
36
43
|
export { FilterBar };
|
|
37
44
|
//# sourceMappingURL=filter-bar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-bar.js","sourceRoot":"","sources":["../../src/blocks/filter-bar.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC
|
|
1
|
+
{"version":3,"file":"filter-bar.js","sourceRoot":"","sources":["../../src/blocks/filter-bar.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,SAAS,SAAS,CAAC,EACjB,QAAQ,EACR,GAAG,EACH,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EAMT;IACC,OAAO,CACL,4BACY,YAAY,EACtB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,EAAE,CACX,oDAAoD;QACpD,oEAAoE;QACpE,oEAAoE;QACpE,qEAAqE;QACrE,aAAa;QACb,wJAAwJ,EACxJ,uHAAuH,EACvH,wLAAwL,EACxL,0EAA0E,EAC1E,SAAS,CACV,KACG,KAAK,aAER,QAAQ,EACR,QAAQ,CAAC,CAAC,CAAC,CACV,4BAAgB,qBAAqB,EAAC,SAAS,EAAC,gCAAgC,YAC7E,QAAQ,GACJ,CACR,CAAC,CAAC,CAAC,IAAI,EACP,GAAG,CAAC,CAAC,CAAC,CACL,2BAAe,gBAAgB,EAAC,SAAS,EAAC,iCAAiC,YACxE,GAAG,GACA,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAA;AACH,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -1,46 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* page.
|
|
5
|
-
*
|
|
6
|
-
* ```
|
|
7
|
-
* ┌──────┐
|
|
8
|
-
* │ A │ Atomic Labs ✎
|
|
9
|
-
* │ ✎│ A shared home for our team's creations. ✎
|
|
10
|
-
* └──────┘
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* - The logo tile is the library `Avatar`: the 80px rung, square, the pastel
|
|
14
|
-
* look (the grid avatar of the header, #381), so a grid has one colour and
|
|
15
|
-
* one letter everywhere. `logoSrc` draws the grid's picture in it, and a
|
|
16
|
-
* picture that fails to load falls back to the letter (Avatar's own rule).
|
|
17
|
-
* - The pencil badge at the tile's lower right is a 28px round button named
|
|
18
|
-
* "Change the Grid logo". The upload is the platform's and comes later
|
|
19
|
-
* (cloudgrid#6538); the caller passes `onEditLogo` when it can do something.
|
|
20
|
-
* Not `AvatarPicker`: that is a person's photo, a round picture with a camera
|
|
21
|
-
* over it on hover and a file input of its own; the grid's tile is a square
|
|
22
|
-
* with a pencil, and what pressing it opens is the caller's.
|
|
23
|
-
* - The name (H4 role, 22) and the description (body text, 15, in the body
|
|
24
|
-
* tone) are `EditableValue`s, so each pencil is named for what it edits
|
|
25
|
-
* ("Edit Grid name", "Edit Grid description").
|
|
26
|
-
*
|
|
27
|
-
* With no handler a pencil is not drawn at all: a pencil that does nothing
|
|
28
|
-
* would say the value can be changed when it cannot. The tile and the text are
|
|
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.
|
|
42
|
-
*/
|
|
43
|
-
declare function GridProfile({ name, description, logoSrc, seed, onEditLogo, onEditName, onEditDescription, logoComingSoon, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
2
|
+
import { type AvatarPickerRejection } from "./avatar-picker.js";
|
|
3
|
+
declare function GridProfile({ name, description, logoSrc, seed, onEditLogo, onSelectLogoFile, onRejectLogoFile, onRemoveLogo, logoAccept, logoMaxBytes, logoPending, onEditName, onEditDescription, logoComingSoon, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
|
|
44
4
|
/** The grid's name: the tile's letter, and the large line. */
|
|
45
5
|
name: string;
|
|
46
6
|
/** The line under the name. */
|
|
@@ -49,8 +9,24 @@ declare function GridProfile({ name, description, logoSrc, seed, onEditLogo, onE
|
|
|
49
9
|
logoSrc?: string;
|
|
50
10
|
/** What the tile's colour is derived from: the grid's id, so a rename keeps it. */
|
|
51
11
|
seed?: string;
|
|
52
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* The badge on the tile was pressed. No handler, no badge.
|
|
14
|
+
* @deprecated Pass `onSelectLogoFile` (and `onRemoveLogo`): the tile becomes
|
|
15
|
+
* the picker and the badge a menu (ui#505).
|
|
16
|
+
*/
|
|
53
17
|
onEditLogo?: () => void;
|
|
18
|
+
/** A good logo file, after the type and size checks. The caller uploads it. Makes the tile the picker. */
|
|
19
|
+
onSelectLogoFile?: (file: File) => void;
|
|
20
|
+
/** A picked file that failed a check, and which one. */
|
|
21
|
+
onRejectLogoFile?: (file: File, reason: AvatarPickerRejection) => void;
|
|
22
|
+
/** "Remove logo" in the badge's menu, shown only while there is a `logoSrc`. */
|
|
23
|
+
onRemoveLogo?: () => void;
|
|
24
|
+
/** The native attribute's syntax. Defaults to JPG, PNG and WebP. */
|
|
25
|
+
logoAccept?: string;
|
|
26
|
+
/** The largest logo file accepted, in bytes, inclusive. No limit when omitted. */
|
|
27
|
+
logoMaxBytes?: number;
|
|
28
|
+
/** The caller's upload or removal is running: a spinner, `aria-busy`, and no picker. */
|
|
29
|
+
logoPending?: boolean;
|
|
54
30
|
/** The upload is not built yet: the badge is drawn, greyed and inert. */
|
|
55
31
|
logoComingSoon?: boolean;
|
|
56
32
|
onEditName?: () => void;
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"grid-profile.d.ts","sourceRoot":"","sources":["../../src/blocks/grid-profile.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,6BAA6B,CAAA;AAkFpC,iBAAS,WAAW,CAAC,EACnB,IAAI,EACJ,WAAW,EACX,OAAO,EACP,IAAI,EACJ,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,UAAiC,EACjC,YAAY,EACZ,WAAmB,EACnB,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;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,0GAA0G;IAC1G,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IACvC,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAA;IACtE,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,IAAI,CAAA;IACzB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wFAAwF;IACxF,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,yEAAyE;IACzE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAA;CAC/B,qBA+HA;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cn } from "../lib/cloudgrid-cn.js";
|
|
5
5
|
import { Avatar } from "./avatar.js";
|
|
6
|
-
import {
|
|
6
|
+
import { AVATAR_PICKER_ACCEPT, routeAvatarFile, } from "./avatar-picker.js";
|
|
7
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../ui/dropdown-menu.js";
|
|
8
|
+
import { ChangePhotoIcon, EditIcon } from "./icons.js";
|
|
7
9
|
import { EditableValue } from "./settings-row.js";
|
|
10
|
+
import { Spinner } from "../ui/spinner.js";
|
|
8
11
|
/**
|
|
9
12
|
* THE GRID PROFILE (ui#494): the block at the top of the Grid settings General
|
|
10
13
|
* page.
|
|
@@ -20,12 +23,10 @@ import { EditableValue } from "./settings-row.js";
|
|
|
20
23
|
* look (the grid avatar of the header, #381), so a grid has one colour and
|
|
21
24
|
* one letter everywhere. `logoSrc` draws the grid's picture in it, and a
|
|
22
25
|
* picture that fails to load falls back to the letter (Avatar's own rule).
|
|
23
|
-
* - The pencil badge at the tile's lower right is a 28px round button
|
|
24
|
-
* "Change the Grid logo"
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* over it on hover and a file input of its own; the grid's tile is a square
|
|
28
|
-
* with a pencil, and what pressing it opens is the caller's.
|
|
26
|
+
* - The pencil badge at the tile's lower right is a 28px round button. Before
|
|
27
|
+
* ui#505 it was named "Change the Grid logo" and called `onEditLogo`, and
|
|
28
|
+
* what it opened was the caller's; that path still works (deprecated). The
|
|
29
|
+
* logo picker is below.
|
|
29
30
|
* - The name (H4 role, 22) and the description (body text, 15, in the body
|
|
30
31
|
* tone) are `EditableValue`s, so each pencil is named for what it edits
|
|
31
32
|
* ("Edit Grid name", "Edit Grid description").
|
|
@@ -45,9 +46,62 @@ import { EditableValue } from "./settings-row.js";
|
|
|
45
46
|
* in the faint tone, with its pencil, so one can be added. No handler, no line.
|
|
46
47
|
* - The description wraps onto more lines rather than being cut with an
|
|
47
48
|
* ellipsis (it was cut on one line at phone width). The name stays one line.
|
|
49
|
+
*
|
|
50
|
+
* ui#505, the logo picked like the profile photo (`AvatarPicker`), adapted to
|
|
51
|
+
* a grid. With `onSelectLogoFile`:
|
|
52
|
+
*
|
|
53
|
+
* - The tile is a button, "Change the Grid logo": pressing it calls `click()`
|
|
54
|
+
* on a hidden file input (`hidden`, `tabIndex={-1}`), so the native picker
|
|
55
|
+
* opens with no pop-up and the tile is one tab stop. A camera fades in over
|
|
56
|
+
* the strong scrim on hover and on keyboard focus, on the tile's own corner.
|
|
57
|
+
* - The pencil badge, "Edit Grid logo", opens a small menu: "Upload new logo",
|
|
58
|
+
* and "Remove logo" only when there is a logo (`logoSrc`) and the caller can
|
|
59
|
+
* remove it (`onRemoveLogo`). Its hover is the other pencils' (`EditableValue`):
|
|
60
|
+
* the hover wash and ink. The badge keeps its white ground on the tile, so the
|
|
61
|
+
* wash is laid over it rather than replacing it.
|
|
62
|
+
* - A picked file goes through `routeAvatarFile`: a type outside `logoAccept`
|
|
63
|
+
* or a file over `logoMaxBytes` goes to `onRejectLogoFile(file, reason)`,
|
|
64
|
+
* anything else to `onSelectLogoFile(file)`. The input is cleared after
|
|
65
|
+
* every pick, so the same file can be chosen again.
|
|
66
|
+
* - `logoPending`: a spinner over the tile, the tile `aria-busy`, and the tile,
|
|
67
|
+
* the pencil and the input disabled, so nothing opens a second picker.
|
|
68
|
+
*
|
|
69
|
+
* The block makes no network call: the upload and the removal are the
|
|
70
|
+
* caller's. `logoComingSoon` wins over a handler and draws what it drew before.
|
|
71
|
+
* `onEditLogo` (deprecated) still draws the old pencil that calls it, so a
|
|
72
|
+
* caller that has not moved keeps working.
|
|
73
|
+
*/
|
|
74
|
+
/** The scrim over the tile, on its 80px corner. */
|
|
75
|
+
const LOGO_OVERLAY = "absolute inset-0 grid place-items-center rounded-container bg-scrim-strong text-ink";
|
|
76
|
+
/**
|
|
77
|
+
* The 28px badge at the tile's lower right. Its hover is `EditableValue`'s
|
|
78
|
+
* pencil's (ui#505): the hover wash and ink. The wash is laid over the badge's
|
|
79
|
+
* white ground as an image, because `--cg-hover` is translucent and replacing
|
|
80
|
+
* the ground would let the tile show through.
|
|
48
81
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
82
|
+
const BADGE = "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:[background-image:linear-gradient(var(--cg-hover),var(--cg-hover))] hover:text-ink focus-line";
|
|
83
|
+
function GridProfile({ name, description, logoSrc, seed, onEditLogo, onSelectLogoFile, onRejectLogoFile, onRemoveLogo, logoAccept = AVATAR_PICKER_ACCEPT, logoMaxBytes, logoPending = false, onEditName, onEditDescription, logoComingSoon = false, className, ...props }) {
|
|
84
|
+
const input = React.useRef(null);
|
|
85
|
+
const picker = Boolean(onSelectLogoFile) && !logoComingSoon;
|
|
86
|
+
const tile = _jsx(Avatar, { name: name, seed: seed, src: logoSrc, size: 80, shape: "square", look: "pastel" });
|
|
87
|
+
const pick = () => {
|
|
88
|
+
if (!logoPending)
|
|
89
|
+
input.current?.click();
|
|
90
|
+
};
|
|
91
|
+
return (_jsxs("div", { "data-slot": "grid-profile", className: cn("flex min-w-0 flex-wrap items-center gap-6 text-ink", className), ...props, children: [_jsx("span", { "data-slot": "grid-profile-logo", "data-pending": (picker && logoPending) || undefined, className: "relative inline-flex shrink-0", children: picker ? (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", "aria-label": "Change the Grid logo", "aria-busy": logoPending || undefined, disabled: logoPending, onClick: pick, className: "group/grid-logo relative inline-flex shrink-0 cursor-pointer rounded-container outline-none focus-line disabled:cursor-not-allowed", children: [tile, logoPending ? (_jsx("span", { "data-cg-surface": "ink", "aria-hidden": "true", className: LOGO_OVERLAY, children: _jsx(Spinner, { decorative: true, size: "lg" }) })) : (_jsx("span", { "data-slot": "grid-profile-logo-mark", "data-cg-surface": "ink", "aria-hidden": "true", className: cn(LOGO_OVERLAY, "opacity-0 transition-opacity duration-150 motion-reduce:transition-none", "group-hover/grid-logo:opacity-100 group-focus-visible/grid-logo:opacity-100"), children: _jsx(ChangePhotoIcon, { className: "size-[40%] shrink-0" }) }))] }), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { "aria-label": "Edit Grid logo", disabled: logoPending, className: cn(BADGE, "disabled:pointer-events-none"), children: _jsx(EditIcon, { className: "size-3.5" }) }), _jsxs(DropdownMenuContent, { "data-slot": "grid-profile-logo-menu", className: "w-max", children: [_jsx(DropdownMenuItem, { onClick: pick, children: "Upload new logo" }), logoSrc && onRemoveLogo ? (_jsx(DropdownMenuItem, { onClick: onRemoveLogo, children: "Remove logo" })) : null] })] }), _jsx("input", { ref: input, type: "file", accept: logoAccept, disabled: logoPending, hidden: true, tabIndex: -1, onChange: (e) => {
|
|
92
|
+
const picked = e.target.files?.[0];
|
|
93
|
+
// Cleared before routing, so the same file can be picked again even
|
|
94
|
+
// when a callback throws.
|
|
95
|
+
e.target.value = "";
|
|
96
|
+
if (picked && onSelectLogoFile) {
|
|
97
|
+
routeAvatarFile(picked, {
|
|
98
|
+
accept: logoAccept,
|
|
99
|
+
maxBytes: logoMaxBytes,
|
|
100
|
+
onSelectFile: onSelectLogoFile,
|
|
101
|
+
onReject: onRejectLogoFile,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
} })] })) : (_jsxs(_Fragment, { children: [tile, 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(BADGE, 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] })] }));
|
|
51
105
|
}
|
|
52
106
|
export { GridProfile };
|
|
53
107
|
//# sourceMappingURL=grid-profile.js.map
|