@the-portland-company/shell 0.11.0 → 0.11.2
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/CHANGELOG.md +16 -0
- package/dist/chunk-VTGRJ4HV.js +25 -0
- package/dist/chunk-VTGRJ4HV.js.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -9
- package/dist/index.d.ts +2 -9
- package/dist/index.js +3 -19
- package/dist/index.js.map +1 -1
- package/dist/native.cjs +38 -4
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +7 -0
- package/dist/native.d.ts +7 -0
- package/dist/native.js +21 -6
- package/dist/native.js.map +1 -1
- package/dist/topbarIconSlot-FunwEKO9.d.cts +10 -0
- package/dist/topbarIconSlot-FunwEKO9.d.ts +10 -0
- package/package.json +22 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 0.11.1 — 2026-07-20
|
|
2
|
+
|
|
3
|
+
### Fixed (packaging — native install)
|
|
4
|
+
|
|
5
|
+
- **Chakra-only peers are now `optional`** via `peerDependenciesMeta`
|
|
6
|
+
(`@chakra-ui/react`, `@emotion/react`, `@emotion/styled`,
|
|
7
|
+
`@supabase/supabase-js`, `react-icons`, `react-router-dom`). The `./native`
|
|
8
|
+
export imports none of them — only `react`/`react-dom` (still required) — so
|
|
9
|
+
the Next.js worker apps (Forms/Surveys/Polls) can `npm i
|
|
10
|
+
@the-portland-company/shell` without `ERESOLVE` and without
|
|
11
|
+
`--legacy-peer-deps`. The Chakra `.` export still expects these at runtime;
|
|
12
|
+
apps that use it already install them.
|
|
13
|
+
- **Relaxed the `@supabase/supabase-js` peer range** from `~2.95.3`
|
|
14
|
+
(`>=2.95.3 <2.96`) to `>=2.95.3 <3` so it no longer conflicts with apps on a
|
|
15
|
+
newer 2.x (e.g. surveys on `^2.106.2`).
|
|
16
|
+
|
|
1
17
|
## 0.11.0 — 2026-07-20
|
|
2
18
|
|
|
3
19
|
### Added (native — icon-only tab strip)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
// src/lib/topbarIconSlot.ts
|
|
4
|
+
function useTopBarIconSlotGlyph(slot) {
|
|
5
|
+
const [name, setName] = useState(null);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
if (typeof window === "undefined") return;
|
|
8
|
+
const read = () => {
|
|
9
|
+
const raw = window.getComputedStyle(document.documentElement).getPropertyValue(`--topbar-icon-${slot}`).trim().replace(/^['"]|['"]$/g, "");
|
|
10
|
+
setName(raw.length > 0 ? raw : null);
|
|
11
|
+
};
|
|
12
|
+
read();
|
|
13
|
+
const observer = new MutationObserver(read);
|
|
14
|
+
observer.observe(document.head, { childList: true, subtree: true });
|
|
15
|
+
return () => observer.disconnect();
|
|
16
|
+
}, [slot]);
|
|
17
|
+
return name;
|
|
18
|
+
}
|
|
19
|
+
function brandIconSrc(name, basePath = "/brand/icons/") {
|
|
20
|
+
return `${basePath}${name}.svg`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { brandIconSrc, useTopBarIconSlotGlyph };
|
|
24
|
+
//# sourceMappingURL=chunk-VTGRJ4HV.js.map
|
|
25
|
+
//# sourceMappingURL=chunk-VTGRJ4HV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/topbarIconSlot.ts"],"names":[],"mappings":";;;AA6BO,SAAS,uBAAuB,IAAA,EAAqC;AAC1E,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAwB,IAAI,CAAA;AAEpD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AAEnC,IAAA,MAAM,OAAO,MAAM;AACjB,MAAA,MAAM,GAAA,GAAM,MAAA,CACT,gBAAA,CAAiB,QAAA,CAAS,eAAe,CAAA,CACzC,gBAAA,CAAiB,CAAA,cAAA,EAAiB,IAAI,EAAE,CAAA,CACxC,IAAA,EAAK,CAEL,OAAA,CAAQ,gBAAgB,EAAE,CAAA;AAC7B,MAAA,OAAA,CAAQ,GAAA,CAAI,MAAA,GAAS,CAAA,GAAI,GAAA,GAAM,IAAI,CAAA;AAAA,IACrC,CAAA;AAEA,IAAA,IAAA,EAAK;AAEL,IAAA,MAAM,QAAA,GAAW,IAAI,gBAAA,CAAiB,IAAI,CAAA;AAC1C,IAAA,QAAA,CAAS,OAAA,CAAQ,SAAS,IAAA,EAAM,EAAE,WAAW,IAAA,EAAM,OAAA,EAAS,MAAM,CAAA;AAClE,IAAA,OAAO,MAAM,SAAS,UAAA,EAAW;AAAA,EACnC,CAAA,EAAG,CAAC,IAAI,CAAC,CAAA;AAET,EAAA,OAAO,IAAA;AACT;AAGO,SAAS,YAAA,CAAa,IAAA,EAAc,QAAA,GAAW,eAAA,EAAiB;AACrE,EAAA,OAAO,CAAA,EAAG,QAAQ,CAAA,EAAG,IAAI,CAAA,IAAA,CAAA;AAC3B","file":"chunk-VTGRJ4HV.js","sourcesContent":["import { useEffect, useState } from 'react'\n\n/**\n * The six canonical top-bar action slots (Reference/Global-Rules v9 → top-bar\n * icons). Each slot's GLYPH is unique and comes from the Brand API\n * `topbarIcons.items.*` tokens, exposed as `--topbar-icon-<slot>` CSS vars\n * whose value is the brand-icon NAME. Every OTHER property — size, gap, color,\n * hover, selected — is universal across all six slots.\n */\nexport type TopBarIconSlot =\n | 'comms-fuel'\n | 'apps'\n | 'notifications'\n | 'alerts'\n | 'support'\n | 'dark-mode'\n\n/**\n * Reads the glyph NAME for a slot from its `--topbar-icon-<slot>` CSS var.\n *\n * Runs in an effect because the Brand stylesheet is appended to <head> at\n * runtime (Global Rules forbids baking it into the build), so the var is not\n * resolvable during SSR or the first synchronous render. The MutationObserver\n * re-reads once the stylesheet lands so the glyph upgrades from the caller's\n * fallback without a reload.\n *\n * Returns null when the slot has no Brand glyph — callers render their own\n * fallback icon in that case.\n */\nexport function useTopBarIconSlotGlyph(slot: TopBarIconSlot): string | null {\n const [name, setName] = useState<string | null>(null)\n\n useEffect(() => {\n if (typeof window === 'undefined') return\n\n const read = () => {\n const raw = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(`--topbar-icon-${slot}`)\n .trim()\n // Brand may emit the name quoted (e.g. \"bell\"); strip the quotes.\n .replace(/^['\"]|['\"]$/g, '')\n setName(raw.length > 0 ? raw : null)\n }\n\n read()\n\n const observer = new MutationObserver(read)\n observer.observe(document.head, { childList: true, subtree: true })\n return () => observer.disconnect()\n }, [slot])\n\n return name\n}\n\n/** Path to a brand-icon SVG in the consuming app's public dir. */\nexport function brandIconSrc(name: string, basePath = '/brand/icons/') {\n return `${basePath}${name}.svg`\n}\n"]}
|
package/dist/index.cjs
CHANGED
|
@@ -2655,7 +2655,7 @@ function AppLayout({
|
|
|
2655
2655
|
overlaySlot
|
|
2656
2656
|
] });
|
|
2657
2657
|
}
|
|
2658
|
-
function
|
|
2658
|
+
function useTopBarIconSlotGlyph(slot) {
|
|
2659
2659
|
const [name, setName] = react$1.useState(null);
|
|
2660
2660
|
react$1.useEffect(() => {
|
|
2661
2661
|
if (typeof window === "undefined") return;
|
|
@@ -2672,7 +2672,7 @@ function useSlotGlyphName(slot) {
|
|
|
2672
2672
|
}
|
|
2673
2673
|
var TopBarIcon = react$1.forwardRef(
|
|
2674
2674
|
function TopBarIcon2({ slot, fallbackIcon, isSelected, ...rest }, ref) {
|
|
2675
|
-
const glyphName =
|
|
2675
|
+
const glyphName = useTopBarIconSlotGlyph(slot);
|
|
2676
2676
|
const icon = glyphName ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2677
2677
|
BrandIcon,
|
|
2678
2678
|
{
|