@nodeblocks/frontend-footer-block 0.1.0 → 0.2.1

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/context.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { ReactNode } from 'react';
2
- type FooterContextValue = {
2
+ export type FooterContextValue = {
3
3
  logoSrc: string;
4
4
  copyright: ReactNode;
5
5
  content: ReactNode;
6
6
  };
7
+ export declare const keys: readonly ["logoSrc", "copyright", "content"];
7
8
  export declare const FooterProvider: ({ children, ...value }: FooterContextValue & {
8
9
  children: ReactNode;
9
10
  }) => import("react/jsx-runtime").JSX.Element;
10
11
  export declare const useFooterContext: () => FooterContextValue;
11
- export {};
12
12
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAc,MAAM,OAAO,CAAC;AAE7D,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,SAAS,CAAC;CACpB,CAAC;AAIF,eAAO,MAAM,cAAc,GAAI,wBAG5B,kBAAkB,GAAG;IACtB,QAAQ,EAAE,SAAS,CAAC;CACrB,4CAEA,CAAC;AAEF,eAAO,MAAM,gBAAgB,0BAO5B,CAAC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAc,MAAM,OAAO,CAAC;AAE7D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,IAAI,8CAA+E,CAAC;AAWjG,eAAO,MAAM,cAAc,GAAI,wBAG5B,kBAAkB,GAAG;IACtB,QAAQ,EAAE,SAAS,CAAC;CACrB,4CAEA,CAAC;AAEF,eAAO,MAAM,gBAAgB,0BAO5B,CAAC"}
package/dist/footer.d.ts CHANGED
@@ -1,21 +1,21 @@
1
+ import { Box, BoxProps, StackProps } from '@mui/material';
1
2
  import { ComponentProps, ReactNode } from 'react';
2
- import './footer.css';
3
+ import { FooterContextValue } from './context';
3
4
  import { BlocksOverride } from './lib';
4
5
  declare const Footer: {
5
- <CustomBlocks extends Record<string, ReactNode> = {}>({ logoSrc, content, copyright, className, children, ...props }: Omit<ComponentProps<"footer">, "content"> & {
6
- logoSrc: string;
7
- copyright: ReactNode;
8
- content: ReactNode;
6
+ <CustomBlocks extends Record<string, ReactNode> = {}>({ className, children, sx, ...props }: Omit<StackProps, "content" | "children"> & Required<Pick<FooterContextValue, "logoSrc" | "content" | "copyright">> & {
9
7
  children?: BlocksOverride<typeof defaultBlocks, CustomBlocks>;
10
8
  }): import("react/jsx-runtime").JSX.Element;
11
- Logo(props: Partial<ComponentProps<"img">>): import("react/jsx-runtime").JSX.Element;
12
- Content(props: Partial<ComponentProps<"div">>): import("react/jsx-runtime").JSX.Element;
13
- Copyright(props: Partial<ComponentProps<"div">>): import("react/jsx-runtime").JSX.Element;
9
+ Logo({ className, sx, ...props }: Partial<ComponentProps<typeof Box> & Pick<FooterContextValue, "logoSrc">>): import("react/jsx-runtime").JSX.Element;
10
+ Content({ className, children, ...props }: Partial<BoxProps & Pick<FooterContextValue, "content">>): import("react/jsx-runtime").JSX.Element;
11
+ Copyright({ className, children, ...props }: Partial<ComponentProps<typeof Box> & Pick<FooterContextValue, "copyright">>): import("react/jsx-runtime").JSX.Element;
14
12
  };
15
13
  declare const defaultBlocks: {
16
- logo: import("react").ReactElement<Partial<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>>, (props: Partial<ComponentProps<"img">>) => import("react/jsx-runtime").JSX.Element>;
17
- content: import("react").ReactElement<Partial<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, (props: Partial<ComponentProps<"div">>) => import("react/jsx-runtime").JSX.Element>;
18
- copyright: import("react").ReactElement<Partial<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, (props: Partial<ComponentProps<"div">>) => import("react/jsx-runtime").JSX.Element>;
14
+ logo: import("react").ReactElement<Partial<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & Pick<FooterContextValue, "logoSrc">>, ({ className, sx, ...props }: Partial<ComponentProps<typeof Box> & Pick<FooterContextValue, "logoSrc">>) => import("react/jsx-runtime").JSX.Element>;
15
+ content: import("react").ReactElement<Partial<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & {
16
+ component?: React.ElementType;
17
+ } & Pick<FooterContextValue, "content">>, ({ className, children, ...props }: Partial<BoxProps & Pick<FooterContextValue, "content">>) => import("react/jsx-runtime").JSX.Element>;
18
+ copyright: import("react").ReactElement<Partial<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & Pick<FooterContextValue, "copyright">>, ({ className, children, ...props }: Partial<ComponentProps<typeof Box> & Pick<FooterContextValue, "copyright">>) => import("react/jsx-runtime").JSX.Element>;
19
19
  };
20
20
  export default Footer;
21
21
  //# sourceMappingURL=footer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"footer.d.ts","sourceRoot":"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,MAAM,EAAE,SAAS,CAAC,8CAK3D,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,UAAU,CAAC,GACzC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC,CAAC,GAAG;QACxE,QAAQ,CAAC,EAAE,cAAc,CAAC,OAAO,aAAa,EAAE,YAAY,CAAC,CAAC;KAC/D;sCA0CA,OAAO,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;+CAuBvB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;iDAezG,OAAO,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;CA5C7E,CAAC;AAuDF,QAAA,MAAM,aAAa;wWAjDhB,OAAO,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;;;kFAuBvB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;qXAezG,OAAO,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;CAe5E,CAAC;AAEH,eAAe,MAAM,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -1,162 +1 @@
1
-
2
-
3
- if (typeof global === 'undefined') {
4
- var global = window;
5
- }
6
-
7
- 'use strict';
8
-
9
- var jsxRuntime = require('react/jsx-runtime');
10
- var react = require('react');
11
-
12
- function styleInject(css, ref) {
13
- if ( ref === void 0 ) ref = {};
14
- var insertAt = ref.insertAt;
15
-
16
- if (typeof document === 'undefined') { return; }
17
-
18
- var head = document.head || document.getElementsByTagName('head')[0];
19
- var style = document.createElement('style');
20
- style.type = 'text/css';
21
-
22
- if (insertAt === 'top') {
23
- if (head.firstChild) {
24
- head.insertBefore(style, head.firstChild);
25
- } else {
26
- head.appendChild(style);
27
- }
28
- } else {
29
- head.appendChild(style);
30
- }
31
-
32
- if (style.styleSheet) {
33
- style.styleSheet.cssText = css;
34
- } else {
35
- style.appendChild(document.createTextNode(css));
36
- }
37
- }
38
-
39
- var css_248z = "/* footer.css */\n.nbb-footer {\n --color-object-accent-primary: #006ead;\n --color-text-on-primary: #fff;\n\n background-color: var(--color-object-accent-primary);\n color: var(--color-text-on-primary);\n padding: 16px;\n text-align: left;\n}\n\n.nbb-footer .nbb-footer-title {\n font-size: 24px;\n font-weight: bold;\n margin-bottom: 16px;\n}\n\n.nbb-footer .nbb-footer-content {\n font-size: 16px;\n margin-bottom: 8px;\n}\n.nbb-footer .nbb-footer-content a {\n color: inherit;\n}\n.nbb-footer .nbb-footer-content a:hover {\n text-decoration: underline;\n}\n\n.nbb-footer .nbb-footer-copyright {\n font-size: 14px;\n margin-top: 16px;\n}\n";
40
- styleInject(css_248z);
41
-
42
- /**
43
- * Creates a strongly typed `defaultBlocks` object, allowing for types to propagate into block override objects.
44
- *
45
- * @param components - A map of default block keys to component functions.
46
- *
47
- * @example
48
- * const defaultBlocks = createDefaultBlocks({
49
- * title: Title,
50
- * description: Description,
51
- * form: Form,
52
- * });
53
- */
54
- function createDefaultBlocks(components) {
55
- return Object.fromEntries(Object.entries(components).map(([key, Component]) => [key, react.createElement(Component, { key })]));
56
- }
57
- /**
58
- * A component for rendering {@link BlocksOverride|`BlocksOverride`} results.
59
- * Exposes the evaluated `blocks` and `blockOrder` as arguments to the `children` function.
60
- *
61
- * @param props
62
- * @param props.blocksOverride - The {@link BlocksOverride|`BlocksOverride`} (i.e. `children` of outer component).
63
- * @param props.defaultBlocks - The default blocks of outer component.
64
- * @param props.children - A function returning the JSX to render.
65
- *
66
- * @example
67
- * <BlocksOverrideComponent
68
- * defaultBlocks={defaultFormBlocks}
69
- * blocksOverride={children}
70
- * >
71
- * {({ blocks, blockOrder }) =>
72
- * blockOrder.map((key) => (
73
- * <Fragment key={String(key)}>{blocks[key]}</Fragment>
74
- * ))
75
- * }
76
- * </BlocksOverrideComponent>
77
- */
78
- function BlocksOverrideComponent({ blocksOverride, defaultBlocks, defaultBlockOrder, children, }) {
79
- if (blocksOverride === undefined) {
80
- return children({
81
- // TODO: Remove this assertion
82
- blocks: defaultBlocks,
83
- blockOrder: defaultBlockOrder,
84
- });
85
- }
86
- if (typeof blocksOverride === 'function') {
87
- const { blocks, blockOrder } = blocksOverride({
88
- defaultBlocks,
89
- defaultBlockOrder,
90
- });
91
- return children({ blocks, blockOrder });
92
- }
93
- return blocksOverride;
94
- }
95
- function deepMerge(obj1, obj2) {
96
- const result = { ...obj1 };
97
- for (const key in obj2) {
98
- if (obj2.hasOwnProperty(key)) {
99
- const val1 = result[key];
100
- const val2 = obj2[key];
101
- if (Array.isArray(val1) || Array.isArray(val2)) {
102
- // If either is an array, replace entirely with obj2's value
103
- result[key] = val2;
104
- }
105
- else if (typeof val1 === 'object' && val1 !== null && typeof val2 === 'object' && val2 !== null) {
106
- result[key] = deepMerge(val1, val2);
107
- }
108
- else {
109
- result[key] = val2;
110
- }
111
- }
112
- }
113
- return result;
114
- }
115
- /**
116
- * Utility function to join class names together, ignoring undefined or nil values.
117
- * @param classes - The class names to join.
118
- * @returns The joined class names.
119
- */
120
- function classNames(...classes) {
121
- return classes.flat().filter(Boolean).join(' ');
122
- }
123
-
124
- const FooterContext = react.createContext(undefined);
125
- const FooterProvider = ({ children, ...value }) => {
126
- return jsxRuntime.jsx(FooterContext.Provider, { value: value, children: children });
127
- };
128
- const useFooterContext = () => {
129
- const context = react.useContext(FooterContext);
130
- if (!context) {
131
- throw new Error('useFooterContext must be used within a FooterProvider');
132
- }
133
- return context;
134
- };
135
-
136
- const Footer = ({ logoSrc, content, copyright, className, children, ...props }) => {
137
- return (jsxRuntime.jsx(FooterProvider, { logoSrc,
138
- content,
139
- copyright, children: jsxRuntime.jsx("footer", { className: classNames('nbb-footer', className), ...props, children: jsxRuntime.jsx(BlocksOverrideComponent, { defaultBlocks: defaultBlocks, defaultBlockOrder: Object.keys(defaultBlocks), blocksOverride: children, children: ({ blocks: { ...blocks }, blockOrder }) => blockOrder
140
- .filter((key) => key in blocks)
141
- .map((key) => jsxRuntime.jsx(react.Fragment, { children: blocks[key] }, String(key))) }) }) }));
142
- };
143
- Footer.Logo = (props) => {
144
- const { className, logoSrc, src } = deepMerge(useFooterContext(), props);
145
- return (jsxRuntime.jsx("img", { className: classNames('nbb-footer-logo', className), src: logoSrc || src, alt: 'Footer logo', ...props }));
146
- };
147
- Footer.Content = (props) => {
148
- const { className, children, content } = deepMerge(useFooterContext(), props);
149
- return (jsxRuntime.jsx("div", { className: classNames('nbb-footer-content', className), ...props, children: content || children }));
150
- };
151
- Footer.Copyright = (props) => {
152
- const { className, children, copyright } = deepMerge(useFooterContext(), props);
153
- return (jsxRuntime.jsx("div", { className: classNames('nbb-footer-copyright', className), ...props, children: copyright || children }));
154
- };
155
- const defaultBlocks = createDefaultBlocks({
156
- logo: Footer.Logo,
157
- content: Footer.Content,
158
- copyright: Footer.Copyright,
159
- });
160
-
161
- exports.Footer = Footer;
162
- //# sourceMappingURL=index.cjs.js.map
1
+ "use strict";var r=require("react/jsx-runtime"),e=require("@mui/material"),o=require("react");const t=["logoSrc","copyright","content"],n=o.createContext(void 0),c=({children:e,...o})=>r.jsx(n.Provider,{value:o,children:e}),s=()=>{const r=o.useContext(n);if(!r)throw new Error("useFooterContext must be used within a FooterProvider");return r};function l({blocksOverride:r,defaultBlocks:e,defaultBlockOrder:o,children:t}){if(void 0===r)return t({blocks:e,blockOrder:o});if("function"==typeof r){const{blocks:n,blockOrder:c}=r({defaultBlocks:e,defaultBlockOrder:o});return t({blocks:n,blockOrder:c})}return r}function i(r,e){const o={...r};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(o[r]=e[r]);return o}function a(...r){return r.flat().filter(Boolean).join(" ")}function d(r,...e){const o={...r};for(const r of e)delete o[r];return o}function u(r,...e){const o={};for(const t of e)t in r&&(o[t]=r[t]);return o}const f=({className:n,children:s,sx:i,...f})=>r.jsx(e.Stack,{component:"footer",className:a("nbb-footer",n),spacing:2,sx:[{backgroundColor:"primary.main",color:"primary.contrastText",py:3,px:2,typography:"body2","& a":{color:"inherit"}},...Array.isArray(i)?i:[i]],...d(f,...t),children:r.jsx(c,{...u(f,...t),children:r.jsx(l,{defaultBlocks:b,defaultBlockOrder:Object.keys(b),blocksOverride:s,children:({blocks:{...e},blockOrder:t})=>t.filter(r=>r in e).map(t=>r.jsx(o.Fragment,{children:e[t]},String(t)))})})}),b=(h={logo:f.Logo=({className:o,sx:n,...c})=>{const l=s(),{logoSrc:u}=i(l,c);return r.jsx(e.Box,{className:a("nbb-footer-logo",o),sx:[{pb:.5,"& img":{display:"block"}},...Array.isArray(n)?n:[n]],...d(c,...t),children:r.jsx("img",{src:u,alt:"Footer logo"})})},content:f.Content=({className:o,children:n,...c})=>{const l=s(),{content:u}=i(l,c);return r.jsx(e.Box,{className:a("nbb-footer-content",o),...d(c,...t),children:u||n})},copyright:f.Copyright=({className:o,children:n,...c})=>{const l=s(),{copyright:u}=i(l,c);return r.jsx(e.Box,{className:a("nbb-footer-copyright",o),...d(c,...t),children:u||n})}},Object.fromEntries(Object.entries(h).map(([r,e])=>[r,o.createElement(e,{key:r})])));var h;exports.Footer=f;
package/dist/index.esm.js CHANGED
@@ -1,160 +1 @@
1
-
2
-
3
- if (typeof global === 'undefined') {
4
- var global = window;
5
- }
6
-
7
- import { jsx } from 'react/jsx-runtime';
8
- import { createElement, createContext, useContext, Fragment } from 'react';
9
-
10
- function styleInject(css, ref) {
11
- if ( ref === void 0 ) ref = {};
12
- var insertAt = ref.insertAt;
13
-
14
- if (typeof document === 'undefined') { return; }
15
-
16
- var head = document.head || document.getElementsByTagName('head')[0];
17
- var style = document.createElement('style');
18
- style.type = 'text/css';
19
-
20
- if (insertAt === 'top') {
21
- if (head.firstChild) {
22
- head.insertBefore(style, head.firstChild);
23
- } else {
24
- head.appendChild(style);
25
- }
26
- } else {
27
- head.appendChild(style);
28
- }
29
-
30
- if (style.styleSheet) {
31
- style.styleSheet.cssText = css;
32
- } else {
33
- style.appendChild(document.createTextNode(css));
34
- }
35
- }
36
-
37
- var css_248z = "/* footer.css */\n.nbb-footer {\n --color-object-accent-primary: #006ead;\n --color-text-on-primary: #fff;\n\n background-color: var(--color-object-accent-primary);\n color: var(--color-text-on-primary);\n padding: 16px;\n text-align: left;\n}\n\n.nbb-footer .nbb-footer-title {\n font-size: 24px;\n font-weight: bold;\n margin-bottom: 16px;\n}\n\n.nbb-footer .nbb-footer-content {\n font-size: 16px;\n margin-bottom: 8px;\n}\n.nbb-footer .nbb-footer-content a {\n color: inherit;\n}\n.nbb-footer .nbb-footer-content a:hover {\n text-decoration: underline;\n}\n\n.nbb-footer .nbb-footer-copyright {\n font-size: 14px;\n margin-top: 16px;\n}\n";
38
- styleInject(css_248z);
39
-
40
- /**
41
- * Creates a strongly typed `defaultBlocks` object, allowing for types to propagate into block override objects.
42
- *
43
- * @param components - A map of default block keys to component functions.
44
- *
45
- * @example
46
- * const defaultBlocks = createDefaultBlocks({
47
- * title: Title,
48
- * description: Description,
49
- * form: Form,
50
- * });
51
- */
52
- function createDefaultBlocks(components) {
53
- return Object.fromEntries(Object.entries(components).map(([key, Component]) => [key, createElement(Component, { key })]));
54
- }
55
- /**
56
- * A component for rendering {@link BlocksOverride|`BlocksOverride`} results.
57
- * Exposes the evaluated `blocks` and `blockOrder` as arguments to the `children` function.
58
- *
59
- * @param props
60
- * @param props.blocksOverride - The {@link BlocksOverride|`BlocksOverride`} (i.e. `children` of outer component).
61
- * @param props.defaultBlocks - The default blocks of outer component.
62
- * @param props.children - A function returning the JSX to render.
63
- *
64
- * @example
65
- * <BlocksOverrideComponent
66
- * defaultBlocks={defaultFormBlocks}
67
- * blocksOverride={children}
68
- * >
69
- * {({ blocks, blockOrder }) =>
70
- * blockOrder.map((key) => (
71
- * <Fragment key={String(key)}>{blocks[key]}</Fragment>
72
- * ))
73
- * }
74
- * </BlocksOverrideComponent>
75
- */
76
- function BlocksOverrideComponent({ blocksOverride, defaultBlocks, defaultBlockOrder, children, }) {
77
- if (blocksOverride === undefined) {
78
- return children({
79
- // TODO: Remove this assertion
80
- blocks: defaultBlocks,
81
- blockOrder: defaultBlockOrder,
82
- });
83
- }
84
- if (typeof blocksOverride === 'function') {
85
- const { blocks, blockOrder } = blocksOverride({
86
- defaultBlocks,
87
- defaultBlockOrder,
88
- });
89
- return children({ blocks, blockOrder });
90
- }
91
- return blocksOverride;
92
- }
93
- function deepMerge(obj1, obj2) {
94
- const result = { ...obj1 };
95
- for (const key in obj2) {
96
- if (obj2.hasOwnProperty(key)) {
97
- const val1 = result[key];
98
- const val2 = obj2[key];
99
- if (Array.isArray(val1) || Array.isArray(val2)) {
100
- // If either is an array, replace entirely with obj2's value
101
- result[key] = val2;
102
- }
103
- else if (typeof val1 === 'object' && val1 !== null && typeof val2 === 'object' && val2 !== null) {
104
- result[key] = deepMerge(val1, val2);
105
- }
106
- else {
107
- result[key] = val2;
108
- }
109
- }
110
- }
111
- return result;
112
- }
113
- /**
114
- * Utility function to join class names together, ignoring undefined or nil values.
115
- * @param classes - The class names to join.
116
- * @returns The joined class names.
117
- */
118
- function classNames(...classes) {
119
- return classes.flat().filter(Boolean).join(' ');
120
- }
121
-
122
- const FooterContext = createContext(undefined);
123
- const FooterProvider = ({ children, ...value }) => {
124
- return jsx(FooterContext.Provider, { value: value, children: children });
125
- };
126
- const useFooterContext = () => {
127
- const context = useContext(FooterContext);
128
- if (!context) {
129
- throw new Error('useFooterContext must be used within a FooterProvider');
130
- }
131
- return context;
132
- };
133
-
134
- const Footer = ({ logoSrc, content, copyright, className, children, ...props }) => {
135
- return (jsx(FooterProvider, { logoSrc,
136
- content,
137
- copyright, children: jsx("footer", { className: classNames('nbb-footer', className), ...props, children: jsx(BlocksOverrideComponent, { defaultBlocks: defaultBlocks, defaultBlockOrder: Object.keys(defaultBlocks), blocksOverride: children, children: ({ blocks: { ...blocks }, blockOrder }) => blockOrder
138
- .filter((key) => key in blocks)
139
- .map((key) => jsx(Fragment, { children: blocks[key] }, String(key))) }) }) }));
140
- };
141
- Footer.Logo = (props) => {
142
- const { className, logoSrc, src } = deepMerge(useFooterContext(), props);
143
- return (jsx("img", { className: classNames('nbb-footer-logo', className), src: logoSrc || src, alt: 'Footer logo', ...props }));
144
- };
145
- Footer.Content = (props) => {
146
- const { className, children, content } = deepMerge(useFooterContext(), props);
147
- return (jsx("div", { className: classNames('nbb-footer-content', className), ...props, children: content || children }));
148
- };
149
- Footer.Copyright = (props) => {
150
- const { className, children, copyright } = deepMerge(useFooterContext(), props);
151
- return (jsx("div", { className: classNames('nbb-footer-copyright', className), ...props, children: copyright || children }));
152
- };
153
- const defaultBlocks = createDefaultBlocks({
154
- logo: Footer.Logo,
155
- content: Footer.Content,
156
- copyright: Footer.Copyright,
157
- });
158
-
159
- export { Footer };
160
- //# sourceMappingURL=index.esm.js.map
1
+ import{jsx as r}from"react/jsx-runtime";import{Stack as o,Box as e}from"@mui/material";import{createContext as t,useContext as n,createElement as c,Fragment as l}from"react";const i=["logoSrc","copyright","content"],s=t(void 0),a=({children:o,...e})=>r(s.Provider,{value:e,children:o}),d=()=>{const r=n(s);if(!r)throw new Error("useFooterContext must be used within a FooterProvider");return r};function f({blocksOverride:r,defaultBlocks:o,defaultBlockOrder:e,children:t}){if(void 0===r)return t({blocks:o,blockOrder:e});if("function"==typeof r){const{blocks:n,blockOrder:c}=r({defaultBlocks:o,defaultBlockOrder:e});return t({blocks:n,blockOrder:c})}return r}function u(r,o){const e={...r};for(const r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r]);return e}function b(...r){return r.flat().filter(Boolean).join(" ")}function m(r,...o){const e={...r};for(const r of o)delete e[r];return e}function p(r,...o){const e={};for(const t of o)t in r&&(e[t]=r[t]);return e}const h=({className:e,children:t,sx:n,...c})=>r(o,{component:"footer",className:b("nbb-footer",e),spacing:2,sx:[{backgroundColor:"primary.main",color:"primary.contrastText",py:3,px:2,typography:"body2","& a":{color:"inherit"}},...Array.isArray(n)?n:[n]],...m(c,...i),children:r(a,{...p(c,...i),children:r(f,{defaultBlocks:y,defaultBlockOrder:Object.keys(y),blocksOverride:t,children:({blocks:{...o},blockOrder:e})=>e.filter(r=>r in o).map(e=>r(l,{children:o[e]},String(e)))})})}),y=(k={logo:h.Logo=({className:o,sx:t,...n})=>{const c=d(),{logoSrc:l}=u(c,n);return r(e,{className:b("nbb-footer-logo",o),sx:[{pb:.5,"& img":{display:"block"}},...Array.isArray(t)?t:[t]],...m(n,...i),children:r("img",{src:l,alt:"Footer logo"})})},content:h.Content=({className:o,children:t,...n})=>{const c=d(),{content:l}=u(c,n);return r(e,{className:b("nbb-footer-content",o),...m(n,...i),children:l||t})},copyright:h.Copyright=({className:o,children:t,...n})=>{const c=d(),{copyright:l}=u(c,n);return r(e,{className:b("nbb-footer-copyright",o),...m(n,...i),children:l||t})}},Object.fromEntries(Object.entries(k).map(([r,o])=>[r,c(o,{key:r})])));var k;export{h as Footer};
package/dist/lib.d.ts CHANGED
@@ -72,7 +72,12 @@ export declare function BlocksOverrideComponent<DefaultBlocks extends Record<str
72
72
  blockOrder: readonly (keyof DefaultBlocks | keyof CustomBlocks)[];
73
73
  }) => ReactNode;
