@esportsplus/ui 0.6.1 → 0.7.2
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/build/components/link/hover.d.ts +10 -0
- package/build/components/link/hover.js +17 -0
- package/build/components/link/index.d.ts +12 -0
- package/build/components/link/index.js +2 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/components/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/link/hover.ts +19 -0
- package/src/components/link/index.ts +4 -0
- package/src/components/link/scss/index.scss +37 -0
- package/src/components/root/scss/variables.scss +2 -1
- package/src/index.ts +1 -0
- package/src/lib/scss/breakpoint.scss +1 -1
- package/src/lib/scss/css-variables.scss +5 -2
- package/src/lib/scss/list.scss +6 -5
- package/src/lib/scss/position.scss +11 -9
- package/src/lib/scss/string.scss +2 -1
- package/src/tokens/scss/state.scss +3 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { html } from '@esportsplus/template';
|
|
2
|
+
export default ({ attributes, content }) => {
|
|
3
|
+
return {
|
|
4
|
+
attributes: {
|
|
5
|
+
class: 'link--hover'
|
|
6
|
+
},
|
|
7
|
+
content: html `
|
|
8
|
+
<span class='link-hover link-hover--one' ${attributes}>
|
|
9
|
+
${content}
|
|
10
|
+
</span>
|
|
11
|
+
|
|
12
|
+
<span class='link-hover link-hover--two' ${attributes}>
|
|
13
|
+
${content}
|
|
14
|
+
</span>
|
|
15
|
+
`
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
hover: ({ attributes, content }: {
|
|
3
|
+
attributes?: Record<string, any>;
|
|
4
|
+
content: any;
|
|
5
|
+
}) => {
|
|
6
|
+
attributes: {
|
|
7
|
+
class: string;
|
|
8
|
+
};
|
|
9
|
+
content: import("@esportsplus/template/build/types").RenderableTemplate;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
package/build/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { default as counter } from './components/counter';
|
|
|
5
5
|
export { default as ellipsis } from './components/ellipsis';
|
|
6
6
|
export { default as form } from './components/form';
|
|
7
7
|
export { default as json } from './components/json';
|
|
8
|
+
export { default as link } from './components/link';
|
|
8
9
|
export { default as loader } from './components/loader';
|
|
9
10
|
export { default as loading } from './components/loading';
|
|
10
11
|
export { default as magnet } from './components/magnet';
|
package/build/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { default as counter } from './components/counter';
|
|
|
5
5
|
export { default as ellipsis } from './components/ellipsis';
|
|
6
6
|
export { default as form } from './components/form';
|
|
7
7
|
export { default as json } from './components/json';
|
|
8
|
+
export { default as link } from './components/link';
|
|
8
9
|
export { default as loader } from './components/loader';
|
|
9
10
|
export { default as loading } from './components/loading';
|
|
10
11
|
export { default as magnet } from './components/magnet';
|
package/components/styles.css
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
.group{display:flex;flex-wrap:wrap;justify-content:flex-start;margin:0 calc(var(--margin-horizontal)/-2);position:relative;width:calc(100% + var(--margin-horizontal))}.group--offset-bottom{margin-bottom:calc(var(--margin-vertical)*-1)}.group--offset-top{margin-top:calc(var(--margin-vertical)*-1)}.group--scroller{flex-flow:row;margin-bottom:calc(var(--scrollbar-width)*-1);overflow-y:hidden;padding-bottom:var(--scrollbar-width)}.group-item{display:flex;margin:var(--margin-vertical) calc(var(--margin-horizontal)/2) 0;position:relative;width:var(--width)}.group-item[class*="--width"]{width:calc(var(--width) - var(--margin-horizontal))}
|
|
15
15
|
.highlight{background:linear-gradient(90deg, var(--background) 50%, transparent 50%) 110% 0/200% 100% no-repeat;background-position:calc((1 - var(--highlight))*110%) 0;transition:background-position .32s}
|
|
16
16
|
.icon{color:var(--color);display:flex;flex:0 0 var(--width);height:var(--height);position:relative;width:var(--width)}.icon svg{color:currentColor;fill:currentColor;height:100%;width:100%}
|
|
17
|
-
.link{align-content:center;background:var(--background);color:var(--color);cursor:pointer;display:flex;flex-wrap:wrap;font-size:var(--font-size);justify-content:flex-start;line-height:var(--line-height);padding:calc(var(--padding-vertical) - var(--border-width)) calc(var(--padding-horizontal) - var(--border-width));position:relative;transition:background var(--transition-duration) ease-in-out,border-color var(--transition-duration) ease-in-out,color var(--transition-duration) ease-in-out,opacity var(--transition-duration) ease-in-out;width:var(--width)}.link--underline.--active,.link--underline:not(.--active):hover{text-decoration:underline}
|
|
17
|
+
.link{align-content:center;background:var(--background);color:var(--color);cursor:pointer;display:flex;flex-wrap:wrap;font-size:var(--font-size);justify-content:flex-start;line-height:var(--line-height);padding:calc(var(--padding-vertical) - var(--border-width)) calc(var(--padding-horizontal) - var(--border-width));position:relative;transition:background var(--transition-duration) ease-in-out,border-color var(--transition-duration) ease-in-out,color var(--transition-duration) ease-in-out,opacity var(--transition-duration) ease-in-out;width:var(--width)}.link--hover.tooltip:hover .link-hover--one,.link--hover:not(.--active):hover .link-hover--one{opacity:0;transform:translateY(-75%)}.link--hover.tooltip:hover .link-hover--two,.link--hover:not(.--active):hover .link-hover--two{opacity:1;transform:translate(50%, 50%)}.link--underline.--active,.link--underline:not(.--active):hover{text-decoration:underline}.link-hover{transition:opacity .3s ease-in-out,.3s cubic-bezier(0.23, 0.65, 0.74, 1.09)}.link-hover--one{transform:translateY(0)}.link-hover--two{position:absolute;bottom:50%;right:50%;transform:translate(50%, 50%);opacity:0;padding:0 var(--padding-horizontal);transform:translate(50%, 125%);white-space:nowrap}
|
|
18
18
|
.loader{background-color:var(--color-black-500);bottom:0;left:0;position:fixed;opacity:1;pointer-events:none;right:0;top:0;transition:all .3s ease-in-out;visibility:visible;z-index:9999}.loader--load{animation:.6s .2s ease-in-out 1 both move}.loader--load .loader--load{animation:.6s ease-in-out 1 both move}@keyframes move{0%{transform:translateY(0)}80%{transform:translateY(-102%)}100%{transform:translateY(-102%)}}.loader .loader{background-color:var(--color-black-400)}.loader-content{bottom:auto;left:50%;position:absolute;right:auto;top:50%;transform:translateX(-50%) translateY(-50%)}.loader-logo{color:#fff}.loader-logo--scale{animation:scale .32s 1;animation-fill-mode:both}@keyframes scale{from{opacity:1;transform:scale3d(1, 1, 1)}to{opacity:0;transform:scale3d(1.8, 1.8, 1.8)}}
|
|
19
19
|
.loading{animation:Loading var(--animation-duration) linear infinite;border:var(--border-width) solid color-mix(in srgb, var(--border-color), transparent 90%);border-left-color:var(--border-color);border-radius:100%;height:var(--size);width:var(--size)}@keyframes Loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}
|
|
20
20
|
.magnet{position:absolute;top:0;left:0;background:var(--background);border-radius:var(--border-radius);height:0;opacity:0;transition:height var(--transition-duration) var(--timing-function),opacity var(--transition-duration) var(--timing-function),transform var(--transition-duration) var(--timing-function),width var(--transition-duration) var(--timing-function);width:0;z-index:-1}
|
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { html } from '@esportsplus/template';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export default ({ attributes, content }: { attributes?: Record<string, any>, content: any }) => {
|
|
5
|
+
return {
|
|
6
|
+
attributes: {
|
|
7
|
+
class: 'link--hover'
|
|
8
|
+
},
|
|
9
|
+
content: html`
|
|
10
|
+
<span class='link-hover link-hover--one' ${attributes}>
|
|
11
|
+
${content}
|
|
12
|
+
</span>
|
|
13
|
+
|
|
14
|
+
<span class='link-hover link-hover--two' ${attributes}>
|
|
15
|
+
${content}
|
|
16
|
+
</span>
|
|
17
|
+
`
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use '/lib';
|
|
1
2
|
@use '/tokens';
|
|
2
3
|
|
|
3
4
|
.link {
|
|
@@ -20,9 +21,45 @@
|
|
|
20
21
|
width: var(--width);
|
|
21
22
|
|
|
22
23
|
|
|
24
|
+
&--hover {
|
|
25
|
+
&.tooltip,
|
|
26
|
+
&:not(.--active) {
|
|
27
|
+
&:hover {
|
|
28
|
+
.link-hover {
|
|
29
|
+
&--one {
|
|
30
|
+
opacity: 0;
|
|
31
|
+
transform: translateY(-75%);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&--two {
|
|
35
|
+
opacity: 1;
|
|
36
|
+
transform: translate(50%, 50%);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
23
43
|
&--underline {
|
|
24
44
|
@include tokens.state(active hover) {
|
|
25
45
|
text-decoration: underline;
|
|
26
46
|
}
|
|
27
47
|
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
&-hover {
|
|
51
|
+
transition: opacity 0.3s ease-in-out, 0.3s cubic-bezier(0.23, 0.65, 0.74, 1.09);
|
|
52
|
+
|
|
53
|
+
&--one {
|
|
54
|
+
transform: translateY(0);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&--two {
|
|
58
|
+
@include lib.position(absolute, center);
|
|
59
|
+
opacity: 0;
|
|
60
|
+
padding: 0 var(--padding-horizontal);
|
|
61
|
+
transform: translate(50%, 125%);
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
28
65
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
1
2
|
@use '/lib';
|
|
2
3
|
@use '/tokens';
|
|
3
4
|
|
|
@@ -82,7 +83,7 @@ h1, h2, h3, h4, h5 {
|
|
|
82
83
|
|
|
83
84
|
// Loop Through Font Size Keys To Set Header Font Size + Line Height
|
|
84
85
|
$keys: lib.map-keys(tokens.$font-size);
|
|
85
|
-
$i: nth($keys, lib.list-length($keys));
|
|
86
|
+
$i: list.nth($keys, lib.list-length($keys));
|
|
86
87
|
|
|
87
88
|
@each $h in h1 h2 h3 h4 h5 {
|
|
88
89
|
#{$h} {
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { default as counter }from './components/counter';
|
|
|
6
6
|
export { default as ellipsis }from './components/ellipsis';
|
|
7
7
|
export { default as form }from './components/form';
|
|
8
8
|
export { default as json }from './components/json';
|
|
9
|
+
export { default as link }from './components/link';
|
|
9
10
|
export { default as loader }from './components/loader';
|
|
10
11
|
export { default as loading }from './components/loading';
|
|
11
12
|
export { default as magnet }from './components/magnet';
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
@else if $function == between-width {
|
|
13
|
-
@media only screen and (min-width: #{nth($param, 1) + 1px}) and (max-width: nth($param, 2)) {
|
|
13
|
+
@media only screen and (min-width: #{list.nth($param, 1) + 1px}) and (max-width: list.nth($param, 2)) {
|
|
14
14
|
@content;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
@use 'sass:meta';
|
|
2
|
+
|
|
3
|
+
|
|
1
4
|
@mixin css-variables($prefix, $tokens) {
|
|
2
5
|
@each $key, $value in $tokens {
|
|
3
|
-
@if type-of($value) == 'map' {
|
|
6
|
+
@if meta.type-of($value) == 'map' {
|
|
4
7
|
@each $subkey, $subvalue in $value {
|
|
5
8
|
--#{$prefix}-#{$key}-#{$subkey}: #{$subvalue};
|
|
6
9
|
}
|
|
@@ -10,4 +13,4 @@
|
|
|
10
13
|
}
|
|
11
14
|
}
|
|
12
15
|
}
|
|
13
|
-
|
|
16
|
+
|
package/src/lib/scss/list.scss
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use 'sass:list';
|
|
2
|
+
@use 'sass:meta';
|
|
2
3
|
@use 'sass:string';
|
|
3
4
|
|
|
4
5
|
@forward 'sass:list';
|
|
@@ -20,15 +21,15 @@
|
|
|
20
21
|
$list: unique($list);
|
|
21
22
|
$output: null;
|
|
22
23
|
|
|
23
|
-
@if type-of($list) != list {
|
|
24
|
+
@if meta.type-of($list) != list {
|
|
24
25
|
@error "#{$list} Is Not A Valid List";
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
@for $i from 1 through list.length($list) {
|
|
28
|
-
$m: nth($list, $i);
|
|
29
|
+
$m: list.nth($list, $i);
|
|
29
30
|
|
|
30
31
|
// If $k Is A List Flatten By Running Through Function Again
|
|
31
|
-
@if type-of($m) == list {
|
|
32
|
+
@if meta.type-of($m) == list {
|
|
32
33
|
$output: string.unquote("#{$output}#{$glue}#{implode($glue, $m)}");
|
|
33
34
|
}
|
|
34
35
|
// Piece Together String
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
@function to-list($input) {
|
|
48
49
|
$output: $input;
|
|
49
50
|
|
|
50
|
-
@if type-of($input) != list {
|
|
51
|
+
@if meta.type-of($input) != list {
|
|
51
52
|
$output: ($input,);
|
|
52
53
|
}
|
|
53
54
|
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
@function unique($list, $recursive: false) {
|
|
58
59
|
$result: ();
|
|
59
60
|
|
|
60
|
-
@if type-of($list) != list {
|
|
61
|
+
@if meta.type-of($list) != list {
|
|
61
62
|
@error "#{$list} Is Not A Valid List";
|
|
62
63
|
}
|
|
63
64
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
@use 'list';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
|
|
2
4
|
|
|
3
5
|
@mixin position($position, $value: null) {
|
|
4
6
|
position: $position;
|
|
@@ -31,23 +33,23 @@
|
|
|
31
33
|
bottom: 50%;
|
|
32
34
|
transform: translateY(50%);
|
|
33
35
|
}
|
|
34
|
-
@else if $value and type-of($value) == list {
|
|
36
|
+
@else if $value and meta.type-of($value) == list {
|
|
35
37
|
$length: list.length($value);
|
|
36
38
|
|
|
37
|
-
@if $length > 0 and nth($value, 1) != null {
|
|
38
|
-
top: nth($value, 1);
|
|
39
|
+
@if $length > 0 and list.nth($value, 1) != null {
|
|
40
|
+
top: list.nth($value, 1);
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
@if $length > 1 and nth($value, 2) != null {
|
|
42
|
-
right: nth($value, 2);
|
|
43
|
+
@if $length > 1 and list.nth($value, 2) != null {
|
|
44
|
+
right: list.nth($value, 2);
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
@if $length > 2 and nth($value, 3) != null {
|
|
46
|
-
bottom: nth($value, 3);
|
|
47
|
+
@if $length > 2 and list.nth($value, 3) != null {
|
|
48
|
+
bottom: list.nth($value, 3);
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
@if $length > 3 and nth($value, 4) != null {
|
|
50
|
-
left: nth($value, 4);
|
|
51
|
+
@if $length > 3 and list.nth($value, 4) != null {
|
|
52
|
+
left: list.nth($value, 4);
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
}
|
package/src/lib/scss/string.scss
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use 'list';
|
|
2
|
+
@use 'sass:meta';
|
|
2
3
|
@use 'sass:string';
|
|
3
4
|
|
|
4
5
|
@forward 'sass:string';
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
@function replace($find, $replace, $haystack) {
|
|
22
|
-
@if type-of($haystack) != string {
|
|
23
|
+
@if meta.type-of($haystack) != string {
|
|
23
24
|
@error "#{$haystack} Is Not A Valid String";
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
@use 'sass:meta';
|
|
21
22
|
@use '../../lib';
|
|
22
23
|
|
|
23
24
|
$state: (
|
|
@@ -39,7 +40,7 @@ $state: (
|
|
|
39
40
|
// To Avoid Overcomplicating The Responsibility Of This Function Limit
|
|
40
41
|
// Replace Parameter To String Values Only
|
|
41
42
|
@if $replace {
|
|
42
|
-
@if type-of($replace) != 'string' or type-of($selector) != 'string' {
|
|
43
|
+
@if meta.type-of($replace) != 'string' or meta.type-of($selector) != 'string' {
|
|
43
44
|
@error "'lib.string-replace' Cannot Be Used On A List!";
|
|
44
45
|
}
|
|
45
46
|
|
|
@@ -69,7 +70,7 @@ $state: (
|
|
|
69
70
|
@mixin state-utility($class, $property, $values) {
|
|
70
71
|
$keys: $values;
|
|
71
72
|
|
|
72
|
-
@if type-of($keys) == 'map' {
|
|
73
|
+
@if meta.type-of($keys) == 'map' {
|
|
73
74
|
$keys: lib.map-keys($keys);
|
|
74
75
|
}
|
|
75
76
|
|