Chore: Housekeeping

This commit is contained in:
Pieter Vander Vennet 2023-12-21 01:46:18 +01:00
parent ef0ba091eb
commit 319c0e2573
77 changed files with 2485 additions and 1727 deletions

View file

@ -10,7 +10,6 @@
const dispatch = createEventDispatcher<{ close }>()
export let extraClasses = "p-4 md:p-6"
</script>
<!-- Draw the background over the total screen -->
@ -27,17 +26,14 @@
style="z-index: 21"
use:trapFocus
>
<div
class="content normal-background"
on:click|stopPropagation={() => {}}
>
<div class="content normal-background" on:click|stopPropagation={() => {}}>
<div class="h-full rounded-xl">
<slot />
</div>
<slot name="close-button">
<!-- The close button is placed _after_ the default slot in order to always paint it on top -->
<button
class="absolute right-10 top-10 h-8 w-8 cursor-pointer border-none bg-white rounded-full p-0"
class="absolute right-10 top-10 h-8 w-8 cursor-pointer rounded-full border-none bg-white p-0"
on:click={() => dispatch("close")}
>
<XCircleIcon />
@ -47,10 +43,10 @@
</div>
<style>
.content {
height: 100%;
border-radius: 0.5rem;
overflow-x: hidden;
box-shadow: 0 0 1rem #00000088;
}
.content {
height: 100%;
border-radius: 0.5rem;
overflow-x: hidden;
box-shadow: 0 0 1rem #00000088;
}
</style>

View file

@ -1,12 +1,19 @@
<script lang="ts">
export let text : string
export let href : string
export let classnames : string = undefined
export let download : string = undefined
export let ariaLabel : string = undefined
export let text: string
export let href: string
export let classnames: string = undefined
export let download: string = undefined
export let ariaLabel: string = undefined
export let newTab: boolean = false
</script>
<a {href} aria-label={ariaLabel} target={newTab ? "_blank" : undefined} {download} class={classnames}>
{@html text}</a>
<a
{href}
aria-label={ariaLabel}
target={newTab ? "_blank" : undefined}
{download}
class={classnames}
>
{@html text}
</a>

View file

@ -9,15 +9,14 @@
*/
const dispatch = createEventDispatcher()
export let cls = "m-0.5 p-0.5 sm:p-1 md:m-1"
export let arialabel: Translation = undefined
export let arialabel: Translation = undefined
</script>
<button
on:click={(e) => dispatch("click", e)}
on:keydown
use:ariaLabel={arialabel}
class={twJoin("relative pointer-events-auto h-fit w-fit rounded-full", cls)}
class={twJoin("pointer-events-auto relative h-fit w-fit rounded-full", cls)}
>
<slot />
</button>

View file

@ -12,7 +12,7 @@
<div
aria-modal="true"
autofocus
class="absolute top-0 right-0 h-screen w-full overflow-y-auto drop-shadow-2xl md:w-6/12 lg:w-5/12 xl:w-4/12 normal-background flex flex-col"
class="normal-background absolute top-0 right-0 flex h-screen w-full flex-col overflow-y-auto drop-shadow-2xl md:w-6/12 lg:w-5/12 xl:w-4/12"
role="dialog"
style="max-width: 100vw; max-height: 100vh"
tabindex="-1"

View file

@ -14,7 +14,7 @@
josmState.stabilized(15000).addCallbackD(() => josmState.setData(undefined))
const showButton = state.osmConnection.userDetails.map(
(ud) => ud.loggedIn && ud.csCount >= Constants.userJourney.historyLinkVisible,
(ud) => ud.loggedIn && ud.csCount >= Constants.userJourney.historyLinkVisible
)
function openJosm() {
@ -35,8 +35,7 @@
{#if $showButton}
<div class="flex">
<button class="flex items-center small soft grow" on:click={openJosm}>
<button class="small soft flex grow items-center" on:click={openJosm}>
<Josm_logo class="h-6 w-6 pr-2" />
<Tr t={t.editJosm} />
</button>
@ -49,5 +48,4 @@
<Tr cls="alert shrink-0 w-fit" t={t.josmNotOpened} />
{/if}
</div>
{/if}

View file

@ -11,13 +11,11 @@
export let cls: string = ""
// Text for the current language
let txt: Store<string | undefined> = t?.current
</script>
{#if $txt}
<span class={cls}>
<FromHtml src={$txt}/>
<FromHtml src={$txt} />
<WeblateLink context={t.context} />
</span>
{/if}