Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@kalamazoo/button

stevenselcuk65Apache-2.01.0.2TypeScript support: included

A React component that is a base button.

readme

Button

Buttons are used as triggers for actions. They are used in forms, toolbars, dialog footers and as stand-alone action triggers.

Installation

yarn add @kalamazoo/button

Usage

Detailed docs and example usage can be found here.

changelog

@kalamazoo/button

13.3.4

Patch Changes

  • [patch]30acc30979:

    @kalamazoo/select has been converted to Typescript. Typescript consumers will now get static type safety. Flow types are no longer provided. No API or behavioural changes.

13.3.3

Patch Changes

  • [patch]35d2229b2a:

    Adding missing license to packages and update to Copyright 2019 Atlassian Pty Ltd.

13.3.2

Patch Changes

  • [patch]a2d0043716:

    Updated version of analytics-next to fix potential incompatibilities with TS 3.6

13.3.1

13.3.0

Minor Changes

  • [minor]66e147e6a1:

    Adding an optional prop testId that will set the attribute value data-testid. It will help products to write better integration and end to end tests.

13.2.0

Minor Changes

  • [minor]93022be303:

    Align button and subtle button text colour with ADG guidelines (improved contrast)

13.1.7

Patch Changes

  • [patch]67a3a1ee02:

    Converts prop types to interfaces

13.1.6

Patch Changes

  • [patch]097b696613:

    Components now depend on TS 3.6 internally, in order to fix an issue with TS resolving non-relative imports as relative imports

13.1.5

Patch Changes

13.1.4

Patch Changes

  • [patch]abee1a5f4f:

    Bumping internal dependency (memoize-one) to latest version (5.1.0). memoize-one@5.1.0 has full typescript support so it is recommended that typescript consumers use it also.

13.1.3

Patch Changes

  • [patch]de35ce8c67:

    Updates component maintainers

13.1.2

Patch Changes

  • [patch]926b43142b:

    Analytics-next has been converted to Typescript. Typescript consumers will now get static type safety. Flow types are no longer provided. No behavioural changes.

    Breaking changes

    • withAnalyticsForSumTypeProps alias has been removed, please use withAnalyticsEvents
    • AnalyticsContextWrappedComp alias has been removed, please use withAnalyticsContext

    Breaking changes to TypeScript annotations

    • withAnalyticsEvents now infers proptypes automatically, consumers no longer need to provide props as a generic type.
    • withAnalyticsContext now infers proptypes automatically, consumers no longer need to provide props as a generic type.
    • Type WithAnalyticsEventProps has been renamed to WithAnalyticsEventsProps to match source code
    • Type CreateUIAnalyticsEventSignature has been renamed to CreateUIAnalyticsEvent to match source code
    • Type UIAnalyticsEventHandlerSignature has been renamed to UIAnalyticsEventHandler to match source code
    • Type AnalyticsEventsPayload has been renamed to AnalyticsEventPayload
    • Type ObjectType has been removed, please use Record<string, any> or [key: string]: any
    • Type UIAnalyticsEventInterface has been removed, please use UIAnalyticsEvent
    • Type AnalyticsEventInterface has been removed, please use AnalyticsEvent
    • Type CreateAndFireEventFunction removed and should now be inferred by TypeScript
    • Type AnalyticsEventUpdater removed and should now be inferred by TypeScript

13.1.1

Patch Changes

  • [patch]688f2957ca:

    Fixes various TypeScript errors which were previously failing silently

13.1.0

Minor Changes

  • [minor]8fcbe23ec6:

    Updated types for analytics-next and buttons to make them easier to consume

13.0.16

Patch Changes

  • [patch]9f8ab1084b:

    Consume analytics-next ts type definitions as an ambient declaration.

13.0.15

Patch Changes

  • [patch]bbff8a7d87:

    Fixes bug, missing version.json file

13.0.14

Patch Changes

  • [patch]18dfac7332:

    In this PR, we are:

    • Re-introducing dist build folders
    • Adding back cjs
    • Replacing es5 by cjs and es2015 by esm
    • Creating folders at the root for entry-points
    • Removing the generation of the entry-points at the root Please see this ticket or this page for further details

13.0.13

Patch Changes

  • [patch]d0db01b410:

    TypeScript users of withAnalyticsEvents and withAnalyticsContext are now required to provide props as a generic type. This is so that TypeScript can correctly calculate the props and defaultProps of the returned component.

    Before:

    withAnalyticsEvents()(Button) as ComponentClass<Props>;

    After:

    withAnalyticsEvents<Props>()(Button);

13.0.12

Patch Changes

  • [patch]29a1f158c1:

    Use default react import in typescript files.

13.0.11

13.0.10

13.0.9

13.0.8

13.0.7

Patch Changes

  • [patch]aaf9d37b31:

    Move @types/react-router-dom to devDependencies

