@department-of-veterans-affairs/component-library 46.0.2 → 46.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1187,6 +1187,10 @@ export namespace Components {
1187
1187
  * Insert a header with defined level inside the label (legend)
1188
1188
  */
1189
1189
  "labelHeaderLevel"?: string;
1190
+ /**
1191
+ * An optional message that will be read by screen readers when a radio option is focused.
1192
+ */
1193
+ "messageAriaDescribedby"?: string;
1190
1194
  /**
1191
1195
  * Whether or not this input field is required.
1192
1196
  */
@@ -3871,6 +3875,10 @@ declare namespace LocalJSX {
3871
3875
  * Insert a header with defined level inside the label (legend)
3872
3876
  */
3873
3877
  "labelHeaderLevel"?: string;
3878
+ /**
3879
+ * An optional message that will be read by screen readers when a radio option is focused.
3880
+ */
3881
+ "messageAriaDescribedby"?: string;
3874
3882
  /**
3875
3883
  * The event used to track usage of the component. This is emitted when a radio option is selected and enableAnalytics is true.
3876
3884
  */
@@ -1 +1 @@
1
- import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$1}from"./va-icon2.js";const vaLinkCss="p,a,ol,ul,li,dl,dt,dd,form,label,button{font-family:Source Sans Pro Web, \"Source Sans Pro\", \"Helvetica Neue\", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.5}button:not([disabled]):focus,:host([uswds='false']) button:not([disabled]):active,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role='option']:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}a{text-decoration:none;color:var(--vads-color-link);-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:color, background-color, border-color;transition-property:color, background-color, border-color}a:hover{background-color:rgba(0, 0, 0, 0.05);color:inherit}a:visited{color:var(--vads-color-link-visited)}.usa-sr-only{position:absolute;left:-999em;right:auto}:host{display:inline}:host a{cursor:pointer;text-decoration:underline}:host a.va-link--reverse,:host a.va-link--reverse .link-icon--back{color:var(--vads-color-white)}:host a.va-link--reverse:hover,:host a.va-link--reverse:active,:host a.va-link--reverse:hover .link-icon--back,:host a.va-link--reverse:active .link-icon--back,:host a.va-link--reverse .link-icon--back:hover,:host a.va-link--reverse .link-icon--back:active,:host a.va-link--reverse .link-icon--back:hover .link-icon--back,:host a.va-link--reverse .link-icon--back:active .link-icon--back{color:var(--vads-color-action-focus-on-light);background-color:transparent}:host([active]:not([active=false])) a{font-weight:700}:host([icon-name]) va-icon{margin-right:4px}.link-icon--active{vertical-align:baseline;position:relative;top:3px}.link-icon--left{margin-right:4px;vertical-align:baseline;position:relative;top:3px}.link-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.link-icon--back{color:var(--vads-color-gray-medium);-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:color, background-color, border-color;transition-property:color, background-color, border-color}.link--center{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}dfn{font-style:normal}abbr{text-decoration:none}.external-link-icon{margin-left:4px}",VaLink=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleClick=e=>{if(!this.disableAnalytics){const e={componentName:"va-link",action:"click",details:{label:this.text,destination:this.href,origin:window.location.href}};this.componentLibraryAnalytics.emit(e)}},this.getAbbreviationTitle=()=>{const{abbrTitle:e,filetype:i}=this;return"PDF"===i?"Portable Document Format":e},this.abbrTitle=void 0,this.active=!1,this.back=!1,this.calendar=!1,this.channel=!1,this.disableAnalytics=!1,this.download=!1,this.href=void 0,this.filename=void 0,this.filetype=void 0,this.pages=void 0,this.text=void 0,this.video=!1,this.reverse=!1,this.external=!1,this.label=null,this.iconName=null,this.iconSize=3}render(){const{active:e,back:i,calendar:n,channel:o,download:t,filetype:a,filename:l,getAbbreviationTitle:s,handleClick:r,href:c,pages:d,text:v,video:b,reverse:k,external:u,iconName:f,iconSize:m}=this,p=classnames({"va-link--reverse":k,"link--center":f||u});if(e)return h(Host,null,h("a",{href:c,class:p,onClick:r,"aria-label":this.label},v,h("va-icon",{class:"link-icon--active",icon:"chevron_right"})));if(i){const e=h("va-icon",{icon:"arrow_back",class:"link-icon--left link-icon--back"});return h(Host,null,h("div",{class:"link-container"},e,h("a",{href:c,class:p,onClick:r,"aria-label":this.label},v)))}return h(Host,null,o||b?h("a",{href:c,class:p,onClick:r,rel:"noopener",target:"_blank"},h("va-icon",{class:"link-icon--left",icon:o?"youtube":"play_circle"}),v," ",h("dfn",null,o?"YouTube":"on YouTube")):n?h("a",{href:c,class:p,download:l,onClick:r},h("va-icon",{class:"link-icon--left",icon:"calendar_today"}),v):t?h("a",{href:c,class:p,download:l,onClick:r},h("va-icon",{class:"link-icon--left",icon:"file_download"}),v," ",a&&h("dfn",null,"(",h("abbr",{title:s()},a),d&&`, ${d} pages`,")")):f?h("a",{href:c,class:p,onClick:r},h("va-icon",{icon:f,size:m,part:"icon"}),v):u?h("a",{href:c,rel:"noreferrer",class:p,onClick:r,target:"_blank"},v,h("va-icon",{class:"external-link-icon",icon:"launch"}),h("span",{class:"usa-sr-only"},"opens in a new tab")):h("a",{href:c,class:p,onClick:r,"aria-label":this.label},v))}static get style(){return vaLinkCss}},[1,"va-link",{abbrTitle:[1,"abbr-title"],active:[516],back:[4],calendar:[4],channel:[4],disableAnalytics:[4,"disable-analytics"],download:[4],href:[1],filename:[1],filetype:[1],pages:[2],text:[1],video:[4],reverse:[4],external:[4],label:[1],iconName:[1,"icon-name"],iconSize:[2,"icon-size"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-link","va-icon"].forEach((e=>{switch(e){case"va-link":customElements.get(e)||customElements.define(e,VaLink);break;case"va-icon":customElements.get(e)||defineCustomElement$1()}}))}export{VaLink as V,defineCustomElement as d};
1
+ import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$1}from"./va-icon2.js";const vaLinkCss="p,a,ol,ul,li,dl,dt,dd,form,label,button{font-family:Source Sans Pro Web, \"Source Sans Pro\", \"Helvetica Neue\", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.5}button:not([disabled]):focus,:host([uswds='false']) button:not([disabled]):active,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role='option']:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}a{text-decoration:none;color:var(--vads-color-link);-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:color, background-color, border-color;transition-property:color, background-color, border-color}a:hover{background-color:rgba(0, 0, 0, 0.05);color:inherit}a:visited{color:var(--vads-color-link-visited)}.usa-sr-only{position:absolute;left:-999em;right:auto}:host{display:inline}:host a{cursor:pointer;text-decoration:underline;font:inherit}:host a.va-link--reverse,:host a.va-link--reverse .link-icon--back{color:var(--vads-color-white)}:host a.va-link--reverse:hover,:host a.va-link--reverse:active,:host a.va-link--reverse:hover .link-icon--back,:host a.va-link--reverse:active .link-icon--back,:host a.va-link--reverse .link-icon--back:hover,:host a.va-link--reverse .link-icon--back:active,:host a.va-link--reverse .link-icon--back:hover .link-icon--back,:host a.va-link--reverse .link-icon--back:active .link-icon--back{color:var(--vads-color-action-focus-on-light);background-color:transparent}:host([active]:not([active=false])) a{font-weight:700}:host([icon-name]) va-icon{margin-right:4px}.link-icon--active{vertical-align:baseline;position:relative;top:3px}.link-icon--left{margin-right:4px;vertical-align:baseline;position:relative;top:3px}.link-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.link-icon--back{color:var(--vads-color-gray-medium);-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:color, background-color, border-color;transition-property:color, background-color, border-color}.link--center{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}dfn{font-style:normal}abbr{text-decoration:none}.external-link-icon{margin-left:4px}",VaLink=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleClick=i=>{if(!this.disableAnalytics){const i={componentName:"va-link",action:"click",details:{label:this.text,destination:this.href,origin:window.location.href}};this.componentLibraryAnalytics.emit(i)}},this.getAbbreviationTitle=()=>{const{abbrTitle:i,filetype:e}=this;return"PDF"===e?"Portable Document Format":i},this.abbrTitle=void 0,this.active=!1,this.back=!1,this.calendar=!1,this.channel=!1,this.disableAnalytics=!1,this.download=!1,this.href=void 0,this.filename=void 0,this.filetype=void 0,this.pages=void 0,this.text=void 0,this.video=!1,this.reverse=!1,this.external=!1,this.label=null,this.iconName=null,this.iconSize=3}render(){const{active:i,back:e,calendar:n,channel:o,download:t,filetype:a,filename:l,getAbbreviationTitle:s,handleClick:r,href:c,pages:d,text:v,video:b,reverse:k,external:u,iconName:f,iconSize:m}=this,p=classnames({"va-link--reverse":k,"link--center":f||u});if(i)return h(Host,null,h("a",{href:c,class:p,onClick:r,"aria-label":this.label},v,h("va-icon",{class:"link-icon--active",icon:"chevron_right"})));if(e){const i=h("va-icon",{icon:"arrow_back",class:"link-icon--left link-icon--back"});return h(Host,null,h("div",{class:"link-container"},i,h("a",{href:c,class:p,onClick:r,"aria-label":this.label},v)))}return h(Host,null,o||b?h("a",{href:c,class:p,onClick:r,rel:"noopener",target:"_blank"},h("va-icon",{class:"link-icon--left",icon:o?"youtube":"play_circle"}),v," ",h("dfn",null,o?"YouTube":"on YouTube")):n?h("a",{href:c,class:p,download:l,onClick:r},h("va-icon",{class:"link-icon--left",icon:"calendar_today"}),v):t?h("a",{href:c,class:p,download:l,onClick:r},h("va-icon",{class:"link-icon--left",icon:"file_download"}),v," ",a&&h("dfn",null,"(",h("abbr",{title:s()},a),d&&`, ${d} pages`,")")):f?h("a",{href:c,class:p,onClick:r},h("va-icon",{icon:f,size:m,part:"icon"}),v):u?h("a",{href:c,rel:"noreferrer",class:p,onClick:r,target:"_blank"},v,h("va-icon",{class:"external-link-icon",icon:"launch"}),h("span",{class:"usa-sr-only"},"opens in a new tab")):h("a",{href:c,class:p,onClick:r,"aria-label":this.label},v))}static get style(){return vaLinkCss}},[1,"va-link",{abbrTitle:[1,"abbr-title"],active:[516],back:[4],calendar:[4],channel:[4],disableAnalytics:[4,"disable-analytics"],download:[4],href:[1],filename:[1],filetype:[1],pages:[2],text:[1],video:[4],reverse:[4],external:[4],label:[1],iconName:[1,"icon-name"],iconSize:[2,"icon-size"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-link","va-icon"].forEach((i=>{switch(i){case"va-link":customElements.get(i)||customElements.define(i,VaLink);break;case"va-icon":customElements.get(i)||defineCustomElement$1()}}))}export{VaLink as V,defineCustomElement as d};
@@ -1 +1 @@
1
- import{Build,proxyCustomElement,HTMLElement,createEvent,forceUpdate,h,Fragment,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{g as getSlottedNodes,a as getHeaderLevel}from"./utils.js";import"./i18n-setup.js";import"./contacts.js";import{i as instance}from"./i18next.js";const vaRadioCss='button:not([disabled]):focus,:host([uswds=\'false\']) button:not([disabled]):active,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}.sr-only{border:0;clip:rect(0, 0, 0, 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute !important;width:1px;word-wrap:normal !important}h1{margin-top:0}h1,h2,h3,h4,h5,h6{margin-bottom:0;margin-top:0;clear:both}*+h1,*+h2,*+h3,*+h4,*+h5,*+h6{margin-top:1.5em}h1+*,h2+*,h3+*,h4+*,h5+*,h6+*{margin-top:1em}h1{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:2.44rem;line-height:1.2;font-weight:700}h2{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.95rem;line-height:1.2;font-weight:700}h3{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.34rem;line-height:1.2;font-weight:700}h4{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.98rem;line-height:1.2;font-weight:700}h5{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.91rem;line-height:1.2;font-weight:700}h6{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:0.87rem;line-height:1.1;font-weight:normal;letter-spacing:0.025em;text-transform:uppercase}h1,h2,h3,h4,h5{font-family:Bitter, Georgia, Cambria, "Times New Roman", Times, serif;font-weight:700}h6{font-family:"Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:1.875rem}h3{font-size:1.25rem}h4{font-size:1.0625rem}h5{font-size:0.9375rem}h6{font-size:0.9375rem}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}.usa-hint,.usa-fieldset{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.usa-sr-only{position:absolute;left:-999em;right:auto}.usa-form{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}@media all and (min-width: 30em){.usa-form{max-width:20rem}}.usa-form abbr[title=required]{text-decoration:none}.usa-form .usa-input,.usa-form .usa-range,.usa-form .usa-select,.usa-form .usa-textarea{max-width:none}.usa-form .usa-input--2xs,.usa-form .usa-input-group--2xs{max-width:5ex}.usa-form .usa-input--xs,.usa-form .usa-input-group--xs{max-width:9ex}.usa-form .usa-input--sm,.usa-form .usa-input--small,.usa-form .usa-input-group--sm,.usa-form .usa-input-group--small{max-width:13ex}.usa-form .usa-input--md,.usa-form .usa-input--medium,.usa-form .usa-input-group--md,.usa-form .usa-input-group--medium{max-width:20ex}.usa-form .usa-input--lg,.usa-form .usa-input-group--lg{max-width:30ex}.usa-form .usa-input--xl,.usa-form .usa-input-group--xl{max-width:40ex}.usa-form .usa-input--2xl,.usa-form .usa-input-group--2xl{max-width:50ex}.usa-form .usa-button{margin-top:0.5rem}@media all and (min-width: 30em){.usa-form .usa-button{margin-top:1.5rem}}.usa-form a:where(:not(.usa-button)){color:#005ea2;text-decoration:underline}.usa-form a:where(:not(.usa-button)):visited{color:#54278f}.usa-form a:where(:not(.usa-button)):hover{color:#1a4480}.usa-form a:where(:not(.usa-button)):active{color:#162e51}.usa-form a:where(:not(.usa-button)):focus{outline:0.25rem solid #2491ff;outline-offset:0rem}@media all and (min-width: 30em){.usa-form--large{max-width:30rem}}.usa-show-password{color:#005ea2;text-decoration:underline;background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;font-weight:normal;-ms-flex-pack:normal;justify-content:normal;text-align:left;margin:0;padding:0;cursor:pointer}.usa-show-password:visited{color:#54278f}.usa-show-password:hover{color:#1a4480}.usa-show-password:active{color:#162e51}.usa-show-password:focus{outline:0.25rem solid #2491ff;outline-offset:0rem}.usa-show-password:hover,.usa-show-password.usa-button--hover,.usa-show-password:disabled:hover,.usa-show-password[aria-disabled=true]:hover,.usa-show-password:disabled.usa-button--hover,.usa-show-password[aria-disabled=true].usa-button--hover,.usa-show-password:active,.usa-show-password.usa-button--active,.usa-show-password:disabled:active,.usa-show-password[aria-disabled=true]:active,.usa-show-password:disabled.usa-button--active,.usa-show-password[aria-disabled=true].usa-button--active,.usa-show-password:disabled:focus,.usa-show-password[aria-disabled=true]:focus,.usa-show-password:disabled.usa-focus,.usa-show-password[aria-disabled=true].usa-focus,.usa-show-password:disabled,.usa-show-password[aria-disabled=true],.usa-show-password.usa-button--disabled{background-color:transparent;-webkit-box-shadow:none;box-shadow:none;text-decoration:underline}.usa-show-password.usa-button--hover{color:#1a4480}.usa-show-password.usa-button--active{color:#162e51}.usa-show-password:disabled,.usa-show-password[aria-disabled=true],.usa-show-password:disabled:hover,.usa-show-password[aria-disabled=true]:hover,.usa-show-password[aria-disabled=true]:focus{color:#757575}@media (forced-colors: active){.usa-show-password:disabled,.usa-show-password[aria-disabled=true],.usa-show-password:disabled:hover,.usa-show-password[aria-disabled=true]:hover,.usa-show-password[aria-disabled=true]:focus{color:GrayText}}.usa-form__note,.usa-show-password{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:0.93rem;line-height:1.3;float:right;margin:0.25rem 0 1rem}.usa-fieldset{border:none;margin:0;padding:0}.usa-legend{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-legend--large{font-size:2.13rem;font-weight:700;margin-top:1rem}.usa-label{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-label--error{font-weight:700;margin-top:0}.usa-label--required{color:#b50909}.usa-hint{color:#71767a}.usa-hint--required{color:#b50909}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""]):not([uswds=false])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""]):not([uswds=false])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""]):not([uswds=false])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""]):not([uswds=false])){margin-left:-0.9rem}:host([error]:not([error=""]):not([uswds=false])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""]):not([uswds=false])[use-forms-pattern=multiple]){padding-left:0}}:host{display:block;border:none;padding:0;margin-top:24px}';Build.isTesting&&instance.init({lng:"cimode"});const VaRadio$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.vaValueChange=createEvent(this,"vaValueChange",7),this.label=void 0,this.hint=void 0,this.required=!1,this.error=void 0,this.enableAnalytics=!1,this.labelHeaderLevel=void 0,this.headerAriaDescribedby=void 0,this.useFormsPattern=void 0,this.formHeadingLevel=3,this.formHeading=void 0}handleKeyDown(e){const a=e.target,s=getSlottedNodes(this.el,"va-radio-option").filter((e=>!e.disabled));if(!s.length)return;const t=s.findIndex((e=>e===a));if(-1===t)return;let o;switch(e.key){case" ":if(e.preventDefault(),a.checked)return;o=a,this.selectNextNode(a);break;case"ArrowDown":case"ArrowRight":e.preventDefault(),t===s.length-1?(o=s[0],this.deselectCurrentNode(a),this.selectNextNode(o)):(o=s[t+1],this.deselectCurrentNode(a),this.selectNextNode(o));break;case"ArrowUp":case"ArrowLeft":e.preventDefault(),0===t?(o=s[s.length-1],this.deselectCurrentNode(a),this.selectNextNode(o)):(o=s[t-1],this.deselectCurrentNode(a),this.selectNextNode(o))}o&&(this.enableAnalytics&&this.fireAnalyticsEvent(o.label),this.vaValueChange.emit({value:o.value}))}radioOptionSelectedHandler(e){const a=e.target;getSlottedNodes(this.el,"va-radio-option").filter((e=>e!==a)).forEach((e=>{this.deselectCurrentNode(e)})),this.selectNextNode(a),this.enableAnalytics&&this.fireAnalyticsEvent(a.label),this.vaValueChange.emit({value:a.value})}fireAnalyticsEvent(e){this.componentLibraryAnalytics.emit({componentName:"va-radio",action:"change",details:{label:this.label,optionLabel:e,required:this.required}})}deselectCurrentNode(e){e.removeAttribute("checked")}selectNextNode(e){e.setAttribute("checked",""),e.focus()}getHeaderLevel(){const e=parseInt(this.labelHeaderLevel,10);return e>=1&&e<=6?`h${e}`:null}connectedCallback(){instance.on("languageChanged",(()=>{forceUpdate(this.el)}))}disconnectedCallback(){instance.off("languageChanged")}render(){const{label:e,hint:a,required:s,error:t,headerAriaDescribedby:o,useFormsPattern:r,formHeadingLevel:i,formHeading:n}=this,l=this.getHeaderLevel(),d=o?"header-message":null,u=`${r&&n?"form-question":""} ${r?"form-description":""} ${"multiple"===r?"header-message":""}`.trim()||null,m=classnames({"usa-legend":!0,"usa-label--error":t});let f=null;if("single"===r||"multiple"===r){const e=getHeaderLevel(i);f=h(Fragment,null,n&&h(e,{id:"form-question",part:"form-header"},n),h("div",{id:"form-description"},h("slot",{name:"form-description"})))}return h(Host,{"aria-invalid":t?"true":"false"},f,h("div",{class:"input-wrap"},h("fieldset",{class:"usa-fieldset","aria-labelledby":u},h("legend",{class:m,part:"legend"},l?h(l,{part:"header","aria-describedby":d},e):e," ","multiple"===r&&h("span",{id:"header-message",class:"sr-only"},e),o&&h("span",{id:"header-message",class:"sr-only"},o),s&&h("span",{class:"usa-label--required",part:"required"},instance.t("required")),a&&h("div",{class:"usa-hint"},a)),h("span",{class:"usa-error-message",role:"alert"},t&&h(Fragment,null,h("span",{class:"usa-sr-only"},instance.t("error"))," ",t)),h("slot",null))))}get el(){return this}static get style(){return vaRadioCss}},[1,"va-radio",{label:[1],hint:[1],required:[4],error:[1],enableAnalytics:[4,"enable-analytics"],labelHeaderLevel:[1,"label-header-level"],headerAriaDescribedby:[1,"header-aria-describedby"],useFormsPattern:[1,"use-forms-pattern"],formHeadingLevel:[2,"form-heading-level"],formHeading:[1,"form-heading"]},[[0,"keydown","handleKeyDown"],[0,"radioOptionSelected","radioOptionSelectedHandler"]]]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-radio"].forEach((e=>{"va-radio"===e&&(customElements.get(e)||customElements.define(e,VaRadio$1))}))}const VaRadio=VaRadio$1,defineCustomElement=defineCustomElement$1;export{VaRadio,defineCustomElement};
1
+ import{Build,proxyCustomElement,HTMLElement,createEvent,forceUpdate,h,Fragment,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{g as getSlottedNodes,a as getHeaderLevel}from"./utils.js";import"./i18n-setup.js";import"./contacts.js";import{i as instance}from"./i18next.js";const vaRadioCss='button:not([disabled]):focus,:host([uswds=\'false\']) button:not([disabled]):active,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}.sr-only{border:0;clip:rect(0, 0, 0, 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute !important;width:1px;word-wrap:normal !important}h1{margin-top:0}h1,h2,h3,h4,h5,h6{margin-bottom:0;margin-top:0;clear:both}*+h1,*+h2,*+h3,*+h4,*+h5,*+h6{margin-top:1.5em}h1+*,h2+*,h3+*,h4+*,h5+*,h6+*{margin-top:1em}h1{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:2.44rem;line-height:1.2;font-weight:700}h2{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.95rem;line-height:1.2;font-weight:700}h3{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.34rem;line-height:1.2;font-weight:700}h4{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.98rem;line-height:1.2;font-weight:700}h5{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.91rem;line-height:1.2;font-weight:700}h6{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:0.87rem;line-height:1.1;font-weight:normal;letter-spacing:0.025em;text-transform:uppercase}h1,h2,h3,h4,h5{font-family:Bitter, Georgia, Cambria, "Times New Roman", Times, serif;font-weight:700}h6{font-family:"Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:1.875rem}h3{font-size:1.25rem}h4{font-size:1.0625rem}h5{font-size:0.9375rem}h6{font-size:0.9375rem}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}.usa-hint,.usa-fieldset{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.usa-sr-only{position:absolute;left:-999em;right:auto}.usa-form{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}@media all and (min-width: 30em){.usa-form{max-width:20rem}}.usa-form abbr[title=required]{text-decoration:none}.usa-form .usa-input,.usa-form .usa-range,.usa-form .usa-select,.usa-form .usa-textarea{max-width:none}.usa-form .usa-input--2xs,.usa-form .usa-input-group--2xs{max-width:5ex}.usa-form .usa-input--xs,.usa-form .usa-input-group--xs{max-width:9ex}.usa-form .usa-input--sm,.usa-form .usa-input--small,.usa-form .usa-input-group--sm,.usa-form .usa-input-group--small{max-width:13ex}.usa-form .usa-input--md,.usa-form .usa-input--medium,.usa-form .usa-input-group--md,.usa-form .usa-input-group--medium{max-width:20ex}.usa-form .usa-input--lg,.usa-form .usa-input-group--lg{max-width:30ex}.usa-form .usa-input--xl,.usa-form .usa-input-group--xl{max-width:40ex}.usa-form .usa-input--2xl,.usa-form .usa-input-group--2xl{max-width:50ex}.usa-form .usa-button{margin-top:0.5rem}@media all and (min-width: 30em){.usa-form .usa-button{margin-top:1.5rem}}.usa-form a:where(:not(.usa-button)){color:#005ea2;text-decoration:underline}.usa-form a:where(:not(.usa-button)):visited{color:#54278f}.usa-form a:where(:not(.usa-button)):hover{color:#1a4480}.usa-form a:where(:not(.usa-button)):active{color:#162e51}.usa-form a:where(:not(.usa-button)):focus{outline:0.25rem solid #2491ff;outline-offset:0rem}@media all and (min-width: 30em){.usa-form--large{max-width:30rem}}.usa-show-password{color:#005ea2;text-decoration:underline;background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;font-weight:normal;-ms-flex-pack:normal;justify-content:normal;text-align:left;margin:0;padding:0;cursor:pointer}.usa-show-password:visited{color:#54278f}.usa-show-password:hover{color:#1a4480}.usa-show-password:active{color:#162e51}.usa-show-password:focus{outline:0.25rem solid #2491ff;outline-offset:0rem}.usa-show-password:hover,.usa-show-password.usa-button--hover,.usa-show-password:disabled:hover,.usa-show-password[aria-disabled=true]:hover,.usa-show-password:disabled.usa-button--hover,.usa-show-password[aria-disabled=true].usa-button--hover,.usa-show-password:active,.usa-show-password.usa-button--active,.usa-show-password:disabled:active,.usa-show-password[aria-disabled=true]:active,.usa-show-password:disabled.usa-button--active,.usa-show-password[aria-disabled=true].usa-button--active,.usa-show-password:disabled:focus,.usa-show-password[aria-disabled=true]:focus,.usa-show-password:disabled.usa-focus,.usa-show-password[aria-disabled=true].usa-focus,.usa-show-password:disabled,.usa-show-password[aria-disabled=true],.usa-show-password.usa-button--disabled{background-color:transparent;-webkit-box-shadow:none;box-shadow:none;text-decoration:underline}.usa-show-password.usa-button--hover{color:#1a4480}.usa-show-password.usa-button--active{color:#162e51}.usa-show-password:disabled,.usa-show-password[aria-disabled=true],.usa-show-password:disabled:hover,.usa-show-password[aria-disabled=true]:hover,.usa-show-password[aria-disabled=true]:focus{color:#757575}@media (forced-colors: active){.usa-show-password:disabled,.usa-show-password[aria-disabled=true],.usa-show-password:disabled:hover,.usa-show-password[aria-disabled=true]:hover,.usa-show-password[aria-disabled=true]:focus{color:GrayText}}.usa-form__note,.usa-show-password{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:0.93rem;line-height:1.3;float:right;margin:0.25rem 0 1rem}.usa-fieldset{border:none;margin:0;padding:0}.usa-legend{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-legend--large{font-size:2.13rem;font-weight:700;margin-top:1rem}.usa-label{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-label--error{font-weight:700;margin-top:0}.usa-label--required{color:#b50909}.usa-hint{color:#71767a}.usa-hint--required{color:#b50909}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""]):not([uswds=false])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""]):not([uswds=false])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""]):not([uswds=false])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""]):not([uswds=false])){margin-left:-0.9rem}:host([error]:not([error=""]):not([uswds=false])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""]):not([uswds=false])[use-forms-pattern=multiple]){padding-left:0}}:host{display:block;border:none;padding:0;margin-top:24px}';Build.isTesting&&instance.init({lng:"cimode"});const VaRadio$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.vaValueChange=createEvent(this,"vaValueChange",7),this.label=void 0,this.hint=void 0,this.required=!1,this.error=void 0,this.enableAnalytics=!1,this.labelHeaderLevel=void 0,this.headerAriaDescribedby=void 0,this.messageAriaDescribedby=void 0,this.useFormsPattern=void 0,this.formHeadingLevel=3,this.formHeading=void 0}handleKeyDown(e){const a=e.target,s=getSlottedNodes(this.el,"va-radio-option").filter((e=>!e.disabled));if(!s.length)return;const t=s.findIndex((e=>e===a));if(-1===t)return;let o;switch(e.key){case" ":if(e.preventDefault(),a.checked)return;o=a,this.selectNextNode(a);break;case"ArrowDown":case"ArrowRight":e.preventDefault(),t===s.length-1?(o=s[0],this.deselectCurrentNode(a),this.selectNextNode(o)):(o=s[t+1],this.deselectCurrentNode(a),this.selectNextNode(o));break;case"ArrowUp":case"ArrowLeft":e.preventDefault(),0===t?(o=s[s.length-1],this.deselectCurrentNode(a),this.selectNextNode(o)):(o=s[t-1],this.deselectCurrentNode(a),this.selectNextNode(o))}o&&(this.enableAnalytics&&this.fireAnalyticsEvent(o.label),this.vaValueChange.emit({value:o.value}))}radioOptionSelectedHandler(e){const a=e.target;getSlottedNodes(this.el,"va-radio-option").filter((e=>e!==a)).forEach((e=>{this.deselectCurrentNode(e)})),this.selectNextNode(a),this.enableAnalytics&&this.fireAnalyticsEvent(a.label),this.vaValueChange.emit({value:a.value})}fireAnalyticsEvent(e){this.componentLibraryAnalytics.emit({componentName:"va-radio",action:"change",details:{label:this.label,optionLabel:e,required:this.required}})}deselectCurrentNode(e){e.removeAttribute("checked")}selectNextNode(e){e.setAttribute("checked",""),e.focus()}getHeaderLevel(){const e=parseInt(this.labelHeaderLevel,10);return e>=1&&e<=6?`h${e}`:null}connectedCallback(){instance.on("languageChanged",(()=>{forceUpdate(this.el)}))}disconnectedCallback(){instance.off("languageChanged")}render(){const{label:e,hint:a,required:s,error:t,headerAriaDescribedby:o,messageAriaDescribedby:r,useFormsPattern:i,formHeadingLevel:n,formHeading:l}=this,d=this.getHeaderLevel(),u=o?"header-message":null,m=r?"description-message":null,f=`${i&&l?"form-question":""} ${i?"form-description":""} ${"multiple"===i?"header-message":""}`.trim()||null,c=classnames({"usa-legend":!0,"usa-label--error":t});let p=null;if("single"===i||"multiple"===i){const e=getHeaderLevel(n);p=h(Fragment,null,l&&h(e,{id:"form-question",part:"form-header"},l),h("div",{id:"form-description"},h("slot",{name:"form-description"})))}return h(Host,{"aria-invalid":t?"true":"false"},p,h("div",{class:"input-wrap"},h("fieldset",{class:"usa-fieldset","aria-labelledby":f},h("legend",{class:c,part:"legend","aria-describedby":m},d?h(d,{part:"header","aria-describedby":u},e):e," ","multiple"===i&&h("span",{id:"header-message",class:"usa-sr-only"},e),o&&h("span",{id:"header-message",class:"usa-sr-only"},o),r&&h("span",{id:"description-message",class:"usa-sr-only"},r),s&&h("span",{class:"usa-label--required",part:"required"},instance.t("required")),a&&h("div",{class:"usa-hint"},a)),h("span",{class:"usa-error-message",role:"alert"},t&&h(Fragment,null,h("span",{class:"usa-sr-only"},instance.t("error"))," ",t)),h("slot",null))))}get el(){return this}static get style(){return vaRadioCss}},[1,"va-radio",{label:[1],hint:[1],required:[4],error:[1],enableAnalytics:[4,"enable-analytics"],labelHeaderLevel:[1,"label-header-level"],headerAriaDescribedby:[1,"header-aria-describedby"],messageAriaDescribedby:[1,"message-aria-describedby"],useFormsPattern:[1,"use-forms-pattern"],formHeadingLevel:[2,"form-heading-level"],formHeading:[1,"form-heading"]},[[0,"keydown","handleKeyDown"],[0,"radioOptionSelected","radioOptionSelectedHandler"]]]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-radio"].forEach((e=>{"va-radio"===e&&(customElements.get(e)||customElements.define(e,VaRadio$1))}))}const VaRadio=VaRadio$1,defineCustomElement=defineCustomElement$1;export{VaRadio,defineCustomElement};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@department-of-veterans-affairs/component-library",
3
3
  "description": "VA.gov component library. Includes React and web components.",
4
- "version": "46.0.2",
4
+ "version": "46.0.3",
5
5
  "license": "MIT",
6
6
  "scripts": {
7
7
  "build": "webpack"
@@ -16,7 +16,7 @@
16
16
  "module": "src/main.js",
17
17
  "dependencies": {
18
18
  "@department-of-veterans-affairs/react-components": "28.1.0",
19
- "@department-of-veterans-affairs/web-components": "14.0.1",
19
+ "@department-of-veterans-affairs/web-components": "14.0.2",
20
20
  "i18next": "^21.6.14",
21
21
  "i18next-browser-languagedetector": "^6.1.4",
22
22
  "react-focus-on": "^3.5.1",