@lukso/web-components 1.151.0 → 1.153.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 (91) hide show
  1. package/dist/components/index.cjs +9 -4
  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 +5 -4
  5. package/dist/components/lukso-button/index.cjs +3 -3
  6. package/dist/components/lukso-button/index.js +3 -3
  7. package/dist/components/lukso-card/index.cjs +7 -7
  8. package/dist/components/lukso-card/index.js +7 -7
  9. package/dist/components/lukso-checkbox/index.cjs +3 -3
  10. package/dist/components/lukso-checkbox/index.js +3 -3
  11. package/dist/components/lukso-collapse/index.cjs +150 -0
  12. package/dist/components/lukso-collapse/index.d.ts +25 -0
  13. package/dist/components/lukso-collapse/index.d.ts.map +1 -0
  14. package/dist/components/lukso-collapse/index.js +148 -0
  15. package/dist/components/lukso-collapse/lukso-collapse.stories.d.ts +10 -0
  16. package/dist/components/lukso-collapse/lukso-collapse.stories.d.ts.map +1 -0
  17. package/dist/components/lukso-color-picker/index.cjs +4 -4
  18. package/dist/components/lukso-color-picker/index.js +4 -4
  19. package/dist/components/lukso-dropdown/index.cjs +4 -4
  20. package/dist/components/lukso-dropdown/index.js +4 -4
  21. package/dist/components/lukso-dropdown-option/index.cjs +2 -2
  22. package/dist/components/lukso-dropdown-option/index.js +2 -2
  23. package/dist/components/lukso-footer/index.cjs +2 -2
  24. package/dist/components/lukso-footer/index.js +2 -2
  25. package/dist/components/lukso-icon/index.cjs +3 -3
  26. package/dist/components/lukso-icon/index.js +3 -3
  27. package/dist/components/lukso-image/index.cjs +4 -4
  28. package/dist/components/lukso-image/index.js +4 -4
  29. package/dist/components/lukso-input/index.cjs +3 -3
  30. package/dist/components/lukso-input/index.js +3 -3
  31. package/dist/components/lukso-modal/index.cjs +2 -2
  32. package/dist/components/lukso-modal/index.js +2 -2
  33. package/dist/components/lukso-navbar/index.cjs +3 -3
  34. package/dist/components/lukso-navbar/index.js +3 -3
  35. package/dist/components/lukso-pagination/index.cjs +3 -3
  36. package/dist/components/lukso-pagination/index.js +3 -3
  37. package/dist/components/lukso-profile/index.cjs +3 -3
  38. package/dist/components/lukso-profile/index.js +3 -3
  39. package/dist/components/lukso-progress/index.cjs +3 -3
  40. package/dist/components/lukso-progress/index.js +3 -3
  41. package/dist/components/lukso-radio/index.cjs +3 -3
  42. package/dist/components/lukso-radio/index.js +3 -3
  43. package/dist/components/lukso-radio-group/index.cjs +3 -3
  44. package/dist/components/lukso-radio-group/index.js +3 -3
  45. package/dist/components/lukso-sanitize/index.cjs +2 -2
  46. package/dist/components/lukso-sanitize/index.js +2 -2
  47. package/dist/components/lukso-search/index.cjs +6 -6
  48. package/dist/components/lukso-search/index.js +6 -6
  49. package/dist/components/lukso-select/index.cjs +5 -5
  50. package/dist/components/lukso-select/index.js +5 -5
  51. package/dist/components/lukso-share/index.cjs +2 -2
  52. package/dist/components/lukso-share/index.js +2 -2
  53. package/dist/components/lukso-switch/index.cjs +3 -3
  54. package/dist/components/lukso-switch/index.js +3 -3
  55. package/dist/components/lukso-tag/index.cjs +3 -3
  56. package/dist/components/lukso-tag/index.js +3 -3
  57. package/dist/components/lukso-terms/index.cjs +3 -3
  58. package/dist/components/lukso-terms/index.js +3 -3
  59. package/dist/components/lukso-textarea/index.cjs +3 -3
  60. package/dist/components/lukso-textarea/index.js +3 -3
  61. package/dist/components/lukso-tooltip/index.cjs +3 -3
  62. package/dist/components/lukso-tooltip/index.js +3 -3
  63. package/dist/components/lukso-username/index.cjs +5 -5
  64. package/dist/components/lukso-username/index.js +5 -5
  65. package/dist/components/lukso-wizard/index.cjs +2 -2
  66. package/dist/components/lukso-wizard/index.js +2 -2
  67. package/dist/{index-nQ4LOAB_.js → index-6Bz9XVC3.js} +4 -4
  68. package/dist/{index-DFCjzim8.js → index-C9vH8YlV.js} +1 -1
  69. package/dist/{index-Dv2LId9u.js → index-CvWyP3CS.js} +2 -2
  70. package/dist/{index-BMuX92jU.js → index-DUwutUFV.js} +5 -5
  71. package/dist/{index-C8BtW2E5.cjs → index-Dg9hcDqR.cjs} +5 -5
  72. package/dist/{index-ClAf3gfo.cjs → index-DkfODalz.cjs} +1 -1
  73. package/dist/{index-c1uDSwY7.cjs → index-U4Y7KwZv.cjs} +2 -2
  74. package/dist/{index-D04k1aOk.cjs → index-fSZGRljb.cjs} +4 -4
  75. package/dist/{index-DhBkXd96.js → index-gJTlTDGh.js} +1 -1
  76. package/dist/{index-BowjCXFs.cjs → index-m3XGqZFz.cjs} +1 -1
  77. package/dist/index.cjs +9 -4
  78. package/dist/index.js +5 -4
  79. package/dist/{isAddress-CmQX7QJh.cjs → isAddress-B3b91Jxf.cjs} +1 -1
  80. package/dist/{isAddress-Dwch1XE4.js → isAddress-Dq9UN07g.js} +1 -1
  81. package/dist/{property-D2sYKbRI.js → property-B4XYi6Sk.js} +1 -1
  82. package/dist/{property-4wWsjv_3.cjs → property-BXmHod5d.cjs} +1 -1
  83. package/dist/shared/tailwind-element/index.cjs +1 -1
  84. package/dist/shared/tailwind-element/index.js +1 -1
  85. package/dist/{state-CbQ1YSsw.cjs → state-CW2YmM3f.cjs} +1 -1
  86. package/dist/{state-BO7uqVYX.js → state-CkvZ4IP8.js} +1 -1
  87. package/dist/{style-map-V1HGVVW5.js → style-map-D1R4wi4h.js} +1 -1
  88. package/dist/{style-map-BPcLqFw4.cjs → style-map-c2S85yDu.cjs} +1 -1
  89. package/package.json +6 -1
  90. package/tools/index.cjs +1 -1
  91. package/tools/index.js +1 -1
