@gov-design-system-ce/components 0.0.42 → 0.0.43

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 (153) hide show
  1. package/dist/cjs/gov-app.cjs.entry.js +9 -2
  2. package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
  3. package/dist/cjs/gov-form-file.cjs.entry.js +2 -2
  4. package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
  5. package/dist/cjs/gov-icon.cjs.entry.js +1 -1
  6. package/dist/collection/components/gov-form/file/gov-form-file.js +1 -1
  7. package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
  8. package/dist/collection/pages/Forms.js +9 -2
  9. package/dist/collection/pages/Forms.js.map +1 -1
  10. package/dist/collection/utils/file.utils.js +1 -1
  11. package/dist/collection/utils/file.utils.js.map +1 -1
  12. package/dist/components/gov-accordion-item.js +0 -1
  13. package/dist/components/gov-accordion-item.js.map +1 -1
  14. package/dist/components/gov-accordion.js +0 -1
  15. package/dist/components/gov-accordion.js.map +1 -1
  16. package/dist/components/gov-alert.js +0 -1
  17. package/dist/components/gov-alert.js.map +1 -1
  18. package/dist/components/gov-app.js +9 -3
  19. package/dist/components/gov-app.js.map +1 -1
  20. package/dist/components/gov-attachments-item2.js +0 -1
  21. package/dist/components/gov-attachments-item2.js.map +1 -1
  22. package/dist/components/gov-attachments2.js +0 -1
  23. package/dist/components/gov-attachments2.js.map +1 -1
  24. package/dist/components/gov-backdrop2.js +0 -1
  25. package/dist/components/gov-backdrop2.js.map +1 -1
  26. package/dist/components/gov-badge2.js +0 -1
  27. package/dist/components/gov-badge2.js.map +1 -1
  28. package/dist/components/gov-breadcrumbs.js +0 -1
  29. package/dist/components/gov-breadcrumbs.js.map +1 -1
  30. package/dist/components/gov-button2.js +0 -1
  31. package/dist/components/gov-button2.js.map +1 -1
  32. package/dist/components/gov-card.js +0 -1
  33. package/dist/components/gov-card.js.map +1 -1
  34. package/dist/components/gov-container.js +0 -1
  35. package/dist/components/gov-container.js.map +1 -1
  36. package/dist/components/gov-control-group.js +0 -1
  37. package/dist/components/gov-control-group.js.map +1 -1
  38. package/dist/components/gov-cookiebar.js +0 -1
  39. package/dist/components/gov-cookiebar.js.map +1 -1
  40. package/dist/components/gov-dropdown.js +0 -1
  41. package/dist/components/gov-dropdown.js.map +1 -1
  42. package/dist/components/gov-empty.js +0 -1
  43. package/dist/components/gov-empty.js.map +1 -1
  44. package/dist/components/gov-error-code.js +0 -1
  45. package/dist/components/gov-error-code.js.map +1 -1
  46. package/dist/components/gov-form-autocomplete2.js +0 -1
  47. package/dist/components/gov-form-autocomplete2.js.map +1 -1
  48. package/dist/components/gov-form-checkbox.js +0 -1
  49. package/dist/components/gov-form-checkbox.js.map +1 -1
  50. package/dist/components/gov-form-control.js +0 -1
  51. package/dist/components/gov-form-control.js.map +1 -1
  52. package/dist/components/gov-form-file.js +2 -3
  53. package/dist/components/gov-form-file.js.map +1 -1
  54. package/dist/components/gov-form-group.js +0 -1
  55. package/dist/components/gov-form-group.js.map +1 -1
  56. package/dist/components/gov-form-input2.js +0 -1
  57. package/dist/components/gov-form-input2.js.map +1 -1
  58. package/dist/components/gov-form-label.js +0 -1
  59. package/dist/components/gov-form-label.js.map +1 -1
  60. package/dist/components/gov-form-message2.js +0 -1
  61. package/dist/components/gov-form-message2.js.map +1 -1
  62. package/dist/components/gov-form-multi-select.js +0 -1
  63. package/dist/components/gov-form-multi-select.js.map +1 -1
  64. package/dist/components/gov-form-password-power.js +0 -1
  65. package/dist/components/gov-form-password-power.js.map +1 -1
  66. package/dist/components/gov-form-radio.js +0 -1
  67. package/dist/components/gov-form-radio.js.map +1 -1
  68. package/dist/components/gov-form-search.js +0 -1
  69. package/dist/components/gov-form-search.js.map +1 -1
  70. package/dist/components/gov-form-select2.js +0 -1
  71. package/dist/components/gov-form-select2.js.map +1 -1
  72. package/dist/components/gov-form-switch.js +0 -1
  73. package/dist/components/gov-form-switch.js.map +1 -1
  74. package/dist/components/gov-grid-item.js +0 -1
  75. package/dist/components/gov-grid-item.js.map +1 -1
  76. package/dist/components/gov-grid.js +0 -1
  77. package/dist/components/gov-grid.js.map +1 -1
  78. package/dist/components/gov-icon2.js +1 -2
  79. package/dist/components/gov-icon2.js.map +1 -1
  80. package/dist/components/gov-layout-column.js +0 -1
  81. package/dist/components/gov-layout-column.js.map +1 -1
  82. package/dist/components/gov-layout.js +0 -1
  83. package/dist/components/gov-layout.js.map +1 -1
  84. package/dist/components/gov-loading.js +0 -1
  85. package/dist/components/gov-loading.js.map +1 -1
  86. package/dist/components/gov-message.js +0 -1
  87. package/dist/components/gov-message.js.map +1 -1
  88. package/dist/components/gov-modal.js +0 -1
  89. package/dist/components/gov-modal.js.map +1 -1
  90. package/dist/components/gov-nav-item.js +0 -1
  91. package/dist/components/gov-nav-item.js.map +1 -1
  92. package/dist/components/gov-nav.js +0 -1
  93. package/dist/components/gov-nav.js.map +1 -1
  94. package/dist/components/gov-pagination.js +0 -1
  95. package/dist/components/gov-pagination.js.map +1 -1
  96. package/dist/components/gov-prompt.js +0 -1
  97. package/dist/components/gov-prompt.js.map +1 -1
  98. package/dist/components/gov-side-nav-item.js +0 -1
  99. package/dist/components/gov-side-nav-item.js.map +1 -1
  100. package/dist/components/gov-side-nav.js +0 -1
  101. package/dist/components/gov-side-nav.js.map +1 -1
  102. package/dist/components/gov-skeleton.js +0 -1
  103. package/dist/components/gov-skeleton.js.map +1 -1
  104. package/dist/components/gov-spacer.js +0 -1
  105. package/dist/components/gov-spacer.js.map +1 -1
  106. package/dist/components/gov-statsbar-item.js +0 -1
  107. package/dist/components/gov-statsbar-item.js.map +1 -1
  108. package/dist/components/gov-statsbar.js +0 -1
  109. package/dist/components/gov-statsbar.js.map +1 -1
  110. package/dist/components/gov-stepper-item.js +0 -1
  111. package/dist/components/gov-stepper-item.js.map +1 -1
  112. package/dist/components/gov-stepper.js +0 -1
  113. package/dist/components/gov-stepper.js.map +1 -1
  114. package/dist/components/gov-tabs-item.js +0 -1
  115. package/dist/components/gov-tabs-item.js.map +1 -1
  116. package/dist/components/gov-tabs.js +0 -1
  117. package/dist/components/gov-tabs.js.map +1 -1
  118. package/dist/components/gov-tile.js +0 -1
  119. package/dist/components/gov-tile.js.map +1 -1
  120. package/dist/components/gov-tiles.js +0 -1
  121. package/dist/components/gov-tiles.js.map +1 -1
  122. package/dist/components/gov-toast.js +0 -1
  123. package/dist/components/gov-toast.js.map +1 -1
  124. package/dist/components/gov-tooltip-content.js +0 -1
  125. package/dist/components/gov-tooltip-content.js.map +1 -1
  126. package/dist/components/gov-tooltip.js +0 -1
  127. package/dist/components/gov-tooltip.js.map +1 -1
  128. package/dist/components/gov-wizzard-item.js +0 -1
  129. package/dist/components/gov-wizzard-item.js.map +1 -1
  130. package/dist/components/gov-wizzard.js +0 -1
  131. package/dist/components/gov-wizzard.js.map +1 -1
  132. package/dist/core/core.esm.js +1 -1
  133. package/dist/core/p-2507a42a.entry.js +2 -0
  134. package/dist/core/p-2507a42a.entry.js.map +1 -0
  135. package/dist/core/{p-be903a7d.entry.js → p-3932645b.entry.js} +2 -2
  136. package/dist/core/{p-3042a794.entry.js → p-bc1c8436.entry.js} +2 -2
  137. package/dist/core/p-bc1c8436.entry.js.map +1 -0
  138. package/dist/custom-elements/index.js +1 -1
  139. package/dist/custom-elements/index.js.map +1 -1
  140. package/dist/esm/gov-app.entry.js +9 -2
  141. package/dist/esm/gov-app.entry.js.map +1 -1
  142. package/dist/esm/gov-form-file.entry.js +2 -2
  143. package/dist/esm/gov-form-file.entry.js.map +1 -1
  144. package/dist/esm/gov-icon.entry.js +1 -1
  145. package/dist/globals.d.ts +2 -0
  146. package/dist/hydrate/index.js +11 -4
  147. package/dist/types/types/typings.d.ts +6 -0
  148. package/hydrate/index.js +11 -4
  149. package/package.json +1 -1
  150. package/dist/core/p-3042a794.entry.js.map +0 -1
  151. package/dist/core/p-de227b73.entry.js +0 -2
  152. package/dist/core/p-de227b73.entry.js.map +0 -1
  153. /package/dist/core/{p-be903a7d.entry.js.map → p-3932645b.entry.js.map} +0 -0
@@ -63,7 +63,6 @@ function defineCustomElement() {
63
63
  break;
64
64
  } });
65
65
  }
66
- defineCustomElement();
67
66
 
68
67
  export { GovAttachmentsItem as G, defineCustomElement as d };
69
68
 
@@ -1 +1 @@
1
- {"file":"gov-attachments-item2.js","mappings":";;;;;;;;;AAAA,MAAM,qBAAqB,GAAG,6+BAA6+B;;MCY9/B,kBAAkB;EAG9B;;;;;;IACC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAiBD,MAAM,kBAAkB;IACvB,IAAI,uBAAuB,EAAE,EAAE;MAC9B,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;MAChB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;KACzB;GACD;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAC,UAAU,IACtE,WAAK,KAAK,EAAE,oBAAoB,CAAC,IAAI,IACpC,SAAG,KAAK,EAAE,oBAAoB,CAAC,IAAI,IAClC,eAAQ,EACR,YAAM,IAAI,EAAC,MAAM,GAAG,CACjB,EACJ,kBACC,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,MAAM,EACX,IAAI,EAAC,GAAG,gBACI,IAAI,CAAC,eAAe,sBACd,IAAI,CAAC,oBAAoB,kBAC7B,IAAI,CAAC,SAAS,CAAC,IAAI,IAEjC,gBAAU,IAAI,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,GAAY,CACtC,CACR,EAEL,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KACzB,WAAK,KAAK,EAAE,oBAAoB,CAAC,QAAQ,IACxC,YAAM,IAAI,EAAC,SAAS,GAAG,CAClB,CACN,CACK,EACP;GACD;;;;EAMD,MAAM,YAAY;IACjB,iBAAiB,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;GAC7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-attachments/gov-attachments-item.scss?tag=gov-attachments-item","../../../packages/core/src/components/gov-attachments/gov-attachments-item.tsx"],"sourcesContent":["/*\n * Attachments - Item\n */\n\n$class: \".gov-attachments-item\";\n\n#{$class} {\n\t@include base();\n\tmargin: rem-calc(0 0 8);\n\t&__messages {\n\t\t@include reset-last-margin();\n\t}\n\t&__file {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t}\n\t&__name {\n\t\tdisplay: flex;\n\t\tgap: 0 rem-calc(8);\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\talign-self: center;\n\t\tmargin: 0;\n\t\tcolor: $attachments-name-color;\n\t\tspan {\n\t\t\t@include typography($font-size-xs);\n\t\t\tcolor: $attachments-decor-color;\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop } from '@stencil/core'\nimport { AttachmentsItemClass } from './constants'\nimport { validateWcagLabel } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-attachments-item',\n\tstyleUrl: 'gov-attachments-item.scss',\n})\nexport class GovAttachmentsItem {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAttachmentsItemElement\n\n\t/**\n\t * Adds accessible label for the remove button that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-remove-label' }) readonly wcagRemoveLabel: string\n\t/**\n\t * Indicates the id of a component that labels the remove button.\n\t */\n\t@Prop({ attribute: 'wcag-remove-labelled-by' }) readonly wcagRemoveLabelledBy: string\n\t/**\n\t * Emitted when the file is removed\n\t */\n\t@Event({ eventName: 'gov-remove' }) govRemove: EventEmitter<PointerEvent>\n\n\tasync componentDidRender() {\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\treturn (\n\t\t\t<Host class={this.h.classes(AttachmentsItemClass.root)} role=\"listitem\">\n\t\t\t\t<div class={AttachmentsItemClass.file}>\n\t\t\t\t\t<p class={AttachmentsItemClass.name}>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t<slot name=\"info\" />\n\t\t\t\t\t</p>\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\twcag-label={this.wcagRemoveLabel}\n\t\t\t\t\t\twcag-labelled-by={this.wcagRemoveLabelledBy}\n\t\t\t\t\t\ton-gov-click={this.govRemove.emit}\n\t\t\t\t\t>\n\t\t\t\t\t\t<gov-icon slot=\"left-icon\" name=\"x-lg\"></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot('message') && (\n\t\t\t\t\t<div class={AttachmentsItemClass.messages}>\n\t\t\t\t\t\t<slot name=\"message\" />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\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\tvalidateWcagLabel(this.wcagRemoveLabel, this.wcagRemoveLabelledBy, AttachmentsItemClass.root)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-attachments-item2.js","mappings":";;;;;;;;;AAAA,MAAM,qBAAqB,GAAG,6+BAA6+B;;MCY9/B,kBAAkB;EAG9B;;;;;;IACC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAiBD,MAAM,kBAAkB;IACvB,IAAI,uBAAuB,EAAE,EAAE;MAC9B,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;MAChB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;KACzB;GACD;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAC,UAAU,IACtE,WAAK,KAAK,EAAE,oBAAoB,CAAC,IAAI,IACpC,SAAG,KAAK,EAAE,oBAAoB,CAAC,IAAI,IAClC,eAAQ,EACR,YAAM,IAAI,EAAC,MAAM,GAAG,CACjB,EACJ,kBACC,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,MAAM,EACX,IAAI,EAAC,GAAG,gBACI,IAAI,CAAC,eAAe,sBACd,IAAI,CAAC,oBAAoB,kBAC7B,IAAI,CAAC,SAAS,CAAC,IAAI,IAEjC,gBAAU,IAAI,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,GAAY,CACtC,CACR,EAEL,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KACzB,WAAK,KAAK,EAAE,oBAAoB,CAAC,QAAQ,IACxC,YAAM,IAAI,EAAC,SAAS,GAAG,CAClB,CACN,CACK,EACP;GACD;;;;EAMD,MAAM,YAAY;IACjB,iBAAiB,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;GAC7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-attachments/gov-attachments-item.scss?tag=gov-attachments-item","../../../packages/core/src/components/gov-attachments/gov-attachments-item.tsx"],"sourcesContent":["/*\n * Attachments - Item\n */\n\n$class: \".gov-attachments-item\";\n\n#{$class} {\n\t@include base();\n\tmargin: rem-calc(0 0 8);\n\t&__messages {\n\t\t@include reset-last-margin();\n\t}\n\t&__file {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t}\n\t&__name {\n\t\tdisplay: flex;\n\t\tgap: 0 rem-calc(8);\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\talign-self: center;\n\t\tmargin: 0;\n\t\tcolor: $attachments-name-color;\n\t\tspan {\n\t\t\t@include typography($font-size-xs);\n\t\t\tcolor: $attachments-decor-color;\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop } from '@stencil/core'\nimport { AttachmentsItemClass } from './constants'\nimport { validateWcagLabel } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-attachments-item',\n\tstyleUrl: 'gov-attachments-item.scss',\n})\nexport class GovAttachmentsItem {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAttachmentsItemElement\n\n\t/**\n\t * Adds accessible label for the remove button that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-remove-label' }) readonly wcagRemoveLabel: string\n\t/**\n\t * Indicates the id of a component that labels the remove button.\n\t */\n\t@Prop({ attribute: 'wcag-remove-labelled-by' }) readonly wcagRemoveLabelledBy: string\n\t/**\n\t * Emitted when the file is removed\n\t */\n\t@Event({ eventName: 'gov-remove' }) govRemove: EventEmitter<PointerEvent>\n\n\tasync componentDidRender() {\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\treturn (\n\t\t\t<Host class={this.h.classes(AttachmentsItemClass.root)} role=\"listitem\">\n\t\t\t\t<div class={AttachmentsItemClass.file}>\n\t\t\t\t\t<p class={AttachmentsItemClass.name}>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t<slot name=\"info\" />\n\t\t\t\t\t</p>\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\twcag-label={this.wcagRemoveLabel}\n\t\t\t\t\t\twcag-labelled-by={this.wcagRemoveLabelledBy}\n\t\t\t\t\t\ton-gov-click={this.govRemove.emit}\n\t\t\t\t\t>\n\t\t\t\t\t\t<gov-icon slot=\"left-icon\" name=\"x-lg\"></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot('message') && (\n\t\t\t\t\t<div class={AttachmentsItemClass.messages}>\n\t\t\t\t\t\t<slot name=\"message\" />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\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\tvalidateWcagLabel(this.wcagRemoveLabel, this.wcagRemoveLabelledBy, AttachmentsItemClass.root)\n\t}\n}\n"],"version":3}
@@ -50,7 +50,6 @@ function defineCustomElement() {
50
50
  break;
51
51
  } });
