@likable-hair/svelte 0.0.8 → 0.0.9

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 (41) hide show
  1. package/buttons/Button.svelte +1 -0
  2. package/buttons/Button.svelte.d.ts +1 -0
  3. package/common/Card.svelte +16 -21
  4. package/common/Card.svelte.d.ts +13 -1
  5. package/common/Gesture.svelte +65 -0
  6. package/common/Gesture.svelte.d.ts +19 -0
  7. package/common/IntersectionObserver.svelte.d.ts +4 -4
  8. package/dates/Calendar.svelte +1 -1
  9. package/dates/utils.d.ts +3 -0
  10. package/dates/utils.js +10 -0
  11. package/forms/{Textfield.svelte.d.ts → TextField.svelte.d.ts} +4 -4
  12. package/index.d.ts +20 -0
  13. package/index.js +29 -0
  14. package/loaders/Skeleton.svelte +1 -0
  15. package/loaders/Skeleton.svelte.d.ts +1 -0
  16. package/media/AttachmentDownloader.svelte +59 -0
  17. package/media/AttachmentDownloader.svelte.d.ts +28 -0
  18. package/media/Avatar.svelte +16 -0
  19. package/media/Avatar.svelte.d.ts +23 -0
  20. package/media/DescriptiveAvatar.svelte +77 -0
  21. package/media/DescriptiveAvatar.svelte.d.ts +28 -0
  22. package/media/Icon.svelte +1 -0
  23. package/media/Icon.svelte.d.ts +1 -0
  24. package/media/Image.svelte +13 -20
  25. package/media/Image.svelte.d.ts +2 -0
  26. package/media/ImageGrid.svelte +1 -0
  27. package/media/ImageGrid.svelte.d.ts +1 -0
  28. package/navigation/BreadCrumb.svelte.d.ts +29 -0
  29. package/navigation/Breadcrumb.svelte +67 -0
  30. package/navigation/Navigator.svelte +3 -6
  31. package/navigation/Navigator.svelte.d.ts +1 -0
  32. package/navigation/TabSwitcher.svelte +2 -1
  33. package/package.json +7 -1
  34. package/progress/ProgressBar.svelte +36 -0
  35. package/progress/ProgressBar.svelte.d.ts +22 -0
  36. package/shop/ProductsGrid.svelte +1 -0
  37. package/shop/ProductsGrid.svelte.d.ts +1 -0
  38. package/timeline/ScrollTimeLine.svelte +65 -174
  39. package/timeline/ScrollTimeLine.svelte.d.ts +18 -1
  40. package/timeline/SimpleTimeLine.svelte +165 -1
  41. package/timeline/SimpleTimeLine.svelte.d.ts +45 -12
@@ -13,6 +13,7 @@ $: cssVariables = Object.entries({
13
13
  return `${css}${key}: ${value};`;
14
14
  }, '');
15
15
  import Icon from '../media/Icon.svelte';
16
+ import '$lib/common/tailwind.css';
16
17
  </script>
17
18
 
18
19
  <div
