@nodeblocks/frontend-breadcrumb-block 0.2.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/Breadcrumb.d.ts +6 -11
- package/dist/Breadcrumb.d.ts.map +1 -1
- package/dist/blocks.d.ts +2 -3
- package/dist/blocks.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -136
- package/dist/index.esm.js +1 -134
- package/dist/lib.d.ts +19 -3
- package/dist/lib.d.ts.map +1 -1
- package/package.json +23 -15
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js.map +0 -1
package/dist/Breadcrumb.d.ts
CHANGED
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import './breadcrumb.css';
|
|
4
|
-
import { BlocksOverride } from './lib';
|
|
5
1
|
import { BreadcrumbsProps } from '@mui/material';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
import { BlocksOverride } from './lib';
|
|
6
4
|
declare const Breadcrumb: {
|
|
7
|
-
<CustomBlocks extends Record<string, ReactNode>>({
|
|
5
|
+
<CustomBlocks extends Record<string, ReactNode>>({ maxItems, itemsBeforeCollapse, itemsAfterCollapse, className, children, sx, ...props }: {
|
|
8
6
|
children?: BlocksOverride<typeof defaultBlocks, CustomBlocks>;
|
|
9
7
|
} & Omit<BreadcrumbsProps, "children">): import("react/jsx-runtime").JSX.Element;
|
|
10
8
|
BreadcrumbChevron: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
BreadcrumbItem: ({ url, children, }:
|
|
9
|
+
BreadcrumbItem: ({ component, sx, url, children, ...props }: Partial<import("@mui/material").LinkProps> & {
|
|
12
10
|
url: string;
|
|
13
|
-
children: ReactNode;
|
|
14
11
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
15
12
|
};
|
|
16
13
|
declare const defaultBlocks: {
|
|
17
14
|
breadcrumbChevron: React.ReactElement<unknown, () => import("react/jsx-runtime").JSX.Element>;
|
|
18
|
-
breadcrumbItem: React.ReactElement<
|
|
15
|
+
breadcrumbItem: React.ReactElement<Partial<import("@mui/material").LinkProps> & {
|
|
19
16
|
url: string;
|
|
20
|
-
|
|
21
|
-
}, ({ url, children, }: Omit<ComponentProps<"a">, "children"> & {
|
|
17
|
+
}, ({ component, sx, url, children, ...props }: Partial<import("@mui/material").LinkProps> & {
|
|
22
18
|
url: string;
|
|
23
|
-
children: ReactNode;
|
|
24
19
|
}) => import("react/jsx-runtime").JSX.Element>;
|
|
25
20
|
};
|
|
26
21
|
export default Breadcrumb;
|
package/dist/Breadcrumb.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../src/Breadcrumb.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../src/Breadcrumb.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,cAAc,EAA4D,MAAM,OAAO,CAAC;AAEjG,QAAA,MAAM,UAAU;KAAI,YAAY,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,4FAQ/D;QACD,QAAQ,CAAC,EAAE,cAAc,CAAC,OAAO,aAAa,EAAE,YAAY,CAAC,CAAC;KAC/D,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC;;;;;CAqDrC,CAAC;AAKF,QAAA,MAAM,aAAa;;;;;;;CAGjB,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
package/dist/blocks.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const BreadcrumbItem: ({ url, children, }:
|
|
1
|
+
import { LinkProps } from '@mui/material';
|
|
2
|
+
export declare const BreadcrumbItem: ({ component, sx, url, children, ...props }: Partial<LinkProps> & {
|
|
3
3
|
url: string;
|
|
4
|
-
children: ReactNode;
|
|
5
4
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export declare const BreadcrumbChevron: () => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
//# sourceMappingURL=blocks.d.ts.map
|
package/dist/blocks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../src/blocks.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../src/blocks.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,SAAS,EAAqB,MAAM,eAAe,CAAC;AAEnE,eAAO,MAAM,cAAc,GAAI,4CAM5B,OAAO,CAAC,SAAS,CAAC,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;CACb,4CAeA,CAAC;AAEF,eAAO,MAAM,iBAAiB,+CAW7B,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,136 +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
|
-
var material = require('@mui/material');
|
|
12
|
-
|
|
13
|
-
const BreadcrumbItem = ({ url, children, }) => {
|
|
14
|
-
const theme = material.useTheme();
|
|
15
|
-
return (
|
|
16
|
-
// TODO: this is hardcoded for now until we setup the theme - then go back and use variables from the theme
|
|
17
|
-
jsxRuntime.jsx(material.Link, { underline: "hover", color: "inherit", href: url, fontSize: theme.typography.caption.fontSize, fontWeight: theme.typography.caption.fontWeight, children: children }));
|
|
18
|
-
};
|
|
19
|
-
const BreadcrumbChevron = () => {
|
|
20
|
-
const theme = material.useTheme();
|
|
21
|
-
return (
|
|
22
|
-
// TODO: this is hardcoded for now until we setup the theme - then go back and use variables from the theme
|
|
23
|
-
jsxRuntime.jsx(material.SvgIcon, { sx: { fontSize: theme.typography.caption.fontSize, color: theme.palette.primary.contrastText }, viewBox: "0 0 8 12", children: jsxRuntime.jsx("path", { d: "M0.294922 10.59L4.87492 6L0.294922 1.41L1.70492 0L7.70492 6L1.70492 12L0.294922 10.59Z" }) }));
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
function styleInject(css, ref) {
|
|
27
|
-
if ( ref === void 0 ) ref = {};
|
|
28
|
-
var insertAt = ref.insertAt;
|
|
29
|
-
|
|
30
|
-
if (typeof document === 'undefined') { return; }
|
|
31
|
-
|
|
32
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
33
|
-
var style = document.createElement('style');
|
|
34
|
-
style.type = 'text/css';
|
|
35
|
-
|
|
36
|
-
if (insertAt === 'top') {
|
|
37
|
-
if (head.firstChild) {
|
|
38
|
-
head.insertBefore(style, head.firstChild);
|
|
39
|
-
} else {
|
|
40
|
-
head.appendChild(style);
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
head.appendChild(style);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (style.styleSheet) {
|
|
47
|
-
style.styleSheet.cssText = css;
|
|
48
|
-
} else {
|
|
49
|
-
style.appendChild(document.createTextNode(css));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
var css_248z = ".nbb-breadcrumb.MuiBreadcrumbs-root {\n padding: calc(var(--mui-spacing) * 1.5) calc(var(--mui-spacing) * 2);\n background-color: var(--mui-palette-primary-main);\n color: var(--mui-palette-primary-contrastText);\n border-bottom: 1px solid rgba(255, 255, 255, 0.2);\n}\n\n.nbb-breadcrumb .MuiBreadcrumbs-ol {\n gap: var(--mui-spacing);\n}\n\n.nbb-breadcrumb .MuiBreadcrumbs-li {\n display: flex;\n align-items: center;\n gap: var(--mui-spacing);\n}\n\n.nbb-breadcrumb .MuiBreadcrumbs-separator {\n display: none;\n}\n";
|
|
54
|
-
styleInject(css_248z);
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Creates a strongly typed `defaultBlocks` object, allowing for types to propagate into block override objects.
|
|
58
|
-
*
|
|
59
|
-
* @param components - A map of default block keys to component functions.
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* const defaultBlocks = createDefaultBlocks({
|
|
63
|
-
* title: Title,
|
|
64
|
-
* description: Description,
|
|
65
|
-
* form: Form,
|
|
66
|
-
* });
|
|
67
|
-
*/
|
|
68
|
-
function createDefaultBlocks(components) {
|
|
69
|
-
return Object.fromEntries(Object.entries(components).map(([key, Component]) => [key, React.createElement(Component, { key })]));
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* A component for rendering {@link BlocksOverride|`BlocksOverride`} results.
|
|
73
|
-
* Exposes the evaluated `blocks` and `blockOrder` as arguments to the `children` function.
|
|
74
|
-
*
|
|
75
|
-
* @param props
|
|
76
|
-
* @param props.blocksOverride - The {@link BlocksOverride|`BlocksOverride`} (i.e. `children` of outer component).
|
|
77
|
-
* @param props.defaultBlocks - The default blocks of outer component.
|
|
78
|
-
* @param props.children - A function returning the JSX to render.
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* <BlocksOverrideComponent
|
|
82
|
-
* defaultBlocks={defaultFormBlocks}
|
|
83
|
-
* blocksOverride={children}
|
|
84
|
-
* >
|
|
85
|
-
* {({ blocks, blockOrder }) =>
|
|
86
|
-
* blockOrder.map((key) => (
|
|
87
|
-
* <Fragment key={String(key)}>{blocks[key]}</Fragment>
|
|
88
|
-
* ))
|
|
89
|
-
* }
|
|
90
|
-
* </BlocksOverrideComponent>
|
|
91
|
-
*/
|
|
92
|
-
function BlocksOverrideComponent({ blocksOverride, defaultBlocks, defaultBlockOrder, children, }) {
|
|
93
|
-
// 1. standard "default" block use with no customization
|
|
94
|
-
if (blocksOverride === undefined) {
|
|
95
|
-
return children({
|
|
96
|
-
// TODO: Remove this assertion
|
|
97
|
-
blocks: defaultBlocks,
|
|
98
|
-
blockOrder: defaultBlockOrder,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
// 2.when user uses "child function" customization pattern, that returns the "override" object of blocks/blockOrder
|
|
102
|
-
if (typeof blocksOverride === 'function') {
|
|
103
|
-
const { blocks, blockOrder } = blocksOverride({
|
|
104
|
-
defaultBlocks,
|
|
105
|
-
defaultBlockOrder,
|
|
106
|
-
});
|
|
107
|
-
return children({ blocks, blockOrder });
|
|
108
|
-
}
|
|
109
|
-
// 3. when user uses "compound components" customization pattern, passing in their own chosen elements
|
|
110
|
-
return blocksOverride;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
const Breadcrumb = ({ children, maxItems = 8, itemsBeforeCollapse = 1, itemsAfterCollapse = 1, ...breadcrumbsProps }) => {
|
|
114
|
-
return (jsxRuntime.jsx(material.Breadcrumbs, { ...breadcrumbsProps, className: "nbb-breadcrumb", "aria-label": "breadcrumb", maxItems: maxItems, itemsBeforeCollapse: itemsBeforeCollapse, itemsAfterCollapse: itemsAfterCollapse, children: BlocksOverrideComponent({
|
|
115
|
-
defaultBlocks: defaultBlocks,
|
|
116
|
-
defaultBlockOrder: Object.keys(defaultBlocks),
|
|
117
|
-
blocksOverride: children,
|
|
118
|
-
children: ({ blocks: { breadcrumbChevron, breadcrumbItem, ...blocks }, blockOrder }) => blockOrder
|
|
119
|
-
.filter((key) => key in blocks)
|
|
120
|
-
.map((key, index) => {
|
|
121
|
-
return (
|
|
122
|
-
// NOTE: the contents of this "children" property is only used for/rendered in the override child function "override" pattern
|
|
123
|
-
// for this to work, the user should pass in breadcrumbItem (or equivalent), and shouldn't pass in the breadcrumbChevron element to the blocks override object (since we append it here)
|
|
124
|
-
jsxRuntime.jsxs(React.Fragment, { children: [index > 0 && breadcrumbChevron, blocks[key]] }, `${index}-breadcrumb`));
|
|
125
|
-
}),
|
|
126
|
-
}) }));
|
|
127
|
-
};
|
|
128
|
-
Breadcrumb.BreadcrumbChevron = BreadcrumbChevron;
|
|
129
|
-
Breadcrumb.BreadcrumbItem = BreadcrumbItem;
|
|
130
|
-
const defaultBlocks = createDefaultBlocks({
|
|
131
|
-
breadcrumbChevron: BreadcrumbChevron,
|
|
132
|
-
breadcrumbItem: BreadcrumbItem,
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
exports.Breadcrumbs = Breadcrumb;
|
|
136
|
-
//# sourceMappingURL=index.cjs.js.map
|
|
1
|
+
"use strict";var r=require("react/jsx-runtime"),e=require("@mui/material"),t=require("react");const a=({component:t="a",sx:a,url:o,children:c,...l})=>r.jsx(e.Link,{underline:"hover",color:"inherit",href:o,sx:[r=>({fontSize:r.typography.caption.fontSize,fontWeight:r.typography.caption.fontWeight}),...Array.isArray(a)?a:[a]],...l,children:c}),o=()=>{const t=e.useTheme();return r.jsx(e.SvgIcon,{sx:{fontSize:t.typography.caption.fontSize,color:t.palette.primary.contrastText},viewBox:"0 0 8 12",children:r.jsx("path",{d:"M0.294922 10.59L4.87492 6L0.294922 1.41L1.70492 0L7.70492 6L1.70492 12L0.294922 10.59Z"})})};function c({blocksOverride:r,defaultBlocks:e,defaultBlockOrder:t,children:a}){if(void 0===r)return a({blocks:e,blockOrder:t});if("function"==typeof r){const{blocks:o,blockOrder:c}=r({defaultBlocks:e,defaultBlockOrder:t});return a({blocks:o,blockOrder:c})}return r}function l(...r){return r.flat().filter(Boolean).join(" ")}const i=({maxItems:a=8,itemsBeforeCollapse:o=1,itemsAfterCollapse:i=1,className:n,children:m,sx:d,...u})=>r.jsx(e.Breadcrumbs,{className:l("nbb-breadcrumb",n),"aria-label":"breadcrumb",maxItems:a,itemsBeforeCollapse:o,itemsAfterCollapse:i,sx:[r=>({py:1.5,px:2,bgcolor:"primary.main",color:"primary.contrastText",borderBottom:e.alpha(r.palette.primary.contrastText,.2),"& .MuiBreadcrumbs-ol":{gap:1},"& .MuiBreadcrumbs-li":{display:"flex",alignItems:"center",gap:1},"& .MuiBreadcrumbs-separator":{display:"none"}}),...Array.isArray(d)?d:[d]],...u,children:r.jsx(c,{defaultBlocks:s,defaultBlockOrder:Object.keys(s),blocksOverride:m,children:({blocks:{breadcrumbChevron:e,breadcrumbItem:a,...o},blockOrder:c})=>c.filter(r=>r in o).map((a,c)=>r.jsxs(t.Fragment,{children:[c>0&&e,o[a]]},`${c}-breadcrumb`))})});i.BreadcrumbChevron=o,i.BreadcrumbItem=a;const s=(n={breadcrumbChevron:o,breadcrumbItem:a},Object.fromEntries(Object.entries(n).map(([r,e])=>[r,t.createElement(e,{key:r})])));var n;exports.Breadcrumbs=i;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,134 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof global === 'undefined') {
|
|
4
|
-
var global = window;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
|
-
import React, { createElement } from 'react';
|
|
9
|
-
import { useTheme, SvgIcon, Link, Breadcrumbs } from '@mui/material';
|
|
10
|
-
|
|
11
|
-
const BreadcrumbItem = ({ url, children, }) => {
|
|
12
|
-
const theme = useTheme();
|
|
13
|
-
return (
|
|
14
|
-
// TODO: this is hardcoded for now until we setup the theme - then go back and use variables from the theme
|
|
15
|
-
jsx(Link, { underline: "hover", color: "inherit", href: url, fontSize: theme.typography.caption.fontSize, fontWeight: theme.typography.caption.fontWeight, children: children }));
|
|
16
|
-
};
|
|
17
|
-
const BreadcrumbChevron = () => {
|
|
18
|
-
const theme = useTheme();
|
|
19
|
-
return (
|
|
20
|
-
// TODO: this is hardcoded for now until we setup the theme - then go back and use variables from the theme
|
|
21
|
-
jsx(SvgIcon, { sx: { fontSize: theme.typography.caption.fontSize, color: theme.palette.primary.contrastText }, viewBox: "0 0 8 12", children: jsx("path", { d: "M0.294922 10.59L4.87492 6L0.294922 1.41L1.70492 0L7.70492 6L1.70492 12L0.294922 10.59Z" }) }));
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
function styleInject(css, ref) {
|
|
25
|
-
if ( ref === void 0 ) ref = {};
|
|
26
|
-
var insertAt = ref.insertAt;
|
|
27
|
-
|
|
28
|
-
if (typeof document === 'undefined') { return; }
|
|
29
|
-
|
|
30
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
31
|
-
var style = document.createElement('style');
|
|
32
|
-
style.type = 'text/css';
|
|
33
|
-
|
|
34
|
-
if (insertAt === 'top') {
|
|
35
|
-
if (head.firstChild) {
|
|
36
|
-
head.insertBefore(style, head.firstChild);
|
|
37
|
-
} else {
|
|
38
|
-
head.appendChild(style);
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
head.appendChild(style);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (style.styleSheet) {
|
|
45
|
-
style.styleSheet.cssText = css;
|
|
46
|
-
} else {
|
|
47
|
-
style.appendChild(document.createTextNode(css));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
var css_248z = ".nbb-breadcrumb.MuiBreadcrumbs-root {\n padding: calc(var(--mui-spacing) * 1.5) calc(var(--mui-spacing) * 2);\n background-color: var(--mui-palette-primary-main);\n color: var(--mui-palette-primary-contrastText);\n border-bottom: 1px solid rgba(255, 255, 255, 0.2);\n}\n\n.nbb-breadcrumb .MuiBreadcrumbs-ol {\n gap: var(--mui-spacing);\n}\n\n.nbb-breadcrumb .MuiBreadcrumbs-li {\n display: flex;\n align-items: center;\n gap: var(--mui-spacing);\n}\n\n.nbb-breadcrumb .MuiBreadcrumbs-separator {\n display: none;\n}\n";
|
|
52
|
-
styleInject(css_248z);
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Creates a strongly typed `defaultBlocks` object, allowing for types to propagate into block override objects.
|
|
56
|
-
*
|
|
57
|
-
* @param components - A map of default block keys to component functions.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* const defaultBlocks = createDefaultBlocks({
|
|
61
|
-
* title: Title,
|
|
62
|
-
* description: Description,
|
|
63
|
-
* form: Form,
|
|
64
|
-
* });
|
|
65
|
-
*/
|
|
66
|
-
function createDefaultBlocks(components) {
|
|
67
|
-
return Object.fromEntries(Object.entries(components).map(([key, Component]) => [key, createElement(Component, { key })]));
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* A component for rendering {@link BlocksOverride|`BlocksOverride`} results.
|
|
71
|
-
* Exposes the evaluated `blocks` and `blockOrder` as arguments to the `children` function.
|
|
72
|
-
*
|
|
73
|
-
* @param props
|
|
74
|
-
* @param props.blocksOverride - The {@link BlocksOverride|`BlocksOverride`} (i.e. `children` of outer component).
|
|
75
|
-
* @param props.defaultBlocks - The default blocks of outer component.
|
|
76
|
-
* @param props.children - A function returning the JSX to render.
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* <BlocksOverrideComponent
|
|
80
|
-
* defaultBlocks={defaultFormBlocks}
|
|
81
|
-
* blocksOverride={children}
|
|
82
|
-
* >
|
|
83
|
-
* {({ blocks, blockOrder }) =>
|
|
84
|
-
* blockOrder.map((key) => (
|
|
85
|
-
* <Fragment key={String(key)}>{blocks[key]}</Fragment>
|
|
86
|
-
* ))
|
|
87
|
-
* }
|
|
88
|
-
* </BlocksOverrideComponent>
|
|
89
|
-
*/
|
|
90
|
-
function BlocksOverrideComponent({ blocksOverride, defaultBlocks, defaultBlockOrder, children, }) {
|
|
91
|
-
// 1. standard "default" block use with no customization
|
|
92
|
-
if (blocksOverride === undefined) {
|
|
93
|
-
return children({
|
|
94
|
-
// TODO: Remove this assertion
|
|
95
|
-
blocks: defaultBlocks,
|
|
96
|
-
blockOrder: defaultBlockOrder,
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
// 2.when user uses "child function" customization pattern, that returns the "override" object of blocks/blockOrder
|
|
100
|
-
if (typeof blocksOverride === 'function') {
|
|
101
|
-
const { blocks, blockOrder } = blocksOverride({
|
|
102
|
-
defaultBlocks,
|
|
103
|
-
defaultBlockOrder,
|
|
104
|
-
});
|
|
105
|
-
return children({ blocks, blockOrder });
|
|
106
|
-
}
|
|
107
|
-
// 3. when user uses "compound components" customization pattern, passing in their own chosen elements
|
|
108
|
-
return blocksOverride;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const Breadcrumb = ({ children, maxItems = 8, itemsBeforeCollapse = 1, itemsAfterCollapse = 1, ...breadcrumbsProps }) => {
|
|
112
|
-
return (jsx(Breadcrumbs, { ...breadcrumbsProps, className: "nbb-breadcrumb", "aria-label": "breadcrumb", maxItems: maxItems, itemsBeforeCollapse: itemsBeforeCollapse, itemsAfterCollapse: itemsAfterCollapse, children: BlocksOverrideComponent({
|
|
113
|
-
defaultBlocks: defaultBlocks,
|
|
114
|
-
defaultBlockOrder: Object.keys(defaultBlocks),
|
|
115
|
-
blocksOverride: children,
|
|
116
|
-
children: ({ blocks: { breadcrumbChevron, breadcrumbItem, ...blocks }, blockOrder }) => blockOrder
|
|
117
|
-
.filter((key) => key in blocks)
|
|
118
|
-
.map((key, index) => {
|
|
119
|
-
return (
|
|
120
|
-
// NOTE: the contents of this "children" property is only used for/rendered in the override child function "override" pattern
|
|
121
|
-
// for this to work, the user should pass in breadcrumbItem (or equivalent), and shouldn't pass in the breadcrumbChevron element to the blocks override object (since we append it here)
|
|
122
|
-
jsxs(React.Fragment, { children: [index > 0 && breadcrumbChevron, blocks[key]] }, `${index}-breadcrumb`));
|
|
123
|
-
}),
|
|
124
|
-
}) }));
|
|
125
|
-
};
|
|
126
|
-
Breadcrumb.BreadcrumbChevron = BreadcrumbChevron;
|
|
127
|
-
Breadcrumb.BreadcrumbItem = BreadcrumbItem;
|
|
128
|
-
const defaultBlocks = createDefaultBlocks({
|
|
129
|
-
breadcrumbChevron: BreadcrumbChevron,
|
|
130
|
-
breadcrumbItem: BreadcrumbItem,
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
export { Breadcrumb as Breadcrumbs };
|
|
134
|
-
//# sourceMappingURL=index.esm.js.map
|
|
1
|
+
import{jsx as r,jsxs as e}from"react/jsx-runtime";import{Link as t,useTheme as o,SvgIcon as a,Breadcrumbs as c,alpha as l}from"@mui/material";import i,{createElement as n}from"react";const s=({component:e="a",sx:o,url:a,children:c,...l})=>r(t,{underline:"hover",color:"inherit",href:a,sx:[r=>({fontSize:r.typography.caption.fontSize,fontWeight:r.typography.caption.fontWeight}),...Array.isArray(o)?o:[o]],...l,children:c}),m=()=>{const e=o();return r(a,{sx:{fontSize:e.typography.caption.fontSize,color:e.palette.primary.contrastText},viewBox:"0 0 8 12",children:r("path",{d:"M0.294922 10.59L4.87492 6L0.294922 1.41L1.70492 0L7.70492 6L1.70492 12L0.294922 10.59Z"})})};function d({blocksOverride:r,defaultBlocks:e,defaultBlockOrder:t,children:o}){if(void 0===r)return o({blocks:e,blockOrder:t});if("function"==typeof r){const{blocks:a,blockOrder:c}=r({defaultBlocks:e,defaultBlockOrder:t});return o({blocks:a,blockOrder:c})}return r}function b(...r){return r.flat().filter(Boolean).join(" ")}const p=({maxItems:t=8,itemsBeforeCollapse:o=1,itemsAfterCollapse:a=1,className:n,children:s,sx:m,...p})=>r(c,{className:b("nbb-breadcrumb",n),"aria-label":"breadcrumb",maxItems:t,itemsBeforeCollapse:o,itemsAfterCollapse:a,sx:[r=>({py:1.5,px:2,bgcolor:"primary.main",color:"primary.contrastText",borderBottom:l(r.palette.primary.contrastText,.2),"& .MuiBreadcrumbs-ol":{gap:1},"& .MuiBreadcrumbs-li":{display:"flex",alignItems:"center",gap:1},"& .MuiBreadcrumbs-separator":{display:"none"}}),...Array.isArray(m)?m:[m]],...p,children:r(d,{defaultBlocks:u,defaultBlockOrder:Object.keys(u),blocksOverride:s,children:({blocks:{breadcrumbChevron:r,breadcrumbItem:t,...o},blockOrder:a})=>a.filter(r=>r in o).map((t,a)=>e(i.Fragment,{children:[a>0&&r,o[t]]},`${a}-breadcrumb`))})});p.BreadcrumbChevron=m,p.BreadcrumbItem=s;const u=(f={breadcrumbChevron:m,breadcrumbItem:s},Object.fromEntries(Object.entries(f).map(([r,e])=>[r,n(e,{key:r})])));var f;export{p as Breadcrumbs};
|
package/dist/lib.d.ts
CHANGED
|
@@ -72,10 +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
|
-
type
|
|
76
|
-
[K in keyof
|
|
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];
|
|
77
79
|
};
|
|
78
|
-
export declare function
|
|
80
|
+
export declare function merge<A extends Record<PropertyKey, any>, B extends Record<PropertyKey, any>>(a: A, b: B): MergeKeepingRequired<A, B>;
|
|
79
81
|
type ClassName = string | ClassName[] | undefined | null;
|
|
80
82
|
/**
|
|
81
83
|
* Utility function to join class names together, ignoring undefined or nil values.
|
|
@@ -83,5 +85,19 @@ type ClassName = string | ClassName[] | undefined | null;
|
|
|
83
85
|
* @returns The joined class names.
|
|
84
86
|
*/
|
|
85
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>>;
|
|
86
102
|
export {};
|
|
87
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,CAAC,EAClF,UAAU,EAAE,CAAC,GACZ;KACA,CAAC,IAAI,MAAM,CAAC,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CACzD,CAMA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EAC/C,YAAY,SAAS,M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W,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,EAC1F,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,GACH,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAQ5B;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,35 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nodeblocks/frontend-breadcrumb-block",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"main": "dist/index.cjs.js",
|
|
5
|
-
"module": "dist/index.esm.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
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": "rm -rf dist && cross-env NODE_ENV=development 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 <20",
|
|
18
|
-
"react-dom": ">=18 <20",
|
|
19
|
-
"@mui/material": "^7.3.4",
|
|
20
25
|
"@emotion/react": "^11.14.0",
|
|
21
|
-
"@emotion/styled": "^11.14.1"
|
|
26
|
+
"@emotion/styled": "^11.14.1",
|
|
27
|
+
"@mui/material": "^7.3.4",
|
|
28
|
+
"react": ">=18 <20",
|
|
29
|
+
"react-dom": ">=18 <20"
|
|
22
30
|
},
|
|
23
31
|
"devDependencies": {
|
|
24
32
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
25
33
|
"@rollup/plugin-json": "^6.1.0",
|
|
26
34
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
35
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
27
36
|
"@rollup/plugin-typescript": "^12.1.1",
|
|
28
37
|
"@types/react": "19.2.7",
|
|
29
38
|
"@types/react-dom": "19.2.3",
|
|
30
|
-
"rollup": "^4.
|
|
39
|
+
"rollup": "^4.55.1",
|
|
31
40
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
32
|
-
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
33
41
|
"rollup-plugin-postcss": "^4.0.2",
|
|
34
42
|
"rollup-plugin-serve": "^1.1.1",
|
|
35
43
|
"tslib": "^2.8.1",
|
package/dist/index.cjs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/blocks.tsx","../node_modules/style-inject/dist/style-inject.es.js","../src/lib.ts","../src/Breadcrumb.tsx"],"sourcesContent":["import { ComponentProps, ReactNode } from 'react';\nimport { Link, SvgIcon, useTheme } from '@mui/material';\n\nexport const BreadcrumbItem = ({\n url,\n children,\n}: Omit<ComponentProps<'a'>, 'children'> & {\n url: string;\n children: ReactNode;\n}) => {\n const theme = useTheme();\n return (\n // TODO: this is hardcoded for now until we setup the theme - then go back and use variables from the theme\n <Link\n underline=\"hover\"\n color=\"inherit\"\n href={url}\n fontSize={theme.typography.caption.fontSize}\n fontWeight={theme.typography.caption.fontWeight}\n >\n {children}\n </Link>\n );\n};\n\nexport const BreadcrumbChevron = () => {\n const theme = useTheme();\n return (\n // TODO: this is hardcoded for now until we setup the theme - then go back and use variables from the theme\n <SvgIcon\n sx={{ fontSize: theme.typography.caption.fontSize, color: theme.palette.primary.contrastText }}\n viewBox=\"0 0 8 12\"\n >\n <path d=\"M0.294922 10.59L4.87492 6L0.294922 1.41L1.70492 0L7.70492 6L1.70492 12L0.294922 10.59Z\" />\n </SvgIcon>\n );\n};\n","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 // 1. standard \"default\" block use with no customization\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 // 2.when user uses \"child function\" customization pattern, that returns the \"override\" object of blocks/blockOrder\n if (typeof blocksOverride === 'function') {\n const { blocks, blockOrder } = blocksOverride({\n defaultBlocks,\n defaultBlockOrder,\n });\n\n return children({ blocks, blockOrder });\n }\n\n // 3. when user uses \"compound components\" customization pattern, passing in their own chosen elements\n return blocksOverride;\n}\n\ntype MergeTypes<Object1, Object2> = {\n [K in keyof Object1 | keyof Object2]: K extends keyof Object1\n ? Object1[K]\n : K extends keyof Object2\n ? Object2[K]\n : never;\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 MergeTypes<B, A>;\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 { ComponentProps, ReactNode } from 'react';\nimport React from 'react';\nimport { BreadcrumbChevron, BreadcrumbItem } from './blocks';\nimport './breadcrumb.css';\nimport { BlocksOverride, BlocksOverrideComponent, createDefaultBlocks } from './lib';\nimport { Breadcrumbs, BreadcrumbsProps } from '@mui/material';\n\nconst Breadcrumb = <CustomBlocks extends Record<string, ReactNode>>({\n children,\n maxItems = 8,\n itemsBeforeCollapse = 1,\n itemsAfterCollapse = 1,\n ...breadcrumbsProps\n}: {\n children?: BlocksOverride<typeof defaultBlocks, CustomBlocks>;\n} & Omit<BreadcrumbsProps, 'children'>) => {\n return (\n <Breadcrumbs\n {...breadcrumbsProps}\n className=\"nbb-breadcrumb\"\n aria-label=\"breadcrumb\"\n maxItems={maxItems}\n itemsBeforeCollapse={itemsBeforeCollapse}\n itemsAfterCollapse={itemsAfterCollapse}\n >\n {BlocksOverrideComponent({\n defaultBlocks: defaultBlocks,\n defaultBlockOrder: Object.keys(defaultBlocks) as (keyof typeof defaultBlocks)[],\n blocksOverride: children,\n children: ({ blocks: { breadcrumbChevron, breadcrumbItem, ...blocks }, blockOrder }) =>\n blockOrder\n .filter((key) => key in blocks)\n .map<ReactNode>((key, index) => {\n return (\n // NOTE: the contents of this \"children\" property is only used for/rendered in the override child function \"override\" pattern\n // for this to work, the user should pass in breadcrumbItem (or equivalent), and shouldn't pass in the breadcrumbChevron element to the blocks override object (since we append it here)\n <React.Fragment key={`${index}-breadcrumb`}>\n {index > 0 && breadcrumbChevron}\n {blocks[key]}\n </React.Fragment>\n );\n }),\n })}\n </Breadcrumbs>\n );\n};\n\nBreadcrumb.BreadcrumbChevron = BreadcrumbChevron;\nBreadcrumb.BreadcrumbItem = BreadcrumbItem;\n\nconst defaultBlocks = createDefaultBlocks({\n breadcrumbChevron: BreadcrumbChevron,\n breadcrumbItem: BreadcrumbItem,\n});\n\nexport default Breadcrumb;\n"],"names":["useTheme","_jsx","Link","SvgIcon","createElement","Breadcrumbs","_jsxs"],"mappings":";;;;;;;;;;;;AAGO,MAAM,cAAc,GAAG,CAAC,EAC7B,GAAG,EACH,QAAQ,GAIT,KAAI;AACH,IAAA,MAAM,KAAK,GAAGA,iBAAQ,EAAE;IACxB;;AAEE,IAAAC,cAAA,CAACC,aAAI,EAAA,EACH,SAAS,EAAC,OAAO,EACjB,KAAK,EAAC,SAAS,EACf,IAAI,EAAE,GAAG,EACT,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,EAC3C,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,YAE9C,QAAQ,EAAA,CACJ;AAEX,CAAC;AAEM,MAAM,iBAAiB,GAAG,MAAK;AACpC,IAAA,MAAM,KAAK,GAAGF,iBAAQ,EAAE;IACxB;;AAEE,IAAAC,cAAA,CAACE,gBAAO,EAAA,EACN,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,EAC9F,OAAO,EAAC,UAAU,EAAA,QAAA,EAElBF,yBAAM,CAAC,EAAC,wFAAwF,EAAA,CAAG,EAAA,CAC3F;AAEd,CAAC;;ACpCD,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,MAAM,GAAG,GAAG,GAAG,EAAE;AAChC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ;;AAE7B,EAAE,IAAY,OAAO,QA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QAAA,EAAA,CACZ,KAAK,GAAG,CAAC,IAAI,iBAAiB,EAC9B,MAAM,CAAC,GAAG,CAAC,CAAA,EAAA,EAFO,CAAA,EAAG,KAAK,CAAA,WAAA,CAAa,CAGzB;AAErB,YAAA,CAAC,CAAC;SACP,CAAC,EAAA,CACU;AAElB;AAEA,UAAU,CAAC,iBAAiB,GAAG,iBAAiB;AAChD,UAAU,CAAC,cAAc,GAAG,cAAc;AAE1C,MAAM,aAAa,GAAG,mBAAmB,CAAC;AACxC,IAAA,iBAAiB,EAAE,iBAAiB;AACpC,IAAA,cAAc,EAAE,cAAc;AAC/B,CAAA,CAAC;;;;","x_google_ignoreList":[1]}
|
package/dist/index.esm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/blocks.tsx","../node_modules/style-inject/dist/style-inject.es.js","../src/lib.ts","../src/Breadcrumb.tsx"],"sourcesContent":["import { ComponentProps, ReactNode } from 'react';\nimport { Link, SvgIcon, useTheme } from '@mui/material';\n\nexport const BreadcrumbItem = ({\n url,\n children,\n}: Omit<ComponentProps<'a'>, 'children'> & {\n url: string;\n children: ReactNode;\n}) => {\n const theme = useTheme();\n return (\n // TODO: this is hardcoded for now until we setup the theme - then go back and use variables from the theme\n <Link\n underline=\"hover\"\n color=\"inherit\"\n href={url}\n fontSize={theme.typography.caption.fontSize}\n fontWeight={theme.typography.caption.fontWeight}\n >\n {children}\n </Link>\n );\n};\n\nexport const BreadcrumbChevron = () => {\n const theme = useTheme();\n return (\n // TODO: this is hardcoded for now until we setup the theme - then go back and use variables from the theme\n <SvgIcon\n sx={{ fontSize: theme.typography.caption.fontSize, color: theme.palette.primary.contrastText }}\n viewBox=\"0 0 8 12\"\n >\n <path d=\"M0.294922 10.59L4.87492 6L0.294922 1.41L1.70492 0L7.70492 6L1.70492 12L0.294922 10.59Z\" />\n </SvgIcon>\n );\n};\n","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 // 1. standard \"default\" block use with no customization\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 // 2.when user uses \"child function\" customization pattern, that returns the \"override\" object of blocks/blockOrder\n if (typeof blocksOverride === 'function') {\n const { blocks, blockOrder } = blocksOverride({\n defaultBlocks,\n defaultBlockOrder,\n });\n\n return children({ blocks, blockOrder });\n }\n\n // 3. when user uses \"compound components\" customization pattern, passing in their own chosen elements\n return blocksOverride;\n}\n\ntype MergeTypes<Object1, Object2> = {\n [K in keyof Object1 | keyof Object2]: K extends keyof Object1\n ? Object1[K]\n : K extends keyof Object2\n ? Object2[K]\n : never;\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 MergeTypes<B, A>;\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 { ComponentProps, ReactNode } from 'react';\nimport React from 'react';\nimport { BreadcrumbChevron, BreadcrumbItem } from './blocks';\nimport './breadcrumb.css';\nimport { BlocksOverride, BlocksOverrideComponent, createDefaultBlocks } from './lib';\nimport { Breadcrumbs, BreadcrumbsProps } from '@mui/material';\n\nconst Breadcrumb = <CustomBlocks extends Record<string, ReactNode>>({\n children,\n maxItems = 8,\n itemsBeforeCollapse = 1,\n itemsAfterCollapse = 1,\n ...breadcrumbsProps\n}: {\n children?: BlocksOverride<typeof defaultBlocks, CustomBlocks>;\n} & Omit<BreadcrumbsProps, 'children'>) => {\n return (\n <Breadcrumbs\n {...breadcrumbsProps}\n className=\"nbb-breadcrumb\"\n aria-label=\"breadcrumb\"\n maxItems={maxItems}\n itemsBeforeCollapse={itemsBeforeCollapse}\n itemsAfterCollapse={itemsAfterCollapse}\n >\n {BlocksOverrideComponent({\n defaultBlocks: defaultBlocks,\n defaultBlockOrder: Object.keys(defaultBlocks) as (keyof typeof defaultBlocks)[],\n blocksOverride: children,\n children: ({ blocks: { breadcrumbChevron, breadcrumbItem, ...blocks }, blockOrder }) =>\n blockOrder\n .filter((key) => key in blocks)\n .map<ReactNode>((key, index) => {\n return (\n // NOTE: the contents of this \"children\" property is only used for/rendered in the override child function \"override\" pattern\n // for this to work, the user should pass in breadcrumbItem (or equivalent), and shouldn't pass in the breadcrumbChevron element to the blocks override object (since we append it here)\n <React.Fragment key={`${index}-breadcrumb`}>\n {index > 0 && breadcrumbChevron}\n {blocks[key]}\n </React.Fragment>\n );\n }),\n })}\n </Breadcrumbs>\n );\n};\n\nBreadcrumb.BreadcrumbChevron = BreadcrumbChevron;\nBreadcrumb.BreadcrumbItem = BreadcrumbItem;\n\nconst defaultBlocks = createDefaultBlocks({\n breadcrumbChevron: BreadcrumbChevron,\n breadcrumbItem: BreadcrumbItem,\n});\n\nexport default Breadcrumb;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;AAGO,MAAM,cAAc,GAAG,CAAC,EAC7B,GAAG,EACH,QAAQ,GAIT,KAAI;AACH,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;IACxB;;AAEE,IAAAA,GAAA,CAAC,IAAI,EAAA,EACH,SAAS,EAAC,OAAO,EACjB,KAAK,EAAC,SAAS,EACf,IAAI,EAAE,GAAG,EACT,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,EAC3C,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,YAE9C,QAAQ,EAAA,CACJ;AAEX,CAAC;AAEM,MAAM,iBAAiB,GAAG,MAAK;AACpC,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;IACxB;;AAEE,IAAAA,GAAA,CAAC,OAAO,EAAA,EACN,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,EAC9F,OAAO,EAAC,UAAU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