13.0.6

13.0.5

  • [patch]b0ef06c685:

    • This is just a safety release in case anything strange happened in in the previous one. See Pull Request #5942 for details

13.0.4

13.0.3

  • [patch]2a2d2060ae:

    • Fixing invalid style for isLoading button

13.0.2

13.0.1

  • [patch]754f83b6f0:

    • Makes dependency on @kalamazoo/spinner a caret version. No API or behaviour changes.

13.0.0

  • [major]7c17b35107:

    • Updates react and react-dom peer dependencies to react@^16.8.0 and react-dom@^16.8.0. To use this package, please ensure you use at least this version of react and react-dom.

12.0.8

  • [hotfix] fixes style error and changes spinner to a caret version.

12.0.7

  • BROKEN RELEASE. DO NOT USE.

12.0.6

  • [patch]e0e3fabf8e:

    • Change button to use theme's multiple entry points. This should reduce the bundle size of button

12.0.5

  • [patch]d3cad2622e:

    • Removes babel-runtime in favour of @babel/runtime

12.0.4

12.0.3

12.0.2

  • [patch]3f28e6443c:

    • @kalamazoo/analytics-next-types is deprecated. Now you can use types for @kalamazoo/analytics-next supplied from itself.

12.0.1

12.0.0

  • [major]1e826b2966:

    Highlights

    • New theming API - Button now supports the new Atlaskit theming API, which allows for powerful custom theming of Buttons and its internal components.
    • Speed improvements - Button has been re-written from the ground up - on heavy-load benchmarks, Button is twice as fast (taking 48% of the time to load).
    • Emotion support - Button is now built using Emotion 10! This is part of a wider push for Emotion across all Atlaskit components.

    Breaking Changes:

    • The old theming API is no longer supported.
    • Styling a Button using Styled Components is no longer supported.
    • Button exports a Theme to use as context instead of using Styled Components' ThemeProvider.
    • Camel-case ARIA props have been renamed (ariaExpanded, ariaHaspopup and ariaLabel).

    See the upgrade guide for more details

11.0.11

  • [patch]f8d92ffc5e:

    • Revert the change to consume entry points from theme

11.0.10

  • [patch]5e3ad7f751:

    • Importing theme components from the root theme package instead of the theme build file

11.0.9

  • [patch]872b3b905a:

    • Updates theme to the version which exposes multiple entry points

11.0.8

  • [patch]22ce87801e:

    • Optimised usages of theme in button using multiple entry points

11.0.7

  • [patch]d13fad66df:

    • Enable esModuleInterop for typescript, this allows correct use of default exports

11.0.6

11.0.5

  • [patch]98e11001ff:

    • Removes duplicate babel-runtime dependency

11.0.4

11.0.3

  • [patch]59d4ab031b:

    • Call mouse handlers (e.g. onMouseDown) which are passed in as props

11.0.2

  • [patch]1bcaa1b991:

    • Add npmignore for index.ts to prevent some jest tests from resolving that instead of index.js

11.0.1

11.0.0

  • [major]9d5cc39394:

    • Dropped ES5 distributables from the typescript packages

10.1.3

10.1.2

10.1.1

10.1.0

  • [minor]36929ef:

    • Add reset as it is listed as a valid type for button and is useful when building forms

10.0.4

10.0.3

  • [patch]76a8f1c:

    • Convert @kalamazoo/textarea to Typescript
      • Dist paths have changed, if you are importing by exact file path you will need to update your imports import '@kalamazoo/button/dist/es5/components/ButtonGroup'
      • Flow types are not present any more, Typescript definitions are shipped instead

10.0.2

  • [patch]8f89287:

    • Add tslib to dependencies to stop load breaking when it's not there

10.0.1

10.0.0

  • [major]6998f11:

    • Converted @kalamazoo/button to Typescript
      • Dist paths have changed, if you are importing by exact file path you will need to update your imports
        • E.g. import '@kalamazoo/button/dist/cjs/components/ButtonGroup'; would need to be updated to import '@kalamazoo/button/dist/es5/components/ButtonGroup'
      • Flow types are not present any more, Typescript definitions are shipped instead
  • Updated dependencies bfac186:

9.0.16

  • [patch] Fix truncation in button 508ca2c

9.0.15

  • [patch] Adds missing implicit @babel/runtime dependency b71751b

9.0.14

  • [patch] Fix styling of button rendering icon in IE b4c5b87

9.0.13

9.0.12

  • [patch] Add help appearance 3548c3f

9.0.11

  • [patch] Update the appearance of selected for Help 196603f

9.0.10

9.0.9

9.0.8

  • [patch] Adds sideEffects: false to allow proper tree shaking b5d6d04

9.0.6

9.0.5

9.0.4

9.0.3

9.0.2

