@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.
Files changed (150) hide show
  1. package/README.md +2 -3
  2. package/build/components/accordion/index.d.ts +15 -10
  3. package/build/components/accordion/index.js +8 -34
  4. package/build/components/accordion/scss/index.scss +1 -1
  5. package/build/components/back/index.d.ts +14 -11
  6. package/build/components/back/index.js +3 -3
  7. package/build/components/button/index.js +2 -2
  8. package/build/components/checkbox/index.js +7 -3
  9. package/build/components/clipboard/index.d.ts +23 -20
  10. package/build/components/clipboard/index.js +1 -0
  11. package/build/components/clipboard/onclick.js +3 -3
  12. package/build/components/form/input.js +3 -3
  13. package/build/components/frame/index.d.ts +16 -15
  14. package/build/components/frame/index.js +11 -5
  15. package/build/components/highlight/index.js +2 -2
  16. package/build/components/icon/index.js +2 -2
  17. package/build/components/index.d.ts +1 -4
  18. package/build/components/index.js +1 -4
  19. package/build/components/loader/index.js +4 -4
  20. package/build/components/loader/scss/index.scss +1 -1
  21. package/build/components/overlay/index.d.ts +16 -15
  22. package/build/components/overlay/index.js +11 -5
  23. package/build/components/overlay/scss/index.scss +1 -1
  24. package/build/components/page/scss/index.scss +1 -1
  25. package/build/components/root/scss/index.scss +1 -1
  26. package/build/components/select/index.d.ts +3 -6
  27. package/build/components/select/index.js +72 -78
  28. package/build/components/sidebar/index.d.ts +16 -15
  29. package/build/components/sidebar/index.js +11 -5
  30. package/build/components/sidebar/scss/index.scss +1 -1
  31. package/build/components/toast/index.d.ts +9 -0
  32. package/build/components/toast/index.js +157 -0
  33. package/build/components/toast/manager.d.ts +60 -0
  34. package/build/components/toast/manager.js +203 -0
  35. package/build/components/toast/scss/index.scss +2 -0
  36. package/build/components/toast/svg/check.svg +1 -0
  37. package/build/components/toast/svg/chevron.svg +1 -0
  38. package/build/components/toast/svg/close.svg +1 -0
  39. package/build/components/toast/svg/copy.svg +1 -0
  40. package/build/components/toast/svg/error.svg +1 -0
  41. package/build/components/toast/svg/info.svg +1 -0
  42. package/build/components/toast/svg/loading.svg +1 -0
  43. package/build/components/toast/svg/success.svg +1 -0
  44. package/build/components/toast/svg/warning.svg +1 -0
  45. package/build/components/tooltip/index.d.ts +40 -40
  46. package/build/components/tooltip/menu.js +37 -23
  47. package/build/components/tooltip/onclick.d.ts +20 -20
  48. package/build/components/tooltip/onclick.js +2 -2
  49. package/build/components/tooltip/onhover.js +2 -2
  50. package/build/components/typewriter/index.js +2 -2
  51. package/build/css-utilities/index.scss +1 -1
  52. package/build/css-utilities/scroll-fade/scss/index.scss +2 -0
  53. package/build/css-utilities/scrollbar/scss/index.scss +2 -0
  54. package/build/themes/dark/back.d.ts +8 -4
  55. package/build/themes/dark/index.d.ts +0 -1
  56. package/build/themes/dark/index.js +0 -1
  57. package/build/themes/dark/input.d.ts +2 -2
  58. package/build/themes/dark/select.d.ts +60 -110
  59. package/build/themes/dark/textarea.d.ts +2 -2
  60. package/package.json +15 -15
  61. package/pnpm-workspace.yaml +11 -8
  62. package/src/components/accordion/index.ts +7 -30
  63. package/src/components/accordion/scss/index.scss +9 -12
  64. package/src/components/back/index.ts +4 -5
  65. package/src/components/button/index.ts +2 -3
  66. package/src/components/checkbox/index.ts +7 -2
  67. package/src/components/clipboard/index.ts +2 -1
  68. package/src/components/clipboard/onclick.ts +3 -4
  69. package/src/components/form/input.ts +4 -4
  70. package/src/components/frame/index.ts +9 -5
  71. package/src/components/highlight/index.ts +2 -3
  72. package/src/components/icon/index.ts +2 -3
  73. package/src/components/index.ts +1 -4
  74. package/src/components/loader/index.ts +5 -6
  75. package/src/components/loader/scss/index.scss +1 -1
  76. package/src/components/overlay/index.ts +9 -5
  77. package/src/components/overlay/scss/index.scss +0 -1
  78. package/src/components/page/scss/index.scss +1 -1
  79. package/src/components/root/scss/index.scss +35 -4
  80. package/src/components/root/scss/variables.scss +1 -2
  81. package/src/components/select/index.ts +71 -83
  82. package/src/components/sidebar/index.ts +9 -5
  83. package/src/components/sidebar/scss/index.scss +0 -1
  84. package/src/components/toast/index.ts +188 -0
  85. package/src/components/toast/manager.ts +312 -0
  86. package/src/components/toast/scss/index.scss +276 -0
  87. package/src/components/toast/scss/variables.scss +19 -0
  88. package/src/components/toast/svg/check.svg +1 -0
  89. package/src/components/toast/svg/chevron.svg +1 -0
  90. package/src/components/toast/svg/close.svg +1 -0
  91. package/src/components/toast/svg/copy.svg +1 -0
  92. package/src/components/toast/svg/error.svg +1 -0
  93. package/src/components/toast/svg/info.svg +1 -0
  94. package/src/components/toast/svg/loading.svg +1 -0
  95. package/src/components/toast/svg/success.svg +1 -0
  96. package/src/components/toast/svg/warning.svg +1 -0
  97. package/src/components/tooltip/menu.ts +8 -4
  98. package/src/components/tooltip/onclick.ts +2 -3
  99. package/src/components/tooltip/onhover.ts +2 -3
  100. package/src/components/typewriter/index.ts +2 -3
  101. package/src/css-utilities/index.scss +3 -2
  102. package/src/css-utilities/scroll-fade/scss/index.scss +47 -0
  103. package/src/css-utilities/scroll-fade/scss/variables.scss +3 -0
  104. package/src/css-utilities/scrollbar/scss/index.scss +53 -0
  105. package/src/css-utilities/scrollbar/scss/variables.scss +5 -0
  106. package/src/themes/dark/index.ts +0 -1
  107. package/src/tokens/scss/color.scss +14 -14
  108. package/src/tokens/scss/font-size.scss +12 -11
  109. package/src/tokens/scss/line-height.scss +7 -4
  110. package/src/tokens/scss/scale.scss +22 -0
  111. package/src/tokens/scss/size.scss +12 -9
  112. package/src/tokens/scss/spacer.scss +9 -9
  113. package/storage/svg/bolt.svg +1 -0
  114. package/storage/svg/star.svg +1 -0
  115. package/tsconfig.json +6 -2
  116. package/vite-env.d.ts +1 -0
  117. package/vite.config.ts +73 -72
  118. package/build/components/alert/index.d.ts +0 -19
  119. package/build/components/alert/index.js +0 -151
  120. package/build/components/alert/scss/index.scss +0 -2
  121. package/build/components/alert/svg/check.svg +0 -11
  122. package/build/components/alert/svg/close.svg +0 -12
  123. package/build/components/alert/svg/error.svg +0 -18
  124. package/build/components/scrollbar/index.d.ts +0 -27
  125. package/build/components/scrollbar/index.js +0 -56
  126. package/build/components/scrollbar/scss/index.scss +0 -2
  127. package/build/components/site/index.d.ts +0 -20
  128. package/build/components/site/index.js +0 -9
  129. package/build/components/site/scss/index.scss +0 -2
  130. package/build/components/template/index.d.ts +0 -14
  131. package/build/components/template/index.js +0 -21
  132. package/build/css-utilities/scroller/scss/index.scss +0 -2
  133. package/build/themes/dark/alert.d.ts +0 -11
  134. package/build/themes/dark/alert.js +0 -20
  135. package/src/components/accordion/scss/variables.scss +0 -9
  136. package/src/components/alert/index.ts +0 -165
  137. package/src/components/alert/scss/index.scss +0 -25
  138. package/src/components/alert/scss/variables.scss +0 -3
  139. package/src/components/alert/svg/check.svg +0 -11
  140. package/src/components/alert/svg/close.svg +0 -12
  141. package/src/components/alert/svg/error.svg +0 -18
  142. package/src/components/scrollbar/index.ts +0 -70
  143. package/src/components/scrollbar/scss/index.scss +0 -82
  144. package/src/components/scrollbar/scss/variables.scss +0 -6
  145. package/src/components/site/index.ts +0 -11
  146. package/src/components/site/scss/index.scss +0 -3
  147. package/src/components/template/index.ts +0 -40
  148. package/src/css-utilities/scroller/scss/index.scss +0 -8
  149. package/src/css-utilities/scroller/scss/variables.scss +0 -4
  150. package/src/themes/dark/alert.ts +0 -23
