vira 29.5.1 → 29.5.3

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.
@@ -13,4 +13,4 @@ export declare const ViraCollapsibleWrapper: import("element-vir").DeclarativeEl
13
13
  contentHeight: number;
14
14
  }, {
15
15
  expandChange: import("element-vir").DefineEvent<boolean>;
16
- }, "vira-collapsible-wrapper-expanded" | "vira-collapsible-wrapper-expand-on-print", "vira-collapsible-wrapper-", readonly ["header"], readonly []>;
16
+ }, "vira-collapsible-wrapper-expand-on-print", "vira-collapsible-wrapper-", readonly ["header"], readonly []>;
@@ -1,5 +1,5 @@
1
- import { css, defineElementEvent, html, listen, onResize } from 'element-vir';
2
- import { noNativeFormStyles, viraAnimationDurations } from '../styles/index.js';
1
+ import { classMap, css, defineElementEvent, html, listen, onResize } from 'element-vir';
2
+ import { noNativeFormStyles, noUserSelect, viraAnimationDurations } from '../styles/index.js';
3
3
  import { defineViraElement } from './define-vira-element.js';
4
4
  /**
5
5
  * A wrapper element that can collapse and expand to fit its content dynamically and efficiently.
@@ -16,7 +16,6 @@ export const ViraCollapsibleWrapper = defineViraElement()({
16
16
  };
17
17
  },
18
18
  hostClasses: {
19
- 'vira-collapsible-wrapper-expanded': ({ inputs }) => inputs.expanded,
20
19
  'vira-collapsible-wrapper-expand-on-print': ({ inputs }) => !!inputs.expandOnPrint,
21
20
  },
22
21
  slotNames: ['header'],
@@ -41,9 +40,10 @@ export const ViraCollapsibleWrapper = defineViraElement()({
41
40
  .collapsing-element {
42
41
  transition: height ${viraAnimationDurations['vira-pretty-animation-duration'].value};
43
42
  overflow: hidden;
44
- }
45
- ${hostClasses['vira-collapsible-wrapper-expanded'].name} .collapsing-element {
46
- pointer-events: none;
43
+
44
+ &.collapsed {
45
+ ${noUserSelect}
46
+ }
47
47
  }
48
48
 
49
49
  @media print {
@@ -76,7 +76,13 @@ export const ViraCollapsibleWrapper = defineViraElement()({
76
76
  <slot name=${slotNames.header}>Header</slot>
77
77
  </button>
78
78
 
79
- <div class="collapsing-element" style=${collapsingStyles} disabled="disabled">
79
+ <div
80
+ class="collapsing-element ${classMap({
81
+ collapsed: !inputs.expanded,
82
+ })}"
83
+ style=${collapsingStyles}
84
+ disabled="disabled"
85
+ >
80
86
  <div
81
87
  ${onResize(({ contentRect }) => {
82
88
  updateState({ contentHeight: contentRect.height });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vira",
3
- "version": "29.5.1",
3
+ "version": "29.5.3",
4
4
  "description": "A simple and highly versatile design system using element-vir.",
5
5
  "keywords": [
6
6
  "design",