@zendeskgarden/react-buttons 9.0.0-next.2 → 9.0.0-next.20
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/README.md +0 -27
- package/dist/esm/elements/Anchor.js +57 -0
- package/dist/esm/elements/Button.js +50 -0
- package/dist/esm/elements/ChevronButton.js +27 -0
- package/dist/esm/elements/IconButton.js +50 -0
- package/dist/esm/elements/SplitButton.js +29 -0
- package/dist/esm/elements/ToggleButton.js +30 -0
- package/dist/esm/elements/ToggleIconButton.js +32 -0
- package/dist/esm/elements/components/EndIcon.js +28 -0
- package/dist/esm/elements/components/StartIcon.js +28 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/new-window-stroke.svg.js +27 -0
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/chevron-down-stroke.svg.js +25 -0
- package/dist/esm/styled/StyledAnchor.js +27 -0
- package/dist/esm/styled/StyledButton.js +321 -0
- package/dist/esm/styled/StyledExternalIcon.js +23 -0
- package/dist/esm/styled/StyledIcon.js +31 -0
- package/dist/esm/styled/StyledIconButton.js +64 -0
- package/dist/esm/styled/StyledSplitButton.js +22 -0
- package/dist/esm/types/index.js +9 -0
- package/dist/esm/utils/useSplitButtonContext.js +14 -0
- package/dist/index.cjs.js +316 -203
- package/dist/typings/elements/Button.d.ts +1 -7
- package/dist/typings/elements/components/EndIcon.d.ts +1 -1
- package/dist/typings/elements/components/StartIcon.d.ts +1 -1
- package/dist/typings/index.d.ts +2 -3
- package/dist/typings/styled/StyledAnchor.d.ts +1 -8
- package/dist/typings/styled/StyledButton.d.ts +6 -7
- package/dist/typings/styled/StyledIcon.d.ts +4 -4
- package/dist/typings/styled/StyledIconButton.d.ts +2 -5
- package/dist/typings/styled/{StyledButtonGroup.d.ts → StyledSplitButton.d.ts} +1 -1
- package/dist/typings/styled/index.d.ts +3 -3
- package/dist/typings/types/index.d.ts +3 -13
- package/package.json +8 -9
- package/dist/index.esm.js +0 -559
- package/dist/typings/elements/ButtonGroup.d.ts +0 -14
- package/dist/typings/utils/useButtonGroupContext.d.ts +0 -14
|
@@ -4,16 +4,10 @@
|
|
|
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 React
|
|
7
|
+
import React from 'react';
|
|
8
8
|
import { IButtonProps } from '../types';
|
|
9
9
|
import { StartIcon } from './components/StartIcon';
|
|
10
10
|
import { EndIcon } from './components/EndIcon';
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated use IButtonStartIconProps or IButtonEndIconProps instead
|
|
13
|
-
*/
|
|
14
|
-
export interface IIconProps extends SVGAttributes<SVGSVGElement> {
|
|
15
|
-
isRotated?: boolean;
|
|
16
|
-
}
|
|
17
11
|
/**
|
|
18
12
|
* @extends ButtonHTMLAttributes<HTMLButtonElement>
|
|
19
13
|
*/
|
|
@@ -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
|
};
|
package/dist/typings/index.d.ts
CHANGED
|
@@ -4,12 +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
|
-
export { Button
|
|
7
|
+
export { Button } from './elements/Button';
|
|
8
8
|
export { Anchor } from './elements/Anchor';
|
|
9
|
-
export { ButtonGroup } from './elements/ButtonGroup';
|
|
10
9
|
export { ChevronButton } from './elements/ChevronButton';
|
|
11
10
|
export { IconButton } from './elements/IconButton';
|
|
12
11
|
export { SplitButton } from './elements/SplitButton';
|
|
13
12
|
export { ToggleButton } from './elements/ToggleButton';
|
|
14
13
|
export { ToggleIconButton } from './elements/ToggleIconButton';
|
|
15
|
-
export type { IButtonProps, IButtonIconProps as IButtonEndIconProps, IButtonIconProps as IButtonStartIconProps, IAnchorProps, IIconButtonProps, IIconButtonProps as IChevronButtonProps, IToggleButtonProps, IToggleIconButtonProps
|
|
14
|
+
export type { IButtonProps, IButtonIconProps as IButtonEndIconProps, IButtonIconProps as IButtonStartIconProps, IAnchorProps, IIconButtonProps, IIconButtonProps as IChevronButtonProps, IToggleButtonProps, IToggleIconButtonProps } from './types';
|
|
@@ -7,11 +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("
|
|
11
|
-
'data-garden-id': string;
|
|
12
|
-
'data-garden-version': string;
|
|
13
|
-
as: string;
|
|
14
|
-
dir: "rtl" | undefined;
|
|
15
|
-
isLink: boolean;
|
|
16
|
-
type: undefined;
|
|
17
|
-
}, "type" | "dir" | "data-garden-id" | "data-garden-version" | "as" | "isLink">;
|
|
10
|
+
export declare const StyledAnchor: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, import("./StyledButton").IStyledButtonProps, never>;
|
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { DefaultTheme, ThemeProps } from 'styled-components';
|
|
8
8
|
import { IButtonProps } from '../types';
|
|
9
|
-
export declare const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export declare const StyledButton: import("styled-components").StyledComponent<"button", DefaultTheme, IButtonProps, never>;
|
|
9
|
+
export declare const COMPONENT_ID = "buttons.button";
|
|
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>;
|
|
@@ -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">;
|
|
@@ -5,8 +5,5 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import { DefaultTheme } from 'styled-components';
|
|
8
|
-
|
|
9
|
-
export declare const StyledIconButton: import("styled-components").StyledComponent<"button", DefaultTheme,
|
|
10
|
-
'data-garden-id': string;
|
|
11
|
-
'data-garden-version': string;
|
|
12
|
-
} & IButtonProps, "data-garden-id" | "data-garden-version">;
|
|
8
|
+
export declare const COMPONENT_ID = "buttons.icon_button";
|
|
9
|
+
export declare const StyledIconButton: import("styled-components").StyledComponent<"button", DefaultTheme, import("./StyledButton").IStyledButtonProps, never>;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* Accepts all `<div>` props
|
|
9
9
|
*/
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const StyledSplitButton: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
11
11
|
'data-garden-id': string;
|
|
12
12
|
'data-garden-version': string;
|
|
13
13
|
}, "data-garden-id" | "data-garden-version">;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
export * from './StyledAnchor';
|
|
8
|
-
export
|
|
9
|
-
export * from './
|
|
8
|
+
export { StyledButton } from './StyledButton';
|
|
9
|
+
export * from './StyledSplitButton';
|
|
10
10
|
export * from './StyledExternalIcon';
|
|
11
11
|
export * from './StyledIcon';
|
|
12
|
-
export
|
|
12
|
+
export { StyledIconButton } from './StyledIconButton';
|
|
@@ -4,7 +4,7 @@
|
|
|
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 { AnchorHTMLAttributes, ButtonHTMLAttributes,
|
|
7
|
+
import { AnchorHTMLAttributes, ButtonHTMLAttributes, SVGAttributes } from 'react';
|
|
8
8
|
export declare const SIZE: readonly ["small", "medium", "large"];
|
|
9
9
|
export interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
10
10
|
/** Applies danger styling */
|
|
@@ -25,8 +25,6 @@ export interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
25
25
|
isPill?: boolean;
|
|
26
26
|
/** Applies inset `box-shadow` styling on focus */
|
|
27
27
|
focusInset?: boolean;
|
|
28
|
-
/** @ignore prop used by `ButtonGroup` */
|
|
29
|
-
isSelected?: boolean;
|
|
30
28
|
}
|
|
31
29
|
export interface IToggleButtonProps extends IButtonProps {
|
|
32
30
|
/**
|
|
@@ -55,14 +53,6 @@ export interface IAnchorProps extends Pick<IButtonProps, 'isDanger'>, AnchorHTML
|
|
|
55
53
|
* making that icon accessible to assistive technology
|
|
56
54
|
**/
|
|
57
55
|
externalIconLabel?: string;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
/** Defines the currently selected button in the group */
|
|
61
|
-
selectedItem?: any;
|
|
62
|
-
/**
|
|
63
|
-
* Handles button selection
|
|
64
|
-
*
|
|
65
|
-
* @param {any} item The selected item
|
|
66
|
-
*/
|
|
67
|
-
onSelect?: (item: any) => void;
|
|
56
|
+
/** Determines if the anchor has underline styling */
|
|
57
|
+
isUnderlined?: boolean;
|
|
68
58
|
}
|
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.20",
|
|
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>",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"url": "https://github.com/zendeskgarden/react-components/issues"
|
|
11
11
|
},
|
|
12
12
|
"main": "dist/index.cjs.js",
|
|
13
|
-
"module": "dist/index.
|
|
13
|
+
"module": "dist/esm/index.js",
|
|
14
14
|
"files": [
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
@@ -21,21 +21,20 @@
|
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"types": "dist/typings/index.d.ts",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@zendeskgarden/container-selection": "^3.0.0",
|
|
25
24
|
"@zendeskgarden/container-utilities": "^2.0.0",
|
|
26
|
-
"polished": "^4.
|
|
25
|
+
"polished": "^4.3.1",
|
|
27
26
|
"prop-types": "^15.5.7",
|
|
28
27
|
"react-merge-refs": "^2.0.0"
|
|
29
28
|
},
|
|
30
29
|
"peerDependencies": {
|
|
31
|
-
"@zendeskgarden/react-theming": "
|
|
30
|
+
"@zendeskgarden/react-theming": ">=9.0.0-next",
|
|
32
31
|
"react": ">=16.8.0",
|
|
33
32
|
"react-dom": ">=16.8.0",
|
|
34
|
-
"styled-components": "^5.1
|
|
33
|
+
"styled-components": "^5.3.1"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
|
-
"@zendeskgarden/react-theming": "^9.0.0-next.
|
|
38
|
-
"@zendeskgarden/svg-icons": "7.
|
|
36
|
+
"@zendeskgarden/react-theming": "^9.0.0-next.20",
|
|
37
|
+
"@zendeskgarden/svg-icons": "7.1.1"
|
|
39
38
|
},
|
|
40
39
|
"keywords": [
|
|
41
40
|
"components",
|
|
@@ -47,5 +46,5 @@
|
|
|
47
46
|
"access": "public"
|
|
48
47
|
},
|
|
49
48
|
"zendeskgarden:src": "src/index.ts",
|
|
50
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "eab087ac0d6e74b3a4489d37d067baf7a225e7a8"
|
|
51
50
|
}
|