@sierra-95/svelte-scaffold 1.0.9 → 1.0.10
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/README.md +8 -8
- package/dist/Hooks/preview.d.ts +2 -1
- package/dist/Hooks/preview.js +4 -4
- package/dist/components/Core/Alerts/Backdrop/backdrop.svelte +26 -26
- package/dist/components/Core/Alerts/Modal/modal.svelte +40 -40
- package/dist/components/Core/Alerts/Toast/toast.css +38 -38
- package/dist/components/Core/Alerts/Toast/toast.svelte +32 -32
- package/dist/components/Core/Alerts/Wrapper/wrapper.svelte +18 -18
- package/dist/components/Core/Alerts/site-under-maintenance/site-under-maintenance.svelte +33 -33
- package/dist/components/Core/Form/Hr/hr.svelte +10 -10
- package/dist/components/Core/Form/Input/FileInput/fileInput.svelte +158 -158
- package/dist/components/Core/Form/Input/FileInput/preview.svelte +50 -50
- package/dist/components/Core/Form/Input/SearchBar/search.svelte +68 -68
- package/dist/components/Core/Form/Input/input/input.svelte +16 -16
- package/dist/components/Core/Form/Input/password/password.svelte +26 -26
- package/dist/components/Core/Menus/DropdownContainer/dropdown.svelte +94 -94
- package/dist/components/Core/Menus/MenuItem/menuItem.svelte +43 -43
- package/dist/components/Core/Menus/UserMenu/profile.svelte +34 -34
- package/dist/components/Core/others/Button/Flip/button.css +50 -50
- package/dist/components/Core/others/Button/Flip/button.svelte +79 -79
- package/dist/components/Core/others/Button/Marquee/button.css +36 -36
- package/dist/components/Core/others/Button/Marquee/button.svelte +58 -58
- package/dist/components/Core/others/Button/Swipe/button.css +32 -32
- package/dist/components/Core/others/Button/Swipe/button.svelte +57 -57
- package/dist/components/Core/others/Button/default/button.css +60 -60
- package/dist/components/Core/others/Button/default/button.svelte +124 -124
- package/dist/components/Core/others/Button/select/select.svelte +28 -28
- package/dist/components/Core/others/Button/theme/theme.css +121 -121
- package/dist/components/Core/others/Button/theme/theme.svelte +67 -67
- package/dist/components/Core/others/Button/times/times.svelte +24 -24
- package/dist/components/Core/others/Clock/Date/date.svelte +25 -25
- package/dist/components/Core/others/Clock/Time/time.svelte +35 -35
- package/dist/components/Core/others/Previews/Audio/audio.svelte +61 -61
- package/dist/components/Core/others/Previews/Document/documents.svelte +36 -36
- package/dist/components/Core/others/Previews/GenericFile/genericFile.svelte +25 -25
- package/dist/components/Core/others/Previews/Image/image.svelte +26 -26
- package/dist/components/Core/others/Previews/Video/video.svelte +28 -28
- package/dist/components/Core/others/Progress/CircularProgress/CircularProgress.svelte +55 -55
- package/dist/components/Core/others/Progress/CustomProgress/customProgress.svelte +64 -64
- package/dist/components/Core/others/Progress/LinearProgress/LinearProgress.css +60 -60
- package/dist/components/Core/others/Progress/LinearProgress/LinearProgress.svelte +86 -86
- package/dist/components/Modules/Editor/Hooks/extractContent.js +14 -14
- package/dist/components/Modules/Editor/Hooks/extractImage.js +30 -30
- package/dist/components/Modules/Editor/Hooks/insertImage.js +26 -26
- package/dist/components/Modules/Editor/Hooks/insertYoutube.js +34 -34
- package/dist/components/Modules/Editor/Marks/Links/links.svelte +78 -78
- package/dist/components/Modules/Editor/Marks/TextFormatting/textFormatting.svelte +32 -32
- package/dist/components/Modules/Editor/Nodes/Headings/heading.svelte +58 -58
- package/dist/components/Modules/Editor/Nodes/History/history.svelte +21 -21
- package/dist/components/Modules/Editor/Nodes/Images/images.svelte +85 -85
- package/dist/components/Modules/Editor/Nodes/Lists/lists.svelte +30 -30
- package/dist/components/Modules/Editor/Nodes/TextAlign/textAlign.svelte +55 -55
- package/dist/components/Modules/Editor/Nodes/TextColor/styles.css +18 -18
- package/dist/components/Modules/Editor/Nodes/TextColor/textColor.svelte +88 -88
- package/dist/components/Modules/Editor/Nodes/Youtube/youtube.svelte +32 -32
- package/dist/components/Modules/Editor/colors.js +21 -21
- package/dist/components/Modules/Editor/controls.svelte +71 -71
- package/dist/components/Modules/Editor/extensions.js +59 -59
- package/dist/components/Modules/Editor/main.svelte +41 -41
- package/dist/components/Modules/Editor/save.svelte +28 -28
- package/dist/components/Modules/Editor/styles/controls.css +68 -68
- package/dist/components/Modules/Editor/styles/main.css +42 -42
- package/dist/components/Modules/Editor/tools.js +22 -22
- package/dist/components/Modules/FilePicker/cloudStore.svelte +101 -98
- package/dist/components/Modules/FilePicker/controls.svelte +167 -141
- package/dist/components/Modules/FilePicker/controls.svelte.d.ts +4 -19
- package/dist/components/Modules/FilePicker/filePicker.svelte +59 -59
- package/dist/components/Modules/FilePicker/file_properties.svelte +33 -0
- package/dist/components/Modules/FilePicker/file_properties.svelte.d.ts +11 -0
- package/dist/components/Modules/FilePicker/previews.svelte +22 -22
- package/dist/components/Modules/Layout/Header/header.css +37 -37
- package/dist/components/Modules/Layout/Header/header.svelte +31 -31
- package/dist/components/Modules/Layout/Menu/menu.css +53 -53
- package/dist/components/Modules/Layout/Menu/menu.svelte +129 -129
- package/dist/components/Modules/Layout/background.svelte +28 -28
- package/dist/components/Modules/Layout/collapse.svelte +24 -24
- package/dist/components/Modules/Layout/main.css +31 -31
- package/dist/components/Modules/Layout/main.svelte +110 -110
- package/dist/global.css +246 -246
- package/dist/index.d.ts +1 -0
- package/dist/stores/core/general.js +4 -4
- package/dist/stores/core/ismobile.js +14 -14
- package/dist/stores/core/modal.js +35 -35
- package/dist/stores/modules/fileInput.d.ts +11 -4
- package/dist/stores/modules/fileInput.js +1 -1
- package/package.json +75 -75
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { onMount } from 'svelte';
|
|
3
|
-
import './button.css';
|
|
4
|
-
|
|
5
|
-
type _buttonType = 'button' | 'submit' | 'reset';
|
|
6
|
-
const {
|
|
7
|
-
text = "Hover me",
|
|
8
|
-
bg = "var(--primary-bg)",
|
|
9
|
-
color = "var(--text)",
|
|
10
|
-
title = "",
|
|
11
|
-
type = 'button' as _buttonType,
|
|
12
|
-
disabled = false,
|
|
13
|
-
...rest
|
|
14
|
-
} = $props();
|
|
15
|
-
|
|
16
|
-
let scrolling = $state(false);
|
|
17
|
-
|
|
18
|
-
let container: HTMLDivElement;
|
|
19
|
-
let marquee: HTMLButtonElement;
|
|
20
|
-
|
|
21
|
-
let containerWidth = 0;
|
|
22
|
-
let textWidth = 0;
|
|
23
|
-
|
|
24
|
-
onMount(() => {
|
|
25
|
-
if (container && marquee) {
|
|
26
|
-
// width of one sentence
|
|
27
|
-
textWidth = marquee.offsetWidth / 3; // because we repeat text 3x
|
|
28
|
-
containerWidth = textWidth - 10;
|
|
29
|
-
container.style.width = containerWidth + "px";
|
|
30
|
-
const containerHeight = container.offsetHeight;
|
|
31
|
-
container.style.borderRadius = containerHeight / 2 + "px";
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<div
|
|
37
|
-
role='none'
|
|
38
|
-
bind:this={container}
|
|
39
|
-
class="marquee-container"
|
|
40
|
-
onmouseenter={() => scrolling = true}
|
|
41
|
-
onmouseleave={() => scrolling = false}
|
|
42
|
-
style="--border-color: {bg}; --text-color: {color}"
|
|
43
|
-
>
|
|
44
|
-
<button
|
|
45
|
-
type={type}
|
|
46
|
-
title={title}
|
|
47
|
-
disabled={disabled}
|
|
48
|
-
class="marquee {scrolling ? 'scrolling' : ''}"
|
|
49
|
-
bind:this={marquee}
|
|
50
|
-
onclick={(e: MouseEvent) => {
|
|
51
|
-
rest.onclick?.(e);
|
|
52
|
-
}}
|
|
53
|
-
>
|
|
54
|
-
<span>{text}</span>
|
|
55
|
-
<span>{text}</span>
|
|
56
|
-
<span>{text}</span>
|
|
57
|
-
</button>
|
|
58
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte';
|
|
3
|
+
import './button.css';
|
|
4
|
+
|
|
5
|
+
type _buttonType = 'button' | 'submit' | 'reset';
|
|
6
|
+
const {
|
|
7
|
+
text = "Hover me",
|
|
8
|
+
bg = "var(--primary-bg)",
|
|
9
|
+
color = "var(--text)",
|
|
10
|
+
title = "",
|
|
11
|
+
type = 'button' as _buttonType,
|
|
12
|
+
disabled = false,
|
|
13
|
+
...rest
|
|
14
|
+
} = $props();
|
|
15
|
+
|
|
16
|
+
let scrolling = $state(false);
|
|
17
|
+
|
|
18
|
+
let container: HTMLDivElement;
|
|
19
|
+
let marquee: HTMLButtonElement;
|
|
20
|
+
|
|
21
|
+
let containerWidth = 0;
|
|
22
|
+
let textWidth = 0;
|
|
23
|
+
|
|
24
|
+
onMount(() => {
|
|
25
|
+
if (container && marquee) {
|
|
26
|
+
// width of one sentence
|
|
27
|
+
textWidth = marquee.offsetWidth / 3; // because we repeat text 3x
|
|
28
|
+
containerWidth = textWidth - 10;
|
|
29
|
+
container.style.width = containerWidth + "px";
|
|
30
|
+
const containerHeight = container.offsetHeight;
|
|
31
|
+
container.style.borderRadius = containerHeight / 2 + "px";
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<div
|
|
37
|
+
role='none'
|
|
38
|
+
bind:this={container}
|
|
39
|
+
class="marquee-container"
|
|
40
|
+
onmouseenter={() => scrolling = true}
|
|
41
|
+
onmouseleave={() => scrolling = false}
|
|
42
|
+
style="--border-color: {bg}; --text-color: {color}"
|
|
43
|
+
>
|
|
44
|
+
<button
|
|
45
|
+
type={type}
|
|
46
|
+
title={title}
|
|
47
|
+
disabled={disabled}
|
|
48
|
+
class="marquee {scrolling ? 'scrolling' : ''}"
|
|
49
|
+
bind:this={marquee}
|
|
50
|
+
onclick={(e: MouseEvent) => {
|
|
51
|
+
rest.onclick?.(e);
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
<span>{text}</span>
|
|
55
|
+
<span>{text}</span>
|
|
56
|
+
<span>{text}</span>
|
|
57
|
+
</button>
|
|
58
|
+
</div>
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
.swipe-btn {
|
|
2
|
-
position: relative;
|
|
3
|
-
display: block;
|
|
4
|
-
width:130px;
|
|
5
|
-
height: 30px;
|
|
6
|
-
line-height: 27px;
|
|
7
|
-
text-align: center;
|
|
8
|
-
border: 1px solid var(--btn-color);
|
|
9
|
-
border-radius: 50px;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
cursor: pointer;
|
|
12
|
-
z-index: 0;
|
|
13
|
-
color: var(--text-color);
|
|
14
|
-
transition: color 0.4s ease;
|
|
15
|
-
}
|
|
16
|
-
/* Swipe layer */
|
|
17
|
-
.swipe-btn::before {
|
|
18
|
-
content: '';
|
|
19
|
-
position: absolute;
|
|
20
|
-
top: 0; left: 0; bottom: 0; right: 0;
|
|
21
|
-
background-color: var(--btn-color);
|
|
22
|
-
transform: translateX(-100%);
|
|
23
|
-
transition: transform 0.4s ease;
|
|
24
|
-
z-index: -1;
|
|
25
|
-
}
|
|
26
|
-
/* Hover triggers swipe */
|
|
27
|
-
.swipe-btn:hover::before {
|
|
28
|
-
transform: translateX(0);
|
|
29
|
-
}
|
|
30
|
-
.swipe-btn:hover {
|
|
31
|
-
color: var(--button-text);
|
|
32
|
-
}
|
|
1
|
+
.swipe-btn {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: block;
|
|
4
|
+
width:130px;
|
|
5
|
+
height: 30px;
|
|
6
|
+
line-height: 27px;
|
|
7
|
+
text-align: center;
|
|
8
|
+
border: 1px solid var(--btn-color);
|
|
9
|
+
border-radius: 50px;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
z-index: 0;
|
|
13
|
+
color: var(--text-color);
|
|
14
|
+
transition: color 0.4s ease;
|
|
15
|
+
}
|
|
16
|
+
/* Swipe layer */
|
|
17
|
+
.swipe-btn::before {
|
|
18
|
+
content: '';
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 0; left: 0; bottom: 0; right: 0;
|
|
21
|
+
background-color: var(--btn-color);
|
|
22
|
+
transform: translateX(-100%);
|
|
23
|
+
transition: transform 0.4s ease;
|
|
24
|
+
z-index: -1;
|
|
25
|
+
}
|
|
26
|
+
/* Hover triggers swipe */
|
|
27
|
+
.swipe-btn:hover::before {
|
|
28
|
+
transform: translateX(0);
|
|
29
|
+
}
|
|
30
|
+
.swipe-btn:hover {
|
|
31
|
+
color: var(--button-text);
|
|
32
|
+
}
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import {buttonRipple} from '../../../../../index.js'
|
|
3
|
-
|
|
4
|
-
type _buttonType = 'button' | 'submit' | 'reset';
|
|
5
|
-
const {
|
|
6
|
-
text = "Button",
|
|
7
|
-
bg = "var(--primary-bg)",
|
|
8
|
-
color = "var(--text)",
|
|
9
|
-
title = "",
|
|
10
|
-
type = 'button' as _buttonType,
|
|
11
|
-
disabled = false,
|
|
12
|
-
...rest
|
|
13
|
-
} = $props();
|
|
14
|
-
</script>
|
|
15
|
-
<button
|
|
16
|
-
type={type}
|
|
17
|
-
title={title}
|
|
18
|
-
disabled={disabled}
|
|
19
|
-
use:buttonRipple
|
|
20
|
-
class="swipe-btn"
|
|
21
|
-
style="--btn-color: {bg}; --text-color: {color}"
|
|
22
|
-
onclick={(e: MouseEvent) => {
|
|
23
|
-
rest.onclick?.(e);
|
|
24
|
-
}}
|
|
25
|
-
>{text}</button>
|
|
26
|
-
<style>.swipe-btn {
|
|
27
|
-
position: relative;
|
|
28
|
-
display: block;
|
|
29
|
-
width:130px;
|
|
30
|
-
height: 30px;
|
|
31
|
-
line-height: 27px;
|
|
32
|
-
text-align: center;
|
|
33
|
-
border: 1px solid var(--btn-color);
|
|
34
|
-
border-radius: 50px;
|
|
35
|
-
overflow: hidden;
|
|
36
|
-
cursor: pointer;
|
|
37
|
-
z-index: 0;
|
|
38
|
-
color: var(--text-color);
|
|
39
|
-
transition: color 0.4s ease;
|
|
40
|
-
}
|
|
41
|
-
/* Swipe layer */
|
|
42
|
-
.swipe-btn::before {
|
|
43
|
-
content: '';
|
|
44
|
-
position: absolute;
|
|
45
|
-
top: 0; left: 0; bottom: 0; right: 0;
|
|
46
|
-
background-color: var(--btn-color);
|
|
47
|
-
transform: translateX(-100%);
|
|
48
|
-
transition: transform 0.4s ease;
|
|
49
|
-
z-index: -1;
|
|
50
|
-
}
|
|
51
|
-
/* Hover triggers swipe */
|
|
52
|
-
.swipe-btn:hover::before {
|
|
53
|
-
transform: translateX(0);
|
|
54
|
-
}
|
|
55
|
-
.swipe-btn:hover {
|
|
56
|
-
color: var(--button-text);
|
|
57
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import {buttonRipple} from '../../../../../index.js'
|
|
3
|
+
|
|
4
|
+
type _buttonType = 'button' | 'submit' | 'reset';
|
|
5
|
+
const {
|
|
6
|
+
text = "Button",
|
|
7
|
+
bg = "var(--primary-bg)",
|
|
8
|
+
color = "var(--text)",
|
|
9
|
+
title = "",
|
|
10
|
+
type = 'button' as _buttonType,
|
|
11
|
+
disabled = false,
|
|
12
|
+
...rest
|
|
13
|
+
} = $props();
|
|
14
|
+
</script>
|
|
15
|
+
<button
|
|
16
|
+
type={type}
|
|
17
|
+
title={title}
|
|
18
|
+
disabled={disabled}
|
|
19
|
+
use:buttonRipple
|
|
20
|
+
class="swipe-btn"
|
|
21
|
+
style="--btn-color: {bg}; --text-color: {color}"
|
|
22
|
+
onclick={(e: MouseEvent) => {
|
|
23
|
+
rest.onclick?.(e);
|
|
24
|
+
}}
|
|
25
|
+
>{text}</button>
|
|
26
|
+
<style>.swipe-btn {
|
|
27
|
+
position: relative;
|
|
28
|
+
display: block;
|
|
29
|
+
width:130px;
|
|
30
|
+
height: 30px;
|
|
31
|
+
line-height: 27px;
|
|
32
|
+
text-align: center;
|
|
33
|
+
border: 1px solid var(--btn-color);
|
|
34
|
+
border-radius: 50px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
z-index: 0;
|
|
38
|
+
color: var(--text-color);
|
|
39
|
+
transition: color 0.4s ease;
|
|
40
|
+
}
|
|
41
|
+
/* Swipe layer */
|
|
42
|
+
.swipe-btn::before {
|
|
43
|
+
content: '';
|
|
44
|
+
position: absolute;
|
|
45
|
+
top: 0; left: 0; bottom: 0; right: 0;
|
|
46
|
+
background-color: var(--btn-color);
|
|
47
|
+
transform: translateX(-100%);
|
|
48
|
+
transition: transform 0.4s ease;
|
|
49
|
+
z-index: -1;
|
|
50
|
+
}
|
|
51
|
+
/* Hover triggers swipe */
|
|
52
|
+
.swipe-btn:hover::before {
|
|
53
|
+
transform: translateX(0);
|
|
54
|
+
}
|
|
55
|
+
.swipe-btn:hover {
|
|
56
|
+
color: var(--button-text);
|
|
57
|
+
}
|
|
58
58
|
</style>
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
#sierra-button {
|
|
2
|
-
padding: 0.5rem 1rem;
|
|
3
|
-
border-radius: 4px;
|
|
4
|
-
cursor: pointer;
|
|
5
|
-
transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
|
6
|
-
min-width: 100px;
|
|
7
|
-
display: flex;
|
|
8
|
-
justify-content: space-evenly;
|
|
9
|
-
align-items: center;
|
|
10
|
-
gap: 10px;
|
|
11
|
-
}
|
|
12
|
-
#sierra-button:hover{
|
|
13
|
-
opacity: 0.8;
|
|
14
|
-
}
|
|
15
|
-
#sierra-button i{
|
|
16
|
-
font-size: 0.9rem;
|
|
17
|
-
}
|
|
18
|
-
/*********Button Variants*************************/
|
|
19
|
-
.sierra-button-contained {
|
|
20
|
-
color: var(--button-text);
|
|
21
|
-
}
|
|
22
|
-
.sierra-button-outlined {
|
|
23
|
-
border-width: 1px;
|
|
24
|
-
border-style: solid;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/*********Contained Button Colors*************************/
|
|
28
|
-
.sierra-button-contained-primary {
|
|
29
|
-
background-color: var(--primary-bg);
|
|
30
|
-
}
|
|
31
|
-
.sierra-button-contained-warning {
|
|
32
|
-
background-color: var(--warning-bg);
|
|
33
|
-
}
|
|
34
|
-
.sierra-button-contained-error {
|
|
35
|
-
background-color: var(--error-bg);
|
|
36
|
-
}
|
|
37
|
-
/*********Outlined Button Colors*************************/
|
|
38
|
-
.sierra-button-outlined-primary {
|
|
39
|
-
border-color: var(--primary-bg);
|
|
40
|
-
color: var(--primary-bg);
|
|
41
|
-
}
|
|
42
|
-
.sierra-button-outlined-warning {
|
|
43
|
-
border-color: var(--warning-bg);
|
|
44
|
-
color: var(--warning-bg);
|
|
45
|
-
}
|
|
46
|
-
.sierra-button-outlined-error {
|
|
47
|
-
border-color: var(--error-bg);
|
|
48
|
-
color: var(--error-bg);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/*****Disabled********/
|
|
52
|
-
#sierra-button.disabled {
|
|
53
|
-
opacity: 0.6;
|
|
54
|
-
cursor: not-allowed;
|
|
55
|
-
}
|
|
56
|
-
/****Pill Button******/
|
|
57
|
-
#sierra-button.pill{
|
|
58
|
-
border-radius: 50%;
|
|
59
|
-
min-width: unset;
|
|
60
|
-
}
|
|
1
|
+
#sierra-button {
|
|
2
|
+
padding: 0.5rem 1rem;
|
|
3
|
+
border-radius: 4px;
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
|
6
|
+
min-width: 100px;
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: space-evenly;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: 10px;
|
|
11
|
+
}
|
|
12
|
+
#sierra-button:hover{
|
|
13
|
+
opacity: 0.8;
|
|
14
|
+
}
|
|
15
|
+
#sierra-button i{
|
|
16
|
+
font-size: 0.9rem;
|
|
17
|
+
}
|
|
18
|
+
/*********Button Variants*************************/
|
|
19
|
+
.sierra-button-contained {
|
|
20
|
+
color: var(--button-text);
|
|
21
|
+
}
|
|
22
|
+
.sierra-button-outlined {
|
|
23
|
+
border-width: 1px;
|
|
24
|
+
border-style: solid;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/*********Contained Button Colors*************************/
|
|
28
|
+
.sierra-button-contained-primary {
|
|
29
|
+
background-color: var(--primary-bg);
|
|
30
|
+
}
|
|
31
|
+
.sierra-button-contained-warning {
|
|
32
|
+
background-color: var(--warning-bg);
|
|
33
|
+
}
|
|
34
|
+
.sierra-button-contained-error {
|
|
35
|
+
background-color: var(--error-bg);
|
|
36
|
+
}
|
|
37
|
+
/*********Outlined Button Colors*************************/
|
|
38
|
+
.sierra-button-outlined-primary {
|
|
39
|
+
border-color: var(--primary-bg);
|
|
40
|
+
color: var(--primary-bg);
|
|
41
|
+
}
|
|
42
|
+
.sierra-button-outlined-warning {
|
|
43
|
+
border-color: var(--warning-bg);
|
|
44
|
+
color: var(--warning-bg);
|
|
45
|
+
}
|
|
46
|
+
.sierra-button-outlined-error {
|
|
47
|
+
border-color: var(--error-bg);
|
|
48
|
+
color: var(--error-bg);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/*****Disabled********/
|
|
52
|
+
#sierra-button.disabled {
|
|
53
|
+
opacity: 0.6;
|
|
54
|
+
cursor: not-allowed;
|
|
55
|
+
}
|
|
56
|
+
/****Pill Button******/
|
|
57
|
+
#sierra-button.pill{
|
|
58
|
+
border-radius: 50%;
|
|
59
|
+
min-width: unset;
|
|
60
|
+
}
|
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { CircularProgress, buttonRipple } from '../../../../../index.js';
|
|
3
|
-
|
|
4
|
-
type _variant = 'contained' | 'outlined';
|
|
5
|
-
type _color = 'primary' | 'warning' | 'error';
|
|
6
|
-
type _buttonType = 'button' | 'submit' | 'reset';
|
|
7
|
-
|
|
8
|
-
const {
|
|
9
|
-
variant = 'contained' as _variant,
|
|
10
|
-
color = 'primary' as _color,
|
|
11
|
-
type = 'button' as _buttonType,
|
|
12
|
-
title = '',
|
|
13
|
-
pill = false,
|
|
14
|
-
spinner = 20,
|
|
15
|
-
thickness = 2,
|
|
16
|
-
disabled = false,
|
|
17
|
-
isLoading = false,
|
|
18
|
-
html2canvas_ignore = 'false',
|
|
19
|
-
startIcon = '',
|
|
20
|
-
endIcon = '',
|
|
21
|
-
style = '',
|
|
22
|
-
children = null,
|
|
23
|
-
...rest
|
|
24
|
-
} = $props();
|
|
25
|
-
|
|
26
|
-
const name = 'sierra-button';
|
|
27
|
-
const buttonClasses = $derived(() => {
|
|
28
|
-
let classes = '';
|
|
29
|
-
if (variant) classes += `${name}-${variant}`;
|
|
30
|
-
if (variant === 'contained') {
|
|
31
|
-
classes += ` ${name}-contained-${color}`;
|
|
32
|
-
} else if (variant === 'outlined') {
|
|
33
|
-
classes += ` ${name}-outlined-${color}`;
|
|
34
|
-
}
|
|
35
|
-
if (style) classes += ` ${style}`;
|
|
36
|
-
return classes;
|
|
37
|
-
});
|
|
38
|
-
</script>
|
|
39
|
-
|
|
40
|
-
<style>#sierra-button {
|
|
41
|
-
padding: 0.5rem 1rem;
|
|
42
|
-
border-radius: 4px;
|
|
43
|
-
cursor: pointer;
|
|
44
|
-
transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
|
45
|
-
min-width: 100px;
|
|
46
|
-
display: flex;
|
|
47
|
-
justify-content: space-evenly;
|
|
48
|
-
align-items: center;
|
|
49
|
-
gap: 10px;
|
|
50
|
-
}
|
|
51
|
-
#sierra-button:hover{
|
|
52
|
-
opacity: 0.8;
|
|
53
|
-
}
|
|
54
|
-
#sierra-button i{
|
|
55
|
-
font-size: 0.9rem;
|
|
56
|
-
}
|
|
57
|
-
/*********Button Variants*************************/
|
|
58
|
-
.sierra-button-contained {
|
|
59
|
-
color: var(--button-text);
|
|
60
|
-
}
|
|
61
|
-
.sierra-button-outlined {
|
|
62
|
-
border-width: 1px;
|
|
63
|
-
border-style: solid;
|
|
64
|
-
}
|
|
65
|
-
/*********Contained Button Colors*************************/
|
|
66
|
-
.sierra-button-contained-primary {
|
|
67
|
-
background-color: var(--primary-bg);
|
|
68
|
-
}
|
|
69
|
-
.sierra-button-contained-warning {
|
|
70
|
-
background-color: var(--warning-bg);
|
|
71
|
-
}
|
|
72
|
-
.sierra-button-contained-error {
|
|
73
|
-
background-color: var(--error-bg);
|
|
74
|
-
}
|
|
75
|
-
/*********Outlined Button Colors*************************/
|
|
76
|
-
.sierra-button-outlined-primary {
|
|
77
|
-
border-color: var(--primary-bg);
|
|
78
|
-
color: var(--primary-bg);
|
|
79
|
-
}
|
|
80
|
-
.sierra-button-outlined-warning {
|
|
81
|
-
border-color: var(--warning-bg);
|
|
82
|
-
color: var(--warning-bg);
|
|
83
|
-
}
|
|
84
|
-
.sierra-button-outlined-error {
|
|
85
|
-
border-color: var(--error-bg);
|
|
86
|
-
color: var(--error-bg);
|
|
87
|
-
}
|
|
88
|
-
/*****Disabled********/
|
|
89
|
-
#sierra-button.disabled {
|
|
90
|
-
opacity: 0.6;
|
|
91
|
-
cursor: not-allowed;
|
|
92
|
-
}
|
|
93
|
-
/****Pill Button******/
|
|
94
|
-
#sierra-button.pill{
|
|
95
|
-
border-radius: 50%;
|
|
96
|
-
min-width: unset;
|
|
97
|
-
}
|
|
98
|
-
</style>
|
|
99
|
-
|
|
100
|
-
<button
|
|
101
|
-
id={name}
|
|
102
|
-
{...rest}
|
|
103
|
-
use:buttonRipple
|
|
104
|
-
data-html2canvas-ignore={html2canvas_ignore}
|
|
105
|
-
class:pill={pill}
|
|
106
|
-
class:disabled={isLoading || disabled}
|
|
107
|
-
class={buttonClasses()}
|
|
108
|
-
disabled={isLoading || disabled}
|
|
109
|
-
type={type}
|
|
110
|
-
title={title}
|
|
111
|
-
onclick={(e: MouseEvent) => {
|
|
112
|
-
rest.onclick?.(e);
|
|
113
|
-
}}
|
|
114
|
-
>
|
|
115
|
-
{#if startIcon}
|
|
116
|
-
<i class="fa {startIcon}"></i>
|
|
117
|
-
{/if}
|
|
118
|
-
{@render children?.()}
|
|
119
|
-
{#if endIcon}
|
|
120
|
-
<i class="fa {endIcon}"></i>
|
|
121
|
-
{/if}
|
|
122
|
-
{#if isLoading}
|
|
123
|
-
<CircularProgress size={spinner} thickness={thickness} />
|
|
124
|
-
{/if}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CircularProgress, buttonRipple } from '../../../../../index.js';
|
|
3
|
+
|
|
4
|
+
type _variant = 'contained' | 'outlined';
|
|
5
|
+
type _color = 'primary' | 'warning' | 'error';
|
|
6
|
+
type _buttonType = 'button' | 'submit' | 'reset';
|
|
7
|
+
|
|
8
|
+
const {
|
|
9
|
+
variant = 'contained' as _variant,
|
|
10
|
+
color = 'primary' as _color,
|
|
11
|
+
type = 'button' as _buttonType,
|
|
12
|
+
title = '',
|
|
13
|
+
pill = false,
|
|
14
|
+
spinner = 20,
|
|
15
|
+
thickness = 2,
|
|
16
|
+
disabled = false,
|
|
17
|
+
isLoading = false,
|
|
18
|
+
html2canvas_ignore = 'false',
|
|
19
|
+
startIcon = '',
|
|
20
|
+
endIcon = '',
|
|
21
|
+
style = '',
|
|
22
|
+
children = null,
|
|
23
|
+
...rest
|
|
24
|
+
} = $props();
|
|
25
|
+
|
|
26
|
+
const name = 'sierra-button';
|
|
27
|
+
const buttonClasses = $derived(() => {
|
|
28
|
+
let classes = '';
|
|
29
|
+
if (variant) classes += `${name}-${variant}`;
|
|
30
|
+
if (variant === 'contained') {
|
|
31
|
+
classes += ` ${name}-contained-${color}`;
|
|
32
|
+
} else if (variant === 'outlined') {
|
|
33
|
+
classes += ` ${name}-outlined-${color}`;
|
|
34
|
+
}
|
|
35
|
+
if (style) classes += ` ${style}`;
|
|
36
|
+
return classes;
|
|
37
|
+
});
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<style>#sierra-button {
|
|
41
|
+
padding: 0.5rem 1rem;
|
|
42
|
+
border-radius: 4px;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
|
45
|
+
min-width: 100px;
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: space-evenly;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: 10px;
|
|
50
|
+
}
|
|
51
|
+
#sierra-button:hover{
|
|
52
|
+
opacity: 0.8;
|
|
53
|
+
}
|
|
54
|
+
#sierra-button i{
|
|
55
|
+
font-size: 0.9rem;
|
|
56
|
+
}
|
|
57
|
+
/*********Button Variants*************************/
|
|
58
|
+
.sierra-button-contained {
|
|
59
|
+
color: var(--button-text);
|
|
60
|
+
}
|
|
61
|
+
.sierra-button-outlined {
|
|
62
|
+
border-width: 1px;
|
|
63
|
+
border-style: solid;
|
|
64
|
+
}
|
|
65
|
+
/*********Contained Button Colors*************************/
|
|
66
|
+
.sierra-button-contained-primary {
|
|
67
|
+
background-color: var(--primary-bg);
|
|
68
|
+
}
|
|
69
|
+
.sierra-button-contained-warning {
|
|
70
|
+
background-color: var(--warning-bg);
|
|
71
|
+
}
|
|
72
|
+
.sierra-button-contained-error {
|
|
73
|
+
background-color: var(--error-bg);
|
|
74
|
+
}
|
|
75
|
+
/*********Outlined Button Colors*************************/
|
|
76
|
+
.sierra-button-outlined-primary {
|
|
77
|
+
border-color: var(--primary-bg);
|
|
78
|
+
color: var(--primary-bg);
|
|
79
|
+
}
|
|
80
|
+
.sierra-button-outlined-warning {
|
|
81
|
+
border-color: var(--warning-bg);
|
|
82
|
+
color: var(--warning-bg);
|
|
83
|
+
}
|
|
84
|
+
.sierra-button-outlined-error {
|
|
85
|
+
border-color: var(--error-bg);
|
|
86
|
+
color: var(--error-bg);
|
|
87
|
+
}
|
|
88
|
+
/*****Disabled********/
|
|
89
|
+
#sierra-button.disabled {
|
|
90
|
+
opacity: 0.6;
|
|
91
|
+
cursor: not-allowed;
|
|
92
|
+
}
|
|
93
|
+
/****Pill Button******/
|
|
94
|
+
#sierra-button.pill{
|
|
95
|
+
border-radius: 50%;
|
|
96
|
+
min-width: unset;
|
|
97
|
+
}
|
|
98
|
+
</style>
|
|
99
|
+
|
|
100
|
+
<button
|
|
101
|
+
id={name}
|
|
102
|
+
{...rest}
|
|
103
|
+
use:buttonRipple
|
|
104
|
+
data-html2canvas-ignore={html2canvas_ignore}
|
|
105
|
+
class:pill={pill}
|
|
106
|
+
class:disabled={isLoading || disabled}
|
|
107
|
+
class={buttonClasses()}
|
|
108
|
+
disabled={isLoading || disabled}
|
|
109
|
+
type={type}
|
|
110
|
+
title={title}
|
|
111
|
+
onclick={(e: MouseEvent) => {
|
|
112
|
+
rest.onclick?.(e);
|
|
113
|
+
}}
|
|
114
|
+
>
|
|
115
|
+
{#if startIcon}
|
|
116
|
+
<i class="fa {startIcon}"></i>
|
|
117
|
+
{/if}
|
|
118
|
+
{@render children?.()}
|
|
119
|
+
{#if endIcon}
|
|
120
|
+
<i class="fa {endIcon}"></i>
|
|
121
|
+
{/if}
|
|
122
|
+
{#if isLoading}
|
|
123
|
+
<CircularProgress size={spinner} thickness={thickness} />
|
|
124
|
+
{/if}
|
|
125
125
|
</button>
|