@sierra-95/svelte-scaffold 1.0.1

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.
Files changed (146) hide show
  1. package/README.md +8 -0
  2. package/dist/Hooks/layout_menu.d.ts +1 -0
  3. package/dist/Hooks/layout_menu.js +24 -0
  4. package/dist/Hooks/preview.d.ts +3 -0
  5. package/dist/Hooks/preview.js +24 -0
  6. package/dist/components/Core/Alerts/Backdrop/backdrop.svelte +27 -0
  7. package/dist/components/Core/Alerts/Backdrop/backdrop.svelte.d.ts +15 -0
  8. package/dist/components/Core/Alerts/Modal/modal.svelte +40 -0
  9. package/dist/components/Core/Alerts/Modal/modal.svelte.d.ts +26 -0
  10. package/dist/components/Core/Alerts/Toast/toast.css +39 -0
  11. package/dist/components/Core/Alerts/Toast/toast.svelte +32 -0
  12. package/dist/components/Core/Alerts/Toast/toast.svelte.d.ts +26 -0
  13. package/dist/components/Core/Alerts/Wrapper/wrapper.svelte +19 -0
  14. package/dist/components/Core/Alerts/Wrapper/wrapper.svelte.d.ts +17 -0
  15. package/dist/components/Core/Alerts/site-under-maintenance/site-under-maintenance.svelte +34 -0
  16. package/dist/components/Core/Alerts/site-under-maintenance/site-under-maintenance.svelte.d.ts +11 -0
  17. package/dist/components/Core/Form/Hr/hr.svelte +11 -0
  18. package/dist/components/Core/Form/Hr/hr.svelte.d.ts +21 -0
  19. package/dist/components/Core/Form/Input/FileInput/fileInput.svelte +130 -0
  20. package/dist/components/Core/Form/Input/FileInput/fileInput.svelte.d.ts +6 -0
  21. package/dist/components/Core/Form/Input/FileInput/preview.svelte +38 -0
  22. package/dist/components/Core/Form/Input/FileInput/preview.svelte.d.ts +18 -0
  23. package/dist/components/Core/Form/Input/input/input.svelte +17 -0
  24. package/dist/components/Core/Form/Input/input/input.svelte.d.ts +24 -0
  25. package/dist/components/Core/Form/Input/password/password.svelte +27 -0
  26. package/dist/components/Core/Form/Input/password/password.svelte.d.ts +23 -0
  27. package/dist/components/Core/Menus/DropdownContainer/dropdown.svelte +94 -0
  28. package/dist/components/Core/Menus/DropdownContainer/dropdown.svelte.d.ts +9 -0
  29. package/dist/components/Core/Menus/MenuItem/menuItem.svelte +44 -0
  30. package/dist/components/Core/Menus/MenuItem/menuItem.svelte.d.ts +10 -0
  31. package/dist/components/Core/Menus/UserMenu/profile.svelte +35 -0
  32. package/dist/components/Core/Menus/UserMenu/profile.svelte.d.ts +11 -0
  33. package/dist/components/Core/others/Button/Flip/button.css +51 -0
  34. package/dist/components/Core/others/Button/Flip/button.svelte +69 -0
  35. package/dist/components/Core/others/Button/Flip/button.svelte.d.ts +21 -0
  36. package/dist/components/Core/others/Button/Marquee/button.css +37 -0
  37. package/dist/components/Core/others/Button/Marquee/button.svelte +45 -0
  38. package/dist/components/Core/others/Button/Marquee/button.svelte.d.ts +9 -0
  39. package/dist/components/Core/others/Button/Swipe/button.css +31 -0
  40. package/dist/components/Core/others/Button/Swipe/button.svelte +45 -0
  41. package/dist/components/Core/others/Button/Swipe/button.svelte.d.ts +17 -0
  42. package/dist/components/Core/others/Button/default/button.css +52 -0
  43. package/dist/components/Core/others/Button/default/button.svelte +112 -0
  44. package/dist/components/Core/others/Button/default/button.svelte.d.ts +16 -0
  45. package/dist/components/Core/others/Button/select/select.svelte +29 -0
  46. package/dist/components/Core/others/Button/select/select.svelte.d.ts +3 -0
  47. package/dist/components/Core/others/Button/theme/theme.css +122 -0
  48. package/dist/components/Core/others/Button/theme/theme.svelte +68 -0
  49. package/dist/components/Core/others/Button/theme/theme.svelte.d.ts +19 -0
  50. package/dist/components/Core/others/Button/times/times.svelte +25 -0
  51. package/dist/components/Core/others/Button/times/times.svelte.d.ts +6 -0
  52. package/dist/components/Core/others/Clock/Date/date.svelte +25 -0
  53. package/dist/components/Core/others/Clock/Date/date.svelte.d.ts +20 -0
  54. package/dist/components/Core/others/Clock/Time/time.svelte +35 -0
  55. package/dist/components/Core/others/Clock/Time/time.svelte.d.ts +20 -0
  56. package/dist/components/Core/others/Previews/Audio/audio.svelte +62 -0
  57. package/dist/components/Core/others/Previews/Audio/audio.svelte.d.ts +22 -0
  58. package/dist/components/Core/others/Previews/Document/documents.svelte +25 -0
  59. package/dist/components/Core/others/Previews/Document/documents.svelte.d.ts +22 -0
  60. package/dist/components/Core/others/Previews/Image/image.svelte +27 -0
  61. package/dist/components/Core/others/Previews/Image/image.svelte.d.ts +22 -0
  62. package/dist/components/Core/others/Previews/Video/video.svelte +29 -0
  63. package/dist/components/Core/others/Previews/Video/video.svelte.d.ts +24 -0
  64. package/dist/components/Core/others/Progress/CircularProgress/CircularProgress.svelte +55 -0
  65. package/dist/components/Core/others/Progress/CircularProgress/CircularProgress.svelte.d.ts +15 -0
  66. package/dist/components/Core/others/Progress/LinearProgress/LinearProgress.css +61 -0
  67. package/dist/components/Core/others/Progress/LinearProgress/LinearProgress.svelte +79 -0
  68. package/dist/components/Core/others/Progress/LinearProgress/LinearProgress.svelte.d.ts +26 -0
  69. package/dist/components/Modules/Editor/Hooks/extractContent.d.ts +7 -0
  70. package/dist/components/Modules/Editor/Hooks/extractContent.js +15 -0
  71. package/dist/components/Modules/Editor/Hooks/extractImage.d.ts +7 -0
  72. package/dist/components/Modules/Editor/Hooks/extractImage.js +30 -0
  73. package/dist/components/Modules/Editor/Hooks/insertImage.d.ts +5 -0
  74. package/dist/components/Modules/Editor/Hooks/insertImage.js +27 -0
  75. package/dist/components/Modules/Editor/Hooks/insertYoutube.d.ts +6 -0
  76. package/dist/components/Modules/Editor/Hooks/insertYoutube.js +35 -0
  77. package/dist/components/Modules/Editor/Marks/Links/links.svelte +79 -0
  78. package/dist/components/Modules/Editor/Marks/Links/links.svelte.d.ts +21 -0
  79. package/dist/components/Modules/Editor/Marks/TextFormatting/textFormatting.svelte +32 -0
  80. package/dist/components/Modules/Editor/Marks/TextFormatting/textFormatting.svelte.d.ts +21 -0
  81. package/dist/components/Modules/Editor/Nodes/Headings/heading.svelte +58 -0
  82. package/dist/components/Modules/Editor/Nodes/Headings/heading.svelte.d.ts +21 -0
  83. package/dist/components/Modules/Editor/Nodes/History/history.svelte +21 -0
  84. package/dist/components/Modules/Editor/Nodes/History/history.svelte.d.ts +21 -0
  85. package/dist/components/Modules/Editor/Nodes/Images/images.svelte +85 -0
  86. package/dist/components/Modules/Editor/Nodes/Images/images.svelte.d.ts +21 -0
  87. package/dist/components/Modules/Editor/Nodes/Lists/lists.svelte +30 -0
  88. package/dist/components/Modules/Editor/Nodes/Lists/lists.svelte.d.ts +21 -0
  89. package/dist/components/Modules/Editor/Nodes/TextAlign/textAlign.svelte +55 -0
  90. package/dist/components/Modules/Editor/Nodes/TextAlign/textAlign.svelte.d.ts +21 -0
  91. package/dist/components/Modules/Editor/Nodes/TextColor/styles.css +18 -0
  92. package/dist/components/Modules/Editor/Nodes/TextColor/textColor.svelte +88 -0
  93. package/dist/components/Modules/Editor/Nodes/TextColor/textColor.svelte.d.ts +22 -0
  94. package/dist/components/Modules/Editor/Nodes/Youtube/youtube.svelte +32 -0
  95. package/dist/components/Modules/Editor/Nodes/Youtube/youtube.svelte.d.ts +21 -0
  96. package/dist/components/Modules/Editor/colors.d.ts +2 -0
  97. package/dist/components/Modules/Editor/colors.js +21 -0
  98. package/dist/components/Modules/Editor/controls.svelte +72 -0
  99. package/dist/components/Modules/Editor/controls.svelte.d.ts +24 -0
  100. package/dist/components/Modules/Editor/extensions.d.ts +1 -0
  101. package/dist/components/Modules/Editor/extensions.js +59 -0
  102. package/dist/components/Modules/Editor/main.svelte +42 -0
  103. package/dist/components/Modules/Editor/main.svelte.d.ts +25 -0
  104. package/dist/components/Modules/Editor/save.svelte +28 -0
  105. package/dist/components/Modules/Editor/save.svelte.d.ts +23 -0
  106. package/dist/components/Modules/Editor/styles/controls.css +70 -0
  107. package/dist/components/Modules/Editor/styles/main.css +43 -0
  108. package/dist/components/Modules/Editor/tools.d.ts +14 -0
  109. package/dist/components/Modules/Editor/tools.js +23 -0
  110. package/dist/components/Modules/FilePicker/cloudStore.svelte +96 -0
  111. package/dist/components/Modules/FilePicker/cloudStore.svelte.d.ts +20 -0
  112. package/dist/components/Modules/FilePicker/controls.svelte +122 -0
  113. package/dist/components/Modules/FilePicker/controls.svelte.d.ts +20 -0
  114. package/dist/components/Modules/FilePicker/filePicker.svelte +61 -0
  115. package/dist/components/Modules/FilePicker/filePicker.svelte.d.ts +18 -0
  116. package/dist/components/Modules/FilePicker/previews.svelte +19 -0
  117. package/dist/components/Modules/FilePicker/previews.svelte.d.ts +20 -0
  118. package/dist/components/Modules/Layout/Header/header.css +38 -0
  119. package/dist/components/Modules/Layout/Header/header.svelte +29 -0
  120. package/dist/components/Modules/Layout/Header/header.svelte.d.ts +21 -0
  121. package/dist/components/Modules/Layout/Menu/menu.css +45 -0
  122. package/dist/components/Modules/Layout/Menu/menu.svelte +129 -0
  123. package/dist/components/Modules/Layout/Menu/menu.svelte.d.ts +24 -0
  124. package/dist/components/Modules/Layout/background.svelte +28 -0
  125. package/dist/components/Modules/Layout/background.svelte.d.ts +26 -0
  126. package/dist/components/Modules/Layout/main.css +21 -0
  127. package/dist/components/Modules/Layout/main.svelte +119 -0
  128. package/dist/components/Modules/Layout/main.svelte.d.ts +27 -0
  129. package/dist/global.css +226 -0
  130. package/dist/index.d.ts +40 -0
  131. package/dist/index.js +53 -0
  132. package/dist/stores/core/general.d.ts +3 -0
  133. package/dist/stores/core/general.js +5 -0
  134. package/dist/stores/core/ismobile.d.ts +1 -0
  135. package/dist/stores/core/ismobile.js +14 -0
  136. package/dist/stores/core/modal.d.ts +14 -0
  137. package/dist/stores/core/modal.js +35 -0
  138. package/dist/stores/core/user.d.ts +9 -0
  139. package/dist/stores/core/user.js +14 -0
  140. package/dist/stores/modules/editor.d.ts +9 -0
  141. package/dist/stores/modules/editor.js +14 -0
  142. package/dist/stores/modules/fileInput.d.ts +22 -0
  143. package/dist/stores/modules/fileInput.js +25 -0
  144. package/dist/stores/modules/toast.d.ts +8 -0
  145. package/dist/stores/modules/toast.js +21 -0
  146. package/package.json +75 -0
