@department-of-veterans-affairs/component-library 49.2.0 → 49.4.0
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.
- package/dist/1214.app.bundle.js +1 -1
- package/dist/1450.app.bundle.js +1 -1
- package/dist/157.app.bundle.js +1 -0
- package/dist/2222.app.bundle.js +1 -1
- package/dist/2387.app.bundle.js +1 -1
- package/dist/2654.app.bundle.js +1 -1
- package/dist/2664.app.bundle.js +1 -1
- package/dist/2801.app.bundle.js +1 -1
- package/dist/286.app.bundle.js +1 -1
- package/dist/3071.app.bundle.js +1 -1
- package/dist/3156.app.bundle.js +1 -1
- package/dist/4064.app.bundle.js +1 -1
- package/dist/4117.app.bundle.js +1 -1
- package/dist/4140.app.bundle.js +1 -1
- package/dist/4493.app.bundle.js +1 -1
- package/dist/4715.app.bundle.js +1 -1
- package/dist/5155.app.bundle.js +1 -1
- package/dist/5306.app.bundle.js +1 -1
- package/dist/5610.app.bundle.js +1 -1
- package/dist/5699.app.bundle.js +1 -1
- package/dist/5830.app.bundle.js +1 -1
- package/dist/6034.app.bundle.js +1 -1
- package/dist/6246.app.bundle.js +1 -1
- package/dist/6247.app.bundle.js +1 -1
- package/dist/641.app.bundle.js +1 -0
- package/dist/6527.app.bundle.js +1 -1
- package/dist/6655.app.bundle.js +2 -0
- package/dist/712.app.bundle.js +1 -1
- package/dist/7367.app.bundle.js +1 -1
- package/dist/7531.app.bundle.js +1 -1
- package/dist/7663.app.bundle.js +1 -1
- package/dist/7821.app.bundle.js +1 -1
- package/dist/8175.app.bundle.js +1 -1
- package/dist/82.app.bundle.js +1 -1
- package/dist/8762.app.bundle.js +1 -1
- package/dist/890.app.bundle.js +1 -1
- package/dist/9157.app.bundle.js +1 -1
- package/dist/9288.app.bundle.js +1 -1
- package/dist/9670.app.bundle.js +1 -1
- package/dist/9724.app.bundle.js +1 -1
- package/dist/9800.app.bundle.js +1 -1
- package/dist/app.bundle.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -1
- package/dist/components/types/components.d.ts +354 -163
- package/dist/components/utils.js +1 -1
- package/dist/components/va-accordion.js +1 -1
- package/dist/components/va-additional-info.js +1 -1
- package/dist/components/va-alert-expandable.js +1 -1
- package/dist/components/va-alert-sign-in.js +1 -1
- package/dist/components/va-back-to-top.js +1 -1
- package/dist/components/va-button-icon2.js +1 -1
- package/dist/components/va-button2.js +1 -1
- package/dist/components/va-card2.js +1 -1
- package/dist/components/va-checkbox-group.js +1 -1
- package/dist/components/va-checkbox2.js +1 -1
- package/dist/components/va-combo-box.js +2 -2
- package/dist/components/va-crisis-line-modal2.js +1 -1
- package/dist/components/va-file-input-multiple.js +1 -1
- package/dist/components/va-file-input2.js +1 -1
- package/dist/components/va-header-minimal.js +1 -1
- package/dist/components/va-icon2.js +1 -1
- package/dist/components/va-language-toggle.js +1 -1
- package/dist/components/va-link-action.js +1 -1
- package/dist/components/va-loading-indicator.js +1 -1
- package/dist/components/va-minimal-footer.js +1 -1
- package/dist/components/va-need-help.js +1 -1
- package/dist/components/va-official-gov-banner2.js +1 -1
- package/dist/components/va-omb-info.js +1 -1
- package/dist/components/va-privacy-agreement.js +1 -1
- package/dist/components/va-process-list-item.js +1 -1
- package/dist/components/va-process-list.js +1 -1
- package/dist/components/va-progress-bar.js +1 -1
- package/dist/components/va-progress-bar2.js +1 -0
- package/dist/components/va-radio-option.js +1 -1
- package/dist/components/va-radio.js +1 -1
- package/dist/components/va-search-input.js +1 -1
- package/dist/components/va-select2.js +1 -1
- package/dist/components/va-service-list-item.d.ts +11 -0
- package/dist/components/va-service-list-item.js +1 -0
- package/dist/components/va-statement-of-truth.js +1 -1
- package/dist/components/va-summary-box.js +1 -1
- package/dist/components/va-table-inner2.js +1 -1
- package/dist/components/va-table-row.js +1 -1
- package/dist/components/va-table.js +1 -1
- package/dist/components/va-telephone2.js +1 -1
- package/dist/components/va-textarea.js +1 -1
- package/dist/main.css +1 -1
- package/dist/react-bindings/index.d.ts +1 -0
- package/dist/react-bindings/index.js +1 -1
- package/dist/react-bindings/index.js.map +1 -1
- package/dist/react-bindings/index.ts +1 -0
- package/package.json +2 -2
- package/dist/196.app.bundle.js +0 -2
- package/dist/326.app.bundle.js +0 -1
- package/dist/5628.app.bundle.js +0 -1
- /package/dist/{196.app.bundle.js.LICENSE.txt → 6655.app.bundle.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement,HTMLElement,createEvent,h,Host,Fragment}from"@stencil/core/internal/client";import"./i18n-setup.js";import"./contacts.js";import{s as selectOrMatches,S as Sanitizer}from"./utils.js";import{d as defineCustomElement$5}from"./va-button2.js";import{d as defineCustomElement$4}from"./va-button-icon2.js";import{d as defineCustomElement$3}from"./va-card2.js";import{d as defineCustomElement$2}from"./va-icon2.js";import{d as defineCustomElement$1}from"./va-modal2.js";import{i as instance}from"./i18next.js";const PREFIX="usa",DROPZONE_CLASS="usa-file-input",DROPZONE=`.${DROPZONE_CLASS}`,INPUT_CLASS="usa-file-input__input",TARGET_CLASS="usa-file-input__target",INPUT=`.${INPUT_CLASS}`,BOX_CLASS="usa-file-input__box",INSTRUCTIONS_CLASS="usa-file-input__instructions",PREVIEW_CLASS="usa-file-input__preview",PREVIEW_HEADING_CLASS="usa-file-input__preview-heading",DISABLED_CLASS="usa-file-input--disabled",CHOOSE_CLASS="usa-file-input__choose",ACCEPTED_FILE_MESSAGE_CLASS="usa-file-input__accepted-files-message",DRAG_TEXT_CLASS="usa-file-input__drag-text",DRAG_CLASS="usa-file-input--drag",LOADING_CLASS="is-loading",INVALID_FILE_CLASS="has-invalid-file",GENERIC_PREVIEW_CLASS_NAME="usa-file-input__preview-image",GENERIC_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--generic`,PDF_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--pdf`,WORD_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--word`,VIDEO_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--video`,EXCEL_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--excel`,SR_ONLY_CLASS="usa-sr-only",SPACER_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";let TYPE_IS_VALID=Boolean(!0),DEFAULT_ARIA_LABEL_TEXT="",DEFAULT_FILE_STATUS_TEXT="";const getFileInputContext=e=>{const t=e.closest(DROPZONE);if(!t)throw new Error(`Element is missing outer ${DROPZONE}`);const i=t.querySelector(INPUT);return{dropZoneEl:t,inputEl:i}},disable=e=>{const{dropZoneEl:t,inputEl:i}=getFileInputContext(e);i.disabled=!0,t.classList.add(DISABLED_CLASS)},ariaDisable=e=>{const{dropZoneEl:t}=getFileInputContext(e);t.classList.add(DISABLED_CLASS)},enable=e=>{const{dropZoneEl:t,inputEl:i}=getFileInputContext(e);i.disabled=!1,t.classList.remove(DISABLED_CLASS),t.removeAttribute("aria-disabled")},replaceName=e=>{const t=e.charCodeAt(0);return 32===t?"-":t>=65&&t<=90?`img_${e.toLowerCase()}`:`__000${t.toString(16).slice(-4)}`},makeSafeForID=e=>e.replace(/[^a-z0-9]/g,replaceName),createUniqueID=e=>`${e}-${Math.floor(Date.now()/1e3)}`,getItemsLabel=e=>e.hasAttribute("multiple")?"files":"file",createTargetArea=e=>{const t=document.createElement("div"),i=document.createElement("div"),a=document.createElement("div");return e.classList.remove(DROPZONE_CLASS),e.classList.add(INPUT_CLASS),t.classList.add(DROPZONE_CLASS),a.classList.add(BOX_CLASS),i.classList.add(TARGET_CLASS),i.prepend(a),e.parentNode.insertBefore(i,e),e.parentNode.insertBefore(t,i),i.appendChild(e),t.appendChild(i),i},createVisibleInstructions=e=>{const t=e.closest(DROPZONE),i=getItemsLabel(e),a=document.createElement("div"),s=`Drag ${i} here or`,o="choose from folder";return DEFAULT_ARIA_LABEL_TEXT=`${s} ${o}`,a.classList.add(INSTRUCTIONS_CLASS),a.setAttribute("aria-hidden","true"),e.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT),a.innerHTML=Sanitizer.escapeHTML(`<span class="${DRAG_TEXT_CLASS}">${s}</span> <span class="${CHOOSE_CLASS}">${o}</span>`),e.parentNode.insertBefore(a,e),(/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.querySelector(`.${DRAG_TEXT_CLASS}`).outerHTML=""),a},createSROnlyStatus=e=>{const t=document.createElement("div"),i=getItemsLabel(e),a=e.closest(DROPZONE),s=e.closest(`.${TARGET_CLASS}`);DEFAULT_FILE_STATUS_TEXT=`No ${i} selected.`,t.classList.add("usa-sr-only"),t.setAttribute("aria-live","polite"),t.textContent=DEFAULT_FILE_STATUS_TEXT,a.insertBefore(t,s)},enhanceFileInput=e=>{const t=e.hasAttribute("aria-disabled")||e.hasAttribute("disabled"),i=createTargetArea(e),a=createVisibleInstructions(e),{dropZoneEl:s}=getFileInputContext(e);return t?s.classList.add(DISABLED_CLASS):createSROnlyStatus(e),{instructions:a,dropTarget:i}},removeOldPreviews=(e,t)=>{const i=e.querySelectorAll(`.${PREVIEW_CLASS}`),a=e.querySelector(`.${PREVIEW_HEADING_CLASS}`),s=e.querySelector(`.${ACCEPTED_FILE_MESSAGE_CLASS}`);a&&(a.outerHTML=""),s&&(s.outerHTML="",e.classList.remove("has-invalid-file")),null!==i&&(t&&t.removeAttribute("hidden"),Array.prototype.forEach.call(i,(e=>{e.parentNode.removeChild(e)})))},updateStatusMessage=(e,t,i)=>{const a=e;let s=DEFAULT_FILE_STATUS_TEXT;1===t.length?s=`You have selected the file: ${i}`:t.length>1&&(s=`You have selected ${t.length} files: ${i.join(", ")}`),setTimeout((()=>{a.textContent=s}),1e3)},addPreviewHeading=(e,t)=>{const i=document.createElement("div"),a=e.closest(`.${TARGET_CLASS}`),s=a.querySelector(`.${INSTRUCTIONS_CLASS}`);let o="Change file",n="";1===t.length?n=Sanitizer.escapeHTML(`Selected file <span class="usa-file-input__choose">${o}</span>`):t.length>1&&(o="Change files",n=Sanitizer.escapeHTML(`${t.length} files selected <span class="usa-file-input__choose">${o}</span>`)),s.setAttribute("hidden","true"),i.classList.add(PREVIEW_HEADING_CLASS),i.innerHTML=n,a.insertBefore(i,s),e.setAttribute("aria-label",o)},handleChange=(e,t,i,a)=>{const s=t.getAttribute("multiple")?e.target.files:[e.target.files[0]],o=a.closest(`.${DROPZONE_CLASS}`).querySelector(".usa-sr-only"),n=[];removeOldPreviews(a,i);for(let e=0;e<s.length;e+=1){const t=new FileReader,o=s[e].name;let r;n.push(o),t.onloadstart=function(){r=createUniqueID(makeSafeForID(o)),i.insertAdjacentHTML("afterend",Sanitizer.escapeHTML(`<div class="${PREVIEW_CLASS}" aria-hidden="true">\n <img id="${r}" src="${SPACER_GIF}" alt="" class="${GENERIC_PREVIEW_CLASS_NAME} is-loading"/>${o}\n <div>`))},t.onloadend=function(){const e=a.querySelector(`#${r}`);o.indexOf(".pdf")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${PDF_PREVIEW_CLASS}")`):o.indexOf(".doc")>0||o.indexOf(".pages")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${WORD_PREVIEW_CLASS}")`):o.indexOf(".xls")>0||o.indexOf(".numbers")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${EXCEL_PREVIEW_CLASS}")`):o.indexOf(".mov")>0||o.indexOf(".mp4")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${VIDEO_PREVIEW_CLASS}")`):e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${GENERIC_PREVIEW_CLASS}")`),e.classList.remove("is-loading"),e.src=t.result},s[e]&&t.readAsDataURL(s[e])}0===s.length?t.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT):addPreviewHeading(t,s),updateStatusMessage(o,s,n)},preventInvalidFiles=(e,t,i,a)=>{const s=t.getAttribute("accept");a.classList.remove("has-invalid-file");const o=(e,t)=>{let i=!1;return e.indexOf(t)>=0&&(i=!0),i};if(s){const n=s.split(","),r=document.createElement("div");let l=!0;const d=e.target.files||e.dataTransfer.files;for(let e=0;e<d.length;e+=1){const t=d[e];if(!l)break;for(let e=0;e<n.length;e+=1){const i=n[e];if(l=t.name.indexOf(i)>0||o(t.type,i.replace(/\*/g,"")),l){TYPE_IS_VALID=!0;break}}}l||(removeOldPreviews(a,i),t.value="",a.insertBefore(r,t),r.textContent=t.dataset.errormessage||"This is not a valid file type.",r.classList.add(ACCEPTED_FILE_MESSAGE_CLASS),a.classList.add("has-invalid-file"),TYPE_IS_VALID=!1,e.preventDefault(),e.stopPropagation())}},handleUpload=(e,t,i,a)=>{preventInvalidFiles(e,t,i,a),!0===TYPE_IS_VALID&&handleChange(e,t,i,a)},fileInput={init(e){selectOrMatches(DROPZONE,e).forEach((e=>{const{instructions:t,dropTarget:i}=enhanceFileInput(e);i.addEventListener("dragover",(function(){this.classList.add(DRAG_CLASS)}),!1),i.addEventListener("dragleave",(function(){this.classList.remove(DRAG_CLASS)}),!1),i.addEventListener("drop",(function(a){a.preventDefault(),this.classList.remove(DRAG_CLASS);const s=a.dataTransfer;if(a.target.files=s.files,s.files.length>1)return;handleUpload(a,e,t,i);const o=new CustomEvent("change",{detail:{files:s.files}});e.dispatchEvent(o)}),!1),e.addEventListener("input",(a=>handleUpload(a,e,t,i)),!1)}))},teardown(e){selectOrMatches(INPUT,e).forEach((e=>{const t=e.parentElement.parentElement;t.parentElement.replaceChild(e,t),e.className=DROPZONE_CLASS}))},getFileInputContext:getFileInputContext,disable:disable,ariaDisable:ariaDisable,enable:enable},extensionToMimeType={".txt":"text/plain",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".odt":"application/vnd.oasis.opendocument.text",".rtf":"application/rtf",".csv":"text/csv",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".bmp":"image/bmp",".webp":"image/webp",".tif":"image/tiff",".tiff":"image/tiff",".svg":"image/svg+xml",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac",".mp4":"video/mp4",".avi":"video/x-msvideo",".mov":"video/quicktime",".wmv":"video/x-ms-wmv",".flv":"video/x-flv",".mkv":"video/x-matroska",".webm":"video/webm",".zip":"application/zip",".rar":"application/x-rar-compressed",".7z":"application/x-7z-compressed",".tar":"application/x-tar",".gz":"application/gzip",".json":"application/json",".xml":"application/xml",".html":"text/html",".htm":"text/html",".css":"text/css",".js":"application/javascript"},vaFileInputCss='button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}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 Web", "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{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.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-sr-only{position:absolute;left:-999em;right:auto}.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=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[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=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}[hidden]{display:none}:host{display:block;font-family:var(--font-source-sans);font-size:16.96px;}:host .label-header{color:var(--vads-color-base);font-weight:var(--font-weight-normal)}:host .label-header-tag{margin:0;display:inline-block}:host .file-input-wrapper{display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host .file-input{cursor:pointer;height:100%;width:100%;max-width:none;top:0;left:0;z-index:1;margin:0;position:absolute;text-indent:-999em;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target{border:1px dashed var(--vads-color-action-border-base-active-on-dark);display:block;margin-top:0.3125rem;position:relative;text-align:center;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target.file-input-target-error{border:2px dashed var(--vads-color-secondary-dark)}:host .file-input-box{background:var(--vads-color-white);height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:2}:host .file-input-instructions{font-size:1.06rem;padding:1.25rem 0.625rem;pointer-events:none;position:relative;z-index:3}:host .file-input-choose-text{color:var(--vads-color-link);text-decoration:underline;font-weight:var(--font-weight-normal)}:host .file-icon{color:var(--vads-color-primary-alt-darkest)}:host .selected-files-wrapper{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light)}:host .selected-files-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;border-bottom:1px solid var(--vads-color-white);margin-bottom:8px;padding:8px}:host .va-card{margin:8px}:host .file-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;padding:0 8px;display:block;width:100%;word-wrap:break-word;word-break:break-word;overflow:hidden}:host #input-error-message{padding:0 8px;width:100%}:host .file-size-label,:host .file-status-label{color:var(--vads-color-base-dark);font-weight:var(--font-weight-normal);font-size:1.06rem;padding:0 8px;display:block}:host .file-status-label{font-style:italic}:host .file-info-section{padding:0 8px 8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .file-button-section{margin-top:8px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:row;flex-direction:row}:host .file-button-section>va-button-icon{font-size:1.06rem}@media screen and (max-width: 320px){:host .file-button-section{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}:host .separator{border:0;border-top:1px solid var(--vads-color-base-lighter);margin:0}:host .vads-u-line-height--2{line-height:1.15}:host .thumbnail-container{height:40px;width:40px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .thumbnail-preview{max-width:40px;width:auto;max-height:40px;height:auto}:host .thumbnail-error{color:#b21d38}:host(.has-error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host(.has-error){margin-left:-0.9rem}}.required{color:var(--vads-color-secondary-dark);margin-left:0.25rem}h1 .required,h2 .required,h3 .required,h4 .required,h5 .required,h6 .required{font-family:var(--font-source-sans);font-size:initial;font-weight:initial}',VaFileInputStyle0=vaFileInputCss,VaFileInput=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaChange=createEvent(this,"vaChange",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.uploadStatus="idle",this.defaultUploadMessage=h("span",null,"Drag a file here or"," ",h("span",{class:"file-input-choose-text"},"choose from folder")),this.handleChange=e=>{const t=e.target;t.files&&t.files.length>0&&this.handleFile(t.files[0]),t.value=""},this.handleDrop=e=>{e.preventDefault(),e.stopPropagation();const t=e.dataTransfer.files;t.length>0&&this.handleFile(t[0])},this.handleFile=(e,t=!0)=>{if(this.accept){const t=this.normalizeAcceptProp(this.accept);if(!this.isAcceptedFileType(e.type,t))return this.removeFile(!1),void(this.internalError="This is not a valid file type.")}if(e.size>this.maxFileSize)return this.internalError=`\n We can't upload your file because it's too big. Files must be less than ${this.formatFileSize(this.maxFileSize)}.`,this.fileContents=null,void(this.uploadStatus="idle");this.uploadedFile=null,this.file=e,t&&this.vaChange.emit({files:[this.file]}),this.uploadStatus="success",this.internalError=null,this.generateFileContents(this.file),this.updateStatusMessage(`You have selected the file: ${this.file.name}`),this.el.focus(),this.enableAnalytics&&this.componentLibraryAnalytics.emit({componentName:"va-file-input",action:"change",details:{label:this.label}})},this.removeFile=(e=!0)=>{this.closeModal(),this.uploadStatus="idle",this.internalError=null,e&&this.vaChange.emit({files:[]}),this.file=null,this.uploadedFile=null,this.updateStatusMessage("File removed. No file selected."),this.el.focus()},this.openModal=()=>{this.el.shadowRoot.querySelector("va-modal").setAttribute("status","warning"),this.showModal=!0},this.closeModal=()=>{this.showModal=!1,setTimeout((()=>{this.fileInputRef.focus()}),0)},this.changeFile=()=>{this.fileInputRef&&this.fileInputRef.click()},this.formatFileSize=e=>{const t=["B","KB","MB","GB","TB"];if(0===e)return"0 B";const i=Math.floor(Math.log(e)/Math.log(1024));return 0===i?`${e} ${t[i]}`:`${(e/Math.pow(1024,i)).toFixed(i<2?0:1)} ${t[i]}`},this.normalizeAcceptProp=e=>e.split(",").map((e=>(e=e.trim()).startsWith(".")?extensionToMimeType[e]:e)),this.isAcceptedFileType=(e,t)=>{for(const i of t){if(i===e)return!0;if(i.endsWith("/*")&&e.startsWith(i.slice(0,-1)))return!0}return!1},this.renderLabelOrHeader=(e,t,i)=>{const a=t?h("span",{class:"required"}," ",instance.t("required")):null;return h("div",{class:"label-header"},i&&i>=1&&i<=6?h(`h${i}`,{htmlFor:"fileInputField",part:"label",class:"label-header-tag"},e,a):h("label",{htmlFor:"fileInputField",part:"label",class:"usa-label"},e,a))},this.file=void 0,this.fileContents=void 0,this.internalError=void 0,this.showModal=!1,this.showSeparator=!0,this.label=void 0,this.name=void 0,this.buttonText=void 0,this.value=void 0,this.required=!1,this.accept=void 0,this.error=void 0,this.hint=void 0,this.statusText=void 0,this.uploadMessage=this.defaultUploadMessage,this.enableAnalytics=!1,this.headerSize=void 0,this.headless=!1,this.readOnly=!1,this.uploadedFile=void 0,this.maxFileSize=1/0}handleValueChange(e){setTimeout((()=>{this.updateStatusMessage(e)}))}updateStatusMessage(e){setTimeout((()=>{const t=this.el.shadowRoot.querySelector("#statusMessage");t&&(t.textContent=e)}),1e3)}generateFileContents(e){if(!e)return;const t=new FileReader;this.fileType=e.type,t.onloadend=()=>{this.fileContents=t.result},this.fileType&&("application/pdf"===this.fileType||this.fileType.startsWith("image/"))&&t.readAsDataURL(e)}componentWillRender(){const e=!!this.el.querySelector(":scope > *"),t=!(!this.value&&!this.file||this.readOnly);this.showSeparator=e||t}componentDidLoad(){fileInput.init(this.el)}connectedCallback(){this.el.addEventListener("change",this.handleChange)}disconnectedCallback(){this.el.removeEventListener("change",this.handleChange)}render(){const{label:e,name:t,required:i,accept:a,error:s,hint:o,file:n,uploadStatus:r,headerSize:l,fileContents:d,fileType:c,headless:f,value:p,readOnly:u,statusText:m,uploadedFile:b}=this;p&&!this.file&&this.handleFile(p,!1);const g=this.error||this.internalError,v=`${o?"input-hint-message":""} ${g?"input-error-message":""}`.trim()||null,S=("file-input-target "+(g?"file-input-target-error":"")).trim();let E=h("div",{key:"c8386dd183ae18c38d25414b217b74a52df8f97a",class:"thumbnail-container"},h("svg",{key:"9cd9ecfc6574b69792ad7fb564e7570da28c3701",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"#07648d",width:"40px",height:"40px"},h("path",{key:"352cd2913f2fc1170d9ce4459d154981a1ac7174",d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"})));s?E=h("div",{key:"983fcb2a7b81a1691b4902bce160d896cc39a229",class:"thumbnail-container"},h("va-icon",{key:"0aca47c7acef3ef598c2fc33edebcdc8ba6c0cf7",icon:"error",size:3,class:"thumbnail-preview thumbnail-error"})):d&&(c.startsWith("image/")?E=h("div",{key:"fb7d6b83ba74ddb8bf2b12d50ae43b5df6fbc2a7",class:"thumbnail-container","aria-hidden":"true"},h("img",{key:"a5878c3034df8c8ded8c93bf6a6e2c67726b7621",class:"thumbnail-preview",src:d,alt:"image"})):"application/pdf"===c&&(E=h("div",{key:"69ebedae991c8788a6c95421ba1233cae1a0a759",class:"thumbnail-container","aria-hidden":"true"},h("object",{key:"7f954260f74fe574a6bae9b2676d04b3de73d669",class:"thumbnail-preview",data:d,type:"application/pdf"}))));let A=f?"headless-selected-files-wrapper":"selected-files-wrapper";const _="usa-hint"+(f?" usa-sr-only":"");return this.uploadMessage||(this.uploadMessage=this.defaultUploadMessage),h(Host,{key:"1d456aec3ce70cb6bea0682e3012a7b12e774d58",class:{"has-error":!!g}},!u&&h("span",{key:"c025b956f716c6bfa561a5fd57e1e069725c09e1",class:{"usa-sr-only":!!f}},e&&this.renderLabelOrHeader(e,i,l)),o&&!u&&h("div",{key:"81dc56922035cf978e24af8b558b398cda1e4021",class:_,id:"input-hint-message"},o),h("div",{key:"c78982f5bf5d390287081388cbf453bf524c5ae4",class:"file-input-wrapper",onDrop:this.handleDrop},h("input",{key:"0747f2157ffc6f1c733afd98c93f203adc443599",id:"fileInputField",class:"file-input",style:{visibility:"success"===this.uploadStatus||b?"hidden":"unset"},type:"file",ref:e=>this.fileInputRef=e,name:t,accept:a,"aria-describedby":v,onChange:this.handleChange}),"idle"===r&&!b&&h("div",{key:"6bd756871f05a37afa1c42a3c62889af818ec1cc"},h("span",{key:"d9e784198ba34782fe40c46de6c2ea0f9ad31b49",id:"file-input-error-alert",role:"alert"},g&&h(Fragment,{key:"462f0974c2a7de8bfc4a6361b85883a09f09106c"},h("span",{key:"aaaa3bd3d79cc9c0127e02239b483f3de3b01046",class:"usa-sr-only"},instance.t("error")),h("span",{key:"11ab265122698c5a924f2e549fca4d8df0ef735b",class:"usa-error-message"},g))),h("div",{key:"6b64578fa9c8c3f4c4355c7cc2f4d68c48815113",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("div",{key:"9fd97a14fb79eb864e02b4c6faf33410d508fb9b",class:S},h("div",{key:"3df5819db18b8e0248157877e333ea36d7295ffb",class:"file-input-box"}),h("div",{key:"cb94ae6292372faf86271e63959d4968e508203a",class:"file-input-instructions"},this.uploadMessage))),("idle"!==r||b)&&h("div",{key:"a2eb99a7ef7bb18609e1359d0b2b9ddc17207c68",class:A},!f&&h("div",{key:"c87287ff7518002911177a4ad34c0be8c9b6a2bc",class:"selected-files-label"},u?"Files you uploaded":"Selected files"),h("div",{key:"f8150b8948d5b92c5f224d7099ac9621251175d1",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("va-card",{key:"c8751c235c9055d6f8fb1ba842b474884f2c3994",class:"va-card"},h("div",{key:"54aa5062335fa6005b028fdaf0f7f73ded54bd05",class:"file-info-section"},E,h("div",{key:"3f778d26008b327dfb8ce451af739a77368db64d",class:"file-info-group vads-u-line-height--2"},h("span",{key:"ed83d7084fd35e612a8e8d08f6b0f3dcbaf6761a",class:"file-label"},n?n.name:b.name),g&&h("span",{key:"da0f7acc8adbe4561a91212ee8f79aa4f9b1c945",id:"input-error-message",role:"alert"},h("span",{key:"314f0234b1a9f0ddfd35162b6309c3372ad0c302",class:"usa-sr-only"},instance.t("error")),h("span",{key:"b6ff8e9f935d8bdc743da1b968c6709ee29347ed","aria-live":"polite",class:"usa-error-message"},g)),h("span",{key:"7348da7b5b54588bd3e74839222e2b8969e79c25",class:"file-size-label"},this.formatFileSize(n?n.size:b.size)),h("span",{key:"d50d4ed09f89746503ad879bf7aa26163cd35b77",class:"file-status-label","aria-live":"polite"},m))),(n||p||b)&&h("div",{key:"6405fc2e466508158a86911920cc3e5bedcb449c"},this.showSeparator&&h("hr",{key:"8e3b3abf8923a9326e798cc1d8d6104f5e1fc596",class:"separator"}),h("div",{key:"e98d3b0a121664209a34faa1f9a0264b208eab0d",class:"additional-info-slot"},h("slot",{key:"adecfa3247fd36129589f31eabaa4c803aa0eadd"})),!u&&h(Fragment,{key:"927b7f473cb33facdc167fe7050c9c1be305dd99"},h("div",{key:"01ad585ba6f6ad8beb0e34644bb0d0e298b8dde0",class:"file-button-section"},h("va-button-icon",{key:"2fb67cf0ecc499e89e0596793c321c46bdf965dc",buttonType:"change-file",onClick:this.changeFile,label:"Change file","aria-label":`change file ${n?n.name:b.name}`}),h("va-button-icon",{key:"96dd63079a686b343ef3ffc18541e9ed95958430",buttonType:"delete",onClick:this.openModal,"aria-label":`delete file ${n?n.name:b.name}`,label:"Delete"})),h("va-modal",{key:"ba7fb5b13a866698f69fa76c31b927860974c744",modalTitle:"Delete this file?",visible:this.showModal,primaryButtonText:"Yes, remove this",secondaryButtonText:"No, keep this",onCloseEvent:this.closeModal,onPrimaryButtonClick:()=>this.removeFile(!0),onSecondaryButtonClick:this.closeModal},"We'll remove the uploaded document"," ",h("span",{key:"1c333567ff4e86789d1e43e36d879cf7cb798934",class:"file-label"},n?n.name:b.name))))))))}get el(){return this}static get watchers(){return{statusText:["handleValueChange"]}}static get style(){return VaFileInputStyle0}},[1,"va-file-input",{label:[1],name:[1],buttonText:[1,"button-text"],value:[16],required:[4],accept:[1],error:[1],hint:[1],statusText:[1,"status-text"],uploadMessage:[16],enableAnalytics:[4,"enable-analytics"],headerSize:[2,"header-size"],headless:[4],readOnly:[4,"read-only"],uploadedFile:[16],maxFileSize:[2,"max-file-size"],file:[32],fileContents:[32],internalError:[32],showModal:[32],showSeparator:[32]},void 0,{statusText:["handleValueChange"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-file-input","va-button","va-button-icon","va-card","va-icon","va-modal"].forEach((e=>{switch(e){case"va-file-input":customElements.get(e)||customElements.define(e,VaFileInput);break;case"va-button":customElements.get(e)||defineCustomElement$5();break;case"va-button-icon":customElements.get(e)||defineCustomElement$4();break;case"va-card":customElements.get(e)||defineCustomElement$3();break;case"va-icon":customElements.get(e)||defineCustomElement$2();break;case"va-modal":customElements.get(e)||defineCustomElement$1()}}))}export{VaFileInput as V,defineCustomElement as d};
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,forceUpdate,Host,Fragment}from"@stencil/core/internal/client";import"./i18n-setup.js";import"./contacts.js";import{s as selectOrMatches,S as Sanitizer}from"./utils.js";import{d as defineCustomElement$6}from"./va-button2.js";import{d as defineCustomElement$5}from"./va-button-icon2.js";import{d as defineCustomElement$4}from"./va-card2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-modal2.js";import{d as defineCustomElement$1}from"./va-progress-bar2.js";import{i as instance}from"./i18next.js";const PREFIX="usa",DROPZONE_CLASS="usa-file-input",DROPZONE=`.${DROPZONE_CLASS}`,INPUT_CLASS="usa-file-input__input",TARGET_CLASS="usa-file-input__target",INPUT=`.${INPUT_CLASS}`,BOX_CLASS="usa-file-input__box",INSTRUCTIONS_CLASS="usa-file-input__instructions",PREVIEW_CLASS="usa-file-input__preview",PREVIEW_HEADING_CLASS="usa-file-input__preview-heading",DISABLED_CLASS="usa-file-input--disabled",CHOOSE_CLASS="usa-file-input__choose",ACCEPTED_FILE_MESSAGE_CLASS="usa-file-input__accepted-files-message",DRAG_TEXT_CLASS="usa-file-input__drag-text",DRAG_CLASS="usa-file-input--drag",LOADING_CLASS="is-loading",INVALID_FILE_CLASS="has-invalid-file",GENERIC_PREVIEW_CLASS_NAME="usa-file-input__preview-image",GENERIC_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--generic`,PDF_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--pdf`,WORD_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--word`,VIDEO_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--video`,EXCEL_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--excel`,SR_ONLY_CLASS="usa-sr-only",SPACER_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";let TYPE_IS_VALID=Boolean(!0),DEFAULT_ARIA_LABEL_TEXT="",DEFAULT_FILE_STATUS_TEXT="";const getFileInputContext=e=>{const t=e.closest(DROPZONE);if(!t)throw new Error(`Element is missing outer ${DROPZONE}`);const i=t.querySelector(INPUT);return{dropZoneEl:t,inputEl:i}},disable=e=>{const{dropZoneEl:t,inputEl:i}=getFileInputContext(e);i.disabled=!0,t.classList.add(DISABLED_CLASS)},ariaDisable=e=>{const{dropZoneEl:t}=getFileInputContext(e);t.classList.add(DISABLED_CLASS)},enable=e=>{const{dropZoneEl:t,inputEl:i}=getFileInputContext(e);i.disabled=!1,t.classList.remove(DISABLED_CLASS),t.removeAttribute("aria-disabled")},replaceName=e=>{const t=e.charCodeAt(0);return 32===t?"-":t>=65&&t<=90?`img_${e.toLowerCase()}`:`__000${t.toString(16).slice(-4)}`},makeSafeForID=e=>e.replace(/[^a-z0-9]/g,replaceName),createUniqueID=e=>`${e}-${Math.floor(Date.now()/1e3)}`,getItemsLabel=e=>e.hasAttribute("multiple")?"files":"file",createTargetArea=e=>{const t=document.createElement("div"),i=document.createElement("div"),a=document.createElement("div");return e.classList.remove(DROPZONE_CLASS),e.classList.add(INPUT_CLASS),t.classList.add(DROPZONE_CLASS),a.classList.add(BOX_CLASS),i.classList.add(TARGET_CLASS),i.prepend(a),e.parentNode.insertBefore(i,e),e.parentNode.insertBefore(t,i),i.appendChild(e),t.appendChild(i),i},createVisibleInstructions=e=>{const t=e.closest(DROPZONE),i=getItemsLabel(e),a=document.createElement("div"),s=`Drag ${i} here or`,o="choose from folder";return DEFAULT_ARIA_LABEL_TEXT=`${s} ${o}`,a.classList.add(INSTRUCTIONS_CLASS),a.setAttribute("aria-hidden","true"),e.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT),a.innerHTML=Sanitizer.escapeHTML(`<span class="${DRAG_TEXT_CLASS}">${s}</span> <span class="${CHOOSE_CLASS}">${o}</span>`),e.parentNode.insertBefore(a,e),(/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.querySelector(`.${DRAG_TEXT_CLASS}`).outerHTML=""),a},createSROnlyStatus=e=>{const t=document.createElement("div"),i=getItemsLabel(e),a=e.closest(DROPZONE),s=e.closest(`.${TARGET_CLASS}`);DEFAULT_FILE_STATUS_TEXT=`No ${i} selected.`,t.classList.add("usa-sr-only"),t.setAttribute("aria-live","polite"),t.textContent=DEFAULT_FILE_STATUS_TEXT,a.insertBefore(t,s)},enhanceFileInput=e=>{const t=e.hasAttribute("aria-disabled")||e.hasAttribute("disabled"),i=createTargetArea(e),a=createVisibleInstructions(e),{dropZoneEl:s}=getFileInputContext(e);return t?s.classList.add(DISABLED_CLASS):createSROnlyStatus(e),{instructions:a,dropTarget:i}},removeOldPreviews=(e,t)=>{const i=e.querySelectorAll(`.${PREVIEW_CLASS}`),a=e.querySelector(`.${PREVIEW_HEADING_CLASS}`),s=e.querySelector(`.${ACCEPTED_FILE_MESSAGE_CLASS}`);a&&(a.outerHTML=""),s&&(s.outerHTML="",e.classList.remove("has-invalid-file")),null!==i&&(t&&t.removeAttribute("hidden"),Array.prototype.forEach.call(i,(e=>{e.parentNode.removeChild(e)})))},updateStatusMessage=(e,t,i)=>{const a=e;let s=DEFAULT_FILE_STATUS_TEXT;1===t.length?s=`You have selected the file: ${i}`:t.length>1&&(s=`You have selected ${t.length} files: ${i.join(", ")}`),setTimeout((()=>{a.textContent=s}),1e3)},addPreviewHeading=(e,t)=>{const i=document.createElement("div"),a=e.closest(`.${TARGET_CLASS}`),s=a.querySelector(`.${INSTRUCTIONS_CLASS}`);let o="Change file",n="";1===t.length?n=Sanitizer.escapeHTML(`Selected file <span class="usa-file-input__choose">${o}</span>`):t.length>1&&(o="Change files",n=Sanitizer.escapeHTML(`${t.length} files selected <span class="usa-file-input__choose">${o}</span>`)),s.setAttribute("hidden","true"),i.classList.add(PREVIEW_HEADING_CLASS),i.innerHTML=n,a.insertBefore(i,s),e.setAttribute("aria-label",o)},handleChange=(e,t,i,a)=>{const s=t.getAttribute("multiple")?e.target.files:[e.target.files[0]],o=a.closest(`.${DROPZONE_CLASS}`).querySelector(".usa-sr-only"),n=[];removeOldPreviews(a,i);for(let e=0;e<s.length;e+=1){const t=new FileReader,o=s[e].name;let r;n.push(o),t.onloadstart=function(){r=createUniqueID(makeSafeForID(o)),i.insertAdjacentHTML("afterend",Sanitizer.escapeHTML(`<div class="${PREVIEW_CLASS}" aria-hidden="true">\n <img id="${r}" src="${SPACER_GIF}" alt="" class="${GENERIC_PREVIEW_CLASS_NAME} is-loading"/>${o}\n <div>`))},t.onloadend=function(){const e=a.querySelector(`#${r}`);o.indexOf(".pdf")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${PDF_PREVIEW_CLASS}")`):o.indexOf(".doc")>0||o.indexOf(".pages")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${WORD_PREVIEW_CLASS}")`):o.indexOf(".xls")>0||o.indexOf(".numbers")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${EXCEL_PREVIEW_CLASS}")`):o.indexOf(".mov")>0||o.indexOf(".mp4")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${VIDEO_PREVIEW_CLASS}")`):e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${GENERIC_PREVIEW_CLASS}")`),e.classList.remove("is-loading"),e.src=t.result},s[e]&&t.readAsDataURL(s[e])}0===s.length?t.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT):addPreviewHeading(t,s),updateStatusMessage(o,s,n)},preventInvalidFiles=(e,t,i,a)=>{const s=t.getAttribute("accept");a.classList.remove("has-invalid-file");const o=(e,t)=>{let i=!1;return e.indexOf(t)>=0&&(i=!0),i};if(s){const n=s.split(","),r=document.createElement("div");let l=!0;const d=e.target.files||e.dataTransfer.files;for(let e=0;e<d.length;e+=1){const t=d[e];if(!l)break;for(let e=0;e<n.length;e+=1){const i=n[e];if(l=t.name.indexOf(i)>0||o(t.type,i.replace(/\*/g,"")),l){TYPE_IS_VALID=!0;break}}}l||(removeOldPreviews(a,i),t.value="",a.insertBefore(r,t),r.textContent=t.dataset.errormessage||"This is not a valid file type.",r.classList.add(ACCEPTED_FILE_MESSAGE_CLASS),a.classList.add("has-invalid-file"),TYPE_IS_VALID=!1,e.preventDefault(),e.stopPropagation())}},handleUpload=(e,t,i,a)=>{preventInvalidFiles(e,t,i,a),!0===TYPE_IS_VALID&&handleChange(e,t,i,a)},fileInput={init(e){selectOrMatches(DROPZONE,e).forEach((e=>{const{instructions:t,dropTarget:i}=enhanceFileInput(e);i.addEventListener("dragover",(function(){this.classList.add(DRAG_CLASS)}),!1),i.addEventListener("dragleave",(function(){this.classList.remove(DRAG_CLASS)}),!1),i.addEventListener("drop",(function(a){a.preventDefault(),this.classList.remove(DRAG_CLASS);const s=a.dataTransfer;if(a.target.files=s.files,s.files.length>1)return;handleUpload(a,e,t,i);const o=new CustomEvent("change",{detail:{files:s.files}});e.dispatchEvent(o)}),!1),e.addEventListener("input",(a=>handleUpload(a,e,t,i)),!1)}))},teardown(e){selectOrMatches(INPUT,e).forEach((e=>{const t=e.parentElement.parentElement;t.parentElement.replaceChild(e,t),e.className=DROPZONE_CLASS}))},getFileInputContext:getFileInputContext,disable:disable,ariaDisable:ariaDisable,enable:enable},extensionToMimeType={".txt":"text/plain",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".odt":"application/vnd.oasis.opendocument.text",".rtf":"application/rtf",".csv":"text/csv",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".bmp":"image/bmp",".webp":"image/webp",".tif":"image/tiff",".tiff":"image/tiff",".svg":"image/svg+xml",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac",".mp4":"video/mp4",".avi":"video/x-msvideo",".mov":"video/quicktime",".wmv":"video/x-ms-wmv",".flv":"video/x-flv",".mkv":"video/x-matroska",".webm":"video/webm",".zip":"application/zip",".rar":"application/x-rar-compressed",".7z":"application/x-7z-compressed",".tar":"application/x-tar",".gz":"application/gzip",".json":"application/json",".xml":"application/xml",".html":"text/html",".htm":"text/html",".css":"text/css",".js":"application/javascript"},vaFileInputCss='button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}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 Web", "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{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.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-sr-only{position:absolute;left:-999em;right:auto}.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=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[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=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}[hidden]{display:none}:host{display:block;font-family:var(--font-source-sans);font-size:16.96px;}:host .label-header{color:var(--vads-color-base);font-weight:var(--font-weight-normal)}:host .label-header-tag{margin:0;display:inline-block}:host .file-input-wrapper{display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host .file-input{cursor:pointer;height:100%;width:100%;max-width:none;top:0;left:0;z-index:1;margin:0;position:absolute;text-indent:-999em;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target{border:1px dashed var(--vads-color-action-border-base-active-on-dark);display:block;margin-top:0.3125rem;position:relative;text-align:center;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target.file-input-target-error{border:2px dashed var(--vads-color-secondary-dark)}:host .file-input-box{background:var(--vads-color-white);height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:2}:host .file-input-instructions{font-size:1.06rem;padding:1.25rem 0.625rem;pointer-events:none;position:relative;z-index:3}:host .file-input-choose-text{color:var(--vads-color-link);text-decoration:underline;font-weight:var(--font-weight-normal)}:host .file-icon{color:var(--vads-color-primary-alt-darkest)}:host .selected-files-wrapper{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light)}:host .selected-files-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;border-bottom:1px solid var(--vads-color-white);margin-bottom:8px;padding:8px}:host .va-card{margin:8px}:host .file-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;padding:0 8px;display:block;width:100%;word-wrap:break-word;word-break:break-word;overflow:hidden}:host #input-error-message{padding:0 8px;width:100%}:host .file-size-label,:host .file-status-label{color:var(--vads-color-base-dark);font-weight:var(--font-weight-normal);font-size:1.06rem;padding:0 8px;display:block}:host .file-status-label{font-style:italic}:host .file-info-section{padding:0 8px 8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .file-button-section{margin-top:8px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:row;flex-direction:row}:host .file-button-section>va-button-icon{font-size:1.06rem}@media screen and (max-width: 320px){:host .file-button-section{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}:host .separator{border:0;border-top:1px solid var(--vads-color-base-lighter);margin:0}:host .vads-u-line-height--2{line-height:1.15}:host .thumbnail-container{height:40px;width:40px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .thumbnail-preview{max-width:40px;width:auto;max-height:40px;height:auto}:host .thumbnail-error{color:#b21d38}:host va-progress-bar{font-size:var(--vads-font-size-root);display:block;margin-left:16px}:host .uploading-status{font-style:var(--font-style-italic)}:host(.has-error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host(.has-error){margin-left:-0.9rem}}.required{color:var(--vads-color-secondary-dark);margin-left:0.25rem}h1 .required,h2 .required,h3 .required,h4 .required,h5 .required,h6 .required{font-family:var(--font-source-sans);font-size:initial;font-weight:initial}',VaFileInputStyle0=vaFileInputCss,VaFileInput=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaChange=createEvent(this,"vaChange",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.uploadStatus="idle",this.handleChange=e=>{const t=e.target;t.files&&t.files.length>0&&this.handleFile(t.files[0]),t.value=""},this.handleDrop=e=>{e.preventDefault(),e.stopPropagation();const t=e.dataTransfer.files;t.length>0&&this.handleFile(t[0])},this.handleFile=(e,t=!0)=>{if(this.accept){const t=this.normalizeAcceptProp(this.accept);if(!this.isAcceptedFileType(e.type,t))return this.removeFile(!1),void(this.internalError="This is not a valid file type.")}if(e.size>this.maxFileSize)return this.internalError=`\n We can't upload your file because it's too big. Files must be less than ${this.formatFileSize(this.maxFileSize)}.`,this.fileContents=null,void(this.uploadStatus="idle");this.uploadedFile=null,this.file=e,t&&this.vaChange.emit({files:[this.file]}),this.uploadStatus="success",this.internalError=null,this.generateFileContents(this.file),this.updateStatusMessage(`You have selected the file: ${this.file.name}`),this.el.focus(),this.enableAnalytics&&this.componentLibraryAnalytics.emit({componentName:"va-file-input",action:"change",details:{label:this.label}})},this.removeFile=(e=!0)=>{this.closeModal(),this.uploadStatus="idle",this.internalError=null,e&&this.vaChange.emit({files:[]}),this.file=null,this.uploadedFile=null,this.updateStatusMessage("File removed. No file selected."),this.el.focus()},this.openModal=()=>{this.el.shadowRoot.querySelector("va-modal").setAttribute("status","warning"),this.showModal=!0},this.closeModal=()=>{this.showModal=!1,setTimeout((()=>{this.fileInputRef.focus()}),0)},this.changeFile=()=>{this.fileInputRef&&this.fileInputRef.click()},this.formatFileSize=e=>{const t=["B","KB","MB","GB","TB"];if(0===e)return"0 B";const i=Math.floor(Math.log(e)/Math.log(1024));return 0===i?`${e} ${t[i]}`:`${(e/Math.pow(1024,i)).toFixed(i<2?0:1)} ${t[i]}`},this.normalizeAcceptProp=e=>e.split(",").map((e=>(e=e.trim()).startsWith(".")?extensionToMimeType[e]:e)),this.isAcceptedFileType=(e,t)=>{for(const i of t){if(i===e)return!0;if(i.endsWith("/*")&&e.startsWith(i.slice(0,-1)))return!0}return!1},this.renderLabelOrHeader=(e,t,i)=>{const a=t?h("span",{class:"required"}," ",instance.t("required")):null;return h("div",{class:"label-header"},i&&i>=1&&i<=6?h(`h${i}`,{htmlFor:"fileInputField",part:"label",class:"label-header-tag"},e,a):h("label",{htmlFor:"fileInputField",part:"label",class:"usa-label"},e,a))},this.file=void 0,this.fileContents=void 0,this.internalError=void 0,this.showModal=!1,this.showSeparator=!0,this.label=void 0,this.name=void 0,this.buttonText=void 0,this.value=void 0,this.required=!1,this.accept=void 0,this.error=void 0,this.hint=void 0,this.statusText=void 0,this.uploadMessage=null,this.enableAnalytics=!1,this.headerSize=void 0,this.headless=!1,this.readOnly=!1,this.uploadedFile=void 0,this.maxFileSize=1/0,this.percentUploaded=null}handleValueChange(e){setTimeout((()=>{this.updateStatusMessage(e)}))}percentHandler(e){e>=100&&this.resetState()}resetState(){this.fileContents=null,this.uploadStatus="idle",this.percentUploaded=null,forceUpdate(this.el)}updateStatusMessage(e){setTimeout((()=>{const t=this.el.shadowRoot.querySelector("#statusMessage");t&&(t.textContent=e)}),1e3)}generateFileContents(e){if(!e)return;const t=new FileReader;this.fileType=e.type,t.onloadend=()=>{this.fileContents=t.result},this.fileType&&("application/pdf"===this.fileType||this.fileType.startsWith("image/"))&&t.readAsDataURL(e)}componentWillRender(){const e=!!this.el.querySelector(":scope > *"),t=!(!this.value&&!this.file||this.readOnly);this.showSeparator=e||t}componentDidLoad(){fileInput.init(this.el)}connectedCallback(){this.el.addEventListener("change",this.handleChange)}disconnectedCallback(){this.el.removeEventListener("change",this.handleChange)}getDefaultUploadMessage(){return h("span",null,"Drag a file here or"," ",h("span",{class:"file-input-choose-text"},"choose from folder"))}render(){const{label:e,name:t,required:i,accept:a,error:s,hint:o,file:n,uploadStatus:r,uploadMessage:l,headerSize:d,fileContents:c,fileType:f,headless:p,value:u,readOnly:m,statusText:b,uploadedFile:g,percentUploaded:v}=this;u&&!this.file&&this.handleFile(u,!1);const S=this.error||this.internalError,E=`${o?"input-hint-message":""} ${S?"input-error-message":""}`.trim()||null,A=("file-input-target "+(S?"file-input-target-error":"")).trim();let _=h("div",{key:"9f8e203689fa7f65274910db83f9112c9cef19c9",class:"thumbnail-container"},h("svg",{key:"eb2928461ad5bd4f31d53743402136f827de9617",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"#07648d",width:"40px",height:"40px"},h("path",{key:"41df5984f061868da2f9d4a6665a440636f0ffbd",d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"})));s?_=h("div",{key:"381162923cb4530bd297371816ccfc39a318f43f",class:"thumbnail-container"},h("va-icon",{key:"3a3da39e02945a0a0880e06ba33ea66ee2e4b22b",icon:"error",size:3,class:"thumbnail-preview thumbnail-error"})):c&&(f.startsWith("image/")?_=h("div",{key:"d1bfc7717fc9088b2db1b20aa14985eb42c4fb5e",class:"thumbnail-container","aria-hidden":"true"},h("img",{key:"7ffe772b516bc71e325d57df21bd96ff38c991a2",class:"thumbnail-preview",src:c,alt:"image"})):"application/pdf"===f&&(_=h("div",{key:"b4cb552b8f013e694098b9d6b0f12916657562d9",class:"thumbnail-container","aria-hidden":"true"},h("object",{key:"aeaa42b5ac428f677864206f7ee6e0d9614e8f5b",class:"thumbnail-preview",data:c,type:"application/pdf"}))));let C=p?"headless-selected-files-wrapper":"selected-files-wrapper";const x="usa-hint"+(p?" usa-sr-only":""),y=null!==v&&v<100;let L="file-status-label";return y&&(L=`${L} uploading-status`),h(Host,{key:"6c9b48b477fded6ed4354d6cda17a9229a7acf13",class:{"has-error":!!S}},!m&&h("span",{key:"c9d49d56d016277e124612b73d5545c0b81d7dcc",class:{"usa-sr-only":!!p}},e&&this.renderLabelOrHeader(e,i,d)),o&&!m&&h("div",{key:"377b5fbd3bdfb3690a4ca62321e0fc4d0b3ba9ce",class:x,id:"input-hint-message"},o),h("div",{key:"e96b7756754bf33b2e7b70bf2f604a0503af45ca",class:"file-input-wrapper",onDrop:this.handleDrop},h("input",{key:"a959904f8a3963d11bd9467ede7c05350ee521e1",id:"fileInputField",class:"file-input",style:{visibility:"success"===this.uploadStatus||g?"hidden":"unset"},type:"file",ref:e=>this.fileInputRef=e,name:t,accept:a,"aria-describedby":E,onChange:this.handleChange}),"idle"===r&&!g&&h("div",{key:"0fdf14f29b2b96d73b32f518b6b44425280a11bf"},h("span",{key:"da6b8276f2e20bce2d8a2a782db6a955eaca9a41",id:"file-input-error-alert",role:"alert"},S&&h(Fragment,{key:"be5b28b5bbdce252918190b1e144d7643832acda"},h("span",{key:"71940d34379ef6fc82f090a83c04a7a8a51f4b18",class:"usa-sr-only"},instance.t("error")),h("span",{key:"21716b6500017aa5eb70cad474df7517c6dcbfd1",class:"usa-error-message"},S))),h("div",{key:"5053f27dec8c14d782aad5563423fad9748d6223",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("div",{key:"45b912aaddfb6252c1def9307f2bb75f68238837",class:A},h("div",{key:"ea6161c7e84ac98addeaf190e8985b146ee2be89",class:"file-input-box"}),h("div",{key:"7ba29054f1e665e823abc5c2505f3dd6572f61ee",class:"file-input-instructions"},l||this.getDefaultUploadMessage()))),("idle"!==r||g)&&h("div",{key:"c2dc6962183a87cd8480f50619c9401e8bc146b9",class:C},!p&&h("div",{key:"70aedc0fc485a9755a9df59011b9edff09012d00",class:"selected-files-label"},m?"Files you uploaded":"Selected files"),h("div",{key:"2ca9e11dabf4ce8e38202ac3d2af413a43500eab",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("va-card",{key:"43be7636f45de6c82c58d7c2e90ed608adefd48c",class:"va-card"},h("div",{key:"d029783a2cabaed5a4b0623af860bcd97e8f1581",class:"file-info-section"},_,h("div",{key:"9a59e620e4abe4239ca5206b3824f10b9c3b57bc",class:"file-info-group vads-u-line-height--2"},h("span",{key:"fab0ec83c61ee5990ed807b753ed8c8c644813d1",class:"file-label"},n?n.name:g.name),S&&h("span",{key:"88b64ef06647bc2d76f589f42676d93c4056f429",id:"input-error-message",role:"alert"},h("span",{key:"2fecacff9dd9cffc0a47cde2b4fb86534529ec84",class:"usa-sr-only"},instance.t("error")),h("span",{key:"5dc5a761ee24f6b6a9c35bae9d3b8065cc8ad5d9","aria-live":"polite",class:"usa-error-message"},S)),!y&&h("span",{key:"2e40a6745ed843f6bf14094a22023f16529bae07",class:"file-size-label"},this.formatFileSize(n?n.size:g.size)),h("span",{key:"bd8990d4b0a416aa05ba23ed191d4aec38496e54",class:L,"aria-live":"polite"},y?"Uploading...":b))),(n||u||g)&&h("div",{key:"6e1b33f562b177edb347cec51b6c702a1147f0e7"},this.showSeparator&&h("hr",{key:"8c69afe1585d3b370d362b7c96e5ad2ee2b06a09",class:"separator"}),h("div",{key:"645ea76fa95616b4c67a5810cb1b39f7fa2ca0e2",class:"additional-info-slot"},h("slot",{key:"47e3afff538273690a94ccc22b298c93a45ff7cc"})),m?null:y?h(Fragment,null,h("va-progress-bar",{percent:v}),h("va-button-icon",{buttonType:"cancel",onClick:this.resetState.bind(this)})):h(Fragment,null,h("div",{class:"file-button-section"},h("va-button-icon",{buttonType:"change-file",onClick:this.changeFile,label:"Change file","aria-label":`change file ${n?n.name:g.name}`}),h("va-button-icon",{buttonType:"delete",onClick:this.openModal,"aria-label":`delete file ${n?n.name:g.name}`,label:"Delete"})),h("va-modal",{modalTitle:"Delete this file?",visible:this.showModal,primaryButtonText:"Yes, remove this",secondaryButtonText:"No, keep this",onCloseEvent:this.closeModal,onPrimaryButtonClick:()=>this.removeFile(!0),onSecondaryButtonClick:this.closeModal},"We'll remove the uploaded document"," ",h("span",{class:"file-label"},n?n.name:g.name))))))))}get el(){return this}static get watchers(){return{statusText:["handleValueChange"],percentUploaded:["percentHandler"]}}static get style(){return VaFileInputStyle0}},[1,"va-file-input",{label:[1],name:[1],buttonText:[1,"button-text"],value:[16],required:[4],accept:[1],error:[1],hint:[1],statusText:[1,"status-text"],uploadMessage:[16],enableAnalytics:[4,"enable-analytics"],headerSize:[2,"header-size"],headless:[4],readOnly:[4,"read-only"],uploadedFile:[16],maxFileSize:[2,"max-file-size"],percentUploaded:[1026,"percent-uploaded"],file:[32],fileContents:[32],internalError:[32],showModal:[32],showSeparator:[32]},void 0,{statusText:["handleValueChange"],percentUploaded:["percentHandler"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-file-input","va-button","va-button-icon","va-card","va-icon","va-modal","va-progress-bar"].forEach((e=>{switch(e){case"va-file-input":customElements.get(e)||customElements.define(e,VaFileInput);break;case"va-button":customElements.get(e)||defineCustomElement$6();break;case"va-button-icon":customElements.get(e)||defineCustomElement$5();break;case"va-card":customElements.get(e)||defineCustomElement$4();break;case"va-icon":customElements.get(e)||defineCustomElement$3();break;case"va-modal":customElements.get(e)||defineCustomElement$2();break;case"va-progress-bar":customElements.get(e)||defineCustomElement$1()}}))}export{VaFileInput as V,defineCustomElement as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{d as defineCustomElement$7}from"./va-button2.js";import{d as defineCustomElement$6}from"./va-crisis-line-modal2.js";import{d as defineCustomElement$5}from"./va-icon2.js";import{d as defineCustomElement$4}from"./va-modal2.js";import{d as defineCustomElement$3}from"./va-official-gov-banner2.js";import{d as defineCustomElement$2}from"./va-telephone2.js";const vaSealSvg="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1Ny42IDM1LjIiIHJvbGU9ImltZyI+PHRpdGxlPlZBPC90aXRsZT48ZyBmaWxsPSIjRkZGIj48cGF0aCBkPSJNMTEuMSAzNS4yTDAgMGg4LjZsNC4yIDE0LjljMS4yIDQuMiAyLjIgOC4yIDMuMSAxMi42aC4xYy45LTQuMiAxLjktOC40IDMuMS0xMi40TDIzLjUgMGg4LjNMMjAuMiAzNS4yaC05LjF6TTM2LjYgMjYuMmwtMi41IDloLThMMzYuNiAwaDEwLjJsMTAuOCAzNS4yaC04LjVsLTIuNy05aC05Ljh6bTguOC02bC0yLjItNy41Yy0uNi0yLjEtMS4yLTQuNy0xLjctNi44aC0uMWMtLjUgMi4xLTEgNC44LTEuNiA2LjhsLTIgNy41aDcuNnoiPjwvcGF0aD48L2c+PC9zdmc+",vaHeaderMinimalCss=".va-header{display:-ms-flexbox;display:flex;margin-left:auto;margin-right:auto;max-width:1000px;background-color:var(--vads-color-primary-darker);color:var(--vads-button-color-text-primary-alt-on-light);-ms-flex-align:center;align-items:center;padding:10px 8px;line-height:22px}@media (min-width: 481px){.va-header{padding:10px 16px}}.va-logo-link:focus{outline:2px solid var(--vads-color-action-focus-on-light)}.va-logo{margin-right:8px;min-height:30px;min-width:48px}@media (min-width: 481px){.va-logo{margin-right:16px}}.header-container{padding-left:8px;border-left:1px solid var(--vads-color-white)}@media (min-width: 481px){.header-container{padding-left:16px}}.header-container h1,.header-container .header{font-size:20px;margin:0;font-weight:700}.header-container h2,.header-container .subheader{font-size:20px;margin:0;font-weight:100}@media (min-width: 1008px){va-crisis-line-modal::part(button){position:absolute;right:0;bottom:-5px}}",VaHeaderMinimalStyle0=vaHeaderMinimalCss,VaHeaderMinimal$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.shifted=!1,this.header=void 0,this.subheader=void 0,this.enableHeadings=!1}trackShiftKey(e){this.shifted=e.shiftKey}trapFocus(){var e;const a=null===(e=this.el)||void 0===e?void 0:e.shadowRoot.querySelector("va-crisis-line-modal").shadowRoot.querySelector("va-modal"),t=null==a?void 0:a.getAttribute("visible");if(null!==t&&"false"!==t){let e;const t=this.shifted?".last-focusable-child":".va-modal-close";e=this.shifted?null==a?void 0:a.querySelector(t):null==a?void 0:a.shadowRoot.querySelector(t),null==e||e.focus()}}render(){const{header:e,subheader:a,enableHeadings:t}=this;return h(Host,{key:"
|
|
1
|
+
import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{d as defineCustomElement$7}from"./va-button2.js";import{d as defineCustomElement$6}from"./va-crisis-line-modal2.js";import{d as defineCustomElement$5}from"./va-icon2.js";import{d as defineCustomElement$4}from"./va-modal2.js";import{d as defineCustomElement$3}from"./va-official-gov-banner2.js";import{d as defineCustomElement$2}from"./va-telephone2.js";const vaSealSvg="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1Ny42IDM1LjIiIHJvbGU9ImltZyI+PHRpdGxlPlZBPC90aXRsZT48ZyBmaWxsPSIjRkZGIj48cGF0aCBkPSJNMTEuMSAzNS4yTDAgMGg4LjZsNC4yIDE0LjljMS4yIDQuMiAyLjIgOC4yIDMuMSAxMi42aC4xYy45LTQuMiAxLjktOC40IDMuMS0xMi40TDIzLjUgMGg4LjNMMjAuMiAzNS4yaC05LjF6TTM2LjYgMjYuMmwtMi41IDloLThMMzYuNiAwaDEwLjJsMTAuOCAzNS4yaC04LjVsLTIuNy05aC05Ljh6bTguOC02bC0yLjItNy41Yy0uNi0yLjEtMS4yLTQuNy0xLjctNi44aC0uMWMtLjUgMi4xLTEgNC44LTEuNiA2LjhsLTIgNy41aDcuNnoiPjwvcGF0aD48L2c+PC9zdmc+",vaHeaderMinimalCss=".va-header{display:-ms-flexbox;display:flex;margin-left:auto;margin-right:auto;max-width:1000px;background-color:var(--vads-color-primary-darker);color:var(--vads-button-color-text-primary-alt-on-light);-ms-flex-align:center;align-items:center;padding:10px 8px;line-height:22px}@media (min-width: 481px){.va-header{padding:10px 16px}}.va-logo-link:focus{outline:2px solid var(--vads-color-action-focus-on-light)}.va-logo{margin-right:8px;min-height:30px;min-width:48px}@media (min-width: 481px){.va-logo{margin-right:16px}}.header-container{padding-left:8px;border-left:1px solid var(--vads-color-white)}@media (min-width: 481px){.header-container{padding-left:16px}}.header-container h1,.header-container .header{font-size:20px;margin:0;font-weight:700}.header-container h2,.header-container .subheader{font-size:20px;margin:0;font-weight:100}@media (min-width: 1008px){va-crisis-line-modal::part(button){position:absolute;right:0;bottom:-5px}}",VaHeaderMinimalStyle0=vaHeaderMinimalCss,VaHeaderMinimal$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.shifted=!1,this.header=void 0,this.subheader=void 0,this.enableHeadings=!1}trackShiftKey(e){this.shifted=e.shiftKey}trapFocus(){var e;const a=null===(e=this.el)||void 0===e?void 0:e.shadowRoot.querySelector("va-crisis-line-modal").shadowRoot.querySelector("va-modal"),t=null==a?void 0:a.getAttribute("visible");if(null!==t&&"false"!==t){let e;const t=this.shifted?".last-focusable-child":".va-modal-close";e=this.shifted?null==a?void 0:a.querySelector(t):null==a?void 0:a.shadowRoot.querySelector(t),null==e||e.focus()}}render(){const{header:e,subheader:a,enableHeadings:t}=this;return h(Host,{key:"de6ef144d4f44b7b21319ee9500274b48e294dfd",role:"banner"},h("va-official-gov-banner",{key:"579da9295024a5605162e2591f1eb6ba12b8a098"}),h("va-crisis-line-modal",{key:"fb9d5ae72e3037cfece2cbfc0eb16951ce94f7e6"}),h("div",{key:"168a6172790ef34e6efca39a0bfce58b9e3d670f",onFocusin:()=>this.trapFocus(),class:"va-header"},h("a",{key:"3db676d77c032470718306337d662b38d6589f90",href:"/",title:"Go to VA.gov",class:"va-logo-link"},h("img",{key:"d41fd05286d3fca0d38549639cec8d29627fc9f0",class:"va-logo",src:vaSealSvg,alt:"VA logo and Seal, U.S. Department of Veterans Affairs"})),h("div",{key:"9a3ce33c9dee2afd43c310fd76d303ef472d74a3",class:"header-container"},t?h("h1",null,e):h("div",{class:"header"},e),a&&(t?h("h2",null,a):h("div",{class:"subheader"},a)))))}get el(){return this}static get style(){return VaHeaderMinimalStyle0}},[1,"va-header-minimal",{header:[1],subheader:[1],enableHeadings:[4,"enable-headings"],shifted:[32]},[[8,"keydown","trackShiftKey"]]]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-header-minimal","va-button","va-crisis-line-modal","va-icon","va-modal","va-official-gov-banner","va-telephone"].forEach((e=>{switch(e){case"va-header-minimal":customElements.get(e)||customElements.define(e,VaHeaderMinimal$1);break;case"va-button":customElements.get(e)||defineCustomElement$7();break;case"va-crisis-line-modal":customElements.get(e)||defineCustomElement$6();break;case"va-icon":customElements.get(e)||defineCustomElement$5();break;case"va-modal":customElements.get(e)||defineCustomElement$4();break;case"va-official-gov-banner":customElements.get(e)||defineCustomElement$3();break;case"va-telephone":customElements.get(e)||defineCustomElement$2()}}))}const VaHeaderMinimal=VaHeaderMinimal$1,defineCustomElement=defineCustomElement$1;export{VaHeaderMinimal,defineCustomElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{c as consoleDevError}from"./utils.js";const vaIconCss=".usa-icon{display:inline-block;fill:currentColor;height:1em;position:relative;width:1em}.usa-icon--size-3{height:1.5rem;width:1.5rem}.usa-icon--size-4{height:2rem;width:2rem}.usa-icon--size-5{height:2.5rem;width:2.5rem}.usa-icon--size-6{height:3rem;width:3rem}.usa-icon--size-7{height:3.5rem;width:3.5rem}.usa-icon--size-8{height:4rem;width:4rem}.usa-icon--size-9{height:4.5rem;width:4.5rem}:host{display:inline-block;line-height:0;vertical-align:bottom}",VaIconStyle0=vaIconCss,VaIcon=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=void 0,this.size=void 0,this.srtext=void 0}getSize(){return this.size&&![3,4,5,6,7,8,9].includes(this.size)?(consoleDevError("Size must be an integer between 3 and 9, inclusive."),null):this.size}render(){const{icon:e,srtext:i}=this,t=this.getSize(),s=classnames({"usa-icon":!0,[`usa-icon--size-${t}`]:!!t}),n=`/img/sprite.svg#${e}`;return h(Host,{key:"
|
|
1
|
+
import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{c as consoleDevError}from"./utils.js";const vaIconCss=".usa-icon{display:inline-block;fill:currentColor;height:1em;position:relative;width:1em}.usa-icon--size-3{height:1.5rem;width:1.5rem}.usa-icon--size-4{height:2rem;width:2rem}.usa-icon--size-5{height:2.5rem;width:2.5rem}.usa-icon--size-6{height:3rem;width:3rem}.usa-icon--size-7{height:3.5rem;width:3.5rem}.usa-icon--size-8{height:4rem;width:4rem}.usa-icon--size-9{height:4.5rem;width:4.5rem}:host{display:inline-block;line-height:0;vertical-align:bottom}",VaIconStyle0=vaIconCss,VaIcon=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=void 0,this.size=void 0,this.srtext=void 0}getSize(){return this.size&&![3,4,5,6,7,8,9].includes(this.size)?(consoleDevError("Size must be an integer between 3 and 9, inclusive."),null):this.size}render(){const{icon:e,srtext:i}=this,t=this.getSize(),s=classnames({"usa-icon":!0,[`usa-icon--size-${t}`]:!!t}),n=`/img/sprite.svg#${e}`;return h(Host,{key:"76ae81158304b7f866203868a1cbdc7ca25eaec7"},h("svg",{key:"60ad891eec64faf5bcdacaed97c561862b40edc9",class:s,"aria-labelledby":i?"icon-title":null,"aria-hidden":i?null:"true",focusable:"false",role:"img"},i&&h("title",{key:"aeb9893f765567aa1d26b95f561adb8249915799",id:"icon-title"},i),h("use",{key:"69b0f269018f6def95752318a0be741881fd6eac",href:n})))}static get assetsDirs(){return["../img"]}static get style(){return VaIconStyle0}},[1,"va-icon",{icon:[1],size:[2],srtext:[1]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-icon"].forEach((e=>{"va-icon"===e&&(customElements.get(e)||customElements.define(e,VaIcon))}))}export{VaIcon as V,defineCustomElement as d};
|
|
@@ -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$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-link2.js";const vaLanguageToggleCss=":host div{display:inline-block
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-link2.js";const vaLanguageToggleCss=":host div{display:inline-block}:host div div.inner-div{border-right:1px solid var(--vads-color-base-light);padding-right:8px;margin-right:8px}:host div a.is-current-lang{font-weight:var(--font-weight-bold);color:var(--vads-color-black);text-decoration:none;padding-top:10px;padding-bottom:16px}:host div a.is-current-lang:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}:host div va-link{color:var(--vads-color-link);padding-bottom:2px;border-bottom:1px solid var(--vads-color-link)}:host div va-link::part(anchor){text-decoration:none;padding-top:10px;padding-bottom:16px}",VaLanguageToggleStyle0=vaLanguageToggleCss,VaLanguageToggle$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaLanguageToggle=createEvent(this,"vaLanguageToggle",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.language="en",this.enHref=void 0,this.esHref=void 0,this.tlHref=void 0,this.urls=void 0,this.routerLinks=!1}getUrl(e){const t=new URL(window.location.href);return t.searchParams.set("lang",e),t.href}handleToggle(e,t,a){this.routerLinks&&(e.preventDefault(),window.history.replaceState(null,null,this.getUrl(t)),this.language=t),this.vaLanguageToggle.emit({language:t});const n={componentName:"va-language-toggle",action:"linkClick",details:{"pipe-delimited-list-header":t,label:a}};this.componentLibraryAnalytics.emit(n)}componentWillLoad(){this.urls=[{label:"English",lang:"en",href:this.enHref}],this.esHref&&(this.urls=[...this.urls,{label:"Español",lang:"es",href:this.esHref}]),this.tlHref&&(this.urls=[...this.urls,{label:"Tagalog",lang:"tl",href:this.tlHref}])}render(){const{language:e,urls:t}=this;return h(Host,{key:"9ed0b54e752d60f6e5361c64fe570cade1f55e62"},h("div",{key:"4521328e3439b79f4579b6a7202881f2f62646a1",role:"group","aria-label":"Language selection"},t.map((({href:a,lang:n,label:l},s)=>{const o=classnames({"is-current-lang":n===e}),i=classnames({"inner-div":s<t.length-1});return h("div",{class:i},n===e?h("a",{class:o,href:a,hrefLang:n,onClick:e=>this.handleToggle(e,n,l),"aria-current":"language"},l):h("va-link",{class:o,href:a,language:n,onClick:e=>this.handleToggle(e,n,l),text:l,disableAnalytics:!0}))}))))}static get style(){return VaLanguageToggleStyle0}},[1,"va-language-toggle",{language:[1025],enHref:[1,"en-href"],esHref:[1,"es-href"],tlHref:[1,"tl-href"],routerLinks:[4,"router-links"],urls:[32]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-language-toggle","va-icon","va-link"].forEach((e=>{switch(e){case"va-language-toggle":customElements.get(e)||customElements.define(e,VaLanguageToggle$1);break;case"va-icon":customElements.get(e)||defineCustomElement$3();break;case"va-link":customElements.get(e)||defineCustomElement$2()}}))}const VaLanguageToggle=VaLanguageToggle$1,defineCustomElement=defineCustomElement$1;export{VaLanguageToggle,defineCustomElement};
|
|
@@ -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$2}from"./va-icon2.js";const vaLinkActionCss="/* From the USWDS styles: */\n/* https://github.com/uswds/uswds/blob/3dc296ec56cd621fe52d918701fd94621d96a198/src/stylesheets/core/mixins/_focus.scss#L12-L13 */\nbutton:not([disabled]):focus,\nselect:not([disabled]):focus,\na:not([disabled]):focus,\nh1:focus,\ninput:not([disabled]):focus,\ntextarea:not([disabled]):focus,\n#form-question\n[role='option']:focus,\n*[tabindex]:focus {\n outline: 2px solid var(--vads-color-action-focus-on-light);\n outline-offset: 2px;\n}\n\n\na {\n text-decoration: none;\n color: var(--vads-color-link);\n -webkit-transition-duration: 0.3s;\n transition-duration: 0.3s;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n -webkit-transition-property: color, background-color, border-color;\n transition-property: color, background-color, border-color;\n}\n\na:hover {\n background-color: rgba(0, 0, 0, 0.05);\n color: inherit;\n}\n\na:visited {\n color: var(--vads-color-link-visited);\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute !important;\n width: 1px;\n /* Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1241631 */\n word-wrap: normal !important;\n}\n\n\n:host {\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n\n:host a {\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-align: start;\n align-items: flex-start;\n cursor: pointer;\n text-decoration: underline;\n font-weight: 700;\n font-size: 1.06rem;\n padding: 0.5rem 0;\n &:active {\n outline: 2px solid var(--vads-color-action-focus-on-light);\n outline-offset: 2px;\n }\n}\n\n:host a.va-link--primary,\n:host a.va-link--secondary {\n &:hover, &:active {\n color: var(--vads-color-link) !important;\n }\n}\n\n:host a.va-link--reverse {\n color: var(--vads-color-white);\n\n &:hover, &:active {\n color: var(--vads-color-action-focus-on-light);\n background-color: transparent;\n }\n}\n\n:host a.va-link--reverse va-icon {\n &:hover, &:active {\n background-color: var(--vads-color-action-focus-on-light);\n }\n}\n\n.link-icon--left {\n margin-right: 8px;\n vertical-align: baseline;\n position: relative;\n}\n\n.link-icon {\n border-radius: 50%;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n color: white;\n -webkit-transition-duration: 0.3s;\n transition-duration: 0.3s;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n -webkit-transition-property: color, background-color, border-color;\n transition-property: color, background-color, border-color;\n}\n\n.va-link--primary {\n va-icon {\n background-color: var(--vads-color-success-dark);\n }\n}\n\n.va-link--secondary {\n va-icon {\n background-color: var(--vads-color-primary);\n }\n}\n\n.link-icon--reverse {\n background-color: var(--vads-color-white);\n color: var(--vads-color-black);\n}\n\n:host a.va-link--reverse:hover va-icon,\n:host a.va-link--reverse:active va-icon {\n background-color: var(--vads-color-action-focus-on-light) !important;\n}\n\n.link-text {\n display: inline-block;\n vertical-align: top;\n max-width: calc(100% - 24px);\n white-space: pre-wrap;\n}",VaLinkActionStyle0=vaLinkActionCss,VaLinkAction$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleClick=n=>{if(!this.disableAnalytics){const n={componentName:"va-link-action",action:"click",details:{label:this.text,destination:this.href,origin:window.location.href}};this.componentLibraryAnalytics.emit(n)}},this.disableAnalytics=!1,this.href=void 0,this.text=void 0,this.messageAriaDescribedby=void 0,this.type="primary",this.label=void 0,this.isSingleLine=!0}componentWillLoad(){this.checkTextLines()}checkTextLines(){if(this.linkRef){const n=getComputedStyle(this.linkRef),i=parseFloat(n.lineHeight),e=this.linkRef.clientHeight;this.isSingleLine=e<=i}}render(){const{handleClick:n,href:i,text:e,messageAriaDescribedby:o,type:t,label:a}=this,s=classnames({"va-link--reverse":"reverse"===t,"va-link--primary":"primary"===t,"va-link--secondary":"secondary"===t}),r=classnames("link-icon--left","link-icon",{"link-icon--reverse":"reverse"===t});return h(Host,{key:"
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$2}from"./va-icon2.js";const vaLinkActionCss="/* From the USWDS styles: */\n/* https://github.com/uswds/uswds/blob/3dc296ec56cd621fe52d918701fd94621d96a198/src/stylesheets/core/mixins/_focus.scss#L12-L13 */\nbutton:not([disabled]):focus,\nselect:not([disabled]):focus,\na:not([disabled]):focus,\nh1:focus,\ninput:not([disabled]):focus,\ntextarea:not([disabled]):focus,\n#form-question\n[role='option']:focus,\n*[tabindex]:focus {\n outline: 2px solid var(--vads-color-action-focus-on-light);\n outline-offset: 2px;\n}\n\n\na {\n text-decoration: none;\n color: var(--vads-color-link);\n -webkit-transition-duration: 0.3s;\n transition-duration: 0.3s;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n -webkit-transition-property: color, background-color, border-color;\n transition-property: color, background-color, border-color;\n}\n\na:hover {\n background-color: rgba(0, 0, 0, 0.05);\n color: inherit;\n}\n\na:visited {\n color: var(--vads-color-link-visited);\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute !important;\n width: 1px;\n /* Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1241631 */\n word-wrap: normal !important;\n}\n\n\n:host {\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n\n:host a {\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-align: start;\n align-items: flex-start;\n cursor: pointer;\n text-decoration: underline;\n font-weight: 700;\n font-size: 1.06rem;\n padding: 0.5rem 0;\n &:active {\n outline: 2px solid var(--vads-color-action-focus-on-light);\n outline-offset: 2px;\n }\n}\n\n:host a.va-link--primary,\n:host a.va-link--secondary {\n &:hover, &:active {\n color: var(--vads-color-link) !important;\n }\n}\n\n:host a.va-link--reverse {\n color: var(--vads-color-white);\n\n &:hover, &:active {\n color: var(--vads-color-action-focus-on-light);\n background-color: transparent;\n }\n}\n\n:host a.va-link--reverse va-icon {\n &:hover, &:active {\n background-color: var(--vads-color-action-focus-on-light);\n }\n}\n\n.link-icon--left {\n margin-right: 8px;\n vertical-align: baseline;\n position: relative;\n}\n\n.link-icon {\n border-radius: 50%;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n color: white;\n -webkit-transition-duration: 0.3s;\n transition-duration: 0.3s;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n -webkit-transition-property: color, background-color, border-color;\n transition-property: color, background-color, border-color;\n}\n\n.va-link--primary {\n va-icon {\n background-color: var(--vads-color-success-dark);\n }\n}\n\n.va-link--secondary {\n va-icon {\n background-color: var(--vads-color-primary);\n }\n}\n\n.link-icon--reverse {\n background-color: var(--vads-color-white);\n color: var(--vads-color-black);\n}\n\n:host a.va-link--reverse:hover va-icon,\n:host a.va-link--reverse:active va-icon {\n background-color: var(--vads-color-action-focus-on-light) !important;\n}\n\n.link-text {\n display: inline-block;\n vertical-align: top;\n max-width: calc(100% - 24px);\n white-space: pre-wrap;\n}",VaLinkActionStyle0=vaLinkActionCss,VaLinkAction$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleClick=n=>{if(!this.disableAnalytics){const n={componentName:"va-link-action",action:"click",details:{label:this.text,destination:this.href,origin:window.location.href}};this.componentLibraryAnalytics.emit(n)}},this.disableAnalytics=!1,this.href=void 0,this.text=void 0,this.messageAriaDescribedby=void 0,this.type="primary",this.label=void 0,this.isSingleLine=!0}componentWillLoad(){this.checkTextLines()}checkTextLines(){if(this.linkRef){const n=getComputedStyle(this.linkRef),i=parseFloat(n.lineHeight),e=this.linkRef.clientHeight;this.isSingleLine=e<=i}}render(){const{handleClick:n,href:i,text:e,messageAriaDescribedby:o,type:t,label:a}=this,s=classnames({"va-link--reverse":"reverse"===t,"va-link--primary":"primary"===t,"va-link--secondary":"secondary"===t}),r=classnames("link-icon--left","link-icon",{"link-icon--reverse":"reverse"===t});return h(Host,{key:"4584ee0a888b8664504102fd20da3d66fba77f0a"},h("a",{key:"d4d32bccb2d212ce902d6f2855d394f02d04145d",href:i,class:s,"aria-label":a,"aria-describedby":o?"link-description":null,onClick:n,ref:n=>this.linkRef=n},h("va-icon",{key:"9acee388afd5c8e1776f8aab737142a4a2725b8e",class:r,icon:"chevron_right",size:3}),h("span",{key:"494a453a5f74615800825899fe2142bf7c7b6b11",class:"link-text"},e)),o&&h("span",{key:"736c963ea80ff59a78fe1547248c5bf66f7e64bb",id:"link-description",class:"sr-only"},o))}static get watchers(){return{text:["checkTextLines"]}}static get style(){return VaLinkActionStyle0}},[1,"va-link-action",{disableAnalytics:[4,"disable-analytics"],href:[1],text:[1],messageAriaDescribedby:[1,"message-aria-describedby"],type:[1],label:[1],isSingleLine:[32]},void 0,{text:["checkTextLines"]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-link-action","va-icon"].forEach((n=>{switch(n){case"va-link-action":customElements.get(n)||customElements.define(n,VaLinkAction$1);break;case"va-icon":customElements.get(n)||defineCustomElement$2()}}))}const VaLinkAction=VaLinkAction$1,defineCustomElement=defineCustomElement$1;export{VaLinkAction,defineCustomElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";var isChromatic=function(t){const e=t||"undefined"!=typeof window&&window;return!(!e||!e.navigator.userAgent.match(/Chromatic/)&&!e.location.href.match(/chromatic=true/))};const vaLoadingIndicatorCss=":host{display:block;font-size:1.06rem;text-align:center}.loading-indicator{display:block;height:4rem;margin-top:1rem}.loading-indicator:after{content:' ';display:inline-block;width:2.1875rem;height:2.1875rem;margin:1px;border-radius:50%;border:8px solid var(--vads-color-primary);border-color:var(--vads-color-primary) transparent var(--vads-color-primary)\n transparent;-webkit-animation:spin 1.5s linear infinite;animation:spin 1.5s linear infinite}.loading-indicator.chromatic:after{-webkit-animation:none;animation:none}.loading-indicator:focus{outline:none}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}",VaLoadingIndicatorStyle0=vaLoadingIndicatorCss,VaLoadingIndicator$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.loadingStartTime=null,this.observer=null,this.message=void 0,this.label="Loading",this.setFocus=!1,this.enableAnalytics=!1}componentDidLoad(){this.setFocus&&this.spinner&&this.spinner.focus(),this.loadingStartTime=Date.now();const t=this.el.parentNode;this.observer=new MutationObserver((e=>{for(const
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";var isChromatic=function(t){const e=t||"undefined"!=typeof window&&window;return!(!e||!e.navigator.userAgent.match(/Chromatic/)&&!e.location.href.match(/chromatic=true/))};const vaLoadingIndicatorCss=":host{display:block;font-size:1.06rem;text-align:center}.loading-indicator{display:block;height:4rem;margin-top:1rem}.loading-indicator:after{content:' ';display:inline-block;width:2.1875rem;height:2.1875rem;margin:1px;border-radius:50%;border:8px solid var(--vads-color-primary);border-color:var(--vads-color-primary) transparent var(--vads-color-primary)\n transparent;-webkit-animation:spin 1.5s linear infinite;animation:spin 1.5s linear infinite}.loading-indicator.chromatic:after{-webkit-animation:none;animation:none}.loading-indicator:focus{outline:none}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}",VaLoadingIndicatorStyle0=vaLoadingIndicatorCss,VaLoadingIndicator$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.loadingStartTime=null,this.observer=null,this.message=void 0,this.label="Loading",this.setFocus=!1,this.enableAnalytics=!1}componentDidLoad(){this.setFocus&&this.spinner&&this.spinner.focus(),this.loadingStartTime=Date.now();const t=this.el.parentNode;this.observer=new MutationObserver((e=>{for(const a of e)if("childList"===a.type){const e=Array.from(a.removedNodes.values()).filter((t=>{var e;return"va-loading-indicator"===(null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase())})).length>0;if(this.enableAnalytics&&e){const e=new CustomEvent("component-library-analytics",{bubbles:!0,composed:!0,detail:{componentName:"va-loading-indicator",action:"displayed",details:{displayTime:Date.now()-this.loadingStartTime,message:this.message}}});t.dispatchEvent(e)}}})),this.observer.observe(t,{childList:!0})}render(){const{message:t,label:e}=this;let a="loading-indicator";return isChromatic()&&(a+=" chromatic"),h(Host,{key:"45574f1984339394aaa02fc5eb419a9f1d87e48d","aria-live":"polite"},h("div",{key:"78ffc121e7422b124f83dac6c960453500f82a29",ref:t=>this.spinner=t,class:a,role:"progressbar","aria-label":e,"aria-valuetext":t,tabindex:"-1"}),t)}get el(){return this}static get style(){return VaLoadingIndicatorStyle0}},[1,"va-loading-indicator",{message:[1],label:[1],setFocus:[4,"set-focus"],enableAnalytics:[4,"enable-analytics"]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-loading-indicator"].forEach((t=>{"va-loading-indicator"===t&&(customElements.get(t)||customElements.define(t,VaLoadingIndicator$1))}))}const VaLoadingIndicator=VaLoadingIndicator$1,defineCustomElement=defineCustomElement$1;export{VaLoadingIndicator,defineCustomElement};
|