This commit is contained in:
1 parent
599351e1c0
commit
04791770de
4 files changed
+27
-23
No files matched your search
@@ -11,6 +11,7 @@
|
|||||||
children,
|
children,
|
||||||
class: className = '',
|
class: className = '',
|
||||||
currentPath = '',
|
currentPath = '',
|
||||||
|
faviconHref = '/favicon.svg',
|
||||||
headerActions,
|
headerActions,
|
||||||
navItems = [],
|
navItems = [],
|
||||||
onAbout,
|
onAbout,
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
children?: Snippet;
|
children?: Snippet;
|
||||||
class?: string;
|
class?: string;
|
||||||
currentPath?: string;
|
currentPath?: string;
|
||||||
|
faviconHref?: string;
|
||||||
headerActions?: Snippet;
|
headerActions?: Snippet;
|
||||||
navItems?: NavItem[];
|
navItems?: NavItem[];
|
||||||
onAbout?: () => void | Promise<void>;
|
onAbout?: () => void | Promise<void>;
|
||||||
@@ -51,10 +53,11 @@
|
|||||||
|
|
||||||
<div class={`sc-root sc-app-shell ${className}`} data-theme={theme === 'system' ? undefined : theme}>
|
<div class={`sc-root sc-app-shell ${className}`} data-theme={theme === 'system' ? undefined : theme}>
|
||||||
<Header
|
<Header
|
||||||
aboutHref={aboutHref ?? navItems.find((item) => item.label.toLowerCase() === 'about')?.href}
|
aboutHref={aboutHref ?? navItems.find((item) => item.label.toLowerCase() === 'about')?.href ?? '/about'}
|
||||||
{brand}
|
{brand}
|
||||||
{brandHref}
|
{brandHref}
|
||||||
{currentPath}
|
{currentPath}
|
||||||
|
{faviconHref}
|
||||||
actions={headerActions}
|
actions={headerActions}
|
||||||
{navItems}
|
{navItems}
|
||||||
{onAbout}
|
{onAbout}
|
||||||
|
|||||||
@@ -134,13 +134,18 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="sc-root sc-auth-page">
|
<div class="sc-root sc-auth-page">
|
||||||
<section aria-labelledby="sc-auth-title" class="sc-auth-card">
|
<section aria-busy={loading} aria-labelledby="sc-auth-title" class="sc-auth-card">
|
||||||
<div class="sc-auth-brand">
|
<div class="sc-auth-brand">
|
||||||
<img alt="" aria-hidden="true" class="sc-auth-brand-icon" src={faviconHref} />
|
<img alt="" aria-hidden="true" class="sc-auth-brand-icon" src={faviconHref} />
|
||||||
<span>{brand}</span>
|
<span>{brand}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h1 id="sc-auth-title">{setupRequired ? 'Create your account' : 'Welcome back'}</h1>
|
{#if loading}
|
||||||
|
<h1 id="sc-auth-title">Loading...</h1>
|
||||||
|
{:else}
|
||||||
|
<h1 id="sc-auth-title">{setupRequired ? 'Create your account' : 'Welcome back'}</h1>
|
||||||
|
{/if}
|
||||||
|
{#if !loading}
|
||||||
{#if tagline}
|
{#if tagline}
|
||||||
<p class="sc-auth-subtitle">{tagline}</p>
|
<p class="sc-auth-subtitle">{tagline}</p>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -268,5 +273,6 @@
|
|||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
{/if}
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
@@ -5,7 +5,6 @@
|
|||||||
BarChart3,
|
BarChart3,
|
||||||
Bot,
|
Bot,
|
||||||
Box,
|
Box,
|
||||||
ChevronDown,
|
|
||||||
CircleAlert,
|
CircleAlert,
|
||||||
CircleHelp,
|
CircleHelp,
|
||||||
CircleUserRound,
|
CircleUserRound,
|
||||||
@@ -93,11 +92,11 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
let {
|
let {
|
||||||
aboutHref,
|
aboutHref = '/about',
|
||||||
brand = 'Application',
|
brand = 'Application',
|
||||||
brandHref = '/',
|
brandHref = '/',
|
||||||
brandIcon,
|
|
||||||
currentPath = '',
|
currentPath = '',
|
||||||
|
faviconHref = '/favicon.svg',
|
||||||
navItems = [],
|
navItems = [],
|
||||||
actions,
|
actions,
|
||||||
onAbout,
|
onAbout,
|
||||||
@@ -111,8 +110,8 @@
|
|||||||
aboutHref?: string;
|
aboutHref?: string;
|
||||||
brand?: string;
|
brand?: string;
|
||||||
brandHref?: string;
|
brandHref?: string;
|
||||||
brandIcon?: Snippet;
|
|
||||||
currentPath?: string;
|
currentPath?: string;
|
||||||
|
faviconHref?: string;
|
||||||
navItems?: NavItem[];
|
navItems?: NavItem[];
|
||||||
actions?: Snippet;
|
actions?: Snippet;
|
||||||
onAbout?: () => void | Promise<void>;
|
onAbout?: () => void | Promise<void>;
|
||||||
@@ -162,11 +161,7 @@
|
|||||||
<header class="sc-header">
|
<header class="sc-header">
|
||||||
<a class="sc-brand" href={brandHref} onclick={closeMenus}>
|
<a class="sc-brand" href={brandHref} onclick={closeMenus}>
|
||||||
<span aria-hidden="true" class="sc-brand-mark">
|
<span aria-hidden="true" class="sc-brand-mark">
|
||||||
{#if brandIcon}
|
<img alt="" class="sc-brand-icon" src={faviconHref} />
|
||||||
{@render brandIcon()}
|
|
||||||
{:else}
|
|
||||||
{brand.slice(0, 1).toUpperCase()}
|
|
||||||
{/if}
|
|
||||||
</span>
|
</span>
|
||||||
<span>{brand}</span>
|
<span>{brand}</span>
|
||||||
</a>
|
</a>
|
||||||
@@ -207,7 +202,6 @@
|
|||||||
>
|
>
|
||||||
<CircleUserRound aria-hidden="true" class="sc-profile-icon" size={16} strokeWidth={2} />
|
<CircleUserRound aria-hidden="true" class="sc-profile-icon" size={16} strokeWidth={2} />
|
||||||
<span>{username}</span>
|
<span>{username}</span>
|
||||||
<ChevronDown aria-hidden="true" class="sc-profile-chevron" size={15} strokeWidth={2} />
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{#if profileOpen}
|
{#if profileOpen}
|
||||||
@@ -284,7 +278,7 @@
|
|||||||
type="button"
|
type="button"
|
||||||
onclick={() => (navOpen = !navOpen)}
|
onclick={() => (navOpen = !navOpen)}
|
||||||
>
|
>
|
||||||
{navOpen ? '×' : '☰'}
|
{navOpen ? '×' : '☰'}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@import '../../../design-tokens/theme.css';
|
@import "@gabriel20xx/design-tokens/theme.css";
|
||||||
|
|
||||||
:where(.sc-root, .sc-root *) {
|
:where(.sc-root, .sc-root *) {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@@ -62,6 +62,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sc-brand-mark {
|
.sc-brand-mark {
|
||||||
|
overflow: hidden;
|
||||||
display: grid;
|
display: grid;
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
@@ -73,6 +74,14 @@
|
|||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sc-brand-icon {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
padding: 0.25rem;
|
||||||
|
object-fit: contain;
|
||||||
|
border-radius: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
.sc-nav {
|
.sc-nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
@@ -143,14 +152,6 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sc-profile-chevron {
|
|
||||||
transition: transform 140ms ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sc-profile-button[aria-expanded="true"] .sc-profile-chevron {
|
|
||||||
transform: rotate(180deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sc-profile-dropdown {
|
.sc-profile-dropdown {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: calc(100% + 0.5rem);
|
top: calc(100% + 0.5rem);
|
||||||
|
|||||||
Reference in new issue
Block a user