Skip to content

Commit

Permalink
feat(ButtonLink): add download and centered props
Browse files Browse the repository at this point in the history
  • Loading branch information
DSil committed Mar 22, 2023
1 parent a27447c commit 6d90b90
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/orbit-components/src/ButtonLink/README.md
Expand Up @@ -21,10 +21,12 @@ Table below contains all types of the props available in ButtonLink component.
| ariaControls | `string` | | Id of the element the button controls. |
| ariaExpanded | `boolean` | | Tells screen reader the controlled element from `ariaControls` is expanded |
| asComponent | `string \| () => React.Element` | `"button"` | The component used for the root node. |
| centered | `boolean` | `false` | Can only be used when `fullWidth` is true and if `iconLeft` and/or `iconRight` are defined. If `centered` prop is `true`, the Button will center everything. |
| circled | `boolean` | `false` | If `true`, the ButtonLink will have circular shape. |
| children | `React.Node` | | The content of the ButtonLink. [See Functional specs](#functional-specs) |
| compact | `boolean` | `false` | If `true`, the ButtonLink will not have horizontal paddings. |
| disabled | `boolean` | `false` | If `true`, the ButtonLink will be disabled. |
| download | `boolean \| string` | | Can only be used when `href` is defined. Adds the `download` attribute to the anchor element. |
| dataTest | `string` | | Optional prop for testing purposes. |
| id | `string` | | Set `id` for `ButtonLink` |
| external | `boolean` | `false` | If `true`, the ButtonLink opens link in a new tab. [See Functional specs](#functional-specs) |
Expand Down
15 changes: 12 additions & 3 deletions packages/orbit-components/src/ButtonLink/types.d.ts
@@ -1,12 +1,21 @@
// Type definitions for @kiwicom/orbit-components
// Project: http://github.com/kiwicom/orbit
import type * as Common from "../common/types";
import type { ButtonCommonProps, Size } from "../primitives/ButtonPrimitive/types";
import type {
ButtonCommonProps,
Size,
DownloadWithHrefConditionalProps,
FullWidthConditionalProps,
} from "../primitives/ButtonPrimitive/types";

export type Type = "primary" | "secondary" | "critical";

export interface Props extends Common.Globals, Common.SpaceAfter, ButtonCommonProps {
export type Props = {
readonly compact?: boolean;
readonly type?: Type;
readonly size?: Size;
}
} & Common.Globals &
Common.SpaceAfter &
ButtonCommonProps &
FullWidthConditionalProps &
DownloadWithHrefConditionalProps;

0 comments on commit 6d90b90

Please sign in to comment.