@dloizides/ui-layout 1.26.4 → 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.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",
@@ -682,12 +685,18 @@ var InlineMenu = ({
682
685
  if (IS_WEB2) return createPortal(menu, document.body);
683
686
  return menu;
684
687
  };
685
- var MENU_BREAKPOINT = 768;
688
+
689
+ // src/responsive.ts
686
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;
687
697
  function resolveDropdownVariant(explicit, width, platformOS) {
688
698
  if (explicit !== void 0) return explicit;
689
- const isWideWeb = platformOS === WEB_PLATFORM && width >= MENU_BREAKPOINT;
690
- return isWideWeb ? "menu" /* Menu */ : "modal" /* Modal */;
699
+ return isWideWebViewport(width, platformOS, MENU_BREAKPOINT) ? "menu" /* Menu */ : "modal" /* Modal */;
691
700
  }
692
701
  function useResolvedDropdownVariant(explicit) {
693
702
  const { width } = useWindowDimensions();
@@ -955,11 +964,9 @@ var TabsMenu = ({
955
964
  }
956
965
  );
957
966
  };
958
- var TABS_COLLAPSE_BREAKPOINT = MENU_BREAKPOINT;
959
- var WEB_PLATFORM2 = "web";
967
+ var TABS_COLLAPSE_BREAKPOINT = LAYOUT_COLLAPSE_BREAKPOINT;
960
968
  function shouldCollapseTabs(width, platformOS, breakpoint) {
961
- const isWideWeb = platformOS === WEB_PLATFORM2 && width >= breakpoint;
962
- return !isWideWeb;
969
+ return !isWideWebViewport(width, platformOS, breakpoint);
963
970
  }
964
971
  function useTabsCollapsed(breakpoint) {
965
972
  const { width } = useWindowDimensions();
@@ -2078,6 +2085,6 @@ var BuildInfoFooter = ({
2078
2085
  );
2079
2086
  };
2080
2087
 
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 };
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 };
2082
2089
  //# sourceMappingURL=index.mjs.map
2083
2090
  //# sourceMappingURL=index.mjs.map