@lukso/web-components 1.40.0 → 1.42.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 (85) hide show
  1. package/dist/components/index.cjs +7 -6
  2. package/dist/components/index.js +7 -6
  3. package/dist/components/lukso-button/index.cjs +21 -20
  4. package/dist/components/lukso-button/index.js +5 -4
  5. package/dist/components/lukso-card/index.cjs +15 -14
  6. package/dist/components/lukso-card/index.js +5 -4
  7. package/dist/components/lukso-checkbox/index.cjs +16 -15
  8. package/dist/components/lukso-checkbox/index.js +5 -4
  9. package/dist/components/lukso-footer/index.cjs +39 -27
  10. package/dist/components/lukso-footer/index.d.ts +2 -0
  11. package/dist/components/lukso-footer/index.d.ts.map +1 -1
  12. package/dist/components/lukso-footer/index.js +39 -27
  13. package/dist/components/lukso-footer/lukso-footer.stories.d.ts +2 -0
  14. package/dist/components/lukso-footer/lukso-footer.stories.d.ts.map +1 -1
  15. package/dist/components/lukso-icon/index.cjs +9 -8
  16. package/dist/components/lukso-icon/index.js +4 -3
  17. package/dist/components/lukso-input/index.cjs +26 -25
  18. package/dist/components/lukso-input/index.js +5 -4
  19. package/dist/components/lukso-modal/index.cjs +7 -6
  20. package/dist/components/lukso-modal/index.js +4 -3
  21. package/dist/components/lukso-navbar/index.cjs +15 -14
  22. package/dist/components/lukso-navbar/index.js +6 -5
  23. package/dist/components/lukso-profile/index.cjs +10 -9
  24. package/dist/components/lukso-profile/index.js +5 -4
  25. package/dist/components/lukso-progress/index.cjs +10 -9
  26. package/dist/components/lukso-progress/index.js +5 -4
  27. package/dist/components/lukso-sanitize/index.cjs +7 -6
  28. package/dist/components/lukso-sanitize/index.js +3 -2
  29. package/dist/components/lukso-search/index.cjs +71 -47
  30. package/dist/components/lukso-search/index.d.ts +6 -2
  31. package/dist/components/lukso-search/index.d.ts.map +1 -1
  32. package/dist/components/lukso-search/index.js +53 -29
  33. package/dist/components/lukso-search/lukso-search.stories.d.ts +6 -2
  34. package/dist/components/lukso-search/lukso-search.stories.d.ts.map +1 -1
  35. package/dist/components/lukso-share/index.cjs +24 -15
  36. package/dist/components/lukso-share/index.d.ts +8 -2
  37. package/dist/components/lukso-share/index.d.ts.map +1 -1
  38. package/dist/components/lukso-share/index.js +23 -14
  39. package/dist/components/lukso-share/lukso-share.stories.d.ts +5 -1
  40. package/dist/components/lukso-share/lukso-share.stories.d.ts.map +1 -1
  41. package/dist/components/lukso-switch/index.cjs +9 -8
  42. package/dist/components/lukso-switch/index.js +5 -4
  43. package/dist/components/lukso-tag/index.cjs +10 -9
  44. package/dist/components/lukso-tag/index.js +5 -4
  45. package/dist/components/lukso-terms/index.cjs +9 -7
  46. package/dist/components/lukso-terms/index.d.ts.map +1 -1
  47. package/dist/components/lukso-terms/index.js +7 -5
  48. package/dist/components/lukso-test/index.cjs +10 -9
  49. package/dist/components/lukso-test/index.js +4 -3
  50. package/dist/components/lukso-username/index.cjs +16 -15
  51. package/dist/components/lukso-username/index.js +5 -4
  52. package/dist/components/lukso-wizard/index.cjs +10 -9
  53. package/dist/components/lukso-wizard/index.js +5 -4
  54. package/dist/directive-2bb7789e.js +8 -0
  55. package/dist/directive-8278ab14.cjs +12 -0
  56. package/dist/{directive-helpers-38cb10eb.cjs → directive-helpers-01f1c3b1.cjs} +1 -1
  57. package/dist/{directive-helpers-294cf70c.js → directive-helpers-8f79cbe5.js} +1 -1
  58. package/dist/{index-714323c9.js → index-5e194caf.js} +1 -1
  59. package/dist/{index-b3762a1f.cjs → index-930f6cf2.cjs} +1 -1
  60. package/dist/{index-7dc05ee5.cjs → index-e9668573.cjs} +2 -2
  61. package/dist/{index-211c8050.js → index-ed87f41b.js} +1 -1
  62. package/dist/index.cjs +7 -6
  63. package/dist/index.js +7 -6
  64. package/dist/query-assigned-elements-5200f974.cjs +24 -0
  65. package/dist/query-assigned-elements-e36df787.js +21 -0
  66. package/dist/shared/tailwind-element/index.cjs +1 -1
  67. package/dist/shared/tailwind-element/index.js +1 -1
  68. package/dist/{state-7fde94d1.js → state-02a92ffa.js} +1 -1
  69. package/dist/state-51b50a6b.cjs +11 -0
  70. package/dist/style-map-3b9af808.cjs +12 -0
  71. package/dist/{style-map-1398bfd6.js → style-map-5daca6c4.js} +2 -2
  72. package/package.json +1 -1
  73. package/tools/assets/images/social-discord.svg +4 -1
  74. package/tools/assets/images/social-github.svg +11 -1
  75. package/tools/assets/images/social-instagram.svg +6 -1
  76. package/tools/assets/images/social-linkedin.svg +4 -1
  77. package/tools/assets/images/social-medium.svg +6 -1
  78. package/tools/assets/images/social-reddit.svg +11 -1
  79. package/tools/assets/images/social-telegram.svg +4 -1
  80. package/tools/assets/images/social-twitter.svg +4 -1
  81. package/tools/sass/component.scss +4 -0
  82. package/dist/directive-9ec64c08.js +0 -28
  83. package/dist/directive-db00f5fb.cjs +0 -34
  84. package/dist/state-a62a7d5d.cjs +0 -11
  85. package/dist/style-map-cc5b37cd.cjs +0 -12