@@ -1,17 +1,14 @@
1
- @use '/tokens';
2
- @use 'variables';
3
-
4
1
  .accordion {
5
- max-height: var(--max-height);
6
- opacity: 0;
7
- pointer-events: none;
8
- transition:
9
- max-height var(--transition-duration) ease-in-out,
10
- opacity var(--transition-duration) ease-in-out;
2
+ display: grid;
3
+ grid-template-rows: 1fr;
4
+ transition: grid-template-rows .3s;
11
5
 
6
+ &[inert] {
7
+ grid-template-rows: 0fr;
8
+ }
12
9
 
13
- @include tokens.state(active) {
14
- opacity: 1;
15
- pointer-events: auto;
10
+ &-content {
11
+ min-height: 0;
12
+ overflow: hidden;
16
13
  }
17
14
  }
@@ -1,16 +1,15 @@
1
- import { html, Attributes } from '@esportsplus/template';
1
+ import { component, html } from '@esportsplus/template';
2
2
  import icon from '~/components/icon';
3
- import template from '~/components/template';
4
3
  import arrow from './svg/arrow.svg';
5
4
  import './scss/index.scss';
6
5
 
7
6
 
8
- export default template.factory(
9
- function (this: { attributes?: Attributes }, attributes, content) {
7
+ export default component(
8
+ function (this, attributes, content) {
10
9
  return html`
11
10
  <a
12
11
  class='back link --padding-0px --flex-vertical'
13
- ${this.attributes}
12
+ ${this?.attributes}
14
13
  ${attributes}
15
14
  >
16
15
  ${icon({ class: 'back-arrow --margin-right --margin-200' }, arrow)}
@@ -1,10 +1,9 @@
1
- import { html, type Renderable } from '@esportsplus/template';
1
+ import { component, html, type Renderable } from '@esportsplus/template';
2
2
  import { reactive } from '@esportsplus/reactivity';
3
- import template from '../template';
4
3
  import './scss/index.scss';
5
4
 
6
5
 
7
- const hold = template.factory(
6
+ const hold = component(
8
7
  function(attributes, content: (state: { holding: boolean, complete: boolean }) => Renderable<any>) {
9
8
  let end = () => {
10
9
  if (!state.complete) {
@@ -13,7 +13,8 @@ const factory = (type: string) => {
13
13
  this: { attributes?: Attributes } | any,
14
14
  attributes?: Attributes & { state?: { active: boolean, error: string } }
15
15
  ) {
16
- let state = attributes?.state || reactive({
16
+ let ref: HTMLElement,
17
+ state = attributes?.state || reactive({
17
18
  active: false,
18
19
  error: ''
19
20
  });
@@ -24,9 +25,10 @@ const factory = (type: string) => {
24
25
 
25
26
  return html`
26
27
  <div
27
- class='${type} ${() => state.active && '--active'}'
28
+ class='${() => state.active ? type + " --active" : type}'
28
29
  ${this?.attributes && omit(this.attributes, OMIT)}
29
30
  ${attributes && omit(attributes, OMIT)}
31
+ onclick=${() => ref.click()}
30
32
  >
31
33
  <input
32
34
  ${{
@@ -35,6 +37,9 @@ const factory = (type: string) => {
35
37
  onchange: (e: Event) => {
36
38
  state.active = (e.target as HTMLInputElement).checked;
37
39
  },
40
+ onconnect: (input) => {
41
+ ref = input;
42
+ },
38
43
  onrender: form.input.onrender(state),
39
44
  type: type === 'radio' ? 'radio' : 'checkbox',
40
45
  value: attributes?.value || 1
@@ -2,4 +2,5 @@ import onclick from './onclick';
2
2
  import write from './write';
3
3
 
4
4
 
5
- export default { onclick, write };
5
+ export default { onclick, write };
6
+ export { onclick, write };
@@ -1,7 +1,6 @@
1
- import { html, type Attributes, type Renderable } from '@esportsplus/template';
1
+ import { component, html, type Attributes, type Renderable } from '@esportsplus/template';
2
2
  import { reactive } from '@esportsplus/reactivity';
3
3
  import { omit } from '@esportsplus/utilities';
4
- import template from '~/components/template';
5
4
  import write from './write';
6
5
 
7
6
 
@@ -11,7 +10,7 @@ type A = { timeout?: number, value: string } & Attributes;
11
10
  const OMIT = ['timeout', 'value'];
12
11
 
13
12
 
14
- export default template.factory<A, (state: { copied: boolean }) => Renderable<unknown>>(
13
+ export default component<A, (state: { copied: boolean }) => Renderable<unknown>>(
15
14
  function(attributes, content) {
16
15
  let state = reactive({
17
16
  copied: false
@@ -25,7 +24,7 @@ export default template.factory<A, (state: { copied: boolean }) => Renderable<un
25
24
  e.preventDefault();
26
25
  e.stopPropagation();
27
26
 
28
- write(attributes.value).then(() => {
27
+ void write(attributes.value).then(() => {
29
28
  state.copied = true;
30
29
 
31
30
  setTimeout(() => {
@@ -1,12 +1,12 @@
1
1
  import { Element } from '@esportsplus/template';
2
2
 
3
3
 
4
- let key = Symbol();
4
+ const KEY = Symbol();
5
5
 
6
6
 
7
- const get = (element?: Element): { error: string } | undefined => {
7
+ const get = (element?: Element) => {
8
8
  if (element) {
9
- return element[key] as { error: string } | undefined;
9
+ return element[KEY] as { error: string } | undefined;
10
10
  }
11
11
 
12
12
  return undefined;
@@ -14,7 +14,7 @@ const get = (element?: Element): { error: string } | undefined => {
14
14
 
15
15
  const onrender = (reactive: { error: string }) => {
16
16
  return (element: Element) => {
17
- element[key] = reactive;
17
+ element[KEY] = reactive;
18
18
  };
19
19
  };
20
20
 
@@ -1,9 +1,13 @@
1
- import scrollbar from '~/components/scrollbar';
1
+ import { component, html } from '@esportsplus/template';
2
2
  import './scss/index.scss';
3
3
 
4
4
 
5
- export default scrollbar.bind({
6
- attributes: {
7
- class: 'frame'
5
+ export default component(
6
+ function(this, attributes, content) {
7
+ return html`
8
+ <div class='frame --scrollbar' ${this?.attributes} ${attributes}>
9
+ ${content}
10
+ </div>
11
+ `;
8
12
  }
9
- });
13
+ );
@@ -1,7 +1,6 @@
1
- import { html, Attributes } from '@esportsplus/template';
1
+ import { component, html, Attributes } from '@esportsplus/template';
2
2
  import { reactive } from '@esportsplus/reactivity';
3
3
  import { omit } from '@esportsplus/utilities';
4
- import template from '~/components/template';
5
4
  import './scss/index.scss';
6
5
 
7
6
 
@@ -15,7 +14,7 @@ let key = Symbol(),
15
14
  observer: IntersectionObserver | null = null;
16
15
 
17
16
 
18
- export default template.factory(
17
+ export default component(
19
18
  (attributes: A, content) => {
20
19
  if (observer === null) {
21
20
  observer = new IntersectionObserver((entries) => {
@@ -1,9 +1,8 @@
1
- import { html } from '@esportsplus/template';
2
- import template from '~/components/template';
1
+ import { component, html } from '@esportsplus/template';
3
2
  import './scss/index.scss';
4
3
 
5
4
 
6
- export default template.factory(
5
+ export default component(
7
6
  (attributes, href: string) => {
8
7
  if (href[0] !== '#') {
9
8
  href = '#' + href;
@@ -1,5 +1,4 @@
1
1
  export { default as accordion } from './accordion';
2
- export { default as alert } from './alert';
3
2
  export { default as back } from './back';
4
3
  export { default as button } from './button';
5
4
  export { default as checkbox } from './checkbox';
@@ -21,11 +20,9 @@ export { default as range } from './range';
21
20
  export { default as root } from './root';
22
21
  export { default as select } from './select';
23
22
  export { default as switch } from './switch';
24
- export { default as scrollbar } from './scrollbar';
25
23
  export { default as sidebar } from './sidebar';
26
- export { default as site } from './site';
27
- export { default as template } from './template';
28
24
  export { default as textarea } from './textarea';
25
+ export { default as toaster, toast } from './toast';
29
26
  export { default as tooltip } from './tooltip';
30
27
  export { default as truncate } from './truncate';
31
28
  export { default as typewriter } from './typewriter';
@@ -1,7 +1,6 @@
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
- import template from '~/components/template';
3
+ import { omit } from '@esportsplus/utilities';
5
4
  import './scss/index.scss';
6
5
 
7
6
 
@@ -15,7 +14,7 @@ type A = Attributes & {
15
14
  const OMIT = ['loader-content', 'loader-logo'];
16
15
 
17
16
 
18
- export default template.factory(
17
+ export default component(
19
18
  (attributes: A, content) => {
20
19
  let state = reactive({
21
20
  load: false,
@@ -33,10 +32,10 @@ export default template.factory(
33
32
  return html`
34
33
  <div
35
34
  class='loader ${() => state.load && 'loader--load'}'
36
- onanimationend=${(e: AnimationEvent) => {
35
+ onanimationend=${({ animationName: name }: AnimationEvent) => {
37
36
  i++;
38
37
 
39
- if (e.animationName === 'move' && i > 1) {
38
+ if (name === 'move' && i > 1) {
40
39
  state.remove = true;
41
40
  }
42
41
  }}
@@ -9,7 +9,7 @@
9
9
  pointer-events: none;
10
10
  right: 0;
11
11
  top: 0;
12
- transition: all 0.3s ease-in-out;
12
+ transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
13
13
  visibility: visible;
14
14
  z-index: 9999;
15
15
 
@@ -1,9 +1,13 @@
1
- import scrollbar from '~/components/scrollbar';
1
+ import { component, html } from '@esportsplus/template';
2
2
  import './scss/index.scss';
3
3
 
4
4
 
5
- export default scrollbar.bind({
6
- attributes: {
7
- class: 'overlay'
5
+ export default component(
6
+ function(this, attributes, content) {
7
+ return html`
8
+ <div class='overlay --scrollbar' ${this?.attributes} ${attributes}>
9
+ ${content}
10
+ </div>
11
+ `;
8
12
  }
9
- });
13
+ );
@@ -7,7 +7,6 @@
7
7
  display: flex;
8
8
  flex-wrap: wrap;
9
9
  justify-content: flex-start;
10
- overflow: hidden;
11
10
  z-index: 9;
12
11
 
13
12
 
@@ -6,7 +6,7 @@
6
6
  gap: var(--gap-vertical) 0px;
7
7
  min-height: 100svh;
8
8
  position: relative;
9
- width: 100vw;
9
+ width: 100%;
10
10
 
11
11
 
12
12
  &-subtitle,
@@ -36,11 +36,9 @@ section {
36
36
  width: var(--width);
37
37
  }
38
38
 
39
- h1, h2, h3, h4, h5 {
39
+ h1, h2, h3, h4, h5, h6 {
40
40
  color: var(--color);
41
- font-size: var(--font-size);
42
- font-weight: var(--font-weight);
43
- line-height: var(--line-height);
41
+ line-height: 1.2;
44
42
  margin: 0;
45
43
  padding: 0;
46
44
  position: relative;
@@ -54,6 +52,39 @@ h1, h2, h3, h4, h5 {
54
52
  }
55
53
  }
56
54
 
55
+ h1 {
56
+ font-size: var(--font-size-800);
57
+ font-weight: var(--font-weight-600);
58
+ letter-spacing: -0.02em;
59
+ line-height: 1.1;
60
+ }
61
+
62
+ h2 {
63
+ font-size: var(--font-size-700);
64
+ font-weight: var(--font-weight-500);
65
+ letter-spacing: -0.015em;
66
+ }
67
+
68
+ h3 {
69
+ font-size: var(--font-size-600);
70
+ font-weight: var(--font-weight-500);
71
+ }
72
+
73
+ h4 {
74
+ font-size: var(--font-size-500);
75
+ font-weight: var(--font-weight-500);
76
+ }
77
+
78
+ h5 {
79
+ font-size: var(--font-size-400);
80
+ font-weight: var(--font-weight-500);
81
+ }
82
+
83
+ h6 {
84
+ font-size: var(--font-size-300);
85
+ font-weight: var(--font-weight-500);
86
+ }
87
+
57
88
  a {
58
89
  color: var(--color, inherit);
59
90
  cursor: pointer;
@@ -13,14 +13,13 @@
13
13
  @include lib.css-variables(size, tokens.$size);
14
14
  @include lib.css-variables(spacer, tokens.$spacer);
15
15
 
16
- --background: var(--color-grey-400);
16
+ --background: var(--color-white-400);
17
17
  --color: var(--color-text-400);
18
18
  --font-family: 'Montserrat', sans-serif;
19
19
  --font-size: var(--font-size-400);
20
20
  --font-weight: var(--font-weight-400);
21
21
  --line-height: var(--line-height-400);
22
22
  --min-width: 320px;
23
- --scrollbar-width: 17px;
24
23
  --transition-duration: #{tokens.$transition-duration};
25
24
 
26
25
  // https://gist.github.com/jh3y/1b3afdfa7af3ebc5668bf169cea17d09
@@ -1,10 +1,8 @@
1
- import { html, type Renderable, type Attributes } from '@esportsplus/template';
1
+ import { component, html, type Renderable, type Attributes } from '@esportsplus/template';
2
2
  import { reactive } from '@esportsplus/reactivity';
3
3
  import { EMPTY_ARRAY, omit, toArray } from '@esportsplus/utilities';
4
4
  import form from '~/components/form';
5
5
  import root from '~/components/root';
6
- import scrollbar, { Attributes as Attr } from '~/components/scrollbar';
7
- import template from '~/components/template';
8
6
  import './scss/index.scss';
9
7
 
10
8
 
@@ -12,8 +10,6 @@ const OMIT = [
12
10
  'arrow',
13
11
  'options',
14
12
  'option',
15
- 'scrollbar',
16
- 'scrollbar-container-content',
17
13
  'tooltip-content',
18
14
  ];
19
15
 
@@ -22,8 +18,6 @@ type A = {
22
18
  arrow?: Attributes;
23
19
  options: Record<number | string, Renderable<unknown> | { content: Renderable<unknown>, selected: Renderable<unknown> }>;
24
20
  option?: Attributes;
25
- scrollbar?: Attributes;
26
- 'scrollbar-container-content'?: Attributes;
27
21
  'tooltip-content'?: Attributes & { direction?: string };
28
22
  } & (
29
23
  {
@@ -37,18 +31,11 @@ type A = {
37
31
  selected?: number | string;
38
32
  }
39
33
  }
40
- ) & Attributes & Attr;
34
+ ) & Attributes;
41
35
 
42
36
 
43
- let previous: { active: boolean } | null = null,
44
- sb = scrollbar.bind({
45
- attributes: {
46
- class: 'tooltip-content',
47
- 'scrollbar-container-content': {
48
- class: '--flex-column'
49
- }
50
- }
51
- });
37
+ let previous: { active: boolean } | null = null;
38
+
52
39
 
53
40
  function set(current: { active: boolean }, value: boolean) {
54
41
  current.active = value;
@@ -73,7 +60,8 @@ function set(current: { active: boolean }, value: boolean) {
73
60
  }
74
61
  }
75
62
 
76
- const select = template.factory<A, (state: { active: boolean, selected?: string | number }) => Renderable<unknown>>(
63
+
64
+ export default component<A, (state: { active: boolean, selected?: string | number }) => Renderable<unknown>>(
77
65
  function(this: { attributes?: Exclude<A, 'options' | 'selected' | 'state'> }, attributes: A, content) {
78
66
  let { options, option } = attributes,
79
67
  state = attributes.state || reactive({
@@ -131,77 +119,77 @@ const select = template.factory<A, (state: { active: boolean, selected?: string
131
119
  Object.fromEntries( keys.map(key => [key, false]) )
132
120
  );
133
121
 
134
- return sb(
135
- {
136
- ...this?.attributes?.['tooltip-content'] || EMPTY_ARRAY,
137
- ...attributes['tooltip-content'],
138
- class: [
139
- ...toArray(this?.attributes?.['tooltip-content']?.class),
140
- ...toArray(attributes['tooltip-content']?.class),
141
- `tooltip-content--${attributes['tooltip-content']?.direction || 's'}`
142
- ],
143
- onclick: (e: Event) => {
144
- let element = e.target as HTMLElement,
145
- key = element.dataset?.key;
146
-
147
- if (key === undefined) {
148
- let parent;
149
-
150
- while (parent = element.parentElement) {
151
- key = parent.dataset?.key;
152
-
153
- if (key !== undefined) {
154
- break;
122
+ return html`
123
+ <div
124
+ class='tooltip-content --flex-column --scrollbar'
125
+ ${{
126
+ ...this?.attributes?.['tooltip-content'] || EMPTY_ARRAY,
127
+ ...attributes['tooltip-content'],
128
+ class: [
129
+ ...toArray(this?.attributes?.['tooltip-content']?.class),
130
+ ...toArray(attributes['tooltip-content']?.class),
131
+ `tooltip-content--${attributes['tooltip-content']?.direction || 's'}`
132
+ ],
133
+ inert: () => !state.active,
134
+ onclick: (e: Event) => {
135
+ let element = e.target as HTMLElement,
136
+ key = element.dataset?.key;
137
+
138
+ if (key === undefined) {
139
+ let parent;
140
+
141
+ while (parent = element.parentElement) {
142
+ key = parent.dataset?.key;
143
+
144
+ if (key !== undefined) {
145
+ break;
146
+ }
155
147
  }
156
148
  }
157
- }
158
149
 
159
- if (key === undefined) {
160
- return;
150
+ if (key === undefined) {
151
+ return;
152
+ }
153
+
154
+ let previous = state.selected!;
155
+
156
+ set(state, false);
157
+ state.selected = key;
158
+
159
+ selected[key] = true;
160
+ selected[previous] = false;
161
+ },
162
+ onconnect: () => {
163
+ set(state, true);
164
+ },
165
+ style: [
166
+ ...toArray(this?.attributes?.['tooltip-content']?.style),
167
+ ...toArray(attributes['tooltip-content']?.style)
168
+ ],
169
+ }}
170
+ >
171
+ ${keys.map((key) => {
172
+ let content = options[key];
173
+
174
+ if (content !== null && typeof content === 'object' && 'content' in content) {
175
+ content = content.content;
161
176
  }
162
177
 
163
- let previous = state.selected!;
164
-
165
- set(state, false);
166
- state.selected = key;
167
-
168
- selected[key] = true;
169
- selected[previous] = false;
170
- },
171
- onconnect: () => {
172
- set(state, true);
173
- },
174
- scrollbar: attributes.scrollbar,
175
- 'scrollbar-container-content': attributes['scrollbar-container-content'],
176
- style: [
177
- ...toArray(this?.attributes?.['tooltip-content']?.style),
178
- ...toArray(attributes['tooltip-content']?.style)
179
- ],
180
- },
181
- keys.map((key) => {
182
- let content = options[key];
183
-
184
- if (content !== null && typeof content === 'object' && 'content' in content) {
185
- content = content.content;
186
- }
187
-
188
- return html`
189
- <div
190
- class='link select-option ${() => selected[key] && '--active'}'
191
- ${this?.attributes?.option}
192
- ${option}
193
- data-key='${key}'
194
- >
195
- ${content}
196
- </div>
197
- `;
198
- })
199
- );
178
+ return html`
179
+ <div
180
+ class='link select-option ${() => selected[key] && '--active'}'
181
+ ${this?.attributes?.option}
182
+ ${option}
183
+ data-key='${key}'
184
+ >
185
+ ${content}
186
+ </div>
187
+ `;
188
+ })}
189
+ </div>
190
+ `;
200
191
  }}
201
192
  </div>
202
193
  `;
203
194
  }
204
- );
205
-
206
-
207
- export default select;
195
+ );
@@ -1,9 +1,13 @@
1
- import scrollbar from '~/components/scrollbar';
1
+ import { component, html } from '@esportsplus/template';
2
2
  import './scss/index.scss';
3
3
 
4
4
 
5
- export default scrollbar.bind({
6
- attributes: {
7
- class: 'sidebar'
5
+ export default component(
6
+ function(this, attributes, content) {
7
+ return html`
8
+ <div class='sidebar --flex-column --scrollbar' ${this?.attributes} ${attributes}>
9
+ ${content}
10
+ </div>
11
+ `;
8
12
  }
9
- });
13
+ );
@@ -6,7 +6,6 @@
6
6
  @include lib.position(absolute, var(--margin-vertical) null var(--margin-vertical) null);
7
7
  cursor: default;
8
8
  height: calc(100% - (var(--margin-vertical) * 2));
9
- overflow: hidden;
10
9
  transition:
11
10
  max-width var(--transition-duration) ease-in-out,
12
11
  opacity var(--transition-duration) ease-in-out,