Skip to content

Commit

Permalink
Working on fix for Header > Nav
Browse files Browse the repository at this point in the history
  • Loading branch information
emi420 committed Oct 14, 2024
1 parent e13e995 commit d1f1196
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 31 deletions.
10 changes: 2 additions & 8 deletions .storybook/stories/header.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,11 @@ const oneTab = [
const twoTab = [
{
label: 'GO TO HEADER PAGE',
clickEvent: async () => {
const url = await hrefTo('Button', 'Template');
window.location.href = url;
}
clickEvent: async () => {}
},
{
label: 'GO TO TRACKING PAGE',
clickEvent: async () => {
const url = await hrefTo('Tracking', 'Template');
window.location.href = url;
}
clickEvent: async () => {}
}
];
const threeTab = Array.from({ length: 3 }, (_, index) => ({
Expand Down
15 changes: 7 additions & 8 deletions dist/chunks/chunk.PCS4XLCJ.js → dist/chunks/chunk.4SB2ERYH.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import{a as d}from"./chunk.WPXUR5EI.js";import{a as h,b as g}from"./chunk.6NA5HMIF.js";import{a as t,b as s,c as l,d as o}from"./chunk.FWYUHKRF.js";import"@shoelace-style/shoelace/dist/components/icon-button/icon-button.js";import"@shoelace-style/shoelace/dist/components/tab-panel/tab-panel.js";import"@shoelace-style/shoelace/dist/components/tab-group/tab-group.js";import"@shoelace-style/shoelace/dist/components/tab/tab.js";import{LitElement as E,html as i}from"lit";import{property as a}from"lit/decorators.js";d();var p,b,m,v,u,y,$,e=class extends E{constructor(){super(...arguments);this.name="hot-header";l(this,p,"");l(this,b,"");l(this,m,!0);l(this,v,[]);l(this,u,"small");l(this,y,!0);l(this,$,0)}get title(){return s(this,p)}set title(c){o(this,p,c)}get logo(){return s(this,b)}set logo(c){o(this,b,c)}get drawer(){return s(this,m)}set drawer(c){o(this,m,c)}get tabs(){return s(this,v)}set tabs(c){o(this,v,c)}get size(){return s(this,u)}set size(c){o(this,u,c)}get borderBottom(){return s(this,y)}set borderBottom(c){o(this,y,c)}get selectedTab(){return s(this,$)}set selectedTab(c){o(this,$,c)}render(){let c=typeof this.logo=="string"||this.logo instanceof URL?typeof this.logo=="string"?this.logo:this.logo.href:"";return i`
import{a as d}from"./chunk.WPXUR5EI.js";import{a as h,b as g}from"./chunk.OZAMUC24.js";import{a as t,b as s,c as l,d as o}from"./chunk.FWYUHKRF.js";import"@shoelace-style/shoelace/dist/components/icon-button/icon-button.js";import"@shoelace-style/shoelace/dist/components/tab-panel/tab-panel.js";import"@shoelace-style/shoelace/dist/components/tab-group/tab-group.js";import"@shoelace-style/shoelace/dist/components/tab/tab.js";import{LitElement as E,html as i}from"lit";import{property as r}from"lit/decorators.js";d();var p,m,b,v,u,y,$,e=class extends E{constructor(){super(...arguments);this.name="hot-header";l(this,p,"");l(this,m,"");l(this,b,!0);l(this,v,[]);l(this,u,"small");l(this,y,!0);l(this,$,0)}get title(){return s(this,p)}set title(c){o(this,p,c)}get logo(){return s(this,m)}set logo(c){o(this,m,c)}get drawer(){return s(this,b)}set drawer(c){o(this,b,c)}get tabs(){return s(this,v)}set tabs(c){o(this,v,c)}get size(){return s(this,u)}set size(c){o(this,u,c)}get borderBottom(){return s(this,y)}set borderBottom(c){o(this,y,c)}get selectedTab(){return s(this,$)}set selectedTab(c){o(this,$,c)}render(){let c=typeof this.logo=="string"||this.logo instanceof URL?typeof this.logo=="string"?this.logo:this.logo.href:"";return i`
<header class=${h({size:this.size,borderBottom:this.borderBottom})}>
<a href="/" class="header--link">
${c.length>0?i`
Expand Down Expand Up @@ -26,16 +26,15 @@ import{a as d}from"./chunk.WPXUR5EI.js";import{a as h,b as g}from"./chunk.6NA5HM
class="header--nav"
>
<sl-tab-group class="header--tab-group">
${this.tabs.map((r,n)=>i`
${this.tabs.map((a,n)=>i`
<sl-tab
class="header--tab"
slot="nav"
panel="general"
@click=${f=>{this._selectTab(f,r.clickEvent,n)}}
?active=${this.selectedTab===n}
@click=${f=>{this._selectTab(f,a.clickEvent,n)}}
active=${this.selectedTab===n}
>
${r.label}
<span class="header--hidden">${this.selectedTab}</span>
${a.label}
</sl-tab>
`)}
</sl-tab-group>
Expand All @@ -53,7 +52,7 @@ import{a as d}from"./chunk.WPXUR5EI.js";import{a as h,b as g}from"./chunk.6NA5HM
library="hot-icons"
class="header--person-circle"
label="login"
@click=${r=>{this._handleLogin(r)}}
@click=${a=>{this._handleLogin(a)}}
></sl-icon-button>
${this.drawer?i`
<sl-icon-button
Expand All @@ -66,4 +65,4 @@ import{a as d}from"./chunk.WPXUR5EI.js";import{a as h,b as g}from"./chunk.6NA5HM
</div>
</div>
</header>
`}_selectTab(c,r,n){this.selectedTab=n,r()}_handleLogin(c){this.dispatchEvent(new Event("login"))}};p=new WeakMap,b=new WeakMap,m=new WeakMap,v=new WeakMap,u=new WeakMap,y=new WeakMap,$=new WeakMap,e.styles=[g],t([a({type:String})],e.prototype,"title",1),t([a({type:String})],e.prototype,"logo",1),t([a({type:Boolean})],e.prototype,"drawer",1),t([a({type:Array})],e.prototype,"tabs",1),t([a({type:String})],e.prototype,"size",1),t([a({type:Boolean})],e.prototype,"borderBottom",1),t([a({type:Number})],e.prototype,"selectedTab",1);var x=e;customElements.define("hot-header",e);export{e as a,x as b};
`}_selectTab(c,a,n){this.selectedTab=n,a()}_handleLogin(c){this.dispatchEvent(new Event("login"))}};p=new WeakMap,m=new WeakMap,b=new WeakMap,v=new WeakMap,u=new WeakMap,y=new WeakMap,$=new WeakMap,e.styles=[g],t([r({type:String})],e.prototype,"title",1),t([r({type:String})],e.prototype,"logo",1),t([r({type:Boolean})],e.prototype,"drawer",1),t([r({type:Array})],e.prototype,"tabs",1),t([r({type:String})],e.prototype,"size",1),t([r({type:Boolean})],e.prototype,"borderBottom",1),t([r({type:Number})],e.prototype,"selectedTab",1);var x=e;customElements.define("hot-header",e);export{e as a,x as b};
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import{b as e}from"./chunk.PCS4XLCJ.js";import*as t from"react";import{createComponent as a}from"@lit/react";var o="hot-header",r=a({tagName:o,elementClass:e,react:t,events:{},displayName:"Header"}),n=r;export{n as a};
import{b as e}from"./chunk.4SB2ERYH.js";import*as t from"react";import{createComponent as a}from"@lit/react";var o="hot-header",r=a({tagName:o,elementClass:e,react:t,events:{},displayName:"Header"}),n=r;export{n as a};
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,5 @@ import{css as e}from"lit";import{cva as a}from"class-variance-authority";var o=a
.header--logo-img {
}
.header--hidden {
font-size: .1px;
}
}
`;export{o as a,i as b};
2 changes: 1 addition & 1 deletion dist/components/header/header.component.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import{a,b}from"../../chunks/chunk.PCS4XLCJ.js";import"../../chunks/chunk.WPXUR5EI.js";import"../../chunks/chunk.6NA5HMIF.js";import"../../chunks/chunk.FWYUHKRF.js";export{a as Header,b as default};
import{a,b}from"../../chunks/chunk.4SB2ERYH.js";import"../../chunks/chunk.WPXUR5EI.js";import"../../chunks/chunk.OZAMUC24.js";import"../../chunks/chunk.FWYUHKRF.js";export{a as Header,b as default};
2 changes: 1 addition & 1 deletion dist/components/header/header.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import{a,b as e}from"../../chunks/chunk.PCS4XLCJ.js";import"../../chunks/chunk.WPXUR5EI.js";import"../../chunks/chunk.6NA5HMIF.js";import"../../chunks/chunk.FWYUHKRF.js";var o=e;export{a as Header,o as default};
import{a,b as e}from"../../chunks/chunk.4SB2ERYH.js";import"../../chunks/chunk.WPXUR5EI.js";import"../../chunks/chunk.OZAMUC24.js";import"../../chunks/chunk.FWYUHKRF.js";var o=e;export{a as Header,o as default};
2 changes: 1 addition & 1 deletion dist/components/header/header.styles.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import{a,b}from"../../chunks/chunk.6NA5HMIF.js";import"../../chunks/chunk.FWYUHKRF.js";export{a as headerVariants,b as styles};
import{a,b}from"../../chunks/chunk.OZAMUC24.js";import"../../chunks/chunk.FWYUHKRF.js";export{a as headerVariants,b as styles};
Loading

0 comments on commit d1f1196

Please sign in to comment.