@esportsplus/ui 0.54.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.
Files changed (64) hide show
  1. package/build/components/accordion/index.d.ts +713 -5
  2. package/build/components/accordion/index.js +16 -5
  3. package/build/components/accordion/scss/index.scss +1 -1
  4. package/build/components/checkbox/constants.d.ts +2 -0
  5. package/build/components/checkbox/constants.js +2 -0
  6. package/build/components/checkbox/index.d.ts +17 -11
  7. package/build/components/checkbox/index.js +22 -36
  8. package/build/components/clipboard/copy.d.ts +1 -1
  9. package/build/components/clipboard/copy.js +12 -7
  10. package/build/components/clipboard/index.d.ts +981 -981
  11. package/build/components/clipboard/onclick.js +4 -6
  12. package/build/components/counter/index.d.ts +1 -1
  13. package/build/components/counter/index.js +4 -8
  14. package/build/components/form/action.d.ts +1 -1
  15. package/build/components/form/action.js +2 -5
  16. package/build/components/form/index.d.ts +1 -1
  17. package/build/components/input/index.d.ts +1 -1
  18. package/build/components/input/index.js +2 -3
  19. package/build/components/radio/index.d.ts +3 -1442
  20. package/build/components/radio/index.js +2 -1
  21. package/build/components/select/constants.d.ts +4 -0
  22. package/build/components/select/constants.js +4 -0
  23. package/build/components/select/index.d.ts +12 -6
  24. package/build/components/select/index.js +43 -60
  25. package/build/components/switch/index.d.ts +3 -1442
  26. package/build/components/switch/index.js +2 -1
  27. package/build/components/textarea/index.d.ts +490 -490
  28. package/build/components/textarea/index.js +5 -8
  29. package/build/components/tooltip/constants.d.ts +3 -0
  30. package/build/components/tooltip/constants.js +3 -0
  31. package/build/components/tooltip/index.d.ts +8 -2153
  32. package/build/components/tooltip/index.js +2 -1
  33. package/build/components/tooltip/menu.d.ts +9 -5
  34. package/build/components/tooltip/menu.js +14 -17
  35. package/build/components/tooltip/onclick.d.ts +490 -490
  36. package/build/components/tooltip/onclick.js +17 -23
  37. package/build/components/tooltip/onhover.d.ts +497 -494
  38. package/build/components/tooltip/onhover.js +12 -17
  39. package/build/themes/dark/input.d.ts +491 -491
  40. package/build/themes/dark/select.d.ts +3 -735
  41. package/build/themes/dark/select.js +5 -4
  42. package/build/themes/dark/textarea.d.ts +490 -490
  43. package/package.json +2 -2
  44. package/pnpm-workspace.yaml +1 -1
  45. package/src/components/accordion/index.ts +7 -14
  46. package/src/components/accordion/scss/index.scss +3 -1
  47. package/src/components/checkbox/constants.ts +4 -0
  48. package/src/components/checkbox/index.ts +12 -23
  49. package/src/components/clipboard/copy.ts +7 -12
  50. package/src/components/clipboard/onclick.ts +4 -9
  51. package/src/components/counter/index.ts +5 -14
  52. package/src/components/form/action.ts +2 -8
  53. package/src/components/input/index.ts +7 -5
  54. package/src/components/radio/index.ts +5 -2
  55. package/src/components/select/constants.ts +8 -0
  56. package/src/components/select/index.ts +49 -53
  57. package/src/components/switch/index.ts +5 -2
  58. package/src/components/textarea/index.ts +13 -14
  59. package/src/components/tooltip/constants.ts +6 -0
  60. package/src/components/tooltip/index.ts +4 -1
  61. package/src/components/tooltip/menu.ts +18 -29
  62. package/src/components/tooltip/onclick.ts +22 -33
  63. package/src/components/tooltip/onhover.ts +18 -29
  64. package/src/themes/dark/select.ts +7 -4
@@ -2,4 +2,5 @@ import menu from './menu.js';
2
2
  import onclick from './onclick.js';
3
3
  import onhover from './onhover.js';
4
4
  import './scss/index.scss';
5
- export default { menu, onclick, onhover };
5
+ const tooltip = { menu, onclick, onhover };
6
+ export default tooltip;
@@ -1,17 +1,21 @@
1
1
  import * as template_u0 from '@esportsplus/template';
2
2
  import { type Attributes, type Renderable } from '@esportsplus/template';
