@lukso/web-components 1.118.0 → 1.119.1

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 (87) hide show
  1. package/dist/components/index.cjs +8 -7
  2. package/dist/components/index.js +8 -7
  3. package/dist/components/lukso-button/index.cjs +3 -3
  4. package/dist/components/lukso-button/index.js +3 -3
  5. package/dist/components/lukso-card/index.cjs +6 -6
  6. package/dist/components/lukso-card/index.js +6 -6
  7. package/dist/components/lukso-checkbox/index.cjs +3 -3
  8. package/dist/components/lukso-checkbox/index.js +3 -3
  9. package/dist/components/lukso-color-picker/index.cjs +4 -4
  10. package/dist/components/lukso-color-picker/index.js +4 -4
  11. package/dist/components/lukso-dropdown/index.cjs +151 -12
  12. package/dist/components/lukso-dropdown/index.js +156 -8
  13. package/dist/components/lukso-dropdown-option/index.cjs +2 -2
  14. package/dist/components/lukso-dropdown-option/index.js +2 -2
  15. package/dist/components/lukso-footer/index.cjs +2 -2
  16. package/dist/components/lukso-footer/index.js +2 -2
  17. package/dist/components/lukso-icon/index.cjs +3 -3
  18. package/dist/components/lukso-icon/index.js +3 -3
  19. package/dist/components/lukso-image/index.cjs +4 -4
  20. package/dist/components/lukso-image/index.js +4 -4
  21. package/dist/components/lukso-input/index.cjs +4 -4
  22. package/dist/components/lukso-input/index.js +4 -4
  23. package/dist/components/lukso-modal/index.cjs +2 -2
  24. package/dist/components/lukso-modal/index.js +2 -2
  25. package/dist/components/lukso-navbar/index.cjs +5 -5
  26. package/dist/components/lukso-navbar/index.js +5 -5
  27. package/dist/components/lukso-pagination/index.cjs +4 -4
  28. package/dist/components/lukso-pagination/index.js +4 -4
  29. package/dist/components/lukso-profile/index.cjs +5 -5
  30. package/dist/components/lukso-profile/index.js +5 -5
  31. package/dist/components/lukso-progress/index.cjs +3 -3
  32. package/dist/components/lukso-progress/index.js +3 -3
  33. package/dist/components/lukso-sanitize/index.cjs +2 -2
  34. package/dist/components/lukso-sanitize/index.js +2 -2
  35. package/dist/components/lukso-search/index.cjs +15 -10
  36. package/dist/components/lukso-search/index.d.ts +1 -0
  37. package/dist/components/lukso-search/index.d.ts.map +1 -1
  38. package/dist/components/lukso-search/index.js +15 -10
  39. package/dist/components/lukso-search/lukso-search.stories.d.ts +2 -0
  40. package/dist/components/lukso-search/lukso-search.stories.d.ts.map +1 -1
  41. package/dist/components/lukso-select/index.cjs +9 -8
  42. package/dist/components/lukso-select/index.js +8 -7
  43. package/dist/components/lukso-share/index.cjs +2 -2
  44. package/dist/components/lukso-share/index.js +2 -2
  45. package/dist/components/lukso-switch/index.cjs +118 -33
  46. package/dist/components/lukso-switch/index.d.ts +12 -4
  47. package/dist/components/lukso-switch/index.d.ts.map +1 -1
  48. package/dist/components/lukso-switch/index.js +118 -33
  49. package/dist/components/lukso-switch/lukso-switch.stories.d.ts +8 -0
  50. package/dist/components/lukso-switch/lukso-switch.stories.d.ts.map +1 -1
  51. package/dist/components/lukso-tag/index.cjs +3 -3
  52. package/dist/components/lukso-tag/index.js +3 -3
  53. package/dist/components/lukso-terms/index.cjs +4 -4
  54. package/dist/components/lukso-terms/index.js +4 -4
  55. package/dist/components/lukso-test/index.cjs +2 -2
  56. package/dist/components/lukso-test/index.js +2 -2
  57. package/dist/components/lukso-textarea/index.cjs +4 -4
  58. package/dist/components/lukso-textarea/index.js +4 -4
  59. package/dist/components/lukso-tooltip/index.cjs +4 -4
  60. package/dist/components/lukso-tooltip/index.js +4 -4
  61. package/dist/components/lukso-username/index.cjs +3 -3
  62. package/dist/components/lukso-username/index.js +3 -3
  63. package/dist/components/lukso-wizard/index.cjs +2 -2
  64. package/dist/components/lukso-wizard/index.js +2 -2
  65. package/dist/index-11ee2a36.cjs +46 -0
  66. package/dist/{index-f564f46f.cjs → index-28b795be.cjs} +1 -1
  67. package/dist/{index-eb08047e.js → index-5e0baae9.js} +1 -1
  68. package/dist/{index-30c74dfe.js → index-6e86d3a6.js} +2 -2
  69. package/dist/index-be30d9db.js +37 -0
  70. package/dist/{index-9f282d35.cjs → index-d95aa803.cjs} +2 -2
  71. package/dist/index.cjs +8 -7
  72. package/dist/index.js +8 -7
  73. package/dist/{property-140ef335.js → property-23ddd718.js} +1 -1
  74. package/dist/{property-46482bf7.cjs → property-c2b27afb.cjs} +1 -1
  75. package/dist/shared/tailwind-element/index.cjs +1 -1
  76. package/dist/shared/tailwind-element/index.js +1 -1
  77. package/dist/{state-94c1d585.cjs → state-88ac4aa9.cjs} +1 -1
  78. package/dist/{state-876605e4.js → state-f46a7e17.js} +1 -1
  79. package/dist/{style-map-15dde65e.js → style-map-129fa2d5.js} +1 -1
  80. package/dist/{style-map-552ab28f.cjs → style-map-6e0d4ef7.cjs} +1 -1
  81. package/dist/uniq-id-ce2d165c.js +6 -0
  82. package/dist/uniq-id-f0b18085.cjs +8 -0
  83. package/package.json +1 -1
  84. package/dist/index-40811e43.js +0 -159
  85. package/dist/index-86a3fdc1.js +0 -37
  86. package/dist/index-dbfb7d50.cjs +0 -161
  87. package/dist/index-dda1809d.cjs +0 -46