@@ -27,9 +27,12 @@ export declare class LuksoSearch extends LuksoSearch_base {
27
27
  borderless: boolean;
28
28
  results: string;
29
29
  debounce: number;
30
- private hasHocus;
30
+ isSearching: boolean;
31
+ noResultsText: string;
32
+ showNoResults: boolean;
33
+ private hasFocus;
31
34
  private hasHighlight;
32
- private isSearching;
35
+ private isDebouncing;
33
36
  private debounceTimer;
34
37
  private defaultInputStyles;
35
38
  inputTemplate(): import("lit").TemplateResult<1>;
@@ -37,6 +40,7 @@ export declare class LuksoSearch extends LuksoSearch_base {
37
40
  descriptionTemplate(): import("lit").TemplateResult<1>;
38
41
  errorTemplate(): import("lit").TemplateResult<1>;
39
42
  resultsTemplate(): import("lit").TemplateResult<1>;
43
+ resultEmptyTemplate(): import("lit").TemplateResult<1>;
40
44
  resultStringTemplate(result: StringResult): import("lit").TemplateResult<1>;
41
45
  resultProfileTemplate(result: ProfileResult): import("lit").TemplateResult<1>;
42
46
  private handleSelect;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../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,aAAa;IAMb,eAAe;IAoCf,mBAAmB;IAMnB,oBAAoB,CAAC,MAAM,EAAE,YAAY;IAUzC,qBAAqB,CAAC,MAAM,EAAE,aAAa;IAsB3C,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,cAAc;IAMtB,MAAM;CA0BP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAA;KAC5B;CACF"}
@@ -1,11 +1,12 @@
1
- import { T as TailwindStyledElement, x, A } from '../../index-211c8050.js';
2
- import { e, a as e$1 } from '../../directive-9ec64c08.js';
3
- import { t } from '../../state-7fde94d1.js';
4
- import { c as customClassMap } from '../../index-714323c9.js';
1
+ import { T as TailwindStyledElement, x, A } from '../../index-ed87f41b.js';
2
+ import { e, a as e$1 } from '../../query-assigned-elements-e36df787.js';
3
+ import { t } from '../../state-02a92ffa.js';
4
+ import { c as customClassMap } from '../../index-5e194caf.js';
5
5
  import '../lukso-icon/index.js';
6
6
  import '../lukso-profile/index.js';
7
7
  import '../lukso-username/index.js';
8
- import '../../style-map-1398bfd6.js';
8
+ import '../../directive-2bb7789e.js';
9
+ import '../../style-map-5daca6c4.js';
9
10
 
10
11
  const style = ":host {\n\n display: inline-flex\n}\n\n:host([is-full-width]) {\n\n display: flex;\n\n width: 100%\n}";
11
12
 
@@ -40,9 +41,12 @@ let LuksoSearch = class extends TailwindStyledElement(style) {
40
41
  this.borderless = false;
41
42
  this.results = "";
42
43
  this.debounce = 700;
43
- this.hasHocus = false;
44
- this.hasHighlight = false;
45
44
  this.isSearching = false;
45
+ this.noResultsText = "";
46
+ this.showNoResults = false;
47
+ this.hasFocus = false;
48
+ this.hasHighlight = false;
49
+ this.isDebouncing = false;
46
50
  this.defaultInputStyles = `bg-neutral-100 paragraph-inter-14-regular px-4 py-3 pr-10
47
51
  border-solid h-[48px] placeholder:text-neutral-70
48
52
  outline-none transition transition-all duration-150 appearance-none rounded-12`;
@@ -102,26 +106,35 @@ let LuksoSearch = class extends TailwindStyledElement(style) {
102
106
  </div>`;
103
107
  }
104
108
  resultsTemplate() {
105
- if (this.results === "") {
109
+ const resultTemplates = [];
110
+ if (this.results === "" && !this.showNoResults || this.showNoResults && !this.noResultsText) {
106
111
  return x``;
107
112
  }
108
- const resultTemplates = [];
109
- const results = JSON.parse(this.results);
110
- for (const result of Object.entries(results)) {
111
- if ("value" in result[1]) {
112
- resultTemplates.push(this.resultStringTemplate(result[1]));
113
- } else if ("address" in result[1]) {
114
- resultTemplates.push(this.resultProfileTemplate(result[1]));
115
- } else {
116
- console.error("Unknown result type", result);
113
+ if (this.showNoResults) {
114
+ resultTemplates.push(this.resultEmptyTemplate());
115
+ } else {
116
+ const results = JSON.parse(this.results);
117
+ for (const result of Object.entries(results)) {
118
+ if ("value" in result[1]) {
119
+ resultTemplates.push(this.resultStringTemplate(result[1]));
120
+ } else if ("address" in result[1]) {
121
+ resultTemplates.push(this.resultProfileTemplate(result[1]));
122
+ } else {
123
+ console.error("Unknown result type", result);
124
+ }
117
125
  }
118
126
  }
119
127
  return x`<div
120
- 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 overflow-y-auto max-h-60 scroll"
128
+ 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 overflow-y-auto max-h-64"
121
129
  >
122
130
  ${resultTemplates}
123
131
  </div>`;
124
132
  }
133
+ resultEmptyTemplate() {
134
+ return x`<div class="paragraph-inter-14-semi-bold text-neutral-20 pl-1">
135
+ ${this.noResultsText}
136
+ </div>`;
137
+ }
125
138
  resultStringTemplate(result) {
126
139
  return x`<div
127
140
  data-id="${result.id}"
@@ -164,12 +177,12 @@ let LuksoSearch = class extends TailwindStyledElement(style) {
164
177
  }
165
178
  handleFocus() {
166
179
  if (!this.isReadonly && !this.isDisabled) {
167
- this.hasHocus = true;
180
+ this.hasFocus = true;
168
181
  this.hasHighlight = true;
169
182
  }
170
183
  }
171
184
  handleBlur() {
172
- this.hasHocus = false;
185
+ this.hasFocus = false;
173
186
  this.hasHighlight = false;
174
187
  }
175
188
  searchDebounce(searchTerm) {
@@ -182,14 +195,14 @@ let LuksoSearch = class extends TailwindStyledElement(style) {
182
195
  composed: true
183
196
  });
184
197
  this.dispatchEvent(changeEvent);
185
- this.isSearching = false;
198
+ this.isDebouncing = false;
186
199
  }, this.debounce);
187
200
  }
188
201
  handleSearch(event) {
189
- if (this.isSearching) {
202
+ if (this.isDebouncing) {
190
203
  clearTimeout(this.debounceTimer);
191
204
  }
192
- this.isSearching = true;
205
+ this.isDebouncing = true;
193
206
  const target = event.target;
194
207
  this.searchDebounce(target.value);
195
208
  }
@@ -199,7 +212,7 @@ let LuksoSearch = class extends TailwindStyledElement(style) {
199
212
  }
200
213
  }
201
214
  handleMouseOut() {
202
- if (!this.hasHocus) {
215
+ if (!this.hasFocus) {
203
216
  this.hasHighlight = false;
204
217
  }
205
218
  }
@@ -211,15 +224,17 @@ let LuksoSearch = class extends TailwindStyledElement(style) {
211
224
  <div class="flex relative items-center">
212
225
  ${this.inputTemplate()}
213
226
  <lukso-icon
214
- name="search"
227
+ name="${this.isSearching || this.isDebouncing ? "spinner" : "search"}"
215
228
  class="absolute right-0 mr-3 ${customClassMap({
216
229
  ["opacity-60 cursor-not-allowed"]: this.isDisabled,
217
- ["cursor-not-allowed"]: this.isReadonly
230
+ ["cursor-not-allowed"]: this.isReadonly,
231
+ ["animate-spin"]: this.isSearching || this.isDebouncing
218
232
  })}"