52
52
  }
53
- defineCustomElement();
54
53
 
55
54
  export { GovAttachments as G, defineCustomElement as d };
56
55
 
@@ -1 +1 @@
1
- {"file":"gov-attachments2.js","mappings":";;;;;;;AAAA,MAAM,iBAAiB,GAAG,qrBAAqrB;;MCYlsB,cAAc;EAG1B;;;;;IACC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAYD,MAAM,kBAAkB;IACvB,IAAI,uBAAuB,EAAE,EAAE;MAC9B,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;MAChB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;KACzB;GACD;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAChD,IAAI,CAAC,KAAK,GAAG,SAAG,KAAK,EAAE,gBAAgB,CAAC,KAAK,IAAG,IAAI,CAAC,KAAK,CAAK,GAAG,IAAI,EACvE,WAAK,KAAK,EAAE,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAC,MAAM,gBAAa,IAAI,CAAC,SAAS,IACxE,eAAQ,CACH,CACA,EACP;GACD;;;;EAMD,MAAM,YAAY;IACjB,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAA;GACrE;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-attachments/gov-attachments.scss?tag=gov-attachments","../../../packages/core/src/components/gov-attachments/gov-attachments.tsx"],"sourcesContent":["/*\n * Attachments\n */\n\n$class: \".gov-attachments\";\n\n#{$class} {\n\t@include base();\n\t&__label {\n\t\t@include typography($font-size-s);\n\t\tcolor: $form-label-color;\n\t}\n\t&__list {\n\t\t@include reset-last-margin();\n\t}\n}\n","import { Component, Element, h, Host, Method, Prop } from '@stencil/core'\nimport { AttachmentsClass } from './constants'\nimport { validateWcagProp } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-attachments',\n\tstyleUrl: 'gov-attachments.scss',\n})\nexport class GovAttachments {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAttachmentsElement\n\t/**\n\t * Label of attachments section\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Adds accessible label for the attachment section that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\n\tasync componentDidRender() {\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\treturn (\n\t\t\t<Host class={this.h.classes(AttachmentsClass.root)}>\n\t\t\t\t{this.label ? <p class={AttachmentsClass.label}>{this.label}</p> : null}\n\t\t\t\t<div class={AttachmentsClass.list} role=\"list\" aria-label={this.wcagLabel}>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\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\tvalidateWcagProp(this.wcagLabel, 'wcag-label', AttachmentsClass.root)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-attachments2.js","mappings":";;;;;;;AAAA,MAAM,iBAAiB,GAAG,qrBAAqrB;;MCYlsB,cAAc;EAG1B;;;;;IACC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAYD,MAAM,kBAAkB;IACvB,IAAI,uBAAuB,EAAE,EAAE;MAC9B,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;MAChB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;KACzB;GACD;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAChD,IAAI,CAAC,KAAK,GAAG,SAAG,KAAK,EAAE,gBAAgB,CAAC,KAAK,IAAG,IAAI,CAAC,KAAK,CAAK,GAAG,IAAI,EACvE,WAAK,KAAK,EAAE,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAC,MAAM,gBAAa,IAAI,CAAC,SAAS,IACxE,eAAQ,CACH,CACA,EACP;GACD;;;;EAMD,MAAM,YAAY;IACjB,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAA;GACrE;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-attachments/gov-attachments.scss?tag=gov-attachments","../../../packages/core/src/components/gov-attachments/gov-attachments.tsx"],"sourcesContent":["/*\n * Attachments\n */\n\n$class: \".gov-attachments\";\n\n#{$class} {\n\t@include base();\n\t&__label {\n\t\t@include typography($font-size-s);\n\t\tcolor: $form-label-color;\n\t}\n\t&__list {\n\t\t@include reset-last-margin();\n\t}\n}\n","import { Component, Element, h, Host, Method, Prop } from '@stencil/core'\nimport { AttachmentsClass } from './constants'\nimport { validateWcagProp } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-attachments',\n\tstyleUrl: 'gov-attachments.scss',\n})\nexport class GovAttachments {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAttachmentsElement\n\t/**\n\t * Label of attachments section\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Adds accessible label for the attachment section that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\n\tasync componentDidRender() {\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\treturn (\n\t\t\t<Host class={this.h.classes(AttachmentsClass.root)}>\n\t\t\t\t{this.label ? <p class={AttachmentsClass.label}>{this.label}</p> : null}\n\t\t\t\t<div class={AttachmentsClass.list} role=\"list\" aria-label={this.wcagLabel}>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\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\tvalidateWcagProp(this.wcagLabel, 'wcag-label', AttachmentsClass.root)\n\t}\n}\n"],"version":3}
@@ -57,7 +57,6 @@ function defineCustomElement() {
57
57
  break;
58
58
  } });
59
59
  }
60
- defineCustomElement();
61
60
 
62
61
  export { GovBackdrop as G, defineCustomElement as d };
63
62
 
@@ -1 +1 @@
1
- {"file":"gov-backdrop2.js","mappings":";;;;;;AAAO,MAAM,aAAa,GAAG;EAC5B,IAAI,EAAE,cAAc;EACpB,EAAE,EAAE,kBAAkB;CACtB;;ACHD,MAAM,cAAc,GAAG,uxBAAuxB;;MCYjyB,WAAW;EAGvB;;;;mBAQoC,KAAK;;;IAPxC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAoBD,MAAM,kBAAkB;IACvB,IAAI,uBAAuB,EAAE,EAAE;MAC9B,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;MAChB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;KACzB;GACD;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,IAC9C,WACC,IAAI,EAAE,QAAQ,gBACF,IAAI,CAAC,SAAS,qBACT,IAAI,CAAC,cAAc,EACpC,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EACnC,KAAK,EAAE,aAAa,CAAC,EAAE,GACjB,CACD,EACP;GACD;;;;EAMD,MAAM,YAAY;IACjB,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;GAC1E;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-backdrop/constants.ts","../../../packages/core/src/components/gov-backdrop/gov-backdrop.scss?tag=gov-backdrop","../../../packages/core/src/components/gov-backdrop/gov-backdrop.tsx"],"sourcesContent":["export const BackdropClass = {\n\troot: 'gov-backdrop',\n\tbg: 'gov-backdrop__bg',\n}\n","/*\n * Backdrop\n */\n\n$class: \".gov-backdrop\";\n\n#{$class} {\n\t&__bg {\n\t\t@include z-index(\"modal\", 0);\n\t\tposition: fixed;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tbackground-color: $backdrop-bg;\n\t\topacity: $backdrop-opacity;\n\t}\n\n\t// VARIANTS\n\t@include parameter(\"inverse\") {\n\t\t#{$class} {\n\t\t\t&__bg {\n\t\t\t\tbackground-color: $backdrop-bg-inverse;\n\t\t\t\topacity: $backdrop-opacity-inverse;\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Event, EventEmitter, h, Method, Prop, Host, Element } from '@stencil/core'\nimport { validateWcagLabel } from '../../helpers/Validate/wcag'\nimport { BackdropClass } from './constants'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-backdrop',\n\tstyleUrl: 'gov-backdrop.scss',\n})\nexport class GovBackdrop {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovAlertElement\n\t/**\n\t * Determide if component should have inversed colors to be used on dark background.\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * Adds accessible label for the backdrop that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when button clicks.\n\t */\n\t@Event({ eventName: 'gov-click' }) govClick: EventEmitter<MouseEvent>\n\n\tasync componentDidRender() {\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\treturn (\n\t\t\t<Host class={this.h.classes(BackdropClass.root)}>\n\t\t\t\t<div\n\t\t\t\t\trole={'button'}\n\t\t\t\t\taria-label={this.wcagLabel}\n\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\tonClick={e => this.govClick.emit(e)}\n\t\t\t\t\tclass={BackdropClass.bg}\n\t\t\t\t></div>\n\t\t\t</Host>\n\t\t)\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\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, BackdropClass.root)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-backdrop2.js","mappings":";;;;;;AAAO,MAAM,aAAa,GAAG;EAC5B,IAAI,EAAE,cAAc;EACpB,EAAE,EAAE,kBAAkB;CACtB;;ACHD,MAAM,cAAc,GAAG,uxBAAuxB;;MCYjyB,WAAW;EAGvB;;;;mBAQoC,KAAK;;;IAPxC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAoBD,MAAM,kBAAkB;IACvB,IAAI,uBAAuB,EAAE,EAAE;MAC9B,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;MAChB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;KACzB;GACD;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,IAC9C,WACC,IAAI,EAAE,QAAQ,gBACF,IAAI,CAAC,SAAS,qBACT,IAAI,CAAC,cAAc,EACpC,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EACnC,KAAK,EAAE,aAAa,CAAC,EAAE,GACjB,CACD,EACP;GACD;;;;EAMD,MAAM,YAAY;IACjB,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,IAAI,CAAC,CAAA;GAC1E;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-backdrop/constants.ts","../../../packages/core/src/components/gov-backdrop/gov-backdrop.scss?tag=gov-backdrop","../../../packages/core/src/components/gov-backdrop/gov-backdrop.tsx"],"sourcesContent":["export const BackdropClass = {\n\troot: 'gov-backdrop',\n\tbg: 'gov-backdrop__bg',\n}\n","/*\n * Backdrop\n */\n\n$class: \".gov-backdrop\";\n\n#{$class} {\n\t&__bg {\n\t\t@include z-index(\"modal\", 0);\n\t\tposition: fixed;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tbackground-color: $backdrop-bg;\n\t\topacity: $backdrop-opacity;\n\t}\n\n\t// VARIANTS\n\t@include parameter(\"inverse\") {\n\t\t#{$class} {\n\t\t\t&__bg {\n\t\t\t\tbackground-color: $backdrop-bg-inverse;\n\t\t\t\topacity: $backdrop-opacity-inverse;\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Event, EventEmitter, h, Method, Prop, Host, Element } from '@stencil/core'\nimport { validateWcagLabel } from '../../helpers/Validate/wcag'\nimport { BackdropClass } from './constants'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-backdrop',\n\tstyleUrl: 'gov-backdrop.scss',\n})\nexport class GovBackdrop {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovAlertElement\n\t/**\n\t * Determide if component should have inversed colors to be used on dark background.\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * Adds accessible label for the backdrop that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when button clicks.\n\t */\n\t@Event({ eventName: 'gov-click' }) govClick: EventEmitter<MouseEvent>\n\n\tasync componentDidRender() {\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\treturn (\n\t\t\t<Host class={this.h.classes(BackdropClass.root)}>\n\t\t\t\t<div\n\t\t\t\t\trole={'button'}\n\t\t\t\t\taria-label={this.wcagLabel}\n\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\tonClick={e => this.govClick.emit(e)}\n\t\t\t\t\tclass={BackdropClass.bg}\n\t\t\t\t></div>\n\t\t\t</Host>\n\t\t)\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\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, BackdropClass.root)\n\t}\n}\n"],"version":3}
@@ -101,7 +101,6 @@ function defineCustomElement() {
101
101
  break;
102
102
  } });
103
103
  }
104
- defineCustomElement();
105
104
 
106
105
  export { GovBadge as G, defineCustomElement as d };
107
106
 
