@snokam/navbar 2.0.0 → 2.1.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/CHANGELOG.md +12 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/v1/SimpleHeader.stories.d.ts +9 -3
- package/dist/v1/SimpleHeader.stories.d.ts.map +1 -1
- package/dist/v1/SimpleHeader.stories.js +17 -4
- package/dist/v1/SimpleHeader.stories.js.map +1 -1
- package/dist/v1/components/SimpleHeader/base.d.ts +15 -0
- package/dist/v1/components/SimpleHeader/base.d.ts.map +1 -0
- package/dist/v1/components/SimpleHeader/base.js +24 -0
- package/dist/v1/components/SimpleHeader/base.js.map +1 -0
- package/dist/v1/components/SimpleHeader/index.d.ts +5 -0
- package/dist/v1/components/SimpleHeader/index.d.ts.map +1 -1
- package/dist/v1/components/SimpleHeader/index.js +9 -9
- package/dist/v1/components/SimpleHeader/index.js.map +1 -1
- package/dist/v1/components/SimpleHeader/types.d.ts +21 -0
- package/dist/v1/components/SimpleHeader/types.d.ts.map +1 -1
- package/dist/v1/index.d.ts +2 -1
- package/dist/v1/index.d.ts.map +1 -1
- package/dist/v1/index.js +1 -0
- package/dist/v1/index.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.1.0](https://github.com/snokam/monorepo/compare/@snokam/navbar@2.0.1...@snokam/navbar@2.1.0) (2026-08-18)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **navbar,footer:** split the markup from the wiring ([#2358](https://github.com/snokam/monorepo/issues/2358)) ([084865a](https://github.com/snokam/monorepo/commit/084865ae9b41e00cee07c3829f645b789c50ee97))
|
|
11
|
+
|
|
12
|
+
## [2.0.1](https://github.com/snokam/monorepo/compare/@snokam/navbar@2.0.0...@snokam/navbar@2.0.1) (2026-08-18)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- **navbar,footer:** add the root entry both packages advertise ([#2357](https://github.com/snokam/monorepo/issues/2357)) ([8f64dd3](https://github.com/snokam/monorepo/commit/8f64dd3242794f40afae308deaaec7feb7282fa1))
|
|
17
|
+
|
|
6
18
|
# 2.0.0 (2026-08-18)
|
|
7
19
|
|
|
8
20
|
- refactor!: strip the Next application out of the six packages ([af931b1](https://github.com/snokam/monorepo/commit/af931b15d16c4e935198ddcec425cd18bef926e0))
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { SimpleHeaderBase } from "./components/SimpleHeader/base";
|
|
3
|
+
/**
|
|
4
|
+
* These render `SimpleHeaderBase`, not `SimpleHeader`. The wired header reads the CMS, the session
|
|
5
|
+
* and the tenant config, none of which exist in Storybook — mocking all three only to look at a
|
|
6
|
+
* header was the reason these stories used to break. The base takes the same three as props.
|
|
7
|
+
*/
|
|
8
|
+
declare const meta: Meta<typeof SimpleHeaderBase>;
|
|
4
9
|
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof
|
|
10
|
+
type Story = StoryObj<typeof SimpleHeaderBase>;
|
|
6
11
|
export declare const Light: Story;
|
|
7
12
|
export declare const Dark: Story;
|
|
8
13
|
export declare const WithBackLink: Story;
|
|
14
|
+
export declare const SignedIn: Story;
|
|
9
15
|
//# sourceMappingURL=SimpleHeader.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleHeader.stories.d.ts","sourceRoot":"","sources":["../../src/v1/SimpleHeader.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SimpleHeader.stories.d.ts","sourceRoot":"","sources":["../../src/v1/SimpleHeader.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGlE;;;;GAIG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAavC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE/C,eAAO,MAAM,KAAK,EAAE,KAAU,CAAC;AAE/B,eAAO,MAAM,IAAI,EAAE,KAElB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC"}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SimpleHeaderBase } from "./components/SimpleHeader/base";
|
|
2
2
|
import { HeaderTheme } from "./components/SimpleHeader/types";
|
|
3
|
+
/**
|
|
4
|
+
* These render `SimpleHeaderBase`, not `SimpleHeader`. The wired header reads the CMS, the session
|
|
5
|
+
* and the tenant config, none of which exist in Storybook — mocking all three only to look at a
|
|
6
|
+
* header was the reason these stories used to break. The base takes the same three as props.
|
|
7
|
+
*/
|
|
3
8
|
const meta = {
|
|
4
9
|
title: "Chrome/SimpleHeader",
|
|
5
|
-
component:
|
|
10
|
+
component: SimpleHeaderBase,
|
|
6
11
|
parameters: { layout: "fullscreen" },
|
|
7
|
-
args: {
|
|
12
|
+
args: {
|
|
13
|
+
theme: HeaderTheme.Light,
|
|
14
|
+
logo: { url: "/snokam-logo.svg", alt: "Snøkam" },
|
|
15
|
+
homeUrl: "https://snokam.no",
|
|
16
|
+
myPageUrl: "https://minside.snokam.no",
|
|
17
|
+
},
|
|
8
18
|
argTypes: {
|
|
9
19
|
theme: { control: "radio", options: Object.values(HeaderTheme) },
|
|
10
20
|
},
|
|
@@ -12,9 +22,12 @@ const meta = {
|
|
|
12
22
|
export default meta;
|
|
13
23
|
export const Light = {};
|
|
14
24
|
export const Dark = {
|
|
15
|
-
args: { theme: HeaderTheme.Dark },
|
|
25
|
+
args: { theme: HeaderTheme.Dark, logo: { url: "/snokam-logo-white.svg", alt: "Snøkam" } },
|
|
16
26
|
};
|
|
17
27
|
export const WithBackLink = {
|
|
18
28
|
args: { backUrl: "/", backText: "Tilbake" },
|
|
19
29
|
};
|
|
30
|
+
export const SignedIn = {
|
|
31
|
+
args: { user: { name: "Kari Nordmann" } },
|
|
32
|
+
};
|
|
20
33
|
//# sourceMappingURL=SimpleHeader.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleHeader.stories.js","sourceRoot":"","sources":["../../src/v1/SimpleHeader.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SimpleHeader.stories.js","sourceRoot":"","sources":["../../src/v1/SimpleHeader.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D;;;;GAIG;AACH,MAAM,IAAI,GAAkC;IAC1C,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,gBAAgB;IAC3B,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;IACpC,IAAI,EAAE;QACJ,KAAK,EAAE,WAAW,CAAC,KAAK;QACxB,IAAI,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,QAAQ,EAAE;QAChD,OAAO,EAAE,mBAAmB;QAC5B,SAAS,EAAE,2BAA2B;KACvC;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE;KACjE;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,KAAK,GAAU,EAAE,CAAC;AAE/B,MAAM,CAAC,MAAM,IAAI,GAAU;IACzB,IAAI,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,wBAAwB,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE;CAC1F,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,IAAI,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE;CAC5C,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAU;IAC7B,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE;CAC1C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SimpleHeaderBaseProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* The header as markup: everything it draws arrives as a prop.
|
|
4
|
+
*
|
|
5
|
+
* `SimpleHeader` is this component with the CMS, the session and the tenant config read for you.
|
|
6
|
+
* Reach for that one inside a Snøkam app. Reach for this one anywhere those three are not
|
|
7
|
+
* available — a Storybook story, a test, a Vite app — where the wired version would only render
|
|
8
|
+
* empty strings, or throw.
|
|
9
|
+
*
|
|
10
|
+
* The one context left is the framework, and it has working defaults: no provider means an `<a>`
|
|
11
|
+
* and an `<img>`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function SimpleHeaderBase({ logo, homeUrl, myPageUrl, backUrl, backText, theme, user, settingsHref, children, }: SimpleHeaderBaseProps): import("react").JSX.Element;
|
|
14
|
+
export default SimpleHeaderBase;
|
|
15
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/base.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAK7D;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,OAAY,EACZ,SAAc,EACd,OAAO,EACP,QAAQ,EACR,KAAyB,EACzB,IAAI,EACJ,YAAY,EACZ,QAAQ,GACT,EAAE,qBAAqB,+BA0CvB;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Styled from "./styled";
|
|
4
|
+
import { HeaderTheme } from "./types";
|
|
5
|
+
import Layout from "@snokam/ui/layout";
|
|
6
|
+
import { SystemThemeTag } from "@snokam/ui";
|
|
7
|
+
import { useFramework } from "@snokam/ui/framework";
|
|
8
|
+
/**
|
|
9
|
+
* The header as markup: everything it draws arrives as a prop.
|
|
10
|
+
*
|
|
11
|
+
* `SimpleHeader` is this component with the CMS, the session and the tenant config read for you.
|
|
12
|
+
* Reach for that one inside a Snøkam app. Reach for this one anywhere those three are not
|
|
13
|
+
* available — a Storybook story, a test, a Vite app — where the wired version would only render
|
|
14
|
+
* empty strings, or throw.
|
|
15
|
+
*
|
|
16
|
+
* The one context left is the framework, and it has working defaults: no provider means an `<a>`
|
|
17
|
+
* and an `<img>`.
|
|
18
|
+
*/
|
|
19
|
+
export function SimpleHeaderBase({ logo, homeUrl = "", myPageUrl = "", backUrl, backText, theme = HeaderTheme.Light, user, settingsHref, children, }) {
|
|
20
|
+
const { Link, Image } = useFramework();
|
|
21
|
+
return (_jsx(Styled.Header, { theme: theme, children: _jsx(Layout.Content, { children: _jsxs(Styled.Menu, { children: [_jsx(Styled.Link, { href: homeUrl, children: _jsx(Image, { "data-sanity": logo.sanityAttr, alt: logo.alt || "Snøkam logo", src: logo.url, height: 30, width: 159 }) }), _jsxs(Styled.Right, { children: [_jsx(SystemThemeTag, { settingsHref: settingsHref ?? (user ? `${myPageUrl}/innstillinger` : "#tema") }), backUrl && (_jsxs(Styled.BackLink, { as: Link, href: backUrl, children: [_jsx(Styled.BackIcon, {}), _jsx(Styled.BackText, { children: backText })] })), user && (_jsx(Styled.Link, { href: myPageUrl, children: _jsxs(Styled.User, { children: [_jsx(Styled.Name, { children: user.name }), user.image && _jsx(Styled.UserAvatar, { src: user.image })] }) })), children] })] }) }) }));
|
|
22
|
+
}
|
|
23
|
+
export default SimpleHeaderBase;
|
|
24
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/base.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAyB,MAAM,SAAS,CAAC;AAC7D,OAAO,MAAuB,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,IAAI,EACJ,OAAO,GAAG,EAAE,EACZ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C;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { SimpleHeaderProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* The header, wired to the app it lives in: logo and labels from the CMS, the signed-in user from
|
|
4
|
+
* the session, the links from the tenant config. {@link SimpleHeaderBase} is the same header with
|
|
5
|
+
* those four passed in as props, for anywhere that has none of them.
|
|
6
|
+
*/
|
|
2
7
|
export declare function SimpleHeader({ backUrl, backText, theme, }: SimpleHeaderProps): import("react").JSX.Element;
|
|
3
8
|
export default SimpleHeader;
|
|
4
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAOzD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,QAAQ,EACR,KAAyB,GAC1B,EAAE,iBAAiB,+BAwBnB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx
|
|
3
|
-
import Styled from "./styled";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
3
|
import { usePageContent } from "@snokam/sanity-page-content";
|
|
5
4
|
import { HeaderTheme } from "./types";
|
|
6
|
-
import Layout from "@snokam/ui/layout";
|
|
7
5
|
import { useColorScheme } from "@snokam/ui/theme/admin";
|
|
8
6
|
import { useAuth } from "@snokam/auth";
|
|
9
7
|
import { useConfig } from "@snokam/config";
|
|
10
|
-
import { SystemThemeTag } from "@snokam/ui";
|
|
11
8
|
import { LanguagePicker } from "../LanguagePicker";
|
|
12
|
-
import {
|
|
9
|
+
import { SimpleHeaderBase } from "./base";
|
|
10
|
+
/**
|
|
11
|
+
* The header, wired to the app it lives in: logo and labels from the CMS, the signed-in user from
|
|
12
|
+
* the session, the links from the tenant config. {@link SimpleHeaderBase} is the same header with
|
|
13
|
+
* those four passed in as props, for anywhere that has none of them.
|
|
14
|
+
*/
|
|
13
15
|
export function SimpleHeader({ backUrl, backText, theme = HeaderTheme.Light, }) {
|
|
14
16
|
const { getText, getImage, getAttr } = usePageContent();
|
|
15
|
-
const { Link, Image } = useFramework();
|
|
16
17
|
const { session } = useAuth();
|
|
17
18
|
const config = useConfig();
|
|
18
19
|
const resolvedTheme = useColorScheme();
|
|
19
20
|
const logoKey = resolvedTheme === "dark" || theme === HeaderTheme.Dark
|
|
20
21
|
? "navbarWhiteLogo"
|
|
21
22
|
: "navbarBlueLogo";
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
: "#tema" }), backUrl && (_jsxs(Styled.BackLink, { as: Link, href: backUrl, children: [_jsx(Styled.BackIcon, {}), _jsx(Styled.BackText, { children: backText ?? getText("navbarBack") })] })), session && (_jsx(Styled.Link, { href: config.NEXT_PUBLIC_MY_PAGE_BASE_URL ?? "", children: _jsxs(Styled.User, { children: [_jsx(Styled.Name, { children: session.user?.name }), session.user?.image && (_jsx(Styled.UserAvatar, { src: session.user?.image }))] }) })), _jsx(LanguagePicker, { theme: theme })] })] }) }) }));
|
|
23
|
+
const logo = getImage(logoKey);
|
|
24
|
+
return (_jsx(SimpleHeaderBase, { theme: theme, backUrl: backUrl, backText: backText ?? getText("navbarBack"), logo: { url: logo.url, alt: logo.alt, sanityAttr: getAttr(logoKey) }, homeUrl: config.NEXT_PUBLIC_SNOKAM_BASE_URL ?? "", myPageUrl: config.NEXT_PUBLIC_MY_PAGE_BASE_URL ?? "", user: session?.user ?? null, children: _jsx(LanguagePicker, { theme: theme }) }));
|
|
25
25
|
}
|
|
26
26
|
export default SimpleHeader;
|
|
27
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAqB,WAAW,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE1C;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,OAAO,EACP,QAAQ,EACR,KAAK,GAAG,WAAW,CAAC,KAAK,GACP;IAClB,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,CAAC;IACxD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;IAC9B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,aAAa,GAAG,cAAc,EAAE,CAAC;IACvC,MAAM,OAAO,GACX,aAAa,KAAK,MAAM,IAAI,KAAK,KAAK,WAAW,CAAC,IAAI;QACpD,CAAC,CAAC,iBAAiB;QACnB,CAAC,CAAC,gBAAgB,CAAC;IACvB,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAE/B,OAAO,CACL,KAAC,gBAAgB,IACf,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC,EAC3C,IAAI,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,EACpE,OAAO,EAAE,MAAM,CAAC,2BAA2B,IAAI,EAAE,EACjD,SAAS,EAAE,MAAM,CAAC,4BAA4B,IAAI,EAAE,EACpD,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,IAAI,YAE3B,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,GAAI,GACf,CACpB,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -10,4 +10,25 @@ export interface SimpleHeaderProps {
|
|
|
10
10
|
extraButtons?: ReactNode;
|
|
11
11
|
userHref?: string;
|
|
12
12
|
}
|
|
13
|
+
export interface HeaderLogo {
|
|
14
|
+
url: string;
|
|
15
|
+
alt?: string;
|
|
16
|
+
sanityAttr?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface HeaderUser {
|
|
19
|
+
name?: string | null;
|
|
20
|
+
image?: string | null;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Everything {@link SimpleHeaderBase} draws. The wired `SimpleHeader` fills these in from the CMS,
|
|
24
|
+
* the session and the tenant config; supply them yourself when none of those exist.
|
|
25
|
+
*/
|
|
26
|
+
export interface SimpleHeaderBaseProps extends SimpleHeaderProps {
|
|
27
|
+
logo: HeaderLogo;
|
|
28
|
+
homeUrl?: string;
|
|
29
|
+
myPageUrl?: string;
|
|
30
|
+
user?: HeaderUser | null;
|
|
31
|
+
settingsHref?: string;
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
}
|
|
13
34
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/types.tsx"],"names":[],"mappings":"AAAA,O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AM,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB"}
|
package/dist/v1/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SimpleHeader } from "./components/SimpleHeader";
|
|
2
|
+
export { SimpleHeaderBase } from "./components/SimpleHeader/base";
|
|
2
3
|
export { HeaderTheme } from "./components/SimpleHeader/types";
|
|
3
|
-
export type { SimpleHeaderProps } from "./components/SimpleHeader/types";
|
|
4
|
+
export type { SimpleHeaderProps, SimpleHeaderBaseProps, HeaderLogo, HeaderUser, } from "./components/SimpleHeader/types";
|
|
4
5
|
export { LanguagePicker } from "./components/LanguagePicker";
|
|
5
6
|
export default SimpleHeader;
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/v1/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,UAAU,GACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,eAAe,YAAY,CAAC"}
|
package/dist/v1/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SimpleHeader } from "./components/SimpleHeader";
|
|
2
|
+
export { SimpleHeaderBase } from "./components/SimpleHeader/base";
|
|
2
3
|
export { HeaderTheme } from "./components/SimpleHeader/types";
|
|
3
4
|
export { LanguagePicker } from "./components/LanguagePicker";
|
|
4
5
|
export default SimpleHeader;
|
package/dist/v1/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAO9D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,eAAe,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.1.0",
|
|
3
3
|
"dependencies": {
|
|
4
4
|
"@emotion/react": "^11.14.0",
|
|
5
5
|
"@emotion/styled": "^11.14.1",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"next-auth": "4.24.15",
|
|
11
11
|
"react": "19.2.8",
|
|
12
12
|
"react-dom": "19.2.8",
|
|
13
|
-
"@snokam/
|
|
13
|
+
"@snokam/auth": "2.3.0",
|
|
14
14
|
"@snokam/sanity-page-content": "1.18.0",
|
|
15
|
-
"@snokam/
|
|
16
|
-
"@snokam/
|
|
15
|
+
"@snokam/config": "1.1.0",
|
|
16
|
+
"@snokam/ui": "1.1.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/node": "^26.1.1",
|