@nodeblocks/frontend-how-to-use-block 0.3.2 → 0.4.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.
@@ -6,11 +6,11 @@ import { BlocksOverride } from './lib';
6
6
  declare const HowToUse: {
7
7
  <CustomBlocks extends Record<string, ReactNode> = {}>({ className, children, sx, ...props }: Omit<StackProps, "children"> & {
8
8
  children?: BlocksOverride<typeof defaultHowToUseBlocks, CustomBlocks>;
9
- } & Required<Pick<HowToUseContextValue, "subtitle" | "headerContent" | "message" | "linkHref" | "linkContent">>): import("react/jsx-runtime").JSX.Element;
9
+ } & Required<Pick<HowToUseContextValue, "subtitle" | "headerContent" | "message" | "linkHref" | "linkContent">> & Partial<Pick<HowToUseContextValue, "cardList">>): import("react/jsx-runtime").JSX.Element;
10
10
  Header: ({ className, children, sx, ...props }: StackProps & Partial<Pick<HowToUseContextValue, "subtitle" | "headerContent">>) => import("react/jsx-runtime").JSX.Element;
11
11
  CardList: ({ children, className, sx, ...props }: StackProps & {
12
- children: ReactNode;
13
- }) => import("react/jsx-runtime").JSX.Element;
12
+ children?: ReactNode;
13
+ } & Partial<Pick<HowToUseContextValue, "cardList">>) => import("react/jsx-runtime").JSX.Element;
14
14
  Card: ({ children, className, icon: Icon, headerContent, sx, ...props }: CardProps & {
15
15
  icon: SvgIconComponent;
16
16
  headerContent: ReactNode;
@@ -19,17 +19,17 @@ declare const HowToUse: {
19
19
  };
20
20
  declare const defaultHowToUseBlocks: {
21
21
  header: import("react").ReactElement<import("@mui/material").StackOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/material").StackOwnProps> & {
22
- component?: React.ElementType;
22
+ component?: React.ElementType | undefined;
23
23
  } & Partial<Pick<HowToUseContextValue, "subtitle" | "headerContent">>, ({ className, children, sx, ...props }: StackProps & Partial<Pick<HowToUseContextValue, "subtitle" | "headerContent">>) => import("react/jsx-runtime").JSX.Element>;
24
24
  cardList: import("react").ReactElement<import("@mui/material").StackOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/material").StackOwnProps> & {
25
- component?: React.ElementType;
25
+ component?: React.ElementType | undefined;
26
26
  } & {
27
- children: ReactNode;
28
- }, ({ children, className, sx, ...props }: StackProps & {
29
- children: ReactNode;
30
- }) => import("react/jsx-runtime").JSX.Element>;
27
+ children?: ReactNode;
28
+ } & Partial<Pick<HowToUseContextValue, "cardList">>, ({ children, className, sx, ...props }: StackProps & {
29
+ children?: ReactNode;
30
+ } & Partial<Pick<HowToUseContextValue, "cardList">>) => import("react/jsx-runtime").JSX.Element>;
31
31
  card: import("react").ReactElement<import("@mui/material").CardOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "style" | "square" | "className" | "classes" | "elevation" | "sx" | "variant" | "raised"> & {
32
- component?: React.ElementType;
32
+ component?: React.ElementType | undefined;
33
33
  } & {
34
34
  icon: SvgIconComponent;
35
35
  headerContent: ReactNode;
@@ -38,7 +38,7 @@ declare const defaultHowToUseBlocks: {
38
38
  headerContent: ReactNode;
39
39
  }) => import("react/jsx-runtime").JSX.Element>;
40
40
  footer: import("react").ReactElement<import("@mui/material").StackOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/material").StackOwnProps> & {
41
- component?: React.ElementType;
41
+ component?: React.ElementType | undefined;
42
42
  } & Required<Pick<HowToUseContextValue, "message" | "linkHref" | "linkContent">>, ({ children, className, sx, ...props }: StackProps & Required<Pick<HowToUseContextValue, "message" | "linkHref" | "linkContent">>) => import("react/jsx-runtime").JSX.Element>;
43
43
  };
44
44
  export default HowToUse;
