@snokam/footer 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/Footer.stories.d.ts +9 -0
- package/dist/v1/Footer.stories.d.ts.map +1 -0
- package/dist/v1/Footer.stories.js +23 -0
- package/dist/v1/Footer.stories.js.map +1 -0
- package/dist/v1/components/Footer/ThemeModeToggle.d.ts +5 -0
- package/dist/v1/components/Footer/ThemeModeToggle.d.ts.map +1 -0
- package/dist/v1/components/Footer/ThemeModeToggle.js +35 -0
- package/dist/v1/components/Footer/ThemeModeToggle.js.map +1 -0
- package/dist/v1/components/Footer/ThemeModeToggle.styled.d.ts +7 -0
- package/dist/v1/components/Footer/ThemeModeToggle.styled.d.ts.map +1 -0
- package/dist/v1/components/Footer/ThemeModeToggle.styled.js +53 -0
- package/dist/v1/components/Footer/ThemeModeToggle.styled.js.map +1 -0
- package/dist/v1/components/Footer/index.d.ts +4 -0
- package/dist/v1/components/Footer/index.d.ts.map +1 -0
- package/dist/v1/components/Footer/index.js +28 -0
- package/dist/v1/components/Footer/index.js.map +1 -0
- package/dist/v1/components/Footer/styled.d.ts +16 -0
- package/dist/v1/components/Footer/styled.d.ts.map +1 -0
- package/dist/v1/components/Footer/styled.js +20 -0
- package/dist/v1/components/Footer/styled.js.map +1 -0
- package/dist/v1/components/Footer/types.d.ts +20 -0
- package/dist/v1/components/Footer/types.d.ts.map +1 -0
- package/dist/v1/components/Footer/types.js +6 -0
- package/dist/v1/components/Footer/types.js.map +1 -0
- package/dist/v1/components/Footer/useColorSchemePersistence.d.ts +3 -0
- package/dist/v1/components/Footer/useColorSchemePersistence.d.ts.map +1 -0
- package/dist/v1/components/Footer/useColorSchemePersistence.js +24 -0
- package/dist/v1/components/Footer/useColorSchemePersistence.js.map +1 -0
- package/dist/v1/index.d.ts +5 -0
- package/dist/v1/index.d.ts.map +1 -0
- package/dist/v1/index.js +4 -0
- package/dist/v1/index.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Footer from "./components/Footer";
|
|
3
|
+
declare const meta: Meta<typeof Footer>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Footer>;
|
|
6
|
+
export declare const Light: Story;
|
|
7
|
+
export declare const Dark: Story;
|
|
8
|
+
export declare const WithWaveTransition: Story;
|
|
9
|
+
//# sourceMappingURL=Footer.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Footer.stories.d.ts","sourceRoot":"","sources":["../../src/v1/Footer.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAGzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAQ7B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAErC,eAAO,MAAM,KAAK,EAAE,KAAU,CAAC;AAE/B,eAAO,MAAM,IAAI,EAAE,KAElB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAIhC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TransitionType } from "@snokam/ui/layout";
|
|
2
|
+
import Footer from "./components/Footer";
|
|
3
|
+
import { FooterTheme } from "./components/Footer/types";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Chrome/Footer",
|
|
6
|
+
component: Footer,
|
|
7
|
+
parameters: { layout: "fullscreen" },
|
|
8
|
+
args: { theme: FooterTheme.Light },
|
|
9
|
+
argTypes: {
|
|
10
|
+
theme: { control: "radio", options: Object.values(FooterTheme) },
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
export const Light = {};
|
|
15
|
+
export const Dark = {
|
|
16
|
+
args: { theme: FooterTheme.Dark },
|
|
17
|
+
};
|
|
18
|
+
export const WithWaveTransition = {
|
|
19
|
+
args: {
|
|
20
|
+
transitions: { top: { type: TransitionType.Wave, flipX: true } },
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=Footer.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Footer.stories.js","sourceRoot":"","sources":["../../src/v1/Footer.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAwB;IAChC,KAAK,EAAE,eAAe;IACtB,SAAS,EAAE,MAAM;IACjB,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,kBAAkB,GAAU;IACvC,IAAI,EAAE;QACJ,WAAW,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;KACjE;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeModeToggle.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/Footer/ThemeModeToggle.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAmB9D,wBAAgB,eAAe,CAAC,EAC9B,WAAW,GACZ,EAAE;IACD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;CAChD,+BA+BA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { DarkMode, LightMode, SettingsBrightness } from "@snokam/ui/icons";
|
|
4
|
+
import { useAdminTheme } from "@snokam/ui/theme/admin";
|
|
5
|
+
import { usePageContent } from "@snokam/sanity-page-content";
|
|
6
|
+
import { Group, Option } from "./ThemeModeToggle.styled";
|
|
7
|
+
import { useColorSchemePersistence } from "./useColorSchemePersistence";
|
|
8
|
+
const MODES = ["light", "system", "dark"];
|
|
9
|
+
const ICONS = {
|
|
10
|
+
light: LightMode,
|
|
11
|
+
system: SettingsBrightness,
|
|
12
|
+
dark: DarkMode,
|
|
13
|
+
};
|
|
14
|
+
const LABEL_KEYS = {
|
|
15
|
+
light: "footerThemeLight",
|
|
16
|
+
system: "footerThemeSystem",
|
|
17
|
+
dark: "footerThemeDark",
|
|
18
|
+
};
|
|
19
|
+
export function ThemeModeToggle({ onThemeSave, }) {
|
|
20
|
+
const { mode, setMode } = useAdminTheme();
|
|
21
|
+
const { getText } = usePageContent();
|
|
22
|
+
const defaultSave = useColorSchemePersistence();
|
|
23
|
+
const save = onThemeSave ?? defaultSave;
|
|
24
|
+
const change = (_, next) => {
|
|
25
|
+
if (!next || next === mode)
|
|
26
|
+
return;
|
|
27
|
+
setMode(next);
|
|
28
|
+
save(next);
|
|
29
|
+
};
|
|
30
|
+
return (_jsx(Group, { exclusive: true, value: mode, onChange: change, size: "small", "aria-label": getText("footerThemeToggleLabel"), children: MODES.map((m) => {
|
|
31
|
+
const Icon = ICONS[m];
|
|
32
|
+
return (_jsxs(Option, { value: m, children: [_jsx(Icon, { fontSize: "small" }), getText(LABEL_KEYS[m])] }, m));
|
|
33
|
+
}) }));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=ThemeModeToggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeModeToggle.js","sourceRoot":"","sources":["../../../../src/v1/components/Footer/ThemeModeToggle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AAEnD,MAAM,KAAK,GAA8C;IACvD,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,kBAAkB;IAC1B,IAAI,EAAE,QAAQ;CACf,CAAC;AAEF,MAAM,UAAU,GAAoC;IAClD,KAAK,EAAE,kBAAkB;IACzB,MAAM,EAAE,mBAAmB;IAC3B,IAAI,EAAE,iBAAiB;CACxB,CAAC;AAEF,MAAM,UAAU,eAAe,CAAC,EAC9B,WAAW,GAGZ;IACC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,aAAa,EAAE,CAAC;IAC1C,MAAM,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,WAAW,GAAG,yBAAyB,EAAE,CAAC;IAChD,MAAM,IAAI,GAAG,WAAW,IAAI,WAAW,CAAC;IAExC,MAAM,MAAM,GAAG,CAAC,CAAU,EAAE,IAA4B,EAAE,EAAE;QAC1D,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO;QACnC,OAAO,CAAC,IAAI,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,KAAK,IACJ,SAAS,QACT,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAC,OAAO,gBACA,OAAO,CAAC,wBAAwB,CAAC,YAE5C,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACf,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACtB,OAAO,CACL,MAAC,MAAM,IAAS,KAAK,EAAE,CAAC,aACtB,KAAC,IAAI,IAAC,QAAQ,EAAC,OAAO,GAAG,EACxB,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAFZ,CAAC,CAGL,CACV,CAAC;QACJ,CAAC,CAAC,GACI,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const Group: import("@emotion/styled").StyledComponent<import("@mui/material").ToggleButtonGroupProps & {
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
}, {}, {}>;
|
|
4
|
+
export declare const Option: import("@emotion/styled").StyledComponent<import("@mui/material").ToggleButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, keyof import("@mui/material").ToggleButtonOwnProps> & Omit<import("@mui/material").ButtonBaseOwnProps, "tabIndex" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "nativeButton" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "type" | keyof import("@mui/material").ToggleButtonOwnProps> & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style" | "classes" | "onChange" | "children" | "className" | "tabIndex" | "color" | "onClick" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "nativeButton" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "type" | "disableFocusRipple" | "fullWidth" | "selected" | "size" | "value"> & {
|
|
5
|
+
theme?: import("@emotion/react").Theme;
|
|
6
|
+
}, {}, {}>;
|
|
7
|
+
//# sourceMappingURL=ThemeModeToggle.styled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeModeToggle.styled.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/Footer/ThemeModeToggle.styled.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,KAAK;;UASjB,CAAC;AAEF,eAAO,MAAM,MAAM;;UAsClB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { ToggleButton, ToggleButtonGroup } from "@snokam/ui";
|
|
4
|
+
export const Group = styled(ToggleButtonGroup) `
|
|
5
|
+
gap: 0.4rem;
|
|
6
|
+
flex-wrap: wrap;
|
|
7
|
+
|
|
8
|
+
& .MuiToggleButtonGroup-grouped {
|
|
9
|
+
margin: 0;
|
|
10
|
+
border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
|
|
11
|
+
border-radius: 999px;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
export const Option = styled(ToggleButton) `
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 0.4rem;
|
|
18
|
+
padding: 0.35rem 0.85rem;
|
|
19
|
+
color: inherit;
|
|
20
|
+
opacity: 0.62;
|
|
21
|
+
font-size: 0.78rem;
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
line-height: 1;
|
|
24
|
+
text-transform: none;
|
|
25
|
+
letter-spacing: 0;
|
|
26
|
+
transition:
|
|
27
|
+
opacity 0.15s ease,
|
|
28
|
+
background-color 0.15s ease;
|
|
29
|
+
|
|
30
|
+
& svg {
|
|
31
|
+
font-size: 1.05rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:hover {
|
|
35
|
+
opacity: 0.88;
|
|
36
|
+
background: color-mix(in srgb, currentColor 8%, transparent);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.Mui-selected,
|
|
40
|
+
&.Mui-selected:hover {
|
|
41
|
+
opacity: 1;
|
|
42
|
+
color: inherit;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&.Mui-selected {
|
|
46
|
+
background: color-mix(in srgb, currentColor 14%, transparent);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.Mui-selected:hover {
|
|
50
|
+
background: color-mix(in srgb, currentColor 20%, transparent);
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
//# sourceMappingURL=ThemeModeToggle.styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeModeToggle.styled.js","sourceRoot":"","sources":["../../../../src/v1/components/Footer/ThemeModeToggle.styled.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE7D,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAA;;;;;;;;;CAS7C,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCzC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FooterProps } from "./types";
|
|
2
|
+
export declare const Footer: ({ theme, showMiljofyrtorn, showBlog, showPresentations, extraLinks, transitions, onThemeSave, }: FooterProps) => import("react").JSX.Element;
|
|
3
|
+
export default Footer;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/Footer/index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAe,MAAM,SAAS,CAAC;AAInD,eAAO,MAAM,MAAM,GAAI,iGAQpB,WAAW,gCA+Db,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronRight } from "@snokam/ui/icons";
|
|
4
|
+
import Styled from "./styled";
|
|
5
|
+
import { useFramework } from "@snokam/ui/framework";
|
|
6
|
+
import { Layout } from "@snokam/ui";
|
|
7
|
+
import { useColorScheme } from "@snokam/ui/theme/admin";
|
|
8
|
+
import { usePageContent } from "@snokam/sanity-page-content";
|
|
9
|
+
import { PortableText } from "@portabletext/react";
|
|
10
|
+
import { useConfig } from "@snokam/config";
|
|
11
|
+
import { FooterTheme } from "./types";
|
|
12
|
+
import { Padding } from "@snokam/ui/layout";
|
|
13
|
+
import { ThemeModeToggle } from "./ThemeModeToggle";
|
|
14
|
+
export const Footer = ({ theme = FooterTheme.Dark, showMiljofyrtorn = true, showBlog = true, showPresentations = false, extraLinks, transitions, onThemeSave, }) => {
|
|
15
|
+
const { getImage, getText, getAttr, getBlock } = usePageContent();
|
|
16
|
+
const config = useConfig();
|
|
17
|
+
const resolvedTheme = useColorScheme();
|
|
18
|
+
const { Link, Image } = useFramework();
|
|
19
|
+
const blogUrl = config.NEXT_PUBLIC_BLOG_BASE_URL ?? "";
|
|
20
|
+
const miljofyrtornUrl = `${config.NEXT_PUBLIC_SNOKAM_BASE_URL ?? ""}/miljofyrtorn`;
|
|
21
|
+
const presentationsUrl = `${config.NEXT_PUBLIC_SNOKAM_BASE_URL ?? ""}/presentasjoner`;
|
|
22
|
+
const logoKey = resolvedTheme === "dark" || theme === FooterTheme.Dark
|
|
23
|
+
? "footerWhiteLogo"
|
|
24
|
+
: "footerBlueLogo";
|
|
25
|
+
return (_jsx(Layout.Container, { as: "footer", theme: theme, transitions: transitions, children: _jsx(Layout.Content, { children: _jsxs(Layout.Section, { padding: Padding.Large, children: [_jsx(Styled.Logo, { as: Image, "data-sanity": getAttr(logoKey), alt: getImage(logoKey).alt || "Snøkam logo", src: getImage(logoKey).url, width: 236, height: 46 }), _jsx(PortableText, { value: getBlock("footerContent") }), showMiljofyrtorn && (_jsxs(Styled.Link, { as: Link, href: miljofyrtornUrl, children: [getText("footerMiljofyrtornLinkText"), _jsx(ChevronRight, {})] })), showBlog && (_jsxs(Styled.Link, { as: Link, href: blogUrl, children: [getText("footerBlogLinkText"), _jsx(ChevronRight, {})] })), showPresentations && (_jsxs(Styled.Link, { as: Link, href: presentationsUrl, children: [getText("footerPresentationsLinkText"), _jsx(ChevronRight, {})] })), extraLinks?.map((link) => (_jsxs(Styled.Link, { as: Link, href: link.href, children: [link.text, _jsx(ChevronRight, {})] }, link.href))), _jsx(Styled.ToggleRow, { id: "tema", children: _jsx(ThemeModeToggle, { onThemeSave: onThemeSave }) })] }) }) }));
|
|
26
|
+
};
|
|
27
|
+
export default Footer;
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/v1/components/Footer/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC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EAAE,WAAW,GAAI,GAC5B,IACJ,GACF,GACA,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
Logo: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme;
|
|
4
|
+
as?: React.ElementType;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, {}>;
|
|
6
|
+
Link: import("@emotion/styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme;
|
|
8
|
+
as?: React.ElementType;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {}>;
|
|
10
|
+
ToggleRow: import("@emotion/styled").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme;
|
|
12
|
+
as?: React.ElementType;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
16
|
+
//# sourceMappingURL=styled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/Footer/styled.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAuBA,wBAAyC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
const Logo = styled.img `
|
|
4
|
+
margin-bottom: 2.5rem;
|
|
5
|
+
max-width: 100%;
|
|
6
|
+
`;
|
|
7
|
+
const Link = styled.a `
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
padding: 0rem;
|
|
11
|
+
flex: 1;
|
|
12
|
+
`;
|
|
13
|
+
const ToggleRow = styled.div `
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: 0.75rem;
|
|
17
|
+
margin-top: 2.5rem;
|
|
18
|
+
`;
|
|
19
|
+
export default { Logo, Link, ToggleRow };
|
|
20
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styled.js","sourceRoot":"","sources":["../../../../src/v1/components/Footer/styled.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGtB,CAAC;AAEF,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAA;;;;;CAKpB,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAK3B,CAAC;AAEF,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Transitions } from "@snokam/ui/layout";
|
|
2
|
+
import type { ColorSchemeMode } from "@snokam/ui/theme/admin";
|
|
3
|
+
export declare enum FooterTheme {
|
|
4
|
+
Light = "light",
|
|
5
|
+
Dark = "dark"
|
|
6
|
+
}
|
|
7
|
+
export interface FooterLink {
|
|
8
|
+
href: string;
|
|
9
|
+
text: string;
|
|
10
|
+
}
|
|
11
|
+
export interface FooterProps {
|
|
12
|
+
showMiljofyrtorn?: boolean;
|
|
13
|
+
showBlog?: boolean;
|
|
14
|
+
showPresentations?: boolean;
|
|
15
|
+
extraLinks?: FooterLink[];
|
|
16
|
+
theme?: FooterTheme;
|
|
17
|
+
transitions?: Transitions;
|
|
18
|
+
onThemeSave?: (_mode: ColorSchemeMode) => void;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/Footer/types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;CAChD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/v1/components/Footer/types.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,4BAAa,CAAA;AACf,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColorSchemePersistence.d.ts","sourceRoot":"","sources":["../../../../src/v1/components/Footer/useColorSchemePersistence.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,wBAAgB,yBAAyB,kBAkBvB,eAAe,UAShC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useMemo } from "react";
|
|
3
|
+
import { Configuration, EmployeesClient } from "@snokam/employees-client";
|
|
4
|
+
import { useAuth } from "@snokam/auth/app-router";
|
|
5
|
+
import { useConfig } from "@snokam/config";
|
|
6
|
+
export function useColorSchemePersistence() {
|
|
7
|
+
const { isAuthenticated, getToken, update } = useAuth();
|
|
8
|
+
const config = useConfig();
|
|
9
|
+
const client = useMemo(() => new EmployeesClient(new Configuration({
|
|
10
|
+
basePath: config.NEXT_PUBLIC_EMPLOYEES_API_BASE_URL,
|
|
11
|
+
...(isAuthenticated && {
|
|
12
|
+
accessToken: () => getToken(),
|
|
13
|
+
}),
|
|
14
|
+
})), [isAuthenticated, getToken, config]);
|
|
15
|
+
return useCallback((colorScheme) => {
|
|
16
|
+
if (!isAuthenticated)
|
|
17
|
+
return;
|
|
18
|
+
client
|
|
19
|
+
.patchMeProtected({ patchEmployee: { settings: { colorScheme } } })
|
|
20
|
+
.then(() => update({ colorScheme }))
|
|
21
|
+
.catch(() => { });
|
|
22
|
+
}, [isAuthenticated, client, update]);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=useColorSchemePersistence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColorSchemePersistence.js","sourceRoot":"","sources":["../../../../src/v1/components/Footer/useColorSchemePersistence.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,MAAM,UAAU,yBAAyB;IACvC,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC;IACxD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,MAAM,MAAM,GAAG,OAAO,CACpB,GAAG,EAAE,CACH,IAAI,eAAe,CACjB,IAAI,aAAa,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC,kCAAkC;QACnD,GAAG,CAAC,eAAe,IAAI;YACrB,WAAW,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE;SAC9B,CAAC;KACH,CAAC,CACH,EACH,CAAC,eAAe,EAAE,QAAQ,EAAE,MAAM,CAAC,CACpC,CAAC;IAEF,OAAO,WAAW,CAChB,CAAC,WAA4B,EAAE,EAAE;QAC/B,IAAI,CAAC,eAAe;YAAE,OAAO;QAC7B,MAAM;aACH,gBAAgB,CAAC,EAAE,aAAa,EAAE,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;aAClE,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;aACnC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACrB,CAAC,EACD,CAAC,eAAe,EAAE,MAAM,EAAE,MAAM,CAAC,CAClC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/v1/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACzE,eAAe,MAAM,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,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,eAAe,MAAM,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
"next-auth": "4.24.15",
|
|
10
|
+
"react": "19.2.8",
|
|
11
|
+
"react-dom": "19.2.8",
|
|
12
|
+
"@snokam/auth": "2.2.22",
|
|
13
|
+
"@snokam/sanity-page-content": "1.17.1",
|
|
14
|
+
"@snokam/config": "1.0.0",
|
|
15
|
+
"@snokam/employees-client": "1.0.0",
|
|
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/footer",
|
|
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
|
+
},
|
|
37
|
+
"typesVersions": {
|
|
38
|
+
"*": {
|
|
39
|
+
"*": [
|
|
40
|
+
"./src/*"
|
|
41
|
+
],
|
|
42
|
+
"v1": [
|
|
43
|
+
"./src/v1/index.tsx"
|
|
44
|
+
],
|
|
45
|
+
"v1/*": [
|
|
46
|
+
"./src/v1/*"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"files": [
|
|
54
|
+
"dist",
|
|
55
|
+
"package.json",
|
|
56
|
+
"CHANGELOG.md",
|
|
57
|
+
"README.md"
|
|
58
|
+
],
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"next": ">=15"
|
|
61
|
+
},
|
|
62
|
+
"peerDependenciesMeta": {
|
|
63
|
+
"next": {
|
|
64
|
+
"optional": true
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "tsc -p tsconfig.build.json --noCheck",
|
|
69
|
+
"lint": "eslint ."
|
|
70
|
+
}
|
|
71
|
+
}
|