219
233
  @mouseenter=${this.handleMouseOver}
220
234
  ></lukso-icon>
221
235
  </div>
222
- ${this.resultsTemplate()} ${this.error ? this.errorTemplate() : A}
236
+ ${this.results || this.showNoResults && this.hasFocus ? this.resultsTemplate() : A}
237
+ ${this.error ? this.errorTemplate() : A}
223
238
  </div>
224
239
  `;
225
240
  }
@@ -275,15 +290,24 @@ __decorateClass([
275
290
  __decorateClass([
276
291
  e({ type: Number })
277
292
  ], LuksoSearch.prototype, "debounce", 2);
293
+ __decorateClass([
294
+ e({ type: Boolean, attribute: "is-searching" })
295
+ ], LuksoSearch.prototype, "isSearching", 2);
296
+ __decorateClass([
297
+ e({ type: String, attribute: "no-results-text" })
298
+ ], LuksoSearch.prototype, "noResultsText", 2);
299
+ __decorateClass([
300
+ e({ type: Boolean, attribute: "show-no-results" })
301
+ ], LuksoSearch.prototype, "showNoResults", 2);
278
302
  __decorateClass([
279
303
  t()
280
- ], LuksoSearch.prototype, "hasHocus", 2);
304
+ ], LuksoSearch.prototype, "hasFocus", 2);
281
305
  __decorateClass([
282
306
  t()
283
307
  ], LuksoSearch.prototype, "hasHighlight", 2);
284
308
  __decorateClass([
285
309
  t()
286
- ], LuksoSearch.prototype, "isSearching", 2);
310
+ ], LuksoSearch.prototype, "isDebouncing", 2);
287
311
  __decorateClass([
288
312
  t()
289
313
  ], LuksoSearch.prototype, "debounceTimer", 2);
@@ -2,8 +2,12 @@ import { Meta } from '@storybook/web-components';
2
2
  /** Documentation and examples of `lukso-search` component. Components share most of `lukso-input` attributes. */
3
3
  declare const meta: Meta;
4
4
  export default meta;
5
- /** */
5
+ /** Example of search with `string` values. */
6
6
  export declare const DefaultSearch: any;
7
- /** */
7
+ /** Example of search with `profile` values. */
8
8
  export declare const ProfileSearch: any;
9
+ /** To indicate when search is processing results you can add `is-searching` attribute. */
10
+ export declare const SearchingState: any;
11
+ /** To show that search hes no results add `show-no-results` attribute. You can also customize no results text with `no-results-text` attribute. */
12
+ export declare const NoResults: any;
9
13
  //# sourceMappingURL=lukso-search.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lukso-search.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-search/lukso-search.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAGhD,OAAO,SAAS,CAAA;AAEhB,mHAAmH;AACnH,QAAA,MAAM,IAAI,EAAE,IAyLX,CAAA;AAED,eAAe,IAAI,CAAA;AAmEnB,QAAQ;AACR,eAAO,MAAM,aAAa,KAAoB,CAAA;AAK9C,QAAQ;AACR,eAAO,MAAM,aAAa,KAAoB,CAAA"}
1
+ {"version":3,"file":"lukso-search.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-search/lukso-search.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAGhD,OAAO,SAAS,CAAA;AAEhB,mHAAmH;AACnH,QAAA,MAAM,IAAI,EAAE,IA6NX,CAAA;AAED,eAAe,IAAI,CAAA;AAyEnB,+CAA+C;AAC/C,eAAO,MAAM,aAAa,KAAoB,CAAA;AAK9C,gDAAgD;AAChD,eAAO,MAAM,aAAa,KAAoB,CAAA;AAqB9C,0FAA0F;AAC1F,eAAO,MAAM,cAAc,KAAoB,CAAA;AAM/C,mJAAmJ;AACnJ,eAAO,MAAM,SAAS,KAAoB,CAAA"}
@@ -2,9 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-b3762a1f.cjs');
6
- const directive = require('../../directive-db00f5fb.cjs');
7
- const index = require('../../index-7dc05ee5.cjs');
5
+ const shared_tailwindElement_index = require('../../index-930f6cf2.cjs');
6
+ const queryAssignedElements = require('../../query-assigned-elements-5200f974.cjs');
8
7
 
9
8
  const style = ":host {\n display: inline-flex\n}";
10
9
 
@@ -22,7 +21,17 @@ var __decorateClass = (decorators, target, key, kind) => {
22
21
  exports.LuksoShare = class LuksoShare extends shared_tailwindElement_index.TailwindStyledElement(style) {
23
22
  constructor() {
24
23
  super(...arguments);
25
- this.customClass = "";
24
+ this.customStyle = "";
25
+ this.providers = [
26
+ "twitter",
27
+ "instagram",
28
+ "linkedin",
29
+ "telegram",
30
+ "discord",
31
+ "reddit",
32
+ "medium",
33
+ "github"
34
+ ];
26
35
  this.urls = {
27
36
  twitter: "https://twitter.com/lukso_io",
28
37
  instagram: "https://www.instagram.com/lukso",
@@ -38,29 +47,29 @@ exports.LuksoShare = class LuksoShare extends shared_tailwindElement_index.Tailw
38
47
  return shared_tailwindElement_index.x`<a
