@esportsplus/ui 0.17.7 → 0.18.1
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/accordion/index.d.ts +2 -2
- package/build/components/counter/index.d.ts +7 -10
- package/build/components/counter/index.js +34 -36
- package/build/components/ellipsis/index.d.ts +2 -1
- package/build/components/ellipsis/index.js +1 -1
- package/build/components/field/checkbox.d.ts +354 -11
- package/build/components/field/checkbox.js +45 -40
- package/build/components/field/description.d.ts +5 -6
- package/build/components/field/description.js +5 -9
- package/build/components/field/error.d.ts +1 -1
- package/build/components/field/error.js +3 -3
- package/build/components/field/index.d.ts +3329 -67
- package/build/components/field/index.js +7 -6
- package/build/components/field/input.d.ts +364 -0
- package/build/components/field/input.js +97 -0
- package/build/components/field/scss/index.scss +1 -1
- package/build/components/field/select.d.ts +245 -24
- package/build/components/field/select.js +99 -109
- package/build/components/field/title.d.ts +113 -7
- package/build/components/field/title.js +7 -10
- package/build/components/footer/index.d.ts +5 -9
- package/build/components/footer/index.js +7 -6
- package/build/components/form/index.d.ts +4 -2
- package/build/components/form/input.d.ts +5 -2
- package/build/components/form/input.js +4 -1
- package/build/components/frame/index.d.ts +115 -0
- package/build/components/frame/index.js +8 -0
- package/build/components/frame/scss/index.scss +1 -1
- package/build/components/highlight/index.d.ts +2 -1
- package/build/components/icon/index.d.ts +5 -2
- package/build/components/icon/index.js +7 -6
- package/build/components/index.d.ts +1 -2
- package/build/components/index.js +1 -2
- package/build/components/json/download.d.ts +1 -1
- package/build/components/json/index.d.ts +1 -1
- package/build/components/link/index.d.ts +0 -12
- package/build/components/link/index.js +0 -2
- package/build/components/link/scss/index.scss +1 -1
- package/build/components/loader/index.d.ts +5 -4
- package/build/components/loader/index.js +20 -20
- package/build/components/loading/index.d.ts +2 -1
- package/build/components/overlay/index.d.ts +114 -2
- package/build/components/overlay/index.js +7 -8
- package/build/components/scrollbar/index.d.ts +115 -4
- package/build/components/scrollbar/index.js +26 -25
- package/build/components/scrollbar/scss/index.scss +1 -1
- package/build/components/sidebar/index.d.ts +114 -2
- package/build/components/sidebar/index.js +7 -8
- package/build/components/site/index.d.ts +114 -2
- package/build/components/site/index.js +9 -10
- package/build/components/template/index.d.ts +8 -0
- package/build/components/template/index.js +15 -0
- package/build/components/tooltip/index.d.ts +355 -8
- package/build/components/tooltip/index.js +54 -37
- package/build/components/typewriter/index.d.ts +1 -1
- package/build/css-utilities/flex/scss/index.scss +1 -1
- package/package.json +7 -7
- package/src/components/accordion/scss/index.scss +1 -1
- package/src/components/anchor/scss/index.scss +1 -1
- package/src/components/banner/scss/index.scss +1 -1
- package/src/components/border/scss/index.scss +1 -1
- package/src/components/button/scss/index.scss +1 -1
- package/src/components/card/scss/index.scss +1 -1
- package/src/components/container/scss/index.scss +1 -1
- package/src/components/counter/index.ts +42 -46
- package/src/components/counter/scss/index.scss +1 -1
- package/src/components/ellipsis/index.ts +3 -3
- package/src/components/ellipsis/scss/index.scss +1 -1
- package/src/components/field/checkbox.ts +68 -53
- package/src/components/field/description.ts +8 -11
- package/src/components/field/error.ts +3 -3
- package/src/components/field/index.ts +10 -6
- package/src/components/field/input.ts +125 -0
- package/src/components/field/scss/{_check.scss → check.scss} +1 -4
- package/src/components/field/scss/index.scss +15 -36
- package/src/components/field/scss/normalize.scss +34 -0
- package/src/components/field/scss/{_text.scss → text.scss} +31 -17
- package/src/components/field/scss/variables.scss +0 -10
- package/src/components/field/select.ts +167 -155
- package/src/components/field/title.ts +10 -12
- package/src/components/footer/index.ts +12 -22
- package/src/components/form/input.ts +10 -5
- package/src/components/frame/index.ts +14 -1
- package/src/components/frame/scss/index.scss +2 -0
- package/src/components/grid/scss/index.scss +1 -1
- package/src/components/group/scss/index.scss +1 -1
- package/src/components/highlight/index.ts +2 -1
- package/src/components/highlight/scss/index.scss +1 -1
- package/src/components/icon/index.ts +11 -8
- package/src/components/icon/scss/index.scss +1 -1
- package/src/components/index.ts +1 -2
- package/src/components/json/download.ts +1 -1
- package/src/components/link/index.ts +1 -5
- package/src/components/link/scss/index.scss +1 -20
- package/src/components/loader/index.ts +35 -33
- package/src/components/loader/scss/index.scss +1 -1
- package/src/components/loading/index.ts +2 -2
- package/src/components/loading/scss/index.scss +1 -1
- package/src/components/modal/scss/index.scss +1 -1
- package/src/components/overlay/index.ts +9 -9
- package/src/components/page/scss/index.scss +1 -1
- package/src/components/root/scss/index.scss +1 -1
- package/src/components/scrollbar/index.ts +44 -42
- package/src/components/scrollbar/scss/index.scss +1 -1
- package/src/components/scrollbar/scss/variables.scss +1 -1
- package/src/components/sidebar/index.ts +9 -9
- package/src/components/sidebar/scss/index.scss +1 -1
- package/src/components/site/index.ts +11 -11
- package/src/components/template/index.ts +26 -0
- package/src/components/text/scss/index.scss +1 -1
- package/src/components/thumbnail/scss/index.scss +1 -1
- package/src/components/tooltip/index.ts +116 -86
- package/src/components/tooltip/scss/index.scss +1 -1
- package/src/css-utilities/flex/scss/index.scss +7 -7
- package/build/components/field/file.d.ts +0 -19
- package/build/components/field/file.js +0 -51
- package/build/components/field/optional.d.ts +0 -12
- package/build/components/field/optional.js +0 -16
- package/build/components/field/switch.d.ts +0 -3
- package/build/components/field/switch.js +0 -6
- package/build/components/field/text.d.ts +0 -19
- package/build/components/field/text.js +0 -64
- package/build/components/field/textarea.d.ts +0 -3
- package/build/components/field/textarea.js +0 -5
- package/build/components/link/hover.d.ts +0 -10
- package/build/components/link/hover.js +0 -17
- package/build/components/magnet/index.d.ts +0 -11
- package/build/components/magnet/index.js +0 -51
- package/build/components/magnet/scss/index.scss +0 -2
- package/src/components/field/file.ts +0 -77
- package/src/components/field/optional.ts +0 -23
- package/src/components/field/scss/_normalize.scss +0 -36
- package/src/components/field/switch.ts +0 -9
- package/src/components/field/text.ts +0 -92
- package/src/components/field/textarea.ts +0 -8
- package/src/components/link/hover.ts +0 -19
- package/src/components/magnet/index.ts +0 -60
- package/src/components/magnet/scss/index.scss +0 -17
- package/src/components/magnet/scss/variables.scss +0 -5
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { html, svg } from '@esportsplus/template';
|
|
1
|
+
import { html, Attributes, svg } from '@esportsplus/template';
|
|
2
|
+
import template from '~/components/template';
|
|
2
3
|
import './scss/index.scss';
|
|
3
4
|
|
|
4
5
|
|
|
5
|
-
export default
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
${
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
export default template.factory<Attributes, Parameters<typeof svg.sprite>[0]>(
|
|
7
|
+
(attributes, icon) => {
|
|
8
|
+
return html`
|
|
9
|
+
<div class='icon' ${attributes}>
|
|
10
|
+
${svg.sprite(icon)}
|
|
11
|
+
</div>
|
|
12
|
+
`;
|
|
13
|
+
}
|
|
14
|
+
);
|
package/src/components/index.ts
CHANGED
|
@@ -18,10 +18,9 @@ export * as group from './group';
|
|
|
18
18
|
export { default as highlight } from './highlight';
|
|
19
19
|
export { default as icon } from './icon';
|
|
20
20
|
export { default as json } from './json';
|
|
21
|
-
export
|
|
21
|
+
export * as link from './link';
|
|
22
22
|
export * as loader from './loader';
|
|
23
23
|
export { default as loading } from './loading';
|
|
24
|
-
export { default as magnet } from './magnet';
|
|
25
24
|
export * as modal from './modal';
|
|
26
25
|
export { default as number } from './number';
|
|
27
26
|
export { default as overlay } from './overlay';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@use '/lib';
|
|
2
2
|
@use '/tokens';
|
|
3
|
-
@use '
|
|
3
|
+
@use 'variables';
|
|
4
4
|
|
|
5
5
|
.link {
|
|
6
6
|
align-content: center;
|
|
@@ -22,25 +22,6 @@
|
|
|
22
22
|
width: var(--width);
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
&--hover {
|
|
26
|
-
&.tooltip,
|
|
27
|
-
&:not(.--active) {
|
|
28
|
-
&:hover {
|
|
29
|
-
.link-hover {
|
|
30
|
-
&--one {
|
|
31
|
-
opacity: 0;
|
|
32
|
-
transform: translateY(-75%);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
&--two {
|
|
36
|
-
opacity: 1;
|
|
37
|
-
transform: translate(50%, 50%);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
25
|
&--underline {
|
|
45
26
|
@include tokens.state(active hover) {
|
|
46
27
|
text-decoration: underline;
|
|
@@ -1,43 +1,45 @@
|
|
|
1
|
-
import { html } from '@esportsplus/template';
|
|
1
|
+
import { html, Attributes } from '@esportsplus/template';
|
|
2
2
|
import { reactive } from '@esportsplus/reactivity';
|
|
3
|
+
import template from '~/components/template';
|
|
3
4
|
import './scss/index.scss';
|
|
4
5
|
|
|
5
6
|
|
|
6
|
-
export default (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export default template.factory<Attributes>(
|
|
8
|
+
(attributes, content) => {
|
|
9
|
+
let state = reactive({
|
|
10
|
+
load: false,
|
|
11
|
+
scale: false
|
|
12
|
+
});
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
state.scale = true;
|
|
16
|
+
}, 300);
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
<div class='loader ${() => state.load && 'loader--load'}'>
|
|
18
|
+
return html`
|
|
18
19
|
<div class='loader ${() => state.load && 'loader--load'}'>
|
|
19
|
-
<div class='loader
|
|
20
|
-
<div
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
20
|
+
<div class='loader ${() => state.load && 'loader--load'}'>
|
|
21
|
+
<div class='loader-content'>
|
|
22
|
+
<div
|
|
23
|
+
class='
|
|
24
|
+
${() => state.scale && 'loader-logo--scale'}
|
|
25
|
+
loader-logo
|
|
26
|
+
text
|
|
27
|
+
--flex-center
|
|
28
|
+
--text-uppercase --text-600
|
|
29
|
+
'
|
|
30
|
+
style='color: var(--color-grey-500);'
|
|
31
|
+
onanimationend='${({ animationName: name }: AnimationEvent) => {
|
|
32
|
+
if (name === 'scale') {
|
|
33
|
+
state.load = true;
|
|
34
|
+
}
|
|
35
|
+
}}'
|
|
36
|
+
${attributes}
|
|
37
|
+
>
|
|
38
|
+
${content}
|
|
39
|
+
</div>
|
|
38
40
|
</div>
|
|
39
41
|
</div>
|
|
40
42
|
</div>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
45
|
+
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { html } from '@esportsplus/template';
|
|
1
|
+
import { html, Attributes } from '@esportsplus/template';
|
|
2
2
|
import './scss/index.scss';
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
export default (attributes?:
|
|
5
|
+
export default (attributes?: Attributes) => {
|
|
6
6
|
return html`
|
|
7
7
|
<div
|
|
8
8
|
class='loading --border-width-700 --size-800'
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toArray } from '@esportsplus/utilities';
|
|
2
2
|
import scrollbar from '~/components/scrollbar';
|
|
3
|
+
import template from '~/components/template';
|
|
3
4
|
import './scss/index.scss';
|
|
4
5
|
|
|
5
6
|
|
|
6
|
-
export default
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
(data.class as unknown[]).push('overlay');
|
|
7
|
+
export default template.factory<Parameters<typeof scrollbar>[0]>(
|
|
8
|
+
(attributes, content) => {
|
|
9
|
+
attributes.class = toArray(attributes.class);
|
|
10
|
+
attributes.class.push('overlay');
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
}
|
|
12
|
+
return scrollbar(attributes, content);
|
|
13
|
+
}
|
|
14
|
+
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
-
import { html } from '@esportsplus/template';
|
|
2
|
+
import { html, type Attributes } from '@esportsplus/template';
|
|
3
3
|
import { omit } from '@esportsplus/utilities';
|
|
4
|
+
import template from '~/components/template';
|
|
4
5
|
import './scss/index.scss';
|
|
5
6
|
|
|
6
7
|
|
|
@@ -8,49 +9,50 @@ let root = document.body,
|
|
|
8
9
|
width: number | undefined;
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
export default template.factory<Attributes & { scrollbar?: Attributes, 'scrollbar-container-content'?: Attributes }>(
|
|
13
|
+
(attributes, content) => {
|
|
14
|
+
let state = reactive({
|
|
15
|
+
height: 100,
|
|
16
|
+
translate: 0
|
|
17
|
+
});
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
<div
|
|
20
|
-
class='scrollbar-container'
|
|
21
|
-
${omit(attributes, ['content', 'scrollbar'])}
|
|
22
|
-
>
|
|
19
|
+
return html`
|
|
23
20
|
<div
|
|
24
|
-
class='scrollbar-container
|
|
25
|
-
|
|
26
|
-
if (width === undefined) {
|
|
27
|
-
width = this.offsetWidth - this.clientWidth;
|
|
28
|
-
|
|
29
|
-
if (width && width !== 17) {
|
|
30
|
-
root.style.setProperty('--scrollbar-width', `${width}px`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
state.height = (this.clientHeight / this.scrollHeight) * 100;
|
|
35
|
-
state.translate = (this.scrollTop / this.clientHeight) * 100;
|
|
36
|
-
}}'
|
|
37
|
-
${attributes.content}
|
|
21
|
+
class='scrollbar-container'
|
|
22
|
+
${omit(attributes, ['scrollbar-container-content', 'scrollbar'])}
|
|
38
23
|
>
|
|
39
|
-
|
|
40
|
-
|
|
24
|
+
<div
|
|
25
|
+
class='scrollbar-container-content'
|
|
26
|
+
onscroll='${function(this: HTMLElement) {
|
|
27
|
+
if (width === undefined) {
|
|
28
|
+
width = this.offsetWidth - this.clientWidth;
|
|
29
|
+
|
|
30
|
+
if (width && width !== 17) {
|
|
31
|
+
root.style.setProperty('--scrollbar-width', `${width}px`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
41
34
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
scrollbar
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
state.height = (this.clientHeight / this.scrollHeight) * 100;
|
|
36
|
+
state.translate = (this.scrollTop / this.clientHeight) * 100;
|
|
37
|
+
}}'
|
|
38
|
+
${attributes['scrollbar-container-content']}
|
|
39
|
+
>
|
|
40
|
+
${content}
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div
|
|
44
|
+
class='
|
|
45
|
+
${() => state.height >= 100 && 'scrollbar--hidden'}
|
|
46
|
+
scrollbar
|
|
47
|
+
'
|
|
48
|
+
style='${() => `
|
|
49
|
+
--translate: translate3d(0, ${state.translate}%, 0);
|
|
50
|
+
--height: ${state.height}%;
|
|
51
|
+
`}'
|
|
52
|
+
${attributes.scrollbar}
|
|
53
|
+
>
|
|
54
|
+
</div>
|
|
53
55
|
</div>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
`;
|
|
57
|
+
}
|
|
58
|
+
);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toArray } from '@esportsplus/utilities';
|
|
2
2
|
import scrollbar from '~/components/scrollbar';
|
|
3
|
+
import template from '~/components/template';
|
|
3
4
|
import './scss/index.scss';
|
|
4
5
|
|
|
5
6
|
|
|
6
|
-
export default
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
(data.class as unknown[]).push('sidebar');
|
|
7
|
+
export default template.factory<Parameters<typeof scrollbar>[0]>(
|
|
8
|
+
(attributes, content) => {
|
|
9
|
+
attributes.class = toArray(attributes.class);
|
|
10
|
+
attributes.class.push('sidebar');
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
}
|
|
12
|
+
return scrollbar(attributes, content);
|
|
13
|
+
}
|
|
14
|
+
);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toArray } from '@esportsplus/utilities';
|
|
2
2
|
import { onclick } from '~/components/root';
|
|
3
3
|
import scrollbar from '~/components/scrollbar';
|
|
4
|
+
import template from '~/components/template';
|
|
4
5
|
import './scss/index.scss';
|
|
5
6
|
|
|
6
7
|
|
|
7
|
-
export default
|
|
8
|
-
|
|
8
|
+
export default template.factory<Parameters<typeof scrollbar>[0]>(
|
|
9
|
+
(attributes, content) => {
|
|
10
|
+
attributes.class = toArray(attributes.class);
|
|
11
|
+
attributes.class.push('site');
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
data.class = data.class ? [data.class] : [];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
(data.class as unknown[]).push('site');
|
|
13
|
+
attributes.onclick = onclick;
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
attributes.style ??= '--background-default: var(--color-black-400);';
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
}
|
|
17
|
+
return scrollbar(attributes, content);
|
|
18
|
+
}
|
|
19
|
+
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Renderable } from '@esportsplus/template';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const factory = <A extends Record<string, unknown>, C = unknown>(template: (attributes: A, content: C) => Renderable) => {
|
|
5
|
+
function factory(content: C): Renderable;
|
|
6
|
+
function factory(attributes: A, content: C): Renderable;
|
|
7
|
+
function factory(one: A | C, two?: C): Renderable {
|
|
8
|
+
let content: C,
|
|
9
|
+
attributes: A = {} as A;
|
|
10
|
+
|
|
11
|
+
if (two === undefined) {
|
|
12
|
+
content = one as C;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
content = two;
|
|
16
|
+
attributes = one as A;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return template(attributes, content);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return factory;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export default { factory };
|