@lukso/web-components 1.54.0 → 1.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 (63) hide show
  1. package/dist/components/index.cjs +4 -3
  2. package/dist/components/index.js +4 -3
  3. package/dist/components/lukso-button/index.cjs +4 -2567
  4. package/dist/components/lukso-button/index.js +2 -2565
  5. package/dist/components/lukso-card/index.cjs +3 -3
  6. package/dist/components/lukso-card/index.js +3 -3
  7. package/dist/components/lukso-checkbox/index.cjs +1 -1
  8. package/dist/components/lukso-checkbox/index.js +1 -1
  9. package/dist/components/lukso-footer/index.cjs +1 -1
  10. package/dist/components/lukso-footer/index.js +1 -1
  11. package/dist/components/lukso-icon/index.cjs +2 -2
  12. package/dist/components/lukso-icon/index.js +2 -2
  13. package/dist/components/lukso-input/index.cjs +1 -1
  14. package/dist/components/lukso-input/index.js +1 -1
  15. package/dist/components/lukso-modal/index.cjs +1 -1
  16. package/dist/components/lukso-modal/index.js +1 -1
  17. package/dist/components/lukso-navbar/index.cjs +2 -2
  18. package/dist/components/lukso-navbar/index.js +2 -2
  19. package/dist/components/lukso-profile/index.cjs +2 -2
  20. package/dist/components/lukso-profile/index.js +2 -2
  21. package/dist/components/lukso-progress/index.cjs +2 -2
  22. package/dist/components/lukso-progress/index.js +2 -2
  23. package/dist/components/lukso-sanitize/index.cjs +1 -1
  24. package/dist/components/lukso-sanitize/index.js +1 -1
  25. package/dist/components/lukso-search/index.cjs +3 -3
  26. package/dist/components/lukso-search/index.js +3 -3
  27. package/dist/components/lukso-select/index.cjs +127 -41
  28. package/dist/components/lukso-select/index.d.ts +16 -2
  29. package/dist/components/lukso-select/index.d.ts.map +1 -1
  30. package/dist/components/lukso-select/index.js +126 -40
  31. package/dist/components/lukso-select/lukso-select.stories.d.ts +2 -0
  32. package/dist/components/lukso-select/lukso-select.stories.d.ts.map +1 -1
  33. package/dist/components/lukso-share/index.cjs +1 -1
  34. package/dist/components/lukso-share/index.js +1 -1
  35. package/dist/components/lukso-switch/index.cjs +2 -2
  36. package/dist/components/lukso-switch/index.js +2 -2
  37. package/dist/components/lukso-tag/index.cjs +2 -2
  38. package/dist/components/lukso-tag/index.js +2 -2
  39. package/dist/components/lukso-terms/index.cjs +2 -2
  40. package/dist/components/lukso-terms/index.js +2 -2
  41. package/dist/components/lukso-test/index.cjs +1 -1
  42. package/dist/components/lukso-test/index.js +1 -1
  43. package/dist/components/lukso-tooltip/index.cjs +1 -1
  44. package/dist/components/lukso-tooltip/index.js +1 -1
  45. package/dist/components/lukso-username/index.cjs +2 -2
  46. package/dist/components/lukso-username/index.js +2 -2
  47. package/dist/components/lukso-wizard/index.cjs +1 -1
  48. package/dist/components/lukso-wizard/index.js +1 -1
  49. package/dist/{index-97f126f3.cjs → index-21cb1f33.cjs} +1 -1
  50. package/dist/index-3373dd2c.js +39 -0
  51. package/dist/index-534893a1.cjs +46 -0
  52. package/dist/{index-9c2f800a.js → index-b02bfbc3.js} +1 -1
  53. package/dist/index-c55a1069.js +2565 -0
  54. package/dist/index-e8741080.cjs +2567 -0
  55. package/dist/index.cjs +4 -3
  56. package/dist/index.js +4 -3
  57. package/dist/shared/tailwind-element/index.cjs +1 -1
  58. package/dist/shared/tailwind-element/index.js +1 -1
  59. package/dist/{style-map-d0fa91c8.js → style-map-04ec407e.js} +1 -1
  60. package/dist/{style-map-a31b1d87.cjs → style-map-beffabf7.cjs} +1 -1
  61. package/package.json +1 -1
  62. package/dist/index-122da399.js +0 -39
  63. package/dist/index-f25fc3ea.cjs +0 -46
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-f25fc3ea.cjs');
5
+ const shared_tailwindElement_index = require('../../index-534893a1.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
7
- const styleMap = require('../../style-map-a31b1d87.cjs');
7
+ const styleMap = require('../../style-map-beffabf7.cjs');
8
8
  require('../lukso-profile/index.cjs');
9
9
  require('../../tailwind-config.cjs');
10
10
  const cn = require('../../cn-4ec0bd94.cjs');
11
- const index = require('../../index-97f126f3.cjs');
11
+ const index = require('../../index-21cb1f33.cjs');
12
12
  require('../../directive-8278ab14.cjs');
13
13
  require('../../index-e9668573.cjs');
14
14
 
@@ -1,10 +1,10 @@
1
- import { T as TailwindStyledElement, x } from '../../index-122da399.js';
1
+ import { T as TailwindStyledElement, x } from '../../index-3373dd2c.js';
2
2
  import { n, e } from '../../query-assigned-elements-5d94572f.js';
3
- import { o } from '../../style-map-d0fa91c8.js';
3
+ import { o } from '../../style-map-04ec407e.js';
4
4
  import '../lukso-profile/index.js';
5
5
  import '../../tailwind-config.js';
6
6
  import { c as cn } from '../../cn-616567d4.js';
7
- import { c as customStyleMap } from '../../index-9c2f800a.js';
7
+ import { c as customStyleMap } from '../../index-b02bfbc3.js';
8
8
  import '../../directive-2bb7789e.js';
9
9
  import '../../index-5e194caf.js';
10
10
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-f25fc3ea.cjs');
5
+ const shared_tailwindElement_index = require('../../index-534893a1.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
7
7
  const state = require('../../state-f73a8b4f.cjs');
8
8
  const index = require('../../index-e9668573.cjs');
@@ -1,4 +1,4 @@
1
- import { a as TailwindElement, x, A } from '../../index-122da399.js';
1
+ import { a as TailwindElement, x, A } from '../../index-3373dd2c.js';
2
2
  import { n, e } from '../../query-assigned-elements-5d94572f.js';
3
3
  import { t } from '../../state-0a779257.js';
4
4
  import { c as customClassMap } from '../../index-5e194caf.js';
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-f25fc3ea.cjs');
5
+ const shared_tailwindElement_index = require('../../index-534893a1.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
7
7
 
8
8
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- import { a as TailwindElement, x } from '../../index-122da399.js';
1
+ import { a as TailwindElement, x } from '../../index-3373dd2c.js';
2
2
  import { n, e } from '../../query-assigned-elements-5d94572f.js';
3
3
 
4
4
  var __defProp = Object.defineProperty;
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-f25fc3ea.cjs');
5
+ const shared_tailwindElement_index = require('../../index-534893a1.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
7
- const styleMap = require('../../style-map-a31b1d87.cjs');
7
+ const styleMap = require('../../style-map-beffabf7.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-122da399.js';
1
+ import { x, T as TailwindStyledElement } from '../../index-3373dd2c.js';
2
2
  import { n, e } from '../../query-assigned-elements-5d94572f.js';
3
- import { o } from '../../style-map-d0fa91c8.js';
3
+ import { o } from '../../style-map-04ec407e.js';
4
4
  import '../../directive-2bb7789e.js';
5
5
 
6
6
  const style = ":host {\n display: inline-flex\n}";
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-f25fc3ea.cjs');
5
+ const shared_tailwindElement_index = require('../../index-534893a1.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
7
7
  const state = require('../../state-f73a8b4f.cjs');
8
8
  const index = require('../../index-e9668573.cjs');
@@ -1,4 +1,4 @@
1
- import { a as TailwindElement, x, A } from '../../index-122da399.js';
1
+ import { a as TailwindElement, x, A } from '../../index-3373dd2c.js';
2
2
  import { n, e } from '../../query-assigned-elements-5d94572f.js';
3
3
  import { t } from '../../state-0a779257.js';
4
4
  import { c as customClassMap } from '../../index-5e194caf.js';
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-f25fc3ea.cjs');
5
+ const shared_tailwindElement_index = require('../../index-534893a1.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
7
7
  const index = require('../../index-e9668573.cjs');
8
8
  require('../../directive-8278ab14.cjs');
@@ -1,4 +1,4 @@
1
- import { a as TailwindElement, x } from '../../index-122da399.js';
1
+ import { a as TailwindElement, x } from '../../index-3373dd2c.js';
2
2
  import { n, e } from '../../query-assigned-elements-5d94572f.js';
3
3
  import { c as customClassMap } from '../../index-5e194caf.js';
4
4
  import '../../directive-2bb7789e.js';
@@ -2,14 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-f25fc3ea.cjs');
5
+ const shared_tailwindElement_index = require('../../index-534893a1.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
7
7
  const state = require('../../state-f73a8b4f.cjs');
8
8
  const index = require('../../index-e9668573.cjs');
9
9
  require('../lukso-icon/index.cjs');
10
10
  require('../lukso-tag/index.cjs');
11
11
  require('../../directive-8278ab14.cjs');
12
- require('../../style-map-a31b1d87.cjs');
12
+ require('../../style-map-beffabf7.cjs');
13
13
 
14
14
  var __defProp = Object.defineProperty;
15
15
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,11 +1,11 @@
1
- import { a as TailwindElement, x } from '../../index-122da399.js';
1
+ import { a as TailwindElement, x } from '../../index-3373dd2c.js';
2
2
  import { n, e } from '../../query-assigned-elements-5d94572f.js';
3
3
  import { t } from '../../state-0a779257.js';
4
4
  import { c as customClassMap } from '../../index-5e194caf.js';
5
5
  import '../lukso-icon/index.js';
6
6
  import '../lukso-tag/index.js';
7
7
  import '../../directive-2bb7789e.js';
8
- import '../../style-map-d0fa91c8.js';
8
+ import '../../style-map-04ec407e.js';
9
9
 
10
10
  var __defProp = Object.defineProperty;
11
11
  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-f25fc3ea.cjs');
5
+ const shared_tailwindElement_index = require('../../index-534893a1.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
7
- const styleMap = require('../../style-map-a31b1d87.cjs');
7
+ const styleMap = require('../../style-map-beffabf7.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 } from '../../index-122da399.js';
1
+ import { a as TailwindElement, x } from '../../index-3373dd2c.js';
2
2
  import { n, e } from '../../query-assigned-elements-5d94572f.js';
3
- import { o } from '../../style-map-d0fa91c8.js';
3
+ import { o } from '../../style-map-04ec407e.js';
4
4
  import { c as customClassMap } from '../../index-5e194caf.js';
5
5
  import '../../directive-2bb7789e.js';
6
6
 
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-f25fc3ea.cjs');
5
+ const shared_tailwindElement_index = require('../../index-534893a1.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
7
- const styleMap = require('../../style-map-a31b1d87.cjs');
7
+ const styleMap = require('../../style-map-beffabf7.cjs');
8
8
  require('../../tailwind-config.cjs');
9
9
  const cn = require('../../cn-4ec0bd94.cjs');
10
10
  require('../../directive-8278ab14.cjs');
@@ -1,6 +1,6 @@
1
- import { a as TailwindElement, x } from '../../index-122da399.js';
1
+ import { a as TailwindElement, x } from '../../index-3373dd2c.js';
2
2
  import { n, e } from '../../query-assigned-elements-5d94572f.js';
3
- import { o } from '../../style-map-d0fa91c8.js';
3
+ import { o } from '../../style-map-04ec407e.js';
4
4
  import '../../tailwind-config.js';
5
5
  import { c as cn } from '../../cn-616567d4.js';
6
6
  import '../../directive-2bb7789e.js';
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-f25fc3ea.cjs');
5
+ const shared_tailwindElement_index = require('../../index-534893a1.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
7
7
  const directive = require('../../directive-8278ab14.cjs');
8
8
 
@@ -1,4 +1,4 @@
1
- import { A, b as T, a as TailwindElement, x } from '../../index-122da399.js';
1
+ import { A, b as T, a as TailwindElement, x } from '../../index-3373dd2c.js';
2
2
  import { n, e as e$2 } from '../../query-assigned-elements-5d94572f.js';
3
3
  import { i, t, e as e$1 } from '../../directive-2bb7789e.js';
4
4
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-f25fc3ea.cjs');
5
+ const shared_tailwindElement_index = require('../../index-534893a1.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
7
7
  const state = require('../../state-f73a8b4f.cjs');
8
8
  const index = require('../../index-e9668573.cjs');
@@ -10,8 +10,8 @@ require('../lukso-icon/index.cjs');
10
10
  require('../lukso-profile/index.cjs');
11
11
  require('../lukso-username/index.cjs');
12
12
  require('../../directive-8278ab14.cjs');
13
- require('../../style-map-a31b1d87.cjs');
14
- require('../../index-97f126f3.cjs');
13
+ require('../../style-map-beffabf7.cjs');
14
+ require('../../index-21cb1f33.cjs');
15
15
 
16
16
  const style = ":host {\n\n display: inline-flex\n}\n\n:host([is-full-width]) {\n\n display: flex;\n\n width: 100%\n}";
17
17
 
@@ -1,4 +1,4 @@
1
- import { T as TailwindStyledElement, x, A } from '../../index-122da399.js';
1
+ import { T as TailwindStyledElement, x, A } from '../../index-3373dd2c.js';
2
2
  import { n, e } from '../../query-assigned-elements-5d94572f.js';
3
3
  import { t } from '../../state-0a779257.js';
4
4
  import { c as customClassMap } from '../../index-5e194caf.js';
@@ -6,8 +6,8 @@ import '../lukso-icon/index.js';
6
6
  import '../lukso-profile/index.js';
7
7
  import '../lukso-username/index.js';
8
8
  import '../../directive-2bb7789e.js';
9
- import '../../style-map-d0fa91c8.js';
10
- import '../../index-9c2f800a.js';
9
+ import '../../style-map-04ec407e.js';
10
+ import '../../index-b02bfbc3.js';
11
11
 
12
12
  const style = ":host {\n\n display: inline-flex\n}\n\n:host([is-full-width]) {\n\n display: flex;\n\n width: 100%\n}";
13
13
 
@@ -2,16 +2,17 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-f25fc3ea.cjs');
5
+ const shared_tailwindElement_index = require('../../index-534893a1.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
7
7
  const state = require('../../state-f73a8b4f.cjs');
8
- const index = require('../../index-e9668573.cjs');
8
+ const index = require('../../index-e8741080.cjs');
9
9
  require('../lukso-icon/index.cjs');
10
10
  require('../lukso-profile/index.cjs');
11
11
  require('../lukso-username/index.cjs');
12
+ require('../../style-map-beffabf7.cjs');
12
13
  require('../../directive-8278ab14.cjs');
13
- require('../../style-map-a31b1d87.cjs');
14
- require('../../index-97f126f3.cjs');
14
+ require('../../index-e9668573.cjs');
15
+ require('../../index-21cb1f33.cjs');
15
16
 
16
17
  const style = ":host {\n\n display: inline-flex\n}\n\n:host([is-full-width]) {\n\n display: flex;\n\n width: 100%\n}";
17
18
 
@@ -43,11 +44,62 @@ exports.LuksoSelect = class LuksoSelect extends shared_tailwindElement_index.Tai
43
44
  this.selected = void 0;
44
45
  this.isOpen = false;
45
46
  this.openTop = false;
47
+ this.isLargeIcon = false;
46
48
  this.optionsParsed = [];
47
49
  this.valueParsed = void 0;
48
- this.defaultInputStyles = `bg-neutral-100 paragraph-inter-14-regular px-4 py-3 pr-11
49
- border-solid h-[48px] placeholder:text-neutral-70 select-none whitespace-nowrap
50
- outline-none transition transition-all duration-150 appearance-none rounded-12`;
50
+ this.inputStyles = index.se({
51
+ base: `bg-neutral-100 paragraph-inter-14-regular px-4 py-3 pr-11
52
+ border border-solid h-[48px] placeholder:text-neutral-70 select-none whitespace-nowrap
53
+ outline-none transition transition-all duration-150 appearance-none rounded-12
54
+ text-neutral-20 cursor-pointer border-neutral-90 group-hover:border-neutral-35
55
+ flex items-center`,
56
+ variants: {
57
+ isFullWidth: {
58
+ true: `w-full`
59
+ },
60
+ isDisabled: {
61
+ true: `cursor-not-allowed text-neutral-60 group-hover:border-neutral-90`
62
+ },
63
+ hasError: {
64
+ true: `border-red-85 group-hover:border-red-65`
65
+ },
66
+ borderless: {
67
+ true: `border-0`
68
+ }
69
+ }
70
+ });
71
+ this.dropdownWrapperStyles = index.se({
72
+ base: `bg-neutral-100 border w-full border-neutral-90 shadow-1xl rounded-12 p-3 z-50
73
+ flex absolute flex-col gap-1 overflow-y-auto max-h-64 mt-2`,
74
+ variants: {
75
+ openTop: {
76
+ true: `bottom-[48px] mb-2 mt-0`
77
+ }
78
+ }
79
+ });
80
+ this.optionsStyles = index.se({
81
+ base: `paragraph-inter-14-regular text-neutral-20 cursor-pointer rounded-8 p-2
82
+ whitespace-nowrap hover:bg-neutral-98 flex items-center`,
83
+ variants: {
84
+ isSelected: {
85
+ true: `bg-neutral-95 hover:bg-neutral-95`
86
+ },
87
+ isActive: {
88
+ true: `bg-neutral-98`
89
+ }
90
+ }
91
+ });
92
+ this.iconStyles = index.se({
93
+ base: `absolute right-0 mr-3 transition cursor-pointer`,
94
+ variants: {
95
+ isDisabled: {
96
+ true: `opacity-60 cursor-not-allowed`
97
+ },
98
+ isOpen: {
99
+ true: `rotate-180`
100
+ }
101
+ }
102
+ });
51
103
  }
52
104
  connectedCallback() {
53
105
  super.connectedCallback();
@@ -91,19 +143,17 @@ exports.LuksoSelect = class LuksoSelect extends shared_tailwindElement_index.Tai
91
143
  }
92
144
  }
93
145
  inputTemplate() {
146
+ const inputStyles = this.inputStyles({
147
+ isFullWidth: this.isFullWidth,
148
+ isDisabled: this.isDisabled,
149
+ hasError: !!this.error,
150
+ borderless: this.borderless
151
+ });
94
152
  return shared_tailwindElement_index.x`
95
153
  <div
96
154
  id=${this.id}
97
155
  data-testid=${this.id ? `select-${this.id}` : "select"}
98
- class=${index.customClassMap({
99
- [this.defaultInputStyles]: true,
100
- ["border-neutral-90 group-hover:border-neutral-35"]: !!!this.error && !this.isDisabled,
101
- ["border-red-85 group-hover:border-red-65"]: !!this.error,
102
- ["w-full"]: this.isFullWidth,
103
- ["cursor-not-allowed text-neutral-60"]: this.isDisabled,
104
- ["text-neutral-20 cursor-pointer"]: !this.isDisabled,
105
- [this.borderless ? "border-0" : "border"]: true
106
- })}
156
+ class=${inputStyles}
107
157
  @blur=${this.handleBlur}
108
158
  @click=${this.handleClick}
109
159
  >
@@ -136,6 +186,8 @@ exports.LuksoSelect = class LuksoSelect extends shared_tailwindElement_index.Tai
136
186
  const index = Number(option[0]);
137
187
  if ("value" in option[1]) {
138
188
  optionTemplates.push(this.optionStringTemplate(option[1], index));
189
+ } else if ("address" in option[1]) {
190
+ optionTemplates.push(this.optionProfileTemplate(option[1], index));
139
191
  } else {
140
192
  console.error("Unknown option type", option);
141
193
  }
@@ -143,40 +195,71 @@ exports.LuksoSelect = class LuksoSelect extends shared_tailwindElement_index.Tai
143
195
  return shared_tailwindElement_index.x`${this.dropdownWrapperTemplate(optionTemplates)}`;
144
196
  }
145
197
  dropdownWrapperTemplate(innerTemplate) {
198
+ const dropdownWrapperStyles = this.dropdownWrapperStyles({
199
+ openTop: this.openTop
200
+ });
201
+ return shared_tailwindElement_index.x`<div class="${dropdownWrapperStyles}">${innerTemplate}</div>`;
202
+ }
203
+ optionStringTemplate(option, index) {
204
+ const optionsStyles = this.optionsStyles({
205
+ isSelected: this.valueParsed?.id === option.id,
206
+ isActive: this.selected === index + 1 && this.valueParsed?.id !== option.id
207
+ });
146
208
  return shared_tailwindElement_index.x`<div
147
- class="bg-neutral-100 border w-full border-neutral-90 shadow-1xl rounded-12 p-3 z-50 flex absolute flex-col gap-1 overflow-y-auto max-h-64 ${index.customClassMap(
148
- {
149
- ["bottom-[48px] mb-2"]: this.openTop,
150
- ["mt-2"]: !this.openTop
151
- }
152
- )}
153
- )}"
209
+ data-id="${option.id}"
210
+ data-index="${index + 1}"
211
+ class="${optionsStyles}"
212
+ @click=${() => this.handleSelect(option)}
154
213
  >
155
- ${innerTemplate}
214
+ ${this.optionStringValue(option)}
156
215
  </div>`;
157
216
  }
158
- optionStringTemplate(option, index$1) {
217
+ optionProfileTemplate(option, index) {
218
+ const optionsStyles = this.optionsStyles({
219
+ isSelected: this.valueParsed?.id === option.id,
220
+ isActive: this.selected === index + 1 && this.valueParsed?.id !== option.id
221
+ });
159
222
  return shared_tailwindElement_index.x`<div
160
223
  data-id="${option.id}"
161
- data-index="${index$1 + 1}"
162
- class="paragraph-inter-14-regular text-neutral-20 cursor-pointer rounded-8 p-2 whitespace-nowrap ${index.customClassMap(
163
- {
164
- ["bg-neutral-95 hover:bg-neutral-95"]: this.valueParsed?.id === option.id,
165
- ["bg-neutral-98"]: this.selected === index$1 + 1 && this.valueParsed?.id !== option.id,
166
- ["hover:bg-neutral-98"]: this.valueParsed?.id !== option.id
167
- }
168
- )}"
224
+ data-index="${index + 1}"
225
+ class="${optionsStyles}"
169
226
  @click=${() => this.handleSelect(option)}
170
227
  >
171
- ${option.value}
228
+ ${this.optionProfileValue(option)}
172
229
  </div>`;
173
230
  }
231
+ optionStringValue(option) {
232
+ return option.value;
233
+ }
234
+ optionProfileValue(option) {
235
+ return shared_tailwindElement_index.x`<lukso-profile
236
+ profile-address="${option.address}"
237
+ profile-url="${option.image}"
238
+ size="x-small"
239
+ has-identicon
240
+ class="mr-2"
241
+ ></lukso-profile>
242
+ <lukso-username
243
+ name="${option.name?.toLowerCase()}"
244
+ address="${option.address}"
245
+ name-color="neutral-20"
246
+ max-width="150"
247
+ slice-by="4"
248
+ size="medium"
249
+ ></lukso-username>`;
250
+ }
174
251
  selectedValue() {
175
252
  const foundValue = this.optionsParsed.find(
176
253
  (option) => option.id === this.valueParsed?.id
177
254
  );
178
255
  if (foundValue) {
179
- return foundValue.value;
256
+ if ("value" in foundValue) {
257
+ return this.optionStringValue(foundValue);
258
+ } else if ("address" in foundValue) {
259
+ return this.optionProfileValue(foundValue);
260
+ } else {
261
+ console.error("Unknown value type", foundValue);
262
+ }
180
263
  }
181
264
  return "";
182
265
  }
@@ -242,6 +325,10 @@ exports.LuksoSelect = class LuksoSelect extends shared_tailwindElement_index.Tai
242
325
  this.isOpen = !this.isOpen;
243
326
  }
244
327
  render() {
328
+ const iconStyles = this.iconStyles({
329
+ isDisabled: this.isDisabled,
330
+ isOpen: this.isOpen
331
+ });
245
332
  return shared_tailwindElement_index.x`
246
333
  <div class="relative w-[inherit]">
247
334
  ${this.label ? this.labelTemplate() : shared_tailwindElement_index.A}
@@ -249,12 +336,8 @@ exports.LuksoSelect = class LuksoSelect extends shared_tailwindElement_index.Tai
249
336
  <div class="group">
250
337
  <div class="flex relative items-center">
251
338
  ${this.inputTemplate()}<lukso-icon
252
- name=${this.isFullWidth ? "arrow-down-lg" : "arrow-down-sm"}
253
- class="absolute right-0 mr-3 transition ${index.customClassMap({
254
- ["opacity-60 cursor-not-allowed"]: this.isDisabled,
255
- ["cursor-pointer"]: !this.isDisabled,
256
- ["rotate-180"]: this.isOpen
257
- })}"
339
+ name=${this.isLargeIcon ? "arrow-down-lg" : "arrow-down-sm"}
340
+ class="${iconStyles}"
258
341
  @click=${this.handleClick}
259
342
  ></lukso-icon>
260
343
  </div>
@@ -309,6 +392,9 @@ __decorateClass([
309
392
  __decorateClass([
310
393
  queryAssignedElements.n({ type: Boolean, attribute: "open-top" })
311
394
  ], exports.LuksoSelect.prototype, "openTop", 2);
395
+ __decorateClass([
396
+ queryAssignedElements.n({ type: Boolean, attribute: "is-large-icon" })
397
+ ], exports.LuksoSelect.prototype, "isLargeIcon", 2);
312
398
  __decorateClass([
313
399
  state.t()
314
400
  ], exports.LuksoSelect.prototype, "optionsParsed", 2);
@@ -1,9 +1,16 @@
1
1
  import { PropertyValues, TemplateResult } from 'lit';
2
+ import { Address } from '../../shared/types';
2
3
  export type SelectStringOption = {
3
4
  id?: string;
4
5
  value: string;
5
6
  };
6
- export type SelectOption = SelectStringOption;
7
+ export type SelectProfileOption = {
8
+ id: string;
9
+ address: Address;
10
+ image?: string;
11
+ name?: string;
12
+ };
13
+ export type SelectOption = SelectStringOption | SelectProfileOption;
7
14
  declare const LuksoSelect_base: typeof import("lit").LitElement;
8
15
  export declare class LuksoSelect extends LuksoSelect_base {
9
16
  value: string;
@@ -20,9 +27,13 @@ export declare class LuksoSelect extends LuksoSelect_base {
20
27
  selected: any;
21
28
  isOpen: boolean;
22
29
  openTop: boolean;
30
+ isLargeIcon: boolean;
23
31
  private optionsParsed;
24
32
  private valueParsed;
25
- private defaultInputStyles;
33
+ private inputStyles;
34
+ private dropdownWrapperStyles;
35
+ private optionsStyles;
36
+ private iconStyles;
26
37
  connectedCallback(): void;
27
38
  disconnectedCallback(): void;
28
39
  willUpdate(changedProperties: PropertyValues<this>): void;
@@ -33,6 +44,9 @@ export declare class LuksoSelect extends LuksoSelect_base {
33
44
  optionsTemplate(): TemplateResult<1>;
34
45
  dropdownWrapperTemplate(innerTemplate: TemplateResult<1> | TemplateResult<1>[]): TemplateResult<1>;
35
46
  optionStringTemplate(option: SelectStringOption, index: number): TemplateResult<1>;
47
+ optionProfileTemplate(option: SelectProfileOption, index: number): TemplateResult<1>;
48
+ private optionStringValue;
49
+ private optionProfileValue;
36
50
  private selectedValue;
37
51
  private handleOutsideDropdownClick;
38
52
  private handleDropdownKeydown;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAiB,MAAM,KAAK,CAAA;AAMnE,OAAO,yBAAyB,CAAA;AAChC,OAAO,4BAA4B,CAAA;AACnC,OAAO,6BAA6B,CAAA;AAEpC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,kBAAkB,CAAA;;AAE7C,qBACa,WAAY,SAAQ,gBAA4B;IAE3D,KAAK,SAAK;IAGV,WAAW,SAAK;IAGhB,KAAK,SAAK;IAGV,EAAE,SAAK;IAGP,WAAW,SAAK;IAGhB,KAAK,SAAK;IAGV,WAAW,UAAQ;IAGnB,UAAU,UAAQ;IAGlB,UAAU,UAAQ;IAGlB,UAAU,UAAQ;IAGlB,OAAO,SAAK;IAGZ,QAAQ,MAAY;IAGpB,MAAM,EAAE,OAAO,CAAQ;IAGvB,OAAO,EAAE,OAAO,CAAQ;IAGxB,OAAO,CAAC,aAAa,CAAqB;IAG1C,OAAO,CAAC,WAAW,CAAsC;IAEzD,OAAO,CAAC,kBAAkB,CAEuD;IAEjF,iBAAiB;IAKjB,oBAAoB;IAMpB,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC;IAwClD,aAAa;IAuBb,aAAa;IAQb,mBAAmB;IAQnB,aAAa;IAMb,eAAe;IAgBf,uBAAuB,CACrB,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE;IAexD,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,EAA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