@@ -1 +1 @@
1
- {"file":"gov-badge2.js","mappings":";;;;;AAEA,IAAY,UAIX;AAJD,WAAY,UAAU;EACrB,qBAAO,CAAA;EACP,2BAAa,CAAA;EACb,+BAAiB,CAAA;AAClB,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAIM,MAAM,UAAU,GAAG;EACzB,IAAI,EAAE,WAAW;EACjB,KAAK,EAAE,kBAAkB;EACzB,QAAQ,EAAE,sBAAsB;EAChC,OAAO,EAAE,qB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CAAC,CAAA;KACrB;GACD;;;;EAMD,MAAM,aAAa;IAClB,OAAO,IAAI,CAAC,UAAU,CAAA;GACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-badge/constants.ts","../../../packages/core/src/components/gov-badge/gov-badge.scss?tag=gov-badge","../../../packages/core/src/components/gov-badge/gov-badge.tsx"],"sourcesContent":["import { ValueOf } from '../../types/interfaces'\n\nexport enum NativeType {\n\tA = 'a',\n\tSPAN = 'span',\n\tBUTTON = 'button',\n}\n\nexport type NativeTypesType = `${ValueOf<typeof NativeType>}`\n\nexport const BadgeClass = {\n\troot: 'gov-badge',\n\tinner: 'gov-badge__inner',\n\thasRight: 'gov-badge--has-right',\n\thasLeft: 'gov-badge--has-left',\n}\n","/*\n * Badge\n */\n\n// Shared definitions - button & badge\n@import \"../gov-button/default/gov-button-core\";\n\n.gov-badge {\n\t@extend %button-core;\n\tdisplay: inline-flex;\n\ta .gov-icon {\n\t\tmargin: 0;\n\t}\n\t.element {\n\t\tpadding: rem-calc(4 10);\n\t\tfont-family: $font-family-primary;\n\t\tfont-weight: 400;\n\t\tletter-spacing: initial;\n\t}\n\t.gov-button {\n\t\t.element {\n\t\t\tborder: none;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $button-sizes {\n\t\t$radius: calc(#{get(\"min-height\", $definitions)} * 0.5);\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tborder-radius: $radius;\n\t\t\t}\n\n\t\t\t// HOVERS\n\t\t\t&[hoverable] .element {\n\t\t\t\t@include focus-outline($radius, $outline-offset);\n\t\t\t}\n\t\t}\n\t}\n\t@each $variant, $types in $badge-inverse-variants {\n\t\t&[type=\"solid\"][variant=\"#{$variant}\"] {\n\t\t\t@include parameter(\"inverse\") {\n\t\t\t\t.element {\n\t\t\t\t\tborder-width: rem-calc(1);\n\t\t\t\t\tborder-color: deep-map-get($badge-inverse-variants, $variant, \"border-color\");\n\t\t\t\t\tbackground-color: deep-map-get($badge-inverse-variants, $variant, \"bg\");\n\t\t\t\t\tcolor: deep-map-get($badge-inverse-variants, $variant, \"color\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t&--has-right > .element {\n\t\tpadding-top: 0 !important;\n\t\tpadding-bottom: 0 !important;\n\t\tpadding-right: 0 !important;\n\t}\n\n\t&--has-left > .element {\n\t\tpadding-top: 0 !important;\n\t\tpadding-bottom: 0 !important;\n\t\tpadding-left: 0 !important;\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from \"@stencil/core\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { BadgeClass, NativeType, NativeTypesType } from \"./constants\"\nimport {\n\tButtonSizes,\n\tButtonSizesType,\n\tButtonVariants,\n\tButtonVariantType,\n\tType,\n\tTypesType,\n} from \"../gov-button/default/constants\"\n\n@Component({\n\ttag: \"gov-badge\",\n\tstyleUrl: \"gov-badge.scss\",\n})\nexport class GovBadge {\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovBadgeElement\n\n\t/**\n\t * Determide if component should have inversed colors to be used on dark background\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * Makes the badge component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target: string\n\t/**\n\t * Badge’s size.\n\t */\n\t@Prop() readonly size: ButtonSizesType = \"m\"\n\t/**\n\t * Badges's type\n\t */\n\t@Prop() readonly type: TypesType = \"solid\"\n\t/**\n\t * Used to change the HMTL tag in the badge\n\t */\n\t@Prop() readonly tag: NativeTypesType = \"span\"\n\t/**\n\t * Style variation of the badge.\n\t */\n\t@Prop() readonly variant: ButtonVariantType = \"primary\"\n\t/**\n\t * Adds accessible label for the button that is only shown for screen readers.\n\t * Typically, this label text replaces the visible text on the button for users who use assistive technology.\n\t */\n\t@Prop({ attribute: \"wcag-label\" }) readonly wcagLabel: string\n\t/**\n\t * Emitted when the button click.\n\t */\n\t@Event({ eventName: \"gov-click\" }) govClick: EventEmitter<PointerEvent>\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ButtonVariants, newValue, BadgeClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, BadgeClass.root)\n\t}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(Type, newValue, BadgeClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateType(this.type)\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? NativeType.A : this.tag\n\t\tconst nativeType = Tag == NativeType.BUTTON ? NativeType.BUTTON : undefined\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([\n\t\t\t\t\tBadgeClass.root,\n\t\t\t\t\tthis.h.hasSlot(\"right\") ? BadgeClass.hasRight : undefined,\n\t\t\t\t\tthis.h.hasSlot(\"left\") ? BadgeClass.hasLeft : undefined,\n\t\t\t\t])}\n\t\t\t\tdisabled={this.disabled}\n\t\t\t\thref={this.href}\n\t\t\t\tvariant={this.variant}\n\t\t\t\tsize={this.size}\n\t\t\t\ttype={this.type}\n\t\t\t\tinverse={this.inverse}\n\t\t\t\thoverable={Tag == NativeType.A || Tag == NativeType.BUTTON}\n\t\t\t>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\taria-label={this.wcagLabel}\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLLinkElement | HTMLButtonElement | HTMLSpanElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\ttype={nativeType}>\n\t\t\t\t\t{this.h.hasSlot(\"left\") && <slot name=\"left\"></slot>}\n\t\t\t\t\t{this.h.hasSlot(\"left-icon\") && <slot name=\"left-icon\"></slot>}\n\t\t\t\t\t<slot />\n\t\t\t\t\t{this.h.hasSlot(\"right-icon\") && <slot name=\"right-icon\"></slot>}\n\t\t\t\t\t{this.h.hasSlot(\"right\") && <slot name=\"right\"></slot>}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false && this.tag === NativeType.BUTTON) {\n\t\t\tthis.govClick.emit(e)\n\t\t}\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getTriggerRef() {\n\t\treturn this.triggerRef\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-badge2.js","mappings":";;;;;AAEA,IAAY,UAIX;AAJD,WAAY,UAAU;EACrB,qBAAO,CAAA;EACP,2BAAa,CAAA;EACb,+BAAiB,CAAA;AAClB,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAIM,MAAM,UAAU,GAAG;EACzB,IAAI,EAAE,WAAW;EACjB,KAAK,EAAE,kBAAkB;EACzB,QAAQ,EAAE,sBAAsB;EAChC,OAAO,EAAE,qBAAqB;CAC9B;;ACfD,MAAM,WAAW,GAAG,m01EAAm01E;;MCkB101E,QAAQ;EAIpB;;;;mBASoC,KAAK;oBAKJ,KAAK;;;gBAcD,GAAG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;;;;;;;;","names":[],"sources":["../../../packages/core/src/components/gov-badge/constants.ts","../../../packages/core/src/components/gov-badge/gov-badge.scss?tag=gov-badge","../../../packages/core/src/components/gov-badge/gov-badge.tsx"],"sourcesContent":["import { ValueOf } from '../../types/interfaces'\n\nexport enum NativeType {\n\tA = 'a',\n\tSPAN = 'span',\n\tBUTTON = 'button',\n}\n\nexport type NativeTypesType = `${ValueOf<typeof NativeType>}`\n\nexport const BadgeClass = {\n\troot: 'gov-badge',\n\tinner: 'gov-badge__inner',\n\thasRight: 'gov-badge--has-right',\n\thasLeft: 'gov-badge--has-left',\n}\n","/*\n * Badge\n */\n\n// Shared definitions - button & badge\n@import \"../gov-button/default/gov-button-core\";\n\n.gov-badge {\n\t@extend %button-core;\n\tdisplay: inline-flex;\n\ta .gov-icon {\n\t\tmargin: 0;\n\t}\n\t.element {\n\t\tpadding: rem-calc(4 10);\n\t\tfont-family: $font-family-primary;\n\t\tfont-weight: 400;\n\t\tletter-spacing: initial;\n\t}\n\t.gov-button {\n\t\t.element {\n\t\t\tborder: none;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $button-sizes {\n\t\t$radius: calc(#{get(\"min-height\", $definitions)} * 0.5);\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tborder-radius: $radius;\n\t\t\t}\n\n\t\t\t// HOVERS\n\t\t\t&[hoverable] .element {\n\t\t\t\t@include focus-outline($radius, $outline-offset);\n\t\t\t}\n\t\t}\n\t}\n\t@each $variant, $types in $badge-inverse-variants {\n\t\t&[type=\"solid\"][variant=\"#{$variant}\"] {\n\t\t\t@include parameter(\"inverse\") {\n\t\t\t\t.element {\n\t\t\t\t\tborder-width: rem-calc(1);\n\t\t\t\t\tborder-color: deep-map-get($badge-inverse-variants, $variant, \"border-color\");\n\t\t\t\t\tbackground-color: deep-map-get($badge-inverse-variants, $variant, \"bg\");\n\t\t\t\t\tcolor: deep-map-get($badge-inverse-variants, $variant, \"color\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t&--has-right > .element {\n\t\tpadding-top: 0 !important;\n\t\tpadding-bottom: 0 !important;\n\t\tpadding-right: 0 !important;\n\t}\n\n\t&--has-left > .element {\n\t\tpadding-top: 0 !important;\n\t\tpadding-bottom: 0 !important;\n\t\tpadding-left: 0 !important;\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch } from \"@stencil/core\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { BadgeClass, NativeType, NativeTypesType } from \"./constants\"\nimport {\n\tButtonSizes,\n\tButtonSizesType,\n\tButtonVariants,\n\tButtonVariantType,\n\tType,\n\tTypesType,\n} from \"../gov-button/default/constants\"\n\n@Component({\n\ttag: \"gov-badge\",\n\tstyleUrl: \"gov-badge.scss\",\n})\nexport class GovBadge {\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovBadgeElement\n\n\t/**\n\t * Determide if component should have inversed colors to be used on dark background\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * Makes the badge component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target: string\n\t/**\n\t * Badge’s size.\n\t */\n\t@Prop() readonly size: ButtonSizesType = \"m\"\n\t/**\n\t * Badges's type\n\t */\n\t@Prop() readonly type: TypesType = \"solid\"\n\t/**\n\t * Used to change the HMTL tag in the badge\n\t */\n\t@Prop() readonly tag: NativeTypesType = \"span\"\n\t/**\n\t * Style variation of the badge.\n\t */\n\t@Prop() readonly variant: ButtonVariantType = \"primary\"\n\t/**\n\t * Adds accessible label for the button that is only shown for screen readers.\n\t * Typically, this label text replaces the visible text on the button for users who use assistive technology.\n\t */\n\t@Prop({ attribute: \"wcag-label\" }) readonly wcagLabel: string\n\t/**\n\t * Emitted when the button click.\n\t */\n\t@Event({ eventName: \"gov-click\" }) govClick: EventEmitter<PointerEvent>\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ButtonVariants, newValue, BadgeClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, BadgeClass.root)\n\t}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(Type, newValue, BadgeClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateType(this.type)\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? NativeType.A : this.tag\n\t\tconst nativeType = Tag == NativeType.BUTTON ? NativeType.BUTTON : undefined\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([\n\t\t\t\t\tBadgeClass.root,\n\t\t\t\t\tthis.h.hasSlot(\"right\") ? BadgeClass.hasRight : undefined,\n\t\t\t\t\tthis.h.hasSlot(\"left\") ? BadgeClass.hasLeft : undefined,\n\t\t\t\t])}\n\t\t\t\tdisabled={this.disabled}\n\t\t\t\thref={this.href}\n\t\t\t\tvariant={this.variant}\n\t\t\t\tsize={this.size}\n\t\t\t\ttype={this.type}\n\t\t\t\tinverse={this.inverse}\n\t\t\t\thoverable={Tag == NativeType.A || Tag == NativeType.BUTTON}\n\t\t\t>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\taria-label={this.wcagLabel}\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLLinkElement | HTMLButtonElement | HTMLSpanElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\ttype={nativeType}>\n\t\t\t\t\t{this.h.hasSlot(\"left\") && <slot name=\"left\"></slot>}\n\t\t\t\t\t{this.h.hasSlot(\"left-icon\") && <slot name=\"left-icon\"></slot>}\n\t\t\t\t\t<slot />\n\t\t\t\t\t{this.h.hasSlot(\"right-icon\") && <slot name=\"right-icon\"></slot>}\n\t\t\t\t\t{this.h.hasSlot(\"right\") && <slot name=\"right\"></slot>}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false && this.tag === NativeType.BUTTON) {\n\t\t\tthis.govClick.emit(e)\n\t\t}\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getTriggerRef() {\n\t\treturn this.triggerRef\n\t}\n}\n"],"version":3}
@@ -58,7 +58,6 @@ function defineCustomElement$1() {
58
58
  break;
59
59
  } });
60
60
  }
61
- defineCustomElement$1();
62
61
 
63
62
  const GovBreadcrumbs = GovBreadcrumbs$1;
64
63
  const defineCustomElement = defineCustomElement$1;
@@ -1 +1 @@
1
- {"file":"gov-breadcrumbs.js","mappings":";;;;;;AAAO,MAAM,gBAAgB,GAAG;EAC/B,IAAI,EAAE,iBAAiB;CACvB;;ACFD,MAAM,iBAAiB,GAAG,mrCAAmrC;;MCahsCA,gBAAc;EAG1B;;;;uBAQwC,KAAK;sBAIsB,KAAK;;;IAXvE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAyBD,MAAM,kBAAkB;IACvB,IAAI,uBAAuB,EAAE,EAAE;MAC9B,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;MAChB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;KACzB;GACD;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,IACjD,yBAAiB,IAAI,CAAC,SAAS,qBAAmB,IAAI,CAAC,cAAc,IACpE,eAAO,CACF,CACA,EACP;GACD;;;;EAOD,MAAM,YAAY;IACjB,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAA;GAC7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["GovBreadcrumbs"],"sources":["../../../packages/core/src/components/gov-breadcrumbs/constants.ts","../../../packages/core/src/components/gov-breadcrumbs/gov-breadcrumbs.scss?tag=gov-breadcrumbs","../../../packages/core/src/components/gov-breadcrumbs/gov-breadcrumbs.tsx"],"sourcesContent":["export const BreadcrumbsClass = {\n\troot: 'gov-breadcrumbs',\n}\n","/*\n * Pagination\n */\n\n$class: \".gov-breadcrumbs\";\n\n#{$class} {\n\tul {\n\t\t@extend %reset-ul;\n\t\t@include base(flex);\n\t\tpadding-bottom: rem-calc(5);\n\t\toverflow-x: auto;\n\t}\n\tli {\n\t\t@extend %reset-ul-li;\n\t\tdisplay: flex;\n\t\tjustify-content: flex-start;\n\t\talign-items: center;\n\t\twhite-space: nowrap;\n\t}\n\tbutton {\n\t\t@include typography($font-size-m);\n\t\tpadding: 0;\n\t\tborder: none;\n\t\tbackground: none;\n\t\tcolor: $breadcrumbs-link-color;\n\t\ttext-decoration: underline;\n\t\t&:hover {\n\t\t\ttext-decoration: none;\n\t\t}\n\t}\n\t& .gov-icon {\n\t\twidth: rem-calc(10);\n\t\theight: rem-calc(10);\n\t\tmargin: rem-calc(0 16px);\n\t\tcolor: $breadcrumbs-arrow-color;\n\t}\n}\n","import { Component, Element, h, Host, Method, Prop, Event, EventEmitter } from '@stencil/core'\nimport { BreadcrumbsClass } from './constants'\nimport { validateWcagLabel } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { GovBreadcrumbsChangeEvent } from './gov-breadcrumbs.d'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-breadcrumbs',\n\tstyleUrl: 'gov-breadcrumbs.scss',\n})\nexport class GovBreadcrumbs {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovBreadcrumbsElement\n\t/**\n\t * Defines wether the components can be collapsible when element doesn't fit in one row.\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Defines whether the breadcrumbs are open or closed by default\n\t */\n\t@Prop({ attribute: 'is-expanded' }) readonly isExpanded: boolean = false\n\t/**\n\t * Adds accessible label for the pagination that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({ attribute: 'wcag-labelded-by' }) readonly wcagLabelledBy: string\n\n\t/**\n\t * Called when the Breadrumbs state changes\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<GovBreadcrumbsChangeEvent>\n\n\tasync componentDidRender() {\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\treturn (\n\t\t\t<Host class={this.h.classes(BreadcrumbsClass.root)}>\n\t\t\t\t<nav aria-label={this.wcagLabel} aria-labelledby={this.wcagLabelledBy}>\n\t\t\t\t\t<slot/>\n\t\t\t\t</nav>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, BreadcrumbsClass.root)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-breadcrumbs.js","mappings":";;;;;;AAAO,MAAM,gBAAgB,GAAG;EAC/B,IAAI,EAAE,iBAAiB;CACvB;;ACFD,MAAM,iBAAiB,GAAG,mrCAAmrC;;MCahsCA,gBAAc;EAG1B;;;;uBAQwC,KAAK;sBAIsB,KAAK;;;IAXvE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAyBD,MAAM,kBAAkB;IACvB,IAAI,uBAAuB,EAAE,EAAE;MAC9B,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;MAChB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;KACzB;GACD;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,IACjD,yBAAiB,IAAI,CAAC,SAAS,qBAAmB,IAAI,CAAC,cAAc,IACpE,eAAO,CACF,CACA,EACP;GACD;;;;EAOD,MAAM,YAAY;IACjB,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAA;GAC7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["GovBreadcrumbs"],"sources":["../../../packages/core/src/components/gov-breadcrumbs/constants.ts","../../../packages/core/src/components/gov-breadcrumbs/gov-breadcrumbs.scss?tag=gov-breadcrumbs","../../../packages/core/src/components/gov-breadcrumbs/gov-breadcrumbs.tsx"],"sourcesContent":["export const BreadcrumbsClass = {\n\troot: 'gov-breadcrumbs',\n}\n","/*\n * Pagination\n */\n\n$class: \".gov-breadcrumbs\";\n\n#{$class} {\n\tul {\n\t\t@extend %reset-ul;\n\t\t@include base(flex);\n\t\tpadding-bottom: rem-calc(5);\n\t\toverflow-x: auto;\n\t}\n\tli {\n\t\t@extend %reset-ul-li;\n\t\tdisplay: flex;\n\t\tjustify-content: flex-start;\n\t\talign-items: center;\n\t\twhite-space: nowrap;\n\t}\n\tbutton {\n\t\t@include typography($font-size-m);\n\t\tpadding: 0;\n\t\tborder: none;\n\t\tbackground: none;\n\t\tcolor: $breadcrumbs-link-color;\n\t\ttext-decoration: underline;\n\t\t&:hover {\n\t\t\ttext-decoration: none;\n\t\t}\n\t}\n\t& .gov-icon {\n\t\twidth: rem-calc(10);\n\t\theight: rem-calc(10);\n\t\tmargin: rem-calc(0 16px);\n\t\tcolor: $breadcrumbs-arrow-color;\n\t}\n}\n","import { Component, Element, h, Host, Method, Prop, Event, EventEmitter } from '@stencil/core'\nimport { BreadcrumbsClass } from './constants'\nimport { validateWcagLabel } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { GovBreadcrumbsChangeEvent } from './gov-breadcrumbs.d'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-breadcrumbs',\n\tstyleUrl: 'gov-breadcrumbs.scss',\n})\nexport class GovBreadcrumbs {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovBreadcrumbsElement\n\t/**\n\t * Defines wether the components can be collapsible when element doesn't fit in one row.\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Defines whether the breadcrumbs are open or closed by default\n\t */\n\t@Prop({ attribute: 'is-expanded' }) readonly isExpanded: boolean = false\n\t/**\n\t * Adds accessible label for the pagination that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({ attribute: 'wcag-labelded-by' }) readonly wcagLabelledBy: string\n\n\t/**\n\t * Called when the Breadrumbs state changes\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<GovBreadcrumbsChangeEvent>\n\n\tasync componentDidRender() {\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\treturn (\n\t\t\t<Host class={this.h.classes(BreadcrumbsClass.root)}>\n\t\t\t\t<nav aria-label={this.wcagLabel} aria-labelledby={this.wcagLabelledBy}>\n\t\t\t\t\t<slot/>\n\t\t\t\t</nav>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, BreadcrumbsClass.root)\n\t}\n}\n"],"version":3}
@@ -216,7 +216,6 @@ function defineCustomElement() {
216
216
  break;
217
217
  } });
218
218
  }
219
- defineCustomElement();
220
219
 
221
220
  export { GovButton as G, defineCustomElement as d };
222
221
 
