@esportsplus/ui 0.5.4 → 0.5.5

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 (150) hide show
  1. package/.editorconfig +9 -9
  2. package/.gitattributes +2 -2
  3. package/.github/dependabot.yml +22 -22
  4. package/.github/workflows/bump.yml +6 -6
  5. package/.github/workflows/publish.yml +13 -13
  6. package/build/components/aurora/index.js +4 -4
  7. package/build/components/counter/index.js +16 -16
  8. package/build/components/ellipsis/index.js +6 -6
  9. package/build/components/footer/index.js +46 -46
  10. package/build/components/form/layout.js +10 -10
  11. package/build/components/magnet/index.js +7 -7
  12. package/build/components/scrollbar/index.js +9 -9
  13. package/build/components/site/index.js +5 -5
  14. package/lib.scss +1 -1
  15. package/package.json +25 -25
  16. package/src/components/accordion/index.ts +34 -34
  17. package/src/components/accordion/scss/index.scss +16 -16
  18. package/src/components/accordion/scss/variables.scss +9 -9
  19. package/src/components/anchor/scss/index.scss +41 -41
  20. package/src/components/anchor/scss/variables.scss +4 -4
  21. package/src/components/aurora/index.ts +21 -21
  22. package/src/components/aurora/scss/index.scss +59 -59
  23. package/src/components/banner/scss/index.scss +40 -40
  24. package/src/components/banner/scss/variables.scss +9 -9
  25. package/src/components/border/scss/index.scss +10 -10
  26. package/src/components/border/scss/variables.scss +6 -6
  27. package/src/components/bubble/scss/index.scss +30 -30
  28. package/src/components/bubble/scss/variables.scss +19 -19
  29. package/src/components/button/scss/index.scss +114 -114
  30. package/src/components/button/scss/variables.scss +66 -66
  31. package/src/components/card/scss/index.scss +35 -35
  32. package/src/components/card/scss/variables.scss +41 -41
  33. package/src/components/clipboard/index.ts +3 -3
  34. package/src/components/clipboard/write.ts +8 -8
  35. package/src/components/container/scss/index.scss +8 -8
  36. package/src/components/container/scss/variables.scss +5 -5
  37. package/src/components/counter/index.ts +93 -93
  38. package/src/components/counter/scss/index.scss +61 -61
  39. package/src/components/counter/scss/variables.scss +26 -26
  40. package/src/components/ellipsis/index.ts +9 -9
  41. package/src/components/ellipsis/scss/index.scss +27 -27
  42. package/src/components/ellipsis/scss/variables.scss +4 -4
  43. package/src/components/footer/index.ts +78 -78
  44. package/src/components/footer/scss/index.scss +25 -25
  45. package/src/components/form/action.ts +80 -80
  46. package/src/components/form/index.ts +5 -5
  47. package/src/components/form/input.ts +14 -14
  48. package/src/components/form/layout.ts +25 -25
  49. package/src/components/form/types.ts +15 -15
  50. package/src/components/grid/scss/index.scss +9 -9
  51. package/src/components/grid/scss/variables.scss +5 -5
  52. package/src/components/group/scss/index.scss +36 -36
  53. package/src/components/group/scss/variables.scss +17 -17
  54. package/src/components/highlight/index.ts +47 -47
  55. package/src/components/highlight/scss/index.scss +4 -4
  56. package/src/components/highlight/scss/variables.scss +3 -3
  57. package/src/components/icon/scss/index.scss +16 -16
  58. package/src/components/icon/scss/variables.scss +7 -7
  59. package/src/components/json/download.ts +14 -14
  60. package/src/components/json/index.ts +3 -3
  61. package/src/components/link/scss/index.scss +28 -28
  62. package/src/components/link/scss/variables.scss +46 -46
  63. package/src/components/loading/scss/index.scss +16 -16
  64. package/src/components/loading/scss/variables.scss +5 -5
  65. package/src/components/magnet/index.ts +54 -54
  66. package/src/components/magnet/scss/index.scss +16 -16
  67. package/src/components/magnet/scss/variables.scss +4 -4
  68. package/src/components/modal/scss/index.scss +34 -34
  69. package/src/components/modal/scss/variables.scss +6 -6
  70. package/src/components/number/index.ts +23 -23
  71. package/src/components/page/index.ts +14 -14
  72. package/src/components/page/scss/index.scss +31 -31
  73. package/src/components/page/scss/variables.scss +15 -15
  74. package/src/components/root/index.ts +4 -4
  75. package/src/components/root/onclick.ts +20 -20
  76. package/src/components/root/scss/index.scss +94 -94
  77. package/src/components/root/scss/variables.scss +99 -99
  78. package/src/components/row/scss/index.scss +7 -7
  79. package/src/components/scrollbar/index.ts +43 -43
  80. package/src/components/scrollbar/scss/index.scss +70 -70
  81. package/src/components/scrollbar/scss/variables.scss +6 -6
  82. package/src/components/sidebar/scss/index.scss +49 -49
  83. package/src/components/sidebar/scss/variables.scss +20 -20
  84. package/src/components/site/index.ts +26 -26
  85. package/src/components/site/scss/index.scss +3 -3
  86. package/src/components/text/scss/index.scss +9 -9
  87. package/src/components/text/scss/variables.scss +8 -8
  88. package/src/components/thumbnail/scss/index.scss +7 -7
  89. package/src/components/thumbnail/scss/variables.scss +7 -7
  90. package/src/components/tooltip/index.ts +84 -84
  91. package/src/components/tooltip/scss/_center.scss +13 -13
  92. package/src/components/tooltip/scss/_east.scss +34 -34
  93. package/src/components/tooltip/scss/_north.scss +34 -34
  94. package/src/components/tooltip/scss/_south.scss +35 -35
  95. package/src/components/tooltip/scss/_west.scss +34 -34
  96. package/src/components/tooltip/scss/index.scss +93 -93
  97. package/src/components/tooltip/scss/variables.scss +24 -24
  98. package/src/components/truncate/index.ts +13 -13
  99. package/src/css-utilities/[margin,padding]/scss/index.scss +41 -41
  100. package/src/css-utilities/[margin,padding]/scss/variables.scss +54 -54
  101. package/src/css-utilities/absolute/scss/index.scss +36 -36
  102. package/src/css-utilities/background/scss/variables.scss +27 -27
  103. package/src/css-utilities/border/scss/index.scss +21 -21
  104. package/src/css-utilities/border/scss/variables.scss +66 -66
  105. package/src/css-utilities/color/scss/variables.scss +31 -31
  106. package/src/css-utilities/disabled/scss/index.scss +4 -4
  107. package/src/css-utilities/flex/scss/index.scss +65 -65
  108. package/src/css-utilities/glass/scss/index.scss +2 -2
  109. package/src/css-utilities/glass/scss/variables.scss +2 -2
  110. package/src/css-utilities/hidden/scss/index.scss +28 -28
  111. package/src/css-utilities/index.scss +14 -14
  112. package/src/css-utilities/inline/scss/index.scss +7 -7
  113. package/src/css-utilities/line-height/scss/variables.scss +10 -10
  114. package/src/css-utilities/not-allowed/scss/index.scss +7 -7
  115. package/src/css-utilities/overflow/scss/index.scss +4 -4
  116. package/src/css-utilities/pointer/scss/index.scss +5 -5
  117. package/src/css-utilities/size/scss/variables.scss +12 -12
  118. package/src/css-utilities/squircle/scss/index.scss +4 -4
  119. package/src/css-utilities/text/scss/index.scss +89 -89
  120. package/src/css-utilities/text/scss/variables.scss +31 -31
  121. package/src/css-utilities/viewport/scss/index.scss +4 -4
  122. package/src/css-utilities/width/scss/index.scss +3 -3
  123. package/src/css-utilities/width/scss/variables.scss +9 -9
  124. package/src/index.ts +16 -16
  125. package/src/lib/index.scss +7 -7
  126. package/src/lib/scss/breakpoint.scss +41 -41
  127. package/src/lib/scss/color.scss +1 -1
  128. package/src/lib/scss/css-variables.scss +13 -13
  129. package/src/lib/scss/list.scss +76 -76
  130. package/src/lib/scss/map.scss +1 -1
  131. package/src/lib/scss/position.scss +53 -53
  132. package/src/lib/scss/string.scss +33 -33
  133. package/src/tokens/index.scss +11 -11
  134. package/src/tokens/scss/border-radius.scss +12 -12
  135. package/src/tokens/scss/border-width.scss +6 -6
  136. package/src/tokens/scss/box-shadow.scss +21 -21
  137. package/src/tokens/scss/color.scss +64 -64
  138. package/src/tokens/scss/font-size.scss +16 -16
  139. package/src/tokens/scss/font-weight.scss +6 -6
  140. package/src/tokens/scss/line-height.scss +6 -6
  141. package/src/tokens/scss/size.scss +13 -13
  142. package/src/tokens/scss/spacer.scss +8 -8
  143. package/src/tokens/scss/state.scss +86 -86
  144. package/src/tokens/scss/transition-duration.scss +1 -1
  145. package/storage/fonts/montserrat/index.css +79 -79
  146. package/tokens.scss +1 -1
  147. package/tsconfig.json +2 -2
  148. package/utilities/styles.css +1 -1
  149. package/utilities/variables.css +1 -1
  150. package/webpack.config.ts +25 -25