9.0.1

9.0.0

8.2.7

  • [patch] Fixed spinner position and size for isLoading state of buttons d6fb3c9
  • [none] Updated dependencies d6fb3c9

8.2.6

  • [patch] Updated prop description for button. Added button label props for inline-edit accessibility. 11205df
  • [none] Updated dependencies 11205df

8.2.5

8.2.4

8.2.3

8.2.2

8.2.1

  • [patch] Fixed interactions for isLoading state. Now prevents interactions (click, hover, keyboard submit) while loading 4605f44
  • [none] Updated dependencies 4605f44

8.2.0

8.1.2

8.1.1

8.1.0

8.0.1

8.0.0

7.2.5

7.2.4

  • [patch] Export types for Button 6a47d88
  • [none] Updated dependencies 6a47d88

7.2.3

  • [patch] Fix invalid css in button 2363d14
  • [none] Updated dependencies 2363d14

7.2.2

  • [patch] Fix react ref dev warnings when using custom components 40b743c

7.2.0

  • [minor] Add ariaLabel prop to button so that it can be passed to the underlying component d7a1e7e

7.1.0

  • [minor] Add autoFocus to button, allowing button to be automatically focused on first render. bf36eb6

7.0.3

  • [patch] Fix a react dev warning when using a custom component 8fb3bc1

7.0.2

  • [patch] Update empty state and button to have consistent types f0da143

7.0.1

  • [patch] Update tests + flow 05d406d
  • [patch] Remove default props to have it optional 0907a36

7.0.0

  • [major] Bump to React 16.3. 4251858

6.6.4

  • [patch] Updates flow types of withAnalyticsEvents and withAnalyticsContext HOCs 26778bc
  • [patch] Uses element config flow type with button deprecation warnings hoc a9aa90a

6.6.3

  • [patch] added onBlur and onFocus hooks 27d01b7

6.6.2

  • [patch] Re-releasing due to potentially broken babel release 9ed0bba

6.6.1

  • [patch] added selected focus state for button dad190d

6.6.0

  • [minor] Update styled-components dependency to support versions 1.4.6 - 3 ceccf30

6.5.0

  • [minor] Instrument button with analytics 4e84f5b

6.4.2

6.4.1

  • [patch] Packages Flow types for elements components 3111e74

6.4.0

  • [minor] id property on Button component is not propagated if href property is provided 7d46c81

6.3.1

  • [patch] Resolved low hanging flow errors in field-base field-text comment icon item and website, $ 007de27

6.3.0

  • [minor] Add React 16 support. 12ea6e4

6.2.0

  • [minor] replace flow type to be less restrictive a28cdbd

6.1.0

  • [minor] Add theming to Button. Deprecate 'help' appearance from Button. c14ea2e
  • [minor] Add theming to Button. Deprecate 'help' appearance from Button. c14ea2e

6.0.0

  • [major] Remove typescript 4635000
  • [major] Remove typescript 4635000
  • [patch] Move button to new repo, tidy types 2dafda6
  • [patch] Move button to new repo, tidy types 2dafda6

5.4.14 (2017-12-01)

  • bug fix; fix button group spacing (issues closed: ak-3978) (f0037f2)

5.4.13 (2017-11-30)

  • bug fix; fix disabled buttons with child elements propagating click events (584ffdc)

5.4.12 (2017-11-27)

  • bug fix; export interface for ts (15c291c)

5.4.11 (2017-11-27)

  • bug fix; fix disabled buttons not swallowing click events (issues closed: ak-3646) (80e976b)

5.4.10 (2017-11-24)

  • bug fix; fix button-group prop validation to ignore null children (3f7f0c3)

5.4.9 (2017-11-21)

  • bug fix; bumping internal dependencies to latest version (5e81848)

5.4.8 (2017-10-27)

  • bug fix; correct formatting for user-select style (fe9419c)

5.4.7 (2017-10-27)

  • bug fix; change icon to be unselectable so button content can be copied (e8c876a)

5.4.6 (2017-10-27)

  • bug fix; updated button props typings (c7a9c09)

5.4.5 (2017-10-23)

  • bug fix; support false/null/undefined children in ButtonGroup (4667228)

5.4.4 (2017-10-22)

  • bug fix; update dependencies for react-16 (077d1ad)

5.4.3 (2017-10-16)

  • bug fix; fix issue where invalid box-shadow style was applied (issues closed: ak-3704) (a786038)

5.4.2 (2017-10-03)

  • bug fix; improve button performance (1bbf0d1)

5.4.1 (2017-09-27)

  • bug fix; button will truncate if wider than its parent (issues closed: ak-3332) (a701ea1)

5.4.0 (2017-09-22)

  • feature; buttons no longer prevent text selection (issues closed: ak-3270) (9ab343b)