39
48
  href=${url}
40
49
  target="_blank"
41
- class="transition-all duration-300 rounded-full hover:opacity-80 hover:shadow-button-hover-primary"
50
+ class="transition-all duration-300 rounded-full opacity-50 hover:opacity-80 hover:shadow-button-hover-primary h-7 w-7"
42
51
  ><img src="/assets/images/social-${name}.svg" alt=""
43
52
  /></a>`;
44
53
  }
45
54
  render() {
46
55
  const linkTemplates = [];
47
- for (const i of Object.keys(this.urls)) {
48
- linkTemplates.push(this.linkTemplate(i, this.urls[i]));
56
+ for (const provider of this.providers) {
57
+ linkTemplates.push(this.linkTemplate(provider, this.urls[provider]));
49
58
  }
50
59
  return shared_tailwindElement_index.x`<div
51
- class="grid gap-4 grid-cols-[repeat(4,max-content)] sm:grid-cols-[repeat(8,max-content)] ${index.customClassMap(
52
- {
53
- [this.customClass]: !!this.customClass
54
- }
55
- )}"
60
+ class="grid gap-2 sm:gap-4"
61
+ style="grid-template-columns: repeat(${this.providers.length}, max-content); ${this.customStyle}"
56
62
  >
57
63
  ${linkTemplates}
