@the-portland-company/shell 0.89.0 → 0.90.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.
@@ -72,6 +72,21 @@ function Card({
72
72
  function FormColumn({ children, className }) {
73
73
  return /* @__PURE__ */ jsx("div", { "data-shell-form-column": "", className: clsx("w-full max-w-[960px]", className), children });
74
74
  }
75
+
76
+ // src/lib/deprecation.ts
77
+ var warned = /* @__PURE__ */ new Set();
78
+ function isDev() {
79
+ try {
80
+ return typeof process !== "undefined" && process.env?.NODE_ENV !== "production";
81
+ } catch {
82
+ return false;
83
+ }
84
+ }
85
+ function warnDeprecated(key, message) {
86
+ if (!isDev() || warned.has(key)) return;
87
+ warned.add(key);
88
+ console.warn(`[@the-portland-company/shell] ${message}`);
89
+ }
75
90
  var VARIANT_CLASS = {
76
91
  primary: "border border-transparent bg-[color:var(--app-btn-primary-bg,var(--color-accent))] text-[color:var(--app-btn-primary-fg,var(--color-white))] hover:bg-[color:var(--app-btn-primary-bg-hover,var(--color-accent-hover))]",
77
92
  secondary: "border border-[color:var(--app-btn-secondary-border,var(--color-border))] bg-[color:var(--app-btn-secondary-bg,var(--color-white))] text-[color:var(--app-btn-secondary-fg,var(--color-text))] hover:bg-[color:var(--app-btn-secondary-bg-hover,var(--color-bg))]",
@@ -377,21 +392,6 @@ var FileInput = forwardRef(function FileInput2({ label, helperText, error, inval
377
392
  );
378
393
  });
379
394
  var FileInput_default = FileInput;
380
-
381
- // src/lib/deprecation.ts
382
- var warned = /* @__PURE__ */ new Set();
383
- function isDev() {
384
- try {
385
- return typeof process !== "undefined" && process.env?.NODE_ENV !== "production";
386
- } catch {
387
- return false;
388
- }
389
- }
390
- function warnDeprecated(key, message) {
391
- if (!isDev() || warned.has(key)) return;
392
- warned.add(key);
393
- console.warn(`[@the-portland-company/shell] ${message}`);
394
- }
395
395
  function useTopBarIconSlotGlyph(slot) {
396
396
  const [name, setName] = useState(null);
397
397
  useEffect(() => {
@@ -2490,60 +2490,65 @@ var MODE_EYEBROW_LABEL = {
2490
2490
  campaign: "Campaign mode",
2491
2491
  petition: "Petition mode"
2492
2492
  };
2493
- var resolveMaxWidthClass = (maxW) => {
2494
- if (maxW === "full") return "max-w-none";
2495
- if (maxW === "container.lg") return "max-w-6xl";
2496
- if (maxW === "container.md") return "max-w-5xl";
2497
- return "max-w-7xl";
2498
- };
2493
+ var EMAIL_PATTERN = /[^\s@]+@[^\s@]+\.[^\s@]+/;
2499
2494
  function PageHeaderView({
2500
- renderCrumbLink,
2501
2495
  title,
2502
2496
  mode,
2503
2497
  eyebrow,
2504
2498
  showEyebrow = true,
2505
2499
  subtitle,
2506
- breadcrumbs = [],
2500
+ breadcrumbs,
2507
2501
  actions = null,
2508
2502
  tabBar = null,
2509
- maxW = "full",
2503
+ maxW,
2510
2504
  hideSidebar = false
2511
2505
  }) {
2512
- const maxWClass = resolveMaxWidthClass(maxW);
2513
- const titleText = typeof title === "string" ? title.trim() : "";
2514
- const normalizedTitle = titleText.toLowerCase();
2515
- const breadcrumbsWithoutCurrent = [...breadcrumbs];
2516
- const last = breadcrumbsWithoutCurrent[breadcrumbsWithoutCurrent.length - 1];
2517
- if (breadcrumbsWithoutCurrent.length > 1 && normalizedTitle && last && last.label.trim().toLowerCase() === normalizedTitle) {
2518
- breadcrumbsWithoutCurrent.pop();
2506
+ if (breadcrumbs !== void 0) {
2507
+ warnDeprecated(
2508
+ "PageHeader.breadcrumbs",
2509
+ '<PageHeader breadcrumbs> is deprecated and renders nothing: the breadcrumb trail is retired (Reference/UI-Platform \u2192 "Page header"). Remove the prop.'
2510
+ );
2511
+ }
2512
+ if (maxW !== void 0) {
2513
+ warnDeprecated(
2514
+ "PageHeader.maxW",
2515
+ "<PageHeader maxW> is deprecated and ignored: the header spans its container. Use <FormColumn> (960px) or the fluid frame for page width."
2516
+ );
2517
+ }
2518
+ if (typeof title === "string" && EMAIL_PATTERN.test(title) || typeof subtitle === "string" && EMAIL_PATTERN.test(subtitle)) {
2519
+ warnDeprecated(
2520
+ "PageHeader.email",
2521
+ `<PageHeader> title/subtitle contains an email address. The user's email never appears in the page header (Reference/UI-Platform \u2192 "Page header"); identity lives in the left bar footer.`
2522
+ );
2519
2523
  }
2520
2524
  const eyebrowText = showEyebrow ? eyebrow ?? (mode ? MODE_EYEBROW_LABEL[mode] : void 0) : void 0;
2521
- if (!title && !eyebrowText && breadcrumbsWithoutCurrent.length === 0 && !actions && !tabBar) {
2525
+ if (!title && !eyebrowText && !actions && !tabBar) {
2522
2526
  return null;
2523
2527
  }
2524
2528
  return /* @__PURE__ */ jsxs(
2525
2529
  "div",
2526
2530
  {
2527
- style: { backgroundColor: "var(--app-tab-header-bg, #888888)" },
2528
- className: clsx("text-slate-100", tabBar ? "pt-3 pb-0" : "py-3 border-b border-gray-200", {
2531
+ "data-shell-page-header": "",
2532
+ className: clsx("pt-[22px] text-[color:var(--color-text,#2F3136)]", tabBar ? "pb-0" : "pb-4", {
2529
2533
  "md:ml-60": !hideSidebar
2530
2534
  }),
2531
2535
  children: [
2532
- /* @__PURE__ */ jsx("div", { className: clsx("w-full px-4", maxWClass), children: /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-nowrap items-start justify-between gap-4", children: [
2536
+ /* @__PURE__ */ jsx("div", { className: "w-full px-4 md:px-6", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-nowrap items-start justify-between gap-4", children: [
2533
2537
  /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
2534
2538
  eyebrowText ? /* @__PURE__ */ jsx(
2535
2539
  "div",
2536
2540
  {
2537
2541
  className: "truncate text-[11px] font-bold uppercase leading-[1.2] tracking-[0.09em]",
2538
- style: { color: "var(--mode-accent, var(--color-accent, #E63946))" },
2542
+ style: { color: "var(--color-accent-fg, var(--mode-accent, var(--color-accent, #E63946)))" },
2539
2543
  children: eyebrowText
2540
2544
  }
2541
2545
  ) : null,
2542
2546
  title ? /* @__PURE__ */ jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsx(
2543
- "div",
2547
+ "h1",
2544
2548
  {
2545
- className: "truncate font-bold text-white",
2549
+ className: "m-0 truncate font-bold",
2546
2550
  style: {
2551
+ color: "var(--color-text, #2F3136)",
2547
2552
  fontFamily: "var(--font-family, ui-sans-serif, system-ui, sans-serif)",
2548
2553
  fontSize: "var(--type-h2-size, 1.875rem)",
2549
2554
  lineHeight: "var(--type-h2-line-height, 1.25)"
@@ -2551,25 +2556,7 @@ function PageHeaderView({
2551
2556
  children: title
2552
2557
  }
2553
2558
  ) }) : null,
2554
- subtitle ? /* @__PURE__ */ jsx("div", { className: "mt-1 truncate text-[15px] text-[color:var(--color-g4,#929599)]", children: subtitle }) : null,
2555
- breadcrumbsWithoutCurrent.length > 0 ? /* @__PURE__ */ jsx(
2556
- "nav",
2557
- {
2558
- "aria-label": "Breadcrumb",
2559
- className: clsx("min-w-0 text-slate-100", title ? "mt-1" : ""),
2560
- children: /* @__PURE__ */ jsx("ol", { className: "flex flex-nowrap items-center gap-2 overflow-hidden text-sm text-gray-600", children: breadcrumbsWithoutCurrent.map((item, index) => /* @__PURE__ */ jsxs(
2561
- "li",
2562
- {
2563
- className: "flex min-w-0 flex-shrink-0 items-center gap-2",
2564
- children: [
2565
- index > 0 ? /* @__PURE__ */ jsx("span", { className: "text-gray-400", children: ">" }) : null,
2566
- item.href ? renderCrumbLink(item.href, item.label, "truncate text-slate-100 hover:underline") : /* @__PURE__ */ jsx("span", { className: "truncate text-slate-100", children: item.label })
2567
- ]
2568
- },
2569
- `${item.label}-${index}`
2570
- )) })
2571
- }
2572
- ) : null
2559
+ subtitle ? /* @__PURE__ */ jsx("div", { className: "mt-1 truncate text-[15px] text-[color:var(--color-g4,#58657A)]", children: subtitle }) : null
2573
2560
  ] }),
2574
2561
  actions ? /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: actions }) : null
2575
2562
  ] }) }),
@@ -2609,5 +2596,5 @@ function BreadcrumbBarView({
2609
2596
  }
2610
2597
 
2611
2598
  export { BreadcrumbBarView, Button_default, CORE_APP_ORIGIN, CORE_BILLING_PATH, CREDIT_TYPE_LABELS, CREDIT_TYPE_ORDER, Card, Checkbox_default, CreditsAction, FileInput_default, FormColumn, FuelAction, HeaderTabBar, Input_default, NAV_DISPLAY_OPTIONS, NavChromeProvider, NavDisplayAction, NavThemeControl, NotificationsAction, PageHeaderView, SPECS_ORIGIN, Select_default, SpecOverlayAction, SpeculationRulesScript, SupportAction, TOPBAR_GLYPH_SIZE, Textarea_default, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, buildNavSpeculationRules, buildSpeculationRules, collectSiblingAppUrls, createCommsNotificationsAdapter, creditGaugeRatio, creditStateWord, creditTooltipLine, creditsAriaLabel, creditsIconState, emptyNotificationsFeed, normalizeNotificationsFeed, resolveBrandGlyph, resolveOrgLogoUrl, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeDedupedFetch, useNavChromeFetcher, useThemePreference, useTopBarIconSlotGlyph, warnDeprecated };
2612
- //# sourceMappingURL=chunk-J23MTK56.js.map
2613
- //# sourceMappingURL=chunk-J23MTK56.js.map
2599
+ //# sourceMappingURL=chunk-VBDI7UZS.js.map
2600
+ //# sourceMappingURL=chunk-VBDI7UZS.js.map