@@ -6,7 +6,7 @@ const components_luksoButton_index = require('./lukso-button/index.cjs');
6
6
  const components_luksoCard_index = require('./lukso-card/index.cjs');
7
7
  const components_luksoCheckbox_index = require('./lukso-checkbox/index.cjs');
8
8
  const components_luksoColorPicker_index = require('./lukso-color-picker/index.cjs');
9
- const components_luksoDropdown_index = require('../index-dbfb7d50.cjs');
9
+ const components_luksoDropdown_index = require('./lukso-dropdown/index.cjs');
10
10
  const components_luksoDropdownOption_index = require('./lukso-dropdown-option/index.cjs');
11
11
  const components_luksoFooter_index = require('./lukso-footer/index.cjs');
12
12
  const components_luksoIcon_index = require('./lukso-icon/index.cjs');
@@ -15,7 +15,7 @@ const components_luksoInput_index = require('./lukso-input/index.cjs');
15
15
  const components_luksoModal_index = require('./lukso-modal/index.cjs');
16
16
  const components_luksoNavbar_index = require('./lukso-navbar/index.cjs');
17
17
  const components_luksoPagination_index = require('./lukso-pagination/index.cjs');
18
- const components_luksoProfile_index = require('../index-9f282d35.cjs');
18
+ const components_luksoProfile_index = require('../index-d95aa803.cjs');
19
19
  const components_luksoProgress_index = require('./lukso-progress/index.cjs');
20
20
  const components_luksoSanitize_index = require('./lukso-sanitize/index.cjs');
21
21
  const components_luksoSearch_index = require('./lukso-search/index.cjs');
@@ -29,16 +29,17 @@ const components_luksoTextarea_index = require('./lukso-textarea/index.cjs');
29
29
  const components_luksoTooltip_index = require('./lukso-tooltip/index.cjs');
30
30
  const components_luksoUsername_index = require('./lukso-username/index.cjs');
31
31
  const components_luksoWizard_index = require('./lukso-wizard/index.cjs');
32
- const shared_tailwindElement_index = require('../index-dda1809d.cjs');
32
+ const shared_tailwindElement_index = require('../index-11ee2a36.cjs');
33
33
  require('../cn-b6daa995.cjs');
34
- require('../property-46482bf7.cjs');
35
- require('../state-94c1d585.cjs');
34
+ require('../property-c2b27afb.cjs');
35
+ require('../state-88ac4aa9.cjs');
36
36
  require('../index-2b104ecb.cjs');
37
37
  require('../tailwind-config.cjs');
38
- require('../style-map-552ab28f.cjs');
38
+ require('../style-map-6e0d4ef7.cjs');
39
39
  require('../directive-8278ab14.cjs');
