@elliemae/ds-breadcrumb 2.2.0 → 2.3.0-alpha.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 +81 -97
- package/cjs/DSBreadcrumb.js.map +7 -0
- package/cjs/DSBreadcrumbItem.js +80 -92
- package/cjs/DSBreadcrumbItem.js.map +7 -0
- package/cjs/hooks/useKeyboardNavigation.js +42 -15
- package/cjs/hooks/useKeyboardNavigation.js.map +7 -0
- package/cjs/index.d.js +27 -2
- package/cjs/index.d.js.map +7 -0
- package/cjs/index.js +37 -15
- package/cjs/index.js.map +7 -0
- package/cjs/styles.js +105 -66
- package/cjs/styles.js.map +7 -0
- package/esm/DSBreadcrumb.js +48 -79
- package/esm/DSBreadcrumb.js.map +7 -0
- package/esm/DSBreadcrumbItem.js +50 -80
- package/esm/DSBreadcrumbItem.js.map +7 -0
- package/esm/hooks/useKeyboardNavigation.js +11 -9
- package/esm/hooks/useKeyboardNavigation.js.map +7 -0
- package/esm/index.d.js +2 -1
- package/esm/index.d.js.map +7 -0
- package/esm/index.js +8 -2
- package/esm/index.js.map +7 -0
- package/esm/styles.js +76 -55
- package/esm/styles.js.map +7 -0
- package/package.json +2 -2
package/esm/styles.js
CHANGED
|
@@ -1,57 +1,78 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
3
|
const handleColor = (theme, isActive, color, isTitle) => {
|
|
4
|
-
if (isActive)
|
|
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];
|
|
5
12
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
color
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
|
@@ -0,0 +1,7 @@
|
|
|
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;A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
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Breadcrumb",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"build": "node ../../scripts/build/build.js"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@elliemae/ds-system": "2.
|
|
51
|
+
"@elliemae/ds-system": "2.3.0-alpha.3",
|
|
52
52
|
"react-desc": "~4.1.3"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|