@sierra-95/svelte-scaffold 1.0.75 → 1.0.77

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.
@@ -0,0 +1,33 @@
1
+ <script lang="ts">
2
+ let {
3
+ id = '',
4
+ label = '',
5
+ rows = 4,
6
+ value = $bindable(""),
7
+ placeholder = '',
8
+ borderSize = '1px',
9
+ borderColor = 'var(--input-border)',
10
+ borderRadius = '4px',
11
+ background = 'transparent',
12
+ width = '100%',
13
+ maxWidth = '',
14
+ textColor = 'inherit',
15
+ ...rest
16
+ } = $props();
17
+ </script>
18
+
19
+ <label class="sierra-input" style="width: {width}; max-width: {maxWidth}; color: {textColor}" for={id}>{label}
20
+ <textarea
21
+ {...rest}
22
+ id={id}
23
+ name={id}
24
+ rows={rows}
25
+ bind:value={value}
26
+ placeholder={placeholder}
27
+ required={rest.required}
28
+ readonly={rest.readonly}
29
+ style="background-color: {background}; border: {borderSize} solid {borderColor}; border-radius: {borderRadius};"
30
+ onclick={(e: MouseEvent) => {
31
+ rest.onclick?.(e);
32
+ }}></textarea>
33
+ </label>
@@ -0,0 +1,16 @@
1
+ declare const Textarea: import("svelte").Component<{
2
+ id?: string;
3
+ label?: string;
4
+ rows?: number;
5
+ value?: string;
6
+ placeholder?: string;
7
+ borderSize?: string;
8
+ borderColor?: string;
9
+ borderRadius?: string;
10
+ background?: string;
11
+ width?: string;
12
+ maxWidth?: string;
13
+ textColor?: string;
14
+ } & Record<string, any>, {}, "value">;
15
+ type Textarea = ReturnType<typeof Textarea>;
16
+ export default Textarea;
@@ -14,7 +14,6 @@
14
14
  maxWidth = '',
15
15
  textColor = 'inherit',
16
16
  autocomplete = undefined as _autocomplete,
17
- required = false,
18
17
  ...rest
19
18
  } = $props();
20
19
  </script>
@@ -27,7 +26,8 @@
27
26
  bind:value={value}
28
27
  placeholder={placeholder}
29
28
  autocomplete={autocomplete ?? undefined}
30
- required={required}
29
+ required={rest.required}
30
+ readonly={rest.readonly}
31
31
  class="{underline? 'underline-input':''}"
32
32
  style="background-color: {background}; border: {borderSize} solid {borderColor};"
33
33
  onclick={(e: MouseEvent) => {
@@ -12,7 +12,6 @@ declare const Input: import("svelte").Component<{
12
12
  maxWidth?: string;
13
13
  textColor?: string;
14
14
  autocomplete?: AutoFill | null | undefined;
15
- required?: boolean;
16
15
  } & Record<string, any>, {}, "value">;
17
16
  type Input = ReturnType<typeof Input>;
18
17
  export default Input;
@@ -0,0 +1,75 @@
1
+ <script>
2
+ const {
3
+ url = '',
4
+ borderSize = '1px',
5
+ borderColor = 'black',
6
+ avatarSize = '50px',
7
+ iconSize = '24px',
8
+ iconColor = '#999999',
9
+ boxShadow = 'var(--box-shadow)',
10
+ icon="fa-solid fa-user",
11
+ zIndex = 0,
12
+ backgroundColor = 'white',
13
+ foregroundAlpha = 'rgba(0, 0, 0, 0.5)',
14
+ upload = false,
15
+ onClick = () => {}
16
+ } =$props();
17
+
18
+ function handleClick(){
19
+ if(!upload) return;
20
+ onClick();
21
+ }
22
+
23
+ </script>
24
+ <style>
25
+ #sierra-avatar{
26
+ position: relative;
27
+ border-radius: 50%;
28
+ }
29
+ #sierra-avatar div{
30
+ width: 100%;
31
+ height: 100%;
32
+ border-radius: 50%;
33
+ display: flex;
34
+ justify-content: center;
35
+ align-items: center;
36
+ position: absolute;
37
+ }
38
+ #sierra-avatar img{
39
+ position: absolute;
40
+ top: 0;
41
+ left: 0;
42
+ width: 100%;
43
+ height: 100%;
44
+ border-radius: 50%;
45
+ object-fit: cover;
46
+ }
47
+ #sierra-avatar i{
48
+ transition: transform 0.2s ease;
49
+ }
50
+ #sierra-avatar i:hover{
51
+ transform: translateY(-3px);
52
+ }
53
+ </style>
54
+ <main id="sierra-avatar" style="
55
+ border: {borderSize}
56
+ solid {borderColor};
57
+ width: {avatarSize};
58
+ height: {avatarSize};
59
+ background-color: {backgroundColor};
60
+ box-shadow: {boxShadow};
61
+ ">
62
+ <div style="z-index: {zIndex}; {url ? `background-color: ${foregroundAlpha};` : ''}">
63
+ <i
64
+ role="none"
65
+ style="
66
+ font-size: {iconSize};
67
+ color: {iconColor};
68
+ cursor: pointer;
69
+ "
70
+ class="{icon}"
71
+ onclick={handleClick}
72
+ ></i>
73
+ </div>
74
+ <img hidden={!url} src={url} alt="avatar"/>
75
+ </main>
@@ -0,0 +1,35 @@
1
+ export default Avatar;
2
+ type Avatar = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<$$ComponentProps>): void;
5
+ };
6
+ declare const Avatar: import("svelte").Component<{
7
+ url?: string;
8
+ borderSize?: string;
9
+ borderColor?: string;
10
+ avatarSize?: string;
11
+ iconSize?: string;
12
+ iconColor?: string;
13
+ boxShadow?: string;
14
+ icon?: string;
15
+ zIndex?: number;
16
+ backgroundColor?: string;
17
+ foregroundAlpha?: string;
18
+ upload?: boolean;
19
+ onClick?: Function;
20
+ }, {}, "">;
21
+ type $$ComponentProps = {
22
+ url?: string;
23
+ borderSize?: string;
24
+ borderColor?: string;
25
+ avatarSize?: string;
26
+ iconSize?: string;
27
+ iconColor?: string;
28
+ boxShadow?: string;
29
+ icon?: string;
30
+ zIndex?: number;
31
+ backgroundColor?: string;
32
+ foregroundAlpha?: string;
33
+ upload?: boolean;
34
+ onClick?: Function;
35
+ };
@@ -13,7 +13,12 @@
13
13
  <img style="--header-image-size : {$layoutStore.headerImageSize}" src={$layoutStore.headerImage} alt="Logo"/>
