@hanzo/ui 8.0.61 → 8.0.62
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/backends/gui/input.cjs +4 -3
- package/dist/backends/gui/input.d.ts +10 -2
- package/dist/backends/gui/input.d.ts.map +1 -1
- package/dist/backends/gui/input.js +4 -3
- package/dist/backends/gui/input.js.map +1 -1
- package/dist/backends/gui/mask.cjs +20 -0
- package/dist/backends/gui/mask.d.ts +17 -0
- package/dist/backends/gui/mask.d.ts.map +1 -0
- package/dist/backends/gui/mask.js +17 -0
- package/dist/backends/gui/mask.js.map +1 -0
- package/dist/backends/gui/switch.cjs +16 -2
- package/dist/backends/gui/switch.d.ts +14 -0
- package/dist/backends/gui/switch.d.ts.map +1 -1
- package/dist/backends/gui/switch.js +16 -2
- package/dist/backends/gui/switch.js.map +1 -1
- package/dist/chat/Code.cjs +1 -1
- package/dist/chat/Code.d.ts.map +1 -1
- package/dist/chat/Code.js +1 -1
- package/dist/chat/Code.js.map +1 -1
- package/dist/core/css.cjs +114 -0
- package/dist/core/css.d.ts +46 -0
- package/dist/core/css.d.ts.map +1 -0
- package/dist/core/css.js +112 -0
- package/dist/core/css.js.map +1 -0
- package/dist/product/CopyButton.cjs +16 -2
- package/dist/product/CopyButton.d.ts +30 -3
- package/dist/product/CopyButton.d.ts.map +1 -1
- package/dist/product/CopyButton.js +18 -4
- package/dist/product/CopyButton.js.map +1 -1
- package/dist/product/DataTable.cjs +4 -4
- package/dist/product/DataTable.js +4 -4
- package/dist/product/DataTable.js.map +1 -1
- package/dist/product/FadeIn.cjs +1 -1
- package/dist/product/FadeIn.js +1 -1
- package/dist/product/FadeIn.js.map +1 -1
- package/dist/product/Field.cjs +3 -3
- package/dist/product/Field.d.ts +21 -1
- package/dist/product/Field.d.ts.map +1 -1
- package/dist/product/Field.js +3 -3
- package/dist/product/Field.js.map +1 -1
- package/dist/product/Fieldset.cjs +10 -2
- package/dist/product/Fieldset.d.ts +12 -1
- package/dist/product/Fieldset.d.ts.map +1 -1
- package/dist/product/Fieldset.js +10 -2
- package/dist/product/Fieldset.js.map +1 -1
- package/dist/product/Metric.cjs +7 -4
- package/dist/product/Metric.d.ts +8 -1
- package/dist/product/Metric.d.ts.map +1 -1
- package/dist/product/Metric.js +7 -4
- package/dist/product/Metric.js.map +1 -1
- package/dist/product/Pagination.cjs +9 -49
- package/dist/product/Pagination.d.ts +2 -10
- package/dist/product/Pagination.d.ts.map +1 -1
- package/dist/product/Pagination.js +6 -46
- package/dist/product/Pagination.js.map +1 -1
- package/dist/product/Palette.cjs +65 -0
- package/dist/product/Palette.d.ts +67 -0
- package/dist/product/Palette.d.ts.map +1 -0
- package/dist/product/Palette.js +63 -0
- package/dist/product/Palette.js.map +1 -0
- package/dist/product/Reorder.cjs +1 -1
- package/dist/product/Reorder.js +1 -1
- package/dist/product/Reorder.js.map +1 -1
- package/dist/product/SecretInput.cjs +3 -13
- package/dist/product/SecretInput.d.ts +2 -11
- package/dist/product/SecretInput.d.ts.map +1 -1
- package/dist/product/SecretInput.js +6 -11
- package/dist/product/SecretInput.js.map +1 -1
- package/dist/product/SlideOver.cjs +2 -2
- package/dist/product/SlideOver.js +2 -2
- package/dist/product/SlideOver.js.map +1 -1
- package/dist/product/StatusTag.cjs +10 -39
- package/dist/product/StatusTag.d.ts +6 -2
- package/dist/product/StatusTag.d.ts.map +1 -1
- package/dist/product/StatusTag.js +10 -39
- package/dist/product/StatusTag.js.map +1 -1
- package/dist/product/UserMenu.cjs +4 -10
- package/dist/product/UserMenu.d.ts +2 -3
- package/dist/product/UserMenu.d.ts.map +1 -1
- package/dist/product/UserMenu.js +5 -8
- package/dist/product/UserMenu.js.map +1 -1
- package/dist/product/animatedLogo.logic.cjs +1 -1
- package/dist/product/animatedLogo.logic.js +1 -1
- package/dist/product/brand.cjs +1 -1
- package/dist/product/brand.js +1 -1
- package/dist/product/combobox/filter.cjs +1 -1
- package/dist/product/combobox/filter.js +1 -1
- package/dist/product/index.cjs +21 -3
- package/dist/product/index.d.ts +4 -1
- package/dist/product/index.d.ts.map +1 -1
- package/dist/product/index.js +20 -1
- package/dist/product/index.js.map +1 -1
- package/dist/product/match.cjs +76 -0
- package/dist/product/match.d.ts +78 -0
- package/dist/product/match.d.ts.map +1 -0
- package/dist/product/match.js +72 -0
- package/dist/product/match.js.map +1 -0
- package/dist/product/name.cjs +17 -0
- package/dist/product/name.d.ts +10 -0
- package/dist/product/name.d.ts.map +1 -0
- package/dist/product/name.js +15 -0
- package/dist/product/name.js.map +1 -0
- package/dist/product/pages.cjs +57 -0
- package/dist/product/pages.d.ts +28 -0
- package/dist/product/pages.d.ts.map +1 -0
- package/dist/product/pages.js +54 -0
- package/dist/product/pages.js.map +1 -0
- package/dist/product/pure.cjs +63 -0
- package/dist/product/pure.d.ts +9 -0
- package/dist/product/pure.d.ts.map +1 -0
- package/dist/product/pure.js +38 -0
- package/dist/product/pure.js.map +1 -0
- package/dist/product/scope.cjs +1 -1
- package/dist/product/scope.js +1 -1
- package/dist/product/social/SocialResource.cjs +1 -1
- package/dist/product/social/SocialResource.js +1 -1
- package/dist/product/social/SocialResource.js.map +1 -1
- package/dist/product/social/SocialSummaryBar.cjs +1 -1
- package/dist/product/social/SocialSummaryBar.js +1 -1
- package/dist/product/social/SocialSummaryBar.js.map +1 -1
- package/dist/product/tone.cjs +105 -0
- package/dist/product/tone.d.ts +52 -0
- package/dist/product/tone.d.ts.map +1 -0
- package/dist/product/tone.js +102 -0
- package/dist/product/tone.js.map +1 -0
- package/dist/product/useCommandK.cjs +46 -0
- package/dist/product/useCommandK.d.ts +4 -0
- package/dist/product/useCommandK.d.ts.map +1 -0
- package/dist/product/useCommandK.js +44 -0
- package/dist/product/useCommandK.js.map +1 -0
- package/dist/styles/motion.css +52 -17
- package/dist/styles.css +62 -29
- package/dist/theme.css +9 -9
- package/package.json +31 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Metric.js","sourceRoot":"","sources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CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,aACvI,MAAC,MAAM,IAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,eAAe,EAAC,GAAG,EAAC,IAAI,aACrD,MAAC,MAAM,IAAC,KAAK,EAAC,QAAQ,EAAC,GAAG,EAAC,IAAI,EAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,aAC7C,IAAI,EACL,KAAC,IAAI,IAAC,QAAQ,EAAC,IAAI,EAAC,UAAU,EAAC,KAAK,EAAC,KAAK,EAAC,UAAU,YAClD,KAAK,GACD,IACA,EACR,KAAK,IACC,EACR,WAAW,CAAC,CAAC,CAAC;YACb,wEAAwE;YACxE,4DAA4D;YAC5D,KAAC,IAAI,IAAC,QAAQ,EAAC,IAAI,EAAC,KAAK,EAAC,UAAU,YACjC,WAAW,GACP,CACR,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,IACJ,CACR,CAAA;AACH,CAAC"}
|
|
@@ -1,63 +1,23 @@
|
|
|
1
1
|
'use client';"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.GAP = void 0;
|
|
5
|
-
exports.pages = pages;
|
|
4
|
+
exports.pages = exports.GAP = void 0;
|
|
6
5
|
exports.Pagination = Pagination;
|
|
7
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
7
|
/**
|
|
9
8
|
* Pagination — page N of M, and the way to the others.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
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".
|
|
10
|
+
* The RULE it pages by — a fixed-width run of page numbers with ellipses
|
|
11
|
+
* standing in for what was skipped — is `pages`, and it lives in `./pages`
|
|
12
|
+
* because it needs no browser. Re-exported here so the product barrel still
|
|
13
|
+
* carries it; `@hanzo/ui/product/pure` is the door that costs no gui runtime.
|
|
21
14
|
*/
|
|
22
15
|
const gui_1 = require("@hanzo/gui");
|
|
23
16
|
const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
|
|
24
17
|
const instrument_1 = require("./instrument.cjs");
|
|
25
|
-
|
|
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
|
-
}
|
|
18
|
+
const pages_1 = require("./pages.cjs");
|
|
19
|
+
Object.defineProperty(exports, "GAP", { enumerable: true, get: function () { return pages_1.GAP; } });
|
|
20
|
+
Object.defineProperty(exports, "pages", { enumerable: true, get: function () { return pages_1.pages; } });
|
|
61
21
|
function Pagination({ page, count, onChange, around = 1 }) {
|
|
62
22
|
const track = (0, instrument_1.useEmit)();
|
|
63
23
|
if (count <= 1)
|
|
@@ -68,5 +28,5 @@ function Pagination({ page, count, onChange, around = 1 }) {
|
|
|
68
28
|
track({ component: 'Pagination', action: 'select', value: to });
|
|
69
29
|
onChange(to);
|
|
70
30
|
};
|
|
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 ===
|
|
31
|
+
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" }), (0, pages_1.pages)(page, count, around).map((slot, i) => slot === pages_1.GAP ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { px: "$1.5", fontSize: "$2", color: "$color10", "aria-hidden": true, children: pages_1.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
32
|
}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
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)[];
|
|
1
|
+
import { GAP, pages } from './pages.js';
|
|
2
|
+
export { GAP, pages };
|
|
11
3
|
export type PaginationProps = {
|
|
12
4
|
/** Current page, 1-based. */
|
|
13
5
|
page: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/product/Pagination.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/product/Pagination.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAA;AAErB,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"}
|
|
@@ -3,56 +3,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
/**
|
|
4
4
|
* Pagination — page N of M, and the way to the others.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
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".
|
|
6
|
+
* The RULE it pages by — a fixed-width run of page numbers with ellipses
|
|
7
|
+
* standing in for what was skipped — is `pages`, and it lives in `./pages`
|
|
8
|
+
* because it needs no browser. Re-exported here so the product barrel still
|
|
9
|
+
* carries it; `@hanzo/ui/product/pure` is the door that costs no gui runtime.
|
|
16
10
|
*/
|
|
17
11
|
import { Button, Text, XStack } from '@hanzo/gui';
|
|
18
12
|
import { ChevronLeft, ChevronRight } from '@hanzogui/lucide-icons-2';
|
|
19
13
|
import { useEmit } from './instrument.js';
|
|
20
|
-
|
|
21
|
-
export
|
|
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
|
-
}
|
|
14
|
+
import { GAP, pages } from './pages.js';
|
|
15
|
+
export { GAP, pages };
|
|
56
16
|
export function Pagination({ page, count, onChange, around = 1 }) {
|
|
57
17
|
const track = useEmit();
|
|
58
18
|
if (count <= 1)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../src/product/Pagination.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ
|
|
1
|
+
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../src/product/Pagination.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;GAOG;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;AACtC,OAAO,EAA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O,CAAC,EAAE,CAEd,CACR,CAAC,CAAC,CAAC,CACF,KAAC,MAAM,IAEL,IAAI,EAAC,IAAI,EACT,UAAU,EAAE,IAAI,KAAK,IAAI,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,gBACX,QAAQ,IAAI,EAAE,kBACZ,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAChD,EAAE,EAAE,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,YAExC,MAAM,CAAC,IAAI,CAAC,IARR,IAAI,CASF,CACV,CACF,EACD,KAAC,MAAM,IACL,IAAI,EAAC,IAAI,EACT,UAAU,QACV,IAAI,EAAE,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,GAAI,EAChC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,EAC3B,QAAQ,EAAE,IAAI,IAAI,KAAK,gBACZ,WAAW,GACtB,IACK,CACV,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Palette = Palette;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
/**
|
|
7
|
+
* Palette — the ⌘K bar, once, for every Hanzo surface.
|
|
8
|
+
*
|
|
9
|
+
* hanzo.app, console and chat each grew their own: three lists of what can be
|
|
10
|
+
* run, all hand-written, already disagreeing with each other and with the API.
|
|
11
|
+
* This is the component half of ending that. The other half is `GET /v1/commands`,
|
|
12
|
+
* which projects every operation the cloud answers out of the one route table —
|
|
13
|
+
* so a surface passes that list in and stops maintaining one.
|
|
14
|
+
*
|
|
15
|
+
* It is composed from `CommandDialog`, not from a hand-rolled Dialog around a
|
|
16
|
+
* bare `Command`. That distinction is the whole history: the stock dialog used to
|
|
17
|
+
* render `<Command>` with none of the palette's props forwarded, so a host could
|
|
18
|
+
* not read the highlighted row and therefore could not draw a preview beside the
|
|
19
|
+
* list — and hanzo.app rebuilt the dialog by hand for exactly that reason. The
|
|
20
|
+
* forwarding landed upstream in this package and named collapsing the hand-rolled
|
|
21
|
+
* palettes as the follow-up. This is that follow-up, so the hand-rolled shape does
|
|
22
|
+
* not come back here under a new name.
|
|
23
|
+
*
|
|
24
|
+
* Props in, callbacks out, like everything else in this layer: no transport, no
|
|
25
|
+
* store, no routing. It does not fetch the commands, does not run them, and does
|
|
26
|
+
* not know what a project or an org is. `onRun` receives the Op and the surface
|
|
27
|
+
* decides whether that means an HTTP call or a function in the page — which is
|
|
28
|
+
* why a route command and a local command are one type (see `match.ts`).
|
|
29
|
+
*
|
|
30
|
+
* The right-hand slot is `children`, and it is why a shared bar costs no surface
|
|
31
|
+
* its personality: hanzo.app keeps its live project preview and console keeps its
|
|
32
|
+
* `>` AI mode by passing them, not by forking this.
|
|
33
|
+
*
|
|
34
|
+
* Filtering is `survivors`. The safe-methods-browse rule, the per-group cap and
|
|
35
|
+
* the empty-query behaviour all live in `match.ts` as pure functions, so
|
|
36
|
+
* `shouldFilter` is off and the Command primitive is left holding the cursor and
|
|
37
|
+
* the view — which is also what makes the rule testable without a DOM.
|
|
38
|
+
*/
|
|
39
|
+
const react_1 = require("react");
|
|
40
|
+
const gui_1 = require("@hanzo/gui");
|
|
41
|
+
const gui_2 = require("../backends/gui/index.cjs");
|
|
42
|
+
const match_1 = require("./match.cjs");
|
|
43
|
+
function Palette({ open, onOpenChange, ops, onRun, active, onActive, search: controlled, onSearch, placeholder = "Search commands…", empty = "No results found.", limit, children, footer, height = 320, title = "Search commands", }) {
|
|
44
|
+
const [own, setOwn] = (0, react_1.useState)("");
|
|
45
|
+
const search = controlled ?? own;
|
|
46
|
+
const setSearch = (s) => {
|
|
47
|
+
setOwn(s);
|
|
48
|
+
onSearch?.(s);
|
|
49
|
+
};
|
|
50
|
+
const groups = (0, react_1.useMemo)(() => (0, match_1.survivors)(ops, search, limit), [ops, search, limit]);
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)(gui_2.CommandDialog, { open: open, onOpenChange: onOpenChange, title: title, description: placeholder, value: active, onValueChange: onActive, shouldFilter: false, children: [(0, jsx_runtime_1.jsx)(gui_2.CommandInput, { value: search, onValueChange: setSearch, placeholder: placeholder, color: "$color", placeholderTextColor: "$color11" }), (0, jsx_runtime_1.jsxs)(gui_1.XStack, { minH: height, children: [(0, jsx_runtime_1.jsxs)(gui_2.CommandList, { maxH: height, width: children ? "50%" : "100%", borderRightWidth: children ? 1 : 0, borderColor: "$borderColor", py: "$1", children: [groups.length === 0 && ((0, jsx_runtime_1.jsx)(gui_2.CommandEmpty, { children: (0, jsx_runtime_1.jsx)(gui_1.SizableText, { color: "$color11", children: empty }) })), groups.map(([group, items]) => ((0, jsx_runtime_1.jsx)(gui_2.CommandGroup, { heading: group, children: items.map((op) => ((0, jsx_runtime_1.jsxs)(gui_2.CommandItem, { value: op.id, onSelect: () => onRun(op), gap: "$2", children: [op.icon, (0, jsx_runtime_1.jsxs)(gui_1.XStack, { flex: 1, items: "center", gap: "$2", overflow: "hidden", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { numberOfLines: 1, shrink: 0, children: op.label }), op.hint ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { numberOfLines: 1, flex: 1, fontSize: "$1", color: "$color11", children: op.hint })) : null] }), (0, jsx_runtime_1.jsx)(Method, { of: op }), op.end] }, op.id))) }, group)))] }), children ? (0, jsx_runtime_1.jsx)(gui_1.YStack, { width: "50%", children: children }) : null] }), footer ? ((0, jsx_runtime_1.jsx)(gui_1.XStack, { items: "center", gap: "$4", borderTopWidth: 1, borderColor: "$borderColor", px: "$3", py: "$2", children: footer })) : null] }));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The method, at the end of the row, for route commands only.
|
|
55
|
+
*
|
|
56
|
+
* It is the rule made visible rather than decoration: GET is what you reached by
|
|
57
|
+
* browsing, anything else is what you reached by naming it exactly, and somebody
|
|
58
|
+
* about to press ↵ on `platform apps-rollback` should be able to see which
|
|
59
|
+
* without reading the docs. A local command has no method and gets no tag.
|
|
60
|
+
*/
|
|
61
|
+
function Method({ of }) {
|
|
62
|
+
if (of.method === undefined)
|
|
63
|
+
return null;
|
|
64
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { shrink: 0, fontFamily: "$mono", fontSize: 10, letterSpacing: 0.4, color: of.method === match_1.SAFE ? "$color11" : "$color", children: of.method }));
|
|
65
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Palette — the ⌘K bar, once, for every Hanzo surface.
|
|
3
|
+
*
|
|
4
|
+
* hanzo.app, console and chat each grew their own: three lists of what can be
|
|
5
|
+
* run, all hand-written, already disagreeing with each other and with the API.
|
|
6
|
+
* This is the component half of ending that. The other half is `GET /v1/commands`,
|
|
7
|
+
* which projects every operation the cloud answers out of the one route table —
|
|
8
|
+
* so a surface passes that list in and stops maintaining one.
|
|
9
|
+
*
|
|
10
|
+
* It is composed from `CommandDialog`, not from a hand-rolled Dialog around a
|
|
11
|
+
* bare `Command`. That distinction is the whole history: the stock dialog used to
|
|
12
|
+
* render `<Command>` with none of the palette's props forwarded, so a host could
|
|
13
|
+
* not read the highlighted row and therefore could not draw a preview beside the
|
|
14
|
+
* list — and hanzo.app rebuilt the dialog by hand for exactly that reason. The
|
|
15
|
+
* forwarding landed upstream in this package and named collapsing the hand-rolled
|
|
16
|
+
* palettes as the follow-up. This is that follow-up, so the hand-rolled shape does
|
|
17
|
+
* not come back here under a new name.
|
|
18
|
+
*
|
|
19
|
+
* Props in, callbacks out, like everything else in this layer: no transport, no
|
|
20
|
+
* store, no routing. It does not fetch the commands, does not run them, and does
|
|
21
|
+
* not know what a project or an org is. `onRun` receives the Op and the surface
|
|
22
|
+
* decides whether that means an HTTP call or a function in the page — which is
|
|
23
|
+
* why a route command and a local command are one type (see `match.ts`).
|
|
24
|
+
*
|
|
25
|
+
* The right-hand slot is `children`, and it is why a shared bar costs no surface
|
|
26
|
+
* its personality: hanzo.app keeps its live project preview and console keeps its
|
|
27
|
+
* `>` AI mode by passing them, not by forking this.
|
|
28
|
+
*
|
|
29
|
+
* Filtering is `survivors`. The safe-methods-browse rule, the per-group cap and
|
|
30
|
+
* the empty-query behaviour all live in `match.ts` as pure functions, so
|
|
31
|
+
* `shouldFilter` is off and the Command primitive is left holding the cursor and
|
|
32
|
+
* the view — which is also what makes the rule testable without a DOM.
|
|
33
|
+
*/
|
|
34
|
+
import { type ReactNode } from "react";
|
|
35
|
+
import { type Op } from "./match.js";
|
|
36
|
+
export type PaletteProps = {
|
|
37
|
+
open: boolean;
|
|
38
|
+
onOpenChange: (open: boolean) => void;
|
|
39
|
+
/** Everything runnable, local commands and route commands alike. */
|
|
40
|
+
ops: Op[];
|
|
41
|
+
/** Run one. The surface decides what running it means. */
|
|
42
|
+
onRun: (op: Op) => void;
|
|
43
|
+
/**
|
|
44
|
+
* The highlighted row's id (controlled). A surface drawing a preview beside the
|
|
45
|
+
* list needs to know what is highlighted.
|
|
46
|
+
*/
|
|
47
|
+
active?: string;
|
|
48
|
+
onActive?: (id: string) => void;
|
|
49
|
+
/** The typed query. Uncontrolled unless a surface wants to read it. */
|
|
50
|
+
search?: string;
|
|
51
|
+
onSearch?: (search: string) => void;
|
|
52
|
+
placeholder?: string;
|
|
53
|
+
/** Shown when nothing survives the search. */
|
|
54
|
+
empty?: ReactNode;
|
|
55
|
+
/** Rows per group. See `survivors` — a render budget, not a preference. */
|
|
56
|
+
limit?: number;
|
|
57
|
+
/** The right-hand panel. Absent, the list takes the full width. */
|
|
58
|
+
children?: ReactNode;
|
|
59
|
+
/** The bar along the bottom — key hints, usually. */
|
|
60
|
+
footer?: ReactNode;
|
|
61
|
+
/** How tall the list is. It scrolls inside this. */
|
|
62
|
+
height?: number;
|
|
63
|
+
/** The dialog's accessible name. */
|
|
64
|
+
title?: string;
|
|
65
|
+
};
|
|
66
|
+
export declare function Palette({ open, onOpenChange, ops, onRun, active, onActive, search: controlled, onSearch, placeholder, empty, limit, children, footer, height, title, }: PaletteProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
//# sourceMappingURL=Palette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Palette.d.ts","sourceRoot":"","sources":["../../src/product/Palette.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAA;AAWzD,OAAO,EAAmB,KAAK,EAAE,EAAE,MAAM,SAAS,CAAA;AAElD,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,oEAAoE;IACpE,GAAG,EAAE,EAAE,EAAE,CAAA;IACT,0DAA0D;IAC1D,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,IAAI,CAAA;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mEAAmE;IACnE,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,qDAAqD;IACrD,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,YAAY,EACZ,GAAG,EACH,KAAK,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EAAE,UAAU,EAClB,QAAQ,EACR,WAAgC,EAChC,KAA2B,EAC3B,KAAK,EACL,QAAQ,EACR,MAAM,EACN,MAAY,EACZ,KAAyB,GAC1B,EAAE,YAAY,2CAqFd"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Palette — the ⌘K bar, once, for every Hanzo surface.
|
|
5
|
+
*
|
|
6
|
+
* hanzo.app, console and chat each grew their own: three lists of what can be
|
|
7
|
+
* run, all hand-written, already disagreeing with each other and with the API.
|
|
8
|
+
* This is the component half of ending that. The other half is `GET /v1/commands`,
|
|
9
|
+
* which projects every operation the cloud answers out of the one route table —
|
|
10
|
+
* so a surface passes that list in and stops maintaining one.
|
|
11
|
+
*
|
|
12
|
+
* It is composed from `CommandDialog`, not from a hand-rolled Dialog around a
|
|
13
|
+
* bare `Command`. That distinction is the whole history: the stock dialog used to
|
|
14
|
+
* render `<Command>` with none of the palette's props forwarded, so a host could
|
|
15
|
+
* not read the highlighted row and therefore could not draw a preview beside the
|
|
16
|
+
* list — and hanzo.app rebuilt the dialog by hand for exactly that reason. The
|
|
17
|
+
* forwarding landed upstream in this package and named collapsing the hand-rolled
|
|
18
|
+
* palettes as the follow-up. This is that follow-up, so the hand-rolled shape does
|
|
19
|
+
* not come back here under a new name.
|
|
20
|
+
*
|
|
21
|
+
* Props in, callbacks out, like everything else in this layer: no transport, no
|
|
22
|
+
* store, no routing. It does not fetch the commands, does not run them, and does
|
|
23
|
+
* not know what a project or an org is. `onRun` receives the Op and the surface
|
|
24
|
+
* decides whether that means an HTTP call or a function in the page — which is
|
|
25
|
+
* why a route command and a local command are one type (see `match.ts`).
|
|
26
|
+
*
|
|
27
|
+
* The right-hand slot is `children`, and it is why a shared bar costs no surface
|
|
28
|
+
* its personality: hanzo.app keeps its live project preview and console keeps its
|
|
29
|
+
* `>` AI mode by passing them, not by forking this.
|
|
30
|
+
*
|
|
31
|
+
* Filtering is `survivors`. The safe-methods-browse rule, the per-group cap and
|
|
32
|
+
* the empty-query behaviour all live in `match.ts` as pure functions, so
|
|
33
|
+
* `shouldFilter` is off and the Command primitive is left holding the cursor and
|
|
34
|
+
* the view — which is also what makes the rule testable without a DOM.
|
|
35
|
+
*/
|
|
36
|
+
import { useMemo, useState } from "react";
|
|
37
|
+
import { SizableText, XStack, YStack } from "@hanzo/gui";
|
|
38
|
+
import { CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from "../backends/gui/index.js";
|
|
39
|
+
import { SAFE, survivors } from "./match.js";
|
|
40
|
+
export function Palette({ open, onOpenChange, ops, onRun, active, onActive, search: controlled, onSearch, placeholder = "Search commands…", empty = "No results found.", limit, children, footer, height = 320, title = "Search commands", }) {
|
|
41
|
+
const [own, setOwn] = useState("");
|
|
42
|
+
const search = controlled ?? own;
|
|
43
|
+
const setSearch = (s) => {
|
|
44
|
+
setOwn(s);
|
|
45
|
+
onSearch?.(s);
|
|
46
|
+
};
|
|
47
|
+
const groups = useMemo(() => survivors(ops, search, limit), [ops, search, limit]);
|
|
48
|
+
return (_jsxs(CommandDialog, { open: open, onOpenChange: onOpenChange, title: title, description: placeholder, value: active, onValueChange: onActive, shouldFilter: false, children: [_jsx(CommandInput, { value: search, onValueChange: setSearch, placeholder: placeholder, color: "$color", placeholderTextColor: "$color11" }), _jsxs(XStack, { minH: height, children: [_jsxs(CommandList, { maxH: height, width: children ? "50%" : "100%", borderRightWidth: children ? 1 : 0, borderColor: "$borderColor", py: "$1", children: [groups.length === 0 && (_jsx(CommandEmpty, { children: _jsx(SizableText, { color: "$color11", children: empty }) })), groups.map(([group, items]) => (_jsx(CommandGroup, { heading: group, children: items.map((op) => (_jsxs(CommandItem, { value: op.id, onSelect: () => onRun(op), gap: "$2", children: [op.icon, _jsxs(XStack, { flex: 1, items: "center", gap: "$2", overflow: "hidden", children: [_jsx(SizableText, { numberOfLines: 1, shrink: 0, children: op.label }), op.hint ? (_jsx(SizableText, { numberOfLines: 1, flex: 1, fontSize: "$1", color: "$color11", children: op.hint })) : null] }), _jsx(Method, { of: op }), op.end] }, op.id))) }, group)))] }), children ? _jsx(YStack, { width: "50%", children: children }) : null] }), footer ? (_jsx(XStack, { items: "center", gap: "$4", borderTopWidth: 1, borderColor: "$borderColor", px: "$3", py: "$2", children: footer })) : null] }));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The method, at the end of the row, for route commands only.
|
|
52
|
+
*
|
|
53
|
+
* It is the rule made visible rather than decoration: GET is what you reached by
|
|
54
|
+
* browsing, anything else is what you reached by naming it exactly, and somebody
|
|
55
|
+
* about to press ↵ on `platform apps-rollback` should be able to see which
|
|
56
|
+
* without reading the docs. A local command has no method and gets no tag.
|
|
57
|
+
*/
|
|
58
|
+
function Method({ of }) {
|
|
59
|
+
if (of.method === undefined)
|
|
60
|
+
return null;
|
|
61
|
+
return (_jsx(SizableText, { shrink: 0, fontFamily: "$mono", fontSize: 10, letterSpacing: 0.4, color: of.method === SAFE ? "$color11" : "$color", children: of.method }));
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=Palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Palette.js","sourceRoot":"","sources":["../../src/product/Palette.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAkB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MA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AE,EAAE,GAAI,EACjB,EAAE,CAAC,GAAG,KApBS,EAAE,CAAC,EAAE,CAqBT,CACf,CAAC,IAxBe,KAAK,CAyBT,CAChB,CAAC,IACU,EACb,QAAQ,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,KAAK,EAAC,KAAK,YAAE,QAAQ,GAAU,CAAC,CAAC,CAAC,IAAI,IACnD,EACR,MAAM,CAAC,CAAC,CAAC,CACR,KAAC,MAAM,IACL,KAAK,EAAC,QAAQ,EACd,GAAG,EAAC,IAAI,EACR,cAAc,EAAE,CAAC,EACjB,WAAW,EAAC,cAAc,EAC1B,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,YAEN,MAAM,GACA,CACV,CAAC,CAAC,CAAC,IAAI,IACM,CACjB,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,MAAM,CAAC,EAAE,EAAE,EAAc;IAChC,IAAI,EAAE,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,IAAI,CAAA;IACxC,OAAO,CACL,KAAC,WAAW,IACV,MAAM,EAAE,CAAC,EACT,UAAU,EAAC,OAAO,EAClB,QAAQ,EAAE,EAAE,EACZ,aAAa,EAAE,GAAG,EAClB,KAAK,EAAE,EAAE,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,YAEhD,EAAE,CAAC,MAAM,GACE,CACf,CAAA;AACH,CAAC"}
|
package/dist/product/Reorder.cjs
CHANGED
|
@@ -73,7 +73,7 @@ function Reorder({ items, keyOf, rowHeight = 44, onReorder, renderItem, }) {
|
|
|
73
73
|
return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { children: items.map((item, i) => {
|
|
74
74
|
const dragging = drag?.from === i;
|
|
75
75
|
const shift = drag && to >= 0 ? rowShift(i, drag.from, to, drag.dy, rowHeight) : 0;
|
|
76
|
-
return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { height: rowHeight, justify: "center", className: "drag", style: {
|
|
76
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { height: rowHeight, justify: "center", className: "hz-drag", style: {
|
|
77
77
|
transform: `translateY(${shift}px)`,
|
|
78
78
|
zIndex: dragging ? 2 : 1,
|
|
79
79
|
...(dragging ? { transition: 'none', boxShadow: '0 8px 24px rgba(0,0,0,0.28)' } : null),
|
package/dist/product/Reorder.js
CHANGED
|
@@ -68,7 +68,7 @@ export function Reorder({ items, keyOf, rowHeight = 44, onReorder, renderItem, }
|
|
|
68
68
|
return (_jsx(YStack, { children: items.map((item, i) => {
|
|
69
69
|
const dragging = drag?.from === i;
|
|
70
70
|
const shift = drag && to >= 0 ? rowShift(i, drag.from, to, drag.dy, rowHeight) : 0;
|
|
71
|
-
return (_jsx(YStack, { height: rowHeight, justify: "center", className: "drag", style: {
|
|
71
|
+
return (_jsx(YStack, { height: rowHeight, justify: "center", className: "hz-drag", style: {
|
|
72
72
|
transform: `translateY(${shift}px)`,
|
|
73
73
|
zIndex: dragging ? 2 : 1,
|
|
74
74
|
...(dragging ? { transition: 'none', boxShadow: '0 8px 24px rgba(0,0,0,0.28)' } : null),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Reorder.js","sourceRoot":"","sources":["../../src/product/Reorder.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEnC,6EAA6E;AAC7E,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,EAAU,EAAE,IAAY,EAAE,KAAa;IAC/E,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IACxC,MAAM,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAA;IACx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AC,IAAI,EAAE,CAAC,EAAE,EAAE;YACrB,MAAM,QAAQ,GAAG,IAAI,EAAE,IAAI,KAAK,CAAC,CAAA;YACjC,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YAClF,OAAO,CACL,KAAC,MAAM,IAEL,MAAM,EAAE,SAAS,EACjB,OAAO,EAAC,QAAQ,EAChB,SAAS,EAAC,SAAS,EACnB,KAAK,EAAE;oBACL,SAAS,EAAE,cAAc,KAAK,KAAK;oBACnC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACxB,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,6BAA6B,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;iBACxF,YAEA,UAAU,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,QAAQ,CAAC,IAVnD,KAAK,CAAC,IAAI,CAAC,CAWT,CACV,CAAA;QACH,CAAC,CAAC,GACK,CACV,CAAA;AACH,CAAC"}
|
|
@@ -27,18 +27,8 @@ const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
|
|
|
27
27
|
const slot_1 = require("../backends/gui/slot.cjs");
|
|
28
28
|
const CopyButton_1 = require("./CopyButton.cjs");
|
|
29
29
|
const instrument_1 = require("./instrument.cjs");
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*
|
|
33
|
-
* `secureTextEntry` is React Native's spelling and gui DROPS it on web — an
|
|
34
|
-
* input carrying only that prop renders the secret in plain text, which is the
|
|
35
|
-
* exact opposite of what the caller asked for. `type="password"` is the web
|
|
36
|
-
* spelling and gui forwards it, being an unrecognised prop. Native ignores
|
|
37
|
-
* `type` for the same reason. So masking needs BOTH names, and neither alone is
|
|
38
|
-
* safe. `readOnly` is the same story: `editable={false}` is dropped on web.
|
|
39
|
-
*/
|
|
40
|
-
const masked = (on) => (on ? { secureTextEntry: true, type: 'password' } : { secureTextEntry: false, type: 'text' });
|
|
41
|
-
exports.masked = masked;
|
|
30
|
+
const mask_1 = require("../backends/gui/mask.cjs");
|
|
31
|
+
Object.defineProperty(exports, "masked", { enumerable: true, get: function () { return mask_1.masked; } });
|
|
42
32
|
function SecretInput({ value, onChange, placeholder, disabled, copy = true, id, }) {
|
|
43
33
|
const [shown, setShown] = (0, react_1.useState)(false);
|
|
44
34
|
const track = (0, instrument_1.useEmit)();
|
|
@@ -55,5 +45,5 @@ function SecretInput({ value, onChange, placeholder, disabled, copy = true, id,
|
|
|
55
45
|
// No handler means the caller is displaying a minted secret, not
|
|
56
46
|
// collecting one; a field that accepts keystrokes it then discards
|
|
57
47
|
// reads as broken. `readOnly`, not `editable` — see `masked`.
|
|
58
|
-
readOnly: !onChange, disabled: disabled, ...(0,
|
|
48
|
+
readOnly: !onChange, disabled: disabled, ...(0, mask_1.masked)(!shown), placeholder: placeholder, autoCapitalize: "none", autoCorrect: false, spellCheck: false }), copy && value ? (0, jsx_runtime_1.jsx)(CopyButton_1.CopyButton, { value: value, label: "Copy secret", id: id }) : null, (0, jsx_runtime_1.jsx)(gui_1.XStack, { width: 24, height: 24, items: "center", justify: "center", rounded: "$2", cursor: disabled ? 'not-allowed' : 'pointer', opacity: 0.7, onPress: disabled ? undefined : toggle, role: "button", tabIndex: 0, "aria-label": shown ? 'Hide secret' : 'Show secret', ...(0, slot_1.tip)(shown ? 'Hide' : 'Show'), hoverStyle: disabled ? undefined : { bg: '$color4', opacity: 1 }, pressStyle: disabled ? undefined : { bg: '$color5' }, children: shown ? (0, jsx_runtime_1.jsx)(lucide_icons_2_1.EyeOff, { size: 14 }) : (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Eye, { size: 14 }) })] }));
|
|
59
49
|
}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* `secureTextEntry` is React Native's spelling and gui DROPS it on web — an
|
|
5
|
-
* input carrying only that prop renders the secret in plain text, which is the
|
|
6
|
-
* exact opposite of what the caller asked for. `type="password"` is the web
|
|
7
|
-
* spelling and gui forwards it, being an unrecognised prop. Native ignores
|
|
8
|
-
* `type` for the same reason. So masking needs BOTH names, and neither alone is
|
|
9
|
-
* safe. `readOnly` is the same story: `editable={false}` is dropped on web.
|
|
10
|
-
*/
|
|
11
|
-
export declare const masked: (on: boolean) => object;
|
|
1
|
+
import { masked } from '../backends/gui/mask.js';
|
|
2
|
+
export { masked };
|
|
12
3
|
export type SecretInputProps = {
|
|
13
4
|
value: string;
|
|
14
5
|
/** Omit to render read-only — the common case for a key the server minted. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretInput.d.ts","sourceRoot":"","sources":["../../src/product/SecretInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SecretInput.d.ts","sourceRoot":"","sources":["../../src/product/SecretInput.tsx"],"names":[],"mappings":"AA0BA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAM7C,OAAO,EAAE,MAAM,EAAE,CAAA;AAEjB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,qEAAqE;IACrE,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,IAAW,EACX,EAAE,GACH,EAAE,gBAAgB,2CAkElB"}
|
|
@@ -23,17 +23,12 @@ import { Eye, EyeOff } from '@hanzogui/lucide-icons-2';
|
|
|
23
23
|
import { tip } from '../backends/gui/slot.js';
|
|
24
24
|
import { CopyButton } from './CopyButton.js';
|
|
25
25
|
import { useEmit } from './instrument.js';
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* spelling and gui forwards it, being an unrecognised prop. Native ignores
|
|
33
|
-
* `type` for the same reason. So masking needs BOTH names, and neither alone is
|
|
34
|
-
* safe. `readOnly` is the same story: `editable={false}` is dropped on web.
|
|
35
|
-
*/
|
|
36
|
-
export const masked = (on) => (on ? { secureTextEntry: true, type: 'password' } : { secureTextEntry: false, type: 'text' });
|
|
26
|
+
import { masked } from '../backends/gui/mask.js';
|
|
27
|
+
// `masked` — the props that hide a value on web AND native — is a value, so it
|
|
28
|
+
// lives in `./mask` and is reachable without a gui runtime via
|
|
29
|
+
// `@hanzo/ui/product/pure`. Re-exported here because it was published from this
|
|
30
|
+
// module and the product barrel still carries it.
|
|
31
|
+
export { masked };
|
|
37
32
|
export function SecretInput({ value, onChange, placeholder, disabled, copy = true, id, }) {
|
|
38
33
|
const [shown, setShown] = useState(false);
|
|
39
34
|
const track = useEmit();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretInput.js","sourceRoot":"","sources":["../../src/product/SecretInput.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAEtD,OAAO,EAAE,GAAG,EAAE,MA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AE,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EAC5C,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EACtC,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,gBACC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,KAC7C,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAChC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,EAChE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,YAEnD,KAAK,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,IAAI,EAAE,EAAE,GAAI,CAAC,CAAC,CAAC,KAAC,GAAG,IAAC,IAAI,EAAE,EAAE,GAAI,GAC1C,IACF,CACV,CAAA;AACH,CAAC"}
|
|
@@ -104,7 +104,7 @@ function SlideOver({ open, onClose, side = 'right', size = 420, title, icon: Ico
|
|
|
104
104
|
, {
|
|
105
105
|
// Fixed to the viewport; overflow hidden so the off-screen panel (absolute
|
|
106
106
|
// child) is CLIPPED and never adds a horizontal scrollbar.
|
|
107
|
-
overflow: "hidden", pointerEvents: open ? 'auto' : 'none', "aria-hidden": !open, style: { position: 'fixed', inset: 0, zIndex }, children: [(0, jsx_runtime_1.jsx)(gui_1.YStack, { position: "absolute", t: 0, l: 0, r: 0, b: 0, bg: "rgba(0,0,0,0.55)", className: "fade", style: { opacity: open ? 1 : 0 }, onPress: onClose }), (0, jsx_runtime_1.jsx)(gui_1.YStack
|
|
107
|
+
overflow: "hidden", pointerEvents: open ? 'auto' : 'none', "aria-hidden": !open, style: { position: 'fixed', inset: 0, zIndex }, children: [(0, jsx_runtime_1.jsx)(gui_1.YStack, { position: "absolute", t: 0, l: 0, r: 0, b: 0, bg: "rgba(0,0,0,0.55)", className: "hz-fade", style: { opacity: open ? 1 : 0 }, onPress: onClose }), (0, jsx_runtime_1.jsx)(gui_1.YStack
|
|
108
108
|
// Web DOM ref; Gui forwards it to the underlying node. Cast (not @ts-expect-error)
|
|
109
109
|
// so it is env-agnostic — the ref type is strict under the pkg build, loose here.
|
|
110
110
|
, {
|
|
@@ -118,7 +118,7 @@ function SlideOver({ open, onClose, side = 'right', size = 420, title, icon: Ico
|
|
|
118
118
|
// own, so it floats free exactly the way a modal does. It asked for a 4th
|
|
119
119
|
// rung, which is what a ladder turns into when it is treated as a palette —
|
|
120
120
|
// and the 4th was a hardcoded shadow behind a variable nothing defined.
|
|
121
|
-
className: "slide elevation-3",
|
|
121
|
+
className: "hz-slide elevation-3",
|
|
122
122
|
// Full-height sheet (100dvh — mobile-safe), inset for the notch (top) + home
|
|
123
123
|
// indicator (bottom) so the drawer header + footer actions clear them on
|
|
124
124
|
// notched devices (env insets are 0 elsewhere, so no effect there).
|