@likable-hair/svelte 3.2.3 → 3.2.4

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,6 @@
1
+ :root {
2
+ --skeleton-default-card-background: rgb(var(--global-color-background-200));
3
+ --skeleton-default-animation-color: rgb(var(--global-color-background-400));
4
+ --skeleton-default-card-width: 100%;
5
+ --skeleton-default-card-height: 100%;
6
+ }
@@ -1,59 +1,46 @@
1
- <script context="module"></script>
2
-
3
- <script>export let sections = [], maxWidth = void 0, maxHeight = void 0, minWidth = void 0, minHeight = void 0, width = "100%", height = "100%", padding = "10px", dark = false;
4
- $:
5
- widthLessPadding = `calc(${width} - (${padding} * 2))`;
6
- $:
7
- heightLessPadding = `calc(${height} - (${padding} * 2))`;
8
- $:
9
- maxWidthLessPadding = `calc(${maxWidth} - (${padding} * 2))`;
10
- $:
11
- maxHeightLessPadding = `calc(${maxHeight} - (${padding} * 2))`;
12
- $:
13
- minWidthLessPadding = `calc(${minWidth} - (${padding} * 2))`;
14
- $:
15
- minHeightLessPadding = `calc(${minHeight} - (${padding} * 2))`;
16
- $:
17
- elementBackground = dark ? "#1a1a1a" : "#eee";
18
- $:
19
- animationBackground = dark ? "#000000e6" : "#ffffffe6";
20
- $:
21
- cardBackground = dark ? "#000000" : "#fff";
1
+ <script>import "../../../css/main.css";
2
+ import "./Skeleton.css";
22
3
  </script>
23
4
 
24
5
  <div
25
- style:--skeleton-card-background={cardBackground}
26
- style:--skeleton-animation-color={animationBackground}
27
- style:width={widthLessPadding}
28
- style:height={heightLessPadding}
29
- style:max-width={maxWidthLessPadding}
30
- style:max-height={maxHeightLessPadding}
31
- style:min-width={minWidthLessPadding}
32
- style:min-height={minHeightLessPadding}
33
- style:padding
34
- class="card"
35
- >
36
- {#each sections as section}
37
- {#if section.type == "image"}
38
- <div
39
- style:height={section.height}
40
- style:background={elementBackground}
41
- class="skeleton-image"
42
- />
43
- {/if}
44
- {/each}
45
- </div>
6
+ class="skeleton"
7
+ ></div>
46
8
 
47
9
  <style>
48
- .skeleton-image {
49
- margin-bottom: 10px;
50
- border-radius: 5px;
51
- overflow: hidden;
52
- width: 100%;
53
- }
54
10
 
55
- .card {
56
- background: var(--skeleton-card-background);
11
+ .skeleton {
12
+ background: var(
13
+ --skeleton-card-background,
14
+ var(--skeleton-default-card-background)
15
+ );
16
+ width: var(
17
+ --skeleton-card-width,
18
+ var(--skeleton-default-card-width)
19
+ );
20
+ height: var(
21
+ --skeleton-card-height,
22
+ var(--skeleton-default-card-height)
23
+ );
24
+ max-width: var(
25
+ --skeleton-card-max-width,
26
+ var(--skeleton-default-card-max-width)
27
+ );
28
+ max-height: var(
29
+ --skeleton-card-max-height,
30
+ var(--skeleton-default-card-max-height)
31
+ );
32
+ min-width: var(
33
+ --skeleton-card-min-width,
34
+ var(--skeleton-default-card-min-width)
35
+ );
36
+ min-height: var(
37
+ --skeleton-card-min-height,
38
+ var(--skeleton-default-card-min-height)
39
+ );
40
+ padding: var(
41
+ --skeleton-card-padding,
42
+ var(--skeleton-default-card-padding)
43
+ );
57
44
  position: relative;
58
45
  border-radius: 5px;
59
46
  box-shadow: 0 10px 100px rgba(0, 0, 0, 0.1);
@@ -69,19 +56,22 @@ $:
69
56
  }
70
57
  }
71
58
 
72
- .card::before {
59
+ .skeleton::before {
73
60
  content: "";
74
61
  position: absolute;
75
62
  background: linear-gradient(
76
63
  90deg,
77
64
  transparent,
78
- var(--skeleton-animation-color),
65
+ var(
66
+ --skeleton-animation-color,
67
+ var(--skeleton-default-animation-color)
68
+ ),
79
69
  transparent
80
70
  );
81
71
  width: 50%;
82
72
  height: 100%;
83
73
  top: 0;
84
74
  left: 0;
85
- animation: loading 1s infinite;
75
+ animation: loading 1.2s infinite;
86
76
  }
87
77
  </style>
@@ -1,20 +1,8 @@
1
1
  import { SvelteComponent } from "svelte";
2
- export type SectionType = "image" | "text";
2
+ import '../../../css/main.css';
3
+ import './Skeleton.css';
3
4
  declare const __propDef: {
4
- props: {
5
- sections?: {
6
- type: SectionType;
7
- height?: string | undefined;
8
- }[] | undefined;
9
- maxWidth?: string | undefined;
10
- maxHeight?: string | undefined;
11
- minWidth?: string | undefined;
12
- minHeight?: string | undefined;
13
- width?: string | undefined;
14
- height?: string | undefined;
15
- padding?: string | undefined;
16
- dark?: boolean | undefined;
17
- };
5
+ props: Record<string, never>;
18
6
  events: {
19
7
  [evt: string]: CustomEvent<any>;
20
8
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@likable-hair/svelte",
3
3
  "description": "A Svelte component for likablehair and others",
4
- "version": "3.2.3",
4
+ "version": "3.2.4",
5
5
  "scripts": {
6
6
  "host": "vite --host",
7
7
  "dev": "vite dev",