58
64
  </div>`;
59
65
  }
60
66
  };
61
67
  __decorateClass([
62
- directive.e({ type: String, attribute: "custom-class" })
63
- ], exports.LuksoShare.prototype, "customClass", 2);
68
+ queryAssignedElements.e({ type: String, attribute: "custom-style" })
69
+ ], exports.LuksoShare.prototype, "customStyle", 2);
70
+ __decorateClass([
71
+ queryAssignedElements.e({ type: Array })
72
+ ], exports.LuksoShare.prototype, "providers", 2);
64
73
  exports.LuksoShare = __decorateClass([
65
- directive.e$1("lukso-share")
74
+ queryAssignedElements.e$1("lukso-share")
66
75
  ], exports.LuksoShare);
@@ -1,8 +1,14 @@
1
+ export type Provider = 'twitter' | 'instagram' | 'linkedin' | 'telegram' | 'discord' | 'reddit' | 'medium' | 'github';
2
+ export type Url = `https://${string}`;
3
+ export type ProviderLinks = {
4
+ [key in Provider]: Url;
5
+ };
1
6
  declare const LuksoShare_base: typeof import("lit").LitElement;
2
7
  export declare class LuksoShare extends LuksoShare_base {
3
- customClass: string;
8
+ customStyle: string;
9
+ providers: Provider[];
4
10
  private urls;
5
- linkTemplate(name: string, url: string): import("lit").TemplateResult<1>;
11
+ linkTemplate(name: Provider, url: Url): import("lit").TemplateResult<1>;
6
12
  render(): import("lit").TemplateResult<1>;
7
13
  }