3
+ import { MENU_OPTION, MENU_TOOLTIP_CONTENT } from './constants.js';
3
4
  type A = Attributes & {
5
+ [MENU_OPTION]?: Attributes;
6
+ [MENU_TOOLTIP_CONTENT]?: Attributes & {
7
+ direction?: string;
8
+ };
4
9
  options: (Attributes & {
5
10
  content: Renderable<unknown>;
6
11
  })[];
7
- option?: Attributes;
8
12
  state?: {
9
13
  active: boolean;
10
14
  };
11
15
  toggle?: boolean;
12
- 'tooltip-content': Attributes & {
13
- direction?: string;
14
- };
15
16
  };
16
- declare const _default: template_u0.Factory<A, Renderable<any>, Renderable<any>>;
17
+ declare const _default: template_u0.Factory<A, Renderable<any>, Renderable<any>> & {
18
+ readonly option: typeof MENU_OPTION;
19
+ readonly tooltipContent: typeof MENU_TOOLTIP_CONTENT;
20
+ };
17
21
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import * as template_u0 from '@esportsplus/template';
2
2
  import { component } from '@esportsplus/template';
3
3
  import * as reactivity_u0 from '@esportsplus/reactivity';
4
- import { omit } from '@esportsplus/utilities';
4
+ import { MENU_OPTION, MENU_TOOLTIP_CONTENT } from './constants.js';
5
5
  import onclick from './onclick.js';
6
6
  const template_u2p = template_u0.template(`<a class='link --width-full' target='_blank' >`);
7
7
  const template_u2s = template_u0.template(`<div class='link --width-full' >`);
@@ -18,35 +18,32 @@ class ReactiveObject_0p4v5170 extends reactivity_u0.ReactiveObject {
18
18
  reactivity_u0.write(this.#active, _v0);
19
19
  }
20
20
  }
21
- const OMIT = ['options', 'option', 'tooltip-content'];
22
- const OMIT_OPTION = ['content'];
23
- const OMIT_TOOLTIP_CONTENT = ['direction'];
24
- export default component((attributes, content) => {
25
- let options = attributes.options, option = attributes.option, state = attributes.state || new ReactiveObject_0p4v5170(), tooltipContent = attributes?.['tooltip-content'], tooltipContentDirection = tooltipContent?.direction || 'nw';
26
- return onclick({ ...omit(attributes, OMIT), state }, (() => {
21
+ export default Object.assign(component(({ options, state = new ReactiveObject_0p4v5170(), ...attributes }, content) => {
22
+ let { direction = 'nw', ...tooltipContent } = attributes[MENU_TOOLTIP_CONTENT] ?? {};
23
+ return onclick({ ...attributes, state }, (() => {
27
24
  let root_u2u = template_u2v(), element_u2w = root_u2u.firstChild, element_u2x = element_u2w.nextSibling;
28
25
  template_u0.slot(element_u2w, content);
29
- template_u0.setList(element_u2x, 'class', `tooltip-content--${tooltipContentDirection}`);
30
- template_u0.setProperties(element_u2x, tooltipContent && omit(tooltipContent, OMIT_TOOLTIP_CONTENT));
26
+ template_u0.setList(element_u2x, 'class', `tooltip-content--${direction}`);
27
+ template_u0.setProperties(element_u2x, tooltipContent);
31
28
  template_u0.setProperty(element_u2x, 'inert', () => !state.active);
32
- template_u0.slot(element_u2x, options.map((o) => {
29
+ template_u0.slot(element_u2x, options.map(({ content, ...o }) => {
33
30
  if (o.href) {
34
31
  return (() => {
35
32
  let root_u2o = template_u2p(), element_u2q = root_u2o.firstChild;
36
- template_u0.setProperties(element_u2q, omit(o, OMIT_OPTION));
37
- template_u0.setProperties(element_u2q, option);
38
- template_u0.slot(element_u2q, o.content, 1);
33
+ template_u0.setProperties(element_u2q, o);
34
+ template_u0.setProperties(element_u2q, attributes[MENU_OPTION]);
35
+ template_u0.slot(element_u2q, content, 1);
39
36
  return root_u2o;
40
37
  })();
41
38
  }
42
39
  return (() => {
43
40
  let root_u2r = template_u2s(), element_u2t = root_u2r.firstChild;
44
- template_u0.setProperties(element_u2t, omit(o, OMIT_OPTION));
45
- template_u0.setProperties(element_u2t, option);
46
- template_u0.slot(element_u2t, o.content, 1);
41
+ template_u0.setProperties(element_u2t, o);
42
+ template_u0.setProperties(element_u2t, attributes[MENU_OPTION]);
43
+ template_u0.slot(element_u2t, content, 1);
47
44
  return root_u2r;
48
45
  })();
49
46
  }), 1);
50
47
  return root_u2u;
51
48
  })());
52
- });
49
+ }), { option: MENU_OPTION, tooltipContent: MENU_TOOLTIP_CONTENT });