@zendeskgarden/react-buttons 9.0.0-next.17 → 9.0.0-next.19
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/Anchor.js +4 -1
- package/dist/esm/elements/Button.js +2 -1
- package/dist/esm/styled/StyledAnchor.js +1 -1
- package/dist/esm/styled/StyledButton.js +2 -2
- package/dist/esm/styled/StyledExternalIcon.js +1 -1
- package/dist/esm/styled/StyledIcon.js +1 -1
- package/dist/esm/styled/StyledIconButton.js +1 -1
- package/dist/esm/styled/StyledSplitButton.js +1 -1
- package/dist/index.cjs.js +13 -9
- package/dist/typings/styled/StyledAnchor.d.ts +1 -1
- package/dist/typings/styled/StyledButton.d.ts +5 -7
- package/dist/typings/styled/StyledIconButton.d.ts +1 -2
- package/dist/typings/types/index.d.ts +2 -0
- package/package.json +3 -3
|
@@ -19,6 +19,7 @@ const Anchor = forwardRef((_ref, ref) => {
|
|
|
19
19
|
children,
|
|
20
20
|
isExternal,
|
|
21
21
|
externalIconLabel,
|
|
22
|
+
isUnderlined = true,
|
|
22
23
|
...otherProps
|
|
23
24
|
} = _ref;
|
|
24
25
|
let anchorProps = otherProps;
|
|
@@ -36,7 +37,8 @@ const Anchor = forwardRef((_ref, ref) => {
|
|
|
36
37
|
};
|
|
37
38
|
const iconAriaLabel = useText(Anchor, checkProps, isExternal ? 'externalIconLabel' : 'noIconLabel', '(opens in a new tab)');
|
|
38
39
|
return React__default.createElement(StyledAnchor, Object.assign({
|
|
39
|
-
ref: ref
|
|
40
|
+
ref: ref,
|
|
41
|
+
$isUnderlined: isUnderlined
|
|
40
42
|
}, anchorProps), children, isExternal &&
|
|
41
43
|
React__default.createElement(StyledExternalIcon, {
|
|
42
44
|
role: "img",
|
|
@@ -48,6 +50,7 @@ Anchor.displayName = 'Anchor';
|
|
|
48
50
|
Anchor.propTypes = {
|
|
49
51
|
isExternal: PropTypes.bool,
|
|
50
52
|
isDanger: PropTypes.bool,
|
|
53
|
+
isUnderlined: PropTypes.bool,
|
|
51
54
|
externalIconLabel: PropTypes.string
|
|
52
55
|
};
|
|
53
56
|
|
|
@@ -21,7 +21,8 @@ const ButtonComponent = forwardRef((props, ref) => {
|
|
|
21
21
|
const splitButtonContext = useSplitButtonContext();
|
|
22
22
|
const computedProps = {
|
|
23
23
|
...props,
|
|
24
|
-
focusInset: props.focusInset || splitButtonContext
|
|
24
|
+
focusInset: props.focusInset || splitButtonContext,
|
|
25
|
+
$isUnderlined: props.isLink
|
|
25
26
|
};
|
|
26
27
|
return React__default.createElement(StyledButton, Object.assign({}, computedProps, {
|
|
27
28
|
ref: ref
|
|
@@ -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.19',
|
|
15
15
|
as: 'a',
|
|
16
16
|
dir: props.theme.rtl ? 'rtl' : undefined,
|
|
17
17
|
isLink: true,
|
|
@@ -308,12 +308,12 @@ const sizeStyles = props => {
|
|
|
308
308
|
};
|
|
309
309
|
const StyledButton = styled.button.attrs(props => ({
|
|
310
310
|
'data-garden-id': props['data-garden-id'] || COMPONENT_ID,
|
|
311
|
-
'data-garden-version': '9.0.0-next.
|
|
311
|
+
'data-garden-version': '9.0.0-next.19',
|
|
312
312
|
type: props.type || 'button'
|
|
313
313
|
})).withConfig({
|
|
314
314
|
displayName: "StyledButton",
|
|
315
315
|
componentId: "sc-qe3ace-0"
|
|
316
|
-
})(["display:", ";align-items:", ";justify-content:", ";transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,outline-color 0.1s ease-in-out,z-index 0.25s ease-in-out;margin:0;border:", ";border-radius:", ";cursor:pointer;width:", ";overflow:hidden;text-decoration:
|
|
316
|
+
})(["display:", ";align-items:", ";justify-content:", ";transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,outline-color 0.1s ease-in-out,z-index 0.25s ease-in-out;margin:0;border:", ";border-radius:", ";cursor:pointer;width:", ";overflow:hidden;text-decoration:", ";text-overflow:ellipsis;white-space:", ";font-family:inherit;font-weight:", ";-webkit-font-smoothing:subpixel-antialiased;box-sizing:border-box;user-select:", ";-webkit-touch-callout:none;", ";&::-moz-focus-inner{border:0;padding:0;}", "{text-decoration:none;}&:hover{text-decoration:", ";}&:active,&[aria-pressed='true'],&[aria-pressed='mixed']{transition:border-color 0.1s ease-in-out,background-color 0.1s ease-in-out,box-shadow 0.1s ease-in-out,color 0.1s ease-in-out,outline-color 0.1s ease-in-out,z-index 0.25s ease-in-out;text-decoration:", ";}", ";&:disabled{cursor:default;text-decoration:", ";}& ", "{", "}", " &&{", "}", ""], props => props.isLink ? 'inline' : 'inline-flex', props => !props.isLink && 'center', props => !props.isLink && 'center', props => `${props.isLink ? `0px solid` : props.theme.borders.sm} transparent`, props => getBorderRadius(props), props => props.isStretched ? '100%' : '', props => props.$isUnderlined ? 'underline' : 'none', props => !props.isLink && 'nowrap', props => props.isLink ? 'inherit' : props.theme.fontWeights.regular, props => !props.isLink && 'none', props => sizeStyles(props), SELECTOR_FOCUS_VISIBLE, props => props.isLink ? 'underline' : 'none', props => props.isLink ? 'underline' : 'none', props => colorStyles(props), props => props.isLink && 'none', StyledIcon, props => iconStyles(props), StyledSplitButton, props => groupStyles(props), props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
317
317
|
StyledButton.defaultProps = {
|
|
318
318
|
theme: DEFAULT_THEME
|
|
319
319
|
};
|
|
@@ -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.19'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledExternalIcon",
|
|
17
17
|
componentId: "sc-16oz07e-0"
|
|
@@ -19,7 +19,7 @@ const sizeStyles = props => {
|
|
|
19
19
|
};
|
|
20
20
|
const StyledIcon = styled(StyledBaseIcon).attrs({
|
|
21
21
|
'data-garden-id': COMPONENT_ID,
|
|
22
|
-
'data-garden-version': '9.0.0-next.
|
|
22
|
+
'data-garden-version': '9.0.0-next.19'
|
|
23
23
|
}).withConfig({
|
|
24
24
|
displayName: "StyledIcon",
|
|
25
25
|
componentId: "sc-19meqgg-0"
|
|
@@ -51,7 +51,7 @@ const StyledIconButton = styled(StyledButton).attrs(props => {
|
|
|
51
51
|
const externalId = props['data-garden-id'];
|
|
52
52
|
return {
|
|
53
53
|
'data-garden-id': externalId && externalId !== COMPONENT_ID$1 ? externalId : COMPONENT_ID,
|
|
54
|
-
'data-garden-version': '9.0.0-next.
|
|
54
|
+
'data-garden-version': '9.0.0-next.19'
|
|
55
55
|
};
|
|
56
56
|
}).withConfig({
|
|
57
57
|
displayName: "StyledIconButton",
|
|
@@ -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.19'
|
|
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.19'
|
|
45
45
|
}).withConfig({
|
|
46
46
|
displayName: "StyledSplitButton",
|
|
47
47
|
componentId: "sc-1u4v04v-0"
|
|
@@ -62,7 +62,7 @@ const sizeStyles$1 = props => {
|
|
|
62
62
|
};
|
|
63
63
|
const StyledIcon = styled__default.default(reactTheming.StyledBaseIcon).attrs({
|
|
64
64
|
'data-garden-id': COMPONENT_ID$4,
|
|
65
|
-
'data-garden-version': '9.0.0-next.
|
|
65
|
+
'data-garden-version': '9.0.0-next.19'
|
|
66
66
|
}).withConfig({
|
|
67
67
|
displayName: "StyledIcon",
|
|
68
68
|
componentId: "sc-19meqgg-0"
|
|
@@ -369,12 +369,12 @@ const sizeStyles = props => {
|
|
|
369
369
|
};
|
|
370
370
|
const StyledButton = styled__default.default.button.attrs(props => ({
|
|
371
371
|
'data-garden-id': props['data-garden-id'] || COMPONENT_ID$3,
|
|
372
|
-
'data-garden-version': '9.0.0-next.
|
|
372
|
+
'data-garden-version': '9.0.0-next.19',
|
|
373
373
|
type: props.type || 'button'
|
|
374
374
|
})).withConfig({
|
|
375
375
|
displayName: "StyledButton",
|
|
376
376
|
componentId: "sc-qe3ace-0"
|
|
377
|
-
})(["display:", ";align-items:", ";justify-content:", ";transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,outline-color 0.1s ease-in-out,z-index 0.25s ease-in-out;margin:0;border:", ";border-radius:", ";cursor:pointer;width:", ";overflow:hidden;text-decoration:
|
|
377
|
+
})(["display:", ";align-items:", ";justify-content:", ";transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out,background-color 0.25s ease-in-out,color 0.25s ease-in-out,outline-color 0.1s ease-in-out,z-index 0.25s ease-in-out;margin:0;border:", ";border-radius:", ";cursor:pointer;width:", ";overflow:hidden;text-decoration:", ";text-overflow:ellipsis;white-space:", ";font-family:inherit;font-weight:", ";-webkit-font-smoothing:subpixel-antialiased;box-sizing:border-box;user-select:", ";-webkit-touch-callout:none;", ";&::-moz-focus-inner{border:0;padding:0;}", "{text-decoration:none;}&:hover{text-decoration:", ";}&:active,&[aria-pressed='true'],&[aria-pressed='mixed']{transition:border-color 0.1s ease-in-out,background-color 0.1s ease-in-out,box-shadow 0.1s ease-in-out,color 0.1s ease-in-out,outline-color 0.1s ease-in-out,z-index 0.25s ease-in-out;text-decoration:", ";}", ";&:disabled{cursor:default;text-decoration:", ";}& ", "{", "}", " &&{", "}", ""], props => props.isLink ? 'inline' : 'inline-flex', props => !props.isLink && 'center', props => !props.isLink && 'center', props => `${props.isLink ? `0px solid` : props.theme.borders.sm} transparent`, props => getBorderRadius(props), props => props.isStretched ? '100%' : '', props => props.$isUnderlined ? 'underline' : 'none', props => !props.isLink && 'nowrap', props => props.isLink ? 'inherit' : props.theme.fontWeights.regular, props => !props.isLink && 'none', props => sizeStyles(props), reactTheming.SELECTOR_FOCUS_VISIBLE, props => props.isLink ? 'underline' : 'none', props => props.isLink ? 'underline' : 'none', props => colorStyles(props), props => props.isLink && 'none', StyledIcon, props => iconStyles$1(props), StyledSplitButton, props => groupStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
|
|
378
378
|
StyledButton.defaultProps = {
|
|
379
379
|
theme: reactTheming.DEFAULT_THEME
|
|
380
380
|
};
|
|
@@ -382,7 +382,7 @@ StyledButton.defaultProps = {
|
|
|
382
382
|
const COMPONENT_ID$2 = 'buttons.anchor';
|
|
383
383
|
const StyledAnchor = styled__default.default(StyledButton).attrs(props => ({
|
|
384
384
|
'data-garden-id': COMPONENT_ID$2,
|
|
385
|
-
'data-garden-version': '9.0.0-next.
|
|
385
|
+
'data-garden-version': '9.0.0-next.19',
|
|
386
386
|
as: 'a',
|
|
387
387
|
dir: props.theme.rtl ? 'rtl' : undefined,
|
|
388
388
|
isLink: true,
|
|
@@ -416,7 +416,7 @@ var SvgNewWindowStroke = function SvgNewWindowStroke(props) {
|
|
|
416
416
|
const COMPONENT_ID$1 = 'buttons.external_icon';
|
|
417
417
|
const StyledExternalIcon = styled__default.default(SvgNewWindowStroke).attrs({
|
|
418
418
|
'data-garden-id': COMPONENT_ID$1,
|
|
419
|
-
'data-garden-version': '9.0.0-next.
|
|
419
|
+
'data-garden-version': '9.0.0-next.19'
|
|
420
420
|
}).withConfig({
|
|
421
421
|
displayName: "StyledExternalIcon",
|
|
422
422
|
componentId: "sc-16oz07e-0"
|
|
@@ -467,7 +467,7 @@ const StyledIconButton = styled__default.default(StyledButton).attrs(props => {
|
|
|
467
467
|
const externalId = props['data-garden-id'];
|
|
468
468
|
return {
|
|
469
469
|
'data-garden-id': externalId && externalId !== COMPONENT_ID$3 ? externalId : COMPONENT_ID,
|
|
470
|
-
'data-garden-version': '9.0.0-next.
|
|
470
|
+
'data-garden-version': '9.0.0-next.19'
|
|
471
471
|
};
|
|
472
472
|
}).withConfig({
|
|
473
473
|
displayName: "StyledIconButton",
|
|
@@ -512,7 +512,8 @@ const ButtonComponent = React.forwardRef((props, ref) => {
|
|
|
512
512
|
const splitButtonContext = useSplitButtonContext();
|
|
513
513
|
const computedProps = {
|
|
514
514
|
...props,
|
|
515
|
-
focusInset: props.focusInset || splitButtonContext
|
|
515
|
+
focusInset: props.focusInset || splitButtonContext,
|
|
516
|
+
$isUnderlined: props.isLink
|
|
516
517
|
};
|
|
517
518
|
return React__namespace.default.createElement(StyledButton, Object.assign({}, computedProps, {
|
|
518
519
|
ref: ref
|
|
@@ -542,6 +543,7 @@ const Anchor = React.forwardRef((_ref, ref) => {
|
|
|
542
543
|
children,
|
|
543
544
|
isExternal,
|
|
544
545
|
externalIconLabel,
|
|
546
|
+
isUnderlined = true,
|
|
545
547
|
...otherProps
|
|
546
548
|
} = _ref;
|
|
547
549
|
let anchorProps = otherProps;
|
|
@@ -559,7 +561,8 @@ const Anchor = React.forwardRef((_ref, ref) => {
|
|
|
559
561
|
};
|
|
560
562
|
const iconAriaLabel = reactTheming.useText(Anchor, checkProps, isExternal ? 'externalIconLabel' : 'noIconLabel', '(opens in a new tab)');
|
|
561
563
|
return React__namespace.default.createElement(StyledAnchor, Object.assign({
|
|
562
|
-
ref: ref
|
|
564
|
+
ref: ref,
|
|
565
|
+
$isUnderlined: isUnderlined
|
|
563
566
|
}, anchorProps), children, isExternal &&
|
|
564
567
|
React__namespace.default.createElement(StyledExternalIcon, {
|
|
565
568
|
role: "img",
|
|
@@ -571,6 +574,7 @@ Anchor.displayName = 'Anchor';
|
|
|
571
574
|
Anchor.propTypes = {
|
|
572
575
|
isExternal: PropTypes__default.default.bool,
|
|
573
576
|
isDanger: PropTypes__default.default.bool,
|
|
577
|
+
isUnderlined: PropTypes__default.default.bool,
|
|
574
578
|
externalIconLabel: PropTypes__default.default.string
|
|
575
579
|
};
|
|
576
580
|
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* Accepts all `<a>` props
|
|
9
9
|
*/
|
|
10
|
-
export declare const StyledAnchor: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, import("
|
|
10
|
+
export declare const StyledAnchor: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, import("./StyledButton").IStyledButtonProps, never>;
|
|
@@ -7,10 +7,8 @@
|
|
|
7
7
|
import { DefaultTheme, ThemeProps } from 'styled-components';
|
|
8
8
|
import { IButtonProps } from '../types';
|
|
9
9
|
export declare const COMPONENT_ID = "buttons.button";
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*/
|
|
16
|
-
export declare const StyledButton: import("styled-components").StyledComponent<"button", DefaultTheme, IButtonProps, never>;
|
|
10
|
+
export interface IStyledButtonProps extends IButtonProps {
|
|
11
|
+
$isUnderlined?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const getHeight: (props: IStyledButtonProps & ThemeProps<DefaultTheme>) => string;
|
|
14
|
+
export declare const StyledButton: import("styled-components").StyledComponent<"button", DefaultTheme, IStyledButtonProps, never>;
|
|
@@ -5,6 +5,5 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import { DefaultTheme } from 'styled-components';
|
|
8
|
-
import { IButtonProps } from '../types';
|
|
9
8
|
export declare const COMPONENT_ID = "buttons.icon_button";
|
|
10
|
-
export declare const StyledIconButton: import("styled-components").StyledComponent<"button", DefaultTheme,
|
|
9
|
+
export declare const StyledIconButton: import("styled-components").StyledComponent<"button", DefaultTheme, import("./StyledButton").IStyledButtonProps, never>;
|
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.19",
|
|
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.19",
|
|
37
37
|
"@zendeskgarden/svg-icons": "7.1.1"
|
|
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": "3f18fec721a25bebc274de6af38cd88ab4e63a79"
|
|
50
50
|
}
|