2021-04-15 15:59:52 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
2021-10-26 00:43:02 +02:00
|
|
|
<script lang="ts">
|
2021-11-24 22:17:41 +01:00
|
|
|
import { pageTheme } from "../sveltelib/theme";
|
2022-02-04 09:36:34 +01:00
|
|
|
import IconConstrain from "./IconConstrain.svelte";
|
2021-03-29 14:54:10 +02:00
|
|
|
|
2021-05-06 01:58:14 +02:00
|
|
|
export let id: string | undefined = undefined;
|
2021-04-27 22:35:25 +02:00
|
|
|
let className = "";
|
|
|
|
export { className as class };
|
2021-04-20 03:24:08 +02:00
|
|
|
|
2021-05-06 01:58:14 +02:00
|
|
|
export let tooltip: string | undefined = undefined;
|
2021-04-28 13:09:25 +02:00
|
|
|
export let active = false;
|
2021-06-18 00:27:07 +02:00
|
|
|
export let disabled = false;
|
2021-05-06 01:58:14 +02:00
|
|
|
export let tabbable = false;
|
2021-04-28 13:09:25 +02:00
|
|
|
|
2021-10-18 14:01:15 +02:00
|
|
|
export let iconSize = 75;
|
|
|
|
export let widthMultiplier = 1;
|
|
|
|
export let flipX = false;
|
2021-03-29 14:54:10 +02:00
|
|
|
</script>
|
|
|
|
|
2021-05-26 01:21:33 +02:00
|
|
|
<button
|
|
|
|
{id}
|
2021-10-31 00:29:22 +02:00
|
|
|
class="icon-button btn {className}"
|
2021-05-26 01:21:33 +02:00
|
|
|
class:active
|
2021-11-24 22:17:41 +01:00
|
|
|
class:btn-day={!$pageTheme.isDark}
|
|
|
|
class:btn-night={$pageTheme.isDark}
|
2021-05-26 01:21:33 +02:00
|
|
|
title={tooltip}
|
2021-06-18 00:27:07 +02:00
|
|
|
{disabled}
|
2021-05-26 01:21:33 +02:00
|
|
|
tabindex={tabbable ? 0 : -1}
|
|
|
|
on:click
|
|
|
|
on:mousedown|preventDefault
|
|
|
|
>
|
2021-10-18 14:01:15 +02:00
|
|
|
<IconConstrain {flipX} {widthMultiplier} {iconSize}>
|
2021-07-21 16:48:02 +02:00
|
|
|
<slot />
|
2021-10-18 14:01:15 +02:00
|
|
|
</IconConstrain>
|
2021-05-26 01:21:33 +02:00
|
|
|
</button>
|
|
|
|
|
2021-04-28 13:09:25 +02:00
|
|
|
<style lang="scss">
|
2021-10-09 02:25:03 +02:00
|
|
|
@use "sass/button-mixins" as button;
|
2021-04-28 13:09:25 +02:00
|
|
|
|
2021-10-31 00:29:22 +02:00
|
|
|
.icon-button {
|
2021-04-28 13:09:25 +02:00
|
|
|
padding: 0;
|
2021-10-31 00:29:22 +02:00
|
|
|
font-size: var(--base-font-size);
|
|
|
|
height: var(--buttons-size);
|
|
|
|
|
2021-05-06 20:29:55 +02:00
|
|
|
@include button.btn-border-radius;
|
2021-04-28 13:09:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@include button.btn-day;
|
|
|
|
@include button.btn-night;
|
|
|
|
</style>
|