@@ -1 +1 @@
1
- {"version":3,"file":"HowToUse.d.ts","sourceRoot":"","sources":["../src/HowToUse.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAuB,SAAS,EAA0B,UAAU,EAAc,MAAM,eAAe,CAAC;AAC/G,OAAO,EAAY,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAA6D,MAAM,WAAW,CAAC;AAE5G,OAAO,EAAE,cAAc,EAAmE,MAAM,OAAO,CAAC;AAoOxG,QAAA,MAAM,QAAQ;KAAI,YAAY,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,8CAK7D,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG;QAChC,QAAQ,CAAC,EAAE,cAAc,CAAC,OAAO,qBAAqB,EAAE,YAAY,CAAC,CAAC;KACvE,GAAG,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,eAAe,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC,CAAC;oDAvJ5G,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,eAAe,CAAC,CAAC;sDA8FxB,UAAU,GAAG;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE;6EAzK1F,SAAS,GAAG;QAAE,IAAI,EAAE,gBAAgB,CAAC;QAAC,aAAa,EAAE,SAAS,CAAA;KAAE;oDA0HhE,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC,CAAC;CA2I3F,CAAC;AAOF,QAAA,MAAM,qBAAqB;;;mHAjMxB,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,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,QAAQ,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;6EAlKvF,SAAS,GAAG;QAAE,IAAI,EAAE,gBAAgB,CAAC;QAAC,aAAa,EAAE,SAAS,CAAA;KAAE;oDAgHhE,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC,CAAC;CAgJ3F,CAAC;AAOF,QAAA,MAAM,qBAAqB;;;mHAlMxB,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,eAAe,CAAC,CAAC;;;;mBA6FpD,SAAS;iGAAnC,UAAU,GAAG;QAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;;;;cAlKnE,gBAAgB;uBAAiB,SAAS;0EAA9D,SAAS,GAAG;QAAE,IAAI,EAAE,gBAAgB,CAAC;QAAC,aAAa,EAAE,SAAS,CAAA;KAAE;;;8HAgHhE,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC,CAAC;CA4J1F,CAAC;AAEH,eAAe,QAAQ,CAAC"}
package/dist/context.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { ReactNode } from 'react';
2
2
  export type HowToUseContextValue = {
3
+ cardList?: ReactNode[];
3
4
  subtitle: ReactNode;
4
5
  headerContent: ReactNode;
5
6
  message: ReactNode;
6
7
  linkHref: string;
7
8
  linkContent: ReactNode;
8
9
  };
9
- export declare const keys: readonly ["subtitle", "headerContent", "message", "linkHref", "linkContent"];
10
+ export declare const keys: readonly ["cardList", "subtitle", "headerContent", "message", "linkHref", "linkContent"];
10
11
  export declare const HowToUseProvider: ({ children, ...value }: HowToUseContextValue & {
11
12
  children: ReactNode;
12
13
  }) => import("react/jsx-runtime").JSX.Element;
@@ -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,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,EAAE,SAAS,CAAC;IACzB,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,SAAS,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,IAAI,8EAMyB,CAAC;AAW3C,eAAO,MAAM,gBAAgB,GAAI,wBAG9B,oBAAoB,GAAG;IACxB,QAAQ,EAAE,SAAS,CAAC;CACrB,4CAEA,CAAC;AAEF,eAAO,MAAM,kBAAkB,4BAO9B,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,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,aAAa,EAAE,SAAS,CAAC;IACzB,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,SAAS,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,IAAI,0FAOyB,CAAC;AAW3C,eAAO,MAAM,gBAAgB,GAAI,wBAG9B,oBAAoB,GAAG;IACxB,QAAQ,EAAE,SAAS,CAAC;CACrB,4CAEA,CAAC;AAEF,eAAO,MAAM,kBAAkB,4BAO9B,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("@mui/icons-material"),n=require("@mui/material"),t=require("react");const s=["subtitle","headerContent","message","linkHref","linkContent"],i=t.createContext(void 0),o=({children:r,...n})=>e.jsx(i.Provider,{value:n,children:r}),a=()=>{const e=t.useContext(i);if(!e)throw new Error("useHowToUseContext must be used within a HowToUseProvider");return e};function l({blocksOverride:e,defaultBlocks:r,defaultBlockOrder:n,children:t}){if(void 0===e)return t({blocks:r,blockOrder:n});if("function"==typeof e){const{blocks:s,blockOrder:i}=e({defaultBlocks:r,defaultBlockOrder:n});return t({blocks:s,blockOrder:i})}return e}function c(e,r){const n={...e};for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e]);return n}function d(...e){return e.flat().filter(Boolean).join(" ")}function x(e,...r){const n={...e};for(const e of r)delete n[e];return n}function h(e,...r){const n={};for(const t of r)t in e&&(n[t]=e[t]);return n}const g=({className:r,children:i,sx:a,...c})=>e.jsx(o,{...h(c,...s),children:e.jsx(n.Stack,{spacing:{xs:5,lg:6},className:d("nbb-how-to-use",r),sx:[e=>({backgroundColor:e.palette.background.default,py:{xs:5,lg:10},px:{xs:2,lg:"unset"}}),...Array.isArray(a)?a:[a]],...x(c,...s),children:e.jsx(l,{defaultBlocks:u,defaultBlockOrder:Object.keys(u),blocksOverride:i,children:({blocks:{card:r,...n},blockOrder:s})=>e.jsx(e.Fragment,{children:s.filter(e=>e in n).map(r=>e.jsx(t.Fragment,{children:n[r]},String(r)))})})})}),u=(f={header:g.Header=({className:r,children:t,sx:i,...o})=>{const l=a(),{subtitle:h,headerContent:g}=c(l,o);return e.jsxs(n.Stack,{spacing:{xs:.5,lg:1},className:d("nbb-how-to-use-header",r),sx:[{textAlign:"center"},...Array.isArray(i)?i:[i]],...x(o,...s),children:[e.jsx(n.Typography,{variant:"h4",sx:{color:"primary.main",fontWeight:"bold",lineHeight:1.5,fontSize:{xs:18,lg:24}},children:g||t}),e.jsx(n.Typography,{variant:"h1",component:"h1",sx:{fontSize:{xs:25,lg:45},fontWeight:600,lineHeight:1.5},children:h})]})},cardList:g.CardList=({children:t,className:s,sx:i,...o})=>e.jsx(n.Stack,{direction:{xs:"column",lg:"row"},spacing:0,className:d("nbb-how-to-use-card-list",s),sx:[{alignItems:{xs:"center",lg:"stretch"},justifyContent:"center"},...Array.isArray(i)?i:[i]],...o,children:t&&Array.isArray(t)?t.reduce((n,t,s)=>[...n,...s>0?[e.jsx(r.ArrowRight,{sx:{display:{xs:"none",lg:"initial"},fontSize:40,color:"primary.main",alignSelf:"center"}},`right-arrow-${s}`),e.jsx(r.ArrowDropDown,{sx:{display:{xs:"initial",lg:"none"},fontSize:40,color:"primary.main",alignSelf:"center"}},`down-arrow-${s}`)]:[],t],[]):t}),card:g.Card=({children:r,className:t,icon:i,headerContent:o,sx:a,...l})=>e.jsx(n.Card,{component:"article",elevation:0,className:d("nbb-how-to-use-card",t),sx:[{width:"100%",maxWidth:360},...Array.isArray(a)?a:[a]],...x(l,...s),children:e.jsxs(n.CardContent,{component:n.Stack,spacing:2,sx:{py:{xs:2,lg:3},px:2.5,alignItems:{xs:"flex-start",lg:"unset"}},children:[e.jsxs(n.Stack,{direction:{xs:"row",lg:"column"},spacing:{xs:2,lg:1},sx:{alignItems:"center",justifyContent:"center",py:.5},children:[i&&e.jsx(i,{sx:{color:"primary.main",fontSize:{xs:24,lg:40}}}),e.jsx(n.Typography,{variant:"h6",component:"h6",sx:{color:"#000",fontWeight:600,fontSize:{xs:16,lg:25},m:0,lineHeight:1.72},children:o})]}),e.jsx(n.Typography,{sx:{fontSize:16,textAlign:"left",lineHeight:1.72,fontWeight:300},children:r})]})}),footer:g.Footer=({children:r,className:t,sx:i,...o})=>{const l=a(),{message:h,linkHref:g,linkContent:u}=c(l,o);return e.jsxs(n.Stack,{spacing:1.5,className:d("nbb-how-to-use-footer",t),sx:[{alignItems:"center"},...Array.isArray(i)?i:[i]],...x(o,...s),children:[h&&e.jsx(n.Typography,{variant:"body2",sx:{color:"primary.main",fontWeight:600,lineHeight:1.72},children:h}),e.jsx(n.Button,{href:g,rel:"noreferrer noopener",variant:"contained",size:"large",sx:{width:360,maxWidth:"100%",fontSize:{lg:22},lineHeight:1.5,px:{lg:32}},children:u})]})}},Object.fromEntries(Object.entries(f).map(([e,r])=>[e,t.createElement(r,{key:e})])));var f;exports.HowToUse=g;
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("@mui/icons-material"),t=require("@mui/material"),n=require("react");const s=["cardList","subtitle","headerContent","message","linkHref","linkContent"],o=n.createContext(void 0),i=({children:r,...t})=>e.jsx(o.Provider,{value:t,children:r}),a=()=>{const e=n.useContext(o);if(!e)throw new Error("useHowToUseContext must be used within a HowToUseProvider");return e};function c({blocksOverride:e,defaultBlocks:r,defaultBlockOrder:t,children:n}){if(void 0===e)return n({blocks:r,blockOrder:t});if("function"==typeof e){const{blocks:s,blockOrder:o}=e({defaultBlocks:r,defaultBlockOrder:t});return n({blocks:s,blockOrder:o})}return e}function l(e){return"[object Object]"===Object.prototype.toString.call(e)}function d(e,r){const t={...e};for(const e of Reflect.ownKeys(r)){const n=t[e],s=r[e];l(n)&&l(s)?t[e]=d(n,s):t[e]=s}return t}function x(...e){return e.flat().filter(Boolean).join(" ")}function h(e,...r){const t={...e};for(const e of r)delete t[e];return t}function u(e,...r){const t={};for(const n of r)n in e&&(t[n]=e[n]);return t}const m=({className:r,children:o,sx:a=[],...l})=>e.jsx(i,{...u(l,...s),children:e.jsx(t.Stack,{spacing:{xs:5,lg:6},className:x("nbb-how-to-use",r),sx:[e=>({backgroundColor:e.palette.background.default,py:{xs:5,lg:10},px:{xs:2,lg:"unset"}}),...Array.isArray(a)?a:[a]],...h(l,...s),children:e.jsx(c,{defaultBlocks:p,defaultBlockOrder:Object.keys(p),blocksOverride:o,children:({blocks:{card:r,...t},blockOrder:s})=>e.jsx(e.Fragment,{children:s.filter(e=>e in t).map(r=>e.jsx(n.Fragment,{children:t[r]},String(r)))})})})}),p=(g={header:m.Header=({className:r,children:n,sx:o=[],...i})=>{const c=a(),{subtitle:l,headerContent:u}=d(c,i);return e.jsxs(t.Stack,{spacing:{xs:.5,lg:1},className:x("nbb-how-to-use-header",r),sx:[{textAlign:"center"},...Array.isArray(o)?o:[o]],...h(i,...s),children:[e.jsx(t.Typography,{variant:"h4",sx:{color:"primary.main",typography:{xs:"h6",lg:"h4"}},children:u||n}),e.jsx(t.Typography,{variant:"h1",component:"h1",sx:{fontSize:{xs:"h4.fontSize",lg:45}},children:l})]})},cardList:m.CardList=({children:o,className:i,sx:c=[],...l})=>{const{cardList:u=[]}=d(a(),l),m=o?n.Children.toArray(o):u;return e.jsx(t.Stack,{direction:{xs:"column",lg:"row"},spacing:0,className:x("nbb-how-to-use-card-list",i),sx:[{alignItems:{xs:"center",lg:"stretch"},justifyContent:"center"},...Array.isArray(c)?c:[c]],...h(l,...s),children:m.reduce((t,n,s)=>[...t,...s>0?[e.jsx(r.ArrowRight,{sx:{display:{xs:"none",lg:"initial"},fontSize:40,color:"primary.main",alignSelf:"center"}},`right-arrow-${s}`),e.jsx(r.ArrowDropDown,{sx:{display:{xs:"initial",lg:"none"},fontSize:40,color:"primary.main",alignSelf:"center"}},`down-arrow-${s}`)]:[],n],[])})},card:m.Card=({children:r,className:n,icon:s,headerContent:o,sx:i=[],...a})=>e.jsx(t.Card,{component:"article",elevation:0,className:x("nbb-how-to-use-card",n),sx:[{width:"100%",maxWidth:360},...Array.isArray(i)?i:[i]],...a,children:e.jsxs(t.CardContent,{component:t.Stack,spacing:2,sx:{py:{xs:2,lg:3},px:2.5,alignItems:{xs:"flex-start",lg:"unset"}},children:[e.jsxs(t.Stack,{direction:{xs:"row",lg:"column"},spacing:{xs:2,lg:1},sx:{alignItems:"center",justifyContent:"center",py:.5},children:[s&&e.jsx(s,{sx:{color:"primary.main",fontSize:{xs:24,lg:40}}}),e.jsx(t.Typography,{component:"h6",sx:{typography:{xs:"subtitle1",sm:"h4"},m:0},children:o})]}),e.jsx(t.Typography,{variant:"body1",sx:{textAlign:"left"},children:r})]})}),footer:m.Footer=({children:r,className:n,sx:o=[],...i})=>{const c=a(),{message:l,linkHref:u,linkContent:m}=d(c,i);return e.jsxs(t.Stack,{spacing:{xs:1.5,sm:2},className:x("nbb-how-to-use-footer",n),sx:[{alignItems:"center"},...Array.isArray(o)?o:[o]],...h(i,...s),children:[l&&e.jsx(t.Typography,{variant:"body2",sx:{typography:{xs:"subtitle2",sm:"h5"},color:"primary.main"},children:l}),e.jsx(t.Button,{href:u,rel:"noreferrer noopener",variant:"contained",size:"large",sx:{width:360,maxWidth:"100%",typography:{xs:"subtitle1",sm:"h5"},px:{sm:4}},children:m})]})}},Object.fromEntries(Object.entries(g).map(([e,r])=>[e,n.createElement(r,{key:e})])));var g;exports.HowToUse=m;
package/dist/index.esm.js CHANGED
@@ -1 +1 @@
1
- import{jsx as e,Fragment as r,jsxs as n}from"react/jsx-runtime";import{ArrowRight as t,ArrowDropDown as i}from"@mui/icons-material";import{Stack as o,Typography as l,Card as s,CardContent as a,Button as c}from"@mui/material";import{createContext as d,useContext as h,createElement as f,Fragment as m}from"react";const g=["subtitle","headerContent","message","linkHref","linkContent"],x=d(void 0),u=({children:r,...n})=>e(x.Provider,{value:n,children:r}),p=()=>{const e=h(x);if(!e)throw new Error("useHowToUseContext must be used within a HowToUseProvider");return e};function b({blocksOverride:e,defaultBlocks:r,defaultBlockOrder:n,children:t}){if(void 0===e)return t({blocks:r,blockOrder:n});if("function"==typeof e){const{blocks:i,blockOrder:o}=e({defaultBlocks:r,defaultBlockOrder:n});return t({blocks:i,blockOrder:o})}return e}function y(e,r){const n={...e};for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e]);return n}function k(...e){return e.flat().filter(Boolean).join(" ")}function w(e,...r){const n={...e};for(const e of r)delete n[e];return n}function v(e,...r){const n={};for(const t of r)t in e&&(n[t]=e[t]);return n}const A=({className:n,children:t,sx:i,...l})=>e(u,{...v(l,...g),children:e(o,{spacing:{xs:5,lg:6},className:k("nbb-how-to-use",n),sx:[e=>({backgroundColor:e.palette.background.default,py:{xs:5,lg:10},px:{xs:2,lg:"unset"}}),...Array.isArray(i)?i:[i]],...w(l,...g),children:e(b,{defaultBlocks:O,defaultBlockOrder:Object.keys(O),blocksOverride:t,children:({blocks:{card:n,...t},blockOrder:i})=>e(r,{children:i.filter(e=>e in t).map(r=>e(m,{children:t[r]},String(r)))})})})}),O=(C={header:A.Header=({className:r,children:t,sx:i,...s})=>{const a=p(),{subtitle:c,headerContent:d}=y(a,s);return n(o,{spacing:{xs:.5,lg:1},className:k("nbb-how-to-use-header",r),sx:[{textAlign:"center"},...Array.isArray(i)?i:[i]],...w(s,...g),children:[e(l,{variant:"h4",sx:{color:"primary.main",fontWeight:"bold",lineHeight:1.5,fontSize:{xs:18,lg:24}},children:d||t}),e(l,{variant:"h1",component:"h1",sx:{fontSize:{xs:25,lg:45},fontWeight:600,lineHeight:1.5},children:c})]})},cardList:A.CardList=({children:r,className:n,sx:l,...s})=>e(o,{direction:{xs:"column",lg:"row"},spacing:0,className:k("nbb-how-to-use-card-list",n),sx:[{alignItems:{xs:"center",lg:"stretch"},justifyContent:"center"},...Array.isArray(l)?l:[l]],...s,children:r&&Array.isArray(r)?r.reduce((r,n,o)=>[...r,...o>0?[e(t,{sx:{display:{xs:"none",lg:"initial"},fontSize:40,color:"primary.main",alignSelf:"center"}},`right-arrow-${o}`),e(i,{sx:{display:{xs:"initial",lg:"none"},fontSize:40,color:"primary.main",alignSelf:"center"}},`down-arrow-${o}`)]:[],n],[]):r}),card:A.Card=({children:r,className:t,icon:i,headerContent:c,sx:d,...h})=>e(s,{component:"article",elevation:0,className:k("nbb-how-to-use-card",t),sx:[{width:"100%",maxWidth:360},...Array.isArray(d)?d:[d]],...w(h,...g),children:n(a,{component:o,spacing:2,sx:{py:{xs:2,lg:3},px:2.5,alignItems:{xs:"flex-start",lg:"unset"}},children:[n(o,{direction:{xs:"row",lg:"column"},spacing:{xs:2,lg:1},sx:{alignItems:"center",justifyContent:"center",py:.5},children:[i&&e(i,{sx:{color:"primary.main",fontSize:{xs:24,lg:40}}}),e(l,{variant:"h6",component:"h6",sx:{color:"#000",fontWeight:600,fontSize:{xs:16,lg:25},m:0,lineHeight:1.72},children:c})]}),e(l,{sx:{fontSize:16,textAlign:"left",lineHeight:1.72,fontWeight:300},children:r})]})}),footer:A.Footer=({children:r,className:t,sx:i,...s})=>{const a=p(),{message:d,linkHref:h,linkContent:f}=y(a,s);return n(o,{spacing:1.5,className:k("nbb-how-to-use-footer",t),sx:[{alignItems:"center"},...Array.isArray(i)?i:[i]],...w(s,...g),children:[d&&e(l,{variant:"body2",sx:{color:"primary.main",fontWeight:600,lineHeight:1.72},children:d}),e(c,{href:h,rel:"noreferrer noopener",variant:"contained",size:"large",sx:{width:360,maxWidth:"100%",fontSize:{lg:22},lineHeight:1.5,px:{lg:32}},children:f})]})}},Object.fromEntries(Object.entries(C).map(([e,r])=>[e,f(r,{key:e})])));var C;export{A as HowToUse};
1
+ import{jsx as e,Fragment as r,jsxs as n}from"react/jsx-runtime";import{ArrowRight as t,ArrowDropDown as o}from"@mui/icons-material";import{Stack as s,Typography as i,Card as a,CardContent as c,Button as l}from"@mui/material";import{createContext as d,useContext as h,createElement as m,Fragment as u,Children as x}from"react";const f=["cardList","subtitle","headerContent","message","linkHref","linkContent"],p=d(void 0),g=({children:r,...n})=>e(p.Provider,{value:n,children:r}),y=()=>{const e=h(p);if(!e)throw new Error("useHowToUseContext must be used within a HowToUseProvider");return e};function b({blocksOverride:e,defaultBlocks:r,defaultBlockOrder:n,children:t}){if(void 0===e)return t({blocks:r,blockOrder:n});if("function"==typeof e){const{blocks:o,blockOrder:s}=e({defaultBlocks:r,defaultBlockOrder:n});return t({blocks:o,blockOrder:s})}return e}function k(e){return"[object Object]"===Object.prototype.toString.call(e)}function w(e,r){const n={...e};for(const e of Reflect.ownKeys(r)){const t=n[e],o=r[e];k(t)&&k(o)?n[e]=w(t,o):n[e]=o}return n}function v(...e){return e.flat().filter(Boolean).join(" ")}function O(e,...r){const n={...e};for(const e of r)delete n[e];return n}function A(e,...r){const n={};for(const t of r)t in e&&(n[t]=e[t]);return n}const C=({className:n,children:t,sx:o=[],...i})=>e(g,{...A(i,...f),children:e(s,{spacing:{xs:5,lg:6},className:v("nbb-how-to-use",n),sx:[e=>({backgroundColor:e.palette.background.default,py:{xs:5,lg:10},px:{xs:2,lg:"unset"}}),...Array.isArray(o)?o:[o]],...O(i,...f),children:e(b,{defaultBlocks:j,defaultBlockOrder:Object.keys(j),blocksOverride:t,children:({blocks:{card:n,...t},blockOrder:o})=>e(r,{children:o.filter(e=>e in t).map(r=>e(u,{children:t[r]},String(r)))})})})}),j=(N={header:C.Header=({className:r,children:t,sx:o=[],...a})=>{const c=y(),{subtitle:l,headerContent:d}=w(c,a);return n(s,{spacing:{xs:.5,lg:1},className:v("nbb-how-to-use-header",r),sx:[{textAlign:"center"},...Array.isArray(o)?o:[o]],...O(a,...f),children:[e(i,{variant:"h4",sx:{color:"primary.main",typography:{xs:"h6",lg:"h4"}},children:d||t}),e(i,{variant:"h1",component:"h1",sx:{fontSize:{xs:"h4.fontSize",lg:45}},children:l})]})},cardList:C.CardList=({children:r,className:n,sx:i=[],...a})=>{const{cardList:c=[]}=w(y(),a),l=r?x.toArray(r):c;return e(s,{direction:{xs:"column",lg:"row"},spacing:0,className:v("nbb-how-to-use-card-list",n),sx:[{alignItems:{xs:"center",lg:"stretch"},justifyContent:"center"},...Array.isArray(i)?i:[i]],...O(a,...f),children:l.reduce((r,n,s)=>[...r,...s>0?[e(t,{sx:{display:{xs:"none",lg:"initial"},fontSize:40,color:"primary.main",alignSelf:"center"}},`right-arrow-${s}`),e(o,{sx:{display:{xs:"initial",lg:"none"},fontSize:40,color:"primary.main",alignSelf:"center"}},`down-arrow-${s}`)]:[],n],[])})},card:C.Card=({children:r,className:t,icon:o,headerContent:l,sx:d=[],...h})=>e(a,{component:"article",elevation:0,className:v("nbb-how-to-use-card",t),sx:[{width:"100%",maxWidth:360},...Array.isArray(d)?d:[d]],...h,children:n(c,{component:s,spacing:2,sx:{py:{xs:2,lg:3},px:2.5,alignItems:{xs:"flex-start",lg:"unset"}},children:[n(s,{direction:{xs:"row",lg:"column"},spacing:{xs:2,lg:1},sx:{alignItems:"center",justifyContent:"center",py:.5},children:[o&&e(o,{sx:{color:"primary.main",fontSize:{xs:24,lg:40}}}),e(i,{component:"h6",sx:{typography:{xs:"subtitle1",sm:"h4"},m:0},children:l})]}),e(i,{variant:"body1",sx:{textAlign:"left"},children:r})]})}),footer:C.Footer=({children:r,className:t,sx:o=[],...a})=>{const c=y(),{message:d,linkHref:h,linkContent:m}=w(c,a);return n(s,{spacing:{xs:1.5,sm:2},className:v("nbb-how-to-use-footer",t),sx:[{alignItems:"center"},...Array.isArray(o)?o:[o]],...O(a,...f),children:[d&&e(i,{variant:"body2",sx:{typography:{xs:"subtitle2",sm:"h5"},color:"primary.main"},children:d}),e(l,{href:h,rel:"noreferrer noopener",variant:"contained",size:"large",sx:{width:360,maxWidth:"100%",typography:{xs:"subtitle1",sm:"h5"},px:{sm:4}},children:m})]})}},Object.fromEntries(Object.entries(N).map(([e,r])=>[e,m(r,{key:e})])));var N;export{C as HowToUse};
package/dist/lib.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ComponentProps, FunctionComponent, ReactElement, ReactNode } from 'react';
2
+ import { DistributedOmit } from 'type-fest';
2
3
  /**
3
4
  * The function to be passed into a block component as `children` to selectively override default blocks, or just a `ReactNode`.
4
5
  *
@@ -72,12 +73,46 @@ export declare function BlocksOverrideComponent<DefaultBlocks extends Record<str
72
73
  blockOrder: readonly (keyof DefaultBlocks | keyof CustomBlocks)[];
73
74
  }) => ReactNode;
74
75
  }): ReactNode;
75
- type MergeKeepingRequired<A, B> = Omit<A, keyof B> & {
76
- [K in keyof A & keyof B]-?: undefined extends B[K] ? A[K] : B[K];
76
+ type IsOptionalKey<T, K extends keyof T> = {} extends Pick<T, K> ? true : false;
77
+ type MergeKeepingRequired<A extends Record<PropertyKey, any>, B extends Record<PropertyKey, any>> = DistributedOmit<A, keyof B> & DistributedOmit<B, keyof A> & {
78
+ [K in keyof A & keyof B as IsOptionalKey<A, K> extends true ? IsOptionalKey<B, K> extends true ? never : K : K]-?: IsOptionalKey<B, K> extends true ? A[K] | Required<B>[K] : B[K];
77
79
  } & {
78
- [K in Exclude<keyof B, keyof A>]: B[K];
80
+ [K in keyof A & keyof B as IsOptionalKey<A, K> extends true ? IsOptionalKey<B, K> extends true ? K : never : never]?: A[K] | Required<B>[K];
79
81
  };
80
- export declare function merge<A extends Record<PropertyKey, any>, B extends Record<PropertyKey, any>>(a: A, b: B): MergeKeepingRequired<A, B>;
82
+ /**
83
+ * Shallow merges `target` and `source`, prioritizing `source`.
84
+ *
85
+ * ⚠️ Keeps keys from `target` that don't exist in `source`.
86
+ */
87
+ export declare function merge<A extends Record<PropertyKey, any>, B extends Record<PropertyKey, any>>(target: A, source: B): MergeKeepingRequired<A, B>;
88
+ type PlainObject = Record<PropertyKey, unknown>;
89
+ type Simplify<T> = {
90
+ [K in keyof T]: T[K];
91
+ } & {};
92
+ type MergeDeepValueKeepingRequired<A, B> = [NonNullable<A>, NonNullable<B>] extends [PlainObject, PlainObject] ? MergeDeepKeepingRequired<Extract<NonNullable<A>, PlainObject>, Extract<NonNullable<B>, PlainObject>> : B;
93
+ type MergeValueAtKey<A extends PlainObject, B extends PlainObject, K extends keyof A | keyof B> = K extends keyof B ? K extends keyof A ? IsOptionalKey<B, K> extends true ? A[K] | MergeDeepValueKeepingRequired<A[K], Required<B>[K]> : MergeDeepValueKeepingRequired<A[K], B[K]> : B[K] : K extends keyof A ? A[K] : never;
94
+ /**
95
+ * This is the "readable" view:
96
+ * every possible key is present at least optionally,
97
+ * so generic indexing works.
98
+ */
99
+ type MergeReadableView<A extends PlainObject, B extends PlainObject> = {
100
+ [K in keyof A | keyof B]?: MergeValueAtKey<A, B, K>;
101
+ };
102
+ /**
103
+ * This is your original precise required/optional logic.
104
+ */
105
+ type MergePrecise<A extends PlainObject, B extends PlainObject> = Omit<A, keyof B> & Omit<B, keyof A> & {
106
+ [K in keyof A & keyof B as IsOptionalKey<A, K> extends true ? IsOptionalKey<B, K> extends true ? never : K : K]-?: IsOptionalKey<B, K> extends true ? A[K] | MergeDeepValueKeepingRequired<A[K], Required<B>[K]> : MergeDeepValueKeepingRequired<A[K], B[K]>;
107
+ } & {
108
+ [K in keyof A & keyof B as IsOptionalKey<A, K> extends true ? IsOptionalKey<B, K> extends true ? K : never : never]?: A[K] | MergeDeepValueKeepingRequired<A[K], Required<B>[K]>;
109
+ };
110
+ type MergeDeepKeepingRequired<A extends PlainObject, B extends PlainObject> = Simplify<MergePrecise<A, B> & MergeReadableView<A, B>>;
111
+ /**
112
+ * Deep merges `target` and `source`, prioritizing `source`.
113
+ * Replaces arrays. Returns a new object.
114
+ */
115
+ export declare function deepMerge<T extends PlainObject, U extends PlainObject>(target: T, source: U): MergeDeepKeepingRequired<T, U>;
81
116
  type ClassName = string | ClassName[] | undefined | null;
82
117
  /**
83
118
  * Utility function to join class names together, ignoring undefined or nil values.
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,C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IAAI,QAAQ,CACpF,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAC7C,CAAC;AAMF;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,WAAW,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAczE,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,CAChD;AAED,KAAK,SAAS,GAAG,MAAM,GAAG,SAAS,EAAE,GAAG,SAAS,GAAG,IAAI,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,CAAC,IAAI,SAAS,SAAS,MAAM,EAAE,EACzE,MAAM,EAAE,CAAC,EACT,GAAG,IAAI,EAAE,IAAI,GACZ,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,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,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodeblocks/frontend-how-to-use-block",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",
@@ -42,5 +42,8 @@
42
42
  "rollup-plugin-serve": "^1.1.1",
43
43
  "tslib": "^2.8.1",
44
44
  "typescript": "^5.7.2"
45
+ },
46
+ "dependencies": {
47
+ "type-fest": "^5.4.4"
45
48
  }
46
49
  }