@lukso/web-components 1.34.1 → 1.35.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 (61) hide show
  1. package/dist/components/index.cjs +8 -3
  2. package/dist/components/index.d.ts +1 -0
  3. package/dist/components/index.d.ts.map +1 -1
  4. package/dist/components/index.js +4 -3
  5. package/dist/components/lukso-button/index.cjs +1 -1
  6. package/dist/components/lukso-button/index.js +1 -1
  7. package/dist/components/lukso-card/index.cjs +2 -2
  8. package/dist/components/lukso-card/index.js +2 -2
  9. package/dist/components/lukso-checkbox/index.cjs +1 -1
  10. package/dist/components/lukso-checkbox/index.js +1 -1
  11. package/dist/components/lukso-footer/index.cjs +1 -1
  12. package/dist/components/lukso-footer/index.js +1 -1
  13. package/dist/components/lukso-icon/index.cjs +2 -2
  14. package/dist/components/lukso-icon/index.js +2 -2
  15. package/dist/components/lukso-input/index.cjs +1 -1
  16. package/dist/components/lukso-input/index.js +1 -1
  17. package/dist/components/lukso-modal/index.cjs +1 -1
  18. package/dist/components/lukso-modal/index.js +1 -1
  19. package/dist/components/lukso-navbar/index.cjs +2 -2
  20. package/dist/components/lukso-navbar/index.js +2 -2
  21. package/dist/components/lukso-profile/index.cjs +2 -2
  22. package/dist/components/lukso-profile/index.js +2 -2
  23. package/dist/components/lukso-progress/index.cjs +2 -2
  24. package/dist/components/lukso-progress/index.js +2 -2
  25. package/dist/components/lukso-sanitize/index.cjs +1 -1
  26. package/dist/components/lukso-sanitize/index.js +1 -1
  27. package/dist/components/lukso-search/index.cjs +295 -0
  28. package/dist/components/lukso-search/index.d.ts +56 -0
  29. package/dist/components/lukso-search/index.d.ts.map +1 -0
  30. package/dist/components/lukso-search/index.js +293 -0
  31. package/dist/components/lukso-search/lukso-search.stories.d.ts +9 -0
  32. package/dist/components/lukso-search/lukso-search.stories.d.ts.map +1 -0
  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 +2 -2
  42. package/dist/components/lukso-test/index.js +2 -2
  43. package/dist/components/lukso-username/index.cjs +6 -3
  44. package/dist/components/lukso-username/index.d.ts +4 -3
  45. package/dist/components/lukso-username/index.d.ts.map +1 -1
  46. package/dist/components/lukso-username/index.js +6 -3
  47. package/dist/components/lukso-wizard/index.cjs +2 -2
  48. package/dist/components/lukso-wizard/index.js +2 -2
  49. package/dist/{directive-helpers-37d4e781.js → directive-helpers-2de20c85.js} +1 -1
  50. package/dist/{directive-helpers-68634886.cjs → directive-helpers-ac1c0bc1.cjs} +1 -1
  51. package/dist/index-3027d420.cjs +67 -0
  52. package/dist/index-e65ce6e8.js +59 -0
  53. package/dist/index.cjs +8 -3
  54. package/dist/index.js +4 -3
  55. package/dist/shared/tailwind-element/index.cjs +1 -1
  56. package/dist/shared/tailwind-element/index.js +1 -1
  57. package/dist/{style-map-ecda466c.js → style-map-0a64ef32.js} +1 -1
  58. package/dist/{style-map-13efc961.cjs → style-map-52b1e12c.cjs} +1 -1
  59. package/package.json +6 -1
  60. package/dist/index-62273515.cjs +0 -67
  61. package/dist/index-9362dc77.js +0 -59
@@ -13,6 +13,7 @@ const components_luksoNavbar_index = require('./lukso-navbar/index.cjs');
13
13
  const components_luksoProfile_index = require('./lukso-profile/index.cjs');
14
14
  const components_luksoProgress_index = require('./lukso-progress/index.cjs');
