@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.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PageHeaderProps, B as BreadcrumbBarProps, N as NavItem } from './index-Cg5aEImm.cjs';
2
- export { C as Card, a as CommsNotification, b as CommsNotificationKind, F as FormColumn, H as HeaderTabBar, c as HeaderTabBarItem, d as NotificationsAdapter, e as NotificationsFeed, f as createCommsNotificationsAdapter, g as emptyNotificationsFeed, n as normalizeNotificationsFeed } from './index-Cg5aEImm.cjs';
1
+ import { P as PageHeaderProps, B as BreadcrumbBarProps, N as NavItem } from './index-BAFJZuRA.cjs';
2
+ export { C as Card, a as CommsNotification, b as CommsNotificationKind, F as FormColumn, H as HeaderTabBar, c as HeaderTabBarItem, K as KNOWN_TAB_GLYPHS, d as NotificationsAdapter, e as NotificationsFeed, T as TabGlyphComponent, f as createCommsNotificationsAdapter, g as emptyNotificationsFeed, n as normalizeNotificationsFeed, r as resolveTabGlyph } from './index-BAFJZuRA.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-DG32i0jC.js';
2
- export { C as Card, a as CommsNotification, b as CommsNotificationKind, F as FormColumn, H as HeaderTabBar, c as HeaderTabBarItem, d as NotificationsAdapter, e as NotificationsFeed, f as createCommsNotificationsAdapter, g as emptyNotificationsFeed, n as normalizeNotificationsFeed } from './index-DG32i0jC.js';
1
+ import { P as PageHeaderProps, B as BreadcrumbBarProps, N as NavItem } from './index-DoSs3sQY.js';
2
+ export { C as Card, a as CommsNotification, b as CommsNotificationKind, F as FormColumn, H as HeaderTabBar, c as HeaderTabBarItem, K as KNOWN_TAB_GLYPHS, d as NotificationsAdapter, e as NotificationsFeed, T as TabGlyphComponent, f as createCommsNotificationsAdapter, g as emptyNotificationsFeed, n as normalizeNotificationsFeed, r as resolveTabGlyph } from './index-DoSs3sQY.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,5 +1,5 @@
1
- import { PageHeaderView, warnDeprecated, BreadcrumbBarView } from './chunk-ZS7MQXDQ.js';
2
- export { Card, FormColumn, HeaderTabBar, SpeculationRulesScript, buildNavSpeculationRules, buildSpeculationRules, collectSiblingAppUrls, createCommsNotificationsAdapter, emptyNotificationsFeed, normalizeNotificationsFeed } from './chunk-ZS7MQXDQ.js';
1
+ import { PageHeaderView, warnDeprecated, BreadcrumbBarView } from './chunk-Y66PVCZO.js';
2
+ export { Card, FormColumn, HeaderTabBar, KNOWN_TAB_GLYPHS, SpeculationRulesScript, buildNavSpeculationRules, buildSpeculationRules, collectSiblingAppUrls, createCommsNotificationsAdapter, emptyNotificationsFeed, normalizeNotificationsFeed, resolveTabGlyph } from './chunk-Y66PVCZO.js';
3
3
  import { readResolvedTheme } from './chunk-BHRVZPZ7.js';
4
4
  import { extendTheme, ChakraProvider, useColorMode } from '@chakra-ui/react';
5
5
  import { jsx, jsxs } from 'react/jsx-runtime';
package/dist/native.cjs CHANGED
@@ -4,9 +4,9 @@
4
4
  var react = require('react');
5
5
  var clsx4 = require('clsx');
6
6
  var fi = require('react-icons/fi');
7
+ var lu = require('react-icons/lu');
7
8
  var reactDom = require('react-dom');
8
9
  var jsxRuntime = require('react/jsx-runtime');
9
- var lu = require('react-icons/lu');
10
10
 
11
11
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
12
 
