@esportsplus/ui 0.1.8 → 0.2.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/.editorconfig +9 -9
- package/.gitattributes +2 -2
- package/.github/dependabot.yml +23 -0
- package/.github/workflows/bump.yml +7 -0
- package/.github/workflows/publish.yml +14 -0
- package/build/components/alert/index.d.ts +1 -1
- package/build/components/alert/index.js +34 -36
- package/build/components/export/clipboard.js +1 -3
- package/build/components/export/index.js +3 -8
- package/build/components/export/json.js +1 -3
- package/build/components/field/checkbox.d.ts +1 -1
- package/build/components/field/checkbox.js +32 -37
- package/build/components/field/description.d.ts +1 -1
- package/build/components/field/description.js +4 -6
- package/build/components/field/error.d.ts +1 -1
- package/build/components/field/error.js +4 -6
- package/build/components/field/file.d.ts +1 -1
- package/build/components/field/file.js +36 -41
- package/build/components/field/index.d.ts +8 -8
- package/build/components/field/index.js +8 -13
- package/build/components/field/optional.d.ts +2 -2
- package/build/components/field/optional.js +8 -13
- package/build/components/field/select.d.ts +1 -1
- package/build/components/field/select.js +65 -70
- package/build/components/field/switch.d.ts +1 -1
- package/build/components/field/switch.js +3 -8
- package/build/components/field/text.d.ts +1 -1
- package/build/components/field/text.js +37 -42
- package/build/components/field/textarea.d.ts +1 -1
- package/build/components/field/textarea.js +3 -8
- package/build/components/field/title.d.ts +1 -1
- package/build/components/field/title.js +14 -19
- package/build/components/form/action.js +7 -13
- package/build/components/form/index.d.ts +1 -1
- package/build/components/form/index.js +4 -9
- package/build/components/form/input.js +1 -3
- package/build/components/form/layout.d.ts +1 -1
- package/build/components/form/layout.js +11 -13
- package/build/components/form/types.d.ts +1 -1
- package/build/components/form/types.js +1 -2
- package/build/components/number/index.js +2 -6
- package/build/components/page/index.js +2 -7
- package/build/components/root/index.js +3 -9
- package/build/components/root/onclick.js +1 -3
- package/build/components/scrollbar/index.d.ts +3 -3
- package/build/components/scrollbar/index.js +13 -15
- package/build/components/site/index.d.ts +1 -1
- package/build/components/site/index.js +10 -15
- package/build/components/tooltip/index.d.ts +5 -5
- package/build/components/tooltip/index.js +8 -13
- package/build/components/tooltip/menu.d.ts +1 -1
- package/build/components/tooltip/menu.js +34 -36
- package/build/index.js +11 -27
- package/lib.scss +1 -1
- package/package.json +25 -25
- package/src/components/accordion/scss/index.scss +16 -16
- package/src/components/accordion/scss/variables.scss +4 -4
- package/src/components/alert/index.ts +156 -156
- package/src/components/alert/scss/index.scss +54 -54
- package/src/components/alert/scss/variables.scss +8 -8
- package/src/components/anchor/scss/index.scss +41 -41
- package/src/components/anchor/scss/variables.scss +5 -5
- package/src/components/banner/scss/index.scss +40 -40
- package/src/components/banner/scss/variables.scss +5 -5
- package/src/components/border/scss/index.scss +10 -10
- package/src/components/border/scss/variables.scss +6 -6
- package/src/components/bubble/scss/index.scss +30 -30
- package/src/components/bubble/scss/variables.scss +19 -19
- package/src/components/button/scss/index.scss +92 -92
- package/src/components/button/scss/variables.scss +69 -69
- package/src/components/card/scss/index.scss +35 -35
- package/src/components/card/scss/variables.scss +42 -42
- package/src/components/container/scss/index.scss +10 -10
- package/src/components/container/scss/variables.scss +5 -5
- package/src/components/ellipsis/scss/index.scss +71 -71
- package/src/components/ellipsis/scss/variables.scss +2 -2
- package/src/components/export/clipboard.ts +11 -11
- package/src/components/export/index.ts +4 -4
- package/src/components/export/json.ts +14 -14
- package/src/components/field/checkbox.ts +60 -60
- package/src/components/field/description.ts +11 -11
- package/src/components/field/error.ts +13 -13
- package/src/components/field/file.ts +64 -64
- package/src/components/field/index.ts +9 -9
- package/src/components/field/optional.ts +26 -26
- package/src/components/field/scss/_check.scss +225 -225
- package/src/components/field/scss/_normalize.scss +36 -36
- package/src/components/field/scss/_text.scss +106 -106
- package/src/components/field/scss/index.scss +158 -158
- package/src/components/field/scss/variables.scss +138 -138
- package/src/components/field/select.ts +150 -150
- package/src/components/field/switch.ts +8 -8
- package/src/components/field/text.ts +68 -68
- package/src/components/field/textarea.ts +7 -7
- package/src/components/field/title.ts +22 -22
- package/src/components/form/action.ts +67 -67
- package/src/components/form/index.ts +5 -5
- package/src/components/form/input.ts +14 -14
- package/src/components/form/layout.ts +25 -25
- package/src/components/form/types.ts +15 -15
- package/src/components/group/scss/index.scss +36 -36
- package/src/components/group/scss/variables.scss +17 -17
- package/src/components/icon/scss/index.scss +17 -17
- package/src/components/icon/scss/variables.scss +7 -7
- package/src/components/link/scss/index.scss +28 -28
- package/src/components/link/scss/variables.scss +47 -47
- package/src/components/loading/scss/index.scss +24 -24
- package/src/components/loading/scss/variables.scss +31 -31
- package/src/components/modal/scss/index.scss +31 -31
- package/src/components/modal/scss/variables.scss +10 -10
- package/src/components/number/index.ts +23 -23
- package/src/components/page/index.ts +14 -14
- package/src/components/page/scss/index.scss +27 -27
- package/src/components/page/scss/variables.scss +27 -27
- package/src/components/processing/scss/index.scss +46 -46
- package/src/components/processing/scss/variables.scss +11 -11
- package/src/components/root/index.ts +4 -4
- package/src/components/root/onclick.ts +20 -20
- package/src/components/root/scss/index.scss +93 -93
- package/src/components/root/scss/variables.scss +55 -55
- package/src/components/row/scss/index.scss +7 -7
- package/src/components/scrollbar/index.ts +43 -43
- package/src/components/scrollbar/scss/index.scss +59 -59
- package/src/components/scrollbar/scss/variables.scss +6 -6
- package/src/components/sidebar/scss/index.scss +50 -50
- package/src/components/sidebar/scss/variables.scss +21 -21
- package/src/components/site/index.ts +26 -26
- package/src/components/site/scss/index.scss +3 -3
- package/src/components/text/scss/index.scss +12 -12
- package/src/components/text/scss/variables.scss +9 -9
- package/src/components/thumbnail/scss/index.scss +7 -7
- package/src/components/thumbnail/scss/variables.scss +7 -7
- package/src/components/tooltip/index.ts +93 -93
- package/src/components/tooltip/menu.ts +70 -70
- package/src/components/tooltip/scss/_center.scss +13 -13
- package/src/components/tooltip/scss/_east.scss +34 -34
- package/src/components/tooltip/scss/_north.scss +34 -34
- package/src/components/tooltip/scss/_south.scss +35 -35
- package/src/components/tooltip/scss/_west.scss +34 -34
- package/src/components/tooltip/scss/index.scss +93 -93
- package/src/components/tooltip/scss/variables.scss +25 -25
- package/src/css-utilities/[margin,padding]/scss/index.scss +41 -41
- package/src/css-utilities/[margin,padding]/scss/variables.scss +54 -54
- package/src/css-utilities/absolute/scss/index.scss +59 -59
- package/src/css-utilities/background/scss/variables.scss +27 -27
- package/src/css-utilities/border/scss/index.scss +21 -21
- package/src/css-utilities/border/scss/variables.scss +66 -66
- package/src/css-utilities/color/scss/variables.scss +31 -31
- package/src/css-utilities/disabled/scss/index.scss +4 -4
- package/src/css-utilities/flex/scss/index.scss +65 -65
- package/src/css-utilities/glass/scss/index.scss +2 -2
- package/src/css-utilities/glass/scss/variables.scss +2 -2
- package/src/css-utilities/hidden/scss/index.scss +28 -28
- package/src/css-utilities/index.scss +14 -14
- package/src/css-utilities/inline/scss/index.scss +7 -7
- package/src/css-utilities/line-height/scss/variables.scss +10 -10
- package/src/css-utilities/not-allowed/scss/index.scss +7 -7
- package/src/css-utilities/overflow/scss/index.scss +4 -4
- package/src/css-utilities/pointer/scss/index.scss +5 -5
- package/src/css-utilities/size/scss/variables.scss +12 -12
- package/src/css-utilities/slide/scss/index.scss +21 -21
- package/src/css-utilities/slide/scss/variables.scss +10 -10
- package/src/css-utilities/text/scss/index.scss +93 -93
- package/src/css-utilities/text/scss/variables.scss +31 -31
- package/src/css-utilities/transition/scss/variables.scss +14 -14
- package/src/css-utilities/viewport/scss/index.scss +4 -4
- package/src/css-utilities/width/scss/index.scss +3 -3
- package/src/css-utilities/width/scss/variables.scss +9 -9
- package/src/index.ts +11 -11
- package/src/lib/index.scss +7 -7
- package/src/lib/scss/breakpoint.scss +41 -41
- package/src/lib/scss/color.scss +1 -1
- package/src/lib/scss/css-variables.scss +13 -13
- package/src/lib/scss/list.scss +76 -76
- package/src/lib/scss/map.scss +1 -1
- package/src/lib/scss/position.scss +77 -77
- package/src/lib/scss/string.scss +33 -33
- package/src/tokens/index.scss +11 -11
- package/src/tokens/scss/border-radius.scss +12 -12
- package/src/tokens/scss/border-width.scss +6 -6
- package/src/tokens/scss/box-shadow.scss +13 -13
- package/src/tokens/scss/color.scss +64 -64
- package/src/tokens/scss/font-size.scss +12 -12
- package/src/tokens/scss/font-weight.scss +6 -6
- package/src/tokens/scss/line-height.scss +6 -6
- package/src/tokens/scss/size.scss +13 -13
- package/src/tokens/scss/spacer.scss +8 -8
- package/src/tokens/scss/state.scss +86 -86
- package/src/tokens/scss/transition-duration.scss +5 -5
- package/storage/fonts/montserrat/index.css +79 -79
- package/tokens.scss +1 -1
- package/tsconfig.json +10 -10
- package/utilities/styles.css +1 -1
- package/utilities/variables.css +1 -1
- package/webpack.config.ts +25 -25
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
@use '/tokens';
|
|
2
|
-
|
|
3
|
-
.sidebar {
|
|
4
|
-
--position-horizontal: 0px;
|
|
5
|
-
--position-vertical: 0px;
|
|
6
|
-
--transition-duration: var(--transition-duration-400);
|
|
7
|
-
--width: var(--width-default);
|
|
8
|
-
--width-closed: var(--width-default);
|
|
9
|
-
--width-default: 320px;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@include tokens.state(default) {
|
|
13
|
-
--width: var(--width-closed);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
&--floating {
|
|
18
|
-
--position-horizontal: var(--size-100);
|
|
19
|
-
--position-vertical: var(--size-100);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
1
|
+
@use '/tokens';
|
|
2
|
+
|
|
3
|
+
.sidebar {
|
|
4
|
+
--position-horizontal: 0px;
|
|
5
|
+
--position-vertical: 0px;
|
|
6
|
+
--transition-duration: var(--transition-duration-400);
|
|
7
|
+
--width: var(--width-default);
|
|
8
|
+
--width-closed: var(--width-default);
|
|
9
|
+
--width-default: 320px;
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@include tokens.state(default) {
|
|
13
|
+
--width: var(--width-closed);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
&--floating {
|
|
18
|
+
--position-horizontal: var(--size-100);
|
|
19
|
+
--position-vertical: var(--size-100);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { html } from '@esportsplus/template';
|
|
2
|
-
import { onclick } from '~/components/root';
|
|
3
|
-
import scrollbar from '~/components/scrollbar';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type Data = {
|
|
7
|
-
class?: string;
|
|
8
|
-
content?: any;
|
|
9
|
-
scrollbar?: {
|
|
10
|
-
style?: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export default (data: Data) => {
|
|
16
|
-
let { attributes: a, html: h } = scrollbar({
|
|
17
|
-
fixed: true,
|
|
18
|
-
style: data?.scrollbar?.style || '--background-default: var(--color-black-400);'
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
return html`
|
|
22
|
-
<section class='site ${data?.class || ''}' onclick='${onclick}' ${a}>
|
|
23
|
-
${data?.content || ''}
|
|
24
|
-
${h}
|
|
25
|
-
</section>
|
|
26
|
-
`;
|
|
1
|
+
import { html } from '@esportsplus/template';
|
|
2
|
+
import { onclick } from '~/components/root';
|
|
3
|
+
import scrollbar from '~/components/scrollbar';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
type Data = {
|
|
7
|
+
class?: string;
|
|
8
|
+
content?: any;
|
|
9
|
+
scrollbar?: {
|
|
10
|
+
style?: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export default (data: Data) => {
|
|
16
|
+
let { attributes: a, html: h } = scrollbar({
|
|
17
|
+
fixed: true,
|
|
18
|
+
style: data?.scrollbar?.style || '--background-default: var(--color-black-400);'
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
return html`
|
|
22
|
+
<section class='site ${data?.class || ''}' onclick='${onclick}' ${a}>
|
|
23
|
+
${data?.content || ''}
|
|
24
|
+
${h}
|
|
25
|
+
</section>
|
|
26
|
+
`;
|
|
27
27
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
.site {
|
|
2
|
-
z-index: 0;
|
|
3
|
-
}
|
|
1
|
+
.site {
|
|
2
|
+
z-index: 0;
|
|
3
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
.text {
|
|
2
|
-
align-items: center;
|
|
3
|
-
color: var(--color);
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-flow: wrap;
|
|
6
|
-
font-size: var(--font-size);
|
|
7
|
-
font-weight: var(--font-weight);
|
|
8
|
-
line-height: var(--line-height);
|
|
9
|
-
position: relative;
|
|
10
|
-
transition: color var(--transition-duration) ease-in-out;
|
|
11
|
-
width: var(--width);
|
|
12
|
-
}
|
|
1
|
+
.text {
|
|
2
|
+
align-items: center;
|
|
3
|
+
color: var(--color);
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-flow: wrap;
|
|
6
|
+
font-size: var(--font-size);
|
|
7
|
+
font-weight: var(--font-weight);
|
|
8
|
+
line-height: var(--line-height);
|
|
9
|
+
position: relative;
|
|
10
|
+
transition: color var(--transition-duration) ease-in-out;
|
|
11
|
+
width: var(--width);
|
|
12
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
.text {
|
|
2
|
-
--color: var(--color-default);
|
|
3
|
-
--color-default: inherit;
|
|
4
|
-
--font-size: var(--font-size-400);
|
|
5
|
-
--font-weight: var(--font-weight-400);
|
|
6
|
-
--line-height: var(--line-height-400);
|
|
7
|
-
--transition-duration: var(--transition-duration-400);
|
|
8
|
-
--width: auto;
|
|
9
|
-
}
|
|
1
|
+
.text {
|
|
2
|
+
--color: var(--color-default);
|
|
3
|
+
--color-default: inherit;
|
|
4
|
+
--font-size: var(--font-size-400);
|
|
5
|
+
--font-weight: var(--font-weight-400);
|
|
6
|
+
--line-height: var(--line-height-400);
|
|
7
|
+
--transition-duration: var(--transition-duration-400);
|
|
8
|
+
--width: auto;
|
|
9
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.thumbnail {
|
|
2
|
-
background: var(--background);
|
|
3
|
-
border-radius: var(--border-radius);
|
|
4
|
-
height: var(--height);
|
|
5
|
-
position: relative;
|
|
6
|
-
width: var(--width);
|
|
7
|
-
}
|
|
1
|
+
.thumbnail {
|
|
2
|
+
background: var(--background);
|
|
3
|
+
border-radius: var(--border-radius);
|
|
4
|
+
height: var(--height);
|
|
5
|
+
position: relative;
|
|
6
|
+
width: var(--width);
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.thumbnail {
|
|
2
|
-
--background: transparent;
|
|
3
|
-
--border-radius: var(--border-radius-300);
|
|
4
|
-
--height: var(--size);
|
|
5
|
-
--size: var(--size-700);
|
|
6
|
-
--width: var(--size);
|
|
7
|
-
}
|
|
1
|
+
.thumbnail {
|
|
2
|
+
--background: transparent;
|
|
3
|
+
--border-radius: var(--border-radius-300);
|
|
4
|
+
--height: var(--size);
|
|
5
|
+
--size: var(--size-700);
|
|
6
|
+
--width: var(--size);
|
|
7
|
+
}
|
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
-
import menu from './menu';
|
|
3
|
-
import root from '~/components/root';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
let queue: VoidFunction[] = [],
|
|
7
|
-
running = false,
|
|
8
|
-
scheduled = false;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
async function frame() {
|
|
12
|
-
if (running) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
running = true;
|
|
17
|
-
|
|
18
|
-
let item;
|
|
19
|
-
|
|
20
|
-
while (item = queue.pop()) {
|
|
21
|
-
await item();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
running = false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const onclick = (data: { active?: boolean, menu?: Parameters<typeof menu>[0], toggle?: boolean } = {}) => {
|
|
29
|
-
let content,
|
|
30
|
-
state = reactive({
|
|
31
|
-
active: data.active || false,
|
|
32
|
-
render: undefined as boolean | undefined
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
if (data.menu) {
|
|
36
|
-
content = menu(data.menu, state);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return {
|
|
40
|
-
attributes: {
|
|
41
|
-
class: () => {
|
|
42
|
-
return `tooltip ${state.active ? '--active' : ''}`;
|
|
43
|
-
},
|
|
44
|
-
onclick: function(this: HTMLElement, e: Event) {
|
|
45
|
-
let active = true,
|
|
46
|
-
node = e.target as Node | null;
|
|
47
|
-
|
|
48
|
-
if (data.toggle && ( this.contains(node) || this.isSameNode(node) )) {
|
|
49
|
-
active = !state.active;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
frame();
|
|
53
|
-
state.active = active;
|
|
54
|
-
|
|
55
|
-
if (active) {
|
|
56
|
-
queue.push(() => state.active = false);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (!scheduled) {
|
|
60
|
-
root.onclick.add(() => {
|
|
61
|
-
frame();
|
|
62
|
-
scheduled = false;
|
|
63
|
-
});
|
|
64
|
-
scheduled = true;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
content,
|
|
69
|
-
state
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const onhover = (active: boolean = false) => {
|
|
74
|
-
let state = reactive({
|
|
75
|
-
active,
|
|
76
|
-
render: undefined as boolean | undefined
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
attributes: {
|
|
81
|
-
class: () => `tooltip ${state.active ? '--active' : ''}`,
|
|
82
|
-
onmouseover: () => {
|
|
83
|
-
state.active = true;
|
|
84
|
-
},
|
|
85
|
-
onmouseout: () => {
|
|
86
|
-
state.active = false;
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
state
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
|
|
1
|
+
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
+
import menu from './menu';
|
|
3
|
+
import root from '~/components/root';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
let queue: VoidFunction[] = [],
|
|
7
|
+
running = false,
|
|
8
|
+
scheduled = false;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
async function frame() {
|
|
12
|
+
if (running) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
running = true;
|
|
17
|
+
|
|
18
|
+
let item;
|
|
19
|
+
|
|
20
|
+
while (item = queue.pop()) {
|
|
21
|
+
await item();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
running = false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
const onclick = (data: { active?: boolean, menu?: Parameters<typeof menu>[0], toggle?: boolean } = {}) => {
|
|
29
|
+
let content,
|
|
30
|
+
state = reactive({
|
|
31
|
+
active: data.active || false,
|
|
32
|
+
render: undefined as boolean | undefined
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
if (data.menu) {
|
|
36
|
+
content = menu(data.menu, state);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
attributes: {
|
|
41
|
+
class: () => {
|
|
42
|
+
return `tooltip ${state.active ? '--active' : ''}`;
|
|
43
|
+
},
|
|
44
|
+
onclick: function(this: HTMLElement, e: Event) {
|
|
45
|
+
let active = true,
|
|
46
|
+
node = e.target as Node | null;
|
|
47
|
+
|
|
48
|
+
if (data.toggle && ( this.contains(node) || this.isSameNode(node) )) {
|
|
49
|
+
active = !state.active;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
frame();
|
|
53
|
+
state.active = active;
|
|
54
|
+
|
|
55
|
+
if (active) {
|
|
56
|
+
queue.push(() => state.active = false);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (!scheduled) {
|
|
60
|
+
root.onclick.add(() => {
|
|
61
|
+
frame();
|
|
62
|
+
scheduled = false;
|
|
63
|
+
});
|
|
64
|
+
scheduled = true;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
content,
|
|
69
|
+
state
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const onhover = (active: boolean = false) => {
|
|
74
|
+
let state = reactive({
|
|
75
|
+
active,
|
|
76
|
+
render: undefined as boolean | undefined
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
attributes: {
|
|
81
|
+
class: () => `tooltip ${state.active ? '--active' : ''}`,
|
|
82
|
+
onmouseover: () => {
|
|
83
|
+
state.active = true;
|
|
84
|
+
},
|
|
85
|
+
onmouseout: () => {
|
|
86
|
+
state.active = false;
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
state
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
|
|
94
94
|
export default { onclick, onhover };
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { effect } from '@esportsplus/reactivity';
|
|
2
|
-
import { html } from '@esportsplus/template';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type Data = {
|
|
6
|
-
class?: string;
|
|
7
|
-
direction?: string;
|
|
8
|
-
items?: {
|
|
9
|
-
border?: {
|
|
10
|
-
class?: string;
|
|
11
|
-
};
|
|
12
|
-
class?: string;
|
|
13
|
-
onclick?: (...args: any[]) => void;
|
|
14
|
-
style?: string;
|
|
15
|
-
svg?: string;
|
|
16
|
-
target?: string;
|
|
17
|
-
text: string;
|
|
18
|
-
url?: string;
|
|
19
|
-
}[];
|
|
20
|
-
state?: { active?: boolean };
|
|
21
|
-
style?: string;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
function template(data: Data) {
|
|
26
|
-
return html`
|
|
27
|
-
<div class="tooltip-content tooltip-content--${data?.direction || 's'} --flex-column --width-full ${data?.class || ''}" style='${data?.style || ''}'>
|
|
28
|
-
${(data?.items || []).map(item => html`
|
|
29
|
-
${item?.border ? html`
|
|
30
|
-
<div
|
|
31
|
-
class="border ${item?.border?.class || ''}"
|
|
32
|
-
style='
|
|
33
|
-
margin-left: calc(var(--margin-horizontal) * -1);
|
|
34
|
-
width: calc(100% + var(--margin-horizontal) * 2);
|
|
35
|
-
'
|
|
36
|
-
></div>
|
|
37
|
-
` : ''}
|
|
38
|
-
|
|
39
|
-
<${item?.url ? 'a' : 'div'}
|
|
40
|
-
class='link --flex-vertical ${item?.class}' ${item?.onclick ? html`onclick='${item.onclick}'` : ''}
|
|
41
|
-
style='${item?.style || ''}'
|
|
42
|
-
${item?.url ? `href='${item.url}' target='${item.target || '_blank'}'` : ''}
|
|
43
|
-
>
|
|
44
|
-
${item?.svg ? html`
|
|
45
|
-
<div class="icon --margin-right --margin-300" style='margin-left: var(--size-100)'>
|
|
46
|
-
${item.svg}
|
|
47
|
-
</div>
|
|
48
|
-
` : ''}
|
|
49
|
-
|
|
50
|
-
<div class="text --color-text --flex-fill">
|
|
51
|
-
${item.text}
|
|
52
|
-
</div>
|
|
53
|
-
</${item?.url ? 'a' : 'div'}>
|
|
54
|
-
`)}
|
|
55
|
-
</div>
|
|
56
|
-
`;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// TODO: There's nothing binding activate to tooltip menu ( this is never called outside initial effect run )
|
|
61
|
-
export default (data: Data, state: { active?: boolean, render?: boolean }) => {
|
|
62
|
-
effect(() => {
|
|
63
|
-
if (!state.active || state.render) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
state.render = true;
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
return () => state.render ? template(data) : '';
|
|
1
|
+
import { effect } from '@esportsplus/reactivity';
|
|
2
|
+
import { html } from '@esportsplus/template';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
type Data = {
|
|
6
|
+
class?: string;
|
|
7
|
+
direction?: string;
|
|
8
|
+
items?: {
|
|
9
|
+
border?: {
|
|
10
|
+
class?: string;
|
|
11
|
+
};
|
|
12
|
+
class?: string;
|
|
13
|
+
onclick?: (...args: any[]) => void;
|
|
14
|
+
style?: string;
|
|
15
|
+
svg?: string;
|
|
16
|
+
target?: string;
|
|
17
|
+
text: string;
|
|
18
|
+
url?: string;
|
|
19
|
+
}[];
|
|
20
|
+
state?: { active?: boolean };
|
|
21
|
+
style?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
function template(data: Data) {
|
|
26
|
+
return html`
|
|
27
|
+
<div class="tooltip-content tooltip-content--${data?.direction || 's'} --flex-column --width-full ${data?.class || ''}" style='${data?.style || ''}'>
|
|
28
|
+
${(data?.items || []).map(item => html`
|
|
29
|
+
${item?.border ? html`
|
|
30
|
+
<div
|
|
31
|
+
class="border ${item?.border?.class || ''}"
|
|
32
|
+
style='
|
|
33
|
+
margin-left: calc(var(--margin-horizontal) * -1);
|
|
34
|
+
width: calc(100% + var(--margin-horizontal) * 2);
|
|
35
|
+
'
|
|
36
|
+
></div>
|
|
37
|
+
` : ''}
|
|
38
|
+
|
|
39
|
+
<${item?.url ? 'a' : 'div'}
|
|
40
|
+
class='link --flex-vertical ${item?.class}' ${item?.onclick ? html`onclick='${item.onclick}'` : ''}
|
|
41
|
+
style='${item?.style || ''}'
|
|
42
|
+
${item?.url ? `href='${item.url}' target='${item.target || '_blank'}'` : ''}
|
|
43
|
+
>
|
|
44
|
+
${item?.svg ? html`
|
|
45
|
+
<div class="icon --margin-right --margin-300" style='margin-left: var(--size-100)'>
|
|
46
|
+
${item.svg}
|
|
47
|
+
</div>
|
|
48
|
+
` : ''}
|
|
49
|
+
|
|
50
|
+
<div class="text --color-text --flex-fill">
|
|
51
|
+
${item.text}
|
|
52
|
+
</div>
|
|
53
|
+
</${item?.url ? 'a' : 'div'}>
|
|
54
|
+
`)}
|
|
55
|
+
</div>
|
|
56
|
+
`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
// TODO: There's nothing binding activate to tooltip menu ( this is never called outside initial effect run )
|
|
61
|
+
export default (data: Data, state: { active?: boolean, render?: boolean }) => {
|
|
62
|
+
effect(() => {
|
|
63
|
+
if (!state.active || state.render) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
state.render = true;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
return () => state.render ? template(data) : '';
|
|
71
71
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
@mixin center($active) {
|
|
2
|
-
&--c {
|
|
3
|
-
bottom: 50%;
|
|
4
|
-
position: absolute;
|
|
5
|
-
right: 50%;
|
|
6
|
-
transform: translate(50%, 50%) scale(var(--scaleX), var(--scaleY));
|
|
7
|
-
transform-origin: center center;
|
|
8
|
-
|
|
9
|
-
#{$active} {
|
|
10
|
-
transform: translate(50%, 50%) scale(1);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
1
|
+
@mixin center($active) {
|
|
2
|
+
&--c {
|
|
3
|
+
bottom: 50%;
|
|
4
|
+
position: absolute;
|
|
5
|
+
right: 50%;
|
|
6
|
+
transform: translate(50%, 50%) scale(var(--scaleX), var(--scaleY));
|
|
7
|
+
transform-origin: center center;
|
|
8
|
+
|
|
9
|
+
#{$active} {
|
|
10
|
+
transform: translate(50%, 50%) scale(1);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
@mixin east($active) {
|
|
2
|
-
&--en,
|
|
3
|
-
&--es {
|
|
4
|
-
left: calc(100% - var(--spacer));
|
|
5
|
-
position: absolute;
|
|
6
|
-
transform: scale(var(--scaleX), var(--scaleY));
|
|
7
|
-
|
|
8
|
-
#{$active} {
|
|
9
|
-
transform: translateX(calc(var(--spacer) * 2));
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&--e {
|
|
14
|
-
bottom: 50%;
|
|
15
|
-
left: calc(100% - var(--spacer));
|
|
16
|
-
position: absolute;
|
|
17
|
-
transform: translateY(50%) scaleX(var(--scaleX));
|
|
18
|
-
transform-origin: center left;
|
|
19
|
-
|
|
20
|
-
#{$active} {
|
|
21
|
-
transform: translate(calc(var(--spacer) * 2), 50%) scale(1);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&--en {
|
|
26
|
-
top: 0;
|
|
27
|
-
transform-origin: top left;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&--es {
|
|
31
|
-
bottom: 0;
|
|
32
|
-
transform-origin: bottom left;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
1
|
+
@mixin east($active) {
|
|
2
|
+
&--en,
|
|
3
|
+
&--es {
|
|
4
|
+
left: calc(100% - var(--spacer));
|
|
5
|
+
position: absolute;
|
|
6
|
+
transform: scale(var(--scaleX), var(--scaleY));
|
|
7
|
+
|
|
8
|
+
#{$active} {
|
|
9
|
+
transform: translateX(calc(var(--spacer) * 2));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&--e {
|
|
14
|
+
bottom: 50%;
|
|
15
|
+
left: calc(100% - var(--spacer));
|
|
16
|
+
position: absolute;
|
|
17
|
+
transform: translateY(50%) scaleX(var(--scaleX));
|
|
18
|
+
transform-origin: center left;
|
|
19
|
+
|
|
20
|
+
#{$active} {
|
|
21
|
+
transform: translate(calc(var(--spacer) * 2), 50%) scale(1);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&--en {
|
|
26
|
+
top: 0;
|
|
27
|
+
transform-origin: top left;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&--es {
|
|
31
|
+
bottom: 0;
|
|
32
|
+
transform-origin: bottom left;
|
|
33
|
+
}
|
|
34
|
+
}
|