@@ -5,6 +5,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
5
  const components_luksoButton_index = require('./lukso-button/index.cjs');
6
6
  const components_luksoCard_index = require('./lukso-card/index.cjs');
7
7
  const components_luksoCheckbox_index = require('./lukso-checkbox/index.cjs');
8
+ const components_luksoCollapse_index = require('./lukso-collapse/index.cjs');
8
9
  const components_luksoColorPicker_index = require('./lukso-color-picker/index.cjs');
9
10
  const components_luksoDropdown_index = require('./lukso-dropdown/index.cjs');
10
11
  const components_luksoDropdownOption_index = require('./lukso-dropdown-option/index.cjs');
@@ -15,12 +16,12 @@ const components_luksoInput_index = require('./lukso-input/index.cjs');
15
16
  const components_luksoModal_index = require('./lukso-modal/index.cjs');
16
17
  const components_luksoNavbar_index = require('./lukso-navbar/index.cjs');
17
18
  const components_luksoPagination_index = require('./lukso-pagination/index.cjs');
18
- const components_luksoProfile_index = require('../index-c1uDSwY7.cjs');
19
+ const components_luksoProfile_index = require('../index-U4Y7KwZv.cjs');
19
20
  const components_luksoProgress_index = require('./lukso-progress/index.cjs');
20
21
  const components_luksoRadio_index = require('./lukso-radio/index.cjs');
21
22
  const components_luksoRadioGroup_index = require('./lukso-radio-group/index.cjs');
22
23
  const components_luksoSanitize_index = require('./lukso-sanitize/index.cjs');
23
- const components_luksoSearch_index = require('../index-C8BtW2E5.cjs');
24
+ const components_luksoSearch_index = require('../index-Dg9hcDqR.cjs');
24
25
  const components_luksoSelect_index = require('./lukso-select/index.cjs');
25
26
  const components_luksoShare_index = require('./lukso-share/index.cjs');
26
27
  const components_luksoSwitch_index = require('./lukso-switch/index.cjs');
