@the-portland-company/shell 0.92.0 → 0.93.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.
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { S as StandardNavIconKey, h as NavIcon, N as NavItem, i as NavBreadcrumb, j as StandardNavMode, k as NavLinkComponent, l as NavChromeFetcher, m as NavMode, o as NavUserMenu, p as NavOrgOption, d as NotificationsAdapter, q as NavFooterLink, r as NavFooter, s as NavDisplayMode } from './index-Cg5aEImm.cjs';
3
+ import { S as StandardNavIconKey, h as NavIcon, N as NavItem, i as NavBreadcrumb, j as StandardNavMode, k as NavLinkComponent, l as NavChromeFetcher, m as NavMode, o as NavUserMenu, p as NavOrgOption, d as NotificationsAdapter, q as NavFooterLink, s as NavFooter, t as NavDisplayMode } from './index-BAFJZuRA.cjs';
4
4
  import './theme-preference.cjs';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- import { S as StandardNavIconKey, h as NavIcon, N as NavItem, i as NavBreadcrumb, j as StandardNavMode, k as NavLinkComponent, l as NavChromeFetcher, m as NavMode, o as NavUserMenu, p as NavOrgOption, d as NotificationsAdapter, q as NavFooterLink, r as NavFooter, s as NavDisplayMode } from './index-DG32i0jC.js';
3
+ import { S as StandardNavIconKey, h as NavIcon, N as NavItem, i as NavBreadcrumb, j as StandardNavMode, k as NavLinkComponent, l as NavChromeFetcher, m as NavMode, o as NavUserMenu, p as NavOrgOption, d as NotificationsAdapter, q as NavFooterLink, s as NavFooter, t as NavDisplayMode } from './index-DoSs3sQY.js';
4
4
  import './theme-preference.js';
5
5
 