8
14
  declare global {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-share/index.ts"],"names":[],"mappings":";AAOA,qBACa,UAAW,SAAQ,eAA4B;IAE1D,WAAW,SAAK;IAEhB,OAAO,CAAC,IAAI,CASX;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAStC,MAAM;CAgBP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAA;KAC1B;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-share/index.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,WAAW,GACX,UAAU,GACV,UAAU,GACV,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,QAAQ,CAAA;AAEZ,MAAM,MAAM,GAAG,GAAG,WAAW,MAAM,EAAE,CAAA;AAErC,MAAM,MAAM,aAAa,GAAG;KACzB,GAAG,IAAI,QAAQ,GAAG,GAAG;CACvB,CAAA;;AAED,qBACa,UAAW,SAAQ,eAA4B;IAE1D,WAAW,SAAK;IAGhB,SAAS,EAAE,QAAQ,EAAE,CASpB;IAED,OAAO,CAAC,IAAI,CASX;IAED,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG;IASrC,MAAM;CAeP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAA;KAC1B;CACF"}
@@ -1,6 +1,5 @@
1
- import { T as TailwindStyledElement, x } from '../../index-211c8050.js';
2
- import { e, a as e$1 } from '../../directive-9ec64c08.js';
3
- import { c as customClassMap } from '../../index-714323c9.js';
1
+ import { T as TailwindStyledElement, x } from '../../index-ed87f41b.js';
2
+ import { e, a as e$1 } from '../../query-assigned-elements-e36df787.js';
4
3
 
5
4
  const style = ":host {\n display: inline-flex\n}";
6
5
 
@@ -18,7 +17,17 @@ var __decorateClass = (decorators, target, key, kind) => {
18
17
  let LuksoShare = class extends TailwindStyledElement(style) {
19
18
  constructor() {
20
19
  super(...arguments);
21
- this.customClass = "";
20
+ this.customStyle = "";
21
+ this.providers = [
22
+ "twitter",
23
+ "instagram",
24
+ "linkedin",
25
+ "telegram",
26
+ "discord",
27
+ "reddit",
28
+ "medium",
29
+ "github"
30
+ ];
22
31
  this.urls = {
23
32
  twitter: "https://twitter.com/lukso_io",
24
33
  instagram: "https://www.instagram.com/lukso",
@@ -34,29 +43,29 @@ let LuksoShare = class extends TailwindStyledElement(style) {
34
43
  return x`<a
35
44
  href=${url}
36
45
  target="_blank"
37
- class="transition-all duration-300 rounded-full hover:opacity-80 hover:shadow-button-hover-primary"
46
+ class="transition-all duration-300 rounded-full opacity-50 hover:opacity-80 hover:shadow-button-hover-primary h-7 w-7"
38
47
  ><img src="/assets/images/social-${name}.svg" alt=""
39
48
  /></a>`;
40
49
  }
41
50
  render() {
42
51
  const linkTemplates = [];
43
- for (const i of Object.keys(this.urls)) {
44
- linkTemplates.push(this.linkTemplate(i, this.urls[i]));
52
+ for (const provider of this.providers) {
53
+ linkTemplates.push(this.linkTemplate(provider, this.urls[provider]));
45
54
  }
46
55
  return x`<div
47
- class="grid gap-4 grid-cols-[repeat(4,max-content)] sm:grid-cols-[repeat(8,max-content)] ${customClassMap(
48
- {
49
- [this.customClass]: !!this.customClass
50
- }
51
- )}"
56
+ class="grid gap-2 sm:gap-4"
57
+ style="grid-template-columns: repeat(${this.providers.length}, max-content); ${this.customStyle}"
52
58
  >
53
59
  ${linkTemplates}
54
60
  </div>`;
55
61
  }
56
62
  };
57
63
  __decorateClass([
58
- e({ type: String, attribute: "custom-class" })
59
- ], LuksoShare.prototype, "customClass", 2);
64
+ e({ type: String, attribute: "custom-style" })
65
+ ], LuksoShare.prototype, "customStyle", 2);
66
+ __decorateClass([
67
+ e({ type: Array })
68
+ ], LuksoShare.prototype, "providers", 2);
60
69
  LuksoShare = __decorateClass([
61
70
  e$1("lukso-share")
62
71
  ], LuksoShare);
@@ -2,6 +2,10 @@ import { Meta } from '@storybook/web-components';
2
2
  /** Documentation and examples of `lukso-share` component. */
3
3
  declare const meta: Meta;
4
4
  export default meta;
5
- /** Component render responsive list of links, use `custom-class` property to change layout of the elements. */
5
+ /** Component render responsive list of links. */
6
6
  export declare const Default: any;
7
+ /** With `custom-style` attribute you can change layout of the elements. */
8
+ export declare const CustomStyle: any;
9
+ /** With `providers` attribute pick only providers that you want, you can also control order this way. Use `JSON.stringify` to encode `array`. */
10
+ export declare const LimitProviders: any;
7
11
  //# sourceMappingURL=lukso-share.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lukso-share.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-share/lukso-share.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAEhD,OAAO,SAAS,CAAA;AAEhB,8DAA8D;AAC9D,QAAA,MAAM,IAAI,EAAE,IAuBX,CAAA;AAED,eAAe,IAAI,CAAA;AAKnB,+GAA+G;AAC/G,eAAO,MAAM,OAAO,KAAoB,CAAA"}
1
+ {"version":3,"file":"lukso-share.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-share/lukso-share.stories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAEhD,OAAO,SAAS,CAAA;AAEhB,8DAA8D;AAC9D,QAAA,MAAM,IAAI,EAAE,IAoCX,CAAA;AAED,eAAe,IAAI,CAAA;AAQnB,iDAAiD;AACjD,eAAO,MAAM,OAAO,KAAoB,CAAA;AAExC,2EAA2E;AAC3E,eAAO,MAAM,WAAW,KAAoB,CAAA;AAK5C,iJAAiJ;AACjJ,eAAO,MAAM,cAAc,KAAoB,CAAA"}
@@ -2,10 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-b3762a1f.cjs');
6
- const directive = require('../../directive-db00f5fb.cjs');
7
- const styleMap = require('../../style-map-cc5b37cd.cjs');
8
- const index = require('../../index-7dc05ee5.cjs');
5
+ const shared_tailwindElement_index = require('../../index-930f6cf2.cjs');
6
+ const queryAssignedElements = require('../../query-assigned-elements-5200f974.cjs');
7
+ const styleMap = require('../../style-map-3b9af808.cjs');
8
+ const index = require('../../index-e9668573.cjs');
9
+ require('../../directive-8278ab14.cjs');
9
10
 
10
11
  var __defProp = Object.defineProperty;
11
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -73,17 +74,17 @@ exports.LuksoSwitch = class LuksoSwitch extends shared_tailwindElement_index.Tai
73
74
  }
74
75
  };
75
76
  __decorateClass([
76
- directive.e({ type: String })
77
+ queryAssignedElements.e({ type: String })
77
78
  ], exports.LuksoSwitch.prototype, "color", 2);
78
79
  __decorateClass([
79
- directive.e({ type: Boolean, attribute: "is-checked" })
80
+ queryAssignedElements.e({ type: Boolean, attribute: "is-checked" })
80
81
  ], exports.LuksoSwitch.prototype, "isChecked", 2);
81
82
  __decorateClass([
82
- directive.e({
83
+ queryAssignedElements.e({
83
84
  type: Boolean,
84
85
  attribute: "is-disabled"
85
86
  })
86
87
  ], exports.LuksoSwitch.prototype, "isDisabled", 2);
87
88
  exports.LuksoSwitch = __decorateClass([
88
- directive.e$1("lukso-switch")
89
+ queryAssignedElements.e$1("lukso-switch")
89
90
  ], exports.LuksoSwitch);
@@ -1,7 +1,8 @@
1
- import { a as TailwindElement, x } from '../../index-211c8050.js';
2
- import { e, a as e$1 } from '../../directive-9ec64c08.js';
3
- import { o } from '../../style-map-1398bfd6.js';
4
- import { c as customClassMap } from '../../index-714323c9.js';
1
+ import { a as TailwindElement, x } from '../../index-ed87f41b.js';
2
+ import { e, a as e$1 } from '../../query-assigned-elements-e36df787.js';
3
+ import { o } from '../../style-map-5daca6c4.js';
4
+ import { c as customClassMap } from '../../index-5e194caf.js';
5
+ import '../../directive-2bb7789e.js';
5
6
 
6
7
  var __defProp = Object.defineProperty;
7
8
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -2,10 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-b3762a1f.cjs');
6
- const directive = require('../../directive-db00f5fb.cjs');
7
- const styleMap = require('../../style-map-cc5b37cd.cjs');
8
- const index = require('../../index-7dc05ee5.cjs');
5
+ const shared_tailwindElement_index = require('../../index-930f6cf2.cjs');
6
+ const queryAssignedElements = require('../../query-assigned-elements-5200f974.cjs');
7
+ const styleMap = require('../../style-map-3b9af808.cjs');
8
+ const index = require('../../index-e9668573.cjs');
9
+ require('../../directive-8278ab14.cjs');
9
10
 
10
11
  const style = ":host {\n display: inline-flex\n}";
11
12
 
@@ -70,17 +71,17 @@ exports.LuksoTag = class LuksoTag extends shared_tailwindElement_index.TailwindS
70
71
  }
71
72
  };
72
73
  __decorateClass([
73
- directive.e({ type: String })
74
+ queryAssignedElements.e({ type: String })
74
75
  ], exports.LuksoTag.prototype, "size", 2);
75
76
  __decorateClass([
76
- directive.e({ type: Boolean, attribute: "is-rounded" })
77
+ queryAssignedElements.e({ type: Boolean, attribute: "is-rounded" })
77
78
  ], exports.LuksoTag.prototype, "isRounded", 2);
78
79
  __decorateClass([
79
- directive.e({ type: String, attribute: "background-color" })
80
+ queryAssignedElements.e({ type: String, attribute: "background-color" })
80
81
  ], exports.LuksoTag.prototype, "backgroundColor", 2);
81
82
  __decorateClass([
82
- directive.e({ type: String, attribute: "text-color" })
83
+ queryAssignedElements.e({ type: String, attribute: "text-color" })
83
84
  ], exports.LuksoTag.prototype, "textColor", 2);
84
85
  exports.LuksoTag = __decorateClass([
85
- directive.e$1("lukso-tag")
86
+ queryAssignedElements.e$1("lukso-tag")
86
87
  ], exports.LuksoTag);
@@ -1,7 +1,8 @@
1
- import { T as TailwindStyledElement, x } from '../../index-211c8050.js';
2
- import { e, a as e$1 } from '../../directive-9ec64c08.js';
3
- import { o } from '../../style-map-1398bfd6.js';
4
- import { c as customClassMap } from '../../index-714323c9.js';
1
+ import { T as TailwindStyledElement, x } from '../../index-ed87f41b.js';
2
+ import { e, a as e$1 } from '../../query-assigned-elements-e36df787.js';
3
+ import { o } from '../../style-map-5daca6c4.js';
4
+ import { c as customClassMap } from '../../index-5e194caf.js';
5
+ import '../../directive-2bb7789e.js';
5
6
 
6
7
  const style = ":host {\n display: inline-flex\n}";
7
8
 
@@ -2,13 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-b3762a1f.cjs');
6
- const directive = require('../../directive-db00f5fb.cjs');
7
- const state = require('../../state-a62a7d5d.cjs');
8
- const index = require('../../index-7dc05ee5.cjs');
5
+ const shared_tailwindElement_index = require('../../index-930f6cf2.cjs');
6
+ const queryAssignedElements = require('../../query-assigned-elements-5200f974.cjs');
7
+ const state = require('../../state-51b50a6b.cjs');
8
+ const index = require('../../index-e9668573.cjs');
9
9
  require('../lukso-icon/index.cjs');
10
10
  require('../lukso-sanitize/index.cjs');
11
- require('../../style-map-cc5b37cd.cjs');
11
+ require('../../directive-8278ab14.cjs');
12
+ require('../../style-map-3b9af808.cjs');
12
13
 
13
14
  const style = ":host {\n display: flex;\n height: 100%\n}";
14
15
 
@@ -77,6 +78,7 @@ exports.LuksoTerms = class LuksoTerms extends shared_tailwindElement_index.Tailw
77
78
  })}
