@entur/chip
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -6,2 +6,9 @@ # Change Log | ||
## [0.2.3](https://bitbucket.org/enturas/design-system/compare/@entur/chip@0.2.2...@entur/chip@0.2.3) (2019-12-10) | ||
### Bug Fixes | ||
- decreasing min-width for chips to 48px ([fe273db](https://bitbucket.org/enturas/design-system/commits/fe273dbd587a31514d852e743da564c2402ef13a)) | ||
- fixing label support for choice chips group ([8bebf95](https://bitbucket.org/enturas/design-system/commits/8bebf9503ccb7dadd100fbd177b3da31a9375483)) | ||
## [0.2.2](https://bitbucket.org/enturas/design-system/compare/@entur/chip@0.2.1...@entur/chip@0.2.2) (2019-12-10) | ||
@@ -8,0 +15,0 @@ |
@@ -8,2 +8,3 @@ 'use strict'; | ||
var cx = _interopDefault(require('classnames')); | ||
var form = require('@entur/form'); | ||
@@ -102,3 +103,3 @@ var ChoiceChipGroupContext = | ||
value: contextValue | ||
}, React.createElement("div", Object.assign({ | ||
}, React.createElement(form.Fieldset, Object.assign({ | ||
className: "eds-choice-chips-group" | ||
@@ -105,0 +106,0 @@ }, rest), children)); |
@@ -1,2 +0,2 @@ | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var n=e(require("@babel/runtime/helpers/objectWithoutProperties")),t=e(require("react")),i=e(require("classnames")),r=t.createContext(null),a=r.Provider,c=t.forwardRef((function(e,a){var c=e.className,s=e.children,o=e.value,l=e.disabled,h=void 0!==l&&l,d=e.style,u=n(e,["className","children","value","disabled","style"]),p=t.Children.toArray(s),m=i(c,"eds-chip",{"eds-chip--disabled":h,"eds-chip--leading-icon":p.length>1&&"string"!=typeof p[0],"eds-chip--trailing-icon":p.length>1&&"string"!=typeof p[p.length-1]}),g=function(){var e=t.useContext(r);if(!e)throw new Error("You need to wrap your ChoiceChips in a ChoiceChipGroup-component");return e}();return t.createElement("label",{className:"eds-choice-chip",style:d},t.createElement("input",Object.assign({className:"eds-choice-chip__input",type:"radio",name:g.name,ref:a,value:o,disabled:h,checked:g.value===o,onChange:g.onChange},u)),t.createElement("div",{className:m},s))}));exports.ActionChip=t.forwardRef((function(e,r){var a=e.children,c=e.className,s=n(e,["children","className"]),o=t.Children.toArray(a);return t.createElement("button",Object.assign({className:i("eds-chip","eds-action-chip",{"eds-chip--leading-icon":o.length>1&&"string"!=typeof o[0],"eds-chip--trailing-icon":o.length>1&&"string"!=typeof o[o.length-1]},c),ref:r,type:"button"},s),a)})),exports.ChoiceChip=c,exports.ChoiceChipGroup=function(e){var i=e.name,r=e.value,c=e.children,s=e.onChange,o=n(e,["name","value","children","onChange"]),l=t.useMemo((function(){return{name:i,value:r,onChange:s}}),[i,r,s]);return t.createElement(a,{value:l},t.createElement("div",Object.assign({className:"eds-choice-chips-group"},o),c))}; | ||
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var n=e(require("@babel/runtime/helpers/objectWithoutProperties")),t=e(require("react")),r=e(require("classnames")),i=require("@entur/form"),a=t.createContext(null),c=a.Provider,s=t.forwardRef((function(e,i){var c=e.className,s=e.children,o=e.value,l=e.disabled,h=void 0!==l&&l,u=e.style,d=n(e,["className","children","value","disabled","style"]),p=t.Children.toArray(s),m=r(c,"eds-chip",{"eds-chip--disabled":h,"eds-chip--leading-icon":p.length>1&&"string"!=typeof p[0],"eds-chip--trailing-icon":p.length>1&&"string"!=typeof p[p.length-1]}),g=function(){var e=t.useContext(a);if(!e)throw new Error("You need to wrap your ChoiceChips in a ChoiceChipGroup-component");return e}();return t.createElement("label",{className:"eds-choice-chip",style:u},t.createElement("input",Object.assign({className:"eds-choice-chip__input",type:"radio",name:g.name,ref:i,value:o,disabled:h,checked:g.value===o,onChange:g.onChange},d)),t.createElement("div",{className:m},s))}));exports.ActionChip=t.forwardRef((function(e,i){var a=e.children,c=e.className,s=n(e,["children","className"]),o=t.Children.toArray(a);return t.createElement("button",Object.assign({className:r("eds-chip","eds-action-chip",{"eds-chip--leading-icon":o.length>1&&"string"!=typeof o[0],"eds-chip--trailing-icon":o.length>1&&"string"!=typeof o[o.length-1]},c),ref:i,type:"button"},s),a)})),exports.ChoiceChip=s,exports.ChoiceChipGroup=function(e){var r=e.name,a=e.value,s=e.children,o=e.onChange,l=n(e,["name","value","children","onChange"]),h=t.useMemo((function(){return{name:r,value:a,onChange:o}}),[r,a,o]);return t.createElement(c,{value:h},t.createElement(i.Fieldset,Object.assign({className:"eds-choice-chips-group"},l),s))}; | ||
//# sourceMappingURL=chip.cjs.production.min.js.map |
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties'; | ||
import React from 'react'; | ||
import cx from 'classnames'; | ||
import { Fieldset } from '@entur/form'; | ||
@@ -97,3 +98,3 @@ var ChoiceChipGroupContext = | ||
value: contextValue | ||
}, React.createElement("div", Object.assign({ | ||
}, React.createElement(Fieldset, Object.assign({ | ||
className: "eds-choice-chips-group" | ||
@@ -100,0 +101,0 @@ }, rest), children)); |
{ | ||
"name": "@entur/chip", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"license": "EUPL-1.2", | ||
@@ -30,6 +30,7 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@entur/form": "^2.0.1", | ||
"@entur/tokens": "^1.1.0", | ||
"classnames": "^2.2.6" | ||
}, | ||
"gitHead": "c518a56619cd30d0c7254b0f9f5298c69e54a8a0" | ||
"gitHead": "cd41e0807d7058a810f686f97fb9f33a0c2b24fd" | ||
} |
@@ -5,3 +5,3 @@ # chip | ||
> 💡 Looking for the [documentation](https://entur-design-system.firebaseapp.com/komponenter/buttons/chips)? | ||
> 💡 Looking for the [documentation](https://design.entur.org/komponenter/skjemaelementer/chips)? | ||
@@ -18,2 +18,2 @@ ## Installation | ||
Please refer to the [documentation](https://entur-design-system.firebaseapp.com/komponenter/buttons/chips) for usage information. | ||
Please refer to the [documentation](https://design.entur.org/komponenter/skjemaelementer/chips) for usage information. |
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
57643
5
349
+ Added@entur/form@^2.0.1
+ Added@entur/button@3.2.33(transitive)
+ Added@entur/form@2.5.5(transitive)
+ Added@entur/icons@1.20.06.18.17.4.1(transitive)
+ Added@entur/layout@2.3.17(transitive)
+ Added@entur/loader@0.5.11(transitive)
+ Added@entur/tokens@3.17.1(transitive)
+ Added@entur/tooltip@2.7.11(transitive)
+ Added@entur/typography@1.8.46(transitive)
+ Added@entur/utils@0.11.20.12.00.2.90.4.9(transitive)
+ Added@popperjs/core@2.11.8(transitive)
+ Addedflat@5.0.2(transitive)
+ Addednormalize-scss@7.0.1(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedreact@17.0.2(transitive)
+ Addedreact-fast-compare@3.2.2(transitive)
+ Addedreact-popper@2.2.5(transitive)
+ Addedtiny-warning@1.0.3(transitive)
+ Addedwarning@4.0.3(transitive)