@@ -1 +1 @@
1
- {"file":"gov-button2.js","mappings":";;;;;;;;;;SAAgB,MAAM,CAAC,KAAU;EAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IAC9B,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;GAC1D;OAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IACrC,OAAO,KAAK,GAAG,CAAC,CAAA;GAChB;OAAM,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;IACtC,OAAO,KAAK,CAAA;GACZ;OAAM;IACN,OAAO,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA;GAC3B;AACF;;ACVA,MAAM,YAAY,GAAG,uvyEAAuvyE;;ACsB5wyE,IAAK,IAGJ;AAHD,WAAK,IAAI;EACR,eAAO,CAAA;EACP,yBAAiB,CAAA;AACl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YAAY,EAAE,eAAe,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;MACrE,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;KACxE;GACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/default/gov-button.scss?tag=gov-button","../../../packages/core/src/components/gov-button/default/gov-button.tsx"],"sourcesContent":["export function toBool(value: any): boolean {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0\n\t} else if (typeof value === 'boolean') {\n\t\treturn value\n\t} else {\n\t\treturn value ? true : false\n\t}\n}\n","/*\n * Button\n */\n\n// Shared definitions - BUTTON & badge\n@import \"gov-button-core\";\n\n.gov-button {\n\t@extend %button-core;\n\tdisplay: inline-block;\n\t.element {\n\t\tborder-radius: #{$border-radius};\n\t}\n\n\t&[type=\"link\"] {\n\t\t.element {\n\t\t\tmin-height: inherit;\n\t\t\tpadding: 0 !important;\n\t\t\tline-height: inherit;\n\t\t\ttext-decoration: underline;\n\t\t\t@include hover() {\n\t\t\t\ttext-decoration: none;\n\t\t\t}\n\t\t}\n\t}\n\n\t// STATES\n\t&[loading=\"true\"],\n\t&[loading=\"1\"] {\n\t\t.element {\n\t\t\t> .gov-icon:not(.gov-spin-animation),\n\t\t\t> gov-icon:not(.gov-spin-animation) {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.gov-icon {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $button-sizes {\n\t\t// Loading state\n\t\t&[loading=\"0\"][size=\"#{$size}\"],\n\t\t&[loading=\"false\"][size=\"#{$size}\"],\n\t\t&[loading=\"\"][size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tpadding: get(\"padding-y\", $definitions) calc(((get(\"padding-x\", $definitions) * 3) + get(\"icon-size\", $definitions)) / 2);\n\t\t\t}\n\t\t}\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tfont-weight: map-get($definitions, \"font-weight\");\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport {\n\tButtonSizesType,\n\tNativeTypesType,\n\tTypesType,\n\tButtonVariants,\n\tButtonVariantType,\n\tButtonClass,\n\tType,\n\tNativeType,\n\tButtonTargetType,\n} from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined, prepareClasses } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { toBool } from \"../../../utils/bool.utils\"\nimport { Sizes } from \"../../../core/constants/sizes\"\nimport { validateWcagLabel, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { delay } from \"../../../utils/utils\"\nimport { ButtonEvent } from \"./gov-button.types\"\n\nenum Tags {\n\tA = \"a\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-button\",\n\tstyleUrl: \"gov-button.scss\",\n})\nexport class GovButton {\n\tprivate h: GovHost\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Style variation of the button\n\t */\n\t@Prop({ reflect: true }) readonly variant?: ButtonVariantType\n\t/**\n\t * Button’s size\n\t */\n\t@Prop({ reflect: true }) readonly size?: ButtonSizesType = \"m\"\n\t/**\n\t * Button's type\n\t */\n\t@Prop({ reflect: true }) readonly type?: TypesType = \"solid\"\n\t/**\n\t * Expands the button to fill 100% of the container width\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Determine if component should have inversed colors to be used on dark background\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Makes the button component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies\n\t */\n\t@Prop({ reflect: true }) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\n\t */\n\t@Prop() readonly nativeType?: NativeTypesType = \"button\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download\n\t */\n\t@Prop() readonly download: boolean\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-hreflang\n\t */\n\t@Prop() readonly hreflang: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-referrerpolicy\n\t */\n\t@Prop() readonly referrerpolicy: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-rel\n\t */\n\t@Prop() readonly rel: string\n\t/**\n\t * Indicates whether an asynchronous process is running\n\t */\n\t@Prop() readonly loading: string\n\t/**\n\t * Same as original parametr\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom button identifier\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Indicates the id of a related component’s visually focused element\n\t */\n\t@Prop({ attribute: \"wcag-active-descendant\" }) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this property to add an aria-controls attribute to the button. Use the attribute to point to the unique id of the content that the button manages\n\t */\n\t@Prop({ attribute: \"wcag-controls\" }) readonly wcagControls: string\n\t/**\n\t * Indicates the id of a component that describes the button\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Aria description the button\n\t */\n\t@Prop({ attribute: \"wcag-description\" }) readonly wcagDescription: string\n\t/**\n\t * Details of the component\n\t */\n\t@Prop({ attribute: \"wcag-details\" }) readonly wcagDetails: string\n\t/**\n\t * If a button expands or collapses adjacent content, then use the ariaExpanded prop to add the aria-expanded attribute to the button\n\t * Set the value to convey the current expanded (true) or collapsed (false) state of the content\n\t */\n\t@Prop({ attribute: \"wcag-expanded\" }) readonly wcagExpanded: boolean\n\t/**\n\t * Adds accessible label for the button that is only shown for screen readers\n\t * Typically, this label text replaces the visible text on the button for users who use assistive technology\n\t */\n\t@Prop({ attribute: \"wcag-label\" }) readonly wcagLabel: string\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component owned by the button\n\t */\n\t@Prop({ attribute: \"wcag-owns\" }) readonly wcagOwns: string\n\t/**\n\t * \tUse this property to add an aria-haspopup attribute to a button, if you are using it as a menu button\n\t */\n\t@Prop({ attribute: \"wcag-has-popup\" }) readonly wcagHasPopup: string\n\t/**\n\t * Tells screen reader the element is pressed\n\t */\n\t@Prop({ attribute: \"wcag-pressed\" }) readonly wcagPressed: string\n\t/**\n\t * Indicates the current item within a container or set of related elements\n\t */\n\t@Prop({ attribute: \"wcag-current\" }) readonly wcagCurrent: string\n\t/**\n\t * Emitted when the button click\n\t */\n\t@Event({ eventName: \"gov-click\" }) govClick: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button has focus\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button loses focus\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<ButtonEvent>\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ButtonVariants, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(Type, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"nativeType\")\n\tvalidateNativeType(newValue: string): void {\n\t\tvalidateProp(NativeType, newValue, ButtonClass.root)\n\t}\n\n\t@State() isPressed = false\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateType(this.type)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateNativeType(this.nativeType)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tget classNames(): string {\n\t\tconst { h } = this\n\n\t\treturn prepareClasses([ButtonClass.root, h.hasSlot(\"left-icon\") && ButtonClass.rootWithIcon, h.hasSlot(\"right-icon\") && ButtonClass.rootWithIcon])\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? Tags.A : Tags.BUTTON\n\t\tconst nativeType = Tag === Tags.A ? undefined : this.nativeType\n\n\t\treturn (\n\t\t\t<Host hoverable={true} size={this.size} variant={this.variant} class={this.h.classes(this.classNames)} type={this.type} inverse={this.inverse}>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLButtonElement | HTMLLinkElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\tonMouseDown={() => (this.isPressed = true)}\n\t\t\t\t\tonMouseUp={() => (this.isPressed = false)}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tdownload={this.download}\n\t\t\t\t\threflang={this.hreflang}\n\t\t\t\t\trel={this.rel}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\ttype={nativeType}\n\t\t\t\t\ttabindex={this.focusable ? \"0\" : \"-1\"}\n\t\t\t\t\taria-activedescendant={this.wcagActiveDescendant}\n\t\t\t\t\taria-describedby={this.wcagActiveDescendant}\n\t\t\t\t\taria-description={this.wcagDescription}\n\t\t\t\t\taria-controls={this.wcagControls}\n\t\t\t\t\taria-details={this.wcagDetails}\n\t\t\t\t\taria-expanded={toBoolAttrIfDefined(this.wcagExpanded)}\n\t\t\t\t\taria-label={this.wcagLabel}\n\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\taria-haspopup={toBoolAttrIfDefined(this.wcagHasPopup)}\n\t\t\t\t\taria-pressed={toBoolAttr(this.isPressed)}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\taria-current={this.wcagCurrent}\n\t\t\t\t>\n\t\t\t\t\t{toBool(this.loading) && !this.h.hasSlot(\"right-icon\") &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\"></gov-icon>}\n\t\t\t\t\t{this.h.hasSlot(\"left-icon\") && <slot name=\"left-icon\"></slot>}\n\t\t\t\t\t<slot />\n\t\t\t\t\t{this.h.hasSlot(\"right-icon\") && <slot name=\"right-icon\"></slot>}\n\t\t\t\t\t{toBool(this.loading) && this.h.hasSlot(\"right-icon\") &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\"></gov-icon>}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false) {\n\t\t\tthis.govClick.emit({\n\t\t\t\tcomponent: ButtonClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\tref: this.host,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.triggerRef.focus()\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getTriggerRef() {\n\t\treturn this.triggerRef\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\tif (this.focusable) {\n\t\t\tvalidateWcagRef(this.wcagActiveDescendant, \"aria-activedescendant\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagControls, \"aria-controls\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagDetails, \"aria-details\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagOwns, \"aria-owns\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagHasPopup, \"aria-haspopup\", ButtonClass.root)\n\t\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, But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EAAE,IAAI,CAAC,IAAI;KACd,CAAC,CAAA;GACF;;;;EAMD,MAAM,QAAQ;IACb,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA;GACvB;;;;EAMD,MAAM,aAAa;IAClB,OAAO,IAAI,CAAC,UAAU,CAAA;GACtB;;;;EAMD,MAAM,YAAY;IACjB,IAAI,IAAI,CAAC,SAAS,EAAE;MACnB,eAAe,CAAC,IAAI,CAAC,oBAAoB,EAAE,uBAAuB,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;MACrF,eAAe,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;MACrE,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;MACnE,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;MAC7D,eAAe,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;MACrE,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;KACxE;GACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["../../../packages/core/src/utils/bool.utils.ts","../../../packages/core/src/components/gov-button/default/gov-button.scss?tag=gov-button","../../../packages/core/src/components/gov-button/default/gov-button.tsx"],"sourcesContent":["export function toBool(value: any): boolean {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0\n\t} else if (typeof value === 'boolean') {\n\t\treturn value\n\t} else {\n\t\treturn value ? true : false\n\t}\n}\n","/*\n * Button\n */\n\n// Shared definitions - BUTTON & badge\n@import \"gov-button-core\";\n\n.gov-button {\n\t@extend %button-core;\n\tdisplay: inline-block;\n\t.element {\n\t\tborder-radius: #{$border-radius};\n\t}\n\n\t&[type=\"link\"] {\n\t\t.element {\n\t\t\tmin-height: inherit;\n\t\t\tpadding: 0 !important;\n\t\t\tline-height: inherit;\n\t\t\ttext-decoration: underline;\n\t\t\t@include hover() {\n\t\t\t\ttext-decoration: none;\n\t\t\t}\n\t\t}\n\t}\n\n\t// STATES\n\t&[loading=\"true\"],\n\t&[loading=\"1\"] {\n\t\t.element {\n\t\t\t> .gov-icon:not(.gov-spin-animation),\n\t\t\t> gov-icon:not(.gov-spin-animation) {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.gov-icon {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $button-sizes {\n\t\t// Loading state\n\t\t&[loading=\"0\"][size=\"#{$size}\"],\n\t\t&[loading=\"false\"][size=\"#{$size}\"],\n\t\t&[loading=\"\"][size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tpadding: get(\"padding-y\", $definitions) calc(((get(\"padding-x\", $definitions) * 3) + get(\"icon-size\", $definitions)) / 2);\n\t\t\t}\n\t\t}\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tfont-weight: map-get($definitions, \"font-weight\");\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport {\n\tButtonSizesType,\n\tNativeTypesType,\n\tTypesType,\n\tButtonVariants,\n\tButtonVariantType,\n\tButtonClass,\n\tType,\n\tNativeType,\n\tButtonTargetType,\n} from \"./constants\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined, prepareClasses } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { toBool } from \"../../../utils/bool.utils\"\nimport { Sizes } from \"../../../core/constants/sizes\"\nimport { validateWcagLabel, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { delay } from \"../../../utils/utils\"\nimport { ButtonEvent } from \"./gov-button.types\"\n\nenum Tags {\n\tA = \"a\",\n\tBUTTON = \"button\",\n}\n\n@Component({\n\ttag: \"gov-button\",\n\tstyleUrl: \"gov-button.scss\",\n})\nexport class GovButton {\n\tprivate h: GovHost\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\n\t/**\n\t * Style variation of the button\n\t */\n\t@Prop({ reflect: true }) readonly variant?: ButtonVariantType\n\t/**\n\t * Button’s size\n\t */\n\t@Prop({ reflect: true }) readonly size?: ButtonSizesType = \"m\"\n\t/**\n\t * Button's type\n\t */\n\t@Prop({ reflect: true }) readonly type?: TypesType = \"solid\"\n\t/**\n\t * Expands the button to fill 100% of the container width\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Determine if component should have inversed colors to be used on dark background\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * The name of the button, which gets paired with the button's value when submitted as part of a form. Corresponds with the native HTML name attribute\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Makes the button component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies\n\t */\n\t@Prop({ reflect: true }) readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type\n\t */\n\t@Prop() readonly nativeType?: NativeTypesType = \"button\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download\n\t */\n\t@Prop() readonly download: boolean\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-hreflang\n\t */\n\t@Prop() readonly hreflang: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-referrerpolicy\n\t */\n\t@Prop() readonly referrerpolicy: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-rel\n\t */\n\t@Prop() readonly rel: string\n\t/**\n\t * Indicates whether an asynchronous process is running\n\t */\n\t@Prop() readonly loading: string\n\t/**\n\t * Same as original parametr\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom button identifier\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Indicates the id of a related component’s visually focused element\n\t */\n\t@Prop({ attribute: \"wcag-active-descendant\" }) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this property to add an aria-controls attribute to the button. Use the attribute to point to the unique id of the content that the button manages\n\t */\n\t@Prop({ attribute: \"wcag-controls\" }) readonly wcagControls: string\n\t/**\n\t * Indicates the id of a component that describes the button\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Aria description the button\n\t */\n\t@Prop({ attribute: \"wcag-description\" }) readonly wcagDescription: string\n\t/**\n\t * Details of the component\n\t */\n\t@Prop({ attribute: \"wcag-details\" }) readonly wcagDetails: string\n\t/**\n\t * If a button expands or collapses adjacent content, then use the ariaExpanded prop to add the aria-expanded attribute to the button\n\t * Set the value to convey the current expanded (true) or collapsed (false) state of the content\n\t */\n\t@Prop({ attribute: \"wcag-expanded\" }) readonly wcagExpanded: boolean\n\t/**\n\t * Adds accessible label for the button that is only shown for screen readers\n\t * Typically, this label text replaces the visible text on the button for users who use assistive technology\n\t */\n\t@Prop({ attribute: \"wcag-label\" }) readonly wcagLabel: string\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component owned by the button\n\t */\n\t@Prop({ attribute: \"wcag-owns\" }) readonly wcagOwns: string\n\t/**\n\t * \tUse this property to add an aria-haspopup attribute to a button, if you are using it as a menu button\n\t */\n\t@Prop({ attribute: \"wcag-has-popup\" }) readonly wcagHasPopup: string\n\t/**\n\t * Tells screen reader the element is pressed\n\t */\n\t@Prop({ attribute: \"wcag-pressed\" }) readonly wcagPressed: string\n\t/**\n\t * Indicates the current item within a container or set of related elements\n\t */\n\t@Prop({ attribute: \"wcag-current\" }) readonly wcagCurrent: string\n\t/**\n\t * Emitted when the button click\n\t */\n\t@Event({ eventName: \"gov-click\" }) govClick: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button has focus\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<ButtonEvent>\n\t/**\n\t * Emitted when the button loses focus\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<ButtonEvent>\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ButtonVariants, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(Type, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(Sizes, newValue, ButtonClass.root)\n\t}\n\n\t@Watch(\"nativeType\")\n\tvalidateNativeType(newValue: string): void {\n\t\tvalidateProp(NativeType, newValue, ButtonClass.root)\n\t}\n\n\t@State() isPressed = false\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateType(this.type)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateNativeType(this.nativeType)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tget classNames(): string {\n\t\tconst { h } = this\n\n\t\treturn prepareClasses([ButtonClass.root, h.hasSlot(\"left-icon\") && ButtonClass.rootWithIcon, h.hasSlot(\"right-icon\") && ButtonClass.rootWithIcon])\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? Tags.A : Tags.BUTTON\n\t\tconst nativeType = Tag === Tags.A ? undefined : this.nativeType\n\n\t\treturn (\n\t\t\t<Host hoverable={true} size={this.size} variant={this.variant} class={this.h.classes(this.classNames)} type={this.type} inverse={this.inverse}>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLButtonElement | HTMLLinkElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\tonMouseDown={() => (this.isPressed = true)}\n\t\t\t\t\tonMouseUp={() => (this.isPressed = false)}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\tdownload={this.download}\n\t\t\t\t\threflang={this.hreflang}\n\t\t\t\t\trel={this.rel}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\ttype={nativeType}\n\t\t\t\t\ttabindex={this.focusable ? \"0\" : \"-1\"}\n\t\t\t\t\taria-activedescendant={this.wcagActiveDescendant}\n\t\t\t\t\taria-describedby={this.wcagActiveDescendant}\n\t\t\t\t\taria-description={this.wcagDescription}\n\t\t\t\t\taria-controls={this.wcagControls}\n\t\t\t\t\taria-details={this.wcagDetails}\n\t\t\t\t\taria-expanded={toBoolAttrIfDefined(this.wcagExpanded)}\n\t\t\t\t\taria-label={this.wcagLabel}\n\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\taria-haspopup={toBoolAttrIfDefined(this.wcagHasPopup)}\n\t\t\t\t\taria-pressed={toBoolAttr(this.isPressed)}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\taria-current={this.wcagCurrent}\n\t\t\t\t>\n\t\t\t\t\t{toBool(this.loading) && !this.h.hasSlot(\"right-icon\") &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\"></gov-icon>}\n\t\t\t\t\t{this.h.hasSlot(\"left-icon\") && <slot name=\"left-icon\"></slot>}\n\t\t\t\t\t<slot />\n\t\t\t\t\t{this.h.hasSlot(\"right-icon\") && <slot name=\"right-icon\"></slot>}\n\t\t\t\t\t{toBool(this.loading) && this.h.hasSlot(\"right-icon\") &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"loader\" class=\"gov-spin-animation\"></gov-icon>}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false) {\n\t\t\tthis.govClick.emit({\n\t\t\t\tcomponent: ButtonClass.root,\n\t\t\t\toriginalEvent: e,\n\t\t\t\tref: this.host,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: ButtonClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.triggerRef.focus()\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getTriggerRef() {\n\t\treturn this.triggerRef\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\tif (this.focusable) {\n\t\t\tvalidateWcagRef(this.wcagActiveDescendant, \"aria-activedescendant\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagControls, \"aria-controls\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagDetails, \"aria-details\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagOwns, \"aria-owns\", ButtonClass.root)\n\t\t\tvalidateWcagRef(this.wcagHasPopup, \"aria-haspopup\", ButtonClass.root)\n\t\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, ButtonClass.root)\n\t\t}\n\t}\n}\n"],"version":3}
@@ -134,7 +134,6 @@ function defineCustomElement$1() {
134
134
  break;
135
135
  } });
136
136
  }
137
- defineCustomElement$1();
138
137
 
139
138
  const GovCard = GovCard$1;
140
139
  const defineCustomElement = defineCustomElement$1;
