@esportsplus/ui 0.45.5 → 0.47.2

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 (75) hide show
  1. package/.github/workflows/bump.yml +2 -2
  2. package/.github/workflows/dependabot.yml +1 -1
  3. package/.github/workflows/publish.yml +3 -3
  4. package/README.md +288 -0
  5. package/build/components/accordion/index.d.ts +16 -16
  6. package/build/components/accordion/index.js +28 -20
  7. package/build/components/alert/index.d.ts +1 -1
  8. package/build/components/alert/index.js +82 -57
  9. package/build/components/back/index.d.ts +8 -7
  10. package/build/components/back/index.js +11 -11
  11. package/build/components/button/index.d.ts +21 -20
  12. package/build/components/button/index.js +52 -27
  13. package/build/components/checkbox/index.d.ts +3 -3
  14. package/build/components/checkbox/index.js +39 -25
  15. package/build/components/clipboard/index.d.ts +90 -70
  16. package/build/components/clipboard/onclick.d.ts +1 -1
  17. package/build/components/clipboard/onclick.js +31 -21
  18. package/build/components/counter/index.d.ts +2 -2
  19. package/build/components/counter/index.js +72 -36
  20. package/build/components/ellipsis/index.d.ts +1 -1
  21. package/build/components/ellipsis/index.js +7 -8
  22. package/build/components/form/action.d.ts +1 -1
  23. package/build/components/form/action.js +13 -15
  24. package/build/components/form/index.d.ts +1 -1
  25. package/build/components/highlight/index.d.ts +16 -16
  26. package/build/components/highlight/index.js +26 -18
  27. package/build/components/icon/index.d.ts +11 -10
  28. package/build/components/icon/index.js +9 -6
  29. package/build/components/input/index.d.ts +2 -2
  30. package/build/components/input/index.js +38 -22
  31. package/build/components/loader/index.d.ts +16 -16
  32. package/build/components/loader/index.js +68 -50
  33. package/build/components/loading/index.d.ts +1 -1
  34. package/build/components/loading/index.js +9 -9
  35. package/build/components/radio/index.d.ts +1 -1
  36. package/build/components/range/index.d.ts +2 -2
  37. package/build/components/range/index.js +50 -27
  38. package/build/components/scrollbar/index.d.ts +12 -11
  39. package/build/components/scrollbar/index.js +42 -37
  40. package/build/components/select/index.d.ts +1 -1
  41. package/build/components/select/index.js +121 -86
  42. package/build/components/switch/index.d.ts +1 -1
  43. package/build/components/textarea/index.d.ts +2 -2
  44. package/build/components/textarea/index.js +37 -22
  45. package/build/components/tooltip/index.d.ts +180 -140
  46. package/build/components/tooltip/menu.d.ts +12 -11
  47. package/build/components/tooltip/menu.js +33 -33
  48. package/build/components/tooltip/onclick.d.ts +1121 -1100
  49. package/build/components/tooltip/onclick.js +26 -16
  50. package/build/components/tooltip/onhover.d.ts +16 -16
  51. package/build/components/tooltip/onhover.js +28 -18
  52. package/build/components/typewriter/index.d.ts +11 -10
  53. package/build/components/typewriter/index.js +25 -12
  54. package/build/themes/dark/alert.d.ts +1 -1
  55. package/build/themes/dark/button/scss/index.scss +1 -1
  56. package/build/themes/dark/index.d.ts +0 -2
  57. package/build/themes/dark/index.js +0 -2
  58. package/build/themes/dark/input.d.ts +10 -8
  59. package/build/themes/dark/link/scss/index.scss +2 -0
  60. package/build/themes/dark/select.d.ts +90 -70
  61. package/build/themes/dark/textarea.d.ts +10 -8
  62. package/package.json +20 -14
  63. package/src/components/button/index.ts +21 -13
  64. package/src/components/counter/index.ts +6 -6
  65. package/src/components/select/index.ts +13 -1
  66. package/src/themes/dark/button/scss/index.scss +16 -0
  67. package/src/themes/dark/index.ts +0 -2
  68. package/src/themes/dark/link/scss/index.scss +26 -0
  69. package/tsconfig.json +6 -1
  70. package/build/themes/dark/button/index.d.ts +0 -16
  71. package/build/themes/dark/button/index.js +0 -14
  72. package/build/themes/dark/link.d.ts +0 -11
  73. package/build/themes/dark/link.js +0 -9
  74. package/src/themes/dark/button/index.ts +0 -22
  75. package/src/themes/dark/link.ts +0 -12
