@the-portland-company/shell 0.97.1 → 0.98.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.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PageHeaderProps, B as BreadcrumbBarProps, N as NavItem } from './index-SHcw15A4.cjs';
2
- export { A as AI_CREDITS_STATE_TITLES, a as AiCreditsState, b as AiCreditsStateKind, C as Card, c as CommsNotification, d as CommsNotificationKind, F as FormColumn, H as HeaderTabBar, e as HeaderTabBarItem, K as KNOWN_TAB_GLYPHS, f as NotificationsAdapter, g as NotificationsFeed, R as RowMenu, h as RowMenuItem, i as RowMenuPlacement, T as TabGlyphComponent, j as aiCreditsWalletUrl, k as createCommsNotificationsAdapter, l as emptyNotificationsFeed, n as normalizeNotificationsFeed, r as resolveTabGlyph, m as rowMenuPosition } from './index-SHcw15A4.cjs';
1
+ import { P as PageHeaderProps, B as BreadcrumbBarProps, N as NavItem } from './index-CUPeC2Ji.cjs';
2
+ export { A as AI_CREDITS_STATE_TITLES, a as AiCreditsState, b as AiCreditsStateKind, C as Card, c as CommsNotification, d as CommsNotificationKind, F as FormColumn, H as HeaderTabBar, e as HeaderTabBarItem, K as KNOWN_TAB_GLYPHS, f as NotificationsAdapter, g as NotificationsFeed, R as RowMenu, h as RowMenuItem, i as RowMenuPlacement, T as TabGlyphComponent, V as VRM_TIER_LABELS, j as VRM_VERIFIED_TOOLTIP, k as VrmVerifiedBadge, l as VrmVerifiedBadgeProps, m as VrmVerifiedTier, n as aiCreditsWalletUrl, o as createCommsNotificationsAdapter, p as emptyNotificationsFeed, q as normalizeNotificationsFeed, r as resolveTabGlyph, s as rowMenuPosition } from './index-CUPeC2Ji.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { ReactNode, CSSProperties } from 'react';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PageHeaderProps, B as BreadcrumbBarProps, N as NavItem } from './index-smsLP_tM.js';
2
- export { A as AI_CREDITS_STATE_TITLES, a as AiCreditsState, b as AiCreditsStateKind, C as Card, c as CommsNotification, d as CommsNotificationKind, F as FormColumn, H as HeaderTabBar, e as HeaderTabBarItem, K as KNOWN_TAB_GLYPHS, f as NotificationsAdapter, g as NotificationsFeed, R as RowMenu, h as RowMenuItem, i as RowMenuPlacement, T as TabGlyphComponent, j as aiCreditsWalletUrl, k as createCommsNotificationsAdapter, l as emptyNotificationsFeed, n as normalizeNotificationsFeed, r as resolveTabGlyph, m as rowMenuPosition } from './index-smsLP_tM.js';
1
+ import { P as PageHeaderProps, B as BreadcrumbBarProps, N as NavItem } from './index-DAD6tSfV.js';
2
+ export { A as AI_CREDITS_STATE_TITLES, a as AiCreditsState, b as AiCreditsStateKind, C as Card, c as CommsNotification, d as CommsNotificationKind, F as FormColumn, H as HeaderTabBar, e as HeaderTabBarItem, K as KNOWN_TAB_GLYPHS, f as NotificationsAdapter, g as NotificationsFeed, R as RowMenu, h as RowMenuItem, i as RowMenuPlacement, T as TabGlyphComponent, V as VRM_TIER_LABELS, j as VRM_VERIFIED_TOOLTIP, k as VrmVerifiedBadge, l as VrmVerifiedBadgeProps, m as VrmVerifiedTier, n as aiCreditsWalletUrl, o as createCommsNotificationsAdapter, p as emptyNotificationsFeed, q as normalizeNotificationsFeed, r as resolveTabGlyph, s as rowMenuPosition } from './index-DAD6tSfV.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { ReactNode, CSSProperties } from 'react';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { PageHeaderView, warnDeprecated, BreadcrumbBarView } from './chunk-XPTC47TY.js';
2
- export { AI_CREDITS_STATE_TITLES, AiCreditsState, Card, FormColumn, HeaderTabBar, KNOWN_TAB_GLYPHS, RowMenu, RowMenuItem, SpeculationRulesScript, aiCreditsWalletUrl, buildNavSpeculationRules, buildSpeculationRules, collectSiblingAppUrls, createCommsNotificationsAdapter, emptyNotificationsFeed, normalizeNotificationsFeed, resolveTabGlyph, rowMenuPosition } from './chunk-XPTC47TY.js';
1
+ import { PageHeaderView, warnDeprecated, BreadcrumbBarView } from './chunk-WOOBPM4V.js';
2
+ export { AI_CREDITS_STATE_TITLES, AiCreditsState, Card, FormColumn, HeaderTabBar, KNOWN_TAB_GLYPHS, RowMenu, RowMenuItem, SpeculationRulesScript, VRM_TIER_LABELS, VRM_VERIFIED_TOOLTIP, VrmVerifiedBadge, aiCreditsWalletUrl, buildNavSpeculationRules, buildSpeculationRules, collectSiblingAppUrls, createCommsNotificationsAdapter, emptyNotificationsFeed, normalizeNotificationsFeed, resolveTabGlyph, rowMenuPosition } from './chunk-WOOBPM4V.js';
3
3
  import { readResolvedTheme } from './chunk-BHRVZPZ7.js';
