@luizleon/sf.prefeiturasp.vuecomponents 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/internal/ThemeToggle.d.ts +11 -1
- package/dist/components/tabnavigation/TabNavigation.d.ts +26 -0
- package/dist/index.d.ts +2 -1
- package/dist/lib.es.js +1229 -1125
- package/dist/lib.umd.js +33 -33
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/internal/HeaderAvatar.vue +49 -0
- package/src/components/internal/ThemeToggle.ts +3 -3
- package/src/components/layout/Layout.vue +2 -14
- package/src/components/tabnavigation/TabNavigation.d.ts +37 -0
- package/src/components/tabnavigation/TabNavigation.vue +114 -0
- package/src/index.ts +2 -0
- package/src/services/dialogService.ts +1 -1
- package/src/style/componentes.scss +3 -11
- package/src/style/src/components/_headerAvatar.scss +22 -0
- package/src/style/src/components/_tab-navigation.scss +88 -0
- package/src/components/internal/LogoutIcon.vue +0 -14
- package/src/sf-oidc-state.html +0 -15
- package/src/style/src/components/_button.scss +0 -110
- package/src/style/src/components/_checkbox.scss +0 -53
- package/src/style/src/components/_datefield.scss +0 -405
- package/src/style/src/components/_mark.scss +0 -9
- package/src/style/src/components/_mask.scss +0 -33
- package/src/style/src/components/_numpad.scss +0 -58
- package/src/style/src/components/_progress-circular.scss +0 -52
- package/src/style/src/components/_select.scss +0 -60
- package/src/style/src/components/_textfield.scss +0 -186
- package/src/style/src/components/_toast.scss +0 -66
- /package/dist/components/internal/{LogoutIcon.d.ts → HeaderAvatar.d.ts} +0 -0
- /package/src/style/src/components/{_internal_icon_button.scss → _internal-icon-button.scss} +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { AuthService } from "../../services/authService";
|
|
3
|
+
import { UseDialogService } from "../../services/dialogService";
|
|
4
|
+
|
|
5
|
+
const dialogService = UseDialogService();
|
|
6
|
+
|
|
7
|
+
const letters = Letters();
|
|
8
|
+
|
|
9
|
+
async function Logout() {
|
|
10
|
+
const confirm = await dialogService.ConfirmAsync({
|
|
11
|
+
message: `${AuthService.User.username} - ${AuthService.User.name}.<br /><br />Você deseja sair da conta?`,
|
|
12
|
+
confirmLabel: "sair",
|
|
13
|
+
});
|
|
14
|
+
if (!confirm) return;
|
|
15
|
+
AuthService.CallLogout();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function Letters() {
|
|
19
|
+
const name = AuthService.User.name;
|
|
20
|
+
let letters = "?";
|
|
21
|
+
if (!name) return letters;
|
|
22
|
+
|
|
23
|
+
const parts = name
|
|
24
|
+
.split(" ")
|
|
25
|
+
.filter((x) => x.length > 0)
|
|
26
|
+
.map((x) => x[0].toUpperCase());
|
|
27
|
+
|
|
28
|
+
const count = Math.min(2, parts.length);
|
|
29
|
+
|
|
30
|
+
letters = parts.slice(0, count).join("");
|
|
31
|
+
|
|
32
|
+
return letters.length > 0 ? letters : "?";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function Color() {
|
|
36
|
+
const primeiraLetra = letters[0];
|
|
37
|
+
const cor =
|
|
38
|
+
primeiraLetra === "?"
|
|
39
|
+
? 0
|
|
40
|
+
: (primeiraLetra.charCodeAt(0) - 64) % 19;
|
|
41
|
+
return Math.max(cor, 0);
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<div id="sf-header-avatar" :data-cor="Color()" @click="Logout">
|
|
47
|
+
{{ letters }}
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
class ThemeToggle {
|
|
2
2
|
get storedTheme() {
|
|
3
|
-
return localStorage.getItem("
|
|
3
|
+
return localStorage.getItem("color-scheme") as
|
|
4
4
|
| "light"
|
|
5
5
|
| "dark"
|
|
6
6
|
| null;
|
|
@@ -14,12 +14,12 @@ class ThemeToggle {
|
|
|
14
14
|
EnableDarkMode() {
|
|
15
15
|
document.documentElement.classList.add("dark");
|
|
16
16
|
document.documentElement.classList.remove("light");
|
|
17
|
-
localStorage.setItem("
|
|
17
|
+
localStorage.setItem("color-scheme", "dark");
|
|
18
18
|
}
|
|
19
19
|
EnableLightMode() {
|
|
20
20
|
document.documentElement.classList.remove("dark");
|
|
21
21
|
document.documentElement.classList.add("light");
|
|
22
|
-
localStorage.setItem("
|
|
22
|
+
localStorage.setItem("color-scheme", "light");
|
|
23
23
|
}
|
|
24
24
|
SetInitialTheme() {
|
|
25
25
|
if (this.storedTheme === "light") {
|
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { UseDialogService } from "../..";
|
|
3
|
-
import { AuthService } from "../../services/authService";
|
|
4
2
|
import { UseNavMenuService } from "../../services/navMenuService";
|
|
5
3
|
import Icon from "../icon/Icon.vue";
|
|
6
|
-
import
|
|
4
|
+
import HeaderAvatar from "../internal/HeaderAvatar.vue";
|
|
7
5
|
import MenuIcon from "../internal/MenuIcon.vue";
|
|
8
6
|
import ThemeToggle from "../internal/ThemeToggle.vue";
|
|
9
7
|
|
|
10
8
|
const navService = UseNavMenuService();
|
|
11
|
-
const dialogService = UseDialogService();
|
|
12
|
-
|
|
13
|
-
async function Logout() {
|
|
14
|
-
const confirm = await dialogService.ConfirmAsync({
|
|
15
|
-
message: "Você deseja sair da sua conta?",
|
|
16
|
-
confirmLabel: "sair",
|
|
17
|
-
});
|
|
18
|
-
if (!confirm) return;
|
|
19
|
-
AuthService.CallLogout();
|
|
20
|
-
}
|
|
21
9
|
</script>
|
|
22
10
|
|
|
23
11
|
<template>
|
|
@@ -38,7 +26,7 @@ async function Logout() {
|
|
|
38
26
|
</div>
|
|
39
27
|
<slot name="action"> </slot>
|
|
40
28
|
<ThemeToggle />
|
|
41
|
-
<
|
|
29
|
+
<HeaderAvatar />
|
|
42
30
|
</header>
|
|
43
31
|
<nav :class="{ visible: navService.IsVisible }">
|
|
44
32
|
<div class="sf-layout-nav-header">
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ClassComponent,
|
|
3
|
+
GlobalComponentConstructor,
|
|
4
|
+
} from "../../ts-helpers";
|
|
5
|
+
|
|
6
|
+
export interface SfTabNavigationProps {
|
|
7
|
+
tabs: { text: string; route: string }[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface SfTabNavigationSlots {
|
|
11
|
+
item: (scope: {
|
|
12
|
+
navigate: () => void;
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
}) => VNode[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare type SfTabNavigationEmits = {};
|
|
18
|
+
|
|
19
|
+
declare class SfTabNavigation extends ClassComponent<
|
|
20
|
+
SfTabNavigationProps,
|
|
21
|
+
SfTabNavigationSlots,
|
|
22
|
+
SfTabNavigationEmits
|
|
23
|
+
> {}
|
|
24
|
+
|
|
25
|
+
declare module "@vue/runtime-core" {
|
|
26
|
+
interface GlobalComponents {
|
|
27
|
+
SfTabNavigation: GlobalComponentConstructor<SfTabNavigation>;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Componente para navegação em abas
|
|
33
|
+
*
|
|
34
|
+
* Dependência: router-link.
|
|
35
|
+
* @see [https://router.vuejs.org/api/#router-link-s-v-slot](https://router.vuejs.org/api/#router-link-s-v-slot)
|
|
36
|
+
*/
|
|
37
|
+
export default SfTabNavigation;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onMounted, onBeforeUnmount, ref } from "vue";
|
|
3
|
+
import { SfTabNavigationProps } from "./TabNavigation";
|
|
4
|
+
|
|
5
|
+
const props = defineProps<SfTabNavigationProps>();
|
|
6
|
+
|
|
7
|
+
const trackerContainer = ref<HTMLInputElement | null>(null);
|
|
8
|
+
const trackerContainerObserver = new ResizeObserver((_) => {
|
|
9
|
+
AjustarIcones();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const isLeftArrowActive = ref(false);
|
|
13
|
+
const isRightArrowActive = ref(false);
|
|
14
|
+
|
|
15
|
+
function Scroll(left: boolean = false) {
|
|
16
|
+
const amount = trackerContainer.value!.clientWidth;
|
|
17
|
+
trackerContainer.value!.scrollLeft += left ? -amount : amount;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function AjustarIcones() {
|
|
21
|
+
const maxScrollValue =
|
|
22
|
+
trackerContainer.value!.scrollWidth -
|
|
23
|
+
trackerContainer.value!.clientWidth;
|
|
24
|
+
|
|
25
|
+
isLeftArrowActive.value! = trackerContainer.value!.scrollLeft > 10;
|
|
26
|
+
|
|
27
|
+
isRightArrowActive.value! =
|
|
28
|
+
trackerContainer.value!.scrollLeft < maxScrollValue - 10;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
onMounted(() => {
|
|
32
|
+
trackerContainer.value!.addEventListener("scroll", AjustarIcones);
|
|
33
|
+
trackerContainerObserver.observe(trackerContainer.value!);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
onBeforeUnmount(() => {
|
|
37
|
+
trackerContainer.value!.removeEventListener(
|
|
38
|
+
"scroll",
|
|
39
|
+
AjustarIcones
|
|
40
|
+
);
|
|
41
|
+
trackerContainerObserver.unobserve(trackerContainer.value!);
|
|
42
|
+
trackerContainerObserver.disconnect();
|
|
43
|
+
});
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<div class="sf-tab-navigation">
|
|
48
|
+
<div
|
|
49
|
+
:class="['left-arrow', { active: isLeftArrowActive }]"
|
|
50
|
+
@click="Scroll(true)"
|
|
51
|
+
>
|
|
52
|
+
<svg
|
|
53
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
54
|
+
fill="none"
|
|
55
|
+
viewBox="0 0 24 24"
|
|
56
|
+
stroke-width="1.5"
|
|
57
|
+
stroke="currentColor"
|
|
58
|
+
class="w-6 h-6"
|
|
59
|
+
>
|
|
60
|
+
<path
|
|
61
|
+
stroke-linecap="round"
|
|
62
|
+
stroke-linejoin="round"
|
|
63
|
+
d="M15.75 19.5L8.25 12l7.5-7.5"
|
|
64
|
+
/>
|
|
65
|
+
</svg>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<ul ref="trackerContainer">
|
|
69
|
+
<RouterLink
|
|
70
|
+
v-for="tab in props.tabs"
|
|
71
|
+
:to="tab.route"
|
|
72
|
+
:custom="true"
|
|
73
|
+
v-slot="{ navigate, isActive }"
|
|
74
|
+
>
|
|
75
|
+
<li>
|
|
76
|
+
<slot
|
|
77
|
+
name="item"
|
|
78
|
+
:item="tab"
|
|
79
|
+
:navigate="navigate"
|
|
80
|
+
:is-active="isActive"
|
|
81
|
+
>
|
|
82
|
+
<a
|
|
83
|
+
:href="tab.route"
|
|
84
|
+
:class="{ active: isActive }"
|
|
85
|
+
@click="navigate"
|
|
86
|
+
>
|
|
87
|
+
{{ tab.text }}
|
|
88
|
+
</a>
|
|
89
|
+
</slot>
|
|
90
|
+
</li>
|
|
91
|
+
</RouterLink>
|
|
92
|
+
</ul>
|
|
93
|
+
|
|
94
|
+
<div
|
|
95
|
+
:class="['right-arrow', { active: isRightArrowActive }]"
|
|
96
|
+
@click="Scroll()"
|
|
97
|
+
>
|
|
98
|
+
<svg
|
|
99
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
100
|
+
fill="none"
|
|
101
|
+
viewBox="0 0 24 24"
|
|
102
|
+
stroke-width="1.5"
|
|
103
|
+
stroke="currentColor"
|
|
104
|
+
class="w-6 h-6"
|
|
105
|
+
>
|
|
106
|
+
<path
|
|
107
|
+
stroke-linecap="round"
|
|
108
|
+
stroke-linejoin="round"
|
|
109
|
+
d="M8.25 4.5l7.5 7.5-7.5 7.5"
|
|
110
|
+
/>
|
|
111
|
+
</svg>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</template>
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ import SfLayout from "./components/layout/Layout.vue";
|
|
|
2
2
|
import SfIcon from "./components/icon/Icon.vue";
|
|
3
3
|
import SfNavMenuLink from "./components/navmenulink/NavMenuLink.vue";
|
|
4
4
|
import SfContent from "./components/content/Content.vue";
|
|
5
|
+
import SfTabNavigation from "./components/tabnavigation/TabNavigation.vue";
|
|
5
6
|
|
|
6
7
|
import { UseNavMenuService } from "./services/navMenuService";
|
|
7
8
|
import { UseDialogService } from "./services/dialogService";
|
|
@@ -19,6 +20,7 @@ export {
|
|
|
19
20
|
SfIcon,
|
|
20
21
|
SfNavMenuLink,
|
|
21
22
|
SfContent,
|
|
23
|
+
SfTabNavigation,
|
|
22
24
|
AuthService,
|
|
23
25
|
UseNavMenuService,
|
|
24
26
|
UseDialogService,
|
|
@@ -20,7 +20,7 @@ class DialogService {
|
|
|
20
20
|
allowOutsideClick: false,
|
|
21
21
|
icon: "question",
|
|
22
22
|
title: options.header,
|
|
23
|
-
|
|
23
|
+
html: options.message,
|
|
24
24
|
confirmButtonText: options.confirmLabel ?? "confirmar",
|
|
25
25
|
cancelButtonText: options.rejectLabel ?? "cancelar",
|
|
26
26
|
}).then((x: any) => {
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
@import "./src/components/layout";
|
|
2
2
|
@import "./src/components/themetoggle";
|
|
3
|
-
@import "./src/components/
|
|
3
|
+
@import "./src/components/internal-icon-button";
|
|
4
4
|
@import "./src/components/svg_icon";
|
|
5
5
|
@import "./src/components/loading-circle";
|
|
6
6
|
@import "./src/components/icon";
|
|
7
|
-
@import "./src/components/progress-circular";
|
|
8
7
|
@import "./src/components/tooltip";
|
|
9
|
-
@import "./src/components/toast";
|
|
10
8
|
@import "./src/components/drawer";
|
|
11
|
-
@import "./src/components/mask";
|
|
12
9
|
@import "./src/components/navmenulink";
|
|
13
|
-
@import "./src/components/button";
|
|
14
|
-
@import "./src/components/textfield";
|
|
15
|
-
@import "./src/components/numpad";
|
|
16
10
|
@import "./src/components/content";
|
|
17
11
|
@import "./src/components/scrollToTop";
|
|
18
|
-
@import "./src/components/datefield";
|
|
19
|
-
@import "./src/components/checkbox";
|
|
20
|
-
@import "./src/components/mark";
|
|
21
|
-
@import "./src/components/select";
|
|
22
12
|
@import "./src/sweetalert/sweetalert";
|
|
13
|
+
@import "./src/components/headerAvatar";
|
|
14
|
+
@import "./src/components/tab-navigation";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
html {
|
|
2
|
+
#sf-header-avatar {
|
|
3
|
+
text-transform: uppercase;
|
|
4
|
+
line-height: 1;
|
|
5
|
+
word-break: keep-all;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
background-position: center;
|
|
10
|
+
background-size: contain;
|
|
11
|
+
font-size: 1rem;
|
|
12
|
+
min-width: 36px;
|
|
13
|
+
min-height: 36px;
|
|
14
|
+
border-radius: 50%;
|
|
15
|
+
margin-left: 0.5rem;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
@include avatar-colors();
|
|
18
|
+
&.dark {
|
|
19
|
+
@include avatar-colors(true);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
.sf-tab-navigation {
|
|
2
|
+
background: var(--surface-100-color);
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
position: relative;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.sf-tab-navigation svg {
|
|
8
|
+
width: 36px;
|
|
9
|
+
height: 36px;
|
|
10
|
+
padding: 8px;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
color: var(--text-color);
|
|
13
|
+
border-radius: 50%;
|
|
14
|
+
pointer-events: auto;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.sf-tab-navigation ul {
|
|
18
|
+
padding: 0;
|
|
19
|
+
margin: 0;
|
|
20
|
+
display: flex;
|
|
21
|
+
height: 42px;
|
|
22
|
+
list-style: none;
|
|
23
|
+
overflow: scroll;
|
|
24
|
+
-ms-overflow-style: none;
|
|
25
|
+
scrollbar-width: none;
|
|
26
|
+
scroll-behavior: smooth;
|
|
27
|
+
background-color: var(--bg-color);
|
|
28
|
+
border-bottom: 1px solid var(--surface-border-color);
|
|
29
|
+
> li {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
padding: 0 1rem;
|
|
33
|
+
flex-grow: 1;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
a {
|
|
36
|
+
text-decoration: none;
|
|
37
|
+
padding-bottom: 2px;
|
|
38
|
+
border-bottom: 2px solid transparent;
|
|
39
|
+
&:hover,
|
|
40
|
+
&.active {
|
|
41
|
+
border-bottom-color: var(--primary-color);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.sf-tab-navigation ul::-webkit-scrollbar {
|
|
48
|
+
display: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.sf-tab-navigation .right-arrow,
|
|
52
|
+
.sf-tab-navigation .left-arrow {
|
|
53
|
+
position: absolute;
|
|
54
|
+
height: 100%;
|
|
55
|
+
width: 100px;
|
|
56
|
+
top: 0;
|
|
57
|
+
display: none;
|
|
58
|
+
align-items: center;
|
|
59
|
+
padding: 0 10px;
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.sf-tab-navigation .right-arrow.active,
|
|
64
|
+
.sf-tab-navigation .left-arrow.active {
|
|
65
|
+
display: flex;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.sf-tab-navigation .right-arrow {
|
|
69
|
+
right: 0;
|
|
70
|
+
background: linear-gradient(
|
|
71
|
+
to left,
|
|
72
|
+
var(--surface-100-color) 30%,
|
|
73
|
+
transparent
|
|
74
|
+
);
|
|
75
|
+
justify-content: flex-end;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.sf-tab-navigation .left-arrow {
|
|
79
|
+
background: linear-gradient(
|
|
80
|
+
to right,
|
|
81
|
+
var(--surface-100-color) 50%,
|
|
82
|
+
transparent
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.sf-tab-navigation svg:hover {
|
|
87
|
+
background: var(--surface-300-color);
|
|
88
|
+
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<button class="sf-internal-icon-button sf-ripple">
|
|
3
|
-
<svg
|
|
4
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
-
height="48"
|
|
6
|
-
viewBox="0 -960 960 960"
|
|
7
|
-
width="48"
|
|
8
|
-
>
|
|
9
|
-
<path
|
|
10
|
-
d="M194.694-124.001q-28.254 0-49.473-21.22-21.22-21.219-21.22-49.473v-570.612q0-28.254 21.22-49.473 21.219-21.22 49.473-21.22h285.075v58.384H194.694q-4.616 0-8.463 3.846-3.846 3.847-3.846 8.463v570.612q0 4.616 3.846 8.463 3.847 3.846 8.463 3.846h285.075v58.384H194.694Zm469.614-183.693-42.999-42.23 101.384-101.384H360.846v-58.384h360.616L620.078-611.076l42.615-41.615 173.306 173.499-171.691 171.498Z"
|
|
11
|
-
/>
|
|
12
|
-
</svg>
|
|
13
|
-
</button>
|
|
14
|
-
</template>
|
package/src/sf-oidc-state.html
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<body>
|
|
4
|
-
<script>
|
|
5
|
-
const query = new URLSearchParams(location.href.split('#')[1]);
|
|
6
|
-
const state = query.get('state');
|
|
7
|
-
const code = query.get('code');
|
|
8
|
-
const error = query.get('error');
|
|
9
|
-
parent.postMessage(
|
|
10
|
-
{ action: 'sf-oidc-state', code, state, error },
|
|
11
|
-
location.origin
|
|
12
|
-
);
|
|
13
|
-
</script>
|
|
14
|
-
</body>
|
|
15
|
-
</html>
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
@use "../mixins";
|
|
2
|
-
|
|
3
|
-
.sf-button {
|
|
4
|
-
position: relative;
|
|
5
|
-
display: inline-flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
border-radius: 4px;
|
|
8
|
-
border: 1px solid transparent;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
font-weight: 400;
|
|
11
|
-
transition: opacity 0.2s ease-in-out;
|
|
12
|
-
&:hover {
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.sf-button-label {
|
|
17
|
-
white-space: nowrap;
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
text-overflow: ellipsis;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.sf-icon {
|
|
23
|
-
position: absolute;
|
|
24
|
-
> button {
|
|
25
|
-
color: currentColor !important;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&.sf-component-loading {
|
|
30
|
-
color: var(--disabled-color) !important;
|
|
31
|
-
border-color: var(--disabled-color) !important;
|
|
32
|
-
.sf-button-label {
|
|
33
|
-
color: transparent !important;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&.sf-button-filled:disabled {
|
|
38
|
-
background-color: hsla(
|
|
39
|
-
var(--disabled-color-h),
|
|
40
|
-
var(--disabled-color-s),
|
|
41
|
-
var(--disabled-color-l),
|
|
42
|
-
0.5
|
|
43
|
-
) !important;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&.sf-button-small {
|
|
47
|
-
height: 32px;
|
|
48
|
-
font-size: 0.875rem;
|
|
49
|
-
padding: 0 12px;
|
|
50
|
-
&.sf-button-with-icon {
|
|
51
|
-
padding-left: 28px;
|
|
52
|
-
}
|
|
53
|
-
.sf-icon {
|
|
54
|
-
inset: 0 0 0 6px;
|
|
55
|
-
&.sf-component-loading {
|
|
56
|
-
inset: 0 0 0 50%;
|
|
57
|
-
margin-left: -8px;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
.sf-button-label {
|
|
61
|
-
line-height: 32px;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&.sf-button-medium {
|
|
66
|
-
height: 36px;
|
|
67
|
-
font-size: 1rem;
|
|
68
|
-
padding: 0 12px;
|
|
69
|
-
&.sf-button-with-icon {
|
|
70
|
-
padding-left: 38px;
|
|
71
|
-
}
|
|
72
|
-
.sf-icon {
|
|
73
|
-
inset: 0 0 0 8px;
|
|
74
|
-
&.sf-component-loading {
|
|
75
|
-
inset: 0 0 0 50%;
|
|
76
|
-
margin-left: -12px;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
.sf-button-label {
|
|
80
|
-
line-height: 36px;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
&.sf-button-large {
|
|
85
|
-
height: 48px;
|
|
86
|
-
font-size: 1.25rem;
|
|
87
|
-
padding: 0 16px;
|
|
88
|
-
&.sf-button-with-icon {
|
|
89
|
-
padding-left: 54px;
|
|
90
|
-
}
|
|
91
|
-
.sf-icon {
|
|
92
|
-
inset: 0 0 0 10px;
|
|
93
|
-
&.sf-component-loading {
|
|
94
|
-
inset: 0 0 0 50%;
|
|
95
|
-
margin-left: -18px;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
.sf-button-label {
|
|
99
|
-
line-height: 48px;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
@include button-colors;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
html.dark {
|
|
107
|
-
.sf-button {
|
|
108
|
-
@include button-colors(true);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
.sf-checkbox {
|
|
2
|
-
$width: 22px;
|
|
3
|
-
$height: 22px;
|
|
4
|
-
$radius: 4px;
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
user-select: none;
|
|
7
|
-
align-items: center;
|
|
8
|
-
position: relative;
|
|
9
|
-
.sf-checkbox-box {
|
|
10
|
-
min-width: $width;
|
|
11
|
-
min-height: $height;
|
|
12
|
-
width: $width;
|
|
13
|
-
height: $height;
|
|
14
|
-
border-radius: $radius;
|
|
15
|
-
border: 2px solid var(--surface-border-color);
|
|
16
|
-
background: var(--surface-200-color);
|
|
17
|
-
display: flex;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
align-items: center;
|
|
20
|
-
transition-duration: 0.2s;
|
|
21
|
-
transition-timing-function: linear;
|
|
22
|
-
transition-property: box-shadow, border;
|
|
23
|
-
&.sf-checkbox-box-highlight {
|
|
24
|
-
border-color: var(--primary-color);
|
|
25
|
-
background-color: var(--primary-color);
|
|
26
|
-
> .sf-icon > button {
|
|
27
|
-
color: var(--bg-color);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
&.sf-checkbox-box-focus {
|
|
31
|
-
outline: 0 none;
|
|
32
|
-
outline-offset: 0;
|
|
33
|
-
border-color: var(--primary-color);
|
|
34
|
-
box-shadow: 0 0 0 1px var(--primary-color);
|
|
35
|
-
}
|
|
36
|
-
&:not(.sf-checkbox-box-highlight) {
|
|
37
|
-
&:hover {
|
|
38
|
-
outline: 0 none;
|
|
39
|
-
outline-offset: 0;
|
|
40
|
-
border-color: var(--surface-900-color);
|
|
41
|
-
background: var(--surface-300-color);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
.sf-checkbox-label {
|
|
46
|
-
padding-left: 1rem;
|
|
47
|
-
margin-right: 1rem;
|
|
48
|
-
word-break: break-all;
|
|
49
|
-
&:empty {
|
|
50
|
-
display: none;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|