@@ -1 +1 @@
1
- {"file":"gov-card.js","mappings":";;;;;;;;;AAAO,MAAM,SAAS,GAAG;EACxB,IAAI,EAAE,UAAU;EAChB,MAAM,EAAE,kBAAkB;EAC1B,KAAK,EAAE,iBAAiB;EACxB,KAAK,EAAE,iBAAiB;EACxB,GAAG,EAAE,eAAe;EACpB,IAAI,EAAE,gBAAgB;EACtB,OAAO,EAAE,mBAAmB;EAC5B,IAAI,EAAE,gBAAgB;EACtB,IAAI,EAAE,gBAAgB;EACtB,MAAM,EAAE,kBAAkB;EAC1B,KAAK,EAAE,iBAAiB;CACxB;;ACZD,MAAM,UAAU,GAAG,u8KAAu8K;;MCe78KA,SAAO;EAKnB;;;;qBAWsC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AAC,qBAAqB,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;KACpF;GACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["GovCard"],"sources":["../../../packages/core/src/components/gov-card/constants.ts","../../../packages/core/src/components/gov-card/gov-card.scss?tag=gov-card","../../../packages/core/src/components/gov-card/gov-card.tsx"],"sourcesContent":["export const CardClass = {\n\troot: 'gov-card',\n\theader: 'gov-card__header',\n\ttitle: 'gov-card__title',\n\tinner: 'gov-card__inner',\n\timg: 'gov-card__img',\n\tmain: 'gov-card__main',\n\tcontent: 'gov-card__content',\n\ticon: 'gov-card__icon',\n\tbtns: 'gov-card__btns',\n\tfooter: 'gov-card__footer',\n\tarrow: 'gov-card__arrow',\n}\n","/*\n * Alert\n */\n\n$class: \".gov-card\";\n\n#{$class} {\n\t@include base(flex);\n\tflex-direction: column;\n\tborder: $card-border;\n\tborder-radius: $border-radius;\n\tbackground: $card-bg;\n\toverflow: hidden;\n\t&__header {\n\t\tgap: rem-calc(28);\n\t\twidth: 100%;\n\t\tpadding: rem-calc(24);\n\t\tborder-bottom: $card-border;\n\t\tborder-radius: 0;\n\t\ttext-align: left;\n\t\ttext-transform: none;\n\t\ttransition: background-color $t ease-in-out;\n\t}\n\t&__arrow {\n\t\tflex: 0 0 auto;\n\t\twidth: rem-calc(16);\n\t\theight: rem-calc(16);\n\t\tcolor: $card-arrow-color;\n\t}\n\t&__title {\n\t\t@include general;\n\t\t@include typography($font-size-xl);\n\t\tcolor: $card-title-color;\n\t\tfont-weight: 700;\n\t}\n\t&__img {\n\t\twidth: 100%;\n\t\tmargin: 0;\n\t\tline-height: 1;\n\t\timg {\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t}\n\t}\n\t&__inner {\n\t\tdisplay: flex;\n\t\tflex: 1 1 auto;\n\t\tflex-direction: column;\n\t\t@include parameter(\"aria-hidden\") {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\t&__main {\n\t\tdisplay: flex;\n\t\tgap: 16px 24px;\n\t\tflex: 1 1 auto;\n\t\tflex-direction: column;\n\t\tpadding: rem-calc(24);\n\t}\n\t&__icon {\n\t\tflex: 0 0 auto;\n\t\twidth: rem-calc(40);\n\t\theight: rem-calc(40);\n\t\tcolor: $card-icon-color;\n\t}\n\t&__btns {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t\tflex: 0 0 auto;\n\t\tflex-wrap: wrap;\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t}\n\t&__footer {\n\t\t@include reset-last-margin();\n\t\tpadding: rem-calc(16 24);\n\t\tbackground: $card-footer-bg;\n\t\tp {\n\t\t\t@include typography($font-size-s);\n\t\t}\n\t}\n\n\t// STATES\n\t@include parameter(\"is-expanded\") {\n\t\theight: 100%;\n\t}\n\n\t// VARIANTS\n\t@include parameter(\"collapsible\") {\n\t\t#{$class} {\n\t\t\t&__header {\n\t\t\t\t@include button-core();\n\t\t\t\t@include focus-outline($border-radius, rem-calc(-2));\n\t\t\t\tjustify-content: space-between;\n\t\t\t\ttext-align: left;\n\t\t\t\t@include hover() {\n\t\t\t\t\tbackground: $card-header-hover-bg;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// STATES\n\t\t@include parameter(\"is-expanded\") {\n\t\t\t#{$class} {\n\t\t\t\t&__header {\n\t\t\t\t\tborder-bottom: $card-border;\n\t\t\t\t}\n\t\t\t\t&__arrow {\n\t\t\t\t\ttransform: scale(-1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: sm) {\n\t\t// VARIANTS\n\t\t@include parameter(\"promotion\") {\n\t\t\t#{$class} {\n\t\t\t\t&__main {\n\t\t\t\t\tflex-direction: row;\n\t\t\t\t\tpadding: rem-calc(32);\n\t\t\t\t}\n\t\t\t\t&__icon {\n\t\t\t\t\twidth: rem-calc(48);\n\t\t\t\t\theight: rem-calc(48);\n\t\t\t\t}\n\t\t\t\t&__btns {\n\t\t\t\t\tflex-direction: column;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Prop, Watch, State, Method, Event, EventEmitter } from '@stencil/core'\nimport { CardClass } from './constants'\nimport { govHost, booleanString } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { createID } from '../../utils/string.utils'\nimport { govErrorLog } from '../../helpers/Log/gov.log'\nimport { validateWcagLabel } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { GovCardChangeEvent } from './interfaces'\n\n@Component({\n\ttag: 'gov-card',\n\tstyleUrl: 'gov-card.scss',\n})\nexport class GovCard {\n\tprivate h: GovHost\n\tprivate readonly headlineId: string\n\tprivate readonly contentId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.headlineId = createID('GovCardHeadline')\n\t\tthis.contentId = createID('GovCardContent')\n\t}\n\n\t@Element() host: HTMLGovCardElement\n\n\t/**\n\t * Style variation of the card.\n\t */\n\t@Prop() readonly promotion: boolean = false\n\t/**\n\t * Item label of the card\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Defines wether the card can be collapsible\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Defines whether the card is open or closed by default\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Used to change the HMTL tag in the card headline for correct semantic structure\n\t */\n\t@Prop({ attribute: 'headline-tag' }) readonly headlineTag: string = 'h3'\n\t/**\n\t * Adds accessible label for the collapsible button that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-trigger-label' }) wcagTriggerLabel: string\n\t/**\n\t * A string of identifiers that indicate alternative label elements for collapsible card\n\t */\n\t@Prop({ attribute: 'wcag-trigger-labelled-by' }) wcagTriggerLabelledBy: string\n\t/**\n\t * Called when the card toggle state changes\n\t */\n\t@Event({ eventName: 'gov-toggle' }) govToggle: EventEmitter<GovCardChangeEvent>\n\t@State() isExpanded: boolean\n\n\t@Watch('headlineTag')\n\tvalidateHeadlineTag(newValue: string): void {\n\t\tconst validTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span']\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${CardClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.isExpanded = this.label ? this.expanded : true\n\t\tthis.validateHeadlineTag(this.headlineTag)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tprivate emmitChange(): void {\n\t\tthis.govToggle.emit({ open: this.isExpanded, element: this.host })\n\t}\n\n\trender() {\n\t\tconst HeadlineTag = this.headlineTag\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(CardClass.root)} is-expanded={this.isExpanded} collapsible={booleanString(this.collapsible)} promotion={this.promotion}>\n\t\t\t\t{this.label && this.collapsible ? (\n\t\t\t\t\t<button\n\t\t\t\t\t\tid={this.headlineId}\n\t\t\t\t\t\tclass={CardClass.header}\n\t\t\t\t\t\taria-label={this.wcagTriggerLabel}\n\t\t\t\t\t\taria-labelledby={this.wcagTriggerLabelledBy}\n\t\t\t\t\t\taria-expanded={booleanString(this.isExpanded)}\n\t\t\t\t\t\taria-controls={this.contentId}\n\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<HeadlineTag class={CardClass.title}>{this.label}</HeadlineTag>\n\t\t\t\t\t\t<gov-icon class={CardClass.arrow} name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t</button>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.label && !this.collapsible ? (\n\t\t\t\t\t<div class={CardClass.header}>\n\t\t\t\t\t\t<HeadlineTag class={CardClass.title}>{this.label}</HeadlineTag>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t<div\n\t\t\t\t\tclass={CardClass.inner}\n\t\t\t\t\tid={this.contentId}\n\t\t\t\t\taria-hidden={this.collapsible ? booleanString(!this.isExpanded) : undefined}\n\t\t\t\t\thidden={this.collapsible ? !this.isExpanded : undefined}\n\t\t\t\t\taria-labelledby={this.collapsible ? this.headlineId : undefined}\n\t\t\t\t>\n\t\t\t\t\t{this.h.hasSlot('img') && (\n\t\t\t\t\t\t<p class={CardClass.img}>\n\t\t\t\t\t\t\t<slot name=\"img\" />\n\t\t\t\t\t\t</p>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<div class={CardClass.main}>\n\t\t\t\t\t\t{this.h.hasSlot('icon') && this.promotion && (\n\t\t\t\t\t\t\t<div class={CardClass.icon}>\n\t\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<div class={CardClass.content}>\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t{this.h.hasSlot('btn') && this.promotion && (\n\t\t\t\t\t\t\t<div class={CardClass.btns}>\n\t\t\t\t\t\t\t\t<slot name=\"btn\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{this.h.hasSlot('footer') && (\n\t\t\t\t\t\t<div class={CardClass.footer}>\n\t\t\t\t\t\t\t<slot name=\"footer\" />\n\t\t\t\t\t\t</div>\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) {\n\t\te.stopPropagation()\n\t\tif (this.collapsible) {\n\t\t\tthis.isExpanded = !this.isExpanded\n\t\t\tthis.emmitChange()\n\t\t}\n\t}\n\n\t/**\n\t * Open the card if it is collapsible\n\t */\n\t@Method()\n\tasync open(): Promise<void> {\n\t\tif (this.collapsible) {\n\t\t\tthis.isExpanded = true\n\t\t\tthis.emmitChange()\n\t\t}\n\t}\n\n\t/**\n\t * Close the card if it is collapsible\n\t */\n\t@Method()\n\tasync close(): Promise<void> {\n\t\tif (this.collapsible) {\n\t\t\tthis.isExpanded = false\n\t\t\tthis.emmitChange()\n\t\t}\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\tif (this.collapsible) {\n\t\t\tvalidateWcagLabel(this.wcagTriggerLabel, this.wcagTriggerLabelledBy, CardClass.root)\n\t\t}\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-card.js","mappings":";;;;;;;;;AAAO,MAAM,SAAS,GAAG;EACxB,IAAI,EAAE,UAAU;EAChB,MAAM,EAAE,kBAAkB;EAC1B,KAAK,EAAE,iBAAiB;EACxB,KAAK,EAAE,iBAAiB;EACxB,GAAG,EAAE,eAAe;EACpB,IAAI,EAAE,gBAAgB;EACtB,OAAO,EAAE,mBAAmB;EAC5B,IAAI,EAAE,gBAAgB;EACtB,IAAI,EAAE,gBAAgB;EACtB,MAAM,EAAE,kBAAkB;EAC1B,KAAK,EAAE,iBAAiB;CACxB;;ACZD,MAAM,UAAU,GAAG,u8KAAu8K;;MCe78KA,SAAO;EAKnB;;;;qBAWsC,KAAK;;uBAQH,KAAK;oBAIR,KAAK;uBAI0B,IAAI;;;;IA1BvE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAA;IAC7C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAA;GAC3C;EAuCD,mBAAmB,CAAC,QAAgB;IACnC,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;IAC9D,IA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AI,EAAC,KAAK,GAAG,CACd,CACN,CACI,EAEL,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KACxB,WAAK,KAAK,EAAE,SAAS,CAAC,MAAM,IAC3B,YAAM,IAAI,EAAC,QAAQ,GAAG,CACjB,CACN,CACI,CACA,EACP;GACD;EAEO,cAAc,CAAC,CAAC;IACvB,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,IAAI,CAAC,WAAW,EAAE;MACrB,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,UAAU,CAAA;MAClC,IAAI,CAAC,WAAW,EAAE,CAAA;KAClB;GACD;;;;EAMD,MAAM,IAAI;IACT,IAAI,IAAI,CAAC,WAAW,EAAE;MACrB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAA;MACtB,IAAI,CAAC,WAAW,EAAE,CAAA;KAClB;GACD;;;;EAMD,MAAM,KAAK;IACV,IAAI,IAAI,CAAC,WAAW,EAAE;MACrB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAA;MACvB,IAAI,CAAC,WAAW,EAAE,CAAA;KAClB;GACD;;;;EAMD,MAAM,YAAY;IACjB,IAAI,IAAI,CAAC,WAAW,EAAE;MACrB,iBAAiB,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;KACpF;GACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["GovCard"],"sources":["../../../packages/core/src/components/gov-card/constants.ts","../../../packages/core/src/components/gov-card/gov-card.scss?tag=gov-card","../../../packages/core/src/components/gov-card/gov-card.tsx"],"sourcesContent":["export const CardClass = {\n\troot: 'gov-card',\n\theader: 'gov-card__header',\n\ttitle: 'gov-card__title',\n\tinner: 'gov-card__inner',\n\timg: 'gov-card__img',\n\tmain: 'gov-card__main',\n\tcontent: 'gov-card__content',\n\ticon: 'gov-card__icon',\n\tbtns: 'gov-card__btns',\n\tfooter: 'gov-card__footer',\n\tarrow: 'gov-card__arrow',\n}\n","/*\n * Alert\n */\n\n$class: \".gov-card\";\n\n#{$class} {\n\t@include base(flex);\n\tflex-direction: column;\n\tborder: $card-border;\n\tborder-radius: $border-radius;\n\tbackground: $card-bg;\n\toverflow: hidden;\n\t&__header {\n\t\tgap: rem-calc(28);\n\t\twidth: 100%;\n\t\tpadding: rem-calc(24);\n\t\tborder-bottom: $card-border;\n\t\tborder-radius: 0;\n\t\ttext-align: left;\n\t\ttext-transform: none;\n\t\ttransition: background-color $t ease-in-out;\n\t}\n\t&__arrow {\n\t\tflex: 0 0 auto;\n\t\twidth: rem-calc(16);\n\t\theight: rem-calc(16);\n\t\tcolor: $card-arrow-color;\n\t}\n\t&__title {\n\t\t@include general;\n\t\t@include typography($font-size-xl);\n\t\tcolor: $card-title-color;\n\t\tfont-weight: 700;\n\t}\n\t&__img {\n\t\twidth: 100%;\n\t\tmargin: 0;\n\t\tline-height: 1;\n\t\timg {\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t}\n\t}\n\t&__inner {\n\t\tdisplay: flex;\n\t\tflex: 1 1 auto;\n\t\tflex-direction: column;\n\t\t@include parameter(\"aria-hidden\") {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\t&__main {\n\t\tdisplay: flex;\n\t\tgap: 16px 24px;\n\t\tflex: 1 1 auto;\n\t\tflex-direction: column;\n\t\tpadding: rem-calc(24);\n\t}\n\t&__icon {\n\t\tflex: 0 0 auto;\n\t\twidth: rem-calc(40);\n\t\theight: rem-calc(40);\n\t\tcolor: $card-icon-color;\n\t}\n\t&__btns {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t\tflex: 0 0 auto;\n\t\tflex-wrap: wrap;\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t}\n\t&__footer {\n\t\t@include reset-last-margin();\n\t\tpadding: rem-calc(16 24);\n\t\tbackground: $card-footer-bg;\n\t\tp {\n\t\t\t@include typography($font-size-s);\n\t\t}\n\t}\n\n\t// STATES\n\t@include parameter(\"is-expanded\") {\n\t\theight: 100%;\n\t}\n\n\t// VARIANTS\n\t@include parameter(\"collapsible\") {\n\t\t#{$class} {\n\t\t\t&__header {\n\t\t\t\t@include button-core();\n\t\t\t\t@include focus-outline($border-radius, rem-calc(-2));\n\t\t\t\tjustify-content: space-between;\n\t\t\t\ttext-align: left;\n\t\t\t\t@include hover() {\n\t\t\t\t\tbackground: $card-header-hover-bg;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// STATES\n\t\t@include parameter(\"is-expanded\") {\n\t\t\t#{$class} {\n\t\t\t\t&__header {\n\t\t\t\t\tborder-bottom: $card-border;\n\t\t\t\t}\n\t\t\t\t&__arrow {\n\t\t\t\t\ttransform: scale(-1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: sm) {\n\t\t// VARIANTS\n\t\t@include parameter(\"promotion\") {\n\t\t\t#{$class} {\n\t\t\t\t&__main {\n\t\t\t\t\tflex-direction: row;\n\t\t\t\t\tpadding: rem-calc(32);\n\t\t\t\t}\n\t\t\t\t&__icon {\n\t\t\t\t\twidth: rem-calc(48);\n\t\t\t\t\theight: rem-calc(48);\n\t\t\t\t}\n\t\t\t\t&__btns {\n\t\t\t\t\tflex-direction: column;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Prop, Watch, State, Method, Event, EventEmitter } from '@stencil/core'\nimport { CardClass } from './constants'\nimport { govHost, booleanString } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { createID } from '../../utils/string.utils'\nimport { govErrorLog } from '../../helpers/Log/gov.log'\nimport { validateWcagLabel } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { GovCardChangeEvent } from './interfaces'\n\n@Component({\n\ttag: 'gov-card',\n\tstyleUrl: 'gov-card.scss',\n})\nexport class GovCard {\n\tprivate h: GovHost\n\tprivate readonly headlineId: string\n\tprivate readonly contentId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.headlineId = createID('GovCardHeadline')\n\t\tthis.contentId = createID('GovCardContent')\n\t}\n\n\t@Element() host: HTMLGovCardElement\n\n\t/**\n\t * Style variation of the card.\n\t */\n\t@Prop() readonly promotion: boolean = false\n\t/**\n\t * Item label of the card\n\t */\n\t@Prop() readonly label: string\n\t/**\n\t * Defines wether the card can be collapsible\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Defines whether the card is open or closed by default\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Used to change the HMTL tag in the card headline for correct semantic structure\n\t */\n\t@Prop({ attribute: 'headline-tag' }) readonly headlineTag: string = 'h3'\n\t/**\n\t * Adds accessible label for the collapsible button that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-trigger-label' }) wcagTriggerLabel: string\n\t/**\n\t * A string of identifiers that indicate alternative label elements for collapsible card\n\t */\n\t@Prop({ attribute: 'wcag-trigger-labelled-by' }) wcagTriggerLabelledBy: string\n\t/**\n\t * Called when the card toggle state changes\n\t */\n\t@Event({ eventName: 'gov-toggle' }) govToggle: EventEmitter<GovCardChangeEvent>\n\t@State() isExpanded: boolean\n\n\t@Watch('headlineTag')\n\tvalidateHeadlineTag(newValue: string): void {\n\t\tconst validTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span']\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${CardClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.isExpanded = this.label ? this.expanded : true\n\t\tthis.validateHeadlineTag(this.headlineTag)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tprivate emmitChange(): void {\n\t\tthis.govToggle.emit({ open: this.isExpanded, element: this.host })\n\t}\n\n\trender() {\n\t\tconst HeadlineTag = this.headlineTag\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(CardClass.root)} is-expanded={this.isExpanded} collapsible={booleanString(this.collapsible)} promotion={this.promotion}>\n\t\t\t\t{this.label && this.collapsible ? (\n\t\t\t\t\t<button\n\t\t\t\t\t\tid={this.headlineId}\n\t\t\t\t\t\tclass={CardClass.header}\n\t\t\t\t\t\taria-label={this.wcagTriggerLabel}\n\t\t\t\t\t\taria-labelledby={this.wcagTriggerLabelledBy}\n\t\t\t\t\t\taria-expanded={booleanString(this.isExpanded)}\n\t\t\t\t\t\taria-controls={this.contentId}\n\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<HeadlineTag class={CardClass.title}>{this.label}</HeadlineTag>\n\t\t\t\t\t\t<gov-icon class={CardClass.arrow} name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t</button>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.label && !this.collapsible ? (\n\t\t\t\t\t<div class={CardClass.header}>\n\t\t\t\t\t\t<HeadlineTag class={CardClass.title}>{this.label}</HeadlineTag>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t<div\n\t\t\t\t\tclass={CardClass.inner}\n\t\t\t\t\tid={this.contentId}\n\t\t\t\t\taria-hidden={this.collapsible ? booleanString(!this.isExpanded) : undefined}\n\t\t\t\t\thidden={this.collapsible ? !this.isExpanded : undefined}\n\t\t\t\t\taria-labelledby={this.collapsible ? this.headlineId : undefined}\n\t\t\t\t>\n\t\t\t\t\t{this.h.hasSlot('img') && (\n\t\t\t\t\t\t<p class={CardClass.img}>\n\t\t\t\t\t\t\t<slot name=\"img\" />\n\t\t\t\t\t\t</p>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<div class={CardClass.main}>\n\t\t\t\t\t\t{this.h.hasSlot('icon') && this.promotion && (\n\t\t\t\t\t\t\t<div class={CardClass.icon}>\n\t\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<div class={CardClass.content}>\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t{this.h.hasSlot('btn') && this.promotion && (\n\t\t\t\t\t\t\t<div class={CardClass.btns}>\n\t\t\t\t\t\t\t\t<slot name=\"btn\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{this.h.hasSlot('footer') && (\n\t\t\t\t\t\t<div class={CardClass.footer}>\n\t\t\t\t\t\t\t<slot name=\"footer\" />\n\t\t\t\t\t\t</div>\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) {\n\t\te.stopPropagation()\n\t\tif (this.collapsible) {\n\t\t\tthis.isExpanded = !this.isExpanded\n\t\t\tthis.emmitChange()\n\t\t}\n\t}\n\n\t/**\n\t * Open the card if it is collapsible\n\t */\n\t@Method()\n\tasync open(): Promise<void> {\n\t\tif (this.collapsible) {\n\t\t\tthis.isExpanded = true\n\t\t\tthis.emmitChange()\n\t\t}\n\t}\n\n\t/**\n\t * Close the card if it is collapsible\n\t */\n\t@Method()\n\tasync close(): Promise<void> {\n\t\tif (this.collapsible) {\n\t\t\tthis.isExpanded = false\n\t\t\tthis.emmitChange()\n\t\t}\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\tif (this.collapsible) {\n\t\t\tvalidateWcagLabel(this.wcagTriggerLabel, this.wcagTriggerLabelledBy, CardClass.root)\n\t\t}\n\t}\n}\n"],"version":3}
@@ -42,7 +42,6 @@ function defineCustomElement$1() {
42
42
  break;
43
43
  } });
