@entur/chip
Advanced tools
Comparing version 0.6.67 to 0.6.68
@@ -85,3 +85,4 @@ 'use strict'; | ||
checked: selectedValue === value, | ||
onChange: onChange | ||
onChange: onChange, | ||
"aria-disabled": disabled | ||
}, rest)), React.createElement("div", { | ||
@@ -151,3 +152,3 @@ className: classList | ||
ref: ref | ||
}, React.createElement(icons.CloseIcon, { | ||
}, React.createElement(icons.CloseSmallIcon, { | ||
"aria-hidden": true | ||
@@ -167,3 +168,3 @@ }))); | ||
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1); | ||
var classList = classNames(className, 'eds-chip', 'eds-filter-chip'); | ||
var classList = classNames(className, 'eds-filter-chip'); | ||
return React.createElement("label", { | ||
@@ -179,5 +180,7 @@ className: classList, | ||
disabled: disabled | ||
}, rest)), React.createElement("span", { | ||
}, rest)), React.createElement("div", { | ||
className: "eds-chip" | ||
}, React.createElement("span", { | ||
className: "eds-filter-chip__icon" | ||
}, React.createElement(CheckboxIcon, null)), children); | ||
}, React.createElement(CheckboxIcon, null)), children)); | ||
}); | ||
@@ -187,10 +190,12 @@ var CheckboxIcon = function CheckboxIcon() { | ||
className: "eds-filter-chip-icon", | ||
width: "11px", | ||
height: "9px", | ||
viewBox: "6 11 37 33", | ||
"aria-hidden": true | ||
width: "16", | ||
height: "16", | ||
viewBox: "0 0 16 16", | ||
fill: "none", | ||
xmlns: "http://www.w3.org/2000/svg" | ||
}, React.createElement("path", { | ||
className: "eds-filter-chip-icon__path", | ||
d: "M14.1 27.2l7.1 7.2 14.6-14.8", | ||
fill: "none" | ||
d: "M1.71283 7.10801L5.6464 11.1377C5.84098 11.3371 6.16095 11.339 6.35786 11.1419L14.2916 3.20325", | ||
stroke: "#181C56", | ||
strokeWidth: "2" | ||
})); | ||
@@ -197,0 +202,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@entur/utils"),a=require("react"),n=require("classnames"),t=require("@entur/loader"),i=require("@entur/icons"),r=require("@entur/form");function l(){return l=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var n=arguments[a];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},l.apply(this,arguments)}function c(e,a){if(null==e)return{};var n,t,i={},r=Object.keys(e);for(t=0;t<r.length;t++)a.indexOf(n=r[t])>=0||(i[n]=e[n]);return i}var s=a.createContext(null),o=s.Provider,d=["className","children","value","disabled","style"],u=a.forwardRef((function(e,t){var i=e.className,r=e.children,o=e.value,u=e.disabled,h=void 0!==u&&u,p=e.style,m=c(e,d),f=a.Children.toArray(r),v=function(e){var a;return null==e||null==(a=e.type)?void 0:a.toString().toLowerCase().includes("icon")},b=f.length>1&&v(f.at(0)),g=f.length>1&&v(f.at(-1)),C=n(i,"eds-chip",{"eds-chip--disabled":h,"eds-chip--leading-icon":b,"eds-chip--trailing-icon":g}),y=function(){var e=a.useContext(s);if(!e)throw new Error("You need to wrap your ChoiceChips in a ChoiceChipGroup-component");return e}();return a.createElement("label",{className:"eds-choice-chip",style:p},a.createElement("input",l({className:"eds-choice-chip__input",type:"radio",name:y.name,ref:t,value:o,disabled:h,checked:y.value===o,onChange:y.onChange},m)),a.createElement("div",{className:C},r))})),h=["children","className","loading"],p=a.forwardRef((function(e,i){var r=e.children,s=e.className,o=e.loading,d=void 0!==o&&o,u=c(e,h),p=a.Children.toArray(r),m=function(e){var a;return null==e||null==(a=e.type)?void 0:a.toString().toLowerCase().includes("icon")},f=p.length>1&&m(p.at(0)),v=p.length>1&&m(p.at(-1)),b=p.filter((function(e){return"string"==typeof e})).join(" "),g=a.createElement("button",l({className:n("eds-chip","eds-action-chip",{"eds-chip--leading-icon":f,"eds-chip--trailing-icon":v,"eds-action-chip--disabled":u.disabled},s),ref:i,"aria-busy":d,"aria-label":u["aria-label"]?u["aria-label"]:d?b:void 0,type:"button"},u),d?a.createElement(t.LoadingDots,{className:"eds-action-chip__loading-dots"}):r);return u.disabled?a.createElement("div",{className:"eds-action-chip--disabled__wrapper"},g):a.createElement(a.Fragment,null,g)})),m=["children","className","onClose","closeButtonAriaLabel"],f=a.forwardRef((function(e,t){var r=e.children,s=e.className,o=e.onClose,d=e.closeButtonAriaLabel,u=c(e,m),h=null!=d?d:"Fjern "+(null==r?void 0:r.toString());return a.createElement("div",l({className:n("eds-chip","eds-tag-chip",s)},u),r,a.createElement("button",{className:"eds-tag-chip__close-button",type:"button",onClick:o,"aria-label":h,ref:t},a.createElement(i.CloseIcon,{"aria-hidden":!0})))})),v=["className","children","value","disabled","name","style"],b=a.forwardRef((function(e,t){var i=e.className,r=e.children,s=e.value,o=e.disabled,d=void 0!==o&&o,u=e.name,h=e.style,p=c(e,v),m=n(i,"eds-chip","eds-filter-chip");return a.createElement("label",{className:m,style:h},a.createElement("input",l({className:"eds-filter-chip__input",type:"checkbox",name:u,ref:t,value:s,disabled:d},p)),a.createElement("span",{className:"eds-filter-chip__icon"},a.createElement(g,null)),r)})),g=function(){return a.createElement("svg",{className:"eds-filter-chip-icon",width:"11px",height:"9px",viewBox:"6 11 37 33","aria-hidden":!0},a.createElement("path",{className:"eds-filter-chip-icon__path",d:"M14.1 27.2l7.1 7.2 14.6-14.8",fill:"none"}))},C=["name","value","children","onChange","label"];e.warnAboutMissingStyles("chip","form"),exports.ActionChip=p,exports.ChoiceChip=u,exports.ChoiceChipGroup=function(e){var n=e.name,t=e.value,i=e.children,s=e.onChange,d=e.label,u=c(e,C),h=a.useMemo((function(){return{name:n,value:t,onChange:s}}),[n,t,s]);return a.createElement(o,{value:h},a.createElement(r.Fieldset,l({className:"eds-choice-chips-group",label:d},u),i))},exports.FilterChip=b,exports.TagChip=f; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@entur/utils"),a=require("react"),t=require("classnames"),n=require("@entur/loader"),r=require("@entur/icons"),i=require("@entur/form");function l(){return l=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},l.apply(this,arguments)}function c(e,a){if(null==e)return{};var t,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)a.indexOf(t=i[n])>=0||(r[t]=e[t]);return r}var s=a.createContext(null),o=s.Provider,d=["className","children","value","disabled","style"],u=a.forwardRef((function(e,n){var r=e.className,i=e.children,o=e.value,u=e.disabled,h=void 0!==u&&u,p=e.style,m=c(e,d),f=a.Children.toArray(i),v=function(e){var a;return null==e||null==(a=e.type)?void 0:a.toString().toLowerCase().includes("icon")},b=f.length>1&&v(f.at(0)),g=f.length>1&&v(f.at(-1)),C=t(r,"eds-chip",{"eds-chip--disabled":h,"eds-chip--leading-icon":b,"eds-chip--trailing-icon":g}),y=function(){var e=a.useContext(s);if(!e)throw new Error("You need to wrap your ChoiceChips in a ChoiceChipGroup-component");return e}();return a.createElement("label",{className:"eds-choice-chip",style:p},a.createElement("input",l({className:"eds-choice-chip__input",type:"radio",name:y.name,ref:n,value:o,disabled:h,checked:y.value===o,onChange:y.onChange,"aria-disabled":h},m)),a.createElement("div",{className:C},i))})),h=["children","className","loading"],p=a.forwardRef((function(e,r){var i=e.children,s=e.className,o=e.loading,d=void 0!==o&&o,u=c(e,h),p=a.Children.toArray(i),m=function(e){var a;return null==e||null==(a=e.type)?void 0:a.toString().toLowerCase().includes("icon")},f=p.length>1&&m(p.at(0)),v=p.length>1&&m(p.at(-1)),b=p.filter((function(e){return"string"==typeof e})).join(" "),g=a.createElement("button",l({className:t("eds-chip","eds-action-chip",{"eds-chip--leading-icon":f,"eds-chip--trailing-icon":v,"eds-action-chip--disabled":u.disabled},s),ref:r,"aria-busy":d,"aria-label":u["aria-label"]?u["aria-label"]:d?b:void 0,type:"button"},u),d?a.createElement(n.LoadingDots,{className:"eds-action-chip__loading-dots"}):i);return u.disabled?a.createElement("div",{className:"eds-action-chip--disabled__wrapper"},g):a.createElement(a.Fragment,null,g)})),m=["children","className","onClose","closeButtonAriaLabel"],f=a.forwardRef((function(e,n){var i=e.children,s=e.className,o=e.onClose,d=e.closeButtonAriaLabel,u=c(e,m),h=null!=d?d:"Fjern "+(null==i?void 0:i.toString());return a.createElement("div",l({className:t("eds-chip","eds-tag-chip",s)},u),i,a.createElement("button",{className:"eds-tag-chip__close-button",type:"button",onClick:o,"aria-label":h,ref:n},a.createElement(r.CloseSmallIcon,{"aria-hidden":!0})))})),v=["className","children","value","disabled","name","style"],b=a.forwardRef((function(e,n){var r=e.className,i=e.children,s=e.value,o=e.disabled,d=void 0!==o&&o,u=e.name,h=e.style,p=c(e,v),m=t(r,"eds-filter-chip");return a.createElement("label",{className:m,style:h},a.createElement("input",l({className:"eds-filter-chip__input",type:"checkbox",name:u,ref:n,value:s,disabled:d},p)),a.createElement("div",{className:"eds-chip"},a.createElement("span",{className:"eds-filter-chip__icon"},a.createElement(g,null)),i))})),g=function(){return a.createElement("svg",{className:"eds-filter-chip-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{className:"eds-filter-chip-icon__path",d:"M1.71283 7.10801L5.6464 11.1377C5.84098 11.3371 6.16095 11.339 6.35786 11.1419L14.2916 3.20325",stroke:"#181C56",strokeWidth:"2"}))},C=["name","value","children","onChange","label"];e.warnAboutMissingStyles("chip","form"),exports.ActionChip=p,exports.ChoiceChip=u,exports.ChoiceChipGroup=function(e){var t=e.name,n=e.value,r=e.children,s=e.onChange,d=e.label,u=c(e,C),h=a.useMemo((function(){return{name:t,value:n,onChange:s}}),[t,n,s]);return a.createElement(o,{value:h},a.createElement(i.Fieldset,l({className:"eds-choice-chips-group",label:d},u),r))},exports.FilterChip=b,exports.TagChip=f; | ||
//# sourceMappingURL=chip.cjs.production.min.js.map |
@@ -5,3 +5,3 @@ import { warnAboutMissingStyles } from '@entur/utils'; | ||
import { LoadingDots } from '@entur/loader'; | ||
import { CloseIcon } from '@entur/icons'; | ||
import { CloseSmallIcon } from '@entur/icons'; | ||
import { Fieldset } from '@entur/form'; | ||
@@ -82,3 +82,4 @@ | ||
checked: selectedValue === value, | ||
onChange: onChange | ||
onChange: onChange, | ||
"aria-disabled": disabled | ||
}, rest)), React.createElement("div", { | ||
@@ -148,3 +149,3 @@ className: classList | ||
ref: ref | ||
}, React.createElement(CloseIcon, { | ||
}, React.createElement(CloseSmallIcon, { | ||
"aria-hidden": true | ||
@@ -164,3 +165,3 @@ }))); | ||
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1); | ||
var classList = classNames(className, 'eds-chip', 'eds-filter-chip'); | ||
var classList = classNames(className, 'eds-filter-chip'); | ||
return React.createElement("label", { | ||
@@ -176,5 +177,7 @@ className: classList, | ||
disabled: disabled | ||
}, rest)), React.createElement("span", { | ||
}, rest)), React.createElement("div", { | ||
className: "eds-chip" | ||
}, React.createElement("span", { | ||
className: "eds-filter-chip__icon" | ||
}, React.createElement(CheckboxIcon, null)), children); | ||
}, React.createElement(CheckboxIcon, null)), children)); | ||
}); | ||
@@ -184,10 +187,12 @@ var CheckboxIcon = function CheckboxIcon() { | ||
className: "eds-filter-chip-icon", | ||
width: "11px", | ||
height: "9px", | ||
viewBox: "6 11 37 33", | ||
"aria-hidden": true | ||
width: "16", | ||
height: "16", | ||
viewBox: "0 0 16 16", | ||
fill: "none", | ||
xmlns: "http://www.w3.org/2000/svg" | ||
}, React.createElement("path", { | ||
className: "eds-filter-chip-icon__path", | ||
d: "M14.1 27.2l7.1 7.2 14.6-14.8", | ||
fill: "none" | ||
d: "M1.71283 7.10801L5.6464 11.1377C5.84098 11.3371 6.16095 11.339 6.35786 11.1419L14.2916 3.20325", | ||
stroke: "#181C56", | ||
strokeWidth: "2" | ||
})); | ||
@@ -194,0 +199,0 @@ }; |
{ | ||
"name": "@entur/chip", | ||
"version": "0.6.67", | ||
"version": "0.6.68", | ||
"license": "EUPL-1.2", | ||
@@ -30,10 +30,10 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@entur/form": "^7.0.39", | ||
"@entur/icons": "^6.15.1", | ||
"@entur/loader": "^0.4.55", | ||
"@entur/tokens": "^3.13.0", | ||
"@entur/form": "^7.0.40", | ||
"@entur/icons": "^6.15.2", | ||
"@entur/loader": "^0.4.56", | ||
"@entur/tokens": "^3.13.1", | ||
"@entur/utils": "^0.10.0", | ||
"classnames": "^2.3.1" | ||
}, | ||
"gitHead": "450b88a0baca11352d329ffa3fcd6c003ec1d338" | ||
"gitHead": "d0a435264ccaf7ed8e6b7798c81e876176ce3d4d" | ||
} |
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
130131
1468
Updated@entur/form@^7.0.40
Updated@entur/icons@^6.15.2
Updated@entur/loader@^0.4.56
Updated@entur/tokens@^3.13.1