@esportsplus/ui 0.0.14 → 0.0.16
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/index.d.ts +1 -1
- package/build/components/index.js +1 -1
- package/build/components/tooltip/index.d.ts +34 -0
- package/build/components/tooltip/index.js +32 -0
- package/build/components/tooltip/menu.d.ts +23 -0
- package/build/components/tooltip/menu.js +32 -0
- package/package.json +1 -1
- package/src/assets.d.ts +24 -0
- package/src/components/index.ts +2 -2
- package/src/components/tooltip/index.ts +39 -0
- package/src/components/tooltip/menu.ts +53 -0
- package/tsconfig.json +1 -1
- package/build/components/page/layout.d.ts +0 -13
- package/build/components/page/layout.js +0 -24
- package/build/components/root/index.d.ts +0 -23
- package/build/components/root/index.js +0 -2
- package/build/components/root/layout.d.ts +0 -22
- package/build/components/root/layout.js +0 -25
- package/src/components/root/index.ts +0 -4
- package/src/components/root/layout.ts +0 -46
- package/src/svg.d.ts +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as alert } from './alert';
|
|
2
2
|
export { default as form } from './form';
|
|
3
3
|
export { default as page } from './page';
|
|
4
|
-
export { default as root } from './root';
|
|
5
4
|
export { default as scrollbar } from './scrollbar';
|
|
6
5
|
export { default as state } from './state';
|
|
6
|
+
export { default as tooltip } from './tooltip';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as alert } from './alert';
|
|
2
2
|
export { default as form } from './form';
|
|
3
3
|
export { default as page } from './page';
|
|
4
|
-
export { default as root } from './root';
|
|
5
4
|
export { default as scrollbar } from './scrollbar';
|
|
6
5
|
export { default as state } from './state';
|
|
6
|
+
export { default as tooltip } from './tooltip';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
onfocus: (active?: boolean) => {
|
|
3
|
+
content: string;
|
|
4
|
+
type: string;
|
|
5
|
+
values: never[];
|
|
6
|
+
};
|
|
7
|
+
onhover: (active?: boolean) => {
|
|
8
|
+
content: string;
|
|
9
|
+
type: string;
|
|
10
|
+
values: never[];
|
|
11
|
+
};
|
|
12
|
+
menu: (data: {
|
|
13
|
+
class?: string | undefined;
|
|
14
|
+
direction?: string | undefined;
|
|
15
|
+
items?: {
|
|
16
|
+
border?: {
|
|
17
|
+
class?: string | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
class?: string | undefined;
|
|
20
|
+
onclick?: ((...args: any[]) => void) | undefined;
|
|
21
|
+
style?: string | undefined;
|
|
22
|
+
svg?: string | undefined;
|
|
23
|
+
target?: string | undefined;
|
|
24
|
+
text: string;
|
|
25
|
+
url?: string | undefined;
|
|
26
|
+
}[] | undefined;
|
|
27
|
+
style?: string | undefined;
|
|
28
|
+
}) => {
|
|
29
|
+
content: string;
|
|
30
|
+
type: string;
|
|
31
|
+
values: never[];
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
+
import { html } from '@esportsplus/template';
|
|
3
|
+
import menu from './menu';
|
|
4
|
+
const onfocus = (active = false) => {
|
|
5
|
+
let state = reactive({ active });
|
|
6
|
+
return html({
|
|
7
|
+
class: () => {
|
|
8
|
+
return `tooltip ${state.active ? '--active' : ''}`;
|
|
9
|
+
},
|
|
10
|
+
onfocusin: () => {
|
|
11
|
+
state.active = true;
|
|
12
|
+
},
|
|
13
|
+
onfocusout: () => {
|
|
14
|
+
state.active = false;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const onhover = (active = false) => {
|
|
19
|
+
let state = reactive({ active });
|
|
20
|
+
return html({
|
|
21
|
+
class: () => {
|
|
22
|
+
return `tooltip ${state.active ? '--active' : ''}`;
|
|
23
|
+
},
|
|
24
|
+
onmouseover: () => {
|
|
25
|
+
state.active = true;
|
|
26
|
+
},
|
|
27
|
+
onmouseout: () => {
|
|
28
|
+
state.active = false;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export default { onfocus, onhover, menu };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type Data = {
|
|
2
|
+
class?: string;
|
|
3
|
+
direction?: string;
|
|
4
|
+
items?: {
|
|
5
|
+
border?: {
|
|
6
|
+
class?: string;
|
|
7
|
+
};
|
|
8
|
+
class?: string;
|
|
9
|
+
onclick?: (...args: any[]) => void;
|
|
10
|
+
style?: string;
|
|
11
|
+
svg?: string;
|
|
12
|
+
target?: string;
|
|
13
|
+
text: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
}[];
|
|
16
|
+
style?: string;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: (data: Data) => {
|
|
19
|
+
content: string;
|
|
20
|
+
type: string;
|
|
21
|
+
values: never[];
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { html } from '@esportsplus/template';
|
|
2
|
+
export default (data) => html `
|
|
3
|
+
<div class="tooltip-content tooltip-content--${data?.direction || 's'} --flex-column --width-full ${data?.class || ''}" style='${data?.style || ''}'>
|
|
4
|
+
${(data?.items || []).map(item => html `
|
|
5
|
+
${item?.border ? html `
|
|
6
|
+
<div
|
|
7
|
+
class="border ${item?.border?.class || ''}"
|
|
8
|
+
style='
|
|
9
|
+
margin-left: calc(var(--margin-horizontal) * -1);
|
|
10
|
+
width: calc(100% + var(--margin-horizontal) * 2);
|
|
11
|
+
'
|
|
12
|
+
></div>
|
|
13
|
+
` : ''}
|
|
14
|
+
|
|
15
|
+
<${item.url ? 'a' : 'div'}
|
|
16
|
+
class='link --flex-vertical ${item?.class}' ${item?.onclick ? html `onclick='${item.onclick}'` : ''}
|
|
17
|
+
style='${item?.style || ''}'
|
|
18
|
+
${item?.url ? `href='${item.url}' target='${item.target || '_blank'}'` : ''}
|
|
19
|
+
>
|
|
20
|
+
${item?.svg ? html `
|
|
21
|
+
<div class="icon --margin-right --margin-300" style='margin-left: var(--size-100)'>
|
|
22
|
+
${item.svg}
|
|
23
|
+
</div>
|
|
24
|
+
` : ''}
|
|
25
|
+
|
|
26
|
+
<div class="text --color-text --flex-fill">
|
|
27
|
+
${item.text}
|
|
28
|
+
</div>
|
|
29
|
+
</${item.url ? 'a' : 'div'}>
|
|
30
|
+
`)}
|
|
31
|
+
</div>
|
|
32
|
+
`;
|
package/package.json
CHANGED
package/src/assets.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare module '*.jpg' {
|
|
2
|
+
const content: any;
|
|
3
|
+
export default content;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
declare module '*.json' {
|
|
7
|
+
const content: any;
|
|
8
|
+
export default content;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare module '*.png' {
|
|
12
|
+
const content: any;
|
|
13
|
+
export default content;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module '*.svg' {
|
|
17
|
+
const content: any;
|
|
18
|
+
export default content;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare module '*.txt' {
|
|
22
|
+
const content: any;
|
|
23
|
+
export default content;
|
|
24
|
+
}
|
package/src/components/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as alert }from './alert';
|
|
2
2
|
export { default as form }from './form';
|
|
3
3
|
export { default as page }from './page';
|
|
4
|
-
export { default as root }from './root';
|
|
5
4
|
export { default as scrollbar }from './scrollbar';
|
|
6
|
-
export { default as state }from './state';
|
|
5
|
+
export { default as state }from './state';
|
|
6
|
+
export { default as tooltip }from './tooltip';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
+
import { html } from '@esportsplus/template';
|
|
3
|
+
import menu from './menu';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const onfocus = (active: boolean = false) => {
|
|
7
|
+
let state = reactive({ active });
|
|
8
|
+
|
|
9
|
+
return html({
|
|
10
|
+
class: () => {
|
|
11
|
+
return `tooltip ${state.active ? '--active' : ''}`;
|
|
12
|
+
},
|
|
13
|
+
onfocusin: () => {
|
|
14
|
+
state.active = true;
|
|
15
|
+
},
|
|
16
|
+
onfocusout: () => {
|
|
17
|
+
state.active = false;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const onhover = (active: boolean = false) => {
|
|
23
|
+
let state = reactive({ active });
|
|
24
|
+
|
|
25
|
+
return html({
|
|
26
|
+
class: () => {
|
|
27
|
+
return `tooltip ${state.active ? '--active' : ''}`;
|
|
28
|
+
},
|
|
29
|
+
onmouseover: () => {
|
|
30
|
+
state.active = true;
|
|
31
|
+
},
|
|
32
|
+
onmouseout: () => {
|
|
33
|
+
state.active = false;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
export default { onfocus, onhover, menu };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { html } from '@esportsplus/template';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
type Data = {
|
|
5
|
+
class?: string;
|
|
6
|
+
direction?: string;
|
|
7
|
+
items?: {
|
|
8
|
+
border?: {
|
|
9
|
+
class?: string;
|
|
10
|
+
};
|
|
11
|
+
class?: string;
|
|
12
|
+
onclick?: (...args: any[]) => void;
|
|
13
|
+
style?: string;
|
|
14
|
+
svg?: string;
|
|
15
|
+
target?: string;
|
|
16
|
+
text: string;
|
|
17
|
+
url?: string;
|
|
18
|
+
}[];
|
|
19
|
+
style?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export default (data: Data) => html`
|
|
24
|
+
<div class="tooltip-content tooltip-content--${data?.direction || 's'} --flex-column --width-full ${data?.class || ''}" style='${data?.style || ''}'>
|
|
25
|
+
${(data?.items || []).map(item => html`
|
|
26
|
+
${item?.border ? html`
|
|
27
|
+
<div
|
|
28
|
+
class="border ${item?.border?.class || ''}"
|
|
29
|
+
style='
|
|
30
|
+
margin-left: calc(var(--margin-horizontal) * -1);
|
|
31
|
+
width: calc(100% + var(--margin-horizontal) * 2);
|
|
32
|
+
'
|
|
33
|
+
></div>
|
|
34
|
+
` : ''}
|
|
35
|
+
|
|
36
|
+
<${item.url ? 'a' : 'div'}
|
|
37
|
+
class='link --flex-vertical ${item?.class}' ${item?.onclick ? html`onclick='${item.onclick}'` : ''}
|
|
38
|
+
style='${item?.style || ''}'
|
|
39
|
+
${item?.url ? `href='${item.url}' target='${item.target || '_blank'}'` : ''}
|
|
40
|
+
>
|
|
41
|
+
${item?.svg ? html`
|
|
42
|
+
<div class="icon --margin-right --margin-300" style='margin-left: var(--size-100)'>
|
|
43
|
+
${item.svg}
|
|
44
|
+
</div>
|
|
45
|
+
` : ''}
|
|
46
|
+
|
|
47
|
+
<div class="text --color-text --flex-fill">
|
|
48
|
+
${item.text}
|
|
49
|
+
</div>
|
|
50
|
+
</${item.url ? 'a' : 'div'}>
|
|
51
|
+
`)}
|
|
52
|
+
</div>
|
|
53
|
+
`;
|
package/tsconfig.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
type Data = {
|
|
2
|
-
content?: any;
|
|
3
|
-
subtitle?: string;
|
|
4
|
-
suptitle?: string;
|
|
5
|
-
title?: string;
|
|
6
|
-
width?: string;
|
|
7
|
-
};
|
|
8
|
-
declare const _default: ({ content, subtitle, suptitle, title, width }: Data) => {
|
|
9
|
-
content: string;
|
|
10
|
-
type: string;
|
|
11
|
-
values: never[];
|
|
12
|
-
};
|
|
13
|
-
export default _default;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { html } from '@esportsplus/template';
|
|
2
|
-
export default ({ content, subtitle, suptitle, title, width }) => html `
|
|
3
|
-
<div class="container --slide-in --margin-vertical --margin-900" style="${width && `--max-width: ${width};`}">
|
|
4
|
-
${suptitle ? html `
|
|
5
|
-
<span class="page-suptitle --text-bold --text-crop --text-uppercase --text-200" style="--color-default: var(--color-primary-400);letter-spacing: 0.24px;">
|
|
6
|
-
${suptitle}
|
|
7
|
-
</span>
|
|
8
|
-
` : ''}
|
|
9
|
-
|
|
10
|
-
${title ? html `
|
|
11
|
-
<h1 class="page-title --line-height-200 --margin-300 ${!subtitle && '--text-crop-bottom'} ${suptitle ? '--margin-top' : '--text-crop-top'}">
|
|
12
|
-
${title}
|
|
13
|
-
</h1>
|
|
14
|
-
` : ''}
|
|
15
|
-
|
|
16
|
-
${subtitle ? html `
|
|
17
|
-
<span class="page-subtitle --margin-top --margin-300 --text-crop-bottom">
|
|
18
|
-
${subtitle}
|
|
19
|
-
</span>
|
|
20
|
-
` : ''}
|
|
21
|
-
|
|
22
|
-
${content || ''}
|
|
23
|
-
</div>
|
|
24
|
-
`;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
layout: (data?: {
|
|
3
|
-
anchor?: {
|
|
4
|
-
content?: any;
|
|
5
|
-
} | undefined;
|
|
6
|
-
content?: any;
|
|
7
|
-
page?: {
|
|
8
|
-
class?: string | undefined;
|
|
9
|
-
content?: any;
|
|
10
|
-
} | undefined;
|
|
11
|
-
scrollbar?: {
|
|
12
|
-
style?: string | undefined;
|
|
13
|
-
} | undefined;
|
|
14
|
-
site?: {
|
|
15
|
-
content?: any;
|
|
16
|
-
} | undefined;
|
|
17
|
-
}) => {
|
|
18
|
-
content: string;
|
|
19
|
-
type: string;
|
|
20
|
-
values: never[];
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export default _default;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
type Data = {
|
|
2
|
-
anchor?: {
|
|
3
|
-
content?: any;
|
|
4
|
-
};
|
|
5
|
-
content?: any;
|
|
6
|
-
page?: {
|
|
7
|
-
class?: string;
|
|
8
|
-
content?: any;
|
|
9
|
-
};
|
|
10
|
-
scrollbar?: {
|
|
11
|
-
style?: string;
|
|
12
|
-
};
|
|
13
|
-
site?: {
|
|
14
|
-
content?: any;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
declare const _default: (data?: Data) => {
|
|
18
|
-
content: string;
|
|
19
|
-
type: string;
|
|
20
|
-
values: never[];
|
|
21
|
-
};
|
|
22
|
-
export default _default;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { html } from '@esportsplus/template';
|
|
2
|
-
import { alert, scrollbar } from '../../components';
|
|
3
|
-
export default (data = {}) => {
|
|
4
|
-
let bar = scrollbar({
|
|
5
|
-
fixed: true,
|
|
6
|
-
style: data?.scrollbar?.style
|
|
7
|
-
});
|
|
8
|
-
return html `
|
|
9
|
-
<section class='site' ${bar.attributes}>
|
|
10
|
-
<section class='page --padding-horizontal --padding-horizontal-sidebars ${data?.page?.class}'>
|
|
11
|
-
${data?.page?.content}
|
|
12
|
-
</section>
|
|
13
|
-
|
|
14
|
-
${data?.site?.content || ''}
|
|
15
|
-
${bar.html}
|
|
16
|
-
</section>
|
|
17
|
-
|
|
18
|
-
<section class='anchors'>
|
|
19
|
-
${alert.html()}
|
|
20
|
-
${data?.anchor?.content || ''}
|
|
21
|
-
</section>
|
|
22
|
-
|
|
23
|
-
${data?.content || ''}
|
|
24
|
-
`;
|
|
25
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { html } from '@esportsplus/template';
|
|
2
|
-
import { alert, scrollbar } from '~/components';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type Data = {
|
|
6
|
-
anchor?: {
|
|
7
|
-
content?: any;
|
|
8
|
-
};
|
|
9
|
-
content?: any;
|
|
10
|
-
page?: {
|
|
11
|
-
class?: string;
|
|
12
|
-
content?: any;
|
|
13
|
-
};
|
|
14
|
-
scrollbar?: {
|
|
15
|
-
style?: string;
|
|
16
|
-
};
|
|
17
|
-
site?: {
|
|
18
|
-
content?: any;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export default (data: Data = {}) => {
|
|
24
|
-
let bar = scrollbar({
|
|
25
|
-
fixed: true,
|
|
26
|
-
style: data?.scrollbar?.style
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
return html`
|
|
30
|
-
<section class='site' ${bar.attributes}>
|
|
31
|
-
<section class='page --padding-horizontal --padding-horizontal-sidebars ${data?.page?.class}'>
|
|
32
|
-
${data?.page?.content}
|
|
33
|
-
</section>
|
|
34
|
-
|
|
35
|
-
${data?.site?.content || ''}
|
|
36
|
-
${bar.html}
|
|
37
|
-
</section>
|
|
38
|
-
|
|
39
|
-
<section class='anchors'>
|
|
40
|
-
${alert.html()}
|
|
41
|
-
${data?.anchor?.content || ''}
|
|
42
|
-
</section>
|
|
43
|
-
|
|
44
|
-
${data?.content || ''}
|
|
45
|
-
`;
|
|
46
|
-
};
|
package/src/svg.d.ts
DELETED