@hanzo/ui 8.0.55 → 8.0.56
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/README.md +5 -1
- package/dist/chat/Code.cjs +2 -36
- package/dist/chat/Code.d.ts +0 -13
- package/dist/chat/Code.d.ts.map +1 -1
- package/dist/chat/Code.js +2 -35
- package/dist/chat/Code.js.map +1 -1
- package/dist/chat/index.cjs +7 -2
- package/dist/chat/index.d.ts +7 -1
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat/index.js +7 -1
- package/dist/chat/index.js.map +1 -1
- package/dist/product/AppHeader.cjs +8 -6
- package/dist/product/AppHeader.d.ts.map +1 -1
- package/dist/product/AppHeader.js +11 -9
- package/dist/product/AppHeader.js.map +1 -1
- package/dist/product/CopyButton.cjs +54 -0
- package/dist/product/CopyButton.d.ts +12 -0
- package/dist/product/CopyButton.d.ts.map +1 -0
- package/dist/product/CopyButton.js +52 -0
- package/dist/product/CopyButton.js.map +1 -0
- package/dist/product/Field.cjs +2 -1
- package/dist/product/Field.d.ts.map +1 -1
- package/dist/product/Field.js +2 -1
- package/dist/product/Field.js.map +1 -1
- package/dist/product/Fieldset.cjs +13 -0
- package/dist/product/Fieldset.d.ts +35 -0
- package/dist/product/Fieldset.d.ts.map +1 -0
- package/dist/product/Fieldset.js +11 -0
- package/dist/product/Fieldset.js.map +1 -0
- package/dist/product/OrgMark.cjs +39 -3
- package/dist/product/OrgMark.d.ts +9 -0
- package/dist/product/OrgMark.d.ts.map +1 -1
- package/dist/product/OrgMark.js +38 -3
- package/dist/product/OrgMark.js.map +1 -1
- package/dist/product/OrgSwitcher.cjs +3 -3
- package/dist/product/OrgSwitcher.d.ts +29 -1
- package/dist/product/OrgSwitcher.d.ts.map +1 -1
- package/dist/product/OrgSwitcher.js +3 -3
- package/dist/product/OrgSwitcher.js.map +1 -1
- package/dist/product/Pagination.cjs +72 -0
- package/dist/product/Pagination.d.ts +21 -0
- package/dist/product/Pagination.d.ts.map +1 -0
- package/dist/product/Pagination.js +68 -0
- package/dist/product/Pagination.js.map +1 -0
- package/dist/product/SecretInput.cjs +59 -0
- package/dist/product/SecretInput.d.ts +24 -0
- package/dist/product/SecretInput.d.ts.map +1 -0
- package/dist/product/SecretInput.js +55 -0
- package/dist/product/SecretInput.js.map +1 -0
- package/dist/product/UserMenu.cjs +63 -0
- package/dist/product/UserMenu.d.ts +56 -0
- package/dist/product/UserMenu.d.ts.map +1 -0
- package/dist/product/UserMenu.js +60 -0
- package/dist/product/UserMenu.js.map +1 -0
- package/dist/product/index.cjs +21 -2
- package/dist/product/index.d.ts +5 -0
- package/dist/product/index.d.ts.map +1 -1
- package/dist/product/index.js +21 -2
- package/dist/product/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Fieldset = Fieldset;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const gui_1 = require("@hanzo/gui");
|
|
7
|
+
function Fieldset({ title, icon, description, action, danger, children }) {
|
|
8
|
+
const edge = danger ? '$red9' : '$borderColor';
|
|
9
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { width: "100%", p: "$4", gap: "$3", rounded: "$4", borderWidth: 1, borderColor: edge, bg: "$color2", children: [title || action ? ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$2", justify: "space-between", flexWrap: "wrap", children: [(0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$2", flex: 1, minW: 0, children: [icon, title ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$3", fontWeight: "500", color: danger ? '$red10' : '$color12', children: title })) : null] }), action] })) : null, description ? (
|
|
10
|
+
// Sits under the legend, not beside it: a description that shares the
|
|
11
|
+
// line with the title competes with it and wraps first on a phone.
|
|
12
|
+
(0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$2", color: "$color11", children: description })) : null, (0, jsx_runtime_1.jsx)(gui_1.YStack, { gap: "$3", children: children })] }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fieldset — a titled group of settings, and the surface it sits on.
|
|
3
|
+
*
|
|
4
|
+
* The name is the HTML one and the right one: a bounded set of related controls
|
|
5
|
+
* under a legend. `FieldRow` and the `Field*` controls are what go inside it;
|
|
6
|
+
* this is the box they were always drawn in and that no package ever owned, so
|
|
7
|
+
* every settings page drew its own — hanzo.app twice, the console once, billing
|
|
8
|
+
* across six panels — and they disagreed on the radius, the fill and, in one
|
|
9
|
+
* case, on whether a destructive group should be a solid red card.
|
|
10
|
+
*
|
|
11
|
+
* `Panel` (from `Metric`) is NOT this: it is a dashboard tile sized to sit in a
|
|
12
|
+
* row of metrics. A settings group is full width, carries a legend and an icon,
|
|
13
|
+
* and has a destructive register. Two boxes, two jobs, two names.
|
|
14
|
+
*
|
|
15
|
+
* Danger says danger with its EDGE. A solid saturated fill makes the one group
|
|
16
|
+
* you should find only when you are looking for it the loudest object on the
|
|
17
|
+
* page; colour is an accent here, so the border carries it and the surface stays
|
|
18
|
+
* on the ladder with its neighbours.
|
|
19
|
+
*/
|
|
20
|
+
import type { ReactNode } from 'react';
|
|
21
|
+
export type FieldsetProps = {
|
|
22
|
+
/** The legend. Sentence case — it names a group, it is not a headline. */
|
|
23
|
+
title?: string;
|
|
24
|
+
/** Optional glyph before the legend, at the legend's own size. */
|
|
25
|
+
icon?: ReactNode;
|
|
26
|
+
/** One line under the legend saying what the group is for. */
|
|
27
|
+
description?: string;
|
|
28
|
+
/** Right-aligned control on the legend line (a link, a small action). */
|
|
29
|
+
action?: ReactNode;
|
|
30
|
+
/** The destructive register — irreversible actions only. */
|
|
31
|
+
danger?: boolean;
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
};
|
|
34
|
+
export declare function Fieldset({ title, icon, description, action, danger, children }: FieldsetProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
//# sourceMappingURL=Fieldset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Fieldset.d.ts","sourceRoot":"","sources":["../../src/product/Fieldset.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,MAAM,MAAM,aAAa,GAAG;IAC1B,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kEAAkE;IAClE,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yEAAyE;IACzE,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,aAAa,2CAqC7F"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Text, XStack, YStack } from '@hanzo/gui';
|
|
4
|
+
export function Fieldset({ title, icon, description, action, danger, children }) {
|
|
5
|
+
const edge = danger ? '$red9' : '$borderColor';
|
|
6
|
+
return (_jsxs(YStack, { width: "100%", p: "$4", gap: "$3", rounded: "$4", borderWidth: 1, borderColor: edge, bg: "$color2", children: [title || action ? (_jsxs(XStack, { items: "center", gap: "$2", justify: "space-between", flexWrap: "wrap", children: [_jsxs(XStack, { items: "center", gap: "$2", flex: 1, minW: 0, children: [icon, title ? (_jsx(Text, { fontSize: "$3", fontWeight: "500", color: danger ? '$red10' : '$color12', children: title })) : null] }), action] })) : null, description ? (
|
|
7
|
+
// Sits under the legend, not beside it: a description that shares the
|
|
8
|
+
// line with the title competes with it and wraps first on a phone.
|
|
9
|
+
_jsx(Text, { fontSize: "$2", color: "$color11", children: description })) : null, _jsx(YStack, { gap: "$3", children: children })] }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=Fieldset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Fieldset.js","sourceRoot":"","sources":["../../src/product/Fieldset.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAsBZ,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAgBjD,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAiB;IAC5F,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAA;IAC9C,OAAO,CACL,MAAC,MAAM,IACL,KAAK,EAAC,MAAM,EACZ,CAAC,EAAC,IAAI,EACN,GAAG,EAAC,IAAI,EACR,OAAO,EAAC,IAAI,EACZ,WAAW,EAAE,CAAC,EACd,WAAW,EAAE,IAAI,EACjB,EAAE,EAAC,SAAS,aAEX,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,CACjB,MAAC,MAAM,IAAC,KAAK,EAAC,QAAQ,EAAC,GAAG,EAAC,IAAI,EAAC,OAAO,EAAC,eAAe,EAAC,QAAQ,EAAC,MAAM,aACrE,MAAC,MAAM,IAAC,KAAK,EAAC,QAAQ,EAAC,GAAG,EAAC,IAAI,EAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,aAC7C,IAAI,EACJ,KAAK,CAAC,CAAC,CAAC,CACP,KAAC,IAAI,IAAC,QAAQ,EAAC,IAAI,EAAC,UAAU,EAAC,KAAK,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,YACvE,KAAK,GACD,CACR,CAAC,CAAC,CAAC,IAAI,IACD,EACR,MAAM,IACA,CACV,CAAC,CAAC,CAAC,IAAI,EAEP,WAAW,CAAC,CAAC,CAAC;YACb,sEAAsE;YACtE,mEAAmE;YACnE,KAAC,IAAI,IAAC,QAAQ,EAAC,IAAI,EAAC,KAAK,EAAC,UAAU,YACjC,WAAW,GACP,CACR,CAAC,CAAC,CAAC,IAAI,EAER,KAAC,MAAM,IAAC,GAAG,EAAC,IAAI,YAAE,QAAQ,GAAU,IAC7B,CACV,CAAA;AACH,CAAC"}
|
package/dist/product/OrgMark.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.isEmoji = isEmoji;
|
|
4
5
|
exports.monogram = monogram;
|
|
5
6
|
exports.OrgMark = OrgMark;
|
|
6
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -13,9 +14,37 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
13
14
|
* customer's console must show the customer's identity, not ours.
|
|
14
15
|
*
|
|
15
16
|
* Monochrome by construction (`$color4` tile, `$color12` glyph) so it belongs to
|
|
16
|
-
* the chrome; colour stays with content
|
|
17
|
+
* the chrome; colour stays with content — with one exception: an emoji logo is
|
|
18
|
+
* rendered in full colour, because a monochrome emoji is not the emoji.
|
|
19
|
+
*
|
|
20
|
+
* Three kinds of `logo`, resolved in order: a URL, a short emoji string, or
|
|
21
|
+
* nothing. A URL that FAILS to load falls back to the monogram rather than
|
|
22
|
+
* leaving a broken-image glyph in the chrome — org logos are tenant-supplied and
|
|
23
|
+
* a dead link is the normal case, not the exceptional one.
|
|
17
24
|
*/
|
|
25
|
+
const react_1 = require("react");
|
|
18
26
|
const gui_1 = require("@hanzo/gui");
|
|
27
|
+
/**
|
|
28
|
+
* An emoji mark rather than a URL.
|
|
29
|
+
*
|
|
30
|
+
* Tested by absence of a scheme/path and by shortness — an emoji sequence is a
|
|
31
|
+
* handful of code points, and `Intl.Segmenter` counts grapheme clusters so a
|
|
32
|
+
* flag or a family (several code points, one glyph) reads as one character.
|
|
33
|
+
* Falls back to code-point length where `Segmenter` is unavailable.
|
|
34
|
+
*/
|
|
35
|
+
function isEmoji(logo) {
|
|
36
|
+
const s = logo.trim();
|
|
37
|
+
if (!s || /^(https?:|data:|\/)/.test(s))
|
|
38
|
+
return false;
|
|
39
|
+
// Regional_Indicator as well as Extended_Pictographic: a flag is a pair of
|
|
40
|
+
// regional indicators and carries no pictographic code point at all, so the
|
|
41
|
+
// pictographic test alone rejects every country mark.
|
|
42
|
+
if (!/[\p{Extended_Pictographic}\p{Regional_Indicator}]/u.test(s))
|
|
43
|
+
return false;
|
|
44
|
+
const Seg = Intl.Segmenter;
|
|
45
|
+
const units = Seg ? [...new Seg().segment(s)].length : [...s].length;
|
|
46
|
+
return units <= 3;
|
|
47
|
+
}
|
|
19
48
|
/**
|
|
20
49
|
* The monogram for a name: the first letter of each of the first two words,
|
|
21
50
|
* uppercased — the SAME rule @hanzo/iam's account widget applies to a person, so
|
|
@@ -32,11 +61,18 @@ function monogram(name) {
|
|
|
32
61
|
return (letters || name.trim().slice(0, 2)).toUpperCase();
|
|
33
62
|
}
|
|
34
63
|
function OrgMark({ org, size = 22, maxW }) {
|
|
35
|
-
|
|
64
|
+
// Reset when the mark changes: switcher rows reuse instances, so a failure on
|
|
65
|
+
// one org must not blank the next org's logo.
|
|
66
|
+
const [broken, setBroken] = (0, react_1.useState)(false);
|
|
67
|
+
(0, react_1.useEffect)(() => setBroken(false), [org.logo]);
|
|
68
|
+
if (org.logo && isEmoji(org.logo)) {
|
|
69
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { width: size, height: size, items: "center", justify: "center", style: { flexShrink: 0 }, children: (0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: Math.round(size * 0.72), lineHeight: size, children: org.logo.trim() }) }));
|
|
70
|
+
}
|
|
71
|
+
if (org.logo && !broken) {
|
|
36
72
|
// An arbitrary tenant-supplied URL — a raw <img>, since next/image would need
|
|
37
73
|
// a remote allow-list per customer domain.
|
|
38
74
|
// eslint-disable-next-line @next/next/no-img-element
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)("img", { src: org.logo, alt: "", style: {
|
|
75
|
+
return ((0, jsx_runtime_1.jsx)("img", { src: org.logo, alt: "", onError: () => setBroken(true), style: {
|
|
40
76
|
height: size,
|
|
41
77
|
width: maxW ? 'auto' : size,
|
|
42
78
|
maxWidth: maxW ?? size,
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import type { Org } from './scope.js';
|
|
2
|
+
/**
|
|
3
|
+
* An emoji mark rather than a URL.
|
|
4
|
+
*
|
|
5
|
+
* Tested by absence of a scheme/path and by shortness — an emoji sequence is a
|
|
6
|
+
* handful of code points, and `Intl.Segmenter` counts grapheme clusters so a
|
|
7
|
+
* flag or a family (several code points, one glyph) reads as one character.
|
|
8
|
+
* Falls back to code-point length where `Segmenter` is unavailable.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isEmoji(logo: string): boolean;
|
|
2
11
|
/**
|
|
3
12
|
* The monogram for a name: the first letter of each of the first two words,
|
|
4
13
|
* uppercased — the SAME rule @hanzo/iam's account widget applies to a person, so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrgMark.d.ts","sourceRoot":"","sources":["../../src/product/OrgMark.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OrgMark.d.ts","sourceRoot":"","sources":["../../src/product/OrgMark.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAElC;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAU7C;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO7C;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,gFAAgF;IAChF,GAAG,EAAE,GAAG,CAAA;IACR,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wBAAgB,OAAO,CAAC,EAAE,GAAG,EAAE,IAAS,EAAE,IAAI,EAAE,EAAE,YAAY,2CA0D7D"}
|
package/dist/product/OrgMark.js
CHANGED
|
@@ -9,9 +9,37 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
9
9
|
* customer's console must show the customer's identity, not ours.
|
|
10
10
|
*
|
|
11
11
|
* Monochrome by construction (`$color4` tile, `$color12` glyph) so it belongs to
|
|
12
|
-
* the chrome; colour stays with content
|
|
12
|
+
* the chrome; colour stays with content — with one exception: an emoji logo is
|
|
13
|
+
* rendered in full colour, because a monochrome emoji is not the emoji.
|
|
14
|
+
*
|
|
15
|
+
* Three kinds of `logo`, resolved in order: a URL, a short emoji string, or
|
|
16
|
+
* nothing. A URL that FAILS to load falls back to the monogram rather than
|
|
17
|
+
* leaving a broken-image glyph in the chrome — org logos are tenant-supplied and
|
|
18
|
+
* a dead link is the normal case, not the exceptional one.
|
|
13
19
|
*/
|
|
20
|
+
import { useEffect, useState } from 'react';
|
|
14
21
|
import { Text, YStack } from '@hanzo/gui';
|
|
22
|
+
/**
|
|
23
|
+
* An emoji mark rather than a URL.
|
|
24
|
+
*
|
|
25
|
+
* Tested by absence of a scheme/path and by shortness — an emoji sequence is a
|
|
26
|
+
* handful of code points, and `Intl.Segmenter` counts grapheme clusters so a
|
|
27
|
+
* flag or a family (several code points, one glyph) reads as one character.
|
|
28
|
+
* Falls back to code-point length where `Segmenter` is unavailable.
|
|
29
|
+
*/
|
|
30
|
+
export function isEmoji(logo) {
|
|
31
|
+
const s = logo.trim();
|
|
32
|
+
if (!s || /^(https?:|data:|\/)/.test(s))
|
|
33
|
+
return false;
|
|
34
|
+
// Regional_Indicator as well as Extended_Pictographic: a flag is a pair of
|
|
35
|
+
// regional indicators and carries no pictographic code point at all, so the
|
|
36
|
+
// pictographic test alone rejects every country mark.
|
|
37
|
+
if (!/[\p{Extended_Pictographic}\p{Regional_Indicator}]/u.test(s))
|
|
38
|
+
return false;
|
|
39
|
+
const Seg = Intl.Segmenter;
|
|
40
|
+
const units = Seg ? [...new Seg().segment(s)].length : [...s].length;
|
|
41
|
+
return units <= 3;
|
|
42
|
+
}
|
|
15
43
|
/**
|
|
16
44
|
* The monogram for a name: the first letter of each of the first two words,
|
|
17
45
|
* uppercased — the SAME rule @hanzo/iam's account widget applies to a person, so
|
|
@@ -28,11 +56,18 @@ export function monogram(name) {
|
|
|
28
56
|
return (letters || name.trim().slice(0, 2)).toUpperCase();
|
|
29
57
|
}
|
|
30
58
|
export function OrgMark({ org, size = 22, maxW }) {
|
|
31
|
-
|
|
59
|
+
// Reset when the mark changes: switcher rows reuse instances, so a failure on
|
|
60
|
+
// one org must not blank the next org's logo.
|
|
61
|
+
const [broken, setBroken] = useState(false);
|
|
62
|
+
useEffect(() => setBroken(false), [org.logo]);
|
|
63
|
+
if (org.logo && isEmoji(org.logo)) {
|
|
64
|
+
return (_jsx(YStack, { width: size, height: size, items: "center", justify: "center", style: { flexShrink: 0 }, children: _jsx(Text, { fontSize: Math.round(size * 0.72), lineHeight: size, children: org.logo.trim() }) }));
|
|
65
|
+
}
|
|
66
|
+
if (org.logo && !broken) {
|
|
32
67
|
// An arbitrary tenant-supplied URL — a raw <img>, since next/image would need
|
|
33
68
|
// a remote allow-list per customer domain.
|
|
34
69
|
// eslint-disable-next-line @next/next/no-img-element
|
|
35
|
-
return (_jsx("img", { src: org.logo, alt: "", style: {
|
|
70
|
+
return (_jsx("img", { src: org.logo, alt: "", onError: () => setBroken(true), style: {
|
|
36
71
|
height: size,
|
|
37
72
|
width: maxW ? 'auto' : size,
|
|
38
73
|
maxWidth: maxW ?? size,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrgMark.js","sourceRoot":"","sources":["../../src/product/OrgMark.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ
|
|
1
|
+
{"version":3,"file":"OrgMark.js","sourceRoot":"","sources":["../../src/product/OrgMark.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAIzC;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IACrB,IAAI,CAAC,CAAC,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IACrD,2EAA2E;IAC3E,4EAA4E;IAC5E,sDAAsD;IACtD,IAAI,CAAC,oDAAoD,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IAC/E,MAAM,GAAG,GAAI,IAA8C,CAAC,SAAS,CAAA;IACrE,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAA;IACpE,OAAO,KAAK,IAAI,CAAC,CAAA;AACnB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAC5D,MAAM,OAAO,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EAAC,EAAE,EACN,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAC9B,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI;gBACZ,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;gBAC3B,QAAQ,EAAE,IAAI,IAAI,IAAI;gBACtB,SAAS,EAAE,SAAS;gBACpB,OAAO,EAAE,OAAO;gBAChB,YAAY,EAAE,CAAC;gBACf,UAAU,EAAE,CAAC;aACd,GACD,CACH,CAAA;IACH,CAAC;IACD,OAAO,CACL,KAAC,MAAM,IACL,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,OAAO,EAAC,IAAI,EACZ,EAAE,EAAC,SAAS,EACZ,KAAK,EAAC,QAAQ,EACd,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,YAExB,KAAC,IAAI,IAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,EAAE,UAAU,EAAC,KAAK,EAAC,KAAK,EAAC,UAAU,YACtE,QAAQ,CAAC,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,CAAC,GACjC,GACA,CACV,CAAA;AACH,CAAC"}
|
|
@@ -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 }) {
|
|
27
|
+
function OrgSwitcher({ scope, orgs, pageSize = 20, current: given, create, picker = false, direction = 'down', footer, }) {
|
|
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,11 +126,11 @@ 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:
|
|
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.jsx)(gui_1.Text, { flex: 1, minW: 0, fontSize: "$4", fontWeight: "800", color: "$color12", numberOfLines: 1, children: currentLabel }), (0, jsx_runtime_1.jsx)(lucide_icons_2_1.ChevronsUpDown, { size: 15, color: "$color9" })] }) }) }), (0, jsx_runtime_1.jsx)(gui_1.Popover.Content, { bordered: true, elevate: true, p: "$2", width: 300, bg: "$color2", borderColor: "$borderColor", 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: [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 organization\u2026", 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.' })) : (visible.map((org) => ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { onPress: () => select(org.name), 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: 15 }) : 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] }), create ? ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { onPress: () => {
|
|
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.' })) : (visible.map((org) => ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { onPress: () => select(org.name), 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: 15 }) : 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] }), footer, create ? ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { onPress: () => {
|
|
134
134
|
setCreating(true);
|
|
135
135
|
setErr(null);
|
|
136
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: () => {
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OrgSwitcher — the Vercel-style org/team switcher, hoisted from the console
|
|
3
|
+
* (hanzoai/ui#36) onto @hanzo/gui primitives. Shows the org the surface is
|
|
4
|
+
* scoped to, switches between the orgs the caller can see, and creates one.
|
|
5
|
+
*
|
|
6
|
+
* Host-agnostic: the LIST is a lazy, paged loader the host injects (IAM
|
|
7
|
+
* `get-organizations` behind its own proxy) — one page at a time, the search
|
|
8
|
+
* term pushed to the server, more on demand (scroll + "Load more"), so it
|
|
9
|
+
* scales to thousands of orgs. No loader → the current org alone, synthesized
|
|
10
|
+
* from the scope (never fabricated). Selecting re-scopes IN PLACE via
|
|
11
|
+
* `scope.switchOrg` (persist + reload → every module refetches under the new
|
|
12
|
+
* `X-Org-Id`). Create posts through the injected hook, then scopes into the
|
|
13
|
+
* new org.
|
|
14
|
+
*/
|
|
15
|
+
import { type ReactNode } from 'react';
|
|
1
16
|
import { type Org, type OrgScope } from './scope.js';
|
|
2
17
|
export type OrgSwitcherProps = {
|
|
3
18
|
/** The active-org contract (see `orgScope`). */
|
|
@@ -21,6 +36,19 @@ export type OrgSwitcherProps = {
|
|
|
21
36
|
create?: (name: string) => Promise<string>;
|
|
22
37
|
/** Show the "All organizations" de-scope row (`scope.leaveOrg`). */
|
|
23
38
|
picker?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Which way the panel opens. `up` for a switcher sitting in a bottom identity
|
|
41
|
+
* bar, where a downward panel would open off the bottom of the viewport —
|
|
42
|
+
* hanzo.app kept a whole local copy of this component for want of this one
|
|
43
|
+
* prop.
|
|
44
|
+
*/
|
|
45
|
+
direction?: 'down' | 'up';
|
|
46
|
+
/**
|
|
47
|
+
* Rows below the list, above the create/de-scope affordances — the surface's
|
|
48
|
+
* own additions (a personal-workspace badge, a link into org settings). The
|
|
49
|
+
* other half of what hanzo.app's local copy existed for.
|
|
50
|
+
*/
|
|
51
|
+
footer?: ReactNode;
|
|
24
52
|
};
|
|
25
|
-
export declare function OrgSwitcher({ scope, orgs, pageSize, current: given, create, picker }: OrgSwitcherProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export declare function OrgSwitcher({ scope, orgs, pageSize, current: given, create, picker, direction, footer, }: OrgSwitcherProps): import("react/jsx-runtime").JSX.Element;
|
|
26
54
|
//# sourceMappingURL=OrgSwitcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrgSwitcher.d.ts","sourceRoot":"","sources":["../../src/product/OrgSwitcher.tsx"],"names":[],"mappings":"
|
|
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;AAMzF,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;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB,CAAA;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,IAAI,EACJ,QAAa,EACb,OAAO,EAAE,KAAK,EACd,MAAM,EACN,MAAc,EACd,SAAkB,EAClB,MAAM,GACP,EAAE,gBAAgB,2CA6RlB"}
|
|
@@ -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 }) {
|
|
24
|
+
export function OrgSwitcher({ scope, orgs, pageSize = 20, current: given, create, picker = false, direction = 'down', footer, }) {
|
|
25
25
|
const currentId = scope.currentOrg();
|
|
26
26
|
const [open, setOpen] = useState(false);
|
|
27
27
|
const [query, setQuery] = useState('');
|
|
@@ -123,11 +123,11 @@ 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:
|
|
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 }), _jsx(Text, { flex: 1, minW: 0, fontSize: "$4", fontWeight: "800", color: "$color12", numberOfLines: 1, children: currentLabel }), _jsx(ChevronsUpDown, { size: 15, color: "$color9" })] }) }) }), _jsx(Popover.Content, { bordered: true, elevate: true, p: "$2", width: 300, bg: "$color2", borderColor: "$borderColor", 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: [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 organization\u2026", 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.' })) : (visible.map((org) => (_jsxs(XStack, { onPress: () => select(org.name), 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: 15 }) : 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] }), create ? (_jsxs(XStack, { onPress: () => {
|
|
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.' })) : (visible.map((org) => (_jsxs(XStack, { onPress: () => select(org.name), 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: 15 }) : 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] }), footer, create ? (_jsxs(XStack, { onPress: () => {
|
|
131
131
|
setCreating(true);
|
|
132
132
|
setErr(null);
|
|
133
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: () => {
|
|
@@ -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,EAAE,MAAM,OAAO,CAAA;AACzE,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;AA0B1E,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,EAAoB;IAClH,MAAM,SAAS,GAAG,KAAK,CAA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,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,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"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.GAP = void 0;
|
|
5
|
+
exports.pages = pages;
|
|
6
|
+
exports.Pagination = Pagination;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
/**
|
|
9
|
+
* Pagination — page N of M, and the way to the others.
|
|
10
|
+
*
|
|
11
|
+
* Four implementations across the fleet (chat, the console's observability
|
|
12
|
+
* pager, and billing twice — in two spellings, in one repo), each with its own
|
|
13
|
+
* rule for what happens when there are eighty pages. `pages` is that rule,
|
|
14
|
+
* written once and testable without a browser: a fixed-width run of page numbers
|
|
15
|
+
* around the current one, with ellipses standing in for what was skipped and the
|
|
16
|
+
* first and last page always reachable.
|
|
17
|
+
*
|
|
18
|
+
* Fixed width is the requirement. A control that grows with the page count
|
|
19
|
+
* reflows the row it sits in every time you page, which is how a "next" button
|
|
20
|
+
* ends up under the cursor that was pressing "previous".
|
|
21
|
+
*/
|
|
22
|
+
const gui_1 = require("@hanzo/gui");
|
|
23
|
+
const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
|
|
24
|
+
const instrument_1 = require("./instrument.cjs");
|
|
25
|
+
/** A gap in the run. Rendered as an ellipsis; never selectable. */
|
|
26
|
+
exports.GAP = '…';
|
|
27
|
+
/**
|
|
28
|
+
* The page numbers to show for `page` of `count`, 1-based.
|
|
29
|
+
*
|
|
30
|
+
* `around` is how many neighbours flank the current page (default 1 → at most
|
|
31
|
+
* 7 slots: first, gap, p-1, p, p+1, gap, last). Returns every page when they
|
|
32
|
+
* all fit, so a short list never grows an ellipsis it does not need.
|
|
33
|
+
*/
|
|
34
|
+
function pages(page, count, around = 1) {
|
|
35
|
+
if (count <= 0)
|
|
36
|
+
return [];
|
|
37
|
+
const width = around * 2 + 5; // first + gap + run + gap + last
|
|
38
|
+
if (count <= width)
|
|
39
|
+
return Array.from({ length: count }, (_, i) => i + 1);
|
|
40
|
+
const current = Math.min(Math.max(page, 1), count);
|
|
41
|
+
// First and last are always present, so the middle carries `width - 2` slots
|
|
42
|
+
// and each end that needs no ellipsis spends that slot on another page
|
|
43
|
+
// instead. Solving for the run that way is what keeps the total constant;
|
|
44
|
+
// clamping the run with Math.max/min alone lets it shrink near the edges, and
|
|
45
|
+
// then the control changes width as you page.
|
|
46
|
+
const middle = width - 2;
|
|
47
|
+
const nearStart = current <= around + 2;
|
|
48
|
+
const nearEnd = current >= count - around - 1;
|
|
49
|
+
const start = nearStart ? 2 : nearEnd ? count - middle + 1 : current - around;
|
|
50
|
+
const end = nearStart ? middle : nearEnd ? count - 1 : current + around;
|
|
51
|
+
const out = [1];
|
|
52
|
+
if (!nearStart)
|
|
53
|
+
out.push(exports.GAP);
|
|
54
|
+
for (let p = start; p <= end; p++)
|
|
55
|
+
out.push(p);
|
|
56
|
+
if (!nearEnd)
|
|
57
|
+
out.push(exports.GAP);
|
|
58
|
+
out.push(count);
|
|
59
|
+
return out;
|
|
60
|
+
}
|
|
61
|
+
function Pagination({ page, count, onChange, around = 1 }) {
|
|
62
|
+
const track = (0, instrument_1.useEmit)();
|
|
63
|
+
if (count <= 1)
|
|
64
|
+
return null;
|
|
65
|
+
const go = (to) => {
|
|
66
|
+
if (to === page || to < 1 || to > count)
|
|
67
|
+
return;
|
|
68
|
+
track({ component: 'Pagination', action: 'select', value: to });
|
|
69
|
+
onChange(to);
|
|
70
|
+
};
|
|
71
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", justify: "center", gap: "$1", flexWrap: "wrap", children: [(0, jsx_runtime_1.jsx)(gui_1.Button, { size: "$2", chromeless: true, icon: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.ChevronLeft, { size: 15 }), onPress: () => go(page - 1), disabled: page <= 1, "aria-label": "Previous page" }), pages(page, count, around).map((slot, i) => slot === exports.GAP ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { px: "$1.5", fontSize: "$2", color: "$color10", "aria-hidden": true, children: exports.GAP }, `gap-${i}`)) : ((0, jsx_runtime_1.jsx)(gui_1.Button, { size: "$2", chromeless: slot !== page, onPress: () => go(slot), "aria-label": `Page ${slot}`, "aria-current": slot === page ? 'page' : undefined, bg: slot === page ? '$color4' : undefined, children: String(slot) }, slot))), (0, jsx_runtime_1.jsx)(gui_1.Button, { size: "$2", chromeless: true, icon: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.ChevronRight, { size: 15 }), onPress: () => go(page + 1), disabled: page >= count, "aria-label": "Next page" })] }));
|
|
72
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** A gap in the run. Rendered as an ellipsis; never selectable. */
|
|
2
|
+
export declare const GAP: "\u2026";
|
|
3
|
+
/**
|
|
4
|
+
* The page numbers to show for `page` of `count`, 1-based.
|
|
5
|
+
*
|
|
6
|
+
* `around` is how many neighbours flank the current page (default 1 → at most
|
|
7
|
+
* 7 slots: first, gap, p-1, p, p+1, gap, last). Returns every page when they
|
|
8
|
+
* all fit, so a short list never grows an ellipsis it does not need.
|
|
9
|
+
*/
|
|
10
|
+
export declare function pages(page: number, count: number, around?: number): (number | typeof GAP)[];
|
|
11
|
+
export type PaginationProps = {
|
|
12
|
+
/** Current page, 1-based. */
|
|
13
|
+
page: number;
|
|
14
|
+
/** Total pages. 1 or 0 renders nothing — there is nowhere to go. */
|
|
15
|
+
count: number;
|
|
16
|
+
onChange: (page: number) => void;
|
|
17
|
+
/** Neighbours flanking the current page. Default 1. */
|
|
18
|
+
around?: number;
|
|
19
|
+
};
|
|
20
|
+
export declare function Pagination({ page, count, onChange, around }: PaginationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
21
|
+
//# sourceMappingURL=Pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/product/Pagination.tsx"],"names":[],"mappings":"AAqBA,mEAAmE;AACnE,eAAO,MAAM,GAAG,EAAG,QAAY,CAAA;AAE/B;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,SAAI,GAAG,CAAC,MAAM,GAAG,OAAO,GAAG,CAAC,EAAE,CAwBtF;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAU,EAAE,EAAE,eAAe,kDAiDhF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Pagination — page N of M, and the way to the others.
|
|
5
|
+
*
|
|
6
|
+
* Four implementations across the fleet (chat, the console's observability
|
|
7
|
+
* pager, and billing twice — in two spellings, in one repo), each with its own
|
|
8
|
+
* rule for what happens when there are eighty pages. `pages` is that rule,
|
|
9
|
+
* written once and testable without a browser: a fixed-width run of page numbers
|
|
10
|
+
* around the current one, with ellipses standing in for what was skipped and the
|
|
11
|
+
* first and last page always reachable.
|
|
12
|
+
*
|
|
13
|
+
* Fixed width is the requirement. A control that grows with the page count
|
|
14
|
+
* reflows the row it sits in every time you page, which is how a "next" button
|
|
15
|
+
* ends up under the cursor that was pressing "previous".
|
|
16
|
+
*/
|
|
17
|
+
import { Button, Text, XStack } from '@hanzo/gui';
|
|
18
|
+
import { ChevronLeft, ChevronRight } from '@hanzogui/lucide-icons-2';
|
|
19
|
+
import { useEmit } from './instrument.js';
|
|
20
|
+
/** A gap in the run. Rendered as an ellipsis; never selectable. */
|
|
21
|
+
export const GAP = '…';
|
|
22
|
+
/**
|
|
23
|
+
* The page numbers to show for `page` of `count`, 1-based.
|
|
24
|
+
*
|
|
25
|
+
* `around` is how many neighbours flank the current page (default 1 → at most
|
|
26
|
+
* 7 slots: first, gap, p-1, p, p+1, gap, last). Returns every page when they
|
|
27
|
+
* all fit, so a short list never grows an ellipsis it does not need.
|
|
28
|
+
*/
|
|
29
|
+
export function pages(page, count, around = 1) {
|
|
30
|
+
if (count <= 0)
|
|
31
|
+
return [];
|
|
32
|
+
const width = around * 2 + 5; // first + gap + run + gap + last
|
|
33
|
+
if (count <= width)
|
|
34
|
+
return Array.from({ length: count }, (_, i) => i + 1);
|
|
35
|
+
const current = Math.min(Math.max(page, 1), count);
|
|
36
|
+
// First and last are always present, so the middle carries `width - 2` slots
|
|
37
|
+
// and each end that needs no ellipsis spends that slot on another page
|
|
38
|
+
// instead. Solving for the run that way is what keeps the total constant;
|
|
39
|
+
// clamping the run with Math.max/min alone lets it shrink near the edges, and
|
|
40
|
+
// then the control changes width as you page.
|
|
41
|
+
const middle = width - 2;
|
|
42
|
+
const nearStart = current <= around + 2;
|
|
43
|
+
const nearEnd = current >= count - around - 1;
|
|
44
|
+
const start = nearStart ? 2 : nearEnd ? count - middle + 1 : current - around;
|
|
45
|
+
const end = nearStart ? middle : nearEnd ? count - 1 : current + around;
|
|
46
|
+
const out = [1];
|
|
47
|
+
if (!nearStart)
|
|
48
|
+
out.push(GAP);
|
|
49
|
+
for (let p = start; p <= end; p++)
|
|
50
|
+
out.push(p);
|
|
51
|
+
if (!nearEnd)
|
|
52
|
+
out.push(GAP);
|
|
53
|
+
out.push(count);
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
export function Pagination({ page, count, onChange, around = 1 }) {
|
|
57
|
+
const track = useEmit();
|
|
58
|
+
if (count <= 1)
|
|
59
|
+
return null;
|
|
60
|
+
const go = (to) => {
|
|
61
|
+
if (to === page || to < 1 || to > count)
|
|
62
|
+
return;
|
|
63
|
+
track({ component: 'Pagination', action: 'select', value: to });
|
|
64
|
+
onChange(to);
|
|
65
|
+
};
|
|
66
|
+
return (_jsxs(XStack, { items: "center", justify: "center", gap: "$1", flexWrap: "wrap", children: [_jsx(Button, { size: "$2", chromeless: true, icon: _jsx(ChevronLeft, { size: 15 }), onPress: () => go(page - 1), disabled: page <= 1, "aria-label": "Previous page" }), pages(page, count, around).map((slot, i) => slot === GAP ? (_jsx(Text, { px: "$1.5", fontSize: "$2", color: "$color10", "aria-hidden": true, children: GAP }, `gap-${i}`)) : (_jsx(Button, { size: "$2", chromeless: slot !== page, onPress: () => go(slot), "aria-label": `Page ${slot}`, "aria-current": slot === page ? 'page' : undefined, bg: slot === page ? '$color4' : undefined, children: String(slot) }, slot))), _jsx(Button, { size: "$2", chromeless: true, icon: _jsx(ChevronRight, { size: 15 }), onPress: () => go(page + 1), disabled: page >= count, "aria-label": "Next page" })] }));
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=Pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../src/product/Pagination.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,mEAAmE;AACnE,MAAM,CAAC,MAAM,GAAG,GAAG,GAAY,CAAA;AAE/B;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,IAAY,EAAE,KAAa,EAAE,MAAM,GAAG,CAAC;IAC3D,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,EAAE,CAAA;IACzB,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,CAAA,CAAC,iCAAiC;IAC9D,IAAI,KAAK,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IAEzE,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,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