@esportsplus/ui 0.51.7 → 0.53.0
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/README.md +2 -3
- package/build/components/accordion/index.d.ts +15 -10
- package/build/components/accordion/index.js +8 -34
- package/build/components/accordion/scss/index.scss +1 -1
- package/build/components/back/index.d.ts +14 -11
- package/build/components/back/index.js +3 -3
- package/build/components/button/index.js +2 -2
- package/build/components/checkbox/index.js +7 -3
- package/build/components/clipboard/index.d.ts +23 -20
- package/build/components/clipboard/index.js +1 -0
- package/build/components/clipboard/onclick.js +3 -3
- package/build/components/form/input.js +3 -3
- package/build/components/frame/index.d.ts +16 -15
- package/build/components/frame/index.js +11 -5
- package/build/components/highlight/index.js +2 -2
- package/build/components/icon/index.js +2 -2
- package/build/components/index.d.ts +1 -4
- package/build/components/index.js +1 -4
- package/build/components/loader/index.js +4 -4
- package/build/components/loader/scss/index.scss +1 -1
- package/build/components/overlay/index.d.ts +16 -15
- package/build/components/overlay/index.js +11 -5
- package/build/components/overlay/scss/index.scss +1 -1
- package/build/components/page/scss/index.scss +1 -1
- package/build/components/root/scss/index.scss +1 -1
- package/build/components/select/index.d.ts +3 -6
- package/build/components/select/index.js +72 -78
- package/build/components/sidebar/index.d.ts +16 -15
- package/build/components/sidebar/index.js +11 -5
- package/build/components/sidebar/scss/index.scss +1 -1
- package/build/components/toast/index.d.ts +9 -0
- package/build/components/toast/index.js +157 -0
- package/build/components/toast/manager.d.ts +60 -0
- package/build/components/toast/manager.js +203 -0
- package/build/components/toast/scss/index.scss +2 -0
- package/build/components/toast/svg/check.svg +1 -0
- package/build/components/toast/svg/chevron.svg +1 -0
- package/build/components/toast/svg/close.svg +1 -0
- package/build/components/toast/svg/copy.svg +1 -0
- package/build/components/toast/svg/error.svg +1 -0
- package/build/components/toast/svg/info.svg +1 -0
- package/build/components/toast/svg/loading.svg +1 -0
- package/build/components/toast/svg/success.svg +1 -0
- package/build/components/toast/svg/warning.svg +1 -0
- package/build/components/tooltip/index.d.ts +40 -40
- package/build/components/tooltip/menu.js +37 -23
- package/build/components/tooltip/onclick.d.ts +20 -20
- package/build/components/tooltip/onclick.js +2 -2
- package/build/components/tooltip/onhover.js +2 -2
- package/build/components/typewriter/index.js +2 -2
- package/build/css-utilities/index.scss +1 -1
- package/build/css-utilities/scroll-fade/scss/index.scss +2 -0
- package/build/css-utilities/scrollbar/scss/index.scss +2 -0
- package/build/themes/dark/back.d.ts +8 -4
- package/build/themes/dark/index.d.ts +0 -1
- package/build/themes/dark/index.js +0 -1
- package/build/themes/dark/input.d.ts +2 -2
- package/build/themes/dark/select.d.ts +60 -110
- package/build/themes/dark/textarea.d.ts +2 -2
- package/package.json +15 -15
- package/pnpm-workspace.yaml +11 -8
- package/src/components/accordion/index.ts +7 -30
- package/src/components/accordion/scss/index.scss +9 -12
- package/src/components/back/index.ts +4 -5
- package/src/components/button/index.ts +2 -3
- package/src/components/checkbox/index.ts +7 -2
- package/src/components/clipboard/index.ts +2 -1
- package/src/components/clipboard/onclick.ts +3 -4
- package/src/components/form/input.ts +4 -4
- package/src/components/frame/index.ts +9 -5
- package/src/components/highlight/index.ts +2 -3
- package/src/components/icon/index.ts +2 -3
- package/src/components/index.ts +1 -4
- package/src/components/loader/index.ts +5 -6
- package/src/components/loader/scss/index.scss +1 -1
- package/src/components/overlay/index.ts +9 -5
- package/src/components/overlay/scss/index.scss +0 -1
- package/src/components/page/scss/index.scss +1 -1
- package/src/components/root/scss/index.scss +35 -4
- package/src/components/root/scss/variables.scss +1 -2
- package/src/components/select/index.ts +71 -83
- package/src/components/sidebar/index.ts +9 -5
- package/src/components/sidebar/scss/index.scss +0 -1
- package/src/components/toast/index.ts +188 -0
- package/src/components/toast/manager.ts +312 -0
- package/src/components/toast/scss/index.scss +276 -0
- package/src/components/toast/scss/variables.scss +19 -0
- package/src/components/toast/svg/check.svg +1 -0
- package/src/components/toast/svg/chevron.svg +1 -0
- package/src/components/toast/svg/close.svg +1 -0
- package/src/components/toast/svg/copy.svg +1 -0
- package/src/components/toast/svg/error.svg +1 -0
- package/src/components/toast/svg/info.svg +1 -0
- package/src/components/toast/svg/loading.svg +1 -0
- package/src/components/toast/svg/success.svg +1 -0
- package/src/components/toast/svg/warning.svg +1 -0
- package/src/components/tooltip/menu.ts +8 -4
- package/src/components/tooltip/onclick.ts +2 -3
- package/src/components/tooltip/onhover.ts +2 -3
- package/src/components/typewriter/index.ts +2 -3
- package/src/css-utilities/index.scss +3 -2
- package/src/css-utilities/scroll-fade/scss/index.scss +47 -0
- package/src/css-utilities/scroll-fade/scss/variables.scss +3 -0
- package/src/css-utilities/scrollbar/scss/index.scss +53 -0
- package/src/css-utilities/scrollbar/scss/variables.scss +5 -0
- package/src/themes/dark/index.ts +0 -1
- package/src/tokens/scss/color.scss +14 -14
- package/src/tokens/scss/font-size.scss +12 -11
- package/src/tokens/scss/line-height.scss +7 -4
- package/src/tokens/scss/scale.scss +22 -0
- package/src/tokens/scss/size.scss +12 -9
- package/src/tokens/scss/spacer.scss +9 -9
- package/storage/svg/bolt.svg +1 -0
- package/storage/svg/star.svg +1 -0
- package/tsconfig.json +6 -2
- package/vite-env.d.ts +1 -0
- package/vite.config.ts +73 -72
- package/build/components/alert/index.d.ts +0 -19
- package/build/components/alert/index.js +0 -151
- package/build/components/alert/scss/index.scss +0 -2
- package/build/components/alert/svg/check.svg +0 -11
- package/build/components/alert/svg/close.svg +0 -12
- package/build/components/alert/svg/error.svg +0 -18
- package/build/components/scrollbar/index.d.ts +0 -27
- package/build/components/scrollbar/index.js +0 -56
- package/build/components/scrollbar/scss/index.scss +0 -2
- package/build/components/site/index.d.ts +0 -20
- package/build/components/site/index.js +0 -9
- package/build/components/site/scss/index.scss +0 -2
- package/build/components/template/index.d.ts +0 -14
- package/build/components/template/index.js +0 -21
- package/build/css-utilities/scroller/scss/index.scss +0 -2
- package/build/themes/dark/alert.d.ts +0 -11
- package/build/themes/dark/alert.js +0 -20
- package/src/components/accordion/scss/variables.scss +0 -9
- package/src/components/alert/index.ts +0 -165
- package/src/components/alert/scss/index.scss +0 -25
- package/src/components/alert/scss/variables.scss +0 -3
- package/src/components/alert/svg/check.svg +0 -11
- package/src/components/alert/svg/close.svg +0 -12
- package/src/components/alert/svg/error.svg +0 -18
- package/src/components/scrollbar/index.ts +0 -70
- package/src/components/scrollbar/scss/index.scss +0 -82
- package/src/components/scrollbar/scss/variables.scss +0 -6
- package/src/components/site/index.ts +0 -11
- package/src/components/site/scss/index.scss +0 -3
- package/src/components/template/index.ts +0 -40
- package/src/css-utilities/scroller/scss/index.scss +0 -8
- package/src/css-utilities/scroller/scss/variables.scss +0 -4
- package/src/themes/dark/alert.ts +0 -23
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import alert from '../../components/alert/index.js';
|
|
2
|
-
export default alert({
|
|
3
|
-
class: '--margin-600 --padding-500',
|
|
4
|
-
style: `
|
|
5
|
-
background: var(--color-black-400);
|
|
6
|
-
border: 2px solid var(--color-black-300);
|
|
7
|
-
box-shadow: var(--box-shadow-300);
|
|
8
|
-
`,
|
|
9
|
-
'alert-close': {
|
|
10
|
-
class: '--background-black --border-radius-300 --color-white',
|
|
11
|
-
style: '--color-default: var(--color-grey-500);margin: calc(var(--size-100) * -1) 0;'
|
|
12
|
-
},
|
|
13
|
-
'alert-messages': {
|
|
14
|
-
class: '--padding-horizontal --padding-500',
|
|
15
|
-
style: 'justify-content: center;'
|
|
16
|
-
},
|
|
17
|
-
'alert-message': {
|
|
18
|
-
style: 'color: var(--color-white-400);'
|
|
19
|
-
},
|
|
20
|
-
});
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import '@esportsplus/vite/global.d.ts';
|
|
2
|
-
import { Response } from '@esportsplus/action';
|
|
3
|
-
import { html, Attributes, Renderable } from '@esportsplus/template';
|
|
4
|
-
import { reactive } from '@esportsplus/reactivity';
|
|
5
|
-
import { omit } from '@esportsplus/utilities';
|
|
6
|
-
import icon from '~/components/icon';
|
|
7
|
-
import check from './svg/check.svg';
|
|
8
|
-
import close from './svg/close.svg';
|
|
9
|
-
import e from './svg/error.svg';
|
|
10
|
-
import './scss/index.scss';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type Type = 'error' | 'info' | 'success';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const OMIT = ['alert-close', 'alert-messages', 'alert-message'];
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
let modifiers: Record<Type, string> = {
|
|
20
|
-
error: 'red',
|
|
21
|
-
info: 'black',
|
|
22
|
-
success: 'green'
|
|
23
|
-
},
|
|
24
|
-
timeout = 250;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
function activate(key: Type, messages: Renderable<any>, seconds: number, state: { active: boolean, messages: Set<Renderable<any>>, rerender: number, type: Type }) {
|
|
28
|
-
if (!Array.isArray(messages)) {
|
|
29
|
-
messages = [messages];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (!messages.length) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (state.type !== key) {
|
|
37
|
-
state.active = false;
|
|
38
|
-
state.messages.clear();
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
state.type = key;
|
|
42
|
-
|
|
43
|
-
for (let message of messages) {
|
|
44
|
-
state.messages.add(message);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (state.active) {
|
|
48
|
-
state.rerender++;
|
|
49
|
-
|
|
50
|
-
if (!seconds) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
setTimeout(deactivate, timeout + (500 * seconds));
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
setTimeout(() => {
|
|
58
|
-
state.active = true;
|
|
59
|
-
state.rerender++;
|
|
60
|
-
state.type = key;
|
|
61
|
-
|
|
62
|
-
if (seconds) {
|
|
63
|
-
setTimeout(deactivate, 500 * seconds);
|
|
64
|
-
}
|
|
65
|
-
}, timeout);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function deactivate(state: { active: boolean, messages: Set<Renderable<any>>, type: Type }) {
|
|
70
|
-
state.active = false;
|
|
71
|
-
|
|
72
|
-
setTimeout(() => {
|
|
73
|
-
state.messages.clear();
|
|
74
|
-
}, timeout);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
export default (attributes: Attributes & { 'alert-close'?: Attributes, 'alert-messages'?: Attributes, 'alert-message'?: Attributes }) => {
|
|
79
|
-
let state = reactive({
|
|
80
|
-
active: false,
|
|
81
|
-
messages: new Set() as Set<Renderable<any>>,
|
|
82
|
-
rerender: 0,
|
|
83
|
-
type: '' as Type
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const error = (messages: Renderable<any>, seconds: number = 0) => activate('error', messages, seconds, state);
|
|
88
|
-
|
|
89
|
-
error.response = (response: Response<any>) => {
|
|
90
|
-
if (response.ok) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
error(
|
|
95
|
-
response.errors.map(({ message, path }) => {
|
|
96
|
-
if (!path) {
|
|
97
|
-
return message;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return `${String(path).split('.').join(' ')} ${message}`;
|
|
101
|
-
}),
|
|
102
|
-
5
|
|
103
|
-
);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return {
|
|
108
|
-
content: html`
|
|
109
|
-
<div
|
|
110
|
-
class='alert anchor anchor--n ${() => state.active && '--active'} --flex-row'
|
|
111
|
-
${omit(attributes, OMIT)}
|
|
112
|
-
>
|
|
113
|
-
${() => {
|
|
114
|
-
let type = state.type;
|
|
115
|
-
|
|
116
|
-
return html`
|
|
117
|
-
<div class='--flex-vertical' style='${`--color: var(--color-${modifiers[type]}-400);`}'>
|
|
118
|
-
${icon({ class: '--size-500' }, type === 'error' ? e : check)}
|
|
119
|
-
</div>
|
|
120
|
-
`;
|
|
121
|
-
}}
|
|
122
|
-
|
|
123
|
-
<div
|
|
124
|
-
class='alert-messages --flex-column --flex-fill'
|
|
125
|
-
${attributes['alert-messages']}
|
|
126
|
-
>
|
|
127
|
-
${() => {
|
|
128
|
-
let message = attributes['alert-message'];
|
|
129
|
-
|
|
130
|
-
return state.rerender && [...state.messages].map((content) => {
|
|
131
|
-
if (typeof content === 'string') {
|
|
132
|
-
return html`
|
|
133
|
-
<p ${message}>
|
|
134
|
-
${content}
|
|
135
|
-
</p>
|
|
136
|
-
`;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
return html`
|
|
140
|
-
<div class='--flex-start'>
|
|
141
|
-
${content}
|
|
142
|
-
</div>
|
|
143
|
-
`;
|
|
144
|
-
});
|
|
145
|
-
}}
|
|
146
|
-
</div>
|
|
147
|
-
|
|
148
|
-
<div class="--flex-vertical">
|
|
149
|
-
<div
|
|
150
|
-
class='alert-close button --padding-300'
|
|
151
|
-
onclick='${() => deactivate(state)}'
|
|
152
|
-
${attributes['alert-close']}
|
|
153
|
-
>
|
|
154
|
-
${icon({ style: '--size: 14px;' }, close)}
|
|
155
|
-
</div>
|
|
156
|
-
</div>
|
|
157
|
-
</div>
|
|
158
|
-
`,
|
|
159
|
-
deactivate: () => deactivate(state),
|
|
160
|
-
error,
|
|
161
|
-
info: (messages: Renderable<any>, seconds: number = 0) => activate('info', messages, seconds, state),
|
|
162
|
-
success: (messages: Renderable<any>, seconds: number = 0) => activate('success', messages, seconds, state)
|
|
163
|
-
|
|
164
|
-
};
|
|
165
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
@use '../../anchor/scss';
|
|
2
|
-
@use '/lib';
|
|
3
|
-
@use '/tokens';
|
|
4
|
-
@use 'variables';
|
|
5
|
-
|
|
6
|
-
.alert {
|
|
7
|
-
max-width: var(--max-width);
|
|
8
|
-
padding: var(--padding-vertical) var(--padding-horizontal);
|
|
9
|
-
position: fixed;
|
|
10
|
-
width: calc(100% - (var(--margin-horizontal) * 2));
|
|
11
|
-
z-index: 9999;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
&.anchor--n {
|
|
15
|
-
@include tokens.state(inactive) {
|
|
16
|
-
transform: translate(50%, -100%);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&.anchor--ne {
|
|
21
|
-
@include tokens.state(inactive) {
|
|
22
|
-
transform: translateY(-100%);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
-
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
5
|
-
width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
|
|
6
|
-
<g>
|
|
7
|
-
<path d="M9,19.5c-0.397,0-0.779-0.158-1.061-0.439l-5-5c-0.586-0.586-0.586-1.535,0-2.121s1.535-0.586,2.121,0l3.893,3.893
|
|
8
|
-
l9.941-10.846c0.561-0.611,1.509-0.651,2.119-0.092c0.61,0.56,0.651,1.509,0.092,2.12l-11,12c-0.277,0.302-0.665,0.478-1.073,0.486
|
|
9
|
-
C9.022,19.5,9.011,19.5,9,19.5z"/>
|
|
10
|
-
</g>
|
|
11
|
-
</svg>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
-
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
5
|
-
width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
|
|
6
|
-
<g>
|
|
7
|
-
<path d="M18,19.5c-0.384,0-0.768-0.146-1.061-0.439L12,14.121l-4.939,4.939c-0.586,0.586-1.535,0.586-2.121,0s-0.586-1.535,0-2.121
|
|
8
|
-
L9.879,12L4.939,7.061c-0.586-0.585-0.586-1.536,0-2.121c0.586-0.586,1.535-0.586,2.121,0L12,9.879l4.939-4.939
|
|
9
|
-
c0.586-0.586,1.535-0.586,2.121,0c0.586,0.585,0.586,1.536,0,2.121L14.121,12l4.939,4.939c0.586,0.586,0.586,1.535,0,2.121
|
|
10
|
-
C18.768,19.354,18.384,19.5,18,19.5z"/>
|
|
11
|
-
</g>
|
|
12
|
-
</svg>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
-
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
5
|
-
width="24px" height="24px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve">
|
|
6
|
-
<g>
|
|
7
|
-
<path d="M12.351,23h-0.702c-4.697,0-7.055,0-8.626-1.132c-1.368-0.986-2.262-2.512-2.454-4.186
|
|
8
|
-
c-0.22-1.925,0.932-3.981,3.227-8.079l0.352-0.628c2.386-4.26,3.583-6.398,5.383-7.211c1.57-0.708,3.369-0.708,4.939,0
|
|
9
|
-
c1.8,0.813,2.997,2.95,5.383,7.209l0.352,0.629l-0.873,0.488l0.881-0.474c2.29,4.09,3.439,6.143,3.219,8.064
|
|
10
|
-
c-0.191,1.675-1.086,3.201-2.453,4.187C19.405,23,17.048,23,12.351,23z M12,3.233c-0.562,0-1.123,0.118-1.646,0.354
|
|
11
|
-
c-1.2,0.542-2.358,2.61-4.46,6.364L5.542,10.58c-2.02,3.606-3.132,5.592-2.985,6.875c0.128,1.116,0.724,2.133,1.636,2.79
|
|
12
|
-
C5.24,21,7.516,21,11.649,21h0.702c4.132,0,6.41,0,7.457-0.755c0.912-0.657,1.509-1.674,1.637-2.791
|
|
13
|
-
c0.146-1.28-0.963-3.262-2.978-6.86l-0.009-0.015l-0.351-0.627c-2.103-3.755-3.261-5.823-4.461-6.365
|
|
14
|
-
C13.123,3.352,12.562,3.233,12,3.233z M12,18c-0.827,0-1.499-0.672-1.5-1.498c0-0.002,0-0.002,0-0.004
|
|
15
|
-
C10.501,15.672,11.173,15,12,15c0.826,0,1.499,0.672,1.5,1.498c0,0.002,0,0.002,0,0.004C13.499,17.328,12.826,18,12,18z M12,14
|
|
16
|
-
c-0.552,0-1-0.447-1-1V9c0-0.552,0.448-1,1-1c0.553,0,1,0.448,1,1v4C13,13.553,12.553,14,12,14z"/>
|
|
17
|
-
</g>
|
|
18
|
-
</svg>
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { html, type Attributes } from '@esportsplus/template';
|
|
2
|
-
import { reactive } from '@esportsplus/reactivity';
|
|
3
|
-
import { omit } from '@esportsplus/utilities';
|
|
4
|
-
import template from '~/components/template';
|
|
5
|
-
import './scss/index.scss';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
type A = Attributes & { scrollbar?: Attributes, 'scrollbar-container-content'?: Attributes };
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const OMIT = ['scrollbar', 'scrollbar-container-content'];
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let root = document.body,
|
|
15
|
-
width: number | undefined;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export default template.factory<A>(
|
|
19
|
-
function(this: { attributes?: A }, attributes, content) {
|
|
20
|
-
let state = reactive({
|
|
21
|
-
height: 100,
|
|
22
|
-
translate: 0
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
return html`
|
|
26
|
-
<div
|
|
27
|
-
class='scrollbar-container'
|
|
28
|
-
${this?.attributes && omit(this.attributes, OMIT)}
|
|
29
|
-
${omit(attributes, OMIT)}
|
|
30
|
-
>
|
|
31
|
-
<div
|
|
32
|
-
class='scrollbar-container-content'
|
|
33
|
-
${this?.attributes?.['scrollbar-container-content']}
|
|
34
|
-
${attributes['scrollbar-container-content']}
|
|
35
|
-
${{
|
|
36
|
-
onscroll: function() {
|
|
37
|
-
if (width === undefined) {
|
|
38
|
-
width = this.offsetWidth - this.clientWidth;
|
|
39
|
-
|
|
40
|
-
if (width && width !== 17) {
|
|
41
|
-
root.style.setProperty('--scrollbar-width', `${width}px`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
state.height = (this.clientHeight / this.scrollHeight) * 100;
|
|
46
|
-
state.translate = (this.scrollTop / this.clientHeight) * 100;
|
|
47
|
-
}
|
|
48
|
-
}}
|
|
49
|
-
>
|
|
50
|
-
${content}
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<div
|
|
54
|
-
class='scrollbar'
|
|
55
|
-
${this?.attributes?.scrollbar}
|
|
56
|
-
${attributes.scrollbar}
|
|
57
|
-
${{
|
|
58
|
-
class: () => state.height >= 100 && 'scrollbar--hidden',
|
|
59
|
-
style: () => `
|
|
60
|
-
--translate: translate3d(0, ${state.translate}%, 0);
|
|
61
|
-
--height: ${state.height}%;
|
|
62
|
-
`
|
|
63
|
-
}}
|
|
64
|
-
>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
`;
|
|
68
|
-
}
|
|
69
|
-
);
|
|
70
|
-
export type { A as Attributes }
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
@use 'variables';
|
|
2
|
-
|
|
3
|
-
// Hide Chrome Mobile Scrollbar
|
|
4
|
-
::-webkit-scrollbar,
|
|
5
|
-
::-webkit-scrollbar-track,
|
|
6
|
-
::-webkit-scrollbar-thumb,
|
|
7
|
-
::-webkit-scrollbar-thumb:window-inactive {
|
|
8
|
-
background: transparent;
|
|
9
|
-
box-shadow: unset;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.scrollbar {
|
|
13
|
-
height: 100%;
|
|
14
|
-
z-index: 9;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
&,
|
|
18
|
-
&::before {
|
|
19
|
-
position: absolute;
|
|
20
|
-
right: 0;
|
|
21
|
-
top: 0;
|
|
22
|
-
transition: opacity var(--transition-duration) ease-in-out;
|
|
23
|
-
width: var(--width);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&::before {
|
|
27
|
-
background: var(--background);
|
|
28
|
-
border-radius: 1px 0 0 1px;
|
|
29
|
-
content: '';
|
|
30
|
-
height: var(--height);
|
|
31
|
-
transform: var(--translate);
|
|
32
|
-
transform-origin: top center;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
&--fixed {
|
|
37
|
-
position: fixed;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&--hidden {
|
|
41
|
-
opacity: 0;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
&-container {
|
|
46
|
-
display: flex;
|
|
47
|
-
flex-flow: column;
|
|
48
|
-
height: auto;
|
|
49
|
-
overflow: hidden;
|
|
50
|
-
position: relative;
|
|
51
|
-
width: 100%;
|
|
52
|
-
|
|
53
|
-
&--full {
|
|
54
|
-
height: 100%;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&-content {
|
|
58
|
-
display: flex;
|
|
59
|
-
flex-wrap: wrap;
|
|
60
|
-
height: 100%;
|
|
61
|
-
justify-content: flex-start;
|
|
62
|
-
margin-right: calc(var(--scrollbar-width) * -1);
|
|
63
|
-
overflow-x: hidden;
|
|
64
|
-
overflow-y: scroll;
|
|
65
|
-
padding-right: var(--scrollbar-width);
|
|
66
|
-
scrollbar-gutter: stable;
|
|
67
|
-
scroll-behavior: smooth;
|
|
68
|
-
width: calc(100% + var(--scrollbar-width));
|
|
69
|
-
|
|
70
|
-
&--snap {
|
|
71
|
-
overflow: auto;
|
|
72
|
-
scroll-snap-type: both mandatory;
|
|
73
|
-
overscroll-behavior-x: contain;
|
|
74
|
-
|
|
75
|
-
> * {
|
|
76
|
-
scroll-snap-stop: normal;
|
|
77
|
-
scroll-snap-align: center;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Attributes, Renderable } from '@esportsplus/template';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const factory = <
|
|
5
|
-
A extends Attributes,
|
|
6
|
-
C = Renderable<any>,
|
|
7
|
-
Context = { attributes?: A, content?: C }
|
|
8
|
-
>(
|
|
9
|
-
template: (this: Context, attributes: Readonly<A>, content: C) => Renderable<any>
|
|
10
|
-
) => {
|
|
11
|
-
function factory(): ReturnType<typeof template>;
|
|
12
|
-
function factory<T extends A>(attributes: T): ReturnType<typeof template>;
|
|
13
|
-
function factory<T extends C>(content: T): ReturnType<typeof template>;
|
|
14
|
-
function factory(attributes: A, content: C): ReturnType<typeof template>;
|
|
15
|
-
function factory(this: Context, one?: A | C, two?: C): ReturnType<typeof template> {
|
|
16
|
-
let attributes: A = {} as A,
|
|
17
|
-
content: C;
|
|
18
|
-
|
|
19
|
-
if (two === undefined) {
|
|
20
|
-
if (typeof one === 'object') {
|
|
21
|
-
attributes = one as A;
|
|
22
|
-
content = null as C;
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
content = one as C;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
attributes = one as A;
|
|
30
|
-
content = two;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return template.call(this, attributes, content);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return factory;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export default { factory };
|
package/src/themes/dark/alert.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import alert from '~/components/alert';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export default alert({
|
|
5
|
-
class: '--margin-600 --padding-500',
|
|
6
|
-
style: `
|
|
7
|
-
background: var(--color-black-400);
|
|
8
|
-
border: 2px solid var(--color-black-300);
|
|
9
|
-
box-shadow: var(--box-shadow-300);
|
|
10
|
-
`,
|
|
11
|
-
|
|
12
|
-
'alert-close': {
|
|
13
|
-
class: '--background-black --border-radius-300 --color-white',
|
|
14
|
-
style: '--color-default: var(--color-grey-500);margin: calc(var(--size-100) * -1) 0;'
|
|
15
|
-
},
|
|
16
|
-
'alert-messages': {
|
|
17
|
-
class: '--padding-horizontal --padding-500',
|
|
18
|
-
style: 'justify-content: center;'
|
|
19
|
-
},
|
|
20
|
-
'alert-message': {
|
|
21
|
-
style: 'color: var(--color-white-400);'
|
|
22
|
-
},
|
|
23
|
-
});
|