5.3.0 (2017-09-18)

  • feature; support new Help button appearance (issues closed: ak-3535) (69728ed)

5.2.0 (2017-09-12)

  • feature; we need the ability to reference elements (cbf5c12)

5.1.2 (2017-09-08)

  • bug fix; adding ButtonGroup to type declarations of button pckage. (bb373c1)

5.1.1 (2017-08-24)

  • bug fix; improved focus ring contrast for warning and danger buttons (39ddda7)

5.1.0 (2017-08-23)

  • bug fix; subtle-link button font colour is slightly updated (issues closed: ak-2480) (510393a)
  • feature; added warning (yellow) and danger (red) options to Button.appearance prop (issues closed: ak-2480) (ba4cfde)

5.0.1 (2017-08-16)

  • bug fix; fix react warning about PropTypes (6b4cd29)

5.0.0 (2017-08-11)

  • bug fix; fix the theme-dependency (db90333)
  • bug fix; button: fix focus box shadow (9746e73)
  • bug fix; button: fix dark link color - default / hover / active (7b85a29)
  • breaking; affects internal styled-components implementation (d14522a)
  • breaking; implement dark mode theme (d14522a)
  • feature; implement dark mode (d959bb1)

4.0.0 (2017-08-11)

  • bug fix; button: fix focus box shadow (9746e73)
  • bug fix; button: fix dark link color - default / hover / active (7b85a29)
  • breaking; affects internal styled-components implementation (d14522a)
  • breaking; implement dark mode theme (d14522a)
  • feature; implement dark mode (d959bb1)

3.6.0 (2017-08-09)

  • feature; export ButtonGroup from button package (issues closed: ak-2382) (61682c6)

3.5.3 (2017-07-27)

  • fix; rename jsnext:main to jsnext:experimental:main temporarily (c7508e0)

3.5.2 (2017-07-25)

  • fix; use class transform in loose mode in babel to improve load performance in apps (fde719a)

3.5.1 (2017-07-20)

  • fix; return focus ring to buttons (94f1ad0)

3.2.0 (2017-07-17)

  • fix; rerelease, failed prepublish scripts (5fd82f8)

3.2.0 (2017-07-17)

  • feature; added ES module builds to dist and add jsnext:main to most ADG packages (ea76507)

3.1.0 (2017-07-10)

  • feature; added functionality to have full-width buttons via optional prop (ad7fae6)

2.0.0 (2017-06-01)

  • fix; add prop-types as a dependency to avoid React 15.x warnings (92598eb)
  • refactored button to styled-components (de6465b)
  • breaking; refactored to styled-components
  • ISSUES CLOSED: AK-2381, AK-2300

1.1.4 (2017-05-25)

  • fix; update util-shared-styles dependency in button (159dd02)

1.1.3 (2017-05-06)

  • fix; link buttons with no spacing are now baseline aligned correctly (66f5e65)

1.1.2 (2017-04-27)

  • fix; update legal copy to be more clear. Not all modules include ADG license. (f3a945e)

1.1.1 (2017-04-26)

  • fix; update legal copy and fix broken links for component README on npm. New contribution and (0b3e454)

1.1.0 (2017-04-20)

  • feature; removed explicit style! imports, set style-loader in webpack config (891fc3c)

1.0.16 (2017-04-04)

  • fix; adds defensive code to allow testing in mocha/jsdom (3f9b72c)

1.0.15 (2017-03-23)

  • fix; Empty commit to release the component (49c08ee)

1.0.13 (2017-03-21)

  • fix; maintainers for all the packages were added (261d00a)

1.0.11 (2017-03-08)

  • fix; fix subtle-link button to use the correct color default color (c4c274d)

1.0.10 (2017-02-28)

  • fix; dummy commit to release stories (3df5d9f)

1.0.9 (2017-02-28)

  • fix; dummy commit to fix broken stories and missing registry pages (a31e92a)

1.0.8 (2017-02-28)

  • fix; dummy commit to release stories for components (a105c02)

1.0.7 (2017-02-28)

  • fix; Removes jsdoc annotations from button (fe8e23b)

1.0.6 (2017-02-24)

  • fix; fixes AK-1787: buttons with z-index + shadow (014af88)
  • fix; spinner related tests fixed (e6d8ad5)
  • fix; storybook clean up and button margin fixed (e06b9c5)

1.0.5 (2017-02-20)

  • fix; use correctly scoped package names in npm docs (91dbd2f)

1.0.4 (2017-02-16)

  • fix; refactor stories to use // rather than http:// (a0826cf)

1.0.3 (2017-02-09)

  • fix; avoiding binding render to this (40c9951)

1.0.2 (2017-02-09)

  • fix; readme refactor to use util-readme (1adf905)

1.0.1 (2017-02-06)

  • fix; Updates package to use ak scoped packages (1262016)