@@ -59,6 +59,173 @@ function resolveBrandGlyph(name) {
59
59
  if (!name) return null;
60
60
  return GLYPHS[name.trim().toLowerCase()] ?? null;
61
61
  }
62
+ var TAB_GLYPHS = {
63
+ "layout-dashboard": lu.LuLayoutDashboard,
64
+ "layout-list": lu.LuLayoutList,
65
+ "layout-grid": lu.LuLayoutGrid,
66
+ "layout-template": lu.LuLayoutTemplate,
67
+ "users": lu.LuUsers,
68
+ "users-round": lu.LuUsersRound,
69
+ "user": lu.LuUser,
70
+ "user-plus": lu.LuUserPlus,
71
+ "user-check": lu.LuUserCheck,
72
+ "square-user": lu.LuSquareUser,
73
+ "upload": lu.LuUpload,
74
+ "download": lu.LuDownload,
75
+ "copy": lu.LuCopy,
76
+ "library": lu.LuLibrary,
77
+ "flag": lu.LuFlag,
78
+ "flag-triangle-right": lu.LuFlagTriangleRight,
79
+ "activity": lu.LuActivity,
80
+ "table-2": lu.LuTable2,
81
+ "chart-pie": lu.LuChartPie,
82
+ "chart-column": lu.LuChartColumn,
83
+ "chart-line": lu.LuChartLine,
84
+ "chart-bar": lu.LuChartBar,
85
+ "chart-area": lu.LuChartArea,
86
+ "chart-no-axes-combined": lu.LuChartNoAxesCombined,
87
+ "lightbulb": lu.LuLightbulb,
88
+ "crosshair": lu.LuCrosshair,
89
+ "map": lu.LuMap,
90
+ "map-pin": lu.LuMapPin,
91
+ "footprints": lu.LuFootprints,
92
+ "brain": lu.LuBrain,
93
+ "clipboard-list": lu.LuClipboardList,
94
+ "clipboard-check": lu.LuClipboardCheck,
95
+ "timer": lu.LuTimer,
96
+ "clock": lu.LuClock,
97
+ "calendar": lu.LuCalendar,
98
+ "layers": lu.LuLayers,
99
+ "scale": lu.LuScale,
100
+ "route": lu.LuRoute,
101
+ "bot": lu.LuBot,
102
+ "messages-square": lu.LuMessagesSquare,
103
+ "message-square": lu.LuMessageSquare,
104
+ "message-circle": lu.LuMessageCircle,
105
+ "send": lu.LuSend,
106
+ "gauge": lu.LuGauge,
107
+ "split": lu.LuSplit,
108
+ "file-text": lu.LuFileText,
109
+ "file": lu.LuFile,
110
+ "files": lu.LuFiles,
111
+ "folder": lu.LuFolder,
112
+ "folder-lock": lu.LuFolderLock,
113
+ "list": lu.LuList,
114
+ "list-checks": lu.LuListChecks,
115
+ "list-ordered": lu.LuListOrdered,
116
+ "list-todo": lu.LuListTodo,
117
+ "trending-up": lu.LuTrendingUp,
118
+ "megaphone": lu.LuMegaphone,
119
+ "shield": lu.LuShield,
120
+ "shield-check": lu.LuShieldCheck,
121
+ "phone": lu.LuPhone,
122
+ "phone-call": lu.LuPhoneCall,
123
+ "book-open": lu.LuBookOpen,
124
+ "notebook-pen": lu.LuNotebookPen,
125
+ "radio": lu.LuRadio,
126
+ "voicemail": lu.LuVoicemail,
127
+ "square-check": lu.LuSquareCheck,
128
+ "circle-check": lu.LuCircleCheck,
129
+ "rotate-ccw": lu.LuRotateCcw,
130
+ "refresh-cw": lu.LuRefreshCw,
131
+ "history": lu.LuHistory,
132
+ "smartphone": lu.LuSmartphone,
133
+ "pencil": lu.LuPencil,
134
+ "sparkles": lu.LuSparkles,
135
+ "target": lu.LuTarget,
136
+ "flask-conical": lu.LuFlaskConical,
137
+ "settings": lu.LuSettings,
138
+ "sliders-horizontal": lu.LuSlidersHorizontal,
139
+ "inbox": lu.LuInbox,
140
+ "share-2": lu.LuShare2,
141
+ "building-2": lu.LuBuilding2,
142
+ "palette": lu.LuPalette,
143
+ "credit-card": lu.LuCreditCard,
144
+ "wallet": lu.LuWallet,
145
+ "receipt": lu.LuReceipt,
146
+ "dollar-sign": lu.LuDollarSign,
147
+ "mail": lu.LuMail,
148
+ "mail-open": lu.LuMailOpen,
149
+ "bell": lu.LuBell,
150
+ "house": lu.LuHouse,
151
+ "star": lu.LuStar,
152
+ "heart": lu.LuHeart,
153
+ "hand-heart": lu.LuHandHeart,
154
+ "tag": lu.LuTag,
155
+ "filter": lu.LuFilter,
156
+ "search": lu.LuSearch,
157
+ "globe": lu.LuGlobe,
158
+ "link": lu.LuLink,
159
+ "image": lu.LuImage,
160
+ "video": lu.LuVideo,
161
+ "mic": lu.LuMic,
162
+ "printer": lu.LuPrinter,
163
+ "eye": lu.LuEye,
164
+ "lock": lu.LuLock,
165
+ "key": lu.LuKey,
166
+ "vote": lu.LuVote,
167
+ "landmark": lu.LuLandmark,
168
+ "newspaper": lu.LuNewspaper,
169
+ "kanban": lu.LuKanban,
170
+ "wrench": lu.LuWrench,
171
+ "zap": lu.LuZap,
172
+ "rocket": lu.LuRocket,
173
+ "archive": lu.LuArchive,
174
+ "trash-2": lu.LuTrash2,
175
+ "circle-help": lu.LuCircleHelp,
176
+ "info": lu.LuInfo,
177
+ "triangle-alert": lu.LuTriangleAlert,
178
+ "door-open": lu.LuDoorOpen,
179
+ "signpost": lu.LuSignpost,
180
+ "badge-check": lu.LuBadgeCheck,
181
+ "award": lu.LuAward,
182
+ "briefcase": lu.LuBriefcase,
183
+ "handshake": lu.LuHandshake,
184
+ "network": lu.LuNetwork,
185
+ "workflow": lu.LuWorkflow,
186
+ "git-branch": lu.LuGitBranch
187
+ };
188
+ function resolveTabGlyph(name) {
189
+ if (!name) return null;
190
+ const key = name.trim().replace(/^['"]|['"]$/g, "").trim().toLowerCase();
191
+ if (!key) return null;
192
+ return Object.prototype.hasOwnProperty.call(TAB_GLYPHS, key) ? TAB_GLYPHS[key] : null;
193
+ }
194
+ var KNOWN_TAB_GLYPHS = Object.freeze(Object.keys(TAB_GLYPHS));
195
+ function tabIconVarName(strip, tabKey) {
196
+ return `--tab-icon-${strip}-${tabKey}`;
197
+ }
198
+ var EMPTY = Object.freeze({});
199
+ function useTabIconStripGlyphs(strip, tabKeys) {
200
+ const [names, setNames] = react.useState(EMPTY);
201
+ const keysSig = tabKeys.join("\0");
202
+ react.useEffect(() => {
203
+ if (!strip || typeof window === "undefined" || typeof document === "undefined") {
204
+ setNames(EMPTY);
205
+ return;
206
+ }
207
+ const keys = keysSig ? keysSig.split("\0") : [];
208
+ const read = () => {
209
+ const style = window.getComputedStyle(document.documentElement);
210
+ const next = {};
211
+ for (const key of keys) {
212
+ const raw = style.getPropertyValue(tabIconVarName(strip, key)).trim().replace(/^['"]|['"]$/g, "").trim();
213
+ if (raw) next[key] = raw;
214
+ }
215
+ setNames((prev) => sameNames(prev, next) ? prev : next);
216
+ };
217
+ read();
218
+ const observer = new MutationObserver(read);
219
+ observer.observe(document.head, { childList: true, subtree: true, characterData: true });
220
+ return () => observer.disconnect();
221
+ }, [strip, keysSig]);
222
+ return names;
223
+ }
224
+ function sameNames(a, b) {
225
+ const ak = Object.keys(a);
226
+ if (ak.length !== Object.keys(b).length) return false;
227
+ return ak.every((k) => a[k] === b[k]);
228
+ }
62
229
 
63
230
  // src/lib/deprecation.ts
64
231
  var warned = /* @__PURE__ */ new Set();
@@ -4146,9 +4313,14 @@ function NavTabStrip({
4146
4313
  linkComponent,
4147
4314
  size = "md",
4148
4315
  className,
4316
+ iconStrip,
4149
4317
  children
4150
4318
  }) {
4151
4319
  const Link = linkComponent ?? DefaultLink;
4320
+ const brandIconNames = useTabIconStripGlyphs(
4321
+ iconStrip,
4322
+ tabs.map((tab) => tab.key)
4323
+ );
4152
4324
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4153
4325
  /* @__PURE__ */ jsxRuntime.jsx(
4154
4326
  "div",
@@ -4162,7 +4334,18 @@ function NavTabStrip({
4162
4334
  "flex items-end gap-[var(--tab-gap,26px)] border-b border-[color:var(--tab-border-color,#D7DADF)]",
4163
4335
  className
4164
4336
  ].filter(Boolean).join(" "),
4165
- children: tabs.map((tab) => /* @__PURE__ */ jsxRuntime.jsx(NavTabButton, { tab, Link, size }, tab.key))
4337
+ children: tabs.map((tab) => {
4338
+ const BrandIcon = iconStrip ? resolveTabGlyph(brandIconNames[tab.key]) : null;
4339
+ return /* @__PURE__ */ jsxRuntime.jsx(
4340
+ NavTabButton,
4341
+ {
4342
+ tab: BrandIcon ? { ...tab, icon: BrandIcon } : tab,
4343
+ Link,
4344
+ size
4345
+ },
4346
+ tab.key
4347
+ );
4348
+ })
4166
4349
  }
4167
4350
  ),
4168
4351
  children !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-5", children }) : null
@@ -4375,6 +4558,7 @@ exports.CreditsAction = CreditsAction;
4375
4558
  exports.FormColumn = FormColumn;
4376
4559
  exports.FuelAction = FuelAction;
4377
4560
  exports.HeaderTabBar = HeaderTabBar;
4561
+ exports.KNOWN_TAB_GLYPHS = KNOWN_TAB_GLYPHS;
4378
4562
  exports.NavAppShell = NavAppShell;
4379
4563
  exports.NavBetaBanner = NavBetaBanner;
4380
4564
  exports.NavChromeProvider = NavChromeProvider;
@@ -4403,6 +4587,7 @@ exports.envChipClasses = envChipClasses;
4403
4587
  exports.isNavItemActive = isNavItemActive;
4404
4588
  exports.modeIdFromLabel = modeIdFromLabel;
4405
4589
  exports.resolveOrgLogoUrl = resolveOrgLogoUrl;
4590
+ exports.resolveTabGlyph = resolveTabGlyph;
4406
4591
  exports.shortEnvLabel = shortEnvLabel;
4407
4592
  exports.shortUserName = shortUserName;
4408
4593
  exports.standardPolitogyNav = standardPolitogyNav;