@faststore/components 2.0.152-alpha.0 → 2.0.159-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/molecules/Breadcrumb/Breadcrumb.d.ts +2 -1
- package/dist/molecules/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/molecules/Breadcrumb/BreadcrumbBase.d.ts +3 -33
- package/dist/molecules/Breadcrumb/BreadcrumbPure.d.ts +4 -13
- package/dist/molecules/Breadcrumb/BreadcrumbPure.js +3 -3
- package/dist/molecules/Breadcrumb/BreadcrumbPure.js.map +1 -1
- package/package.json +2 -2
- package/src/molecules/Breadcrumb/Breadcrumb.tsx +4 -7
- package/src/molecules/Breadcrumb/BreadcrumbBase.tsx +2 -2
- package/src/molecules/Breadcrumb/BreadcrumbPure.tsx +53 -53
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BreadcrumbBaseProps } from './BreadcrumbBase';
|
|
3
|
-
export
|
|
3
|
+
export interface BreadcrumbProps extends Omit<BreadcrumbBaseProps, 'isDesktop'> {
|
|
4
|
+
}
|
|
4
5
|
declare const Breadcrumb: ({ breadcrumbList, ...otherProps }: BreadcrumbProps) => JSX.Element;
|
|
5
6
|
export default Breadcrumb;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.js","sourceRoot":"","sources":["../../../src/molecules/Breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,cAAuC,MAAM,kBAAkB,CAAA;AAKtE,MAAM,UAAU,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"Breadcrumb.js","sourceRoot":"","sources":["../../../src/molecules/Breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,cAAuC,MAAM,kBAAkB,CAAA;AAKtE,MAAM,UAAU,GAAG,CAAC,EAAE,cAAc,EAAE,GAAG,UAAU,EAAmB,EAAE,EAAE,CAAC,CACzE;IACE,oBAAC,cAAc,IAAC,cAAc,EAAE,cAAc,KAAM,UAAU,GAAI;IAClE,oBAAC,cAAc,IAAC,cAAc,EAAE,cAAc,EAAE,SAAS,WAAK,UAAU,GAAI,CAC3E,CACJ,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -15,7 +15,7 @@ type RenderLinkProps = {
|
|
|
15
15
|
*/
|
|
16
16
|
collapsed: boolean;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export interface BreadcrumbBaseProps extends BreadcrumbPureProps {
|
|
19
19
|
/**
|
|
20
20
|
* Array of ItemElement that represents each breadcrumb item.
|
|
21
21
|
*/
|
|
@@ -42,36 +42,6 @@ export type BreadcrumbBaseProps = {
|
|
|
42
42
|
* @returns Link to be rendered.
|
|
43
43
|
*/
|
|
44
44
|
renderLink?: (renderLinkProps: RenderLinkProps) => ReactElement;
|
|
45
|
-
}
|
|
46
|
-
declare const BreadcrumbBase: React.ForwardRefExoticComponent<
|
|
47
|
-
/**
|
|
48
|
-
* Array of ItemElement that represents each breadcrumb item.
|
|
49
|
-
*/
|
|
50
|
-
breadcrumbList: ItemElement[];
|
|
51
|
-
/**
|
|
52
|
-
* Represents if is Desktop os mobile.
|
|
53
|
-
*/
|
|
54
|
-
isDesktop?: boolean | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* Link go to home.
|
|
57
|
-
*/
|
|
58
|
-
homeLink?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Icon for dropdown button.
|
|
61
|
-
*/
|
|
62
|
-
dropdownButtonIcon?: ReactNode;
|
|
63
|
-
/**
|
|
64
|
-
* Icon for collapsed items.
|
|
65
|
-
*/
|
|
66
|
-
collapsedItemsIcon?: ReactNode;
|
|
67
|
-
/**
|
|
68
|
-
* Function to render a item as breadcrumb link.
|
|
69
|
-
* @param renderLinkProps Properties for each item to be rendered.
|
|
70
|
-
* @returns Link to be rendered.
|
|
71
|
-
*/
|
|
72
|
-
renderLink?: ((renderLinkProps: RenderLinkProps) => ReactElement) | undefined;
|
|
73
|
-
} & {
|
|
74
|
-
divider?: React.ReactNode;
|
|
75
|
-
testId?: string | undefined;
|
|
76
|
-
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
}
|
|
46
|
+
declare const BreadcrumbBase: React.ForwardRefExoticComponent<BreadcrumbBaseProps & React.RefAttributes<HTMLDivElement>>;
|
|
77
47
|
export default BreadcrumbBase;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
-
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface BreadcrumbPureProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* A ReactNode that will be rendered as the Divider icon.
|
|
6
6
|
*/
|
|
@@ -9,15 +9,6 @@ export type BreadcrumbPureProps = {
|
|
|
9
9
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
10
10
|
*/
|
|
11
11
|
testId?: string;
|
|
12
|
-
}
|
|
13
|
-
declare const BreadcrumbPure: React.ForwardRefExoticComponent<
|
|
14
|
-
/**
|
|
15
|
-
* A ReactNode that will be rendered as the Divider icon.
|
|
16
|
-
*/
|
|
17
|
-
divider?: ReactNode;
|
|
18
|
-
/**
|
|
19
|
-
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
20
|
-
*/
|
|
21
|
-
testId?: string | undefined;
|
|
22
|
-
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
}
|
|
13
|
+
declare const BreadcrumbPure: React.ForwardRefExoticComponent<BreadcrumbPureProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
14
|
export default BreadcrumbPure;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { forwardRef } from
|
|
2
|
-
import List from
|
|
3
|
-
import ListItem from
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import List from '../../atoms/List';
|
|
3
|
+
import ListItem from './ListItem';
|
|
4
4
|
const BreadcrumbPure = forwardRef(function BreadcrumbPure({ children, divider: rawDivider = '', testId = 'fs-breadcrumb', ...otherProps }, ref) {
|
|
5
5
|
return (React.createElement("nav", { "aria-label": "Breadcrumb", role: "navigation", ref: ref, "data-fs-breadcrumb": true, "data-testid": testId, ...otherProps },
|
|
6
6
|
React.createElement(List, { as: "ol", "data-fs-breadcrumb-list": true }, React.Children.toArray(children).map((child, index, childrenArray) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreadcrumbPure.js","sourceRoot":"","sources":["../../../src/molecules/Breadcrumb/BreadcrumbPure.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BreadcrumbPure.js","sourceRoot":"","sources":["../../../src/molecules/Breadcrumb/BreadcrumbPure.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,IAAI,MAAM,kBAAkB,CAAA;AACnC,OAAO,QAAQ,MAAM,YAAY,CAAA;AAajC,MAAM,cAAc,GAAG,UAAU,CAC/B,SAAS,cAAc,CACrB,EACE,QAAQ,EACR,OAAO,EAAE,UAAU,GAAG,EAAE,EACxB,MAAM,GAAG,eAAe,EACxB,GAAG,UAAU,EACd,EACD,GAAG;IAEH,OAAO,CACL,2CACa,YAAY,EACvB,IAAI,EAAC,YAAY,EACjB,GAAG,EAAE,GAAG,6CAEK,MAAM,KACf,UAAU;QAEd,oBAAC,IAAI,IAAC,EAAE,EAAC,IAAI,qCACV,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CACnC,CAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE;YAC9B,MAAM,UAAU,GAAG,KAAK,KAAK,aAAa,CAAC,MAAM,GAAG,CAAC,CAAA;YAErD,OAAO,CACL,oBAAC,QAAQ,IACP,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,UAAU,EACnB,GAAG,EAAE,cAAc,KAAK,EAAE,EAC1B,MAAM,EAAE,MAAM,IAEb,KAAK,CACG,CACZ,CAAA;QACH,CAAC,CACF,CACI,CACH,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,cAAc,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.159-alpha.0",
|
|
4
4
|
"module": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"author": "Emerson Laurentino @emersonlaurentino",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"node": "16.18.0",
|
|
31
31
|
"yarn": "1.19.1"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "e2a069b16ae52f76b7b20c12945dc3e6dab45bac"
|
|
34
34
|
}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import BreadcrumbBase, { BreadcrumbBaseProps } from './BreadcrumbBase'
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export interface BreadcrumbProps
|
|
5
|
+
extends Omit<BreadcrumbBaseProps, 'isDesktop'> {}
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
const Breadcrumb = ({
|
|
8
|
-
breadcrumbList,
|
|
9
|
-
...otherProps
|
|
10
|
-
}: BreadcrumbProps) => (
|
|
7
|
+
const Breadcrumb = ({ breadcrumbList, ...otherProps }: BreadcrumbProps) => (
|
|
11
8
|
<>
|
|
12
9
|
<BreadcrumbBase breadcrumbList={breadcrumbList} {...otherProps} />
|
|
13
10
|
<BreadcrumbBase breadcrumbList={breadcrumbList} isDesktop {...otherProps} />
|
|
14
11
|
</>
|
|
15
12
|
)
|
|
16
13
|
|
|
17
|
-
export default Breadcrumb
|
|
14
|
+
export default Breadcrumb
|
|
@@ -31,7 +31,7 @@ type RenderLinkProps = {
|
|
|
31
31
|
collapsed: boolean
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export
|
|
34
|
+
export interface BreadcrumbBaseProps extends BreadcrumbPureProps {
|
|
35
35
|
/**
|
|
36
36
|
* Array of ItemElement that represents each breadcrumb item.
|
|
37
37
|
*/
|
|
@@ -58,7 +58,7 @@ export type BreadcrumbBaseProps = {
|
|
|
58
58
|
* @returns Link to be rendered.
|
|
59
59
|
*/
|
|
60
60
|
renderLink?: (renderLinkProps: RenderLinkProps) => ReactElement
|
|
61
|
-
}
|
|
61
|
+
}
|
|
62
62
|
|
|
63
63
|
const BreadcrumbBase = forwardRef<HTMLDivElement, BreadcrumbBaseProps>(
|
|
64
64
|
function BreadcrumbBase(
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import React, { forwardRef } from "react"
|
|
2
|
-
import List from "../../atoms/List"
|
|
3
1
|
import type { HTMLAttributes, ReactNode } from 'react'
|
|
4
|
-
import
|
|
2
|
+
import React, { forwardRef } from 'react'
|
|
3
|
+
import List from '../../atoms/List'
|
|
4
|
+
import ListItem from './ListItem'
|
|
5
5
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
6
|
+
export interface BreadcrumbPureProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
/**
|
|
8
|
+
* A ReactNode that will be rendered as the Divider icon.
|
|
9
|
+
*/
|
|
10
|
+
divider?: ReactNode
|
|
11
|
+
/**
|
|
12
|
+
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
13
|
+
*/
|
|
14
|
+
testId?: string
|
|
15
|
+
}
|
|
16
16
|
|
|
17
17
|
const BreadcrumbPure = forwardRef<HTMLDivElement, BreadcrumbPureProps>(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
18
|
+
function BreadcrumbPure(
|
|
19
|
+
{
|
|
20
|
+
children,
|
|
21
|
+
divider: rawDivider = '',
|
|
22
|
+
testId = 'fs-breadcrumb',
|
|
23
|
+
...otherProps
|
|
24
|
+
},
|
|
25
|
+
ref
|
|
26
|
+
) {
|
|
27
|
+
return (
|
|
28
|
+
<nav
|
|
29
|
+
aria-label="Breadcrumb"
|
|
30
|
+
role="navigation"
|
|
31
|
+
ref={ref}
|
|
32
|
+
data-fs-breadcrumb
|
|
33
|
+
data-testid={testId}
|
|
34
|
+
{...otherProps}
|
|
35
|
+
>
|
|
36
|
+
<List as="ol" data-fs-breadcrumb-list>
|
|
37
|
+
{React.Children.toArray(children).map(
|
|
38
|
+
(child, index, childrenArray) => {
|
|
39
|
+
const isLastItem = index === childrenArray.length - 1
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<ListItem
|
|
43
|
+
isLastItem={isLastItem}
|
|
44
|
+
divider={rawDivider}
|
|
45
|
+
key={`breadcrumb-${index}`}
|
|
46
|
+
testId={testId}
|
|
47
|
+
>
|
|
48
|
+
{child}
|
|
49
|
+
</ListItem>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
)}
|
|
53
|
+
</List>
|
|
54
|
+
</nav>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
58
|
|
|
59
59
|
export default BreadcrumbPure
|