15
15
  const components_luksoSanitize_index = require('./lukso-sanitize/index.cjs');
16
+ const components_luksoSearch_index = require('./lukso-search/index.cjs');
16
17
  const components_luksoShare_index = require('./lukso-share/index.cjs');
17
18
  const components_luksoSwitch_index = require('./lukso-switch/index.cjs');
18
19
  const components_luksoTag_index = require('./lukso-tag/index.cjs');
@@ -20,12 +21,12 @@ const components_luksoTerms_index = require('./lukso-terms/index.cjs');
20
21
  const components_luksoTest_index = require('./lukso-test/index.cjs');
21
22
  const components_luksoUsername_index = require('./lukso-username/index.cjs');
22
23
  const components_luksoWizard_index = require('./lukso-wizard/index.cjs');
23
- const shared_tailwindElement_index = require('../index-62273515.cjs');
24
+ const shared_tailwindElement_index = require('../index-3027d420.cjs');
24
25
  require('../directive-db00f5fb.cjs');
25
26
  require('../state-a62a7d5d.cjs');
26
27
  require('../index-7dc05ee5.cjs');
27
- require('../style-map-13efc961.cjs');
28
- require('../directive-helpers-68634886.cjs');
28
+ require('../style-map-52b1e12c.cjs');
29
+ require('../directive-helpers-ac1c0bc1.cjs');
29
30
 
30
31
 
31
32
 
@@ -73,6 +74,10 @@ Object.defineProperty(exports, 'LuksoSanitize', {
73
74
  enumerable: true,
74
75
  get: () => components_luksoSanitize_index.LuksoSanitize
75
76
  });
77
+ Object.defineProperty(exports, 'LuksoSearch', {
78
+ enumerable: true,
79
+ get: () => components_luksoSearch_index.LuksoSearch
80
+ });
76
81
  Object.defineProperty(exports, 'LuksoShare', {
77
82
  enumerable: true,
78
83
  get: () => components_luksoShare_index.LuksoShare
@@ -9,6 +9,7 @@ export * from './lukso-navbar/index';
9
9
  export * from './lukso-profile/index';
10
10
  export * from './lukso-progress/index';
11
11
  export * from './lukso-sanitize/index';
12
+ export * from './lukso-search/index';
12
13
  export * from './lukso-share/index';
13
14
  export * from './lukso-switch/index';
14
15
  export * from './lukso-tag/index';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA"}
@@ -9,6 +9,7 @@ export { LuksoNavbar } from './lukso-navbar/index.js';
9
9
  export { LuksoProfile } from './lukso-profile/index.js';
10
10
  export { LuksoProgress } from './lukso-progress/index.js';
11
11
  export { LuksoSanitize } from './lukso-sanitize/index.js';
12
+ export { LuksoSearch } from './lukso-search/index.js';
12
13
  export { LuksoShare } from './lukso-share/index.js';
13
14
  export { LuksoSwitch } from './lukso-switch/index.js';
14
15
  export { LuksoTag } from './lukso-tag/index.js';
@@ -16,9 +17,9 @@ export { LuksoTerms } from './lukso-terms/index.js';
16
17
  export { LuksoTest } from './lukso-test/index.js';
17
18
  export { LuksoUsername } from './lukso-username/index.js';
18
19
  export { LuksoWizard } from './lukso-wizard/index.js';
19
- export { a as TailwindElement, T as TailwindStyledElement } from '../index-9362dc77.js';
20
+ export { a as TailwindElement, T as TailwindStyledElement } from '../index-e65ce6e8.js';
20
21
  import '../directive-9ec64c08.js';
21
22
  import '../state-7fde94d1.js';
22
23
  import '../index-714323c9.js';
23
- import '../style-map-ecda466c.js';
24
- import '../directive-helpers-37d4e781.js';
24
+ import '../style-map-0a64ef32.js';
25
+ import '../directive-helpers-2de20c85.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-62273515.cjs');
5
+ const shared_tailwindElement_index = require('../../index-3027d420.cjs');
6
6
  const directive = require('../../directive-db00f5fb.cjs');
7
7
  const state = require('../../state-a62a7d5d.cjs');
8
8
  const index = require('../../index-7dc05ee5.cjs');
@@ -1,4 +1,4 @@
1
- import { T as TailwindStyledElement, x } from '../../index-9362dc77.js';
1
+ import { T as TailwindStyledElement, x } from '../../index-e65ce6e8.js';
2
2
  import { e, a as e$1 } from '../../directive-9ec64c08.js';
3
3
  import { t } from '../../state-7fde94d1.js';
4
4
  import { c as customClassMap } from '../../index-714323c9.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-62273515.cjs');
