@homebound/beam 3.101.0 → 3.102.0
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 +50 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +61 -13
- package/dist/index.js.map +1 -1
- package/dist/truss.css +2 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -21981,9 +21981,20 @@ var import_jsx_runtime149 = require("react/jsx-runtime");
|
|
|
21981
21981
|
function HeaderActions(props) {
|
|
21982
21982
|
const {
|
|
21983
21983
|
actions,
|
|
21984
|
+
collapseOnSm = false,
|
|
21984
21985
|
...otherProps
|
|
21985
21986
|
} = props;
|
|
21986
21987
|
const tid = useTestIds(otherProps, "headerActions");
|
|
21988
|
+
const {
|
|
21989
|
+
sm
|
|
21990
|
+
} = useBreakpoint();
|
|
21991
|
+
const collapse = collapseOnSm && sm && actions.length > 1;
|
|
21992
|
+
if (collapse) {
|
|
21993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "df aic gap1 fs0", ...tid, children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(ButtonMenu, { trigger: {
|
|
21994
|
+
icon: "verticalDots",
|
|
21995
|
+
variant: "outline"
|
|
21996
|
+
}, items: toMenuItems(actions) }) });
|
|
21997
|
+
}
|
|
21987
21998
|
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "df aic gap1 fs0", ...tid, children: actions.map((action, i) => {
|
|
21988
21999
|
const key = headerActionKey(action, i);
|
|
21989
22000
|
if (action.kind === "icon") {
|
|
@@ -22003,7 +22014,38 @@ function HeaderActions(props) {
|
|
|
22003
22014
|
function headerActionKey(action, index) {
|
|
22004
22015
|
if (action.kind === "icon") return `${action.icon}-${index}`;
|
|
22005
22016
|
if (action.kind === "menu") return `menu-${index}`;
|
|
22006
|
-
return `${
|
|
22017
|
+
return `${action.label}-${index}`;
|
|
22018
|
+
}
|
|
22019
|
+
function toMenuItems(actions) {
|
|
22020
|
+
return actions.flatMap((action) => {
|
|
22021
|
+
if (action.kind === "menu") return action.items;
|
|
22022
|
+
const {
|
|
22023
|
+
label,
|
|
22024
|
+
onClick,
|
|
22025
|
+
disabled
|
|
22026
|
+
} = action;
|
|
22027
|
+
const itemOnClick = typeof onClick === "string" ? onClick : () => void onClick({});
|
|
22028
|
+
if (action.kind === "icon") {
|
|
22029
|
+
return [{
|
|
22030
|
+
label,
|
|
22031
|
+
onClick: itemOnClick,
|
|
22032
|
+
disabled,
|
|
22033
|
+
icon: action.icon
|
|
22034
|
+
}];
|
|
22035
|
+
}
|
|
22036
|
+
return [{
|
|
22037
|
+
label,
|
|
22038
|
+
onClick: itemOnClick,
|
|
22039
|
+
disabled,
|
|
22040
|
+
// Buttons can opt out of their default icon with `icon: null`, which menu items can't render.
|
|
22041
|
+
...action.icon ? {
|
|
22042
|
+
icon: action.icon
|
|
22043
|
+
} : {},
|
|
22044
|
+
...action.variant === "danger" ? {
|
|
22045
|
+
destructive: true
|
|
22046
|
+
} : {}
|
|
22047
|
+
}];
|
|
22048
|
+
});
|
|
22007
22049
|
}
|
|
22008
22050
|
|
|
22009
22051
|
// src/components/Headers/ContentHeader.tsx
|
|
@@ -25904,6 +25946,7 @@ function InlineFeedbackBanner(props) {
|
|
|
25904
25946
|
/* @__PURE__ */ (0, import_jsx_runtime203.jsx)("span", { ...(0, import_runtime127.trussProps)({
|
|
25905
25947
|
flexGrow: "fg1",
|
|
25906
25948
|
minWidth: "mw0",
|
|
25949
|
+
paddingTop: "pt_1px",
|
|
25907
25950
|
color: ["color_var", {
|
|
25908
25951
|
"--color": "var(--b-on-surface)"
|
|
25909
25952
|
}]
|
|
@@ -28673,10 +28716,15 @@ var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
|
28673
28716
|
function PageHeader2(props) {
|
|
28674
28717
|
const {
|
|
28675
28718
|
tabs,
|
|
28719
|
+
actions,
|
|
28720
|
+
rightSlot,
|
|
28676
28721
|
...otherProps
|
|
28677
28722
|
} = props;
|
|
28678
28723
|
const tid = useTestIds(otherProps, "header");
|
|
28679
|
-
return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(BaseHeader, { ...otherProps,
|
|
28724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(BaseHeader, { ...otherProps, rightSlot: /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)(import_jsx_runtime233.Fragment, { children: [
|
|
28725
|
+
rightSlot,
|
|
28726
|
+
actions && actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(HeaderActions, { actions, collapseOnSm: true })
|
|
28727
|
+
] }), bottomSlot: tabs && /* @__PURE__ */ (0, import_jsx_runtime233.jsx)("div", { ...(0, import_runtime150.trussProps)(pageContentPaddingX), children: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(Tabs, { ...tabs, ...tid.tabs }) }) });
|
|
28680
28728
|
}
|
|
28681
28729
|
|
|
28682
28730
|
// src/layouts/useBannerAndNavbarHeight.ts
|