@hanzo/ui 8.0.87 → 8.0.88
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/box.cjs +4 -7
- package/dist/box.d.ts +3 -6
- package/dist/box.d.ts.map +1 -1
- package/dist/box.js +4 -7
- package/dist/box.js.map +1 -1
- package/dist/product/OrgSwitcher.cjs +12 -4
- package/dist/product/OrgSwitcher.d.ts +41 -3
- package/dist/product/OrgSwitcher.d.ts.map +1 -1
- package/dist/product/OrgSwitcher.js +12 -4
- package/dist/product/OrgSwitcher.js.map +1 -1
- package/dist/product/UserMenu.cjs +18 -4
- package/dist/product/UserMenu.d.ts +37 -4
- package/dist/product/UserMenu.d.ts.map +1 -1
- package/dist/product/UserMenu.js +19 -5
- package/dist/product/UserMenu.js.map +1 -1
- package/dist/styles.css +0 -1
- package/package.json +1 -1
package/dist/box.cjs
CHANGED
|
@@ -15,12 +15,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
15
15
|
* part-way through the move renders the same either way — the converted classes
|
|
16
16
|
* come from gui, the rest from whatever still serves them.
|
|
17
17
|
*
|
|
18
|
-
* A `<div>` is `display: block
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* 77 of 225 elements on one page into flex containers that were never asked to
|
|
22
|
-
* be: an inline run became a column, a heading's width collapsed to its text,
|
|
23
|
-
* and a page grew 8% taller.
|
|
18
|
+
* A `<div>` is `display: block` and a Stack is flex, which agree for a column
|
|
19
|
+
* of full-width children and disagree for inline content. Text belongs in a
|
|
20
|
+
* Text, and this is for the boxes around it.
|
|
24
21
|
*/
|
|
25
22
|
const react_1 = require("react");
|
|
26
23
|
const gui_1 = require("@hanzo/gui");
|
|
@@ -29,6 +26,6 @@ exports.Box = (0, react_1.forwardRef)(function Box({ className, children, ...res
|
|
|
29
26
|
const { props, rest: unread } = (0, tw_1.tw)(className);
|
|
30
27
|
// Explicit props win: a caller who states a value directly means it, and the
|
|
31
28
|
// classes are what they are migrating away from.
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { ref: ref,
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { ref: ref, ...props, ...rest, className: unread || undefined, children: children }));
|
|
33
30
|
});
|
|
34
31
|
exports.default = exports.Box;
|
package/dist/box.d.ts
CHANGED
|
@@ -10,12 +10,9 @@
|
|
|
10
10
|
* part-way through the move renders the same either way — the converted classes
|
|
11
11
|
* come from gui, the rest from whatever still serves them.
|
|
12
12
|
*
|
|
13
|
-
* A `<div>` is `display: block
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* 77 of 225 elements on one page into flex containers that were never asked to
|
|
17
|
-
* be: an inline run became a column, a heading's width collapsed to its text,
|
|
18
|
-
* and a page grew 8% taller.
|
|
13
|
+
* A `<div>` is `display: block` and a Stack is flex, which agree for a column
|
|
14
|
+
* of full-width children and disagree for inline content. Text belongs in a
|
|
15
|
+
* Text, and this is for the boxes around it.
|
|
19
16
|
*/
|
|
20
17
|
import { type ReactNode } from 'react';
|
|
21
18
|
import { YStack } from '@hanzo/gui';
|
package/dist/box.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../src/box.tsx"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../src/box.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAM,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAE1C,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IAC3D,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,GAAG,uGAYd,CAAA;AAEF,eAAe,GAAG,CAAA"}
|
package/dist/box.js
CHANGED
|
@@ -12,12 +12,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
12
12
|
* part-way through the move renders the same either way — the converted classes
|
|
13
13
|
* come from gui, the rest from whatever still serves them.
|
|
14
14
|
*
|
|
15
|
-
* A `<div>` is `display: block
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* 77 of 225 elements on one page into flex containers that were never asked to
|
|
19
|
-
* be: an inline run became a column, a heading's width collapsed to its text,
|
|
20
|
-
* and a page grew 8% taller.
|
|
15
|
+
* A `<div>` is `display: block` and a Stack is flex, which agree for a column
|
|
16
|
+
* of full-width children and disagree for inline content. Text belongs in a
|
|
17
|
+
* Text, and this is for the boxes around it.
|
|
21
18
|
*/
|
|
22
19
|
import { forwardRef } from 'react';
|
|
23
20
|
import { YStack } from '@hanzo/gui';
|
|
@@ -26,7 +23,7 @@ export const Box = forwardRef(function Box({ className, children, ...rest }, ref
|
|
|
26
23
|
const { props, rest: unread } = tw(className);
|
|
27
24
|
// Explicit props win: a caller who states a value directly means it, and the
|
|
28
25
|
// classes are what they are migrating away from.
|
|
29
|
-
return (_jsx(YStack, { ref: ref,
|
|
26
|
+
return (_jsx(YStack, { ref: ref, ...props, ...rest, className: unread || undefined, children: children }));
|
|
30
27
|
});
|
|
31
28
|
export default Box;
|
|
32
29
|
//# sourceMappingURL=box.js.map
|
package/dist/box.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box.js","sourceRoot":"","sources":["../src/box.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ
|
|
1
|
+
{"version":3,"file":"box.js","sourceRoot":"","sources":["../src/box.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,EAAE,EAAmB,MAAM,MAAM,CAAA;AAO1C,MAAM,CAAC,MAAM,GAAG,GAAG,UAAU,CAAgB,SAAS,GAAG,CACvD,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAChC,GAAG;IAEH,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;IAC7C,6EAA6E;IAC7E,iDAAiD;IACjD,OAAO,CACL,KAAC,MAAM,IAAC,GAAG,EAAE,GAAG,KAAO,KAAgB,KAAM,IAAI,EAAE,SAAS,EAAE,MAAM,IAAI,SAAS,YAC9E,QAAQ,GACF,CACV,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,GAAG,CAAA"}
|
|
@@ -24,7 +24,7 @@ const instrument_1 = require("./instrument.cjs");
|
|
|
24
24
|
const OrgMark_1 = require("./OrgMark.cjs");
|
|
25
25
|
const scope_1 = require("./scope.cjs");
|
|
26
26
|
const titleCase = (s) => (s ? s[0].toUpperCase() + s.slice(1) : s);
|
|
27
|
-
function OrgSwitcher({ scope, orgs, pageSize = 20, current: given, create, picker = false, direction = 'down', footer, }) {
|
|
27
|
+
function OrgSwitcher({ scope, orgs, pageSize = 20, current: given, create, picker = false, direction = 'down', footer, sub, aria, search, heading, testId, className, style, }) {
|
|
28
28
|
const currentId = scope.currentOrg();
|
|
29
29
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
30
30
|
const [query, setQuery] = (0, react_1.useState)('');
|
|
@@ -126,14 +126,22 @@ function OrgSwitcher({ scope, orgs, pageSize = 20, current: given, create, picke
|
|
|
126
126
|
setBusy(false);
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
|
-
return ((0, jsx_runtime_1.jsxs)(gui_1.Popover, { open: open, onOpenChange: setOpen, placement: direction === 'up' ? 'top-start' : 'bottom-start', children: [(0, jsx_runtime_1.jsx)(gui_1.Popover.Trigger, { asChild: true, children: (0, jsx_runtime_1.jsx)(gui_1.Button, { chromeless: true, height: 44, px: "$2", justify: "flex-start", "aria-label": `${currentLabel} · switch organization`, children: (0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$2.5", flex: 1, minW: 0, children: [(0, jsx_runtime_1.jsx)(OrgMark_1.OrgMark, { org: current, size: 30 }), (0, jsx_runtime_1.
|
|
129
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.Popover, { open: open, onOpenChange: setOpen, placement: direction === 'up' ? 'top-start' : 'bottom-start', children: [(0, jsx_runtime_1.jsx)(gui_1.Popover.Trigger, { asChild: true, children: (0, jsx_runtime_1.jsx)(gui_1.Button, { chromeless: true, height: 44, px: "$2", justify: "flex-start", "data-testid": testId, "aria-label": aria ?? `${currentLabel} · switch organization`, children: (0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$2.5", flex: 1, minW: 0, children: [(0, jsx_runtime_1.jsx)(OrgMark_1.OrgMark, { org: current, size: 30 }), (0, jsx_runtime_1.jsxs)(gui_1.YStack, { flex: 1, minW: 0, children: [(0, jsx_runtime_1.jsx)(gui_1.Text, { minW: 0, fontSize: "$4", fontWeight: "800", color: "$color12", numberOfLines: 1, children: currentLabel }), sub ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { minW: 0, fontSize: "$1", color: "$color10", numberOfLines: 1, children: sub })) : null] }), (0, jsx_runtime_1.jsx)(lucide_icons_2_1.ChevronsUpDown, { size: 16, color: "$color9" })] }) }) }), (0, jsx_runtime_1.jsx)(gui_1.Popover.Content, { role: "menu", bordered: true, elevate: true, px: "$1", py: "$1", width: 300, bg: "$color2", borderColor: "$borderColor", className: className, style: style, children: creating ? ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: "$2", children: [(0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$2", color: "$color12", fontWeight: "700", children: "Create organization" }), (0, jsx_runtime_1.jsx)(gui_1.Input, { size: "$3", placeholder: "Organization name", value: newName, onChangeText: setNewName, autoCapitalize: "words", onSubmitEditing: () => void submitCreate() }), err ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$1", color: "$red10", children: err })) : null, (0, jsx_runtime_1.jsxs)(gui_1.XStack, { gap: "$2", justify: "flex-end", children: [(0, jsx_runtime_1.jsx)(gui_1.Button, { size: "$2", chromeless: true, onPress: () => setCreating(false), disabled: busy, children: "Cancel" }), (0, jsx_runtime_1.jsx)(gui_1.Button, { size: "$2", onPress: () => void submitCreate(), disabled: busy || !newName.trim(), icon: busy ? (0, jsx_runtime_1.jsx)(gui_1.Spinner, { size: "small" }) : (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Plus, { size: 14 }), children: "Create" })] })] })) : ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: "$1", children: [heading ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { px: "$2", py: "$1", fontSize: "$1", color: "$color10", fontWeight: "500", children: heading })) : null, search ?? !!orgs ? ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$2", px: "$2", py: "$1", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [(0, jsx_runtime_1.jsx)(lucide_icons_2_1.Search, { size: 13, opacity: 0.6 }), (0, jsx_runtime_1.jsx)(gui_1.Input, { flex: 1, size: "$2", borderWidth: 0, bg: "transparent", placeholder: "Find an organization", "aria-label": "Find an organization", value: query, onChangeText: setQuery, autoCapitalize: "none", autoCorrect: false })] })) : null, (0, jsx_runtime_1.jsxs)("div", { style: { maxHeight: 300, overflowY: 'auto', display: 'flex', flexDirection: 'column' }, onScroll: (e) => {
|
|
130
130
|
const el = e.currentTarget;
|
|
131
131
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48)
|
|
132
132
|
loadMore();
|
|
133
|
-
}, children: [loading ? ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$2", px: "$2", py: "$3", children: [(0, jsx_runtime_1.jsx)(gui_1.Spinner, { size: "small", color: "$color11" }), (0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$2", color: "$color10", children: "Loading organizations\u2026" })] })) : visible.length === 0 ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { px: "$2", py: "$2", fontSize: "$2", color: "$color10", children: query.trim() ? `No organizations match “${query.trim()}”.` : 'No organizations yet.' })) : (
|
|
133
|
+
}, children: [loading ? ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$2", px: "$2", py: "$3", children: [(0, jsx_runtime_1.jsx)(gui_1.Spinner, { size: "small", color: "$color11" }), (0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$2", color: "$color10", children: "Loading organizations\u2026" })] })) : visible.length === 0 ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { px: "$2", py: "$2", fontSize: "$2", color: "$color10", children: query.trim() ? `No organizations match “${query.trim()}”.` : 'No organizations yet.' })) : (
|
|
134
|
+
// A set of organizations exactly one of which holds is a
|
|
135
|
+
// `radiogroup` of `radio`s — not a bag of divs, which is what
|
|
136
|
+
// assistive tech was being handed. `radio` rather than the more
|
|
137
|
+
// obvious `option` because @hanzo/gui's `role` union is React
|
|
138
|
+
// Native's accessibility-role set: it admits `option` but NOT
|
|
139
|
+
// `listbox`, so an `option` here could never be given the parent
|
|
140
|
+
// ARIA requires.
|
|
141
|
+
(0, jsx_runtime_1.jsx)(gui_1.YStack, { role: "radiogroup", "aria-label": "Organizations", gap: "$1", children: visible.map((org) => ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { onPress: () => select(org.name), role: "radio", "aria-checked": org.name === currentId, cursor: "pointer", items: "center", gap: "$2.5", px: "$2", py: "$2", rounded: "$3", bg: org.name === currentId ? '$color4' : 'transparent', hoverStyle: { bg: '$color5' }, children: [(0, jsx_runtime_1.jsx)(OrgMark_1.OrgMark, { org: org }), (0, jsx_runtime_1.jsx)(gui_1.Text, { flex: 1, fontSize: "$2", color: "$color12", numberOfLines: 1, children: org.displayName || org.name }), org.name === currentId ? (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Check, { size: 16 }) : null] }, org.name))) })), loadingMore ? ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$2", px: "$2", py: "$2", children: [(0, jsx_runtime_1.jsx)(gui_1.Spinner, { size: "small", color: "$color11" }), (0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$1", color: "$color10", children: "Loading more\u2026" })] })) : hasMore ? ((0, jsx_runtime_1.jsx)(gui_1.XStack, { onPress: loadMore, cursor: "pointer", items: "center", justify: "center", px: "$2", py: "$1.5", rounded: "$3", hoverStyle: { bg: '$color4' }, children: (0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$1", color: "$color11", fontWeight: "600", children: "Load more" }) })) : null] }), typeof footer === 'function' ? footer(() => setOpen(false)) : footer, create ? ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { role: "menuitem", onPress: () => {
|
|
134
142
|
setCreating(true);
|
|
135
143
|
setErr(null);
|
|
136
|
-
}, cursor: "pointer", items: "center", gap: "$2.5", px: "$2", py: "$2", mt: "$1", rounded: "$3", borderTopWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: '$color5' }, children: [(0, jsx_runtime_1.jsx)(gui_1.YStack, { width: 22, height: 22, rounded: "$3", bg: "$color3", items: "center", justify: "center", children: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Plus, { size: 14 }) }), (0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$2", color: "$color12", children: "Create organization" })] })) : null, picker ? ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { onPress: () => {
|
|
144
|
+
}, cursor: "pointer", items: "center", gap: "$2.5", px: "$2", py: "$2", mt: "$1", rounded: "$3", borderTopWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: '$color5' }, children: [(0, jsx_runtime_1.jsx)(gui_1.YStack, { width: 22, height: 22, rounded: "$3", bg: "$color3", items: "center", justify: "center", children: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Plus, { size: 14 }) }), (0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$2", color: "$color12", children: "Create organization" })] })) : null, picker ? ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { role: "menuitem", onPress: () => {
|
|
137
145
|
setOpen(false);
|
|
138
146
|
scope.leaveOrg();
|
|
139
147
|
}, cursor: "pointer", items: "center", gap: "$2.5", px: "$2", py: "$2", rounded: "$3", hoverStyle: { bg: '$color5' }, children: [(0, jsx_runtime_1.jsx)(gui_1.YStack, { width: 22, height: 22, rounded: "$3", bg: "$color3", items: "center", justify: "center", children: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.LayoutGrid, { size: 14 }) }), (0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$2", color: "$color12", children: "All organizations" })] })) : null] })) })] }));
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* `X-Org-Id`). Create posts through the injected hook, then scopes into the
|
|
13
13
|
* new org.
|
|
14
14
|
*/
|
|
15
|
-
import { type ReactNode } from 'react';
|
|
15
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
16
16
|
import { type Org, type OrgScope } from './scope.js';
|
|
17
17
|
export type OrgSwitcherProps = {
|
|
18
18
|
/** The active-org contract (see `orgScope`). */
|
|
@@ -47,8 +47,46 @@ export type OrgSwitcherProps = {
|
|
|
47
47
|
* Rows below the list, above the create/de-scope affordances — the surface's
|
|
48
48
|
* own additions (a personal-workspace badge, a link into org settings). The
|
|
49
49
|
* other half of what hanzo.app's local copy existed for.
|
|
50
|
+
*
|
|
51
|
+
* Given a function it receives `close`, so a row that acts IN PLACE — picking
|
|
52
|
+
* a project rather than navigating away — can dismiss the sheet it was chosen
|
|
53
|
+
* from. A row that navigates does not need it; a row that does not, does.
|
|
50
54
|
*/
|
|
51
|
-
footer?: ReactNode;
|
|
55
|
+
footer?: ReactNode | ((close: () => void) => ReactNode);
|
|
56
|
+
/**
|
|
57
|
+
* The second line of the trigger, when the caller scopes below the org — a
|
|
58
|
+
* project, an environment. The console kept a whole local copy of this
|
|
59
|
+
* component because its trigger has to say "Org / project" and this one could
|
|
60
|
+
* only say the org; a caller that scopes deeper has to be able to name where
|
|
61
|
+
* it is, or it grows a second control beside this one saying the other half.
|
|
62
|
+
*/
|
|
63
|
+
sub?: string;
|
|
64
|
+
/**
|
|
65
|
+
* The accessible name, when the control does more than switch organization
|
|
66
|
+
* (a caller passing `sub` is also switching what `sub` names). Defaults to
|
|
67
|
+
* "<org> · switch organization".
|
|
68
|
+
*/
|
|
69
|
+
aria?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Whether the list can be searched. Defaults to "whenever there is a loader",
|
|
72
|
+
* because a loader is what makes a list longer than the rows on screen.
|
|
73
|
+
*
|
|
74
|
+
* It is separate from the loader because the two answer different questions —
|
|
75
|
+
* whether a list can be FETCHED, and whether searching it can change the
|
|
76
|
+
* answer. The console fetches for everyone and offers the field only to a
|
|
77
|
+
* platform admin, whose list is cross-tenant, server-paged and far longer than
|
|
78
|
+
* one page; a customer has one org, and a field promising a list that does not
|
|
79
|
+
* exist is worse than no field.
|
|
80
|
+
*/
|
|
81
|
+
search?: boolean;
|
|
82
|
+
/** What to call the list, for a sheet that answers more than one question. */
|
|
83
|
+
heading?: string;
|
|
84
|
+
/** `data-testid` on the trigger. */
|
|
85
|
+
testId?: string;
|
|
86
|
+
/** Classes for the sheet — the host's own material (glass, elevation). */
|
|
87
|
+
className?: string;
|
|
88
|
+
/** Inline style for the sheet — a host's stacking layer belongs here. */
|
|
89
|
+
style?: CSSProperties;
|
|
52
90
|
};
|
|
53
|
-
export declare function OrgSwitcher({ scope, orgs, pageSize, current: given, create, picker, direction, footer, }: OrgSwitcherProps): import("react/jsx-runtime").JSX.Element;
|
|
91
|
+
export declare function OrgSwitcher({ scope, orgs, pageSize, current: given, create, picker, direction, footer, sub, aria, search, heading, testId, className, style, }: OrgSwitcherProps): import("react/jsx-runtime").JSX.Element;
|
|
54
92
|
//# sourceMappingURL=OrgSwitcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrgSwitcher.d.ts","sourceRoot":"","sources":["../../src/product/OrgSwitcher.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAqD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"OrgSwitcher.d.ts","sourceRoot":"","sources":["../../src/product/OrgSwitcher.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAqD,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAM7G,OAAO,EAAc,KAAK,GAAG,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAA;AAI7D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,gDAAgD;IAChD,KAAK,EAAE,QAAQ,CAAA;IACf;;;;OAIG;IACH,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;IACtD,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,GAAG,CAAA;IACb,2EAA2E;IAC3E,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAC1C,oEAAoE;IACpE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC,CAAA;IACvD;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,yEAAyE;IACzE,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,CAAA;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,IAAI,EACJ,QAAa,EACb,OAAO,EAAE,KAAK,EACd,MAAM,EACN,MAAc,EACd,SAAkB,EAClB,MAAM,EACN,GAAG,EACH,IAAI,EACJ,MAAM,EACN,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,gBAAgB,2CAmVlB"}
|
|
@@ -21,7 +21,7 @@ import { useEmit } from './instrument.js';
|
|
|
21
21
|
import { OrgMark } from './OrgMark.js';
|
|
22
22
|
import { filterOrgs } from './scope.js';
|
|
23
23
|
const titleCase = (s) => (s ? s[0].toUpperCase() + s.slice(1) : s);
|
|
24
|
-
export function OrgSwitcher({ scope, orgs, pageSize = 20, current: given, create, picker = false, direction = 'down', footer, }) {
|
|
24
|
+
export function OrgSwitcher({ scope, orgs, pageSize = 20, current: given, create, picker = false, direction = 'down', footer, sub, aria, search, heading, testId, className, style, }) {
|
|
25
25
|
const currentId = scope.currentOrg();
|
|
26
26
|
const [open, setOpen] = useState(false);
|
|
27
27
|
const [query, setQuery] = useState('');
|
|
@@ -123,14 +123,22 @@ export function OrgSwitcher({ scope, orgs, pageSize = 20, current: given, create
|
|
|
123
123
|
setBusy(false);
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, placement: direction === 'up' ? 'top-start' : 'bottom-start', children: [_jsx(Popover.Trigger, { asChild: true, children: _jsx(Button, { chromeless: true, height: 44, px: "$2", justify: "flex-start", "aria-label": `${currentLabel} · switch organization`, children: _jsxs(XStack, { items: "center", gap: "$2.5", flex: 1, minW: 0, children: [_jsx(OrgMark, { org: current, size: 30 }),
|
|
126
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, placement: direction === 'up' ? 'top-start' : 'bottom-start', children: [_jsx(Popover.Trigger, { asChild: true, children: _jsx(Button, { chromeless: true, height: 44, px: "$2", justify: "flex-start", "data-testid": testId, "aria-label": aria ?? `${currentLabel} · switch organization`, children: _jsxs(XStack, { items: "center", gap: "$2.5", flex: 1, minW: 0, children: [_jsx(OrgMark, { org: current, size: 30 }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { minW: 0, fontSize: "$4", fontWeight: "800", color: "$color12", numberOfLines: 1, children: currentLabel }), sub ? (_jsx(Text, { minW: 0, fontSize: "$1", color: "$color10", numberOfLines: 1, children: sub })) : null] }), _jsx(ChevronsUpDown, { size: 16, color: "$color9" })] }) }) }), _jsx(Popover.Content, { role: "menu", bordered: true, elevate: true, px: "$1", py: "$1", width: 300, bg: "$color2", borderColor: "$borderColor", className: className, style: style, children: creating ? (_jsxs(YStack, { gap: "$2", children: [_jsx(Text, { fontSize: "$2", color: "$color12", fontWeight: "700", children: "Create organization" }), _jsx(Input, { size: "$3", placeholder: "Organization name", value: newName, onChangeText: setNewName, autoCapitalize: "words", onSubmitEditing: () => void submitCreate() }), err ? (_jsx(Text, { fontSize: "$1", color: "$red10", children: err })) : null, _jsxs(XStack, { gap: "$2", justify: "flex-end", children: [_jsx(Button, { size: "$2", chromeless: true, onPress: () => setCreating(false), disabled: busy, children: "Cancel" }), _jsx(Button, { size: "$2", onPress: () => void submitCreate(), disabled: busy || !newName.trim(), icon: busy ? _jsx(Spinner, { size: "small" }) : _jsx(Plus, { size: 14 }), children: "Create" })] })] })) : (_jsxs(YStack, { gap: "$1", children: [heading ? (_jsx(Text, { px: "$2", py: "$1", fontSize: "$1", color: "$color10", fontWeight: "500", children: heading })) : null, search ?? !!orgs ? (_jsxs(XStack, { items: "center", gap: "$2", px: "$2", py: "$1", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [_jsx(Search, { size: 13, opacity: 0.6 }), _jsx(Input, { flex: 1, size: "$2", borderWidth: 0, bg: "transparent", placeholder: "Find an organization", "aria-label": "Find an organization", value: query, onChangeText: setQuery, autoCapitalize: "none", autoCorrect: false })] })) : null, _jsxs("div", { style: { maxHeight: 300, overflowY: 'auto', display: 'flex', flexDirection: 'column' }, onScroll: (e) => {
|
|
127
127
|
const el = e.currentTarget;
|
|
128
128
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48)
|
|
129
129
|
loadMore();
|
|
130
|
-
}, children: [loading ? (_jsxs(XStack, { items: "center", gap: "$2", px: "$2", py: "$3", children: [_jsx(Spinner, { size: "small", color: "$color11" }), _jsx(Text, { fontSize: "$2", color: "$color10", children: "Loading organizations\u2026" })] })) : visible.length === 0 ? (_jsx(Text, { px: "$2", py: "$2", fontSize: "$2", color: "$color10", children: query.trim() ? `No organizations match “${query.trim()}”.` : 'No organizations yet.' })) : (
|
|
130
|
+
}, children: [loading ? (_jsxs(XStack, { items: "center", gap: "$2", px: "$2", py: "$3", children: [_jsx(Spinner, { size: "small", color: "$color11" }), _jsx(Text, { fontSize: "$2", color: "$color10", children: "Loading organizations\u2026" })] })) : visible.length === 0 ? (_jsx(Text, { px: "$2", py: "$2", fontSize: "$2", color: "$color10", children: query.trim() ? `No organizations match “${query.trim()}”.` : 'No organizations yet.' })) : (
|
|
131
|
+
// A set of organizations exactly one of which holds is a
|
|
132
|
+
// `radiogroup` of `radio`s — not a bag of divs, which is what
|
|
133
|
+
// assistive tech was being handed. `radio` rather than the more
|
|
134
|
+
// obvious `option` because @hanzo/gui's `role` union is React
|
|
135
|
+
// Native's accessibility-role set: it admits `option` but NOT
|
|
136
|
+
// `listbox`, so an `option` here could never be given the parent
|
|
137
|
+
// ARIA requires.
|
|
138
|
+
_jsx(YStack, { role: "radiogroup", "aria-label": "Organizations", gap: "$1", children: visible.map((org) => (_jsxs(XStack, { onPress: () => select(org.name), role: "radio", "aria-checked": org.name === currentId, cursor: "pointer", items: "center", gap: "$2.5", px: "$2", py: "$2", rounded: "$3", bg: org.name === currentId ? '$color4' : 'transparent', hoverStyle: { bg: '$color5' }, children: [_jsx(OrgMark, { org: org }), _jsx(Text, { flex: 1, fontSize: "$2", color: "$color12", numberOfLines: 1, children: org.displayName || org.name }), org.name === currentId ? _jsx(Check, { size: 16 }) : null] }, org.name))) })), loadingMore ? (_jsxs(XStack, { items: "center", gap: "$2", px: "$2", py: "$2", children: [_jsx(Spinner, { size: "small", color: "$color11" }), _jsx(Text, { fontSize: "$1", color: "$color10", children: "Loading more\u2026" })] })) : hasMore ? (_jsx(XStack, { onPress: loadMore, cursor: "pointer", items: "center", justify: "center", px: "$2", py: "$1.5", rounded: "$3", hoverStyle: { bg: '$color4' }, children: _jsx(Text, { fontSize: "$1", color: "$color11", fontWeight: "600", children: "Load more" }) })) : null] }), typeof footer === 'function' ? footer(() => setOpen(false)) : footer, create ? (_jsxs(XStack, { role: "menuitem", onPress: () => {
|
|
131
139
|
setCreating(true);
|
|
132
140
|
setErr(null);
|
|
133
|
-
}, cursor: "pointer", items: "center", gap: "$2.5", px: "$2", py: "$2", mt: "$1", rounded: "$3", borderTopWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: '$color5' }, children: [_jsx(YStack, { width: 22, height: 22, rounded: "$3", bg: "$color3", items: "center", justify: "center", children: _jsx(Plus, { size: 14 }) }), _jsx(Text, { fontSize: "$2", color: "$color12", children: "Create organization" })] })) : null, picker ? (_jsxs(XStack, { onPress: () => {
|
|
141
|
+
}, cursor: "pointer", items: "center", gap: "$2.5", px: "$2", py: "$2", mt: "$1", rounded: "$3", borderTopWidth: 1, borderColor: "$borderColor", hoverStyle: { bg: '$color5' }, children: [_jsx(YStack, { width: 22, height: 22, rounded: "$3", bg: "$color3", items: "center", justify: "center", children: _jsx(Plus, { size: 14 }) }), _jsx(Text, { fontSize: "$2", color: "$color12", children: "Create organization" })] })) : null, picker ? (_jsxs(XStack, { role: "menuitem", onPress: () => {
|
|
134
142
|
setOpen(false);
|
|
135
143
|
scope.leaveOrg();
|
|
136
144
|
}, cursor: "pointer", items: "center", gap: "$2.5", px: "$2", py: "$2", rounded: "$3", hoverStyle: { bg: '$color5' }, children: [_jsx(YStack, { width: 22, height: 22, rounded: "$3", bg: "$color3", items: "center", justify: "center", children: _jsx(LayoutGrid, { size: 14 }) }), _jsx(Text, { fontSize: "$2", color: "$color12", children: "All organizations" })] })) : null] })) })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrgSwitcher.js","sourceRoot":"","sources":["../../src/product/OrgSwitcher.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AACzF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAClF,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAE1F,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,UAAU,EAA2B,MAAM,SAAS,CAAA;AAE7D,MAAM,SAAS,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAuC1E,MAAM,UAAU,WAAW,CAAC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EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAC,IAAI,EAAC,EAAE,EAAC,SAAS,EAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,YACtF,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,GAAI,GACX,EACT,KAAC,IAAI,IAAC,QAAQ,EAAC,IAAI,EAAC,KAAK,EAAC,UAAU,oCAE7B,IACA,CACV,CAAC,CAAC,CAAC,IAAI,EAEP,MAAM,CAAC,CAAC,CAAC,CACR,MAAC,MAAM,IACL,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,GAAG,EAAE;gCACZ,OAAO,CAAC,KAAK,CAAC,CAAA;gCACd,KAAK,CAAC,QAAQ,EAAE,CAAA;4BAClB,CAAC,EACD,MAAM,EAAC,SAAS,EAChB,KAAK,EAAC,QAAQ,EACd,GAAG,EAAC,MAAM,EACV,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,OAAO,EAAC,IAAI,EACZ,UAAU,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,aAE7B,KAAC,MAAM,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAC,IAAI,EAAC,EAAE,EAAC,SAAS,EAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,YACtF,KAAC,UAAU,IAAC,IAAI,EAAE,EAAE,GAAI,GACjB,EACT,KAAC,IAAI,IAAC,QAAQ,EAAC,IAAI,EAAC,KAAK,EAAC,UAAU,kCAE7B,IACA,CACV,CAAC,CAAC,CAAC,IAAI,IACD,CACV,GACe,IACV,CACX,CAAA;AACH,CAAC"}
|
|
@@ -31,24 +31,38 @@ const name_1 = require("./name.cjs");
|
|
|
31
31
|
Object.defineProperty(exports, "displayName", { enumerable: true, get: function () { return name_1.displayName; } });
|
|
32
32
|
const OrgMark_1 = require("./OrgMark.cjs");
|
|
33
33
|
const ThemeToggle_1 = require("./ThemeToggle.cjs");
|
|
34
|
+
const itemsOf = (g) => (Array.isArray(g) ? g : g.items);
|
|
35
|
+
const nameOf = (g) => (Array.isArray(g) ? undefined : g.label);
|
|
34
36
|
function Row({ item, onDone }) {
|
|
35
37
|
const track = (0, instrument_1.useEmit)();
|
|
38
|
+
// A row that can be CURRENT is one of a set exactly one of which holds; a row
|
|
39
|
+
// without the notion is an action. One fact — `active` — decides the role, so
|
|
40
|
+
// no call site has to say it twice.
|
|
41
|
+
const choice = item.active !== undefined;
|
|
36
42
|
return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { onPress: () => {
|
|
37
43
|
track({ component: 'UserMenu', action: 'select', id: item.id });
|
|
38
44
|
onDone();
|
|
39
45
|
item.onPress();
|
|
40
|
-
}, cursor: "pointer", items: "center", gap: "$2.5", px: "$2", py: "$2", rounded: "$3", hoverStyle: { bg: '$color5' }, children: [item.icon, (0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$2", color: item.danger ? '$red10' : '$color12', children: item.label })] }));
|
|
46
|
+
}, role: choice ? 'radio' : 'menuitem', "aria-checked": choice ? !!item.active : undefined, cursor: "pointer", items: "center", gap: "$2.5", px: "$2", py: "$2", rounded: "$3", hoverStyle: { bg: '$color5' }, children: [item.icon, (0, jsx_runtime_1.jsx)(gui_1.Text, { flex: 1, fontSize: "$2", color: item.danger ? '$red10' : '$color12', children: item.label }), item.active ? (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Check, { size: 14 }) : null] }));
|
|
41
47
|
}
|
|
42
|
-
function UserMenu({ name, email, avatar, groups = [], theme, onSignOut, signOutLabel = 'Sign out', children, label = true, height = 44, }) {
|
|
48
|
+
function UserMenu({ name, email, avatar, groups = [], theme, onSignOut, signOutLabel = 'Sign out', children, label = true, height = 44, direction = 'down', align = 'end', aria, testId, className, style, }) {
|
|
43
49
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
44
50
|
const track = (0, instrument_1.useEmit)();
|
|
45
51
|
const shown = (0, name_1.displayName)(name, email);
|
|
46
|
-
const filled = groups.filter((g) => g.length > 0);
|
|
52
|
+
const filled = groups.filter((g) => itemsOf(g).length > 0);
|
|
47
53
|
const close = () => setOpen(false);
|
|
48
54
|
return ((0, jsx_runtime_1.jsxs)(gui_1.Popover, { open: open, onOpenChange: (next) => {
|
|
49
55
|
track({ component: 'UserMenu', action: next ? 'open' : 'close' });
|
|
50
56
|
setOpen(next);
|
|
51
|
-
}, placement:
|
|
57
|
+
}, placement: `${direction === 'up' ? 'top' : 'bottom'}-${align}`, children: [(0, jsx_runtime_1.jsx)(gui_1.Popover.Trigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)(gui_1.XStack, { cursor: "pointer", items: "center", gap: "$2.5", height: height, px: "$2", rounded: "$3", minW: 0, hoverStyle: { bg: '$color4' }, role: "button", tabIndex: 0, "data-testid": testId, "aria-label": aria ?? (shown ? `${shown} · account` : 'Account'), children: [avatar || shown ? ((0, jsx_runtime_1.jsx)(OrgMark_1.OrgMark, { org: { name: shown || 'Account', logo: avatar }, size: 30 })) : ((0, jsx_runtime_1.jsx)(lucide_icons_2_1.UserRound, { size: 18 })), label && shown ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$3", fontWeight: "600", color: "$color12", numberOfLines: 1, maxW: 160, children: shown })) : null, label && shown ? (0, jsx_runtime_1.jsx)(lucide_icons_2_1.ChevronsUpDown, { size: 16, color: "$color9" }) : null] }) }), (0, jsx_runtime_1.jsx)(gui_1.Popover.Content, { role: "menu", bordered: true, elevate: true, px: "$1", py: "$1", width: 240, bg: "$color2", borderColor: "$borderColor", className: className, style: style, children: children ?? ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: "$1", children: [shown || email ? ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: "$0.5", px: "$2", py: "$1.5", children: [shown ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$2", fontWeight: "700", color: "$color12", numberOfLines: 1, children: shown })) : null, email && email !== shown ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$1", color: "$color10", numberOfLines: 1, children: email })) : null] })) : null, filled.map((group, i) => {
|
|
58
|
+
const items = itemsOf(group);
|
|
59
|
+
const groupName = nameOf(group);
|
|
60
|
+
// A group whose every row carries a chosen-one is a CHOICE, so it
|
|
61
|
+
// is a radiogroup — a heading alone would leave the rows unrelated.
|
|
62
|
+
const choice = items.every((it) => it.active !== undefined);
|
|
63
|
+
const rows = items.map((item) => (0, jsx_runtime_1.jsx)(Row, { item: item, onDone: close }, item.id));
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: "$1", children: [i > 0 || shown || email ? (0, jsx_runtime_1.jsx)(gui_1.Separator, { borderColor: "$borderColor", my: "$1" }) : null, groupName ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { px: "$2", py: "$1", fontSize: "$1", color: "$color10", fontWeight: "500", children: groupName })) : null, choice ? ((0, jsx_runtime_1.jsx)(gui_1.YStack, { role: "radiogroup", "aria-label": groupName, gap: "$1", children: rows })) : (rows)] }, i));
|
|
65
|
+
}), theme !== null ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(gui_1.Separator, { borderColor: "$borderColor", my: "$1" }), (0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$2.5", px: "$2", py: "$1", rounded: "$3", children: [(0, jsx_runtime_1.jsx)(gui_1.Text, { flex: 1, fontSize: "$2", color: "$color12", children: "Theme" }), theme ?? (0, jsx_runtime_1.jsx)(ThemeToggle_1.ThemeToggle, {})] })] })) : null, onSignOut ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(gui_1.Separator, { borderColor: "$borderColor", my: "$1" }), (0, jsx_runtime_1.jsx)(Row, { item: {
|
|
52
66
|
id: 'sign-out',
|
|
53
67
|
label: signOutLabel,
|
|
54
68
|
icon: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.LogOut, { size: 16 }),
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* same type — so "which workspace" and "who I am" read as two halves of one
|
|
18
18
|
* identity rather than a caption over a control.
|
|
19
19
|
*/
|
|
20
|
-
import { type ReactNode } from 'react';
|
|
20
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
21
21
|
import { displayName } from './name.js';
|
|
22
22
|
/** One row. `id` names it in analytics; the label is what the person reads. */
|
|
23
23
|
export type UserMenuItem = {
|
|
@@ -27,6 +27,18 @@ export type UserMenuItem = {
|
|
|
27
27
|
onPress: () => void;
|
|
28
28
|
/** Draws the row in the destructive tone (sign out, delete account). */
|
|
29
29
|
danger?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether this row is the chosen one — for a group that is a CHOICE rather
|
|
32
|
+
* than a list of actions (which theme, which language). Its presence makes the
|
|
33
|
+
* group a `radiogroup` and the row a `radio`, so assistive tech is told that
|
|
34
|
+
* exactly one of them holds, and the chosen row carries a check.
|
|
35
|
+
*/
|
|
36
|
+
active?: boolean;
|
|
37
|
+
};
|
|
38
|
+
/** A group of rows, optionally named. A bare array is the unnamed form. */
|
|
39
|
+
export type UserMenuGroup = UserMenuItem[] | {
|
|
40
|
+
label?: string;
|
|
41
|
+
items: UserMenuItem[];
|
|
30
42
|
};
|
|
31
43
|
export type UserMenuProps = {
|
|
32
44
|
/** The signed-in person's display name. Falls back to the email's local part. */
|
|
@@ -34,8 +46,9 @@ export type UserMenuProps = {
|
|
|
34
46
|
email?: string;
|
|
35
47
|
/** Avatar URL. Absent → the monogram of the name, like an org's mark. */
|
|
36
48
|
avatar?: string;
|
|
37
|
-
/** Grouped rows — each group is separated by a rule, empty groups are dropped.
|
|
38
|
-
|
|
49
|
+
/** Grouped rows — each group is separated by a rule, empty groups are dropped.
|
|
50
|
+
* A group may be named, and a named group of `active` rows is a choice. */
|
|
51
|
+
groups?: UserMenuGroup[];
|
|
39
52
|
/** Theme row content — default `<ThemeToggle/>`; `null` hides the row (a
|
|
40
53
|
* single-theme surface has nothing to toggle and should not pretend to). */
|
|
41
54
|
theme?: ReactNode;
|
|
@@ -49,7 +62,27 @@ export type UserMenuProps = {
|
|
|
49
62
|
label?: boolean;
|
|
50
63
|
/** Trigger height. Default 44 — the peer of `OrgSwitcher`. */
|
|
51
64
|
height?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Which way the panel opens, and from which edge. A user menu in a top bar
|
|
67
|
+
* opens down from its right edge; the same control at the FOOT of a sidebar
|
|
68
|
+
* has to open upward from its left, and a downward panel there falls off the
|
|
69
|
+
* bottom of the viewport. This was hard-coded `bottom-end`, which is why the
|
|
70
|
+
* console could not mount this component in its rail and kept a local copy of
|
|
71
|
+
* the whole thing — the peer of `OrgSwitcher.direction`, which already had it.
|
|
72
|
+
*/
|
|
73
|
+
direction?: 'down' | 'up';
|
|
74
|
+
/** Which edge the panel aligns to. Default `end` (a top-bar avatar); `start`
|
|
75
|
+
* for a rail, where the panel should share the trigger's left edge. */
|
|
76
|
+
align?: 'start' | 'end';
|
|
77
|
+
/** The trigger's accessible name. Defaults to "<name> · account". */
|
|
78
|
+
aria?: string;
|
|
79
|
+
/** `data-testid` on the trigger. */
|
|
80
|
+
testId?: string;
|
|
81
|
+
/** Classes for the sheet — the host's own material (glass, elevation). */
|
|
82
|
+
className?: string;
|
|
83
|
+
/** Inline style for the sheet — a host's stacking layer belongs here. */
|
|
84
|
+
style?: CSSProperties;
|
|
52
85
|
};
|
|
53
86
|
export { displayName };
|
|
54
|
-
export declare function UserMenu({ name, email, avatar, groups, theme, onSignOut, signOutLabel, children, label, height, }: UserMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
export declare function UserMenu({ name, email, avatar, groups, theme, onSignOut, signOutLabel, children, label, height, direction, align, aria, testId, className, style, }: UserMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
55
88
|
//# sourceMappingURL=UserMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../src/product/UserMenu.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../src/product/UserMenu.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAY,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAKpE,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAIpC,+EAA+E;AAC/E,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,wEAAwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,2EAA2E;AAC3E,MAAM,MAAM,aAAa,GAAG,YAAY,EAAE,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,YAAY,EAAE,CAAA;CAAE,CAAA;AAKtF,MAAM,MAAM,aAAa,GAAG;IAC1B,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;gFAC4E;IAC5E,MAAM,CAAC,EAAE,aAAa,EAAE,CAAA;IACxB;iFAC6E;IAC7E,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,oEAAoE;IACpE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,8DAA8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB;4EACwE;IACxE,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IACvB,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,yEAAyE;IACzE,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,CAAA;AAqCD,OAAO,EAAE,WAAW,EAAE,CAAA;AAEtB,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,KAAK,EACL,MAAM,EACN,MAAW,EACX,KAAK,EACL,SAAS,EACT,YAAyB,EACzB,QAAQ,EACR,KAAY,EACZ,MAAW,EACX,SAAkB,EAClB,KAAa,EACb,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,aAAa,2CA4If"}
|
package/dist/product/UserMenu.js
CHANGED
|
@@ -21,33 +21,47 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
21
21
|
*/
|
|
22
22
|
import { useState } from 'react';
|
|
23
23
|
import { Popover, Separator, Text, XStack, YStack } from '@hanzo/gui';
|
|
24
|
-
import { LogOut, UserRound } from '@hanzogui/lucide-icons-2';
|
|
24
|
+
import { Check, ChevronsUpDown, LogOut, UserRound } from '@hanzogui/lucide-icons-2';
|
|
25
25
|
import { useEmit } from './instrument.js';
|
|
26
26
|
import { displayName } from './name.js';
|
|
27
27
|
import { OrgMark } from './OrgMark.js';
|
|
28
28
|
import { ThemeToggle } from './ThemeToggle.js';
|
|
29
|
+
const itemsOf = (g) => (Array.isArray(g) ? g : g.items);
|
|
30
|
+
const nameOf = (g) => (Array.isArray(g) ? undefined : g.label);
|
|
29
31
|
function Row({ item, onDone }) {
|
|
30
32
|
const track = useEmit();
|
|
33
|
+
// A row that can be CURRENT is one of a set exactly one of which holds; a row
|
|
34
|
+
// without the notion is an action. One fact — `active` — decides the role, so
|
|
35
|
+
// no call site has to say it twice.
|
|
36
|
+
const choice = item.active !== undefined;
|
|
31
37
|
return (_jsxs(XStack, { onPress: () => {
|
|
32
38
|
track({ component: 'UserMenu', action: 'select', id: item.id });
|
|
33
39
|
onDone();
|
|
34
40
|
item.onPress();
|
|
35
|
-
}, cursor: "pointer", items: "center", gap: "$2.5", px: "$2", py: "$2", rounded: "$3", hoverStyle: { bg: '$color5' }, children: [item.icon, _jsx(Text, { fontSize: "$2", color: item.danger ? '$red10' : '$color12', children: item.label })] }));
|
|
41
|
+
}, role: choice ? 'radio' : 'menuitem', "aria-checked": choice ? !!item.active : undefined, cursor: "pointer", items: "center", gap: "$2.5", px: "$2", py: "$2", rounded: "$3", hoverStyle: { bg: '$color5' }, children: [item.icon, _jsx(Text, { flex: 1, fontSize: "$2", color: item.danger ? '$red10' : '$color12', children: item.label }), item.active ? _jsx(Check, { size: 14 }) : null] }));
|
|
36
42
|
}
|
|
37
43
|
// The name to show is a rule over two strings, so it lives in `./name` and is
|
|
38
44
|
// reachable without a gui runtime via `@hanzo/ui/product/pure`. Re-exported
|
|
39
45
|
// here because it was published from this module.
|
|
40
46
|
export { displayName };
|
|
41
|
-
export function UserMenu({ name, email, avatar, groups = [], theme, onSignOut, signOutLabel = 'Sign out', children, label = true, height = 44, }) {
|
|
47
|
+
export function UserMenu({ name, email, avatar, groups = [], theme, onSignOut, signOutLabel = 'Sign out', children, label = true, height = 44, direction = 'down', align = 'end', aria, testId, className, style, }) {
|
|
42
48
|
const [open, setOpen] = useState(false);
|
|
43
49
|
const track = useEmit();
|
|
44
50
|
const shown = displayName(name, email);
|
|
45
|
-
const filled = groups.filter((g) => g.length > 0);
|
|
51
|
+
const filled = groups.filter((g) => itemsOf(g).length > 0);
|
|
46
52
|
const close = () => setOpen(false);
|
|
47
53
|
return (_jsxs(Popover, { open: open, onOpenChange: (next) => {
|
|
48
54
|
track({ component: 'UserMenu', action: next ? 'open' : 'close' });
|
|
49
55
|
setOpen(next);
|
|
50
|
-
}, placement:
|
|
56
|
+
}, placement: `${direction === 'up' ? 'top' : 'bottom'}-${align}`, children: [_jsx(Popover.Trigger, { asChild: true, children: _jsxs(XStack, { cursor: "pointer", items: "center", gap: "$2.5", height: height, px: "$2", rounded: "$3", minW: 0, hoverStyle: { bg: '$color4' }, role: "button", tabIndex: 0, "data-testid": testId, "aria-label": aria ?? (shown ? `${shown} · account` : 'Account'), children: [avatar || shown ? (_jsx(OrgMark, { org: { name: shown || 'Account', logo: avatar }, size: 30 })) : (_jsx(UserRound, { size: 18 })), label && shown ? (_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$color12", numberOfLines: 1, maxW: 160, children: shown })) : null, label && shown ? _jsx(ChevronsUpDown, { size: 16, color: "$color9" }) : null] }) }), _jsx(Popover.Content, { role: "menu", bordered: true, elevate: true, px: "$1", py: "$1", width: 240, bg: "$color2", borderColor: "$borderColor", className: className, style: style, children: children ?? (_jsxs(YStack, { gap: "$1", children: [shown || email ? (_jsxs(YStack, { gap: "$0.5", px: "$2", py: "$1.5", children: [shown ? (_jsx(Text, { fontSize: "$2", fontWeight: "700", color: "$color12", numberOfLines: 1, children: shown })) : null, email && email !== shown ? (_jsx(Text, { fontSize: "$1", color: "$color10", numberOfLines: 1, children: email })) : null] })) : null, filled.map((group, i) => {
|
|
57
|
+
const items = itemsOf(group);
|
|
58
|
+
const groupName = nameOf(group);
|
|
59
|
+
// A group whose every row carries a chosen-one is a CHOICE, so it
|
|
60
|
+
// is a radiogroup — a heading alone would leave the rows unrelated.
|
|
61
|
+
const choice = items.every((it) => it.active !== undefined);
|
|
62
|
+
const rows = items.map((item) => _jsx(Row, { item: item, onDone: close }, item.id));
|
|
63
|
+
return (_jsxs(YStack, { gap: "$1", children: [i > 0 || shown || email ? _jsx(Separator, { borderColor: "$borderColor", my: "$1" }) : null, groupName ? (_jsx(Text, { px: "$2", py: "$1", fontSize: "$1", color: "$color10", fontWeight: "500", children: groupName })) : null, choice ? (_jsx(YStack, { role: "radiogroup", "aria-label": groupName, gap: "$1", children: rows })) : (rows)] }, i));
|
|
64
|
+
}), theme !== null ? (_jsxs(_Fragment, { children: [_jsx(Separator, { borderColor: "$borderColor", my: "$1" }), _jsxs(XStack, { items: "center", gap: "$2.5", px: "$2", py: "$1", rounded: "$3", children: [_jsx(Text, { flex: 1, fontSize: "$2", color: "$color12", children: "Theme" }), theme ?? _jsx(ThemeToggle, {})] })] })) : null, onSignOut ? (_jsxs(_Fragment, { children: [_jsx(Separator, { borderColor: "$borderColor", my: "$1" }), _jsx(Row, { item: {
|
|
51
65
|
id: 'sign-out',
|
|
52
66
|
label: signOutLabel,
|
|
53
67
|
icon: _jsx(LogOut, { size: 16 }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMenu.js","sourceRoot":"","sources":["../../src/product/UserMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"UserMenu.js","sourceRoot":"","sources":["../../src/product/UserMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAA;AACpE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACrE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEnF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,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,EAAC,IAAI,EAAC,KAAK,EAAC,UAAU,sBAEtC,EACN,KAAK,IAAI,KAAC,WAAW,KAAG,IAClB,IACR,CACJ,CAAC,CAAC,CAAC,IAAI,EAEP,SAAS,CAAC,CAAC,CAAC,CACX,8BACE,KAAC,SAAS,IAAC,WAAW,EAAC,cAAc,EAAC,EAAE,EAAC,IAAI,GAAG,EAChD,KAAC,GAAG,IACF,IAAI,EAAE;wCACJ,EAAE,EAAE,UAAU;wCACd,KAAK,EAAE,YAAY;wCACnB,IAAI,EAAE,KAAC,MAAM,IAAC,IAAI,EAAE,EAAE,GAAI;wCAC1B,OAAO,EAAE,SAAS;qCACnB,EACD,MAAM,EAAE,KAAK,GACb,IACD,CACJ,CAAC,CAAC,CAAC,IAAI,IACD,CACV,GACe,IACV,CACX,CAAA;AACH,CAAC"}
|
package/dist/styles.css
CHANGED
|
@@ -2230,7 +2230,6 @@
|
|
|
2230
2230
|
:root ._cur-pointer{cursor:pointer;}
|
|
2231
2231
|
:root ._cur-row-resize{cursor:row-resize;}
|
|
2232
2232
|
:root ._direction-ltr{direction:ltr;}
|
|
2233
|
-
:root ._dsp-block{display:block;}
|
|
2234
2233
|
:root ._dsp-flex{display:flex;}
|
|
2235
2234
|
:root ._dsp-inline-flex{display:inline-flex;}
|
|
2236
2235
|
:root ._dsp-none{display:none;}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.88",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Hanzo UI — the one canonical Hanzo component library, on @hanzo/gui + @hanzo/design. ONE substrate: every component renders through @hanzo/gui primitives, so the same import works on web, native (expo) and desktop (Tauri). Self-contained (theme.css), presentational, host-agnostic, clean-room.",
|
|
6
6
|
"exports": {
|