@likable-hair/svelte 3.2.2 → 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.
@@ -25,77 +25,77 @@ export let name, value, id = void 0, checked = false, label = void 0, disabled =
25
25
  {/if}
26
26
 
27
27
  <style>
28
- @supports (-webkit-appearance: none) or (-moz-appearance: none) {
29
- input[type="radio"] {
30
- -webkit-appearance: none;
31
- -moz-appearance: none;
32
- height: 21px;
33
- width: 21px;
34
- outline: none;
35
- display: inline-block;
36
- vertical-align: top;
37
- position: relative;
38
- margin: 0;
39
- cursor: pointer;
40
- border-radius: 50%;
41
- border: 1px solid var(--bc, var(--radio-button-border-color, var(--radio-button-default-border-color)));
42
- background: var(--b, var(--radio-button-background-color, var(--radio-button-default-background-color)));
43
- transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
44
- }
28
+ @supports (-webkit-appearance: none) or (-moz-appearance: none) {
29
+ input[type="radio"] {
30
+ -webkit-appearance: none;
31
+ -moz-appearance: none;
32
+ height: 21px;
33
+ width: 21px;
34
+ outline: none;
35
+ display: inline-block;
36
+ vertical-align: top;
37
+ position: relative;
38
+ margin: 0;
39
+ cursor: pointer;
40
+ border-radius: 50%;
41
+ border: 1px solid var(--bc, var(--radio-button-border-color, var(--radio-button-default-border-color)));
42
+ background: var(--b, var(--radio-button-background-color, var(--radio-button-default-background-color)));
43
+ transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
44
+ }
45
45
 
46
- input[type="radio"]:after {
47
- content: "";
48
- display: block;
49
- position: absolute;
50
- width: 19px;
51
- height: 19px;
52
- border-radius: 50%;
53
- background: var(--radio-button-active-inner-color, var(--radio-button-default-active-inner-color));
54
- opacity: var(--o, 0);
55
- transform: scale(var(--s, 0.7));
56
- transition: transform 0.3s ease, opacity 0.2s;
57
- }
46
+ input[type="radio"]:after {
47
+ content: "";
48
+ display: block;
49
+ position: absolute;
50
+ width: 19px;
51
+ height: 19px;
52
+ border-radius: 50%;
53
+ background: var(--radio-button-active-inner-color, var(--radio-button-default-active-inner-color));
54
+ opacity: var(--o, 0);
55
+ transform: scale(var(--s, 0.7));
56
+ transition: transform 0.3s ease, opacity 0.2s;
57
+ }
58
58
 
59
- input[type="radio"]:checked:not(:disabled) {
60
- --b: var(--radio-button-active-color, var(--radio-button-default-active-color));
61
- --bc: var(--radio-button-active-color, var(--radio-button-default-active-color));
62
- --o: 1;
63
- --s: 0.5;
64
- }
59
+ input[type="radio"]:checked:not(:disabled) {
60
+ --b: var(--radio-button-active-color, var(--radio-button-default-active-color));
61
+ --bc: var(--radio-button-active-color, var(--radio-button-default-active-color));
62
+ --o: 1;
63
+ --s: 0.5;
64
+ }
65
65
 
66
- input[type="radio"]:disabled {
67
- --b: var(--radio-button-disabled-color, var(--radio-button-default-disabled-color));
68
- --bc: var(--radio-button-disabled-active-color, var(--radio-button-default-disabled-active-color));
69
- cursor: not-allowed;
70
- opacity: 0.9;
71
- }
66
+ input[type="radio"]:disabled {
67
+ --b: var(--radio-button-disabled-color, var(--radio-button-default-disabled-color));
68
+ --bc: var(--radio-button-disabled-active-color, var(--radio-button-default-disabled-active-color));
69
+ cursor: not-allowed;
70
+ opacity: 0.9;
71
+ }
72
72
 
73
- input[type="radio"]:disabled:checked {
74
- --b: var(--radio-button-disabled-active-color, var(--radio-button-default-disabled-active-color));
75
- --bc: var(--radio-button-border-color, var(--radio-button-default-border-color));
76
- --o: 1;
77
- --s: 0.5;
78
- }
73
+ input[type="radio"]:disabled:checked {
74
+ --b: var(--radio-button-disabled-active-color, var(--radio-button-default-disabled-active-color));
75
+ --bc: var(--radio-button-border-color, var(--radio-button-default-border-color));
76
+ --o: 1;
77
+ --s: 0.5;
78
+ }
79
79
 
80
- input[type="radio"]:hover:not(:checked):not(:disabled) {
81
- --bc: var(--radio-button-border-hover-color, var(--radio-button-default-border-hover-color));
82
- }
80
+ input[type="radio"]:hover:not(:checked):not(:disabled) {
81
+ --bc: var(--radio-button-border-hover-color, var(--radio-button-default-border-hover-color));
82
+ }
83
83
 
84
- input[type="radio"]:focus {
85
- box-shadow: 0 0 0 var(--radio-button-focus-shadow, var(--radio-button-default-focus-shadow));
86
- }
84
+ input[type="radio"]:focus {
85
+ box-shadow: 0 0 0 var(--radio-button-focus-shadow, var(--radio-button-default-focus-shadow));
86
+ }
87
87
 
88
- input[type="radio"] + label {
89
- font-size: 14px;
90
- line-height: 21px;
91
- display: inline-block;
92
- vertical-align: top;
93
- cursor: pointer;
94
- margin-left: 4px;
95
- }
88
+ input[type="radio"] + label {
89
+ font-size: 14px;
90
+ line-height: 21px;
91
+ display: inline-block;
92
+ vertical-align: top;
93
+ cursor: pointer;
94
+ margin-left: 4px;
95
+ }
96
96
 
97
- input[type="radio"]:disabled + label {
98
- cursor: not-allowed;
99
- }
97
+ input[type="radio"]:disabled + label {
98
+ cursor: not-allowed;
100
99
  }
101
- </style>
100
+ }
101
+ </style>
@@ -39,7 +39,6 @@ onMount(() => {
39
39
  if (!!th) {
40
40
  let { paddingLeft, paddingRight } = getComputedStyle(th);
41
41
  let width = resizedColumnSizeWithPadding[head.value] - parseFloat(paddingLeft) - parseFloat(paddingRight);
42
- console.log(resizedColumnSizeWithPadding[head.value], paddingLeft, paddingRight, width);
43
42
  th.style.width = `${width}px`;
44
43
  }
45
44
  }
@@ -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.2",
4
+ "version": "3.2.4",
5
5
  "scripts": {
6
6
  "host": "vite --host",
7
7
  "dev": "vite dev",