@zendeskgarden/react-breadcrumbs 9.0.0-next.16 → 9.0.0-next.18
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/esm/elements/Breadcrumb.js +1 -1
- package/dist/esm/styled/StyledBreadcrumb.js +1 -1
- package/dist/esm/styled/StyledBreadcrumbItem.js +17 -7
- package/dist/esm/styled/StyledChevronIcon.js +5 -2
- package/dist/index.cjs.js +22 -9
- package/dist/typings/styled/StyledBreadcrumbItem.d.ts +3 -2
- package/package.json +3 -3
|
@@ -22,7 +22,7 @@ const Breadcrumb = forwardRef((props, ref) => {
|
|
|
22
22
|
const isLastItem = index === totalChildren - 1;
|
|
23
23
|
if (isLastItem) {
|
|
24
24
|
return React__default.createElement(StyledBreadcrumbItem, {
|
|
25
|
-
isCurrent: true
|
|
25
|
+
$isCurrent: true
|
|
26
26
|
}, cloneElement(child, getCurrentPageProps()));
|
|
27
27
|
}
|
|
28
28
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement(StyledBreadcrumbItem, null, child), React__default.createElement(StyledCenteredBreadcrumbItem, null, React__default.createElement(StyledChevronIcon, null)));
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
10
10
|
const COMPONENT_ID = 'breadcrumbs.list';
|
|
11
11
|
const StyledBreadcrumb = styled.ol.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.18'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledBreadcrumb",
|
|
16
16
|
componentId: "sc-11jrinn-0"
|
|
@@ -5,31 +5,41 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import {
|
|
8
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getLineHeight, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'breadcrumbs.item';
|
|
11
|
-
const
|
|
11
|
+
const sizeStyles = _ref => {
|
|
12
12
|
let {
|
|
13
|
-
|
|
13
|
+
theme
|
|
14
14
|
} = _ref;
|
|
15
|
-
return css(["
|
|
15
|
+
return css(["line-height:", ";white-space:nowrap;& > :link,& > :visited{white-space:inherit;}"], getLineHeight(theme.space.base * 5, theme.fontSizes.md));
|
|
16
|
+
};
|
|
17
|
+
const colorStyles = _ref2 => {
|
|
18
|
+
let {
|
|
19
|
+
$isCurrent,
|
|
20
|
+
theme
|
|
21
|
+
} = _ref2;
|
|
22
|
+
return css(["color:", ";", ""], $isCurrent ? getColor({
|
|
23
|
+
variable: 'foreground.subtle',
|
|
24
|
+
theme
|
|
25
|
+
}) : 'inherit', $isCurrent && `
|
|
16
26
|
& > :link,
|
|
17
27
|
& > :visited,
|
|
18
28
|
& > :link:hover,
|
|
19
29
|
& > :visited:hover,
|
|
20
30
|
& > :link:focus,
|
|
21
31
|
& > :visited:focus {
|
|
22
|
-
color: inherit;
|
|
32
|
+
color: inherit; /* [1] */
|
|
23
33
|
}
|
|
24
34
|
`);
|
|
25
35
|
};
|
|
26
36
|
const StyledBreadcrumbItem = styled.li.attrs({
|
|
27
37
|
'data-garden-id': COMPONENT_ID,
|
|
28
|
-
'data-garden-version': '9.0.0-next.
|
|
38
|
+
'data-garden-version': '9.0.0-next.18'
|
|
29
39
|
}).withConfig({
|
|
30
40
|
displayName: "StyledBreadcrumbItem",
|
|
31
41
|
componentId: "sc-r0suq7-0"
|
|
32
|
-
})(["
|
|
42
|
+
})(["font-size:inherit;", " ", ";", ";"], sizeStyles, colorStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
33
43
|
StyledBreadcrumbItem.defaultProps = {
|
|
34
44
|
theme: DEFAULT_THEME
|
|
35
45
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React__default from 'react';
|
|
8
8
|
import styled from 'styled-components';
|
|
9
9
|
import { em } from 'polished';
|
|
10
|
-
import {
|
|
10
|
+
import { getColor, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
11
11
|
import SvgChevronRightStroke from '../node_modules/@zendeskgarden/svg-icons/src/12/chevron-right-stroke.svg.js';
|
|
12
12
|
|
|
13
13
|
const StyledChevronIcon = styled(_ref => {
|
|
@@ -23,7 +23,10 @@ const StyledChevronIcon = styled(_ref => {
|
|
|
23
23
|
}).withConfig({
|
|
24
24
|
displayName: "StyledChevronIcon",
|
|
25
25
|
componentId: "sc-9r9qrm-0"
|
|
26
|
-
})(["transform:", ";margin:0 ", ";color:", ";"],
|
|
26
|
+
})(["transform:", ";margin:0 ", ";color:", ";"], p => p.theme.rtl && `rotate(180deg);`, p => em(p.theme.space.base, p.theme.fontSizes.md), p => getColor({
|
|
27
|
+
variable: 'foreground.subtle',
|
|
28
|
+
theme: p.theme
|
|
29
|
+
}));
|
|
27
30
|
StyledChevronIcon.defaultProps = {
|
|
28
31
|
theme: DEFAULT_THEME
|
|
29
32
|
};
|
package/dist/index.cjs.js
CHANGED
|
@@ -38,7 +38,7 @@ var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
|
38
38
|
const COMPONENT_ID$1 = 'breadcrumbs.list';
|
|
39
39
|
const StyledBreadcrumb = styled__default.default.ol.attrs({
|
|
40
40
|
'data-garden-id': COMPONENT_ID$1,
|
|
41
|
-
'data-garden-version': '9.0.0-next.
|
|
41
|
+
'data-garden-version': '9.0.0-next.18'
|
|
42
42
|
}).withConfig({
|
|
43
43
|
displayName: "StyledBreadcrumb",
|
|
44
44
|
componentId: "sc-11jrinn-0"
|
|
@@ -76,34 +76,47 @@ const StyledChevronIcon = styled__default.default(_ref => {
|
|
|
76
76
|
}).withConfig({
|
|
77
77
|
displayName: "StyledChevronIcon",
|
|
78
78
|
componentId: "sc-9r9qrm-0"
|
|
79
|
-
})(["transform:", ";margin:0 ", ";color:", ";"],
|
|
79
|
+
})(["transform:", ";margin:0 ", ";color:", ";"], p => p.theme.rtl && `rotate(180deg);`, p => polished.em(p.theme.space.base, p.theme.fontSizes.md), p => reactTheming.getColor({
|
|
80
|
+
variable: 'foreground.subtle',
|
|
81
|
+
theme: p.theme
|
|
82
|
+
}));
|
|
80
83
|
StyledChevronIcon.defaultProps = {
|
|
81
84
|
theme: reactTheming.DEFAULT_THEME
|
|
82
85
|
};
|
|
83
86
|
|
|
84
87
|
const COMPONENT_ID = 'breadcrumbs.item';
|
|
85
|
-
const
|
|
88
|
+
const sizeStyles = _ref => {
|
|
86
89
|
let {
|
|
87
|
-
|
|
90
|
+
theme
|
|
88
91
|
} = _ref;
|
|
89
|
-
return styled.css(["
|
|
92
|
+
return styled.css(["line-height:", ";white-space:nowrap;& > :link,& > :visited{white-space:inherit;}"], reactTheming.getLineHeight(theme.space.base * 5, theme.fontSizes.md));
|
|
93
|
+
};
|
|
94
|
+
const colorStyles = _ref2 => {
|
|
95
|
+
let {
|
|
96
|
+
$isCurrent,
|
|
97
|
+
theme
|
|
98
|
+
} = _ref2;
|
|
99
|
+
return styled.css(["color:", ";", ""], $isCurrent ? reactTheming.getColor({
|
|
100
|
+
variable: 'foreground.subtle',
|
|
101
|
+
theme
|
|
102
|
+
}) : 'inherit', $isCurrent && `
|
|
90
103
|
& > :link,
|
|
91
104
|
& > :visited,
|
|
92
105
|
& > :link:hover,
|
|
93
106
|
& > :visited:hover,
|
|
94
107
|
& > :link:focus,
|
|
95
108
|
& > :visited:focus {
|
|
96
|
-
color: inherit;
|
|
109
|
+
color: inherit; /* [1] */
|
|
97
110
|
}
|
|
98
111
|
`);
|
|
99
112
|
};
|
|
100
113
|
const StyledBreadcrumbItem = styled__default.default.li.attrs({
|
|
101
114
|
'data-garden-id': COMPONENT_ID,
|
|
102
|
-
'data-garden-version': '9.0.0-next.
|
|
115
|
+
'data-garden-version': '9.0.0-next.18'
|
|
103
116
|
}).withConfig({
|
|
104
117
|
displayName: "StyledBreadcrumbItem",
|
|
105
118
|
componentId: "sc-r0suq7-0"
|
|
106
|
-
})(["
|
|
119
|
+
})(["font-size:inherit;", " ", ";", ";"], sizeStyles, colorStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
107
120
|
StyledBreadcrumbItem.defaultProps = {
|
|
108
121
|
theme: reactTheming.DEFAULT_THEME
|
|
109
122
|
};
|
|
@@ -128,7 +141,7 @@ const Breadcrumb = React.forwardRef((props, ref) => {
|
|
|
128
141
|
const isLastItem = index === totalChildren - 1;
|
|
129
142
|
if (isLastItem) {
|
|
130
143
|
return React__namespace.default.createElement(StyledBreadcrumbItem, {
|
|
131
|
-
isCurrent: true
|
|
144
|
+
$isCurrent: true
|
|
132
145
|
}, React.cloneElement(child, getCurrentPageProps()));
|
|
133
146
|
}
|
|
134
147
|
return React__namespace.default.createElement(React__namespace.default.Fragment, null, React__namespace.default.createElement(StyledBreadcrumbItem, null, child), React__namespace.default.createElement(StyledCenteredBreadcrumbItem, null, React__namespace.default.createElement(StyledChevronIcon, null)));
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
+
import { DefaultTheme } from 'styled-components';
|
|
7
8
|
export interface IStyledBreadcrumbItemProps {
|
|
8
|
-
isCurrent?: boolean;
|
|
9
|
+
$isCurrent?: boolean;
|
|
9
10
|
}
|
|
10
|
-
export declare const StyledBreadcrumbItem: import("styled-components").StyledComponent<"li",
|
|
11
|
+
export declare const StyledBreadcrumbItem: import("styled-components").StyledComponent<"li", DefaultTheme, {
|
|
11
12
|
'data-garden-id': string;
|
|
12
13
|
'data-garden-version': string;
|
|
13
14
|
} & IStyledBreadcrumbItemProps, "data-garden-id" | "data-garden-version">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-breadcrumbs",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.18",
|
|
4
4
|
"description": "Components relating to breadcrumbs in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"styled-components": "^5.3.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@zendeskgarden/react-theming": "^9.0.0-next.
|
|
35
|
+
"@zendeskgarden/react-theming": "^9.0.0-next.18",
|
|
36
36
|
"@zendeskgarden/svg-icons": "7.1.1"
|
|
37
37
|
},
|
|
38
38
|
"keywords": [
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"zendeskgarden:src": "src/index.ts",
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "31680e30a7c9b1f2bd1f8f711f540dfaaf4ee4ec"
|
|
49
49
|
}
|