@elliemae/ds-breadcrumb 2.3.0-alpha.9 → 2.3.0-next.3
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/cjs/DSBreadcrumb.js +102 -0
- package/cjs/DSBreadcrumbItem.js +98 -0
- package/cjs/hooks/useKeyboardNavigation.js +30 -0
- package/cjs/index.d.js +2 -0
- package/cjs/index.js +15 -0
- package/cjs/styles.js +68 -0
- package/esm/DSBreadcrumb.js +88 -0
- package/esm/DSBreadcrumbItem.js +87 -0
- package/{dist/esm → esm}/hooks/useKeyboardNavigation.js +9 -11
- package/esm/index.d.js +1 -0
- package/esm/index.js +2 -0
- package/esm/styles.js +57 -0
- package/package.json +27 -29
- package/{dist/types → types}/DSBreadcrumb.d.ts +0 -0
- package/{dist/types → types}/DSBreadcrumbItem.d.ts +0 -0
- package/{dist/types → types}/hooks/useKeyboardNavigation.d.ts +0 -0
- package/{dist/types → types}/index.d.d.ts +0 -0
- package/{dist/types → types}/index.d.ts +0 -0
- package/{dist/types → types}/styles.d.ts +0 -0
- package/{dist/types → types}/tests/DSBreadcrumb.test.d.ts +0 -0
- package/{dist/types → types}/tests/DSBreadcrumbItem.test.d.ts +0 -0
- package/dist/cjs/DSBreadcrumb.js +0 -86
- package/dist/cjs/DSBreadcrumb.js.map +0 -7
- package/dist/cjs/DSBreadcrumbItem.js +0 -86
- package/dist/cjs/DSBreadcrumbItem.js.map +0 -7
- package/dist/cjs/hooks/useKeyboardNavigation.js +0 -57
- package/dist/cjs/hooks/useKeyboardNavigation.js.map +0 -7
- package/dist/cjs/index.d.js +0 -27
- package/dist/cjs/index.d.js.map +0 -7
- package/dist/cjs/index.js +0 -37
- package/dist/cjs/index.js.map +0 -7
- package/dist/cjs/styles.js +0 -107
- package/dist/cjs/styles.js.map +0 -7
- package/dist/esm/DSBreadcrumb.js +0 -57
- package/dist/esm/DSBreadcrumb.js.map +0 -7
- package/dist/esm/DSBreadcrumbItem.js +0 -57
- package/dist/esm/DSBreadcrumbItem.js.map +0 -7
- package/dist/esm/hooks/useKeyboardNavigation.js.map +0 -7
- package/dist/esm/index.d.js +0 -2
- package/dist/esm/index.d.js.map +0 -7
- package/dist/esm/index.js +0 -8
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/styles.js +0 -78
- package/dist/esm/styles.js.map +0 -7
package/dist/esm/DSBreadcrumb.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import React2, { cloneElement, useMemo } from "react";
|
|
3
|
-
import { PropTypes, describe } from "react-desc";
|
|
4
|
-
import DSBreadcrumbItem from "./DSBreadcrumbItem";
|
|
5
|
-
import { useKeyboardNavigation } from "./hooks/useKeyboardNavigation";
|
|
6
|
-
import { StyledContainer, StyledList } from "./styles";
|
|
7
|
-
const htmlElements = ["nav", "div", "header", "footer", "main"];
|
|
8
|
-
const DSBreadcrumb = ({
|
|
9
|
-
containerProps = {},
|
|
10
|
-
as = "nav",
|
|
11
|
-
label = "Breadcrumb",
|
|
12
|
-
isTitle = false,
|
|
13
|
-
children,
|
|
14
|
-
trailingSlash = true,
|
|
15
|
-
...rest
|
|
16
|
-
}) => {
|
|
17
|
-
const [addRef, onKeyDown] = useKeyboardNavigation();
|
|
18
|
-
const safeElement = useMemo(() => htmlElements.indexOf(as) > -1 ? as : "nav", [as]);
|
|
19
|
-
return /* @__PURE__ */ React2.createElement(StyledContainer, {
|
|
20
|
-
"aria-label": label,
|
|
21
|
-
"data-testid": "breadcrumb-nav-container",
|
|
22
|
-
...rest,
|
|
23
|
-
...containerProps,
|
|
24
|
-
as: safeElement
|
|
25
|
-
}, /* @__PURE__ */ React2.createElement(StyledList, {
|
|
26
|
-
"data-testid": "list-container"
|
|
27
|
-
}, React2.Children.map(children, (child, childIndex) => childIndex < children.length - 1 ? cloneElement(child, {
|
|
28
|
-
childIndex,
|
|
29
|
-
addRef,
|
|
30
|
-
onKeyDown
|
|
31
|
-
}) : cloneElement(child, {
|
|
32
|
-
childIndex,
|
|
33
|
-
addRef,
|
|
34
|
-
onKeyDown,
|
|
35
|
-
trailingSlash,
|
|
36
|
-
isTitle
|
|
37
|
-
}))));
|
|
38
|
-
};
|
|
39
|
-
DSBreadcrumb.Item = DSBreadcrumbItem;
|
|
40
|
-
const props = {
|
|
41
|
-
containerProps: PropTypes.object.description("props injected to breadcrumb wrapper"),
|
|
42
|
-
as: PropTypes.string.description("Type of element you want the main container to be: 'nav', 'div', 'header', 'footer', 'main'"),
|
|
43
|
-
isTitle: PropTypes.bool.description("Whether to show the last element of the breadcrumb as a title. Also removes trailing slash to show last element as title"),
|
|
44
|
-
label: PropTypes.string.description("breadcrumb label"),
|
|
45
|
-
children: PropTypes.arrayOf(DSBreadcrumbItem).isRequired.description("Container items to wrap")
|
|
46
|
-
};
|
|
47
|
-
DSBreadcrumb.propTypes = props;
|
|
48
|
-
const DSBreadcrumbWithSchema = describe(DSBreadcrumb);
|
|
49
|
-
DSBreadcrumbWithSchema.propTypes = props;
|
|
50
|
-
var DSBreadcrumb_default = DSBreadcrumb;
|
|
51
|
-
export {
|
|
52
|
-
DSBreadcrumb,
|
|
53
|
-
DSBreadcrumbWithSchema,
|
|
54
|
-
DSBreadcrumb_default as default,
|
|
55
|
-
htmlElements
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=DSBreadcrumb.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSBreadcrumb.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { cloneElement, useMemo } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport DSBreadcrumbItem from './DSBreadcrumbItem';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\nimport type { DSBreadcrumbPropsT } from './index.d';\nimport { StyledContainer, StyledList } from './styles';\n\nconst htmlElements = ['nav', 'div', 'header', 'footer', 'main'] as const;\n\nconst DSBreadcrumb = ({\n containerProps = {},\n as = 'nav',\n label = 'Breadcrumb',\n isTitle = false,\n children,\n trailingSlash = true,\n ...rest\n}: DSBreadcrumbPropsT): React.ReactElement => {\n const [addRef, onKeyDown] = useKeyboardNavigation();\n\n const safeElement = useMemo(\n () => (htmlElements.indexOf(as) > -1 ? as : 'nav'),\n [as],\n );\n\n return (\n <StyledContainer\n aria-label={label}\n data-testid=\"breadcrumb-nav-container\"\n {...rest}\n {...containerProps}\n as={safeElement}\n >\n <StyledList data-testid=\"list-container\">\n {React.Children.map(children, (child: React.ReactElement, childIndex) =>\n childIndex < children.length - 1\n ? cloneElement(child, {\n childIndex,\n addRef,\n onKeyDown,\n })\n : cloneElement(child, {\n childIndex,\n addRef,\n onKeyDown,\n trailingSlash,\n isTitle,\n }),\n )}\n </StyledList>\n </StyledContainer>\n );\n};\n\nDSBreadcrumb.Item = DSBreadcrumbItem;\n\nconst props = {\n /** props injected to breadcrumb wrapper */\n containerProps: PropTypes.object.description(\n 'props injected to breadcrumb wrapper',\n ),\n /**\n * Type of element you want the main container to be:\n * 'nav', 'div', 'header', 'footer', 'main'\n */\n as: PropTypes.string.description(\n \"Type of element you want the main container to be: 'nav', 'div', 'header', 'footer', 'main'\",\n ),\n /**\n * Whether to show the last element of the breadcrumb as a title\n * Also removes trailing slash to show last element as title\n */\n isTitle: PropTypes.bool.description(\n 'Whether to show the last element of the breadcrumb as a title. Also removes trailing slash to show last element as title',\n ),\n /** breadcrumb label */\n label: PropTypes.string.description('breadcrumb label'),\n /**\n * Container items to wrap\n */\n children: PropTypes.arrayOf(DSBreadcrumbItem).isRequired.description(\n 'Container items to wrap',\n ),\n};\n\nDSBreadcrumb.propTypes = props;\n\nconst DSBreadcrumbWithSchema = describe(DSBreadcrumb);\nDSBreadcrumbWithSchema.propTypes = props;\n\nexport { DSBreadcrumb, DSBreadcrumbWithSchema, htmlElements };\nexport default DSBreadcrumb;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA;AAEA,MAAM,eAAe,CAAC,OAAO,OAAO,UAAU,UAAU;AAExD,MAAM,eAAe,CAAC;AAAA,EACpB,iBAAiB;AAAA,EACjB,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,UAAU;AAAA,EACV;AAAA,EACA,gBAAgB;AAAA,KACb;AAAA,MACyC;AAC5C,QAAM,CAAC,QAAQ,aAAa;AAE5B,QAAM,cAAc,QAClB,MAAO,aAAa,QAAQ,MAAM,KAAK,KAAK,OAC5C,CAAC;AAGH,SACE,qCAAC,iBAAD;AAAA,IACE,cAAY;AAAA,IACZ,eAAY;AAAA,OACR;AAAA,OACA;AAAA,IACJ,IAAI;AAAA,KAEJ,qCAAC,YAAD;AAAA,IAAY,eAAY;AAAA,KACrB,OAAM,SAAS,IAAI,UAAU,CAAC,OAA2B,eACxD,aAAa,SAAS,SAAS,IAC3B,aAAa,OAAO;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,OAEF,aAAa,OAAO;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAQhB,aAAa,OAAO;AAEpB,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,UAAU,OAAO,YAC/B;AAAA,EAMF,IAAI,UAAU,OAAO,YACnB;AAAA,EAMF,SAAS,UAAU,KAAK,YACtB;AAAA,EAGF,OAAO,UAAU,OAAO,YAAY;AAAA,EAIpC,UAAU,UAAU,QAAQ,kBAAkB,WAAW,YACvD;AAAA;AAIJ,aAAa,YAAY;AAEzB,MAAM,yBAAyB,SAAS;AACxC,uBAAuB,YAAY;AAGnC,IAAO,uBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import React2 from "react";
|
|
3
|
-
import { PropTypes, describe } from "react-desc";
|
|
4
|
-
import { StyledLink, StyledCrumbWrapper } from "./styles";
|
|
5
|
-
function DSBreadcrumbItem({
|
|
6
|
-
active = false,
|
|
7
|
-
as = "a",
|
|
8
|
-
href = void 0,
|
|
9
|
-
isTitle,
|
|
10
|
-
onClick = () => null,
|
|
11
|
-
label = "",
|
|
12
|
-
color = null,
|
|
13
|
-
addRef,
|
|
14
|
-
childIndex,
|
|
15
|
-
trailingSlash,
|
|
16
|
-
onKeyDown = () => null,
|
|
17
|
-
...rest
|
|
18
|
-
}) {
|
|
19
|
-
return /* @__PURE__ */ React2.createElement(StyledCrumbWrapper, {
|
|
20
|
-
"aria-current": active ? "page" : void 0,
|
|
21
|
-
"data-testid": "breadcrumb-item-container",
|
|
22
|
-
isTitle,
|
|
23
|
-
trailingSlash,
|
|
24
|
-
...rest
|
|
25
|
-
}, /* @__PURE__ */ React2.createElement(StyledLink, {
|
|
26
|
-
as,
|
|
27
|
-
href,
|
|
28
|
-
onClick,
|
|
29
|
-
ref: addRef,
|
|
30
|
-
tabIndex: 0,
|
|
31
|
-
isActive: active,
|
|
32
|
-
onKeyDown: (e) => onKeyDown(e, childIndex, onClick),
|
|
33
|
-
isTitle,
|
|
34
|
-
color
|
|
35
|
-
}, label));
|
|
36
|
-
}
|
|
37
|
-
const props = {
|
|
38
|
-
containerComponent: PropTypes.string.description("inject props to wrapper"),
|
|
39
|
-
as: PropTypes.string.description("render as any html node"),
|
|
40
|
-
active: PropTypes.bool.description("active item"),
|
|
41
|
-
href: PropTypes.string.description("href link"),
|
|
42
|
-
onClick: PropTypes.func.description("on click handler"),
|
|
43
|
-
isTitle: PropTypes.bool.description("style item as title"),
|
|
44
|
-
trailingSlash: PropTypes.bool.description("add trailing slash"),
|
|
45
|
-
label: PropTypes.string.description("item label"),
|
|
46
|
-
color: PropTypes.string.description("link color")
|
|
47
|
-
};
|
|
48
|
-
DSBreadcrumbItem.propTypes = props;
|
|
49
|
-
const DSBreadcrumbItemWithSchema = describe(DSBreadcrumbItem);
|
|
50
|
-
DSBreadcrumbItemWithSchema.propTypes = props;
|
|
51
|
-
var DSBreadcrumbItem_default = DSBreadcrumbItem;
|
|
52
|
-
export {
|
|
53
|
-
DSBreadcrumbItem,
|
|
54
|
-
DSBreadcrumbItemWithSchema,
|
|
55
|
-
DSBreadcrumbItem_default as default
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=DSBreadcrumbItem.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSBreadcrumbItem.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport type { DSBreadcrumbItemPropsT } from './index.d';\nimport { StyledLink, StyledCrumbWrapper } from './styles';\n\nfunction DSBreadcrumbItem({\n active = false,\n as = 'a',\n href = undefined,\n isTitle,\n onClick = () => null,\n label = '',\n color = null,\n addRef,\n childIndex,\n trailingSlash,\n onKeyDown = () => null,\n ...rest\n}: DSBreadcrumbItemPropsT): React.ReactElement {\n return (\n <StyledCrumbWrapper\n aria-current={active ? 'page' : undefined}\n data-testid=\"breadcrumb-item-container\"\n isTitle={isTitle}\n trailingSlash={trailingSlash}\n {...rest}\n >\n <StyledLink\n as={as}\n href={href}\n onClick={onClick}\n ref={addRef}\n tabIndex={0}\n isActive={active}\n onKeyDown={(e: React.KeyboardEvent) =>\n onKeyDown(e, childIndex, onClick)\n }\n isTitle={isTitle}\n color={color}\n >\n {label}\n </StyledLink>\n </StyledCrumbWrapper>\n );\n}\n\nconst props = {\n /** inject props to wrapper */\n containerComponent: PropTypes.string.description('inject props to wrapper'),\n /** render as any html node */\n as: PropTypes.string.description('render as any html node'),\n /** active item */\n active: PropTypes.bool.description('active item'),\n /** href link */\n href: PropTypes.string.description('href link'),\n /** on click handler */\n onClick: PropTypes.func.description('on click handler'),\n /** style item as title */\n isTitle: PropTypes.bool.description('style item as title'),\n /** add trailing slash */\n trailingSlash: PropTypes.bool.description('add trailing slash'),\n /** item label */\n label: PropTypes.string.description('item label'),\n /** link color */\n color: PropTypes.string.description('link color'),\n};\n\nDSBreadcrumbItem.propTypes = props;\n\nconst DSBreadcrumbItemWithSchema = describe(DSBreadcrumbItem);\nDSBreadcrumbItemWithSchema.propTypes = props;\n\nexport { DSBreadcrumbItem, DSBreadcrumbItemWithSchema };\nexport default DSBreadcrumbItem;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAEA;AAEA,0BAA0B;AAAA,EACxB,SAAS;AAAA,EACT,KAAK;AAAA,EACL,OAAO;AAAA,EACP;AAAA,EACA,UAAU,MAAM;AAAA,EAChB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY,MAAM;AAAA,KACf;AAAA,GAC0C;AAC7C,SACE,qCAAC,oBAAD;AAAA,IACE,gBAAc,SAAS,SAAS;AAAA,IAChC,eAAY;AAAA,IACZ;AAAA,IACA;AAAA,OACI;AAAA,KAEJ,qCAAC,YAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,KAAK;AAAA,IACL,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW,CAAC,MACV,UAAU,GAAG,YAAY;AAAA,IAE3B;AAAA,IACA;AAAA,KAEC;AAAA;AAMT,MAAM,QAAQ;AAAA,EAEZ,oBAAoB,UAAU,OAAO,YAAY;AAAA,EAEjD,IAAI,UAAU,OAAO,YAAY;AAAA,EAEjC,QAAQ,UAAU,KAAK,YAAY;AAAA,EAEnC,MAAM,UAAU,OAAO,YAAY;AAAA,EAEnC,SAAS,UAAU,KAAK,YAAY;AAAA,EAEpC,SAAS,UAAU,KAAK,YAAY;AAAA,EAEpC,eAAe,UAAU,KAAK,YAAY;AAAA,EAE1C,OAAO,UAAU,OAAO,YAAY;AAAA,EAEpC,OAAO,UAAU,OAAO,YAAY;AAAA;AAGtC,iBAAiB,YAAY;AAE7B,MAAM,6BAA6B,SAAS;AAC5C,2BAA2B,YAAY;AAGvC,IAAO,2BAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useKeyboardNavigation.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef, useCallback } from 'react';\n\nexport const useKeyboardNavigation = () => {\n const componentsRef = useRef<HTMLAnchorElement[]>([]);\n\n const addRef = useCallback((ref: HTMLAnchorElement) => {\n if (ref && !componentsRef.current.includes(ref)) {\n componentsRef.current.push(ref);\n }\n }, []);\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent, componentRefIndex, callback) => {\n if (\n e.key === 'ArrowDown' &&\n componentsRef.current[componentRefIndex + 1]\n ) {\n componentsRef.current[componentRefIndex + 1].focus();\n e.preventDefault();\n } else if (e.key === 'ArrowUp' && componentRefIndex !== 0) {\n componentsRef.current[componentRefIndex - 1].focus();\n e.preventDefault();\n } else if (e.key === 'Enter') {\n callback();\n } else if (e.ctrlKey && e.altKey && e.key === ' ') {\n componentsRef.current[componentRefIndex].click();\n }\n },\n [],\n );\n\n return [addRef, onKeyDown];\n};\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AAEO,MAAM,wBAAwB,MAAM;AACzC,QAAM,gBAAgB,OAA4B;AAElD,QAAM,SAAS,YAAY,CAAC,QAA2B;AACrD,QAAI,OAAO,CAAC,cAAc,QAAQ,SAAS,MAAM;AAC/C,oBAAc,QAAQ,KAAK;AAAA;AAAA,KAE5B;AAEH,QAAM,YAAY,YAChB,CAAC,GAAwB,mBAAmB,aAAa;AACvD,QACE,EAAE,QAAQ,eACV,cAAc,QAAQ,oBAAoB,IAC1C;AACA,oBAAc,QAAQ,oBAAoB,GAAG;AAC7C,QAAE;AAAA,eACO,EAAE,QAAQ,aAAa,sBAAsB,GAAG;AACzD,oBAAc,QAAQ,oBAAoB,GAAG;AAC7C,QAAE;AAAA,eACO,EAAE,QAAQ,SAAS;AAC5B;AAAA,eACS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,KAAK;AACjD,oBAAc,QAAQ,mBAAmB;AAAA;AAAA,KAG7C;AAGF,SAAO,CAAC,QAAQ;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/esm/index.d.js
DELETED
package/dist/esm/index.d.js.map
DELETED
package/dist/esm/index.js
DELETED
package/dist/esm/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSBreadcrumb';\nexport * from './DSBreadcrumbItem';\nexport { default } from './DSBreadcrumb';\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/esm/styles.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
const handleColor = (theme, isActive, color, isTitle) => {
|
|
4
|
-
if (isActive)
|
|
5
|
-
return theme.colors.neutral[800];
|
|
6
|
-
else if (color)
|
|
7
|
-
return color;
|
|
8
|
-
else if (isTitle)
|
|
9
|
-
return theme.colors.neutral[700];
|
|
10
|
-
else
|
|
11
|
-
return theme.colors.brand[600];
|
|
12
|
-
};
|
|
13
|
-
const StyledList = styled.ol`
|
|
14
|
-
width: 100%;
|
|
15
|
-
list-style: none;
|
|
16
|
-
display: flex;
|
|
17
|
-
padding: 0;
|
|
18
|
-
margin: 0;
|
|
19
|
-
li:first-child * {
|
|
20
|
-
margin-left: 0;
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
23
|
-
const StyledCrumbWrapper = styled.li`
|
|
24
|
-
display: inline-flex;
|
|
25
|
-
align-items: center;
|
|
26
|
-
flex-shrink: 20;
|
|
27
|
-
transition: flex-shrink 0.1s cubic-bezier(0.64, 0, 0.35, 1);
|
|
28
|
-
height: 16px;
|
|
29
|
-
min-width: 10px;
|
|
30
|
-
&:hover {
|
|
31
|
-
flex-shrink: 0;
|
|
32
|
-
}
|
|
33
|
-
${({ theme, isTitle, trailingSlash }) => isTitle || !trailingSlash ? `&:not(:last-child):after {
|
|
34
|
-
display: inline-block;
|
|
35
|
-
content: '/';
|
|
36
|
-
color: ${theme.colors.neutral[700]};
|
|
37
|
-
}
|
|
38
|
-
` : `&:after {
|
|
39
|
-
display: inline-block;
|
|
40
|
-
content: '/';
|
|
41
|
-
color: ${theme.colors.neutral[700]};
|
|
42
|
-
}
|
|
43
|
-
`}
|
|
44
|
-
`;
|
|
45
|
-
const StyledContainer = styled.nav`
|
|
46
|
-
display: flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
padding: 0;
|
|
49
|
-
`;
|
|
50
|
-
const StyledLink = styled.a`
|
|
51
|
-
white-space: nowrap;
|
|
52
|
-
overflow: hidden;
|
|
53
|
-
text-overflow: ellipsis;
|
|
54
|
-
text-decoration: none;
|
|
55
|
-
font-size: 12px;
|
|
56
|
-
outline: none;
|
|
57
|
-
margin: 0 2px;
|
|
58
|
-
border: 2px solid transparent;
|
|
59
|
-
-webkit-text-stroke: 0.4px transparent;
|
|
60
|
-
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
|
61
|
-
color: ${({ theme, isActive, color, isTitle }) => handleColor(theme, isActive, color, isTitle)};
|
|
62
|
-
&:hover {
|
|
63
|
-
color: ${({ theme, color }) => color ? color : theme.colors.brand[800]};
|
|
64
|
-
cursor: pointer;
|
|
65
|
-
${({ theme, color }) => `-webkit-text-stroke: 0.4px ${color ? color : theme.colors.brand[800]}`};
|
|
66
|
-
}
|
|
67
|
-
&:focus {
|
|
68
|
-
${({ theme }) => `border: 2px solid ${theme.colors.brand[700]};`}
|
|
69
|
-
border-radius: 2px;
|
|
70
|
-
}
|
|
71
|
-
`;
|
|
72
|
-
export {
|
|
73
|
-
StyledContainer,
|
|
74
|
-
StyledCrumbWrapper,
|
|
75
|
-
StyledLink,
|
|
76
|
-
StyledList
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=styles.js.map
|
package/dist/esm/styles.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { Theme } from '@elliemae/pui-theme';\nimport styled from 'styled-components';\nimport type { DSBreadcrumbItemPropsT } from './index.d';\n\nconst handleColor = (theme: Theme, isActive: boolean, color: string, isTitle: boolean): string => {\n if (isActive) return theme.colors.neutral[800];\n else if (color) return color;\n else if (isTitle) return theme.colors.neutral[700];\n else return theme.colors.brand[600];\n};\n\nconst StyledList = styled.ol`\n width: 100%;\n list-style: none;\n display: flex;\n padding: 0;\n margin: 0;\n li:first-child * {\n margin-left: 0;\n }\n`;\n\nconst StyledCrumbWrapper = styled.li<Partial<DSBreadcrumbItemPropsT>>`\n display: inline-flex;\n align-items: center;\n flex-shrink: 20;\n transition: flex-shrink 0.1s cubic-bezier(0.64, 0, 0.35, 1);\n height: 16px;\n min-width: 10px;\n &:hover {\n flex-shrink: 0;\n }\n ${({ theme, isTitle, trailingSlash }) =>\n isTitle || !trailingSlash\n ? `&:not(:last-child):after {\n display: inline-block;\n content: '/';\n color: ${theme.colors.neutral[700]};\n }\n `\n : `&:after {\n display: inline-block;\n content: '/';\n color: ${theme.colors.neutral[700]};\n }\n `}\n`;\n\nconst StyledContainer = styled.nav`\n display: flex;\n align-items: center;\n padding: 0;\n`;\n\nconst StyledLink = styled.a<Partial<DSBreadcrumbItemPropsT>>`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-decoration: none;\n font-size: 12px;\n outline: none;\n margin: 0 2px;\n border: 2px solid transparent;\n -webkit-text-stroke: 0.4px transparent;\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n color: ${({ theme, isActive, color, isTitle }) => handleColor(theme, isActive, color, isTitle)};\n &:hover {\n color: ${({ theme, color }) => (color ? color : theme.colors.brand[800])};\n cursor: pointer;\n ${({ theme, color }) => `-webkit-text-stroke: 0.4px ${color ? color : theme.colors.brand[800]}`};\n }\n &:focus {\n ${({ theme }) => `border: 2px solid ${theme.colors.brand[700]};`}\n border-radius: 2px;\n }\n`;\n\nexport { StyledList, StyledCrumbWrapper, StyledContainer, StyledLink };\n"],
|
|
5
|
-
"mappings": "AAAA;ACCA;AAGA,MAAM,cAAc,CAAC,OAAc,UAAmB,OAAe,YAA6B;AAChG,MAAI;AAAU,WAAO,MAAM,OAAO,QAAQ;AAAA,WACjC;AAAO,WAAO;AAAA,WACd;AAAS,WAAO,MAAM,OAAO,QAAQ;AAAA;AACzC,WAAO,MAAM,OAAO,MAAM;AAAA;AAGjC,MAAM,aAAa,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW1B,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAU9B,CAAC,EAAE,OAAO,SAAS,oBACnB,WAAW,CAAC,gBACR;AAAA;AAAA;AAAA,aAGK,MAAM,OAAO,QAAQ;AAAA;AAAA,MAG1B;AAAA;AAAA;AAAA,aAGK,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAKlC,MAAM,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA;AAM/B,MAAM,aAAa,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAUT,CAAC,EAAE,YAAY,MAAM,YAAY;AAAA,WACvC,CAAC,EAAE,OAAO,UAAU,OAAO,cAAc,YAAY,OAAO,UAAU,OAAO;AAAA;AAAA,aAE3E,CAAC,EAAE,OAAO,YAAa,QAAQ,QAAQ,MAAM,OAAO,MAAM;AAAA;AAAA,MAEjE,CAAC,EAAE,OAAO,YAAY,8BAA8B,QAAQ,QAAQ,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,MAGvF,CAAC,EAAE,YAAY,qBAAqB,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|