@lukso/web-components 1.66.0 → 1.67.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.
- package/dist/components/index.cjs +3 -3
- package/dist/components/index.js +3 -3
- package/dist/components/lukso-button/index.cjs +4 -1
- package/dist/components/lukso-button/index.d.ts.map +1 -1
- package/dist/components/lukso-button/index.js +4 -1
- package/dist/components/lukso-card/index.cjs +3 -3
- package/dist/components/lukso-card/index.js +3 -3
- package/dist/components/lukso-checkbox/index.cjs +1 -1
- package/dist/components/lukso-checkbox/index.js +1 -1
- package/dist/components/lukso-footer/index.cjs +1 -1
- package/dist/components/lukso-footer/index.js +1 -1
- package/dist/components/lukso-icon/index.cjs +2 -2
- package/dist/components/lukso-icon/index.js +2 -2
- package/dist/components/lukso-input/index.cjs +1 -1
- package/dist/components/lukso-input/index.js +1 -1
- package/dist/components/lukso-modal/index.cjs +1 -1
- package/dist/components/lukso-modal/index.js +1 -1
- package/dist/components/lukso-navbar/index.cjs +3 -3
- package/dist/components/lukso-navbar/index.js +3 -3
- package/dist/components/lukso-profile/index.cjs +2 -2
- package/dist/components/lukso-profile/index.js +2 -2
- package/dist/components/lukso-progress/index.cjs +2 -2
- package/dist/components/lukso-progress/index.js +2 -2
- package/dist/components/lukso-sanitize/index.cjs +1 -1
- package/dist/components/lukso-sanitize/index.js +1 -1
- package/dist/components/lukso-search/index.cjs +3 -3
- package/dist/components/lukso-search/index.js +3 -3
- package/dist/components/lukso-select/index.cjs +3 -3
- package/dist/components/lukso-select/index.js +3 -3
- package/dist/components/lukso-share/index.cjs +1 -1
- package/dist/components/lukso-share/index.js +1 -1
- package/dist/components/lukso-switch/index.cjs +2 -2
- package/dist/components/lukso-switch/index.js +2 -2
- package/dist/components/lukso-tag/index.cjs +2 -2
- package/dist/components/lukso-tag/index.js +2 -2
- package/dist/components/lukso-terms/index.cjs +2 -2
- package/dist/components/lukso-terms/index.js +2 -2
- package/dist/components/lukso-test/index.cjs +1 -1
- package/dist/components/lukso-test/index.js +1 -1
- package/dist/components/lukso-tooltip/index.cjs +32 -14
- package/dist/components/lukso-tooltip/index.d.ts +9 -2
- package/dist/components/lukso-tooltip/index.d.ts.map +1 -1
- package/dist/components/lukso-tooltip/index.js +32 -14
- package/dist/components/lukso-tooltip/lukso-tooltip.stories.d.ts +3 -1
- package/dist/components/lukso-tooltip/lukso-tooltip.stories.d.ts.map +1 -1
- package/dist/components/lukso-username/index.cjs +2 -2
- package/dist/components/lukso-username/index.js +2 -2
- package/dist/components/lukso-wizard/index.cjs +1 -1
- package/dist/components/lukso-wizard/index.js +1 -1
- package/dist/{index-98e8e0d5.cjs → index-21e30dce.cjs} +1 -1
- package/dist/{index-688c3040.cjs → index-9158df3a.cjs} +1 -1
- package/dist/{index-3527fb14.js → index-987980d1.js} +1 -1
- package/dist/{index-1765cfe1.js → index-ccc127cd.js} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +3 -3
- package/dist/shared/tailwind-element/index.cjs +1 -1
- package/dist/shared/tailwind-element/index.js +1 -1
- package/dist/{style-map-c86dd6e2.cjs → style-map-c75e9a96.cjs} +1 -1
- package/dist/{style-map-9fdda015.js → style-map-de03e3eb.js} +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { PropertyValues } from 'lit';
|
|
1
|
+
import { type PropertyValues } from 'lit';
|
|
2
2
|
export type TooltipVariant = 'dark' | 'light' | 'success' | 'danger' | 'white';
|
|
3
3
|
export type TooltipSize = 'medium' | 'large';
|
|
4
4
|
export type TooltipPlacement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'auto' | 'auto-start' | 'auto-end';
|
|
5
5
|
export type TooltipTrigger = 'mouseenter' | 'click' | 'manual';
|
|
6
|
+
export type TooltipOption = {
|
|
7
|
+
id?: string;
|
|
8
|
+
value: string;
|
|
9
|
+
text: string;
|
|
10
|
+
};
|
|
6
11
|
declare const LuksoTooltip_base: typeof import("lit").LitElement;
|
|
7
12
|
export declare class LuksoTooltip extends LuksoTooltip_base {
|
|
8
13
|
variant: TooltipVariant;
|
|
@@ -17,13 +22,15 @@ export declare class LuksoTooltip extends LuksoTooltip_base {
|
|
|
17
22
|
copyText: string;
|
|
18
23
|
copyValue: string;
|
|
19
24
|
offset: number;
|
|
25
|
+
options: string;
|
|
20
26
|
showCopy: boolean;
|
|
21
|
-
|
|
27
|
+
optionsParsed: TooltipOption[];
|
|
22
28
|
private tooltipInstance;
|
|
23
29
|
private hideOnClickCheck;
|
|
24
30
|
private initTooltip;
|
|
25
31
|
private handleClick;
|
|
26
32
|
willUpdate(changedProperties: PropertyValues<this>): Promise<void>;
|
|
33
|
+
private optionsTemplate;
|
|
27
34
|
render(): import("lit-html").TemplateResult<1>;
|
|
28
35
|
}
|
|
29
36
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,KAAK,CAAA;AAO/C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAA;AAC9E,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAA;AAC5C,MAAM,MAAM,gBAAgB,GACxB,KAAK,GACL,WAAW,GACX,SAAS,GACT,OAAO,GACP,aAAa,GACb,WAAW,GACX,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,MAAM,GACN,YAAY,GACZ,UAAU,GACV,MAAM,GACN,YAAY,GACZ,UAAU,CAAA;AACd,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,CAAA;AAE9D,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;;AAED,qBACa,YAAa,SAAQ,iBAA4B;IAE5D,OAAO,EAAE,cAAc,CAAU;IAGjC,IAAI,EAAE,WAAW,CAAW;IAG5B,SAAS,EAAE,gBAAgB,CAAQ;IAGnC,OAAO,EAAE,cAAc,CAAe;IAGtC,IAAI,SAAK;IAGT,QAAQ,SAAM;IAGd,IAAI,UAAQ;IAGZ,WAAW,SAAS;IAGpB,eAAe,UAAQ;IAGvB,QAAQ,SAAK;IAGb,SAAS,SAAK;IAGd,MAAM,SAAK;IAGX,OAAO,SAAK;IAGZ,QAAQ,UAAQ;IAGhB,aAAa,EAAE,aAAa,EAAE,CAAK;IAEnC,OAAO,CAAC,eAAe,CAAY;IAEnC,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,WAAW;IA8BnB,OAAO,CAAC,WAAW;IAab,UAAU,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC;IAyBxD,OAAO,CAAC,eAAe;IAcvB,MAAM;CAiCP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAA;KAC9B;CACF"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, x } from '../../index-
|
|
1
|
+
import { T as TailwindStyledElement, x } from '../../index-987980d1.js';
|
|
2
2
|
import { n, e } from '../../query-assigned-elements-5d94572f.js';
|
|
3
3
|
import { t } from '../../state-0a779257.js';
|
|
4
|
-
import { c as customClassMap } from '../../index-5e194caf.js';
|
|
5
|
-
import '../../directive-2bb7789e.js';
|
|
6
4
|
|
|
7
5
|
var top = 'top';
|
|
8
6
|
var bottom = 'bottom';
|
|
@@ -3469,8 +3467,9 @@ let LuksoTooltip = class extends TailwindStyledElement(style) {
|
|
|
3469
3467
|
this.copyText = "";
|
|
3470
3468
|
this.copyValue = "";
|
|
3471
3469
|
this.offset = 10;
|
|
3470
|
+
this.options = "";
|
|
3472
3471
|
this.showCopy = false;
|
|
3473
|
-
this.
|
|
3472
|
+
this.optionsParsed = [];
|
|
3474
3473
|
this.tooltipInstance = void 0;
|
|
3475
3474
|
}
|
|
3476
3475
|
hideOnClickCheck() {
|
|
@@ -3491,7 +3490,7 @@ let LuksoTooltip = class extends TailwindStyledElement(style) {
|
|
|
3491
3490
|
this.tooltipInstance.destroy();
|
|
3492
3491
|
this.tooltipInstance = void 0;
|
|
3493
3492
|
}
|
|
3494
|
-
if (!this.text) {
|
|
3493
|
+
if (!this.text && !this.options) {
|
|
3495
3494
|
return;
|
|
3496
3495
|
}
|
|
3497
3496
|
this.tooltipInstance = tippy(trigger, {
|
|
@@ -3523,25 +3522,38 @@ let LuksoTooltip = class extends TailwindStyledElement(style) {
|
|
|
3523
3522
|
await this.updateComplete;
|
|
3524
3523
|
if (changedProperties.has("show") && this.trigger === "manual") {
|
|
3525
3524
|
if (this.show) {
|
|
3526
|
-
|
|
3525
|
+
!this.tooltipInstance && this.initTooltip();
|
|
3527
3526
|
this.tooltipInstance.show();
|
|
3528
3527
|
} else {
|
|
3529
3528
|
this.tooltipInstance?.hide();
|
|
3530
3529
|
}
|
|
3531
3530
|
return;
|
|
3532
3531
|
}
|
|
3532
|
+
if (changedProperties.has("options") && !!this.options) {
|
|
3533
|
+
try {
|
|
3534
|
+
this.optionsParsed = JSON.parse(this.options);
|
|
3535
|
+
} catch (error) {
|
|
3536
|
+
console.warn("Could not parse options", error);
|
|
3537
|
+
}
|
|
3538
|
+
}
|
|
3533
3539
|
this.initTooltip();
|
|
3534
3540
|
}
|
|
3541
|
+
optionsTemplate() {
|
|
3542
|
+
return x`
|
|
3543
|
+
${Object.entries(this.optionsParsed).map(
|
|
3544
|
+
(option) => x`<div
|
|
3545
|
+
class="mb-1 rounded-4 px-2 py-1 hover:cursor-pointer hover:bg-neutral-95"
|
|
3546
|
+
onClick="navigator.clipboard.writeText('${option[1].value}')"
|
|
3547
|
+
>
|
|
3548
|
+
${option[1].text}
|
|
3549
|
+
</div>`
|
|
3550
|
+
)}
|
|
3551
|
+
`;
|
|
3552
|
+
}
|
|
3535
3553
|
render() {
|
|
3536
3554
|
return x`
|
|
3537
|
-
<div
|
|
3538
|
-
|
|
3539
|
-
role="tooltip"
|
|
3540
|
-
class=${customClassMap({
|
|
3541
|
-
[this.defaultTooltipStyles]: true
|
|
3542
|
-
})}
|
|
3543
|
-
>
|
|
3544
|
-
${this.text}
|
|
3555
|
+
<div id="tooltip" role="tooltip" class="bg-neutral-20 p-4 hidden">
|
|
3556
|
+
${this.options ? this.optionsTemplate() : this.text}
|
|
3545
3557
|
</div>
|
|
3546
3558
|
${this.isClipboardCopy ? x`<lukso-tooltip
|
|
3547
3559
|
variant=${this.variant}
|
|
@@ -3606,9 +3618,15 @@ __decorateClass([
|
|
|
3606
3618
|
__decorateClass([
|
|
3607
3619
|
n({ type: Number })
|
|
3608
3620
|
], LuksoTooltip.prototype, "offset", 2);
|
|
3621
|
+
__decorateClass([
|
|
3622
|
+
n({ type: String })
|
|
3623
|
+
], LuksoTooltip.prototype, "options", 2);
|
|
3609
3624
|
__decorateClass([
|
|
3610
3625
|
t()
|
|
3611
3626
|
], LuksoTooltip.prototype, "showCopy", 2);
|
|
3627
|
+
__decorateClass([
|
|
3628
|
+
t()
|
|
3629
|
+
], LuksoTooltip.prototype, "optionsParsed", 2);
|
|
3612
3630
|
LuksoTooltip = __decorateClass([
|
|
3613
3631
|
e("lukso-tooltip")
|
|
3614
3632
|
], LuksoTooltip);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta } from '@storybook/web-components';
|
|
1
|
+
import type { Meta } from '@storybook/web-components';
|
|
2
2
|
/** Documentation and examples of `lukso-tooltip` component. */
|
|
3
3
|
declare const meta: Meta;
|
|
4
4
|
export default meta;
|
|
@@ -24,4 +24,6 @@ export declare const PlacementBottom: any;
|
|
|
24
24
|
export declare const Offset: any;
|
|
25
25
|
/** Tooltip can work as clipboard copy component. For that wou need to enable `is-clipboard-copy` and set `copy-text` attribute.. */
|
|
26
26
|
export declare const ClipboardCopy: any;
|
|
27
|
+
/** Tooltip with options (copied to clipboard). */
|
|
28
|
+
export declare const OptionsTooltip: any;
|
|
27
29
|
//# sourceMappingURL=lukso-tooltip.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lukso-tooltip.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-tooltip/lukso-tooltip.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lukso-tooltip.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-tooltip/lukso-tooltip.stories.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,SAAS,CAAA;AAChB,OAAO,uBAAuB,CAAA;AAE9B,gEAAgE;AAChE,QAAA,MAAM,IAAI,EAAE,IAmLX,CAAA;AAED,eAAe,IAAI,CAAA;AAuCnB,8CAA8C;AAC9C,eAAO,MAAM,cAAc,KAA2B,CAAA;AAMtD,4CAA4C;AAC5C,eAAO,MAAM,YAAY,KAA2B,CAAA;AAOpD,sEAAsE;AACtE,eAAO,MAAM,QAAQ,KAA2B,CAAA;AAUhD,gCAAgC;AAChC,eAAO,MAAM,SAAS,KAA2B,CAAA;AASjD,mCAAmC;AACnC,eAAO,MAAM,YAAY,KAA2B,CAAA;AASpD,qCAAqC;AACrC,eAAO,MAAM,cAAc,KAA2B,CAAA;AAStD,oCAAoC;AACpC,eAAO,MAAM,aAAa,KAA2B,CAAA;AASrD,oEAAoE;AACpE,eAAO,MAAM,cAAc,KAA2B,CAAA;AAOtD,eAAO,MAAM,aAAa,KAA2B,CAAA;AAQrD,eAAO,MAAM,eAAe,KAA2B,CAAA;AASvD,8DAA8D;AAC9D,eAAO,MAAM,MAAM,KAA2B,CAAA;AAS9C,qIAAqI;AACrI,eAAO,MAAM,aAAa,KAA2B,CAAA;AAUrD,mDAAmD;AACnD,eAAO,MAAM,cAAc,KAA2B,CAAA"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-9158df3a.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
|
|
7
7
|
const index = require('../../index-e9668573.cjs');
|
|
8
|
-
const index$1 = require('../../index-
|
|
8
|
+
const index$1 = require('../../index-21e30dce.cjs');
|
|
9
9
|
require('../../directive-8278ab14.cjs');
|
|
10
10
|
|
|
11
11
|
const sliceAddress = (address, startSliceBy = 6, endSliceBy) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, x, A } from '../../index-
|
|
1
|
+
import { T as TailwindStyledElement, x, A } from '../../index-987980d1.js';
|
|
2
2
|
import { n, e } from '../../query-assigned-elements-5d94572f.js';
|
|
3
3
|
import { c as customClassMap } from '../../index-5e194caf.js';
|
|
4
|
-
import { c as customStyleMap } from '../../index-
|
|
4
|
+
import { c as customStyleMap } from '../../index-ccc127cd.js';
|
|
5
5
|
import '../../directive-2bb7789e.js';
|
|
6
6
|
|
|
7
7
|
const sliceAddress = (address, startSliceBy = 6, endSliceBy) => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-9158df3a.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-1d5d9d4c.cjs');
|
|
7
7
|
const directive = require('../../directive-8278ab14.cjs');
|
|
8
8
|
const index = require('../../index-e9668573.cjs');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j, b as T, T as TailwindStyledElement, x } from '../../index-
|
|
1
|
+
import { j, b as T, T as TailwindStyledElement, x } from '../../index-987980d1.js';
|
|
2
2
|
import { n, e as e$1 } from '../../query-assigned-elements-5d94572f.js';
|
|
3
3
|
import { e, i, t } from '../../directive-2bb7789e.js';
|
|
4
4
|
import { c as customClassMap } from '../../index-5e194caf.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const shared_tailwindElement_index = require('./index-
|
|
3
|
+
const shared_tailwindElement_index = require('./index-9158df3a.cjs');
|
|
4
4
|
const directive = require('./directive-8278ab14.cjs');
|
|
5
5
|
|
|
6
6
|
class CustomStyleMapDirective extends directive.i {
|