@illinois-toolkit/ilw-hero 0.9.1 → 1.0.0-alpha

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.
@@ -0,0 +1,168 @@
1
+ (function(_){typeof define=="function"&&define.amd?define(_):_()})(function(){"use strict";/**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */var rt;const _=globalThis,R=_.ShadowRoot&&(_.ShadyCSS===void 0||_.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,M=Symbol(),I=new WeakMap;let W=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==M)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(R&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=I.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&I.set(e,t))}return t}toString(){return this.cssText}};const ot=n=>new W(typeof n=="string"?n:n+"",void 0,M),ht=(n,...t)=>{const e=n.length===1?n[0]:t.reduce((i,s,o)=>i+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+n[o+1],n[0]);return new W(e,n,M)},at=(n,t)=>{if(R)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),s=_.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,n.appendChild(i)}},V=R?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return ot(e)})(n):n;/**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ */const{is:lt,defineProperty:ct,getOwnPropertyDescriptor:dt,getOwnPropertyNames:pt,getOwnPropertySymbols:ut,getPrototypeOf:$t}=Object,$=globalThis,q=$.trustedTypes,gt=q?q.emptyScript:"",z=$.reactiveElementPolyfillSupport,x=(n,t)=>n,L={toAttribute(n,t){switch(t){case Boolean:n=n?gt:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},J=(n,t)=>!lt(n,t),K={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:J};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),$.litPropertyMetadata??($.litPropertyMetadata=new WeakMap);class v extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=K){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);s!==void 0&&ct(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:o}=dt(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get(){return s==null?void 0:s.call(this)},set(r){const l=s==null?void 0:s.call(this);o.call(this,r),this.requestUpdate(t,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??K}static _$Ei(){if(this.hasOwnProperty(x("elementProperties")))return;const t=$t(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(x("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(x("properties"))){const e=this.properties,i=[...pt(e),...ut(e)];for(const s of i)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,s]of e)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const s=this._$Eu(e,i);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(V(s))}else t!==void 0&&e.push(V(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return at(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var o;const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){const r=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:L).toAttribute(e,i.type);this._$Em=t,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,e){var o;const i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const r=i.getPropertyOptions(s),l=typeof r.converter=="function"?{fromAttribute:r.converter}:((o=r.converter)==null?void 0:o.fromAttribute)!==void 0?r.converter:L;this._$Em=s,this[s]=l.fromAttribute(e,r.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??J)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,r]of s)r.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],r)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}v.elementStyles=[],v.shadowRootOptions={mode:"open"},v[x("elementProperties")]=new Map,v[x("finalized")]=new Map,z==null||z({ReactiveElement:v}),($.reactiveElementVersions??($.reactiveElementVersions=[])).push("2.0.4");/**
10
+ * @license
11
+ * Copyright 2017 Google LLC
12
+ * SPDX-License-Identifier: BSD-3-Clause
13
+ */const E=globalThis,k=E.trustedTypes,F=k?k.createPolicy("lit-html",{createHTML:n=>n}):void 0,Z="$lit$",g=`lit$${Math.random().toFixed(9).slice(2)}$`,G="?"+g,ft=`<${G}>`,m=document,w=()=>m.createComment(""),C=n=>n===null||typeof n!="object"&&typeof n!="function",Q=Array.isArray,_t=n=>Q(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",j=`[
14
+ \f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,X=/-->/g,Y=/>/g,A=RegExp(`>|${j}(?:([^\\s"'>=/]+)(${j}*=${j}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),tt=/'/g,et=/"/g,it=/^(?:script|style|textarea|title)$/i,mt=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),At=mt(1),b=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),st=new WeakMap,y=m.createTreeWalker(m,129);function nt(n,t){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return F!==void 0?F.createHTML(t):t}const yt=(n,t)=>{const e=n.length-1,i=[];let s,o=t===2?"<svg>":"",r=P;for(let l=0;l<e;l++){const h=n[l];let d,p,a=-1,u=0;for(;u<h.length&&(r.lastIndex=u,p=r.exec(h),p!==null);)u=r.lastIndex,r===P?p[1]==="!--"?r=X:p[1]!==void 0?r=Y:p[2]!==void 0?(it.test(p[2])&&(s=RegExp("</"+p[2],"g")),r=A):p[3]!==void 0&&(r=A):r===A?p[0]===">"?(r=s??P,a=-1):p[1]===void 0?a=-2:(a=r.lastIndex-p[2].length,d=p[1],r=p[3]===void 0?A:p[3]==='"'?et:tt):r===et||r===tt?r=A:r===X||r===Y?r=P:(r=A,s=void 0);const f=r===A&&n[l+1].startsWith("/>")?" ":"";o+=r===P?h+ft:a>=0?(i.push(d),h.slice(0,a)+Z+h.slice(a)+g+f):h+g+(a===-2?l:f)}return[nt(n,o+(n[e]||"<?>")+(t===2?"</svg>":"")),i]};class U{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,r=0;const l=t.length-1,h=this.parts,[d,p]=yt(t,e);if(this.el=U.createElement(d,i),y.currentNode=this.el.content,e===2){const a=this.el.content.firstChild;a.replaceWith(...a.childNodes)}for(;(s=y.nextNode())!==null&&h.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(const a of s.getAttributeNames())if(a.endsWith(Z)){const u=p[r++],f=s.getAttribute(a).split(g),O=/([.?@])?(.*)/.exec(u);h.push({type:1,index:o,name:O[2],strings:f,ctor:O[1]==="."?bt:O[1]==="?"?St:O[1]==="@"?xt:N}),s.removeAttribute(a)}else a.startsWith(g)&&(h.push({type:6,index:o}),s.removeAttribute(a));if(it.test(s.tagName)){const a=s.textContent.split(g),u=a.length-1;if(u>0){s.textContent=k?k.emptyScript:"";for(let f=0;f<u;f++)s.append(a[f],w()),y.nextNode(),h.push({type:2,index:++o});s.append(a[u],w())}}}else if(s.nodeType===8)if(s.data===G)h.push({type:2,index:o});else{let a=-1;for(;(a=s.data.indexOf(g,a+1))!==-1;)h.push({type:7,index:o}),a+=g.length-1}o++}}static createElement(t,e){const i=m.createElement("template");return i.innerHTML=t,i}}function S(n,t,e=n,i){var r,l;if(t===b)return t;let s=i!==void 0?(r=e._$Co)==null?void 0:r[i]:e._$Cl;const o=C(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==o&&((l=s==null?void 0:s._$AO)==null||l.call(s,!1),o===void 0?s=void 0:(s=new o(n),s._$AT(n,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=s:e._$Cl=s),s!==void 0&&(t=S(n,s._$AS(n,t.values),s,i)),t}class vt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=((t==null?void 0:t.creationScope)??m).importNode(e,!0);y.currentNode=s;let o=y.nextNode(),r=0,l=0,h=i[0];for(;h!==void 0;){if(r===h.index){let d;h.type===2?d=new H(o,o.nextSibling,this,t):h.type===1?d=new h.ctor(o,h.name,h.strings,this,t):h.type===6&&(d=new Et(o,this,t)),this._$AV.push(d),h=i[++l]}r!==(h==null?void 0:h.index)&&(o=y.nextNode(),r++)}return y.currentNode=m,s}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class H{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),C(t)?t===c||t==null||t===""?(this._$AH!==c&&this._$AR(),this._$AH=c):t!==this._$AH&&t!==b&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):_t(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==c&&C(this._$AH)?this._$AA.nextSibling.data=t:this.T(m.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:i}=t,s=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=U.createElement(nt(i.h,i.h[0]),this.options)),i);if(((o=this._$AH)==null?void 0:o._$AD)===s)this._$AH.p(e);else{const r=new vt(s,this),l=r.u(this.options);r.p(e),this.T(l),this._$AH=r}}_$AC(t){let e=st.get(t.strings);return e===void 0&&st.set(t.strings,e=new U(t)),e}k(t){Q(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new H(this.S(w()),this.S(w()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class N{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,o){this.type=1,this._$AH=c,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=c}_$AI(t,e=this,i,s){const o=this.strings;let r=!1;if(o===void 0)t=S(this,t,e,0),r=!C(t)||t!==this._$AH&&t!==b,r&&(this._$AH=t);else{const l=t;let h,d;for(t=o[0],h=0;h<o.length-1;h++)d=S(this,l[i+h],e,h),d===b&&(d=this._$AH[h]),r||(r=!C(d)||d!==this._$AH[h]),d===c?t=c:t!==c&&(t+=(d??"")+o[h+1]),this._$AH[h]=d}r&&!s&&this.j(t)}j(t){t===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class bt extends N{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===c?void 0:t}}class St extends N{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==c)}}class xt extends N{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){if((t=S(this,t,e,0)??c)===b)return;const i=this._$AH,s=t===c&&i!==c||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==c&&(i===c||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Et{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}}const B=E.litHtmlPolyfillSupport;B==null||B(U,H),(E.litHtmlVersions??(E.litHtmlVersions=[])).push("3.1.3");const wt=(n,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let s=i._$litPart$;if(s===void 0){const o=(e==null?void 0:e.renderBefore)??null;i._$litPart$=s=new H(t.insertBefore(w(),o),o,void 0,e??{})}return s._$AI(n),s};/**
16
+ * @license
17
+ * Copyright 2017 Google LLC
18
+ * SPDX-License-Identifier: BSD-3-Clause
19
+ */class T extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=wt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return b}}T._$litElement$=!0,T.finalized=!0,(rt=globalThis.litElementHydrateSupport)==null||rt.call(globalThis,{LitElement:T});const D=globalThis.litElementPolyfillSupport;D==null||D({LitElement:T}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.5");const Ct=ht`
20
+
21
+ .hero {
22
+ position: relative;
23
+ }
24
+
25
+ .hero.fixed {
26
+ left:50%;
27
+ margin-left:-50vw;
28
+ margin-right:-50vw;
29
+ padding-left:0;
30
+ padding-right:0;
31
+ position:relative;
32
+ right:50%;
33
+ width:100vw;
34
+ }
35
+
36
+ .background {
37
+ position: relative;
38
+ width: 100%;
39
+ height: var(--ilw-hero--height, 223px);
40
+ background-color: var(--ilw-hero--background);
41
+ }
42
+
43
+ .background.collapse {
44
+ display: none;
45
+ }
46
+
47
+ img {
48
+ display: block;
49
+ position: relative;
50
+ object-fit: cover;
51
+ object-position: center;
52
+ }
53
+
54
+ .content-outer {
55
+ background: var(--ilw-hero--background);
56
+ position: relative;
57
+ z-index: 100;
58
+ padding: 0 20px;
59
+ }
60
+
61
+ .content-inner {
62
+ padding: 18px 0 36px 0;
63
+ }
64
+
65
+ @media (min-width: 576px) {
66
+ .content-inner {
67
+ padding: 36px 0px 72px;
68
+ }
69
+ }
70
+
71
+ @media (min-width: 767px) {
72
+ .background {
73
+ position: absolute;
74
+ width: 100%;
75
+ top: 0;
76
+ left: 0;
77
+ z-index: 1;
78
+ }
79
+ .background img {
80
+ position: absolute;
81
+ width: 100%;
82
+ height: 100%;
83
+ top: 0;
84
+ left: 0;
85
+ z-index: 101;
86
+ }
87
+ .background.collapse {
88
+ display: block;
89
+ }
90
+
91
+
92
+ .content-outer {
93
+ background: transparent;
94
+ height: var(--ilw-hero--height, 223px);
95
+ display: flex;
96
+ }
97
+
98
+ .content-inner {
99
+ width: 60%;
100
+ margin: auto;
101
+ display: flex;
102
+ flex-direction: column;
103
+ text-align: center;
104
+ align-items: center;
105
+ max-width: 1200px;
106
+ }
107
+
108
+ .content-inner.left {
109
+ text-align: left;
110
+ align-items: flex-start;
111
+ margin-left: 100px;
112
+ }
113
+
114
+ .content-inner.right {
115
+ text-align: right;
116
+ align-items: flex-end;
117
+ margin-right: 100px;
118
+ }
119
+
120
+ .content-inner.top {
121
+ margin-top: 0;
122
+ }
123
+
124
+ .content-inner.bottom {
125
+ margin-bottom: 0;
126
+ }
127
+ .content-inner.top-left {
128
+ text-align: left;
129
+ align-items: flex-start;
130
+ margin: 0 auto auto 100px;
131
+ }
132
+
133
+ .content-inner.top-right {
134
+ text-align: left;
135
+ align-items: flex-start;
136
+ margin: 0 100px auto auto;
137
+ }
138
+
139
+ .content-inner.bottom-left {
140
+ text-align: right;
141
+ align-items: flex-end;
142
+ margin: auto auto 0 100px;
143
+ }
144
+
145
+ .content-inner.bottom-right {
146
+ text-align: right;
147
+ align-items: flex-end;
148
+ margin: auto 100px 0 auto;
149
+ }
150
+ }
151
+
152
+ @media (min-width: 992px) {
153
+ .content-inner {
154
+ width: var(--ilw-hero--text-width);
155
+ }
156
+ }
157
+ `;class Pt extends T{static get properties(){return{theme:{type:String,attribute:!0},focus:{type:String,attribute:!0},shadow:{type:Boolean,attribute:!0},collapse:{type:Boolean,attribute:!0},align:{type:String,attribute:!0},width:{type:String,attribute:!0}}}static get styles(){return Ct}constructor(){super(),this.align="",this.focus="",this.shadow=!1,this.collapse=!1,this.theme="",this.width=""}get outerWidth(){return this.width=="full"||this.width=="auto"?"fixed":""}render(){return At`
158
+ <div class="hero ${this.outerWidth}">
159
+ <div role="presentation" class="background ${this.collapse?"collapse":""}">
160
+ <slot name="background"></slot>
161
+ </div>
162
+ <div class="content-outer">
163
+ <div class="content-inner ${this.align.replace("-"," ")}">
164
+ <slot></slot>
165
+ </div>
166
+ </div>
167
+ </div>
168
+ `}}customElements.define("ilw-hero",Pt)});
package/package.json CHANGED
@@ -1,22 +1,31 @@
1
- {
2
- "name": "@illinois-toolkit/ilw-hero",
3
- "private": false,
4
- "version": "0.9.1",
5
- "type": "module",
6
- "exports": {
7
- ".": {
8
- "import": "./src/ilw-hero.js"
9
- }
10
- },
11
- "scripts": {
12
- "dev": "vite",
13
- "build": "vite build --config vite.build.config.js --emptyOutDir",
14
- "preview": "vite preview"
15
- },
16
- "dependencies": {
17
- "lit": "3.1.3"
18
- },
19
- "devDependencies": {
20
- "vite": "^5.2.0"
21
- }
22
- }
1
+ {
2
+ "name": "@illinois-toolkit/ilw-hero",
3
+ "description": "Illinois Toolkit: The Hero Image component adds a large picture at the top of the page.",
4
+ "private": false,
5
+ "version": "1.0.0-alpha",
6
+ "type": "module",
7
+ "files": [
8
+ "src/**",
9
+ "dist/**",
10
+ "builder/**"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "import": "./src/ilw-hero.js",
15
+ "require": "./src/ilw-hero.cjs",
16
+ "default": "./src/ilw-hero.js"
17
+ }
18
+ },
19
+ "scripts": {
20
+ "dev": "vite",
21
+ "build": "vite build --config vite.build.config.js --emptyOutDir",
22
+ "preview": "vite preview",
23
+ "prepack": "npm run build"
24
+ },
25
+ "dependencies": {
26
+ "lit": "3.1.3"
27
+ },
28
+ "devDependencies": {
29
+ "vite": "^5.2.0"
30
+ }
31
+ }
package/src/ilw-hero.css CHANGED
@@ -1,86 +1,86 @@
1
- :root {
2
- --ilw-hero--height: 223px;
3
- --ilw-hero--font: 700 2.25rem/2.25rem var(--il-font-sans);
4
- --ilw-hero--background: var(--il-blue);
5
- --ilw-hero--text-color: white;
6
- --ilw-hero--text-width: 40%;
7
- --ilw-hero--shadow-color: rgba(0, 0, 0, 1);
8
- }
9
-
10
- ilw-hero {
11
- img, *[slot="background"] {
12
- display: block;
13
- position: relative;
14
- width: 100%;
15
- height: 100%;
16
- object-fit: cover;
17
- object-position: center;
18
- }
19
-
20
- h1, h2, h3 {
21
- all: initial;
22
- font: var(--ilw-hero--font);
23
- color: var(--ilw-hero--text-color);
24
- text-shadow: 2px 2px 2px var(--ilw-hero--shadow-color);
25
- text-align: inherit;
26
- }
27
-
28
- &[theme="orange"] {
29
- --ilw-hero--background: var(--il-orange);
30
- --ilw-hero--button-background-color: var(--il-blue);
31
- --ilw-hero--focused-button-foreground-color: var(--il-blue);
32
- }
33
-
34
- &[theme="white"] {
35
- --ilw-hero--background: white;
36
- --ilw-hero--button-background-color: white;
37
- --ilw-hero--button-foreground-color: var(--il-blue);
38
- --ilw-hero--button-border-color: var(--il-blue);
39
- --ilw-hero--focused-button-background-color: var(--il-blue);
40
- --ilw-hero--focused-button-foreground-color: white;
41
- --ilw-hero--focused-button-border-color: var(--il-blue);
42
- --ilw-hero--text-color: #252525;
43
- --ilw-hero--shadow-color: rgba(255, 255, 255, 1);
44
- }
45
-
46
- &[focus="top"] img {
47
- object-position: top;
48
- }
49
- &[focus="bottom"] img {
50
- object-position: bottom;
51
- }
52
- &[focus="left"] img {
53
- object-position: left;
54
- }
55
- &[focus="right"] img {
56
- object-position: right;
57
- }
58
- }
59
-
60
- @media (min-width: 576px) {
61
- :root {
62
- --ilw-hero--height: 315px;
63
- --ilw-hero--font: 700 3rem/3rem var(--il-font-sans);
64
- }
65
- }
66
-
67
- @media (min-width: 767px) {
68
- :root {
69
- --ilw-hero--height: 557px;
70
- --ilw-hero--font: 700 4rem/4rem var(--il-font-sans);
71
- }
72
- ilw-hero[shadow] h1, ilw-hero[shadow] h2, ilw-hero[shadow] h3 {
73
- background: radial-gradient(rgba(0,0,0,.9),rgba(0,0,0,0.1));
74
- padding: 1rem!important;
75
- }
76
-
77
- ilw-hero[theme="white"][shadow] h1, ilw-hero[theme="white"][shadow] h2, ilw-hero[theme="white"][shadow] h3 {
78
- background: radial-gradient(rgba(255,255,255,.9),rgba(255,255,255,0.1));
79
- }
80
- }
81
-
82
- @media (min-width: 992px) {
83
- :root {
84
- --ilw-hero--font: 700 4.5rem/4.5rem var(--il-font-sans);
85
- }
1
+ :root {
2
+ --ilw-hero--height: 223px;
3
+ --ilw-hero--font: 700 2.25rem/2.25rem var(--il-font-sans);
4
+ --ilw-hero--background: var(--il-blue);
5
+ --ilw-hero--text-color: white;
6
+ --ilw-hero--text-width: 40%;
7
+ --ilw-hero--shadow-color: rgba(0, 0, 0, 1);
8
+ }
9
+
10
+ ilw-hero {
11
+ img, *[slot="background"] {
12
+ display: block;
13
+ position: relative;
14
+ width: 100%;
15
+ height: 100%;
16
+ object-fit: cover;
17
+ object-position: center;
18
+ }
19
+
20
+ h1, h2, h3 {
21
+ all: initial;
22
+ font: var(--ilw-hero--font);
23
+ color: var(--ilw-hero--text-color);
24
+ text-shadow: 2px 2px 2px var(--ilw-hero--shadow-color);
25
+ text-align: inherit;
26
+ }
27
+
28
+ &[theme="orange"] {
29
+ --ilw-hero--background: var(--il-orange);
30
+ --ilw-hero--button-background-color: var(--il-blue);
31
+ --ilw-hero--focused-button-foreground-color: var(--il-blue);
32
+ }
33
+
34
+ &[theme="white"] {
35
+ --ilw-hero--background: white;
36
+ --ilw-hero--button-background-color: white;
37
+ --ilw-hero--button-foreground-color: var(--il-blue);
38
+ --ilw-hero--button-border-color: var(--il-blue);
39
+ --ilw-hero--focused-button-background-color: var(--il-blue);
40
+ --ilw-hero--focused-button-foreground-color: white;
41
+ --ilw-hero--focused-button-border-color: var(--il-blue);
42
+ --ilw-hero--text-color: #252525;
43
+ --ilw-hero--shadow-color: rgba(255, 255, 255, 1);
44
+ }
45
+
46
+ &[focus="top"] img {
47
+ object-position: top;
48
+ }
49
+ &[focus="bottom"] img {
50
+ object-position: bottom;
51
+ }
52
+ &[focus="left"] img {
53
+ object-position: left;
54
+ }
55
+ &[focus="right"] img {
56
+ object-position: right;
57
+ }
58
+ }
59
+
60
+ @media (min-width: 576px) {
61
+ :root {
62
+ --ilw-hero--height: 315px;
63
+ --ilw-hero--font: 700 3rem/3rem var(--il-font-sans);
64
+ }
65
+ }
66
+
67
+ @media (min-width: 767px) {
68
+ :root {
69
+ --ilw-hero--height: 557px;
70
+ --ilw-hero--font: 700 4rem/4rem var(--il-font-sans);
71
+ }
72
+ ilw-hero[shadow] h1, ilw-hero[shadow] h2, ilw-hero[shadow] h3 {
73
+ background: radial-gradient(rgba(0,0,0,.9),rgba(0,0,0,0.1));
74
+ padding: 1rem!important;
75
+ }
76
+
77
+ ilw-hero[theme="white"][shadow] h1, ilw-hero[theme="white"][shadow] h2, ilw-hero[theme="white"][shadow] h3 {
78
+ background: radial-gradient(rgba(255,255,255,.9),rgba(255,255,255,0.1));
79
+ }
80
+ }
81
+
82
+ @media (min-width: 992px) {
83
+ :root {
84
+ --ilw-hero--font: 700 4.5rem/4.5rem var(--il-font-sans);
85
+ }
86
86
  }
package/src/ilw-hero.js CHANGED
@@ -1,52 +1,52 @@
1
- import { LitElement, html } from 'lit';
2
- import styles from './ilw-hero.styles';
3
- import './ilw-hero.css';
4
-
5
- class Hero extends LitElement {
6
-
7
- static get properties() {
8
- return {
9
- theme: { type: String, attribute: true },
10
- focus: { type: String, attribute: true },
11
- shadow: { type: Boolean, attribute: true },
12
- collapse: { type: Boolean, attribute: true },
13
- align: { type: String, attribute: true },
14
- width: { type: String, attribute: true }
15
- };
16
- }
17
-
18
- static get styles() {
19
- return styles;
20
- }
21
-
22
- constructor() {
23
- super();
24
- this.align = '';
25
- this.focus = '';
26
- this.shadow = false;
27
- this.collapse = false;
28
- this.theme = '';
29
- this.width = '';
30
- }
31
-
32
- get outerWidth() {
33
- return this.width == 'full' || this.width == 'auto' ? 'fixed' : '';
34
- }
35
-
36
- render() {
37
- return html`
38
- <div class="hero ${this.outerWidth}">
39
- <div role="presentation" class="background ${this.collapse ? 'collapse' : ''}">
40
- <slot name="background"></slot>
41
- </div>
42
- <div class="content-outer">
43
- <div class="content-inner ${this.align.replace('-', ' ')}">
44
- <slot></slot>
45
- </div>
46
- </div>
47
- </div>
48
- `;
49
- }
50
- }
51
-
1
+ import { LitElement, html } from 'lit';
2
+ import styles from './ilw-hero.styles';
3
+ import './ilw-hero.css';
4
+
5
+ class Hero extends LitElement {
6
+
7
+ static get properties() {
8
+ return {
9
+ theme: { type: String, attribute: true },
10
+ focus: { type: String, attribute: true },
11
+ shadow: { type: Boolean, attribute: true },
12
+ collapse: { type: Boolean, attribute: true },
13
+ align: { type: String, attribute: true },
14
+ width: { type: String, attribute: true }
15
+ };
16
+ }
17
+
18
+ static get styles() {
19
+ return styles;
20
+ }
21
+
22
+ constructor() {
23
+ super();
24
+ this.align = '';
25
+ this.focus = '';
26
+ this.shadow = false;
27
+ this.collapse = false;
28
+ this.theme = '';
29
+ this.width = '';
30
+ }
31
+
32
+ get outerWidth() {
33
+ return this.width == 'full' || this.width == 'auto' ? 'fixed' : '';
34
+ }
35
+
36
+ render() {
37
+ return html`
38
+ <div class="hero ${this.outerWidth}">
39
+ <div role="presentation" class="background ${this.collapse ? 'collapse' : ''}">
40
+ <slot name="background"></slot>
41
+ </div>
42
+ <div class="content-outer">
43
+ <div class="content-inner ${this.align.replace('-', ' ')}">
44
+ <slot></slot>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ `;
49
+ }
50
+ }
51
+
52
52
  customElements.define('ilw-hero', Hero);