4
- export { BRAND_APPLE_ICON_LINK_ID, BRAND_FAVICON_LINK_ID, BrandFavicon, applyBrandFavicon, watchBrandFavicon } from './chunk-BMR5WAWH.js';
4
+ export { BRAND_APPLE_ICON_LINK_ID, BRAND_FAVICON_LINK_ID, BrandFavicon, applyBrandFavicon, watchBrandFavicon } from './chunk-Q5DTPY5N.js';
5
5
  import { extendTheme, ChakraProvider, useColorMode } from '@chakra-ui/react';
6
6
  import { jsx, jsxs } from 'react/jsx-runtime';
7
7
  import clsx from 'clsx';
package/dist/native.cjs CHANGED
@@ -2430,6 +2430,30 @@ function readBrandAsset(kind) {
2430
2430
  return null;
2431
2431
  }
2432
2432
  }
2433
+ var RETRY_MS = [0, 250, 1e3, 3e3];
2434
+ function useBrandAsset(kind) {
2435
+ const [url, setUrl] = react.useState(null);
2436
+ react.useEffect(() => {
2437
+ let done = false;
2438
+ const read = () => {
2439
+ if (done) return;
2440
+ const next = readBrandAsset(kind);
2441
+ setUrl((prev) => prev === next ? prev : next);
2442
+ };
2443
+ const links = Array.from(
2444
+ document.querySelectorAll('link[rel="stylesheet"][href*="api/tokens"]')
2445
+ );
2446
+ links.forEach((l) => l.addEventListener("load", read));
2447
+ const timers = RETRY_MS.map((ms) => window.setTimeout(read, ms));
2448
+ read();
2449
+ return () => {
2450
+ done = true;
2451
+ links.forEach((l) => l.removeEventListener("load", read));
2452
+ timers.forEach((t) => window.clearTimeout(t));
2453
+ };
2454
+ }, [kind]);
2455
+ return url;
2456
+ }
2433
2457
 
2434
2458
  // src/lib/brandFavicon.ts
2435
2459
  var BRAND_FAVICON_LINK_ID = "politogy-brand-favicon";
@@ -2454,7 +2478,7 @@ function applyBrandFavicon() {
2454
2478
  if (apple) upsertLink(BRAND_APPLE_ICON_LINK_ID, "apple-touch-icon", apple);
2455
2479
  return true;
2456
2480
  }
2457
- var RETRY_MS = [0, 250, 1e3, 3e3];
2481
+ var RETRY_MS2 = [0, 250, 1e3, 3e3];
2458
2482
  function watchBrandFavicon() {
2459
2483
  if (typeof document === "undefined") return () => {
2460
2484
  };
@@ -2471,7 +2495,7 @@ function watchBrandFavicon() {
2471
2495
  });
2472
2496
  };
2473
2497
  listen();
