@dloizides/ui-layout 1.26.3 → 1.27.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 +23 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -10
- 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",
|
|
@@ -138,11 +141,14 @@ var styles3 = StyleSheet.create({
|
|
|
138
141
|
paddingHorizontal: DEFAULT_PADDING_H,
|
|
139
142
|
paddingVertical: DEFAULT_PADDING_V,
|
|
140
143
|
borderRadius: DEFAULT_BORDER_RADIUS,
|
|
141
|
-
alignSelf: "flex-start"
|
|
144
|
+
alignSelf: "flex-start",
|
|
145
|
+
// Never wider than the container: a long label wraps inside the pill instead of being clipped.
|
|
146
|
+
maxWidth: "100%"
|
|
142
147
|
},
|
|
143
148
|
text: {
|
|
144
149
|
fontSize: DEFAULT_FONT_SIZE,
|
|
145
|
-
fontWeight: "600"
|
|
150
|
+
fontWeight: "600",
|
|
151
|
+
flexShrink: 1
|
|
146
152
|
}
|
|
147
153
|
});
|
|
148
154
|
var StatusBadge = ({
|
|
@@ -679,12 +685,18 @@ var InlineMenu = ({
|
|
|
679
685
|
if (IS_WEB2) return createPortal(menu, document.body);
|
|
680
686
|
return menu;
|
|
681
687
|
};
|
|
682
|
-
|
|
688
|
+
|
|
689
|
+
// src/responsive.ts
|
|
683
690
|
var WEB_PLATFORM = "web";
|
|
691
|
+
function isWideWebViewport(width, platformOS, breakpoint = LAYOUT_COLLAPSE_BREAKPOINT) {
|
|
692
|
+
return platformOS === WEB_PLATFORM && width >= breakpoint;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
// src/ModalDropdown/resolveDropdownVariant.ts
|
|
696
|
+
var MENU_BREAKPOINT = LAYOUT_COLLAPSE_BREAKPOINT;
|
|
684
697
|
function resolveDropdownVariant(explicit, width, platformOS) {
|
|
685
698
|
if (explicit !== void 0) return explicit;
|
|
686
|
-
|
|
687
|
-
return isWideWeb ? "menu" /* Menu */ : "modal" /* Modal */;
|
|
699
|
+
return isWideWebViewport(width, platformOS, MENU_BREAKPOINT) ? "menu" /* Menu */ : "modal" /* Modal */;
|
|
688
700
|
}
|
|
689
701
|
function useResolvedDropdownVariant(explicit) {
|
|
690
702
|
const { width } = useWindowDimensions();
|
|
@@ -952,11 +964,9 @@ var TabsMenu = ({
|
|
|
952
964
|
}
|
|
953
965
|
);
|
|
954
966
|
};
|
|
955
|
-
var TABS_COLLAPSE_BREAKPOINT =
|
|
956
|
-
var WEB_PLATFORM2 = "web";
|
|
967
|
+
var TABS_COLLAPSE_BREAKPOINT = LAYOUT_COLLAPSE_BREAKPOINT;
|
|
957
968
|
function shouldCollapseTabs(width, platformOS, breakpoint) {
|
|
958
|
-
|
|
959
|
-
return !isWideWeb;
|
|
969
|
+
return !isWideWebViewport(width, platformOS, breakpoint);
|
|
960
970
|
}
|
|
961
971
|
function useTabsCollapsed(breakpoint) {
|
|
962
972
|
const { width } = useWindowDimensions();
|
|
@@ -2075,6 +2085,6 @@ var BuildInfoFooter = ({
|
|
|
2075
2085
|
);
|
|
2076
2086
|
};
|
|
2077
2087
|
|
|
2078
|
-
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 };
|
|
2088
|
+
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 };
|
|
2079
2089
|
//# sourceMappingURL=index.mjs.map
|
|
2080
2090
|
//# sourceMappingURL=index.mjs.map
|