5
+ const shared_tailwindElement_index = require('../../index-3027d420.cjs');
6
6
  const directive = require('../../directive-db00f5fb.cjs');
7
- const styleMap = require('../../style-map-13efc961.cjs');
7
+ const styleMap = require('../../style-map-52b1e12c.cjs');
8
8
  const index = require('../../index-7dc05ee5.cjs');
9
9
  require('../lukso-profile/index.cjs');
10
10
 
@@ -1,6 +1,6 @@
1
- import { T as TailwindStyledElement, x } from '../../index-9362dc77.js';
1
+ import { T as TailwindStyledElement, x } from '../../index-e65ce6e8.js';
2
2
  import { e, a as e$1 } from '../../directive-9ec64c08.js';
3
- import { o } from '../../style-map-ecda466c.js';
3
+ import { o } from '../../style-map-0a64ef32.js';
4
4
  import { c as customClassMap } from '../../index-714323c9.js';
5
5
  import '../lukso-profile/index.js';
6
6
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-62273515.cjs');
5
+ const shared_tailwindElement_index = require('../../index-3027d420.cjs');
6
6
  const directive = require('../../directive-db00f5fb.cjs');
7
7
  const state = require('../../state-a62a7d5d.cjs');
8
8
  const index = require('../../index-7dc05ee5.cjs');
@@ -1,4 +1,4 @@
1
- import { a as TailwindElement, x, A } from '../../index-9362dc77.js';
1
+ import { a as TailwindElement, x, A } from '../../index-e65ce6e8.js';
2
2
  import { e, a as e$1 } from '../../directive-9ec64c08.js';
3
3
  import { t } from '../../state-7fde94d1.js';
4
4
  import { c as customClassMap } from '../../index-714323c9.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-62273515.cjs');
5
+ const shared_tailwindElement_index = require('../../index-3027d420.cjs');
6
6
  const directive = require('../../directive-db00f5fb.cjs');
7
7
  require('../lukso-share/index.cjs');
8
8
  require('../../index-7dc05ee5.cjs');
@@ -1,4 +1,4 @@
1
- import { a as TailwindElement, x } from '../../index-9362dc77.js';
1
+ import { a as TailwindElement, x } from '../../index-e65ce6e8.js';
2
2
  import { a as e } from '../../directive-9ec64c08.js';
3
3
  import '../lukso-share/index.js';
4
4
  import '../../index-714323c9.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-62273515.cjs');
5
+ const shared_tailwindElement_index = require('../../index-3027d420.cjs');
6
6
  const directive = require('../../directive-db00f5fb.cjs');
7
- const styleMap = require('../../style-map-13efc961.cjs');
7
+ const styleMap = require('../../style-map-52b1e12c.cjs');
8
8
 
9
9
  const style = ":host {\n display: inline-flex\n}";
10
10
 
@@ -1,6 +1,6 @@
1
- import { x, T as TailwindStyledElement } from '../../index-9362dc77.js';
1
+ import { x, T as TailwindStyledElement } from '../../index-e65ce6e8.js';
2
2
  import { e, a as e$1 } from '../../directive-9ec64c08.js';
3
- import { o } from '../../style-map-ecda466c.js';
3
+ import { o } from '../../style-map-0a64ef32.js';
4
4
 