2474
- const timers = RETRY_MS.map((ms) => window.setTimeout(apply, ms));
2498
+ const timers = RETRY_MS2.map((ms) => window.setTimeout(apply, ms));
2475
2499
  const observer = typeof MutationObserver === "undefined" ? null : new MutationObserver(() => {
2476
2500
  listen();
2477
2501
  apply();
@@ -3013,6 +3037,90 @@ function RowMenuItem({
3013
3037
  }
3014
3038
  );
3015
3039
  }
3040
+ var VRM_VERIFIED_TOOLTIP = "Politogy has confirmed this is a real, registered voter.";
3041
+ var VRM_TIER_LABELS = {
3042
+ verified: "VRM Verified",
3043
+ identified: "Identified",
3044
+ anonymous: "Anonymous",
3045
+ stale: "Stale",
3046
+ inactive: "Inactive"
3047
+ };
3048
+ var TIER_TOOLTIPS = {
3049
+ verified: VRM_VERIFIED_TOOLTIP,
3050
+ identified: "Identified: we know who this is, but Politogy has not verified them.",
3051
+ anonymous: "Anonymous: nothing identifying has been captured yet.",
3052
+ stale: "Stale: was VRM Verified, but the proof is more than 12 months old.",
3053
+ inactive: "Inactive: the voter file marks this registration inactive or canceled."
3054
+ };
3055
+ var DOT_FALLBACK = {
3056
+ identified: "#a855f7",
3057
+ anonymous: "var(--color-graphite, #2b2b2b)",
3058
+ stale: "#eab308",
3059
+ inactive: "var(--muted, #8a8a8a)"
3060
+ };
3061
+ function VrmVerifiedBadge({ tier, size, showLabel = true, className, style }) {
3062
+ const icon = useBrandAsset("verified-icon");
3063
+ const known = tier && tier in VRM_TIER_LABELS ? tier : null;
3064
+ const label = known ? VRM_TIER_LABELS[known] : "Not yet computed";
3065
+ const title = known ? TIER_TOOLTIPS[known] : "The VRM Verified tier has not been worked out yet.";
3066
+ const iconSize = size ?? 16;
3067
+ const dotSize = size ?? 8;
3068
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3069
+ "span",
3070
+ {
3071
+ "data-vrm-tier": known ?? "none",
3072
+ title,
3073
+ "aria-label": showLabel ? void 0 : label,
3074
+ role: showLabel ? void 0 : "img",
3075
+ className,
3076
+ style: {
3077
+ display: "inline-flex",
3078
+ alignItems: "center",
3079
+ gap: 6,
3080
+ borderRadius: 9999,
3081
+ border: "1px solid var(--line, #e5e5e5)",
3082
+ padding: "2px 10px",
3083
+ fontSize: 12,
3084
+ fontWeight: 600,
3085
+ lineHeight: 1.4,
3086
+ whiteSpace: "nowrap",
3087
+ ...style
3088
+ },
3089
+ children: [
3090
+ known === "verified" ? (
3091
+ // The box is reserved while the Brand sheet loads; nothing stands in.
3092
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, style: { display: "inline-block", width: iconSize, height: iconSize, flexShrink: 0 }, children: icon ? /* @__PURE__ */ jsxRuntime.jsx(
3093
+ "img",
3094
+ {
3095
+ src: icon,
3096
+ alt: "",
3097
+ width: iconSize,
3098
+ height: iconSize,
3099
+ draggable: false,
3100
+ "data-testid": "vrm-verified-icon",
3101
+ style: { display: "block", width: iconSize, height: iconSize }
3102
+ }
3103
+ ) : null })
3104
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
3105
+ "span",
3106
+ {
3107
+ "aria-hidden": true,
3108
+ style: {
3109
+ display: "inline-block",
3110
+ width: dotSize,
3111
+ height: dotSize,
3112
+ borderRadius: 9999,
3113
+ flexShrink: 0,
3114
+ background: known ? `var(--vrm-tier-${known}, ${DOT_FALLBACK[known]})` : "transparent",
3115
+ border: known ? void 0 : "1px dashed var(--muted, #8a8a8a)"
3116
+ }
3117
+ }
3118
+ ),
3119
+ showLabel ? /* @__PURE__ */ jsxRuntime.jsx("span", { children: label }) : null
3120
+ ]
3121
+ }
3122
+ );
3123
+ }
3016
3124
  var standardNavIcons = {
3017
3125
  home: lu.LuHouse,
3018
3126
  users: lu.LuUsers,
@@ -5019,6 +5127,9 @@ exports.TopBarPanelArrow = TopBarPanelArrow;
5019
5127
  exports.TopBarPopover = TopBarPopover;
5020
5128
  exports.TopBarTooltip = TopBarTooltip;
5021
5129
  exports.TopBarWidgetSlot = TopBarWidgetSlot;
5130
+ exports.VRM_TIER_LABELS = VRM_TIER_LABELS;
5131
+ exports.VRM_VERIFIED_TOOLTIP = VRM_VERIFIED_TOOLTIP;
5132
+ exports.VrmVerifiedBadge = VrmVerifiedBadge;
5022
5133
  exports.aiCreditsWalletUrl = aiCreditsWalletUrl;
5023
5134
  exports.applyBrandFavicon = applyBrandFavicon;
5024
5135
  exports.buildLineParts = buildLineParts;