6
6
  /**
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { broadcastLogout, watchLogout } from './chunk-LL6LSJAH.js';
3
3
  import { writeUrlState } from './chunk-GVQKZI5X.js';
4
- import { clearBetaBannerDismissal, standardPolitogyNav, standardNavIcons, isNavItemActive, NavAppShell } from './chunk-WDVQBUWF.js';
5
- export { standardNavIcons } from './chunk-WDVQBUWF.js';
6
- import { warnDeprecated, NavChromeProvider, TopBarWidgetSlot, FuelAction, SpecOverlayAction, NotificationsAction, SupportAction, useChromeMe, useNavChromeDedupedFetch, useChromeOrgs, useNavChromeFetcher } from './chunk-ZS7MQXDQ.js';
4
+ import { clearBetaBannerDismissal, standardPolitogyNav, standardNavIcons, isNavItemActive, NavAppShell } from './chunk-EN5ANFMB.js';
5
+ export { standardNavIcons } from './chunk-EN5ANFMB.js';
6
+ import { warnDeprecated, NavChromeProvider, TopBarWidgetSlot, FuelAction, SpecOverlayAction, NotificationsAction, SupportAction, useChromeMe, useNavChromeDedupedFetch, useChromeOrgs, useNavChromeFetcher } from './chunk-Y66PVCZO.js';
7
7
  import './chunk-BHRVZPZ7.js';
8
8
  import { NAV_DISPLAY_DEFAULT, resolveNavDisplay, writeNavDisplayLocal, writeNavDisplayCookie, isNavDisplayPreference, NAV_DISPLAY_STORAGE_KEY, readNavDisplayCookie } from './chunk-7YVJ7HQG.js';
9
9
  import { authBaseUrl, orgIdTail, settingsBaseUrl, ORG_ID_QUERY_PARAM, readOrgSelectorFromUrl, matchOrgSelector, syncOrgIdInUrl, isOrgId, switchActiveOrg, ACTIVE_ORG_QUERY_PARAM, writeActiveOrgCookie, resolveActiveOrg, readActiveOrgCookie } from './chunk-5LO5W7W5.js';
@@ -1,4 +1,4 @@
1
- import { PageHeaderView, BreadcrumbBarView, resolveOrgLogoUrl, topBarIconButtonClass, TopBarTooltip, TopBarPanelArrow, NavThemeControl, NAV_DISPLAY_OPTIONS, useTopBarIconSlotGlyph, resolveBrandGlyph, TOPBAR_GLYPH_SIZE, warnDeprecated, SpeculationRulesScript } from './chunk-ZS7MQXDQ.js';
1
+ import { PageHeaderView, BreadcrumbBarView, resolveOrgLogoUrl, topBarIconButtonClass, TopBarTooltip, TopBarPanelArrow, NavThemeControl, NAV_DISPLAY_OPTIONS, useTopBarIconSlotGlyph, resolveBrandGlyph, TOPBAR_GLYPH_SIZE, resolveTabGlyph, warnDeprecated, SpeculationRulesScript } from './chunk-Y66PVCZO.js';
2
2
  import { readRailPreference, writeRailPreference } from './chunk-7YVJ7HQG.js';
3
3
  import { orgIdTail, authBaseUrl } from './chunk-5LO5W7W5.js';
4
4
  import { createContext, useRef, useEffect, useMemo, useState, Fragment as Fragment$1, useContext } from 'react';
@@ -6,6 +6,41 @@ import clsx from 'clsx';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
7
  import { LuSignpost, LuDoorOpen, LuChartNoAxesColumn, LuLandmark, LuCrosshair, LuCircleUser, LuClipboardList, LuMousePointerClick, LuUsersRound, LuLayoutDashboard, LuFlag, LuTarget, LuMapPin, LuMap, LuPhone, LuShare2, LuDollarSign, LuCreditCard, LuSettings, LuBriefcase, LuChartColumn, LuUser, LuClock, LuSend, LuFileText, LuPencil, LuUpload, LuList, LuLayoutGrid, LuLifeBuoy, LuActivity, LuMessageSquare, LuMail, LuUsers, LuHouse } from 'react-icons/lu';
8
8
 
9
+ function tabIconVarName(strip, tabKey) {
10
+ return `--tab-icon-${strip}-${tabKey}`;
11
+ }
12
+ var EMPTY = Object.freeze({});
13
+ function useTabIconStripGlyphs(strip, tabKeys) {
14
+ const [names, setNames] = useState(EMPTY);
15
+ const keysSig = tabKeys.join("\0");
16
+ useEffect(() => {
17
+ if (!strip || typeof window === "undefined" || typeof document === "undefined") {
18
+ setNames(EMPTY);
19
+ return;
20
+ }
21
+ const keys = keysSig ? keysSig.split("\0") : [];
22
+ const read = () => {
23
+ const style = window.getComputedStyle(document.documentElement);
24
+ const next = {};
25
+ for (const key of keys) {
26
+ const raw = style.getPropertyValue(tabIconVarName(strip, key)).trim().replace(/^['"]|['"]$/g, "").trim();
27
+ if (raw) next[key] = raw;
28
+ }
29
+ setNames((prev) => sameNames(prev, next) ? prev : next);
30
+ };
31
+ read();
32
+ const observer = new MutationObserver(read);
33
+ observer.observe(document.head, { childList: true, subtree: true, characterData: true });
34
+ return () => observer.disconnect();
35
+ }, [strip, keysSig]);
36
+ return names;
37
+ }
38
+ function sameNames(a, b) {
39
+ const ak = Object.keys(a);
40
+ if (ak.length !== Object.keys(b).length) return false;
41
+ return ak.every((k) => a[k] === b[k]);
42
+ }
43
+
9
44
  // src/native/orgFilter.ts
10
45
  var ORG_FILTER_THRESHOLD = 8;
11
46
  function filterOrgs(orgs, query) {
@@ -1757,9 +1792,14 @@ function NavTabStrip({
1757
1792
  linkComponent,
1758
1793
  size = "md",
1759
1794
  className,
1795
+ iconStrip,
1760
1796
  children
1761
1797
  }) {
1762
1798
  const Link = linkComponent ?? DefaultLink;
1799
+ const brandIconNames = useTabIconStripGlyphs(
1800
+ iconStrip,
1801
+ tabs.map((tab) => tab.key)
1802
+ );
1763
1803
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1764
1804
  /* @__PURE__ */ jsx(
1765
1805
  "div",
@@ -1773,7 +1813,18 @@ function NavTabStrip({
1773
1813
  "flex items-end gap-[var(--tab-gap,26px)] border-b border-[color:var(--tab-border-color,#D7DADF)]",
1774
1814
  className
1775
1815
  ].filter(Boolean).join(" "),
1776
- children: tabs.map((tab) => /* @__PURE__ */ jsx(NavTabButton, { tab, Link, size }, tab.key))
1816
+ children: tabs.map((tab) => {
1817
+ const BrandIcon = iconStrip ? resolveTabGlyph(brandIconNames[tab.key]) : null;
1818
+ return /* @__PURE__ */ jsx(
1819
+ NavTabButton,
1820
+ {
1821
+ tab: BrandIcon ? { ...tab, icon: BrandIcon } : tab,
1822
+ Link,
1823
+ size
1824
+ },
1825
+ tab.key
1826
+ );
1827
+ })
1777
1828
  }
1778
1829
  ),
1779
1830
  children !== void 0 ? /* @__PURE__ */ jsx("div", { className: "pt-5", children }) : null
@@ -1975,5 +2026,5 @@ function NavAppShell({
1975
2026
  }
1976
2027
 
1977
2028
  export { BETA_BANNER_DISMISS_KEY, BreadcrumbBar, CAMPAIGN_FEATURE_AVAILABILITY, NavAppShell, NavBetaBanner, NavSidebar, NavTabStrip, NavTopBar, PageHeader, clearBetaBannerDismissal, envChipClasses, isNavItemActive, modeIdFromLabel, shortEnvLabel, shortUserName, standardNavIcons, standardPolitogyNav };
1978
- //# sourceMappingURL=chunk-WDVQBUWF.js.map
1979
- //# sourceMappingURL=chunk-WDVQBUWF.js.map
2029
+ //# sourceMappingURL=chunk-EN5ANFMB.js.map
2030
+ //# sourceMappingURL=chunk-EN5ANFMB.js.map