@sebgroup/green-core 3.12.3 → 3.12.5

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.
@@ -19,6 +19,7 @@ declare const GdsDetails_base: (new (...args: any[]) => import("../../utils/mixi
19
19
  export declare class GdsDetails extends GdsDetails_base {
20
20
  #private;
21
21
  static styles: (import("lit").CSSResult | import("lit").CSSResult[])[];
22
+ private _isAnimating;
22
23
  /**
23
24
  * The summary text displayed in the details header
24
25
  */
@@ -3,8 +3,8 @@ import {
3
3
  __privateAdd,
4
4
  __privateGet
5
5
  } from "../../chunks/chunk.CAV4X6PU.js";
6
- var _handleToggle, _handleKeydown, _syncGroupState, _dispatchStateEvent, _renderHeader, _renderIconButton, _renderContent;
7
- import { property, query } from "lit/decorators.js";
6
+ var _handleToggle, _handleKeydown, _syncGroupState, _dispatchStateEvent, _handleContentTransitionEnd, _renderHeader, _renderIconButton, _renderContent;
7
+ import { property, query, state } from "lit/decorators.js";
8
8
  import { classMap } from "lit/directives/class-map.js";
9
9
  import { GdsElement } from "../../gds-element.js";
10
10
  import { tokens } from "../../tokens.style.js";
@@ -27,6 +27,7 @@ let GdsDetails = class extends withSizeXProps(
27
27
  ) {
28
28
  constructor() {
29
29
  super(...arguments);
30
+ this._isAnimating = false;
30
31
  this.summary = "";
31
32
  this.name = "";
32
33
  this.open = false;
@@ -60,6 +61,11 @@ let GdsDetails = class extends withSizeXProps(
60
61
  detail: this.open
61
62
  });
62
63
  });
64
+ __privateAdd(this, _handleContentTransitionEnd, (event) => {
65
+ if (event.target !== this._content || event.propertyName !== "height")
66
+ return;
67
+ this._isAnimating = false;
68
+ });
63
69
  __privateAdd(this, _renderHeader, () => {
64
70
  return html`
65
71
  <div
@@ -100,10 +106,12 @@ let GdsDetails = class extends withSizeXProps(
100
106
  class=${classMap({
101
107
  content: true,
102
108
  open: this.open,
109
+ animating: this._isAnimating,
103
110
  small: this.size === "small"
104
111
  })}
105
112
  aria-hidden="${!this.open}"
106
113
  ?inert="${!this.open}"
114
+ @transitionend=${__privateGet(this, _handleContentTransitionEnd)}
107
115
  >
108
116
  <slot></slot>
109
117
  </div>
@@ -112,6 +120,9 @@ let GdsDetails = class extends withSizeXProps(
112
120
  }
113
121
  __handleOpenChange() {
114
122
  __privateGet(this, _syncGroupState).call(this);
123
+ if (this.hasUpdated) {
124
+ this._isAnimating = true;
125
+ }
115
126
  }
116
127
  render() {
117
128
  return html`
@@ -131,10 +142,14 @@ _handleToggle = new WeakMap();
131
142
  _handleKeydown = new WeakMap();
132
143
  _syncGroupState = new WeakMap();
133
144
  _dispatchStateEvent = new WeakMap();
145
+ _handleContentTransitionEnd = new WeakMap();
134
146
  _renderHeader = new WeakMap();
135
147
  _renderIconButton = new WeakMap();
136
148
  _renderContent = new WeakMap();
137
149
  GdsDetails.styles = [tokens, DetailsStyles];
150
+ __decorateClass([
151
+ state()
152
+ ], GdsDetails.prototype, "_isAnimating", 2);
138
153
  __decorateClass([
139
154
  property({ type: String })
140
155
  ], GdsDetails.prototype, "summary", 2);
@@ -112,9 +112,12 @@ const style = css`
112
112
  }
113
113
 
114
114
  .content.open {
115
- overflow: auto;
116
115
  height: max-content;
117
116
  }
117
+
118
+ .content.open:not(.animating) {
119
+ overflow: visible;
120
+ }
118
121
  }
119
122
  `;
120
123
  var details_styles_default = style;
@@ -39,10 +39,6 @@ const style = css`
39
39
  margin-top: 0;
40
40
  }
41
41
 
42
- h4 + h5 {
43
- margin-top: 0;
44
- }
45
-
46
42
  h5 + h6 {
47
43
  margin-top: 0;
48
44
  }
@@ -86,6 +82,26 @@ const style = css`
86
82
  background-color: color-mix(in srgb, currentColor, transparent 80%);
87
83
  }
88
84
 
85
+ .text-heading-xl {
86
+ font: var(--gds-sys-text-heading-xl);
87
+ }
88
+
89
+ .text-heading-l {
90
+ font: var(--gds-sys-text-heading-l);
91
+ }
92
+
93
+ .text-heading-m {
94
+ font: var(--gds-sys-text-heading-m);
95
+ }
96
+
97
+ .text-preamble-m {
98
+ font: var(--gds-sys-text-preamble-m);
99
+ }
100
+
101
+ .text-preamble-s {
102
+ font: var(--gds-sys-text-preamble-s);
103
+ }
104
+
89
105
  /*
90
106
  * lists
91
107
  * -----------------------------------------------------------
@@ -281,7 +297,8 @@ const style = css`
281
297
  * Iframe
282
298
  */
283
299
  iframe {
284
- border: var(--gds-sys-space-5xs) solid var(--gds-sys-color-border-neutral-02);
300
+ border: var(--gds-sys-space-5xs) solid
301
+ var(--gds-sys-color-border-neutral-02);
285
302
  border-radius: var(--gds-sys-radius-xs);
286
303
  min-width: 100%;
287
304
  margin-bottom: var(--gds-sys-space-l);