@elliemae/ds-breadcrumb 3.14.0-next.8 → 3.14.0-rc.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/cjs/DSBreadcrumbItem.js +3 -2
- package/dist/cjs/DSBreadcrumbItem.js.map +2 -2
- package/dist/cjs/hooks/useKeyboardNavigation.js +1 -3
- package/dist/cjs/hooks/useKeyboardNavigation.js.map +2 -2
- package/dist/cjs/styles.js +4 -4
- package/dist/cjs/styles.js.map +2 -2
- package/dist/esm/DSBreadcrumbItem.js +3 -2
- package/dist/esm/DSBreadcrumbItem.js.map +2 -2
- package/dist/esm/hooks/useKeyboardNavigation.js +1 -3
- package/dist/esm/hooks/useKeyboardNavigation.js.map +2 -2
- package/dist/esm/styles.js +4 -4
- package/dist/esm/styles.js.map +2 -2
- package/dist/types/DSBreadcrumb.d.ts +45 -0
- package/dist/types/DSBreadcrumbItem.d.ts +29 -0
- package/dist/types/hooks/useKeyboardNavigation.d.ts +2 -0
- package/dist/types/index.d.d.ts +27 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/styles.d.ts +7 -0
- package/dist/types/tests/DSBreadcrumb.test.d.ts +1 -0
- package/dist/types/tests/DSBreadcrumbItem.test.d.ts +1 -0
- package/package.json +4 -3
|
@@ -57,15 +57,16 @@ const DSBreadcrumbItem = ({
|
|
|
57
57
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
58
58
|
import_styles.StyledLink,
|
|
59
59
|
{
|
|
60
|
-
|
|
60
|
+
variant: "link",
|
|
61
|
+
component: as,
|
|
61
62
|
href,
|
|
62
63
|
onClick,
|
|
63
|
-
ref: addRef,
|
|
64
64
|
tabIndex: 0,
|
|
65
65
|
isActive: active,
|
|
66
66
|
onKeyDown: (e) => onKeyDown(e, childIndex, onClick),
|
|
67
67
|
isTitle,
|
|
68
68
|
color,
|
|
69
|
+
innerRef: addRef,
|
|
69
70
|
children: label
|
|
70
71
|
}
|
|
71
72
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSBreadcrumbItem.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport type { DSBreadcrumbItemPropsT } from './index.d';\nimport { StyledLink, StyledCrumbWrapper } from './styles';\n\nconst 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 <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
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0BnB;AAzBJ,0BAAoC;AAEpC,oBAA+C;AAE/C,MAAM,mBAAmB,CAAC;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;AACL,MACE;AAAA,EAAC;AAAA;AAAA,IACC,gBAAc,SAAS,SAAS;AAAA,IAChC,eAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACC,GAAG;AAAA,IAEJ;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport type { DSBreadcrumbItemPropsT } from './index.d';\nimport { StyledLink, StyledCrumbWrapper } from './styles';\n\nconst 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 <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 variant=\"link\"\n component={as}\n href={href}\n onClick={onClick}\n tabIndex={0}\n isActive={active}\n onKeyDown={(e: React.KeyboardEvent) => onKeyDown(e, childIndex, onClick)}\n isTitle={isTitle}\n color={color}\n innerRef={addRef}\n >\n {label}\n </StyledLink>\n </StyledCrumbWrapper>\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;\nDSBreadcrumbItem.displayName = 'DSBreadcrumbItem';\n\nconst DSBreadcrumbItemWithSchema = describe(DSBreadcrumbItem);\nDSBreadcrumbItemWithSchema.propTypes = props;\n\nexport { DSBreadcrumbItem, DSBreadcrumbItemWithSchema };\nexport default DSBreadcrumbItem;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0BnB;AAzBJ,0BAAoC;AAEpC,oBAA+C;AAE/C,MAAM,mBAAmB,CAAC;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;AACL,MACE;AAAA,EAAC;AAAA;AAAA,IACC,gBAAc,SAAS,SAAS;AAAA,IAChC,eAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACC,GAAG;AAAA,IAEJ;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,WAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA,UAAU;AAAA,QACV,UAAU;AAAA,QACV,WAAW,CAAC,MAA2B,UAAU,GAAG,YAAY,OAAO;AAAA,QACvE;AAAA,QACA;AAAA,QACA,UAAU;AAAA,QAET;AAAA;AAAA,IACH;AAAA;AACF;AAGF,MAAM,QAAQ;AAAA,EAEZ,oBAAoB,8BAAU,OAAO,YAAY,yBAAyB;AAAA,EAE1E,IAAI,8BAAU,OAAO,YAAY,yBAAyB;AAAA,EAE1D,QAAQ,8BAAU,KAAK,YAAY,aAAa;AAAA,EAEhD,MAAM,8BAAU,OAAO,YAAY,WAAW;AAAA,EAE9C,SAAS,8BAAU,KAAK,YAAY,kBAAkB;AAAA,EAEtD,SAAS,8BAAU,KAAK,YAAY,qBAAqB;AAAA,EAEzD,eAAe,8BAAU,KAAK,YAAY,oBAAoB;AAAA,EAE9D,OAAO,8BAAU,OAAO,YAAY,YAAY;AAAA,EAEhD,OAAO,8BAAU,OAAO,YAAY,YAAY;AAClD;AAEA,iBAAiB,YAAY;AAC7B,iBAAiB,cAAc;AAE/B,MAAM,iCAA6B,8BAAS,gBAAgB;AAC5D,2BAA2B,YAAY;AAGvC,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -43,10 +43,8 @@ const useKeyboardNavigation = () => {
|
|
|
43
43
|
} else if (e.key === "ArrowUp" && componentRefIndex !== 0) {
|
|
44
44
|
componentsRef.current[componentRefIndex - 1].focus();
|
|
45
45
|
e.preventDefault();
|
|
46
|
-
} else if (e.key === "Enter") {
|
|
46
|
+
} else if (e.key === "Enter" || e.ctrlKey && e.altKey && e.code === "Space") {
|
|
47
47
|
callback();
|
|
48
|
-
} else if (e.ctrlKey && e.altKey && e.key === " ") {
|
|
49
|
-
componentsRef.current[componentRefIndex].click();
|
|
50
48
|
}
|
|
51
49
|
}, []);
|
|
52
50
|
return [addRef, onKeyDown];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/useKeyboardNavigation.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type React from 'react';\nimport { 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((e: React.KeyboardEvent, componentRefIndex, callback) => {\n if (e.key === 'ArrowDown' && componentsRef.current[componentRefIndex + 1]) {\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'
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAoC;AAE7B,MAAM,wBAAwB,MAAM;AACzC,QAAM,oBAAgB,qBAA4B,CAAC,CAAC;AAEpD,QAAM,aAAS,0BAAY,CAAC,QAA2B;AACrD,QAAI,OAAO,CAAC,cAAc,QAAQ,SAAS,GAAG,GAAG;AAC/C,oBAAc,QAAQ,KAAK,GAAG;AAAA,IAChC;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,gBAAY,0BAAY,CAAC,GAAwB,mBAAmB,aAAa;AACrF,QAAI,EAAE,QAAQ,eAAe,cAAc,QAAQ,oBAAoB,IAAI;AACzE,oBAAc,QAAQ,oBAAoB,GAAG,MAAM;AACnD,QAAE,eAAe;AAAA,IACnB,WAAW,EAAE,QAAQ,aAAa,sBAAsB,GAAG;AACzD,oBAAc,QAAQ,oBAAoB,GAAG,MAAM;AACnD,QAAE,eAAe;AAAA,IACnB,WAAW,EAAE,QAAQ,
|
|
4
|
+
"sourcesContent": ["import type React from 'react';\nimport { 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((e: React.KeyboardEvent, componentRefIndex, callback) => {\n if (e.key === 'ArrowDown' && componentsRef.current[componentRefIndex + 1]) {\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' || (e.ctrlKey && e.altKey && e.code === 'Space')) {\n callback();\n }\n }, []);\n\n return [addRef, onKeyDown];\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAoC;AAE7B,MAAM,wBAAwB,MAAM;AACzC,QAAM,oBAAgB,qBAA4B,CAAC,CAAC;AAEpD,QAAM,aAAS,0BAAY,CAAC,QAA2B;AACrD,QAAI,OAAO,CAAC,cAAc,QAAQ,SAAS,GAAG,GAAG;AAC/C,oBAAc,QAAQ,KAAK,GAAG;AAAA,IAChC;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,gBAAY,0BAAY,CAAC,GAAwB,mBAAmB,aAAa;AACrF,QAAI,EAAE,QAAQ,eAAe,cAAc,QAAQ,oBAAoB,IAAI;AACzE,oBAAc,QAAQ,oBAAoB,GAAG,MAAM;AACnD,QAAE,eAAe;AAAA,IACnB,WAAW,EAAE,QAAQ,aAAa,sBAAsB,GAAG;AACzD,oBAAc,QAAQ,oBAAoB,GAAG,MAAM;AACnD,QAAE,eAAe;AAAA,IACnB,WAAW,EAAE,QAAQ,WAAY,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,SAAU;AAC7E,eAAS;AAAA,IACX;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO,CAAC,QAAQ,SAAS;AAC3B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/styles.js
CHANGED
|
@@ -32,6 +32,7 @@ __export(styles_exports, {
|
|
|
32
32
|
module.exports = __toCommonJS(styles_exports);
|
|
33
33
|
var React = __toESM(require("react"));
|
|
34
34
|
var import_ds_system = require("@elliemae/ds-system");
|
|
35
|
+
var import_ds_typography = require("@elliemae/ds-typography");
|
|
35
36
|
const handleColor = (theme, isActive, color, isTitle) => {
|
|
36
37
|
if (isActive)
|
|
37
38
|
return theme.colors.neutral[800];
|
|
@@ -56,7 +57,7 @@ const StyledCrumbWrapper = import_ds_system.styled.li`
|
|
|
56
57
|
align-items: center;
|
|
57
58
|
flex-shrink: 20;
|
|
58
59
|
transition: flex-shrink 0.1s cubic-bezier(0.64, 0, 0.35, 1);
|
|
59
|
-
height:
|
|
60
|
+
min-height: 1.231rem;
|
|
60
61
|
min-width: 10px;
|
|
61
62
|
&:hover {
|
|
62
63
|
flex-shrink: 0;
|
|
@@ -78,18 +79,17 @@ const StyledContainer = import_ds_system.styled.nav`
|
|
|
78
79
|
align-items: center;
|
|
79
80
|
padding: 0;
|
|
80
81
|
`;
|
|
81
|
-
const StyledLink = import_ds_system.styled.
|
|
82
|
+
const StyledLink = (0, import_ds_system.styled)(import_ds_typography.DSTypography)`
|
|
82
83
|
white-space: nowrap;
|
|
83
84
|
overflow: hidden;
|
|
84
85
|
text-overflow: ellipsis;
|
|
85
86
|
text-decoration: none;
|
|
86
|
-
font-size: 12px;
|
|
87
87
|
outline: none;
|
|
88
88
|
margin: 0 2px;
|
|
89
89
|
border: 2px solid transparent;
|
|
90
90
|
-webkit-text-stroke: 0.4px transparent;
|
|
91
91
|
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
|
92
|
-
color: ${({ theme, isActive, color, isTitle }) => handleColor(theme, isActive, color, isTitle)};
|
|
92
|
+
color: ${({ theme, isActive, color = "", isTitle }) => handleColor(theme, !!isActive, color, !!isTitle)};
|
|
93
93
|
&:hover {
|
|
94
94
|
color: ${({ theme, color }) => color || theme.colors.brand[800]};
|
|
95
95
|
cursor: pointer;
|
package/dist/cjs/styles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styles.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { Theme } from '@elliemae/pui-theme';\nimport { styled } from '@elliemae/ds-system';\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 if (color) return color;\n if (isTitle) return theme.colors.neutral[700];\n 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:
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAuB;
|
|
4
|
+
"sourcesContent": ["import type { Theme } from '@elliemae/pui-theme';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\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 if (color) return color;\n if (isTitle) return theme.colors.neutral[700];\n 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 min-height: 1.231rem;\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(DSTypography)<Partial<DSBreadcrumbItemPropsT>>`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-decoration: none;\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 || theme.colors.brand[800]};\n cursor: pointer;\n ${({ theme, color }) => `-webkit-text-stroke: 0.4px ${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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAuB;AACvB,2BAA6B;AAG7B,MAAM,cAAc,CAAC,OAAc,UAAmB,OAAe,YAA6B;AAChG,MAAI;AAAU,WAAO,MAAM,OAAO,QAAQ;AAC1C,MAAI;AAAO,WAAO;AAClB,MAAI;AAAS,WAAO,MAAM,OAAO,QAAQ;AACzC,SAAO,MAAM,OAAO,MAAM;AAC5B;AAEA,MAAM,aAAa,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW1B,MAAM,qBAAqB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAU9B,CAAC,EAAE,OAAO,SAAS,cAAc,MACjC,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,wBAAO;AAAA;AAAA;AAAA;AAAA;AAM/B,MAAM,iBAAa,yBAAO,iCAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBASrB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,WACvC,CAAC,EAAE,OAAO,UAAU,QAAQ,IAAI,QAAQ,MAAM,YAAY,OAAO,CAAC,CAAC,UAAU,OAAO,CAAC,CAAC,OAAO;AAAA;AAAA,aAE3F,CAAC,EAAE,OAAO,MAAM,MAAM,SAAS,MAAM,OAAO,MAAM;AAAA;AAAA,MAEzD,CAAC,EAAE,OAAO,MAAM,MAAM,8BAA8B,SAAS,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,MAGhF,CAAC,EAAE,MAAM,MAAM,qBAAqB,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -26,15 +26,16 @@ const DSBreadcrumbItem = ({
|
|
|
26
26
|
children: /* @__PURE__ */ jsx(
|
|
27
27
|
StyledLink,
|
|
28
28
|
{
|
|
29
|
-
|
|
29
|
+
variant: "link",
|
|
30
|
+
component: as,
|
|
30
31
|
href,
|
|
31
32
|
onClick,
|
|
32
|
-
ref: addRef,
|
|
33
33
|
tabIndex: 0,
|
|
34
34
|
isActive: active,
|
|
35
35
|
onKeyDown: (e) => onKeyDown(e, childIndex, onClick),
|
|
36
36
|
isTitle,
|
|
37
37
|
color,
|
|
38
|
+
innerRef: addRef,
|
|
38
39
|
children: label
|
|
39
40
|
}
|
|
40
41
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 '@elliemae/ds-utilities';\nimport type { DSBreadcrumbItemPropsT } from './index.d';\nimport { StyledLink, StyledCrumbWrapper } from './styles';\n\nconst 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 <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
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC0BnB;AAzBJ,SAAS,WAAW,gBAAgB;AAEpC,SAAS,YAAY,0BAA0B;AAE/C,MAAM,mBAAmB,CAAC;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;AACL,MACE;AAAA,EAAC;AAAA;AAAA,IACC,gBAAc,SAAS,SAAS;AAAA,IAChC,eAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACC,GAAG;AAAA,IAEJ;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport type { DSBreadcrumbItemPropsT } from './index.d';\nimport { StyledLink, StyledCrumbWrapper } from './styles';\n\nconst 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 <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 variant=\"link\"\n component={as}\n href={href}\n onClick={onClick}\n tabIndex={0}\n isActive={active}\n onKeyDown={(e: React.KeyboardEvent) => onKeyDown(e, childIndex, onClick)}\n isTitle={isTitle}\n color={color}\n innerRef={addRef}\n >\n {label}\n </StyledLink>\n </StyledCrumbWrapper>\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;\nDSBreadcrumbItem.displayName = 'DSBreadcrumbItem';\n\nconst DSBreadcrumbItemWithSchema = describe(DSBreadcrumbItem);\nDSBreadcrumbItemWithSchema.propTypes = props;\n\nexport { DSBreadcrumbItem, DSBreadcrumbItemWithSchema };\nexport default DSBreadcrumbItem;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC0BnB;AAzBJ,SAAS,WAAW,gBAAgB;AAEpC,SAAS,YAAY,0BAA0B;AAE/C,MAAM,mBAAmB,CAAC;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;AACL,MACE;AAAA,EAAC;AAAA;AAAA,IACC,gBAAc,SAAS,SAAS;AAAA,IAChC,eAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACC,GAAG;AAAA,IAEJ;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,WAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA,UAAU;AAAA,QACV,UAAU;AAAA,QACV,WAAW,CAAC,MAA2B,UAAU,GAAG,YAAY,OAAO;AAAA,QACvE;AAAA,QACA;AAAA,QACA,UAAU;AAAA,QAET;AAAA;AAAA,IACH;AAAA;AACF;AAGF,MAAM,QAAQ;AAAA,EAEZ,oBAAoB,UAAU,OAAO,YAAY,yBAAyB;AAAA,EAE1E,IAAI,UAAU,OAAO,YAAY,yBAAyB;AAAA,EAE1D,QAAQ,UAAU,KAAK,YAAY,aAAa;AAAA,EAEhD,MAAM,UAAU,OAAO,YAAY,WAAW;AAAA,EAE9C,SAAS,UAAU,KAAK,YAAY,kBAAkB;AAAA,EAEtD,SAAS,UAAU,KAAK,YAAY,qBAAqB;AAAA,EAEzD,eAAe,UAAU,KAAK,YAAY,oBAAoB;AAAA,EAE9D,OAAO,UAAU,OAAO,YAAY,YAAY;AAAA,EAEhD,OAAO,UAAU,OAAO,YAAY,YAAY;AAClD;AAEA,iBAAiB,YAAY;AAC7B,iBAAiB,cAAc;AAE/B,MAAM,6BAA6B,SAAS,gBAAgB;AAC5D,2BAA2B,YAAY;AAGvC,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -14,10 +14,8 @@ const useKeyboardNavigation = () => {
|
|
|
14
14
|
} else if (e.key === "ArrowUp" && componentRefIndex !== 0) {
|
|
15
15
|
componentsRef.current[componentRefIndex - 1].focus();
|
|
16
16
|
e.preventDefault();
|
|
17
|
-
} else if (e.key === "Enter") {
|
|
17
|
+
} else if (e.key === "Enter" || e.ctrlKey && e.altKey && e.code === "Space") {
|
|
18
18
|
callback();
|
|
19
|
-
} else if (e.ctrlKey && e.altKey && e.key === " ") {
|
|
20
|
-
componentsRef.current[componentRefIndex].click();
|
|
21
19
|
}
|
|
22
20
|
}, []);
|
|
23
21
|
return [addRef, onKeyDown];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useKeyboardNavigation.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport { 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((e: React.KeyboardEvent, componentRefIndex, callback) => {\n if (e.key === 'ArrowDown' && componentsRef.current[componentRefIndex + 1]) {\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'
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,QAAQ,mBAAmB;AAE7B,MAAM,wBAAwB,MAAM;AACzC,QAAM,gBAAgB,OAA4B,CAAC,CAAC;AAEpD,QAAM,SAAS,YAAY,CAAC,QAA2B;AACrD,QAAI,OAAO,CAAC,cAAc,QAAQ,SAAS,GAAG,GAAG;AAC/C,oBAAc,QAAQ,KAAK,GAAG;AAAA,IAChC;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,YAAY,YAAY,CAAC,GAAwB,mBAAmB,aAAa;AACrF,QAAI,EAAE,QAAQ,eAAe,cAAc,QAAQ,oBAAoB,IAAI;AACzE,oBAAc,QAAQ,oBAAoB,GAAG,MAAM;AACnD,QAAE,eAAe;AAAA,IACnB,WAAW,EAAE,QAAQ,aAAa,sBAAsB,GAAG;AACzD,oBAAc,QAAQ,oBAAoB,GAAG,MAAM;AACnD,QAAE,eAAe;AAAA,IACnB,WAAW,EAAE,QAAQ,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport { 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((e: React.KeyboardEvent, componentRefIndex, callback) => {\n if (e.key === 'ArrowDown' && componentsRef.current[componentRefIndex + 1]) {\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' || (e.ctrlKey && e.altKey && e.code === 'Space')) {\n callback();\n }\n }, []);\n\n return [addRef, onKeyDown];\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,QAAQ,mBAAmB;AAE7B,MAAM,wBAAwB,MAAM;AACzC,QAAM,gBAAgB,OAA4B,CAAC,CAAC;AAEpD,QAAM,SAAS,YAAY,CAAC,QAA2B;AACrD,QAAI,OAAO,CAAC,cAAc,QAAQ,SAAS,GAAG,GAAG;AAC/C,oBAAc,QAAQ,KAAK,GAAG;AAAA,IAChC;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,YAAY,YAAY,CAAC,GAAwB,mBAAmB,aAAa;AACrF,QAAI,EAAE,QAAQ,eAAe,cAAc,QAAQ,oBAAoB,IAAI;AACzE,oBAAc,QAAQ,oBAAoB,GAAG,MAAM;AACnD,QAAE,eAAe;AAAA,IACnB,WAAW,EAAE,QAAQ,aAAa,sBAAsB,GAAG;AACzD,oBAAc,QAAQ,oBAAoB,GAAG,MAAM;AACnD,QAAE,eAAe;AAAA,IACnB,WAAW,EAAE,QAAQ,WAAY,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,SAAU;AAC7E,eAAS;AAAA,IACX;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO,CAAC,QAAQ,SAAS;AAC3B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/styles.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { styled } from "@elliemae/ds-system";
|
|
3
|
+
import { DSTypography } from "@elliemae/ds-typography";
|
|
3
4
|
const handleColor = (theme, isActive, color, isTitle) => {
|
|
4
5
|
if (isActive)
|
|
5
6
|
return theme.colors.neutral[800];
|
|
@@ -24,7 +25,7 @@ const StyledCrumbWrapper = styled.li`
|
|
|
24
25
|
align-items: center;
|
|
25
26
|
flex-shrink: 20;
|
|
26
27
|
transition: flex-shrink 0.1s cubic-bezier(0.64, 0, 0.35, 1);
|
|
27
|
-
height:
|
|
28
|
+
min-height: 1.231rem;
|
|
28
29
|
min-width: 10px;
|
|
29
30
|
&:hover {
|
|
30
31
|
flex-shrink: 0;
|
|
@@ -46,18 +47,17 @@ const StyledContainer = styled.nav`
|
|
|
46
47
|
align-items: center;
|
|
47
48
|
padding: 0;
|
|
48
49
|
`;
|
|
49
|
-
const StyledLink = styled
|
|
50
|
+
const StyledLink = styled(DSTypography)`
|
|
50
51
|
white-space: nowrap;
|
|
51
52
|
overflow: hidden;
|
|
52
53
|
text-overflow: ellipsis;
|
|
53
54
|
text-decoration: none;
|
|
54
|
-
font-size: 12px;
|
|
55
55
|
outline: none;
|
|
56
56
|
margin: 0 2px;
|
|
57
57
|
border: 2px solid transparent;
|
|
58
58
|
-webkit-text-stroke: 0.4px transparent;
|
|
59
59
|
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
|
60
|
-
color: ${({ theme, isActive, color, isTitle }) => handleColor(theme, isActive, color, isTitle)};
|
|
60
|
+
color: ${({ theme, isActive, color = "", isTitle }) => handleColor(theme, !!isActive, color, !!isTitle)};
|
|
61
61
|
&:hover {
|
|
62
62
|
color: ${({ theme, color }) => color || theme.colors.brand[800]};
|
|
63
63
|
cursor: pointer;
|
package/dist/esm/styles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 '@elliemae/ds-system';\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 if (color) return color;\n if (isTitle) return theme.colors.neutral[700];\n 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:
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,cAAc;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { Theme } from '@elliemae/pui-theme';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\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 if (color) return color;\n if (isTitle) return theme.colors.neutral[700];\n 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 min-height: 1.231rem;\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(DSTypography)<Partial<DSBreadcrumbItemPropsT>>`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-decoration: none;\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 || theme.colors.brand[800]};\n cursor: pointer;\n ${({ theme, color }) => `-webkit-text-stroke: 0.4px ${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,YAAY,WAAW;ACCvB,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAG7B,MAAM,cAAc,CAAC,OAAc,UAAmB,OAAe,YAA6B;AAChG,MAAI;AAAU,WAAO,MAAM,OAAO,QAAQ;AAC1C,MAAI;AAAO,WAAO;AAClB,MAAI;AAAS,WAAO,MAAM,OAAO,QAAQ;AACzC,SAAO,MAAM,OAAO,MAAM;AAC5B;AAEA,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,cAAc,MACjC,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,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBASrB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,WACvC,CAAC,EAAE,OAAO,UAAU,QAAQ,IAAI,QAAQ,MAAM,YAAY,OAAO,CAAC,CAAC,UAAU,OAAO,CAAC,CAAC,OAAO;AAAA;AAAA,aAE3F,CAAC,EAAE,OAAO,MAAM,MAAM,SAAS,MAAM,OAAO,MAAM;AAAA;AAAA,MAEzD,CAAC,EAAE,OAAO,MAAM,MAAM,8BAA8B,SAAS,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,MAGhF,CAAC,EAAE,MAAM,MAAM,qBAAqB,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DSBreadcrumbPropsT } from './index.d';
|
|
3
|
+
declare const htmlElements: readonly ["nav", "div", "header", "footer", "main"];
|
|
4
|
+
declare const DSBreadcrumb: {
|
|
5
|
+
({ containerProps, as, label, isTitle, children, trailingSlash, ...rest }: DSBreadcrumbPropsT): React.ReactElement;
|
|
6
|
+
Item: {
|
|
7
|
+
({ active, as, href, isTitle, onClick, label, color, addRef, childIndex, trailingSlash, onKeyDown, ...rest }: import("./index.d").DSBreadcrumbItemPropsT): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
8
|
+
propTypes: {
|
|
9
|
+
containerComponent: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
10
|
+
as: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
11
|
+
active: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
12
|
+
href: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
13
|
+
onClick: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
14
|
+
isTitle: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
15
|
+
trailingSlash: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
16
|
+
label: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
17
|
+
color: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
18
|
+
};
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
propTypes: {
|
|
22
|
+
/** props injected to breadcrumb wrapper */
|
|
23
|
+
containerProps: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
24
|
+
/**
|
|
25
|
+
* Type of element you want the main container to be:
|
|
26
|
+
* 'nav', 'div', 'header', 'footer', 'main'
|
|
27
|
+
*/
|
|
28
|
+
as: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to show the last element of the breadcrumb as a title
|
|
31
|
+
* Also removes trailing slash to show last element as title
|
|
32
|
+
*/
|
|
33
|
+
isTitle: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
34
|
+
/** breadcrumb label */
|
|
35
|
+
label: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
36
|
+
/**
|
|
37
|
+
* Container items to wrap
|
|
38
|
+
*/
|
|
39
|
+
children: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
40
|
+
};
|
|
41
|
+
displayName: string;
|
|
42
|
+
};
|
|
43
|
+
declare const DSBreadcrumbWithSchema: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").DocumentedReactComponent<DSBreadcrumbPropsT>;
|
|
44
|
+
export { DSBreadcrumb, DSBreadcrumbWithSchema, htmlElements };
|
|
45
|
+
export default DSBreadcrumb;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DSBreadcrumbItemPropsT } from './index.d';
|
|
3
|
+
declare const DSBreadcrumbItem: {
|
|
4
|
+
({ active, as, href, isTitle, onClick, label, color, addRef, childIndex, trailingSlash, onKeyDown, ...rest }: DSBreadcrumbItemPropsT): React.ReactElement;
|
|
5
|
+
propTypes: {
|
|
6
|
+
/** inject props to wrapper */
|
|
7
|
+
containerComponent: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
8
|
+
/** render as any html node */
|
|
9
|
+
as: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
10
|
+
/** active item */
|
|
11
|
+
active: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
12
|
+
/** href link */
|
|
13
|
+
href: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
14
|
+
/** on click handler */
|
|
15
|
+
onClick: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
16
|
+
/** style item as title */
|
|
17
|
+
isTitle: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
18
|
+
/** add trailing slash */
|
|
19
|
+
trailingSlash: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
20
|
+
/** item label */
|
|
21
|
+
label: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
22
|
+
/** link color */
|
|
23
|
+
color: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").ReactDescT;
|
|
24
|
+
};
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
declare const DSBreadcrumbItemWithSchema: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").DocumentedReactComponent<DSBreadcrumbItemPropsT>;
|
|
28
|
+
export { DSBreadcrumbItem, DSBreadcrumbItemWithSchema };
|
|
29
|
+
export default DSBreadcrumbItem;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { htmlElements } from './DSBreadcrumb';
|
|
3
|
+
type SafeComponentsT = (typeof htmlElements)[number];
|
|
4
|
+
type SafeItemComponentT = 'a' | 'button' | 'div' | 'span' | 'p';
|
|
5
|
+
interface DSBreadcrumbPropsT {
|
|
6
|
+
containerProps?: unknown;
|
|
7
|
+
as?: SafeComponentsT;
|
|
8
|
+
label?: string;
|
|
9
|
+
isTitle?: boolean;
|
|
10
|
+
trailingSlash?: boolean;
|
|
11
|
+
children: React.ReactElement[];
|
|
12
|
+
}
|
|
13
|
+
interface DSBreadcrumbItemPropsT {
|
|
14
|
+
active?: boolean;
|
|
15
|
+
isActive?: boolean;
|
|
16
|
+
as?: SafeItemComponentT;
|
|
17
|
+
href?: string;
|
|
18
|
+
isTitle?: boolean;
|
|
19
|
+
trailingSlash?: boolean;
|
|
20
|
+
addRef: (ref: HTMLElement) => void;
|
|
21
|
+
onKeyDown: (e: React.KeyboardEvent, componentRefIndex: number, onClick: () => void) => void;
|
|
22
|
+
onClick?: () => void;
|
|
23
|
+
label?: string;
|
|
24
|
+
childIndex: number;
|
|
25
|
+
color?: string | null;
|
|
26
|
+
}
|
|
27
|
+
export type { DSBreadcrumbPropsT, DSBreadcrumbItemPropsT, SafeComponentsT, SafeItemComponentT };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DSBreadcrumbItemPropsT } from './index.d';
|
|
3
|
+
declare const StyledList: import("styled-components").StyledComponent<keyof JSX.IntrinsicElements, import("@elliemae/ds-system").Theme, Record<string, unknown> & object, never>;
|
|
4
|
+
declare const StyledCrumbWrapper: import("styled-components").StyledComponent<keyof JSX.IntrinsicElements, import("@elliemae/ds-system").Theme, Record<string, unknown> & Partial<DSBreadcrumbItemPropsT>, never>;
|
|
5
|
+
declare const StyledContainer: import("styled-components").StyledComponent<keyof JSX.IntrinsicElements, import("@elliemae/ds-system").Theme, Record<string, unknown> & object, never>;
|
|
6
|
+
declare const StyledLink: import("styled-components").StyledComponent<import("react").FC<import("@elliemae/ds-typography/dist/types/react-desc-prop-types").DSTypographyT.Props>, import("@elliemae/ds-system").Theme, Partial<DSBreadcrumbItemPropsT>, never>;
|
|
7
|
+
export { StyledList, StyledCrumbWrapper, StyledContainer, StyledLink };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-breadcrumb",
|
|
3
|
-
"version": "3.14.0-
|
|
3
|
+
"version": "3.14.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Breadcrumb",
|
|
6
6
|
"files": [
|
|
@@ -51,8 +51,9 @@
|
|
|
51
51
|
"indent": 4
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@elliemae/ds-system": "3.14.0-
|
|
55
|
-
"@elliemae/ds-
|
|
54
|
+
"@elliemae/ds-system": "3.14.0-rc.0",
|
|
55
|
+
"@elliemae/ds-typography": "3.14.0-rc.0",
|
|
56
|
+
"@elliemae/ds-utilities": "3.14.0-rc.0"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"@elliemae/pui-theme": "~2.6.0",
|