40
- require('../index-f564f46f.cjs');
40
+ require('../index-28b795be.cjs');
41
41
  require('../index-e9668573.cjs');
42
+ require('../uniq-id-f0b18085.cjs');
42
43
 
43
44
 
44
45
 
@@ -2,7 +2,7 @@ export { LuksoButton } from './lukso-button/index.js';
2
2
  export { LuksoCard } from './lukso-card/index.js';
3
3
  export { LuksoCheckbox } from './lukso-checkbox/index.js';
4
4
  export { LuksoColorPicker } from './lukso-color-picker/index.js';
5
- export { L as LuksoDropdown } from '../index-40811e43.js';
5
+ export { LuksoDropdown } from './lukso-dropdown/index.js';
6
6
  export { LuksoDropdownOption } from './lukso-dropdown-option/index.js';
7
7
  export { LuksoFooter } from './lukso-footer/index.js';
8
8
  export { LuksoIcon } from './lukso-icon/index.js';
@@ -11,7 +11,7 @@ export { LuksoInput } from './lukso-input/index.js';
11
11
  export { LuksoModal } from './lukso-modal/index.js';
12
12
  export { LuksoNavbar } from './lukso-navbar/index.js';
13
13
  export { LuksoPagination } from './lukso-pagination/index.js';
14
- export { L as LuksoProfile } from '../index-30c74dfe.js';
14
+ export { L as LuksoProfile } from '../index-6e86d3a6.js';
15
15
  export { LuksoProgress } from './lukso-progress/index.js';
16
16
  export { LuksoSanitize } from './lukso-sanitize/index.js';
17
17
  export { LuksoSearch } from './lukso-search/index.js';
@@ -25,13 +25,14 @@ export { LuksoTextarea } from './lukso-textarea/index.js';
25
25
  export { LuksoTooltip } from './lukso-tooltip/index.js';
26
26
  export { LuksoUsername } from './lukso-username/index.js';
27
27
  export { LuksoWizard } from './lukso-wizard/index.js';
28
- export { a as TailwindElement, T as TailwindStyledElement } from '../index-86a3fdc1.js';
28
+ export { a as TailwindElement, T as TailwindStyledElement } from '../index-be30d9db.js';
29
29
  import '../cn-90c03edf.js';
30
- import '../property-140ef335.js';
31
- import '../state-876605e4.js';
30
+ import '../property-23ddd718.js';
31
+ import '../state-f46a7e17.js';
32
32
  import '../index-d14b6a34.js';
33
33
  import '../tailwind-config.js';
34
- import '../style-map-15dde65e.js';
34
+ import '../style-map-129fa2d5.js';
35
35
  import '../directive-2bb7789e.js';
36
- import '../index-eb08047e.js';
36
+ import '../index-5e0baae9.js';
37
37
  import '../index-5e194caf.js';
38
+ import '../uniq-id-ce2d165c.js';
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-dda1809d.cjs');
6
- const property = require('../../property-46482bf7.cjs');
7
- const state = require('../../state-94c1d585.cjs');
5
+ const shared_tailwindElement_index = require('../../index-11ee2a36.cjs');
6
+ const property = require('../../property-c2b27afb.cjs');
7
+ const state = require('../../state-88ac4aa9.cjs');
8
8
  const index = require('../../index-2b104ecb.cjs');
9
9
  require('../../tailwind-config.cjs');
10
10
  const cn = require('../../cn-b6daa995.cjs');
@@ -1,6 +1,6 @@
1
- import { T as TailwindStyledElement, x, E } from '../../index-86a3fdc1.js';
2
- import { n, t } from '../../property-140ef335.js';
3
- import { r } from '../../state-876605e4.js';
1
+ import { T as TailwindStyledElement, x, E } from '../../index-be30d9db.js';
2
+ import { n, t } from '../../property-23ddd718.js';
3
+ import { r } from '../../state-f46a7e17.js';
4
4
  import { c as ce } from '../../index-d14b6a34.js';
5
5
  import '../../tailwind-config.js';
6
6
  import { c as cn } from '../../cn-90c03edf.js';
@@ -2,15 +2,15 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const components_luksoProfile_index = require('../../index-9f282d35.cjs');
6
- const shared_tailwindElement_index = require('../../index-dda1809d.cjs');
7
- const property = require('../../property-46482bf7.cjs');
8
- const state = require('../../state-94c1d585.cjs');
9
- const styleMap = require('../../style-map-552ab28f.cjs');
5
+ const components_luksoProfile_index = require('../../index-d95aa803.cjs');
6
+ const shared_tailwindElement_index = require('../../index-11ee2a36.cjs');
7
+ const property = require('../../property-c2b27afb.cjs');
8
+ const state = require('../../state-88ac4aa9.cjs');
9
+ const styleMap = require('../../style-map-6e0d4ef7.cjs');
10
10
  const index = require('../../index-2b104ecb.cjs');
