@snokam/navbar 1.0.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/v1/SimpleHeader.stories.d.ts +9 -0
- package/dist/v1/SimpleHeader.stories.d.ts.map +1 -0
- package/dist/v1/SimpleHeader.stories.js +20 -0
- package/dist/v1/SimpleHeader.stories.js.map +1 -0
- package/dist/v1/components/LanguagePicker/index.app-router.d.ts +7 -0
- package/dist/v1/components/LanguagePicker/index.app-router.d.ts.map +1 -0
- package/dist/v1/components/LanguagePicker/index.app-router.js +5 -0
- package/dist/v1/components/LanguagePicker/index.app-router.js.map +1 -0
- package/dist/v1/components/LanguagePicker/index.d.ts +7 -0
- package/dist/v1/components/LanguagePicker/index.d.ts.map +1 -0
- package/dist/v1/components/LanguagePicker/index.js +39 -0
- package/dist/v1/components/LanguagePicker/index.js.map +1 -0
- package/dist/v1/components/LanguagePicker/styled.d.ts +15 -0
- package/dist/v1/components/LanguagePicker/styled.d.ts.map +1 -0
- package/dist/v1/components/LanguagePicker/styled.js +48 -0
- package/dist/v1/components/LanguagePicker/styled.js.map +1 -0
- package/dist/v1/components/SimpleHeader/index.app-router.d.ts +4 -0
- package/dist/v1/components/SimpleHeader/index.app-router.d.ts.map +1 -0
- package/dist/v1/components/SimpleHeader/index.app-router.js +38 -0
- package/dist/v1/components/SimpleHeader/index.app-router.js.map +1 -0
- package/dist/v1/components/SimpleHeader/index.d.ts +4 -0
- package/dist/v1/components/SimpleHeader/index.d.ts.map +1 -0
- package/dist/v1/components/SimpleHeader/index.js +27 -0
- package/dist/v1/components/SimpleHeader/index.js.map +1 -0
- package/dist/v1/components/SimpleHeader/styled.d.ts +51 -0
- package/dist/v1/components/SimpleHeader/styled.d.ts.map +1 -0
- package/dist/v1/components/SimpleHeader/styled.js +122 -0
- package/dist/v1/components/SimpleHeader/styled.js.map +1 -0
- package/dist/v1/components/SimpleHeader/types.d.ts +13 -0
- package/dist/v1/components/SimpleHeader/types.d.ts.map +1 -0
- package/dist/v1/components/SimpleHeader/types.js +6 -0
- package/dist/v1/components/SimpleHeader/types.js.map +1 -0
- package/dist/v1/index.app-router.d.ts +6 -0
- package/dist/v1/index.app-router.d.ts.map +1 -0
- package/dist/v1/index.app-router.js +5 -0
- package/dist/v1/index.app-router.js.map +1 -0
- package/dist/v1/index.d.ts +6 -0
- package/dist/v1/index.d.ts.map +1 -0
- package/dist/v1/index.js +5 -0
- package/dist/v1/index.js.map +1 -0
- package/dist/v1/index.pages-router.d.ts +6 -0
- package/dist/v1/index.pages-router.d.ts.map +1 -0
- package/dist/v1/index.pages-router.js +5 -0
- package/dist/v1/index.pages-router.js.map +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { SimpleHeader } from "./components/SimpleHeader";
|
|
3
|
+
declare const meta: Meta<typeof SimpleHeader>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof SimpleHeader>;
|
|
6
|
+
export declare const Light: Story;
|
|
7
|
+
export declare const Dark: Story;
|
|
8
|
+
export declare const WithBackLink: Story;
|
|
9
|
+
//# sourceMappingURL=SimpleHeader.stories.d.ts.map
|
|
@@ -0,0 +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,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAQnC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C,eAAO,MAAM,KAAK,EAAE,KAAU,CAAC;AAE/B,eAAO,MAAM,IAAI,EAAE,KAElB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SimpleHeader } from "./components/SimpleHeader";
|
|
2
|
+
import { HeaderTheme } from "./components/SimpleHeader/types";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Chrome/SimpleHeader",
|
|
5
|
+
component: SimpleHeader,
|
|
6
|
+
parameters: { layout: "fullscreen" },
|
|
7
|
+
args: { theme: HeaderTheme.Light },
|
|
8
|
+
argTypes: {
|
|
9
|
+
theme: { control: "radio", options: Object.values(HeaderTheme) },
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
export const Light = {};
|
|
14
|
+
export const Dark = {
|
|
15
|
+
args: { theme: HeaderTheme.Dark },
|
|
16
|
+
};
|
|
17
|
+
export const WithBackLink = {
|
|
18
|
+
args: { backUrl: "/", backText: "Tilbake" },
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=SimpleHeader.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleHeader.stories.js","sourceRoot":"","sources":["../../src/v1/SimpleHeader.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,MAAM,IAAI,GAA8B;IACtC,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;IACpC,IAAI,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE;IAClC,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;CAClC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,IAAI,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE;CAC5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.app-router.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/LanguagePicker/index.app-router.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,UAAU,mBAAmB;IAC3B,KAAK,EAAE,WAAW,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,GAAI,WAAW,mBAAmB,QAE5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.app-router.js","sourceRoot":"","sources":["../../../../src/v1/components/LanguagePicker/index.app-router.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAQb,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,KAAK,EAAuB,EAAE,EAAE;IAC/D,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/LanguagePicker/index.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,UAAU,mBAAmB;IAC3B,KAAK,EAAE,WAAW,CAAC;CACpB;AAID,eAAO,MAAM,cAAc,GAAI,WAAW,mBAAmB,gCA+D5D,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { FormControl, MenuItem, InputLabel, Select, ListItemIcon, ListItemText, } from "@snokam/ui";
|
|
4
|
+
import { useFramework } from "@snokam/ui/framework";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { US, NO } from "country-flag-icons/react/3x2";
|
|
7
|
+
import { usePageContent } from "@snokam/sanity-page-content";
|
|
8
|
+
import Styled from "./styled";
|
|
9
|
+
const locales = ["no", "en"];
|
|
10
|
+
export const LanguagePicker = ({ theme }) => {
|
|
11
|
+
const [open, setOpen] = useState(false);
|
|
12
|
+
const { useNavigation } = useFramework();
|
|
13
|
+
const { push, pathname } = useNavigation();
|
|
14
|
+
const locale = "no";
|
|
15
|
+
const { getText } = usePageContent();
|
|
16
|
+
const languageMap = {
|
|
17
|
+
en: "English",
|
|
18
|
+
no: "Norsk",
|
|
19
|
+
};
|
|
20
|
+
const iconMap = {
|
|
21
|
+
en: US,
|
|
22
|
+
no: NO,
|
|
23
|
+
};
|
|
24
|
+
const countries = locales.map((code) => ({
|
|
25
|
+
value: code,
|
|
26
|
+
label: languageMap[code],
|
|
27
|
+
Flag: iconMap[code],
|
|
28
|
+
}));
|
|
29
|
+
const selected = countries.find((c) => c.value === locale);
|
|
30
|
+
return (_jsx(Styled.Form, { "$theme": theme, autoComplete: "off", children: _jsxs(FormControl, { size: "small", variant: "outlined", children: [_jsx(InputLabel, { id: "lang-label", children: getText("language") }), _jsx(Select, { open: open, id: "country-select", label: getText("language"), onClose: () => setOpen(false), onOpen: () => setOpen(true), value: locale, onChange: () => {
|
|
31
|
+
push(pathname);
|
|
32
|
+
}, renderValue: () => {
|
|
33
|
+
if (!selected)
|
|
34
|
+
return null;
|
|
35
|
+
const { Flag } = selected;
|
|
36
|
+
return (_jsx(Styled.Item, { children: _jsx(Flag, {}) }));
|
|
37
|
+
}, children: countries.map(({ value, label, Flag }) => (_jsxs(MenuItem, { value: value, children: [_jsx(ListItemIcon, { children: _jsx(Styled.Item, { children: _jsx(Flag, {}) }) }), _jsx(ListItemText, { primary: label })] }, value))) })] }) }));
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v1/components/LanguagePicker/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,WAAW,EACX,QAAQ,EACR,UAAU,EACV,MAAM,EACN,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,MAAM,MAAM,UAAU,CAAC;AAO9B,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAE7B,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,KAAK,EAAuB,EAAE,EAAE;IAC/D,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,EAAE,aAAa,EAAE,GAAG,YAAY,EAAE,CAAC;IACzC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,aAAa,EAAE,CAAC;IAC3C,MAAM,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,CAAC;IAErC,MAAM,WAAW,GAAG;QAClB,EAAE,EAAE,SAAS;QACb,EAAE,EAAE,OAAO;KACH,CAAC;IAEX,MAAM,OAAO,GAAG;QACd,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,EAAE;KACE,CAAC;IAEX,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACvC,KAAK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C,IAAI,KAAG,GACI,GACD,EACf,KAAC,YAAY,IAAC,OAAO,EAAE,KAAK,GAAI,KANL,KAAK,CAOvB,CACZ,CAAC,GACK,IACG,GACF,CACf,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HeaderTheme } from "../SimpleHeader/types";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
Item: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme;
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
7
|
+
Form: import("@emotion/styled").StyledComponent<{
|
|
8
|
+
theme?: import("@emotion/react").Theme;
|
|
9
|
+
as?: React.ElementType;
|
|
10
|
+
} & {
|
|
11
|
+
$theme: HeaderTheme;
|
|
12
|
+
}, import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, {}>;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
15
|
+
//# sourceMappingURL=styled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/LanguagePicker/styled.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;;;;;;;;;;gBAajB,WAAW;;;AAmC9C,wBAA8B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { HeaderTheme } from "../SimpleHeader/types";
|
|
4
|
+
import { css } from "@emotion/react";
|
|
5
|
+
const Item = styled.div `
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
|
|
9
|
+
svg {
|
|
10
|
+
width: 22px;
|
|
11
|
+
height: 22px;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
const Form = styled.form `
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 8px;
|
|
18
|
+
|
|
19
|
+
${({ $theme }) => $theme === HeaderTheme.Light
|
|
20
|
+
? css `
|
|
21
|
+
label {
|
|
22
|
+
color: var(--color-primary) !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.MuiOutlinedInput-notchedOutline {
|
|
26
|
+
border-color: var(--color-primary) !important;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
svg {
|
|
30
|
+
border-color: var(--color-primary) !important;
|
|
31
|
+
}
|
|
32
|
+
`
|
|
33
|
+
: css `
|
|
34
|
+
label {
|
|
35
|
+
color: var(--color-light-blue) !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.MuiOutlinedInput-notchedOutline {
|
|
39
|
+
border-color: var(--color-light-blue) !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
svg {
|
|
43
|
+
fill: var(--color-light-blue) !important ;
|
|
44
|
+
}
|
|
45
|
+
`}
|
|
46
|
+
`;
|
|
47
|
+
export default { Item, Form };
|
|
48
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styled.js","sourceRoot":"","sources":["../../../../src/v1/components/LanguagePicker/styled.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;CAQtB,CAAC;AAEF,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAyB;;;;;IAK7C,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CACf,MAAM,KAAK,WAAW,CAAC,KAAK;IAC1B,CAAC,CAAC,GAAG,CAAA;;;;;;;;;;;;SAYF;IACH,CAAC,CAAC,GAAG,CAAA;;;;;;;;;;;;SAYF;CACR,CAAC;AAEF,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.app-router.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/index.app-router.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAe,MAAM,SAAS,CAAC;AAoBzD,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,QAAQ,EACR,KAAyB,EACzB,YAAY,EACZ,QAAQ,GACT,EAAE,iBAAiB,+BA4DnB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Styled from "./styled";
|
|
4
|
+
import { usePageContent } from "@snokam/sanity-page-content";
|
|
5
|
+
import { HeaderTheme } from "./types";
|
|
6
|
+
import Layout from "@snokam/ui/layout";
|
|
7
|
+
import { useColorScheme } from "@snokam/ui/theme/admin";
|
|
8
|
+
import { useAuth } from "@snokam/auth/app-router";
|
|
9
|
+
import { useConfig } from "@snokam/config";
|
|
10
|
+
import { SystemThemeTag } from "@snokam/ui";
|
|
11
|
+
import { LanguagePicker } from "../LanguagePicker/index.app-router";
|
|
12
|
+
import { useFramework } from "@snokam/ui/framework";
|
|
13
|
+
function initialsFrom(name) {
|
|
14
|
+
if (!name)
|
|
15
|
+
return "";
|
|
16
|
+
return name
|
|
17
|
+
.trim()
|
|
18
|
+
.split(/\s+/)
|
|
19
|
+
.map((word) => word[0])
|
|
20
|
+
.slice(0, 2)
|
|
21
|
+
.join("")
|
|
22
|
+
.toUpperCase();
|
|
23
|
+
}
|
|
24
|
+
export function SimpleHeader({ backUrl, backText, theme = HeaderTheme.Light, extraButtons, userHref, }) {
|
|
25
|
+
const { getText, getImage, getAttr } = usePageContent();
|
|
26
|
+
const { Link, Image } = useFramework();
|
|
27
|
+
const { session } = useAuth();
|
|
28
|
+
const config = useConfig();
|
|
29
|
+
const resolvedTheme = useColorScheme();
|
|
30
|
+
const logoKey = resolvedTheme === "dark" || theme === HeaderTheme.Dark
|
|
31
|
+
? "navbarWhiteLogo"
|
|
32
|
+
: "navbarBlueLogo";
|
|
33
|
+
return (_jsx(Styled.Header, { theme: theme, children: _jsx(Layout.Content, { children: _jsxs(Styled.Menu, { children: [_jsx(Styled.Logo, { href: config.NEXT_PUBLIC_SNOKAM_BASE_URL ?? "", children: _jsx(Image, { "data-sanity": getAttr(logoKey), alt: getImage(logoKey).alt || "Snøkam logo", src: getImage(logoKey).url, height: 30, width: 159 }) }), _jsxs(Styled.Right, { children: [_jsx(SystemThemeTag, { settingsHref: session
|
|
34
|
+
? `${config.NEXT_PUBLIC_MY_PAGE_BASE_URL ?? ""}/innstillinger`
|
|
35
|
+
: "#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: userHref ?? config.NEXT_PUBLIC_MY_PAGE_BASE_URL ?? "", children: _jsxs(Styled.User, { children: [_jsx(Styled.Name, { children: session.user?.name }), _jsx(Styled.UserAvatar, { src: session.user?.image ?? undefined, children: initialsFrom(session.user?.name) })] }) })) : (extraButtons), _jsx(LanguagePicker, { theme: theme })] })] }) }) }));
|
|
36
|
+
}
|
|
37
|
+
export default SimpleHeader;
|
|
38
|
+
//# sourceMappingURL=index.app-router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.app-router.js","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/index.app-router.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,cAAc,EA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AE,IAAI,CAAC,GACf,IACR,GACF,CACf,CAAC,CAAC,CAAC,CACF,YAAY,CACb,EACD,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,GAAI,IACnB,IACH,GACC,GACH,CACjB,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAe,MAAM,SAAS,CAAC;AASzD,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,QAAQ,EACR,KAAyB,GAC1B,EAAE,iBAAiB,+BAwDnB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Styled from "./styled";
|
|
4
|
+
import { usePageContent } from "@snokam/sanity-page-content";
|
|
5
|
+
import { HeaderTheme } from "./types";
|
|
6
|
+
import Layout from "@snokam/ui/layout";
|
|
7
|
+
import { useColorScheme } from "@snokam/ui/theme/admin";
|
|
8
|
+
import { useAuth } from "@snokam/auth";
|
|
9
|
+
import { useConfig } from "@snokam/config";
|
|
10
|
+
import { SystemThemeTag } from "@snokam/ui";
|
|
11
|
+
import { LanguagePicker } from "../LanguagePicker";
|
|
12
|
+
import { useFramework } from "@snokam/ui/framework";
|
|
13
|
+
export function SimpleHeader({ backUrl, backText, theme = HeaderTheme.Light, }) {
|
|
14
|
+
const { getText, getImage, getAttr } = usePageContent();
|
|
15
|
+
const { Link, Image } = useFramework();
|
|
16
|
+
const { session } = useAuth();
|
|
17
|
+
const config = useConfig();
|
|
18
|
+
const resolvedTheme = useColorScheme();
|
|
19
|
+
const logoKey = resolvedTheme === "dark" || theme === HeaderTheme.Dark
|
|
20
|
+
? "navbarWhiteLogo"
|
|
21
|
+
: "navbarBlueLogo";
|
|
22
|
+
return (_jsx(Styled.Header, { theme: theme, children: _jsx(Layout.Content, { children: _jsxs(Styled.Menu, { children: [_jsx(Styled.Link, { href: config.NEXT_PUBLIC_SNOKAM_BASE_URL ?? "", children: _jsx(Image, { "data-sanity": getAttr(logoKey), alt: getImage(logoKey).alt || "Snøkam logo", src: getImage(logoKey).url, height: 30, width: 159 }) }), _jsxs(Styled.Right, { children: [_jsx(SystemThemeTag, { settingsHref: session
|
|
23
|
+
? `${config.NEXT_PUBLIC_MY_PAGE_BASE_URL ?? ""}/innstillinger`
|
|
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 })] })] }) }) }));
|
|
25
|
+
}
|
|
26
|
+
export default SimpleHeader;
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAqB,WAAW,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,MAAuB,MAAM,mBAAmB,CAAC;AACxD,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,cA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CAAC,OAAO,GAEb,EACD,OAAO,IAAI,CACV,MAAC,MAAM,CAAC,QAAQ,IAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,aACtC,KAAC,MAAM,CAAC,QAAQ,KAAG,EACnB,KAAC,MAAM,CAAC,QAAQ,cACb,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC,GAClB,IACF,CACnB,EACA,OAAO,IAAI,CACV,KAAC,MAAM,CAAC,IAAI,IAAC,IAAI,EAAE,MAAM,CAAC,4BAA4B,IAAI,EAAE,YAC1D,MAAC,MAAM,CAAC,IAAI,eACV,KAAC,MAAM,CAAC,IAAI,cAAE,OAAO,CAAC,IAAI,EAAE,IAAI,GAAe,EAC9C,OAAO,CAAC,IAAI,EAAE,KAAK,IAAI,CACtB,KAAC,MAAM,CAAC,UAAU,IAAC,GAAG,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,GAAI,CAChD,IACW,GACF,CACf,EACD,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,GAAI,IACnB,IACH,GACC,GACH,CACjB,CAAC;AACJ,CAAC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { LayoutTheme } from "@snokam/ui/layout";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
Header: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme;
|
|
5
|
+
as?: React.ElementType;
|
|
6
|
+
} & {
|
|
7
|
+
theme: LayoutTheme;
|
|
8
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
9
|
+
Menu: import("@emotion/styled").StyledComponent<{
|
|
10
|
+
theme?: import("@emotion/react").Theme;
|
|
11
|
+
as?: React.ElementType;
|
|
12
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
13
|
+
Link: import("@emotion/styled").StyledComponent<{
|
|
14
|
+
theme?: import("@emotion/react").Theme;
|
|
15
|
+
as?: React.ElementType;
|
|
16
|
+
}, import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {}>;
|
|
17
|
+
BackLink: import("@emotion/styled").StyledComponent<{
|
|
18
|
+
theme?: import("@emotion/react").Theme;
|
|
19
|
+
as?: React.ElementType;
|
|
20
|
+
}, import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {}>;
|
|
21
|
+
Logo: import("@emotion/styled").StyledComponent<{
|
|
22
|
+
theme?: import("@emotion/react").Theme;
|
|
23
|
+
as?: React.ElementType;
|
|
24
|
+
}, import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {}>;
|
|
25
|
+
BackText: import("@emotion/styled").StyledComponent<{
|
|
26
|
+
theme?: import("@emotion/react").Theme;
|
|
27
|
+
as?: React.ElementType;
|
|
28
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
29
|
+
BackIcon: import("@emotion/styled").StyledComponent<import("@mui/material").SvgIconOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").SVGProps<SVGSVGElement>, "style" | "color" | "fontSize" | "shapeRendering" | "className" | "classes" | "children" | "htmlColor" | "inheritViewBox" | "sx" | "titleAccess" | "viewBox"> & {
|
|
30
|
+
theme?: import("@emotion/react").Theme;
|
|
31
|
+
}, {}, {}>;
|
|
32
|
+
Right: import("@emotion/styled").StyledComponent<{
|
|
33
|
+
theme?: import("@emotion/react").Theme;
|
|
34
|
+
as?: React.ElementType;
|
|
35
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
36
|
+
User: import("@emotion/styled").StyledComponent<{
|
|
37
|
+
theme?: import("@emotion/react").Theme;
|
|
38
|
+
as?: React.ElementType;
|
|
39
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
40
|
+
Name: import("@emotion/styled").StyledComponent<{
|
|
41
|
+
theme?: import("@emotion/react").Theme;
|
|
42
|
+
as?: React.ElementType;
|
|
43
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
44
|
+
UserAvatar: import("@emotion/styled").StyledComponent<import("@mui/material").AvatarOwnProps & import("@mui/material").AvatarSlotsAndSlotProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style" | "className" | "classes" | "children" | "sx" | "alt" | "sizes" | "src" | "srcSet" | "variant" | "slots" | "slotProps"> & {
|
|
45
|
+
component?: React.ElementType | undefined;
|
|
46
|
+
} & {
|
|
47
|
+
theme?: import("@emotion/react").Theme;
|
|
48
|
+
}, {}, {}>;
|
|
49
|
+
};
|
|
50
|
+
export default _default;
|
|
51
|
+
//# sourceMappingURL=styled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/styled.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;;;;;;eAIV,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkHjD,wBAYE"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { css } from "@emotion/react";
|
|
4
|
+
import { LayoutTheme } from "@snokam/ui/layout";
|
|
5
|
+
import { ArrowBack } from "@snokam/ui/icons";
|
|
6
|
+
import { Avatar } from "@snokam/ui";
|
|
7
|
+
const Header = styled.header `
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
align-items: center;
|
|
11
|
+
position: relative;
|
|
12
|
+
color: var(--container-fg);
|
|
13
|
+
background-color: var(--container-bg);
|
|
14
|
+
|
|
15
|
+
${({ theme }) => theme === LayoutTheme.Dark
|
|
16
|
+
? css `
|
|
17
|
+
--container-fg: var(--color-light-blue);
|
|
18
|
+
--container-bg: var(--color-primary);
|
|
19
|
+
|
|
20
|
+
[data-theme="dark"] & {
|
|
21
|
+
--container-fg: #ffffff;
|
|
22
|
+
--container-bg: #071d41;
|
|
23
|
+
}
|
|
24
|
+
`
|
|
25
|
+
: css `
|
|
26
|
+
--container-fg: var(--color-primary);
|
|
27
|
+
--container-bg: var(--color-light-blue);
|
|
28
|
+
|
|
29
|
+
[data-theme="dark"] & {
|
|
30
|
+
--container-fg: #ffffff;
|
|
31
|
+
--container-bg: #0e2748;
|
|
32
|
+
}
|
|
33
|
+
`}
|
|
34
|
+
`;
|
|
35
|
+
const Menu = styled.div `
|
|
36
|
+
flex: 1;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: space-between;
|
|
40
|
+
width: 100%;
|
|
41
|
+
`;
|
|
42
|
+
const Link = styled.a `
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
font-size: 20px;
|
|
46
|
+
font-family: inherit;
|
|
47
|
+
gap: 0.5rem;
|
|
48
|
+
`;
|
|
49
|
+
const BackLink = styled.a `
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
font-size: 20px;
|
|
53
|
+
font-family: inherit;
|
|
54
|
+
gap: 0.5rem;
|
|
55
|
+
`;
|
|
56
|
+
const Logo = styled.a `
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
flex-shrink: 1;
|
|
60
|
+
min-width: 0;
|
|
61
|
+
|
|
62
|
+
img {
|
|
63
|
+
max-width: 100%;
|
|
64
|
+
height: auto;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@media only screen and (max-width: 480px) {
|
|
68
|
+
img {
|
|
69
|
+
width: 128px;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
const Right = styled.div `
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
gap: 1.25rem;
|
|
77
|
+
|
|
78
|
+
@media only screen and (max-width: 768px) {
|
|
79
|
+
gap: 1rem;
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
const User = styled.div `
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
gap: 1rem;
|
|
87
|
+
`;
|
|
88
|
+
const Name = styled.div `
|
|
89
|
+
font-size: 20px;
|
|
90
|
+
text-transform: capitalize;
|
|
91
|
+
|
|
92
|
+
@media only screen and (max-width: 768px) {
|
|
93
|
+
display: none;
|
|
94
|
+
}
|
|
95
|
+
`;
|
|
96
|
+
const BackText = styled.div `
|
|
97
|
+
@media only screen and (max-width: 360px) {
|
|
98
|
+
display: none;
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
const BackIcon = styled(ArrowBack) `
|
|
102
|
+
height: 32px;
|
|
103
|
+
width: 32px;
|
|
104
|
+
`;
|
|
105
|
+
const UserAvatar = styled(Avatar) `
|
|
106
|
+
height: 40px;
|
|
107
|
+
width: 40px;
|
|
108
|
+
`;
|
|
109
|
+
export default {
|
|
110
|
+
Header,
|
|
111
|
+
Menu,
|
|
112
|
+
Link,
|
|
113
|
+
BackLink,
|
|
114
|
+
Logo,
|
|
115
|
+
BackText,
|
|
116
|
+
BackIcon,
|
|
117
|
+
Right,
|
|
118
|
+
User,
|
|
119
|
+
Name,
|
|
120
|
+
UserAvatar,
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styled.js","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/styled.tsx"],"names":[],"m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,IAAI;IACJ,QAAQ;IACR,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,UAAU;CACX,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare enum HeaderTheme {
|
|
3
|
+
Light = "light",
|
|
4
|
+
Dark = "dark"
|
|
5
|
+
}
|
|
6
|
+
export interface SimpleHeaderProps {
|
|
7
|
+
backUrl?: string;
|
|
8
|
+
backText?: string;
|
|
9
|
+
theme?: HeaderTheme;
|
|
10
|
+
extraButtons?: ReactNode;
|
|
11
|
+
userHref?: string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/v1/components/SimpleHeader/types.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,4BAAa,CAAA;AACf,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SimpleHeader } from "./components/SimpleHeader/index.app-router";
|
|
2
|
+
export { HeaderTheme } from "./components/SimpleHeader/types";
|
|
3
|
+
export type { SimpleHeaderProps } from "./components/SimpleHeader/types";
|
|
4
|
+
export { LanguagePicker } from "./components/LanguagePicker/index.app-router";
|
|
5
|
+
export default SimpleHeader;
|
|
6
|
+
//# sourceMappingURL=index.app-router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.app-router.d.ts","sourceRoot":"","sources":["../../src/v1/index.app-router.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SimpleHeader } from "./components/SimpleHeader/index.app-router";
|
|
2
|
+
export { HeaderTheme } from "./components/SimpleHeader/types";
|
|
3
|
+
export { LanguagePicker } from "./components/LanguagePicker/index.app-router";
|
|
4
|
+
export default SimpleHeader;
|
|
5
|
+
//# sourceMappingURL=index.app-router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.app-router.js","sourceRoot":"","sources":["../../src/v1/index.app-router.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAC9E,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SimpleHeader } from "./components/SimpleHeader";
|
|
2
|
+
export { HeaderTheme } from "./components/SimpleHeader/types";
|
|
3
|
+
export type { SimpleHeaderProps } from "./components/SimpleHeader/types";
|
|
4
|
+
export { LanguagePicker } from "./components/LanguagePicker";
|
|
5
|
+
export default SimpleHeader;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,eAAe,YAAY,CAAC"}
|
package/dist/v1/index.js
ADDED
|
@@ -0,0 +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;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SimpleHeader } from "./components/SimpleHeader";
|
|
2
|
+
export { HeaderTheme } from "./components/SimpleHeader/types";
|
|
3
|
+
export type { SimpleHeaderProps } from "./components/SimpleHeader/types";
|
|
4
|
+
export { LanguagePicker } from "./components/LanguagePicker";
|
|
5
|
+
export default SimpleHeader;
|
|
6
|
+
//# sourceMappingURL=index.pages-router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.pages-router.d.ts","sourceRoot":"","sources":["../../src/v1/index.pages-router.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.pages-router.js","sourceRoot":"","sources":["../../src/v1/index.pages-router.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,eAAe,YAAY,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"dependencies": {
|
|
4
|
+
"@emotion/react": "^11.14.0",
|
|
5
|
+
"@emotion/styled": "^11.14.1",
|
|
6
|
+
"@mui/icons-material": "^9.2.0",
|
|
7
|
+
"@mui/material": "^9.2.0",
|
|
8
|
+
"@portabletext/react": "^7.0.1",
|
|
9
|
+
"country-flag-icons": "^1.6.20",
|
|
10
|
+
"next-auth": "4.24.15",
|
|
11
|
+
"react": "19.2.8",
|
|
12
|
+
"react-dom": "19.2.8",
|
|
13
|
+
"@snokam/auth": "2.2.22",
|
|
14
|
+
"@snokam/config": "1.0.0",
|
|
15
|
+
"@snokam/sanity-page-content": "1.17.1",
|
|
16
|
+
"@snokam/ui": "1.0.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/node": "^26.1.1",
|
|
20
|
+
"@types/react": "^19.2.17",
|
|
21
|
+
"@types/react-dom": "^19.2.3",
|
|
22
|
+
"eslint": "^10.7.0",
|
|
23
|
+
"typescript": "5.9.3",
|
|
24
|
+
"next": "16.2.11"
|
|
25
|
+
},
|
|
26
|
+
"name": "@snokam/navbar",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"default": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./v1": {
|
|
33
|
+
"types": "./dist/v1/index.d.ts",
|
|
34
|
+
"default": "./dist/v1/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./v1/pages-router": {
|
|
37
|
+
"types": "./dist/v1/index.pages-router.d.ts",
|
|
38
|
+
"default": "./dist/v1/index.pages-router.js"
|
|
39
|
+
},
|
|
40
|
+
"./v1/app-router": {
|
|
41
|
+
"types": "./dist/v1/index.app-router.d.ts",
|
|
42
|
+
"default": "./dist/v1/index.app-router.js"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"typesVersions": {
|
|
46
|
+
"*": {
|
|
47
|
+
"*": [
|
|
48
|
+
"./src/*"
|
|
49
|
+
],
|
|
50
|
+
"v1": [
|
|
51
|
+
"./src/v1/index.tsx"
|
|
52
|
+
],
|
|
53
|
+
"v1/pages-router": [
|
|
54
|
+
"./src/v1/index.pages-router.tsx"
|
|
55
|
+
],
|
|
56
|
+
"v1/app-router": [
|
|
57
|
+
"./src/v1/index.app-router.tsx"
|
|
58
|
+
],
|
|
59
|
+
"v1/*": [
|
|
60
|
+
"./src/v1/*"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public"
|
|
66
|
+
},
|
|
67
|
+
"files": [
|
|
68
|
+
"dist",
|
|
69
|
+
"package.json",
|
|
70
|
+
"CHANGELOG.md",
|
|
71
|
+
"README.md"
|
|
72
|
+
],
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"next": ">=15"
|
|
75
|
+
},
|
|
76
|
+
"peerDependenciesMeta": {
|
|
77
|
+
"next": {
|
|
78
|
+
"optional": true
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"scripts": {
|
|
82
|
+
"build": "tsc -p tsconfig.build.json --noCheck",
|
|
83
|
+
"lint": "eslint ."
|
|
84
|
+
}
|
|
85
|
+
}
|