@behivetech/organisms.site-header 1.1.1 → 1.1.2
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/index.cjs +8 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8 -1
- package/dist/index.native.js +6 -3
- package/dist/native/site-header.block.d.ts +3 -0
- package/docs.json +1 -1
- package/package.json +8 -8
- package/site-header.block.native.ts +1 -0
- package/site-header.block.ts +8 -1
- package/site-header.native.tsx +8 -2
package/dist/index.cjs
CHANGED
|
@@ -64,7 +64,14 @@ var siteHeader = (0, import_blocks.defineBlock)("BHT__SiteHeader", {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
brand: {
|
|
67
|
+
brand: {
|
|
68
|
+
display: "flex",
|
|
69
|
+
alignItems: "center",
|
|
70
|
+
minWidth: 0,
|
|
71
|
+
// Native: a flex item does not shrink unless told to, so a long brand pushed the menu button past the bar's
|
|
72
|
+
// padding. It gives way to the end of the bar, and a brand given as text is cut with an ellipsis there.
|
|
73
|
+
native: { flexShrink: 1 }
|
|
74
|
+
},
|
|
68
75
|
end: {
|
|
69
76
|
display: "flex",
|
|
70
77
|
alignItems: "center",
|
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,9 @@ declare const siteHeader: _behivetech_blocks_core.Block<"BHT__SiteHeader", {
|
|
|
25
25
|
readonly display: "flex";
|
|
26
26
|
readonly alignItems: "center";
|
|
27
27
|
readonly minWidth: 0;
|
|
28
|
+
readonly native: {
|
|
29
|
+
readonly flexShrink: 1;
|
|
30
|
+
};
|
|
28
31
|
};
|
|
29
32
|
readonly end: {
|
|
30
33
|
readonly display: "flex";
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,14 @@ var siteHeader = defineBlock("BHT__SiteHeader", {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
brand: {
|
|
38
|
+
brand: {
|
|
39
|
+
display: "flex",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
minWidth: 0,
|
|
42
|
+
// Native: a flex item does not shrink unless told to, so a long brand pushed the menu button past the bar's
|
|
43
|
+
// padding. It gives way to the end of the bar, and a brand given as text is cut with an ellipsis there.
|
|
44
|
+
native: { flexShrink: 1 }
|
|
45
|
+
},
|
|
39
46
|
end: {
|
|
40
47
|
display: "flex",
|
|
41
48
|
alignItems: "center",
|
package/dist/index.native.js
CHANGED
|
@@ -37,7 +37,8 @@ var __bht0_shared = __bhtStyleSheet.create({
|
|
|
37
37
|
display: "flex",
|
|
38
38
|
flexDirection: "row",
|
|
39
39
|
alignItems: "center",
|
|
40
|
-
minWidth: 0
|
|
40
|
+
minWidth: 0,
|
|
41
|
+
flexShrink: 1
|
|
41
42
|
},
|
|
42
43
|
__end: {
|
|
43
44
|
display: "flex",
|
|
@@ -129,7 +130,6 @@ var SiteHeader = ({
|
|
|
129
130
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
130
131
|
const { width } = useWindowDimensions();
|
|
131
132
|
const isWide = width >= WIDE_WIDTH;
|
|
132
|
-
const BrandWrapper = holdsText(brand) ? Text : View;
|
|
133
133
|
const ActionsWrapper = holdsText(actions) ? Text : View;
|
|
134
134
|
const closeMenu = () => setIsMenuOpen(false);
|
|
135
135
|
const [wasWide, setWasWide] = useState(isWide);
|
|
@@ -153,7 +153,10 @@ var SiteHeader = ({
|
|
|
153
153
|
));
|
|
154
154
|
return /* @__PURE__ */ jsxs(View, { role: "banner", ...rest, ...rootProps, children: [
|
|
155
155
|
/* @__PURE__ */ jsxs(View, { ...childProps("bar"), children: [
|
|
156
|
-
|
|
156
|
+
holdsText(brand) ? (
|
|
157
|
+
// one line, cut with an ellipsis when the bar has no room: the menu button keeps its place
|
|
158
|
+
/* @__PURE__ */ jsx(Text, { ...childProps("brand"), numberOfLines: 1, children: brand })
|
|
159
|
+
) : /* @__PURE__ */ jsx(View, { ...childProps("brand"), children: brand }),
|
|
157
160
|
/* @__PURE__ */ jsxs(View, { ...childProps("end"), children: [
|
|
158
161
|
isWide ? /* @__PURE__ */ jsx(
|
|
159
162
|
View,
|
|
@@ -20,6 +20,9 @@ export declare const siteHeader: import("@behivetech/blocks.core").Block<"BHT__S
|
|
|
20
20
|
readonly display: "flex";
|
|
21
21
|
readonly alignItems: "center";
|
|
22
22
|
readonly minWidth: 0;
|
|
23
|
+
readonly native: {
|
|
24
|
+
readonly flexShrink: 1;
|
|
25
|
+
};
|
|
23
26
|
};
|
|
24
27
|
readonly end: {
|
|
25
28
|
readonly display: "flex";
|
package/docs.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@behivetech/organisms.site-header",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A site header with a brand slot, navigation links and optional actions; once the header itself is at least `64rem` wide the links sit inline, and narrower a menu button opens them in a right-hand Drawer.",
|
|
6
6
|
"type": "module",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"tags": []
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@behivetech/atoms.button": "1.1.
|
|
43
|
-
"@behivetech/atoms.drawer": "1.1.
|
|
44
|
-
"@behivetech/atoms.nav-item": "1.1.
|
|
45
|
-
"@behivetech/blocks.core": "0.
|
|
46
|
-
"@behivetech/icons.base": "1.1.
|
|
42
|
+
"@behivetech/atoms.button": "1.1.2",
|
|
43
|
+
"@behivetech/atoms.drawer": "1.1.2",
|
|
44
|
+
"@behivetech/atoms.nav-item": "1.1.2",
|
|
45
|
+
"@behivetech/blocks.core": "0.2.0",
|
|
46
|
+
"@behivetech/icons.base": "1.1.2",
|
|
47
47
|
"@behivetech/icons.menu": "1.1.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"react-native": "*"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@behivetech/blocks.builder": "0.
|
|
56
|
-
"@behivetech/blocks.native-test": "0.0.
|
|
55
|
+
"@behivetech/blocks.builder": "0.2.0",
|
|
56
|
+
"@behivetech/blocks.native-test": "0.0.3",
|
|
57
57
|
"@bht-component-registry/env": "0.3.0",
|
|
58
58
|
"@types/react": "19.3.3",
|
|
59
59
|
"@types/react-dom": "19.3.0",
|
package/site-header.block.ts
CHANGED
|
@@ -20,7 +20,14 @@ export const siteHeader = defineBlock("BHT__SiteHeader", {
|
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
|
-
brand: {
|
|
23
|
+
brand: {
|
|
24
|
+
display: "flex",
|
|
25
|
+
alignItems: "center",
|
|
26
|
+
minWidth: 0,
|
|
27
|
+
// Native: a flex item does not shrink unless told to, so a long brand pushed the menu button past the bar's
|
|
28
|
+
// padding. It gives way to the end of the bar, and a brand given as text is cut with an ellipsis there.
|
|
29
|
+
native: { flexShrink: 1 },
|
|
30
|
+
},
|
|
24
31
|
end: {
|
|
25
32
|
display: "flex",
|
|
26
33
|
alignItems: "center",
|
package/site-header.native.tsx
CHANGED
|
@@ -69,7 +69,6 @@ export const SiteHeader = ({
|
|
|
69
69
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
70
70
|
const { width } = useWindowDimensions();
|
|
71
71
|
const isWide = width >= WIDE_WIDTH;
|
|
72
|
-
const BrandWrapper = holdsText(brand) ? Text : View;
|
|
73
72
|
const ActionsWrapper = holdsText(actions) ? Text : View;
|
|
74
73
|
|
|
75
74
|
const closeMenu = () => setIsMenuOpen(false);
|
|
@@ -101,7 +100,14 @@ export const SiteHeader = ({
|
|
|
101
100
|
return (
|
|
102
101
|
<View role="banner" {...rest} {...rootProps}>
|
|
103
102
|
<View {...childProps("bar")}>
|
|
104
|
-
|
|
103
|
+
{holdsText(brand) ? (
|
|
104
|
+
// one line, cut with an ellipsis when the bar has no room: the menu button keeps its place
|
|
105
|
+
<Text {...childProps("brand")} numberOfLines={1}>
|
|
106
|
+
{brand}
|
|
107
|
+
</Text>
|
|
108
|
+
) : (
|
|
109
|
+
<View {...childProps("brand")}>{brand}</View>
|
|
110
|
+
)}
|
|
105
111
|
<View {...childProps("end")}>
|
|
106
112
|
{isWide ? (
|
|
107
113
|
<View
|