@esportsplus/ui 0.46.0 → 0.48.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 (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 +287 -0
  5. package/build/components/accordion/index.d.ts +16 -16
  6. package/build/components/accordion/index.js +15 -17
  7. package/build/components/alert/index.d.ts +1 -1
  8. package/build/components/alert/index.js +45 -51
  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 +32 -23
  13. package/build/components/checkbox/index.d.ts +3 -3
  14. package/build/components/checkbox/index.js +18 -21
  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 +18 -18
  18. package/build/components/counter/index.d.ts +2 -2
  19. package/build/components/counter/index.js +37 -32
  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 +13 -15
  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 +18 -18
  31. package/build/components/loader/index.d.ts +16 -16
  32. package/build/components/loader/index.js +41 -45
  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 +22 -22
  38. package/build/components/scrollbar/index.d.ts +12 -11
  39. package/build/components/scrollbar/index.js +22 -33
  40. package/build/components/select/index.d.ts +1 -1
  41. package/build/components/select/index.js +86 -80
  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 +17 -18
  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 +13 -15
  50. package/build/components/tooltip/onhover.d.ts +16 -16
  51. package/build/components/tooltip/onhover.js +15 -17
  52. package/build/components/typewriter/index.d.ts +11 -10
  53. package/build/components/typewriter/index.js +12 -11
  54. package/build/themes/dark/alert.d.ts +1 -1
  55. package/build/themes/dark/input.d.ts +10 -8
  56. package/build/themes/dark/select.d.ts +90 -70
  57. package/build/themes/dark/textarea.d.ts +10 -8
  58. package/package.json +17 -14
  59. package/src/components/accordion/index.ts +1 -2
  60. package/src/components/alert/index.ts +1 -2
  61. package/src/components/button/index.ts +22 -15
  62. package/src/components/checkbox/index.ts +1 -2
  63. package/src/components/clipboard/onclick.ts +1 -2
  64. package/src/components/counter/index.ts +7 -8
  65. package/src/components/highlight/index.ts +1 -2
  66. package/src/components/input/index.ts +1 -2
  67. package/src/components/loader/index.ts +1 -2
  68. package/src/components/range/index.ts +1 -2
  69. package/src/components/scrollbar/index.ts +1 -2
  70. package/src/components/select/index.ts +14 -3
  71. package/src/components/textarea/index.ts +1 -2
  72. package/src/components/tooltip/onclick.ts +1 -2
  73. package/src/components/tooltip/onhover.ts +1 -2
  74. package/src/components/typewriter/index.ts +1 -2
  75. package/tsconfig.json +6 -1
@@ -1,33 +1,34 @@
1
1
  declare const _default: (attributes: {
2
2
  [key: `aria-${string}`]: string | number | boolean | undefined;
3
3
  [key: `data-${string}`]: string | undefined;
4
- class?: import("@esportsplus/template/build/types").Attribute | import("@esportsplus/template/build/types").Attribute[];
4
+ class?: import("node_modules/@esportsplus/template/build/types").Attribute | import("node_modules/@esportsplus/template/build/types").Attribute[];
5
5
  onconnect?: ((element: import("@esportsplus/template").Element) => void) | undefined;
6
6
  ondisconnect?: ((element: import("@esportsplus/template").Element) => void) | undefined;
7
7
  onrender?: ((element: import("@esportsplus/template").Element) => void) | undefined;
8
8
  ontick?: ((dispose: VoidFunction, element: import("@esportsplus/template").Element) => void) | undefined;
9
- style?: import("@esportsplus/template/build/types").Attribute | import("@esportsplus/template/build/types").Attribute[];
9
+ style?: import("node_modules/@esportsplus/template/build/types").Attribute | import("node_modules/@esportsplus/template/build/types").Attribute[];
10
10
  } & {
11
11
  onabort?: ((this: import("@esportsplus/template").Element, event: UIEvent) => void) | undefined;
12
12
  onanimationcancel?: ((this: import("@esportsplus/template").Element, event: AnimationEvent) => void) | undefined;
13
13
  onanimationend?: ((this: import("@esportsplus/template").Element, event: AnimationEvent) => void) | undefined;
14
14
  onanimationiteration?: ((this: import("@esportsplus/template").Element, event: AnimationEvent) => void) | undefined;
15
15
  onanimationstart?: ((this: import("@esportsplus/template").Element, event: AnimationEvent) => void) | undefined;
16
- onauxclick?: ((this: import("@esportsplus/template").Element, event: MouseEvent) => void) | undefined;
16
+ onauxclick?: ((this: import("@esportsplus/template").Element, event: PointerEvent) => void) | undefined;
17
17
  onbeforeinput?: ((this: import("@esportsplus/template").Element, event: InputEvent) => void) | undefined;
18
- onbeforetoggle?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
18
+ onbeforematch?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
19
+ onbeforetoggle?: ((this: import("@esportsplus/template").Element, event: ToggleEvent) => void) | undefined;
19
20
  onblur?: ((this: import("@esportsplus/template").Element, event: FocusEvent) => void) | undefined;
20
21
  oncancel?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
21
22
  oncanplay?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
22
23
  oncanplaythrough?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
23
24
  onchange?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
24
- onclick?: ((this: import("@esportsplus/template").Element, event: MouseEvent) => void) | undefined;
25
+ onclick?: ((this: import("@esportsplus/template").Element, event: PointerEvent) => void) | undefined;
25
26
  onclose?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
26
27
  oncompositionend?: ((this: import("@esportsplus/template").Element, event: CompositionEvent) => void) | undefined;
27
28
  oncompositionstart?: ((this: import("@esportsplus/template").Element, event: CompositionEvent) => void) | undefined;
28
29
  oncompositionupdate?: ((this: import("@esportsplus/template").Element, event: CompositionEvent) => void) | undefined;
29
30
  oncontextlost?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
30
- oncontextmenu?: ((this: import("@esportsplus/template").Element, event: MouseEvent) => void) | undefined;
31
+ oncontextmenu?: ((this: import("@esportsplus/template").Element, event: PointerEvent) => void) | undefined;
31
32
  oncontextrestored?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
32
33
  oncopy?: ((this: import("@esportsplus/template").Element, event: ClipboardEvent) => void) | undefined;
33
34
  oncuechange?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
@@ -77,6 +78,7 @@ declare const _default: (attributes: {
77
78
  onpointermove?: ((this: import("@esportsplus/template").Element, event: PointerEvent) => void) | undefined;
78
79
  onpointerout?: ((this: import("@esportsplus/template").Element, event: PointerEvent) => void) | undefined;
79
80
  onpointerover?: ((this: import("@esportsplus/template").Element, event: PointerEvent) => void) | undefined;
81
+ onpointerrawupdate?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
80
82
  onpointerup?: ((this: import("@esportsplus/template").Element, event: PointerEvent) => void) | undefined;
81
83
  onprogress?: ((this: import("@esportsplus/template").Element, event: ProgressEvent<EventTarget>) => void) | undefined;
82
84
  onratechange?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
@@ -95,7 +97,7 @@ declare const _default: (attributes: {
95
97
  onsubmit?: ((this: import("@esportsplus/template").Element, event: SubmitEvent) => void) | undefined;
96
98
  onsuspend?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
97
99
  ontimeupdate?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
98
- ontoggle?: ((this: import("@esportsplus/template").Element, event: Event) => void) | undefined;
100
+ ontoggle?: ((this: import("@esportsplus/template").Element, event: ToggleEvent) => void) | undefined;
99
101
  ontouchcancel?: ((this: import("@esportsplus/template").Element, event: TouchEvent) => void) | undefined;
100
102
  ontouchend?: ((this: import("@esportsplus/template").Element, event: TouchEvent) => void) | undefined;
101
103
  ontouchmove?: ((this: import("@esportsplus/template").Element, event: TouchEvent) => void) | undefined;
@@ -116,5 +118,5 @@ declare const _default: (attributes: {
116
118
  active: boolean;
117
119
  error: string;
118
120
  };
119
- }) => Node;
121
+ }) => DocumentFragment;
120
122
  export default _default;
package/package.json CHANGED
@@ -1,25 +1,24 @@
1
1
  {
2
2
  "author": "ICJR",
3
3
  "dependencies": {
4
- "@esportsplus/action": "^0.0.58",
5
- "@esportsplus/queue": "^0.1.0",
6
- "@esportsplus/reactivity": "^0.18.1",
7
- "@esportsplus/template": "^0.26.5",
8
- "@esportsplus/utilities": "^0.25.0",
9
- "@esportsplus/vite": "^0.10.5",
4
+ "@esportsplus/action": "^0.1.4",
5
+ "@esportsplus/queue": "^0.2.0",
6
+ "@esportsplus/template": "^0.41.0",
7
+ "@esportsplus/utilities": "^0.27.2",
8
+ "@esportsplus/vite": "^0.12.3",
10
9
  "modern-normalize": "^3.0.1"
11
10
  },
12
11
  "devDependencies": {
13
- "@esportsplus/typescript": "^0.9.2",
14
- "@types/node": "^24.10.1",
15
- "@types/shelljs": "^0.8.17",
16
- "autoprefixer": "^10.4.22",
12
+ "@esportsplus/typescript": "^0.27.3",
13
+ "@types/node": "^25.0.3",
14
+ "@types/shelljs": "^0.10.0",
15
+ "autoprefixer": "^10.4.23",
17
16
  "glob": "^13.0.0",
18
17
  "lightningcss": "^1.30.2",
19
18
  "npm-run-all": "^4.1.5",
20
- "sass": "^1.94.2",
19
+ "sass": "^1.97.2",
21
20
  "shelljs": "^0.10.0",
22
- "vite": "^7.2.2"
21
+ "vite": "^7.3.1"
23
22
  },
24
23
  "exports": {
25
24
  "./css-utilities.scss": "./build/css-utilities/index.scss",
@@ -53,12 +52,16 @@
53
52
  },
54
53
  "name": "@esportsplus/ui",
55
54
  "private": false,
55
+ "repository": {
56
+ "type": "git",
57
+ "url": "https://github.com/esportsplus/ui"
58
+ },
56
59
  "sideEffects": false,
57
60
  "type": "module",
58
- "version": "0.46.0",
61
+ "version": "0.48.0",
59
62
  "scripts": {
60
63
  "build": "run-s build:vite build:ts",
61
- "build:ts": "tsc && tsc-alias",
64
+ "build:ts": "tsc",
62
65
  "build:vite": "vite build",
63
66
  "-": "-"
64
67
  }
@@ -1,5 +1,4 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html, Attributes } from '@esportsplus/template';
1
+ import { html, reactive, Attributes } from '@esportsplus/template';
3
2
  import { omit } from '@esportsplus/utilities';
4
3
  import template from '~/components/template';
5
4
  import './scss/index.scss';
@@ -1,7 +1,6 @@
1
1
  import '@esportsplus/vite/global.d.ts';
2
2
  import { Response } from '@esportsplus/action';
3
- import { reactive } from '@esportsplus/reactivity';
4
- import { html, svg, Attributes, Renderable } from '@esportsplus/template';
3
+ import { html, reactive, svg, Attributes, Renderable } from '@esportsplus/template';
5
4
  import { omit } from '@esportsplus/utilities';
6
5
  import { icon } from '@esportsplus/ui';
7
6
  import check from './svg/check.svg';
@@ -1,5 +1,4 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html, Renderable } from '@esportsplus/template';
1
+ import { html, reactive, type Renderable } from '@esportsplus/template';
3
2
  import template from '../template';
4
3
  import './scss/index.scss';
5
4
 
@@ -11,10 +10,6 @@ const hold = template.factory(
11
10
  state.holding = false;
12
11
  }
13
12
  },
14
- start = (e: MouseEvent) => {
15
- e.preventDefault();
16
- state.holding = true;
17
- },
18
13
  state = reactive({
19
14
  complete: false,
20
15
  holding: false
@@ -23,17 +18,29 @@ const hold = template.factory(
23
18
  return html`
24
19
  <div
25
20
  class='button ${() => state.holding && 'button--holding'} ${() => state.complete && '--active'}'
26
- onanimationend=${(e: AnimationEvent) => {
27
- if (e.animationName === 'buttonHolding') {
28
- state.complete = true;
21
+ onmousedown='${(e) => {
22
+ e.preventDefault();
23
+ state.holding = true;
24
+ }}'
25
+ ${attributes}
26
+ ${{
27
+ onanimationend: (e: AnimationEvent) => {
28
+ if (e.animationName === 'buttonHolding') {
29
+ state.complete = true;
30
+ }
31
+ },
32
+ onclick: () => {},
33
+ onmousedown: (e) => {
34
+ e.preventDefault();
35
+ state.holding = true;
36
+ },
37
+ onmouseup: end,
38
+ ontouchend: end,
39
+ ontouchstart: (e) => {
40
+ e.preventDefault();
41
+ state.holding = true;
29
42
  }
30
43
  }}
31
- onclick=${() => {}}
32
- onmousedown=${start}
33
- onmouseup=${end}
34
- ontouchstart=${start}
35
- ontouchend=${end}
36
- ${attributes}
37
44
  >
38
45
  ${() => content(state)}
39
46
  </div>
@@ -1,5 +1,4 @@
1
- import { reactive, root } from '@esportsplus/reactivity';
2
- import { html, type Attributes } from '@esportsplus/template';
1
+ import { html, reactive, root, type Attributes } from '@esportsplus/template';
3
2
  import { omit } from '@esportsplus/utilities';
4
3
  import form from '~/components/form';
5
4
  import './scss/index.scss';
@@ -1,5 +1,4 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html, type Attributes, type Renderable } from '@esportsplus/template';
1
+ import { html, reactive, type Attributes, type Renderable } from '@esportsplus/template';
3
2
  import { omit } from '@esportsplus/utilities';
4
3
  import template from '~/components/template';
5
4
  import write from './write';
@@ -1,5 +1,4 @@
1
- import { effect, reactive } from '@esportsplus/reactivity'
2
- import { html, type Attributes } from '@esportsplus/template';
1
+ import { effect, html, reactive, type Attributes } from '@esportsplus/template';
3
2
  import { omit } from '@esportsplus/utilities';
4
3
  import './scss/index.scss';
5
4
 
@@ -30,8 +29,10 @@ export default (attributes: Attributes & {
30
29
  rendering = true,
31
30
  state = reactive({
32
31
  length: 0,
32
+ test: () => 'sds',
33
33
  render: [] as string[]
34
- });
34
+ }),
35
+ render = reactive([] as string[]);
35
36
 
36
37
  decimals ??= 2;
37
38
 
@@ -69,7 +70,7 @@ export default (attributes: Attributes & {
69
70
  value = '0';
70
71
  }
71
72
 
72
- state.render[i] = value;
73
+ render[i] = value;
73
74
  }
74
75
 
75
76
  if (rendering === true) {
@@ -87,7 +88,7 @@ export default (attributes: Attributes & {
87
88
  return '';
88
89
  }
89
90
 
90
- return html.reactive(state.render, function (value, i) {
91
+ return html.reactive(render, function (value) {
91
92
  if (isNaN(parseInt(value, 10))) {
92
93
  return html`
93
94
  <span class='counter-character counter-character--symbol'>
@@ -97,9 +98,7 @@ export default (attributes: Attributes & {
97
98
  }
98
99
 
99
100
  return html`
100
- <div class=' counter-character' ${{
101
- class: i > n - 3 && 'counter-character--fraction'
102
- }}>
101
+ <div class=' counter-character'>
103
102
  <div class='counter-character-track' style='${`--value: ${value}`}'>
104
103
  <span>9</span>
105
104
  ${[0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((value) => html`<span>${value}</span>`)}
@@ -1,5 +1,4 @@
1
- import { reactive } from '@esportsplus/reactivity'
2
- import { html, Attributes } from '@esportsplus/template';
1
+ import { html, reactive, Attributes } from '@esportsplus/template';
3
2
  import { omit } from '@esportsplus/utilities';
4
3
  import template from '~/components/template';
5
4
  import './scss/index.scss';
@@ -1,5 +1,4 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html, type Attributes } from '@esportsplus/template';
1
+ import { html, reactive, type Attributes } from '@esportsplus/template';
3
2
  import form from '~/components/form';
4
3
  import './scss/index.scss';
5
4
 
@@ -1,5 +1,4 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html, Attributes } from '@esportsplus/template';
1
+ import { html, reactive, type Attributes } from '@esportsplus/template';
3
2
  import { omit } from '@esportsplus/utilities'
4
3
  import template from '~/components/template';
5
4
  import './scss/index.scss';
@@ -1,5 +1,4 @@
1
- import { reactive, root } from '@esportsplus/reactivity';
2
- import { html, type Attributes } from '@esportsplus/template';
1
+ import { html, reactive, root, type Attributes } from '@esportsplus/template';
3
2
  import form from '~/components/form';
4
3
  import './scss/index.scss';
5
4
 
@@ -1,5 +1,4 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html, type Attributes } from '@esportsplus/template';
1
+ import { html, reactive, type Attributes } from '@esportsplus/template';
3
2
  import { omit } from '@esportsplus/utilities';
4
3
  import template from '~/components/template';
5
4
  import './scss/index.scss';
@@ -1,5 +1,4 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html, Renderable, type Attributes } from '@esportsplus/template';
1
+ import { html, reactive, type Renderable, type Attributes } from '@esportsplus/template';
3
2
  import { EMPTY_ARRAY, omit, toArray } from '@esportsplus/utilities';
4
3
  import form from '~/components/form';
5
4
  import root from '~/components/root';
@@ -96,7 +95,19 @@ const select = template.factory<A, (state: { active: boolean, selected?: string
96
95
  state.render = true;
97
96
  }}
98
97
  >
99
- ${content ? (() => content(state)) : (() => options[ state.selected! ] || '-')}
98
+ ${content ? (() => content(state)) : (() => {
99
+ let selected = options[state.selected!];
100
+
101
+ if (!selected) {
102
+ return '-';
103
+ }
104
+
105
+ if (selected !== null && typeof selected === 'object' && 'content' in selected) {
106
+ return selected.content;
107
+ }
108
+
109
+ return selected;
110
+ })}
100
111
 
101
112
  <div class='select-arrow' ${this?.attributes?.arrow} ${attributes.arrow}></div>
102
113
 
@@ -1,5 +1,4 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html, type Attributes } from '@esportsplus/template';
1
+ import { html, reactive, type Attributes } from '@esportsplus/template';
3
2
  import { omit } from '@esportsplus/utilities';
4
3
  import form from '~/components/form';
5
4
  import './scss/index.scss';
@@ -1,5 +1,4 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html, type Attributes } from '@esportsplus/template';
1
+ import { html, reactive, type Attributes } from '@esportsplus/template';
3
2
  import { omit } from '@esportsplus/utilities';
4
3
  import { root } from '@esportsplus/ui';
5
4
  import template from '~/components/template';
@@ -1,5 +1,4 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html, Attributes } from '@esportsplus/template';
1
+ import { html, reactive, Attributes } from '@esportsplus/template';
3
2
  import { omit } from '@esportsplus/utilities';
4
3
  import template from '~/components/template';
5
4
 
@@ -1,5 +1,4 @@
1
- import { html } from '@esportsplus/template';
2
- import { reactive } from '@esportsplus/reactivity';
1
+ import { html, reactive } from '@esportsplus/template';
3
2
  import template from '~/components/template';
4
3
  import './scss/index.scss';
5
4
 
package/tsconfig.json CHANGED
@@ -1,3 +1,8 @@
1
1
  {
2
- "extends": "@esportsplus/typescript/tsconfig.package.json"
2
+ "extends": "@esportsplus/typescript/tsconfig.package.json",
3
+ "compilerOptions": {
4
+ "plugins": [
5
+ { "transform": "@esportsplus/template/compiler/tsc" }
6
+ ]
7
+ }
3
8
  }