@lukso/web-components 1.152.0 → 1.154.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/base-Cl6v8-BZ.js +8 -0
- package/dist/base-NFGX42U4.cjs +10 -0
- package/dist/components/index.cjs +4 -4
- package/dist/components/index.js +4 -4
- package/dist/components/lukso-button/index.cjs +3 -3
- package/dist/components/lukso-button/index.js +3 -3
- package/dist/components/lukso-card/index.cjs +8 -14
- package/dist/components/lukso-card/index.js +7 -13
- package/dist/components/lukso-checkbox/index.cjs +3 -3
- package/dist/components/lukso-checkbox/index.js +3 -3
- package/dist/components/lukso-collapse/index.cjs +56 -22
- package/dist/components/lukso-collapse/index.d.ts +6 -1
- package/dist/components/lukso-collapse/index.d.ts.map +1 -1
- package/dist/components/lukso-collapse/index.js +56 -22
- package/dist/components/lukso-collapse/lukso-collapse.stories.d.ts +13 -5
- package/dist/components/lukso-collapse/lukso-collapse.stories.d.ts.map +1 -1
- package/dist/components/lukso-color-picker/index.cjs +4 -4
- package/dist/components/lukso-color-picker/index.js +4 -4
- package/dist/components/lukso-dropdown/index.cjs +4 -4
- package/dist/components/lukso-dropdown/index.js +4 -4
- package/dist/components/lukso-dropdown-option/index.cjs +2 -2
- package/dist/components/lukso-dropdown-option/index.js +2 -2
- package/dist/components/lukso-footer/index.cjs +2 -2
- package/dist/components/lukso-footer/index.js +2 -2
- package/dist/components/lukso-icon/index.cjs +3 -3
- package/dist/components/lukso-icon/index.js +3 -3
- package/dist/components/lukso-image/index.cjs +4 -4
- package/dist/components/lukso-image/index.js +4 -4
- package/dist/components/lukso-input/index.cjs +3 -3
- package/dist/components/lukso-input/index.js +3 -3
- package/dist/components/lukso-modal/index.cjs +2 -2
- package/dist/components/lukso-modal/index.js +2 -2
- package/dist/components/lukso-navbar/index.cjs +3 -3
- package/dist/components/lukso-navbar/index.js +3 -3
- package/dist/components/lukso-pagination/index.cjs +3 -3
- package/dist/components/lukso-pagination/index.js +3 -3
- package/dist/components/lukso-profile/index.cjs +3 -3
- package/dist/components/lukso-profile/index.js +3 -3
- package/dist/components/lukso-progress/index.cjs +3 -3
- package/dist/components/lukso-progress/index.js +3 -3
- package/dist/components/lukso-radio/index.cjs +3 -3
- package/dist/components/lukso-radio/index.js +3 -3
- package/dist/components/lukso-radio-group/index.cjs +3 -3
- package/dist/components/lukso-radio-group/index.js +3 -3
- package/dist/components/lukso-sanitize/index.cjs +2 -2
- package/dist/components/lukso-sanitize/index.js +2 -2
- package/dist/components/lukso-search/index.cjs +6 -6
- package/dist/components/lukso-search/index.js +6 -6
- package/dist/components/lukso-select/index.cjs +5 -5
- package/dist/components/lukso-select/index.js +5 -5
- package/dist/components/lukso-share/index.cjs +2 -2
- package/dist/components/lukso-share/index.js +2 -2
- package/dist/components/lukso-switch/index.cjs +3 -3
- package/dist/components/lukso-switch/index.js +3 -3
- package/dist/components/lukso-tag/index.cjs +3 -3
- package/dist/components/lukso-tag/index.js +3 -3
- package/dist/components/lukso-terms/index.cjs +3 -3
- package/dist/components/lukso-terms/index.js +3 -3
- package/dist/components/lukso-textarea/index.cjs +3 -3
- package/dist/components/lukso-textarea/index.js +3 -3
- package/dist/components/lukso-tooltip/index.cjs +3 -3
- package/dist/components/lukso-tooltip/index.js +3 -3
- package/dist/components/lukso-username/index.cjs +4 -4
- package/dist/components/lukso-username/index.js +4 -4
- package/dist/components/lukso-wizard/index.cjs +2 -2
- package/dist/components/lukso-wizard/index.js +2 -2
- package/dist/{index-B8OjQ3J3.js → index-6Bz9XVC3.js} +3 -3
- package/dist/index-C9vH8YlV.js +41 -0
- package/dist/{index-DCxKDPzL.js → index-CvWyP3CS.js} +2 -2
- package/dist/{index-ClY4WCoF.js → index-DUwutUFV.js} +5 -5
- package/dist/{index-CIZzn-j8.cjs → index-Dg9hcDqR.cjs} +5 -5
- package/dist/index-DkfODalz.cjs +50 -0
- package/dist/{index-DaUM7s7o.cjs → index-U4Y7KwZv.cjs} +2 -2
- package/dist/{index-DQWc7SKC.cjs → index-fSZGRljb.cjs} +3 -3
- package/dist/{index-CJKQ25eW.js → index-gJTlTDGh.js} +1 -1
- package/dist/{index-D6Gca4wb.cjs → index-m3XGqZFz.cjs} +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/{property-B4lb2hEb.js → property-B4XYi6Sk.js} +1 -1
- package/dist/{property-DEgM7RLm.cjs → property-BXmHod5d.cjs} +1 -1
- package/dist/shared/tailwind-element/index.cjs +1 -1
- package/dist/shared/tailwind-element/index.js +1 -1
- package/dist/{state-D5qmKvZx.cjs → state-CW2YmM3f.cjs} +1 -1
- package/dist/{state-DMM56pp-.js → state-CkvZ4IP8.js} +1 -1
- package/dist/{style-map-7bFOLcGG.js → style-map-D1R4wi4h.js} +1 -1
- package/dist/{style-map-DmaHQ6RH.cjs → style-map-c2S85yDu.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-DKXUCmZ9.cjs +0 -50
- package/dist/index-LyJ1o9RN.js +0 -41
|
@@ -16,12 +16,12 @@ const components_luksoInput_index = require('./lukso-input/index.cjs');
|
|
|
16
16
|
const components_luksoModal_index = require('./lukso-modal/index.cjs');
|
|
17
17
|
const components_luksoNavbar_index = require('./lukso-navbar/index.cjs');
|
|
18
18
|
const components_luksoPagination_index = require('./lukso-pagination/index.cjs');
|
|
19
|
-
const components_luksoProfile_index = require('../index-
|
|
19
|
+
const components_luksoProfile_index = require('../index-U4Y7KwZv.cjs');
|
|
20
20
|
const components_luksoProgress_index = require('./lukso-progress/index.cjs');
|
|
21
21
|
const components_luksoRadio_index = require('./lukso-radio/index.cjs');
|
|
22
22
|
const components_luksoRadioGroup_index = require('./lukso-radio-group/index.cjs');
|
|
23
23
|
const components_luksoSanitize_index = require('./lukso-sanitize/index.cjs');
|
|
24
|
-
const components_luksoSearch_index = require('../index-
|
|
24
|
+
const components_luksoSearch_index = require('../index-Dg9hcDqR.cjs');
|
|
25
25
|
const components_luksoSelect_index = require('./lukso-select/index.cjs');
|
|
26
26
|
const components_luksoShare_index = require('./lukso-share/index.cjs');
|
|
27
27
|
const components_luksoSwitch_index = require('./lukso-switch/index.cjs');
|
|
@@ -29,9 +29,9 @@ const components_luksoTag_index = require('./lukso-tag/index.cjs');
|
|
|
29
29
|
const components_luksoTerms_index = require('./lukso-terms/index.cjs');
|
|
30
30
|
const components_luksoTextarea_index = require('./lukso-textarea/index.cjs');
|
|
31
31
|
const components_luksoTooltip_index = require('./lukso-tooltip/index.cjs');
|
|
32
|
-
const components_luksoUsername_index = require('../index-
|
|
32
|
+
const components_luksoUsername_index = require('../index-fSZGRljb.cjs');
|
|
33
33
|
const components_luksoWizard_index = require('./lukso-wizard/index.cjs');
|
|
34
|
-
const shared_tailwindElement_index = require('../index-
|
|
34
|
+
const shared_tailwindElement_index = require('../index-DkfODalz.cjs');
|
|
35
35
|
require('../cn-CNdKneQ1.cjs');
|
|
36
36
|
|
|
37
37
|
|
package/dist/components/index.js
CHANGED
|
@@ -12,12 +12,12 @@ export { LuksoInput } from './lukso-input/index.js';
|
|
|
12
12
|
export { LuksoModal } from './lukso-modal/index.js';
|
|
13
13
|
export { LuksoNavbar } from './lukso-navbar/index.js';
|
|
14
14
|
export { LuksoPagination } from './lukso-pagination/index.js';
|
|
15
|
-
export { L as LuksoProfile } from '../index-
|
|
15
|
+
export { L as LuksoProfile } from '../index-CvWyP3CS.js';
|
|
16
16
|
export { LuksoProgress } from './lukso-progress/index.js';
|
|
17
17
|
export { LuksoRadio } from './lukso-radio/index.js';
|
|
18
18
|
export { LuksoRadioGroup } from './lukso-radio-group/index.js';
|
|
19
19
|
export { LuksoSanitize } from './lukso-sanitize/index.js';
|
|
20
|
-
export { L as LuksoSearch } from '../index-
|
|
20
|
+
export { L as LuksoSearch } from '../index-DUwutUFV.js';
|
|
21
21
|
export { LuksoSelect } from './lukso-select/index.js';
|
|
22
22
|
export { LuksoShare } from './lukso-share/index.js';
|
|
23
23
|
export { LuksoSwitch } from './lukso-switch/index.js';
|
|
@@ -25,7 +25,7 @@ export { LuksoTag } from './lukso-tag/index.js';
|
|
|
25
25
|
export { LuksoTerms } from './lukso-terms/index.js';
|
|
26
26
|
export { LuksoTextarea } from './lukso-textarea/index.js';
|
|
27
27
|
export { LuksoTooltip } from './lukso-tooltip/index.js';
|
|
28
|
-
export { L as LuksoUsername } from '../index-
|
|
28
|
+
export { L as LuksoUsername } from '../index-6Bz9XVC3.js';
|
|
29
29
|
export { LuksoWizard } from './lukso-wizard/index.js';
|
|
30
|
-
export { a as TailwindElement, T as TailwindStyledElement } from '../index-
|
|
30
|
+
export { a as TailwindElement, T as TailwindStyledElement } from '../index-C9vH8YlV.js';
|
|
31
31
|
import '../cn-Cu9aP49j.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-
|
|
6
|
-
const property = require('../../property-
|
|
7
|
-
const state = require('../../state-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-DkfODalz.cjs');
|
|
6
|
+
const property = require('../../property-BXmHod5d.cjs');
|
|
7
|
+
const state = require('../../state-CW2YmM3f.cjs');
|
|
8
8
|
const index = require('../../index-CaJky2qL.cjs');
|
|
9
9
|
require('../../tailwind-config.cjs');
|
|
10
10
|
const cn = require('../../cn-CNdKneQ1.cjs');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, E, x } from '../../index-
|
|
2
|
-
import { n, t } from '../../property-
|
|
3
|
-
import { r } from '../../state-
|
|
1
|
+
import { T as TailwindStyledElement, E, x } from '../../index-C9vH8YlV.js';
|
|
2
|
+
import { n, t } from '../../property-B4XYi6Sk.js';
|
|
3
|
+
import { r } from '../../state-CkvZ4IP8.js';
|
|
4
4
|
import { c as ce } from '../../index-B9iart53.js';
|
|
5
5
|
import '../../tailwind-config.js';
|
|
6
6
|
import { c as cn } from '../../cn-Cu9aP49j.js';
|
|
@@ -2,30 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const components_luksoProfile_index = require('../../index-
|
|
6
|
-
const shared_tailwindElement_index = require('../../index-
|
|
7
|
-
const property = require('../../property-
|
|
8
|
-
const state = require('../../state-
|
|
9
|
-
const
|
|
5
|
+
const components_luksoProfile_index = require('../../index-U4Y7KwZv.cjs');
|
|
6
|
+
const shared_tailwindElement_index = require('../../index-DkfODalz.cjs');
|
|
7
|
+
const property = require('../../property-BXmHod5d.cjs');
|
|
8
|
+
const state = require('../../state-CW2YmM3f.cjs');
|
|
9
|
+
const base = require('../../base-NFGX42U4.cjs');
|
|
10
|
+
const styleMap = require('../../style-map-c2S85yDu.cjs');
|
|
10
11
|
const index = require('../../index-CaJky2qL.cjs');
|
|
11
12
|
require('../../tailwind-config.cjs');
|
|
12
13
|
const cn = require('../../cn-CNdKneQ1.cjs');
|
|
13
14
|
const isAddress = require('../../isAddress-B3b91Jxf.cjs');
|
|
14
|
-
const index$1 = require('../../index-
|
|
15
|
+
const index$1 = require('../../index-m3XGqZFz.cjs');
|
|
15
16
|
require('../lukso-image/index.cjs');
|
|
16
17
|
|
|
17
|
-
/**
|
|
18
|
-
* @license
|
|
19
|
-
* Copyright 2017 Google LLC
|
|
20
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
-
*/
|
|
22
|
-
const e=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
|
|
23
|
-
|
|
24
18
|
/**
|
|
25
19
|
* @license
|
|
26
20
|
* Copyright 2021 Google LLC
|
|
27
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
-
*/function o(o){return (e
|
|
22
|
+
*/function o(o){return (e,n)=>{const{slot:r,selector:s}=o??{},c="slot"+(r?`[name=${r}]`:":not([name])");return base.e(e,n,{get(){const t=this.renderRoot?.querySelector(c),e=t?.assignedElements(o)??[];return void 0===s?e:e.filter((t=>t.matches(s)))}})}}
|
|
29
23
|
|
|
30
24
|
const backgroundGradient = (address) => {
|
|
31
25
|
let gradientStart = "#24354210";
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import { m as makeBlockie } from '../../index-
|
|
2
|
-
import { T as TailwindStyledElement, x, E } from '../../index-
|
|
3
|
-
import { n, t } from '../../property-
|
|
4
|
-
import { r } from '../../state-
|
|
5
|
-
import {
|
|
1
|
+
import { m as makeBlockie } from '../../index-CvWyP3CS.js';
|
|
2
|
+
import { T as TailwindStyledElement, x, E } from '../../index-C9vH8YlV.js';
|
|
3
|
+
import { n, t } from '../../property-B4XYi6Sk.js';
|
|
4
|
+
import { r } from '../../state-CkvZ4IP8.js';
|
|
5
|
+
import { e } from '../../base-Cl6v8-BZ.js';
|
|
6
|
+
import { o as o$1 } from '../../style-map-D1R4wi4h.js';
|
|
6
7
|
import { c as ce } from '../../index-B9iart53.js';
|
|
7
8
|
import '../../tailwind-config.js';
|
|
8
9
|
import { c as cn } from '../../cn-Cu9aP49j.js';
|
|
9
10
|
import { i as isAddress } from '../../isAddress-Dq9UN07g.js';
|
|
10
|
-
import { c as customStyleMap } from '../../index-
|
|
11
|
+
import { c as customStyleMap } from '../../index-gJTlTDGh.js';
|
|
11
12
|
import '../lukso-image/index.js';
|
|
12
13
|
|
|
13
|
-
/**
|
|
14
|
-
* @license
|
|
15
|
-
* Copyright 2017 Google LLC
|
|
16
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
-
*/
|
|
18
|
-
const e=(e,t,c)=>(c.configurable=true,c.enumerable=true,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
|
|
19
|
-
|
|
20
14
|
/**
|
|
21
15
|
* @license
|
|
22
16
|
* Copyright 2021 Google LLC
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
6
|
-
const property = require('../../property-
|
|
7
|
-
const state = require('../../state-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-DkfODalz.cjs');
|
|
6
|
+
const property = require('../../property-BXmHod5d.cjs');
|
|
7
|
+
const state = require('../../state-CW2YmM3f.cjs');
|
|
8
8
|
const index = require('../../index-D0nCA-7X.cjs');
|
|
9
9
|
|
|
10
10
|
var __defProp = Object.defineProperty;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as TailwindElement, x, E } from '../../index-
|
|
2
|
-
import { n, t } from '../../property-
|
|
3
|
-
import { r } from '../../state-
|
|
1
|
+
import { a as TailwindElement, x, E } from '../../index-C9vH8YlV.js';
|
|
2
|
+
import { n, t } from '../../property-B4XYi6Sk.js';
|
|
3
|
+
import { r } from '../../state-CkvZ4IP8.js';
|
|
4
4
|
import { c as customClassMap } from '../../index-F8ll4iy2.js';
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
@@ -2,14 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
6
|
-
const property = require('../../property-
|
|
7
|
-
const state = require('../../state-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-DkfODalz.cjs');
|
|
6
|
+
const property = require('../../property-BXmHod5d.cjs');
|
|
7
|
+
const state = require('../../state-CW2YmM3f.cjs');
|
|
8
|
+
const base = require('../../base-NFGX42U4.cjs');
|
|
8
9
|
const index = require('../../index-CaJky2qL.cjs');
|
|
9
10
|
require('../../tailwind-config.cjs');
|
|
10
11
|
const cn = require('../../cn-CNdKneQ1.cjs');
|
|
11
12
|
require('../lukso-icon/index.cjs');
|
|
12
13
|
|
|
14
|
+
/**
|
|
15
|
+
* @license
|
|
16
|
+
* Copyright 2017 Google LLC
|
|
17
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
18
|
+
*/function e(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;return base.e(n,s,{get(){return o(this)}})}}
|
|
19
|
+
|
|
13
20
|
var __defProp = Object.defineProperty;
|
|
14
21
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
22
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -33,14 +40,21 @@ exports.LuksoCollapse = class LuksoCollapse extends shared_tailwindElement_index
|
|
|
33
40
|
this.isDisabled = false;
|
|
34
41
|
this.icon = "";
|
|
35
42
|
this.maxHeight = "0px";
|
|
43
|
+
this.observedHeight = 0;
|
|
44
|
+
this.onTransitionEnd = (e) => {
|
|
45
|
+
if (e.propertyName !== "max-height") return;
|
|
46
|
+
this.dispatchEvent(
|
|
47
|
+
new CustomEvent(this.isOpen ? "after-enter" : "after-leave")
|
|
48
|
+
);
|
|
49
|
+
};
|
|
36
50
|
this.collapseStyles = index.ce({
|
|
37
51
|
slots: {
|
|
38
|
-
base: "",
|
|
39
|
-
header: "flex items-center justify-between cursor-pointer
|
|
52
|
+
base: "hover:border-neutral-35 transition transition-all duration-150",
|
|
53
|
+
header: "flex items-center justify-between cursor-pointer ml-3 py-2",
|
|
40
54
|
label: "text-neutral-45 paragraph-inter-14-semi-bold",
|
|
41
55
|
secondary: "text-neutral-45 paragraph-inter-14-semi-bold",
|
|
42
|
-
icon: "transition cursor-pointer",
|
|
43
|
-
content: "
|
|
56
|
+
icon: "transition cursor-pointer mr-3",
|
|
57
|
+
content: "transition-all duration-250 ease-in-out"
|
|
44
58
|
},
|
|
45
59
|
variants: {
|
|
46
60
|
isOpen: {
|
|
@@ -63,27 +77,35 @@ exports.LuksoCollapse = class LuksoCollapse extends shared_tailwindElement_index
|
|
|
63
77
|
});
|
|
64
78
|
}
|
|
65
79
|
firstUpdated() {
|
|
66
|
-
if (
|
|
67
|
-
this.
|
|
80
|
+
if ("ResizeObserver" in window) {
|
|
81
|
+
this.resizeObserver = new ResizeObserver(() => this.syncHeight());
|
|
82
|
+
this.resizeObserver.observe(this.contentElement);
|
|
68
83
|
}
|
|
84
|
+
this.syncHeight(true);
|
|
85
|
+
}
|
|
86
|
+
disconnectedCallback() {
|
|
87
|
+
this.resizeObserver?.disconnect();
|
|
88
|
+
super.disconnectedCallback();
|
|
69
89
|
}
|
|
70
90
|
updated(changed) {
|
|
71
91
|
if (changed.has("isOpen")) {
|
|
72
|
-
this.
|
|
92
|
+
this.syncHeight();
|
|
73
93
|
}
|
|
74
94
|
}
|
|
75
|
-
|
|
76
|
-
const content = this.
|
|
77
|
-
".collapse-content"
|
|
78
|
-
);
|
|
95
|
+
syncHeight(immediate = false) {
|
|
96
|
+
const content = this.contentElement;
|
|
79
97
|
if (!content) return;
|
|
98
|
+
const height = content.scrollHeight;
|
|
99
|
+
this.observedHeight = height;
|
|
80
100
|
if (this.isOpen) {
|
|
81
|
-
|
|
101
|
+
if (immediate) {
|
|
102
|
+
this.maxHeight = `${height}px`;
|
|
103
|
+
} else {
|
|
104
|
+
if (this.maxHeight !== `${height}px`) this.maxHeight = `${height}px`;
|
|
105
|
+
}
|
|
82
106
|
} else {
|
|
83
|
-
this.maxHeight = `${
|
|
84
|
-
requestAnimationFrame(() =>
|
|
85
|
-
this.maxHeight = "0px";
|
|
86
|
-
});
|
|
107
|
+
this.maxHeight = `${height}px`;
|
|
108
|
+
requestAnimationFrame(() => this.maxHeight = "0px");
|
|
87
109
|
}
|
|
88
110
|
}
|
|
89
111
|
toggle() {
|
|
@@ -105,7 +127,7 @@ exports.LuksoCollapse = class LuksoCollapse extends shared_tailwindElement_index
|
|
|
105
127
|
@click=${() => !this.isDisabled && this.toggle()}
|
|
106
128
|
>
|
|
107
129
|
<span class=${label()}>${this.label}</span>
|
|
108
|
-
<div class="flex items-center
|
|
130
|
+
<div class="flex items-center">
|
|
109
131
|
${this.secondaryLabel ? shared_tailwindElement_index.x`<span class=${secondary()}>
|
|
110
132
|
${this.isOpen ? this.secondaryLabel.close : this.secondaryLabel.open}
|
|
111
133
|
</span>` : null}
|
|
@@ -117,8 +139,14 @@ exports.LuksoCollapse = class LuksoCollapse extends shared_tailwindElement_index
|
|
|
117
139
|
</div>
|
|
118
140
|
|
|
119
141
|
<!-- Content -->
|
|
120
|
-
<div
|
|
121
|
-
|
|
142
|
+
<div
|
|
143
|
+
class=${content()}
|
|
144
|
+
style="max-height:${this.maxHeight};"
|
|
145
|
+
@transitionend=${this.onTransitionEnd}
|
|
146
|
+
>
|
|
147
|
+
<div class="collapse-content">
|
|
148
|
+
<slot @slotchange=${() => this.syncHeight()}></slot>
|
|
149
|
+
</div>
|
|
122
150
|
</div>
|
|
123
151
|
</div>
|
|
124
152
|
`;
|
|
@@ -145,6 +173,12 @@ __decorateClass([
|
|
|
145
173
|
__decorateClass([
|
|
146
174
|
state.r()
|
|
147
175
|
], exports.LuksoCollapse.prototype, "maxHeight", 2);
|
|
176
|
+
__decorateClass([
|
|
177
|
+
state.r()
|
|
178
|
+
], exports.LuksoCollapse.prototype, "observedHeight", 2);
|
|
179
|
+
__decorateClass([
|
|
180
|
+
e(".collapse-content")
|
|
181
|
+
], exports.LuksoCollapse.prototype, "contentElement", 2);
|
|
148
182
|
exports.LuksoCollapse = __decorateClass([
|
|
149
183
|
property.t("lukso-collapse")
|
|
150
184
|
], exports.LuksoCollapse);
|
|
@@ -10,9 +10,14 @@ export declare class LuksoCollapse extends TailwindElement {
|
|
|
10
10
|
isDisabled: boolean;
|
|
11
11
|
icon: string;
|
|
12
12
|
private maxHeight;
|
|
13
|
+
private observedHeight;
|
|
14
|
+
private contentElement;
|
|
15
|
+
private resizeObserver?;
|
|
13
16
|
firstUpdated(): void;
|
|
17
|
+
disconnectedCallback(): void;
|
|
14
18
|
updated(changed: Map<string, unknown>): void;
|
|
15
|
-
private
|
|
19
|
+
private syncHeight;
|
|
20
|
+
private onTransitionEnd;
|
|
16
21
|
private toggle;
|
|
17
22
|
private collapseStyles;
|
|
18
23
|
render(): import('lit-html').TemplateResult<1>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-collapse/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,yBAAyB,CAAA;AAEhC,qBACa,aAAc,SAAQ,eAAe;IAEhD,KAAK,SAAK;IAGV,cAAc,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAG9C;IAGD,MAAM,UAAQ;IAGd,WAAW,SAAK;IAGhB,UAAU,UAAQ;IAGlB,IAAI,SAAK;IAEA,OAAO,CAAC,SAAS,CAAQ;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-collapse/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,yBAAyB,CAAA;AAEhC,qBACa,aAAc,SAAQ,eAAe;IAEhD,KAAK,SAAK;IAGV,cAAc,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAG9C;IAGD,MAAM,UAAQ;IAGd,WAAW,SAAK;IAGhB,UAAU,UAAQ;IAGlB,IAAI,SAAK;IAEA,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,cAAc,CAAI;IAEP,OAAO,CAAC,cAAc,CAAc;IAChE,OAAO,CAAC,cAAc,CAAC,CAAgB;IAEvC,YAAY;IAQZ,oBAAoB,IAAI,IAAI;IAK5B,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAMrC,OAAO,CAAC,UAAU;IAmBlB,OAAO,CAAC,eAAe,CAKtB;IAED,OAAO,CAAC,MAAM;IAOd,OAAO,CAAC,cAAc,CA2BpB;IAEF,MAAM;CA6CP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAA;KAChC;CACF"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { a as TailwindElement, x } from '../../index-
|
|
2
|
-
import { n, t } from '../../property-
|
|
3
|
-
import { r } from '../../state-
|
|
1
|
+
import { a as TailwindElement, x } from '../../index-C9vH8YlV.js';
|
|
2
|
+
import { n, t } from '../../property-B4XYi6Sk.js';
|
|
3
|
+
import { r } from '../../state-CkvZ4IP8.js';
|
|
4
|
+
import { e as e$1 } from '../../base-Cl6v8-BZ.js';
|
|
4
5
|
import { c as ce } from '../../index-B9iart53.js';
|
|
5
6
|
import '../../tailwind-config.js';
|
|
6
7
|
import { c as cn } from '../../cn-Cu9aP49j.js';
|
|
7
8
|
import '../lukso-icon/index.js';
|
|
8
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @license
|
|
12
|
+
* Copyright 2017 Google LLC
|
|
13
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
14
|
+
*/function e(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;return e$1(n,s,{get(){return o(this)}})}}
|
|
15
|
+
|
|
9
16
|
var __defProp = Object.defineProperty;
|
|
10
17
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
18
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -29,14 +36,21 @@ let LuksoCollapse = class extends TailwindElement {
|
|
|
29
36
|
this.isDisabled = false;
|
|
30
37
|
this.icon = "";
|
|
31
38
|
this.maxHeight = "0px";
|
|
39
|
+
this.observedHeight = 0;
|
|
40
|
+
this.onTransitionEnd = (e) => {
|
|
41
|
+
if (e.propertyName !== "max-height") return;
|
|
42
|
+
this.dispatchEvent(
|
|
43
|
+
new CustomEvent(this.isOpen ? "after-enter" : "after-leave")
|
|
44
|
+
);
|
|
45
|
+
};
|
|
32
46
|
this.collapseStyles = ce({
|
|
33
47
|
slots: {
|
|
34
|
-
base: "",
|
|
35
|
-
header: "flex items-center justify-between cursor-pointer
|
|
48
|
+
base: "hover:border-neutral-35 transition transition-all duration-150",
|
|
49
|
+
header: "flex items-center justify-between cursor-pointer ml-3 py-2",
|
|
36
50
|
label: "text-neutral-45 paragraph-inter-14-semi-bold",
|
|
37
51
|
secondary: "text-neutral-45 paragraph-inter-14-semi-bold",
|
|
38
|
-
icon: "transition cursor-pointer",
|
|
39
|
-
content: "
|
|
52
|
+
icon: "transition cursor-pointer mr-3",
|
|
53
|
+
content: "transition-all duration-250 ease-in-out"
|
|
40
54
|
},
|
|
41
55
|
variants: {
|
|
42
56
|
isOpen: {
|
|
@@ -59,27 +73,35 @@ let LuksoCollapse = class extends TailwindElement {
|
|
|
59
73
|
});
|
|
60
74
|
}
|
|
61
75
|
firstUpdated() {
|
|
62
|
-
if (
|
|
63
|
-
this.
|
|
76
|
+
if ("ResizeObserver" in window) {
|
|
77
|
+
this.resizeObserver = new ResizeObserver(() => this.syncHeight());
|
|
78
|
+
this.resizeObserver.observe(this.contentElement);
|
|
64
79
|
}
|
|
80
|
+
this.syncHeight(true);
|
|
81
|
+
}
|
|
82
|
+
disconnectedCallback() {
|
|
83
|
+
this.resizeObserver?.disconnect();
|
|
84
|
+
super.disconnectedCallback();
|
|
65
85
|
}
|
|
66
86
|
updated(changed) {
|
|
67
87
|
if (changed.has("isOpen")) {
|
|
68
|
-
this.
|
|
88
|
+
this.syncHeight();
|
|
69
89
|
}
|
|
70
90
|
}
|
|
71
|
-
|
|
72
|
-
const content = this.
|
|
73
|
-
".collapse-content"
|
|
74
|
-
);
|
|
91
|
+
syncHeight(immediate = false) {
|
|
92
|
+
const content = this.contentElement;
|
|
75
93
|
if (!content) return;
|
|
94
|
+
const height = content.scrollHeight;
|
|
95
|
+
this.observedHeight = height;
|
|
76
96
|
if (this.isOpen) {
|
|
77
|
-
|
|
97
|
+
if (immediate) {
|
|
98
|
+
this.maxHeight = `${height}px`;
|
|
99
|
+
} else {
|
|
100
|
+
if (this.maxHeight !== `${height}px`) this.maxHeight = `${height}px`;
|
|
101
|
+
}
|
|
78
102
|
} else {
|
|
79
|
-
this.maxHeight = `${
|
|
80
|
-
requestAnimationFrame(() =>
|
|
81
|
-
this.maxHeight = "0px";
|
|
82
|
-
});
|
|
103
|
+
this.maxHeight = `${height}px`;
|
|
104
|
+
requestAnimationFrame(() => this.maxHeight = "0px");
|
|
83
105
|
}
|
|
84
106
|
}
|
|
85
107
|
toggle() {
|
|
@@ -101,7 +123,7 @@ let LuksoCollapse = class extends TailwindElement {
|
|
|
101
123
|
@click=${() => !this.isDisabled && this.toggle()}
|
|
102
124
|
>
|
|
103
125
|
<span class=${label()}>${this.label}</span>
|
|
104
|
-
<div class="flex items-center
|
|
126
|
+
<div class="flex items-center">
|
|
105
127
|
${this.secondaryLabel ? x`<span class=${secondary()}>
|
|
106
128
|
${this.isOpen ? this.secondaryLabel.close : this.secondaryLabel.open}
|
|
107
129
|
</span>` : null}
|
|
@@ -113,8 +135,14 @@ let LuksoCollapse = class extends TailwindElement {
|
|
|
113
135
|
</div>
|
|
114
136
|
|
|
115
137
|
<!-- Content -->
|
|
116
|
-
<div
|
|
117
|
-
|
|
138
|
+
<div
|
|
139
|
+
class=${content()}
|
|
140
|
+
style="max-height:${this.maxHeight};"
|
|
141
|
+
@transitionend=${this.onTransitionEnd}
|
|
142
|
+
>
|
|
143
|
+
<div class="collapse-content">
|
|
144
|
+
<slot @slotchange=${() => this.syncHeight()}></slot>
|
|
145
|
+
</div>
|
|
118
146
|
</div>
|
|
119
147
|
</div>
|
|
120
148
|
`;
|
|
@@ -141,6 +169,12 @@ __decorateClass([
|
|
|
141
169
|
__decorateClass([
|
|
142
170
|
r()
|
|
143
171
|
], LuksoCollapse.prototype, "maxHeight", 2);
|
|
172
|
+
__decorateClass([
|
|
173
|
+
r()
|
|
174
|
+
], LuksoCollapse.prototype, "observedHeight", 2);
|
|
175
|
+
__decorateClass([
|
|
176
|
+
e(".collapse-content")
|
|
177
|
+
], LuksoCollapse.prototype, "contentElement", 2);
|
|
144
178
|
LuksoCollapse = __decorateClass([
|
|
145
179
|
t("lukso-collapse")
|
|
146
180
|
], LuksoCollapse);
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { Meta } from '@storybook/web-components-vite';
|
|
2
|
+
/** Documentation and examples of `lukso-collapse` component. */
|
|
2
3
|
declare const meta: Meta;
|
|
3
4
|
export default meta;
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
6
|
-
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
5
|
+
/** Example of `lukso-collapse` */
|
|
6
|
+
export declare const LuksoCollapse: any;
|
|
7
|
+
/** Example of lukso-collapse `open` by default */
|
|
8
|
+
export declare const CollapseOpen: any;
|
|
9
|
+
/** Example of lukso-collapse `disabled` */
|
|
10
|
+
export declare const CollapseDisabled: any;
|
|
11
|
+
/** Example of lukso-collapse with a `custom CSS class` */
|
|
12
|
+
export declare const CollapseWithCustomClass: any;
|
|
13
|
+
/** Example of lukso-collapse with `longer content` */
|
|
14
|
+
export declare const CollapseWithLongContent: any;
|
|
15
|
+
/** Example of lukso-collapse with a `selector` as content */
|
|
16
|
+
export declare const CollapseWithSelector: any;
|
|
9
17
|
//# sourceMappingURL=lukso-collapse.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lukso-collapse.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-collapse/lukso-collapse.stories.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAA;AAC1D,OAAO,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"lukso-collapse.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-collapse/lukso-collapse.stories.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAA;AAC1D,OAAO,SAAS,CAAA;AAChB,OAAO,uBAAuB,CAAA;AAE9B,iEAAiE;AACjE,QAAA,MAAM,IAAI,EAAE,IA+FX,CAAA;AAED,eAAe,IAAI,CAAA;AA4BnB,kCAAkC;AAClC,eAAO,MAAM,aAAa,KAAoB,CAAA;AAS9C,kDAAkD;AAClD,eAAO,MAAM,YAAY,KAAoB,CAAA;AAa7C,2CAA2C;AAC3C,eAAO,MAAM,gBAAgB,KAAoB,CAAA;AAUjD,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB,KAAoB,CAAA;AAYxD,sDAAsD;AACtD,eAAO,MAAM,uBAAuB,KAAoB,CAAA;AAqBxD,6DAA6D;AAC7D,eAAO,MAAM,oBAAoB,KAAoB,CAAA"}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
6
|
-
const property = require('../../property-
|
|
7
|
-
const state = require('../../state-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-DkfODalz.cjs');
|
|
6
|
+
const property = require('../../property-BXmHod5d.cjs');
|
|
7
|
+
const state = require('../../state-CW2YmM3f.cjs');
|
|
8
8
|
const index = require('../../index-CaJky2qL.cjs');
|
|
9
|
-
const styleMap = require('../../style-map-
|
|
9
|
+
const styleMap = require('../../style-map-c2S85yDu.cjs');
|
|
10
10
|
require('../../tailwind-config.cjs');
|
|
11
11
|
const cn = require('../../cn-CNdKneQ1.cjs');
|
|
12
12
|
require('../lukso-icon/index.cjs');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, E, x } from '../../index-
|
|
2
|
-
import { n, t } from '../../property-
|
|
3
|
-
import { r } from '../../state-
|
|
1
|
+
import { T as TailwindStyledElement, E, x } from '../../index-C9vH8YlV.js';
|
|
2
|
+
import { n, t } from '../../property-B4XYi6Sk.js';
|
|
3
|
+
import { r } from '../../state-CkvZ4IP8.js';
|
|
4
4
|
import { c as ce } from '../../index-B9iart53.js';
|
|
5
|
-
import { o } from '../../style-map-
|
|
5
|
+
import { o } from '../../style-map-D1R4wi4h.js';
|
|
6
6
|
import '../../tailwind-config.js';
|
|
7
7
|
import { c as cn } from '../../cn-Cu9aP49j.js';
|
|
8
8
|
import '../lukso-icon/index.js';
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
6
|
-
const property = require('../../property-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-DkfODalz.cjs');
|
|
6
|
+
const property = require('../../property-BXmHod5d.cjs');
|
|
7
7
|
const index = require('../../index-CaJky2qL.cjs');
|
|
8
8
|
require('../lukso-icon/index.cjs');
|
|
9
|
-
require('../../index-
|
|
10
|
-
require('../../index-
|
|
9
|
+
require('../../index-U4Y7KwZv.cjs');
|
|
10
|
+
require('../../index-fSZGRljb.cjs');
|
|
11
11
|
const uniqId = require('../../uniq-id-Cszs24DQ.cjs');
|
|
12
12
|
|
|
13
13
|
const debounceFunction = (func, timeout = 100) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, E, x } from '../../index-
|
|
2
|
-
import { n, t } from '../../property-
|
|
1
|
+
import { T as TailwindStyledElement, E, x } from '../../index-C9vH8YlV.js';
|
|
2
|
+
import { n, t } from '../../property-B4XYi6Sk.js';
|
|
3
3
|
import { c as ce } from '../../index-B9iart53.js';
|
|
4
4
|
import '../lukso-icon/index.js';
|
|
5
|
-
import '../../index-
|
|
6
|
-
import '../../index-
|
|
5
|
+
import '../../index-CvWyP3CS.js';
|
|
6
|
+
import '../../index-6Bz9XVC3.js';
|
|
7
7
|
import { u as uniqId } from '../../uniq-id-CGUN-pJV.js';
|
|
8
8
|
|
|
9
9
|
const debounceFunction = (func, timeout = 100) => {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
6
|
-
const property = require('../../property-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-DkfODalz.cjs');
|
|
6
|
+
const property = require('../../property-BXmHod5d.cjs');
|
|
7
7
|
const index = require('../../index-CaJky2qL.cjs');
|
|
8
8
|
|
|
9
9
|
const style = ":host {\n display: block\n}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, x } from '../../index-
|
|
2
|
-
import { n, t } from '../../property-
|
|
1
|
+
import { T as TailwindStyledElement, x } from '../../index-C9vH8YlV.js';
|
|
2
|
+
import { n, t } from '../../property-B4XYi6Sk.js';
|
|
3
3
|
import { c as ce } from '../../index-B9iart53.js';
|
|
4
4
|
|
|
5
5
|
const style = ":host {\n display: block\n}";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
6
|
-
const property = require('../../property-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-DkfODalz.cjs');
|
|
6
|
+
const property = require('../../property-BXmHod5d.cjs');
|
|
7
7
|
|
|
8
8
|
var __defProp = Object.defineProperty;
|
|
9
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as TailwindElement, x } from '../../index-
|
|
2
|
-
import { n, t } from '../../property-
|
|
1
|
+
import { a as TailwindElement, x } from '../../index-C9vH8YlV.js';
|
|
2
|
+
import { n, t } from '../../property-B4XYi6Sk.js';
|
|
3
3
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|