44
44
  }
45
- defineCustomElement$1();
46
45
 
47
46
  const GovContainer = GovContainer$1;
48
47
  const defineCustomElement = defineCustomElement$1;
@@ -1 +1 @@
1
- {"file":"gov-container.js","mappings":";;;AAAO,MAAM,cAAc,GAAG;EAC7B,IAAI,EAAE,eAAe;CACrB;;ACFD,MAAM,eAAe,GAAG,swBAAswB;;MCSjxBA,cAAY;EAGxB;;;IACC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAID,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAC/C,eAAQ,CACF,EACP;GACD;;;;;;EAQD,MAAM,eAAe;IACpB,OAAO,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;GAClD;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["GovContainer"],"sources":["../../../packages/core/src/components/gov-container/constants.tsx","../../../packages/core/src/components/gov-container/gov-container.scss?tag=gov-container","../../../packages/core/src/components/gov-container/gov-container.tsx"],"sourcesContent":["export const ContainerClass = {\n\troot: 'gov-container',\n}\n","/*\n * Container\n */\n\n$class: \".gov-container\";\n\n#{$class} {\n\t@include container();\n}\n","import { Component, Element, h, Host, Method } from '@stencil/core'\nimport { govHost, slottedChildren } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { ContainerClass } from './constants'\n\n@Component({\n\ttag: 'gov-container',\n\tstyleUrl: 'gov-container.scss',\n})\nexport class GovContainer {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovContainerElement\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ContainerClass.root)}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns slotted children\n\t *\n\t * @return {Promise<Node[]>}\n\t */\n\t@Method()\n\tasync slottedChildren(): Promise<Node[]> {\n\t\treturn Promise.resolve(slottedChildren(this.host))\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-container.js","mappings":";;;AAAO,MAAM,cAAc,GAAG;EAC7B,IAAI,EAAE,eAAe;CACrB;;ACFD,MAAM,eAAe,GAAG,swBAAswB;;MCSjxBA,cAAY;EAGxB;;;IACC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAID,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAC/C,eAAQ,CACF,EACP;GACD;;;;;;EAQD,MAAM,eAAe;IACpB,OAAO,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;GAClD;;;;;;;;;;;;;;;;;;;;;;;;;","names":["GovContainer"],"sources":["../../../packages/core/src/components/gov-container/constants.tsx","../../../packages/core/src/components/gov-container/gov-container.scss?tag=gov-container","../../../packages/core/src/components/gov-container/gov-container.tsx"],"sourcesContent":["export const ContainerClass = {\n\troot: 'gov-container',\n}\n","/*\n * Container\n */\n\n$class: \".gov-container\";\n\n#{$class} {\n\t@include container();\n}\n","import { Component, Element, h, Host, Method } from '@stencil/core'\nimport { govHost, slottedChildren } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { ContainerClass } from './constants'\n\n@Component({\n\ttag: 'gov-container',\n\tstyleUrl: 'gov-container.scss',\n})\nexport class GovContainer {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovContainerElement\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ContainerClass.root)}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns slotted children\n\t *\n\t * @return {Promise<Node[]>}\n\t */\n\t@Method()\n\tasync slottedChildren(): Promise<Node[]> {\n\t\treturn Promise.resolve(slottedChildren(this.host))\n\t}\n}\n"],"version":3}
@@ -48,7 +48,6 @@ function defineCustomElement$1() {
48
48
  break;
49
49
  } });
50
50
  }
51
- defineCustomElement$1();
52
51
 
53
52
  const GovControlGroup = GovControlGroup$1;
54
53
  const defineCustomElement = defineCustomElement$1;
@@ -1 +1 @@
1
- {"file":"gov-control-group.js","mappings":";;;;;;AAI6B,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAC;AAG9D,MAAM,iBAAiB,GAAG;EAChC,IAAI,EAAE,mBAAmB;CACzB;;ACTD,MAAM,kBAAkB,GAAG,stCAAstC;;MCWpuCA,iBAAe;EAG3B;;;mBAQ6C,QAAQ,CAAC,OAAO;oBAIE,KAAK;IAXnE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAaD,eAAe,CAAC,QAAgB;IAC/B,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAA;GACxD;EAED,MAAM;IACL,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,GAAG,WAAW,GAAG,SAAS,CAAA;IACjE,QACC,EAAC,IAAI,IACJ,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,EACzD,OAAO,EAAE,IAAI,CAAC,OAAO,IACrB,eAAQ,CACF,EACP;GACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["GovControlGroup"],"sources":["../../../packages/core/src/components/gov-control-group/constants.ts","../../../packages/core/src/components/gov-control-group/gov-control-group.scss?tag=gov-control-group","../../../packages/core/src/components/gov-control-group/gov-control-group.tsx"],"sourcesContent":["import { Variants } from '../../core/constants/variants'\nimport { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils'\n\nexport const ControlGroups = pick(Variants, ['PRIMARY', 'SECONDARY'])\nexport type ControlGroupType = `${ValueOf<typeof ControlGroups>}`\n\nexport const ControlGroupClass = {\n\troot: 'gov-control-group',\n}\n","/*\n * Control group\n */\n\n$class: \".gov-control-group\";\n\n#{$class} {\n\t@include base(flex);\n\talign-items: center;\n\tborder-radius: $control-group-border-radius;\n\t.element *,\n\t.gov-button .element {\n\t\tborder: none !important;\n\t\tborder-radius: 0;\n\t}\n\n\t// VARIANTS\n\t@each $variant, $definitions in $control-group-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\tborder: get(\"border\", $definitions);\n\t\t\t> * {\n\t\t\t\tborder-right: get(\"border\", $definitions);\n\t\t\t}\n\t\t}\n\t}\n\n\t> * {\n\t\t&:last-child {\n\t\t\tborder-right: none;\n\t\t}\n\t}\n\t&.no-border {\n\t\t> * {\n\t\t\tborder-right: none;\n\t\t}\n\t}\n}\n\n","import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { Variants } from \"../../core/constants/variants\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { ControlGroupClass, ControlGroupType } from \"./constants\"\n\n@Component({\n\ttag: \"gov-control-group\",\n\tstyleUrl: \"gov-control-group.scss\",\n})\nexport class GovControlGroup {\n\tprivate readonly h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovControlGroupElement\n\t/**\n\t * Style variation of the content message.\n\t */\n\t@Prop() readonly variant: ControlGroupType = Variants.PRIMARY\n\t/**\n\t * Specifies the display of the border between elements\n\t */\n\t@Prop({ attribute: \"no-border\" }) readonly noBorder: boolean = false\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(Variants, newValue, ControlGroupClass.root)\n\t}\n\n\trender() {\n\t\tconst noBorder = this.noBorder === true ? \"no-border\" : undefined\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([ControlGroupClass.root, noBorder])}\n\t\t\t\tvariant={this.variant}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-control-group.js","mappings":";;;;;;AAI6B,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAC;AAG9D,MAAM,iBAAiB,GAAG;EAChC,IAAI,EAAE,mBAAmB;CACzB;;ACTD,MAAM,kBAAkB,GAAG,stCAAstC;;MCWpuCA,iBAAe;EAG3B;;;mBAQ6C,QAAQ,CAAC,OAAO;oBAIE,KAAK;IAXnE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAaD,eAAe,CAAC,QAAgB;IAC/B,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAA;GACxD;EAED,MAAM;IACL,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,GAAG,WAAW,GAAG,SAAS,CAAA;IACjE,QACC,EAAC,IAAI,IACJ,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,EACzD,OAAO,EAAE,IAAI,CAAC,OAAO,IACrB,eAAQ,CACF,EACP;GACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["GovControlGroup"],"sources":["../../../packages/core/src/components/gov-control-group/constants.ts","../../../packages/core/src/components/gov-control-group/gov-control-group.scss?tag=gov-control-group","../../../packages/core/src/components/gov-control-group/gov-control-group.tsx"],"sourcesContent":["import { Variants } from '../../core/constants/variants'\nimport { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils'\n\nexport const ControlGroups = pick(Variants, ['PRIMARY', 'SECONDARY'])\nexport type ControlGroupType = `${ValueOf<typeof ControlGroups>}`\n\nexport const ControlGroupClass = {\n\troot: 'gov-control-group',\n}\n","/*\n * Control group\n */\n\n$class: \".gov-control-group\";\n\n#{$class} {\n\t@include base(flex);\n\talign-items: center;\n\tborder-radius: $control-group-border-radius;\n\t.element *,\n\t.gov-button .element {\n\t\tborder: none !important;\n\t\tborder-radius: 0;\n\t}\n\n\t// VARIANTS\n\t@each $variant, $definitions in $control-group-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\tborder: get(\"border\", $definitions);\n\t\t\t> * {\n\t\t\t\tborder-right: get(\"border\", $definitions);\n\t\t\t}\n\t\t}\n\t}\n\n\t> * {\n\t\t&:last-child {\n\t\t\tborder-right: none;\n\t\t}\n\t}\n\t&.no-border {\n\t\t> * {\n\t\t\tborder-right: none;\n\t\t}\n\t}\n}\n\n","import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { Variants } from \"../../core/constants/variants\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { ControlGroupClass, ControlGroupType } from \"./constants\"\n\n@Component({\n\ttag: \"gov-control-group\",\n\tstyleUrl: \"gov-control-group.scss\",\n})\nexport class GovControlGroup {\n\tprivate readonly h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovControlGroupElement\n\t/**\n\t * Style variation of the content message.\n\t */\n\t@Prop() readonly variant: ControlGroupType = Variants.PRIMARY\n\t/**\n\t * Specifies the display of the border between elements\n\t */\n\t@Prop({ attribute: \"no-border\" }) readonly noBorder: boolean = false\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(Variants, newValue, ControlGroupClass.root)\n\t}\n\n\trender() {\n\t\tconst noBorder = this.noBorder === true ? \"no-border\" : undefined\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([ControlGroupClass.root, noBorder])}\n\t\t\t\tvariant={this.variant}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
@@ -37,7 +37,6 @@ function defineCustomElement$1() {
37
37
  break;
38
38
  } });
39
39
  }
40
- defineCustomElement$1();
41
40
 
42
41
  const GovCookiebar = GovCookiebar$1;
43
42
  const defineCustomElement = defineCustomElement$1;