5
5
  const style = ":host {\n display: inline-flex\n}";
6
6
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-62273515.cjs');
5
+ const shared_tailwindElement_index = require('../../index-3027d420.cjs');
6
6
  const directive = require('../../directive-db00f5fb.cjs');
7
7
  const state = require('../../state-a62a7d5d.cjs');
8
8
  const index = require('../../index-7dc05ee5.cjs');
@@ -1,4 +1,4 @@
1
- import { a as TailwindElement, x, A } from '../../index-9362dc77.js';
1
+ import { a as TailwindElement, x, A } from '../../index-e65ce6e8.js';
2
2
  import { e, a as e$1 } from '../../directive-9ec64c08.js';
3
3
  import { t } from '../../state-7fde94d1.js';
4
4
  import { c as customClassMap } from '../../index-714323c9.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-62273515.cjs');
5
+ const shared_tailwindElement_index = require('../../index-3027d420.cjs');
6
6
  const directive = require('../../directive-db00f5fb.cjs');
7
7
  const index = require('../../index-7dc05ee5.cjs');
8
8
 
@@ -1,4 +1,4 @@
1
- import { a as TailwindElement, x } from '../../index-9362dc77.js';
1
+ import { a as TailwindElement, x } from '../../index-e65ce6e8.js';
2
2
  import { e, a as e$1 } from '../../directive-9ec64c08.js';
3
3
  import { c as customClassMap } from '../../index-714323c9.js';
4
4
 
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-62273515.cjs');
5
+ const shared_tailwindElement_index = require('../../index-3027d420.cjs');
6
6
  const directive = require('../../directive-db00f5fb.cjs');
7
7
  const state = require('../../state-a62a7d5d.cjs');
8
8
  const index = require('../../index-7dc05ee5.cjs');
9
9
  require('../lukso-icon/index.cjs');
10
10
  require('../lukso-tag/index.cjs');
11
- require('../../style-map-13efc961.cjs');
11
+ require('../../style-map-52b1e12c.cjs');
12
12
 
13
13
  var __defProp = Object.defineProperty;
14
14
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,10 +1,10 @@
1
- import { a as TailwindElement, x } from '../../index-9362dc77.js';
1
+ import { a as TailwindElement, x } from '../../index-e65ce6e8.js';
2
2
  import { e, a as e$1 } from '../../directive-9ec64c08.js';
3
3
  import { t } from '../../state-7fde94d1.js';
4
4
  import { c as customClassMap } from '../../index-714323c9.js';
5
5
  import '../lukso-icon/index.js';
6
6
  import '../lukso-tag/index.js';
7
- import '../../style-map-ecda466c.js';
7
+ import '../../style-map-0a64ef32.js';
8
8
 
9
9
  var __defProp = Object.defineProperty;
10
10
  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-62273515.cjs');
5
+ const shared_tailwindElement_index = require('../../index-3027d420.cjs');
6
6
  const directive = require('../../directive-db00f5fb.cjs');
7
- const styleMap = require('../../style-map-13efc961.cjs');
7
+ const styleMap = require('../../style-map-52b1e12c.cjs');
8
8
 
9
9
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
10
10
 
@@ -1,6 +1,6 @@
1
- import { a as TailwindElement, x } from '../../index-9362dc77.js';
1
+ import { a as TailwindElement, x } from '../../index-e65ce6e8.js';
2
2
  import { e, a as e$1 } from '../../directive-9ec64c08.js';
3
- import { o } from '../../style-map-ecda466c.js';
3
+ import { o } from '../../style-map-0a64ef32.js';
4
4
 
5
5
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
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-62273515.cjs');
5
+ const shared_tailwindElement_index = require('../../index-3027d420.cjs');
6
6
  const directive = require('../../directive-db00f5fb.cjs');
7
- const styleMap = require('../../style-map-13efc961.cjs');
7
+ const styleMap = require('../../style-map-52b1e12c.cjs');
8
8
  const index = require('../../index-7dc05ee5.cjs');
9
9
 
