@aquera/nile-visualization 1.0.0 → 1.1.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.
@@ -186,6 +186,14 @@ export const styles = css `
186
186
  word-break: break-word;
187
187
  }
188
188
 
189
+ /* ─── Skeleton loading state ───────────────────────────────────────────── */
190
+
191
+ .es-skeleton {
192
+ display: flex;
193
+ flex-direction: column;
194
+ gap: 12px;
195
+ }
196
+
189
197
  @media (forced-colors: active) {
190
198
  .es-panel {
191
199
  border: 1px solid ButtonText;
@@ -71,6 +71,13 @@ export declare class NileExecutiveSummary extends NileElement {
71
71
  * Can be set programmatically; use `show()` / `hide()` for animated transitions.
72
72
  */
73
73
  open: boolean;
74
+ /**
75
+ * Whether the drawer body is in a loading state. When `true`, the body renders
76
+ * `nile-skeleton-loader` placeholders instead of the typed summary. Toggle it
77
+ * off (set to `false`) once data arrives from the API — at which point the
78
+ * typewriter animation begins if the drawer is already open.
79
+ */
80
+ loading: boolean;
74
81
  /** @internal Characters revealed so far during typing. */
75
82
  private displayedText;
76
83
  /** @internal Whether typing is still in progress (drives cursor visibility). */
@@ -90,6 +97,7 @@ export declare class NileExecutiveSummary extends NileElement {
90
97
  private stopTyping;
91
98
  /** Opens the drawer with animation. Resolves when the animation completes. */
92
99
  show(): Promise<void>;
100
+ updated(changed: Map<string, unknown>): void;
93
101
  /** Closes the drawer with animation. Resolves when the animation completes. */
94
102
  hide(): Promise<void>;
95
103
  render(): TemplateResult;
@@ -72,6 +72,13 @@ let NileExecutiveSummary = class NileExecutiveSummary extends NileElement {
72
72
  * Can be set programmatically; use `show()` / `hide()` for animated transitions.
73
73
  */
74
74
  this.open = false;
75
+ /**
76
+ * Whether the drawer body is in a loading state. When `true`, the body renders
77
+ * `nile-skeleton-loader` placeholders instead of the typed summary. Toggle it
78
+ * off (set to `false`) once data arrives from the API — at which point the
79
+ * typewriter animation begins if the drawer is already open.
80
+ */
81
+ this.loading = false;
75
82
  /** @internal Characters revealed so far during typing. */
76
83
  this.displayedText = '';
77
84
  /** @internal Whether typing is still in progress (drives cursor visibility). */
@@ -185,7 +192,13 @@ let NileExecutiveSummary = class NileExecutiveSummary extends NileElement {
185
192
  await Promise.all([this.animatePanel(true), this.animateOverlay(true)]);
186
193
  requestAnimationFrame(() => this.panel.focus({ preventScroll: true }));
187
194
  this.emit('nile-after-show');
188
- this.startTyping();
195
+ if (!this.loading)
196
+ this.startTyping();
197
+ }
198
+ updated(changed) {
199
+ if (changed.has('loading') && changed.get('loading') === true && !this.loading && this.open) {
200
+ this.startTyping();
201
+ }
189
202
  }
190
203
  /** Closes the drawer with animation. Resolves when the animation completes. */
191
204
  async hide() {
@@ -264,12 +277,24 @@ let NileExecutiveSummary = class NileExecutiveSummary extends NileElement {
264
277
  </header>
265
278
 
266
279
  <div part="body" class="es-body">
267
- <div
268
- class=${classMap({
269
- 'es-typed-text': true,
270
- 'es-typed-text--typing': this.isTyping,
271
- })}
272
- >${unsafeHTML(this.displayedText)}</div>
280
+ ${this.loading
281
+ ? html `
282
+ <div part="skeleton" class="es-skeleton" aria-busy="true" aria-live="polite">
283
+ <nile-skeleton-loader variant="text" width="90%"></nile-skeleton-loader>
284
+ <nile-skeleton-loader variant="text" width="95%"></nile-skeleton-loader>
285
+ <nile-skeleton-loader variant="text" width="80%"></nile-skeleton-loader>
286
+ <nile-skeleton-loader variant="text" width="70%"></nile-skeleton-loader>
287
+ <nile-skeleton-loader variant="text" width="85%"></nile-skeleton-loader>
288
+ </div>
289
+ `
290
+ : html `
291
+ <div
292
+ class=${classMap({
293
+ 'es-typed-text': true,
294
+ 'es-typed-text--typing': this.isTyping,
295
+ })}
296
+ >${unsafeHTML(this.displayedText)}</div>
297
+ `}
273
298
  <slot></slot>
274
299
  </div>
275
300
 
@@ -295,6 +320,9 @@ __decorate([
295
320
  __decorate([
296
321
  property({ type: Boolean, reflect: true })
297
322
  ], NileExecutiveSummary.prototype, "open", void 0);
323
+ __decorate([
324
+ property({ type: Boolean, reflect: true })
325
+ ], NileExecutiveSummary.prototype, "loading", void 0);
298
326
  __decorate([
299
327
  state()
300
328
  ], NileExecutiveSummary.prototype, "displayedText", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aquera/nile-visualization",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "A visualization Library for the Nile Design System",
5
5
  "license": "MIT",
6
6
  "author": "Aquera Inc",