diff --git a/src/elements/common/button/rvt-button.styles.ts b/src/elements/common/button/rvt-button.styles.ts index 22a80c1b..f0bec80b 100644 --- a/src/elements/common/button/rvt-button.styles.ts +++ b/src/elements/common/button/rvt-button.styles.ts @@ -1,18 +1,16 @@ import { createTV } from 'tailwind-variants'; const tv = createTV({ - twMerge: false + // twMerge: false }); export const button = tv({ base: [ 'inline-flex', - 'gap-2', 'm', 'items-center', 'align-middle', 'will-change-transform', - 'font-bold', 'min-w-30', 'transition-all', 'duration-100', @@ -23,12 +21,18 @@ export const button = tv({ variants: { variant: { primary: [ - 'relative text-cream-100 fill-cream-100 border-cream-100 border transition-all', + 'relative font-bold gap-2 text-cream-100 fill-cream-100 border-cream-100 border transition-all', "before:content-[''] before:absolute before:inset-0 before:-z-10 before:bg-light-grain before:bg-[size:32px] before:bg-blend-multiply before:transition-all before:opacity-0", "after:content-[''] after:absolute after:inset-0 after:-z-10 after:bg-dark-grain after:bg-[size:32px] after:transition-all after:opacity-100" ], - secondary: 'text-white fill-white bg-charcole-900 border-cream-100 border transition-all', - danger: 'border-red-500 text-red-500 fill-red-500 border transition-all' + link: ['text-cream-100 gap-2 font-bold px-0 mx-2'], + secondary: [ + 'text-white gap-2 fill-white bg-charcole-900 border-cream-100 border', + 'transition-all text-lg font-bold' + ], + danger: 'border-red-500 gap-2 font-bold text-red-500 fill-red-500 border transition-all', + // very specific types + nav: ['text-cream-100 px-3.5 py-1.5 gap-2.5 font-normal font-display'] }, size: { sm: 'px-2 py-1 text-xs', @@ -52,6 +56,33 @@ export const button = tv({ 'aria-busy:border-neutral-300 aria-busy:hover:bg-transparent aria-busy:translate-y-0 aria-busy:hover:text-white' ] }, + { + variant: 'link', + class: [ + // hover + 'hover:text-white', + // disabled + 'disabled:text-cream-100/60 disabled:hover:text-cream-100/60', + // loading + 'aria-busy:text-white' + ] + }, + { + variant: 'link', + size: 'sm', + class: ['px-0 mx-2'] + }, + { + variant: 'nav', + size: 'md', + class: [ + 'px-3.5 py-1.5 text-lg', + // hover + 'hover:text-white hover:bg-white/5', + // selected + 'aria-current:border-white/10 aria-current:text-white aria-current:bg-white/5' + ] + }, { variant: 'danger', class: [ @@ -87,13 +118,23 @@ export const button = tv({ export const icon = tv({ variants: { - size: { sm: 'h-2.5 w-2.5', md: 'h-5 w-5"', lg: 'h-6 w-6' }, + size: { sm: 'h-2.5 w-2.5', md: 'h-5 w-5', lg: 'h-6 w-6' }, variant: { primary: '', secondary: '', - danger: '' + link: '', + danger: '', + // custom variants + nav: 'text-cream-100 group-hover:text-white transition-all' } - } + }, + compoundVariants: [ + { + variant: 'nav', + size: 'md', + class: 'h-4 w-4' + } + ] }); export type ButtonVariants = (typeof button)['variants']; diff --git a/src/elements/common/button/rvt-button.ts b/src/elements/common/button/rvt-button.ts index 00279487..b38f29e7 100644 --- a/src/elements/common/button/rvt-button.ts +++ b/src/elements/common/button/rvt-button.ts @@ -49,19 +49,12 @@ export default class RvtButton extends LitElement { ${when( this.loading, () => html``, - () => - when( - this.icon, - () => html`` - ) + () => when(this.icon, () => html``) )} - ${when( - this.iconRight, - () => html`` - )} + ${when(this.iconRight, () => html``)} `; } diff --git a/src/elements/common/rvt-breadcrumbs.ts b/src/elements/common/rvt-breadcrumbs.ts index ef561947..dc241749 100644 --- a/src/elements/common/rvt-breadcrumbs.ts +++ b/src/elements/common/rvt-breadcrumbs.ts @@ -136,6 +136,7 @@ export default class RvtBreadcrumbs extends LitElement { href: routes.devGameOverview.build({ gameId: this.game.data?.game.gameId }) }), html`` @@ -170,31 +171,31 @@ export default class RvtBreadcrumbs extends LitElement { > `, a: (opts: { content: TemplateResult; href?: string }) => html` - - ${opts.content} - - ` + ${opts.content} + `, + home: () => + html`` }; renderChevron(): TemplateResult { - return html` - - `; + return html` `; } render() { let crumbs = this.generateCrumbs(); - return html`
    + if (crumbs.length < 1) { + return html``; + } + return html`
      +
    1. +
      ${this.fragment.home()}
      +
    2. ${map( crumbs, (crumb, index) => - html`
    3. + html`
    4. ${when(index <= crumbs.length - 1, () => this.renderChevron())} ${crumb}
      diff --git a/src/elements/common/rvt-nav.ts b/src/elements/common/rvt-nav.ts index 886aee76..c957ae7f 100644 --- a/src/elements/common/rvt-nav.ts +++ b/src/elements/common/rvt-nav.ts @@ -24,27 +24,36 @@ export default class RvtNav extends LitElement { render() { return html` `; } diff --git a/src/elements/layouts/sidebar-layout.ts b/src/elements/layouts/sidebar-layout.ts index 5b645a30..6def8af3 100644 --- a/src/elements/layouts/sidebar-layout.ts +++ b/src/elements/layouts/sidebar-layout.ts @@ -11,16 +11,16 @@ export default class Layout extends LitElement { render() { return html` -
      +
      -
      -
      +
      +
      -
      +
      @@ -46,7 +46,7 @@ export class Body extends LitElement { static styles = cssify(); render() { - return html`
      `; + return html`
      `; } } diff --git a/src/elements/pages/analytics/rvt-game-analytics.ts b/src/elements/pages/analytics/rvt-game-analytics.ts index 950d04a2..370c60b4 100644 --- a/src/elements/pages/analytics/rvt-game-analytics.ts +++ b/src/elements/pages/analytics/rvt-game-analytics.ts @@ -145,7 +145,7 @@ export class RvtGameAnalytics extends LitElement { return html`
      -
      +
      @@ -36,7 +36,7 @@ export default class DevGameBanner extends LitElement { ? html` ${this.game.bannerUrl ? html` ` @@ -52,7 +52,7 @@ export default class DevGameBanner extends LitElement { Settings ${this.renderGameIcon(this.game)} -

      ${this.game.displayName}

      +

      ${this.game.displayName}

      ` : html``}
      diff --git a/src/elements/pages/dev/game/pages/game-overview.ts b/src/elements/pages/dev/game/pages/game-overview.ts index f8945442..eba36211 100644 --- a/src/elements/pages/dev/game/pages/game-overview.ts +++ b/src/elements/pages/dev/game/pages/game-overview.ts @@ -255,7 +255,7 @@ export default class DevGameOverview extends LitElement { renderNamespaceList(game: Rivet.cloud.GameFull): TemplateResult { if (!game.namespaces) return html`

      No namespaces found

      `; return html` -
      +

      Namespaces