@@ -1,4 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+ import '$lib/common/tailwind.css';
2
3
  declare const __propDef: {
3
4
  props: {
4
5
  type?: 'default' | 'text' | 'icon';
@@ -1,31 +1,26 @@
1
- <script >export let rounded = true, outlined = false;
2
- $: cssVariables = Object.entries({}).filter(([key]) => key.startsWith('--'))
3
- .reduce((css, [key, value]) => {
4
- return `${css}${key}: ${value};`;
5
- }, '');
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 = "";
6
2
  import '$lib/common/tailwind.css';
7
3
  </script>
8
4
 
9
5
  <style>
10
- .card-container {
11
- height: var(--height, fit-content);
12
- width: var(--width, fit-content);
13
- max-height: var(--max-height);
14
- max-width: var(--max-width);
15
- min-height: var(--min-height);
16
- min-width: var(--min-width);
17
- padding: var(--padding, 5px);
18
- background-color: var(--background-color, rgb(252, 252, 252));
19
- color: var(--color);
20
- border-color: var(--border-color);
21
- }
22
6
  </style>
23
7
 
24
- <div
25
- class="card-container flex flex-col shadow-lg"
26
- style={cssVariables}
8
+ <div
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:padding={padding}
16
+ style:border-radius={borderRadius}
17
+ style:background-color={backgroundColor}
18
+ style:color={color}
19
+ style:border-color={borderColor}
20
+ style:border-width={borderWidth}
21
+ style={style}
22
+ class="flex flex-col shadow-lg"
27
23
  class:border-solid={outlined}
28
- class:rounded-md={rounded}
29
24
  >
30
25
  <div class="header flex-none">
31
26
  <slot name="header"></slot>
@@ -2,8 +2,20 @@ import { SvelteComponentTyped } from "svelte";
2
2
  import '$lib/common/tailwind.css';
3
3
  declare const __propDef: {
4
4
  props: {
5
- rounded?: boolean;
6
5
  outlined?: boolean;
6
+ maxWidth?: string;
7
+ maxHeight?: string;
8
+ minWidth?: string;
9
+ minHeight?: string;
10
+ width?: string;
11
+ height?: string;
12
+ padding?: string;
13
+ borderRadius?: string;
14
+ backgroundColor?: string;
15
+ color?: string;
16
+ borderColor?: string;
17
+ borderWidth?: string;
18
+ style?: string;
7
19
  };
8
20
  events: {
9
21
  [evt: string]: CustomEvent<any>;
@@ -0,0 +1,65 @@
1
+ <script >import { createEventDispatcher } from 'svelte';
2
+ const dispatch = createEventDispatcher();
3
+ // TODO export the handler into a service to avoid mount 3 listeners for every component instance
4
+ export let timeThreshold = 200, diagonalThreshold = 100;
5
+ let lastTouch, startTouch, endTouch, startTime, endTime;
6
+ function handleTouchStart(event) {
7
+ lastTouch = event.touches[0];
8
+ startTouch = event.touches[0];
9
+ startTime = new Date();
10
+ }
11
+ function handleTouchEnd(event) {
12
+ endTouch = event.changedTouches[0];
13
+ endTime = new Date();
14
+ let timeDifference = endTime.getTime() - startTime.getTime();
15
+ if (timeDifference < timeThreshold) {
16
+ let direction;
17
+ let xDifference = endTouch.clientX - startTouch.clientX;
18
+ let yDifference = endTouch.clientY - startTouch.clientY;
19
+ // check if is diagonal swipe
20
+ if (Math.abs(Math.abs(xDifference) - Math.abs(yDifference)) < diagonalThreshold)
21
+ return;
22
+ if (Math.abs(xDifference) > Math.abs(yDifference)) {
23
+ // horizontal
24
+ if (xDifference > 0) {
25
+ direction = 'right';
26
+ }
27
+ else {
28
+ direction = 'left';
29
+ }
30
+ }
31
+ else {
32
+ // vertical
33
+ if (yDifference > 0) {
34
+ direction = 'down';
35
+ }
36
+ else {
37
+ direction = 'up';
38
+ }
39
+ }
40
+ dispatch('swipe-' + direction, {
41
+ direction: direction,
42
+ timeDifference: timeDifference,
43
+ xDifference: xDifference,
44
+ yDifference: yDifference
45
+ });
46
+ dispatch('swipe', {
47
+ direction: direction,
48
+ timeDifference: timeDifference,
49
+ xDifference: xDifference,
50
+ yDifference: yDifference
51
+ });
52
+ }
53
+ }
54
+ function handleTouchMove(event) {
55
+ let currentTouch = event.changedTouches[0];
56
+ lastTouch = currentTouch;
57
+ }
58
+ </script>
59
+
60
+
61
+ <svelte:window
62
+ on:touchstart="{handleTouchStart}"
63
+ on:touchend="{handleTouchEnd}"
64
+ on:touchmove="{handleTouchMove}"
65
+ />
@@ -0,0 +1,19 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ timeThreshold?: number;
5
+ diagonalThreshold?: number;
6
+ };
7
+ events: {
8
+ swipe: CustomEvent<any>;
9
+ } & {
10
+ [evt: string]: CustomEvent<any>;
11
+ };
12
+ slots: {};
13
+ };
14
+ export declare type GestureProps = typeof __propDef.props;
15
+ export declare type GestureEvents = typeof __propDef.events;
16
+ export declare type GestureSlots = typeof __propDef.slots;
17
+ export default class Gesture extends SvelteComponentTyped<GestureProps, GestureEvents, GestureSlots> {
18
+ }
19
+ export {};
@@ -2,11 +2,11 @@
2
2
  /** @typedef {typeof __propDef.events} IntersectionObserverEvents */
3
3
  /** @typedef {typeof __propDef.slots} IntersectionObserverSlots */
4
4
  export default class IntersectionObserver extends SvelteComponentTyped<{
5
+ left?: number;
6
+ right?: number;
5
7
  once?: boolean;
6
8
  top?: number;
7
9
  bottom?: number;
8
- left?: number;
9
- right?: number;
10
10
  }, {
11
11
  [evt: string]: CustomEvent<any>;
12
12
  }, {
@@ -21,11 +21,11 @@ export type IntersectionObserverSlots = typeof __propDef.slots;
21
21
  import { SvelteComponentTyped } from "svelte";
22
22
  declare const __propDef: {
23
23
  props: {
24
+ left?: number;
25
+ right?: number;
24
26
  once?: boolean;
25
27
  top?: number;
26
28
  bottom?: number;
27
- left?: number;
28
- right?: number;
29
29
  };
30
30
  events: {
31
31
  [evt: string]: CustomEvent<any>;
@@ -1,4 +1,4 @@
1
- <script >import './utils';
1
+ <script >import { getDateRows } from './utils';
2
2
  import '$lib/common/tailwind.css';
3
3
  </script>
4
4
 
package/dates/utils.d.ts CHANGED
@@ -9,3 +9,6 @@ export declare type MonthStats = {
9
9
  days: number;
10
10
  };
11
11
  export declare const getDateRows: (monthIndex: number, year: number) => number[];
12
+ declare type dateFormat = 'extended';
13
+ export declare const dateToString: (date: Date, format?: dateFormat) => string;
14
+ export {};
package/dates/utils.js CHANGED
@@ -57,3 +57,13 @@ export const getDateRows = (monthIndex, year) => {
57
57
  }
58
58
  return rows.filter(el => !Array.isArray(el));
59
59
  };
60
+ export const dateToString = (date, format = 'extended') => {
61
+ let stringDate = "";
62
+ if (format == 'extended') {
63
+ const day = date.getDate();
64
+ const month = getMonthName(date.getMonth());
65
+ const year = date.getFullYear();
66
+ stringDate = `${day} ${month} ${year}`;
67
+ }
68
+ return stringDate;
69
+ };
@@ -21,9 +21,9 @@ declare const __propDef: {
21
21
  'append-inner': {};
22
22
  };
23
23
  };
24
- export declare type TextfieldProps = typeof __propDef.props;
25
- export declare type TextfieldEvents = typeof __propDef.events;
26
- export declare type TextfieldSlots = typeof __propDef.slots;
27
- export default class Textfield extends SvelteComponentTyped<TextfieldProps, TextfieldEvents, TextfieldSlots> {
24
+ export declare type TextFieldProps = typeof __propDef.props;
25
+ export declare type TextFieldEvents = typeof __propDef.events;
26
+ export declare type TextFieldSlots = typeof __propDef.slots;
27
+ export default class TextField extends SvelteComponentTyped<TextFieldProps, TextFieldEvents, TextFieldSlots> {
28
28
  }
29
29
  export {};
package/index.d.ts CHANGED
@@ -1,2 +1,22 @@
1
1
  export { default as Button } from './buttons/Button.svelte';
2
+ export { default as Card } from './common/Card.svelte';
3
+ export { default as Gesture } from './common/Gesture.svelte';
4
+ export { default as IntersectionObserver } from './common/IntersectionObserver.svelte';
5
+ export { default as TextField } from './forms/TextField.svelte';
6
+ export { default as Skeleton } from './forms/Skeleton.svelte';
7
+ export { default as AttachmentDownloader } from './forms/AttachmentDownloader.svelte';
8
+ export { default as Avatar } from './forms/Avatar.svelte';
9
+ export { default as Carousel } from './forms/Carousel.svelte';
10
+ export { default as DescriptiveAvatar } from './forms/DescriptiveAvatar.svelte';
11
+ export { default as Icon } from './forms/Icon.svelte';
12
+ export { default as Image } from './forms/Image.svelte';
13
+ export { default as ImageGrid } from './forms/ImageGrid.svelte';
14
+ export { default as BreadCrumb } from './navigation/BreadCrumb.svelte';
2
15
  export { default as HeaderMenu } from './navigation/HeaderMenu.svelte';
16
+ export { default as Navigator } from './navigation/Navigator.svelte';
17
+ export { default as TabSwitcher } from './navigation/TabSwitcher.svelte';
18
+ export { default as ProgressBar } from './navigation/ProgressBar.svelte';
19
+ export { default as ProductCard } from './shop/ProductCard.svelte';
20
+ export { default as ProductGrid } from './shop/ProductCard.svelte';
21
+ export { default as ScollTimeLine } from './shop/ScrollTimeLine.svelte';
22
+ export { default as SimpleTimeLine } from './shop/SimpleTimeLine.svelte';
package/index.js CHANGED
@@ -1,2 +1,31 @@
1
+ // buttons
1
2
  export { default as Button } from './buttons/Button.svelte';
3
+ // common
4
+ export { default as Card } from './common/Card.svelte';
5
+ export { default as Gesture } from './common/Gesture.svelte';
6
+ export { default as IntersectionObserver } from './common/IntersectionObserver.svelte';
7
+ // forms
8
+ export { default as TextField } from './forms/TextField.svelte';
9
+ // loaders
10
+ export { default as Skeleton } from './forms/Skeleton.svelte';
11
+ // media
12
+ export { default as AttachmentDownloader } from './forms/AttachmentDownloader.svelte';
13
+ export { default as Avatar } from './forms/Avatar.svelte';
14
+ export { default as Carousel } from './forms/Carousel.svelte';
15
+ export { default as DescriptiveAvatar } from './forms/DescriptiveAvatar.svelte';
16
+ export { default as Icon } from './forms/Icon.svelte';
17
+ export { default as Image } from './forms/Image.svelte';
18
+ export { default as ImageGrid } from './forms/ImageGrid.svelte';
19
+ // navigation
20
+ export { default as BreadCrumb } from './navigation/BreadCrumb.svelte';
2
21
  export { default as HeaderMenu } from './navigation/HeaderMenu.svelte';
22
+ export { default as Navigator } from './navigation/Navigator.svelte';
23
+ export { default as TabSwitcher } from './navigation/TabSwitcher.svelte';
24
+ // progress
25
+ export { default as ProgressBar } from './navigation/ProgressBar.svelte';
26
+ // shop
27
+ export { default as ProductCard } from './shop/ProductCard.svelte';
28
+ export { default as ProductGrid } from './shop/ProductCard.svelte';
29
+ // timeline
30
+ export { default as ScollTimeLine } from './shop/ScrollTimeLine.svelte';
31
+ export { default as SimpleTimeLine } from './shop/SimpleTimeLine.svelte';
@@ -14,6 +14,7 @@ $: cssVariables = Object.entries({
14
14
  .reduce((css, [key, value]) => {
15
15
  return `${css}${key}: ${value};`;
16
16
  }, '');
17
+ import '$lib/common/tailwind.css';
17
18
  </script>
18
19
 
19
20
  <div class="card" style={cssVariables}>
@@ -1,5 +1,6 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import type { SectionType } from './sectionType';
3
+ import '$lib/common/tailwind.css';
3
4
  declare const __propDef: {
4
5
  props: {
5
6
  sections?: {
@@ -0,0 +1,59 @@
1
+ <script >export let title = undefined, description = undefined, borderColor = "#B8B8B8", iconColor = "#8D8D8D", borderWidth = '1px', maxWidth = undefined, maxHeight = undefined, minWidth = undefined, minHeight = undefined, width = 'fit-content', height = undefined;
2
+ import Icon from './Icon.svelte';
3
+ import Card from '../common/Card.svelte';
4
+ </script>
5
+
6
+ <style>
7
+ .title {
8
+ font-size: 13pt;
9
+ font-weight: 700;
10
+ }
11
+
12
+ .description {
13
+ margin-top: 5px;
14
+ font-size: 9pt;
15
+ font-weight: 200;
16
+ }
17
+ </style>
18
+
19
+ <Card
20
+ outlined
21
+ borderColor={borderColor}
22
+ borderWidth={borderWidth}
23
+ width={width}
24
+ maxWidth={maxWidth}
25
+ minWidth={minWidth}
26
+ height={height}
27
+ maxHeight={maxHeight}
28
+ minHeight={minHeight}
29
+ on:click
30
+ >
31
+ <div
32
+ style:display="flex"
33
+ style:align-items="center"
34
+ >
35
+ <Icon
36
+ name="mdi-file"
37
+ size={40}
38
+ color={iconColor}
39
+ ></Icon>
40
+ <div
41
+ style:margin-left="10px"
42
+ style:margin-right="10px"
43
+ style:margin-top="10px"
44
+ style:margin-bottom="10px"
45
+ >
46
+ {#if !!title}
47
+ <div
48
+ class="title"
49
+ >{title}</div>
50
+ {/if}
51
+ {#if !!description}
52
+ <div
53
+ class="description"
54
+ >{description}</div>
55
+ {/if}
56
+ </div>
57
+ </div>
58
+ </Card>
59
+
@@ -0,0 +1,28 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ title?: string;
5
+ description?: string;
6
+ borderColor?: string;
7
+ iconColor?: string;
8
+ borderWidth?: string;
9
+ maxWidth?: string;
10
+ maxHeight?: string;
11
+ minWidth?: string;
12
+ minHeight?: string;
13
+ width?: string;
14
+ height?: string;
15
+ };
16
+ events: {
17
+ click: CustomEvent<any>;
18
+ } & {
19
+ [evt: string]: CustomEvent<any>;
20
+ };
21
+ slots: {};
22
+ };
23
+ export declare type AttachmentDownloaderProps = typeof __propDef.props;
24
+ export declare type AttachmentDownloaderEvents = typeof __propDef.events;
25
+ export declare type AttachmentDownloaderSlots = typeof __propDef.slots;
26
+ export default class AttachmentDownloader extends SvelteComponentTyped<AttachmentDownloaderProps, AttachmentDownloaderEvents, AttachmentDownloaderSlots> {
27
+ }
28
+ export {};
@@ -0,0 +1,16 @@
1
+ <script >export let src, width = "40px", maxWidth = undefined, minWidth = undefined, height = "40px", maxHeight = undefined, minHeight = undefined, borderRadius = "50%";
2
+ import Image from './Image.svelte';
3
+ </script>
4
+
5
+ <Image
6
+ src={src}
7
+ width={width}
8
+ maxWidth={maxWidth}
9
+ minWidth={minWidth}
10
+ height={height}
11
+ maxHeight={maxHeight}
12
+ minHeight={minHeight}
13
+ borderRadius={borderRadius}
14
+ disableHover={true}
15
+ showSkeletonLoader={true}
16
+ ></Image>
@@ -0,0 +1,23 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ src: string;
5
+ width?: string;
6
+ maxWidth?: string;
7
+ minWidth?: string;
8
+ height?: string;
9
+ maxHeight?: string;
10
+ minHeight?: string;
11
+ borderRadius?: string;
12
+ };
13
+ events: {
14
+ [evt: string]: CustomEvent<any>;
15
+ };
16
+ slots: {};
17
+ };
18
+ export declare type AvatarProps = typeof __propDef.props;
19
+ export declare type AvatarEvents = typeof __propDef.events;
20
+ export declare type AvatarSlots = typeof __propDef.slots;
21
+ export default class Avatar extends SvelteComponentTyped<AvatarProps, AvatarEvents, AvatarSlots> {
22
+ }
23
+ export {};
@@ -0,0 +1,77 @@
1
+ <script >export let src, title = undefined, description = undefined, direction = 'row', reverse = false, avatarSpacing = '10px', width = undefined, maxWidth = undefined, minWidth = undefined, height = undefined, maxHeight = undefined, minHeight = undefined, borderRadius = "50%";
2
+ let textAlignment;
3
+ $: if (direction == 'column') {
4
+ textAlignment = 'center';
5
+ }
6
+ else if (reverse) {
7
+ textAlignment = 'right';
8
+ }
9
+ else {
10
+ textAlignment = 'left';
11
+ }
12
+ import Avatar from "./Avatar.svelte";
13
+ </script>
14
+
15
+ <style>
16
+ .descriptive-avatar-container {
17
+ width: fit-content;
18
+ display: flex;
19
+ }
20
+
21
+ .avatar-container {
22
+ flex: none
23
+ }
24
+
25
+ .description-container {
26
+ flex-grow: 1;
27
+ }
28
+
29
+ .title {
30
+ font-size: 12pt;
31
+ font-weight: 700;
32
+ }
33
+
34
+ .description {
35
+ font-size: 10pt;
36
+ font-weight: 300;
37
+ }
38
+ </style>
39
+
40
+ <div
41
+ style:align-items="center"
42
+ style:flex-direction={reverse ? direction + '-reverse' : direction}
43
+ class="descriptive-avatar-container"
44
+ >
45
+ <div class="avatar-container">
46
+ <Avatar
47
+ src={src}
48
+ width={width}
49
+ maxWidth={maxWidth}
50
+ minWidth={minWidth}
51
+ height={height}
52
+ maxHeight={maxHeight}
53
+ minHeight={minHeight}
54
+ borderRadius={borderRadius}
55
+ ></Avatar>
56
+ </div>
57
+ <div
58
+ style:margin-left={!reverse && direction === 'row' ? avatarSpacing : undefined}
59
+ style:margin-right={reverse && direction === 'row' ? avatarSpacing : undefined}
60
+ style:margin-top={!reverse && direction === 'column' ? avatarSpacing : undefined}
61
+ style:margin-bottom={reverse && direction === 'column' ? avatarSpacing : undefined}
62
+ class="description-container"
63
+ >
64
+ {#if !!title}
65
+ <div
66
+ style:text-align={textAlignment}
67
+ class="title"
68
+ >{title}</div>
69
+ {/if}
70
+ {#if !!description}
71
+ <div
72
+ style:text-align={textAlignment}
73
+ class="description"
74
+ >{description}</div>
75
+ {/if}
76
+ </div>
77
+ </div>
@@ -0,0 +1,28 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ src: string;
5
+ title?: string;
6
+ description?: string;
7
+ direction?: 'row' | 'column';
8
+ reverse?: boolean;
9
+ avatarSpacing?: string;
10
+ width?: string;
11
+ maxWidth?: string;
12
+ minWidth?: string;
13
+ height?: string;
14
+ maxHeight?: string;
15
+ minHeight?: string;
16
+ borderRadius?: string;
17
+ };
18
+ events: {
19
+ [evt: string]: CustomEvent<any>;
20
+ };
21
+ slots: {};
22
+ };
23
+ export declare type DescriptiveAvatarProps = typeof __propDef.props;
24
+ export declare type DescriptiveAvatarEvents = typeof __propDef.events;
25
+ export declare type DescriptiveAvatarSlots = typeof __propDef.slots;
26
+ export default class DescriptiveAvatar extends SvelteComponentTyped<DescriptiveAvatarProps, DescriptiveAvatarEvents, DescriptiveAvatarSlots> {
27
+ }
28
+ export {};
package/media/Icon.svelte CHANGED
@@ -9,6 +9,7 @@ $: cssVariables = Object.entries({
9
9
  return `${css}${key}: ${value};`;
10
10
  }, '');
11
11
  import '../common/materialDesign.css';
12
+ import '$lib/common/tailwind.css';
12
13
  </script>
13
14
 
14
15
  <style>
@@ -1,5 +1,6 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  import '../common/materialDesign.css';
3
+ import '$lib/common/tailwind.css';
3
4
  declare const __propDef: {
4
5
  props: {
5
6
  name: string;
@@ -1,6 +1,6 @@
1
1
  <script >import { SectionType } from "../loaders/sectionType";
2
2
  import { browser } from '$app/env';
3
- export let maxWidth = undefined, maxHeight = undefined, minWidth = undefined, minHeight = undefined, width = undefined, height = undefined, src = undefined, title = undefined, description = undefined, dark = false, disableHover = false, showSkeletonLoader = true, imageCover = true, imageContain = false;
3
+ 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
4
  const load = (src) => {
5
5
  return new Promise(async (resolve, reject) => {
6
6
  if (browser) {
@@ -16,25 +16,25 @@ const load = (src) => {
16
16
  }
17
17
  });
18
18
  };
19
- $: cssVariables = Object.entries({
20
- '--max-width': maxWidth,
21
- '--max-height': maxHeight,
22
- '--min-width': minWidth,
23
- '--min-height': minHeight,
24
- '--width': width,
25
- '--height': height,
26
- '--object-fit': imageCover ? 'cover' : imageContain ? 'contain' : undefined,
27
- }).filter(([key]) => key.startsWith('--'))
19
+ $: cssVariables = Object.entries({}).filter(([key]) => key.startsWith('--'))
28
20
  .reduce((css, [key, value]) => {
29
21
  return `${css}${key}: ${value};`;
30
22
  }, '');
31
23
  import IntersectionObserver from '../common/IntersectionObserver.svelte';
32
24
  import Skeleton from "../loaders/Skeleton.svelte";
25
+ import '$lib/common/tailwind.css';
33
26
  </script>
34
27
 
35
28
  <div
36
- class="image-container"
29
+ style:width={width}
30
+ style:max-width={maxWidth}
31
+ style:min-width={minWidth}
32
+ style:height={height}
33
+ style:max-height={maxHeight}
34
+ style:min-height={minHeight}
35
+ style:border-radius={borderRadius}
37
36
  style={cssVariables}
37
+ class="image-container"
38
38
  >
39
39
  <IntersectionObserver once={true} let:intersecting={intersecting}>
40
40
  {#if intersecting}
@@ -57,7 +57,8 @@ import Skeleton from "../loaders/Skeleton.svelte";
57
57
  <div style="position: relative; height: 100%">
58
58
  <div class="image-filter">
59
59
  <div
60
- style={'background-image: url(' + base64 + ')'}
60
+ style:background-size={imageCover ? 'cover' : imageContain ? 'contain' : undefined}
61
+ style:background-image={`url(${base64})`}
61
62
  class="image"
62
63
  class:image-hover={!disableHover}
63
64
  >
@@ -97,18 +98,10 @@ import Skeleton from "../loaders/Skeleton.svelte";
97
98
 
98
99
  <style>
99
100
  .image-container {
100
- max-width: var(--max-width);
101
- max-height: var(--max-height);
102
- min-width: var(--min-width);
103
- min-height: var(--min-height);
104
- width: var(--width);
105
- height: var(--height);
106
- border-radius: var(--border-radius);
107
101
  overflow: hidden;
108
102
  }
109
103
 
110
104
  .image {
111
- background-size: var(--object-fit);
112
105
  background-repeat: no-repeat;
113
106
  background-position: center center;
114
107
  width: 100%;
@@ -1,4 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+ import '$lib/common/tailwind.css';
2
3
  declare const __propDef: {
3
4
  props: {
4
5
  maxWidth?: string;
@@ -7,6 +8,7 @@ declare const __propDef: {
7
8
  minHeight?: string;
8
9
  width?: string;
9
10
  height?: string;
11
+ borderRadius?: string;
10
12
  src?: string;
11
13
  title?: string;
12
14
  description?: string;
@@ -6,6 +6,7 @@ $: cssVariables = Object.entries({
6
6
  return `${css}${key}: ${value};`;
7
7
  }, '');
8
8
  import Image from './Image.svelte';
9
+ import '$lib/common/tailwind.css';
9
10
  </script>
10
11
 
11
12
  <div