@gov-design-system-ce/components 0.0.32 → 0.0.34

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.
Files changed (100) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/gov-badge.cjs.entry.js +7 -1
  3. package/dist/cjs/gov-badge.cjs.entry.js.map +1 -1
  4. package/dist/cjs/gov-button.cjs.entry.js +8 -2
  5. package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
  6. package/dist/cjs/gov-form-autocomplete.cjs.entry.js +0 -2
  7. package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
  8. package/dist/cjs/gov-form-input.cjs.entry.js +3 -1
  9. package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
  10. package/dist/cjs/gov-form-label.cjs.entry.js +1 -1
  11. package/dist/cjs/gov-form-label.cjs.entry.js.map +1 -1
  12. package/dist/cjs/gov-form-radio.cjs.entry.js +3 -3
  13. package/dist/cjs/gov-form-radio.cjs.entry.js.map +1 -1
  14. package/dist/cjs/gov-icon.cjs.entry.js +1 -1
  15. package/dist/cjs/gov-tile.cjs.entry.js +7 -1
  16. package/dist/cjs/gov-tile.cjs.entry.js.map +1 -1
  17. package/dist/cjs/loader.cjs.js +1 -1
  18. package/dist/collection/components/gov-badge/gov-badge.js +37 -2
  19. package/dist/collection/components/gov-badge/gov-badge.js.map +1 -1
  20. package/dist/collection/components/gov-button/gov-button.js +30 -2
  21. package/dist/collection/components/gov-button/gov-button.js.map +1 -1
  22. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +0 -2
  23. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
  24. package/dist/collection/components/gov-form/input/gov-form-input.js +37 -1
  25. package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
  26. package/dist/collection/components/gov-form/label/gov-form-label.js +2 -2
  27. package/dist/collection/components/gov-form/label/gov-form-label.js.map +1 -1
  28. package/dist/collection/components/gov-form/radio/gov-form-radio.js +4 -4
  29. package/dist/collection/components/gov-form/radio/gov-form-radio.js.map +1 -1
  30. package/dist/collection/components/gov-tile/gov-tile.js +37 -5
  31. package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
  32. package/dist/components/gov-badge2.js +9 -2
  33. package/dist/components/gov-badge2.js.map +1 -1
  34. package/dist/components/gov-button2.js +9 -2
  35. package/dist/components/gov-button2.js.map +1 -1
  36. package/dist/components/gov-form-autocomplete2.js +0 -2
  37. package/dist/components/gov-form-autocomplete2.js.map +1 -1
  38. package/dist/components/gov-form-input2.js +5 -1
  39. package/dist/components/gov-form-input2.js.map +1 -1
  40. package/dist/components/gov-form-label.js +1 -1
  41. package/dist/components/gov-form-label.js.map +1 -1
  42. package/dist/components/gov-form-radio.js +3 -3
  43. package/dist/components/gov-form-radio.js.map +1 -1
  44. package/dist/components/gov-icon2.js +1 -1
  45. package/dist/components/gov-tile.js +9 -2
  46. package/dist/components/gov-tile.js.map +1 -1
  47. package/dist/core/core.esm.js +1 -1
  48. package/dist/core/core.esm.js.map +1 -1
  49. package/dist/core/{p-30777e50.entry.js → p-35aadeeb.entry.js} +2 -2
  50. package/dist/core/p-35aadeeb.entry.js.map +1 -0
  51. package/dist/core/{p-67006730.entry.js → p-4db67975.entry.js} +2 -2
  52. package/dist/core/p-4db67975.entry.js.map +1 -0
  53. package/dist/core/{p-d5b2d142.entry.js → p-7bc34e7d.entry.js} +2 -2
  54. package/dist/core/{p-f814b4e9.entry.js → p-bbc765ca.entry.js} +2 -2
  55. package/dist/core/p-bbc765ca.entry.js.map +1 -0
  56. package/dist/core/p-ea493ce6.entry.js +2 -0
  57. package/dist/core/p-ea493ce6.entry.js.map +1 -0
  58. package/dist/core/{p-70786676.entry.js → p-f656fffe.entry.js} +2 -2
  59. package/dist/core/p-f656fffe.entry.js.map +1 -0
  60. package/dist/core/{p-3412facd.entry.js → p-fa7daa95.entry.js} +2 -2
  61. package/dist/core/p-fa7daa95.entry.js.map +1 -0
  62. package/dist/core/{p-96a59983.entry.js → p-fe1ee53b.entry.js} +2 -2
  63. package/dist/core/p-fe1ee53b.entry.js.map +1 -0
  64. package/dist/custom-elements/index.js +1 -1
  65. package/dist/custom-elements/index.js.map +1 -1
  66. package/dist/esm/core.js +1 -1
  67. package/dist/esm/gov-badge.entry.js +7 -1
  68. package/dist/esm/gov-badge.entry.js.map +1 -1
  69. package/dist/esm/gov-button.entry.js +8 -2
  70. package/dist/esm/gov-button.entry.js.map +1 -1
  71. package/dist/esm/gov-form-autocomplete.entry.js +0 -2
  72. package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
  73. package/dist/esm/gov-form-input.entry.js +3 -1
  74. package/dist/esm/gov-form-input.entry.js.map +1 -1
  75. package/dist/esm/gov-form-label.entry.js +1 -1
  76. package/dist/esm/gov-form-label.entry.js.map +1 -1
  77. package/dist/esm/gov-form-radio.entry.js +3 -3
  78. package/dist/esm/gov-form-radio.entry.js.map +1 -1
  79. package/dist/esm/gov-icon.entry.js +1 -1
  80. package/dist/esm/gov-tile.entry.js +7 -1
  81. package/dist/esm/gov-tile.entry.js.map +1 -1
  82. package/dist/esm/loader.js +1 -1
  83. package/dist/hydrate/index.js +36 -13
  84. package/dist/types/components/gov-badge/gov-badge.d.ts +6 -1
  85. package/dist/types/components/gov-button/gov-button.d.ts +5 -1
  86. package/dist/types/components/gov-form/input/gov-form-input.d.ts +9 -1
  87. package/dist/types/components/gov-form/label/gov-form-label.d.ts +1 -1
  88. package/dist/types/components/gov-form/radio/gov-form-radio.d.ts +1 -1
  89. package/dist/types/components/gov-tile/gov-tile.d.ts +5 -0
  90. package/dist/types/components.d.ts +28 -0
  91. package/package.json +1 -1
  92. package/dist/core/p-30777e50.entry.js.map +0 -1
  93. package/dist/core/p-3412facd.entry.js.map +0 -1
  94. package/dist/core/p-4687e822.entry.js +0 -2
  95. package/dist/core/p-4687e822.entry.js.map +0 -1
  96. package/dist/core/p-67006730.entry.js.map +0 -1
  97. package/dist/core/p-70786676.entry.js.map +0 -1
  98. package/dist/core/p-96a59983.entry.js.map +0 -1
  99. package/dist/core/p-f814b4e9.entry.js.map +0 -1
  100. /package/dist/core/{p-d5b2d142.entry.js.map → p-7bc34e7d.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{r as o,c as r,h as e,H as i,g as a}from"./p-4af5e4f4.js";import{c as t}from"./p-24636c53.js";import{v as s}from"./p-26acf964.js";import{g as c,c as n,d as v}from"./p-fd2f10eb.js";import{g as d,t as m}from"./p-3f37ddb6.js";import{b as l,c as g}from"./p-670b4f93.js";import{c as f}from"./p-c20102ff.js";import{d as h}from"./p-03990da5.js";import{F as p}from"./p-1c1d0bbe.js";import"./p-561fa17b.js";import"./p-55500e5a.js";import"./p-ff7365ae.js";import"./p-ef79904e.js";import"./p-6278531b.js";import"./p-9dab01be.js";import"./p-3464136c.js";const b='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-radio{cursor:pointer}.gov-form-radio input{position:absolute;top:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gov-form-radio input+span{position:relative;display:block}.gov-form-radio input+span::before{content:"";position:absolute;display:block;top:0;left:0;border:var(--gov-form-checkbox-border-size, 0.125rem solid var(--gov-color-primary));background-color:var(--gov-form-checkbox-background-color, var(--gov-color-neutral-white));transition:150ms linear border-color, 150ms linear background-color, 150ms linear outline-color}.gov-form-radio .gov-form-label__label{position:relative;z-index:1;width:100%}.gov-form-radio input:focus-visible+span::before{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}[invalid=""].gov-form-radio .gov-form-label__label,[invalid=true i].gov-form-radio .gov-form-label__label,[invalid="1"].gov-form-radio .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-radio input+span::before,[invalid=true i].gov-form-radio input+span::before,[invalid="1"].gov-form-radio input+span::before{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}[disabled=""].gov-form-radio,[disabled=true i].gov-form-radio,[disabled="1"].gov-form-radio{pointer-events:none}[disabled=""].gov-form-radio .gov-form-label__label,[disabled=true i].gov-form-radio .gov-form-label__label,[disabled="1"].gov-form-radio .gov-form-label__label{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-radio input+span::before,[disabled=true i].gov-form-radio input+span::before,[disabled="1"].gov-form-radio input+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}[size=xs].gov-form-radio{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);min-height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=xs].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-text-xs-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}[size=xs].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=s].gov-form-radio{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);min-height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=s].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-text-s-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}[size=s].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=m].gov-form-radio{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);min-height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=m].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-text-m-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}[size=m].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=l].gov-form-radio{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);min-height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}[size=l].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-text-l-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}[size=l].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}.gov-form-radio input+span::before{border-radius:50%}.gov-form-radio input+span::after{content:"";position:absolute;display:block;border-radius:50%;background:var(--gov-form-radio-indicator-bg, var(--gov-color-primary));opacity:0;transition:150ms linear opacity}.gov-form-radio input:checked+span::after{opacity:1}.gov-form-radio[invalid=""] input+span::after,.gov-form-radio[invalid=true i] input+span::after,.gov-form-radio[invalid="1"] input+span::after{background:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-radio[disabled=""] input:checked+span::after,.gov-form-radio[disabled=true i] input:checked+span::after,.gov-form-radio[disabled="1"] input:checked+span::after{background-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}.gov-form-radio[size=xs] input+span::after{top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)) / 2);left:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)) / 2);width:var(--gov-form-checkbox-core-xs-dot-size, 0.625rem);height:var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)}.gov-form-radio[size=s] input+span::after{top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)) / 2);left:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)) / 2);width:var(--gov-form-checkbox-core-s-dot-size, 0.6875rem);height:var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)}.gov-form-radio[size=m] input+span::after{top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-dot-size, 0.75rem)) / 2);left:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-dot-size, 0.75rem)) / 2);width:var(--gov-form-checkbox-core-m-dot-size, 0.75rem);height:var(--gov-form-checkbox-core-m-dot-size, 0.75rem)}.gov-form-radio[size=l] input+span::after{top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-dot-size, 1rem)) / 2);left:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-dot-size, 1rem)) / 2);width:var(--gov-form-checkbox-core-l-dot-size, 1rem);height:var(--gov-form-checkbox-core-l-dot-size, 1rem)}';const x=class{constructor(e){o(this,e);this.govFocus=r(this,"gov-focus",7);this.govBlur=r(this,"gov-blur",7);this.govChange=r(this,"gov-change",7);this.value=undefined;this.noLabel=false;this.checked=false;this.required=false;this.disabled=undefined;this.name=undefined;this.size="m";this.identifier=undefined;this.invalid=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.radioId=t("GovRadio");this.h=d(this.host);this.f=c(this.h)}validateSize(o){s(v,o,n.root)}componentWillLoad(){this.f.passAttrToControl("type","radio")}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.radioId);this.f.passAttrToLabel("required",String(this.required));if(f()){await h(500);await this.validateWcag()}}render(){const o=o=>{if(this.noLabel){return e("label",null,o)}return o};return e(i,{class:n.root,checked:this.checked,size:this.size,invalid:m(this.invalid)},e("div",{class:n.holder},o(e(p,null,e("input",{class:n.input,id:this.identifier||this.radioId,type:"radio",value:this.value,name:this.name,checked:this.checked,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),ref:o=>this.inputRef=o,required:this.required,"aria-checked":this.checked,"aria-required":m(this.required),"aria-invalid":m(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":m(this.disabled)}),e("span",null,e("slot",{name:"label"}))))))}onClickHandler(o){o.stopPropagation()}onFocusHandler(o){o.stopPropagation();this.govFocus.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:o})}onBlurHandler(o){o.stopPropagation();this.govBlur.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:o})}onChangeHandler(o){this.checked=o.target.checked;o.stopPropagation();this.govChange.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:o})}async getRef(){return this.inputRef}async validateWcag(){l(this.wcagDescribedBy,"wcag-described-by",n.root);l(this.wcagLabelledBy,"wcag-labelled-by",n.root);g(this.identifier||this.radioId,this.wcagLabelledBy,n.root)}get host(){return a(this)}static get watchers(){return{size:["validateSize"]}}};x.style=b;export{x as gov_form_radio};
2
- //# sourceMappingURL=p-3412facd.entry.js.map
1
+ import{r as o,c as r,h as e,H as i,g as a}from"./p-4af5e4f4.js";import{c as t}from"./p-24636c53.js";import{v as s}from"./p-26acf964.js";import{g as c,c as n,d as v}from"./p-fd2f10eb.js";import{g as d,t as m}from"./p-3f37ddb6.js";import{b as l,c as g}from"./p-670b4f93.js";import{c as f}from"./p-c20102ff.js";import{d as h}from"./p-03990da5.js";import{F as p}from"./p-1c1d0bbe.js";import"./p-561fa17b.js";import"./p-55500e5a.js";import"./p-ff7365ae.js";import"./p-ef79904e.js";import"./p-6278531b.js";import"./p-9dab01be.js";import"./p-3464136c.js";const b='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-radio{cursor:pointer}.gov-form-radio input{position:absolute;top:0;left:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gov-form-radio input+span{position:relative;display:block}.gov-form-radio input+span::before{content:"";position:absolute;display:block;top:0;left:0;border:var(--gov-form-checkbox-border-size, 0.125rem solid var(--gov-color-primary));background-color:var(--gov-form-checkbox-background-color, var(--gov-color-neutral-white));transition:150ms linear border-color, 150ms linear background-color, 150ms linear outline-color}.gov-form-radio .gov-form-label__label{position:relative;z-index:1;width:100%}.gov-form-radio input:focus-visible+span::before{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}[invalid=""].gov-form-radio .gov-form-label__label,[invalid=true i].gov-form-radio .gov-form-label__label,[invalid="1"].gov-form-radio .gov-form-label__label{color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-radio input+span::before,[invalid=true i].gov-form-radio input+span::before,[invalid="1"].gov-form-radio input+span::before{border-color:var(--gov-form-state-color-error, var(--gov-color-error))}[disabled=""].gov-form-radio,[disabled=true i].gov-form-radio,[disabled="1"].gov-form-radio{pointer-events:none}[disabled=""].gov-form-radio .gov-form-label__label,[disabled=true i].gov-form-radio .gov-form-label__label,[disabled="1"].gov-form-radio .gov-form-label__label{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-radio input+span::before,[disabled=true i].gov-form-radio input+span::before,[disabled="1"].gov-form-radio input+span::before{border-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}[size=xs].gov-form-radio{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);min-height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=xs].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-text-xs-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem))}[size=xs].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem);height:var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem)}[size=s].gov-form-radio{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);min-height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=s].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-text-s-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem))}[size=s].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem);height:var(--gov-form-checkbox-core-s-indicator-size, 1.375rem)}[size=m].gov-form-radio{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);min-height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=m].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-text-m-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem))}[size=m].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem);height:var(--gov-form-checkbox-core-m-indicator-size, 1.5rem)}[size=l].gov-form-radio{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);display:block;min-width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);min-height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}[size=l].gov-form-radio .gov-form-label__label{padding-top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-text-l-font-size) * 1.5) / 2);padding-left:calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem))}[size=l].gov-form-radio input+span::before{width:var(--gov-form-checkbox-core-l-indicator-size, 2rem);height:var(--gov-form-checkbox-core-l-indicator-size, 2rem)}.gov-form-radio input+span::before{border-radius:50%}.gov-form-radio input+span::after{content:"";position:absolute;display:block;border-radius:50%;background:var(--gov-form-radio-indicator-bg, var(--gov-color-primary));opacity:0;transition:150ms linear opacity}.gov-form-radio input:checked+span::after{opacity:1}.gov-form-radio[invalid=""] input+span::after,.gov-form-radio[invalid=true i] input+span::after,.gov-form-radio[invalid="1"] input+span::after{background:var(--gov-form-state-color-error, var(--gov-color-error))}.gov-form-radio[disabled=""] input:checked+span::after,.gov-form-radio[disabled=true i] input:checked+span::after,.gov-form-radio[disabled="1"] input:checked+span::after{background-color:var(--gov-form-input-disabled-bg, var(--gov-color-primary-400))}.gov-form-radio[size=xs] input+span::after{top:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)) / 2);left:calc((var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) - var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)) / 2);width:var(--gov-form-checkbox-core-xs-dot-size, 0.625rem);height:var(--gov-form-checkbox-core-xs-dot-size, 0.625rem)}.gov-form-radio[size=s] input+span::after{top:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)) / 2);left:calc((var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) - var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)) / 2);width:var(--gov-form-checkbox-core-s-dot-size, 0.6875rem);height:var(--gov-form-checkbox-core-s-dot-size, 0.6875rem)}.gov-form-radio[size=m] input+span::after{top:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-dot-size, 0.75rem)) / 2);left:calc((var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) - var(--gov-form-checkbox-core-m-dot-size, 0.75rem)) / 2);width:var(--gov-form-checkbox-core-m-dot-size, 0.75rem);height:var(--gov-form-checkbox-core-m-dot-size, 0.75rem)}.gov-form-radio[size=l] input+span::after{top:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-dot-size, 1rem)) / 2);left:calc((var(--gov-form-checkbox-core-l-indicator-size, 2rem) - var(--gov-form-checkbox-core-l-dot-size, 1rem)) / 2);width:var(--gov-form-checkbox-core-l-dot-size, 1rem);height:var(--gov-form-checkbox-core-l-dot-size, 1rem)}';const x=class{constructor(e){o(this,e);this.govFocus=r(this,"gov-focus",7);this.govBlur=r(this,"gov-blur",7);this.govChange=r(this,"gov-change",7);this.value=undefined;this.noLabel=false;this.checked=false;this.required=false;this.disabled=undefined;this.name=undefined;this.size="m";this.identifier=undefined;this.invalid=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.radioId=t("GovRadio");this.h=d(this.host);this.f=c(this.h)}validateSize(o){s(v,o,n.root)}componentWillLoad(){this.f.passAttrToControl("type","radio")}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.radioId);this.f.passAttrToLabel("required",String(this.required));if(f()){await h(500);await this.validateWcag()}}render(){const o=o=>{if(this.noLabel){return e("label",null,o)}return o};return e(i,{class:n.root,checked:this.checked,size:this.size,invalid:m(this.invalid)},e("div",{class:n.holder},o(e(p,null,e("input",{class:n.input,id:this.identifier||this.radioId,type:"radio",value:this.value,name:this.name,checked:this.checked,disabled:this.disabled,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),ref:o=>this.inputRef=o,required:this.required,"aria-checked":this.checked,"aria-required":m(this.required),"aria-invalid":m(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-disabled":m(this.disabled)}),e("span",null,e("slot",{name:"label"}))))))}onClickHandler(o){o.stopPropagation()}onFocusHandler(o){o.stopPropagation();this.govFocus.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:o})}onBlurHandler(o){o.stopPropagation();this.govBlur.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:o})}onChangeHandler(o){this.checked=o.target.checked;o.stopPropagation();this.govChange.emit({component:n.root,value:this.value,checked:this.checked,originalEvent:o})}async getRef(){return this.inputRef}async validateWcag(){l(this.wcagDescribedBy,"wcag-described-by",n.root);l(this.wcagLabelledBy,"wcag-labelled-by",n.root);g(this.identifier||this.radioId,this.wcagLabelledBy,n.root)}get host(){return a(this)}static get watchers(){return{size:["validateSize"]}}};x.style=b;export{x as gov_form_radio};
2
+ //# sourceMappingURL=p-fa7daa95.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../packages/core/src/components/gov-form/radio/gov-form-radio.scss?tag=gov-form-radio","../../../packages/core/src/components/gov-form/radio/gov-form-radio.tsx"],"names":["govFormRadioCss","GovFormRadio","[object Object]","hostRef","this","radioId","createID","h","govHost","host","f","govForm","newValue","validateProp","FormRadioSizes","FormRadioClass","root","passAttrToControl","passAttrToLabel","identifier","String","required","canValidateWcagOnRender","delay","validateWcag","wrapCheckbox","children","noLabel","Host","class","checked","size","invalid","toBoolAttrIfDefined","holder","Fragment","input","id","type","value","name","disabled","onClick","onClickHandler","bind","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","ref","el","inputRef","aria-checked","aria-required","aria-invalid","aria-describedby","wcagDescribedBy","aria-labelledby","wcagLabelledBy","aria-disabled","e","stopPropagation","govFocus","emit","component","originalEvent","govBlur","target","govChange","validateWcagRef","validateWcagLabelFor"],"mappings":"oiBAAA,MAAMA,EAAkB,ghPCmBXC,EAAY,MAOxBC,YAAAC,2JAe6D,mBAIX,oBAKb,4DAaQ,kHApC5CC,KAAKC,QAAUC,EAAS,YAExBF,KAAKG,EAAIC,EAAQJ,KAAKK,MACtBL,KAAKM,EAAIC,EAAQP,KAAKG,GAgEvBL,aAAaU,GACZC,EAAaC,EAAgBF,EAAUG,EAAeC,MAGvDd,oBACCE,KAAKM,EAAEO,kBAAkB,OAAQ,SAGlCf,2BACCE,KAAKM,EAAEQ,gBAAgB,aAAcd,KAAKe,YAAcf,KAAKC,SAC7DD,KAAKM,EAAEQ,gBAAgB,WAAYE,OAAOhB,KAAKiB,WAC/C,GAAIC,IAA2B,OACxBC,EAAM,WACNnB,KAAKoB,gBAIbtB,SACC,MAAMuB,EAAeC,IACpB,GAAItB,KAAKuB,QAAS,CACjB,OAAOpB,EAAA,QAAA,KAAQmB,GAEhB,OAAOA,GAGR,OACCnB,EAACqB,EAAI,CAACC,MAAOd,EAAeC,KAAMc,QAAS1B,KAAK0B,QAASC,KAAM3B,KAAK2B,KAAMC,QAASC,EAAoB7B,KAAK4B,UAC3GzB,EAAA,MAAA,CAAKsB,MAAOd,EAAemB,QACzBT,EACAlB,EAAC4B,EAAQ,KACR5B,EAAA,QAAA,CACCsB,MAAOd,EAAeqB,MACtBC,GAAIjC,KAAKe,YAAcf,KAAKC,QAC5BiC,KAAK,QACLC,MAAOnC,KAAKmC,MACZC,KAAMpC,KAAKoC,KACXV,QAAS1B,KAAK0B,QACdW,SAAUrC,KAAKqC,SACfC,QAAStC,KAAKuC,eAAeC,KAAKxC,MAClCyC,SAAUzC,KAAK0C,gBAAgBF,KAAKxC,MACpC2C,QAAS3C,KAAK4C,eAAeJ,KAAKxC,MAClC6C,OAAQ7C,KAAK8C,cAAcN,KAAKxC,MAChC+C,IAAKC,GAAOhD,KAAKiD,SAAWD,EAC5B/B,SAAUjB,KAAKiB,SAAQiC,eACTlD,KAAK0B,QAAOyB,gBACXtB,EAAoB7B,KAAKiB,UAASmC,eACnCvB,EAAoB7B,KAAK4B,SAAQyB,mBAC7BrD,KAAKsD,gBAAeC,kBACrBvD,KAAKwD,eAAcC,gBACrB5B,EAAoB7B,KAAKqC,YAEzClC,EAAA,OAAA,KACCA,EAAA,OAAA,CAAMiC,KAAK,eASVtC,eAAe4D,GACtBA,EAAEC,kBAGK7D,eAAe4D,GACtBA,EAAEC,kBACF3D,KAAK4D,SAASC,KAAK,CAClBC,UAAWnD,EAAeC,KAC1BuB,MAAOnC,KAAKmC,MACZT,QAAS1B,KAAK0B,QACdqC,cAAeL,IAIT5D,cAAc4D,GACrBA,EAAEC,kBACF3D,KAAKgE,QAAQH,KAAK,CACjBC,UAAWnD,EAAeC,KAC1BuB,MAAOnC,KAAKmC,MACZT,QAAS1B,KAAK0B,QACdqC,cAAeL,IAIT5D,gBAAgB4D,GACvB1D,KAAK0B,QAAWgC,EAAEO,OAA4BvC,QAC9CgC,EAAEC,kBACF3D,KAAKkE,UAAUL,KAAK,CACnBC,UAAWnD,EAAeC,KAC1BuB,MAAOnC,KAAKmC,MACZT,QAAS1B,KAAK0B,QACdqC,cAAeL,IAQjB5D,eACC,OAAOE,KAAKiD,SAObnD,qBACCqE,EAAgBnE,KAAKsD,gBAAiB,oBAAqB3C,EAAeC,MAC1EuD,EAAgBnE,KAAKwD,eAAgB,mBAAoB7C,EAAeC,MACxEwD,EAAqBpE,KAAKe,YAAcf,KAAKC,QAASD,KAAKwD,eAAgB7C,EAAeC","sourcesContent":["/*\n * Radio\n */\n\n@import \"../checkbox/gov-form-checkbox-core.scss\";\n$class: \".gov-form-radio\";\n\n#{$class} {\n\t@extend %form-checkbox-core;\n\tinput + span {\n\t\t&::before {\n\t\t\tborder-radius: 50%;\n\t\t}\n\t\t&::after {\n\t\t\t@include pseudo();\n\t\t\tborder-radius: 50%;\n\t\t\tbackground: $form-radio-indicator-bg;\n\t\t\topacity: 0;\n\t\t\ttransition: $t linear opacity;\n\t\t}\n\t}\n\n\t// STATES\n\tinput:checked + span::after {\n\t\topacity: 1;\n\t}\n\t@include parameter(\"invalid\") {\n\t\tinput + span::after {\n\t\t\tbackground: $form-state-color-error;\n\t\t}\n\t}\n\t@include parameter(\"disabled\") {\n\t\tinput:checked + span::after {\n\t\t\tbackground-color: $form-state-bg-disabled;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $form-checkbox-core-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\tinput + span::after {\n\t\t\t\ttop: calc((get(\"indicator-size\", $definitions) - get(\"dot-size\", $definitions)) / 2);\n\t\t\t\tleft: calc((get(\"indicator-size\", $definitions) - get(\"dot-size\", $definitions)) / 2);\n\t\t\t\twidth: get(\"dot-size\", $definitions);\n\t\t\t\theight: get(\"dot-size\", $definitions);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Host, h, Prop, Event, EventEmitter, Element, Watch, Method } from '@stencil/core'\nimport { createID } from '../../../utils/string.utils'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { FormRadioClass, FormRadioSizes, FormRadioSizesType } from './constants'\nimport { toBoolAttrIfDefined } from '../../../helpers/Dom/template'\nimport { validateWcagLabelFor, validateWcagRef } from '../../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../../helpers/Dom/win'\nimport { delay } from '../../../utils/utils'\nimport { GovForm } from '../../../helpers/Dom/form.types'\nimport { govHost } from '../../../helpers/Dom/template'\nimport { GovHost } from '../../../helpers/Dom/template.types'\nimport { govForm } from '../../../helpers/Dom/form'\nimport Fragment from '../../../helpers/Fragment'\nimport { FormRadioEvent } from './gov-form-radio.types'\n\n@Component({\n\ttag: 'gov-form-radio',\n\tstyleUrl: 'gov-form-radio.scss',\n})\nexport class GovFormRadio {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\n\tprivate readonly radioId: string\n\n\tconstructor() {\n\t\tthis.radioId = createID('GovRadio')\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormRadioElement\n\t/**\n\t * Value of radio\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({ attribute: 'no-label' }) readonly noLabel: boolean = false\n\t/**\n\t * Radio default state\n\t */\n\t@Prop({ reflect: true, mutable: true }) checked = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the radio component disabled.\n\t * This prevents users from being able to interact with the radio, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean\n\t/**\n\t * Name of the radio.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Radio's size.\n\t */\n\t@Prop() readonly size?: FormRadioSizesType = 'm'\n\t/**\n\t * Custom radio identifier.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: 'wcag-described-by' }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when the radio has focus.\n\t */\n\t@Event({ eventName: 'gov-focus' }) govFocus: EventEmitter<FormRadioEvent>\n\t/**\n\t * Emitted when the radio loses focus.\n\t */\n\t@Event({ eventName: 'gov-blur' }) govBlur: EventEmitter<FormRadioEvent>\n\t/**\n\t * Emitted when the radio change value.\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<FormRadioEvent>\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormRadioSizes, newValue, FormRadioClass.root)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToControl('type', 'radio')\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel('identifier', this.identifier || this.radioId)\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst wrapCheckbox = children => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn <label>{children}</label>\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormRadioClass.root} checked={this.checked} size={this.size} invalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t<div class={FormRadioClass.holder}>\n\t\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tclass={FormRadioClass.input}\n\t\t\t\t\t\t\t\tid={this.identifier || this.radioId}\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\t\taria-checked={this.checked}\n\t\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t<slot name=\"label\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormRadioClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormRadioClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormRadioClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.radioId, this.wcagLabelledBy, FormRadioClass.root)\n\t}\n}\n"]}
@@ -1,2 +1,2 @@
1
- import{r as o,c as s,h as i,H as a}from"./p-4af5e4f4.js";import{F as r}from"./p-3464136c.js";import"./p-03990da5.js";import"./p-55500e5a.js";const e=".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-label{position:relative;display:flex;width:100%}.gov-form-label__label{display:inline-block;color:var(--gov-form-label-color, #686868);cursor:pointer;box-sizing:border-box}";const t=class{constructor(i){o(this,i);this.govClick=s(this,"gov-click",7);this.identifier=undefined;this.size="m";this.required=false;this.legend=false}render(){const o=this.legend?"legend":"label";return i(a,{class:r.root,size:this.size},i(o,{class:r.label,htmlFor:this.identifier,onClick:()=>this.govClick.emit()},i("slot",null),this.required?i("span",{class:"gov-color--danger-500"},"*"):null))}};t.style=e;export{t as gov_form_label};
2
- //# sourceMappingURL=p-96a59983.entry.js.map
1
+ import{r as o,c as s,h as i,H as r}from"./p-4af5e4f4.js";import{F as a}from"./p-3464136c.js";import"./p-03990da5.js";import"./p-55500e5a.js";const e=".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-label{position:relative;display:flex;width:100%}.gov-form-label__label{display:inline-block;color:var(--gov-form-label-color, #686868);cursor:pointer;box-sizing:border-box}";const t=class{constructor(i){o(this,i);this.govClick=s(this,"gov-click",7);this.identifier=undefined;this.size="m";this.required=false;this.legend=false}render(){const o=this.legend?"legend":"label";return i(r,{class:a.root,size:this.size},i(o,{class:a.label,htmlFor:this.identifier,onClick:()=>this.govClick.emit()},i("slot",null),this.required?i("span",{class:"gov-color--error-500"},"*"):null))}};t.style=e;export{t as gov_form_label};
2
+ //# sourceMappingURL=p-fe1ee53b.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../packages/core/src/components/gov-form/label/gov-form-label.scss?tag=gov-form-label","../../../packages/core/src/components/gov-form/label/gov-form-label.tsx"],"names":["govFormLabelCss","GovFormLabel","[object Object]","Tag","this","legend","h","Host","class","FormLabelClass","root","size","label","htmlFor","identifier","onClick","govClick","emit","required"],"mappings":"6IAAA,MAAMA,EAAkB,qhBCOXC,EAAY,uGAQsB,kBAIT,kBAKF,MAMnCC,SACC,MAAMC,EAAMC,KAAKC,OAAS,SAAW,QACrC,OACCC,EAACC,EAAI,CAACC,MAAOC,EAAeC,KAAMC,KAAMP,KAAKO,MAC5CL,EAACH,EAAG,CAACK,MAAOC,EAAeG,MAAOC,QAAST,KAAKU,WAAYC,QAAS,IAAMX,KAAKY,SAASC,QACxFX,EAAA,OAAA,MACCF,KAAKc,SAAWZ,EAAA,OAAA,CAAME,MAAM,wBAAsB,KAAY","sourcesContent":["/*\n * Label\n */\n\n$class: \".gov-form-label\";\n\n#{$class} {\n\t@include base(flex);\n\t&__label {\n\t\tdisplay: inline-block;\n\t\tcolor: $form-label-color;\n\t\tcursor: pointer;\n\t\tbox-sizing: border-box;\n\t}\n}\n","import { Component, Event, EventEmitter, h, Prop, Host } from '@stencil/core'\nimport { FormLabelClass, FormLabelSizesTypes } from './constants'\n\n@Component({\n\ttag: 'gov-form-label',\n\tstyleUrl: 'gov-form-label.scss',\n})\nexport class GovFormLabel {\n\t/**\n\t * Identifier for label.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Label's size.\n\t */\n\t@Prop() readonly size?: FormLabelSizesTypes = 'm'\n\t/**\n\t * Set whether the input is required or not.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Use label as a legend for better accessibility.\n\t * Note: Don't forget to set the fieldset attribute of the gov-form-control component\n\t */\n\t@Prop() readonly legend: boolean = false\n\t/**\n\t * Emitted when the label click.\n\t */\n\t@Event({ eventName: 'gov-click' }) govClick: EventEmitter<PointerEvent>\n\n\trender() {\n\t\tconst Tag = this.legend ? 'legend' : 'label'\n\t\treturn (\n\t\t\t<Host class={FormLabelClass.root} size={this.size}>\n\t\t\t\t<Tag class={FormLabelClass.label} htmlFor={this.identifier} onClick={() => this.govClick.emit()}>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t{this.required ? <span class=\"gov-color--error-500\">*</span> : null}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}