11
11
  require('../../tailwind-config.cjs');
12
12
  const cn = require('../../cn-b6daa995.cjs');
13
- const index$1 = require('../../index-f564f46f.cjs');
13
+ const index$1 = require('../../index-28b795be.cjs');
14
14
  require('../lukso-image/index.cjs');
15
15
  require('../../directive-8278ab14.cjs');
16
16
 
@@ -1,12 +1,12 @@
1
- import { m as makeBlockie } from '../../index-30c74dfe.js';
2
- import { T as TailwindStyledElement, x, E } from '../../index-86a3fdc1.js';
3
- import { n, t } from '../../property-140ef335.js';
4
- import { r } from '../../state-876605e4.js';
5
- import { o as o$1 } from '../../style-map-15dde65e.js';
1
+ import { m as makeBlockie } from '../../index-6e86d3a6.js';
2
+ import { T as TailwindStyledElement, x, E } from '../../index-be30d9db.js';
3
+ import { n, t } from '../../property-23ddd718.js';
4
+ import { r } from '../../state-f46a7e17.js';
5
+ import { o as o$1 } from '../../style-map-129fa2d5.js';
6
6
  import { c as ce } from '../../index-d14b6a34.js';
7
7
  import '../../tailwind-config.js';
8
8
  import { c as cn } from '../../cn-90c03edf.js';
9
- import { c as customStyleMap } from '../../index-eb08047e.js';
9
+ import { c as customStyleMap } from '../../index-5e0baae9.js';
10
10
  import '../lukso-image/index.js';
11
11
  import '../../directive-2bb7789e.js';
12
12
 
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-dda1809d.cjs');
6
- const property = require('../../property-46482bf7.cjs');
7
- const state = require('../../state-94c1d585.cjs');
5
+ const shared_tailwindElement_index = require('../../index-11ee2a36.cjs');
6
+ const property = require('../../property-c2b27afb.cjs');
7
+ const state = require('../../state-88ac4aa9.cjs');
8
8
  const index = require('../../index-e9668573.cjs');
9
9
  require('../../directive-8278ab14.cjs');
10
10
 
@@ -1,6 +1,6 @@
1
- import { a as TailwindElement, x, E } from '../../index-86a3fdc1.js';
2
- import { n, t } from '../../property-140ef335.js';
3
- import { r } from '../../state-876605e4.js';
1
+ import { a as TailwindElement, x, E } from '../../index-be30d9db.js';
2
+ import { n, t } from '../../property-23ddd718.js';
3
+ import { r } from '../../state-f46a7e17.js';
4
4
  import { c as customClassMap } from '../../index-5e194caf.js';
5
5
  import '../../directive-2bb7789e.js';
6
6
 
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-dda1809d.cjs');
6
- const property = require('../../property-46482bf7.cjs');
7
- const state = require('../../state-94c1d585.cjs');
5
+ const shared_tailwindElement_index = require('../../index-11ee2a36.cjs');
6
+ const property = require('../../property-c2b27afb.cjs');
7
+ const state = require('../../state-88ac4aa9.cjs');
8
8
  const index = require('../../index-2b104ecb.cjs');
9
- const styleMap = require('../../style-map-552ab28f.cjs');
9
+ const styleMap = require('../../style-map-6e0d4ef7.cjs');
10
10
  require('../../tailwind-config.cjs');
11
11
  const cn = require('../../cn-b6daa995.cjs');
12
12
  require('../lukso-icon/index.cjs');
@@ -1,8 +1,8 @@
1
- import { T as TailwindStyledElement, x, E } from '../../index-86a3fdc1.js';
2
- import { n, t } from '../../property-140ef335.js';
3
- import { r } from '../../state-876605e4.js';
1
+ import { T as TailwindStyledElement, x, E } from '../../index-be30d9db.js';
2
+ import { n, t } from '../../property-23ddd718.js';
3
+ import { r } from '../../state-f46a7e17.js';
4
4
  import { c as ce } from '../../index-d14b6a34.js';
5
- import { o } from '../../style-map-15dde65e.js';
5
+ import { o } from '../../style-map-129fa2d5.js';
6
6
  import '../../tailwind-config.js';