@@ -1 +1 @@
1
- {"file":"gov-cookiebar.js","mappings":";;;AAAO,MAAM,cAAc,GAAG;EAC7B,IAAI,EAAE,eAAe;EACrB,MAAM,EAAE,uBAAuB;EAC/B,OAAO,EAAE,wBAAwB;EACjC,OAAO,EAAE,wBAAwB;EACjC,cAAc,EAAE,gCAAgC;EAChD,gBAAgB,EAAE,kCAAkC;CACpD;;ACPD,MAAM,eAAe,GAAG,mrDAAmrD;;MCS9rDA,cAAY;EAGxB;;;IACC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAID,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAC/C,WAAK,KAAK,EAAE,cAAc,CAAC,MAAM,IAChC,WAAK,KAAK,EAAE,cAAc,CAAC,OAAO,IACjC,eAAQ,CACH,EAEL,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,MACzE,WAAK,KAAK,EAAE,cAAc,CAAC,OAAO,IAChC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,KACjC,WAAK,KAAK,EAAE,cAAc,CAAC,cAAc,IACxC,YAAM,IAAI,EAAC,iBAAiB,GAAG,CAC1B,CACN,EAEA,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,KACnC,WAAK,KAAK,EAAE,cAAc,CAAC,gBAAgB,IAC1C,YAAM,IAAI,EAAC,mBAAmB,GAAG,CAC5B,CACN,CACI,CACN,CACI,CACA,EACP;GACD;;;;;;;;;;;;;;;;;;;;;;;;","names":["GovCookiebar"],"sources":["../../../packages/core/src/components/gov-cookiebar/constants.tsx","../../../packages/core/src/components/gov-cookiebar/gov-cookiebar.scss?tag=gov-cookiebar","../../../packages/core/src/components/gov-cookiebar/gov-cookiebar.tsx"],"sourcesContent":["export const CookiebarClass = {\n\troot: 'gov-cookiebar',\n\tholder: 'gov-cookiebar__holder',\n\tcontent: 'gov-cookiebar__content',\n\tactions: 'gov-cookiebar__actions',\n\tactionsPrimary: 'gov-cookiebar__actions-primary',\n\tactionsSecondary: 'gov-cookiebar__actions-secondary',\n}\n","/*\n * Cookiebar\n */\n\n$class: \".gov-cookiebar\";\n\n#{$class} {\n\t@include z-index(\"bar\", 1);\n\tposition: fixed;\n\tright: 0;\n\tbottom: 0;\n\tleft: 0;\n\tbackground-color: $cookiebar-bg;\n\tbox-shadow: $cookiebar-box-shadow;\n\t&__holder {\n\t\t@include container();\n\t\t@include space(32);\n\t\tpadding-top: rem-calc(20);\n\t\tpadding-bottom: rem-calc(20);\n\t}\n\t&__content {\n\t\t@include space(12);\n\t\tp {\n\t\t\tcolor: $cookiebar-color;\n\t\t\tletter-spacing: em-calc(0.2);\n\t\t}\n\t}\n\t&__actions {\n\t\t&,\n\t\t&-primary,\n\t\t&-secondary {\n\t\t\tdisplay: flex;\n\t\t\tgap: rem-calc(10);\n\t\t\tflex-wrap: wrap;\n\t\t\tjustify-content: space-between;\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: md) {\n\t\t&__holder {\n\t\t\tpadding-top: rem-calc(32);\n\t\t\tpadding-bottom: rem-calc(32);\n\t\t}\n\t\t&__actions {\n\t\t\t&,\n\t\t\t&-primary,\n\t\t\t&-secondary {\n\t\t\t\tgap: rem-calc(16);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host } from '@stencil/core'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { CookiebarClass } from './constants'\n\n@Component({\n\ttag: 'gov-cookiebar',\n\tstyleUrl: 'gov-cookiebar.scss',\n})\nexport class GovCookiebar {\n\th: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovCookiebarElement\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(CookiebarClass.root)}>\n\t\t\t\t<div class={CookiebarClass.holder}>\n\t\t\t\t\t<div class={CookiebarClass.content}>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{(this.h.hasSlot('actions-primary') || this.h.hasSlot('actions-secondary')) && (\n\t\t\t\t\t\t<div class={CookiebarClass.actions}>\n\t\t\t\t\t\t\t{this.h.hasSlot('actions-primary') && (\n\t\t\t\t\t\t\t\t<div class={CookiebarClass.actionsPrimary}>\n\t\t\t\t\t\t\t\t\t<slot name=\"actions-primary\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t{this.h.hasSlot('actions-secondary') && (\n\t\t\t\t\t\t\t\t<div class={CookiebarClass.actionsSecondary}>\n\t\t\t\t\t\t\t\t\t<slot name=\"actions-secondary\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-cookiebar.js","mappings":";;;AAAO,MAAM,cAAc,GAAG;EAC7B,IAAI,EAAE,eAAe;EACrB,MAAM,EAAE,uBAAuB;EAC/B,OAAO,EAAE,wBAAwB;EACjC,OAAO,EAAE,wBAAwB;EACjC,cAAc,EAAE,gCAAgC;EAChD,gBAAgB,EAAE,kCAAkC;CACpD;;ACPD,MAAM,eAAe,GAAG,mrDAAmrD;;MCS9rDA,cAAY;EAGxB;;;IACC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAID,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAC/C,WAAK,KAAK,EAAE,cAAc,CAAC,MAAM,IAChC,WAAK,KAAK,EAAE,cAAc,CAAC,OAAO,IACjC,eAAQ,CACH,EAEL,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,MACzE,WAAK,KAAK,EAAE,cAAc,CAAC,OAAO,IAChC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,KACjC,WAAK,KAAK,EAAE,cAAc,CAAC,cAAc,IACxC,YAAM,IAAI,EAAC,iBAAiB,GAAG,CAC1B,CACN,EAEA,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,KACnC,WAAK,KAAK,EAAE,cAAc,CAAC,gBAAgB,IAC1C,YAAM,IAAI,EAAC,mBAAmB,GAAG,CAC5B,CACN,CACI,CACN,CACI,CACA,EACP;GACD;;;;;;;;;;;;;;;;;;;;;;;","names":["GovCookiebar"],"sources":["../../../packages/core/src/components/gov-cookiebar/constants.tsx","../../../packages/core/src/components/gov-cookiebar/gov-cookiebar.scss?tag=gov-cookiebar","../../../packages/core/src/components/gov-cookiebar/gov-cookiebar.tsx"],"sourcesContent":["export const CookiebarClass = {\n\troot: 'gov-cookiebar',\n\tholder: 'gov-cookiebar__holder',\n\tcontent: 'gov-cookiebar__content',\n\tactions: 'gov-cookiebar__actions',\n\tactionsPrimary: 'gov-cookiebar__actions-primary',\n\tactionsSecondary: 'gov-cookiebar__actions-secondary',\n}\n","/*\n * Cookiebar\n */\n\n$class: \".gov-cookiebar\";\n\n#{$class} {\n\t@include z-index(\"bar\", 1);\n\tposition: fixed;\n\tright: 0;\n\tbottom: 0;\n\tleft: 0;\n\tbackground-color: $cookiebar-bg;\n\tbox-shadow: $cookiebar-box-shadow;\n\t&__holder {\n\t\t@include container();\n\t\t@include space(32);\n\t\tpadding-top: rem-calc(20);\n\t\tpadding-bottom: rem-calc(20);\n\t}\n\t&__content {\n\t\t@include space(12);\n\t\tp {\n\t\t\tcolor: $cookiebar-color;\n\t\t\tletter-spacing: em-calc(0.2);\n\t\t}\n\t}\n\t&__actions {\n\t\t&,\n\t\t&-primary,\n\t\t&-secondary {\n\t\t\tdisplay: flex;\n\t\t\tgap: rem-calc(10);\n\t\t\tflex-wrap: wrap;\n\t\t\tjustify-content: space-between;\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: md) {\n\t\t&__holder {\n\t\t\tpadding-top: rem-calc(32);\n\t\t\tpadding-bottom: rem-calc(32);\n\t\t}\n\t\t&__actions {\n\t\t\t&,\n\t\t\t&-primary,\n\t\t\t&-secondary {\n\t\t\t\tgap: rem-calc(16);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host } from '@stencil/core'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { CookiebarClass } from './constants'\n\n@Component({\n\ttag: 'gov-cookiebar',\n\tstyleUrl: 'gov-cookiebar.scss',\n})\nexport class GovCookiebar {\n\th: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovCookiebarElement\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(CookiebarClass.root)}>\n\t\t\t\t<div class={CookiebarClass.holder}>\n\t\t\t\t\t<div class={CookiebarClass.content}>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{(this.h.hasSlot('actions-primary') || this.h.hasSlot('actions-secondary')) && (\n\t\t\t\t\t\t<div class={CookiebarClass.actions}>\n\t\t\t\t\t\t\t{this.h.hasSlot('actions-primary') && (\n\t\t\t\t\t\t\t\t<div class={CookiebarClass.actionsPrimary}>\n\t\t\t\t\t\t\t\t\t<slot name=\"actions-primary\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t\t{this.h.hasSlot('actions-secondary') && (\n\t\t\t\t\t\t\t\t<div class={CookiebarClass.actionsSecondary}>\n\t\t\t\t\t\t\t\t\t<slot name=\"actions-secondary\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
@@ -141,7 +141,6 @@ function defineCustomElement$1() {
141
141
  break;
142
142
  } });
143
143
  }
144
- defineCustomElement$1();
145
144
 
146
145
  const GovDropdown = GovDropdown$1;
147
146
  const defineCustomElement = defineCustomElement$1;
@@ -1 +1 @@
1
- {"file":"gov-dropdown.js","mappings":";;;;;AACA,MAAM,2BAA2B,GAAG;AACpC,IAAI,aAAa,EAAE,OAAO;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,CAAC,CAAC;AAgCF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,GAAG,2BAA2B,EAAE;AACtG,IAAI,MAAM,aAAa,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;AAChD,IAAI,gBAAgB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,YAAY,IAAI;AAClD,QAAQ,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC,CAAC,KAAK;AACrD,YAAY,gBAAgB,CAAC,CAAC,EAAE,SAAS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-click-outside/dist/esm/index.js","../../../packages/core/src/components/gov-button/dropdown/constants.ts","../../../packages/core/src/components/gov-button/dropdown/gov-dropdown.scss?tag=gov-dropdown","../../../packages/core/src/components/gov-button/dropdown/gov-dropdown.tsx"],"sourcesContent":["import { Build as BUILD, getElement } from '@stencil/core';\nconst ClickOutsideOptionsDefaults = {\n triggerEvents: \"click\",\n exclude: \"\"\n};\n/**\n * Call this function as soon as the click outside of annotated method's host is done.\n * @example\n```\n@ClickOutside()\ncallback() {\n // this will run when click outside of element (host component) is done.\n}\n```\n */\nexport function ClickOutside(opt = ClickOutsideOptionsDefaults) {\n return (proto, methodName) => {\n // this is to resolve the 'compiler optimization issue':\n // lifecycle events not being called when not explicitly declared in at least one of components from bundle\n BUILD.connectedCallback = true;\n BUILD.disconnectedCallback = true;\n const { connectedCallback, disconnectedCallback } = proto;\n proto.connectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n registerClickOutside(this, host, method, opt);\n return connectedCallback && connectedCallback.call(this);\n };\n proto.disconnectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n removeClickOutside(this, host, method, opt);\n return disconnectedCallback && disconnectedCallback.call(this);\n };\n };\n}\n/**\n * Register callback function for HTMLElement to be executed when user clicks outside of element.\n * @example\n```\n<span\n ref={spanEl => registerClickOutside(this, spanEl, () => this.test())}>\n Hello, World!\n</span>;\n```\n */\nexport function registerClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n const excludedNodes = getExcludedNodes(opt);\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.addEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback, excludedNodes);\n }, false);\n });\n}\n/**\n * Remove click outside callback function for HTMLElement.\n */\nexport function removeClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.removeEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback);\n }, false);\n });\n}\nfunction initClickOutside(event, component, element, callback, excludedNodes) {\n const target = event.target;\n if (!element.contains(target) && !isExcluded(target, excludedNodes)) {\n callback.call(component);\n }\n}\nfunction getTriggerEvents(opt) {\n if (opt.triggerEvents) {\n return opt.triggerEvents.split(\",\").map(e => e.trim());\n }\n return [\"click\"];\n}\nfunction getExcludedNodes(opt) {\n if (opt.exclude) {\n try {\n return Array.from(document.querySelectorAll(opt.exclude));\n }\n catch (err) {\n console.warn(`@ClickOutside: Exclude: '${opt.exclude}' will not be evaluated. Check your exclude selector syntax.`, err);\n }\n }\n return;\n}\nfunction isExcluded(target, excudedNodes) {\n if (target && excudedNodes) {\n for (let excludedNode of excudedNodes) {\n if (excludedNode.contains(target)) {\n return true;\n }\n }\n }\n return false;\n}\n","import { ValueOf } from \"../../../types/interfaces\"\n\nexport enum Position {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n}\n\nexport type PositionType = `${ValueOf<typeof Position>}`\n\nexport const DropdownClass = {\n\troot: 'gov-dropdown',\n\tlist: 'gov-dropdown__list'\n}\n","/*\n * Dropdown\n */\n\n$class: \".gov-dropdown\";\n\n#{$class} {\n\tposition: relative;\n\n\t&__list {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tz-index: 100;\n\t}\n\tul {\n\t\tpadding: rem-calc(4);\n\t\tborder-radius: $border-radius;\n\t\tbackground-color: $dropdown-bg-color;\n\t\tbox-shadow: $dropdown-box-shadow;\n\t}\n\tli {\n\t\tmargin: 0;\n\t\twhite-space: nowrap;\n\t\t&::before {\n\t\t\tcontent: none;\n\t\t}\n\t\t> * {\n\t\t\twidth: 100%;\n\t\t}\n\t\t> * .element {\n\t\t\tjustify-content: space-between;\n\t\t\twidth: 100%;\n\t\t\tpadding: rem-calc(8) !important;\n\t\t\tfont-weight: 400 !important;\n\t\t}\n\t}\n\t&[position=\"right\"] {\n\t\t#{$class}__list {\n\t\t\tright: 0;\n\t\t\tleft: initial;\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop } from \"@stencil/core\"\nimport { registerClickOutside } from \"stencil-click-outside\"\nimport { govHost, toBoolAttr } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { Nullable } from \"../../../types/interfaces\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { ButtonClass } from \"../default/constants\"\nimport { DropdownClass, Position, PositionType } from \"./constants\"\nimport { DropdownEvent } from \"./gov-dropdown.types\"\n\n@Component({\n\ttag: \"gov-dropdown\",\n\tstyleUrl: \"gov-dropdown.scss\",\n})\nexport class GovDropdown {\n\tprivate h: GovHost\n\tprivate readonly listId: string\n\tprivate readonly controlId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.listId = createID(\"GovDropdownList\")\n\t\tthis.controlId = createID(\"GovDropdownControl\")\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\t/**\n\t * Dropdown open state\n\t */\n\t@Prop({ mutable: true }) open = false\n\t/**\n\t * Menu display position\n\t */\n\t@Prop() readonly position: PositionType = Position.LEFT\n\t/**\n\t * Emitted when the dropdown change state\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<DropdownEvent>\n\n\tcomponentWillLoad() {\n\t\tif (this.trigger) {\n\t\t\tthis.trigger.setAttribute(\"wcag-controls\", this.listId)\n\t\t\tthis.trigger.setAttribute(\"wcag-has-popup\", toBoolAttr(!!this.list))\n\t\t\tthis.trigger.setAttribute(\"identifier\", this.controlId)\n\n\t\t\tthis.trigger.addEventListener(\"gov-click\", (e) => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.open = !this.open\n\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: DropdownClass.root,\n\t\t\t\t\toriginalEvent: e,\n\t\t\t\t\topen: this.open,\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t}\n\n\tget trigger() {\n\t\treturn this.host.querySelector(`* > ${ButtonClass.root}`) as HTMLGovButtonElement\n\t}\n\n\tget list() {\n\t\treturn this.h.getSlot(\"list\") as Nullable<HTMLUListElement>\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([DropdownClass.root])} open={this.open} position={this.position}>\n\t\t\t\t<slot></slot>\n\t\t\t\t<div\n\t\t\t\t\tref={el => registerClickOutside(this, el, () => this.open = false)}\n\t\t\t\t\tclass={DropdownClass.list}\n\t\t\t\t\tid={this.listId}\n\t\t\t\t\taria-labelledby={this.controlId}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\thidden={!this.open}>\n\t\t\t\t\t<slot name=\"list\"></slot>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns the current state of the dropdown\n\t */\n\t@Method()\n\tasync getState() {\n\t\treturn this.open\n\t}\n\n\t/**\n\t * Sets the dropdown state\n\t */\n\t@Method()\n\tasync setOpen(state: boolean) {\n\t\tthis.open = state\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-dropdown.js","mappings":";;;;;AACA,MAAM,2BAA2B,GAAG;AACpC,IAAI,aAAa,EAAE,OAAO;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,CAAC,CAAC;AAgCF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,GAAG,2BAA2B,EAAE;AACtG,IAAI,MAAM,aAAa,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;AAChD,IAAI,gBAAgB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,YAAY,IAAI;AAClD,QAAQ,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC,CAAC,KAAK;AACrD,YAAY,gBAAgB,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;AAC7E,SAAS,EAAE,KAAK,CAAC,CAAC;AAClB,KAAK,C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C;UACnB,SAAS,EAAE,aAAa,CAAC,IAAI;UAC7B,aAAa,EAAE,CAAC;UAChB,IAAI,EAAE,IAAI,CAAC,IAAI;SACf,CAAC,CAAA;OACF,CAAC,CAAA;KACF;GACD;EAED,IAAI,OAAO;IACV,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,WAAW,CAAC,IAAI,EAAE,CAAyB,CAAA;GACjF;EAED,IAAI,IAAI;IACP,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAA+B,CAAA;GAC3D;EAED,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAC1F,eAAa,EACb,WACC,GAAG,EAAE,EAAE,IAAI,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,EAClE,KAAK,EAAE,aAAa,CAAC,IAAI,EACzB,EAAE,EAAE,IAAI,CAAC,MAAM,qBACE,IAAI,CAAC,SAAS,iBAClB,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EACnC,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,IAClB,YAAM,IAAI,EAAC,MAAM,GAAQ,CACpB,CACA,EACP;GACD;;;;EAMD,MAAM,QAAQ;IACb,OAAO,IAAI,CAAC,IAAI,CAAA;GAChB;;;;EAMD,MAAM,OAAO,CAAC,KAAc;IAC3B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAA;GACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["GovDropdown"],"sources":["../../../node_modules/stencil-click-outside/dist/esm/index.js","../../../packages/core/src/components/gov-button/dropdown/constants.ts","../../../packages/core/src/components/gov-button/dropdown/gov-dropdown.scss?tag=gov-dropdown","../../../packages/core/src/components/gov-button/dropdown/gov-dropdown.tsx"],"sourcesContent":["import { Build as BUILD, getElement } from '@stencil/core';\nconst ClickOutsideOptionsDefaults = {\n triggerEvents: \"click\",\n exclude: \"\"\n};\n/**\n * Call this function as soon as the click outside of annotated method's host is done.\n * @example\n```\n@ClickOutside()\ncallback() {\n // this will run when click outside of element (host component) is done.\n}\n```\n */\nexport function ClickOutside(opt = ClickOutsideOptionsDefaults) {\n return (proto, methodName) => {\n // this is to resolve the 'compiler optimization issue':\n // lifecycle events not being called when not explicitly declared in at least one of components from bundle\n BUILD.connectedCallback = true;\n BUILD.disconnectedCallback = true;\n const { connectedCallback, disconnectedCallback } = proto;\n proto.connectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n registerClickOutside(this, host, method, opt);\n return connectedCallback && connectedCallback.call(this);\n };\n proto.disconnectedCallback = function () {\n const host = getElement(this);\n const method = this[methodName];\n removeClickOutside(this, host, method, opt);\n return disconnectedCallback && disconnectedCallback.call(this);\n };\n };\n}\n/**\n * Register callback function for HTMLElement to be executed when user clicks outside of element.\n * @example\n```\n<span\n ref={spanEl => registerClickOutside(this, spanEl, () => this.test())}>\n Hello, World!\n</span>;\n```\n */\nexport function registerClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n const excludedNodes = getExcludedNodes(opt);\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.addEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback, excludedNodes);\n }, false);\n });\n}\n/**\n * Remove click outside callback function for HTMLElement.\n */\nexport function removeClickOutside(component, element, callback, opt = ClickOutsideOptionsDefaults) {\n getTriggerEvents(opt).forEach(triggerEvent => {\n window.removeEventListener(triggerEvent, (e) => {\n initClickOutside(e, component, element, callback);\n }, false);\n });\n}\nfunction initClickOutside(event, component, element, callback, excludedNodes) {\n const target = event.target;\n if (!element.contains(target) && !isExcluded(target, excludedNodes)) {\n callback.call(component);\n }\n}\nfunction getTriggerEvents(opt) {\n if (opt.triggerEvents) {\n return opt.triggerEvents.split(\",\").map(e => e.trim());\n }\n return [\"click\"];\n}\nfunction getExcludedNodes(opt) {\n if (opt.exclude) {\n try {\n return Array.from(document.querySelectorAll(opt.exclude));\n }\n catch (err) {\n console.warn(`@ClickOutside: Exclude: '${opt.exclude}' will not be evaluated. Check your exclude selector syntax.`, err);\n }\n }\n return;\n}\nfunction isExcluded(target, excudedNodes) {\n if (target && excudedNodes) {\n for (let excludedNode of excudedNodes) {\n if (excludedNode.contains(target)) {\n return true;\n }\n }\n }\n return false;\n}\n","import { ValueOf } from \"../../../types/interfaces\"\n\nexport enum Position {\n\tLEFT = 'left',\n\tRIGHT = 'right',\n}\n\nexport type PositionType = `${ValueOf<typeof Position>}`\n\nexport const DropdownClass = {\n\troot: 'gov-dropdown',\n\tlist: 'gov-dropdown__list'\n}\n","/*\n * Dropdown\n */\n\n$class: \".gov-dropdown\";\n\n#{$class} {\n\tposition: relative;\n\n\t&__list {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tz-index: 100;\n\t}\n\tul {\n\t\tpadding: rem-calc(4);\n\t\tborder-radius: $border-radius;\n\t\tbackground-color: $dropdown-bg-color;\n\t\tbox-shadow: $dropdown-box-shadow;\n\t}\n\tli {\n\t\tmargin: 0;\n\t\twhite-space: nowrap;\n\t\t&::before {\n\t\t\tcontent: none;\n\t\t}\n\t\t> * {\n\t\t\twidth: 100%;\n\t\t}\n\t\t> * .element {\n\t\t\tjustify-content: space-between;\n\t\t\twidth: 100%;\n\t\t\tpadding: rem-calc(8) !important;\n\t\t\tfont-weight: 400 !important;\n\t\t}\n\t}\n\t&[position=\"right\"] {\n\t\t#{$class}__list {\n\t\t\tright: 0;\n\t\t\tleft: initial;\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop } from \"@stencil/core\"\nimport { registerClickOutside } from \"stencil-click-outside\"\nimport { govHost, toBoolAttr } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { Nullable } from \"../../../types/interfaces\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { ButtonClass } from \"../default/constants\"\nimport { DropdownClass, Position, PositionType } from \"./constants\"\nimport { DropdownEvent } from \"./gov-dropdown.types\"\n\n@Component({\n\ttag: \"gov-dropdown\",\n\tstyleUrl: \"gov-dropdown.scss\",\n})\nexport class GovDropdown {\n\tprivate h: GovHost\n\tprivate readonly listId: string\n\tprivate readonly controlId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.listId = createID(\"GovDropdownList\")\n\t\tthis.controlId = createID(\"GovDropdownControl\")\n\t}\n\n\t@Element() host: HTMLGovButtonElement\n\t/**\n\t * Dropdown open state\n\t */\n\t@Prop({ mutable: true }) open = false\n\t/**\n\t * Menu display position\n\t */\n\t@Prop() readonly position: PositionType = Position.LEFT\n\t/**\n\t * Emitted when the dropdown change state\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<DropdownEvent>\n\n\tcomponentWillLoad() {\n\t\tif (this.trigger) {\n\t\t\tthis.trigger.setAttribute(\"wcag-controls\", this.listId)\n\t\t\tthis.trigger.setAttribute(\"wcag-has-popup\", toBoolAttr(!!this.list))\n\t\t\tthis.trigger.setAttribute(\"identifier\", this.controlId)\n\n\t\t\tthis.trigger.addEventListener(\"gov-click\", (e) => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.open = !this.open\n\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: DropdownClass.root,\n\t\t\t\t\toriginalEvent: e,\n\t\t\t\t\topen: this.open,\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t}\n\n\tget trigger() {\n\t\treturn this.host.querySelector(`* > ${ButtonClass.root}`) as HTMLGovButtonElement\n\t}\n\n\tget list() {\n\t\treturn this.h.getSlot(\"list\") as Nullable<HTMLUListElement>\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([DropdownClass.root])} open={this.open} position={this.position}>\n\t\t\t\t<slot></slot>\n\t\t\t\t<div\n\t\t\t\t\tref={el => registerClickOutside(this, el, () => this.open = false)}\n\t\t\t\t\tclass={DropdownClass.list}\n\t\t\t\t\tid={this.listId}\n\t\t\t\t\taria-labelledby={this.controlId}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\thidden={!this.open}>\n\t\t\t\t\t<slot name=\"list\"></slot>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns the current state of the dropdown\n\t */\n\t@Method()\n\tasync getState() {\n\t\treturn this.open\n\t}\n\n\t/**\n\t * Sets the dropdown state\n\t */\n\t@Method()\n\tasync setOpen(state: boolean) {\n\t\tthis.open = state\n\t}\n}\n"],"version":3}
@@ -35,7 +35,6 @@ function defineCustomElement$1() {
35
35
  break;
36
36
  } });