74
74
  }): ReactNode;
75
- export declare function deepMerge<A extends Record<string, any>, B extends Record<string, any>>(obj1: A, obj2: B): A & B;
75
+ type MergeKeepingRequired<A, B> = Omit<A, keyof B> & {
76
+ [K in keyof A & keyof B]-?: undefined extends B[K] ? A[K] : B[K];
77
+ } & {
78
+ [K in Exclude<keyof B, keyof A>]: B[K];
79
+ };
80
+ export declare function merge<A extends Record<PropertyKey, any>, B extends Record<PropertyKey, any>>(a: A, b: B): MergeKeepingRequired<A, B>;
76
81
  type ClassName = string | ClassName[] | undefined | null;
77
82
  /**
78
83
  * Utility function to join class names together, ignoring undefined or nil values.
@@ -80,5 +85,19 @@ type ClassName = string | ClassName[] | undefined | null;
80
85
  * @returns The joined class names.
81
86
  */
82
87
  export declare function classNames(...classes: ClassName[]): string;
88
+ /**
89
+ * Omits the given string keys from `source`.
90
+ *
91
+ * Usage:
92
+ * omit(obj, "a", "b")
93
+ */
94
+ export declare function omit<T extends object, const Keys extends readonly string[]>(source: T, ...keys: Keys): Omit<T, Extract<Keys[number], keyof T>>;
95
+ /**
96
+ * Picks the given keys out of `source` into a new object.
97
+ *
98
+ * Usage:
99
+ * pick(obj, "a", "b")
100
+ */
101
+ export declare function pick<T extends object, K extends PropertyKey>(source: T, ...keys: K[]): Pick<T, Extract<K, keyof T>>;
83
102
  export {};
