@likable-hair/svelte 0.0.16 → 0.0.19
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/buttons/Button.svelte +41 -35
- package/buttons/Button.svelte.d.ts +15 -0
- package/common/Card.svelte +21 -5
- package/common/Card.svelte.d.ts +0 -1
- package/dates/Calendar.svelte +0 -1
- package/dates/Calendar.svelte.d.ts +0 -1
- package/forms/Textfield.svelte +26 -23
- package/forms/{TextField.svelte.d.ts → Textfield.svelte.d.ts} +8 -5
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/loaders/Skeleton.svelte +30 -29
- package/loaders/Skeleton.svelte.d.ts +2 -3
- package/media/Carousel.svelte +16 -20
- package/media/Carousel.svelte.d.ts +6 -1
- package/media/Image.svelte +3 -10
- package/media/Image.svelte.d.ts +0 -1
- package/media/ImageGrid.svelte +7 -13
- package/media/ImageGrid.svelte.d.ts +0 -1
- package/navigation/Drawer.svelte +139 -0
- package/navigation/Drawer.svelte.d.ts +36 -0
- package/navigation/HeaderMenu.svelte +123 -22
- package/navigation/HeaderMenu.svelte.d.ts +15 -2
- package/navigation/Navigator.svelte +19 -6
- package/navigation/Navigator.svelte.d.ts +7 -1
- package/navigation/TabSwitcher.svelte +10 -14
- package/navigation/TabSwitcher.svelte.d.ts +0 -1
- package/package.json +2 -2
- package/shop/ProductCard.svelte +64 -17
- package/shop/ProductCard.svelte.d.ts +6 -1
- package/shop/ProductsGrid.svelte +10 -19
- package/shop/ProductsGrid.svelte.d.ts +2 -1
- package/timeline/ScrollTimeLine.svelte +1 -2
- package/timeline/ScrollTimeLine.svelte.d.ts +0 -1
- package/common/tailwind.css +0 -149
package/buttons/Button.svelte
CHANGED
|
@@ -1,27 +1,34 @@
|
|
|
1
|
-
<script >export let type = 'default';
|
|
2
|
-
export let icon = undefined;
|
|
3
|
-
export let iconSize = 15;
|
|
4
|
-
let clazz = '';
|
|
1
|
+
<script >export let type = 'default', icon = undefined, iconSize = 15, clazz = '', maxWidth = undefined, maxHeight = undefined, minWidth = undefined, minHeight = undefined, width = undefined, height = undefined, textAlign = "center", cursor = "pointer", padding = "5px", fontSize = undefined, color = undefined, backgroundColor = undefined, hoverBackgroundColor = '#88888847', borderRadius = undefined, boxShadow = undefined;
|
|
5
2
|
export { clazz as class };
|
|
3
|
+
$: defaultBorderRadius = type == 'icon' ? '50%' : '5px';
|
|
6
4
|
$: position = !!$$slots.append ? 'relative' : undefined;
|
|
7
|
-
$: cssVariables = Object.entries({
|
|
8
|
-
'--icon-button-height': (iconSize + 15) + 'pt',
|
|
9
|
-
'--icon-button-width': (iconSize + 15) + 'pt',
|
|
10
|
-
'--button-position': position
|
|
11
|
-
}).filter(([key]) => key.startsWith('--'))
|
|
12
|
-
.reduce((css, [key, value]) => {
|
|
13
|
-
return `${css}${key}: ${value};`;
|
|
14
|
-
}, '');
|
|
15
5
|
import Icon from '../media/Icon.svelte';
|
|
16
6
|
</script>
|
|
17
7
|
|
|
18
8
|
<div
|
|
19
|
-
|
|
9
|
+
style:width={width}
|
|
10
|
+
style:max-width={maxWidth}
|
|
11
|
+
style:min-width={minWidth}
|
|
12
|
+
style:height={height}
|
|
13
|
+
style:max-height={maxHeight}
|
|
14
|
+
style:min-height={minHeight}
|
|
15
|
+
style:text-align={textAlign}
|
|
16
|
+
style:position={position}
|
|
17
|
+
style:cursor={cursor}
|
|
18
|
+
style:padding={padding}
|
|
19
|
+
style:font-size={fontSize}
|
|
20
|
+
style:color={color}
|
|
21
|
+
style:button-border-radius={!!borderRadius ? borderRadius : defaultBorderRadius}
|
|
22
|
+
style:--button-background-color={backgroundColor}
|
|
23
|
+
style:--button-hover-background-color={hoverBackgroundColor}
|
|
24
|
+
style:--button-box-shadow={boxShadow}
|
|
25
|
+
style:--button-icon-height={(iconSize + 5) + 'pt'}
|
|
26
|
+
style:--button-icon-width={(iconSize + 5) + 'pt'}
|
|
27
|
+
class="button no-select {clazz}"
|
|
20
28
|
class:button-default={type === 'default'}
|
|
21
29
|
class:button-text={type === 'text'}
|
|
22
30
|
class:button-icon={type === 'icon'}
|
|
23
31
|
on:click
|
|
24
|
-
style={cssVariables}
|
|
25
32
|
>
|
|
26
33
|
{#if !!icon}
|
|
27
34
|
<Icon name={icon} size={iconSize}></Icon>
|
|
@@ -31,7 +38,6 @@ import Icon from '../media/Icon.svelte';
|
|
|
31
38
|
{#if $$slots.append}
|
|
32
39
|
<span class="append-item">
|
|
33
40
|
<slot name="append">
|
|
34
|
-
|
|
35
41
|
</slot>
|
|
36
42
|
</span>
|
|
37
43
|
{/if}
|
|
@@ -45,57 +51,57 @@ import Icon from '../media/Icon.svelte';
|
|
|
45
51
|
|
|
46
52
|
.button {
|
|
47
53
|
overflow: hidden;
|
|
48
|
-
position: var(--button-position);
|
|
49
|
-
width: var(--width, fit-content);
|
|
50
|
-
height: var(--height, fit-content);
|
|
51
|
-
text-align: var(--text-align, center);
|
|
52
|
-
cursor: var(--cursor, pointer);
|
|
53
|
-
padding: var(--padding, 5px);
|
|
54
|
-
font-size: var(--font-size);
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
.button-default {
|
|
58
57
|
transition: background-color 200ms;
|
|
59
|
-
color: var(--color);
|
|
60
|
-
background-color: var(--background-color);
|
|
58
|
+
background-color: var(--button-background-color);
|
|
61
59
|
outline: 0;
|
|
62
60
|
border: 0;
|
|
63
|
-
border-radius: var(--border-radius, 0.25rem);
|
|
64
|
-
box-shadow: var(--box-shadow, 0 0 0.5rem rgba(0, 0, 0, 0.3));
|
|
61
|
+
border-radius: var(--button-border-radius, 0.25rem);
|
|
62
|
+
box-shadow: var(--button-box-shadow, 0 0 0.5rem rgba(0, 0, 0, 0.3));
|
|
65
63
|
}
|
|
66
64
|
|
|
67
65
|
.button-default:hover {
|
|
68
|
-
background-color: var(--hover-background-color, var(--background-color));
|
|
66
|
+
background-color: var(--button-hover-background-color, var(--button-background-color));
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
.button-text {
|
|
72
|
-
color: var(--color);
|
|
73
70
|
transition: background-color 200ms;
|
|
74
71
|
text-transform: uppercase;
|
|
75
72
|
font-weight: 600;
|
|
76
73
|
outline: 0;
|
|
77
74
|
border: 0;
|
|
78
|
-
border-radius: var(--border-radius, 0.25rem);
|
|
75
|
+
border-radius: var(--button-border-radius, 0.25rem);
|
|
79
76
|
}
|
|
80
77
|
|
|
81
78
|
.button-text:hover {
|
|
82
|
-
background-color: var(--hover-background-color, transparent);
|
|
79
|
+
background-color: var(--button-hover-background-color, transparent);
|
|
83
80
|
}
|
|
84
81
|
|
|
85
82
|
.button-icon {
|
|
86
|
-
color: var(--color);
|
|
87
83
|
transition: background-color 200ms;
|
|
88
84
|
outline: 0;
|
|
89
85
|
border: 0;
|
|
90
|
-
border-radius: var(--border-radius, 50%);
|
|
91
|
-
height: var(--icon-
|
|
92
|
-
width: var(--icon-
|
|
86
|
+
border-radius: var(--button-border-radius, 50%);
|
|
87
|
+
height: var(--button-icon-height) !important;
|
|
88
|
+
width: var(--button-icon-width) !important;
|
|
93
89
|
display: flex;
|
|
94
90
|
align-items: center;
|
|
95
91
|
justify-content: center;
|
|
96
92
|
}
|
|
97
93
|
|
|
98
94
|
.button-icon:hover {
|
|
99
|
-
background-color: var(--hover-background-color, transparent);
|
|
95
|
+
background-color: var(--button-hover-background-color, transparent);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.no-select {
|
|
99
|
+
-webkit-touch-callout: none; /* iOS Safari */
|
|
100
|
+
-webkit-user-select: none; /* Safari */
|
|
101
|
+
-khtml-user-select: none; /* Konqueror HTML */
|
|
102
|
+
-moz-user-select: none; /* Old versions of Firefox */
|
|
103
|
+
-ms-user-select: none; /* Internet Explorer/Edge */
|
|
104
|
+
user-select: none; /* Non-prefixed version, currently
|
|
105
|
+
supported by Chrome, Edge, Opera and Firefox */
|
|
100
106
|
}
|
|
101
107
|
</style>
|
|
@@ -5,6 +5,21 @@ declare const __propDef: {
|
|
|
5
5
|
icon?: string;
|
|
6
6
|
iconSize?: number;
|
|
7
7
|
class?: string;
|
|
8
|
+
maxWidth?: string;
|
|
9
|
+
maxHeight?: string;
|
|
10
|
+
minWidth?: string;
|
|
11
|
+
minHeight?: string;
|
|
12
|
+
width?: string;
|
|
13
|
+
height?: string;
|
|
14
|
+
textAlign?: string;
|
|
15
|
+
cursor?: string;
|
|
16
|
+
padding?: string;
|
|
17
|
+
fontSize?: string;
|
|
18
|
+
color?: string;
|
|
19
|
+
backgroundColor?: string;
|
|
20
|
+
hoverBackgroundColor?: string;
|
|
21
|
+
borderRadius?: string;
|
|
22
|
+
boxShadow?: string;
|
|
8
23
|
};
|
|
9
24
|
events: {
|
|
10
25
|
click: MouseEvent;
|
package/common/Card.svelte
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<script >export let outlined = false, maxWidth = undefined, maxHeight = undefined, minWidth = undefined, minHeight = undefined, width = 'fit-content', height = undefined, padding = "5px", borderRadius = "5px", backgroundColor = "rgb(252, 252, 252)", color = undefined, borderColor = undefined, borderWidth = undefined, style = "";
|
|
2
|
-
import './tailwind.css';
|
|
3
2
|
</script>
|
|
4
3
|
|
|
5
4
|
<style>
|
|
5
|
+
.shadow-lg {
|
|
6
|
+
--shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
7
|
+
--shadow-colored: 0 10px 15px -3px #000, 0 4px 6px -4px #000;
|
|
8
|
+
box-shadow: inset 0 0 0 calc(1px + 0px) rgb(255 255 255/0.1), 0 0 #0000, 0 0 #0000;
|
|
9
|
+
}
|
|
6
10
|
</style>
|
|
7
11
|
|
|
8
12
|
<div
|
|
@@ -19,16 +23,28 @@ import './tailwind.css';
|
|
|
19
23
|
style:border-color={borderColor}
|
|
20
24
|
style:border-width={borderWidth}
|
|
21
25
|
style={style}
|
|
22
|
-
|
|
26
|
+
style:display="flex"
|
|
27
|
+
style:flex-direction="column"
|
|
28
|
+
class="shadow-lg"
|
|
23
29
|
class:border-solid={outlined}
|
|
24
30
|
>
|
|
25
|
-
<div
|
|
31
|
+
<div
|
|
32
|
+
style:flex="none"
|
|
33
|
+
class="header"
|
|
34
|
+
>
|
|
26
35
|
<slot name="header"></slot>
|
|
27
36
|
</div>
|
|
28
|
-
<div
|
|
37
|
+
<div
|
|
38
|
+
style:flex-shrink="1"
|
|
39
|
+
style:overflow-y="auto"
|
|
40
|
+
class="body"
|
|
41
|
+
>
|
|
29
42
|
<slot></slot>
|
|
30
43
|
</div>
|
|
31
|
-
<div
|
|
44
|
+
<div
|
|
45
|
+
style:flex="none"
|
|
46
|
+
class="footer flex-none"
|
|
47
|
+
>
|
|
32
48
|
<slot name="footer"></slot>
|
|
33
49
|
</div>
|
|
34
50
|
</div>
|
package/common/Card.svelte.d.ts
CHANGED
package/dates/Calendar.svelte
CHANGED
package/forms/Textfield.svelte
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script >export let label = "", placeholder = "", color = "", value = "", variant = 'outlined';
|
|
1
|
+
<script >export let label = "", placeholder = "", color = "", value = "", variant = 'outlined', width = "100%", textColor = "balck", borderRadius = "5px", borderColor = undefined;
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
3
|
import { onMount } from 'svelte';
|
|
4
4
|
let inputId = uuidv4(), focused = false, legendWidth = 0, labelElement = undefined;
|
|
@@ -16,22 +16,13 @@ function handleBlur() {
|
|
|
16
16
|
$: if (!!labelElement) {
|
|
17
17
|
legendWidth = !value && !focused ? 0 : (labelElement.offsetWidth * 0.8) + 8;
|
|
18
18
|
}
|
|
19
|
-
$: cssVariables = Object.entries({
|
|
20
|
-
'--theme-color': color,
|
|
21
|
-
'--legend-width': legendWidth + 'px'
|
|
22
|
-
}).filter(([key]) => key.startsWith('--'))
|
|
23
|
-
.reduce((css, [key, value]) => {
|
|
24
|
-
return `${css}${key}: ${value};`;
|
|
25
|
-
}, '');
|
|
26
|
-
import '$lib/common/tailwind.css';
|
|
27
19
|
</script>
|
|
28
20
|
|
|
29
21
|
<style>
|
|
30
22
|
.input-container {
|
|
31
23
|
height: 50px;
|
|
32
24
|
position: relative;
|
|
33
|
-
|
|
34
|
-
--final-color: var(--theme-color, --border-color, rgb(88, 88, 88));
|
|
25
|
+
--textfield-final-color: var(--textfield-theme-color, --textfield-border-color, rgb(88, 88, 88));
|
|
35
26
|
}
|
|
36
27
|
|
|
37
28
|
/* outlined input */
|
|
@@ -39,7 +30,6 @@ import '$lib/common/tailwind.css';
|
|
|
39
30
|
.input-outlined {
|
|
40
31
|
border: 0px solid;
|
|
41
32
|
box-sizing: border-box;
|
|
42
|
-
color: var(--color, black);
|
|
43
33
|
font-size: 18px;
|
|
44
34
|
height: 100%;
|
|
45
35
|
outline: 0;
|
|
@@ -49,18 +39,17 @@ import '$lib/common/tailwind.css';
|
|
|
49
39
|
}
|
|
50
40
|
|
|
51
41
|
.fieldset-outlined {
|
|
52
|
-
border-radius: var(--border-radius, 5px);
|
|
53
42
|
border: 1px solid rgb(122, 122, 122);
|
|
54
43
|
padding-left: 4px;
|
|
55
44
|
}
|
|
56
45
|
|
|
57
46
|
.focused .fieldset-outlined {
|
|
58
|
-
border: 1px solid var(--final-color);
|
|
59
|
-
color: var(--final-color);
|
|
47
|
+
border: 1px solid var(--textfield-final-color);
|
|
48
|
+
color: var(--textfield-final-color);
|
|
60
49
|
}
|
|
61
50
|
|
|
62
51
|
.legend-outlined {
|
|
63
|
-
width: var(--legend-width);
|
|
52
|
+
width: var(--textfield-legend-width);
|
|
64
53
|
padding: 0px;
|
|
65
54
|
transition: width 0.3s, color 0.1s;
|
|
66
55
|
}
|
|
@@ -85,9 +74,8 @@ import '$lib/common/tailwind.css';
|
|
|
85
74
|
/* boxed input */
|
|
86
75
|
|
|
87
76
|
.fieldset-boxed {
|
|
88
|
-
border: 2px solid var(--final-color);
|
|
77
|
+
border: 2px solid var(--textfield-final-color);
|
|
89
78
|
padding: 5px;
|
|
90
|
-
border-radius: var(--border-radius, 0);
|
|
91
79
|
}
|
|
92
80
|
|
|
93
81
|
.input-boxed {
|
|
@@ -103,7 +91,7 @@ import '$lib/common/tailwind.css';
|
|
|
103
91
|
}
|
|
104
92
|
|
|
105
93
|
.input-boxed::placeholder {
|
|
106
|
-
color: var(--final-color);
|
|
94
|
+
color: var(--textfield-final-color);
|
|
107
95
|
opacity: 60%;
|
|
108
96
|
}
|
|
109
97
|
|
|
@@ -111,13 +99,18 @@ import '$lib/common/tailwind.css';
|
|
|
111
99
|
|
|
112
100
|
|
|
113
101
|
<div
|
|
102
|
+
style:width={width}
|
|
103
|
+
style:--textfield-theme-color={color}
|
|
104
|
+
style:--textfield-border-color={borderColor}
|
|
105
|
+
style:--textfield-legend-width={legendWidth + 'px'}
|
|
114
106
|
class="input-container"
|
|
115
|
-
style={cssVariables}
|
|
116
107
|
class:focused={focused}
|
|
117
108
|
class:texted={focused || !!value}
|
|
118
109
|
>
|
|
119
110
|
<fieldset
|
|
120
|
-
aria-hidden="true"
|
|
111
|
+
aria-hidden="true"
|
|
112
|
+
style:border-radius={borderRadius}
|
|
113
|
+
style:border-color={borderColor}
|
|
121
114
|
class="fieldset"
|
|
122
115
|
class:fieldset-outlined={variant == 'outlined'}
|
|
123
116
|
class:fieldset-boxed={variant == 'boxed'}
|
|
@@ -129,11 +122,18 @@ import '$lib/common/tailwind.css';
|
|
|
129
122
|
class="label-outlined"
|
|
130
123
|
bind:this={labelElement}
|
|
131
124
|
>{label}</label>
|
|
132
|
-
<div
|
|
125
|
+
<div
|
|
126
|
+
style:display="flex"
|
|
127
|
+
style:position="relative"
|
|
128
|
+
style:bottom="8px"
|
|
129
|
+
style:margin-left="8px"
|
|
130
|
+
style:margin-right="8px"
|
|
131
|
+
>
|
|
133
132
|
<div>
|
|
134
133
|
<slot name="prepend-inner"></slot>
|
|
135
134
|
</div>
|
|
136
135
|
<input
|
|
136
|
+
style:color={textColor}
|
|
137
137
|
id={inputId}
|
|
138
138
|
class="input-outlined"
|
|
139
139
|
type="text"
|
|
@@ -151,11 +151,14 @@ import '$lib/common/tailwind.css';
|
|
|
151
151
|
</div>
|
|
152
152
|
</div>
|
|
153
153
|
{:else if variant == 'boxed'}
|
|
154
|
-
<div
|
|
154
|
+
<div
|
|
155
|
+
style:display="flex"
|
|
156
|
+
>
|
|
155
157
|
<div>
|
|
156
158
|
<slot name="prepend-inner"></slot>
|
|
157
159
|
</div>
|
|
158
160
|
<input
|
|
161
|
+
style:color={textColor}
|
|
159
162
|
id={inputId}
|
|
160
163
|
class="input-boxed"
|
|
161
164
|
type="text"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import '$lib/common/tailwind.css';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: {
|
|
5
4
|
label?: string;
|
|
@@ -7,6 +6,10 @@ declare const __propDef: {
|
|
|
7
6
|
color?: string;
|
|
8
7
|
value?: string;
|
|
9
8
|
variant?: "outlined" | "boxed";
|
|
9
|
+
width?: string;
|
|
10
|
+
textColor?: string;
|
|
11
|
+
borderRadius?: string;
|
|
12
|
+
borderColor?: string;
|
|
10
13
|
};
|
|
11
14
|
events: {
|
|
12
15
|
change: Event;
|
|
@@ -21,9 +24,9 @@ declare const __propDef: {
|
|
|
21
24
|
'append-inner': {};
|
|
22
25
|
};
|
|
23
26
|
};
|
|
24
|
-
export declare type
|
|
25
|
-
export declare type
|
|
26
|
-
export declare type
|
|
27
|
-
export default class
|
|
27
|
+
export declare type TextfieldProps = typeof __propDef.props;
|
|
28
|
+
export declare type TextfieldEvents = typeof __propDef.events;
|
|
29
|
+
export declare type TextfieldSlots = typeof __propDef.slots;
|
|
30
|
+
export default class Textfield extends SvelteComponentTyped<TextfieldProps, TextfieldEvents, TextfieldSlots> {
|
|
28
31
|
}
|
|
29
32
|
export {};
|
package/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { default as Button } from './buttons/Button.svelte';
|
|
|
2
2
|
export { default as Card } from './common/Card.svelte';
|
|
3
3
|
export { default as Gesture } from './common/Gesture.svelte';
|
|
4
4
|
export { default as IntersectionObserver } from './common/IntersectionObserver.svelte';
|
|
5
|
-
export { default as TextField } from './forms/
|
|
5
|
+
export { default as TextField } from './forms/Textfield.svelte';
|
|
6
6
|
export { default as Skeleton } from './loaders/Skeleton.svelte';
|
|
7
7
|
export { default as AttachmentDownloader } from './media/AttachmentDownloader.svelte';
|
|
8
8
|
export { default as Avatar } from './media/Avatar.svelte';
|
|
@@ -15,6 +15,7 @@ export { default as BreadCrumb } from './navigation/BreadCrumb.svelte';
|
|
|
15
15
|
export { default as HeaderMenu } from './navigation/HeaderMenu.svelte';
|
|
16
16
|
export { default as Navigator } from './navigation/Navigator.svelte';
|
|
17
17
|
export { default as TabSwitcher } from './navigation/TabSwitcher.svelte';
|
|
18
|
+
export { default as Drawer } from './navigation/Drawer.svelte';
|
|
18
19
|
export { default as ProgressBar } from './progress/ProgressBar.svelte';
|
|
19
20
|
export { default as ProductCard } from './shop/ProductCard.svelte';
|
|
20
21
|
export { default as ProductGrid } from './shop/ProductCard.svelte';
|
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { default as Card } from './common/Card.svelte';
|
|
|
5
5
|
export { default as Gesture } from './common/Gesture.svelte';
|
|
6
6
|
export { default as IntersectionObserver } from './common/IntersectionObserver.svelte';
|
|
7
7
|
// forms
|
|
8
|
-
export { default as TextField } from './forms/
|
|
8
|
+
export { default as TextField } from './forms/Textfield.svelte';
|
|
9
9
|
// loaders
|
|
10
10
|
export { default as Skeleton } from './loaders/Skeleton.svelte';
|
|
11
11
|
// media
|
|
@@ -21,6 +21,7 @@ export { default as BreadCrumb } from './navigation/BreadCrumb.svelte';
|
|
|
21
21
|
export { default as HeaderMenu } from './navigation/HeaderMenu.svelte';
|
|
22
22
|
export { default as Navigator } from './navigation/Navigator.svelte';
|
|
23
23
|
export { default as TabSwitcher } from './navigation/TabSwitcher.svelte';
|
|
24
|
+
export { default as Drawer } from './navigation/Drawer.svelte';
|
|
24
25
|
// progress
|
|
25
26
|
export { default as ProgressBar } from './progress/ProgressBar.svelte';
|
|
26
27
|
// shop
|
package/loaders/Skeleton.svelte
CHANGED
|
@@ -1,28 +1,37 @@
|
|
|
1
|
-
<script
|
|
2
|
-
$: cssVariables = Object.entries({
|
|
3
|
-
'--max-width': maxWidth,
|
|
4
|
-
'--max-height': maxHeight,
|
|
5
|
-
'--min-width': minWidth,
|
|
6
|
-
'--min-height': minHeight,
|
|
7
|
-
'--width': width,
|
|
8
|
-
'--height': height,
|
|
9
|
-
'--padding': padding,
|
|
10
|
-
'--card-background': dark ? '#000000' : '#fff',
|
|
11
|
-
'--element-background': dark ? '#1a1a1a' : '#eee',
|
|
12
|
-
'--animation-color': dark ? '#000000e6' : '#ffffffe6',
|
|
13
|
-
}).filter(([key]) => key.startsWith('--'))
|
|
14
|
-
.reduce((css, [key, value]) => {
|
|
15
|
-
return `${css}${key}: ${value};`;
|
|
16
|
-
}, '');
|
|
17
|
-
import '$lib/common/tailwind.css';
|
|
1
|
+
<script context="module">export {};
|
|
18
2
|
</script>
|
|
19
3
|
|
|
20
|
-
<
|
|
4
|
+
<script >export let sections = [], maxWidth = undefined, maxHeight = undefined, minWidth = undefined, minHeight = undefined, width = "100%", height = "100%", padding = '10px', dark = false;
|
|
5
|
+
$: widthLessPadding = `calc(${width} - (${padding} * 2))`;
|
|
6
|
+
$: heightLessPadding = `calc(${height} - (${padding} * 2))`;
|
|
7
|
+
$: maxWidthLessPadding = `calc(${maxWidth} - (${padding} * 2))`;
|
|
8
|
+
$: maxHeightLessPadding = `calc(${maxHeight} - (${padding} * 2))`;
|
|
9
|
+
$: minWidthLessPadding = `calc(${minWidth} - (${padding} * 2))`;
|
|
10
|
+
$: minHeightLessPadding = `calc(${minHeight} - (${padding} * 2))`;
|
|
11
|
+
$: elementBackground = dark ? '#1a1a1a' : '#eee';
|
|
12
|
+
$: animationBackground = dark ? '#000000e6' : '#ffffffe6';
|
|
13
|
+
$: cardBackground = dark ? '#000000' : '#fff';
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
<div
|
|
18
|
+
style:--skeleton-card-background={cardBackground}
|
|
19
|
+
style:--skeleton-animation-color={animationBackground}
|
|
20
|
+
style:width={widthLessPadding}
|
|
21
|
+
style:height={heightLessPadding}
|
|
22
|
+
style:max-width={maxWidthLessPadding}
|
|
23
|
+
style:max-height={maxHeightLessPadding}
|
|
24
|
+
style:min-width={minWidthLessPadding}
|
|
25
|
+
style:min-height={minHeightLessPadding}
|
|
26
|
+
style:padding={padding}
|
|
27
|
+
class="card"
|
|
28
|
+
>
|
|
21
29
|
{#each sections as section}
|
|
22
30
|
{#if section.type == 'image'}
|
|
23
31
|
<div
|
|
32
|
+
style:height={section.height}
|
|
33
|
+
style:background={elementBackground}
|
|
24
34
|
class="skeleton-image"
|
|
25
|
-
style="height: {section.height}"
|
|
26
35
|
></div>
|
|
27
36
|
{/if}
|
|
28
37
|
{/each}
|
|
@@ -30,7 +39,6 @@ import '$lib/common/tailwind.css';
|
|
|
30
39
|
|
|
31
40
|
<style>
|
|
32
41
|
.skeleton-image {
|
|
33
|
-
background: var(--element-background);
|
|
34
42
|
margin-bottom: 10px;
|
|
35
43
|
border-radius: 5px;
|
|
36
44
|
overflow: hidden;
|
|
@@ -38,17 +46,10 @@ import '$lib/common/tailwind.css';
|
|
|
38
46
|
}
|
|
39
47
|
|
|
40
48
|
.card {
|
|
41
|
-
background: var(--card-background);
|
|
49
|
+
background: var(--skeleton-card-background);
|
|
42
50
|
position: relative;
|
|
43
|
-
padding: var(--padding);
|
|
44
51
|
border-radius: 5px;
|
|
45
52
|
box-shadow: 0 10px 100px rgba(0, 0, 0, 0.1);
|
|
46
|
-
width: calc(var(--width) - (var(--padding) * 2));
|
|
47
|
-
height: calc(var(--height) - (var(--padding) * 2));
|
|
48
|
-
max-width: calc(var(--max-width) - (var(--padding) * 2));
|
|
49
|
-
max-height: calc(var(--max-height) - (var(--padding) * 2));
|
|
50
|
-
min-width: calc(var(--min-width) - (var(--padding) * 2));
|
|
51
|
-
min-height: calc(var(--min-height) - (var(--padding) * 2));
|
|
52
53
|
overflow: hidden;
|
|
53
54
|
}
|
|
54
55
|
|
|
@@ -67,7 +68,7 @@ import '$lib/common/tailwind.css';
|
|
|
67
68
|
background: linear-gradient(
|
|
68
69
|
90deg,
|
|
69
70
|
transparent,
|
|
70
|
-
var(--animation-color),
|
|
71
|
+
var(--skeleton-animation-color),
|
|
71
72
|
transparent
|
|
72
73
|
);
|
|
73
74
|
width: 50%;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
|
|
3
|
-
import '$lib/common/tailwind.css';
|
|
2
|
+
export declare type SectionType = "image" | "text";
|
|
4
3
|
declare const __propDef: {
|
|
5
4
|
props: {
|
|
6
5
|
sections?: {
|
|
@@ -11,9 +10,9 @@ declare const __propDef: {
|
|
|
11
10
|
maxHeight?: string;
|
|
12
11
|
minWidth?: string;
|
|
13
12
|
minHeight?: string;
|
|
14
|
-
padding?: string;
|
|
15
13
|
width?: string;
|
|
16
14
|
height?: string;
|
|
15
|
+
padding?: string;
|
|
17
16
|
dark?: boolean;
|
|
18
17
|
};
|
|
19
18
|
events: {
|
package/media/Carousel.svelte
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
<script >import { onMount } from 'svelte';
|
|
2
|
-
export let images = [];
|
|
3
|
-
let container,
|
|
2
|
+
export let images = [], maxWidth = undefined, maxHeight = undefined, minWidth = undefined, minHeight = undefined, width = "100%", height = "100%";
|
|
3
|
+
let container, localWidth = '0px', localHeight = '0px';
|
|
4
4
|
onMount(() => {
|
|
5
5
|
calculateWidthAndHeight();
|
|
6
6
|
});
|
|
7
7
|
function calculateWidthAndHeight() {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
localWidth = container.offsetWidth + 'px';
|
|
9
|
+
localHeight = container.offsetHeight + 'px';
|
|
10
10
|
}
|
|
11
|
-
$: cssVariables = Object.entries({}).filter(([key]) => key.startsWith('--'))
|
|
12
|
-
.reduce((css, [key, value]) => {
|
|
13
|
-
return `${css}${key}: ${value};`;
|
|
14
|
-
}, '');
|
|
15
|
-
import '$lib/common/tailwind.css';
|
|
16
11
|
import Image from './Image.svelte';
|
|
17
12
|
</script>
|
|
18
13
|
|
|
@@ -22,9 +17,16 @@ import Image from './Image.svelte';
|
|
|
22
17
|
|
|
23
18
|
|
|
24
19
|
<div
|
|
25
|
-
style={
|
|
20
|
+
style:max-width={maxWidth}
|
|
21
|
+
style:max-height={maxHeight}
|
|
22
|
+
style:min-width={minWidth}
|
|
23
|
+
style:min-height={minHeight}
|
|
24
|
+
style:width={width}
|
|
25
|
+
style:height={height}
|
|
26
|
+
style:display="flex"
|
|
27
|
+
style:flex-wrap="no-wrap"
|
|
26
28
|
bind:this={container}
|
|
27
|
-
class="container
|
|
29
|
+
class="container"
|
|
28
30
|
>
|
|
29
31
|
{#each images as image}
|
|
30
32
|
<div class="image-container">
|
|
@@ -34,9 +36,9 @@ import Image from './Image.svelte';
|
|
|
34
36
|
description={image.description}
|
|
35
37
|
disableHover={true}
|
|
36
38
|
showSkeletonLoader={false}
|
|
37
|
-
minWidth={
|
|
38
|
-
width={
|
|
39
|
-
height={
|
|
39
|
+
minWidth={localWidth}
|
|
40
|
+
width={localWidth}
|
|
41
|
+
height={localHeight}
|
|
40
42
|
imageContain={true}
|
|
41
43
|
imageCover={false}
|
|
42
44
|
/>
|
|
@@ -46,12 +48,6 @@ import Image from './Image.svelte';
|
|
|
46
48
|
|
|
47
49
|
<style>
|
|
48
50
|
.container {
|
|
49
|
-
height: var(--height);
|
|
50
|
-
width: var(--width);
|
|
51
|
-
max-height: var(--max-height);
|
|
52
|
-
max-width: var(--max-width);
|
|
53
|
-
min-height: var(--min-height);
|
|
54
|
-
min-width: var(--min-width);
|
|
55
51
|
overflow-x: scroll;
|
|
56
52
|
scroll-snap-type: x mandatory;
|
|
57
53
|
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import '$lib/common/tailwind.css';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: {
|
|
5
4
|
images?: {
|
|
@@ -7,6 +6,12 @@ declare const __propDef: {
|
|
|
7
6
|
title: string;
|
|
8
7
|
description: string;
|
|
9
8
|
}[];
|
|
9
|
+
maxWidth?: string;
|
|
10
|
+
maxHeight?: string;
|
|
11
|
+
minWidth?: string;
|
|
12
|
+
minHeight?: string;
|
|
13
|
+
width?: string;
|
|
14
|
+
height?: string;
|
|
10
15
|
};
|
|
11
16
|
events: {
|
|
12
17
|
[evt: string]: CustomEvent<any>;
|
package/media/Image.svelte
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
<script >import {
|
|
2
|
-
import { browser } from '$app/env';
|
|
1
|
+
<script >import { browser } from '$app/env';
|
|
3
2
|
export let maxWidth = undefined, maxHeight = undefined, minWidth = undefined, minHeight = undefined, width = undefined, height = undefined, borderRadius = undefined, src = undefined, title = undefined, description = undefined, dark = false, disableHover = false, showSkeletonLoader = true, imageCover = true, imageContain = false;
|
|
4
3
|
const load = (src) => {
|
|
5
4
|
return new Promise(async (resolve, reject) => {
|
|
@@ -16,13 +15,8 @@ const load = (src) => {
|
|
|
16
15
|
}
|
|
17
16
|
});
|
|
18
17
|
};
|
|
19
|
-
$: cssVariables = Object.entries({}).filter(([key]) => key.startsWith('--'))
|
|
20
|
-
.reduce((css, [key, value]) => {
|
|
21
|
-
return `${css}${key}: ${value};`;
|
|
22
|
-
}, '');
|
|
23
18
|
import IntersectionObserver from '../common/IntersectionObserver.svelte';
|
|
24
19
|
import Skeleton from "../loaders/Skeleton.svelte";
|
|
25
|
-
import '$lib/common/tailwind.css';
|
|
26
20
|
</script>
|
|
27
21
|
|
|
28
22
|
<div
|
|
@@ -33,7 +27,6 @@ import '$lib/common/tailwind.css';
|
|
|
33
27
|
style:max-height={maxHeight}
|
|
34
28
|
style:min-height={minHeight}
|
|
35
29
|
style:border-radius={borderRadius}
|
|
36
|
-
style={cssVariables}
|
|
37
30
|
class="image-container"
|
|
38
31
|
>
|
|
39
32
|
<IntersectionObserver once={true} let:intersecting={intersecting}>
|
|
@@ -43,7 +36,7 @@ import '$lib/common/tailwind.css';
|
|
|
43
36
|
<Skeleton
|
|
44
37
|
sections={[
|
|
45
38
|
{
|
|
46
|
-
type:
|
|
39
|
+
type: 'image',
|
|
47
40
|
height: `100%`
|
|
48
41
|
}
|
|
49
42
|
]}
|
|
@@ -82,7 +75,7 @@ import '$lib/common/tailwind.css';
|
|
|
82
75
|
<Skeleton
|
|
83
76
|
sections={[
|
|
84
77
|
{
|
|
85
|
-
type:
|
|
78
|
+
type: 'image',
|
|
86
79
|
height: `100%`
|
|
87
80
|
}
|
|
88
81
|
]}
|