@@ -1,6 +1,6 @@
1
- .grid {
2
- --margin-horizontal: var(--size-400);
3
- --margin-vertical: var(--size-400);
4
- --max-width: 1fr;
5
- --min-width: 200px;
1
+ .grid {
2
+ --margin-horizontal: var(--size-400);
3
+ --margin-vertical: var(--size-400);
4
+ --max-width: 1fr;
5
+ --min-width: 200px;
6
6
  }
@@ -1,36 +1,36 @@
1
- .group {
2
- display: flex;
3
- flex-wrap: wrap;
4
- justify-content: flex-start;
5
- margin: 0 calc(var(--margin-horizontal) / -2);
6
- position: relative;
7
- width: calc(100% + var(--margin-horizontal));
8
-
9
-
10
- &--offset {
11
- @each $direction in 'bottom' 'top' {
12
- &-#{$direction} {
13
- margin-#{$direction}: calc(var(--margin-vertical) * -1);
14
- }
15
- }
16
- }
17
-
18
- &--scroller {
19
- flex-flow: row;
20
- margin-bottom: calc(var(--scrollbar-width) * -1);
21
- overflow-y: hidden;
22
- padding-bottom: var(--scrollbar-width);
23
- }
24
-
25
-
26
- &-item {
27
- display: flex;
28
- margin: var(--margin-vertical) calc(var(--margin-horizontal) / 2) 0;
29
- position: relative;
30
- width: var(--width);
31
-
32
- &[class*='--width'] {
33
- width: calc(var(--width) - var(--margin-horizontal));
34
- }
35
- }
36
- }
1
+ .group {
2
+ display: flex;
3
+ flex-wrap: wrap;
4
+ justify-content: flex-start;
5
+ margin: 0 calc(var(--margin-horizontal) / -2);
6
+ position: relative;
7
+ width: calc(100% + var(--margin-horizontal));
8
+
9
+
10
+ &--offset {
11
+ @each $direction in 'bottom' 'top' {
12
+ &-#{$direction} {
13
+ margin-#{$direction}: calc(var(--margin-vertical) * -1);
14
+ }
15
+ }
16
+ }
17
+
18
+ &--scroller {
19
+ flex-flow: row;
20
+ margin-bottom: calc(var(--scrollbar-width) * -1);
21
+ overflow-y: hidden;
22
+ padding-bottom: var(--scrollbar-width);
23
+ }
24
+
25
+
26
+ &-item {
27
+ display: flex;
28
+ margin: var(--margin-vertical) calc(var(--margin-horizontal) / 2) 0;
29
+ position: relative;
30
+ width: var(--width);
31
+
32
+ &[class*='--width'] {
33
+ width: calc(var(--width) - var(--margin-horizontal));
34
+ }
35
+ }
36
+ }
@@ -1,17 +1,17 @@
1
- .group {
2
- --margin-horizontal: var(--size-400);
3
- --width: auto;
4
-
5
-
6
- &.--flex-column {
7
- .group-item {
8
- --width: 100%;
9
- }
10
- }
11
-
12
- &--scroller {
13
- .group-item {
14
- --margin-vertical: 0px;
15
- }
16
- }
17
- }
1
+ .group {
2
+ --margin-horizontal: var(--size-400);
3
+ --width: auto;
4
+
5
+
6
+ &.--flex-column {
7
+ .group-item {
8
+ --width: 100%;
9
+ }
10
+ }
11
+
12
+ &--scroller {
13
+ .group-item {
14
+ --margin-vertical: 0px;
15
+ }
16
+ }
17
+ }
@@ -1,48 +1,48 @@
1
- import { reactive } from '@esportsplus/reactivity'
2
-
3
-
4
- let key = Symbol(),
5
- observer: IntersectionObserver | null = null;
6
-
7
-
8
- export default (background: string) => {
9
- if (observer === null) {
10
- observer = new IntersectionObserver((entries) => {
11
- let disconnected = 0,
12
- n = entries.length;
13
-
14
- for (let i = 0; i < n; i++) {
15
- let { isIntersecting, target } = entries[i];
16
-
17
- if (target.isConnected) {
18
- // @ts-ignore
19
- target[key].highlight = +isIntersecting;
20
- }
21
- else {
22
- disconnected++;
23
- observer!.unobserve(target);
24
- }
25
- }
26
-
27
- if (n - disconnected === 0) {
28
- observer!.disconnect();
29
- observer = null;
30
- }
31
- }, { threshold: 1 });
32
- }
33
-
34
- let state = reactive({
35
- highlight: 0
36
- });
37
-
38
- return {
39
- attributes: {
40
- class: 'highlight',
41
- onrender: function(element: HTMLElement & Record<PropertyKey, unknown>) {
42
- element[key] = state;
43
- observer!.observe(element);
44
- },
45
- style: [ `--background: ${background}`, () => `--highlight: ${state.highlight}` ]
46
- }
47
- };
1
+ import { reactive } from '@esportsplus/reactivity'
2
+
3
+
4
+ let key = Symbol(),
5
+ observer: IntersectionObserver | null = null;
6
+
7
+
8
+ export default (background: string) => {
9
+ if (observer === null) {
10
+ observer = new IntersectionObserver((entries) => {
11
+ let disconnected = 0,
12
+ n = entries.length;
13
+
14
+ for (let i = 0; i < n; i++) {
15
+ let { isIntersecting, target } = entries[i];
16
+
17
+ if (target.isConnected) {
18
+ // @ts-ignore
19
+ target[key].highlight = +isIntersecting;
20
+ }
21
+ else {
22
+ disconnected++;
23
+ observer!.unobserve(target);
24
+ }
25
+ }
26
+
27
+ if (n - disconnected === 0) {
28
+ observer!.disconnect();
29
+ observer = null;
30
+ }
31
+ }, { threshold: 1 });
32
+ }
33
+
34
+ let state = reactive({
35
+ highlight: 0
36
+ });
37
+
38
+ return {
39
+ attributes: {
40
+ class: 'highlight',
41
+ onrender: function(element: HTMLElement & Record<PropertyKey, unknown>) {
42
+ element[key] = state;
43
+ observer!.observe(element);
44
+ },
45
+ style: [ `--background: ${background}`, () => `--highlight: ${state.highlight}` ]
46
+ }
47
+ };
48
48
  }
@@ -1,5 +1,5 @@
1
- .highlight {
2
- background: linear-gradient(90deg, var(--background) 50%, transparent 50%) 110% 0 / 200% 100% no-repeat;
3
- background-position: calc((1 - var(--highlight)) * 110%) 0;
4
- transition: background-position 0.32s;
1
+ .highlight {
2
+ background: linear-gradient(90deg, var(--background) 50%, transparent 50%) 110% 0 / 200% 100% no-repeat;
3
+ background-position: calc((1 - var(--highlight)) * 110%) 0;
4
+ transition: background-position 0.32s;
5
5
  }
@@ -1,4 +1,4 @@
1
- .highlight {
2
- --background: transparent;
3
- --highlight: 1;
1
+ .highlight {
2
+ --background: transparent;
3
+ --highlight: 1;
4
4
  }
@@ -1,16 +1,16 @@
1
- .icon {
2
- color: var(--color);
3
- display: flex;
4
- flex: 0 0 var(--width);
5
- height: var(--height);
6
- position: relative;
7
- width: var(--width);
8
-
9
-
10
- svg {
11
- color: currentColor;
12
- fill: currentColor;
13
- height: 100%;
14
- width: 100%;
15
- }
16
- }
1
+ .icon {
2
+ color: var(--color);
3
+ display: flex;
4
+ flex: 0 0 var(--width);
5
+ height: var(--height);
6
+ position: relative;
7
+ width: var(--width);
8
+
9
+
10
+ svg {
11
+ color: currentColor;
12
+ fill: currentColor;
13
+ height: 100%;
14
+ width: 100%;
15
+ }
16
+ }
@@ -1,7 +1,7 @@
1
- .icon {
2
- --color: inherit;
3
- --height: var(--size);
4
- --margin-horizontal: var(--size-300);
5
- --size: var(--size-400);
6
- --width: var(--size);
7
- }
1
+ .icon {
2
+ --color: inherit;
3
+ --height: var(--size);
4
+ --margin-horizontal: var(--size-300);
5
+ --size: var(--size-400);
6
+ --width: var(--size);
7
+ }
@@ -1,15 +1,15 @@
1
- export default (content: any[] | Record<string, any>, name: string) => {
2
- let link = document.createElement('a');
3
-
4
- link.download = name + '.json';
5
- link.href = window.URL.createObjectURL(new Blob(
6
- [ JSON.stringify(content) ],
7
- { type: 'application/json' }
8
- ));
9
-
10
- document.body.appendChild(link);
11
-
12
- link.click();
13
-
14
- document.body.removeChild(link);
1
+ export default (content: any[] | Record<string, any>, name: string) => {
2
+ let link = document.createElement('a');
3
+
4
+ link.download = name + '.json';
5
+ link.href = window.URL.createObjectURL(new Blob(
6
+ [ JSON.stringify(content) ],
7
+ { type: 'application/json' }
8
+ ));
9
+
10
+ document.body.appendChild(link);
11
+
12
+ link.click();
13
+
14
+ document.body.removeChild(link);
15
15
  };
@@ -1,4 +1,4 @@
1
- import download from './download';
2
-
3
-
1
+ import download from './download';
2
+
3
+
4
4
  export default { download };
@@ -1,28 +1,28 @@
1
- @use '/tokens';
2
-
3
- .link {
4
- align-content: center;
5
- background: var(--background);
6
- color: var(--color);
7
- cursor: pointer;
8
- display: flex;
9
- flex-wrap: wrap;
10
- font-size: var(--font-size);
11
- justify-content: flex-start;
12
- line-height: var(--line-height);
13
- padding: calc(var(--padding-vertical) - var(--border-width)) calc(var(--padding-horizontal) - var(--border-width));
14
- position: relative;
15
- transition:
16
- background var(--transition-duration) ease-in-out,
17
- border-color var(--transition-duration) ease-in-out,
18
- color var(--transition-duration) ease-in-out,
19
- opacity var(--transition-duration) ease-in-out;
20
- width: var(--width);
21
-
22
-
23
- &--underline {
24
- @include tokens.state(active hover) {
25
- text-decoration: underline;
26
- }
27
- }
28
- }
1
+ @use '/tokens';
2
+
3
+ .link {
4
+ align-content: center;
5
+ background: var(--background);
6
+ color: var(--color);
7
+ cursor: pointer;
8
+ display: flex;
9
+ flex-wrap: wrap;
10
+ font-size: var(--font-size);
11
+ justify-content: flex-start;
12
+ line-height: var(--line-height);
13
+ padding: calc(var(--padding-vertical) - var(--border-width)) calc(var(--padding-horizontal) - var(--border-width));
14
+ position: relative;
15
+ transition:
16
+ background var(--transition-duration) ease-in-out,
17
+ border-color var(--transition-duration) ease-in-out,
18
+ color var(--transition-duration) ease-in-out,
19
+ opacity var(--transition-duration) ease-in-out;
20
+ width: var(--width);
21
+
22
+
23
+ &--underline {
24
+ @include tokens.state(active hover) {
25
+ text-decoration: underline;
26
+ }
27
+ }
28
+ }
@@ -1,46 +1,46 @@
1
- @use '/tokens';
2
-
3
- .link {
4
- --background: var(--background-default);
5
- --background-active: var(--background-default);
6
- --background-default: transparent;
7
- --background-hover: var(--background-default);
8
- --background-pressed: var(--background-default);
9
- --border-color: var(--border-color-default);
10
- --border-color-active: var(--border-color-default);
11
- --border-color-default: var(--background);
12
- --border-color-hover: var(--border-color-default);
13
- --border-color-pressed: var(--border-color-default);
14
- --border-radius: var(--border-radius-400);
15
- --border-width: 0px;
16
- --color: var(--color-default);
17
- --color-active: var(--color-default);
18
- --color-default: var(--color-text-400);
19
- --color-hover: var(--color-default);
20
- --color-pressed: var(--color-default);
21
- --font-size: var(--font-size-400);
22
- --font-weight: var(--font-weight-500);
23
- --line-height: var(--line-height-400);
24
- --padding-horizontal: 0px;
25
- --padding-vertical: var(--size-400);
26
- --width: auto;
27
-
28
-
29
- @include tokens.state(active) {
30
- --background: var(--background-active);
31
- --border-color: var(--border-color-active);
32
- --color: var(--color-active);
33
- }
34
-
35
- @include tokens.state(hover) {
36
- --background: var(--background-hover);
37
- --border-color: var(--border-color-hover);
38
- --color: var(--color-hover);
39
- }
40
-
41
- @include tokens.state(pressed) {
42
- --background: var(--background-pressed);
43
- --border-color: var(--border-color-pressed);
44
- --color: var(--color-pressed);
45
- }
46
- }
1
+ @use '/tokens';
2
+
3
+ .link {
4
+ --background: var(--background-default);
5
+ --background-active: var(--background-default);
6
+ --background-default: transparent;
7
+ --background-hover: var(--background-default);
8
+ --background-pressed: var(--background-default);
9
+ --border-color: var(--border-color-default);
10
+ --border-color-active: var(--border-color-default);
11
+ --border-color-default: var(--background);
12
+ --border-color-hover: var(--border-color-default);
13
+ --border-color-pressed: var(--border-color-default);
14
+ --border-radius: var(--border-radius-400);
15
+ --border-width: 0px;
16
+ --color: var(--color-default);
17
+ --color-active: var(--color-default);
18
+ --color-default: var(--color-text-400);
19
+ --color-hover: var(--color-default);
20
+ --color-pressed: var(--color-default);
21
+ --font-size: var(--font-size-400);
22
+ --font-weight: var(--font-weight-500);
23
+ --line-height: var(--line-height-400);
24
+ --padding-horizontal: 0px;
25
+ --padding-vertical: var(--size-400);
26
+ --width: auto;
27
+
28
+
29
+ @include tokens.state(active) {
30
+ --background: var(--background-active);
31
+ --border-color: var(--border-color-active);
32
+ --color: var(--color-active);
33
+ }
34
+
35
+ @include tokens.state(hover) {
36
+ --background: var(--background-hover);
37
+ --border-color: var(--border-color-hover);
38
+ --color: var(--color-hover);
39
+ }
40
+
41
+ @include tokens.state(pressed) {
42
+ --background: var(--background-pressed);
43
+ --border-color: var(--border-color-pressed);
44
+ --color: var(--color-pressed);
45
+ }
46
+ }
@@ -1,17 +1,17 @@
1
- .loading {
2
- animation: Loading var(--animation-duration) linear infinite;
3
- border: var(--border-width) solid color-mix(in srgb, var(--border-color), transparent 90%);
4
- border-left-color: var(--border-color);
5
- border-radius: 100%;
6
- height: var(--size);
7
- width: var(--size);
8
- }
9
-
10
- @keyframes Loading {
11
- 0% {
12
- transform: rotate(0deg)
13
- }
14
- 100% {
15
- transform: rotate(360deg)
16
- }
1
+ .loading {
2
+ animation: Loading var(--animation-duration) linear infinite;
3
+ border: var(--border-width) solid color-mix(in srgb, var(--border-color), transparent 90%);
4
+ border-left-color: var(--border-color);
5
+ border-radius: 100%;
6
+ height: var(--size);
7
+ width: var(--size);
8
+ }
9
+
10
+ @keyframes Loading {
11
+ 0% {
12
+ transform: rotate(0deg)
13
+ }
14
+ 100% {
15
+ transform: rotate(360deg)
16
+ }
17
17
  }
@@ -1,6 +1,6 @@
1
- .loading {
2
- --animation-duration: 0.64s;
3
- --border-color: var(--color);
4
- --border-width: var(--border-width-400);
5
- --size: var(--size-400);
1
+ .loading {
2
+ --animation-duration: 0.64s;
3
+ --border-color: var(--color);
4
+ --border-width: var(--border-width-400);
5
+ --size: var(--size-400);
6
6
  }
@@ -1,55 +1,55 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html } from '@esportsplus/template';
3
-
4
-
5
- export default ({ attributes, hide }: { attributes?: Record<string, unknown>, hide?: boolean }) => {
6
- let active = false,
7
- events: Record<string, Function> = {
8
- onmouseover: function (this: HTMLElement) {
9
- let { offsetHeight, offsetLeft, offsetTop, offsetWidth } = this;
10
-
11
- active = true;
12
-
13
- state.height = offsetHeight;
14
- state.left = offsetLeft;
15
- state.opacity = 1;
16
- state.top = offsetTop;
17
- state.width = offsetWidth;
18
- }
19
- },
20
- state = reactive({
21
- height: null as number | null,
22
- hide: true,
23
- left: 0,
24
- opacity: 0,
25
- top: 0,
26
- width: 0
27
- });
28
-
29
- if (hide === true) {
30
- events.onmouseout = () => {
31
- active = false;
32
- setTimeout(() => {
33
- if (active === true) {
34
- return;
35
- }
36
-
37
- state.opacity = 0;
38
- }, 50);
39
- };
40
- }
41
-
42
- return {
43
- html: html`
44
- <div class='magnet' style='${() => `
45
- height: ${state.height ? `${state.height}px` : '100%'};
46
- opacity: ${state.opacity};
47
- transform: translate(${state.left}px, ${state.top}px);
48
- width: ${state.width}px;
49
- `}' ${attributes}></div>
50
- `,
51
- sibling: {
52
- attributes: events
53
- }
54
- };
1
+ import { reactive } from '@esportsplus/reactivity';
2
+ import { html } from '@esportsplus/template';
3
+
4
+
5
+ export default ({ attributes, hide }: { attributes?: Record<string, unknown>, hide?: boolean }) => {
6
+ let active = false,
7
+ events: Record<string, Function> = {
8
+ onmouseover: function (this: HTMLElement) {
9
+ let { offsetHeight, offsetLeft, offsetTop, offsetWidth } = this;
10
+
11
+ active = true;
12
+
13
+ state.height = offsetHeight;
14
+ state.left = offsetLeft;
15
+ state.opacity = 1;
16
+ state.top = offsetTop;
17
+ state.width = offsetWidth;
18
+ }
19
+ },
20
+ state = reactive({
21
+ height: null as number | null,
22
+ hide: true,
23
+ left: 0,
24
+ opacity: 0,
25
+ top: 0,
26
+ width: 0
27
+ });
28
+
29
+ if (hide === true) {
30
+ events.onmouseout = () => {
31
+ active = false;
32
+ setTimeout(() => {
33
+ if (active === true) {
34
+ return;
35
+ }
36
+
37
+ state.opacity = 0;
38
+ }, 50);
39
+ };
40
+ }
41
+
42
+ return {
43
+ html: html`
44
+ <div class='magnet' style='${() => `
45
+ height: ${state.height ? `${state.height}px` : '100%'};
46
+ opacity: ${state.opacity};
47
+ transform: translate(${state.left}px, ${state.top}px);
48
+ width: ${state.width}px;
49
+ `}' ${attributes}></div>
50
+ `,
51
+ sibling: {
52
+ attributes: events
53
+ }
54
+ };
55
55
  };
@@ -1,16 +1,16 @@
1
- @use '/lib';
2
-
3
- .magnet {
4
- @include lib.position(absolute, 0 null null 0);
5
- background: var(--background);
6
- border-radius: var(--border-radius);
7
- height: 0;
8
- opacity: 0;
9
- transition:
10
- height var(--transition-duration) var(--timing-function),
11
- opacity var(--transition-duration) var(--timing-function),
12
- transform var(--transition-duration) var(--timing-function),
13
- width var(--transition-duration) var(--timing-function);
14
- width: 0;
15
- z-index: -1;
16
- }
1
+ @use '/lib';
2
+
3
+ .magnet {
4
+ @include lib.position(absolute, 0 null null 0);
5
+ background: var(--background);
6
+ border-radius: var(--border-radius);
7
+ height: 0;
8
+ opacity: 0;
9
+ transition:
10
+ height var(--transition-duration) var(--timing-function),
11
+ opacity var(--transition-duration) var(--timing-function),
12
+ transform var(--transition-duration) var(--timing-function),
13
+ width var(--transition-duration) var(--timing-function);
14
+ width: 0;
15
+ z-index: -1;
16
+ }