78
79
  >
79
80
  <div
81
+ data-testid="scroll-to-bottom"
80
82
  class="w-10 h-10 bg-neutral-100 rounded-full shadow-1xl flex items-center justify-center animate-bounce2 cursor-pointer"
81
83
  @click=${this.handleBottomScroll}
82
84
  >
@@ -87,11 +89,11 @@ exports.LuksoTerms = class LuksoTerms extends shared_tailwindElement_index.Tailw
87
89
  }
88
90
  };
89
91
  __decorateClass([
90
- directive.e({ type: String })
92
+ queryAssignedElements.e({ type: String })
91
93
  ], exports.LuksoTerms.prototype, "text", 2);
92
94
  __decorateClass([
93
95
  state.t()
94
96
  ], exports.LuksoTerms.prototype, "hasScrollButton", 2);
95
97
  exports.LuksoTerms = __decorateClass([
96
- directive.e$1("lukso-terms")
98
+ queryAssignedElements.e$1("lukso-terms")
97
99
  ], exports.LuksoTerms);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-terms/index.ts"],"names":[],"mappings":"AAMA,OAAO,yBAAyB,CAAA;AAChC,OAAO,6BAA6B,CAAA;;AAEpC,qBACa,UAAW,SAAQ,eAA4B;IAE1D,IAAI,SAAK;IAGT,OAAO,CAAC,eAAe,CAAO;IAE9B,OAAO,CAAC,aAAa,CAE8B;IAEnD,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,kBAAkB;IAW1B,MAAM;CA2BP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAA;KAC1B;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-terms/index.ts"],"names":[],"mappings":"AAMA,OAAO,yBAAyB,CAAA;AAChC,OAAO,6BAA6B,CAAA;;AAEpC,qBACa,UAAW,SAAQ,eAA4B;IAE1D,IAAI,SAAK;IAGT,OAAO,CAAC,eAAe,CAAO;IAE9B,OAAO,CAAC,aAAa,CAE8B;IAEnD,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,kBAAkB;IAW1B,MAAM;CA4BP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAA;KAC1B;CACF"}