7
7
  import { c as cn } from '../../cn-90c03edf.js';
8
8
  import '../lukso-icon/index.js';
@@ -2,24 +2,163 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- require('../../index-dda1809d.cjs');
6
- require('../../property-46482bf7.cjs');
7
- require('../../index-2b104ecb.cjs');
5
+ const shared_tailwindElement_index = require('../../index-11ee2a36.cjs');
6
+ const property = require('../../property-c2b27afb.cjs');
7
+ const index = require('../../index-2b104ecb.cjs');
8
8
  require('../lukso-icon/index.cjs');
9
- require('../../index-9f282d35.cjs');
9
+ require('../../index-d95aa803.cjs');
10
10
  require('../lukso-username/index.cjs');
11
- const components_luksoDropdown_index = require('../../index-dbfb7d50.cjs');
12
- require('../../style-map-552ab28f.cjs');
11
+ const uniqId = require('../../uniq-id-f0b18085.cjs');
12
+ require('../../style-map-6e0d4ef7.cjs');
13
13
  require('../../directive-8278ab14.cjs');
14
14
  require('../lukso-image/index.cjs');
15
- require('../../state-94c1d585.cjs');
16
- require('../../index-f564f46f.cjs');
15
+ require('../../state-88ac4aa9.cjs');
16
+ require('../../index-28b795be.cjs');
17
17
  require('../../tailwind-config.cjs');
18
18
  require('../../cn-b6daa995.cjs');
19
19
 
20
+ const style = ":host {\n display: flex;\n width: 100%\n}";
20
21
 
22
+ const debounceFunction = (func, timeout = 100) => {
23
+ let timer;
24
+ return (...args) => {
25
+ clearTimeout(timer);
26
+ timer = setTimeout(() => {
27
+ typeof func === "function" && func.apply(void 0, args);
28
+ }, timeout);
29
+ };
30
+ };
21
31
 