@@ -28,9 +29,9 @@ const components_luksoTag_index = require('./lukso-tag/index.cjs');
28
29
  const components_luksoTerms_index = require('./lukso-terms/index.cjs');
29
30
  const components_luksoTextarea_index = require('./lukso-textarea/index.cjs');
30
31
  const components_luksoTooltip_index = require('./lukso-tooltip/index.cjs');
31
- const components_luksoUsername_index = require('../index-D04k1aOk.cjs');
32
+ const components_luksoUsername_index = require('../index-fSZGRljb.cjs');
32
33
  const components_luksoWizard_index = require('./lukso-wizard/index.cjs');
33
- const shared_tailwindElement_index = require('../index-ClAf3gfo.cjs');
34
+ const shared_tailwindElement_index = require('../index-DkfODalz.cjs');
34
35
  require('../cn-CNdKneQ1.cjs');
35
36
 
36
37
 
@@ -47,6 +48,10 @@ Object.defineProperty(exports, "LuksoCheckbox", {
47
48
  enumerable: true,
48
49
  get: () => components_luksoCheckbox_index.LuksoCheckbox
49
50
  });
51
+ Object.defineProperty(exports, "LuksoCollapse", {
52
+ enumerable: true,
53
+ get: () => components_luksoCollapse_index.LuksoCollapse
54
+ });
50
55
  Object.defineProperty(exports, "LuksoColorPicker", {
51
56
  enumerable: true,
52
57
  get: () => components_luksoColorPicker_index.LuksoColorPicker
@@ -1,6 +1,7 @@
1
1
  export * from './lukso-button/index';
2
2
  export * from './lukso-card/index';
3
3
  export * from './lukso-checkbox/index';
4
+ export * from './lukso-collapse/index';
4
5
  export * from './lukso-color-picker/index';
5
6
  export * from './lukso-dropdown/index';
6
7
  export * from './lukso-dropdown-option/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,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,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,wBAAwB,CAAA;AACtC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA"}
@@ -1,6 +1,7 @@
1
1
  export { LuksoButton } from './lukso-button/index.js';
2
2
  export { LuksoCard } from './lukso-card/index.js';
3
3
  export { LuksoCheckbox } from './lukso-checkbox/index.js';
4
+ export { LuksoCollapse } from './lukso-collapse/index.js';
4
5
  export { LuksoColorPicker } from './lukso-color-picker/index.js';
5
6
  export { LuksoDropdown } from './lukso-dropdown/index.js';
6
7
  export { LuksoDropdownOption } from './lukso-dropdown-option/index.js';
@@ -11,12 +12,12 @@ export { LuksoInput } from './lukso-input/index.js';
11
12
  export { LuksoModal } from './lukso-modal/index.js';
12
13
  export { LuksoNavbar } from './lukso-navbar/index.js';
13
14
  export { LuksoPagination } from './lukso-pagination/index.js';
14
- export { L as LuksoProfile } from '../index-Dv2LId9u.js';
15
+ export { L as LuksoProfile } from '../index-CvWyP3CS.js';
15
16
  export { LuksoProgress } from './lukso-progress/index.js';
16
17
  export { LuksoRadio } from './lukso-radio/index.js';
17
18
  export { LuksoRadioGroup } from './lukso-radio-group/index.js';
18
19
  export { LuksoSanitize } from './lukso-sanitize/index.js';
19
- export { L as LuksoSearch } from '../index-BMuX92jU.js';
20
+ export { L as LuksoSearch } from '../index-DUwutUFV.js';
20
21
  export { LuksoSelect } from './lukso-select/index.js';
21
22
  export { LuksoShare } from './lukso-share/index.js';
22
23
  export { LuksoSwitch } from './lukso-switch/index.js';
@@ -24,7 +25,7 @@ export { LuksoTag } from './lukso-tag/index.js';
24
25
  export { LuksoTerms } from './lukso-terms/index.js';
25
26
  export { LuksoTextarea } from './lukso-textarea/index.js';
26
27
  export { LuksoTooltip } from './lukso-tooltip/index.js';
27
- export { L as LuksoUsername } from '../index-nQ4LOAB_.js';
28
+ export { L as LuksoUsername } from '../index-6Bz9XVC3.js';
28
29
  export { LuksoWizard } from './lukso-wizard/index.js';
29
- export { a as TailwindElement, T as TailwindStyledElement } from '../index-DFCjzim8.js';
30
+ export { a as TailwindElement, T as TailwindStyledElement } from '../index-C9vH8YlV.js';
30
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-ClAf3gfo.cjs');
6
- const property = require('../../property-4wWsjv_3.cjs');
7
- const state = require('../../state-CbQ1YSsw.cjs');
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-DFCjzim8.js';
2
- import { n, t } from '../../property-D2sYKbRI.js';
3
- import { r } from '../../state-BO7uqVYX.js';
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,16 +2,16 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const components_luksoProfile_index = require('../../index-c1uDSwY7.cjs');
6
- const shared_tailwindElement_index = require('../../index-ClAf3gfo.cjs');
7
- const property = require('../../property-4wWsjv_3.cjs');
8
- const state = require('../../state-CbQ1YSsw.cjs');
9
- const styleMap = require('../../style-map-BPcLqFw4.cjs');
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 styleMap = require('../../style-map-c2S85yDu.cjs');
10
10
  const index = require('../../index-CaJky2qL.cjs');
11
11
  require('../../tailwind-config.cjs');
12
12
  const cn = require('../../cn-CNdKneQ1.cjs');
13
- const isAddress = require('../../isAddress-CmQX7QJh.cjs');
14
- const index$1 = require('../../index-BowjCXFs.cjs');
13
+ const isAddress = require('../../isAddress-B3b91Jxf.cjs');
14
+ const index$1 = require('../../index-m3XGqZFz.cjs');
15
15
  require('../lukso-image/index.cjs');
16
16
 
17
17
  /**
@@ -1,13 +1,13 @@
1
- import { m as makeBlockie } from '../../index-Dv2LId9u.js';
2
- import { T as TailwindStyledElement, x, E } from '../../index-DFCjzim8.js';
3
- import { n, t } from '../../property-D2sYKbRI.js';
4
- import { r } from '../../state-BO7uqVYX.js';
5
- import { o as o$1 } from '../../style-map-V1HGVVW5.js';
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 { o as o$1 } from '../../style-map-D1R4wi4h.js';
6
6
  import { c as ce } from '../../index-B9iart53.js';
7
7
  import '../../tailwind-config.js';
8
8
  import { c as cn } from '../../cn-Cu9aP49j.js';
9
- import { i as isAddress } from '../../isAddress-Dwch1XE4.js';
10
- import { c as customStyleMap } from '../../index-DhBkXd96.js';
9
+ import { i as isAddress } from '../../isAddress-Dq9UN07g.js';
10
+ import { c as customStyleMap } from '../../index-gJTlTDGh.js';
11
11
  import '../lukso-image/index.js';
12
12
 
13
13
  /**
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-ClAf3gfo.cjs');
6
- const property = require('../../property-4wWsjv_3.cjs');
7
- const state = require('../../state-CbQ1YSsw.cjs');
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-DFCjzim8.js';
2
- import { n, t } from '../../property-D2sYKbRI.js';
3
- import { r } from '../../state-BO7uqVYX.js';
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;
@@ -0,0 +1,150 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
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 index = require('../../index-CaJky2qL.cjs');
9
+ require('../../tailwind-config.cjs');
10
+ const cn = require('../../cn-CNdKneQ1.cjs');
11
+ require('../lukso-icon/index.cjs');
12
+
13
+ var __defProp = Object.defineProperty;
14
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
+ var __decorateClass = (decorators, target, key, kind) => {
16
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
17
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
18
+ if (decorator = decorators[i])
19
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
20
+ if (kind && result) __defProp(target, key, result);
21
+ return result;
22
+ };
23
+ exports.LuksoCollapse = class LuksoCollapse extends shared_tailwindElement_index.TailwindElement {
24
+ constructor() {
25
+ super(...arguments);
26
+ this.label = "";
27
+ this.secondaryLabel = {
28
+ open: "",
29
+ close: ""
30
+ };
31
+ this.isOpen = false;
32
+ this.customClass = "";
33
+ this.isDisabled = false;
34
+ this.icon = "";
35
+ this.maxHeight = "0px";
36
+ this.collapseStyles = index.ce({
37
+ slots: {
38
+ base: "hover:border-neutral-35 ransition transition-all duration-150",
39
+ header: "flex items-center justify-between cursor-pointer ml-3 py-2",
40
+ label: "text-neutral-45 paragraph-inter-14-semi-bold",
41
+ secondary: "text-neutral-45 paragraph-inter-14-semi-bold",
42
+ icon: "transition cursor-pointer mr-3",
43
+ content: "transition-all duration-250 ease-in-out"
44
+ },
45
+ variants: {
46
+ isOpen: {
47
+ true: {
48
+ icon: "rotate-180",
49
+ content: "opacity-100"
50
+ },
51
+ false: {
52
+ content: "opacity-0"
53
+ }
54
+ },
55
+ isDisabled: {
56
+ true: {
57
+ base: "opacity-60",
58
+ header: "cursor-not-allowed",
59
+ icon: "opacity-60 cursor-not-allowed"
60
+ }
61
+ }
62
+ }
63
+ });
64
+ }
65
+ firstUpdated() {
66
+ if (this.isOpen) {
67
+ this.updateHeight();
68
+ }
69
+ }
70
+ updated(changed) {
71
+ if (changed.has("isOpen")) {
72
+ this.updateHeight();
73
+ }
74
+ }
75
+ updateHeight() {
76
+ const content = this.renderRoot.querySelector(
77
+ ".collapse-content"
78
+ );
79
+ if (!content) return;
80
+ if (this.isOpen) {
81
+ this.maxHeight = `${content.scrollHeight}px`;
82
+ } else {
83
+ this.maxHeight = `${content.scrollHeight}px`;
84
+ requestAnimationFrame(() => {
85
+ this.maxHeight = "0px";
86
+ });
87
+ }
88
+ }
89
+ toggle() {
90
+ this.isOpen = !this.isOpen;
91
+ this.dispatchEvent(
92
+ new CustomEvent("toggle", { detail: { open: this.isOpen } })
93
+ );
94
+ }
95
+ render() {
96
+ const { base, header, label, secondary, icon, content } = this.collapseStyles({
97
+ isOpen: this.isOpen,
98
+ isDisabled: this.isDisabled
99
+ });
100
+ return shared_tailwindElement_index.x`
101
+ <div class=${cn.cn(base(), this.customClass)}>
102
+ <!-- Header -->
103
+ <div
104
+ class=${header()}
105
+ @click=${() => !this.isDisabled && this.toggle()}
106
+ >
107
+ <span class=${label()}>${this.label}</span>
108
+ <div class="flex items-center">
109
+ ${this.secondaryLabel ? shared_tailwindElement_index.x`<span class=${secondary()}>
110
+ ${this.isOpen ? this.secondaryLabel.close : this.secondaryLabel.open}
111
+ </span>` : null}
112
+ ${this.icon ? shared_tailwindElement_index.x`<lukso-icon
113
+ name=${this.icon}
114
+ class=${icon()}
115
+ ></lukso-icon>` : null}
116
+ </div>
117
+ </div>
118
+
119
+ <!-- Content -->
120
+ <div class=${content()} style="max-height:${this.maxHeight};">
121
+ <div class="collapse-content"><slot></slot></div>
122
+ </div>
123
+ </div>
124
+ `;
125
+ }
126
+ };
127
+ __decorateClass([
128
+ property.n({ type: String })
129
+ ], exports.LuksoCollapse.prototype, "label", 2);
130
+ __decorateClass([
131
+ property.n({ type: Object, attribute: "secondary-label" })
132
+ ], exports.LuksoCollapse.prototype, "secondaryLabel", 2);
133
+ __decorateClass([
134
+ property.n({ type: Boolean, attribute: "is-open" })
135
+ ], exports.LuksoCollapse.prototype, "isOpen", 2);
136
+ __decorateClass([
137
+ property.n({ type: String, attribute: "custom-class" })
138
+ ], exports.LuksoCollapse.prototype, "customClass", 2);
139
+ __decorateClass([
140
+ property.n({ type: Boolean, attribute: "is-disabled" })
141
+ ], exports.LuksoCollapse.prototype, "isDisabled", 2);
142
+ __decorateClass([
143
+ property.n({ type: String, attribute: "icon" })
144
+ ], exports.LuksoCollapse.prototype, "icon", 2);
145
+ __decorateClass([
146
+ state.r()
147
+ ], exports.LuksoCollapse.prototype, "maxHeight", 2);
148
+ exports.LuksoCollapse = __decorateClass([
149
+ property.t("lukso-collapse")
150
+ ], exports.LuksoCollapse);
@@ -0,0 +1,25 @@
1
+ import { TailwindElement } from '../../shared/tailwind-element';
2
+ export declare class LuksoCollapse extends TailwindElement {
3
+ label: string;
4
+ secondaryLabel: {
5
+ open: string;
6
+ close: string;
7
+ };
8
+ isOpen: boolean;
9
+ customClass: string;
10
+ isDisabled: boolean;
11
+ icon: string;
12
+ private maxHeight;
13
+ firstUpdated(): void;
14
+ updated(changed: Map<string, unknown>): void;
15
+ private updateHeight;
16
+ private toggle;
17
+ private collapseStyles;
18
+ render(): import('lit-html').TemplateResult<1>;
19
+ }
20
+ declare global {
21
+ interface HTMLElementTagNameMap {
22
+ 'lukso-collapse': LuksoCollapse;
23
+ }
24
+ }
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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;IAElC,YAAY;IAMZ,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAMrC,OAAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,MAAM;IAOd,OAAO,CAAC,cAAc,CA2BpB;IAEF,MAAM;CAuCP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAA;KAChC;CACF"}
@@ -0,0 +1,148 @@
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 { c as ce } from '../../index-B9iart53.js';
5
+ import '../../tailwind-config.js';
6
+ import { c as cn } from '../../cn-Cu9aP49j.js';
7
+ import '../lukso-icon/index.js';
8
+
9
+ var __defProp = Object.defineProperty;
10
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11
+ var __decorateClass = (decorators, target, key, kind) => {
12
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
13
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
14
+ if (decorator = decorators[i])
15
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
16
+ if (kind && result) __defProp(target, key, result);
17
+ return result;
18
+ };
19
+ let LuksoCollapse = class extends TailwindElement {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.label = "";
23
+ this.secondaryLabel = {
24
+ open: "",
25
+ close: ""
26
+ };
27
+ this.isOpen = false;
28
+ this.customClass = "";
29
+ this.isDisabled = false;
30
+ this.icon = "";
31
+ this.maxHeight = "0px";
32
+ this.collapseStyles = ce({
33
+ slots: {
34
+ base: "hover:border-neutral-35 ransition transition-all duration-150",
35
+ header: "flex items-center justify-between cursor-pointer ml-3 py-2",
36
+ label: "text-neutral-45 paragraph-inter-14-semi-bold",
37
+ secondary: "text-neutral-45 paragraph-inter-14-semi-bold",
38
+ icon: "transition cursor-pointer mr-3",
39
+ content: "transition-all duration-250 ease-in-out"
40
+ },
41
+ variants: {
42
+ isOpen: {
43
+ true: {
44
+ icon: "rotate-180",
45
+ content: "opacity-100"
46
+ },
47
+ false: {
48
+ content: "opacity-0"
49
+ }
50
+ },
51
+ isDisabled: {
52
+ true: {
53
+ base: "opacity-60",
54
+ header: "cursor-not-allowed",
55
+ icon: "opacity-60 cursor-not-allowed"
56
+ }
57
+ }
58
+ }
59
+ });
60
+ }
61
+ firstUpdated() {
62
+ if (this.isOpen) {
63
+ this.updateHeight();
64
+ }
65
+ }
66
+ updated(changed) {
67
+ if (changed.has("isOpen")) {
68
+ this.updateHeight();
69
+ }
70
+ }
71
+ updateHeight() {
72
+ const content = this.renderRoot.querySelector(
73
+ ".collapse-content"
74
+ );
75
+ if (!content) return;
76
+ if (this.isOpen) {
77
+ this.maxHeight = `${content.scrollHeight}px`;
78
+ } else {
79
+ this.maxHeight = `${content.scrollHeight}px`;
80
+ requestAnimationFrame(() => {
81
+ this.maxHeight = "0px";
82
+ });
83
+ }
84
+ }
85
+ toggle() {
86
+ this.isOpen = !this.isOpen;
87
+ this.dispatchEvent(
88
+ new CustomEvent("toggle", { detail: { open: this.isOpen } })
89
+ );
90
+ }
91
+ render() {
92
+ const { base, header, label, secondary, icon, content } = this.collapseStyles({
93
+ isOpen: this.isOpen,
94
+ isDisabled: this.isDisabled
95
+ });
96
+ return x`
97
+ <div class=${cn(base(), this.customClass)}>
98
+ <!-- Header -->
99
+ <div
100
+ class=${header()}
101
+ @click=${() => !this.isDisabled && this.toggle()}
102
+ >
103
+ <span class=${label()}>${this.label}</span>
104
+ <div class="flex items-center">
105
+ ${this.secondaryLabel ? x`<span class=${secondary()}>
106
+ ${this.isOpen ? this.secondaryLabel.close : this.secondaryLabel.open}
107
+ </span>` : null}
108
+ ${this.icon ? x`<lukso-icon
109
+ name=${this.icon}
110
+ class=${icon()}
111
+ ></lukso-icon>` : null}
112
+ </div>
113
+ </div>
114
+
115
+ <!-- Content -->
116
+ <div class=${content()} style="max-height:${this.maxHeight};">
117
+ <div class="collapse-content"><slot></slot></div>
118
+ </div>
119
+ </div>
120
+ `;
121
+ }
122
+ };
123
+ __decorateClass([
124
+ n({ type: String })
125
+ ], LuksoCollapse.prototype, "label", 2);
126
+ __decorateClass([
127
+ n({ type: Object, attribute: "secondary-label" })
128
+ ], LuksoCollapse.prototype, "secondaryLabel", 2);
129
+ __decorateClass([
130
+ n({ type: Boolean, attribute: "is-open" })
131
+ ], LuksoCollapse.prototype, "isOpen", 2);
132
+ __decorateClass([
133
+ n({ type: String, attribute: "custom-class" })
134
+ ], LuksoCollapse.prototype, "customClass", 2);
135
+ __decorateClass([
136
+ n({ type: Boolean, attribute: "is-disabled" })
137
+ ], LuksoCollapse.prototype, "isDisabled", 2);
138
+ __decorateClass([
139
+ n({ type: String, attribute: "icon" })
140
+ ], LuksoCollapse.prototype, "icon", 2);
141
+ __decorateClass([
142
+ r()
143
+ ], LuksoCollapse.prototype, "maxHeight", 2);
144
+ LuksoCollapse = __decorateClass([
145
+ t("lukso-collapse")
146
+ ], LuksoCollapse);
147
+
148
+ export { LuksoCollapse };
@@ -0,0 +1,10 @@
1
+ import { Meta } from '@storybook/web-components-vite';
2
+ declare const meta: Meta;
3
+ export default meta;
4
+ export declare const DefaultClosed: any;
5
+ export declare const DefaultOpen: any;
6
+ export declare const DefaultDisabled: any;
7
+ export declare const WithCustomClass: any;
8
+ export declare const WithLongContent: any;
9
+ export declare const WithSelector: any;
10
+ //# sourceMappingURL=lukso-collapse.stories.d.ts.map
@@ -0,0 +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;AAChB,OAAO,uBAAuB,CAAA;AAE9B,QAAA,MAAM,IAAI,EAAE,IAuFX,CAAA;AAED,eAAe,IAAI,CAAA;AA4BnB,eAAO,MAAM,aAAa,KAAoB,CAAA;AAS9C,eAAO,MAAM,WAAW,KAAoB,CAAA;AAQ5C,eAAO,MAAM,eAAe,KAAoB,CAAA;AAUhD,eAAO,MAAM,eAAe,KAAoB,CAAA;AAOhD,eAAO,MAAM,eAAe,KAAoB,CAAA;AAqBhD,eAAO,MAAM,YAAY,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-ClAf3gfo.cjs');
6
- const property = require('../../property-4wWsjv_3.cjs');
7
- const state = require('../../state-CbQ1YSsw.cjs');
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-BPcLqFw4.cjs');
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-DFCjzim8.js';
2
- import { n, t } from '../../property-D2sYKbRI.js';
3
- import { r } from '../../state-BO7uqVYX.js';
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-V1HGVVW5.js';
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-ClAf3gfo.cjs');
6
- const property = require('../../property-4wWsjv_3.cjs');
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-c1uDSwY7.cjs');
10
- require('../../index-D04k1aOk.cjs');
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-DFCjzim8.js';
2
- import { n, t } from '../../property-D2sYKbRI.js';
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-Dv2LId9u.js';
6
- import '../../index-nQ4LOAB_.js';
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-ClAf3gfo.cjs');
6
- const property = require('../../property-4wWsjv_3.cjs');
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-DFCjzim8.js';
2
- import { n, t } from '../../property-D2sYKbRI.js';
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-ClAf3gfo.cjs');
6
- const property = require('../../property-4wWsjv_3.cjs');
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-DFCjzim8.js';
2
- import { n, t } from '../../property-D2sYKbRI.js';
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;