@the-portland-company/shell 0.92.0 → 0.94.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.
@@ -12,6 +12,26 @@ type CardProps = {
12
12
  };
13
13
  declare function Card({ title, children, minH, className, style, ...props }: CardProps): react_jsx_runtime.JSX.Element;
14
14
 
15
+ type AiCreditsStateKind = 'out' | 'paused' | 'waiting';
16
+ /** Organization Settings → Subscription & Billing → Wallet, on this organization. */
17
+ declare function aiCreditsWalletUrl(orgId?: string | null): string;
18
+ declare const AI_CREDITS_STATE_TITLES: Record<AiCreditsStateKind, string>;
19
+ type AiCreditsStateProps = {
20
+ kind: AiCreditsStateKind;
21
+ orgId?: string | null;
22
+ /** Account Admins see the Wallet buttons; others are told to ask one. */
23
+ isAccountAdmin: boolean;
24
+ /** paused: when the last output was made; null when there has been none. */
25
+ lastOutputAt?: Date | string | null;
26
+ /** Shows "Check again" (re-ask can-start). */
27
+ onCheckAgain?: () => void;
28
+ /** Overrides the time format (tests, or an app's own locale). */
29
+ formatTime?: (at: Date) => string;
30
+ className?: string;
31
+ style?: CSSProperties;
32
+ };
33
+ declare function AiCreditsState({ kind, orgId, isAccountAdmin, lastOutputAt, onCheckAgain, formatTime, className, style, }: AiCreditsStateProps): react_jsx_runtime.JSX.Element;
34
+
15
35
  type FormColumnProps = {
16
36
  children: ReactNode;
17
37
  className?: string;
@@ -93,6 +113,22 @@ type HeaderTabBarProps = {
93
113
  */
94
114
  declare function HeaderTabBar({ items, activeId, onChange, className, ariaLabel, }: HeaderTabBarProps): react_jsx_runtime.JSX.Element;
95
115
 
116
+ /** A tab icon: the same shape `NavTabStrip` passes (`size`, `className`, `strokeWidth`). */
117
+ type TabGlyphComponent = ComponentType<{
118
+ size?: number;
119
+ className?: string;
120
+ strokeWidth?: number;
121
+ }>;
122
+ /**
123
+ * Resolve a Brand tab-icon name to its component. Trims, strips surrounding
124
+ * quotes (the CSS var value is a quoted string) and lowercases. Returns null
125
+ * for an empty or unknown name so `NavTabStrip` falls back to the tab's own
126
+ * `icon` prop: an unrecognised token never renders a broken or empty icon.
127
+ */
128
+ declare function resolveTabGlyph(name: string | null | undefined): TabGlyphComponent | null;
129
+ /** The tab icon names the shell knows, in vocabulary order. The Brand editor offers only these. */
130
+ declare const KNOWN_TAB_GLYPHS: readonly string[];
131
+
96
132
  /**
97
133
  * The six canonical top-bar action slots (Reference/Global-Rules v9 → top-bar
98
134
  * icons). Each slot's GLYPH is unique and comes from the Brand API
@@ -1057,6 +1093,16 @@ type NavTabStripProps = {
1057
1093
  size?: 'md' | 'sm';
1058
1094
  /** Extra classes on the tablist container. */
1059
1095
  className?: string;
1096
+ /**
1097
+ * The app's strip key in the Brand tab icon map (`tabIcons`), e.g.
1098
+ * `"forms"` or `"contacts-tribes"` (Reference/UI-Platform → Tabs, "Tab icon
1099
+ * map", decided 2026-10-24). When set, each tab reads
1100
+ * `--tab-icon-<iconStrip>-<tab.key>` from the Brand token sheet at runtime
1101
+ * and renders that Lucide icon; when the variable is missing, empty or names
1102
+ * an icon not in `KNOWN_TAB_GLYPHS`, the tab renders its own `icon` prop.
1103
+ * Omit it and every tab renders its own `icon`, as before.
1104
+ */
1105
+ iconStrip?: string;
1060
1106
  /**
1061
1107
  * Optional tab panel rendered directly below the strip, on the page
1062
1108
  * surface with no card chrome. Omit to render only the strip and compose
@@ -1069,7 +1115,7 @@ type NavTabStripProps = {
1069
1115
  * in the page body below the page header; pass the app's `Link` as
1070
1116
  * `linkComponent` for `href` tabs.
1071
1117
  */
1072
- declare function NavTabStrip({ tabs, 'aria-label': ariaLabel, linkComponent, size, className, children, }: NavTabStripProps): react_jsx_runtime.JSX.Element;
1118
+ declare function NavTabStrip({ tabs, 'aria-label': ariaLabel, linkComponent, size, className, iconStrip, children, }: NavTabStripProps): react_jsx_runtime.JSX.Element;
1073
1119
  /**
1074
1120
  * sessionStorage key holding the Beta-banner dismissal. sessionStorage — not
1075
1121
  * localStorage — so the dismissal lasts only for the browser session; and it is
@@ -1142,4 +1188,4 @@ type NavAppShellProps = {
1142
1188
  };
1143
1189
  declare function NavAppShell({ sidebar, topBar, betaBanner, contentWrapper, accountMenuPlacement, modeId, children, }: NavAppShellProps): react_jsx_runtime.JSX.Element;
1144
1190
 
1145
- export { NavChromeProvider as $, type CampaignFeatureAvailability as A, type BreadcrumbBarProps as B, Card as C, type ChromeMe as D, type ChromeNotificationAlert as E, FormColumn as F, type ChromeNotificationImport as G, HeaderTabBar as H, type ChromeNotificationQuarantine as I, type ChromeNotificationReply as J, type ChromeNotificationsPayload as K, type ChromeOrgSummary as L, type CommunicationsFuelStatus as M, type NavItem as N, type CreditHealthState as O, type PageHeaderProps as P, type CreditTypeKey as Q, CreditsAction as R, type StandardNavIconKey as S, type CreditsIconState as T, FuelAction as U, type FuelChannelStatus as V, NavAppShell as W, type NavAppShellProps as X, NavBetaBanner as Y, type NavBetaBannerProps as Z, type NavBrand as _, type CommsNotification as a, NavDisplayAction as a0, type NavLinkProps as a1, type NavLinkedAccount as a2, type NavModeOption as a3, type NavOrg as a4, type NavRoleBadge as a5, NavSidebar as a6, type NavSidebarProps as a7, type NavTab as a8, NavTabStrip as a9, envChipClasses as aA, isNavItemActive as aB, modeIdFromLabel as aC, resolveOrgLogoUrl as aD, shortEnvLabel as aE, shortUserName as aF, standardPolitogyNav as aG, topBarIconButtonClass as aH, useChromeMe as aI, useChromeOrgs as aJ, useNavChromeDedupedFetch as aK, useNavChromeFetcher as aL, useThemePreference as aM, type NavTabStripProps as aa, NavThemeControl as ab, NavTopBar as ac, type NavTopBarAction as ad, type NavTopBarProps as ae, type NavUser as af, NotificationsAction as ag, PageHeader as ah, type PageHeaderMode as ai, SPECS_ORIGIN as aj, SpecOverlayAction as ak, type StandardNavOptions as al, SupportAction as am, type ThemePreference as an, TopBarCountBadge as ao, type TopBarIconTone as ap, TopBarPanelArrow as aq, TopBarPopover as ar, TopBarTooltip as as, TopBarWidgetSlot as at, clearBetaBannerDismissal as au, creditGaugeRatio as av, creditStateWord as aw, creditTooltipLine as ax, creditsAriaLabel as ay, creditsIconState as az, type CommsNotificationKind as b, type HeaderTabBarItem as c, type NotificationsAdapter as d, type NotificationsFeed as e, createCommsNotificationsAdapter as f, emptyNotificationsFeed as g, type NavIcon as h, type NavBreadcrumb as i, type StandardNavMode as j, type NavLinkComponent as k, type NavChromeFetcher as l, type NavMode as m, normalizeNotificationsFeed as n, type NavUserMenu as o, type NavOrgOption as p, type NavFooterLink as q, type NavFooter as r, type NavDisplayMode as s, BETA_BANNER_DISMISS_KEY as t, BreadcrumbBar as u, CAMPAIGN_FEATURE_AVAILABILITY as v, CORE_APP_ORIGIN as w, CORE_BILLING_PATH as x, CREDIT_TYPE_LABELS as y, CREDIT_TYPE_ORDER as z };
1191
+ export { FuelAction as $, AI_CREDITS_STATE_TITLES as A, type BreadcrumbBarProps as B, Card as C, CORE_APP_ORIGIN as D, CORE_BILLING_PATH as E, FormColumn as F, CREDIT_TYPE_LABELS as G, HeaderTabBar as H, CREDIT_TYPE_ORDER as I, type CampaignFeatureAvailability as J, KNOWN_TAB_GLYPHS as K, type ChromeMe as L, type ChromeNotificationAlert as M, type NavItem as N, type ChromeNotificationImport as O, type PageHeaderProps as P, type ChromeNotificationQuarantine as Q, type ChromeNotificationReply as R, type StandardNavIconKey as S, type TabGlyphComponent as T, type ChromeNotificationsPayload as U, type ChromeOrgSummary as V, type CommunicationsFuelStatus as W, type CreditHealthState as X, type CreditTypeKey as Y, CreditsAction as Z, type CreditsIconState as _, AiCreditsState as a, type FuelChannelStatus as a0, NavAppShell as a1, type NavAppShellProps as a2, NavBetaBanner as a3, type NavBetaBannerProps as a4, type NavBrand as a5, NavChromeProvider as a6, NavDisplayAction as a7, type NavLinkProps as a8, type NavLinkedAccount as a9, TopBarWidgetSlot as aA, clearBetaBannerDismissal as aB, creditGaugeRatio as aC, creditStateWord as aD, creditTooltipLine as aE, creditsAriaLabel as aF, creditsIconState as aG, envChipClasses as aH, isNavItemActive as aI, modeIdFromLabel as aJ, resolveOrgLogoUrl as aK, shortEnvLabel as aL, shortUserName as aM, standardPolitogyNav as aN, topBarIconButtonClass as aO, useChromeMe as aP, useChromeOrgs as aQ, useNavChromeDedupedFetch as aR, useNavChromeFetcher as aS, useThemePreference as aT, type NavModeOption as aa, type NavOrg as ab, type NavRoleBadge as ac, NavSidebar as ad, type NavSidebarProps as ae, type NavTab as af, NavTabStrip as ag, type NavTabStripProps as ah, NavThemeControl as ai, NavTopBar as aj, type NavTopBarAction as ak, type NavTopBarProps as al, type NavUser as am, NotificationsAction as an, PageHeader as ao, type PageHeaderMode as ap, SPECS_ORIGIN as aq, SpecOverlayAction as ar, type StandardNavOptions as as, SupportAction as at, type ThemePreference as au, TopBarCountBadge as av, type TopBarIconTone as aw, TopBarPanelArrow as ax, TopBarPopover as ay, TopBarTooltip as az, type AiCreditsStateKind as b, type CommsNotification as c, type CommsNotificationKind as d, type HeaderTabBarItem as e, type NotificationsAdapter as f, type NotificationsFeed as g, aiCreditsWalletUrl as h, createCommsNotificationsAdapter as i, emptyNotificationsFeed as j, type NavIcon as k, type NavBreadcrumb as l, type StandardNavMode as m, normalizeNotificationsFeed as n, type NavLinkComponent as o, type NavChromeFetcher as p, type NavMode as q, resolveTabGlyph as r, type NavUserMenu as s, type NavOrgOption as t, type NavFooterLink as u, type NavFooter as v, type NavDisplayMode as w, BETA_BANNER_DISMISS_KEY as x, BreadcrumbBar as y, CAMPAIGN_FEATURE_AVAILABILITY as z };
@@ -12,6 +12,26 @@ type CardProps = {
12
12
  };
13
13
  declare function Card({ title, children, minH, className, style, ...props }: CardProps): react_jsx_runtime.JSX.Element;
14
14
 
15
+ type AiCreditsStateKind = 'out' | 'paused' | 'waiting';
16
+ /** Organization Settings → Subscription & Billing → Wallet, on this organization. */
17
+ declare function aiCreditsWalletUrl(orgId?: string | null): string;
18
+ declare const AI_CREDITS_STATE_TITLES: Record<AiCreditsStateKind, string>;
19
+ type AiCreditsStateProps = {
20
+ kind: AiCreditsStateKind;
21
+ orgId?: string | null;
22
+ /** Account Admins see the Wallet buttons; others are told to ask one. */
23
+ isAccountAdmin: boolean;
24
+ /** paused: when the last output was made; null when there has been none. */
25
+ lastOutputAt?: Date | string | null;
26
+ /** Shows "Check again" (re-ask can-start). */
27
+ onCheckAgain?: () => void;
28
+ /** Overrides the time format (tests, or an app's own locale). */
29
+ formatTime?: (at: Date) => string;
30
+ className?: string;
31
+ style?: CSSProperties;
32
+ };
33
+ declare function AiCreditsState({ kind, orgId, isAccountAdmin, lastOutputAt, onCheckAgain, formatTime, className, style, }: AiCreditsStateProps): react_jsx_runtime.JSX.Element;
34
+
15
35
  type FormColumnProps = {
16
36
  children: ReactNode;
17
37
  className?: string;
@@ -93,6 +113,22 @@ type HeaderTabBarProps = {
93
113
  */
94
114
  declare function HeaderTabBar({ items, activeId, onChange, className, ariaLabel, }: HeaderTabBarProps): react_jsx_runtime.JSX.Element;
95
115
 
116
+ /** A tab icon: the same shape `NavTabStrip` passes (`size`, `className`, `strokeWidth`). */
117
+ type TabGlyphComponent = ComponentType<{
118
+ size?: number;
119
+ className?: string;
120
+ strokeWidth?: number;
121
+ }>;
122
+ /**
123
+ * Resolve a Brand tab-icon name to its component. Trims, strips surrounding
124
+ * quotes (the CSS var value is a quoted string) and lowercases. Returns null
125
+ * for an empty or unknown name so `NavTabStrip` falls back to the tab's own
126
+ * `icon` prop: an unrecognised token never renders a broken or empty icon.
127
+ */
128
+ declare function resolveTabGlyph(name: string | null | undefined): TabGlyphComponent | null;
129
+ /** The tab icon names the shell knows, in vocabulary order. The Brand editor offers only these. */
130
+ declare const KNOWN_TAB_GLYPHS: readonly string[];
131
+
96
132
  /**
97
133
  * The six canonical top-bar action slots (Reference/Global-Rules v9 → top-bar
98
134
  * icons). Each slot's GLYPH is unique and comes from the Brand API
@@ -1057,6 +1093,16 @@ type NavTabStripProps = {
1057
1093
  size?: 'md' | 'sm';
1058
1094
  /** Extra classes on the tablist container. */
1059
1095
  className?: string;
1096
+ /**
1097
+ * The app's strip key in the Brand tab icon map (`tabIcons`), e.g.
1098
+ * `"forms"` or `"contacts-tribes"` (Reference/UI-Platform → Tabs, "Tab icon
1099
+ * map", decided 2026-10-24). When set, each tab reads
1100
+ * `--tab-icon-<iconStrip>-<tab.key>` from the Brand token sheet at runtime
1101
+ * and renders that Lucide icon; when the variable is missing, empty or names
1102
+ * an icon not in `KNOWN_TAB_GLYPHS`, the tab renders its own `icon` prop.
1103
+ * Omit it and every tab renders its own `icon`, as before.
1104
+ */
1105
+ iconStrip?: string;
1060
1106
  /**
1061
1107
  * Optional tab panel rendered directly below the strip, on the page
1062
1108
  * surface with no card chrome. Omit to render only the strip and compose
@@ -1069,7 +1115,7 @@ type NavTabStripProps = {
1069
1115
  * in the page body below the page header; pass the app's `Link` as
1070
1116
  * `linkComponent` for `href` tabs.
1071
1117
  */
1072
- declare function NavTabStrip({ tabs, 'aria-label': ariaLabel, linkComponent, size, className, children, }: NavTabStripProps): react_jsx_runtime.JSX.Element;
1118
+ declare function NavTabStrip({ tabs, 'aria-label': ariaLabel, linkComponent, size, className, iconStrip, children, }: NavTabStripProps): react_jsx_runtime.JSX.Element;
1073
1119
  /**
1074
1120
  * sessionStorage key holding the Beta-banner dismissal. sessionStorage — not
1075
1121
  * localStorage — so the dismissal lasts only for the browser session; and it is
@@ -1142,4 +1188,4 @@ type NavAppShellProps = {
1142
1188
  };
1143
1189
  declare function NavAppShell({ sidebar, topBar, betaBanner, contentWrapper, accountMenuPlacement, modeId, children, }: NavAppShellProps): react_jsx_runtime.JSX.Element;
1144
1190
 
1145
- export { NavChromeProvider as $, type CampaignFeatureAvailability as A, type BreadcrumbBarProps as B, Card as C, type ChromeMe as D, type ChromeNotificationAlert as E, FormColumn as F, type ChromeNotificationImport as G, HeaderTabBar as H, type ChromeNotificationQuarantine as I, type ChromeNotificationReply as J, type ChromeNotificationsPayload as K, type ChromeOrgSummary as L, type CommunicationsFuelStatus as M, type NavItem as N, type CreditHealthState as O, type PageHeaderProps as P, type CreditTypeKey as Q, CreditsAction as R, type StandardNavIconKey as S, type CreditsIconState as T, FuelAction as U, type FuelChannelStatus as V, NavAppShell as W, type NavAppShellProps as X, NavBetaBanner as Y, type NavBetaBannerProps as Z, type NavBrand as _, type CommsNotification as a, NavDisplayAction as a0, type NavLinkProps as a1, type NavLinkedAccount as a2, type NavModeOption as a3, type NavOrg as a4, type NavRoleBadge as a5, NavSidebar as a6, type NavSidebarProps as a7, type NavTab as a8, NavTabStrip as a9, envChipClasses as aA, isNavItemActive as aB, modeIdFromLabel as aC, resolveOrgLogoUrl as aD, shortEnvLabel as aE, shortUserName as aF, standardPolitogyNav as aG, topBarIconButtonClass as aH, useChromeMe as aI, useChromeOrgs as aJ, useNavChromeDedupedFetch as aK, useNavChromeFetcher as aL, useThemePreference as aM, type NavTabStripProps as aa, NavThemeControl as ab, NavTopBar as ac, type NavTopBarAction as ad, type NavTopBarProps as ae, type NavUser as af, NotificationsAction as ag, PageHeader as ah, type PageHeaderMode as ai, SPECS_ORIGIN as aj, SpecOverlayAction as ak, type StandardNavOptions as al, SupportAction as am, type ThemePreference as an, TopBarCountBadge as ao, type TopBarIconTone as ap, TopBarPanelArrow as aq, TopBarPopover as ar, TopBarTooltip as as, TopBarWidgetSlot as at, clearBetaBannerDismissal as au, creditGaugeRatio as av, creditStateWord as aw, creditTooltipLine as ax, creditsAriaLabel as ay, creditsIconState as az, type CommsNotificationKind as b, type HeaderTabBarItem as c, type NotificationsAdapter as d, type NotificationsFeed as e, createCommsNotificationsAdapter as f, emptyNotificationsFeed as g, type NavIcon as h, type NavBreadcrumb as i, type StandardNavMode as j, type NavLinkComponent as k, type NavChromeFetcher as l, type NavMode as m, normalizeNotificationsFeed as n, type NavUserMenu as o, type NavOrgOption as p, type NavFooterLink as q, type NavFooter as r, type NavDisplayMode as s, BETA_BANNER_DISMISS_KEY as t, BreadcrumbBar as u, CAMPAIGN_FEATURE_AVAILABILITY as v, CORE_APP_ORIGIN as w, CORE_BILLING_PATH as x, CREDIT_TYPE_LABELS as y, CREDIT_TYPE_ORDER as z };
1191
+ export { FuelAction as $, AI_CREDITS_STATE_TITLES as A, type BreadcrumbBarProps as B, Card as C, CORE_APP_ORIGIN as D, CORE_BILLING_PATH as E, FormColumn as F, CREDIT_TYPE_LABELS as G, HeaderTabBar as H, CREDIT_TYPE_ORDER as I, type CampaignFeatureAvailability as J, KNOWN_TAB_GLYPHS as K, type ChromeMe as L, type ChromeNotificationAlert as M, type NavItem as N, type ChromeNotificationImport as O, type PageHeaderProps as P, type ChromeNotificationQuarantine as Q, type ChromeNotificationReply as R, type StandardNavIconKey as S, type TabGlyphComponent as T, type ChromeNotificationsPayload as U, type ChromeOrgSummary as V, type CommunicationsFuelStatus as W, type CreditHealthState as X, type CreditTypeKey as Y, CreditsAction as Z, type CreditsIconState as _, AiCreditsState as a, type FuelChannelStatus as a0, NavAppShell as a1, type NavAppShellProps as a2, NavBetaBanner as a3, type NavBetaBannerProps as a4, type NavBrand as a5, NavChromeProvider as a6, NavDisplayAction as a7, type NavLinkProps as a8, type NavLinkedAccount as a9, TopBarWidgetSlot as aA, clearBetaBannerDismissal as aB, creditGaugeRatio as aC, creditStateWord as aD, creditTooltipLine as aE, creditsAriaLabel as aF, creditsIconState as aG, envChipClasses as aH, isNavItemActive as aI, modeIdFromLabel as aJ, resolveOrgLogoUrl as aK, shortEnvLabel as aL, shortUserName as aM, standardPolitogyNav as aN, topBarIconButtonClass as aO, useChromeMe as aP, useChromeOrgs as aQ, useNavChromeDedupedFetch as aR, useNavChromeFetcher as aS, useThemePreference as aT, type NavModeOption as aa, type NavOrg as ab, type NavRoleBadge as ac, NavSidebar as ad, type NavSidebarProps as ae, type NavTab as af, NavTabStrip as ag, type NavTabStripProps as ah, NavThemeControl as ai, NavTopBar as aj, type NavTopBarAction as ak, type NavTopBarProps as al, type NavUser as am, NotificationsAction as an, PageHeader as ao, type PageHeaderMode as ap, SPECS_ORIGIN as aq, SpecOverlayAction as ar, type StandardNavOptions as as, SupportAction as at, type ThemePreference as au, TopBarCountBadge as av, type TopBarIconTone as aw, TopBarPanelArrow as ax, TopBarPopover as ay, TopBarTooltip as az, type AiCreditsStateKind as b, type CommsNotification as c, type CommsNotificationKind as d, type HeaderTabBarItem as e, type NotificationsAdapter as f, type NotificationsFeed as g, aiCreditsWalletUrl as h, createCommsNotificationsAdapter as i, emptyNotificationsFeed as j, type NavIcon as k, type NavBreadcrumb as l, type StandardNavMode as m, normalizeNotificationsFeed as n, type NavLinkComponent as o, type NavChromeFetcher as p, type NavMode as q, resolveTabGlyph as r, type NavUserMenu as s, type NavOrgOption as t, type NavFooterLink as u, type NavFooter as v, type NavDisplayMode as w, BETA_BANNER_DISMISS_KEY as x, BreadcrumbBar as y, CAMPAIGN_FEATURE_AVAILABILITY as z };
package/dist/index.cjs CHANGED
@@ -6,6 +6,7 @@ var clsx5 = require('clsx');
6
6
  var reactRouterDom = require('react-router-dom');
7
7
  var react$1 = require('react');
8
8
  require('react-dom');
9
+ var lu = require('react-icons/lu');
9
10
 
10
11
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
12
 
@@ -854,6 +855,71 @@ function Card({
854
855
  }
855
856
  );
856
857
  }
858
+ var SETTINGS_ORIGIN = "https://settings.politogyvrm.com";
859
+ var WALLET_PATH = "/organization-settings/subscription-billing/wallet";
860
+ function aiCreditsWalletUrl(orgId) {
861
+ const url = new URL(WALLET_PATH, SETTINGS_ORIGIN);
862
+ if (orgId) url.searchParams.set("org", orgId);
863
+ return url.toString();
864
+ }
865
+ var AI_CREDITS_STATE_TITLES = {
866
+ out: "Out of AI Credits",
867
+ paused: "Paused \u2014 out of AI Credits",
868
+ waiting: "Waiting for AI Credits"
869
+ };
870
+ var MUTED = { color: "var(--color-text-muted, #6b7280)" };
871
+ var BUTTON = {
872
+ display: "inline-block",
873
+ borderRadius: 6,
874
+ padding: "6px 12px",
875
+ fontSize: 12,
876
+ fontWeight: 600,
877
+ textDecoration: "none"
878
+ };
879
+ var PRIMARY = { ...BUTTON, background: "var(--color-text, #2F3136)", color: "#fff" };
880
+ var SECONDARY = {
881
+ ...BUTTON,
882
+ border: "1px solid var(--color-border, #e5e7eb)",
883
+ color: "var(--color-text, #2F3136)"
884
+ };
885
+ var defaultFormat = (at) => at.toLocaleString(void 0, { month: "short", day: "numeric", hour: "numeric", minute: "2-digit" });
886
+ function detail(kind, lastOutputAt, format) {
887
+ if (kind === "paused") return lastOutputAt ? `Last updated ${format(lastOutputAt)}.` : "Nothing has been generated yet.";
888
+ if (kind === "waiting") return "This step is kept and starts on its own once AI Credits are added.";
889
+ return null;
890
+ }
891
+ function AiCreditsState({
892
+ kind,
893
+ orgId,
894
+ isAccountAdmin,
895
+ lastOutputAt,
896
+ onCheckAgain,
897
+ formatTime = defaultFormat,
898
+ className,
899
+ style
900
+ }) {
901
+ const at = lastOutputAt == null ? null : lastOutputAt instanceof Date ? lastOutputAt : new Date(lastOutputAt);
902
+ const last = at && !Number.isNaN(at.getTime()) ? at : null;
903
+ const text = detail(kind, last, formatTime);
904
+ const wallet = aiCreditsWalletUrl(orgId);
905
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "status", "data-ai-credits-state": kind, className, style: { fontSize: 14, ...style }, children: [
906
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: 0, fontWeight: 600 }, children: AI_CREDITS_STATE_TITLES[kind] }),
907
+ text && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "4px 0 0", ...MUTED }, children: text }),
908
+ isAccountAdmin ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginTop: 8, display: "flex", flexWrap: "wrap", gap: 8 }, children: [
909
+ /* @__PURE__ */ jsxRuntime.jsx("a", { href: wallet, style: PRIMARY, children: "Buy AI Credits" }),
910
+ /* @__PURE__ */ jsxRuntime.jsx("a", { href: wallet, style: SECONDARY, children: "Turn on auto top-off" })
911
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "4px 0 0", ...MUTED }, children: "Ask an Account Admin to add AI Credits." }),
912
+ onCheckAgain && /* @__PURE__ */ jsxRuntime.jsx(
913
+ "button",
914
+ {
915
+ type: "button",
916
+ onClick: onCheckAgain,
917
+ style: { marginTop: 8, padding: 0, border: 0, background: "none", fontSize: 12, textDecoration: "underline", cursor: "pointer", ...MUTED },
918
+ children: "Check again"
919
+ }
920
+ )
921
+ ] });
922
+ }
857
923
  function FormColumn({ children, className }) {
858
924
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-shell-form-column": "", className: clsx5__default.default("w-full max-w-[960px]", className), children });
859
925
  }