22
- Object.defineProperty(exports, 'LuksoDropdown', {
23
- enumerable: true,
24
- get: () => components_luksoDropdown_index.LuksoDropdown
25
- });
32
+ var __defProp = Object.defineProperty;
33
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
34
+ var __decorateClass = (decorators, target, key, kind) => {
35
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
36
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
37
+ if (decorator = decorators[i])
38
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
39
+ if (kind && result)
40
+ __defProp(target, key, result);
41
+ return result;
42
+ };
43
+ exports.LuksoDropdown = class LuksoDropdown extends shared_tailwindElement_index.TailwindStyledElement(style) {
44
+ constructor() {
45
+ super();
46
+ this.id = "";
47
+ this.triggerId = "";
48
+ this.isOpen = false;
49
+ this.isOpenOnOutsideClick = false;
50
+ this.openTop = false;
51
+ this.isRight = false;
52
+ this.isFullWidth = false;
53
+ this.size = "medium";
54
+ this.styles = index.ce({
55
+ base: `bg-neutral-100 border w-full border-neutral-90 shadow-1xl z-50
56
+ flex absolute flex-col gap-1 overflow-y-auto max-h-64 w-[max-content]`,
57
+ variants: {
58
+ openTop: {
59
+ true: "bottom-[48px] mb-2 mt-0"
60
+ },
61
+ size: {
62
+ small: "rounded-8 p-2 mt-1 min-w-[120px] paragraph-inter-12-regular",
63
+ medium: "rounded-12 p-3 mt-2 min-w-[200px] paragraph-inter-14-regular"
64
+ },
65
+ isRight: {
66
+ true: "right-0"
67
+ },
68
+ isFullWidth: {
69
+ true: "w-full"
70
+ }
71
+ },
72
+ compoundVariants: [
73
+ {
74
+ isFullWidth: false,
75
+ size: "small",
76
+ class: "max-w-[200px]"
77
+ },
78
+ {
79
+ isFullWidth: false,
80
+ size: "medium",
81
+ class: "max-w-[300px]"
82
+ }
83
+ ]
84
+ });
85
+ this.handleClick = debounceFunction((event) => {
86
+ const element = event.target;
87
+ if (element.id === this.triggerId || this.id === element.id) {
88
+ this.isOpen = !this.isOpen;
89
+ return;
90
+ }
91
+ if (!this.isOpenOnOutsideClick) {
92
+ this.isOpen = false;
93
+ }
94
+ });
95
+ if (!this.id) {
96
+ this.id = uniqId.uniqId();
97
+ }
98
+ }
99
+ connectedCallback() {
100
+ super.connectedCallback();
101
+ window.addEventListener("click", this.handleClick.bind(this));
102
+ }
103
+ disconnectedCallback() {
104
+ super.disconnectedCallback();
105
+ window.removeEventListener("click", this.handleClick);
106
+ }
107
+ async willUpdate(changedProperties) {
108
+ if (changedProperties.has("isOpen")) {
109
+ await this.updateComplete;
110
+ const changeEvent = new CustomEvent(
111
+ "on-change",
112
+ {
113
+ detail: {
114
+ isOpen: this.isOpen
115
+ },
116
+ bubbles: false,
117
+ composed: true
118
+ }
119
+ );
120
+ this.dispatchEvent(changeEvent);
121
+ }
122
+ }
123
+ render() {
124
+ const styles = this.styles({
125
+ openTop: this.openTop,
126
+ size: this.size,
127
+ isRight: this.isRight,
128
+ isFullWidth: this.isFullWidth
129
+ });
130
+ if (!this.isOpen) {
131
+ return shared_tailwindElement_index.E;
132
+ }
133
+ return shared_tailwindElement_index.x`<div class="${styles} animate-fade-in animation-duration-200">
134
+ <slot></slot>
135
+ </div>`;
136
+ }
137
+ };
138
+ __decorateClass([
139
+ property.n({ type: String })
140
+ ], exports.LuksoDropdown.prototype, "id", 2);
141
+ __decorateClass([
142
+ property.n({ type: String, attribute: "trigger-id" })
143
+ ], exports.LuksoDropdown.prototype, "triggerId", 2);
144
+ __decorateClass([
145
+ property.n({ type: Boolean, attribute: "is-open", reflect: true })
146
+ ], exports.LuksoDropdown.prototype, "isOpen", 2);
147
+ __decorateClass([
148
+ property.n({ type: Boolean, attribute: "is-open-on-outside-click" })
149
+ ], exports.LuksoDropdown.prototype, "isOpenOnOutsideClick", 2);
150
+ __decorateClass([
151
+ property.n({ type: Boolean, attribute: "open-top" })
152
+ ], exports.LuksoDropdown.prototype, "openTop", 2);
153
+ __decorateClass([
154
+ property.n({ type: Boolean, attribute: "is-right" })
155
+ ], exports.LuksoDropdown.prototype, "isRight", 2);
156
+ __decorateClass([
157
+ property.n({ type: Boolean, attribute: "is-full-width" })
158
+ ], exports.LuksoDropdown.prototype, "isFullWidth", 2);
159
+ __decorateClass([
160
+ property.n({ type: String })
161
+ ], exports.LuksoDropdown.prototype, "size", 2);
162
+ exports.LuksoDropdown = __decorateClass([
163
+ property.t("lukso-dropdown")
164
+ ], exports.LuksoDropdown);
@@ -1,14 +1,162 @@
1
- import '../../index-86a3fdc1.js';
2
- import '../../property-140ef335.js';
3
- import '../../index-d14b6a34.js';
1
+ import { T as TailwindStyledElement, E, x } from '../../index-be30d9db.js';
2
+ import { n, t } from '../../property-23ddd718.js';
3
+ import { c as ce } from '../../index-d14b6a34.js';
4
4
  import '../lukso-icon/index.js';
5
- import '../../index-30c74dfe.js';
5
+ import '../../index-6e86d3a6.js';
6
6
  import '../lukso-username/index.js';
7
- export { L as LuksoDropdown } from '../../index-40811e43.js';
8
- import '../../style-map-15dde65e.js';
7
+ import { u as uniqId } from '../../uniq-id-ce2d165c.js';
8
+ import '../../style-map-129fa2d5.js';
9
9
  import '../../directive-2bb7789e.js';
10
10
  import '../lukso-image/index.js';
11
- import '../../state-876605e4.js';
12
- import '../../index-eb08047e.js';
11
+ import '../../state-f46a7e17.js';
12
+ import '../../index-5e0baae9.js';
13
13
  import '../../tailwind-config.js';
14
14
  import '../../cn-90c03edf.js';