84
103
  //# sourceMappingURL=lib.d.ts.map
package/dist/lib.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElG;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,cAAc,CAAC,aAAa,EAAE,YAAY,IAClD,CAAC,CAAC,EACA,aAAa,EACb,iBAAiB,GAClB,EAAE;IACD,aAAa,EAAE,aAAa,CAAC;IAC7B,iBAAiB,EAAE,SAAS,CAAC,MAAM,aAAa,CAAC,EAAE,CAAC;CACrD,KAAK;IACJ,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,YAAY,CAAC;IAE9C,UAAU,EAAE,SAAS,CAAC,MAAM,aAAa,CAAC,EAAE,GAAG,SAAS,CAAC,MAAM,YAAY,CAAC,EAAE,CAAC;CAChF,CAAC,GACF,SAAS,CAAC;AAEd;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,CAAC,C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,EAAE,MAAM,CAAC,CAAC,CAAC,CAQzC;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,WAAW,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAWnH"}
package/package.json CHANGED
@@ -1,32 +1,43 @@
1
1
  {
2
2
  "name": "@nodeblocks/frontend-footer-block",
3
- "version": "0.1.0",
4
- "main": "dist/index.cjs.js",
5
- "module": "dist/index.esm.js",
6
- "browser": "dist/index.iife.js",
7
- "types": "dist/index.d.ts",
3
+ "version": "0.2.1",
4
+ "main": "./dist/index.cjs.js",
5
+ "module": "./dist/index.esm.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "development": "./src/index.ts",
11
+ "import": "./dist/index.esm.js",
12
+ "require": "./dist/index.cjs.js",
13
+ "default": "./dist/index.esm.js"
14
+ }
15
+ },
8
16
  "files": [
9
- "dist/",
10
- "dist/index.css"
17
+ "dist/"
11
18
  ],