@@ -1654,6 +1720,139 @@ function getUserDisplayName(user) {
1654
1720
  if (!user) return "User";
1655
1721
  return user.profile?.full_name || user.profile?.name || user.user_metadata?.full_name || user.user_metadata?.name || (typeof user.email === "string" ? user.email.split("@")[0] : "") || user.email || "User";
1656
1722
  }
1723
+ var TAB_GLYPHS = {
1724
+ "layout-dashboard": lu.LuLayoutDashboard,
1725
+ "layout-list": lu.LuLayoutList,
1726
+ "layout-grid": lu.LuLayoutGrid,
1727
+ "layout-template": lu.LuLayoutTemplate,
1728
+ "users": lu.LuUsers,
1729
+ "users-round": lu.LuUsersRound,
1730
+ "user": lu.LuUser,
1731
+ "user-plus": lu.LuUserPlus,
1732
+ "user-check": lu.LuUserCheck,
1733
+ "square-user": lu.LuSquareUser,
1734
+ "upload": lu.LuUpload,
1735
+ "download": lu.LuDownload,
1736
+ "copy": lu.LuCopy,
1737
+ "library": lu.LuLibrary,
1738
+ "flag": lu.LuFlag,
1739
+ "flag-triangle-right": lu.LuFlagTriangleRight,
1740
+ "activity": lu.LuActivity,
1741
+ "table-2": lu.LuTable2,
1742
+ "chart-pie": lu.LuChartPie,
1743
+ "chart-column": lu.LuChartColumn,
1744
+ "chart-line": lu.LuChartLine,
1745
+ "chart-bar": lu.LuChartBar,
1746
+ "chart-area": lu.LuChartArea,
1747
+ "chart-no-axes-combined": lu.LuChartNoAxesCombined,
1748
+ "lightbulb": lu.LuLightbulb,
1749
+ "crosshair": lu.LuCrosshair,
1750
+ "map": lu.LuMap,
1751
+ "map-pin": lu.LuMapPin,
1752
+ "footprints": lu.LuFootprints,
1753
+ "brain": lu.LuBrain,
1754
+ "clipboard-list": lu.LuClipboardList,
1755
+ "clipboard-check": lu.LuClipboardCheck,
1756
+ "timer": lu.LuTimer,
1757
+ "clock": lu.LuClock,
1758
+ "calendar": lu.LuCalendar,
1759
+ "layers": lu.LuLayers,
1760
+ "scale": lu.LuScale,
1761
+ "route": lu.LuRoute,
1762
+ "bot": lu.LuBot,
1763
+ "messages-square": lu.LuMessagesSquare,
1764
+ "message-square": lu.LuMessageSquare,
1765
+ "message-circle": lu.LuMessageCircle,
1766
+ "send": lu.LuSend,
1767
+ "gauge": lu.LuGauge,
1768
+ "split": lu.LuSplit,
1769
+ "file-text": lu.LuFileText,
1770
+ "file": lu.LuFile,
1771
+ "files": lu.LuFiles,
1772
+ "folder": lu.LuFolder,
1773
+ "folder-lock": lu.LuFolderLock,
1774
+ "list": lu.LuList,
1775
+ "list-checks": lu.LuListChecks,
1776
+ "list-ordered": lu.LuListOrdered,
1777
+ "list-todo": lu.LuListTodo,
1778
+ "trending-up": lu.LuTrendingUp,
1779
+ "megaphone": lu.LuMegaphone,
1780
+ "shield": lu.LuShield,
1781
+ "shield-check": lu.LuShieldCheck,
1782
+ "phone": lu.LuPhone,
1783
+ "phone-call": lu.LuPhoneCall,
1784
+ "book-open": lu.LuBookOpen,
1785
+ "notebook-pen": lu.LuNotebookPen,
1786
+ "radio": lu.LuRadio,
1787
+ "voicemail": lu.LuVoicemail,
1788
+ "square-check": lu.LuSquareCheck,
1789
+ "circle-check": lu.LuCircleCheck,
1790
+ "rotate-ccw": lu.LuRotateCcw,
1791
+ "refresh-cw": lu.LuRefreshCw,
1792
+ "history": lu.LuHistory,
1793
+ "smartphone": lu.LuSmartphone,
1794
+ "pencil": lu.LuPencil,
1795
+ "sparkles": lu.LuSparkles,
1796
+ "target": lu.LuTarget,
1797
+ "flask-conical": lu.LuFlaskConical,
1798
+ "settings": lu.LuSettings,
1799
+ "sliders-horizontal": lu.LuSlidersHorizontal,
1800
+ "inbox": lu.LuInbox,
1801
+ "share-2": lu.LuShare2,
1802
+ "building-2": lu.LuBuilding2,
1803
+ "palette": lu.LuPalette,
1804
+ "credit-card": lu.LuCreditCard,
1805
+ "wallet": lu.LuWallet,
1806
+ "receipt": lu.LuReceipt,
1807
+ "dollar-sign": lu.LuDollarSign,
1808
+ "mail": lu.LuMail,
1809
+ "mail-open": lu.LuMailOpen,
1810
+ "bell": lu.LuBell,
1811
+ "house": lu.LuHouse,
1812
+ "star": lu.LuStar,
1813
+ "heart": lu.LuHeart,
1814
+ "hand-heart": lu.LuHandHeart,
1815
+ "tag": lu.LuTag,
1816
+ "filter": lu.LuFilter,
1817
+ "search": lu.LuSearch,
1818
+ "globe": lu.LuGlobe,
1819
+ "link": lu.LuLink,
1820
+ "image": lu.LuImage,
1821
+ "video": lu.LuVideo,
1822
+ "mic": lu.LuMic,
1823
+ "printer": lu.LuPrinter,
1824
+ "eye": lu.LuEye,
1825
+ "lock": lu.LuLock,
1826
+ "key": lu.LuKey,
1827
+ "vote": lu.LuVote,
1828
+ "landmark": lu.LuLandmark,
1829
+ "newspaper": lu.LuNewspaper,
1830
+ "kanban": lu.LuKanban,
1831
+ "wrench": lu.LuWrench,
1832
+ "zap": lu.LuZap,
1833
+ "rocket": lu.LuRocket,
1834
+ "archive": lu.LuArchive,
1835
+ "trash-2": lu.LuTrash2,
1836
+ "circle-help": lu.LuCircleHelp,
1837
+ "info": lu.LuInfo,
1838
+ "triangle-alert": lu.LuTriangleAlert,
1839
+ "door-open": lu.LuDoorOpen,
1840
+ "signpost": lu.LuSignpost,
1841
+ "badge-check": lu.LuBadgeCheck,
1842
+ "award": lu.LuAward,
1843
+ "briefcase": lu.LuBriefcase,
1844
+ "handshake": lu.LuHandshake,
1845
+ "network": lu.LuNetwork,
1846
+ "workflow": lu.LuWorkflow,
1847
+ "git-branch": lu.LuGitBranch
1848
+ };
1849
+ function resolveTabGlyph(name) {
1850
+ if (!name) return null;
1851
+ const key = name.trim().replace(/^['"]|['"]$/g, "").trim().toLowerCase();
1852
+ if (!key) return null;
1853
+ return Object.prototype.hasOwnProperty.call(TAB_GLYPHS, key) ? TAB_GLYPHS[key] : null;
1854
+ }
1855
+ var KNOWN_TAB_GLYPHS = Object.freeze(Object.keys(TAB_GLYPHS));
1657
1856
 
1658
1857
  // src/sw/registerShellPrecache.ts
1659
1858
  async function registerShellPrecache(opts = {}) {
@@ -1766,6 +1965,8 @@ function SpeculationRulesScript({ items }) {
1766
1965
  return null;
1767
1966
  }
1768
1967
 
1968
+ exports.AI_CREDITS_STATE_TITLES = AI_CREDITS_STATE_TITLES;
1969
+ exports.AiCreditsState = AiCreditsState;
1769
1970
  exports.BrandIcon = BrandIcon;
1770
1971
  exports.BrandLogo = BrandLogo;
1771
1972
  exports.BreadcrumbBar = BreadcrumbBar;
@@ -1773,6 +1974,7 @@ exports.Card = Card;
1773
1974
  exports.FormColumn = FormColumn;
1774
1975
  exports.GlobalUiIdProvider = GlobalUiIdProvider;
1775
1976
  exports.HeaderTabBar = HeaderTabBar;
1977
+ exports.KNOWN_TAB_GLYPHS = KNOWN_TAB_GLYPHS;
1776
1978
  exports.PageContainer = PageContainer;
1777
1979
  exports.PageHeader = PageHeader;
1778
1980
  exports.ShellChromeContext = ShellChromeContext;
@@ -1786,6 +1988,7 @@ exports.ShellProvider = ShellProvider;
1786
1988
  exports.ShellRoleContext = ShellRoleContext;
1787
1989
  exports.ShellSupportProviderContext = ShellSupportProviderContext;
1788
1990
  exports.SpeculationRulesScript = SpeculationRulesScript;
1991
+ exports.aiCreditsWalletUrl = aiCreditsWalletUrl;
1789
1992
  exports.buildNavSpeculationRules = buildNavSpeculationRules;
1790
1993
  exports.buildSpeculationRules = buildSpeculationRules;
1791
1994
  exports.collectSiblingAppUrls = collectSiblingAppUrls;
@@ -1800,6 +2003,7 @@ exports.normalizeHexColor = normalizeHexColor;
1800
2003
  exports.normalizeNotificationsFeed = normalizeNotificationsFeed;
1801
2004
  exports.politogyTheme = politogyTheme;
1802
2005
  exports.registerShellPrecache = registerShellPrecache;
2006
+ exports.resolveTabGlyph = resolveTabGlyph;
1803
2007
  exports.useAppRegistry = useAppRegistry;
1804
2008
  exports.useCurrentApp = useCurrentApp;
1805
2009
  exports.useShellAuth = useShellAuth;