@zendeskgarden/react-buttons 9.0.0-next.8 → 9.0.0-next.9
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/IconButton.js +1 -1
- package/dist/esm/elements/components/EndIcon.js +10 -3
- package/dist/esm/elements/components/StartIcon.js +10 -3
- package/dist/esm/styled/StyledAnchor.js +1 -1
- package/dist/esm/styled/StyledButton.js +1 -1
- package/dist/esm/styled/StyledExternalIcon.js +1 -1
- package/dist/esm/styled/StyledIcon.js +6 -15
- package/dist/esm/styled/StyledIconButton.js +1 -1
- package/dist/esm/styled/StyledSplitButton.js +1 -1
- package/dist/index.cjs.js +31 -25
- package/dist/typings/elements/components/EndIcon.d.ts +1 -1
- package/dist/typings/elements/components/StartIcon.d.ts +1 -1
- package/dist/typings/styled/StyledIcon.d.ts +4 -4
- package/package.json +3 -3
|
@@ -27,7 +27,7 @@ const IconButton = forwardRef((_ref, ref) => {
|
|
|
27
27
|
}, otherProps, {
|
|
28
28
|
focusInset: otherProps.focusInset || focusInset
|
|
29
29
|
}), React__default.createElement(StyledIcon, {
|
|
30
|
-
isRotated: isRotated
|
|
30
|
+
$isRotated: isRotated
|
|
31
31
|
}, children));
|
|
32
32
|
});
|
|
33
33
|
IconButton.displayName = 'IconButton';
|
|
@@ -12,9 +12,16 @@ import '../../styled/StyledExternalIcon.js';
|
|
|
12
12
|
import { StyledIcon } from '../../styled/StyledIcon.js';
|
|
13
13
|
import '../../styled/StyledIconButton.js';
|
|
14
14
|
|
|
15
|
-
const EndIconComponent =
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const EndIconComponent = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
isRotated,
|
|
18
|
+
...props
|
|
19
|
+
} = _ref;
|
|
20
|
+
return React__default.createElement(StyledIcon, Object.assign({
|
|
21
|
+
$position: "end",
|
|
22
|
+
$isRotated: isRotated
|
|
23
|
+
}, props));
|
|
24
|
+
};
|
|
18
25
|
EndIconComponent.displayName = 'Button.EndIcon';
|
|
19
26
|
const EndIcon = EndIconComponent;
|
|
20
27
|
|
|
@@ -12,9 +12,16 @@ import '../../styled/StyledExternalIcon.js';
|
|
|
12
12
|
import { StyledIcon } from '../../styled/StyledIcon.js';
|
|
13
13
|
import '../../styled/StyledIconButton.js';
|
|
14
14
|
|
|
15
|
-
const StartIconComponent =
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const StartIconComponent = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
isRotated,
|
|
18
|
+
...props
|
|
19
|
+
} = _ref;
|
|
20
|
+
return React__default.createElement(StyledIcon, Object.assign({
|
|
21
|
+
$position: "start",
|
|
22
|
+
$isRotated: isRotated
|
|
23
|
+
}, props));
|
|
24
|
+
};
|
|
18
25
|
StartIconComponent.displayName = 'Button.StartIcon';
|
|
19
26
|
const StartIcon = StartIconComponent;
|
|
20
27
|
|
|
@@ -11,7 +11,7 @@ import { StyledButton } from './StyledButton.js';
|
|
|
11
11
|
const COMPONENT_ID = 'buttons.anchor';
|
|
12
12
|
const StyledAnchor = styled(StyledButton).attrs(props => ({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.9',
|
|
15
15
|
as: 'a',
|
|
16
16
|
dir: props.theme.rtl ? 'rtl' : undefined,
|
|
17
17
|
isLink: true,
|
|
@@ -142,7 +142,7 @@ const sizeStyles = props => {
|
|
|
142
142
|
};
|
|
143
143
|
const StyledButton = styled.button.attrs(props => ({
|
|
144
144
|
'data-garden-id': COMPONENT_ID,
|
|
145
|
-
'data-garden-version': '9.0.0-next.
|
|
145
|
+
'data-garden-version': '9.0.0-next.9',
|
|
146
146
|
type: props.type || 'button'
|
|
147
147
|
})).withConfig({
|
|
148
148
|
displayName: "StyledButton",
|
|
@@ -11,7 +11,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
11
11
|
const COMPONENT_ID = 'buttons.external_icon';
|
|
12
12
|
const StyledExternalIcon = styled(SvgNewWindowStroke).attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.9'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledExternalIcon",
|
|
17
17
|
componentId: "sc-16oz07e-0"
|
|
@@ -5,34 +5,25 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import
|
|
9
|
-
import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
8
|
+
import { StyledBaseIcon, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
|
|
10
9
|
|
|
11
10
|
const COMPONENT_ID = 'buttons.icon';
|
|
12
11
|
const sizeStyles = props => {
|
|
13
12
|
let marginProperty;
|
|
14
|
-
if (props
|
|
13
|
+
if (props.$position === 'start') {
|
|
15
14
|
marginProperty = `margin-${props.theme.rtl ? 'left' : 'right'}`;
|
|
16
|
-
} else if (props
|
|
15
|
+
} else if (props.$position === 'end') {
|
|
17
16
|
marginProperty = `margin-${props.theme.rtl ? 'right' : 'left'}`;
|
|
18
17
|
}
|
|
19
18
|
return marginProperty && css(["", ":", "px;"], marginProperty, props.theme.space.base * 2);
|
|
20
19
|
};
|
|
21
|
-
const StyledIcon = styled(
|
|
22
|
-
let {
|
|
23
|
-
children,
|
|
24
|
-
isRotated,
|
|
25
|
-
theme,
|
|
26
|
-
...props
|
|
27
|
-
} = _ref;
|
|
28
|
-
return React__default.cloneElement(Children.only(children), props);
|
|
29
|
-
}).attrs({
|
|
20
|
+
const StyledIcon = styled(StyledBaseIcon).attrs({
|
|
30
21
|
'data-garden-id': COMPONENT_ID,
|
|
31
|
-
'data-garden-version': '9.0.0-next.
|
|
22
|
+
'data-garden-version': '9.0.0-next.9'
|
|
32
23
|
}).withConfig({
|
|
33
24
|
displayName: "StyledIcon",
|
|
34
25
|
componentId: "sc-19meqgg-0"
|
|
35
|
-
})(["transform:", ";transition:transform 0.25s ease-in-out,color 0.25s ease-in-out;", ";", ";"], props => props
|
|
26
|
+
})(["transform:", ";transition:transform 0.25s ease-in-out,color 0.25s ease-in-out;", ";", ";"], props => props.$isRotated && `rotate(${props.theme.rtl ? '-' : '+'}180deg)`, props => sizeStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
36
27
|
StyledIcon.defaultProps = {
|
|
37
28
|
theme: DEFAULT_THEME
|
|
38
29
|
};
|
|
@@ -27,7 +27,7 @@ const iconStyles = props => {
|
|
|
27
27
|
};
|
|
28
28
|
const StyledIconButton = styled(StyledButton).attrs({
|
|
29
29
|
'data-garden-id': COMPONENT_ID,
|
|
30
|
-
'data-garden-version': '9.0.0-next.
|
|
30
|
+
'data-garden-version': '9.0.0-next.9'
|
|
31
31
|
}).withConfig({
|
|
32
32
|
displayName: "StyledIconButton",
|
|
33
33
|
componentId: "sc-1t0ughp-0"
|
|
@@ -10,7 +10,7 @@ import { retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-the
|
|
|
10
10
|
const COMPONENT_ID = 'buttons.button_group_view';
|
|
11
11
|
const StyledSplitButton = styled.div.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.9'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledSplitButton",
|
|
16
16
|
componentId: "sc-1u4v04v-0"
|
package/dist/index.cjs.js
CHANGED
|
@@ -41,7 +41,7 @@ const SIZE = ['small', 'medium', 'large'];
|
|
|
41
41
|
const COMPONENT_ID$5 = 'buttons.button_group_view';
|
|
42
42
|
const StyledSplitButton = styled__default.default.div.attrs({
|
|
43
43
|
'data-garden-id': COMPONENT_ID$5,
|
|
44
|
-
'data-garden-version': '9.0.0-next.
|
|
44
|
+
'data-garden-version': '9.0.0-next.9'
|
|
45
45
|
}).withConfig({
|
|
46
46
|
displayName: "StyledSplitButton",
|
|
47
47
|
componentId: "sc-1u4v04v-0"
|
|
@@ -53,28 +53,20 @@ StyledSplitButton.defaultProps = {
|
|
|
53
53
|
const COMPONENT_ID$4 = 'buttons.icon';
|
|
54
54
|
const sizeStyles$1 = props => {
|
|
55
55
|
let marginProperty;
|
|
56
|
-
if (props
|
|
56
|
+
if (props.$position === 'start') {
|
|
57
57
|
marginProperty = `margin-${props.theme.rtl ? 'left' : 'right'}`;
|
|
58
|
-
} else if (props
|
|
58
|
+
} else if (props.$position === 'end') {
|
|
59
59
|
marginProperty = `margin-${props.theme.rtl ? 'right' : 'left'}`;
|
|
60
60
|
}
|
|
61
61
|
return marginProperty && styled.css(["", ":", "px;"], marginProperty, props.theme.space.base * 2);
|
|
62
62
|
};
|
|
63
|
-
const StyledIcon = styled__default.default(
|
|
64
|
-
let {
|
|
65
|
-
children,
|
|
66
|
-
isRotated,
|
|
67
|
-
theme,
|
|
68
|
-
...props
|
|
69
|
-
} = _ref;
|
|
70
|
-
return React__namespace.default.cloneElement(React.Children.only(children), props);
|
|
71
|
-
}).attrs({
|
|
63
|
+
const StyledIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({
|
|
72
64
|
'data-garden-id': COMPONENT_ID$4,
|
|
73
|
-
'data-garden-version': '9.0.0-next.
|
|
65
|
+
'data-garden-version': '9.0.0-next.9'
|
|
74
66
|
}).withConfig({
|
|
75
67
|
displayName: "StyledIcon",
|
|
76
68
|
componentId: "sc-19meqgg-0"
|
|
77
|
-
})(["transform:", ";transition:transform 0.25s ease-in-out,color 0.25s ease-in-out;", ";", ";"], props => props
|
|
69
|
+
})(["transform:", ";transition:transform 0.25s ease-in-out,color 0.25s ease-in-out;", ";", ";"], props => props.$isRotated && `rotate(${props.theme.rtl ? '-' : '+'}180deg)`, props => sizeStyles$1(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
78
70
|
StyledIcon.defaultProps = {
|
|
79
71
|
theme: reactTheming.DEFAULT_THEME
|
|
80
72
|
};
|
|
@@ -211,7 +203,7 @@ const sizeStyles = props => {
|
|
|
211
203
|
};
|
|
212
204
|
const StyledButton = styled__default.default.button.attrs(props => ({
|
|
213
205
|
'data-garden-id': COMPONENT_ID$3,
|
|
214
|
-
'data-garden-version': '9.0.0-next.
|
|
206
|
+
'data-garden-version': '9.0.0-next.9',
|
|
215
207
|
type: props.type || 'button'
|
|
216
208
|
})).withConfig({
|
|
217
209
|
displayName: "StyledButton",
|
|
@@ -224,7 +216,7 @@ StyledButton.defaultProps = {
|
|
|
224
216
|
const COMPONENT_ID$2 = 'buttons.anchor';
|
|
225
217
|
const StyledAnchor = styled__default.default(StyledButton).attrs(props => ({
|
|
226
218
|
'data-garden-id': COMPONENT_ID$2,
|
|
227
|
-
'data-garden-version': '9.0.0-next.
|
|
219
|
+
'data-garden-version': '9.0.0-next.9',
|
|
228
220
|
as: 'a',
|
|
229
221
|
dir: props.theme.rtl ? 'rtl' : undefined,
|
|
230
222
|
isLink: true,
|
|
@@ -258,7 +250,7 @@ var SvgNewWindowStroke = function SvgNewWindowStroke(props) {
|
|
|
258
250
|
const COMPONENT_ID$1 = 'buttons.external_icon';
|
|
259
251
|
const StyledExternalIcon = styled__default.default(SvgNewWindowStroke).attrs({
|
|
260
252
|
'data-garden-id': COMPONENT_ID$1,
|
|
261
|
-
'data-garden-version': '9.0.0-next.
|
|
253
|
+
'data-garden-version': '9.0.0-next.9'
|
|
262
254
|
}).withConfig({
|
|
263
255
|
displayName: "StyledExternalIcon",
|
|
264
256
|
componentId: "sc-16oz07e-0"
|
|
@@ -285,7 +277,7 @@ const iconStyles = props => {
|
|
|
285
277
|
};
|
|
286
278
|
const StyledIconButton = styled__default.default(StyledButton).attrs({
|
|
287
279
|
'data-garden-id': COMPONENT_ID,
|
|
288
|
-
'data-garden-version': '9.0.0-next.
|
|
280
|
+
'data-garden-version': '9.0.0-next.9'
|
|
289
281
|
}).withConfig({
|
|
290
282
|
displayName: "StyledIconButton",
|
|
291
283
|
componentId: "sc-1t0ughp-0"
|
|
@@ -299,15 +291,29 @@ const useSplitButtonContext = () => {
|
|
|
299
291
|
return React.useContext(SplitButtonContext);
|
|
300
292
|
};
|
|
301
293
|
|
|
302
|
-
const StartIconComponent =
|
|
303
|
-
|
|
304
|
-
|
|
294
|
+
const StartIconComponent = _ref => {
|
|
295
|
+
let {
|
|
296
|
+
isRotated,
|
|
297
|
+
...props
|
|
298
|
+
} = _ref;
|
|
299
|
+
return React__namespace.default.createElement(StyledIcon, Object.assign({
|
|
300
|
+
$position: "start",
|
|
301
|
+
$isRotated: isRotated
|
|
302
|
+
}, props));
|
|
303
|
+
};
|
|
305
304
|
StartIconComponent.displayName = 'Button.StartIcon';
|
|
306
305
|
const StartIcon = StartIconComponent;
|
|
307
306
|
|
|
308
|
-
const EndIconComponent =
|
|
309
|
-
|
|
310
|
-
|
|
307
|
+
const EndIconComponent = _ref => {
|
|
308
|
+
let {
|
|
309
|
+
isRotated,
|
|
310
|
+
...props
|
|
311
|
+
} = _ref;
|
|
312
|
+
return React__namespace.default.createElement(StyledIcon, Object.assign({
|
|
313
|
+
$position: "end",
|
|
314
|
+
$isRotated: isRotated
|
|
315
|
+
}, props));
|
|
316
|
+
};
|
|
311
317
|
EndIconComponent.displayName = 'Button.EndIcon';
|
|
312
318
|
const EndIcon = EndIconComponent;
|
|
313
319
|
|
|
@@ -389,7 +395,7 @@ const IconButton = React.forwardRef((_ref, ref) => {
|
|
|
389
395
|
}, otherProps, {
|
|
390
396
|
focusInset: otherProps.focusInset || focusInset
|
|
391
397
|
}), React__namespace.default.createElement(StyledIcon, {
|
|
392
|
-
isRotated: isRotated
|
|
398
|
+
$isRotated: isRotated
|
|
393
399
|
}, children));
|
|
394
400
|
});
|
|
395
401
|
IconButton.displayName = 'IconButton';
|
|
@@ -10,6 +10,6 @@ import { IButtonIconProps } from '../../types';
|
|
|
10
10
|
* @extends SVGAttributes<SVGElement>
|
|
11
11
|
*/
|
|
12
12
|
export declare const EndIcon: {
|
|
13
|
-
(props: IButtonIconProps): React.JSX.Element;
|
|
13
|
+
({ isRotated, ...props }: IButtonIconProps): React.JSX.Element;
|
|
14
14
|
displayName: string;
|
|
15
15
|
};
|
|
@@ -10,6 +10,6 @@ import { IButtonIconProps } from '../../types';
|
|
|
10
10
|
* @extends SVGAttributes<SVGElement>
|
|
11
11
|
*/
|
|
12
12
|
export declare const StartIcon: {
|
|
13
|
-
(props: IButtonIconProps): React.JSX.Element;
|
|
13
|
+
({ isRotated, ...props }: IButtonIconProps): React.JSX.Element;
|
|
14
14
|
displayName: string;
|
|
15
15
|
};
|
|
@@ -4,13 +4,13 @@
|
|
|
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
|
+
/// <reference types="react" />
|
|
7
8
|
import { DefaultTheme } from 'styled-components';
|
|
8
|
-
import React from 'react';
|
|
9
9
|
interface IStyledIconProps {
|
|
10
|
-
isRotated: boolean;
|
|
11
|
-
position?: 'start' | 'end';
|
|
10
|
+
$isRotated: boolean;
|
|
11
|
+
$position?: 'start' | 'end';
|
|
12
12
|
}
|
|
13
|
-
export declare const StyledIcon: import("styled-components").StyledComponent<({ children,
|
|
13
|
+
export declare const StyledIcon: import("styled-components").StyledComponent<({ children, theme, ...props }: any) => import("react").DetailedReactHTMLElement<any, HTMLElement>, DefaultTheme, {
|
|
14
14
|
'data-garden-id': string;
|
|
15
15
|
'data-garden-version': string;
|
|
16
16
|
} & IStyledIconProps, "data-garden-id" | "data-garden-version">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-buttons",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.9",
|
|
4
4
|
"description": "Components relating to buttons in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"styled-components": "^5.3.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@zendeskgarden/react-theming": "^9.0.0-next.
|
|
36
|
+
"@zendeskgarden/react-theming": "^9.0.0-next.9",
|
|
37
37
|
"@zendeskgarden/svg-icons": "7.0.0"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"zendeskgarden:src": "src/index.ts",
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "771281b562d376a6aee04b0cd71dd888b3ae4a1d"
|
|
50
50
|
}
|