@hanzo/ui 8.4.5 → 8.4.6
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 +11 -1
- package/dist/box.d.ts.map +1 -1
- package/dist/box.js +11 -1
- package/dist/box.js.map +1 -1
- package/dist/gallery.html +4 -3
- package/dist/styles.css +1 -0
- package/package.json +1 -1
package/dist/box.cjs
CHANGED
|
@@ -42,7 +42,13 @@ const tw_1 = require("./tw.cjs");
|
|
|
42
42
|
/** Properties a frame ignores and a DOM element passes to its children. */
|
|
43
43
|
const TEXT_PROPS = ['fontSize', 'lineHeight', 'fontWeight', 'letterSpacing',
|
|
44
44
|
'textTransform', 'fontFamily', 'fontStyle', 'textAlign', 'color',
|
|
45
|
-
'textDecorationLine', 'whiteSpace'
|
|
45
|
+
'textDecorationLine', 'whiteSpace',
|
|
46
|
+
// `tabular-nums` is the one class on a checkout that MUST survive: it is what
|
|
47
|
+
// makes a column of figures line up. tw converts it to fontVariantNumeric,
|
|
48
|
+
// which a frame drops like the rest of these, and the loss shows as a money
|
|
49
|
+
// column going ragged — a 25px total measuring 27px, which no test asserting
|
|
50
|
+
// on text would notice.
|
|
51
|
+
'fontVariantNumeric'];
|
|
46
52
|
exports.Box = (0, react_1.forwardRef)(function Box({ className, children, 'aria-hidden': hidden, tag, ...rest }, ref) {
|
|
47
53
|
const { props, rest: unread } = (0, tw_1.tw)(className);
|
|
48
54
|
// A View pins `min-height: 0`; a div's is `auto`, and auto is what gives a
|
|
@@ -50,6 +56,10 @@ exports.Box = (0, react_1.forwardRef)(function Box({ className, children, 'aria-
|
|
|
50
56
|
// a row of indefinite height measured 0px and its content vanished.
|
|
51
57
|
if (!('minHeight' in props))
|
|
52
58
|
props.minHeight = 'auto';
|
|
59
|
+
// The same fact on the other axis. A View pins `min-width: 0`, a div's is
|
|
60
|
+
// auto, and auto is what stops a flex child shrinking below its content.
|
|
61
|
+
if (!('minWidth' in props))
|
|
62
|
+
props.minWidth = 'auto';
|
|
53
63
|
// gui drops a text property set on a frame — `fontSize` is not a frame style
|
|
54
64
|
// prop, so it silently rendered at the inherited size and a page carrying
|
|
55
65
|
// `text-xs` on a box came out three pixels larger everywhere. A div DOES pass
|
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;
|
|
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,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,aAAa,CAAC,GAAG;IAChF,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAA;IACvC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;CAC3C,CAAA;AAED,eAAO,MAAM,GAAG,uGAwDd,CAAA;eAEa,GAAG"}
|
package/dist/box.js
CHANGED
|
@@ -39,7 +39,13 @@ import { tw } from './tw.js';
|
|
|
39
39
|
/** Properties a frame ignores and a DOM element passes to its children. */
|
|
40
40
|
const TEXT_PROPS = ['fontSize', 'lineHeight', 'fontWeight', 'letterSpacing',
|
|
41
41
|
'textTransform', 'fontFamily', 'fontStyle', 'textAlign', 'color',
|
|
42
|
-
'textDecorationLine', 'whiteSpace'
|
|
42
|
+
'textDecorationLine', 'whiteSpace',
|
|
43
|
+
// `tabular-nums` is the one class on a checkout that MUST survive: it is what
|
|
44
|
+
// makes a column of figures line up. tw converts it to fontVariantNumeric,
|
|
45
|
+
// which a frame drops like the rest of these, and the loss shows as a money
|
|
46
|
+
// column going ragged — a 25px total measuring 27px, which no test asserting
|
|
47
|
+
// on text would notice.
|
|
48
|
+
'fontVariantNumeric'];
|
|
43
49
|
export const Box = forwardRef(function Box({ className, children, 'aria-hidden': hidden, tag, ...rest }, ref) {
|
|
44
50
|
const { props, rest: unread } = tw(className);
|
|
45
51
|
// A View pins `min-height: 0`; a div's is `auto`, and auto is what gives a
|
|
@@ -47,6 +53,10 @@ export const Box = forwardRef(function Box({ className, children, 'aria-hidden':
|
|
|
47
53
|
// a row of indefinite height measured 0px and its content vanished.
|
|
48
54
|
if (!('minHeight' in props))
|
|
49
55
|
props.minHeight = 'auto';
|
|
56
|
+
// The same fact on the other axis. A View pins `min-width: 0`, a div's is
|
|
57
|
+
// auto, and auto is what stops a flex child shrinking below its content.
|
|
58
|
+
if (!('minWidth' in props))
|
|
59
|
+
props.minWidth = 'auto';
|
|
50
60
|
// gui drops a text property set on a frame — `fontSize` is not a frame style
|
|
51
61
|
// prop, so it silently rendered at the inherited size and a page carrying
|
|
52
62
|
// `text-xs` on a box came out three pixels larger everywhere. A div DOES pass
|
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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