@dloizides/ui-layout 1.26.4 → 1.28.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.d.mts +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +38 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -99,6 +99,9 @@ var LAYOUT_I18N = {
|
|
|
99
99
|
/** `BuildInfoFooter`: accessible hint on the version caption (the visible `v<version>` is the label). */
|
|
100
100
|
buildInfoHint: "common.buildInfoHint"
|
|
101
101
|
};
|
|
102
|
+
var TYPE_SCALE_BREAKPOINT = 600;
|
|
103
|
+
var LAYOUT_COLLAPSE_BREAKPOINT = 768;
|
|
104
|
+
var MIN_TARGET_PX = 44;
|
|
102
105
|
var styles2 = StyleSheet.create({
|
|
103
106
|
heading: {
|
|
104
107
|
fontWeight: "700",
|
|
@@ -192,6 +195,8 @@ var styles4 = StyleSheet.create({
|
|
|
192
195
|
borderWidth: BORDER_WIDTH
|
|
193
196
|
},
|
|
194
197
|
segment: {
|
|
198
|
+
minHeight: MIN_TARGET_PX,
|
|
199
|
+
justifyContent: "center",
|
|
195
200
|
paddingHorizontal: SEGMENT_PAD_H,
|
|
196
201
|
paddingVertical: SEGMENT_PAD_V,
|
|
197
202
|
borderRadius: SEGMENT_RADIUS
|
|
@@ -682,12 +687,18 @@ var InlineMenu = ({
|
|
|
682
687
|
if (IS_WEB2) return createPortal(menu, document.body);
|
|
683
688
|
return menu;
|
|
684
689
|
};
|
|
685
|
-
|
|
690
|
+
|
|
691
|
+
// src/responsive.ts
|
|
686
692
|
var WEB_PLATFORM = "web";
|
|
693
|
+
function isWideWebViewport(width, platformOS, breakpoint = LAYOUT_COLLAPSE_BREAKPOINT) {
|
|
694
|
+
return platformOS === WEB_PLATFORM && width >= breakpoint;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
// src/ModalDropdown/resolveDropdownVariant.ts
|
|
698
|
+
var MENU_BREAKPOINT = LAYOUT_COLLAPSE_BREAKPOINT;
|
|
687
699
|
function resolveDropdownVariant(explicit, width, platformOS) {
|
|
688
700
|
if (explicit !== void 0) return explicit;
|
|
689
|
-
|
|
690
|
-
return isWideWeb ? "menu" /* Menu */ : "modal" /* Modal */;
|
|
701
|
+
return isWideWebViewport(width, platformOS, MENU_BREAKPOINT) ? "menu" /* Menu */ : "modal" /* Modal */;
|
|
691
702
|
}
|
|
692
703
|
function useResolvedDropdownVariant(explicit) {
|
|
693
704
|
const { width } = useWindowDimensions();
|
|
@@ -955,11 +966,9 @@ var TabsMenu = ({
|
|
|
955
966
|
}
|
|
956
967
|
);
|
|
957
968
|
};
|
|
958
|
-
var TABS_COLLAPSE_BREAKPOINT =
|
|
959
|
-
var WEB_PLATFORM2 = "web";
|
|
969
|
+
var TABS_COLLAPSE_BREAKPOINT = LAYOUT_COLLAPSE_BREAKPOINT;
|
|
960
970
|
function shouldCollapseTabs(width, platformOS, breakpoint) {
|
|
961
|
-
|
|
962
|
-
return !isWideWeb;
|
|
971
|
+
return !isWideWebViewport(width, platformOS, breakpoint);
|
|
963
972
|
}
|
|
964
973
|
function useTabsCollapsed(breakpoint) {
|
|
965
974
|
const { width } = useWindowDimensions();
|
|
@@ -1123,9 +1132,16 @@ var styles9 = StyleSheet.create({
|
|
|
1123
1132
|
},
|
|
1124
1133
|
title: { fontSize: TITLE_FONT_SIZE, fontWeight: "700", marginBottom: TITLE_MARGIN_BOTTOM },
|
|
1125
1134
|
message: { fontSize: MESSAGE_FONT_SIZE, marginBottom: MESSAGE_MARGIN_BOTTOM },
|
|
1126
|
-
cta: {
|
|
1135
|
+
cta: {
|
|
1136
|
+
minHeight: MIN_TARGET_PX,
|
|
1137
|
+
paddingVertical: BUTTON_PADDING_V,
|
|
1138
|
+
borderRadius: BUTTON_BORDER_RADIUS,
|
|
1139
|
+
alignItems: "center",
|
|
1140
|
+
justifyContent: "center",
|
|
1141
|
+
marginBottom: CTA_MARGIN_BOTTOM
|
|
1142
|
+
},
|
|
1127
1143
|
ctaText: { fontSize: BUTTON_FONT_SIZE, fontWeight: "700" },
|
|
1128
|
-
dismiss: { alignItems: "center", paddingVertical: BUTTON_PADDING_V },
|
|
1144
|
+
dismiss: { minHeight: MIN_TARGET_PX, alignItems: "center", justifyContent: "center", paddingVertical: BUTTON_PADDING_V },
|
|
1129
1145
|
dismissText: { fontSize: DISMISS_FONT_SIZE }
|
|
1130
1146
|
});
|
|
1131
1147
|
var UpgradePrompt = ({
|
|
@@ -1555,6 +1571,8 @@ var styles14 = StyleSheet.create({
|
|
|
1555
1571
|
flexDirection: "row",
|
|
1556
1572
|
alignItems: "center",
|
|
1557
1573
|
justifyContent: "space-between",
|
|
1574
|
+
// Hit box floor on the pressable header box itself (mobile-first.md); padding alone gave 35px.
|
|
1575
|
+
minHeight: MIN_TARGET_PX,
|
|
1558
1576
|
paddingHorizontal: HEADER_PADDING_H,
|
|
1559
1577
|
paddingVertical: HEADER_PADDING_V
|
|
1560
1578
|
},
|
|
@@ -1932,7 +1950,13 @@ var styles16 = StyleSheet.create({
|
|
|
1932
1950
|
fontWeight: "600",
|
|
1933
1951
|
paddingHorizontal: ACTION_PADDING_H,
|
|
1934
1952
|
paddingVertical: ACTION_PADDING_V,
|
|
1935
|
-
borderRadius: ACTION_RADIUS
|
|
1953
|
+
borderRadius: ACTION_RADIUS,
|
|
1954
|
+
// 44x44 hit box on the rendered box (it measured 40x20). `lineHeight` = the floor keeps the
|
|
1955
|
+
// label vertically centred without wrapping the Text in another element.
|
|
1956
|
+
minHeight: MIN_TARGET_PX,
|
|
1957
|
+
minWidth: MIN_TARGET_PX,
|
|
1958
|
+
lineHeight: MIN_TARGET_PX,
|
|
1959
|
+
textAlign: "center"
|
|
1936
1960
|
}
|
|
1937
1961
|
});
|
|
1938
1962
|
var TONE_STEP = "500";
|
|
@@ -2078,6 +2102,6 @@ var BuildInfoFooter = ({
|
|
|
2078
2102
|
);
|
|
2079
2103
|
};
|
|
2080
2104
|
|
|
2081
|
-
export { API_COMMIT_SEPARATOR, Accordion, AccordionItem, BUILD_INFO_PREFIX, BuildInfoFooter, COPY_FEEDBACK_MS, ConfirmDialog, CopyStatus, CopyableId, DEFAULT_BILLING_ROUTE, DropdownVariant, ELLIPSIS, Heading, LAYOUT_I18N, LAYOUT_TEST_IDS, Modal3 as Modal, ModalDropdown, ModalShell, Section, SegmentedControl, StatusBadge, Tabs, TabsCollapsedTrigger, TruncatedText, UpgradePrompt, copyText, formatBuildInfo, formatUrlForDisplay, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap };
|
|
2105
|
+
export { API_COMMIT_SEPARATOR, Accordion, AccordionItem, BUILD_INFO_PREFIX, BuildInfoFooter, COPY_FEEDBACK_MS, ConfirmDialog, CopyStatus, CopyableId, DEFAULT_BILLING_ROUTE, DropdownVariant, ELLIPSIS, Heading, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, MIN_TARGET_PX, Modal3 as Modal, ModalDropdown, ModalShell, Section, SegmentedControl, StatusBadge, TYPE_SCALE_BREAKPOINT, Tabs, TabsCollapsedTrigger, TruncatedText, UpgradePrompt, copyText, formatBuildInfo, formatUrlForDisplay, isWideWebViewport, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap };
|
|
2082
2106
|
//# sourceMappingURL=index.mjs.map
|
|
2083
2107
|
//# sourceMappingURL=index.mjs.map
|