15
+
16
+ const style = ":host {\n display: flex;\n width: 100%\n}";
17
+
18
+ const debounceFunction = (func, timeout = 100) => {
19
+ let timer;
20
+ return (...args) => {
21
+ clearTimeout(timer);
22
+ timer = setTimeout(() => {
23
+ typeof func === "function" && func.apply(void 0, args);
24
+ }, timeout);
25
+ };
26
+ };
27
+
28
+ var __defProp = Object.defineProperty;
29
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
30
+ var __decorateClass = (decorators, target, key, kind) => {
31
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
32
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
33
+ if (decorator = decorators[i])
34
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
35
+ if (kind && result)
36
+ __defProp(target, key, result);
37
+ return result;
38
+ };
39
+ let LuksoDropdown = class extends TailwindStyledElement(style) {
40
+ constructor() {
41
+ super();
42
+ this.id = "";
43
+ this.triggerId = "";
44
+ this.isOpen = false;
45
+ this.isOpenOnOutsideClick = false;
46
+ this.openTop = false;
47
+ this.isRight = false;
48
+ this.isFullWidth = false;
49
+ this.size = "medium";
50
+ this.styles = ce({
51
+ base: `bg-neutral-100 border w-full border-neutral-90 shadow-1xl z-50
52
+ flex absolute flex-col gap-1 overflow-y-auto max-h-64 w-[max-content]`,
53
+ variants: {
54
+ openTop: {
55
+ true: "bottom-[48px] mb-2 mt-0"
56
+ },
57
+ size: {
58
+ small: "rounded-8 p-2 mt-1 min-w-[120px] paragraph-inter-12-regular",
59
+ medium: "rounded-12 p-3 mt-2 min-w-[200px] paragraph-inter-14-regular"
60
+ },
61
+ isRight: {
62
+ true: "right-0"
63
+ },
64
+ isFullWidth: {
65
+ true: "w-full"
66
+ }
67
+ },
68
+ compoundVariants: [
69
+ {
70
+ isFullWidth: false,
71
+ size: "small",
72
+ class: "max-w-[200px]"
73
+ },
74
+ {
75
+ isFullWidth: false,
76
+ size: "medium",
77
+ class: "max-w-[300px]"
78
+ }
79
+ ]
80
+ });
81
+ this.handleClick = debounceFunction((event) => {
82
+ const element = event.target;
83
+ if (element.id === this.triggerId || this.id === element.id) {
84
+ this.isOpen = !this.isOpen;
85
+ return;
86
+ }
87
+ if (!this.isOpenOnOutsideClick) {
88
+ this.isOpen = false;
89
+ }
90
+ });
91
+ if (!this.id) {
92
+ this.id = uniqId();
93
+ }
94
+ }
95
+ connectedCallback() {
96
+ super.connectedCallback();
97
+ window.addEventListener("click", this.handleClick.bind(this));
98
+ }
99
+ disconnectedCallback() {
100
+ super.disconnectedCallback();
101
+ window.removeEventListener("click", this.handleClick);
102
+ }
103
+ async willUpdate(changedProperties) {
104
+ if (changedProperties.has("isOpen")) {
105
+ await this.updateComplete;
106
+ const changeEvent = new CustomEvent(
107
+ "on-change",
108
+ {
109
+ detail: {
110
+ isOpen: this.isOpen
111
+ },
112
+ bubbles: false,
113
+ composed: true
114
+ }
115
+ );
116
+ this.dispatchEvent(changeEvent);
117
+ }
118
+ }
119
+ render() {
120
+ const styles = this.styles({
121
+ openTop: this.openTop,
122
+ size: this.size,
123
+ isRight: this.isRight,
124
+ isFullWidth: this.isFullWidth
125
+ });
126
+ if (!this.isOpen) {
127
+ return E;
128
+ }
129
+ return x`<div class="${styles} animate-fade-in animation-duration-200">
130
+ <slot></slot>
131
+ </div>`;
132
+ }
133
+ };
134
+ __decorateClass([
135
+ n({ type: String })
136
+ ], LuksoDropdown.prototype, "id", 2);
137
+ __decorateClass([
138
+ n({ type: String, attribute: "trigger-id" })
139
+ ], LuksoDropdown.prototype, "triggerId", 2);
140
+ __decorateClass([
141
+ n({ type: Boolean, attribute: "is-open", reflect: true })
142
+ ], LuksoDropdown.prototype, "isOpen", 2);
143
+ __decorateClass([
144
+ n({ type: Boolean, attribute: "is-open-on-outside-click" })
145
+ ], LuksoDropdown.prototype, "isOpenOnOutsideClick", 2);
146
+ __decorateClass([
147
+ n({ type: Boolean, attribute: "open-top" })
148
+ ], LuksoDropdown.prototype, "openTop", 2);
149
+ __decorateClass([
150
+ n({ type: Boolean, attribute: "is-right" })
151
+ ], LuksoDropdown.prototype, "isRight", 2);
152
+ __decorateClass([
153
+ n({ type: Boolean, attribute: "is-full-width" })
154
+ ], LuksoDropdown.prototype, "isFullWidth", 2);
155
+ __decorateClass([
156
+ n({ type: String })
157
+ ], LuksoDropdown.prototype, "size", 2);
158
+ LuksoDropdown = __decorateClass([
159
+ t("lukso-dropdown")
160
+ ], LuksoDropdown);
161
+
162
+ export { LuksoDropdown };
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-dda1809d.cjs');
6
- const property = require('../../property-46482bf7.cjs');
5
+ const shared_tailwindElement_index = require('../../index-11ee2a36.cjs');
6
+ const property = require('../../property-c2b27afb.cjs');
7
7
  const index = require('../../index-2b104ecb.cjs');
