@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.
package/dist/native.cjs CHANGED
@@ -2217,60 +2217,65 @@ var MODE_EYEBROW_LABEL = {
2217
2217
  campaign: "Campaign mode",
2218
2218
  petition: "Petition mode"
2219
2219
  };
2220
- var resolveMaxWidthClass = (maxW) => {
2221
- if (maxW === "full") return "max-w-none";
2222
- if (maxW === "container.lg") return "max-w-6xl";
2223
- if (maxW === "container.md") return "max-w-5xl";
2224
- return "max-w-7xl";
2225
- };
2220
+ var EMAIL_PATTERN = /[^\s@]+@[^\s@]+\.[^\s@]+/;
2226
2221
  function PageHeaderView({
2227
- renderCrumbLink,
2228
2222
  title,
2229
2223
  mode,
2230
2224
  eyebrow,
2231
2225
  showEyebrow = true,
2232
2226
  subtitle,
2233
- breadcrumbs = [],
2227
+ breadcrumbs,
2234
2228
  actions = null,
2235
2229
  tabBar = null,
2236
- maxW = "full",
2230
+ maxW,
2237
2231
  hideSidebar = false
2238
2232
  }) {
2239
- const maxWClass = resolveMaxWidthClass(maxW);
2240
- const titleText = typeof title === "string" ? title.trim() : "";
2241
- const normalizedTitle = titleText.toLowerCase();
2242
- const breadcrumbsWithoutCurrent = [...breadcrumbs];
2243
- const last = breadcrumbsWithoutCurrent[breadcrumbsWithoutCurrent.length - 1];
2244
- if (breadcrumbsWithoutCurrent.length > 1 && normalizedTitle && last && last.label.trim().toLowerCase() === normalizedTitle) {
2245
- breadcrumbsWithoutCurrent.pop();
2233
+ if (breadcrumbs !== void 0) {
2234
+ warnDeprecated(
2235
+ "PageHeader.breadcrumbs",
2236
+ '<PageHeader breadcrumbs> is deprecated and renders nothing: the breadcrumb trail is retired (Reference/UI-Platform \u2192 "Page header"). Remove the prop.'
2237
+ );
2238
+ }
2239
+ if (maxW !== void 0) {
2240
+ warnDeprecated(
2241
+ "PageHeader.maxW",
2242
+ "<PageHeader maxW> is deprecated and ignored: the header spans its container. Use <FormColumn> (960px) or the fluid frame for page width."
2243
+ );
2244
+ }
2245
+ if (typeof title === "string" && EMAIL_PATTERN.test(title) || typeof subtitle === "string" && EMAIL_PATTERN.test(subtitle)) {
2246
+ warnDeprecated(
2247
+ "PageHeader.email",
2248
+ `<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.`
2249
+ );
2246
2250
  }
2247
2251
  const eyebrowText = showEyebrow ? eyebrow ?? (mode ? MODE_EYEBROW_LABEL[mode] : void 0) : void 0;
2248
- if (!title && !eyebrowText && breadcrumbsWithoutCurrent.length === 0 && !actions && !tabBar) {
2252
+ if (!title && !eyebrowText && !actions && !tabBar) {
2249
2253
  return null;
2250
2254
  }
2251
2255
  return /* @__PURE__ */ jsxRuntime.jsxs(
2252
2256
  "div",
2253
2257
  {
2254
- style: { backgroundColor: "var(--app-tab-header-bg, #888888)" },
2255
- className: clsx5__default.default("text-slate-100", tabBar ? "pt-3 pb-0" : "py-3 border-b border-gray-200", {
2258
+ "data-shell-page-header": "",
2259
+ className: clsx5__default.default("pt-[22px] text-[color:var(--color-text,#2F3136)]", tabBar ? "pb-0" : "pb-4", {
2256
2260
  "md:ml-60": !hideSidebar
2257
2261
  }),
2258
2262
  children: [
2259
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx5__default.default("w-full px-4", maxWClass), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full flex-nowrap items-start justify-between gap-4", children: [
2263
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full px-4 md:px-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full flex-nowrap items-start justify-between gap-4", children: [
2260
2264
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
2261
2265
  eyebrowText ? /* @__PURE__ */ jsxRuntime.jsx(
2262
2266
  "div",
2263
2267
  {
2264
2268
  className: "truncate text-[11px] font-bold uppercase leading-[1.2] tracking-[0.09em]",
2265
- style: { color: "var(--mode-accent, var(--color-accent, #E63946))" },
2269
+ style: { color: "var(--color-accent-fg, var(--mode-accent, var(--color-accent, #E63946)))" },
2266
2270
  children: eyebrowText
2267
2271
  }
2268
2272
  ) : null,
2269
2273
  title ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx(
2270
- "div",
2274
+ "h1",
2271
2275
  {
2272
- className: "truncate font-bold text-white",
2276
+ className: "m-0 truncate font-bold",
2273
2277
  style: {
2278
+ color: "var(--color-text, #2F3136)",
2274
2279
  fontFamily: "var(--font-family, ui-sans-serif, system-ui, sans-serif)",
2275
2280
  fontSize: "var(--type-h2-size, 1.875rem)",
2276
2281
  lineHeight: "var(--type-h2-line-height, 1.25)"
@@ -2278,25 +2283,7 @@ function PageHeaderView({
2278
2283
  children: title
2279
2284
  }
2280
2285
  ) }) : null,
2281
- subtitle ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 truncate text-[15px] text-[color:var(--color-g4,#929599)]", children: subtitle }) : null,
2282
- breadcrumbsWithoutCurrent.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
2283
- "nav",
2284
- {
2285
- "aria-label": "Breadcrumb",
2286
- className: clsx5__default.default("min-w-0 text-slate-100", title ? "mt-1" : ""),
2287
- children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex flex-nowrap items-center gap-2 overflow-hidden text-sm text-gray-600", children: breadcrumbsWithoutCurrent.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(
2288
- "li",
2289
- {
2290
- className: "flex min-w-0 flex-shrink-0 items-center gap-2",
2291
- children: [
2292
- index > 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-400", children: ">" }) : null,
2293
- item.href ? renderCrumbLink(item.href, item.label, "truncate text-slate-100 hover:underline") : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-slate-100", children: item.label })
2294
- ]
2295
- },
2296
- `${item.label}-${index}`
2297
- )) })
2298
- }
2299
- ) : null
2286
+ subtitle ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 truncate text-[15px] text-[color:var(--color-g4,#58657A)]", children: subtitle }) : null
2300
2287
  ] }),
2301
2288
  actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: actions }) : null
2302
2289
  ] }) }),
@@ -2306,13 +2293,7 @@ function PageHeaderView({
2306
2293
  );
2307
2294
  }
2308
2295
  function PageHeader(props) {
2309
- return /* @__PURE__ */ jsxRuntime.jsx(
2310
- PageHeaderView,
2311
- {
2312
- ...props,
2313
- renderCrumbLink: (href, label, className) => /* @__PURE__ */ jsxRuntime.jsx("a", { href, className, children: label })
2314
- }
2315
- );
2296
+ return /* @__PURE__ */ jsxRuntime.jsx(PageHeaderView, { ...props });
2316
2297
  }
2317
2298
  function BreadcrumbBarView({
2318
2299
  renderCrumbLink,