37
37
  }
38
- defineCustomElement$1();
39
38
 
40
39
  const GovEmpty = GovEmpty$1;
41
40
  const defineCustomElement = defineCustomElement$1;
@@ -1 +1 @@
1
- {"file":"gov-empty.js","mappings":";;;AAAO,MAAM,UAAU,GAAG;EACzB,IAAI,EAAE,WAAW;EACjB,IAAI,EAAE,iBAAiB;EACvB,SAAS,EAAE,sBAAsB;EACjC,OAAO,EAAE,oBAAoB;CAC7B;;ACLD,MAAM,WAAW,GAAG,yzBAAyzB;;MCSh0BA,UAAQ;EAGpB;;;IACC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAID,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAC1C,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KACtB,WAAK,KAAK,EAAE,UAAU,CAAC,IAAI,IAC1B,YAAM,IAAI,EAAC,MAAM,GAAG,CACf,CACN,EACD,WAAK,KAAK,EAAE,UAAU,CAAC,OAAO,IAC7B,eAAQ,CACH,CACA,EACP;GACD;;;;;;;;;;;;;;;;;;;;;;;;","names":["GovEmpty"],"sources":["../../../packages/core/src/components/gov-empty/constants.ts","../../../packages/core/src/components/gov-empty/gov-empty.scss?tag=gov-empty","../../../packages/core/src/components/gov-empty/gov-empty.tsx"],"sourcesContent":["export const EmptyClass = {\n\troot: 'gov-empty',\n\ticon: 'gov-empty__icon',\n\tcontainer: 'gov-empty__container',\n\tcontent: 'gov-empty__content',\n}\n","/*\n * Alert\n */\n\n$class: \".gov-empty\";\n\n#{$class} {\n\t@include base();\n\t&__icon {\n\t\tdisplay: inline-flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\twidth: rem-calc(96);\n\t\theight: rem-calc(96);\n\t\tmargin-bottom: calc(rem-calc(96) / 3);\n\t\tborder-radius: 50%;\n\t\tbackground: $empty-icon-circle-bg;\n\t\tcolor: $empty-icon-color;\n\t\t& > * {\n\t\t\twidth: rem-calc(56);\n\t\t\theight: rem-calc(56);\n\t\t}\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t}\n}\n","import { Component, Element, Host, h } from '@stencil/core'\nimport { EmptyClass } from './constants'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-empty',\n\tstyleUrl: 'gov-empty.scss',\n})\nexport class GovEmpty {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovEmptyElement\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(EmptyClass.root)}>\n\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t<div class={EmptyClass.icon}>\n\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t<div class={EmptyClass.content}>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-empty.js","mappings":";;;AAAO,MAAM,UAAU,GAAG;EACzB,IAAI,EAAE,WAAW;EACjB,IAAI,EAAE,iBAAiB;EACvB,SAAS,EAAE,sBAAsB;EACjC,OAAO,EAAE,oBAAoB;CAC7B;;ACLD,MAAM,WAAW,GAAG,yzBAAyzB;;MCSh0BA,UAAQ;EAGpB;;;IACC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAID,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAC1C,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KACtB,WAAK,KAAK,EAAE,UAAU,CAAC,IAAI,IAC1B,YAAM,IAAI,EAAC,MAAM,GAAG,CACf,CACN,EACD,WAAK,KAAK,EAAE,UAAU,CAAC,OAAO,IAC7B,eAAQ,CACH,CACA,EACP;GACD;;;;;;;;;;;;;;;;;;;;;;;","names":["GovEmpty"],"sources":["../../../packages/core/src/components/gov-empty/constants.ts","../../../packages/core/src/components/gov-empty/gov-empty.scss?tag=gov-empty","../../../packages/core/src/components/gov-empty/gov-empty.tsx"],"sourcesContent":["export const EmptyClass = {\n\troot: 'gov-empty',\n\ticon: 'gov-empty__icon',\n\tcontainer: 'gov-empty__container',\n\tcontent: 'gov-empty__content',\n}\n","/*\n * Alert\n */\n\n$class: \".gov-empty\";\n\n#{$class} {\n\t@include base();\n\t&__icon {\n\t\tdisplay: inline-flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\twidth: rem-calc(96);\n\t\theight: rem-calc(96);\n\t\tmargin-bottom: calc(rem-calc(96) / 3);\n\t\tborder-radius: 50%;\n\t\tbackground: $empty-icon-circle-bg;\n\t\tcolor: $empty-icon-color;\n\t\t& > * {\n\t\t\twidth: rem-calc(56);\n\t\t\theight: rem-calc(56);\n\t\t}\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t}\n}\n","import { Component, Element, Host, h } from '@stencil/core'\nimport { EmptyClass } from './constants'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-empty',\n\tstyleUrl: 'gov-empty.scss',\n})\nexport class GovEmpty {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovEmptyElement\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(EmptyClass.root)}>\n\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t<div class={EmptyClass.icon}>\n\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t<div class={EmptyClass.content}>\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
@@ -35,7 +35,6 @@ function defineCustomElement$1() {
35
35
  break;
36
36
  } });
37
37
  }
38
- defineCustomElement$1();
39
38
 
40
39
  const GovErrorCode = GovErrorCode$1;
41
40
  const defineCustomElement = defineCustomElement$1;
@@ -1 +1 @@
1
- {"file":"gov-error-code.js","mappings":";;;AAAO,MAAM,cAAc,GAAG;EAC7B,IAAI,EAAE,gBAAgB;EACtB,IAAI,EAAE,sBAAsB;EAC5B,MAAM,EAAE,wBAAwB;EAChC,OAAO,EAAE,yBAAyB;CAClC;;ACLD,MAAM,eAAe,GAAG,+hCAA+hC;;MCS1iCA,cAAY;EAGxB;;;IACC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAID,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAC/C,WAAK,KAAK,EAAE,cAAc,CAAC,MAAM,IAC/B,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KACtB,WAAK,KAAK,EAAE,cAAc,CAAC,IAAI,IAC9B,YAAM,IAAI,EAAC,MAAM,GAAG,CACf,CACN,EACD,WAAK,KAAK,EAAE,cAAc,CAAC,OAAO,IACjC,eAAQ,CACH,CACD,CACA,EACP;GACD;;;;;;;;;;;;;;;;;;;;;;;;","names":["GovErrorCode"],"sources":["../../../packages/core/src/components/gov-error-code/constants.ts","../../../packages/core/src/components/gov-error-code/gov-error-code.scss?tag=gov-error-code","../../../packages/core/src/components/gov-error-code/gov-error-code.tsx"],"sourcesContent":["export const ErrorCodeClass = {\n\troot: 'gov-error-code',\n\ticon: 'gov-error-code__icon',\n\tholder: 'gov-error-code__holder',\n\tcontent: 'gov-error-code__content',\n}\n","/*\n * Alert\n */\n\n$class: \".gov-error-code\";\n\n#{$class} {\n\t@include base();\n\t&__holder {\n\t\tmargin: 0 auto;\n\t\ttext-align: center;\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t}\n\t&__icon {\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\twidth: rem-calc(150);\n\t\theight: rem-calc(150);\n\t\tmargin: 0 auto rem-calc(24);\n\t\tborder-radius: 50%;\n\t\tbackground: $error-icon-circle-bg;\n\t\tcolor: $error-icon-color;\n\t\t& > * {\n\t\t\twidth: rem-calc(114);\n\t\t\theight: rem-calc(114);\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: md) {\n\t\t&__icon {\n\t\t\twidth: rem-calc(200);\n\t\t\theight: rem-calc(200);\n\t\t\tmargin: 0 auto rem-calc(32);\n\t\t\t& > * {\n\t\t\t\twidth: rem-calc(152);\n\t\t\t\theight: rem-calc(152);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host } from '@stencil/core'\nimport { ErrorCodeClass } from './constants'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-error-code',\n\tstyleUrl: 'gov-error-code.scss',\n})\nexport class GovErrorCode {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovErrorCodeElement\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ErrorCodeClass.root)}>\n\t\t\t\t<div class={ErrorCodeClass.holder}>\n\t\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t\t<div class={ErrorCodeClass.icon}>\n\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<div class={ErrorCodeClass.content}>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
1
+ {"file":"gov-error-code.js","mappings":";;;AAAO,MAAM,cAAc,GAAG;EAC7B,IAAI,EAAE,gBAAgB;EACtB,IAAI,EAAE,sBAAsB;EAC5B,MAAM,EAAE,wBAAwB;EAChC,OAAO,EAAE,yBAAyB;CAClC;;ACLD,MAAM,eAAe,GAAG,+hCAA+hC;;MCS1iCA,cAAY;EAGxB;;;IACC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAID,MAAM;IACL,QACC,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,IAC/C,WAAK,KAAK,EAAE,cAAc,CAAC,MAAM,IAC/B,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KACtB,WAAK,KAAK,EAAE,cAAc,CAAC,IAAI,IAC9B,YAAM,IAAI,EAAC,MAAM,GAAG,CACf,CACN,EACD,WAAK,KAAK,EAAE,cAAc,CAAC,OAAO,IACjC,eAAQ,CACH,CACD,CACA,EACP;GACD;;;;;;;;;;;;;;;;;;;;;;;","names":["GovErrorCode"],"sources":["../../../packages/core/src/components/gov-error-code/constants.ts","../../../packages/core/src/components/gov-error-code/gov-error-code.scss?tag=gov-error-code","../../../packages/core/src/components/gov-error-code/gov-error-code.tsx"],"sourcesContent":["export const ErrorCodeClass = {\n\troot: 'gov-error-code',\n\ticon: 'gov-error-code__icon',\n\tholder: 'gov-error-code__holder',\n\tcontent: 'gov-error-code__content',\n}\n","/*\n * Alert\n */\n\n$class: \".gov-error-code\";\n\n#{$class} {\n\t@include base();\n\t&__holder {\n\t\tmargin: 0 auto;\n\t\ttext-align: center;\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t}\n\t&__icon {\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\twidth: rem-calc(150);\n\t\theight: rem-calc(150);\n\t\tmargin: 0 auto rem-calc(24);\n\t\tborder-radius: 50%;\n\t\tbackground: $error-icon-circle-bg;\n\t\tcolor: $error-icon-color;\n\t\t& > * {\n\t\t\twidth: rem-calc(114);\n\t\t\theight: rem-calc(114);\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: md) {\n\t\t&__icon {\n\t\t\twidth: rem-calc(200);\n\t\t\theight: rem-calc(200);\n\t\t\tmargin: 0 auto rem-calc(32);\n\t\t\t& > * {\n\t\t\t\twidth: rem-calc(152);\n\t\t\t\theight: rem-calc(152);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host } from '@stencil/core'\nimport { ErrorCodeClass } from './constants'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-error-code',\n\tstyleUrl: 'gov-error-code.scss',\n})\nexport class GovErrorCode {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovErrorCodeElement\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ErrorCodeClass.root)}>\n\t\t\t\t<div class={ErrorCodeClass.holder}>\n\t\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t\t<div class={ErrorCodeClass.icon}>\n\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<div class={ErrorCodeClass.content}>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"version":3}
@@ -282,7 +282,6 @@ function defineCustomElement() {
282
282
  break;
283
283
  } });
284
284
  }
285
- defineCustomElement();
286
285
 
287
286
  export { GovFormAutocomplete as G, defineCustomElement as d };
288
287