@sproutsocial/seeds-react-button 1.0.0
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/index.d.mts +37 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +5063 -0
- package/dist/index.mjs +5054 -0
- package/package.json +33 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { TypeStyledComponentsCommonProps, TypeSystemCommonProps, TypeSystemLayoutProps, TypeSystemFlexboxProps, TypeSystemGridProps } from '@sproutsocial/seeds-react-system-props';
|
|
4
|
+
|
|
5
|
+
type TypeButtonAppearance = "primary" | "secondary" | "pill" | "destructive" | "unstyled" | "placeholder";
|
|
6
|
+
interface TypeButtonProps extends TypeStyledComponentsCommonProps, TypeSystemCommonProps, TypeSystemLayoutProps, TypeSystemFlexboxProps, TypeSystemGridProps, Omit<React.ComponentPropsWithoutRef<"button">, "color"> {
|
|
7
|
+
/** If the button is being used as an anchor, this prop will cause the link to open in a new tab. */
|
|
8
|
+
external?: boolean;
|
|
9
|
+
size?: "large" | "small" | "default";
|
|
10
|
+
/** What the button looks like. */
|
|
11
|
+
appearance?: TypeButtonAppearance;
|
|
12
|
+
/** Set the button to display in its active state */
|
|
13
|
+
active?: boolean;
|
|
14
|
+
/** Disables user action and applies a disabled style on the button */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
/** Setting this prop will cause the component to be rendered as an anchor element instead of a button element */
|
|
18
|
+
href?: string;
|
|
19
|
+
/** If the component is rendered as an anchor to a file, this prop sets the name of the file to be downloaded */
|
|
20
|
+
download?: string;
|
|
21
|
+
/** Used to get a reference to the underlying button */
|
|
22
|
+
innerRef?: React.Ref<HTMLButtonElement>;
|
|
23
|
+
/** Action to perform when the button is clicked */
|
|
24
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
25
|
+
title?: string;
|
|
26
|
+
qa?: object;
|
|
27
|
+
as?: TypeStyledComponentsCommonProps["as"];
|
|
28
|
+
/** Label used to describe the button if the button does not have text within it */
|
|
29
|
+
ariaLabel?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare const Button: {
|
|
33
|
+
({ href, appearance, active, disabled, external, children, size, innerRef, onClick, title, qa, as, ariaLabel, ...rest }: TypeButtonProps): React__default.JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { Button, type TypeButtonAppearance, type TypeButtonProps, Button as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { TypeStyledComponentsCommonProps, TypeSystemCommonProps, TypeSystemLayoutProps, TypeSystemFlexboxProps, TypeSystemGridProps } from '@sproutsocial/seeds-react-system-props';
|
|
4
|
+
|
|
5
|
+
type TypeButtonAppearance = "primary" | "secondary" | "pill" | "destructive" | "unstyled" | "placeholder";
|
|
6
|
+
interface TypeButtonProps extends TypeStyledComponentsCommonProps, TypeSystemCommonProps, TypeSystemLayoutProps, TypeSystemFlexboxProps, TypeSystemGridProps, Omit<React.ComponentPropsWithoutRef<"button">, "color"> {
|
|
7
|
+
/** If the button is being used as an anchor, this prop will cause the link to open in a new tab. */
|
|
8
|
+
external?: boolean;
|
|
9
|
+
size?: "large" | "small" | "default";
|
|
10
|
+
/** What the button looks like. */
|
|
11
|
+
appearance?: TypeButtonAppearance;
|
|
12
|
+
/** Set the button to display in its active state */
|
|
13
|
+
active?: boolean;
|
|
14
|
+
/** Disables user action and applies a disabled style on the button */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
/** Setting this prop will cause the component to be rendered as an anchor element instead of a button element */
|
|
18
|
+
href?: string;
|
|
19
|
+
/** If the component is rendered as an anchor to a file, this prop sets the name of the file to be downloaded */
|
|
20
|
+
download?: string;
|
|
21
|
+
/** Used to get a reference to the underlying button */
|
|
22
|
+
innerRef?: React.Ref<HTMLButtonElement>;
|
|
23
|
+
/** Action to perform when the button is clicked */
|
|
24
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
25
|
+
title?: string;
|
|
26
|
+
qa?: object;
|
|
27
|
+
as?: TypeStyledComponentsCommonProps["as"];
|
|
28
|
+
/** Label used to describe the button if the button does not have text within it */
|
|
29
|
+
ariaLabel?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare const Button: {
|
|
33
|
+
({ href, appearance, active, disabled, external, children, size, innerRef, onClick, title, qa, as, ariaLabel, ...rest }: TypeButtonProps): React__default.JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { Button, type TypeButtonAppearance, type TypeButtonProps, Button as default };
|