@esportsplus/ui 0.53.0 → 0.55.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 +51 -6
- package/build/components/accordion/index.d.ts +714 -23
- package/build/components/accordion/index.js +22 -11
- package/build/components/accordion/scss/index.scss +1 -1
- package/build/components/anchor/scss/index.scss +1 -1
- package/build/components/button/scss/index.scss +1 -1
- package/build/components/card/scss/index.scss +1 -1
- package/build/components/checkbox/constants.d.ts +2 -0
- package/build/components/checkbox/constants.js +2 -0
- package/build/components/checkbox/index.d.ts +16 -10
- package/build/components/checkbox/index.js +53 -39
- package/build/components/checkbox/scss/index.scss +1 -1
- package/build/components/checkbox/svg/check.svg +1 -0
- package/build/components/clipboard/copy.d.ts +11 -0
- package/build/components/clipboard/copy.js +54 -0
- package/build/components/clipboard/index.d.ts +1435 -1229
- package/build/components/clipboard/index.js +3 -2
- package/build/components/clipboard/onclick.d.ts +4 -38
- package/build/components/clipboard/onclick.js +10 -12
- package/build/components/counter/index.d.ts +1 -1
- package/build/components/counter/index.js +59 -71
- package/build/components/counter/scss/index.scss +1 -1
- package/build/components/form/action.d.ts +1 -1
- package/build/components/form/action.js +9 -12
- package/build/components/form/index.d.ts +5 -5
- package/build/components/form/input.d.ts +4 -4
- package/build/components/grid/scss/index.scss +1 -1
- package/build/components/icon/index.d.ts +2 -19
- package/build/components/icon/index.js +6 -6
- package/build/components/icon/scss/index.scss +1 -1
- package/build/components/index.d.ts +0 -7
- package/build/components/index.js +0 -7
- package/build/components/input/index.d.ts +1 -1
- package/build/components/input/index.js +12 -13
- package/build/components/input/scss/index.scss +1 -1
- package/build/components/link/scss/index.scss +1 -1
- package/build/components/loading/index.js +5 -5
- package/build/components/modal/scss/index.scss +1 -1
- package/build/components/normalize/scss/index.scss +1 -1
- package/build/components/overlay/index.d.ts +2 -19
- package/build/components/overlay/index.js +7 -7
- package/build/components/page/scss/index.scss +1 -1
- package/build/components/radio/index.d.ts +3 -10
- package/build/components/radio/index.js +2 -2
- package/build/components/range/index.d.ts +1 -1
- package/build/components/range/index.js +13 -13
- package/build/components/range/scss/index.scss +1 -1
- package/build/components/root/scss/index.scss +1 -1
- package/build/components/select/constants.d.ts +4 -0
- package/build/components/select/constants.js +4 -0
- package/build/components/select/index.d.ts +15 -52
- package/build/components/select/index.js +65 -94
- package/build/components/select/scss/index.scss +1 -1
- package/build/components/sidebar/index.d.ts +2 -19
- package/build/components/sidebar/index.js +7 -7
- package/build/components/sidebar/scss/index.scss +1 -1
- package/build/components/switch/index.d.ts +3 -10
- package/build/components/switch/index.js +2 -2
- package/build/components/tabs/scss/index.scss +2 -0
- package/build/components/text/scss/index.scss +1 -1
- package/build/components/textarea/index.d.ts +719 -6
- package/build/components/textarea/index.js +36 -17
- package/build/components/textarea/scss/index.scss +1 -1
- package/build/components/toast/index.js +43 -43
- package/build/components/toast/scss/index.scss +1 -1
- package/build/components/tooltip/constants.d.ts +3 -0
- package/build/components/tooltip/constants.js +3 -0
- package/build/components/tooltip/index.d.ts +8 -2546
- package/build/components/tooltip/index.js +2 -1
- package/build/components/tooltip/menu.d.ts +9 -21
- package/build/components/tooltip/menu.js +26 -29
- package/build/components/tooltip/onclick.d.ts +717 -1229
- package/build/components/tooltip/onclick.js +18 -60
- package/build/components/tooltip/onhover.d.ts +716 -20
- package/build/components/tooltip/onhover.js +14 -19
- package/build/components/tooltip/scss/index.scss +1 -1
- package/build/components/typewriter/index.d.ts +2 -19
- package/build/components/typewriter/index.js +8 -8
- package/build/css-utilities/background/scss/index.scss +1 -1
- package/build/css-utilities/border/scss/index.scss +1 -1
- package/build/css-utilities/color/scss/index.scss +1 -1
- package/build/css-utilities/font/geist/scss/Geist-Italic-Variable.woff2 +0 -0
- package/build/css-utilities/font/geist/scss/Geist-Variable.woff2 +0 -0
- package/build/css-utilities/font/geist/scss/GeistMono-Italic-Variable.woff2 +0 -0
- package/build/css-utilities/font/geist/scss/GeistMono-Variable.woff2 +0 -0
- package/build/css-utilities/font/geist/scss/index.scss +2 -0
- package/build/css-utilities/font/montserrat/index.d.ts +1 -0
- package/build/css-utilities/font/montserrat/index.js +1 -0
- package/build/css-utilities/font/montserrat/scss/index.scss +2 -0
- package/build/css-utilities/index.scss +1 -1
- package/build/css-utilities/inline/scss/index.scss +1 -1
- package/build/css-utilities/scrollbar/scss/index.scss +1 -1
- package/build/css-utilities/tabular/scss/index.scss +2 -0
- package/build/css-utilities/text/scss/index.scss +1 -1
- package/build/themes/dark/index.d.ts +0 -1
- package/build/themes/dark/index.js +0 -1
- package/build/themes/dark/input.d.ts +709 -115
- package/build/themes/dark/select.d.ts +3 -1409
- package/build/themes/dark/select.js +12 -9
- package/build/themes/dark/textarea.d.ts +716 -119
- package/package.json +12 -12
- package/pnpm-workspace.yaml +4 -3
- package/scripts/css-variables.test.mjs +50 -0
- package/scripts/sort-scss.md +57 -0
- package/scripts/sort-scss.mjs +233 -0
- package/scripts/sort-scss.test.mjs +217 -0
- package/src/components/accordion/index.ts +7 -14
- package/src/components/accordion/scss/index.scss +3 -1
- package/src/components/anchor/scss/index.scss +2 -2
- package/src/components/button/scss/index.scss +23 -57
- package/src/components/button/scss/variables.scss +1 -19
- package/src/components/card/scss/index.scss +11 -46
- package/src/components/card/scss/variables.scss +1 -2
- package/src/components/checkbox/constants.ts +4 -0
- package/src/components/checkbox/index.ts +20 -35
- package/src/components/checkbox/scss/index.scss +86 -28
- package/src/components/checkbox/scss/variables.scss +71 -30
- package/src/components/checkbox/svg/check.svg +1 -0
- package/src/components/clipboard/copy.ts +55 -0
- package/src/components/clipboard/index.ts +3 -2
- package/src/components/clipboard/onclick.ts +4 -9
- package/src/components/counter/index.ts +57 -66
- package/src/components/counter/scss/index.scss +4 -5
- package/src/components/counter/scss/variables.scss +0 -1
- package/src/components/form/action.ts +2 -8
- package/src/components/form/input.ts +4 -3
- package/src/components/grid/scss/index.scss +1 -1
- package/src/components/icon/scss/variables.scss +0 -1
- package/src/components/index.ts +1 -8
- package/src/components/input/index.ts +8 -6
- package/src/components/input/scss/index.scss +8 -7
- package/src/components/input/scss/variables.scss +0 -1
- package/src/components/link/scss/index.scss +9 -34
- package/src/components/link/scss/variables.scss +0 -12
- package/src/components/modal/scss/index.scss +4 -4
- package/src/components/normalize/scss/index.scss +0 -1
- package/src/components/page/scss/index.scss +0 -6
- package/src/components/page/scss/variables.scss +0 -2
- package/src/components/radio/index.ts +5 -3
- package/src/components/range/index.ts +1 -1
- package/src/components/range/scss/index.scss +5 -5
- package/src/components/root/scss/index.scss +37 -63
- package/src/components/root/scss/variables.scss +37 -67
- package/src/components/select/constants.ts +8 -0
- package/src/components/select/index.ts +49 -70
- package/src/components/select/scss/index.scss +10 -7
- package/src/components/select/scss/variables.scss +0 -1
- package/src/components/sidebar/scss/index.scss +3 -3
- package/src/components/switch/index.ts +5 -3
- package/src/components/tabs/scss/index.scss +62 -0
- package/src/components/tabs/scss/variables.scss +4 -0
- package/src/components/text/scss/index.scss +8 -1
- package/src/components/text/scss/variables.scss +5 -3
- package/src/components/textarea/index.ts +45 -13
- package/src/components/textarea/scss/index.scss +24 -13
- package/src/components/textarea/scss/variables.scss +0 -1
- package/src/components/toast/scss/index.scss +1 -1
- package/src/components/tooltip/constants.ts +6 -0
- package/src/components/tooltip/index.ts +4 -1
- package/src/components/tooltip/menu.ts +18 -29
- package/src/components/tooltip/onclick.ts +21 -88
- package/src/components/tooltip/onhover.ts +18 -29
- package/src/components/tooltip/scss/index.scss +2 -3
- package/src/css-utilities/background/scss/variables.scss +2 -2
- package/src/css-utilities/border/scss/index.scss +1 -27
- package/src/css-utilities/border/scss/variables.scss +3 -34
- package/src/css-utilities/color/scss/variables.scss +2 -6
- package/src/css-utilities/font/geist/scss/Geist-Italic-Variable.woff2 +0 -0
- package/src/css-utilities/font/geist/scss/Geist-Variable.woff2 +0 -0
- package/src/css-utilities/font/geist/scss/GeistMono-Italic-Variable.woff2 +0 -0
- package/src/css-utilities/font/geist/scss/GeistMono-Variable.woff2 +0 -0
- package/src/css-utilities/font/geist/scss/index.scss +55 -0
- package/src/css-utilities/font/montserrat/index.ts +1 -0
- package/src/{fonts → css-utilities/font}/montserrat/scss/index.scss +15 -0
- package/src/css-utilities/index.scss +6 -12
- package/src/css-utilities/inline/scss/index.scss +0 -1
- package/src/css-utilities/scrollbar/scss/index.scss +42 -0
- package/src/css-utilities/tabular/scss/index.scss +3 -0
- package/src/css-utilities/text/scss/index.scss +30 -71
- package/src/lib/scss/css-variables.scss +29 -5
- package/src/themes/dark/index.ts +0 -1
- package/src/themes/dark/select.ts +14 -9
- package/src/tokens/index.scss +1 -3
- package/src/tokens/scss/border-radius.scss +1 -6
- package/src/tokens/scss/color.scss +3 -3
- package/src/tokens/scss/scale.scss +1 -1
- package/src/tokens/scss/size.scss +7 -0
- package/src/tokens/scss/transition.scss +4 -0
- package/storage/svg/arrow-left.svg +1 -0
- package/storage/svg/arrow-right.svg +1 -0
- package/storage/svg/book.svg +1 -0
- package/storage/svg/cube.svg +1 -0
- package/storage/svg/github.svg +1 -0
- package/storage/svg/info.svg +1 -0
- package/storage/svg/palette.svg +1 -0
- package/storage/svg/search.svg +2 -0
- package/storage/svg/type.svg +1 -0
- package/vite.config.ts +8 -3
- package/build/components/back/index.d.ts +0 -21
- package/build/components/back/index.js +0 -16
- package/build/components/back/scss/index.scss +0 -2
- package/build/components/back/svg/arrow.svg +0 -15
- package/build/components/bubble/scss/index.scss +0 -2
- package/build/components/button/index.d.ts +0 -103
- package/build/components/button/index.js +0 -60
- package/build/components/ellipsis/index.d.ts +0 -4
- package/build/components/ellipsis/index.js +0 -8
- package/build/components/ellipsis/scss/index.scss +0 -2
- package/build/components/frame/index.d.ts +0 -21
- package/build/components/frame/index.js +0 -13
- package/build/components/frame/scss/index.scss +0 -2
- package/build/components/highlight/index.d.ts +0 -22
- package/build/components/highlight/index.js +0 -56
- package/build/components/highlight/scss/index.scss +0 -2
- package/build/components/loader/index.d.ts +0 -22
- package/build/components/loader/index.js +0 -78
- package/build/components/loader/scss/index.scss +0 -2
- package/build/components/radio/scss/index.scss +0 -2
- package/build/components/root/index.d.ts +0 -7
- package/build/components/root/index.js +0 -4
- package/build/components/root/onclick.d.ts +0 -5
- package/build/components/root/onclick.js +0 -12
- package/build/components/switch/scss/index.scss +0 -2
- package/build/css-utilities/[margin,padding]/scss/index.scss +0 -2
- package/build/css-utilities/error/scss/index.scss +0 -2
- package/build/css-utilities/flicker/scss/index.scss +0 -2
- package/build/css-utilities/focus/scss/index.scss +0 -2
- package/build/css-utilities/gap/scss/index.scss +0 -2
- package/build/css-utilities/line-height/scss/index.scss +0 -2
- package/build/css-utilities/pointer/scss/index.scss +0 -2
- package/build/css-utilities/scroll-fade/scss/index.scss +0 -2
- package/build/css-utilities/size/scss/index.scss +0 -2
- package/build/css-utilities/viewport/scss/index.scss +0 -2
- package/build/css-utilities/width/scss/index.scss +0 -2
- package/build/fonts/index.d.ts +0 -1
- package/build/fonts/index.js +0 -1
- package/build/fonts/montserrat/scss/index.scss +0 -2
- package/build/themes/dark/back.d.ts +0 -19
- package/build/themes/dark/back.js +0 -7
- package/build/themes/dark/button/scss/index.scss +0 -2
- package/build/themes/dark/link/scss/index.scss +0 -2
- package/src/components/back/index.ts +0 -20
- package/src/components/back/scss/index.scss +0 -17
- package/src/components/back/svg/arrow.svg +0 -15
- package/src/components/bubble/scss/index.scss +0 -32
- package/src/components/bubble/scss/variables.scss +0 -20
- package/src/components/button/index.ts +0 -53
- package/src/components/ellipsis/index.ts +0 -11
- package/src/components/ellipsis/scss/index.scss +0 -30
- package/src/components/ellipsis/scss/variables.scss +0 -5
- package/src/components/frame/index.ts +0 -13
- package/src/components/frame/scss/index.scss +0 -39
- package/src/components/frame/scss/variables.scss +0 -4
- package/src/components/highlight/index.ts +0 -66
- package/src/components/highlight/scss/index.scss +0 -7
- package/src/components/highlight/scss/variables.scss +0 -4
- package/src/components/loader/index.ts +0 -80
- package/src/components/loader/scss/index.scss +0 -71
- package/src/components/loader/scss/variables.scss +0 -6
- package/src/components/radio/scss/index.scss +0 -50
- package/src/components/radio/scss/variables.scss +0 -67
- package/src/components/root/index.ts +0 -6
- package/src/components/root/onclick.ts +0 -20
- package/src/components/switch/scss/index.scss +0 -48
- package/src/components/switch/scss/variables.scss +0 -74
- package/src/css-utilities/[margin,padding]/scss/index.scss +0 -43
- package/src/css-utilities/[margin,padding]/scss/variables.scss +0 -54
- package/src/css-utilities/error/scss/index.scss +0 -24
- package/src/css-utilities/error/scss/variables.scss +0 -3
- package/src/css-utilities/flicker/scss/index.scss +0 -15
- package/src/css-utilities/flicker/scss/variables.scss +0 -5
- package/src/css-utilities/focus/scss/index.scss +0 -7
- package/src/css-utilities/focus/scss/variables.scss +0 -5
- package/src/css-utilities/gap/scss/index.scss +0 -13
- package/src/css-utilities/gap/scss/variables.scss +0 -39
- package/src/css-utilities/line-height/scss/index.scss +0 -1
- package/src/css-utilities/line-height/scss/variables.scss +0 -10
- package/src/css-utilities/pointer/scss/index.scss +0 -5
- package/src/css-utilities/scroll-fade/scss/index.scss +0 -47
- package/src/css-utilities/scroll-fade/scss/variables.scss +0 -3
- package/src/css-utilities/size/scss/index.scss +0 -1
- package/src/css-utilities/size/scss/variables.scss +0 -12
- package/src/css-utilities/text/scss/variables.scss +0 -31
- package/src/css-utilities/viewport/scss/index.scss +0 -5
- package/src/css-utilities/width/scss/index.scss +0 -5
- package/src/css-utilities/width/scss/variables.scss +0 -9
- package/src/fonts/index.ts +0 -1
- package/src/themes/dark/back.ts +0 -9
- package/src/themes/dark/button/scss/index.scss +0 -46
- package/src/themes/dark/link/scss/index.scss +0 -26
- package/src/tokens/scss/font-weight.scss +0 -6
- package/src/tokens/scss/line-height.scss +0 -9
- package/src/tokens/scss/transition-duration.scss +0 -1
- /package/build/{fonts/montserrat → css-utilities/font/geist}/index.d.ts +0 -0
- /package/build/{fonts/montserrat → css-utilities/font/geist}/index.js +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Bold.woff +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Bold.woff2 +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-BoldItalic.woff +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-BoldItalic.woff2 +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Italic.woff +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Italic.woff2 +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Medium.woff +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Medium.woff2 +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-MediumItalic.woff +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-MediumItalic.woff2 +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Regular.woff +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Regular.woff2 +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBold.woff +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBold.woff2 +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBoldItalic.woff +0 -0
- /package/build/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBoldItalic.woff2 +0 -0
- /package/src/{fonts/montserrat → css-utilities/font/geist}/index.ts +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Bold.woff +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Bold.woff2 +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-BoldItalic.woff +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-BoldItalic.woff2 +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Italic.woff +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Italic.woff2 +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Medium.woff +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Medium.woff2 +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-MediumItalic.woff +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-MediumItalic.woff2 +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Regular.woff +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-Regular.woff2 +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBold.woff +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBold.woff2 +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBoldItalic.woff +0 -0
- /package/src/{fonts → css-utilities/font}/montserrat/scss/Montserrat-SemiBoldItalic.woff2 +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
.text {
|
|
2
|
+
--border-width: 0px;
|
|
2
3
|
--color: var(--color-default, inherit);
|
|
3
|
-
--
|
|
4
|
-
--
|
|
5
|
-
--
|
|
4
|
+
--color-active: var(--color-default);
|
|
5
|
+
--color-default: var(--color-text-400);
|
|
6
|
+
--color-hover: var(--color-default);
|
|
7
|
+
--color-pressed: var(--color-default);
|
|
6
8
|
--width: auto;
|
|
7
9
|
}
|
|
@@ -1,27 +1,60 @@
|
|
|
1
|
-
import { html, type Attributes } from '@esportsplus/template';
|
|
1
|
+
import { component, html, type Attributes } from '@esportsplus/template';
|
|
2
2
|
import { reactive } from '@esportsplus/reactivity';
|
|
3
|
-
import { omit } from '@esportsplus/utilities';
|
|
4
3
|
import form from '~/components/form';
|
|
5
4
|
import './scss/index.scss';
|
|
6
5
|
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
type Autoresize = { height: { max: `${number}px`, min: `${number}px` } };
|
|
9
8
|
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
function autoresize({ height }: Autoresize) {
|
|
11
|
+
let attributes = {
|
|
12
|
+
class: 'textarea--autoresize',
|
|
13
|
+
style: `
|
|
14
|
+
--max-height: ${height.max};
|
|
15
|
+
--min-height: ${height.min};
|
|
16
|
+
`
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
if (CSS.supports('field-sizing', 'content')) {
|
|
20
|
+
return attributes;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
...attributes,
|
|
25
|
+
class: `${attributes.class} textarea--autoresize-fallback`,
|
|
26
|
+
oninput: (e: InputEvent) => {
|
|
27
|
+
let element = e.target as HTMLTextAreaElement;
|
|
28
|
+
|
|
29
|
+
element.style.setProperty('--content-height', '0px');
|
|
30
|
+
element.style.setProperty('--content-height', `${element.scrollHeight}px`);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
export default component(function(
|
|
12
37
|
this: { attributes?: Attributes },
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
38
|
+
{
|
|
39
|
+
autoresize: resize,
|
|
40
|
+
state = reactive({
|
|
16
41
|
active: false,
|
|
17
42
|
error: ''
|
|
18
|
-
})
|
|
43
|
+
}),
|
|
44
|
+
...attributes
|
|
45
|
+
}: Attributes & {
|
|
46
|
+
autoresize?: Autoresize,
|
|
47
|
+
state?: { active: boolean, error: string }
|
|
48
|
+
}
|
|
49
|
+
) {
|
|
50
|
+
attributes.value ??= '';
|
|
19
51
|
|
|
20
52
|
return html`
|
|
21
53
|
<textarea
|
|
22
54
|
class='textarea'
|
|
23
|
-
${this?.attributes
|
|
24
|
-
${
|
|
55
|
+
${this?.attributes}
|
|
56
|
+
${attributes}
|
|
57
|
+
${resize && autoresize(resize)}
|
|
25
58
|
${{
|
|
26
59
|
class: () => state.active && '--active',
|
|
27
60
|
onfocusin: () => {
|
|
@@ -30,9 +63,8 @@ export default function(
|
|
|
30
63
|
onfocusout: () => {
|
|
31
64
|
state.active = false;
|
|
32
65
|
},
|
|
33
|
-
onrender: form.input.onrender(state)
|
|
34
|
-
value: attributes?.value || ''
|
|
66
|
+
onrender: form.input.onrender(state)
|
|
35
67
|
}}
|
|
36
68
|
></textarea>
|
|
37
69
|
`;
|
|
38
|
-
};
|
|
70
|
+
});
|
|
@@ -1,32 +1,43 @@
|
|
|
1
1
|
@use 'variables';
|
|
2
2
|
|
|
3
3
|
.textarea {
|
|
4
|
-
align-items: center;
|
|
5
4
|
background: var(--background);
|
|
6
5
|
border: var(--border-width) var(--border-style) var(--border-color);
|
|
7
6
|
border-radius: var(--border-radius);
|
|
8
7
|
color: var(--color);
|
|
9
8
|
cursor: text;
|
|
10
|
-
display: flex;
|
|
11
|
-
field-sizing: content;
|
|
12
9
|
flex: 1 1 auto;
|
|
13
|
-
flex-wrap: wrap;
|
|
14
10
|
font-size: var(--font-size);
|
|
15
|
-
line-height: var(--line-height);
|
|
16
11
|
min-width: 0;
|
|
17
|
-
padding:
|
|
12
|
+
padding:
|
|
13
|
+
max(0px, calc(var(--padding-vertical) - var(--border-width)))
|
|
14
|
+
max(0px, calc(var(--padding-horizontal) - var(--border-width)));
|
|
18
15
|
position: relative;
|
|
19
16
|
transition:
|
|
20
|
-
background var(--transition-duration)
|
|
21
|
-
border-color var(--transition-duration)
|
|
22
|
-
box-shadow var(--transition-duration)
|
|
23
|
-
opacity var(--transition-duration)
|
|
24
|
-
transform var(--transition-duration)
|
|
25
|
-
white-space: normal;
|
|
17
|
+
background var(--transition-duration) var(--transition-timing-function),
|
|
18
|
+
border-color var(--transition-duration) var(--transition-timing-function),
|
|
19
|
+
box-shadow var(--transition-duration) var(--transition-timing-function),
|
|
20
|
+
opacity var(--transition-duration) var(--transition-timing-function),
|
|
21
|
+
transform var(--transition-duration) var(--transition-timing-function);
|
|
26
22
|
width: 100%;
|
|
27
23
|
|
|
28
24
|
&:invalid,
|
|
29
25
|
&:required {
|
|
30
26
|
box-shadow: none;
|
|
31
27
|
}
|
|
32
|
-
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
&--autoresize {
|
|
31
|
+
field-sizing: content;
|
|
32
|
+
height: auto;
|
|
33
|
+
max-height: var(--max-height);
|
|
34
|
+
min-height: var(--min-height);
|
|
35
|
+
overflow-y: auto;
|
|
36
|
+
resize: none;
|
|
37
|
+
|
|
38
|
+
&-fallback {
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
height: calc(var(--content-height, var(--min-height)) + 2 * var(--border-width));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
--color-hover: var(--color-default);
|
|
20
20
|
--color-pressed: var(--color-default);
|
|
21
21
|
--font-size: var(--font-size-400);
|
|
22
|
-
--line-height: var(--line-height-400);
|
|
23
22
|
--padding-horizontal: var(--size-400);
|
|
24
23
|
--padding-vertical: var(--size-400);
|
|
25
24
|
--size: var(--size-400);
|
|
@@ -1,55 +1,44 @@
|
|
|
1
1
|
import { component, html, type Attributes, type Renderable } from '@esportsplus/template';
|
|
2
2
|
import { reactive } from '@esportsplus/reactivity';
|
|
3
|
-
import {
|
|
3
|
+
import { MENU_OPTION, MENU_TOOLTIP_CONTENT } from './constants';
|
|
4
4
|
import onclick from './onclick';
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
type A = Attributes & {
|
|
8
|
+
[MENU_OPTION]?: Attributes,
|
|
9
|
+
[MENU_TOOLTIP_CONTENT]?: Attributes & { direction?: string },
|
|
8
10
|
options: (Attributes & { content: Renderable<unknown> })[],
|
|
9
|
-
option?: Attributes,
|
|
10
11
|
state?: { active: boolean },
|
|
11
|
-
toggle?: boolean
|
|
12
|
-
'tooltip-content': Attributes & { direction?: string }
|
|
12
|
+
toggle?: boolean
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const OMIT_TOOLTIP_CONTENT = ['direction'];
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export default component<A>(
|
|
24
|
-
(attributes, content) => {
|
|
25
|
-
let options = attributes.options,
|
|
26
|
-
option = attributes.option,
|
|
27
|
-
state = attributes.state || reactive({ active: false }),
|
|
28
|
-
tooltipContent = attributes?.['tooltip-content'],
|
|
29
|
-
tooltipContentDirection = tooltipContent?.direction || 'nw';
|
|
16
|
+
export default Object.assign(component<A>(
|
|
17
|
+
({ options, state = reactive({ active: false }), ...attributes }, content) => {
|
|
18
|
+
let { direction = 'nw', ...tooltipContent } = attributes[MENU_TOOLTIP_CONTENT] ?? {};
|
|
30
19
|
|
|
31
20
|
return onclick(
|
|
32
|
-
{ ...
|
|
21
|
+
{ ...attributes, state },
|
|
33
22
|
html`
|
|
34
23
|
${content}
|
|
35
24
|
|
|
36
25
|
<div
|
|
37
|
-
class='tooltip-content ${`tooltip-content--${
|
|
38
|
-
${tooltipContent
|
|
26
|
+
class='tooltip-content ${`tooltip-content--${direction}`}'
|
|
27
|
+
${tooltipContent}
|
|
39
28
|
${{
|
|
40
29
|
inert: () => !state.active
|
|
41
30
|
}}
|
|
42
31
|
>
|
|
43
|
-
${options.map((o) => {
|
|
32
|
+
${options.map(({ content, ...o }) => {
|
|
44
33
|
if (o.href) {
|
|
45
34
|
return html`
|
|
46
35
|
<a
|
|
47
36
|
class='link --width-full'
|
|
48
37
|
target='_blank'
|
|
49
|
-
${
|
|
50
|
-
${
|
|
38
|
+
${o}
|
|
39
|
+
${attributes[MENU_OPTION]}
|
|
51
40
|
>
|
|
52
|
-
${
|
|
41
|
+
${content}
|
|
53
42
|
</a>
|
|
54
43
|
`;
|
|
55
44
|
}
|
|
@@ -57,10 +46,10 @@ export default component<A>(
|
|
|
57
46
|
return html`
|
|
58
47
|
<div
|
|
59
48
|
class='link --width-full'
|
|
60
|
-
${
|
|
61
|
-
${
|
|
49
|
+
${o}
|
|
50
|
+
${attributes[MENU_OPTION]}
|
|
62
51
|
>
|
|
63
|
-
${
|
|
52
|
+
${content}
|
|
64
53
|
</div>
|
|
65
54
|
`;
|
|
66
55
|
})}
|
|
@@ -68,4 +57,4 @@ export default component<A>(
|
|
|
68
57
|
`
|
|
69
58
|
);
|
|
70
59
|
}
|
|
71
|
-
);
|
|
60
|
+
), { option: MENU_OPTION, tooltipContent: MENU_TOOLTIP_CONTENT } as const);
|
|
@@ -1,96 +1,29 @@
|
|
|
1
1
|
import { component, html, type Attributes } from '@esportsplus/template';
|
|
2
2
|
import { reactive } from '@esportsplus/reactivity';
|
|
3
|
-
import { omit } from '@esportsplus/utilities';
|
|
4
|
-
import root from '~/components/root';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const OMIT = ['state', 'toggle'];
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
let parent: HTMLElement | null | undefined = null,
|
|
11
|
-
queue: { fn: VoidFunction, tooltip: HTMLElement }[] = [],
|
|
12
|
-
running = false,
|
|
13
|
-
scheduled = false;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function frame() {
|
|
17
|
-
if (running) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
running = true;
|
|
22
|
-
|
|
23
|
-
let item,
|
|
24
|
-
keep;
|
|
25
|
-
|
|
26
|
-
while (item = queue.pop()) {
|
|
27
|
-
if (parent === item.tooltip) {
|
|
28
|
-
keep = item;
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
item.fn();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (keep) {
|
|
36
|
-
queue.push(keep);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
running = false;
|
|
40
|
-
}
|
|
41
3
|
|
|
42
4
|
|
|
43
5
|
export default component<Attributes & { state?: { active: boolean }, toggle?: boolean }>(
|
|
44
|
-
(attributes, content) =>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (this === node || (toggle && this.contains(node))) {
|
|
59
|
-
active = !state.active;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (parent !== this && !parent?.contains(this)) {
|
|
63
|
-
parent = this.parentElement?.closest('.tooltip');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
frame();
|
|
67
|
-
|
|
68
|
-
if (parent === this) {
|
|
69
|
-
parent = null;
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
state.active = active;
|
|
74
|
-
|
|
75
|
-
if (active) {
|
|
76
|
-
queue.push({
|
|
77
|
-
fn: () => state.active = false,
|
|
78
|
-
tooltip: this
|
|
79
|
-
});
|
|
80
|
-
}
|
|
6
|
+
({ state = reactive({ active: false }), toggle = false, ...attributes }, content) => html`
|
|
7
|
+
<div
|
|
8
|
+
class='tooltip'
|
|
9
|
+
${attributes}
|
|
10
|
+
${{
|
|
11
|
+
class: () => state.active && '--active',
|
|
12
|
+
onclick: function(e) {
|
|
13
|
+
state.active = this === e.target || toggle ? !state.active : true;
|
|
14
|
+
},
|
|
15
|
+
ondocumentclick: function(this, event) {
|
|
16
|
+
if (!this?.isConnected || !state.active) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
81
19
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
frame();
|
|
85
|
-
scheduled = false;
|
|
86
|
-
});
|
|
87
|
-
scheduled = true;
|
|
88
|
-
}
|
|
20
|
+
if (!this.contains(event.target as Node | null)) {
|
|
21
|
+
state.active = false;
|
|
89
22
|
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
23
|
+
}
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
${content}
|
|
27
|
+
</div>
|
|
28
|
+
`
|
|
96
29
|
);
|
|
@@ -1,34 +1,23 @@
|
|
|
1
1
|
import { component, html, Attributes } from '@esportsplus/template';
|
|
2
2
|
import { reactive } from '@esportsplus/reactivity';
|
|
3
|
-
import { omit } from '@esportsplus/utilities';
|
|
4
3
|
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
onmouseout: () => {
|
|
26
|
-
state.active = false;
|
|
27
|
-
}
|
|
28
|
-
}}
|
|
29
|
-
>
|
|
30
|
-
${content}
|
|
31
|
-
</div>
|
|
32
|
-
`;
|
|
33
|
-
}
|
|
5
|
+
export default component<Attributes & { state?: { active: boolean } }>(
|
|
6
|
+
({ state = reactive({ active: false }), ...attributes }, content) => html`
|
|
7
|
+
<div
|
|
8
|
+
class='tooltip'
|
|
9
|
+
${attributes}
|
|
10
|
+
${{
|
|
11
|
+
class: () => state.active && '--active',
|
|
12
|
+
onmouseover: () => {
|
|
13
|
+
state.active = true;
|
|
14
|
+
},
|
|
15
|
+
onmouseout: () => {
|
|
16
|
+
state.active = false;
|
|
17
|
+
}
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
${content}
|
|
21
|
+
</div>
|
|
22
|
+
`
|
|
34
23
|
);
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
opacity: 0;
|
|
55
55
|
overflow: hidden;
|
|
56
56
|
transition:
|
|
57
|
-
opacity var(--transition-duration)
|
|
58
|
-
transform var(--transition-duration)
|
|
57
|
+
opacity var(--transition-duration) var(--transition-timing-function),
|
|
58
|
+
transform var(--transition-duration) var(--transition-timing-function);
|
|
59
59
|
width: var(--width);
|
|
60
60
|
z-index: 9;
|
|
61
61
|
|
|
@@ -88,7 +88,6 @@
|
|
|
88
88
|
cursor: auto;
|
|
89
89
|
font-size: var(--font-size);
|
|
90
90
|
font-weight: var(--font-weight);
|
|
91
|
-
line-height: normal;
|
|
92
91
|
padding: var(--padding-vertical) var(--padding-horizontal);
|
|
93
92
|
pointer-events: none;
|
|
94
93
|
white-space: nowrap;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@use '/tokens';
|
|
2
2
|
|
|
3
3
|
.--background {
|
|
4
|
+
@include tokens.state-utility('background', tokens.$colors);
|
|
5
|
+
|
|
4
6
|
&-default {
|
|
5
7
|
--background: var(--background-default);
|
|
6
8
|
--background-active: var(--background-default);
|
|
@@ -27,7 +29,5 @@
|
|
|
27
29
|
--background: var(--background-pressed);
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
|
-
|
|
31
|
-
@include tokens.state-utility('background', tokens.$colors);
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -1,27 +1 @@
|
|
|
1
|
-
@use './variables';
|
|
2
|
-
|
|
3
|
-
.--border {
|
|
4
|
-
border: var(--border-width) var(--border-style) var(--border-color);
|
|
5
|
-
|
|
6
|
-
@each $key in 'bottom' 'left' 'right' 'top' {
|
|
7
|
-
&-#{$key} {
|
|
8
|
-
border-#{$key}: var(--border-width) var(--border-style) var(--border-color);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
&-offset {
|
|
13
|
-
@each $key in 'bottom' 'left' 'right' 'top' {
|
|
14
|
-
&-#{$key} {
|
|
15
|
-
margin-#{$key}: calc(var(--border-width) * -1);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&-radius {
|
|
21
|
-
border-radius: var(--border-radius);
|
|
22
|
-
|
|
23
|
-
&-circle {
|
|
24
|
-
aspect-ratio: 1;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
@use './variables';
|
|
@@ -2,30 +2,11 @@
|
|
|
2
2
|
@use '/tokens';
|
|
3
3
|
|
|
4
4
|
.--border {
|
|
5
|
-
|
|
6
|
-
&-bottom,
|
|
7
|
-
&-left,
|
|
8
|
-
&-right,
|
|
9
|
-
&-top {
|
|
10
|
-
--border-style: solid;
|
|
11
|
-
--border-width: var(--border-width-400);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&-dashed {
|
|
15
|
-
--border-style: dashed;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
&-dotted {
|
|
19
|
-
--border-style: dotted;
|
|
20
|
-
}
|
|
5
|
+
@include tokens.state-utility('border-color', tokens.$colors);
|
|
21
6
|
|
|
22
7
|
&-radius {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@each $key in lib.map-keys(tokens.$border-radius) {
|
|
26
|
-
&-#{$key} {
|
|
27
|
-
--border-radius: var(--border-radius-#{$key});
|
|
28
|
-
}
|
|
8
|
+
&-responsive {
|
|
9
|
+
--border-radius: #{"calc( progress((100vi - 100cqi) / 2, 0px, var(--gap-horizontal)) * var(--border-radius) )"};
|
|
29
10
|
}
|
|
30
11
|
}
|
|
31
12
|
|
|
@@ -55,16 +36,4 @@
|
|
|
55
36
|
--border-color: var(--border-color-pressed);
|
|
56
37
|
}
|
|
57
38
|
}
|
|
58
|
-
|
|
59
|
-
&-width {
|
|
60
|
-
--border-width: var(--border-width-400);
|
|
61
|
-
|
|
62
|
-
@each $key in lib.map-keys(tokens.$border-width) {
|
|
63
|
-
&-#{$key} {
|
|
64
|
-
--border-width: var(--border-width-#{$key});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
@include tokens.state-utility('border-color', tokens.$colors);
|
|
70
39
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@use '/tokens';
|
|
2
2
|
|
|
3
3
|
.--color {
|
|
4
|
+
@include tokens.state-utility('color', tokens.$colors);
|
|
5
|
+
|
|
4
6
|
&-default {
|
|
5
7
|
--color: var(--color-default);
|
|
6
8
|
--color-active: var(--color-default);
|
|
@@ -8,10 +10,6 @@
|
|
|
8
10
|
--color-pressed: var(--color-default);
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
&-inherit {
|
|
12
|
-
--color: inherit;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
13
|
&-state {
|
|
16
14
|
--color: var(--color-default);
|
|
17
15
|
--color-active: var(--color-default);
|
|
@@ -31,6 +29,4 @@
|
|
|
31
29
|
--color: var(--color-pressed);
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
|
-
|
|
35
|
-
@include tokens.state-utility('color', tokens.$colors);
|
|
36
32
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
@use '/lib';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@font-face {
|
|
5
|
+
font-display: swap;
|
|
6
|
+
font-family: 'Geist';
|
|
7
|
+
font-style: normal;
|
|
8
|
+
font-weight: 100 900;
|
|
9
|
+
src: url('./Geist-Variable.woff2') format('woff2');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@font-face {
|
|
13
|
+
font-display: swap;
|
|
14
|
+
font-family: 'Geist';
|
|
15
|
+
font-style: italic;
|
|
16
|
+
font-weight: 100 900;
|
|
17
|
+
src: url('./Geist-Italic-Variable.woff2') format('woff2');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@font-face {
|
|
21
|
+
font-display: swap;
|
|
22
|
+
font-family: 'Geist Mono';
|
|
23
|
+
font-style: normal;
|
|
24
|
+
font-weight: 100 900;
|
|
25
|
+
src: url('./GeistMono-Variable.woff2') format('woff2');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@font-face {
|
|
29
|
+
font-display: swap;
|
|
30
|
+
font-family: 'Geist Mono';
|
|
31
|
+
font-style: italic;
|
|
32
|
+
font-weight: 100 900;
|
|
33
|
+
src: url('./GeistMono-Italic-Variable.woff2') format('woff2');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
.--font-geist {
|
|
38
|
+
--font-family: 'Geist', sans-serif;
|
|
39
|
+
|
|
40
|
+
&,
|
|
41
|
+
&-mono {
|
|
42
|
+
@include lib.css-variables(font-weight, (
|
|
43
|
+
300: 300,
|
|
44
|
+
400: 400,
|
|
45
|
+
500: 500,
|
|
46
|
+
600: 600
|
|
47
|
+
));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&-mono {
|
|
51
|
+
--font-family: 'Geist Mono', monospace;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './scss/index.scss';
|