@@ -0,0 +1,112 @@
1
+ <script lang="ts">
2
+ // @enable runes
3
+ import { CircularProgress } from '../../../../../index.js';
4
+
5
+ type _variant = 'contained' | 'outlined';
6
+ type _color = 'primary' | 'warning' | 'error';
7
+ type _buttonType = 'button' | 'submit' | 'reset';
8
+
9
+ const {
10
+ variant = 'contained' as _variant,
11
+ color = 'primary' as _color,
12
+ type = 'button' as _buttonType,
13
+ title = '',
14
+ pill = false,
15
+ spinner = 20,
16
+ thickness = 2,
17
+ disabled = false,
18
+ isLoading = false,
19
+ html2canvas_ignore = 'false',
20
+ style = '',
21
+ children = null,
22
+ ...rest
23
+ } = $props();
24
+
25
+ const buttonClasses = $derived(() => {
26
+ let classes = 'base-btn';
27
+
28
+ if (variant) classes += ` btn-${variant}`;
29
+
30
+ if (variant === 'contained') {
31
+ classes += ` btn-contained-${color}`;
32
+ } else if (variant === 'outlined') {
33
+ classes += ` btn-outlined-${color}`;
34
+ }
35
+
36
+ if (style) classes += ` ${style}`;
37
+
38
+ return classes;
39
+ });
40
+ </script>
41
+
42
+ <style>.base-btn {
43
+ color: var(--button-text);
44
+ padding: 0.5rem 1rem;
45
+ border-radius: 4px;
46
+ cursor: pointer;
47
+ transition: all 0.3s ease-in-out;
48
+ min-width: 100px;
49
+ display: flex;
50
+ justify-content: space-evenly;
51
+ align-items: center;
52
+ gap: 10px;
53
+ }
54
+ .base-btn:hover{
55
+ opacity: 0.8;
56
+ }
57
+ /*********Button Variants*************************/
58
+ .btn-outlined {
59
+ border-width: 1px;
60
+ border-style: solid;
61
+ }
62
+ .btn-contained-primary {
63
+ background-color: var(--primary-bg);
64
+ }
65
+ .btn-contained-warning {
66
+ background-color: var(--warning-bg);
67
+ }
68
+ .btn-contained-error {
69
+ background-color: var(--error-bg);
70
+ }
71
+ .btn-outlined-primary {
72
+ border-color: var(--primary-bg);
73
+ color: var(--primary-bg);
74
+ }
75
+ .btn-outlined-warning {
76
+ border-color: var(--warning-bg);
77
+ color: var(--warning-bg);
78
+ }
79
+ .btn-outlined-error {
80
+ border-color: var(--error-bg);
81
+ color: var(--error-bg);
82
+ }
83
+ /*****Disabled********/
84
+ .base-btn.disabled {
85
+ opacity: 0.6;
86
+ cursor: not-allowed;
87
+ }
88
+ /****Pill Button******/
89
+ .base-btn.pill{
90
+ border-radius: 50%;
91
+ min-width: unset;
92
+ }
93
+ </style>
94
+
95
+ <button
96
+ {...rest}
97
+ data-html2canvas-ignore={html2canvas_ignore}
98
+ class:pill={pill}
99
+ class:disabled={isLoading || disabled}
100
+ class={buttonClasses()}
101
+ disabled={isLoading || disabled}
102
+ type={type}
103
+ title={title}
104
+ onclick={(e: MouseEvent) => {
105
+ rest.onclick?.(e);
106
+ }}
107
+ >
108
+ {@render children?.()}
109
+ {#if isLoading}
110
+ <CircularProgress size={spinner} thickness={thickness} />
111
+ {/if}
112
+ </button>
@@ -0,0 +1,16 @@
1
+ declare const Button: import("svelte").Component<{
2
+ variant?: "contained" | "outlined";
3
+ color?: "primary" | "warning" | "error";
4
+ type?: "button" | "submit" | "reset";
5
+ title?: string;
6
+ pill?: boolean;
7
+ spinner?: number;
8
+ thickness?: number;
9
+ disabled?: boolean;
10
+ isLoading?: boolean;
11
+ html2canvas_ignore?: string;
12
+ style?: string;
13
+ children?: any;
14
+ } & Record<string, any>, {}, "">;
15
+ type Button = ReturnType<typeof Button>;
16
+ export default Button;
@@ -0,0 +1,29 @@
1
+ <script lang="ts">
2
+ const {
3
+ ...rest
4
+ } = $props();
5
+ </script>
6
+ <style>
7
+ #sierra-button-select{
8
+ position: absolute;
9
+ top: 6px;
10
+ right: 6px;
11
+ width: 22px;
12
+ height: 22px;
13
+ border-radius: 50%;
14
+ background: var(--primary-bg);
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ z-index: 2;
19
+ }
20
+ </style>
21
+ <button
22
+ aria-label="Selected"
23
+ id="sierra-button-select"
24
+ {...rest}
25
+ onclick={(e: MouseEvent) => {
26
+ rest.onclick?.(e);
27
+ }}
28
+ ><i class="fa fa-check" style="color: white; font-size: 12px;"></i>
29
+ </button>
@@ -0,0 +1,3 @@
1
+ declare const Select: import("svelte").Component<Record<string, any>, {}, "">;
2
+ type Select = ReturnType<typeof Select>;
3
+ export default Select;
@@ -0,0 +1,122 @@
1
+ #sierra-theme-toggle {
2
+ --hue: 223;
3
+ --trans-dur: 0.6s;
4
+ --trans-timing: cubic-bezier(0.65,0,0.35,1);
5
+ font-size: calc(60px + (120 - 60) * (100vw - 320px) / (2560 - 320));
6
+ }
7
+ #sierra-theme-toggle * {
8
+ border: 0;
9
+ box-sizing: border-box;
10
+ margin: 0;
11
+ padding: 0;
12
+ }
13
+ #sierra-theme-toggle,
14
+ #sierra-theme-toggle .switch__input {
15
+ display: block;
16
+ -webkit-tap-highlight-color: transparent;
17
+ }
18
+ #sierra-theme-toggle {
19
+ font-size: 25px;
20
+ margin: auto;
21
+ position: relative;
22
+ -webkit-user-select: none;
23
+ -moz-user-select: none;
24
+ user-select: none;
25
+ cursor: pointer;
26
+ width: 68.75px;
27
+ overflow: hidden;
28
+ border-radius: 0.8em;
29
+ box-shadow: var(--box-shadow);
30
+ }
31
+ #sierra-theme-toggle .switch__icon {
32
+ color: hsla(var(--hue),10%,80%);
33
+ position: absolute;
34
+ top: 0.375em;
35
+ left: 0.375em;
36
+ width: 0.75em;
37
+ height: 0.75em;
38
+ transition:
39
+ color var(--trans-dur),
40
+ transform var(--trans-dur) var(--trans-timing);
41
+ }
42
+ #sierra-theme-toggle .switch__icon:nth-of-type(2) {
43
+ right: 0.375em;
44
+ left: auto;
45
+ }
46
+ #sierra-theme-toggle .switch__inner,
47
+ #sierra-theme-toggle .switch__inner-icons {
48
+ border-radius: 0.5em;
49
+ display: block;
50
+ overflow: hidden;
51
+ position: absolute;
52
+ top: 0.25em;
53
+ left: 0.25em;
54
+ width: 2.25em;
55
+ height: 1em;
56
+ }
57
+ #sierra-theme-toggle .switch__inner:before,
58
+ #sierra-theme-toggle .switch__inner-icons {
59
+ transition: transform var(--trans-dur) var(--trans-timing);
60
+ transform: translateX(-1.25em);
61
+ }
62
+ #sierra-theme-toggle .switch__inner:before {
63
+ background-color: var(--primary-bg);
64
+ border-radius: inherit;
65
+ content: "";
66
+ display: block;
67
+ width: 100%;
68
+ height: 100%;
69
+ }
70
+ #sierra-theme-toggle .switch__inner-icons {
71
+ pointer-events: none;
72
+ }
73
+ #sierra-theme-toggle .switch__inner-icons .switch__icon {
74
+ color: hsl(0,0%,100%);
75
+ top: 0.125em;
76
+ left: 0.125em;
77
+ transform: translateX(1.25em);
78
+ }
79
+ #sierra-theme-toggle .switch__inner-icons .switch__icon:nth-child(2) {
80
+ right: 0.125em;
81
+ left: auto;
82
+ }
83
+ #sierra-theme-toggle .switch__input {
84
+ background-color: hsl(0,0%,100%);
85
+ border-radius: 0.75em;
86
+ box-shadow:
87
+ 0 0 0 0.0625em hsla(var(--hue),90%,50%,0),
88
+ 0 0.125em 0.5em hsla(var(--hue),10%,10%,0.1);
89
+ outline: transparent;
90
+ width: 2.75em;
91
+ height: 1.5em;
92
+ -webkit-appearance: none;
93
+ appearance: none;
94
+ transition:
95
+ background-color var(--trans-dur),
96
+ box-shadow var(--trans-dur);
97
+ }
98
+ #sierra-theme-toggle .switch__input:checked {
99
+ background-color: hsl(var(--hue),10%,10%);
100
+ }
101
+ #sierra-theme-toggle .switch__input:checked ~ .switch__icon {
102
+ color: hsla(var(--hue),10%,40%);
103
+ }
104
+ #sierra-theme-toggle .switch__input:checked ~ .switch__inner:before,
105
+ #sierra-theme-toggle .switch__input:checked ~ .switch__inner-icons {
106
+ transform: translateX(1.25em);
107
+ }
108
+ #sierra-theme-toggle .switch__input:not(:checked) ~ .switch__icon:first-of-type,
109
+ #sierra-theme-toggle .switch__input:checked ~ .switch__icon:nth-of-type(2) {
110
+ transform: rotate(360deg);
111
+ }
112
+ #sierra-theme-toggle .switch__input:checked ~ .switch__inner-icons .switch__icon:first-of-type {
113
+ transform: translateX(-1.25em) rotate(-360deg);
114
+ }
115
+ #sierra-theme-toggle .switch__input:checked ~ .switch__inner-icons .switch__icon:nth-of-type(2) {
116
+ transform: translateX(-1.25em) rotate(360deg);
117
+ }
118
+ #sierra-theme-toggle .switch__input:focus-visible {
119
+ box-shadow:
120
+ 0 0 0 0.0625em hsla(var(--hue),90%,50%,1),
121
+ 0 0.125em 0.5em hsla(var(--hue),10%,10%,0.1);
122
+ }
@@ -0,0 +1,68 @@
1
+ <script lang="ts">
2
+ import './theme.css';
3
+ import { onMount } from 'svelte';
4
+ import {theme} from '../../../../../index.js';
5
+
6
+ let isDark = false;
7
+
8
+ onMount(() => {
9
+ const unsubscribe = theme.subscribe(value => {
10
+ isDark = value === 'dark';
11
+ });
12
+ return () => unsubscribe();
13
+ });
14
+
15
+ function toggleTheme(e: Event) {
16
+ const target = e.target as HTMLInputElement;
17
+ isDark = target.checked;
18
+ theme.set(isDark ? 'dark' : 'light');
19
+ }
20
+ </script>
21
+
22
+ <main>
23
+ <svg style="display: none;">
24
+ <symbol id="light" viewBox="0 0 24 24">
25
+ <g stroke="currentColor" stroke-width="2" stroke-linecap="round">
26
+ <line x1="12" y1="17" x2="12" y2="20" transform="rotate(0,12,12)" />
27
+ <line x1="12" y1="17" x2="12" y2="20" transform="rotate(45,12,12)" />
28
+ <line x1="12" y1="17" x2="12" y2="20" transform="rotate(90,12,12)" />
29
+ <line x1="12" y1="17" x2="12" y2="20" transform="rotate(135,12,12)" />
30
+ <line x1="12" y1="17" x2="12" y2="20" transform="rotate(180,12,12)" />
31
+ <line x1="12" y1="17" x2="12" y2="20" transform="rotate(225,12,12)" />
32
+ <line x1="12" y1="17" x2="12" y2="20" transform="rotate(270,12,12)" />
33
+ <line x1="12" y1="17" x2="12" y2="20" transform="rotate(315,12,12)" />
34
+ </g>
35
+ <circle fill="currentColor" cx="12" cy="12" r="5" />
36
+ </symbol>
37
+ <symbol id="dark" viewBox="0 0 24 24">
38
+ <path fill="currentColor" d="M15.1,14.9c-3-0.5-5.5-3-6-6C8.8,7.1,9.1,5.4,9.9,4c0.4-0.8-0.4-1.7-1.2-1.4C4.6,4,1.8,7.9,2,12.5c0.2,5.1,4.4,9.3,9.5,9.5c4.5,0.2,8.5-2.6,9.9-6.6c0.3-0.8-0.6-1.7-1.4-1.2C18.6,14.9,16.9,15.2,15.1,14.9z" />
39
+ </symbol>
40
+ </svg>
41
+ <label id="sierra-theme-toggle">
42
+ <input
43
+ hidden
44
+ class="switch__input"
45
+ type="checkbox"
46
+ role="switch"
47
+ name="dark"
48
+ bind:checked={isDark}
49
+ on:change={toggleTheme}
50
+ />
51
+ <button aria-label="button"></button>
52
+ <svg class="switch__icon" width="24px" height="24px" aria-hidden="true">
53
+ <use href="#light" />
54
+ </svg>
55
+ <svg class="switch__icon" width="24px" height="24px" aria-hidden="true">
56
+ <use href="#dark" />
57
+ </svg>
58
+ <span class="switch__inner"></span>
59
+ <span class="switch__inner-icons">
60
+ <svg class="switch__icon" width="24px" height="24px" aria-hidden="true">
61
+ <use href="#light" />
62
+ </svg>
63
+ <svg class="switch__icon" width="24px" height="24px" aria-hidden="true">
64
+ <use href="#dark" />
65
+ </svg>
66
+ </span>
67
+ </label>
68
+ </main>
@@ -0,0 +1,19 @@
1
+ import './theme.css';
2
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
+ $$bindings?: Bindings;
5
+ } & Exports;
6
+ (internal: unknown, props: {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports & {
10
+ $set?: any;
11
+ $on?: any;
12
+ };
13
+ z_$$bindings?: Bindings;
14
+ }
15
+ declare const Theme: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type Theme = InstanceType<typeof Theme>;
19
+ export default Theme;
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ const {
3
+ vertical = 'top',
4
+ horizontal = 'right',
5
+ ...rest
6
+ } = $props();
7
+ </script>
8
+ <style>
9
+ .sierra-times-top{
10
+ transform: translate(50%, -50%);
11
+ }
12
+ .sierra-times-bottom{
13
+ transform: translate(50%, 50%);
14
+ }
15
+ </style>
16
+ <button
17
+ {...rest}
18
+ onclick={(e: MouseEvent) => {
19
+ rest.onclick?.(e);
20
+ }}
21
+ style="position: absolute; {vertical}: 0; {horizontal}: 0;"
22
+ aria-label="Times Button"
23
+ class={vertical === 'top' ? 'sierra-times-top' : 'sierra-times-bottom'}
24
+ ><i class="fa fa-times-circle"></i>
25
+ </button>
@@ -0,0 +1,6 @@
1
+ declare const Times: import("svelte").Component<{
2
+ vertical?: string;
3
+ horizontal?: string;
4
+ } & Record<string, any>, {}, "">;
5
+ type Times = ReturnType<typeof Times>;
6
+ export default Times;
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ import { onMount } from "svelte";
3
+
4
+ export let timezone: string = "Africa/Nairobi";
5
+
6
+ let time = new Date();
7
+ let interval: ReturnType<typeof setInterval>;
8
+
9
+ onMount(() => {
10
+ interval = setInterval(() => {
11
+ time = new Date();
12
+ }, 1000);
13
+
14
+ return () => clearInterval(interval);
15
+ });
16
+
17
+ $: dateString = new Intl.DateTimeFormat("en-GB", {
18
+ weekday: "long",
19
+ day: "numeric",
20
+ month: "long",
21
+ timeZone: timezone
22
+ }).format(time);
23
+ </script>
24
+
25
+ <div>{dateString}</div>
@@ -0,0 +1,20 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const Date: $$__sveltets_2_IsomorphicComponent<{
15
+ timezone?: string;
16
+ }, {
17
+ [evt: string]: CustomEvent<any>;
18
+ }, {}, {}, string>;
19
+ type Date = InstanceType<typeof Date>;
20
+ export default Date;
@@ -0,0 +1,35 @@
1
+ <script lang="ts">
2
+ import { onMount } from 'svelte';
3
+
4
+ export let timezone: string = 'Africa/Nairobi';
5
+
6
+ let time = new Date();
7
+ let interval: ReturnType<typeof setInterval>;
8
+
9
+ onMount(() => {
10
+ interval = setInterval(() => {
11
+ time = new Date();
12
+ }, 1000);
13
+
14
+ return () => clearInterval(interval);
15
+ });
16
+
17
+ $: timeString = new Intl.DateTimeFormat('en-GB', {
18
+ timeStyle: 'medium',
19
+ timeZone: timezone
20
+ }).format(time);
21
+
22
+ $: ampm = new Intl.DateTimeFormat('en-GB', {
23
+ hour12: true,
24
+ hour: 'numeric',
25
+ timeZone: timezone
26
+ }).format(time).split(' ')[1];
27
+
28
+ $: city = timezone.split('/')[1]?.replace('_', ' ') || '';
29
+ </script>
30
+
31
+ <div style="display: flex; align-items:last baseline; gap: 0.2rem;">
32
+ {timeString}
33
+ <span class="time">{ampm}</span>
34
+ <span class="time">{city}</span>
35
+ </div>
@@ -0,0 +1,20 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const Time: $$__sveltets_2_IsomorphicComponent<{
15
+ timezone?: string;
16
+ }, {
17
+ [evt: string]: CustomEvent<any>;
18
+ }, {}, {}, string>;
19
+ type Time = InstanceType<typeof Time>;
20
+ export default Time;
@@ -0,0 +1,62 @@
1
+ <script lang="ts">
2
+ import {setToastMessage,ButtonTimes, fileInputStore, ButtonSelect, removeFileForMedia, toggleSelectForMedia} from '../../../../../index.js'
3
+ export let media;
4
+ export let buttonTimes = false;
5
+ export let urlsOnly = true;
6
+
7
+ let audioPlaying: Record<string, boolean> = {};
8
+ let audioRefs: Record<string, HTMLAudioElement> = {};
9
+ function togglePlay(id: string) {
10
+ if(!urlsOnly){
11
+ setToastMessage('warning', 'Audio preview is disabled for local files.');
12
+ return;
13
+ }
14
+ const audio = audioRefs[id];
15
+ if (!audio) return;
16
+
17
+ if (audio.paused) {
18
+ // Pause any other playing audio
19
+ for (const key in audioRefs) {
20
+ if (key !== id && !audioRefs[key].paused) {
21
+ audioRefs[key].pause();
22
+ audioPlaying[key] = false;
23
+ }
24
+ }
25
+ audio.play();
26
+ audioPlaying[id] = true;
27
+ } else {
28
+ audio.pause();
29
+ audioPlaying[id] = false;
30
+ }
31
+ }
32
+ function getPreviewUrl(file: File) {
33
+ return URL.createObjectURL(file);
34
+ }
35
+ function uuid() {
36
+ return crypto.randomUUID();
37
+ }
38
+ </script>
39
+
40
+ {#if media.Audio.length === 0}
41
+ <p>No audio files available.</p>
42
+ {:else}
43
+ <div style="display: flex; flex-wrap:wrap; gap: 1rem">
44
+ {#each media.Audio as item (item.id || uuid())}
45
+ <div on:click={() => toggleSelectForMedia(item.id,item.url,urlsOnly)} role="none" class="sierra-translate" style="position: relative; width: 200px;display: flex; gap: 0.5rem; padding: 0.5rem; box-shadow: var(--box-shadow-secondary); border-radius: 0.3rem; cursor: pointer;">
46
+ <button aria-label="Play or pause audio" on:click|stopPropagation={() => togglePlay(item.id)}>
47
+ <i class="fa {audioPlaying[item.id] ? 'fa-pause' : 'fa-play'}" aria-hidden="true"></i>
48
+ </button>
49
+ <audio hidden bind:this={audioRefs[item.id]} src={urlsOnly ? item.url : getPreviewUrl(item)} controls></audio>
50
+ <h3 style=" margin-left:0.2rem" class="sierra-text-ellipsis">{item.original_name || item.name}</h3>
51
+ {#if buttonTimes}
52
+ <ButtonTimes vertical="bottom" onclick={(e: Event) => removeFileForMedia(
53
+ $fileInputStore.selectedFiles.indexOf(item), e
54
+ )}/>
55
+ {/if}
56
+ {#if $fileInputStore.submissions.some(sub => sub.url === item.url || sub.id === item.id)}
57
+ <ButtonSelect />
58
+ {/if}
59
+ </div>
60
+ {/each}
61
+ </div>
62
+ {/if}
@@ -0,0 +1,22 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const Audio: $$__sveltets_2_IsomorphicComponent<{
15
+ media: any;
16
+ buttonTimes?: boolean;
17
+ urlsOnly?: boolean;
18
+ }, {
19
+ [evt: string]: CustomEvent<any>;
20
+ }, {}, {}, string>;
21
+ type Audio = InstanceType<typeof Audio>;
22
+ export default Audio;
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ import {ButtonTimes,ButtonSelect, fileInputStore, removeFileForMedia, toggleSelectForMedia} from '../../../../../index.js'
3
+ export let media;
4
+ export let buttonTimes = false;
5
+ export let urlsOnly = true;
6
+ </script>
7
+ {#if media.Documents.length === 0}
8
+ <p>No documents available.</p>
9
+ {:else}
10
+ <div style="display: flex; flex-wrap: wrap; gap: 1rem;">
11
+ {#each media.Documents as item}
12
+ <div on:click={() => toggleSelectForMedia(item.id,item.url,urlsOnly)} role="none" class="sierra-translate" style="position: relative; width: 200px; padding: 0.5rem; box-shadow: var(--box-shadow-secondary); cursor: pointer;">
13
+ {#if buttonTimes}
14
+ <ButtonTimes vertical="bottom" onclick={(e: Event) => removeFileForMedia(
15
+ $fileInputStore.selectedFiles.indexOf(item), e
16
+ )}/>
17
+ {/if}
18
+ {#if $fileInputStore.submissions.some(sub => sub.url === item.url || sub.id === item.id)}
19
+ <ButtonSelect />
20
+ {/if}
21
+ <h3 class="sierra-text-ellipsis">{item.original_name || item.name}</h3>
22
+ </div>
23
+ {/each}
24
+ </div>
25
+ {/if}
@@ -0,0 +1,22 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const Documents: $$__sveltets_2_IsomorphicComponent<{
15
+ media: any;
16
+ buttonTimes?: boolean;
17
+ urlsOnly?: boolean;
18
+ }, {
19
+ [evt: string]: CustomEvent<any>;
20
+ }, {}, {}, string>;
21
+ type Documents = InstanceType<typeof Documents>;
22
+ export default Documents;
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ import {ButtonTimes, fileInputStore, ButtonSelect, getPreviewUrlForMedia, toggleSelectForMedia, removeFileForMedia} from '../../../../../index.js'
3
+ export let media;
4
+ export let buttonTimes = false;
5
+ export let urlsOnly = true;
6
+ </script>
7
+
8
+ {#if media.Images.length === 0}
9
+ <p>No images available.</p>
10
+ {:else}
11
+ <div style="display: flex; flex-wrap: wrap; gap: 1rem;">
12
+ {#each media.Images as item}
13
+ <div on:click={() => toggleSelectForMedia(item.id,item.url,urlsOnly)} role="none" class="sierra-translate" style="position:relative; box-shadow: var(--box-shadow-secondary);width: 150px;border-radius: 0.3rem;cursor: pointer;">
14
+ <img src={urlsOnly ? item.url : getPreviewUrlForMedia(item)} alt={item} style="width: 100%; height: 100px; object-fit: cover;border-top-left-radius: 0.3rem; border-top-right-radius: 0.3rem;" />
15
+ <h3 style="margin: 0.5rem" class="sierra-text-ellipsis">{item.original_name || item.name}</h3>
16
+ {#if buttonTimes}
17
+ <ButtonTimes vertical="bottom" onclick={(e: Event) => removeFileForMedia(
18
+ $fileInputStore.selectedFiles.indexOf(item), e
19
+ )}/>
20
+ {/if}
21
+ {#if $fileInputStore.submissions.some(sub => sub.url === item.url || sub.id === item.id)}
22
+ <ButtonSelect />
23
+ {/if}
24
+ </div>
25
+ {/each}
26
+ </div>
27
+ {/if}