12
19
  "scripts": {
13
- "build": "rollup -c",
14
- "watch": "rollup -c --watch"
20
+ "build": "npm run typecheck && rollup -c",
21
+ "watch": "rm -rf dist && cross-env NODE_ENV=development rollup -c --watch",
22
+ "typecheck": "tsc --noEmit"
15
23
  },
16
24
  "peerDependencies": {
17
- "react": "^18.3.1",
18
- "react-dom": "^18.3.1"
25
+ "@emotion/react": "^11.14.0",
26
+ "@emotion/styled": "^11.14.1",
27
+ "@mui/material": "^7.3.4",
28
+ "react": ">=18 <20",
29
+ "react-dom": ">=18 <20"
19
30
  },
20
31
  "devDependencies": {
21
- "@rollup/plugin-commonjs": "^28.0.1",
32
+ "@rollup/plugin-commonjs": "^28.0.6",
22
33
  "@rollup/plugin-json": "^6.1.0",
23
34
  "@rollup/plugin-node-resolve": "^15.3.0",
35
+ "@rollup/plugin-terser": "^0.4.4",
24
36
  "@rollup/plugin-typescript": "^12.1.1",
25
- "@types/react": "^18.3.12",
26
- "@types/react-dom": "^18.3.1",
27
- "rollup": "^4.28.0",
37
+ "@types/react": "19.2.7",
38
+ "@types/react-dom": "19.2.3",
39
+ "rollup": "^4.55.1",
28
40
  "rollup-plugin-peer-deps-external": "^2.2.4",
29
- "rollup-plugin-polyfill-node": "^0.13.0",
30
41
  "rollup-plugin-postcss": "^4.0.2",
31
42
  "rollup-plugin-serve": "^1.1.1",
32
43
  "tslib": "^2.8.1",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/lib.ts","../src/context.tsx","../src/footer.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import { ComponentProps, createElement, FunctionComponent, ReactElement, ReactNode } from 'react';\n\n/**\n * The function to be passed into a block component as `children` to selectively override default blocks, or just a `ReactNode`.\n *\n * @example\n * <Block>\n * {({ defaultBlocks: { header, ...defaultBlocks }, defaultBlockOrder }) => ({\n * blocks: {\n * ...defaultBlocks,\n * header: {\n * ...header,\n * props: {\n * ...header.props,\n * label: \"Custom Label\"\n * }\n * },\n * subheader: <CustomComponent />\n * },\n * blockOrder: [\"header\", \"subheader\", \"body\", \"footer\"]\n * })}\n * </Block>\n */\nexport type BlocksOverride<DefaultBlocks, CustomBlocks> =\n | (({\n defaultBlocks,\n defaultBlockOrder,\n }: {\n defaultBlocks: DefaultBlocks;\n defaultBlockOrder: readonly (keyof DefaultBlocks)[];\n }) => {\n blocks: Partial<DefaultBlocks> & CustomBlocks;\n // NOTE: This specific combination allows proper autocomplete.\n blockOrder: readonly (keyof DefaultBlocks)[] | readonly (keyof CustomBlocks)[];\n })\n | ReactNode;\n\n/**\n * Creates a strongly typed `defaultBlocks` object, allowing for types to propagate into block override objects.\n *\n * @param components - A map of default block keys to component functions.\n *\n * @example\n * const defaultBlocks = createDefaultBlocks({\n * title: Title,\n * description: Description,\n * form: Form,\n * });\n */\nexport function createDefaultBlocks<T extends Record<string, FunctionComponent<any>>>(\n components: T\n): {\n [K in keyof T]: ReactElement<ComponentProps<T[K]>, T[K]>;\n} {\n return Object.fromEntries(\n Object.entries(components).map(([key, Component]) => [key, createElement(Component, { key })])\n ) as {\n [K in keyof T]: ReactElement<ComponentProps<T[K]>, T[K]>;\n };\n}\n\n/**\n * A component for rendering {@link BlocksOverride|`BlocksOverride`} results.\n * Exposes the evaluated `blocks` and `blockOrder` as arguments to the `children` function.\n *\n * @param props\n * @param props.blocksOverride - The {@link BlocksOverride|`BlocksOverride`} (i.e. `children` of outer component).\n * @param props.defaultBlocks - The default blocks of outer component.\n * @param props.children - A function returning the JSX to render.\n *\n * @example\n * <BlocksOverrideComponent\n * defaultBlocks={defaultFormBlocks}\n * blocksOverride={children}\n * >\n * {({ blocks, blockOrder }) =>\n * blockOrder.map((key) => (\n * <Fragment key={String(key)}>{blocks[key]}</Fragment>\n * ))\n * }\n * </BlocksOverrideComponent>\n */\nexport function BlocksOverrideComponent<\n DefaultBlocks extends Record<string, ReactNode>,\n CustomBlocks extends Record<string, ReactNode>,\n>({\n blocksOverride,\n defaultBlocks,\n defaultBlockOrder,\n children,\n}: {\n blocksOverride: BlocksOverride<DefaultBlocks, CustomBlocks>;\n defaultBlocks: DefaultBlocks;\n defaultBlockOrder: (keyof DefaultBlocks)[];\n children: ({\n blocks,\n blockOrder,\n }: {\n // TODO: Possibly find an alternative to Partial<CustomBlocks>\n blocks: Partial<DefaultBlocks> & Partial<CustomBlocks>;\n blockOrder: readonly (keyof DefaultBlocks | keyof CustomBlocks)[];\n }) => ReactNode;\n}) {\n if (blocksOverride === undefined) {\n return children({\n // TODO: Remove this assertion\n blocks: defaultBlocks as DefaultBlocks & Partial<CustomBlocks>,\n blockOrder: defaultBlockOrder,\n });\n }\n\n if (typeof blocksOverride === 'function') {\n const { blocks, blockOrder } = blocksOverride({\n defaultBlocks,\n defaultBlockOrder,\n });\n\n return children({ blocks, blockOrder });\n }\n\n return blocksOverride;\n}\n\nexport function deepMerge<A extends Record<string, any>, B extends Record<string, any>>(obj1: A, obj2: B) {\n const result: Record<string, any> = { ...obj1 };\n\n for (const key in obj2) {\n if (obj2.hasOwnProperty(key)) {\n const val1 = result[key];\n const val2 = obj2[key];\n\n if (Array.isArray(val1) || Array.isArray(val2)) {\n // If either is an array, replace entirely with obj2's value\n result[key] = val2;\n } else if (typeof val1 === 'object' && val1 !== null && typeof val2 === 'object' && val2 !== null) {\n result[key] = deepMerge(val1, val2);\n } else {\n result[key] = val2;\n }\n }\n }\n\n return result as A & B;\n}\n\ntype ClassName = string | ClassName[] | undefined | null;\n\n/**\n * Utility function to join class names together, ignoring undefined or nil values.\n * @param classes - The class names to join.\n * @returns The joined class names.\n */\nexport function classNames(...classes: ClassName[]): string {\n return classes.flat().filter(Boolean).join(' ');\n}\n","import { createContext, ReactNode, useContext } from 'react';\n\ntype FooterContextValue = {\n logoSrc: string;\n copyright: ReactNode;\n content: ReactNode;\n};\n\nconst FooterContext = createContext<FooterContextValue | undefined>(undefined);\n\nexport const FooterProvider = ({\n children,\n ...value\n}: FooterContextValue & {\n children: ReactNode;\n}) => {\n return <FooterContext.Provider value={value}>{children}</FooterContext.Provider>;\n};\n\nexport const useFooterContext = () => {\n const context = useContext<FooterContextValue | undefined>(FooterContext);\n\n if (!context) {\n throw new Error('useFooterContext must be used within a FooterProvider');\n }\n return context;\n};\n","import { ComponentProps, Fragment, ReactNode } from 'react';\nimport './footer.css';\nimport { BlocksOverride, BlocksOverrideComponent, classNames, createDefaultBlocks, deepMerge } from './lib';\nimport { FooterProvider, useFooterContext } from './context';\n\nconst Footer = <CustomBlocks extends Record<string, ReactNode> = {}>({\n logoSrc,\n content,\n copyright,\n className,\n children,\n ...props\n}: Omit<ComponentProps<'footer'>, 'content'> & {\n logoSrc: string;\n copyright: ReactNode;\n content: ReactNode;\n children?: BlocksOverride<typeof defaultBlocks, CustomBlocks>;\n}) => {\n return (\n <FooterProvider\n {...{\n logoSrc,\n content,\n copyright,\n }}\n >\n <footer className={classNames('nbb-footer', className)} {...props}>\n <BlocksOverrideComponent\n defaultBlocks={defaultBlocks}\n defaultBlockOrder={Object.keys(defaultBlocks) as (keyof typeof defaultBlocks)[]}\n blocksOverride={children}\n >\n {({ blocks: { ...blocks }, blockOrder }) =>\n blockOrder\n .filter((key) => key in blocks)\n .map<ReactNode>((key) => <Fragment key={String(key)}>{blocks[key]}</Fragment>)\n }\n </BlocksOverrideComponent>\n </footer>\n </FooterProvider>\n );\n};\n\nFooter.Logo = (props: Partial<ComponentProps<'img'>>) => {\n const { className, logoSrc, src } = deepMerge(useFooterContext(), props);\n\n return (\n <img className={classNames('nbb-footer-logo', className)} src={logoSrc || src} alt={'Footer logo'} {...props} />\n );\n};\n\nFooter.Content = (props: Partial<ComponentProps<'div'>>) => {\n const { className, children, content } = deepMerge(useFooterContext(), props);\n\n return (\n <div className={classNames('nbb-footer-content', className)} {...props}>\n {content || children}\n </div>\n );\n};\n\nFooter.Copyright = (props: Partial<ComponentProps<'div'>>) => {\n const { className, children, copyright } = deepMerge(useFooterContext(), props);\n\n return (\n <div className={classNames('nbb-footer-copyright', className)} {...props}>\n {copyright || children}\n </div>\n );\n};\n\nconst defaultBlocks = createDefaultBlocks({\n logo: Footer.Logo,\n content: Footer.Content,\n copyright: Footer.Copyright,\n});\n\nexport default Footer;\n"],"names":["createElement","createContext","_js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,CAAC,sBAAsB,EAAE,SAAS,CAAC,EAAA,GAAM,KAAK,EAAA,QAAA,EACrE,SAAS,IAAI,QAAQ,EAAA,CAClB;AAEV,CAAC;AAED,MAAM,aAAa,GAAG,mBAAmB,CAAC;IACxC,IAAI,EAAE,MAAM,CAAC,IAAI;IACjB,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,SAAS,EAAE,MAAM,CAAC,SAAS;AAC5B,CAAA,CAAC;;;;","x_google_ignoreList":[0]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.esm.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/lib.ts","../src/context.tsx","../src/footer.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import { ComponentProps, createElement, FunctionComponent, ReactElement, ReactNode } from 'react';\n\n/**\n * The function to be passed into a block component as `children` to selectively override default blocks, or just a `ReactNode`.\n *\n * @example\n * <Block>\n * {({ defaultBlocks: { header, ...defaultBlocks }, defaultBlockOrder }) => ({\n * blocks: {\n * ...defaultBlocks,\n * header: {\n * ...header,\n * props: {\n * ...header.props,\n * label: \"Custom Label\"\n * }\n * },\n * subheader: <CustomComponent />\n * },\n * blockOrder: [\"header\", \"subheader\", \"body\", \"footer\"]\n * })}\n * </Block>\n */\nexport type BlocksOverride<DefaultBlocks, CustomBlocks> =\n | (({\n defaultBlocks,\n defaultBlockOrder,\n }: {\n defaultBlocks: DefaultBlocks;\n defaultBlockOrder: readonly (keyof DefaultBlocks)[];\n }) => {\n blocks: Partial<DefaultBlocks> & CustomBlocks;\n // NOTE: This specific combination allows proper autocomplete.\n blockOrder: readonly (keyof DefaultBlocks)[] | readonly (keyof CustomBlocks)[];\n })\n | ReactNode;\n\n/**\n * Creates a strongly typed `defaultBlocks` object, allowing for types to propagate into block override objects.\n *\n * @param components - A map of default block keys to component functions.\n *\n * @example\n * const defaultBlocks = createDefaultBlocks({\n * title: Title,\n * description: Description,\n * form: Form,\n * });\n */\nexport function createDefaultBlocks<T extends Record<string, FunctionComponent<any>>>(\n components: T\n): {\n [K in keyof T]: ReactElement<ComponentProps<T[K]>, T[K]>;\n} {\n return Object.fromEntries(\n Object.entries(components).map(([key, Component]) => [key, createElement(Component, { key })])\n ) as {\n [K in keyof T]: ReactElement<ComponentProps<T[K]>, T[K]>;\n };\n}\n\n/**\n * A component for rendering {@link BlocksOverride|`BlocksOverride`} results.\n * Exposes the evaluated `blocks` and `blockOrder` as arguments to the `children` function.\n *\n * @param props\n * @param props.blocksOverride - The {@link BlocksOverride|`BlocksOverride`} (i.e. `children` of outer component).\n * @param props.defaultBlocks - The default blocks of outer component.\n * @param props.children - A function returning the JSX to render.\n *\n * @example\n * <BlocksOverrideComponent\n * defaultBlocks={defaultFormBlocks}\n * blocksOverride={children}\n * >\n * {({ blocks, blockOrder }) =>\n * blockOrder.map((key) => (\n * <Fragment key={String(key)}>{blocks[key]}</Fragment>\n * ))\n * }\n * </BlocksOverrideComponent>\n */\nexport function BlocksOverrideComponent<\n DefaultBlocks extends Record<string, ReactNode>,\n CustomBlocks extends Record<string, ReactNode>,\n>({\n blocksOverride,\n defaultBlocks,\n defaultBlockOrder,\n children,\n}: {\n blocksOverride: BlocksOverride<DefaultBlocks, CustomBlocks>;\n defaultBlocks: DefaultBlocks;\n defaultBlockOrder: (keyof DefaultBlocks)[];\n children: ({\n blocks,\n blockOrder,\n }: {\n // TODO: Possibly find an alternative to Partial<CustomBlocks>\n blocks: Partial<DefaultBlocks> & Partial<CustomBlocks>;\n blockOrder: readonly (keyof DefaultBlocks | keyof CustomBlocks)[];\n }) => ReactNode;\n}) {\n if (blocksOverride === undefined) {\n return children({\n // TODO: Remove this assertion\n blocks: defaultBlocks as DefaultBlocks & Partial<CustomBlocks>,\n blockOrder: defaultBlockOrder,\n });\n }\n\n if (typeof blocksOverride === 'function') {\n const { blocks, blockOrder } = blocksOverride({\n defaultBlocks,\n defaultBlockOrder,\n });\n\n return children({ blocks, blockOrder });\n }\n\n return blocksOverride;\n}\n\nexport function deepMerge<A extends Record<string, any>, B extends Record<string, any>>(obj1: A, obj2: B) {\n const result: Record<string, any> = { ...obj1 };\n\n for (const key in obj2) {\n if (obj2.hasOwnProperty(key)) {\n const val1 = result[key];\n const val2 = obj2[key];\n\n if (Array.isArray(val1) || Array.isArray(val2)) {\n // If either is an array, replace entirely with obj2's value\n result[key] = val2;\n } else if (typeof val1 === 'object' && val1 !== null && typeof val2 === 'object' && val2 !== null) {\n result[key] = deepMerge(val1, val2);\n } else {\n result[key] = val2;\n }\n }\n }\n\n return result as A & B;\n}\n\ntype ClassName = string | ClassName[] | undefined | null;\n\n/**\n * Utility function to join class names together, ignoring undefined or nil values.\n * @param classes - The class names to join.\n * @returns The joined class names.\n */\nexport function classNames(...classes: ClassName[]): string {\n return classes.flat().filter(Boolean).join(' ');\n}\n","import { createContext, ReactNode, useContext } from 'react';\n\ntype FooterContextValue = {\n logoSrc: string;\n copyright: ReactNode;\n content: ReactNode;\n};\n\nconst FooterContext = createContext<FooterContextValue | undefined>(undefined);\n\nexport const FooterProvider = ({\n children,\n ...value\n}: FooterContextValue & {\n children: ReactNode;\n}) => {\n return <FooterContext.Provider value={value}>{children}</FooterContext.Provider>;\n};\n\nexport const useFooterContext = () => {\n const context = useContext<FooterContextValue | undefined>(FooterContext);\n\n if (!context) {\n throw new Error('useFooterContext must be used within a FooterProvider');\n }\n return context;\n};\n","import { ComponentProps, Fragment, ReactNode } from 'react';\nimport './footer.css';\nimport { BlocksOverride, BlocksOverrideComponent, classNames, createDefaultBlocks, deepMerge } from './lib';\nimport { FooterProvider, useFooterContext } from './context';\n\nconst Footer = <CustomBlocks extends Record<string, ReactNode> = {}>({\n logoSrc,\n content,\n copyright,\n className,\n children,\n ...props\n}: Omit<ComponentProps<'footer'>, 'content'> & {\n logoSrc: string;\n copyright: ReactNode;\n content: ReactNode;\n children?: BlocksOverride<typeof defaultBlocks, CustomBlocks>;\n}) => {\n return (\n <FooterProvider\n {...{\n logoSrc,\n content,\n copyright,\n }}\n >\n <footer className={classNames('nbb-footer', className)} {...props}>\n <BlocksOverrideComponent\n defaultBlocks={defaultBlocks}\n defaultBlockOrder={Object.keys(defaultBlocks) as (keyof typeof defaultBlocks)[]}\n blocksOverride={children}\n >\n {({ blocks: { ...blocks }, blockOrder }) =>\n blockOrder\n .filter((key) => key in blocks)\n .map<ReactNode>((key) => <Fragment key={String(key)}>{blocks[key]}</Fragment>)\n }\n </BlocksOverrideComponent>\n </footer>\n </FooterProvider>\n );\n};\n\nFooter.Logo = (props: Partial<ComponentProps<'img'>>) => {\n const { className, logoSrc, src } = deepMerge(useFooterContext(), props);\n\n return (\n <img className={classNames('nbb-footer-logo', className)} src={logoSrc || src} alt={'Footer logo'} {...props} />\n );\n};\n\nFooter.Content = (props: Partial<ComponentProps<'div'>>) => {\n const { className, children, content } = deepMerge(useFooterContext(), props);\n\n return (\n <div className={classNames('nbb-footer-content', className)} {...props}>\n {content || children}\n </div>\n );\n};\n\nFooter.Copyright = (props: Partial<ComponentProps<'div'>>) => {\n const { className, children, copyright } = deepMerge(useFooterContext(), props);\n\n return (\n <div className={classNames('nbb-footer-copyright', className)} {...props}>\n {copyright || children}\n </div>\n );\n};\n\nconst defaultBlocks = createDefaultBlocks({\n logo: Footer.Logo,\n content: Footer.Content,\n copyright: Footer.Copyright,\n});\n\nexport default Footer;\n"],"names":["_jsx"],"mappings":";;;;;;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,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