10
10
  var __defProp = Object.defineProperty;
@@ -1,6 +1,6 @@
1
- import { a as TailwindElement, x } from '../../index-9362dc77.js';
1
+ import { a as TailwindElement, x } from '../../index-e65ce6e8.js';
2
2
  import { e, a as e$1 } from '../../directive-9ec64c08.js';
3
- import { o } from '../../style-map-ecda466c.js';
3
+ import { o } from '../../style-map-0a64ef32.js';
4
4
  import { c as customClassMap } from '../../index-714323c9.js';
5
5
 
6
6
  var __defProp = Object.defineProperty;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-62273515.cjs');
5
+ const shared_tailwindElement_index = require('../../index-3027d420.cjs');
6
6
  const directive = require('../../directive-db00f5fb.cjs');
7
7
 
8
8
  /**
@@ -1,4 +1,4 @@
1
- import { c as A, b as T, a as TailwindElement, x } from '../../index-9362dc77.js';
1
+ import { c as A, b as T, a as TailwindElement, x } from '../../index-e65ce6e8.js';
2
2
  import { i, t, b as e$1, e as e$2, a as e$3 } from '../../directive-9ec64c08.js';
3
3
 
4
4
  /**
@@ -0,0 +1,295 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const shared_tailwindElement_index = require('../../index-3027d420.cjs');
6
+ const directive = require('../../directive-db00f5fb.cjs');
7
+ const state = require('../../state-a62a7d5d.cjs');
8
+ const index = require('../../index-7dc05ee5.cjs');
9
+ require('../lukso-icon/index.cjs');
10
+ require('../lukso-profile/index.cjs');
11
+ require('../lukso-username/index.cjs');
12
+ require('../../style-map-52b1e12c.cjs');
13
+
14
+ const style = ":host {\n\n display: inline-flex\n}\n\n:host([is-full-width]) {\n\n display: flex;\n\n width: 100%\n}";
15
+
16
+ var __defProp = Object.defineProperty;
17
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
18
+ var __decorateClass = (decorators, target, key, kind) => {
19
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
20
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
21
+ if (decorator = decorators[i])
22
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
23
+ if (kind && result)
24
+ __defProp(target, key, result);
25
+ return result;
26
+ };
27
+ exports.LuksoSearch = class LuksoSearch extends shared_tailwindElement_index.TailwindStyledElement(style) {
28
+ constructor() {
29
+ super(...arguments);
30
+ this.value = "";
31
+ this.name = "";
32
+ this.type = "text";
33
+ this.placeholder = "";
34
+ this.label = "";
35
+ this.autocomplete = "off";
36
+ this.id = "";
37
+ this.description = "";
38
+ this.error = "";
39
+ this.customClass = "";
40
+ this.isFullWidth = false;
41
+ this.isReadonly = false;
42
+ this.isDisabled = false;
43
+ this.autofocus = false;
44
+ this.borderless = false;
45
+ this.results = "";
46
+ this.debounce = 700;
47
+ this.hasHocus = false;
48
+ this.hasHighlight = false;
49
+ this.isSearching = false;
50
+ this.defaultInputStyles = `bg-neutral-100 paragraph-inter-14-regular px-4 py-3 pr-10
51
+ border-solid h-[48px] placeholder:text-neutral-70
52
+ outline-none transition transition-all duration-150 appearance-none rounded-12`;
53
+ }
54
+ inputTemplate() {
55
+ return shared_tailwindElement_index.x`
56
+ <input
57
+ name=${this.name}
58
+ type=${this.type}
59
+ .value=${this.value}
60
+ placeholder=${this.placeholder}
61
+ ?autofocus=${this.autofocus}
62
+ autocomplete=${this.autocomplete}
63
+ id=${this.id || this.name}
64
+ data-testid=${this.name ? `input-${this.name}` : "input"}
65
+ ?readonly=${this.isReadonly ? true : void 0}
66
+ ?disabled=${this.isDisabled ? true : void 0}
67
+ class=${index.customClassMap({
68
+ [this.defaultInputStyles]: true,
69
+ [this.error === "" ? "border-neutral-90" : "border-red-85"]: !this.hasHighlight,
70
+ [this.error === "" ? "border-neutral-35" : "border-red-65"]: this.hasHighlight,
71
+ ["w-full"]: this.isFullWidth,
72
+ ["w-[350px]"]: !this.isFullWidth,
73
+ ["cursor-not-allowed text-neutral-60"]: this.isDisabled,
74
+ ["text-neutral-20"]: !this.isDisabled,
75
+ ["cursor-not-allowed"]: this.isReadonly,
76
+ [this.customClass]: !!this.customClass,
77
+ [this.borderless ? "border-0" : "border"]: true
78
+ })}
79
+ @focus=${this.handleFocus}
80
+ @input=${this.handleSearch}
81
+ @blur=${this.handleBlur}
82
+ @mouseenter=${this.handleMouseOver}
83
+ @mouseleave=${this.handleMouseOut}
84
+ />
85
+ `;
86
+ }
87
+ labelTemplate() {
88
+ return shared_tailwindElement_index.x`
89
+ <label
90
+ for=${this.name}
91
+ class="heading-inter-14-bold text-neutral-20 pb-2 block"
92
+ >${this.label}</label
93
+ >
94
+ `;
95
+ }
96
+ descriptionTemplate() {
97
+ return shared_tailwindElement_index.x`
98
+ <div class="paragraph-inter-12-regular text-neutral-20 pb-2">
99
+ ${this.description ?? shared_tailwindElement_index.A}
100
+ </div>
101
+ `;
102
+ }
103
+ errorTemplate() {
104
+ return shared_tailwindElement_index.x`<div class="paragraph-inter-12-regular text-red-65 pt-2">
105
+ ${this.error}
106
+ </div>`;
107
+ }
108
+ resultsTemplate() {
109
+ if (this.results === "") {
110
+ return shared_tailwindElement_index.x``;
111
+ }
112
+ const resultTemplates = [];
113
+ const results = JSON.parse(this.results);
114
+ for (const result of Object.entries(results)) {
115
+ if ("value" in result[1]) {
116
+ resultTemplates.push(this.resultStringTemplate(result[1]));
117
+ } else if ("address" in result[1]) {
118
+ resultTemplates.push(this.resultProfileTemplate(result[1]));
119
+ } else {
120
+ console.error("Unknown result type", result);
121
+ }
122
+ }
123
+ return shared_tailwindElement_index.x`<div
124
+ class="bg-neutral-100 border border-neutral-90 shadow-1xl rounded-12 p-3 mt-2 z-50 flex absolute w-full flex-col gap-1"
125
+ >
126
+ ${resultTemplates}
127
+ </div>`;
128
+ }
129
+ resultStringTemplate(result) {
130
+ return shared_tailwindElement_index.x`<div
131
+ data-id="${result.id}"
132
+ class="paragraph-inter-14-regular text-neutral-20 cursor-pointer hover:bg-neutral-98 rounded-8 p-2"
133
+ @click=${() => this.handleSelect(result)}
134
+ >
135
+ ${result.value}
136
+ </div>`;
137
+ }
138
+ resultProfileTemplate(result) {
139
+ return shared_tailwindElement_index.x`<div
140
+ data-id="${result.address}"
141
+ class="cursor-pointer hover:bg-neutral-98 rounded-8 p-2 flex gap-2 items-center"
142
+ @click=${() => this.handleSelect(result)}
143
+ >
144
+ <lukso-profile
145
+ profile-address="${result.address}"
146
+ profile-url="${result.image}"
147
+ size="x-small"
148
+ ></lukso-profile>
149
+ <lukso-username
150
+ name="${result.name}"
151
+ address="${result.address}"
152
+ name-color="neutral-20"
153
+ max-width="300"
154
+ size="medium"
155
+ ></lukso-username>
156
+ </div>`;
157
+ }
158
+ handleSelect(result) {
159
+ const selectEvent = new CustomEvent("on-select", {
160
+ detail: {
161
+ value: result
162
+ },
163
+ bubbles: false,
164
+ composed: true
165
+ });
166
+ this.dispatchEvent(selectEvent);
167
+ }
168
+ handleFocus() {
169
+ if (!this.isReadonly && !this.isDisabled) {
170
+ this.hasHocus = true;
171
+ this.hasHighlight = true;
172
+ }
173
+ }
174
+ handleBlur() {
175
+ this.hasHocus = false;
176
+ this.hasHighlight = false;
177
+ }
178
+ searchDebounce(searchTerm) {
179
+ this.debounceTimer = setTimeout(() => {
180
+ const changeEvent = new CustomEvent("on-search", {
181
+ detail: {
182
+ value: searchTerm
183
+ },
184
+ bubbles: false,
185
+ composed: true
186
+ });
187
+ this.dispatchEvent(changeEvent);
188
+ this.isSearching = false;
189
+ }, this.debounce);
190
+ }
191
+ handleSearch(event) {
192
+ if (this.isSearching) {
193
+ clearTimeout(this.debounceTimer);
194
+ }
195
+ this.isSearching = true;
196
+ const target = event.target;
197
+ this.searchDebounce(target.value);
198
+ }
199
+ handleMouseOver() {
200
+ if (!this.isReadonly && !this.isDisabled) {
201
+ this.hasHighlight = true;
202
+ }
203
+ }
204
+ handleMouseOut() {
205
+ if (!this.hasHocus) {
206
+ this.hasHighlight = false;
207
+ }
208
+ }
209
+ render() {
210
+ return shared_tailwindElement_index.x`
211
+ <div class="relative w-full">
212
+ ${this.label ? this.labelTemplate() : shared_tailwindElement_index.A}
213
+ ${this.description ? this.descriptionTemplate() : shared_tailwindElement_index.A}
214
+ <div class="flex relative items-center">
215
+ ${this.inputTemplate()}
216
+ <lukso-icon
217
+ name="search"
218
+ class="absolute right-0 mr-3 ${index.customClassMap({
219
+ ["opacity-60 cursor-not-allowed"]: this.isDisabled,
220
+ ["cursor-not-allowed"]: this.isReadonly
221
+ })}"
222
+ @mouseenter=${this.handleMouseOver}
223
+ ></lukso-icon>
224
+ </div>
225
+ ${this.resultsTemplate()} ${this.error ? this.errorTemplate() : shared_tailwindElement_index.A}
226
+ </div>
227
+ `;
228
+ }
229
+ };
230
+ __decorateClass([
231
+ directive.e({ type: String })
232
+ ], exports.LuksoSearch.prototype, "value", 2);
233
+ __decorateClass([
234
+ directive.e({ type: String })
235
+ ], exports.LuksoSearch.prototype, "name", 2);
236
+ __decorateClass([
237
+ directive.e({ type: String })
238
+ ], exports.LuksoSearch.prototype, "type", 2);
239
+ __decorateClass([
240
+ directive.e({ type: String })
241
+ ], exports.LuksoSearch.prototype, "placeholder", 2);
242
+ __decorateClass([
243
+ directive.e({ type: String })
244
+ ], exports.LuksoSearch.prototype, "label", 2);
245
+ __decorateClass([
246
+ directive.e({ type: String })
247
+ ], exports.LuksoSearch.prototype, "autocomplete", 2);
248
+ __decorateClass([
249
+ directive.e({ type: String })
250
+ ], exports.LuksoSearch.prototype, "id", 2);
251
+ __decorateClass([
252
+ directive.e({ type: String })
253
+ ], exports.LuksoSearch.prototype, "description", 2);
254
+ __decorateClass([
255
+ directive.e({ type: String })
256
+ ], exports.LuksoSearch.prototype, "error", 2);
257
+ __decorateClass([
258
+ directive.e({ type: String, attribute: "custom-class" })
259
+ ], exports.LuksoSearch.prototype, "customClass", 2);
260
+ __decorateClass([
261
+ directive.e({ type: Boolean, attribute: "is-full-width" })
262
+ ], exports.LuksoSearch.prototype, "isFullWidth", 2);
263
+ __decorateClass([
264
+ directive.e({ type: Boolean, attribute: "is-readonly" })
265
+ ], exports.LuksoSearch.prototype, "isReadonly", 2);
266
+ __decorateClass([
267
+ directive.e({ type: Boolean, attribute: "is-disabled" })
268
+ ], exports.LuksoSearch.prototype, "isDisabled", 2);
269
+ __decorateClass([
270
+ directive.e({ type: Boolean })
271
+ ], exports.LuksoSearch.prototype, "autofocus", 2);
272
+ __decorateClass([
273
+ directive.e({ type: Boolean })
274
+ ], exports.LuksoSearch.prototype, "borderless", 2);
275
+ __decorateClass([
276
+ directive.e({ type: String })
277
+ ], exports.LuksoSearch.prototype, "results", 2);
278
+ __decorateClass([
279
+ directive.e({ type: Number })
280
+ ], exports.LuksoSearch.prototype, "debounce", 2);
281
+ __decorateClass([
282
+ state.t()
283
+ ], exports.LuksoSearch.prototype, "hasHocus", 2);
284
+ __decorateClass([
285
+ state.t()
286
+ ], exports.LuksoSearch.prototype, "hasHighlight", 2);
287
+ __decorateClass([
288
+ state.t()
289
+ ], exports.LuksoSearch.prototype, "isSearching", 2);
290
+ __decorateClass([
291
+ state.t()
292
+ ], exports.LuksoSearch.prototype, "debounceTimer", 2);
293
+ exports.LuksoSearch = __decorateClass([
294
+ directive.e$1("lukso-search")
295
+ ], exports.LuksoSearch);
@@ -0,0 +1,56 @@
1
+ export type StringResult = {
2
+ id?: string;
3
+ value: string;
4
+ };
5
+ export type ProfileResult = {
6
+ address: string;
7
+ image?: string;
8
+ name?: string;
9
+ };
10
+ declare const LuksoSearch_base: typeof import("lit").LitElement;
11
+ export declare class LuksoSearch extends LuksoSearch_base {
12
+ value: string;
13
+ name: string;
14
+ type: string;
15
+ placeholder: string;
16
+ label: string;
17
+ autocomplete: string;
18
+ id: string;
19
+ description: string;
20
+ error: string;
21
+ customClass: string;
22
+ isFullWidth: boolean;
23
+ isReadonly: boolean;
24
+ isDisabled: boolean;
25
+ autofocus: boolean;
26
+ borderless: boolean;
27
+ results: string;
28
+ debounce: number;
29
+ private hasHocus;
30
+ private hasHighlight;
31
+ private isSearching;
32
+ private debounceTimer;
33
+ private defaultInputStyles;
34
+ inputTemplate(): import("lit").TemplateResult<1>;
35
+ labelTemplate(): import("lit").TemplateResult<1>;
36
+ descriptionTemplate(): import("lit").TemplateResult<1>;
37
+ errorTemplate(): import("lit").TemplateResult<1>;
38
+ resultsTemplate(): import("lit").TemplateResult<1>;
39
+ resultStringTemplate(result: StringResult): import("lit").TemplateResult<1>;
40
+ resultProfileTemplate(result: ProfileResult): import("lit").TemplateResult<1>;
41
+ private handleSelect;
42
+ private handleFocus;
43
+ private handleBlur;
44
+ private searchDebounce;
45
+ private handleSearch;
46
+ private handleMouseOver;
47
+ private handleMouseOut;
48
+ render(): import("lit").TemplateResult<1>;
49
+ }
50
+ declare global {
51
+ interface HTMLElementTagNameMap {
52
+ 'lukso-search': LuksoSearch;
53
+ }
54
+ }
55
+ export {};
56
+ //# sourceMappingURL=index.d.ts.map