@hanzo/ui 8.4.7 → 8.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/box.cjs +12 -3
- package/dist/box.d.ts +13 -2
- package/dist/box.d.ts.map +1 -1
- package/dist/box.js +12 -3
- package/dist/box.js.map +1 -1
- package/dist/gallery.html +1 -1
- package/package.json +1 -1
package/dist/box.cjs
CHANGED
|
@@ -49,7 +49,7 @@ const TEXT_PROPS = ['fontSize', 'lineHeight', 'fontWeight', 'letterSpacing',
|
|
|
49
49
|
// column going ragged — a 25px total measuring 27px, which no test asserting
|
|
50
50
|
// on text would notice.
|
|
51
51
|
'fontVariantNumeric'];
|
|
52
|
-
|
|
52
|
+
const BoxInner = (0, react_1.forwardRef)(function Box({ className, children, 'aria-hidden': hidden, tag, ...rest }, ref) {
|
|
53
53
|
const { props, rest: unread } = (0, tw_1.tw)(className);
|
|
54
54
|
// A View pins `min-height: 0`; a div's is `auto`, and auto is what gives a
|
|
55
55
|
// flex or grid child its automatic minimum size. Pinned, a converted child of
|
|
@@ -88,9 +88,18 @@ exports.Box = (0, react_1.forwardRef)(function Box({ className, children, 'aria-
|
|
|
88
88
|
// row with a 32px gap, where the divs they replaced sat at 592.
|
|
89
89
|
// `shrink`, not `flexShrink`: gui types the shorthand and compiles both to
|
|
90
90
|
// the same `_shrink-1`, and the DOM spelling is the one it does not carry.
|
|
91
|
-
shrink: 1, "aria-hidden": hidden === undefined ? undefined : hidden !== 'false' && hidden !== false, ...props, ...rest, className: tag ? undefined : unread || undefined, style: tag ? undefined : style, children: tag
|
|
92
|
-
? (0, react_1.createElement)(tag, { ref, className: unread || undefined, style }, children)
|
|
91
|
+
shrink: 1, "aria-hidden": hidden === undefined ? undefined : hidden !== 'false' && hidden !== false, ...props, ...(tag ? {} : rest), className: tag ? undefined : unread || undefined, style: tag ? undefined : style, children: tag
|
|
92
|
+
? (0, react_1.createElement)(tag, { ...rest, ref, className: unread || undefined, style }, children)
|
|
93
93
|
: children }));
|
|
94
94
|
return frame;
|
|
95
95
|
});
|
|
96
|
+
/**
|
|
97
|
+
* `forwardRef` cannot carry a generic through, so the props of every element
|
|
98
|
+
* collapse into a UNION — and a union demands a prop be valid for ALL of them,
|
|
99
|
+
* which makes `href`, `type` and `onSubmit` errors on the very elements that
|
|
100
|
+
* own them. The cast is what restores inference from `tag`, and it is the
|
|
101
|
+
* standard shape for a polymorphic component: the implementation stays checked
|
|
102
|
+
* against the union, the CALLER gets the one element it named.
|
|
103
|
+
*/
|
|
104
|
+
exports.Box = BoxInner;
|
|
96
105
|
exports.default = exports.Box;
|
package/dist/box.d.ts
CHANGED
|
@@ -44,9 +44,10 @@ import { type ClassValue } from './tw.js';
|
|
|
44
44
|
* component rather than as a missing generic. `style` and `ref` come from each
|
|
45
45
|
* side and are taken from gui's, which is the one that reaches the DOM.
|
|
46
46
|
*/
|
|
47
|
-
export type BoxProps<T extends keyof React.JSX.IntrinsicElements = 'div'> = Omit<React.ComponentProps<typeof YStack>, 'aria-hidden'> & Omit<React.JSX.IntrinsicElements[T], 'style' | 'ref' | 'children' | 'className' | 'color'> & {
|
|
47
|
+
export type BoxProps<T extends keyof React.JSX.IntrinsicElements = 'div'> = Omit<React.ComponentProps<typeof YStack>, 'aria-hidden' | 'ref' | keyof React.JSX.IntrinsicElements[T]> & Omit<React.JSX.IntrinsicElements[T], 'style' | 'ref' | 'children' | 'className' | 'color'> & {
|
|
48
48
|
className?: ClassValue;
|
|
49
49
|
children?: ReactNode;
|
|
50
|
+
ref?: React.Ref<any>;
|
|
50
51
|
/**
|
|
51
52
|
* The element to render. Omitted, Box is the `<div>` it has always been.
|
|
52
53
|
*/
|
|
@@ -58,6 +59,16 @@ export type BoxProps<T extends keyof React.JSX.IntrinsicElements = 'div'> = Omit
|
|
|
58
59
|
*/
|
|
59
60
|
'aria-hidden'?: boolean | 'true' | 'false';
|
|
60
61
|
};
|
|
61
|
-
|
|
62
|
+
/**
|
|
63
|
+
* `forwardRef` cannot carry a generic through, so the props of every element
|
|
64
|
+
* collapse into a UNION — and a union demands a prop be valid for ALL of them,
|
|
65
|
+
* which makes `href`, `type` and `onSubmit` errors on the very elements that
|
|
66
|
+
* own them. The cast is what restores inference from `tag`, and it is the
|
|
67
|
+
* standard shape for a polymorphic component: the implementation stays checked
|
|
68
|
+
* against the union, the CALLER gets the one element it named.
|
|
69
|
+
*/
|
|
70
|
+
export declare const Box: <T extends keyof React.JSX.IntrinsicElements = 'div'>(props: BoxProps<T> & {
|
|
71
|
+
ref?: React.Ref<any>;
|
|
72
|
+
}) => React.ReactElement | null;
|
|
62
73
|
export default Box;
|
|
63
74
|
//# sourceMappingURL=box.d.ts.map
|
package/dist/box.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../src/box.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAM,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAa1C;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../src/box.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAM,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAa1C;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,KAAK,IAMtE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EACtC,aAAa,GAAG,KAAK,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAC/D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC,GAAG;IAC3F,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACpB;;OAEG;IACH,GAAG,CAAC,EAAE,CAAC,CAAA;IACP;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;CAC3C,CAAA;AAmEH;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAe,CAAC,CAAC,SAAS,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,GAAG,KAAK,EACjF,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CAAE,KAC1C,KAAK,CAAC,YAAY,GAAG,IAAI,CAAA;eAEf,GAAG"}
|
package/dist/box.js
CHANGED
|
@@ -46,7 +46,7 @@ const TEXT_PROPS = ['fontSize', 'lineHeight', 'fontWeight', 'letterSpacing',
|
|
|
46
46
|
// column going ragged — a 25px total measuring 27px, which no test asserting
|
|
47
47
|
// on text would notice.
|
|
48
48
|
'fontVariantNumeric'];
|
|
49
|
-
|
|
49
|
+
const BoxInner = forwardRef(function Box({ className, children, 'aria-hidden': hidden, tag, ...rest }, ref) {
|
|
50
50
|
const { props, rest: unread } = tw(className);
|
|
51
51
|
// A View pins `min-height: 0`; a div's is `auto`, and auto is what gives a
|
|
52
52
|
// flex or grid child its automatic minimum size. Pinned, a converted child of
|
|
@@ -85,10 +85,19 @@ export const Box = forwardRef(function Box({ className, children, 'aria-hidden':
|
|
|
85
85
|
// row with a 32px gap, where the divs they replaced sat at 592.
|
|
86
86
|
// `shrink`, not `flexShrink`: gui types the shorthand and compiles both to
|
|
87
87
|
// the same `_shrink-1`, and the DOM spelling is the one it does not carry.
|
|
88
|
-
shrink: 1, "aria-hidden": hidden === undefined ? undefined : hidden !== 'false' && hidden !== false, ...props, ...rest, className: tag ? undefined : unread || undefined, style: tag ? undefined : style, children: tag
|
|
89
|
-
? createElement(tag, { ref, className: unread || undefined, style }, children)
|
|
88
|
+
shrink: 1, "aria-hidden": hidden === undefined ? undefined : hidden !== 'false' && hidden !== false, ...props, ...(tag ? {} : rest), className: tag ? undefined : unread || undefined, style: tag ? undefined : style, children: tag
|
|
89
|
+
? createElement(tag, { ...rest, ref, className: unread || undefined, style }, children)
|
|
90
90
|
: children }));
|
|
91
91
|
return frame;
|
|
92
92
|
});
|
|
93
|
+
/**
|
|
94
|
+
* `forwardRef` cannot carry a generic through, so the props of every element
|
|
95
|
+
* collapse into a UNION — and a union demands a prop be valid for ALL of them,
|
|
96
|
+
* which makes `href`, `type` and `onSubmit` errors on the very elements that
|
|
97
|
+
* own them. The cast is what restores inference from `tag`, and it is the
|
|
98
|
+
* standard shape for a polymorphic component: the implementation stays checked
|
|
99
|
+
* against the union, the CALLER gets the one element it named.
|
|
100
|
+
*/
|
|
101
|
+
export const Box = BoxInner;
|
|
93
102
|
export default Box;
|
|
94
103
|
//# sourceMappingURL=box.js.map
|
package/dist/box.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box.js","sourceRoot":"","sources":["../src/box.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE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AA2E;QAC3E,MAAM,EAAE,CAAC,iBACI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,KAAK,OAAO,IAAI,MAAM,KAAK,KAAK,KACjF,KAAgB,KAIjB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE,IAAe,CAAC,EACjC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,IAAI,SAAS,EAChD,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,YAK7B,GAAG;YACF,CAAC,CAAC,aAAa,CACX,GAAG,EACH,EAAE,GAAI,IAAe,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,IAAI,SAAS,EAAE,KAAK,EAAE,EACnE,QAAQ,CACT;YACH,CAAC,CAAC,QAAQ,GACL,CACV,CAAA;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAC,CAAA;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,QAEW,CAAA;AAE9B,eAAe,GAAG,CAAA"}
|
package/dist/gallery.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!doctype html><html lang="en" class="t_dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>@hanzo/ui 8.4.
|
|
1
|
+
<!doctype html><html lang="en" class="t_dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>@hanzo/ui 8.4.9</title><style>/* @hanzo/ui — generated by scripts/gen-css.mjs. Do not edit. */
|
|
2
2
|
:root { --hanzo-ui-styles: 1; }
|
|
3
3
|
/* Hanzo Design System — the entry point. Import THIS one file.
|
|
4
4
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.9",
|
|
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": {
|