14
14
  {/if}
15
15
  {#if $layoutStore.headerTitle}
16
- <h2>{$layoutStore.headerTitle}</h2>
16
+ <h2
17
+ style="
18
+ color: {$layoutStore.headerTitleColor};
19
+ font-family: {$layoutStore.headerTitleFont};
20
+ font-size: {$layoutStore.headerTitleFontSize};
21
+ ">{$layoutStore.headerTitle}</h2>
17
22
  {/if}
18
23
  </a>
19
24
  </div>
@@ -21,7 +21,7 @@
21
21
  if (item.children) {
22
22
  return pathname === item.path || pathname.startsWith(item.path + '/');
23
23
  }
24
- return pathname === item.path;
24
+ return pathname === item.path || pathname.startsWith(item.path + '/');
25
25
  }
26
26
 
27
27
  let openSubsections = new Set();
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export { default as PasswordInput } from './Core/components/Form/Input/password/
15
15
  export { default as Select } from './Core/components/Form/Input/select/select.svelte';
16
16
  export { default as FileInput } from './Core/components/Form/Input/FileInput/fileInput.svelte';
17
17
  export { default as SearchBar } from './Core/components/Form/Input/SearchBar/search.svelte';
18
+ export { default as TextArea } from './Core/components/Form/Input/TextArea/textarea.svelte';
18
19
  export { default as PreviewAudio } from './Core/components/others/Previews/Audio/audio.svelte';
19
20
  export { default as PreviewImage } from './Core/components/others/Previews/Image/image.svelte';
20
21
  export { default as PreviewVideo } from './Core/components/others/Previews/Video/video.svelte';
@@ -36,6 +37,7 @@ export { default as HrSplit } from './Core/components/others/Hr/HrSplit/hrsplit.
36
37
  export { default as Checkbox } from './Core/components/Form/Checkbox/checkbox.svelte';
37
38
  export { default as Form } from './Core/components/Form/Form/form.svelte';
38
39
  export { default as Carousel } from './Core/components/others/Carousel/carousel.svelte';
40
+ export { default as Avatar } from './Core/components/others/Avatar/avatar.svelte';
39
41
  export { default as GlobalSearch } from './Core/features/GlobalSearch/main.svelte';
40
42
  export { default as Editor } from './Modules/Editor/main.svelte';
41
43
  export { default as Layout } from './Modules/Layout/main.svelte';
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ export { default as PasswordInput } from './Core/components/Form/Input/password/
19
19
  export { default as Select } from './Core/components/Form/Input/select/select.svelte';
20
20
  export { default as FileInput } from './Core/components/Form/Input/FileInput/fileInput.svelte';
21
21
  export { default as SearchBar } from './Core/components/Form/Input/SearchBar/search.svelte';
22
+ export { default as TextArea } from './Core/components/Form/Input/TextArea/textarea.svelte';
22
23
  //Previews
23
24
  export { default as PreviewAudio } from './Core/components/others/Previews/Audio/audio.svelte';
24
25
  export { default as PreviewImage } from './Core/components/others/Previews/Image/image.svelte';
@@ -44,6 +45,7 @@ export { default as HrSplit } from './Core/components/others/Hr/HrSplit/hrsplit.
44
45
  export { default as Checkbox } from './Core/components/Form/Checkbox/checkbox.svelte';
45
46
  export { default as Form } from './Core/components/Form/Form/form.svelte';
46
47
  export { default as Carousel } from './Core/components/others/Carousel/carousel.svelte';
48
+ export { default as Avatar } from './Core/components/others/Avatar/avatar.svelte';
47
49
  //####################Features##################################
48
50
  export { default as GlobalSearch } from './Core/features/GlobalSearch/main.svelte';
49
51
  //####################MODULES COMPONENTS########################
@@ -16,6 +16,9 @@ export type Section = {
16
16
  };
17
17
  export type LayoutState = {
18
18
  headerTitle: string;
19
+ headerTitleColor?: string;
20
+ headerTitleFont?: string;
21
+ headerTitleFontSize?: string;
19
22
  headerLink: string;
20
23
  headerImage: string;
21
24
  headerImageSize: string;
@@ -1,6 +1,9 @@
1
1
  import { writable } from 'svelte/store';
2
2
  const defaultLayoutState = {
3
3
  headerTitle: '',
4
+ headerTitleColor: 'inherit',
5
+ headerTitleFont: 'inherit',
6
+ headerTitleFontSize: 'inherit',
4
7
  headerLink: '',
5
8
  headerImage: '',
6
9
  headerImageSize: '30px',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sierra-95/svelte-scaffold",
3
- "version": "1.0.75",
3
+ "version": "1.0.77",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",