@entur/form
Advanced tools
Comparing version 8.0.2 to 8.1.0-beta.0
import React from 'react'; | ||
import { VariantType } from '@entur/utils'; | ||
import { Placement } from '@entur/tooltip'; | ||
import './BaseFormControl.scss'; | ||
@@ -33,2 +34,3 @@ /** @deprecated use variant="information" instead */ | ||
labelTooltipButtonAriaLabel?: string; | ||
labelTooltipPlacement?: Placement; | ||
/** Illustrerer om inputfeltet er påkrevd eller ikke */ | ||
@@ -35,0 +37,0 @@ required?: boolean; |
@@ -174,3 +174,3 @@ 'use strict'; | ||
var _excluded$e = ["children", "className", "disabled", "readOnly", "variant", "prepend", "append", "size", "isFilled", "label", "required", "labelTooltip", "labelTooltipButtonAriaLabel", "feedback", "labelId", "labelProps", "style", "disableLabelAnimation", "ariaAlertOnFeedback"]; | ||
var _excluded$e = ["children", "className", "disabled", "readOnly", "variant", "prepend", "append", "size", "isFilled", "label", "required", "labelTooltip", "labelTooltipButtonAriaLabel", "labelTooltipPlacement", "feedback", "labelId", "labelProps", "style", "disableLabelAnimation", "ariaAlertOnFeedback"]; | ||
/** @deprecated use variant="negative" instead */ | ||
@@ -196,2 +196,4 @@ var error = 'error'; | ||
labelTooltipButtonAriaLabel = _ref$labelTooltipButt === void 0 ? 'Klikk for tilleggsinfo om feltet' : _ref$labelTooltipButt, | ||
_ref$labelTooltipPlac = _ref.labelTooltipPlacement, | ||
labelTooltipPlacement = _ref$labelTooltipPlac === void 0 ? 'top' : _ref$labelTooltipPlac, | ||
feedback = _ref.feedback, | ||
@@ -208,2 +210,3 @@ labelId = _ref.labelId, | ||
var currentVariant = variant || contextVariant; | ||
console.log('baseF', labelTooltipPlacement); | ||
return React.createElement(InputGroupContextProvider, null, React.createElement("div", { | ||
@@ -232,3 +235,3 @@ className: classNames('eds-form-control__field-and-feedback-text', className, { | ||
content: labelTooltip, | ||
placement: "right", | ||
placement: labelTooltipPlacement, | ||
showCloseButton: false, | ||
@@ -621,3 +624,3 @@ disableFocusListener: true, | ||
var _excluded$5 = ["variant", "disabled", "readOnly", "className", "style", "label", "feedback", "labelTooltip", "onChange", "disableLabelAnimation"], | ||
var _excluded$5 = ["variant", "disabled", "readOnly", "className", "style", "label", "feedback", "labelTooltip", "labelTooltipButtonAriaLabel", "labelTooltipPlacement", "onChange", "disableLabelAnimation"], | ||
_excluded2$1 = ["readOnly", "disabled", "onChange", "value", "variant"]; | ||
@@ -635,2 +638,4 @@ var TextArea = /*#__PURE__*/React.forwardRef(function (_ref, ref) { | ||
labelTooltip = _ref.labelTooltip, | ||
labelTooltipButtonAriaLabel = _ref.labelTooltipButtonAriaLabel, | ||
labelTooltipPlacement = _ref.labelTooltipPlacement, | ||
onChange = _ref.onChange, | ||
@@ -651,2 +656,4 @@ disableLabelAnimation = _ref.disableLabelAnimation, | ||
labelTooltip: labelTooltip, | ||
labelTooltipButtonAriaLabel: labelTooltipButtonAriaLabel, | ||
labelTooltipPlacement: labelTooltipPlacement, | ||
labelProps: { | ||
@@ -712,3 +719,3 @@ className: 'eds-textarea__label' | ||
var _excluded$4 = ["prepend", "append", "variant", "disabled", "readOnly", "className", "style", "size", "label", "required", "labelTooltip", "feedback", "onChange", "disableLabelAnimation", "labelProps", "clearable", "onClear", "value", "ariaAlertOnFeedback"], | ||
var _excluded$4 = ["prepend", "append", "variant", "disabled", "readOnly", "className", "style", "size", "label", "required", "labelTooltip", "labelTooltipButtonAriaLabel", "labelTooltipPlacement", "feedback", "onChange", "disableLabelAnimation", "labelProps", "clearable", "onClear", "value", "ariaAlertOnFeedback"], | ||
_excluded2 = ["disabled", "readOnly", "placeholder", "onChange", "value", "variant"], | ||
@@ -731,2 +738,4 @@ _excluded3 = ["onClear"]; | ||
labelTooltip = _ref.labelTooltip, | ||
labelTooltipButtonAriaLabel = _ref.labelTooltipButtonAriaLabel, | ||
labelTooltipPlacement = _ref.labelTooltipPlacement, | ||
feedback = _ref.feedback, | ||
@@ -760,2 +769,4 @@ onChange = _ref.onChange, | ||
labelTooltip: labelTooltip, | ||
labelTooltipButtonAriaLabel: labelTooltipButtonAriaLabel, | ||
labelTooltipPlacement: labelTooltipPlacement, | ||
labelId: textFieldId, | ||
@@ -762,0 +773,0 @@ feedback: feedback, |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@entur/utils"),a=require("react"),l=require("classnames"),n=require("@entur/icons"),t=require("@entur/tooltip"),r=require("@entur/button"),i=require("@entur/typography"),d=require("@entur/tokens");function o(e){var a=Object.create(null);return e&&Object.keys(e).forEach((function(l){if("default"!==l){var n=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(a,l,n.get?n:{enumerable:!0,get:function(){return e[l]}})}})),a.default=e,a}var c=o(a);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e},s.apply(this,arguments)}function u(e,a){if(null==e)return{};var l,n,t={},r=Object.keys(e);for(n=0;n<r.length;n++)a.indexOf(l=r[n])>=0||(t[l]=e[l]);return t}var m=["children","hideIcon","variant","className"],b=function(e){var l=e.variant,t="eds-feedback-text__icon eds-feedback-text__icon--"+l;switch(l){case"success":return a.createElement(n.ValidationSuccessFilledIcon,{"aria-label":"Suksessmelding",className:t});case"negative":case"error":return a.createElement(n.ValidationErrorFilledIcon,{"aria-label":"Feilmelding",className:t});case"information":default:return null;case"warning":return a.createElement(n.ValidationExclamationFilledIcon,{"aria-label":"Varselmelding",className:t})}},p=function(e){var n=e.children,t=e.hideIcon,r=void 0!==t&&t,d=e.variant,o=e.className,c=u(e,m);return a.createElement(i.SubLabel,s({className:l("eds-feedback-text",{"eds-feedback-text--information":"info"===d||"information"===d},o)},c),!r&&a.createElement(b,{variant:d}),a.createElement("span",{className:"eds-feedback-text__text"},n))},f=c.createContext({isFilled:!1,setFilled:function(){return null}}),v=function(e){var a=e.children,l=c.useState(!1);return c.createElement(f.Provider,{value:{isFilled:l[0],setFilled:l[1]}},a)},h=function(){return c.useContext(f)},g=["label","required","labelId","staticAnimation"],E=function(e){var n=e.label,t=e.required,r=e.labelId,i=e.staticAnimation,d=void 0!==i&&i,o=u(e,g),c=h(),m=d||c.isFilled;return a.createElement("label",s({className:l(o.className,{"eds-input-group-label-wrapper--filled":m}),id:r},o),a.createElement("span",{className:l("eds-input-group__label",{"eds-input-group__label--filled":m})},n," ",t&&a.createElement("span",null,"*")))},y=a.createContext(null),C=function(){return a.useContext(y)},_=["children","className","disabled","readOnly","variant","prepend","append","size","isFilled","label","required","labelTooltip","labelTooltipButtonAriaLabel","feedback","labelId","labelProps","style","disableLabelAnimation","ariaAlertOnFeedback"],x=a.forwardRef((function(e,i){var d=e.children,o=e.className,c=e.disabled,m=void 0!==c&&c,b=e.readOnly,f=void 0!==b&&b,h=e.variant,g=e.prepend,y=e.append,x=e.size,k=void 0===x?"medium":x,N=e.isFilled,w=e.label,O=e.required,I=e.labelTooltip,F=e.labelTooltipButtonAriaLabel,R=void 0===F?"Klikk for tilleggsinfo om feltet":F,z=e.feedback,L=e.labelId,A=e.labelProps,P=e.style,S=e.disableLabelAnimation,V=void 0!==S&&S,q=e.ariaAlertOnFeedback,T=void 0!==q&&q,j=u(e,_),B=C(),M=h||B;return a.createElement(v,null,a.createElement("div",{className:l("eds-form-control__field-and-feedback-text",o,{"eds-form-control__field-and-feedback-text--has-tooltip":void 0!==I}),style:P},a.createElement("div",s({className:l("eds-form-control-wrapper","eds-form-control-wrapper--size-"+k,{"eds-form-control-wrapper--success":"success"===M,"eds-form-control-wrapper--negative":"negative"===M||"error"===M,"eds-form-control-wrapper--disabled":m,"eds-form-control-wrapper--readonly":f,"eds-form-control-wrapper--is-filled":N}),ref:i},j),g&&a.createElement("div",{className:"eds-form-control__prepend"},g),a.createElement(E,s({label:w,required:O,labelId:L,staticAnimation:V},A)),I&&a.createElement(t.Tooltip,{content:I,placement:"right",showCloseButton:!1,disableFocusListener:!0,disableHoverListener:!0,disableClickListner:!1,disableKeyboardListener:!1},a.createElement(r.IconButton,{as:"span",tabIndex:0,role:"button",className:"eds-form-control__append eds-form-control__append--tooltip","aria-label":R},a.createElement(n.QuestionIcon,{className:"eds-input-group__label-tooltip-icon","aria-hidden":"true"}))),d,y&&a.createElement("div",{className:"eds-form-control__append"},y)),z&&M&&a.createElement(p,{variant:M,role:T?"alert":void 0},z)))})),k=["checked","className","children","style","disabled","reduceClickArea"],N=a.forwardRef((function(n,t){var r=n.checked,d=n.className,o=n.children,c=n.style,m=n.disabled,b=void 0!==m&&m,p=n.reduceClickArea,f=u(n,k),v=a.useRef(null),h="indeterminate"===r,g=void 0!==r;return a.useEffect((function(){v&&v.current&&(v.current.indeterminate=h)}),[h]),a.createElement("label",{className:l("eds-checkbox__container",d,{"eds-checkbox--disabled":b,"eds-checkbox__container--reduced-click-area":p}),style:c},a.createElement("input",s({type:"checkbox",ref:e.mergeRefs(t,v),checked:g?!0===r:void 0,disabled:b},f)),a.createElement("span",{className:l("eds-checkbox__icon",{"eds-checkbox__icon--disabled":b,"eds-checkbox__icon--reduced-click-area":p})},a.createElement(w,{indeterminate:h})),o&&a.createElement(i.Paragraph,{className:"eds-checkbox__label",margin:"none",as:"span"},o))})),w=function(e){var l=e.indeterminate;return a.createElement("svg",{className:"eds-checkbox-icon",width:"11px",height:"9px",viewBox:"6 11 37 33","aria-hidden":!0},void 0!==l&&l?a.createElement("rect",{x:"10",y:"25",width:"28",height:"5",fill:"white"}):a.createElement("path",{d:"M14.1 27.2l7.1 7.2 14.6-14.8",fill:"none"}))},O=["children","className","label"],I=function(e){var n=e.children,t=e.className,r=e.label,d=u(e,O);return a.createElement("fieldset",s({className:l("eds-fieldset",t)},d),r&&a.createElement(i.Heading5,{as:"legend"},r),n)},F=a.createContext(null),R=F.Provider,z=function(){var e=a.useContext(F);if(!e)throw new Error("You need to wrap your RadioButtons in a RadioGroup component");return e},L=["className","children","value","disabled"],A=a.forwardRef((function(e,n){var t,r,d,o=e.className,c=e.children,m=e.value,b=e.disabled,p=u(e,L),f=l(o,"eds-form-component--radio__radio",{"eds-form-component--radio__radio--disabled":b}),v=z();return a.createElement("label",{className:"eds-form-component--radio__container"},a.createElement("input",s({type:"radio",name:null!=(t=p.name)?t:v.name,ref:n,value:m,checked:null!=(r=p.checked)?r:v.value===m,onChange:null!=(d=p.onChange)?d:v.onChange,disabled:b},p)),a.createElement("span",{className:f},a.createElement("span",{className:"eds-form-component--radio__circle"})),c&&a.createElement(i.Paragraph,{margin:"none",as:"span",className:"eds-form-component--radio__label"},c))})),P=["className","children","value","title","secondaryLabel","size","hideSelectionIndicator","style","id","disabled","type","onChange","checked","name"],S=a.forwardRef((function(n,t){var r,i,d,o,c=n.className,m=n.children,b=n.value,p=n.title,f=n.secondaryLabel,v=n.size,h=void 0===v?"medium":v,g=n.hideSelectionIndicator,E=void 0!==g&&g,y=n.style,C=n.id,_=n.disabled,x=void 0!==_&&_,k=n.type,w=void 0===k?"radio":k,O=n.onChange,I=n.checked,F=n.name,R=u(n,P),z=l(c,"eds-input-panel__container","eds-input-panel--"+h),L=a.useRef(null),S=e.useRandomId("eds-inputpanel"),V=C||S,q=e.useForceUpdate();return a.createElement("label",{className:"eds-input-panel",htmlFor:V},a.createElement("input",s({type:w,name:F,ref:e.mergeRefs(t,L),value:b,checked:I,onChange:function(e){void 0===O&&q(),null==O||O(e)},id:V,disabled:x},R)),a.createElement("div",{className:z,style:y},a.createElement("div",{className:"eds-input-panel__title-wrapper"},a.createElement("div",{className:"eds-input-panel__title"},p),a.createElement("div",{className:"eds-input-panel__secondary-label-and-icon-wrapper"},void 0!==f&&a.createElement(a.Fragment,null,f),a.createElement("span",{style:{pointerEvents:"none"}},!(x||E)&&("radio"===w?a.createElement(A,{name:"",value:"",checked:null!=(r=null!=I?I:null==(i=L.current)?void 0:i.checked)&&r,onChange:function(){},"aria-hidden":"true",tabIndex:-1}):a.createElement(N,{checked:null!=(d=null!=I?I:null==(o=L.current)?void 0:o.checked)&&d,onChange:function(){return null},"aria-hidden":"true",tabIndex:-1}))))),m&&a.createElement("div",{className:"eds-input-panel__additional-content"},m)))})),V=["className","children","value","title","secondaryLabel","size","hideRadioButton","style","id","disabled"],q=a.forwardRef((function(e,l){var n=e.className,t=e.children,r=e.value,i=e.title,d=e.secondaryLabel,o=e.size,c=void 0===o?"medium":o,m=e.hideRadioButton,b=void 0!==m&&m,p=e.style,f=e.id,v=e.disabled,h=void 0!==v&&v,g=u(e,V),E=z();return a.createElement(S,s({type:"radio",name:E.name,title:i,value:r,checked:E.value===r,onChange:E.onChange,className:n,secondaryLabel:d,size:c,hideSelectionIndicator:b,style:p,id:f,disabled:h},g,{ref:l}),t)})),T=["name","checked","onChange","className","children","value","title","secondaryLabel","size","hideCheckbox","style","id","disabled"],j=a.forwardRef((function(e,l){var n=e.name,t=e.checked,r=e.onChange,i=e.className,d=e.children,o=e.value,c=e.title,m=e.secondaryLabel,b=e.size,p=void 0===b?"medium":b,f=e.hideCheckbox,v=void 0!==f&&f,h=e.style,g=e.id,E=e.disabled,y=void 0!==E&&E,C=u(e,T);return a.createElement(S,s({type:"checkbox",name:n,title:c,value:o,checked:t,onChange:r,className:i,secondaryLabel:m,size:p,hideSelectionIndicator:v,style:h,id:g,disabled:y},C,{ref:l}),d)})),B=["name","value","children","onChange","label"],M=["className","children","labelPlacement","icon","hideIcon","color","contrastColor","size","checked"],G=a.forwardRef((function(e,t){var r=e.className,i=e.children,o=e.labelPlacement,c=void 0===o?"right":o,m=e.icon,b=e.hideIcon,p=void 0!==b&&b,f=e.color,v=void 0===f?d.colors.validation.mint:f,h=e.contrastColor,g=void 0===h?d.colors.validation.mintContrast:h,E=e.size,y=void 0===E?"medium":E,C=e.checked,_=u(e,M);return a.createElement("label",{className:l("eds-switch","eds-switch--"+c,r),style:s({},_.style)},a.createElement("input",s({type:"checkbox",ref:t,checked:C},_)),a.createElement("span",{className:l("eds-switch__switch","eds-switch__switch--"+y),style:{"--eds-switch-color":v,"--eds-switch-contrast-color":g},"aria-hidden":"true"},a.createElement("span",{className:"eds-switch__circle"},!p&&(m||(void 0===C?a.createElement(a.Fragment,null):a.createElement(C?n.CheckIcon:n.CloseSmallIcon,{size:"large"===y?23:void 0}))))),i&&a.createElement("span",{className:l("eds-switch__label","eds-switch__label--"+y+"--"+c)},i))}));function H(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function K(e,a){return void 0===a&&(a=!1),e&&(H(e.value)&&""!==e.value||a&&H(e.defaultValue)&&""!==e.defaultValue)}var Y=["variant","disabled","readOnly","className","style","label","feedback","labelTooltip","onChange","disableLabelAnimation"],D=["readOnly","disabled","onChange","value","variant"],Q=a.forwardRef((function(n,t){var r=n.variant,i=n.disabled,d=void 0!==i&&i,o=n.readOnly,c=void 0!==o&&o,m=n.className,b=n.style,p=n.label,f=n.feedback,v=n.labelTooltip,h=n.onChange,g=n.disableLabelAnimation,E=u(n,Y),y=e.useRandomId("eds-textarea"),C=a.useRef(null);return a.createElement(x,{className:l(m,"eds-textarea__wrapper"),disabled:d,readOnly:c,variant:r,style:b,label:p,labelId:y,feedback:f,labelTooltip:v,labelProps:{className:"eds-textarea__label"},disableLabelAnimation:g,onClick:function(e){var a;e.target===e.currentTarget&&(null==C||null==(a=C.current)||a.focus())}},a.createElement(U,s({readOnly:c,disabled:d,ref:e.mergeRefs(t,C),"aria-labelledby":y,onChange:h,variant:r},E)))})),U=a.forwardRef((function(l,n){var t=l.readOnly,r=l.disabled,i=l.onChange,d=l.value,o=l.variant,c=u(l,D),m=C(),b=o||m,p=h(),f=p.isFilled,v=p.setFilled;return e.useOnMount((function(){(null!=d&&d.toString()||c.defaultValue)&&v&&!f&&v(!0)})),a.useEffect((function(){null!=d&&d.toString()&&v&&!f&&v(!0)}),[d,v,f]),a.createElement("textarea",s({className:"eds-form-control eds-textarea",ref:n,readOnly:t,disabled:r,onChange:function(e){K(e.target)?v&&!f&&v(!0):v&&f&&v(!1),i&&i(e)},value:d,"aria-invalid":"error"===b},c))})),J=["prepend","append","variant","disabled","readOnly","className","style","size","label","required","labelTooltip","feedback","onChange","disableLabelAnimation","labelProps","clearable","onClear","value","ariaAlertOnFeedback"],W=["disabled","readOnly","placeholder","onChange","value","variant"],X=["onClear"],Z=a.forwardRef((function(n,t){var r=n.prepend,i=n.append,d=n.variant,o=n.disabled,c=void 0!==o&&o,m=n.readOnly,b=void 0!==m&&m,p=n.className,f=n.style,v=n.size,h=void 0===v?"medium":v,g=n.label,E=n.required,y=n.labelTooltip,C=n.feedback,_=n.onChange,k=n.disableLabelAnimation,N=n.labelProps,w=n.clearable,O=void 0!==w&&w,I=n.onClear,F=n.value,R=n.ariaAlertOnFeedback,z=void 0!==R&&R,L=u(n,J),A=e.useRandomId("eds-textfield"),P=N&&N.id?N.id:A,S=a.useRef(null);return a.createElement(x,{disabled:c,readOnly:b,variant:d,prepend:r,append:O&&I?a.createElement(ee,{onClear:I}):i,className:l(p,"eds-textfield__wrapper"),style:f,size:h,label:g,required:E,labelTooltip:y,labelId:P,feedback:C,disableLabelAnimation:k,labelProps:N,ariaAlertOnFeedback:z,onClick:function(e){var a;e.target===e.currentTarget&&(null==S||null==(a=S.current)||a.focus())}},a.createElement($,s({disabled:c,readOnly:b,ref:e.mergeRefs(t,S),"aria-labelledby":P,onChange:_,value:F,variant:d},L)))})),$=a.forwardRef((function(l,n){var t=l.disabled,r=l.readOnly,i=l.placeholder,d=l.onChange,o=l.value,c=l.variant,m=u(l,W),b=C(),p=c||b,f=h(),v=f.isFilled,g=f.setFilled;return e.useOnMount((function(){(null!=o&&o.toString()||m.defaultValue)&&g&&!v&&g(!0)})),a.useEffect((function(){null!=o&&o.toString()&&g&&!v&&g(!0)}),[o,g,v]),a.createElement("input",s({"aria-invalid":"error"===p,className:"eds-form-control",disabled:t,readOnly:r,ref:n,placeholder:i,onChange:function(e){K(e.target)?g&&!v&&g(!0):g&&v&&g(!1),d&&d(e)},value:o},m))})),ee=function(e){var l=e.onClear,t=u(e,X),r=h(),i=r.isFilled,d=r.setFilled;return a.createElement("div",{className:"eds-textfield__clear-button-wrapper"},i&&a.createElement("div",{className:"eds-textfield__divider"}),i&&a.createElement("button",s({className:"eds-textfield__clear-button",type:"button",tabIndex:-1,onClick:function(){d(!1),l()}},t),a.createElement(n.CloseSmallIcon,null)))},ae=["name","onChange","selectedValue","multiple","size"],le=a.createContext(null),ne=function(l){var n=l.name,t=l.onChange,r=void 0===t?function(){}:t,i=l.selectedValue,d=l.multiple,o=l.size,c=u(l,ae),m=e.useRandomId("eds-segmented-control"),b=a.useMemo((function(){return{name:n||m,onChange:r,multiple:d,selectedValue:i,size:o}}),[m,d,n,r,i,o]);return a.createElement(le.Provider,s({value:b},c))},te=["children","className","style","value","name","onChange"],re=a.forwardRef((function(e,n){var t=e.children,r=e.className,i=e.style,d=e.value,o=e.name,c=e.onChange,m=void 0===c?function(){}:c,b=u(e,te),p=function(){var e=a.useContext(le);if(!e)throw new Error("You need to wrap your SegmentedChoice in either SegmentedControl or MultipleSegmentedControl");return e}(),f=p.name,v=p.selectedValue,h=p.onChange,g=p.multiple,E=p.size,y=g?v[d]:v===d;return a.createElement("label",{className:l("eds-segmented-choice",r),style:i},a.createElement("input",s({type:g?"checkbox":"radio",name:o||f,checked:y,value:d,onChange:function(e){var a;m(e),g?h(s({},v,((a={})[d]=e.target.checked,a))):e.target.checked&&h(d)},ref:n},b)),a.createElement("div",{className:l("eds-base-segmented",{"eds-base-segmented--large":"large"===E})},t))})),ie=["children","label","name","onChange","selectedValue","size","className"],de=["children","label","name","onChange","selectedValue"];e.warnAboutMissingStyles("form","icons","typography"),exports.BaseFormControl=x,exports.Checkbox=N,exports.CheckboxPanel=j,exports.FeedbackText=p,exports.Fieldset=I,exports.InputGroupContextProvider=v,exports.InputGroupLabel=E,exports.MultipleSegmentedControl=function(e){var l=e.children,n=e.label,t=e.name,r=e.onChange,d=e.selectedValue,o=u(e,de);return a.createElement(ne,{name:t,selectedValue:d,onChange:r,multiple:!0,size:"medium"},a.createElement(i.Label,{as:"div"},n),a.createElement("div",s({className:"eds-segmented-control"},o),l))},exports.Radio=A,exports.RadioGroup=function(e){var l=e.name,n=e.value,t=e.children,r=e.onChange,i=e.label,d=u(e,B),o=a.useMemo((function(){return{name:l,value:n,onChange:r}}),[l,n,r]);return a.createElement(R,{value:o},i?a.createElement(I,s({label:i},d),t):t)},exports.RadioPanel=q,exports.SegmentedChoice=re,exports.SegmentedControl=function(e){var n=e.children,t=e.label,r=e.name,i=e.onChange,d=e.selectedValue,o=e.size,c=void 0===o?"medium":o,m=e.className,b=u(e,ie);return a.createElement(ne,{name:r,selectedValue:d,onChange:i,multiple:!1,size:c},a.createElement(I,{label:t},a.createElement("div",s({className:l("eds-segmented-control",m)},b),n)))},exports.Switch=G,exports.TextArea=Q,exports.TextField=Z,exports.VariantProvider=function(e){var l=e.variant;return a.createElement(y.Provider,{value:void 0===l?null:l},e.children)},exports.hasValue=H,exports.isFilled=K,exports.useInputGroupContext=h,exports.useVariant=C; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@entur/utils"),a=require("react"),l=require("classnames"),n=require("@entur/icons"),t=require("@entur/tooltip"),r=require("@entur/button"),i=require("@entur/typography"),o=require("@entur/tokens");function d(e){var a=Object.create(null);return e&&Object.keys(e).forEach((function(l){if("default"!==l){var n=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(a,l,n.get?n:{enumerable:!0,get:function(){return e[l]}})}})),a.default=e,a}var c=d(a);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e},s.apply(this,arguments)}function u(e,a){if(null==e)return{};var l,n,t={},r=Object.keys(e);for(n=0;n<r.length;n++)a.indexOf(l=r[n])>=0||(t[l]=e[l]);return t}var m=["children","hideIcon","variant","className"],b=function(e){var l=e.variant,t="eds-feedback-text__icon eds-feedback-text__icon--"+l;switch(l){case"success":return a.createElement(n.ValidationSuccessFilledIcon,{"aria-label":"Suksessmelding",className:t});case"negative":case"error":return a.createElement(n.ValidationErrorFilledIcon,{"aria-label":"Feilmelding",className:t});case"information":default:return null;case"warning":return a.createElement(n.ValidationExclamationFilledIcon,{"aria-label":"Varselmelding",className:t})}},p=function(e){var n=e.children,t=e.hideIcon,r=void 0!==t&&t,o=e.variant,d=e.className,c=u(e,m);return a.createElement(i.SubLabel,s({className:l("eds-feedback-text",{"eds-feedback-text--information":"info"===o||"information"===o},d)},c),!r&&a.createElement(b,{variant:o}),a.createElement("span",{className:"eds-feedback-text__text"},n))},f=c.createContext({isFilled:!1,setFilled:function(){return null}}),v=function(e){var a=e.children,l=c.useState(!1);return c.createElement(f.Provider,{value:{isFilled:l[0],setFilled:l[1]}},a)},h=function(){return c.useContext(f)},g=["label","required","labelId","staticAnimation"],E=function(e){var n=e.label,t=e.required,r=e.labelId,i=e.staticAnimation,o=void 0!==i&&i,d=u(e,g),c=h(),m=o||c.isFilled;return a.createElement("label",s({className:l(d.className,{"eds-input-group-label-wrapper--filled":m}),id:r},d),a.createElement("span",{className:l("eds-input-group__label",{"eds-input-group__label--filled":m})},n," ",t&&a.createElement("span",null,"*")))},y=a.createContext(null),C=function(){return a.useContext(y)},_=["children","className","disabled","readOnly","variant","prepend","append","size","isFilled","label","required","labelTooltip","labelTooltipButtonAriaLabel","labelTooltipPlacement","feedback","labelId","labelProps","style","disableLabelAnimation","ariaAlertOnFeedback"],x=a.forwardRef((function(e,i){var o=e.children,d=e.className,c=e.disabled,m=void 0!==c&&c,b=e.readOnly,f=void 0!==b&&b,h=e.variant,g=e.prepend,y=e.append,x=e.size,k=void 0===x?"medium":x,N=e.isFilled,w=e.label,O=e.required,I=e.labelTooltip,F=e.labelTooltipButtonAriaLabel,L=void 0===F?"Klikk for tilleggsinfo om feltet":F,R=e.labelTooltipPlacement,A=void 0===R?"top":R,P=e.feedback,T=e.labelId,z=e.labelProps,S=e.style,V=e.disableLabelAnimation,q=void 0!==V&&V,B=e.ariaAlertOnFeedback,j=void 0!==B&&B,M=u(e,_),G=C(),H=h||G;return console.log("baseF",A),a.createElement(v,null,a.createElement("div",{className:l("eds-form-control__field-and-feedback-text",d,{"eds-form-control__field-and-feedback-text--has-tooltip":void 0!==I}),style:S},a.createElement("div",s({className:l("eds-form-control-wrapper","eds-form-control-wrapper--size-"+k,{"eds-form-control-wrapper--success":"success"===H,"eds-form-control-wrapper--negative":"negative"===H||"error"===H,"eds-form-control-wrapper--disabled":m,"eds-form-control-wrapper--readonly":f,"eds-form-control-wrapper--is-filled":N}),ref:i},M),g&&a.createElement("div",{className:"eds-form-control__prepend"},g),a.createElement(E,s({label:w,required:O,labelId:T,staticAnimation:q},z)),I&&a.createElement(t.Tooltip,{content:I,placement:A,showCloseButton:!1,disableFocusListener:!0,disableHoverListener:!0,disableClickListner:!1,disableKeyboardListener:!1},a.createElement(r.IconButton,{as:"span",tabIndex:0,role:"button",className:"eds-form-control__append eds-form-control__append--tooltip","aria-label":L},a.createElement(n.QuestionIcon,{className:"eds-input-group__label-tooltip-icon","aria-hidden":"true"}))),o,y&&a.createElement("div",{className:"eds-form-control__append"},y)),P&&H&&a.createElement(p,{variant:H,role:j?"alert":void 0},P)))})),k=["checked","className","children","style","disabled","reduceClickArea"],N=a.forwardRef((function(n,t){var r=n.checked,o=n.className,d=n.children,c=n.style,m=n.disabled,b=void 0!==m&&m,p=n.reduceClickArea,f=u(n,k),v=a.useRef(null),h="indeterminate"===r,g=void 0!==r;return a.useEffect((function(){v&&v.current&&(v.current.indeterminate=h)}),[h]),a.createElement("label",{className:l("eds-checkbox__container",o,{"eds-checkbox--disabled":b,"eds-checkbox__container--reduced-click-area":p}),style:c},a.createElement("input",s({type:"checkbox",ref:e.mergeRefs(t,v),checked:g?!0===r:void 0,disabled:b},f)),a.createElement("span",{className:l("eds-checkbox__icon",{"eds-checkbox__icon--disabled":b,"eds-checkbox__icon--reduced-click-area":p})},a.createElement(w,{indeterminate:h})),d&&a.createElement(i.Paragraph,{className:"eds-checkbox__label",margin:"none",as:"span"},d))})),w=function(e){var l=e.indeterminate;return a.createElement("svg",{className:"eds-checkbox-icon",width:"11px",height:"9px",viewBox:"6 11 37 33","aria-hidden":!0},void 0!==l&&l?a.createElement("rect",{x:"10",y:"25",width:"28",height:"5",fill:"white"}):a.createElement("path",{d:"M14.1 27.2l7.1 7.2 14.6-14.8",fill:"none"}))},O=["children","className","label"],I=function(e){var n=e.children,t=e.className,r=e.label,o=u(e,O);return a.createElement("fieldset",s({className:l("eds-fieldset",t)},o),r&&a.createElement(i.Heading5,{as:"legend"},r),n)},F=a.createContext(null),L=F.Provider,R=function(){var e=a.useContext(F);if(!e)throw new Error("You need to wrap your RadioButtons in a RadioGroup component");return e},A=["className","children","value","disabled"],P=a.forwardRef((function(e,n){var t,r,o,d=e.className,c=e.children,m=e.value,b=e.disabled,p=u(e,A),f=l(d,"eds-form-component--radio__radio",{"eds-form-component--radio__radio--disabled":b}),v=R();return a.createElement("label",{className:"eds-form-component--radio__container"},a.createElement("input",s({type:"radio",name:null!=(t=p.name)?t:v.name,ref:n,value:m,checked:null!=(r=p.checked)?r:v.value===m,onChange:null!=(o=p.onChange)?o:v.onChange,disabled:b},p)),a.createElement("span",{className:f},a.createElement("span",{className:"eds-form-component--radio__circle"})),c&&a.createElement(i.Paragraph,{margin:"none",as:"span",className:"eds-form-component--radio__label"},c))})),T=["className","children","value","title","secondaryLabel","size","hideSelectionIndicator","style","id","disabled","type","onChange","checked","name"],z=a.forwardRef((function(n,t){var r,i,o,d,c=n.className,m=n.children,b=n.value,p=n.title,f=n.secondaryLabel,v=n.size,h=void 0===v?"medium":v,g=n.hideSelectionIndicator,E=void 0!==g&&g,y=n.style,C=n.id,_=n.disabled,x=void 0!==_&&_,k=n.type,w=void 0===k?"radio":k,O=n.onChange,I=n.checked,F=n.name,L=u(n,T),R=l(c,"eds-input-panel__container","eds-input-panel--"+h),A=a.useRef(null),z=e.useRandomId("eds-inputpanel"),S=C||z,V=e.useForceUpdate();return a.createElement("label",{className:"eds-input-panel",htmlFor:S},a.createElement("input",s({type:w,name:F,ref:e.mergeRefs(t,A),value:b,checked:I,onChange:function(e){void 0===O&&V(),null==O||O(e)},id:S,disabled:x},L)),a.createElement("div",{className:R,style:y},a.createElement("div",{className:"eds-input-panel__title-wrapper"},a.createElement("div",{className:"eds-input-panel__title"},p),a.createElement("div",{className:"eds-input-panel__secondary-label-and-icon-wrapper"},void 0!==f&&a.createElement(a.Fragment,null,f),a.createElement("span",{style:{pointerEvents:"none"}},!(x||E)&&("radio"===w?a.createElement(P,{name:"",value:"",checked:null!=(r=null!=I?I:null==(i=A.current)?void 0:i.checked)&&r,onChange:function(){},"aria-hidden":"true",tabIndex:-1}):a.createElement(N,{checked:null!=(o=null!=I?I:null==(d=A.current)?void 0:d.checked)&&o,onChange:function(){return null},"aria-hidden":"true",tabIndex:-1}))))),m&&a.createElement("div",{className:"eds-input-panel__additional-content"},m)))})),S=["className","children","value","title","secondaryLabel","size","hideRadioButton","style","id","disabled"],V=a.forwardRef((function(e,l){var n=e.className,t=e.children,r=e.value,i=e.title,o=e.secondaryLabel,d=e.size,c=void 0===d?"medium":d,m=e.hideRadioButton,b=void 0!==m&&m,p=e.style,f=e.id,v=e.disabled,h=void 0!==v&&v,g=u(e,S),E=R();return a.createElement(z,s({type:"radio",name:E.name,title:i,value:r,checked:E.value===r,onChange:E.onChange,className:n,secondaryLabel:o,size:c,hideSelectionIndicator:b,style:p,id:f,disabled:h},g,{ref:l}),t)})),q=["name","checked","onChange","className","children","value","title","secondaryLabel","size","hideCheckbox","style","id","disabled"],B=a.forwardRef((function(e,l){var n=e.name,t=e.checked,r=e.onChange,i=e.className,o=e.children,d=e.value,c=e.title,m=e.secondaryLabel,b=e.size,p=void 0===b?"medium":b,f=e.hideCheckbox,v=void 0!==f&&f,h=e.style,g=e.id,E=e.disabled,y=void 0!==E&&E,C=u(e,q);return a.createElement(z,s({type:"checkbox",name:n,title:c,value:d,checked:t,onChange:r,className:i,secondaryLabel:m,size:p,hideSelectionIndicator:v,style:h,id:g,disabled:y},C,{ref:l}),o)})),j=["name","value","children","onChange","label"],M=["className","children","labelPlacement","icon","hideIcon","color","contrastColor","size","checked"],G=a.forwardRef((function(e,t){var r=e.className,i=e.children,d=e.labelPlacement,c=void 0===d?"right":d,m=e.icon,b=e.hideIcon,p=void 0!==b&&b,f=e.color,v=void 0===f?o.colors.validation.mint:f,h=e.contrastColor,g=void 0===h?o.colors.validation.mintContrast:h,E=e.size,y=void 0===E?"medium":E,C=e.checked,_=u(e,M);return a.createElement("label",{className:l("eds-switch","eds-switch--"+c,r),style:s({},_.style)},a.createElement("input",s({type:"checkbox",ref:t,checked:C},_)),a.createElement("span",{className:l("eds-switch__switch","eds-switch__switch--"+y),style:{"--eds-switch-color":v,"--eds-switch-contrast-color":g},"aria-hidden":"true"},a.createElement("span",{className:"eds-switch__circle"},!p&&(m||(void 0===C?a.createElement(a.Fragment,null):a.createElement(C?n.CheckIcon:n.CloseSmallIcon,{size:"large"===y?23:void 0}))))),i&&a.createElement("span",{className:l("eds-switch__label","eds-switch__label--"+y+"--"+c)},i))}));function H(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function K(e,a){return void 0===a&&(a=!1),e&&(H(e.value)&&""!==e.value||a&&H(e.defaultValue)&&""!==e.defaultValue)}var Y=["variant","disabled","readOnly","className","style","label","feedback","labelTooltip","labelTooltipButtonAriaLabel","labelTooltipPlacement","onChange","disableLabelAnimation"],D=["readOnly","disabled","onChange","value","variant"],Q=a.forwardRef((function(n,t){var r=n.variant,i=n.disabled,o=void 0!==i&&i,d=n.readOnly,c=void 0!==d&&d,m=n.className,b=n.style,p=n.label,f=n.feedback,v=n.labelTooltip,h=n.labelTooltipButtonAriaLabel,g=n.labelTooltipPlacement,E=n.onChange,y=n.disableLabelAnimation,C=u(n,Y),_=e.useRandomId("eds-textarea"),k=a.useRef(null);return a.createElement(x,{className:l(m,"eds-textarea__wrapper"),disabled:o,readOnly:c,variant:r,style:b,label:p,labelId:_,feedback:f,labelTooltip:v,labelTooltipButtonAriaLabel:h,labelTooltipPlacement:g,labelProps:{className:"eds-textarea__label"},disableLabelAnimation:y,onClick:function(e){var a;e.target===e.currentTarget&&(null==k||null==(a=k.current)||a.focus())}},a.createElement(U,s({readOnly:c,disabled:o,ref:e.mergeRefs(t,k),"aria-labelledby":_,onChange:E,variant:r},C)))})),U=a.forwardRef((function(l,n){var t=l.readOnly,r=l.disabled,i=l.onChange,o=l.value,d=l.variant,c=u(l,D),m=C(),b=d||m,p=h(),f=p.isFilled,v=p.setFilled;return e.useOnMount((function(){(null!=o&&o.toString()||c.defaultValue)&&v&&!f&&v(!0)})),a.useEffect((function(){null!=o&&o.toString()&&v&&!f&&v(!0)}),[o,v,f]),a.createElement("textarea",s({className:"eds-form-control eds-textarea",ref:n,readOnly:t,disabled:r,onChange:function(e){K(e.target)?v&&!f&&v(!0):v&&f&&v(!1),i&&i(e)},value:o,"aria-invalid":"error"===b},c))})),J=["prepend","append","variant","disabled","readOnly","className","style","size","label","required","labelTooltip","labelTooltipButtonAriaLabel","labelTooltipPlacement","feedback","onChange","disableLabelAnimation","labelProps","clearable","onClear","value","ariaAlertOnFeedback"],W=["disabled","readOnly","placeholder","onChange","value","variant"],X=["onClear"],Z=a.forwardRef((function(n,t){var r=n.prepend,i=n.append,o=n.variant,d=n.disabled,c=void 0!==d&&d,m=n.readOnly,b=void 0!==m&&m,p=n.className,f=n.style,v=n.size,h=void 0===v?"medium":v,g=n.label,E=n.required,y=n.labelTooltip,C=n.labelTooltipButtonAriaLabel,_=n.labelTooltipPlacement,k=n.feedback,N=n.onChange,w=n.disableLabelAnimation,O=n.labelProps,I=n.clearable,F=void 0!==I&&I,L=n.onClear,R=n.value,A=n.ariaAlertOnFeedback,P=void 0!==A&&A,T=u(n,J),z=e.useRandomId("eds-textfield"),S=O&&O.id?O.id:z,V=a.useRef(null);return a.createElement(x,{disabled:c,readOnly:b,variant:o,prepend:r,append:F&&L?a.createElement(ee,{onClear:L}):i,className:l(p,"eds-textfield__wrapper"),style:f,size:h,label:g,required:E,labelTooltip:y,labelTooltipButtonAriaLabel:C,labelTooltipPlacement:_,labelId:S,feedback:k,disableLabelAnimation:w,labelProps:O,ariaAlertOnFeedback:P,onClick:function(e){var a;e.target===e.currentTarget&&(null==V||null==(a=V.current)||a.focus())}},a.createElement($,s({disabled:c,readOnly:b,ref:e.mergeRefs(t,V),"aria-labelledby":S,onChange:N,value:R,variant:o},T)))})),$=a.forwardRef((function(l,n){var t=l.disabled,r=l.readOnly,i=l.placeholder,o=l.onChange,d=l.value,c=l.variant,m=u(l,W),b=C(),p=c||b,f=h(),v=f.isFilled,g=f.setFilled;return e.useOnMount((function(){(null!=d&&d.toString()||m.defaultValue)&&g&&!v&&g(!0)})),a.useEffect((function(){null!=d&&d.toString()&&g&&!v&&g(!0)}),[d,g,v]),a.createElement("input",s({"aria-invalid":"error"===p,className:"eds-form-control",disabled:t,readOnly:r,ref:n,placeholder:i,onChange:function(e){K(e.target)?g&&!v&&g(!0):g&&v&&g(!1),o&&o(e)},value:d},m))})),ee=function(e){var l=e.onClear,t=u(e,X),r=h(),i=r.isFilled,o=r.setFilled;return a.createElement("div",{className:"eds-textfield__clear-button-wrapper"},i&&a.createElement("div",{className:"eds-textfield__divider"}),i&&a.createElement("button",s({className:"eds-textfield__clear-button",type:"button",tabIndex:-1,onClick:function(){o(!1),l()}},t),a.createElement(n.CloseSmallIcon,null)))},ae=["name","onChange","selectedValue","multiple","size"],le=a.createContext(null),ne=function(l){var n=l.name,t=l.onChange,r=void 0===t?function(){}:t,i=l.selectedValue,o=l.multiple,d=l.size,c=u(l,ae),m=e.useRandomId("eds-segmented-control"),b=a.useMemo((function(){return{name:n||m,onChange:r,multiple:o,selectedValue:i,size:d}}),[m,o,n,r,i,d]);return a.createElement(le.Provider,s({value:b},c))},te=["children","className","style","value","name","onChange"],re=a.forwardRef((function(e,n){var t=e.children,r=e.className,i=e.style,o=e.value,d=e.name,c=e.onChange,m=void 0===c?function(){}:c,b=u(e,te),p=function(){var e=a.useContext(le);if(!e)throw new Error("You need to wrap your SegmentedChoice in either SegmentedControl or MultipleSegmentedControl");return e}(),f=p.name,v=p.selectedValue,h=p.onChange,g=p.multiple,E=p.size,y=g?v[o]:v===o;return a.createElement("label",{className:l("eds-segmented-choice",r),style:i},a.createElement("input",s({type:g?"checkbox":"radio",name:d||f,checked:y,value:o,onChange:function(e){var a;m(e),g?h(s({},v,((a={})[o]=e.target.checked,a))):e.target.checked&&h(o)},ref:n},b)),a.createElement("div",{className:l("eds-base-segmented",{"eds-base-segmented--large":"large"===E})},t))})),ie=["children","label","name","onChange","selectedValue","size","className"],oe=["children","label","name","onChange","selectedValue"];e.warnAboutMissingStyles("form","icons","typography"),exports.BaseFormControl=x,exports.Checkbox=N,exports.CheckboxPanel=B,exports.FeedbackText=p,exports.Fieldset=I,exports.InputGroupContextProvider=v,exports.InputGroupLabel=E,exports.MultipleSegmentedControl=function(e){var l=e.children,n=e.label,t=e.name,r=e.onChange,o=e.selectedValue,d=u(e,oe);return a.createElement(ne,{name:t,selectedValue:o,onChange:r,multiple:!0,size:"medium"},a.createElement(i.Label,{as:"div"},n),a.createElement("div",s({className:"eds-segmented-control"},d),l))},exports.Radio=P,exports.RadioGroup=function(e){var l=e.name,n=e.value,t=e.children,r=e.onChange,i=e.label,o=u(e,j),d=a.useMemo((function(){return{name:l,value:n,onChange:r}}),[l,n,r]);return a.createElement(L,{value:d},i?a.createElement(I,s({label:i},o),t):t)},exports.RadioPanel=V,exports.SegmentedChoice=re,exports.SegmentedControl=function(e){var n=e.children,t=e.label,r=e.name,i=e.onChange,o=e.selectedValue,d=e.size,c=void 0===d?"medium":d,m=e.className,b=u(e,ie);return a.createElement(ne,{name:r,selectedValue:o,onChange:i,multiple:!1,size:c},a.createElement(I,{label:t},a.createElement("div",s({className:l("eds-segmented-control",m)},b),n)))},exports.Switch=G,exports.TextArea=Q,exports.TextField=Z,exports.VariantProvider=function(e){var l=e.variant;return a.createElement(y.Provider,{value:void 0===l?null:l},e.children)},exports.hasValue=H,exports.isFilled=K,exports.useInputGroupContext=h,exports.useVariant=C; | ||
//# sourceMappingURL=form.cjs.production.min.js.map |
@@ -152,3 +152,3 @@ import { mergeRefs, useRandomId, useForceUpdate, useOnMount, warnAboutMissingStyles } from '@entur/utils'; | ||
var _excluded$e = ["children", "className", "disabled", "readOnly", "variant", "prepend", "append", "size", "isFilled", "label", "required", "labelTooltip", "labelTooltipButtonAriaLabel", "feedback", "labelId", "labelProps", "style", "disableLabelAnimation", "ariaAlertOnFeedback"]; | ||
var _excluded$e = ["children", "className", "disabled", "readOnly", "variant", "prepend", "append", "size", "isFilled", "label", "required", "labelTooltip", "labelTooltipButtonAriaLabel", "labelTooltipPlacement", "feedback", "labelId", "labelProps", "style", "disableLabelAnimation", "ariaAlertOnFeedback"]; | ||
/** @deprecated use variant="negative" instead */ | ||
@@ -174,2 +174,4 @@ var error = 'error'; | ||
labelTooltipButtonAriaLabel = _ref$labelTooltipButt === void 0 ? 'Klikk for tilleggsinfo om feltet' : _ref$labelTooltipButt, | ||
_ref$labelTooltipPlac = _ref.labelTooltipPlacement, | ||
labelTooltipPlacement = _ref$labelTooltipPlac === void 0 ? 'top' : _ref$labelTooltipPlac, | ||
feedback = _ref.feedback, | ||
@@ -186,2 +188,3 @@ labelId = _ref.labelId, | ||
var currentVariant = variant || contextVariant; | ||
console.log('baseF', labelTooltipPlacement); | ||
return React__default.createElement(InputGroupContextProvider, null, React__default.createElement("div", { | ||
@@ -210,3 +213,3 @@ className: classNames('eds-form-control__field-and-feedback-text', className, { | ||
content: labelTooltip, | ||
placement: "right", | ||
placement: labelTooltipPlacement, | ||
showCloseButton: false, | ||
@@ -599,3 +602,3 @@ disableFocusListener: true, | ||
var _excluded$5 = ["variant", "disabled", "readOnly", "className", "style", "label", "feedback", "labelTooltip", "onChange", "disableLabelAnimation"], | ||
var _excluded$5 = ["variant", "disabled", "readOnly", "className", "style", "label", "feedback", "labelTooltip", "labelTooltipButtonAriaLabel", "labelTooltipPlacement", "onChange", "disableLabelAnimation"], | ||
_excluded2$1 = ["readOnly", "disabled", "onChange", "value", "variant"]; | ||
@@ -613,2 +616,4 @@ var TextArea = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) { | ||
labelTooltip = _ref.labelTooltip, | ||
labelTooltipButtonAriaLabel = _ref.labelTooltipButtonAriaLabel, | ||
labelTooltipPlacement = _ref.labelTooltipPlacement, | ||
onChange = _ref.onChange, | ||
@@ -629,2 +634,4 @@ disableLabelAnimation = _ref.disableLabelAnimation, | ||
labelTooltip: labelTooltip, | ||
labelTooltipButtonAriaLabel: labelTooltipButtonAriaLabel, | ||
labelTooltipPlacement: labelTooltipPlacement, | ||
labelProps: { | ||
@@ -690,3 +697,3 @@ className: 'eds-textarea__label' | ||
var _excluded$4 = ["prepend", "append", "variant", "disabled", "readOnly", "className", "style", "size", "label", "required", "labelTooltip", "feedback", "onChange", "disableLabelAnimation", "labelProps", "clearable", "onClear", "value", "ariaAlertOnFeedback"], | ||
var _excluded$4 = ["prepend", "append", "variant", "disabled", "readOnly", "className", "style", "size", "label", "required", "labelTooltip", "labelTooltipButtonAriaLabel", "labelTooltipPlacement", "feedback", "onChange", "disableLabelAnimation", "labelProps", "clearable", "onClear", "value", "ariaAlertOnFeedback"], | ||
_excluded2 = ["disabled", "readOnly", "placeholder", "onChange", "value", "variant"], | ||
@@ -709,2 +716,4 @@ _excluded3 = ["onClear"]; | ||
labelTooltip = _ref.labelTooltip, | ||
labelTooltipButtonAriaLabel = _ref.labelTooltipButtonAriaLabel, | ||
labelTooltipPlacement = _ref.labelTooltipPlacement, | ||
feedback = _ref.feedback, | ||
@@ -738,2 +747,4 @@ onChange = _ref.onChange, | ||
labelTooltip: labelTooltip, | ||
labelTooltipButtonAriaLabel: labelTooltipButtonAriaLabel, | ||
labelTooltipPlacement: labelTooltipPlacement, | ||
labelId: textFieldId, | ||
@@ -740,0 +751,0 @@ feedback: feedback, |
import React from 'react'; | ||
import { VariantType } from '@entur/utils'; | ||
import './TextArea.scss'; | ||
import { Placement } from '@entur/tooltip'; | ||
/** @deprecated use variant="information" instead */ | ||
@@ -21,2 +22,6 @@ declare const info = "info"; | ||
labelTooltip?: React.ReactNode; | ||
/** Forklarende tekst for knappen som åpner labelTooltip */ | ||
labelTooltipButtonAriaLabel?: string; | ||
/** Plasseringen til tooltip-en relativt til spørsmålstegn-knappen */ | ||
labelTooltipPlacement?: Placement; | ||
/** Varselmelding, som vil komme under TextArea */ | ||
@@ -42,2 +47,6 @@ feedback?: string; | ||
labelTooltip?: React.ReactNode; | ||
/** Forklarende tekst for knappen som åpner labelTooltip */ | ||
labelTooltipButtonAriaLabel?: string | undefined; | ||
/** Plasseringen til tooltip-en relativt til spørsmålstegn-knappen */ | ||
labelTooltipPlacement?: Placement | undefined; | ||
/** Varselmelding, som vil komme under TextArea */ | ||
@@ -44,0 +53,0 @@ feedback?: string | undefined; |
import React from 'react'; | ||
import { VariantType } from '@entur/utils'; | ||
import './TextField.scss'; | ||
import { Placement } from '@entur/tooltip'; | ||
/** @deprecated use variant="information" instead */ | ||
@@ -19,2 +20,6 @@ declare const info = "info"; | ||
labelTooltip?: React.ReactNode; | ||
/** Forklarende tekst for knappen som åpner labelTooltip */ | ||
labelTooltipButtonAriaLabel?: string; | ||
/** Plasseringen til tooltip-en relativt til spørsmålstegn-knappen */ | ||
labelTooltipPlacement?: Placement; | ||
/** Varselmelding, som vil komme under TextField */ | ||
@@ -57,2 +62,6 @@ feedback?: string; | ||
labelTooltip?: React.ReactNode; | ||
/** Forklarende tekst for knappen som åpner labelTooltip */ | ||
labelTooltipButtonAriaLabel?: string | undefined; | ||
/** Plasseringen til tooltip-en relativt til spørsmålstegn-knappen */ | ||
labelTooltipPlacement?: Placement | undefined; | ||
/** Varselmelding, som vil komme under TextField */ | ||
@@ -59,0 +68,0 @@ feedback?: string | undefined; |
{ | ||
"name": "@entur/form", | ||
"version": "8.0.2", | ||
"version": "8.1.0-beta.0", | ||
"license": "EUPL-1.2", | ||
@@ -32,3 +32,3 @@ "main": "dist/index.js", | ||
"@entur/tokens": "^3.17.0", | ||
"@entur/tooltip": "^3.0.2", | ||
"@entur/tooltip": "^4.0.0-beta.0", | ||
"@entur/typography": "^1.8.43", | ||
@@ -38,3 +38,3 @@ "@entur/utils": "^0.11.1", | ||
}, | ||
"gitHead": "20838cf27b3f76a9ce3259fe808d60132ab0a653" | ||
"gitHead": "cf307ea5b19e314649370964a7368666df04305b" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
435615
4186
3
+ Added@entur/tooltip@4.0.1(transitive)
+ Added@floating-ui/core@1.6.8(transitive)
+ Added@floating-ui/dom@1.6.12(transitive)
+ Added@floating-ui/react-dom@2.1.2(transitive)
+ Added@floating-ui/utils@0.2.8(transitive)
- Removed@entur/tooltip@3.0.2(transitive)
- Removed@popperjs/core@2.11.8(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedreact@17.0.2(transitive)
- Removedreact-fast-compare@3.2.2(transitive)
- Removedreact-popper@2.2.5(transitive)
- Removedwarning@4.0.3(transitive)
Updated@entur/tooltip@^4.0.0-beta.0