@@ -1,23 +1,24 @@
1
+ import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
1
2
  import { Renderable } from '@esportsplus/template';
2
3
  import './scss/index.scss';
3
4
  declare const hold: {
4
5
  (): ReturnType<(this: {
5
- attributes?: import("@esportsplus/template").Attributes | undefined;
6
+ attributes?: template_a6aeaec5a75649bd8ec693d5230c50001.Attributes | undefined;
6
7
  content?: ((state: {
7
8
  holding: boolean;
8
9
  complete: boolean;
9
10
  }) => Renderable<any>) | undefined;
10
- }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: (state: {
11
+ }, attributes: Readonly<template_a6aeaec5a75649bd8ec693d5230c50001.Attributes>, content: (state: {
11
12
  holding: boolean;
12
13
  complete: boolean;
13
14
  }) => Renderable<any>) => Renderable<any>>;
14
- <T extends import("@esportsplus/template").Attributes>(attributes: T): ReturnType<(this: {
15
- attributes?: import("@esportsplus/template").Attributes | undefined;
15
+ <T extends template_a6aeaec5a75649bd8ec693d5230c50001.Attributes>(attributes: T): ReturnType<(this: {
16
+ attributes?: template_a6aeaec5a75649bd8ec693d5230c50001.Attributes | undefined;
16
17
  content?: ((state: {
17
18
  holding: boolean;
18
19
  complete: boolean;
19
20
  }) => Renderable<any>) | undefined;
20
- }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: (state: {
21
+ }, attributes: Readonly<template_a6aeaec5a75649bd8ec693d5230c50001.Attributes>, content: (state: {
21
22
  holding: boolean;
22
23
  complete: boolean;
23
24
  }) => Renderable<any>) => Renderable<any>>;
@@ -25,25 +26,25 @@ declare const hold: {
25
26
  holding: boolean;
26
27
  complete: boolean;
27
28
  }) => Renderable<any>>(content: T): ReturnType<(this: {
28
- attributes?: import("@esportsplus/template").Attributes | undefined;
29
+ attributes?: template_a6aeaec5a75649bd8ec693d5230c50001.Attributes | undefined;
29
30
  content?: ((state: {
30
31
  holding: boolean;
31
32
  complete: boolean;
32
33
  }) => Renderable<any>) | undefined;
33
- }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: (state: {
34
+ }, attributes: Readonly<template_a6aeaec5a75649bd8ec693d5230c50001.Attributes>, content: (state: {
34
35
  holding: boolean;
35
36
  complete: boolean;
36
37
  }) => Renderable<any>) => Renderable<any>>;
37
- (attributes: import("@esportsplus/template").Attributes, content: (state: {
38
+ (attributes: template_a6aeaec5a75649bd8ec693d5230c50001.Attributes, content: (state: {
38
39
  holding: boolean;
39
40
  complete: boolean;
40
41
  }) => Renderable<any>): ReturnType<(this: {
41
- attributes?: import("@esportsplus/template").Attributes | undefined;
42
+ attributes?: template_a6aeaec5a75649bd8ec693d5230c50001.Attributes | undefined;
42
43
  content?: ((state: {
43
44
  holding: boolean;
44
45
  complete: boolean;
45
46
  }) => Renderable<any>) | undefined;
46
- }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: (state: {
47
+ }, attributes: Readonly<template_a6aeaec5a75649bd8ec693d5230c50001.Attributes>, content: (state: {
47
48
  holding: boolean;
48
49
  complete: boolean;
49
50
  }) => Renderable<any>) => Renderable<any>>;
@@ -51,22 +52,22 @@ declare const hold: {
51
52
  declare const _default: {
52
53
  hold: {
53
54
  (): ReturnType<(this: {
54
- attributes?: import("@esportsplus/template").Attributes | undefined;
55
+ attributes?: template_a6aeaec5a75649bd8ec693d5230c50001.Attributes | undefined;
55
56
  content?: ((state: {
56
57
  holding: boolean;
57
58
  complete: boolean;
58
59
  }) => Renderable<any>) | undefined;
59
- }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: (state: {
60
+ }, attributes: Readonly<template_a6aeaec5a75649bd8ec693d5230c50001.Attributes>, content: (state: {
60
61
  holding: boolean;
61
62
  complete: boolean;
62
63
  }) => Renderable<any>) => Renderable<any>>;
63
- <T extends import("@esportsplus/template").Attributes>(attributes: T): ReturnType<(this: {
64
- attributes?: import("@esportsplus/template").Attributes | undefined;
64
+ <T extends template_a6aeaec5a75649bd8ec693d5230c50001.Attributes>(attributes: T): ReturnType<(this: {
65
+ attributes?: template_a6aeaec5a75649bd8ec693d5230c50001.Attributes | undefined;
65
66
  content?: ((state: {
66
67
  holding: boolean;
67
68
  complete: boolean;
68
69
  }) => Renderable<any>) | undefined;
69
- }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: (state: {
70
+ }, attributes: Readonly<template_a6aeaec5a75649bd8ec693d5230c50001.Attributes>, content: (state: {
70
71
  holding: boolean;
71
72
  complete: boolean;
72
73
  }) => Renderable<any>) => Renderable<any>>;
@@ -74,25 +75,25 @@ declare const _default: {
74
75
  holding: boolean;
75
76
  complete: boolean;
76
77
  }) => Renderable<any>>(content: T): ReturnType<(this: {
77
- attributes?: import("@esportsplus/template").Attributes | undefined;
78
+ attributes?: template_a6aeaec5a75649bd8ec693d5230c50001.Attributes | undefined;
78
79
  content?: ((state: {
79
80
  holding: boolean;
80
81
  complete: boolean;
81
82
  }) => Renderable<any>) | undefined;
82
- }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: (state: {
83
+ }, attributes: Readonly<template_a6aeaec5a75649bd8ec693d5230c50001.Attributes>, content: (state: {
83
84
  holding: boolean;
84
85
  complete: boolean;
85
86
  }) => Renderable<any>) => Renderable<any>>;
86
- (attributes: import("@esportsplus/template").Attributes, content: (state: {
87
+ (attributes: template_a6aeaec5a75649bd8ec693d5230c50001.Attributes, content: (state: {
87
88
  holding: boolean;
88
89
  complete: boolean;
89
90
  }) => Renderable<any>): ReturnType<(this: {
90
- attributes?: import("@esportsplus/template").Attributes | undefined;
91
+ attributes?: template_a6aeaec5a75649bd8ec693d5230c50001.Attributes | undefined;
91
92
  content?: ((state: {
92
93
  holding: boolean;
93
94
  complete: boolean;
94
95
  }) => Renderable<any>) | undefined;
95
- }, attributes: Readonly<import("@esportsplus/template").Attributes>, content: (state: {
96
+ }, attributes: Readonly<template_a6aeaec5a75649bd8ec693d5230c50001.Attributes>, content: (state: {
96
97
  holding: boolean;
97
98
  complete: boolean;
98
99
  }) => Renderable<any>) => Renderable<any>>;
@@ -1,37 +1,62 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html } from '@esportsplus/template';
1
+ import * as reactivity_a6aeaec5a75649bd8ec693d5230c50000 from '@esportsplus/reactivity';
2
+ import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
3
3
  import template from '../template/index.js';
4
4
  import './scss/index.scss';
5
+ const template_a6aeaec5a75649bd8ec693d5230c5000y = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<div
6
+ class='button '><!--$--></div>`);
7
+ class ReactiveObject_a6aeaec5a75649bd8ec693d5230c5000w extends reactivity_a6aeaec5a75649bd8ec693d5230c50000.ReactiveObject {
8
+ #complete = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
9
+ #holding = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
10
+ constructor() {
11
+ super(null);
12
+ }
13
+ get complete() {
14
+ return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#complete);
15
+ }
16
+ set complete(_v0) {
17
+ reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#complete, _v0);
18
+ }
19
+ get holding() {
20
+ return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#holding);
21
+ }
22
+ set holding(_v1) {
23
+ reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#holding, _v1);
24
+ }
25
+ }
5
26
  const hold = template.factory(function (attributes, content) {
6
27
  let end = () => {
7
28
  if (!state.complete) {
8
29
  state.holding = false;
9
30
  }
10
- }, start = (e) => {
11
- e.preventDefault();
12
- state.holding = true;
13
- }, state = reactive({
14
- complete: false,
15
- holding: false
16
- });
17
- return html `
18
- <div
19
- class='button ${() => state.holding && 'button--holding'} ${() => state.complete && '--active'}'
20
- onanimationend=${(e) => {
21
- if (e.animationName === 'buttonHolding') {
22
- state.complete = true;
23
- }
24
- }}
25
- onclick=${() => { }}
26
- onmousedown=${start}
27
- onmouseup=${end}
28
- ontouchstart=${start}
29
- ontouchend=${end}
30
- ${attributes}
31
- >
32
- ${() => content(state)}
33
- </div>
34
- `;
31
+ }, state = new ReactiveObject_a6aeaec5a75649bd8ec693d5230c5000w();
32
+ return (() => {
33
+ let root_a6aeaec5a75649bd8ec693d5230c5000x = template_a6aeaec5a75649bd8ec693d5230c5000y(), element_a6aeaec5a75649bd8ec693d5230c5000z = root_a6aeaec5a75649bd8ec693d5230c5000x.firstChild, element_a6aeaec5a75649bd8ec693d5230c500010 = element_a6aeaec5a75649bd8ec693d5230c5000z.firstChild;
34
+ template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c5000z, ' ', () => state.holding && 'button--holding');
35
+ template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c5000z, ' ', () => state.complete && '--active');
36
+ template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c5000z, 'mousedown', (e) => {
37
+ e.preventDefault();
38
+ state.holding = true;
39
+ });
40
+ template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c5000z, attributes);
41
+ template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c5000z, 'animationend', (e) => {
42
+ if (e.animationName === 'buttonHolding') {
43
+ state.complete = true;
44
+ }
45
+ });
46
+ template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c5000z, 'click', () => { });
47
+ template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c5000z, 'mousedown', (e) => {
48
+ e.preventDefault();
49
+ state.holding = true;
50
+ });
51
+ template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c5000z, 'mouseup', end);
52
+ template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c5000z, 'touchend', end);
53
+ template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c5000z, 'touchstart', (e) => {
54
+ e.preventDefault();
55
+ state.holding = true;
56
+ });
57
+ new template_a6aeaec5a75649bd8ec693d5230c50001.EffectSlot(element_a6aeaec5a75649bd8ec693d5230c500010, () => content(state));
58
+ return root_a6aeaec5a75649bd8ec693d5230c5000x;
59
+ })();
35
60
  });
36
61
  export default { hold };
37
62
  export { hold };
@@ -1,4 +1,4 @@
1
- import { type Attributes } from '@esportsplus/template';
1
+ import { Attributes } from '@esportsplus/template';
2
2
  import './scss/index.scss';
3
3
  declare const factory: (type: string) => (this: {
4
4
  attributes?: Attributes;
@@ -7,7 +7,7 @@ declare const factory: (type: string) => (this: {
7
7
  active: boolean;
8
8
  error: string;
9
9
  };
10
- }) => Node;
10
+ }) => DocumentFragment;
11
11
  declare const _default: (this: {
12
12
  attributes?: Attributes;
13
13
  } | any, attributes?: Attributes & {
@@ -15,6 +15,6 @@ declare const _default: (this: {
15
15
  active: boolean;
16
16
  error: string;
17
17
  };
18
- }) => Node;
18
+ }) => DocumentFragment;
19
19
  export default _default;
20
20
  export { factory };
@@ -1,38 +1,52 @@
1
- import { reactive, root } from '@esportsplus/reactivity';
2
- import { html } from '@esportsplus/template';
1
+ import * as reactivity_a6aeaec5a75649bd8ec693d5230c50000 from '@esportsplus/reactivity';
2
+ import { root } from '@esportsplus/reactivity';
3
+ import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
3
4
  import { omit } from '@esportsplus/utilities';
4
5
  import form from '../../components/form/index.js';
5
6
  import './scss/index.scss';
7
+ const template_a6aeaec5a75649bd8ec693d5230c500013 = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<div><input></div>`);
8
+ class ReactiveObject_a6aeaec5a75649bd8ec693d5230c500011 extends reactivity_a6aeaec5a75649bd8ec693d5230c50000.ReactiveObject {
9
+ #active = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
10
+ #error = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL]('');
11
+ constructor() {
12
+ super(null);
13
+ }
14
+ get active() {
15
+ return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#active);
16
+ }
17
+ set active(_v0) {
18
+ reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#active, _v0);
19
+ }
20
+ get error() {
21
+ return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#error);
22
+ }
23
+ set error(_v1) {
24
+ reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#error, _v1);
25
+ }
26
+ }
6
27
  const OMIT = ['checked', 'value'];
7
28
  const factory = (type) => {
8
29
  function template(attributes) {
9
- let state = attributes?.state || reactive({
10
- active: false,
11
- error: ''
12
- });
30
+ let state = attributes?.state || new ReactiveObject_a6aeaec5a75649bd8ec693d5230c500011();
13
31
  if (attributes?.checked) {
14
32
  state.active = true;
15
33
  }
16
- return html `
17
- <div
18
- class='${type} ${() => state.active && '--active'}'
19
- ${this?.attributes && omit(this.attributes, OMIT)}
20
- ${attributes && omit(attributes, OMIT)}
21
- >
22
- <input
23
- ${{
24
- checked: attributes?.checked || root(() => state.active),
25
- class: `${type}-tag`,
26
- onchange: (e) => {
34
+ return (() => {
35
+ let root_a6aeaec5a75649bd8ec693d5230c500012 = template_a6aeaec5a75649bd8ec693d5230c500013(), element_a6aeaec5a75649bd8ec693d5230c500014 = root_a6aeaec5a75649bd8ec693d5230c500012.firstChild, element_a6aeaec5a75649bd8ec693d5230c500015 = element_a6aeaec5a75649bd8ec693d5230c500014.firstElementChild;
36
+ template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c500014, ' ', type);
37
+ template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c500014, ' ', () => state.active && '--active');
38
+ template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c500014, this?.attributes && omit(this.attributes, OMIT));
39
+ template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c500014, attributes && omit(attributes, OMIT));
40
+ template_a6aeaec5a75649bd8ec693d5230c50001.setProperty(element_a6aeaec5a75649bd8ec693d5230c500015, 'checked', attributes?.checked || root(() => state.active));
41
+ template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c500015, '', `${type}-tag`);
42
+ template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c500015, 'change', (e) => {
27
43
  state.active = e.target.checked;
28
- },
29
- onrender: form.input.onrender(state),
30
- type: type === 'radio' ? 'radio' : 'checkbox',
31
- value: attributes?.value || 1
32
- }}
33
- >
34
- </div>
35
- `;
44
+ });
45
+ template_a6aeaec5a75649bd8ec693d5230c50001.onrender(element_a6aeaec5a75649bd8ec693d5230c500015, form.input.onrender(state));
46
+ template_a6aeaec5a75649bd8ec693d5230c50001.setProperty(element_a6aeaec5a75649bd8ec693d5230c500015, 'type', type === 'radio' ? 'radio' : 'checkbox');
47
+ template_a6aeaec5a75649bd8ec693d5230c50001.setProperty(element_a6aeaec5a75649bd8ec693d5230c500015, 'value', attributes?.value || 1);
48
+ return root_a6aeaec5a75649bd8ec693d5230c500012;
49
+ })();
36
50
  }
37
51
  return template;
38
52
  };