8
8
 
9
9
  const style = ":host {\n display: block\n}";
@@ -1,5 +1,5 @@
1
- import { T as TailwindStyledElement, x } from '../../index-86a3fdc1.js';
2
- import { n, t } from '../../property-140ef335.js';
1
+ import { T as TailwindStyledElement, x } from '../../index-be30d9db.js';
2
+ import { n, t } from '../../property-23ddd718.js';
3
3
  import { c as ce } from '../../index-d14b6a34.js';
4
4
 
5
5
  const style = ":host {\n display: block\n}";
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-dda1809d.cjs');
6
- const property = require('../../property-46482bf7.cjs');
5
+ const shared_tailwindElement_index = require('../../index-11ee2a36.cjs');
6
+ const property = require('../../property-c2b27afb.cjs');
7
7
 
8
8
  var __defProp = Object.defineProperty;
9
9
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,5 +1,5 @@
1
- import { a as TailwindElement, x } from '../../index-86a3fdc1.js';
2
- import { n, t } from '../../property-140ef335.js';
1
+ import { a as TailwindElement, x } from '../../index-be30d9db.js';
2
+ import { n, t } from '../../property-23ddd718.js';
3
3
 
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-dda1809d.cjs');
6
- const property = require('../../property-46482bf7.cjs');
7
- const styleMap = require('../../style-map-552ab28f.cjs');
5
+ const shared_tailwindElement_index = require('../../index-11ee2a36.cjs');
6
+ const property = require('../../property-c2b27afb.cjs');
7
+ const styleMap = require('../../style-map-6e0d4ef7.cjs');
8
8
  require('../../directive-8278ab14.cjs');
9
9
 
10
10
  const style = ":host {\n display: inline-flex\n}";
@@ -1,6 +1,6 @@
1
- import { x, T as TailwindStyledElement } from '../../index-86a3fdc1.js';
2
- import { n, t } from '../../property-140ef335.js';
3
- import { o } from '../../style-map-15dde65e.js';
1
+ import { x, T as TailwindStyledElement } from '../../index-be30d9db.js';
2
+ import { n, t } from '../../property-23ddd718.js';
3
+ import { o } from '../../style-map-129fa2d5.js';
4
4
  import '../../directive-2bb7789e.js';
5
5
 
6
6
  const style = ":host {\n display: inline-flex\n}";
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-dda1809d.cjs');
6
- const property = require('../../property-46482bf7.cjs');
7
- const state = require('../../state-94c1d585.cjs');
8
- const styleMap = require('../../style-map-552ab28f.cjs');
5
+ const shared_tailwindElement_index = require('../../index-11ee2a36.cjs');
6
+ const property = require('../../property-c2b27afb.cjs');
7
+ const state = require('../../state-88ac4aa9.cjs');
8
+ const styleMap = require('../../style-map-6e0d4ef7.cjs');
9
9
  const index = require('../../index-2b104ecb.cjs');
10
10
  require('../../directive-8278ab14.cjs');
11
11
 
@@ -1,7 +1,7 @@
1
- import { a as TailwindElement, x } from '../../index-86a3fdc1.js';
2
- import { n, t } from '../../property-140ef335.js';
3
- import { r } from '../../state-876605e4.js';
4
- import { o } from '../../style-map-15dde65e.js';
1
+ import { a as TailwindElement, x } from '../../index-be30d9db.js';
2
+ import { n, t } from '../../property-23ddd718.js';
3
+ import { r } from '../../state-f46a7e17.js';
4
+ import { o } from '../../style-map-129fa2d5.js';
5
5
  import { c as ce } from '../../index-d14b6a34.js';
6
6
  import '../../directive-2bb7789e.js';
7
7