@entur/button
Advanced tools
Comparing version 1.2.2 to 1.3.0
@@ -6,2 +6,14 @@ # Change Log | ||
# [1.3.0](https://bitbucket.org/enturas/design-system/compare/@entur/button@1.2.2...@entur/button@1.3.0) (2019-12-10) | ||
### Bug Fixes | ||
- adding aria-disabled to disabled state ([c048c0e](https://bitbucket.org/enturas/design-system/commits/c048c0e335ea97dd0989cc98515b5e3262887357)) | ||
- adding default prop as part of documentation ([1ef7510](https://bitbucket.org/enturas/design-system/commits/1ef75107362f6262429d7fe31519b4353eccc8de)) | ||
- **styling:** fixing contrast styling for secondary and negative button ([d0ebaa1](https://bitbucket.org/enturas/design-system/commits/d0ebaa18ff2b0c5bd69668934399db1d47747e07)) | ||
### Features | ||
- adding the tertiary button as a new variant ([808e129](https://bitbucket.org/enturas/design-system/commits/808e129be233ae6ff47d4d8a0add1524138041ad)) | ||
## [1.2.2](https://bitbucket.org/enturas/design-system/compare/@entur/button@1.2.1...@entur/button@1.2.2) (2019-11-29) | ||
@@ -8,0 +20,0 @@ |
@@ -36,3 +36,4 @@ 'use strict'; | ||
"aria-busy": loading, | ||
disabled: disabled | ||
disabled: disabled, | ||
"aria-disabled": disabled | ||
}, rest), loading ? React.createElement("div", { | ||
@@ -39,0 +40,0 @@ className: "eds-button__spinner" |
@@ -1,2 +0,2 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("@babel/runtime/helpers/defineProperty")),n=e(require("@babel/runtime/helpers/objectWithoutProperties")),a=e(require("react")),s=e(require("classnames"));exports.Button=a.forwardRef((function(e,i){var r,o=e.variant,d=e.size,u=void 0===d?"medium":d,l=e.loading,c=e.className,b=e.children,m=e.disabled,g=void 0!==m&&m,f=e.width,h=e.as,p=void 0===h?"button":h,v=n(e,["variant","size","loading","className","children","disabled","width","as"]),N=g?"button":p,y=a.Children.toArray(b),j=y.length>1&&"string"!=typeof y[0],q=y.length>1&&"string"!=typeof y[y.length-1];return a.createElement(N,Object.assign({className:s("eds-button",(r={},t(r,"eds-button--variant-".concat(o),o),t(r,"eds-button--size-".concat(u),u),t(r,"eds-button--width-".concat(f),f),t(r,"eds-button--loading",l),t(r,"eds-button--leading-icon",j),t(r,"eds-button--trailing-icon",q),r),c),ref:i,"aria-busy":l,disabled:g},v),l?a.createElement("div",{className:"eds-button__spinner"}):b)})),exports.ButtonGroup=function(e){var t=e.as,i=void 0===t?"div":t,r=e.className,o=n(e,["as","className"]);return a.createElement(i,Object.assign({className:s("eds-button-group",r)},o))}; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("@babel/runtime/helpers/defineProperty")),a=e(require("@babel/runtime/helpers/objectWithoutProperties")),n=e(require("react")),i=e(require("classnames"));exports.Button=n.forwardRef((function(e,s){var r,o=e.variant,d=e.size,u=void 0===d?"medium":d,l=e.loading,c=e.className,b=e.children,m=e.disabled,g=void 0!==m&&m,f=e.width,h=e.as,p=void 0===h?"button":h,v=a(e,["variant","size","loading","className","children","disabled","width","as"]),N=g?"button":p,y=n.Children.toArray(b),j=y.length>1&&"string"!=typeof y[0],q=y.length>1&&"string"!=typeof y[y.length-1];return n.createElement(N,Object.assign({className:i("eds-button",(r={},t(r,"eds-button--variant-".concat(o),o),t(r,"eds-button--size-".concat(u),u),t(r,"eds-button--width-".concat(f),f),t(r,"eds-button--loading",l),t(r,"eds-button--leading-icon",j),t(r,"eds-button--trailing-icon",q),r),c),ref:s,"aria-busy":l,disabled:g,"aria-disabled":g},v),l?n.createElement("div",{className:"eds-button__spinner"}):b)})),exports.ButtonGroup=function(e){var t=e.as,s=void 0===t?"div":t,r=e.className,o=a(e,["as","className"]);return n.createElement(s,Object.assign({className:i("eds-button-group",r)},o))}; | ||
//# sourceMappingURL=button.cjs.production.min.js.map |
@@ -32,3 +32,4 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty'; | ||
"aria-busy": loading, | ||
disabled: disabled | ||
disabled: disabled, | ||
"aria-disabled": disabled | ||
}, rest), loading ? React.createElement("div", { | ||
@@ -35,0 +36,0 @@ className: "eds-button__spinner" |
import React from "react"; | ||
declare type sizes = 'medium' | 'large'; | ||
declare type variants = 'primary' | 'secondary' | 'success' | 'negative'; | ||
declare type widths = 'fluid' | 'square'; | ||
declare type ButtonProps = { | ||
/** Farge og uttrykk på knappen */ | ||
variant: variants; | ||
/** Størrelsen på knappen */ | ||
size?: sizes; | ||
/** Om knappen er opptatt, f.eks. med å lagre eller å kjøpe */ | ||
variant: 'primary' | 'secondary' | 'success' | 'negative' | 'tertiary'; | ||
/** Størrelsen på knappen | ||
* @default 'medium' | ||
*/ | ||
size?: 'medium' | 'large'; | ||
/** Om knappen er opptatt, f.eks. med å lagre eller å kjøpe | ||
* @default false | ||
*/ | ||
loading?: boolean; | ||
/** Ekstra klassenavn */ | ||
className?: string; | ||
/** Deaktivering av knappen */ | ||
/** Deaktivering av knappen | ||
* @default false | ||
*/ | ||
disabled?: boolean; | ||
/** Bredden på knappen. Defaulter til "standard-størrelse" */ | ||
width?: widths; | ||
width?: 'fluid' | 'square'; | ||
/** Innholdet i knappen */ | ||
children: React.ReactNode; | ||
/** HTML-elementet eller React-komponenten som lager knappen */ | ||
/** HTML-elementet eller React-komponenten som lager knappen | ||
* @default "button" | ||
*/ | ||
as?: 'a' | 'button' | React.ElementType; | ||
@@ -30,3 +35,5 @@ [key: string]: any; | ||
className?: string; | ||
/** HTML-elementet eller React-komponenten som lages */ | ||
/** HTML-elementet eller React-komponenten som lages | ||
* @default "div" | ||
*/ | ||
as?: string | React.ElementType; | ||
@@ -33,0 +40,0 @@ [key: string]: any; |
{ | ||
"name": "@entur/button", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"license": "EUPL-1.2", | ||
@@ -35,3 +35,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "063faba53aff9f8a3248ca8880f9f1dd3db36a9d" | ||
"gitHead": "c518a56619cd30d0c7254b0f9f5298c69e54a8a0" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51870
375