@hanzo/ui 8.0.116 → 8.0.118
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/place.cjs +13 -5
- package/dist/backends/gui/place.d.ts +9 -2
- package/dist/backends/gui/place.d.ts.map +1 -1
- package/dist/backends/gui/place.js +13 -5
- package/dist/backends/gui/place.js.map +1 -1
- package/dist/product/SecretInput.cjs +2 -2
- package/dist/product/SecretInput.d.ts +8 -1
- package/dist/product/SecretInput.d.ts.map +1 -1
- package/dist/product/SecretInput.js +2 -2
- package/dist/product/SecretInput.js.map +1 -1
- package/package.json +1 -1
|
@@ -23,12 +23,20 @@ exports.place = void 0;
|
|
|
23
23
|
* side that already carries one is RE-aligned rather than appended to — so the
|
|
24
24
|
* result is always a legal placement and applying it twice changes nothing.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
26
|
+
* An align that is not named does not mean centre. A side arrives already
|
|
27
|
+
* carrying its own alignment whenever the root was given a whole placement, and
|
|
28
|
+
* only a Content that names one has anything to say about it — so the carried
|
|
29
|
+
* suffix survives, and naming `center` is how a caller re-centres on purpose.
|
|
30
|
+
*
|
|
31
|
+
* place('bottom') === 'bottom'
|
|
32
|
+
* place('bottom', 'start') === 'bottom-start'
|
|
33
|
+
* place('bottom-start') === 'bottom-start'
|
|
28
34
|
* place('bottom-end', 'start') === 'bottom-start'
|
|
35
|
+
* place('bottom-start', 'center') === 'bottom'
|
|
29
36
|
*/
|
|
30
|
-
const place = (side, align
|
|
31
|
-
const base = side.split('-')
|
|
32
|
-
|
|
37
|
+
const place = (side, align) => {
|
|
38
|
+
const [base, carried] = side.split('-');
|
|
39
|
+
const named = align ?? carried;
|
|
40
|
+
return !named || named === 'center' ? base : `${base}-${named}`;
|
|
33
41
|
};
|
|
34
42
|
exports.place = place;
|
|
@@ -24,9 +24,16 @@ export type Align = 'start' | 'center' | 'end';
|
|
|
24
24
|
* side that already carries one is RE-aligned rather than appended to — so the
|
|
25
25
|
* result is always a legal placement and applying it twice changes nothing.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* An align that is not named does not mean centre. A side arrives already
|
|
28
|
+
* carrying its own alignment whenever the root was given a whole placement, and
|
|
29
|
+
* only a Content that names one has anything to say about it — so the carried
|
|
30
|
+
* suffix survives, and naming `center` is how a caller re-centres on purpose.
|
|
31
|
+
*
|
|
32
|
+
* place('bottom') === 'bottom'
|
|
33
|
+
* place('bottom', 'start') === 'bottom-start'
|
|
34
|
+
* place('bottom-start') === 'bottom-start'
|
|
29
35
|
* place('bottom-end', 'start') === 'bottom-start'
|
|
36
|
+
* place('bottom-start', 'center') === 'bottom'
|
|
30
37
|
*/
|
|
31
38
|
export declare const place: (side: string, align?: Align) => string;
|
|
32
39
|
//# sourceMappingURL=place.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/place.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,oDAAoD;AACpD,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEtD,gDAAgD;AAChD,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;AAE9C
|
|
1
|
+
{"version":3,"file":"place.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/place.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,oDAAoD;AACpD,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEtD,gDAAgD;AAChD,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;AAE9C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,EAAE,QAAQ,KAAK,KAAG,MAInD,CAAA"}
|
|
@@ -20,12 +20,20 @@
|
|
|
20
20
|
* side that already carries one is RE-aligned rather than appended to — so the
|
|
21
21
|
* result is always a legal placement and applying it twice changes nothing.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* An align that is not named does not mean centre. A side arrives already
|
|
24
|
+
* carrying its own alignment whenever the root was given a whole placement, and
|
|
25
|
+
* only a Content that names one has anything to say about it — so the carried
|
|
26
|
+
* suffix survives, and naming `center` is how a caller re-centres on purpose.
|
|
27
|
+
*
|
|
28
|
+
* place('bottom') === 'bottom'
|
|
29
|
+
* place('bottom', 'start') === 'bottom-start'
|
|
30
|
+
* place('bottom-start') === 'bottom-start'
|
|
25
31
|
* place('bottom-end', 'start') === 'bottom-start'
|
|
32
|
+
* place('bottom-start', 'center') === 'bottom'
|
|
26
33
|
*/
|
|
27
|
-
export const place = (side, align
|
|
28
|
-
const base = side.split('-')
|
|
29
|
-
|
|
34
|
+
export const place = (side, align) => {
|
|
35
|
+
const [base, carried] = side.split('-');
|
|
36
|
+
const named = align ?? carried;
|
|
37
|
+
return !named || named === 'center' ? base : `${base}-${named}`;
|
|
30
38
|
};
|
|
31
39
|
//# sourceMappingURL=place.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place.js","sourceRoot":"","sources":["../../../src/backends/gui/place.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH
|
|
1
|
+
{"version":3,"file":"place.js","sourceRoot":"","sources":["../../../src/backends/gui/place.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,KAAa,EAAU,EAAE;IAC3D,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACvC,MAAM,KAAK,GAAG,KAAK,IAAK,OAA6B,CAAA;IACrD,OAAO,CAAC,KAAK,IAAI,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAA;AACjE,CAAC,CAAA"}
|
|
@@ -29,14 +29,14 @@ const CopyButton_1 = require("./CopyButton.cjs");
|
|
|
29
29
|
const instrument_1 = require("./instrument.cjs");
|
|
30
30
|
const mask_1 = require("../backends/gui/mask.cjs");
|
|
31
31
|
Object.defineProperty(exports, "masked", { enumerable: true, get: function () { return mask_1.masked; } });
|
|
32
|
-
function SecretInput({ value, onChange, placeholder, disabled, copy = true, id, }) {
|
|
32
|
+
function SecretInput({ value, onChange, placeholder, disabled, copy = true, id, invalid, 'aria-describedby': describedBy, }) {
|
|
33
33
|
const [shown, setShown] = (0, react_1.useState)(false);
|
|
34
34
|
const track = (0, instrument_1.useEmit)();
|
|
35
35
|
const toggle = () => {
|
|
36
36
|
track({ component: 'SecretInput', action: shown ? 'close' : 'open', id });
|
|
37
37
|
setShown((s) => !s);
|
|
38
38
|
};
|
|
39
|
-
return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$1", px: "$2", rounded: "$3", borderWidth: 1, borderColor:
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$1", px: "$2", rounded: "$3", borderWidth: 1, borderColor: invalid ? '$red10' : '$borderColor', bg: "$background", opacity: disabled ? 0.5 : 1, children: [(0, jsx_runtime_1.jsx)(gui_1.Input, { flex: 1, minW: 0, borderWidth: 0, bg: "transparent", "aria-invalid": invalid ? 'true' : undefined, "aria-describedby": describedBy, value: value, onChangeText: onChange
|
|
40
40
|
? (v) => {
|
|
41
41
|
track({ component: 'SecretInput', action: 'change', id, value: v.length });
|
|
42
42
|
onChange(v);
|
|
@@ -10,6 +10,13 @@ export type SecretInputProps = {
|
|
|
10
10
|
copy?: boolean;
|
|
11
11
|
/** Names the secret in analytics ("openai-key"). Never the value. */
|
|
12
12
|
id?: string;
|
|
13
|
+
/** Failed validation: reddens the frame AND says so to a screen reader. A
|
|
14
|
+
* colour alone is not a message, and a required key is the field's most
|
|
15
|
+
* common error. */
|
|
16
|
+
invalid?: boolean;
|
|
17
|
+
/** id of the element holding the error text, so the field announces WHY it is
|
|
18
|
+
* invalid rather than only that it is. */
|
|
19
|
+
'aria-describedby'?: string;
|
|
13
20
|
};
|
|
14
|
-
export declare function SecretInput({ value, onChange, placeholder, disabled, copy, id, }: SecretInputProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function SecretInput({ value, onChange, placeholder, disabled, copy, id, invalid, 'aria-describedby': describedBy, }: SecretInputProps): import("react/jsx-runtime").JSX.Element;
|
|
15
22
|
//# sourceMappingURL=SecretInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;IACX;;wBAEoB;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;+CAC2C;IAC3C,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,IAAW,EACX,EAAE,EACF,OAAO,EACP,kBAAkB,EAAE,WAAW,GAChC,EAAE,gBAAgB,2CAoElB"}
|
|
@@ -29,14 +29,14 @@ import { masked } from '../backends/gui/mask.js';
|
|
|
29
29
|
// `@hanzo/ui/product/pure`. Re-exported here because it was published from this
|
|
30
30
|
// module and the product barrel still carries it.
|
|
31
31
|
export { masked };
|
|
32
|
-
export function SecretInput({ value, onChange, placeholder, disabled, copy = true, id, }) {
|
|
32
|
+
export function SecretInput({ value, onChange, placeholder, disabled, copy = true, id, invalid, 'aria-describedby': describedBy, }) {
|
|
33
33
|
const [shown, setShown] = useState(false);
|
|
34
34
|
const track = useEmit();
|
|
35
35
|
const toggle = () => {
|
|
36
36
|
track({ component: 'SecretInput', action: shown ? 'close' : 'open', id });
|
|
37
37
|
setShown((s) => !s);
|
|
38
38
|
};
|
|
39
|
-
return (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", rounded: "$3", borderWidth: 1, borderColor:
|
|
39
|
+
return (_jsxs(XStack, { items: "center", gap: "$1", px: "$2", rounded: "$3", borderWidth: 1, borderColor: invalid ? '$red10' : '$borderColor', bg: "$background", opacity: disabled ? 0.5 : 1, children: [_jsx(Input, { flex: 1, minW: 0, borderWidth: 0, bg: "transparent", "aria-invalid": invalid ? 'true' : undefined, "aria-describedby": describedBy, value: value, onChangeText: onChange
|
|
40
40
|
? (v) => {
|
|
41
41
|
track({ component: 'SecretInput', action: 'change', id, value: v.length });
|
|
42
42
|
onChange(v);
|
|
@@ -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,MAAM,sBAAsB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE7C,+EAA+E;AAC/E,+DAA+D;AAC/D,gFAAgF;AAChF,kDAAkD;AAClD,OAAO,EAAE,MAAM,EAAE,CAAA;
|
|
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,MAAM,sBAAsB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,E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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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.118",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Hanzo UI — the one canonical Hanzo component library, on @hanzo/gui + @hanzo/design. ONE substrate: every component renders through @hanzo/gui primitives, so the same import works on web, native (expo) and desktop (Tauri). Self-contained (theme.css), presentational, host-agnostic, clean-room.",
|
|
6
6
|
"exports": {
|