@dloizides/ui-layout 1.58.0 → 1.59.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.mjs CHANGED
@@ -3636,21 +3636,29 @@ var StickyActionBar = ({
3636
3636
  var TITLE_BASIS = 280;
3637
3637
  var styles36 = StyleSheet.create({
3638
3638
  row: { flexDirection: "row", flexWrap: "wrap", alignItems: "flex-start", justifyContent: "space-between", gap: 12 },
3639
+ rowCompact: { gap: 10 },
3639
3640
  text: { gap: 4, flexGrow: 1, flexShrink: 1, flexBasis: TITLE_BASIS, minWidth: 0 },
3641
+ textCompact: { gap: 2 },
3640
3642
  title: { fontSize: 24, fontWeight: "800" },
3643
+ titleCompact: { fontSize: 22, lineHeight: 26, fontWeight: "700" },
3644
+ subtitle: { fontSize: 14, lineHeight: 20 },
3645
+ subtitleCompact: { fontSize: 12, lineHeight: 16 },
3641
3646
  actions: { flexDirection: "row", flexWrap: "wrap", alignItems: "center", gap: 8, maxWidth: "100%" }
3642
3647
  });
3643
3648
  function hasContent(node) {
3644
3649
  return node !== void 0 && node !== null && node !== false;
3645
3650
  }
3646
- var PageHead = ({ title, subtitle, actions, initialFocus = false, testID = LAYOUT_TEST_IDS.pageHead }) => {
3651
+ var PageHead = ({ title, subtitle, actions, initialFocus = false, compact, testID = LAYOUT_TEST_IDS.pageHead }) => {
3647
3652
  const { colors } = useUi().theme;
3653
+ const { width } = useWindowDimensions();
3654
+ const isCompact = compact ?? width < LAYOUT_COLLAPSE_BREAKPOINT;
3648
3655
  const titleRef = useInitialFocus();
3649
3656
  const focusProps = initialFocus ? { ref: titleRef, ...INITIAL_FOCUS_PROPS } : {};
3650
- return /* @__PURE__ */ jsxs(View, { style: styles36.row, testID, children: [
3651
- /* @__PURE__ */ jsxs(View, { style: styles36.text, children: [
3652
- /* @__PURE__ */ jsx(Text, { ...focusProps, accessibilityRole: "header", style: [styles36.title, { color: colors.text }], testID: `${testID}-title`, children: title }),
3653
- subtitle
3657
+ const subtitleNode = typeof subtitle === "string" ? /* @__PURE__ */ jsx(Text, { style: [isCompact ? styles36.subtitleCompact : styles36.subtitle, { color: colors.textSecondary }], testID: `${testID}-subtitle`, children: subtitle }) : subtitle;
3658
+ return /* @__PURE__ */ jsxs(View, { style: [styles36.row, isCompact ? styles36.rowCompact : null], testID, children: [
3659
+ /* @__PURE__ */ jsxs(View, { style: [styles36.text, isCompact ? styles36.textCompact : null], children: [
3660
+ /* @__PURE__ */ jsx(Text, { ...focusProps, accessibilityRole: "header", style: [isCompact ? styles36.titleCompact : styles36.title, { color: colors.text }], testID: `${testID}-title`, children: title }),
3661
+ subtitleNode
3654
3662
  ] }),
3655
3663
  hasContent(actions) ? /* @__PURE__ */ jsx(View, { style: styles36.actions, testID: `${testID}-actions`, children: actions }) : null
3656
3664
  ] });