@gov-design-system-ce/components 0.0.54 → 0.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{constants-393e915a.js → constants-dde21dcf.js} +4 -4
- package/dist/cjs/{constants-393e915a.js.map → constants-dde21dcf.js.map} +1 -1
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/gov-accordion-item.cjs.entry.js +3 -3
- package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-accordion.cjs.entry.js +1 -1
- package/dist/cjs/gov-app.cjs.entry.js +68 -23
- package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-form-file.cjs.entry.js +14 -2
- package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-icon.cjs.entry.js +1 -1
- package/dist/cjs/gov-message.cjs.entry.js +1 -1
- package/dist/cjs/gov-message.cjs.entry.js.map +1 -1
- package/dist/cjs/gov-tile.cjs.entry.js +3 -17
- package/dist/cjs/gov-tile.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/gov-accordion/constants.js +3 -3
- package/dist/collection/components/gov-accordion/constants.js.map +1 -1
- package/dist/collection/components/gov-accordion/gov-accordion-item.css +96 -68
- package/dist/collection/components/gov-accordion/gov-accordion-item.js +1 -1
- package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
- package/dist/collection/components/gov-form/file/gov-form-file.js +31 -2
- package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
- package/dist/collection/components/gov-message/gov-message.js +1 -1
- package/dist/collection/components/gov-message/gov-message.js.map +1 -1
- package/dist/collection/components/gov-tile/gov-tile.css +17 -36
- package/dist/collection/components/gov-tile/gov-tile.js +19 -45
- package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
- package/dist/collection/pages/Accordion.js +41 -2
- package/dist/collection/pages/Accordion.js.map +1 -1
- package/dist/collection/pages/Tiles.js +27 -21
- package/dist/collection/pages/Tiles.js.map +1 -1
- package/dist/components/gov-accordion-item.js +1 -1
- package/dist/components/gov-accordion-item.js.map +1 -1
- package/dist/components/gov-accordion.js +1 -1
- package/dist/components/gov-alert.js +1 -1
- package/dist/components/gov-app.js +1 -1
- package/dist/components/gov-app.js.map +1 -1
- package/dist/components/gov-attachments-item.js +1 -1
- package/dist/components/gov-button.js +1 -1
- package/dist/components/gov-card.js +1 -1
- package/dist/components/gov-form-autocomplete.js +1 -1
- package/dist/components/gov-form-checkbox.js +1 -1
- package/dist/components/gov-form-file.js +1 -1
- package/dist/components/gov-form-file.js.map +1 -1
- package/dist/components/gov-form-input.js +1 -1
- package/dist/components/gov-form-multi-select.js +1 -1
- package/dist/components/gov-form-select.js +1 -1
- package/dist/components/gov-icon.js +1 -1
- package/dist/components/gov-loading.js +1 -1
- package/dist/components/gov-message.js.map +1 -1
- package/dist/components/gov-modal.js +1 -1
- package/dist/components/gov-pagination.js +1 -1
- package/dist/components/gov-prompt.js +1 -1
- package/dist/components/gov-side-nav-item.js +1 -1
- package/dist/components/gov-tabs.js +1 -1
- package/dist/components/gov-tile.js +1 -1
- package/dist/components/gov-tile.js.map +1 -1
- package/dist/components/gov-toast.js +1 -1
- package/dist/components/gov-wizard-item.js +1 -1
- package/dist/components/{p-c055eb68.js → p-04bfe959.js} +2 -2
- package/dist/components/{p-3a46b683.js → p-2753b6e4.js} +2 -2
- package/dist/components/{p-e9a01d67.js → p-594ba760.js} +2 -2
- package/dist/components/{p-d6ab5b8a.js → p-6ca0c464.js} +2 -2
- package/dist/components/p-74b2311a.js +2 -0
- package/dist/components/p-74b2311a.js.map +1 -0
- package/dist/components/{p-b9388dc1.js → p-baf87688.js} +2 -2
- package/dist/components/{p-560846c7.js → p-f516d8f6.js} +2 -2
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-dbb46457.entry.js → p-13624a77.entry.js} +2 -2
- package/dist/core/p-13624a77.entry.js.map +1 -0
- package/dist/core/{p-b9b57928.entry.js → p-4df62a13.entry.js} +2 -2
- package/dist/core/p-5316e768.entry.js.map +1 -1
- package/dist/core/p-74b2311a.js +2 -0
- package/dist/core/p-74b2311a.js.map +1 -0
- package/dist/core/p-74ce7780.entry.js +2 -0
- package/dist/core/p-74ce7780.entry.js.map +1 -0
- package/dist/core/p-74f0be51.entry.js +2 -0
- package/dist/core/p-74f0be51.entry.js.map +1 -0
- package/dist/core/p-801f1147.entry.js +2 -0
- package/dist/core/p-801f1147.entry.js.map +1 -0
- package/dist/core/{p-44af4bc9.entry.js → p-87aca157.entry.js} +2 -2
- package/dist/esm/{constants-858966b9.js → constants-09bda759.js} +4 -4
- package/dist/esm/{constants-858966b9.js.map → constants-09bda759.js.map} +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/gov-accordion-item.entry.js +3 -3
- package/dist/esm/gov-accordion-item.entry.js.map +1 -1
- package/dist/esm/gov-accordion.entry.js +1 -1
- package/dist/esm/gov-app.entry.js +68 -23
- package/dist/esm/gov-app.entry.js.map +1 -1
- package/dist/esm/gov-form-file.entry.js +14 -2
- package/dist/esm/gov-form-file.entry.js.map +1 -1
- package/dist/esm/gov-icon.entry.js +1 -1
- package/dist/esm/gov-message.entry.js +1 -1
- package/dist/esm/gov-message.entry.js.map +1 -1
- package/dist/esm/gov-tile.entry.js +3 -17
- package/dist/esm/gov-tile.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +93 -49
- package/dist/types/components/gov-accordion/constants.d.ts +3 -3
- package/dist/types/components/gov-form/file/gov-form-file.d.ts +4 -0
- package/dist/types/components/gov-message/gov-message.d.ts +1 -1
- package/dist/types/components/gov-tile/gov-tile.d.ts +4 -8
- package/dist/types/components.d.ts +10 -12
- package/package.json +2 -2
- package/dist/components/p-37a7409e.js +0 -2
- package/dist/components/p-37a7409e.js.map +0 -1
- package/dist/core/p-37a7409e.js +0 -2
- package/dist/core/p-37a7409e.js.map +0 -1
- package/dist/core/p-3b236ac2.entry.js +0 -2
- package/dist/core/p-3b236ac2.entry.js.map +0 -1
- package/dist/core/p-af7a89bc.entry.js +0 -2
- package/dist/core/p-af7a89bc.entry.js.map +0 -1
- package/dist/core/p-d1b7d8a6.entry.js +0 -2
- package/dist/core/p-d1b7d8a6.entry.js.map +0 -1
- package/dist/core/p-dbb46457.entry.js.map +0 -1
- /package/dist/components/{p-c055eb68.js.map → p-04bfe959.js.map} +0 -0
- /package/dist/components/{p-3a46b683.js.map → p-2753b6e4.js.map} +0 -0
- /package/dist/components/{p-e9a01d67.js.map → p-594ba760.js.map} +0 -0
- /package/dist/components/{p-d6ab5b8a.js.map → p-6ca0c464.js.map} +0 -0
- /package/dist/components/{p-b9388dc1.js.map → p-baf87688.js.map} +0 -0
- /package/dist/components/{p-560846c7.js.map → p-f516d8f6.js.map} +0 -0
- /package/dist/core/{p-b9b57928.entry.js.map → p-4df62a13.entry.js.map} +0 -0
- /package/dist/core/{p-44af4bc9.entry.js.map → p-87aca157.entry.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["govAccordionItemCss","GovAccordionItem","constructor","hostRef","this","h","govHost","host","triggerId","createID","contentId","validateSize","newValue","validateProp","AccordionSizes","AccordionItemClass","root","validateVariant","AccordionVariants","emmitChange","govChange","emit","open","isExpanded","component","ref","componentWillLoad","getPropsFromParents","size","variant","accordion","getParent","AccordionClass","getAttribute","render","identifier","Host","class","classes","role","id","header","booleanString","disabled","type","toBoolAttrIfDefined","onClick","e","stopPropagation","toggle","finally","hasSlot","icon","name","title","label","annotation","suffix","arrow","content","hidden","close","currentState"],"sources":["../../../packages/core/src/components/gov-accordion/gov-accordion-item.scss?tag=gov-accordion-item","../../../packages/core/src/components/gov-accordion/gov-accordion-item.tsx"],"sourcesContent":["/*\n * Accordion - Item\n */\n\n$class: \".gov-accordion-item\";\n\n#{$class} {\n\t@include base();\n\t&::before {\n\t\t@include pseudo();\n\t\tright: 0;\n\t\tbottom: -1px;\n\t\tleft: 0;\n\t\theight: 1px;\n\t\tbackground-color: color(\"secondary.500\");\n\t}\n\n\t&__header {\n\t\t@include button-core();\n\t\t@include focus-outline();\n\t\t@include general;\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: flex-start;\n\t\twidth: 100%;\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\n\t\t// STATES\n\t\t&:focus-visible {\n\t\t\t&::before {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t\t@include parameter(\"aria-expanded\") {\n\t\t\t#{$class} {\n\t\t\t\t&__arrow .gov-icon:not([slot=\"toggle-icon\"]) {\n\t\t\t\t\ttransform: scale(-1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t&__arrow {\n\t\tflex: 0 0 auto;\n\t\tmargin-left: auto;\n\t}\n\t&__icon {\n\t\tdisplay: inline-flex;\n\t\tvertical-align: middle;\n\t\tflex: 0 0 auto;\n\t}\n\t&__suffix {\n\t\tdisplay: inline-flex;\n\t\tvertical-align: middle;\n\t\tflex: 0 0 auto;\n\t\talign-self: start;\n\t\tmargin-left: auto;\n\t\tline-height: initial;\n\t}\n\t&__title {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\t&__label * {\n\t\tmargin-bottom: 0;\n\t\ttransform: translateY(1px);\n\t}\n\t&__annotation * {\n\t\tcolor: color(\"secondary\");\n\t\tmargin-bottom: 0;\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $accordion-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__header {\n\t\t\t\t\tgap: get(\"headline-gap\", $definitions);\n\t\t\t\t\tmin-height: get(\"min-height\", $definitions);\n\t\t\t\t\tpadding: get(\"padding-y\", $definitions) get(\"padding-x\", $definitions);\n\t\t\t\t}\n\t\t\t\t&__label * {\n\t\t\t\t\t@include typography(get(\"font\", $definitions));\n\t\t\t\t}\n\t\t\t\t&__arrow {\n\t\t\t\t\twidth: get(\"icon-size\", $definitions);\n\t\t\t\t\theight: get(\"icon-size\", $definitions);\n\t\t\t\t\ttransform: translateY(get(\"arrow-position\", $definitions));\n\t\t\t\t}\n\t\t\t\t&__icon {\n\t\t\t\t\twidth: calc(get-font-size(get(\"font\", $definitions)) * 1.2);\n\t\t\t\t\theight: calc(get-font-size(get(\"font\", $definitions)) * 1.2);\n\t\t\t\t\ttransform: translateY(get(\"icon-position\", $definitions));\n\t\t\t\t}\n\t\t\t\t&__annotation {\n\t\t\t\t\t@include typography(get(\"font-annotation\", $definitions));\n\t\t\t\t}\n\t\t\t\t&__content {\n\t\t\t\t\tpadding: get(\"padding-inner\", $definitions);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t@each $variant, $definitions in $accordion-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&::before {\n\t\t\t\t\tbackground-color: get(\"separator\", $definitions);\n\t\t\t\t}\n\t\t\t\t&__header {\n\t\t\t\t\tbackground-color: get(\"background\", $definitions);\n\t\t\t\t\tcolor: get(\"color\", $definitions);\n\t\t\t\t\t@include hover() {\n\t\t\t\t\t\tbackground-color: get(\"background-hover\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// STATES\n\t\t\t@include parameter(\"disabled\") {\n\t\t\t\t#{$class} {\n\t\t\t\t\t&__header {\n\t\t\t\t\t\tcolor: get(\"disabled-color\", $definitions);\n\t\t\t\t\t\t@include hover() {\n\t\t\t\t\t\t\tbackground: transparent;\n\t\t\t\t\t\t\tcursor: not-allowed;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($until: md) {\n\t\t&__title {\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t&__label {\n\t\t\tflex: 0 0 auto;\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\tAccordionClass,\n\tAccordionItemClass,\n\tAccordionSizes,\n\tAccordionSizeType,\n\tAccordionVariants,\n\tAccordionVariantType,\n} from \"./constants\"\nimport { createID } from \"../../utils/string.utils\"\nimport { booleanString, govHost, toBoolAttrIfDefined } from \"../../helpers/Dom/template\"\nimport { AccordionItemEvent } from \"./gov-accordion.types\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\n\n@Component({\n\ttag: \"gov-accordion-item\",\n\tstyleUrl: \"gov-accordion-item.scss\",\n})\nexport class GovAccordionItem {\n\tprivate readonly triggerId: string\n\tprivate readonly contentId: string\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.triggerId = createID(\"GovAccordionItem\")\n\t\tthis.contentId = createID(\"GovAccordionContent\")\n\t}\n\n\t@Element() readonly host: HTMLGovAccordionItemElement\n\t@State() isExpandedState: boolean\n\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() variant?: AccordionVariantType\n\t/**\n\t * Custom accordion item identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Accordion’s size.\n\t */\n\t@Prop() size?: AccordionSizeType\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() readonly disabled: boolean = false\n\t/**\n\t * Defines whether the accordion is open or closed by default\n\t */\n\t@Prop({ attribute: \"is-expanded\", mutable: true }) isExpanded = false\n\t/**\n\t * Called when the accordion state changes\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<AccordionItemEvent>\n\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(AccordionSizes, newValue, AccordionItemClass.root)\n\t}\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(AccordionVariants, newValue, AccordionItemClass.root)\n\t}\n\n\tprivate emmitChange(): void {\n\t\tthis.govChange.emit({\n\t\t\topen: this.isExpanded,\n\t\t\tcomponent: AccordionItemClass.root,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.getPropsFromParents()\n\t\tthis.validateSize(this.size)\n\t\tthis.validateVariant(this.variant)\n\n\t}\n\n\tgetPropsFromParents() {\n\t\tconst accordion = this.h.getParent(AccordionClass.root)\n\t\tif (accordion) {\n\t\t\tthis.size = accordion.getAttribute(\"size\") as AccordionSizeType\n\t\t\tthis.variant = accordion.getAttribute(\"variant\") as AccordionVariantType\n\t\t}\n\t}\n\n\trender() {\n\t\tconst triggerId = this.identifier || this.triggerId\n\t\tconst contentId = this.contentId\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(AccordionItemClass.root)} size={this.size} variant={this.variant} role=\"listitem\">\n\t\t\t\t<button\n\t\t\t\t\tid={triggerId}\n\t\t\t\t\tclass={AccordionItemClass.header}\n\t\t\t\t\taria-expanded={booleanString(this.isExpanded)}\n\t\t\t\t\taria-controls={contentId}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\ttype={\"button\"}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\tonClick={(e: Event) => {\n\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\tthis.toggle().finally()\n\t\t\t\t\t}}>\n\n\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t<span class={AccordionItemClass.icon}>\n\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<span class={AccordionItemClass.title}>\n\t\t\t\t\t\t<span class={AccordionItemClass.label}>\n\t\t\t\t\t\t\t<slot name=\"label\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{this.h.hasSlot(\"annotation\") && (\n\t\t\t\t\t\t\t<span class={AccordionItemClass.annotation}>\n\t\t\t\t\t\t\t\t<slot name=\"annotation\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\n\t\t\t\t\t{this.h.hasSlot(\"suffix\") && (\n\t\t\t\t\t\t<span class={AccordionItemClass.suffix}>\n\t\t\t\t\t\t\t<slot name=\"suffix\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<span class={AccordionItemClass.arrow}>\n\t\t\t\t\t\t{this.h.hasSlot(\"toggle-icon\") ? (\n\t\t\t\t\t\t\t<slot name=\"toggle-icon\" />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<gov-icon name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</button>\n\t\t\t\t<div\n\t\t\t\t\tclass={AccordionItemClass.content}\n\t\t\t\t\tid={contentId}\n\t\t\t\t\taria-hidden={booleanString(!this.isExpanded)}\n\t\t\t\t\thidden={!this.isExpanded}\n\t\t\t\t\taria-labelledby={triggerId}>\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 * Opening the accordion\n\t */\n\t@Method()\n\tasync open(): Promise<void> {\n\t\tthis.isExpanded = true\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Closing the accordion\n\t */\n\t@Method()\n\tasync close(): Promise<void> {\n\t\tthis.isExpanded = false\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Accordion switch\n\t */\n\t@Method()\n\tasync toggle(): Promise<void> {\n\t\tthis.isExpanded = !this.isExpanded\n\t\tthis.emmitChange()\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync currentState(): Promise<boolean> {\n\t\treturn this.isExpanded\n\t}\n}\n"],"mappings":"mVAAA,MAAMA,EAAsB,8xT,MCmBfC,EAAgB,MAK5B,WAAAC,CAAAC,G,kKAyBqC,M,gBAI2B,MA5B/DC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,UAAYC,EAAS,oBAC1BL,KAAKM,UAAYD,EAAS,sB,CAkC3B,YAAAE,CAAaC,GACZC,EAAaC,EAAgBF,EAAUG,EAAmBC,K,CAI3D,eAAAC,CAAgBL,GACfC,EAAaK,EAAmBN,EAAUG,EAAmBC,K,CAGtD,WAAAG,GACPf,KAAKgB,UAAUC,KAAK,CACnBC,KAAMlB,KAAKmB,WACXC,UAAWT,EAAmBC,KAC9BS,IAAKrB,KAAKG,M,CAIZ,iBAAAmB,GACCtB,KAAKuB,sBACLvB,KAAKO,aAAaP,KAAKwB,MACvBxB,KAAKa,gBAAgBb,KAAKyB,Q,CAI3B,mBAAAF,GACC,MAAMG,EAAY1B,KAAKC,EAAE0B,UAAUC,EAAehB,MAClD,GAAIc,EAAW,CACd1B,KAAKwB,KAAOE,EAAUG,aAAa,QACnC7B,KAAKyB,QAAUC,EAAUG,aAAa,U,EAIxC,MAAAC,GACC,MAAM1B,EAAYJ,KAAK+B,YAAc/B,KAAKI,UAC1C,MAAME,EAAYN,KAAKM,UAEvB,OACCL,EAAC+B,EAAI,CAACC,MAAOjC,KAAKC,EAAEiC,QAAQvB,EAAmBC,MAAOY,KAAMxB,KAAKwB,KAAMC,QAASzB,KAAKyB,QAASU,KAAK,YAClGlC,EAAA,UACCmC,GAAIhC,EACJ6B,MAAOtB,EAAmB0B,OAAM,gBACjBC,EAActC,KAAKmB,YAAW,gBAC9Bb,EACfiC,SAAUvC,KAAKuC,SACfC,KAAM,SAAQ,gBACCC,EAAoBzC,KAAKuC,UACxCG,QAAUC,IACTA,EAAEC,kBACF5C,KAAK6C,SAASC,SAAS,GAGvB9C,KAAKC,EAAE8C,QAAQ,SACf9C,EAAA,QAAMgC,MAAOtB,EAAmBqC,MAC/B/C,EAAA,QAAMgD,KAAK,UAIbhD,EAAA,QAAMgC,MAAOtB,EAAmBuC,OAC/BjD,EAAA,QAAMgC,MAAOtB,EAAmBwC,OAC/BlD,EAAA,QAAMgD,KAAK,WAEXjD,KAAKC,EAAE8C,QAAQ,eACf9C,EAAA,QAAMgC,MAAOtB,EAAmByC,YAC/BnD,EAAA,QAAMgD,KAAK,iBAKbjD,KAAKC,EAAE8C,QAAQ,WACf9C,EAAA,QAAMgC,MAAOtB,EAAmB0C,QAC/BpD,EAAA,QAAMgD,KAAK,YAIbhD,EAAA,QAAMgC,MAAOtB,EAAmB2C,OAC9BtD,KAAKC,EAAE8C,QAAQ,eACf9C,EAAA,QAAMgD,KAAK,gBAEXhD,EAAA,YAAUgD,KAAK,mBAIlBhD,EAAA,OACCgC,MAAOtB,EAAmB4C,QAC1BnB,GAAI9B,EAAS,cACAgC,GAAetC,KAAKmB,YACjCqC,QAASxD,KAAKmB,WAAU,kBACPf,GACjBH,EAAA,c,CAUJ,UAAMiB,GACLlB,KAAKmB,WAAa,KAClBnB,KAAKe,a,CAON,WAAM0C,GACLzD,KAAKmB,WAAa,MAClBnB,KAAKe,a,CAON,YAAM8B,GACL7C,KAAKmB,YAAcnB,KAAKmB,WACxBnB,KAAKe,a,CAON,kBAAM2C,GACL,OAAO1D,KAAKmB,U"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as o,h as i,H as t,g as e}from"./p-10cbc3fe.js";import{a as r}from"./p-561fa17b.js";import{g as n}from"./p-3f37ddb6.js";const l={root:"gov-tile",icon:"gov-tile__icon",arrow:"gov-tile__arrow",title:"gov-tile__title",link:"gov-tile__link",content:"gov-tile__content",heading:"gov-tile__heading"};const a='.gov-tile__heading::before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:1}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-tile{position:relative;display:block;width:100%;padding:0.75rem;transition:background-color 150ms}.gov-tile__icon{display:flex;margin:0rem 0rem 0.75rem;color:var(--gov-tile-main-color, var(--gov-color-primary))}.gov-tile__icon .gov-icon{width:2.5rem;height:2.5rem}.gov-tile__title{font-weight:var(--gov-text-xl-font-weight);font-size:var(--gov-text-xl-font-size);line-height:var(--gov-text-xl-line-height);letter-spacing:var(--gov-text-xl-letter-spacing);margin:0 0 0.5rem}.gov-tile__heading{display:flex;gap:0.5rem;justify-content:space-between;color:var(--gov-tile-main-color, var(--gov-color-primary));text-decoration:none}.gov-tile__arrow{flex:0 0 auto;width:0.75rem;height:2rem;margin:0.5rem;color:inherit}.gov-tile__content{color:var(--gov-tile-text-color, var(--gov-color-secondary-700))}.gov-tile__content>*:last-child{margin-bottom:0}.gov-tile__content a{position:relative;z-index:1}.gov-tile__link{display:block;text-decoration:none}@media not all and (pointer: coarse){.gov-tile[href]:hover{background:var(--gov-tile-hover-bg, var(--gov-color-primary-200))}.gov-tile[href]:hover .gov-tile__heading{color:var(--gov-tile-main-color, var(--gov-color-primary))}}@media (min-width: 30em){.gov-tile[promotion=""],.gov-tile[promotion=true i],.gov-tile[promotion="1"]{display:grid;grid-template-columns:auto 1fr;gap:0 0.875rem}.gov-tile[promotion=""] .gov-tile__icon,.gov-tile[promotion=true i] .gov-tile__icon,.gov-tile[promotion="1"] .gov-tile__icon{grid-area:1/1/3/1;margin:0}.gov-tile[promotion=""] .gov-tile__title,.gov-tile[promotion=true i] .gov-tile__title,.gov-tile[promotion="1"] .gov-tile__title{grid-area:1/2/1/2}.gov-tile[promotion=""] .gov-tile__content,.gov-tile[promotion=true i] .gov-tile__content,.gov-tile[promotion="1"] .gov-tile__content{grid-area:2/2/2/2}}@media (min-width: 48em){.gov-tile{padding:1.5rem}.gov-tile__icon{margin:0rem 0rem 1.5rem}.gov-tile__icon .gov-icon{width:3rem;height:3rem}}@media (min-width: 64em){.gov-tile[promotion=""],.gov-tile[promotion=true i],.gov-tile[promotion="1"]{gap:0 1.625rem}}';const g=class{constructor(i){o(this,i);this.promotion=false;this.href=undefined;this.name=undefined;this.h=n(this.host)}validateName(o){if(!o){r(`[${l.root}]: Parameter title is required.`)}}componentWillLoad(){this.validateName(this.name)}render(){return i(t,{class:this.h.classes(l.root),promotion:this.promotion},this.href?i("a",{href:this.href,class:l.link,ref:o=>this.triggerRef=o},this.h.hasSlot("icon")&&i("div",{class:l.icon},i("slot",{name:"icon"})),i("h3",{class:l.title},i("span",{class:l.heading},this.name,i("gov-icon",{class:l.arrow,name:"chevron-right"}))),i("div",{class:l.content},i("slot",null))):i("span",null,this.h.hasSlot("icon")&&i("div",{class:l.icon},i("slot",{name:"icon"})),i("h3",{class:l.title},i("span",null,this.name)),i("div",{class:l.content},i("slot",null))))}async getTriggerRef(){return this.triggerRef}get host(){return e(this)}static get watchers(){return{name:["validateName"]}}};g.style=a;export{g as gov_tile};
|
|
2
|
-
//# sourceMappingURL=p-af7a89bc.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TileClass","root","icon","arrow","title","link","content","heading","govTileCss","GovTile","constructor","hostRef","this","h","govHost","host","validateName","newValue","govErrorLog","componentWillLoad","name","render","Host","class","classes","promotion","href","ref","el","triggerRef","hasSlot","getTriggerRef"],"sources":["../../../packages/core/src/components/gov-tile/constants.ts","../../../packages/core/src/components/gov-tile/gov-tile.scss?tag=gov-tile","../../../packages/core/src/components/gov-tile/gov-tile.tsx"],"sourcesContent":["export const TileClass = {\n\troot: 'gov-tile',\n\ticon: 'gov-tile__icon',\n\tarrow: 'gov-tile__arrow',\n\ttitle: 'gov-tile__title',\n\tlink: 'gov-tile__link',\n\tcontent: 'gov-tile__content',\n\theading: 'gov-tile__heading',\n}\n","/*\n * Tile\n */\n\n$class: \".gov-tile\";\n\n#{$class} {\n\t@include base();\n\tpadding: rem-calc(12);\n\ttransition: background-color $t;\n\t&__icon {\n\t\tdisplay: flex;\n\t\tmargin: rem-calc(0 0 12);\n\t\tcolor: $tile-main-color;\n\t\t.gov-icon {\n\t\t\twidth: rem-calc(40);\n\t\t\theight: rem-calc(40);\n\t\t}\n\t}\n\t&__title {\n\t\t@include typography($font-size-xl);\n\t\tmargin: 0 0 rem-calc(8);\n\t}\n\t&__heading {\n\t\t@extend %link-mask;\n\t\tdisplay: flex;\n\t\tgap: rem-calc(8);\n\t\tjustify-content: space-between;\n\t\tcolor: $tile-main-color;\n\t\ttext-decoration: none;\n\t}\n\t&__arrow {\n\t\tflex: 0 0 auto;\n\t\twidth: rem-calc(12);\n\t\theight: rem-calc(32);\n\t\tmargin: rem-calc(8);\n\t\tcolor: inherit;\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t\tcolor: $tile-text-color;\n\t\ta {\n\t\t\tposition: relative;\n\t\t\tz-index: 1;\n\t\t}\n\t}\n\t&__link {\n\t\tdisplay: block;\n\t\ttext-decoration: none;\n\t}\n\n\t// HOVERS\n\t&[href] {\n\t\t@include hover() {\n\t\t\tbackground: $tile-hover-bg;\n\t\t\t#{$class} {\n\t\t\t\t&__heading {\n\t\t\t\t\tcolor: $tile-main-color;\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\tdisplay: grid;\n\t\t\tgrid-template-columns: auto 1fr;\n\t\t\tgap: 0 rem-calc(14);\n\t\t\t#{$class} {\n\t\t\t\t&__icon {\n\t\t\t\t\tgrid-area: 1/1/3/1;\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t\t&__title {\n\t\t\t\t\tgrid-area: 1/2/1/2;\n\t\t\t\t}\n\t\t\t\t&__content {\n\t\t\t\t\tgrid-area: 2/2/2/2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t@include mq($from: md) {\n\t\tpadding: rem-calc(24);\n\t\t&__icon {\n\t\t\tmargin: rem-calc(0 0 24);\n\t\t\t.gov-icon {\n\t\t\t\twidth: rem-calc(48);\n\t\t\t\theight: rem-calc(48);\n\t\t\t}\n\t\t}\n\t}\n\t@include mq($from: lg) {\n\t\t// VARIANTS\n\t\t@include parameter(\"promotion\") {\n\t\t\tgap: 0 rem-calc(26);\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Method, Prop, Watch } from \"@stencil/core\"\nimport { govErrorLog } from \"../../helpers/Log/gov.log\"\nimport { TileClass } from \"./constants\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\n\n@Component({\n\ttag: \"gov-tile\",\n\tstyleUrl: \"gov-tile.scss\",\n})\nexport class GovTile {\n\tprivate triggerRef?: HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTileElement\n\t/**\n\t * Style variation of the card.\n\t */\n\t@Prop() readonly promotion: boolean = false\n\t/**\n\t * Link on whole tile\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Item name\n\t */\n\t@Prop() readonly name: string\n\n\t@Watch(\"name\")\n\tvalidateName(newValue: string): void {\n\t\tif (!newValue) {\n\t\t\tgovErrorLog(`[${TileClass.root}]: Parameter title is required.`)\n\t\t}\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateName(this.name)\n\t}\n\n\trender() {\n\t\t// tag type\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TileClass.root)} promotion={this.promotion}>\n\t\t\t\t{this.href ? (\n\t\t\t\t\t<a href={this.href} class={TileClass.link} ref={el => (this.triggerRef = el as HTMLLinkElement | HTMLSpanElement)}>\n\t\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t\t<div class={TileClass.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\t\t\t\t\t\t<h3 class={TileClass.title}>\n\t\t\t\t\t\t\t<span class={TileClass.heading}>\n\t\t\t\t\t\t\t\t{this.name}\n\t\t\t\t\t\t\t\t<gov-icon class={TileClass.arrow} name=\"chevron-right\"></gov-icon>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t<div class={TileClass.content}>\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</a>\n\t\t\t\t) : (\n\t\t\t\t\t<span>\n\t\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t\t<div class={TileClass.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\t\t\t\t\t\t<h3 class={TileClass.title}>\n\t\t\t\t\t\t\t\t<span>{this.name}</span>\n\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t<div class={TileClass.content}>\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\n\t\t\t</Host>\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"],"mappings":"iIAAO,MAAMA,EAAY,CACxBC,KAAM,WACNC,KAAM,iBACNC,MAAO,kBACPC,MAAO,kBACPC,KAAM,iBACNC,QAAS,oBACTC,QAAS,qBCPV,MAAMC,EAAa,q7E,MCUNC,EAAO,MAInB,WAAAC,CAAAC,G,yBAQsC,M,wCAPrCC,KAAKC,EAAIC,EAAQF,KAAKG,K,CAkBvB,YAAAC,CAAaC,GACZ,IAAKA,EAAU,CACdC,EAAY,IAAIlB,EAAUC,sC,EAI5B,iBAAAkB,GACCP,KAAKI,aAAaJ,KAAKQ,K,CAGxB,MAAAC,GAEC,OACCR,EAACS,EAAI,CAACC,MAAOX,KAAKC,EAAEW,QAAQxB,EAAUC,MAAOwB,UAAWb,KAAKa,WAC3Db,KAAKc,KACLb,EAAA,KAAGa,KAAMd,KAAKc,KAAMH,MAAOvB,EAAUK,KAAMsB,IAAKC,GAAOhB,KAAKiB,WAAaD,GACvEhB,KAAKC,EAAEiB,QAAQ,SACfjB,EAAA,OAAKU,MAAOvB,EAAUE,MACrBW,EAAA,QAAMO,KAAK,UAGbP,EAAA,MAAIU,MAAOvB,EAAUI,OACpBS,EAAA,QAAMU,MAAOvB,EAAUO,SACrBK,KAAKQ,KACNP,EAAA,YAAUU,MAAOvB,EAAUG,MAAOiB,KAAK,oBAGzCP,EAAA,OAAKU,MAAOvB,EAAUM,SACrBO,EAAA,eAIFA,EAAA,YACED,KAAKC,EAAEiB,QAAQ,SACfjB,EAAA,OAAKU,MAAOvB,EAAUE,MACrBW,EAAA,QAAMO,KAAK,UAGbP,EAAA,MAAIU,MAAOvB,EAAUI,OACnBS,EAAA,YAAOD,KAAKQ,OAEdP,EAAA,OAAKU,MAAOvB,EAAUM,SACrBO,EAAA,e,CAaN,mBAAMkB,GACL,OAAOnB,KAAKiB,U"}
|