@@ -1,10 +1,11 @@
1
- import { T as TailwindStyledElement, x } from '../../index-211c8050.js';
2
- import { e, a as e$1 } from '../../directive-9ec64c08.js';
3
- import { t } from '../../state-7fde94d1.js';
4
- import { c as customClassMap } from '../../index-714323c9.js';
1
+ import { T as TailwindStyledElement, x } from '../../index-ed87f41b.js';
2
+ import { e, a as e$1 } from '../../query-assigned-elements-e36df787.js';
3
+ import { t } from '../../state-02a92ffa.js';
4
+ import { c as customClassMap } from '../../index-5e194caf.js';
5
5
  import '../lukso-icon/index.js';
6
6
  import '../lukso-sanitize/index.js';
7
- import '../../style-map-1398bfd6.js';
7
+ import '../../directive-2bb7789e.js';
8
+ import '../../style-map-5daca6c4.js';
8
9
 
9
10
  const style = ":host {\n display: flex;\n height: 100%\n}";
10
11
 
@@ -73,6 +74,7 @@ let LuksoTerms = class extends TailwindStyledElement(style) {
73
74
  })}
74
75
  >
75
76
  <div
77
+ data-testid="scroll-to-bottom"
76
78
  class="w-10 h-10 bg-neutral-100 rounded-full shadow-1xl flex items-center justify-center animate-bounce2 cursor-pointer"
77
79
  @click=${this.handleBottomScroll}
78
80
  >