@vialiq/web-components 0.13.0 → 0.14.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/index.js CHANGED
@@ -15,7 +15,7 @@ import { unsafeCSS, css, html } from 'lit';
15
15
  import { customElement, property, state, queryAssignedElements } from 'lit/decorators.js';
16
16
  import { checkCircleIcon, triangleWarningIcon, infoIcon, xIcon, lockIcon } from '@vialiq/icons';
17
17
  import { F as FocusableMixin } from './focusable-mixin-CmxOyPX5.js';
18
- import { V as ValidityMixin } from './validity-mixin-H4aOFJEr.js';
18
+ import { V as ValidityMixin } from './validity-mixin-DO0ycRH2.js';
19
19
 
20
20
  const badgeStyles = "@charset \"UTF-8\";@layer reset,components,utilities;@layer components{.badge{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;box-sizing:border-box;font-size:var(--vi-badge-font-size, 11px);font-weight:var(--vi-badge-font-weight, var(--vi-font-weight-semibold, 600));padding:var(--vi-badge-padding, 2px 8px);border-radius:var(--vi-badge-border-radius, 9999px);gap:var(--vi-badge-gap, 4px);border:var(--vi-border-width-thin, 1px) solid transparent}.dot{display:inline-block;width:var(--vi-badge-dot-size, 8px);height:var(--vi-badge-dot-size, 8px);border-radius:50%;background-color:currentColor;flex-shrink:0}.icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}}:host{display:inline-block;vertical-align:middle}:host([hidden]),:host([count=\"0\"]:not([show-zero])){display:none!important}:host([size=sm]){--vi-badge-font-size: 10px;--vi-badge-padding: 0 6px;--vi-badge-gap: 2px;--vi-badge-dot-size: 6px}:host([size=md]){--vi-badge-font-size: 11px;--vi-badge-padding: 2px 8px;--vi-badge-gap: 4px;--vi-badge-dot-size: 8px}:host([size=lg]){--vi-badge-font-size: 13px;--vi-badge-padding: 4px 12px;--vi-badge-gap: 6px;--vi-badge-dot-size: 10px}:host([pill]){--vi-badge-border-radius: 9999px}:host(:not([pill])){--vi-badge-border-radius: var(--vi-border-radius-sm, 2px)}.badge.dot-only{--vi-badge-padding: 4px}:host([variant=neutral]) .badge{background-color:var(--vi-badge-neutral-bg, var(--vi-border-02, #eeeeee));color:var(--vi-badge-neutral-color, var(--vi-text-secondary, #4b5563))}:host([variant=primary]) .badge{background-color:var(--vi-badge-primary-bg, var(--vi-bg-info, #e3f2fd));color:var(--vi-badge-primary-color, var(--vi-text-info, #3676d0))}:host([variant=success]) .badge{background-color:var(--vi-badge-success-bg, var(--vi-bg-success, #e6f9f0));color:var(--vi-badge-success-color, var(--vi-text-success, #265a3d))}:host([variant=warning]) .badge{background-color:var(--vi-badge-warning-bg, var(--vi-bg-warning, #fff8e1));color:var(--vi-badge-warning-color, var(--vi-text-warning, #e68300))}:host([variant=danger]) .badge{background-color:var(--vi-badge-danger-bg, var(--vi-bg-error, #ffebee));color:var(--vi-badge-danger-color, var(--vi-text-error, #db231b))}:host([variant=info]) .badge{background-color:var(--vi-badge-info-bg, var(--vi-bg-info, #e3f2fd));color:var(--vi-badge-info-color, var(--vi-text-info, #3676d0))}:host([outline][variant=neutral]) .badge{background-color:transparent;color:var(--vi-badge-neutral-color, var(--vi-text-secondary, #4b5563));border-color:var(--vi-badge-neutral-border, var(--vi-border-03, #e0e0e0))}:host([outline][variant=primary]) .badge{background-color:transparent;color:var(--vi-badge-primary-color, var(--vi-text-info, #3676d0));border-color:var(--vi-badge-primary-border, var(--vi-color-primary, #3676d0))}:host([outline][variant=success]) .badge{background-color:transparent;color:var(--vi-badge-success-color, var(--vi-text-success, #265a3d));border-color:var(--vi-badge-success-border, var(--vi-color-success, #489167))}:host([outline][variant=warning]) .badge{background-color:transparent;color:var(--vi-badge-warning-color, var(--vi-text-warning, #e68300));border-color:var(--vi-badge-warning-border, var(--vi-color-warning, #ffba00))}:host([outline][variant=danger]) .badge{background-color:transparent;color:var(--vi-badge-danger-color, var(--vi-text-error, #db231b));border-color:var(--vi-badge-danger-border, var(--vi-color-error, #ef4444))}:host([outline][variant=info]) .badge{background-color:transparent;color:var(--vi-badge-info-color, var(--vi-text-info, #3676d0));border-color:var(--vi-badge-info-border, var(--vi-color-info, #3676d0))}.icon{display:inline-flex;flex-shrink:0}.icon[hidden]{display:none}::slotted(vi-icon),::slotted(svg){--vi-icon-size: 1em;width:1em;height:1em}";
21
21
 
@@ -391,7 +391,7 @@ function applyDecs2203RFactory$4() {
391
391
  function _apply_decs_2203_r$4(targetClass, memberDecs, classDecs, parentClass) {
392
392
  return (_apply_decs_2203_r$4 = applyDecs2203RFactory$4())(targetClass, memberDecs, classDecs, parentClass);
393
393
  }
394
- function _identity$4(x) {
394
+ function _identity$3(x) {
395
395
  return x;
396
396
  }
397
397
  var _dec$4, _initClass$4, _ViElement$2, _dec1$4, _dec2$4, _dec3$4, _dec4$4, _dec5$4, _dec6$4, _dec7$4, _dec8$4, _dec9$4, _dec10$4, /** Colour semantic */ _init_variant$2, /** Size */ _init_size$1, /** Show coloured dot */ _init_dot, /** Fully rounded (pill shape) vs. square */ _init_pill, /** Numeric count to display */ _init_count, /** Show the badge even if the count is zero */ _init_showZero, /** Max count before showing {max}+ */ _init_max, /** Outlined/ghost style */ _init_outline, _init__hasIcon$1, _init__hasDefaultSlot, _initProto$4;
@@ -421,7 +421,7 @@ _dec$4 = customElement('vi-badge'), _dec1$4 = property({
421
421
  type: Boolean,
422
422
  reflect: true
423
423
  }), _dec9$4 = state(), _dec10$4 = state();
424
- new class extends _identity$4 {
424
+ new class extends _identity$3 {
425
425
  constructor(){
426
426
  super(_ViBadge), _initClass$4();
427
427
  }
@@ -615,7 +615,7 @@ new class extends _identity$4 {
615
615
  }
616
616
  }();
617
617
 
618
- const alertStyles = "@charset \"UTF-8\";@layer reset,components,utilities;@layer components{.alert-root{display:flex;align-items:flex-start;box-sizing:border-box;width:100%;border-radius:var(--vi-alert-border-radius, 6px);padding:var(--vi-alert-padding, 12px 16px);gap:var(--vi-alert-gap, 12px);border-width:var(--vi-alert-border-width, 1px);border-style:solid;font-family:var(--vi-font-family-base, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);font-size:var(--vi-font-size-sm, 14px);line-height:var(--vi-line-height-normal, 1.5)}.alert-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;padding-top:2px}.alert-content{display:flex;flex-direction:column;flex-grow:1;min-width:0}.alert-title{font-weight:var(--vi-font-weight-semibold, 600);margin-bottom:4px;display:block}.alert-actions{display:flex;align-items:center;gap:var(--vi-spacing-xs, 8px);margin-top:var(--vi-spacing-sm, 16px)}}:host{display:block;width:100%}:host([floating]){position:absolute;top:0;left:0;right:0;z-index:var(--vi-alert-floating-z-index, 10);box-shadow:var(--vi-alert-floating-shadow, 0 4px 12px rgba(0, 0, 0, .12))}:host([hidden]){display:none!important}.alert-root{overflow:hidden}.alert-root[data-variant=neutral]{background-color:var(--vi-alert-neutral-bg, var(--vi-layer-02, #f3f4f6));border-color:var(--vi-alert-neutral-border, var(--vi-border-04, #bdbdbd));color:var(--vi-alert-neutral-text-color, var(--vi-text-primary, #111827))}.alert-root[data-variant=neutral] .alert-title{color:var(--vi-alert-neutral-title-color, var(--vi-text-primary, #111827))}.alert-root[data-variant=neutral] .alert-icon{color:var(--vi-alert-neutral-icon-color, var(--vi-text-secondary, #4b5563))}.alert-root[data-variant=info]{background-color:var(--vi-alert-info-bg, var(--vi-bg-info, #e3f2fd));border-color:var(--vi-alert-info-border, var(--vi-color-info, #3676d0));color:var(--vi-alert-info-text-color, var(--vi-text-info, #3676d0))}.alert-root[data-variant=info] .alert-title{color:var(--vi-alert-info-title-color, var(--vi-text-info, #3676d0))}.alert-root[data-variant=info] .alert-icon{color:var(--vi-alert-info-icon-color, var(--vi-color-info, #3676d0))}.alert-root[data-variant=success]{background-color:var(--vi-alert-success-bg, var(--vi-bg-success, #e6f9f0));border-color:var(--vi-alert-success-border, var(--vi-color-success, #489167));color:var(--vi-alert-success-text-color, var(--vi-text-success, #265a3d))}.alert-root[data-variant=success] .alert-title{color:var(--vi-alert-success-title-color, var(--vi-text-success, #265a3d))}.alert-root[data-variant=success] .alert-icon{color:var(--vi-alert-success-icon-color, var(--vi-color-success, #489167))}.alert-root[data-variant=warning]{background-color:var(--vi-alert-warning-bg, var(--vi-bg-warning, #fff8e1));border-color:var(--vi-alert-warning-border, var(--vi-color-warning, #ffba00));color:var(--vi-alert-warning-text-color, var(--vi-text-warning, #e68300))}.alert-root[data-variant=warning] .alert-title{color:var(--vi-alert-warning-title-color, var(--vi-text-warning, #e68300))}.alert-root[data-variant=warning] .alert-icon{color:var(--vi-alert-warning-icon-color, var(--vi-color-warning, #ffba00))}.alert-root[data-variant=danger]{background-color:var(--vi-alert-danger-bg, var(--vi-bg-error, #ffebee));border-color:var(--vi-alert-danger-border, var(--vi-color-error, #ef4444));color:var(--vi-alert-danger-text-color, var(--vi-text-error, #db231b))}.alert-root[data-variant=danger] .alert-title{color:var(--vi-alert-danger-title-color, var(--vi-text-error, #db231b))}.alert-root[data-variant=danger] .alert-icon{color:var(--vi-alert-danger-icon-color, var(--vi-color-error, #ef4444))}vi-icon,::slotted(vi-icon),::slotted(svg){--vi-icon-size: 1.25em;width:1.25em;height:1.25em}vi-button[part=close-btn]{margin-top:-4px;margin-right:-4px;margin-left:4px}";
618
+ const alertStyles = "@charset \"UTF-8\";@layer reset,components,utilities;@layer components{.alert-root{display:flex;align-items:flex-start;box-sizing:border-box;width:100%;border-radius:var(--vi-alert-border-radius, 6px);padding:var(--vi-alert-padding, 12px 16px);gap:var(--vi-alert-gap, 12px);border-width:var(--vi-alert-border-width, 1px);border-style:solid;font-family:var(--vi-font-family-base, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);font-size:var(--vi-font-size-sm, 14px);line-height:var(--vi-line-height-normal, 1.5)}.alert-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;padding-top:2px}.alert-content{display:flex;flex-direction:column;flex-grow:1;min-width:0}.alert-title{font-weight:var(--vi-font-weight-semibold, 600);margin-bottom:4px;display:block}.alert-actions{display:flex;align-items:center;gap:var(--vi-spacing-xs, 8px);margin-top:var(--vi-spacing-sm, 16px)}}:host{display:block;width:100%}:host([floating]){position:absolute;top:0;left:0;right:0;z-index:var(--vi-alert-floating-z-index, var(--vi-alert-floating-z-index, 1080));box-shadow:var(--vi-alert-floating-shadow, 0 4px 12px rgba(0, 0, 0, .12))}:host([hidden]){display:none!important}.alert-root{overflow:hidden}.alert-root[data-variant=neutral]{background-color:var(--vi-alert-neutral-bg, var(--vi-layer-02, #f3f4f6));border-color:var(--vi-alert-neutral-border, var(--vi-border-04, #bdbdbd));color:var(--vi-alert-neutral-text-color, var(--vi-text-primary, #111827))}.alert-root[data-variant=neutral] .alert-title{color:var(--vi-alert-neutral-title-color, var(--vi-text-primary, #111827))}.alert-root[data-variant=neutral] .alert-icon{color:var(--vi-alert-neutral-icon-color, var(--vi-text-secondary, #4b5563))}.alert-root[data-variant=info]{background-color:var(--vi-alert-info-bg, var(--vi-bg-info, #e3f2fd));border-color:var(--vi-alert-info-border, var(--vi-color-info, #3676d0));color:var(--vi-alert-info-text-color, var(--vi-text-info, #3676d0))}.alert-root[data-variant=info] .alert-title{color:var(--vi-alert-info-title-color, var(--vi-text-info, #3676d0))}.alert-root[data-variant=info] .alert-icon{color:var(--vi-alert-info-icon-color, var(--vi-color-info, #3676d0))}.alert-root[data-variant=success]{background-color:var(--vi-alert-success-bg, var(--vi-bg-success, #e6f9f0));border-color:var(--vi-alert-success-border, var(--vi-color-success, #489167));color:var(--vi-alert-success-text-color, var(--vi-text-success, #265a3d))}.alert-root[data-variant=success] .alert-title{color:var(--vi-alert-success-title-color, var(--vi-text-success, #265a3d))}.alert-root[data-variant=success] .alert-icon{color:var(--vi-alert-success-icon-color, var(--vi-color-success, #489167))}.alert-root[data-variant=warning]{background-color:var(--vi-alert-warning-bg, var(--vi-bg-warning, #fff8e1));border-color:var(--vi-alert-warning-border, var(--vi-color-warning, #ffba00));color:var(--vi-alert-warning-text-color, var(--vi-text-warning, #e68300))}.alert-root[data-variant=warning] .alert-title{color:var(--vi-alert-warning-title-color, var(--vi-text-warning, #e68300))}.alert-root[data-variant=warning] .alert-icon{color:var(--vi-alert-warning-icon-color, var(--vi-color-warning, #ffba00))}.alert-root[data-variant=danger]{background-color:var(--vi-alert-danger-bg, var(--vi-bg-error, #ffebee));border-color:var(--vi-alert-danger-border, var(--vi-color-error, #ef4444));color:var(--vi-alert-danger-text-color, var(--vi-text-error, #db231b))}.alert-root[data-variant=danger] .alert-title{color:var(--vi-alert-danger-title-color, var(--vi-text-error, #db231b))}.alert-root[data-variant=danger] .alert-icon{color:var(--vi-alert-danger-icon-color, var(--vi-color-error, #ef4444))}vi-icon,::slotted(vi-icon),::slotted(svg){--vi-icon-size: 1.25em;width:1.25em;height:1.25em}vi-button[part=close-btn]{margin-top:-4px;margin-right:-4px;margin-left:4px}";
619
619
 
620
620
  function applyDecs2203RFactory$3() {
621
621
  function createAddInitializerMethod(initializers, decoratorFinishedRef) {
@@ -989,7 +989,7 @@ function applyDecs2203RFactory$3() {
989
989
  function _apply_decs_2203_r$3(targetClass, memberDecs, classDecs, parentClass) {
990
990
  return (_apply_decs_2203_r$3 = applyDecs2203RFactory$3())(targetClass, memberDecs, classDecs, parentClass);
991
991
  }
992
- function _identity$3(x) {
992
+ function _identity$2(x) {
993
993
  return x;
994
994
  }
995
995
  var _dec$3, _initClass$3, _ViElement$1, _dec1$3, _dec2$3, _dec3$3, _dec4$3, _dec5$3, _dec6$3, _dec7$3, _dec8$3, _dec9$3, _dec10$3, _dec11$2, _dec12$1, _dec13$1, /** Colour, icon, ARIA role */ _init_variant$1, /** Bold headline (optional) */ _init_title, /** Show × dismiss button */ _init_dismissible, /** Accessible label for the dismiss button */ _init_dismissLabel, /**
@@ -1040,7 +1040,7 @@ _dec$3 = customElement('vi-alert'), _dec1$3 = property({
1040
1040
  attribute: 'no-icon',
1041
1041
  reflect: true
1042
1042
  }), _dec12$1 = state(), _dec13$1 = state();
1043
- new class extends _identity$3 {
1043
+ new class extends _identity$2 {
1044
1044
  constructor(){
1045
1045
  super(_ViAlert), _initClass$3();
1046
1046
  }
@@ -1821,7 +1821,7 @@ function applyDecs2203RFactory$2() {
1821
1821
  function _apply_decs_2203_r$2(targetClass, memberDecs, classDecs, parentClass) {
1822
1822
  return (_apply_decs_2203_r$2 = applyDecs2203RFactory$2())(targetClass, memberDecs, classDecs, parentClass);
1823
1823
  }
1824
- function _identity$2(x) {
1824
+ function _identity$1(x) {
1825
1825
  return x;
1826
1826
  }
1827
1827
  var _dec$2, _initClass$2, _FocusableMixin, _dec1$2, _dec2$2, _dec3$2, _dec4$2, _dec5$2, _dec6$2, _dec7$2, _dec8$2, _dec9$2, _dec10$2, _dec11$1, /** Value for group selection tracking. */ _init_value$1, /** Selected / active state. */ _init_selected, /** Disables the chip. */ _init_disabled$1, /** Show × remove button. */ _init_removable, /** Screen reader text for the remove button (default: 'Remove') */ _init_removeAriaLabel, /** Base colour. */ _init_variant, /** Chip size. */ _init_size, _init__inGroup, _init__hasAvatar, _init__hasIcon, _init__hasTrailingIcon, _initProto$2;
@@ -1848,7 +1848,7 @@ _dec$2 = customElement('vi-chip'), _dec1$2 = property({
1848
1848
  type: String,
1849
1849
  reflect: true
1850
1850
  }), _dec8$2 = state(), _dec9$2 = state(), _dec10$2 = state(), _dec11$1 = state();
1851
- new class extends _identity$2 {
1851
+ new class extends _identity$1 {
1852
1852
  constructor(){
1853
1853
  super(_ViChip), _initClass$2();
1854
1854
  }
@@ -2519,7 +2519,7 @@ function applyDecs2203RFactory$1() {
2519
2519
  function _apply_decs_2203_r$1(targetClass, memberDecs, classDecs, parentClass) {
2520
2520
  return (_apply_decs_2203_r$1 = applyDecs2203RFactory$1())(targetClass, memberDecs, classDecs, parentClass);
2521
2521
  }
2522
- function _identity$1(x) {
2522
+ function _identity(x) {
2523
2523
  return x;
2524
2524
  }
2525
2525
  var _dec$1, _initClass$1, _ValidityMixin, _dec1$1, _dec2$1, _dec3$1, _dec4$1, _dec5$1, _dec6$1, _dec7$1, _dec8$1, _dec9$1, _dec10$1, /** Currently selected chip values. */ _init_value, /** Allow multiple selections. */ _init_multi, /** Form field name. */ _init_name$1, /** At least one chip must be selected. */ _init_required, /** Disable all chips. */ _init_disabled, /** Chips wrap to next line. */ _init_wrap, /** Gap between chips. */ _init_gap, // ValidityMixin requirements
@@ -2546,7 +2546,7 @@ _dec$1 = customElement('vi-chip-group'), _dec1$1 = property({
2546
2546
  }), _dec9$1 = property(), _dec10$1 = queryAssignedElements({
2547
2547
  selector: 'vi-chip'
2548
2548
  });
2549
- new class extends _identity$1 {
2549
+ new class extends _identity {
2550
2550
  constructor(){
2551
2551
  super(_ViChipGroup), _initClass$1();
2552
2552
  }
@@ -2704,10 +2704,41 @@ new class extends _identity$1 {
2704
2704
  }
2705
2705
  }
2706
2706
  formResetCallback() {
2707
- this.value = [];
2707
+ const initialValue = this.getAttribute('value');
2708
+ if (initialValue) {
2709
+ try {
2710
+ const parsed = JSON.parse(initialValue);
2711
+ this.value = Array.isArray(parsed) ? parsed : [
2712
+ initialValue
2713
+ ];
2714
+ } catch {
2715
+ this.value = [
2716
+ initialValue
2717
+ ];
2718
+ }
2719
+ } else {
2720
+ this.value = [];
2721
+ }
2708
2722
  this.status = 'default';
2709
2723
  this.validityMessage = '';
2710
2724
  }
2725
+ formStateRestoreCallback(state, _mode) {
2726
+ if (typeof state === 'string') {
2727
+ try {
2728
+ const parsed = JSON.parse(state);
2729
+ this.value = Array.isArray(parsed) ? parsed : [
2730
+ state
2731
+ ];
2732
+ } catch {
2733
+ this.value = [
2734
+ state
2735
+ ];
2736
+ }
2737
+ } else if (state instanceof FormData) {
2738
+ const values = state.getAll(this.name);
2739
+ this.value = values.map((v)=>v.toString());
2740
+ }
2741
+ }
2711
2742
  formDisabledCallback(disabled) {
2712
2743
  this.disabled = disabled;
2713
2744
  }
@@ -2868,545 +2899,167 @@ new class extends _identity$1 {
2868
2899
  }
2869
2900
  }();
2870
2901
 
2871
- const animationStyles = "@charset \"UTF-8\";@layer reset,components,utilities;:root{--vi-animation-duration-fast: .15s;--vi-animation-duration-base: .3s;--vi-animation-duration-slow: .5s;--vi-animation-easing-standard: cubic-bezier(.2, 0, 0, 1);--vi-animation-easing-entrance: cubic-bezier(0, 0, .2, 1);--vi-animation-easing-exit: cubic-bezier(.4, 0, 1, 1);--vi-animation-easing-bounce: cubic-bezier(.34, 1.56, .64, 1);--vi-animation-expand-max-height: 100vh;--vi-animation-expand-max-width: 100vw}@keyframes vi-fade-in{0%{opacity:0}to{opacity:1}}@keyframes vi-fade-out{0%{opacity:1}to{opacity:0}}@keyframes vi-fade-in-up{0%{opacity:0;transform:translate3d(0,1rem,0)}to{opacity:1;transform:translateZ(0)}}@keyframes vi-fade-in-down{0%{opacity:0;transform:translate3d(0,-1rem,0)}to{opacity:1;transform:translateZ(0)}}@keyframes vi-fade-in-left{0%{opacity:0;transform:translate3d(-1rem,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes vi-fade-in-right{0%{opacity:0;transform:translate3d(1rem,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes vi-fade-out-up{0%{opacity:1;transform:translateZ(0)}to{opacity:0;transform:translate3d(0,-1rem,0)}}@keyframes vi-fade-out-down{0%{opacity:1;transform:translateZ(0)}to{opacity:0;transform:translate3d(0,1rem,0)}}@keyframes vi-fade-out-left{0%{opacity:1;transform:translateZ(0)}to{opacity:0;transform:translate3d(-1rem,0,0)}}@keyframes vi-fade-out-right{0%{opacity:1;transform:translateZ(0)}to{opacity:0;transform:translate3d(1rem,0,0)}}@keyframes vi-zoom-in{0%{opacity:0;transform:scale3d(.92,.92,.92)}to{opacity:1;transform:scaleZ(1)}}@keyframes vi-zoom-out{0%{opacity:1;transform:scaleZ(1)}to{opacity:0;transform:scale3d(.92,.92,.92)}}@keyframes vi-scale-up{0%{transform:scale3d(.8,.8,.8)}to{transform:scaleZ(1)}}@keyframes vi-scale-down{0%{transform:scale3d(1.2,1.2,1.2)}to{transform:scaleZ(1)}}@keyframes vi-bounce-in{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:.9;transform:scale3d(1.08,1.08,1.08)}75%{transform:scale3d(.95,.95,.95)}to{opacity:1;transform:scaleZ(1)}}@keyframes vi-bounce-out{0%{opacity:1;transform:scaleZ(1)}20%{transform:scale3d(.9,.9,.9)}50%{opacity:1;transform:scale3d(1.1,1.1,1.1)}to{opacity:0;transform:scale3d(.3,.3,.3)}}@keyframes vi-pop-in{0%{opacity:0;transform:scale3d(.8,.8,1)}70%{transform:scale3d(1.05,1.05,1)}to{opacity:1;transform:scaleZ(1)}}@keyframes vi-pop-out{0%{opacity:1;transform:scaleZ(1)}to{opacity:0;transform:scale3d(.8,.8,1)}}@keyframes vi-slide-in-top{0%{transform:translate3d(0,-100%,0)}to{transform:translateZ(0)}}@keyframes vi-slide-in-bottom{0%{transform:translate3d(0,100%,0)}to{transform:translateZ(0)}}@keyframes vi-slide-in-left{0%{transform:translate3d(-100%,0,0)}to{transform:translateZ(0)}}@keyframes vi-slide-in-right{0%{transform:translate3d(100%,0,0)}to{transform:translateZ(0)}}@keyframes vi-slide-out-top{0%{transform:translateZ(0)}to{transform:translate3d(0,-100%,0)}}@keyframes vi-slide-out-bottom{0%{transform:translateZ(0)}to{transform:translate3d(0,100%,0)}}@keyframes vi-slide-out-left{0%{transform:translateZ(0)}to{transform:translate3d(-100%,0,0)}}@keyframes vi-slide-out-right{0%{transform:translateZ(0)}to{transform:translate3d(100%,0,0)}}@keyframes vi-flip-x{0%{transform:perspective(400px) rotateX(90deg);opacity:0}to{transform:perspective(400px) rotateX(0);opacity:1}}@keyframes vi-flip-y{0%{transform:perspective(400px) rotateY(90deg);opacity:0}to{transform:perspective(400px) rotateY(0);opacity:1}}@keyframes vi-perspective-pop{0%{transform:perspective(600px) translateZ(-100px);opacity:0}to{transform:perspective(600px) translateZ(0);opacity:1}}@keyframes vi-expand-vertical{0%{max-height:0;opacity:0}to{max-height:var(--vi-animation-expand-max-height, 100vh);opacity:1}}@keyframes vi-collapse-vertical{0%{max-height:var(--vi-animation-expand-max-height, 100vh);opacity:1}to{max-height:0;opacity:0}}@keyframes vi-expand-horizontal{0%{max-width:0;opacity:0}to{max-width:var(--vi-animation-expand-max-width, 100vw);opacity:1}}@keyframes vi-collapse-horizontal{0%{max-width:var(--vi-animation-expand-max-width, 100vw);opacity:1}to{max-width:0;opacity:0}}@keyframes vi-pulse{0%{transform:scaleZ(1)}50%{transform:scale3d(1.05,1.05,1.05)}to{transform:scaleZ(1)}}@keyframes vi-bounce{0%,20%,53%,80%,to{transform:translateZ(0)}40%,43%{transform:translate3d(0,-12px,0)}70%{transform:translate3d(0,-6px,0)}90%{transform:translate3d(0,-2px,0)}}@keyframes vi-shake{0%,to{transform:translateZ(0)}10%,30%,50%,70%,90%{transform:translate3d(-4px,0,0)}20%,40%,60%,80%{transform:translate3d(4px,0,0)}}@keyframes vi-wobble{0%,to{transform:translateZ(0) rotate(0)}15%{transform:translate3d(-15%,0,0) rotate(-4deg)}30%{transform:translate3d(12%,0,0) rotate(3deg)}45%{transform:translate3d(-9%,0,0) rotate(-2deg)}60%{transform:translate3d(6%,0,0) rotate(1deg)}75%{transform:translate3d(-3%,0,0) rotate(-1deg)}}@keyframes vi-heartbeat{0%{transform:scale(1)}14%{transform:scale(1.15)}28%{transform:scale(1)}42%{transform:scale(1.15)}70%{transform:scale(1)}}@keyframes vi-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}:host{display:contents}:host([hidden]){display:none!important}";
2872
-
2873
- function applyDecs2203RFactory() {
2874
- function createAddInitializerMethod(initializers, decoratorFinishedRef) {
2875
- return function addInitializer(initializer) {
2876
- assertNotFinished(decoratorFinishedRef, "addInitializer");
2877
- assertCallable(initializer, "An initializer");
2878
- initializers.push(initializer);
2879
- };
2880
- }
2881
- function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
2882
- var kindStr;
2883
- switch(kind){
2884
- case 1:
2885
- kindStr = "accessor";
2886
- break;
2887
- case 2:
2888
- kindStr = "method";
2889
- break;
2890
- case 3:
2891
- kindStr = "getter";
2892
- break;
2893
- case 4:
2894
- kindStr = "setter";
2895
- break;
2896
- default:
2897
- kindStr = "field";
2902
+ /**
2903
+ * Explicit exit counterpart map.
2904
+ * Replaces fragile string.replace('in','out') which corrupted strings like 'spin' -> 'spout'.
2905
+ */ const EXIT_COUNTERPART = {
2906
+ 'fade-in': 'fade-out',
2907
+ 'fade-in-up': 'fade-out-down',
2908
+ 'fade-in-down': 'fade-out-up',
2909
+ 'fade-in-left': 'fade-out-right',
2910
+ 'fade-in-right': 'fade-out-left',
2911
+ 'zoom-in': 'zoom-out',
2912
+ 'scale-up': 'scale-down',
2913
+ 'bounce-in': 'bounce-out',
2914
+ 'pop-in': 'pop-out',
2915
+ 'slide-in-top': 'slide-out-top',
2916
+ 'slide-in-bottom': 'slide-out-bottom',
2917
+ 'slide-in-left': 'slide-out-left',
2918
+ 'slide-in-right': 'slide-out-right',
2919
+ 'flip-x': 'fade-out',
2920
+ 'flip-y': 'fade-out',
2921
+ 'perspective-pop': 'fade-out',
2922
+ 'expand-vertical': 'collapse-vertical',
2923
+ 'expand-horizontal': 'collapse-horizontal'
2924
+ };
2925
+ /**
2926
+ * WAAPI (Web Animations API) keyframe definitions — used by this component's imperative
2927
+ * runtime path via `element.animate()`. These are the canonical source for adding or
2928
+ * changing a preset. When you add a preset here you MUST also add the matching
2929
+ * `@keyframes vi-<name>` rule in `libs/flux-ui/components/_animation.scss`, which serves
2930
+ * the parallel CSS-only consumer path (\`animation: vi-fade-in 300ms ...\`).
2931
+ * The two representations cannot share a runtime source without a build-time code-gen step.
2932
+ */ const PRESET_KEYFRAMES = {
2933
+ 'fade-in': [
2934
+ {
2935
+ opacity: 0
2936
+ },
2937
+ {
2938
+ opacity: 1
2898
2939
  }
2899
- var ctx = {
2900
- kind: kindStr,
2901
- name: isPrivate ? "#" + name : name,
2902
- static: isStatic,
2903
- private: isPrivate,
2904
- metadata: metadata
2905
- };
2906
- var decoratorFinishedRef = {
2907
- v: false
2908
- };
2909
- ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
2910
- var get, set;
2911
- if (kind === 0) {
2912
- if (isPrivate) {
2913
- get = desc.get;
2914
- set = desc.set;
2915
- } else {
2916
- get = function() {
2917
- return this[name];
2918
- };
2919
- set = function(v) {
2920
- this[name] = v;
2921
- };
2922
- }
2923
- } else if (kind === 2) {
2924
- get = function() {
2925
- return desc.value;
2926
- };
2927
- } else {
2928
- if (kind === 1 || kind === 3) {
2929
- get = function() {
2930
- return desc.get.call(this);
2931
- };
2932
- }
2933
- if (kind === 1 || kind === 4) {
2934
- set = function(v) {
2935
- desc.set.call(this, v);
2936
- };
2937
- }
2940
+ ],
2941
+ 'fade-out': [
2942
+ {
2943
+ opacity: 1
2944
+ },
2945
+ {
2946
+ opacity: 0
2938
2947
  }
2939
- ctx.access = get && set ? {
2940
- get: get,
2941
- set: set
2942
- } : get ? {
2943
- get: get
2944
- } : {
2945
- set: set
2946
- };
2947
- try {
2948
- return dec(value, ctx);
2949
- } finally{
2950
- decoratorFinishedRef.v = true;
2948
+ ],
2949
+ 'fade-in-up': [
2950
+ {
2951
+ opacity: 0,
2952
+ transform: 'translate3d(0, 1rem, 0)'
2953
+ },
2954
+ {
2955
+ opacity: 1,
2956
+ transform: 'translate3d(0, 0, 0)'
2951
2957
  }
2952
- }
2953
- function assertNotFinished(decoratorFinishedRef, fnName) {
2954
- if (decoratorFinishedRef.v) {
2955
- throw new Error("attempted to call " + fnName + " after decoration was finished");
2958
+ ],
2959
+ 'fade-in-down': [
2960
+ {
2961
+ opacity: 0,
2962
+ transform: 'translate3d(0, -1rem, 0)'
2963
+ },
2964
+ {
2965
+ opacity: 1,
2966
+ transform: 'translate3d(0, 0, 0)'
2956
2967
  }
2957
- }
2958
- function assertCallable(fn, hint) {
2959
- if (typeof fn !== "function") {
2960
- throw new TypeError(hint + " must be a function");
2968
+ ],
2969
+ 'fade-in-left': [
2970
+ {
2971
+ opacity: 0,
2972
+ transform: 'translate3d(-1rem, 0, 0)'
2973
+ },
2974
+ {
2975
+ opacity: 1,
2976
+ transform: 'translate3d(0, 0, 0)'
2961
2977
  }
2962
- }
2963
- function assertValidReturnValue(kind, value) {
2964
- var type = typeof value;
2965
- if (kind === 1) {
2966
- if (type !== "object" || value === null) {
2967
- throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
2968
- }
2969
- if (value.get !== undefined) {
2970
- assertCallable(value.get, "accessor.get");
2971
- }
2972
- if (value.set !== undefined) {
2973
- assertCallable(value.set, "accessor.set");
2974
- }
2975
- if (value.init !== undefined) {
2976
- assertCallable(value.init, "accessor.init");
2977
- }
2978
- } else if (type !== "function") {
2979
- var hint;
2980
- if (kind === 0) {
2981
- hint = "field";
2982
- } else if (kind === 10) {
2983
- hint = "class";
2984
- } else {
2985
- hint = "method";
2986
- }
2987
- throw new TypeError(hint + " decorators must return a function or void 0");
2978
+ ],
2979
+ 'fade-in-right': [
2980
+ {
2981
+ opacity: 0,
2982
+ transform: 'translate3d(1rem, 0, 0)'
2983
+ },
2984
+ {
2985
+ opacity: 1,
2986
+ transform: 'translate3d(0, 0, 0)'
2988
2987
  }
2989
- }
2990
- function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
2991
- var decs = decInfo[0];
2992
- var desc, init, value;
2993
- if (isPrivate) {
2994
- if (kind === 0 || kind === 1) {
2995
- desc = {
2996
- get: decInfo[3],
2997
- set: decInfo[4]
2998
- };
2999
- } else if (kind === 3) {
3000
- desc = {
3001
- get: decInfo[3]
3002
- };
3003
- } else if (kind === 4) {
3004
- desc = {
3005
- set: decInfo[3]
3006
- };
3007
- } else {
3008
- desc = {
3009
- value: decInfo[3]
3010
- };
3011
- }
3012
- } else if (kind !== 0) {
3013
- desc = Object.getOwnPropertyDescriptor(base, name);
2988
+ ],
2989
+ 'fade-out-up': [
2990
+ {
2991
+ opacity: 1,
2992
+ transform: 'translate3d(0, 0, 0)'
2993
+ },
2994
+ {
2995
+ opacity: 0,
2996
+ transform: 'translate3d(0, -1rem, 0)'
3014
2997
  }
3015
- if (kind === 1) {
3016
- value = {
3017
- get: desc.get,
3018
- set: desc.set
3019
- };
3020
- } else if (kind === 2) {
3021
- value = desc.value;
3022
- } else if (kind === 3) {
3023
- value = desc.get;
3024
- } else if (kind === 4) {
3025
- value = desc.set;
2998
+ ],
2999
+ 'fade-out-down': [
3000
+ {
3001
+ opacity: 1,
3002
+ transform: 'translate3d(0, 0, 0)'
3003
+ },
3004
+ {
3005
+ opacity: 0,
3006
+ transform: 'translate3d(0, 1rem, 0)'
3026
3007
  }
3027
- var newValue, get, set;
3028
- if (typeof decs === "function") {
3029
- newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
3030
- if (newValue !== void 0) {
3031
- assertValidReturnValue(kind, newValue);
3032
- if (kind === 0) {
3033
- init = newValue;
3034
- } else if (kind === 1) {
3035
- init = newValue.init;
3036
- get = newValue.get || value.get;
3037
- set = newValue.set || value.set;
3038
- value = {
3039
- get: get,
3040
- set: set
3041
- };
3042
- } else {
3043
- value = newValue;
3044
- }
3045
- }
3046
- } else {
3047
- for(var i = decs.length - 1; i >= 0; i--){
3048
- var dec = decs[i];
3049
- newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
3050
- if (newValue !== void 0) {
3051
- assertValidReturnValue(kind, newValue);
3052
- var newInit;
3053
- if (kind === 0) {
3054
- newInit = newValue;
3055
- } else if (kind === 1) {
3056
- newInit = newValue.init;
3057
- get = newValue.get || value.get;
3058
- set = newValue.set || value.set;
3059
- value = {
3060
- get: get,
3061
- set: set
3062
- };
3063
- } else {
3064
- value = newValue;
3065
- }
3066
- if (newInit !== void 0) {
3067
- if (init === void 0) {
3068
- init = newInit;
3069
- } else if (typeof init === "function") {
3070
- init = [
3071
- init,
3072
- newInit
3073
- ];
3074
- } else {
3075
- init.push(newInit);
3076
- }
3077
- }
3078
- }
3079
- }
3008
+ ],
3009
+ 'fade-out-left': [
3010
+ {
3011
+ opacity: 1,
3012
+ transform: 'translate3d(0, 0, 0)'
3013
+ },
3014
+ {
3015
+ opacity: 0,
3016
+ transform: 'translate3d(-1rem, 0, 0)'
3080
3017
  }
3081
- if (kind === 0 || kind === 1) {
3082
- if (init === void 0) {
3083
- init = function(instance, init) {
3084
- return init;
3085
- };
3086
- } else if (typeof init !== "function") {
3087
- var ownInitializers = init;
3088
- init = function(instance, init) {
3089
- var value = init;
3090
- for(var i = 0; i < ownInitializers.length; i++){
3091
- value = ownInitializers[i].call(instance, value);
3092
- }
3093
- return value;
3094
- };
3095
- } else {
3096
- var originalInitializer = init;
3097
- init = function(instance, init) {
3098
- return originalInitializer.call(instance, init);
3099
- };
3100
- }
3101
- ret.push(init);
3018
+ ],
3019
+ 'fade-out-right': [
3020
+ {
3021
+ opacity: 1,
3022
+ transform: 'translate3d(0, 0, 0)'
3023
+ },
3024
+ {
3025
+ opacity: 0,
3026
+ transform: 'translate3d(1rem, 0, 0)'
3102
3027
  }
3103
- if (kind !== 0) {
3104
- if (kind === 1) {
3105
- desc.get = value.get;
3106
- desc.set = value.set;
3107
- } else if (kind === 2) {
3108
- desc.value = value;
3109
- } else if (kind === 3) {
3110
- desc.get = value;
3111
- } else if (kind === 4) {
3112
- desc.set = value;
3113
- }
3114
- if (isPrivate) {
3115
- if (kind === 1) {
3116
- ret.push(function(instance, args) {
3117
- return value.get.call(instance, args);
3118
- });
3119
- ret.push(function(instance, args) {
3120
- return value.set.call(instance, args);
3121
- });
3122
- } else if (kind === 2) {
3123
- ret.push(value);
3124
- } else {
3125
- ret.push(function(instance, args) {
3126
- return value.call(instance, args);
3127
- });
3128
- }
3129
- } else {
3130
- Object.defineProperty(base, name, desc);
3131
- }
3028
+ ],
3029
+ 'zoom-in': [
3030
+ {
3031
+ opacity: 0,
3032
+ transform: 'scale3d(0.92, 0.92, 0.92)'
3033
+ },
3034
+ {
3035
+ opacity: 1,
3036
+ transform: 'scale3d(1, 1, 1)'
3132
3037
  }
3133
- }
3134
- function applyMemberDecs(Class, decInfos, metadata) {
3135
- var ret = [];
3136
- var protoInitializers;
3137
- var staticInitializers;
3138
- var existingProtoNonFields = new Map();
3139
- var existingStaticNonFields = new Map();
3140
- for(var i = 0; i < decInfos.length; i++){
3141
- var decInfo = decInfos[i];
3142
- if (!Array.isArray(decInfo)) continue;
3143
- var kind = decInfo[1];
3144
- var name = decInfo[2];
3145
- var isPrivate = decInfo.length > 3;
3146
- var isStatic = kind >= 5;
3147
- var base;
3148
- var initializers;
3149
- if (isStatic) {
3150
- base = Class;
3151
- kind = kind - 5;
3152
- staticInitializers = staticInitializers || [];
3153
- initializers = staticInitializers;
3154
- } else {
3155
- base = Class.prototype;
3156
- protoInitializers = protoInitializers || [];
3157
- initializers = protoInitializers;
3158
- }
3159
- if (kind !== 0 && !isPrivate) {
3160
- var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
3161
- var existingKind = existingNonFields.get(name) || 0;
3162
- if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
3163
- throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
3164
- } else if (!existingKind && kind > 2) {
3165
- existingNonFields.set(name, kind);
3166
- } else {
3167
- existingNonFields.set(name, true);
3168
- }
3169
- }
3170
- applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
3038
+ ],
3039
+ 'zoom-out': [
3040
+ {
3041
+ opacity: 1,
3042
+ transform: 'scale3d(1, 1, 1)'
3043
+ },
3044
+ {
3045
+ opacity: 0,
3046
+ transform: 'scale3d(0.92, 0.92, 0.92)'
3171
3047
  }
3172
- pushInitializers(ret, protoInitializers);
3173
- pushInitializers(ret, staticInitializers);
3174
- return ret;
3175
- }
3176
- function pushInitializers(ret, initializers) {
3177
- if (initializers) {
3178
- ret.push(function(instance) {
3179
- for(var i = 0; i < initializers.length; i++){
3180
- initializers[i].call(instance);
3181
- }
3182
- return instance;
3183
- });
3048
+ ],
3049
+ 'scale-up': [
3050
+ {
3051
+ transform: 'scale3d(0.8, 0.8, 0.8)'
3052
+ },
3053
+ {
3054
+ transform: 'scale3d(1, 1, 1)'
3184
3055
  }
3185
- }
3186
- function applyClassDecs(targetClass, classDecs, metadata) {
3187
- if (classDecs.length > 0) {
3188
- var initializers = [];
3189
- var newClass = targetClass;
3190
- var name = targetClass.name;
3191
- for(var i = classDecs.length - 1; i >= 0; i--){
3192
- var decoratorFinishedRef = {
3193
- v: false
3194
- };
3195
- try {
3196
- var nextNewClass = classDecs[i](newClass, {
3197
- kind: "class",
3198
- name: name,
3199
- addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
3200
- metadata
3201
- });
3202
- } finally{
3203
- decoratorFinishedRef.v = true;
3204
- }
3205
- if (nextNewClass !== undefined) {
3206
- assertValidReturnValue(10, nextNewClass);
3207
- newClass = nextNewClass;
3208
- }
3209
- }
3210
- return [
3211
- defineMetadata(newClass, metadata),
3212
- function() {
3213
- for(var i = 0; i < initializers.length; i++){
3214
- initializers[i].call(newClass);
3215
- }
3216
- }
3217
- ];
3218
- }
3219
- }
3220
- function defineMetadata(Class, metadata) {
3221
- return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
3222
- configurable: true,
3223
- enumerable: true,
3224
- value: metadata
3225
- });
3226
- }
3227
- return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
3228
- if (parentClass !== void 0) {
3229
- var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
3230
- }
3231
- var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
3232
- var e = applyMemberDecs(targetClass, memberDecs, metadata);
3233
- if (!classDecs.length) defineMetadata(targetClass, metadata);
3234
- return {
3235
- e: e,
3236
- get c () {
3237
- return applyClassDecs(targetClass, classDecs, metadata);
3238
- }
3239
- };
3240
- };
3241
- }
3242
- function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
3243
- return (_apply_decs_2203_r = applyDecs2203RFactory())(targetClass, memberDecs, classDecs, parentClass);
3244
- }
3245
- function _identity(x) {
3246
- return x;
3247
- }
3248
- var _dec, _initClass, _ViElement, _dec1, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _init_name, _init_enter, _init_exit, _init_duration, _init_delay, _init_easing, _init_iterations, _init_direction, _init_fill, _init_open, _init_autoPlay, _init_cascade, _init_stagger, _init_staggerSelector, _init_staggerDirection, _init_reducedMotion, _init_keyframes, _init__isAnimating, _initProto;
3249
- /**
3250
- * Explicit exit counterpart map.
3251
- * Replaces fragile string.replace('in','out') which corrupted strings like 'spin' -> 'spout'.
3252
- */ const EXIT_COUNTERPART = {
3253
- 'fade-in': 'fade-out',
3254
- 'fade-in-up': 'fade-out-down',
3255
- 'fade-in-down': 'fade-out-up',
3256
- 'fade-in-left': 'fade-out-right',
3257
- 'fade-in-right': 'fade-out-left',
3258
- 'zoom-in': 'zoom-out',
3259
- 'scale-up': 'scale-down',
3260
- 'bounce-in': 'bounce-out',
3261
- 'pop-in': 'pop-out',
3262
- 'slide-in-top': 'slide-out-top',
3263
- 'slide-in-bottom': 'slide-out-bottom',
3264
- 'slide-in-left': 'slide-out-left',
3265
- 'slide-in-right': 'slide-out-right',
3266
- 'flip-x': 'fade-out',
3267
- 'flip-y': 'fade-out',
3268
- 'perspective-pop': 'fade-out',
3269
- 'expand-vertical': 'collapse-vertical',
3270
- 'expand-horizontal': 'collapse-horizontal'
3271
- };
3272
- /**
3273
- * WAAPI (Web Animations API) keyframe definitions — used by this component's imperative
3274
- * runtime path via `element.animate()`. These are the canonical source for adding or
3275
- * changing a preset. When you add a preset here you MUST also add the matching
3276
- * `@keyframes vi-<name>` rule in `libs/flux-ui/components/_animation.scss`, which serves
3277
- * the parallel CSS-only consumer path (`animation: vi-fade-in 300ms ...`).
3278
- * The two representations cannot share a runtime source without a build-time code-gen step.
3279
- */ const PRESET_KEYFRAMES = {
3280
- 'fade-in': [
3281
- {
3282
- opacity: 0
3283
- },
3284
- {
3285
- opacity: 1
3286
- }
3287
- ],
3288
- 'fade-out': [
3289
- {
3290
- opacity: 1
3291
- },
3292
- {
3293
- opacity: 0
3294
- }
3295
- ],
3296
- 'fade-in-up': [
3297
- {
3298
- opacity: 0,
3299
- transform: 'translate3d(0, 1rem, 0)'
3300
- },
3301
- {
3302
- opacity: 1,
3303
- transform: 'translate3d(0, 0, 0)'
3304
- }
3305
- ],
3306
- 'fade-in-down': [
3307
- {
3308
- opacity: 0,
3309
- transform: 'translate3d(0, -1rem, 0)'
3310
- },
3311
- {
3312
- opacity: 1,
3313
- transform: 'translate3d(0, 0, 0)'
3314
- }
3315
- ],
3316
- 'fade-in-left': [
3317
- {
3318
- opacity: 0,
3319
- transform: 'translate3d(-1rem, 0, 0)'
3320
- },
3321
- {
3322
- opacity: 1,
3323
- transform: 'translate3d(0, 0, 0)'
3324
- }
3325
- ],
3326
- 'fade-in-right': [
3327
- {
3328
- opacity: 0,
3329
- transform: 'translate3d(1rem, 0, 0)'
3330
- },
3331
- {
3332
- opacity: 1,
3333
- transform: 'translate3d(0, 0, 0)'
3334
- }
3335
- ],
3336
- 'fade-out-up': [
3337
- {
3338
- opacity: 1,
3339
- transform: 'translate3d(0, 0, 0)'
3340
- },
3341
- {
3342
- opacity: 0,
3343
- transform: 'translate3d(0, -1rem, 0)'
3344
- }
3345
- ],
3346
- 'fade-out-down': [
3347
- {
3348
- opacity: 1,
3349
- transform: 'translate3d(0, 0, 0)'
3350
- },
3351
- {
3352
- opacity: 0,
3353
- transform: 'translate3d(0, 1rem, 0)'
3354
- }
3355
- ],
3356
- 'fade-out-left': [
3357
- {
3358
- opacity: 1,
3359
- transform: 'translate3d(0, 0, 0)'
3360
- },
3361
- {
3362
- opacity: 0,
3363
- transform: 'translate3d(-1rem, 0, 0)'
3364
- }
3365
- ],
3366
- 'fade-out-right': [
3367
- {
3368
- opacity: 1,
3369
- transform: 'translate3d(0, 0, 0)'
3370
- },
3371
- {
3372
- opacity: 0,
3373
- transform: 'translate3d(1rem, 0, 0)'
3374
- }
3375
- ],
3376
- 'zoom-in': [
3377
- {
3378
- opacity: 0,
3379
- transform: 'scale3d(0.92, 0.92, 0.92)'
3380
- },
3381
- {
3382
- opacity: 1,
3383
- transform: 'scale3d(1, 1, 1)'
3384
- }
3385
- ],
3386
- 'zoom-out': [
3387
- {
3388
- opacity: 1,
3389
- transform: 'scale3d(1, 1, 1)'
3390
- },
3391
- {
3392
- opacity: 0,
3393
- transform: 'scale3d(0.92, 0.92, 0.92)'
3394
- }
3395
- ],
3396
- 'scale-up': [
3397
- {
3398
- transform: 'scale3d(0.8, 0.8, 0.8)'
3399
- },
3400
- {
3401
- transform: 'scale3d(1, 1, 1)'
3402
- }
3403
- ],
3404
- 'scale-down': [
3405
- {
3406
- transform: 'scale3d(1.2, 1.2, 1.2)'
3407
- },
3408
- {
3409
- transform: 'scale3d(1, 1, 1)'
3056
+ ],
3057
+ 'scale-down': [
3058
+ {
3059
+ transform: 'scale3d(1.2, 1.2, 1.2)'
3060
+ },
3061
+ {
3062
+ transform: 'scale3d(1, 1, 1)'
3410
3063
  }
3411
3064
  ],
3412
3065
  'bounce-in': [
@@ -3687,39 +3340,413 @@ var _dec, _initClass, _ViElement, _dec1, _dec2, _dec3, _dec4, _dec5, _dec6, _dec
3687
3340
  {
3688
3341
  transform: 'translate3d(0, 0, 0) rotate(0deg)'
3689
3342
  }
3690
- ],
3691
- 'heartbeat': [
3692
- {
3693
- transform: 'scale(1)'
3694
- },
3695
- {
3696
- transform: 'scale(1.15)'
3697
- },
3698
- {
3699
- transform: 'scale(1)'
3700
- },
3701
- {
3702
- transform: 'scale(1.15)'
3703
- },
3704
- {
3705
- transform: 'scale(1)'
3343
+ ],
3344
+ 'heartbeat': [
3345
+ {
3346
+ transform: 'scale(1)'
3347
+ },
3348
+ {
3349
+ transform: 'scale(1.15)'
3350
+ },
3351
+ {
3352
+ transform: 'scale(1)'
3353
+ },
3354
+ {
3355
+ transform: 'scale(1.15)'
3356
+ },
3357
+ {
3358
+ transform: 'scale(1)'
3359
+ }
3360
+ ],
3361
+ 'shimmer': [
3362
+ {
3363
+ backgroundPosition: '-200% 0'
3364
+ },
3365
+ {
3366
+ backgroundPosition: '200% 0'
3367
+ }
3368
+ ]
3369
+ };
3370
+ const EXPAND_COLLAPSE_PRESETS = new Set([
3371
+ 'expand-vertical',
3372
+ 'collapse-vertical',
3373
+ 'expand-horizontal',
3374
+ 'collapse-horizontal'
3375
+ ]);
3376
+
3377
+ function applyDecs2203RFactory() {
3378
+ function createAddInitializerMethod(initializers, decoratorFinishedRef) {
3379
+ return function addInitializer(initializer) {
3380
+ assertNotFinished(decoratorFinishedRef, "addInitializer");
3381
+ assertCallable(initializer, "An initializer");
3382
+ initializers.push(initializer);
3383
+ };
3384
+ }
3385
+ function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
3386
+ var kindStr;
3387
+ switch(kind){
3388
+ case 1:
3389
+ kindStr = "accessor";
3390
+ break;
3391
+ case 2:
3392
+ kindStr = "method";
3393
+ break;
3394
+ case 3:
3395
+ kindStr = "getter";
3396
+ break;
3397
+ case 4:
3398
+ kindStr = "setter";
3399
+ break;
3400
+ default:
3401
+ kindStr = "field";
3402
+ }
3403
+ var ctx = {
3404
+ kind: kindStr,
3405
+ name: isPrivate ? "#" + name : name,
3406
+ static: isStatic,
3407
+ private: isPrivate,
3408
+ metadata: metadata
3409
+ };
3410
+ var decoratorFinishedRef = {
3411
+ v: false
3412
+ };
3413
+ ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
3414
+ var get, set;
3415
+ if (kind === 0) {
3416
+ if (isPrivate) {
3417
+ get = desc.get;
3418
+ set = desc.set;
3419
+ } else {
3420
+ get = function() {
3421
+ return this[name];
3422
+ };
3423
+ set = function(v) {
3424
+ this[name] = v;
3425
+ };
3426
+ }
3427
+ } else if (kind === 2) {
3428
+ get = function() {
3429
+ return desc.value;
3430
+ };
3431
+ } else {
3432
+ if (kind === 1 || kind === 3) {
3433
+ get = function() {
3434
+ return desc.get.call(this);
3435
+ };
3436
+ }
3437
+ if (kind === 1 || kind === 4) {
3438
+ set = function(v) {
3439
+ desc.set.call(this, v);
3440
+ };
3441
+ }
3442
+ }
3443
+ ctx.access = get && set ? {
3444
+ get: get,
3445
+ set: set
3446
+ } : get ? {
3447
+ get: get
3448
+ } : {
3449
+ set: set
3450
+ };
3451
+ try {
3452
+ return dec(value, ctx);
3453
+ } finally{
3454
+ decoratorFinishedRef.v = true;
3455
+ }
3456
+ }
3457
+ function assertNotFinished(decoratorFinishedRef, fnName) {
3458
+ if (decoratorFinishedRef.v) {
3459
+ throw new Error("attempted to call " + fnName + " after decoration was finished");
3460
+ }
3461
+ }
3462
+ function assertCallable(fn, hint) {
3463
+ if (typeof fn !== "function") {
3464
+ throw new TypeError(hint + " must be a function");
3465
+ }
3466
+ }
3467
+ function assertValidReturnValue(kind, value) {
3468
+ var type = typeof value;
3469
+ if (kind === 1) {
3470
+ if (type !== "object" || value === null) {
3471
+ throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
3472
+ }
3473
+ if (value.get !== undefined) {
3474
+ assertCallable(value.get, "accessor.get");
3475
+ }
3476
+ if (value.set !== undefined) {
3477
+ assertCallable(value.set, "accessor.set");
3478
+ }
3479
+ if (value.init !== undefined) {
3480
+ assertCallable(value.init, "accessor.init");
3481
+ }
3482
+ } else if (type !== "function") {
3483
+ var hint;
3484
+ if (kind === 0) {
3485
+ hint = "field";
3486
+ } else if (kind === 10) {
3487
+ hint = "class";
3488
+ } else {
3489
+ hint = "method";
3490
+ }
3491
+ throw new TypeError(hint + " decorators must return a function or void 0");
3492
+ }
3493
+ }
3494
+ function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
3495
+ var decs = decInfo[0];
3496
+ var desc, init, value;
3497
+ if (isPrivate) {
3498
+ if (kind === 0 || kind === 1) {
3499
+ desc = {
3500
+ get: decInfo[3],
3501
+ set: decInfo[4]
3502
+ };
3503
+ } else if (kind === 3) {
3504
+ desc = {
3505
+ get: decInfo[3]
3506
+ };
3507
+ } else if (kind === 4) {
3508
+ desc = {
3509
+ set: decInfo[3]
3510
+ };
3511
+ } else {
3512
+ desc = {
3513
+ value: decInfo[3]
3514
+ };
3515
+ }
3516
+ } else if (kind !== 0) {
3517
+ desc = Object.getOwnPropertyDescriptor(base, name);
3518
+ }
3519
+ if (kind === 1) {
3520
+ value = {
3521
+ get: desc.get,
3522
+ set: desc.set
3523
+ };
3524
+ } else if (kind === 2) {
3525
+ value = desc.value;
3526
+ } else if (kind === 3) {
3527
+ value = desc.get;
3528
+ } else if (kind === 4) {
3529
+ value = desc.set;
3530
+ }
3531
+ var newValue, get, set;
3532
+ if (typeof decs === "function") {
3533
+ newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
3534
+ if (newValue !== void 0) {
3535
+ assertValidReturnValue(kind, newValue);
3536
+ if (kind === 0) {
3537
+ init = newValue;
3538
+ } else if (kind === 1) {
3539
+ init = newValue.init;
3540
+ get = newValue.get || value.get;
3541
+ set = newValue.set || value.set;
3542
+ value = {
3543
+ get: get,
3544
+ set: set
3545
+ };
3546
+ } else {
3547
+ value = newValue;
3548
+ }
3549
+ }
3550
+ } else {
3551
+ for(var i = decs.length - 1; i >= 0; i--){
3552
+ var dec = decs[i];
3553
+ newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
3554
+ if (newValue !== void 0) {
3555
+ assertValidReturnValue(kind, newValue);
3556
+ var newInit;
3557
+ if (kind === 0) {
3558
+ newInit = newValue;
3559
+ } else if (kind === 1) {
3560
+ newInit = newValue.init;
3561
+ get = newValue.get || value.get;
3562
+ set = newValue.set || value.set;
3563
+ value = {
3564
+ get: get,
3565
+ set: set
3566
+ };
3567
+ } else {
3568
+ value = newValue;
3569
+ }
3570
+ if (newInit !== void 0) {
3571
+ if (init === void 0) {
3572
+ init = newInit;
3573
+ } else if (typeof init === "function") {
3574
+ init = [
3575
+ init,
3576
+ newInit
3577
+ ];
3578
+ } else {
3579
+ init.push(newInit);
3580
+ }
3581
+ }
3582
+ }
3583
+ }
3584
+ }
3585
+ if (kind === 0 || kind === 1) {
3586
+ if (init === void 0) {
3587
+ init = function(instance, init) {
3588
+ return init;
3589
+ };
3590
+ } else if (typeof init !== "function") {
3591
+ var ownInitializers = init;
3592
+ init = function(instance, init) {
3593
+ var value = init;
3594
+ for(var i = 0; i < ownInitializers.length; i++){
3595
+ value = ownInitializers[i].call(instance, value);
3596
+ }
3597
+ return value;
3598
+ };
3599
+ } else {
3600
+ var originalInitializer = init;
3601
+ init = function(instance, init) {
3602
+ return originalInitializer.call(instance, init);
3603
+ };
3604
+ }
3605
+ ret.push(init);
3606
+ }
3607
+ if (kind !== 0) {
3608
+ if (kind === 1) {
3609
+ desc.get = value.get;
3610
+ desc.set = value.set;
3611
+ } else if (kind === 2) {
3612
+ desc.value = value;
3613
+ } else if (kind === 3) {
3614
+ desc.get = value;
3615
+ } else if (kind === 4) {
3616
+ desc.set = value;
3617
+ }
3618
+ if (isPrivate) {
3619
+ if (kind === 1) {
3620
+ ret.push(function(instance, args) {
3621
+ return value.get.call(instance, args);
3622
+ });
3623
+ ret.push(function(instance, args) {
3624
+ return value.set.call(instance, args);
3625
+ });
3626
+ } else if (kind === 2) {
3627
+ ret.push(value);
3628
+ } else {
3629
+ ret.push(function(instance, args) {
3630
+ return value.call(instance, args);
3631
+ });
3632
+ }
3633
+ } else {
3634
+ Object.defineProperty(base, name, desc);
3635
+ }
3636
+ }
3637
+ }
3638
+ function applyMemberDecs(Class, decInfos, metadata) {
3639
+ var ret = [];
3640
+ var protoInitializers;
3641
+ var staticInitializers;
3642
+ var existingProtoNonFields = new Map();
3643
+ var existingStaticNonFields = new Map();
3644
+ for(var i = 0; i < decInfos.length; i++){
3645
+ var decInfo = decInfos[i];
3646
+ if (!Array.isArray(decInfo)) continue;
3647
+ var kind = decInfo[1];
3648
+ var name = decInfo[2];
3649
+ var isPrivate = decInfo.length > 3;
3650
+ var isStatic = kind >= 5;
3651
+ var base;
3652
+ var initializers;
3653
+ if (isStatic) {
3654
+ base = Class;
3655
+ kind = kind - 5;
3656
+ staticInitializers = staticInitializers || [];
3657
+ initializers = staticInitializers;
3658
+ } else {
3659
+ base = Class.prototype;
3660
+ protoInitializers = protoInitializers || [];
3661
+ initializers = protoInitializers;
3662
+ }
3663
+ if (kind !== 0 && !isPrivate) {
3664
+ var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
3665
+ var existingKind = existingNonFields.get(name) || 0;
3666
+ if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
3667
+ throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
3668
+ } else if (!existingKind && kind > 2) {
3669
+ existingNonFields.set(name, kind);
3670
+ } else {
3671
+ existingNonFields.set(name, true);
3672
+ }
3673
+ }
3674
+ applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
3675
+ }
3676
+ pushInitializers(ret, protoInitializers);
3677
+ pushInitializers(ret, staticInitializers);
3678
+ return ret;
3679
+ }
3680
+ function pushInitializers(ret, initializers) {
3681
+ if (initializers) {
3682
+ ret.push(function(instance) {
3683
+ for(var i = 0; i < initializers.length; i++){
3684
+ initializers[i].call(instance);
3685
+ }
3686
+ return instance;
3687
+ });
3688
+ }
3689
+ }
3690
+ function applyClassDecs(targetClass, classDecs, metadata) {
3691
+ if (classDecs.length > 0) {
3692
+ var initializers = [];
3693
+ var newClass = targetClass;
3694
+ var name = targetClass.name;
3695
+ for(var i = classDecs.length - 1; i >= 0; i--){
3696
+ var decoratorFinishedRef = {
3697
+ v: false
3698
+ };
3699
+ try {
3700
+ var nextNewClass = classDecs[i](newClass, {
3701
+ kind: "class",
3702
+ name: name,
3703
+ addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
3704
+ metadata
3705
+ });
3706
+ } finally{
3707
+ decoratorFinishedRef.v = true;
3708
+ }
3709
+ if (nextNewClass !== undefined) {
3710
+ assertValidReturnValue(10, nextNewClass);
3711
+ newClass = nextNewClass;
3712
+ }
3713
+ }
3714
+ return [
3715
+ defineMetadata(newClass, metadata),
3716
+ function() {
3717
+ for(var i = 0; i < initializers.length; i++){
3718
+ initializers[i].call(newClass);
3719
+ }
3720
+ }
3721
+ ];
3706
3722
  }
3707
- ],
3708
- 'shimmer': [
3709
- {
3710
- backgroundPosition: '-200% 0'
3711
- },
3712
- {
3713
- backgroundPosition: '200% 0'
3723
+ }
3724
+ function defineMetadata(Class, metadata) {
3725
+ return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
3726
+ configurable: true,
3727
+ enumerable: true,
3728
+ value: metadata
3729
+ });
3730
+ }
3731
+ return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
3732
+ if (parentClass !== void 0) {
3733
+ var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
3714
3734
  }
3715
- ]
3716
- };
3717
- const EXPAND_COLLAPSE_PRESETS = new Set([
3718
- 'expand-vertical',
3719
- 'collapse-vertical',
3720
- 'expand-horizontal',
3721
- 'collapse-horizontal'
3722
- ]);
3735
+ var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
3736
+ var e = applyMemberDecs(targetClass, memberDecs, metadata);
3737
+ if (!classDecs.length) defineMetadata(targetClass, metadata);
3738
+ return {
3739
+ e: e,
3740
+ get c () {
3741
+ return applyClassDecs(targetClass, classDecs, metadata);
3742
+ }
3743
+ };
3744
+ };
3745
+ }
3746
+ function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
3747
+ return (_apply_decs_2203_r = applyDecs2203RFactory())(targetClass, memberDecs, classDecs, parentClass);
3748
+ }
3749
+ var _dec, _initClass, _ViElement, _dec1, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _init_name, _init_enter, _init_exit, _init_duration, _init_delay, _init_easing, _init_iterations, _init_direction, _init_fill, _init_open, _init_autoPlay, _init_cascade, _init_stagger, _init_staggerSelector, _init_staggerDirection, _init_reducedMotion, _init_keyframes, _init__isAnimating, _initProto;
3723
3750
  /** Shuffle indices using Fisher-Yates — no duplicate delay slots. */ function shuffleIndices(length) {
3724
3751
  const arr = Array.from({
3725
3752
  length
@@ -3729,655 +3756,646 @@ const EXPAND_COLLAPSE_PRESETS = new Set([
3729
3756
  [arr[i], arr[j]] = [
3730
3757
  arr[j],
3731
3758
  arr[i]
3732
- ];
3733
- }
3734
- return arr;
3735
- }
3736
- let _ViAnimation;
3737
- _dec = customElement('vi-animation'), _dec1 = property({
3738
- type: String,
3739
- reflect: true
3740
- }), _dec2 = property({
3741
- type: String,
3742
- reflect: true
3743
- }), _dec3 = property({
3744
- type: String,
3745
- reflect: true
3746
- }), _dec4 = property({
3747
- type: Number,
3748
- reflect: true
3749
- }), _dec5 = property({
3750
- type: Number,
3751
- reflect: true
3752
- }), _dec6 = property({
3753
- type: String,
3754
- reflect: true
3755
- }), _dec7 = property({
3756
- type: Number,
3757
- reflect: true
3758
- }), _dec8 = property({
3759
- type: String,
3760
- reflect: true
3761
- }), _dec9 = property({
3762
- type: String,
3763
- reflect: true
3764
- }), _dec10 = property({
3765
- type: Boolean,
3766
- reflect: true
3767
- }), _dec11 = property({
3768
- type: Boolean,
3769
- attribute: 'auto-play',
3770
- reflect: true
3771
- }), _dec12 = property({
3772
- type: Boolean,
3773
- reflect: true
3774
- }), _dec13 = property({
3775
- type: Number,
3776
- reflect: true
3777
- }), _dec14 = property({
3778
- type: String,
3779
- attribute: 'stagger-selector',
3780
- reflect: true
3781
- }), _dec15 = property({
3782
- type: String,
3783
- attribute: 'stagger-direction',
3784
- reflect: true
3785
- }), _dec16 = property({
3786
- type: String,
3787
- attribute: 'reduced-motion',
3788
- reflect: true
3789
- }), _dec17 = property({
3790
- attribute: false
3791
- }), _dec18 = state();
3792
- new class extends _identity {
3793
- constructor(){
3794
- super(_ViAnimation), _initClass();
3795
- }
3796
- static{
3797
- class ViAnimation extends (_ViElement = ViElement) {
3798
- static{
3799
- ({ e: [_init_name, _init_enter, _init_exit, _init_duration, _init_delay, _init_easing, _init_iterations, _init_direction, _init_fill, _init_open, _init_autoPlay, _init_cascade, _init_stagger, _init_staggerSelector, _init_staggerDirection, _init_reducedMotion, _init_keyframes, _init__isAnimating, _initProto], c: [_ViAnimation, _initClass] } = _apply_decs_2203_r(this, [
3800
- [
3801
- _dec1,
3802
- 1,
3803
- "name"
3804
- ],
3805
- [
3806
- _dec2,
3807
- 1,
3808
- "enter"
3809
- ],
3810
- [
3811
- _dec3,
3812
- 1,
3813
- "exit"
3814
- ],
3815
- [
3816
- _dec4,
3817
- 1,
3818
- "duration"
3819
- ],
3820
- [
3821
- _dec5,
3822
- 1,
3823
- "delay"
3824
- ],
3825
- [
3826
- _dec6,
3827
- 1,
3828
- "easing"
3829
- ],
3830
- [
3831
- _dec7,
3832
- 1,
3833
- "iterations"
3834
- ],
3835
- [
3836
- _dec8,
3837
- 1,
3838
- "direction"
3839
- ],
3840
- [
3841
- _dec9,
3842
- 1,
3843
- "fill"
3844
- ],
3845
- [
3846
- _dec10,
3847
- 1,
3848
- "open"
3849
- ],
3850
- [
3851
- _dec11,
3852
- 1,
3853
- "autoPlay"
3854
- ],
3855
- [
3856
- _dec12,
3857
- 1,
3858
- "cascade"
3859
- ],
3860
- [
3861
- _dec13,
3862
- 1,
3863
- "stagger"
3864
- ],
3865
- [
3866
- _dec14,
3867
- 1,
3868
- "staggerSelector"
3869
- ],
3870
- [
3871
- _dec15,
3872
- 1,
3873
- "staggerDirection"
3874
- ],
3875
- [
3876
- _dec16,
3877
- 1,
3878
- "reducedMotion"
3879
- ],
3880
- [
3881
- _dec17,
3882
- 1,
3883
- "keyframes"
3884
- ],
3885
- [
3886
- _dec18,
3887
- 1,
3888
- "_isAnimating"
3889
- ]
3890
- ], [
3891
- _dec
3892
- ], _ViElement));
3893
- }
3894
- static styles = css`${unsafeCSS(animationStyles)}`;
3895
- #___private_name_1 = (_initProto(this), _init_name(this, 'fade-in'));
3896
- get name() {
3897
- return this.#___private_name_1;
3898
- }
3899
- set name(_v) {
3900
- this.#___private_name_1 = _v;
3901
- }
3902
- #___private_enter_2 = _init_enter(this, '');
3903
- get enter() {
3904
- return this.#___private_enter_2;
3905
- }
3906
- set enter(_v) {
3907
- this.#___private_enter_2 = _v;
3908
- }
3909
- #___private_exit_3 = _init_exit(this, '');
3910
- get exit() {
3911
- return this.#___private_exit_3;
3912
- }
3913
- set exit(_v) {
3914
- this.#___private_exit_3 = _v;
3915
- }
3916
- #___private_duration_4 = _init_duration(this, 300);
3917
- get duration() {
3918
- return this.#___private_duration_4;
3919
- }
3920
- set duration(_v) {
3921
- this.#___private_duration_4 = _v;
3922
- }
3923
- #___private_delay_5 = _init_delay(this, 0);
3924
- get delay() {
3925
- return this.#___private_delay_5;
3926
- }
3927
- set delay(_v) {
3928
- this.#___private_delay_5 = _v;
3929
- }
3930
- #___private_easing_6 = _init_easing(this, 'cubic-bezier(0.2, 0, 0, 1)');
3931
- get easing() {
3932
- return this.#___private_easing_6;
3933
- }
3934
- set easing(_v) {
3935
- this.#___private_easing_6 = _v;
3936
- }
3937
- #___private_iterations_7 = _init_iterations(this, 1);
3938
- get iterations() {
3939
- return this.#___private_iterations_7;
3940
- }
3941
- set iterations(_v) {
3942
- this.#___private_iterations_7 = _v;
3943
- }
3944
- #___private_direction_8 = _init_direction(this, 'normal');
3945
- get direction() {
3946
- return this.#___private_direction_8;
3947
- }
3948
- set direction(_v) {
3949
- this.#___private_direction_8 = _v;
3950
- }
3951
- #___private_fill_9 = _init_fill(this, 'forwards');
3952
- get fill() {
3953
- return this.#___private_fill_9;
3954
- }
3955
- set fill(_v) {
3956
- this.#___private_fill_9 = _v;
3957
- }
3958
- #___private_open_10 = _init_open(this, true);
3959
- get open() {
3960
- return this.#___private_open_10;
3961
- }
3962
- set open(_v) {
3963
- this.#___private_open_10 = _v;
3964
- }
3965
- #___private_autoPlay_11 = _init_autoPlay(this, true);
3966
- get autoPlay() {
3967
- return this.#___private_autoPlay_11;
3968
- }
3969
- set autoPlay(_v) {
3970
- this.#___private_autoPlay_11 = _v;
3971
- }
3972
- #___private_cascade_12 = _init_cascade(this, false);
3973
- get cascade() {
3974
- return this.#___private_cascade_12;
3975
- }
3976
- set cascade(_v) {
3977
- this.#___private_cascade_12 = _v;
3978
- }
3979
- #___private_stagger_13 = _init_stagger(this, 50);
3980
- get stagger() {
3981
- return this.#___private_stagger_13;
3982
- }
3983
- set stagger(_v) {
3984
- this.#___private_stagger_13 = _v;
3985
- }
3986
- #___private_staggerSelector_14 = _init_staggerSelector(this, ':scope > *');
3987
- get staggerSelector() {
3988
- return this.#___private_staggerSelector_14;
3989
- }
3990
- set staggerSelector(_v) {
3991
- this.#___private_staggerSelector_14 = _v;
3992
- }
3993
- #___private_staggerDirection_15 = _init_staggerDirection(this, 'normal');
3994
- get staggerDirection() {
3995
- return this.#___private_staggerDirection_15;
3996
- }
3997
- set staggerDirection(_v) {
3998
- this.#___private_staggerDirection_15 = _v;
3999
- }
4000
- #___private_reducedMotion_16 = _init_reducedMotion(this, 'auto');
4001
- get reducedMotion() {
4002
- return this.#___private_reducedMotion_16;
4003
- }
4004
- set reducedMotion(_v) {
4005
- this.#___private_reducedMotion_16 = _v;
4006
- }
4007
- #___private_keyframes_17 = _init_keyframes(this, null);
4008
- get keyframes() {
4009
- return this.#___private_keyframes_17;
4010
- }
4011
- set keyframes(_v) {
4012
- this.#___private_keyframes_17 = _v;
4013
- }
4014
- #___private__isAnimating_18 = _init__isAnimating(this, false);
4015
- get _isAnimating() {
4016
- return this.#___private__isAnimating_18;
4017
- }
4018
- set _isAnimating(_v) {
4019
- this.#___private__isAnimating_18 = _v;
4020
- }
4021
- _activeAnimations = [];
4022
- /**
3759
+ ];
3760
+ }
3761
+ return arr;
3762
+ }
3763
+ let _ViAnimation;
3764
+ _dec = customElement('vi-animation'), _dec1 = property({
3765
+ type: String,
3766
+ reflect: true
3767
+ }), _dec2 = property({
3768
+ type: String,
3769
+ reflect: true
3770
+ }), _dec3 = property({
3771
+ type: String,
3772
+ reflect: true
3773
+ }), _dec4 = property({
3774
+ type: Number,
3775
+ reflect: true
3776
+ }), _dec5 = property({
3777
+ type: Number,
3778
+ reflect: true
3779
+ }), _dec6 = property({
3780
+ type: String,
3781
+ reflect: true
3782
+ }), _dec7 = property({
3783
+ type: Number,
3784
+ reflect: true
3785
+ }), _dec8 = property({
3786
+ type: String,
3787
+ reflect: true
3788
+ }), _dec9 = property({
3789
+ type: String,
3790
+ reflect: true
3791
+ }), _dec10 = property({
3792
+ type: Boolean,
3793
+ reflect: true
3794
+ }), _dec11 = property({
3795
+ type: Boolean,
3796
+ attribute: 'auto-play',
3797
+ reflect: true
3798
+ }), _dec12 = property({
3799
+ type: Boolean,
3800
+ reflect: true
3801
+ }), _dec13 = property({
3802
+ type: Number,
3803
+ reflect: true
3804
+ }), _dec14 = property({
3805
+ type: String,
3806
+ attribute: 'stagger-selector',
3807
+ reflect: true
3808
+ }), _dec15 = property({
3809
+ type: String,
3810
+ attribute: 'stagger-direction',
3811
+ reflect: true
3812
+ }), _dec16 = property({
3813
+ type: String,
3814
+ attribute: 'reduced-motion',
3815
+ reflect: true
3816
+ }), _dec17 = property({
3817
+ attribute: false
3818
+ }), _dec18 = state();
3819
+ class ViAnimation extends (_ViElement = ViElement) {
3820
+ static{
3821
+ ({ e: [_init_name, _init_enter, _init_exit, _init_duration, _init_delay, _init_easing, _init_iterations, _init_direction, _init_fill, _init_open, _init_autoPlay, _init_cascade, _init_stagger, _init_staggerSelector, _init_staggerDirection, _init_reducedMotion, _init_keyframes, _init__isAnimating, _initProto], c: [_ViAnimation, _initClass] } = _apply_decs_2203_r(this, [
3822
+ [
3823
+ _dec1,
3824
+ 1,
3825
+ "name"
3826
+ ],
3827
+ [
3828
+ _dec2,
3829
+ 1,
3830
+ "enter"
3831
+ ],
3832
+ [
3833
+ _dec3,
3834
+ 1,
3835
+ "exit"
3836
+ ],
3837
+ [
3838
+ _dec4,
3839
+ 1,
3840
+ "duration"
3841
+ ],
3842
+ [
3843
+ _dec5,
3844
+ 1,
3845
+ "delay"
3846
+ ],
3847
+ [
3848
+ _dec6,
3849
+ 1,
3850
+ "easing"
3851
+ ],
3852
+ [
3853
+ _dec7,
3854
+ 1,
3855
+ "iterations"
3856
+ ],
3857
+ [
3858
+ _dec8,
3859
+ 1,
3860
+ "direction"
3861
+ ],
3862
+ [
3863
+ _dec9,
3864
+ 1,
3865
+ "fill"
3866
+ ],
3867
+ [
3868
+ _dec10,
3869
+ 1,
3870
+ "open"
3871
+ ],
3872
+ [
3873
+ _dec11,
3874
+ 1,
3875
+ "autoPlay"
3876
+ ],
3877
+ [
3878
+ _dec12,
3879
+ 1,
3880
+ "cascade"
3881
+ ],
3882
+ [
3883
+ _dec13,
3884
+ 1,
3885
+ "stagger"
3886
+ ],
3887
+ [
3888
+ _dec14,
3889
+ 1,
3890
+ "staggerSelector"
3891
+ ],
3892
+ [
3893
+ _dec15,
3894
+ 1,
3895
+ "staggerDirection"
3896
+ ],
3897
+ [
3898
+ _dec16,
3899
+ 1,
3900
+ "reducedMotion"
3901
+ ],
3902
+ [
3903
+ _dec17,
3904
+ 1,
3905
+ "keyframes"
3906
+ ],
3907
+ [
3908
+ _dec18,
3909
+ 1,
3910
+ "_isAnimating"
3911
+ ]
3912
+ ], [
3913
+ _dec
3914
+ ], _ViElement));
3915
+ }
3916
+ createRenderRoot() {
3917
+ return this;
3918
+ }
3919
+ #___private_name_1 = (_initProto(this), _init_name(this, 'fade-in'));
3920
+ get name() {
3921
+ return this.#___private_name_1;
3922
+ }
3923
+ set name(_v) {
3924
+ this.#___private_name_1 = _v;
3925
+ }
3926
+ #___private_enter_2 = _init_enter(this, '');
3927
+ get enter() {
3928
+ return this.#___private_enter_2;
3929
+ }
3930
+ set enter(_v) {
3931
+ this.#___private_enter_2 = _v;
3932
+ }
3933
+ #___private_exit_3 = _init_exit(this, '');
3934
+ get exit() {
3935
+ return this.#___private_exit_3;
3936
+ }
3937
+ set exit(_v) {
3938
+ this.#___private_exit_3 = _v;
3939
+ }
3940
+ #___private_duration_4 = _init_duration(this, 300);
3941
+ get duration() {
3942
+ return this.#___private_duration_4;
3943
+ }
3944
+ set duration(_v) {
3945
+ this.#___private_duration_4 = _v;
3946
+ }
3947
+ #___private_delay_5 = _init_delay(this, 0);
3948
+ get delay() {
3949
+ return this.#___private_delay_5;
3950
+ }
3951
+ set delay(_v) {
3952
+ this.#___private_delay_5 = _v;
3953
+ }
3954
+ #___private_easing_6 = _init_easing(this, 'cubic-bezier(0.2, 0, 0, 1)');
3955
+ get easing() {
3956
+ return this.#___private_easing_6;
3957
+ }
3958
+ set easing(_v) {
3959
+ this.#___private_easing_6 = _v;
3960
+ }
3961
+ #___private_iterations_7 = _init_iterations(this, 1);
3962
+ get iterations() {
3963
+ return this.#___private_iterations_7;
3964
+ }
3965
+ set iterations(_v) {
3966
+ this.#___private_iterations_7 = _v;
3967
+ }
3968
+ #___private_direction_8 = _init_direction(this, 'normal');
3969
+ get direction() {
3970
+ return this.#___private_direction_8;
3971
+ }
3972
+ set direction(_v) {
3973
+ this.#___private_direction_8 = _v;
3974
+ }
3975
+ #___private_fill_9 = _init_fill(this, 'forwards');
3976
+ get fill() {
3977
+ return this.#___private_fill_9;
3978
+ }
3979
+ set fill(_v) {
3980
+ this.#___private_fill_9 = _v;
3981
+ }
3982
+ #___private_open_10 = _init_open(this, true);
3983
+ get open() {
3984
+ return this.#___private_open_10;
3985
+ }
3986
+ set open(_v) {
3987
+ this.#___private_open_10 = _v;
3988
+ }
3989
+ #___private_autoPlay_11 = _init_autoPlay(this, true);
3990
+ get autoPlay() {
3991
+ return this.#___private_autoPlay_11;
3992
+ }
3993
+ set autoPlay(_v) {
3994
+ this.#___private_autoPlay_11 = _v;
3995
+ }
3996
+ #___private_cascade_12 = _init_cascade(this, false);
3997
+ get cascade() {
3998
+ return this.#___private_cascade_12;
3999
+ }
4000
+ set cascade(_v) {
4001
+ this.#___private_cascade_12 = _v;
4002
+ }
4003
+ #___private_stagger_13 = _init_stagger(this, 50);
4004
+ get stagger() {
4005
+ return this.#___private_stagger_13;
4006
+ }
4007
+ set stagger(_v) {
4008
+ this.#___private_stagger_13 = _v;
4009
+ }
4010
+ #___private_staggerSelector_14 = _init_staggerSelector(this, ':scope > *');
4011
+ get staggerSelector() {
4012
+ return this.#___private_staggerSelector_14;
4013
+ }
4014
+ set staggerSelector(_v) {
4015
+ this.#___private_staggerSelector_14 = _v;
4016
+ }
4017
+ #___private_staggerDirection_15 = _init_staggerDirection(this, 'normal');
4018
+ get staggerDirection() {
4019
+ return this.#___private_staggerDirection_15;
4020
+ }
4021
+ set staggerDirection(_v) {
4022
+ this.#___private_staggerDirection_15 = _v;
4023
+ }
4024
+ #___private_reducedMotion_16 = _init_reducedMotion(this, 'auto');
4025
+ get reducedMotion() {
4026
+ return this.#___private_reducedMotion_16;
4027
+ }
4028
+ set reducedMotion(_v) {
4029
+ this.#___private_reducedMotion_16 = _v;
4030
+ }
4031
+ #___private_keyframes_17 = _init_keyframes(this, null);
4032
+ get keyframes() {
4033
+ return this.#___private_keyframes_17;
4034
+ }
4035
+ set keyframes(_v) {
4036
+ this.#___private_keyframes_17 = _v;
4037
+ }
4038
+ #___private__isAnimating_18 = _init__isAnimating(this, false);
4039
+ get _isAnimating() {
4040
+ return this.#___private__isAnimating_18;
4041
+ }
4042
+ set _isAnimating(_v) {
4043
+ this.#___private__isAnimating_18 = _v;
4044
+ }
4045
+ _activeAnimations = [];
4046
+ /**
4023
4047
  * Monotonically incrementing sequence ID. Incremented on every new sequence
4024
4048
  * start (via _cancelSilently). Async continuations check their captured ID
4025
4049
  * against the current to detect stale callbacks.
4026
4050
  */ _sequenceId = 0;
4027
- /**
4051
+ /**
4028
4052
  * Prevents updated() from re-calling show()/hide() when the imperative API
4029
4053
  * internally mutates this.open to keep it in sync with animation state.
4030
4054
  */ _updateGuard = false;
4031
- /** Cached matchMedia object for prefers-reduced-motion. */ _reducedMotionMQ = null;
4032
- _reducedMotionListener = null;
4033
- // ─── Public getters ───────────────────────────────────────────────────────
4034
- /** Whether an animation sequence is currently running. */ get isAnimating() {
4035
- return this._isAnimating;
4036
- }
4037
- // ─── Lifecycle ────────────────────────────────────────────────────────────
4038
- connectedCallback() {
4039
- super.connectedCallback();
4040
- if (!this.open) {
4041
- this.hidden = true;
4042
- } else if (this.autoPlay) {
4043
- this.updateComplete.then(()=>this.play());
4044
- }
4045
- if (typeof window !== 'undefined') {
4046
- this._reducedMotionMQ = window.matchMedia('(prefers-reduced-motion: reduce)');
4047
- this._reducedMotionListener = ()=>this.requestUpdate();
4048
- this._reducedMotionMQ.addEventListener('change', this._reducedMotionListener);
4049
- }
4050
- }
4051
- disconnectedCallback() {
4052
- super.disconnectedCallback();
4053
- // Cancel in-flight animations to release resources on detached nodes
4054
- this._cancelSilently();
4055
- if (this._reducedMotionMQ && this._reducedMotionListener) {
4056
- this._reducedMotionMQ.removeEventListener('change', this._reducedMotionListener);
4057
- this._reducedMotionMQ = null;
4058
- this._reducedMotionListener = null;
4059
- }
4060
- }
4061
- updated(changedProperties) {
4062
- super.updated(changedProperties);
4063
- // _updateGuard prevents show()/hide() from being called again when the
4064
- // imperative API internally sets this.open to keep property state in sync
4065
- if (this._updateGuard) return;
4066
- if (changedProperties.has('open') && changedProperties.get('open') !== undefined) {
4067
- if (this.open) {
4068
- this.show();
4069
- } else {
4070
- this.hide();
4071
- }
4072
- }
4073
- }
4074
- // ─── Imperative API ───────────────────────────────────────────────────────
4075
- /** Returns a snapshot of the currently running Animation objects. */ getAnimations() {
4076
- return [
4077
- ...this._activeAnimations
4078
- ];
4055
+ /** Cached matchMedia object for prefers-reduced-motion. */ _reducedMotionMQ = null;
4056
+ _reducedMotionListener = null;
4057
+ // ─── Public getters ───────────────────────────────────────────────────────
4058
+ /** Whether an animation sequence is currently running. */ get isAnimating() {
4059
+ return this._isAnimating;
4060
+ }
4061
+ // ─── Lifecycle ────────────────────────────────────────────────────────────
4062
+ connectedCallback() {
4063
+ super.connectedCallback();
4064
+ if (!this.open) {
4065
+ this.hidden = true;
4066
+ } else if (this.autoPlay) {
4067
+ this.updateComplete.then(()=>this.play());
4068
+ }
4069
+ if (typeof window !== 'undefined') {
4070
+ this._reducedMotionMQ = window.matchMedia('(prefers-reduced-motion: reduce)');
4071
+ this._reducedMotionListener = ()=>this.requestUpdate();
4072
+ this._reducedMotionMQ.addEventListener('change', this._reducedMotionListener);
4073
+ }
4074
+ }
4075
+ disconnectedCallback() {
4076
+ super.disconnectedCallback();
4077
+ // Cancel in-flight animations to release resources on detached nodes
4078
+ this._cancelSilently();
4079
+ if (this._reducedMotionMQ && this._reducedMotionListener) {
4080
+ this._reducedMotionMQ.removeEventListener('change', this._reducedMotionListener);
4081
+ this._reducedMotionMQ = null;
4082
+ this._reducedMotionListener = null;
4083
+ }
4084
+ }
4085
+ updated(changedProperties) {
4086
+ super.updated(changedProperties);
4087
+ // _updateGuard prevents show()/hide() from being called again when the
4088
+ // imperative API internally sets this.open to keep property state in sync
4089
+ if (this._updateGuard) return;
4090
+ if (changedProperties.has('open') && changedProperties.get('open') !== undefined) {
4091
+ if (this.open) {
4092
+ this.show();
4093
+ } else {
4094
+ this.hide();
4079
4095
  }
4080
- /**
4096
+ }
4097
+ }
4098
+ // ─── Imperative API ───────────────────────────────────────────────────────
4099
+ /** Returns a snapshot of the currently running Animation objects. */ getAnimations() {
4100
+ return [
4101
+ ...this._activeAnimations
4102
+ ];
4103
+ }
4104
+ /**
4081
4105
  * Animate element into view.
4082
4106
  * Fires cancelable `vi-animation-before-show` — call preventDefault() to block.
4083
4107
  */ async show() {
4084
- const allowed = this._dispatchCancelable('vi-animation-before-show', {
4085
- name: this.enter || this.name,
4086
- target: this,
4087
- phase: 'enter'
4088
- });
4089
- if (!allowed) {
4090
- // If show() was triggered by a declarative open=true change while still hidden,
4091
- // revert to a consistent closed state.
4092
- if (this.open && this.hidden) {
4093
- this._withUpdateGuard(()=>{
4094
- this.open = false;
4095
- this.hidden = true;
4096
- });
4097
- }
4098
- return;
4099
- }
4108
+ const allowed = this._dispatchCancelable('vi-animation-before-show', {
4109
+ name: this.enter || this.name,
4110
+ target: this,
4111
+ phase: 'enter'
4112
+ });
4113
+ if (!allowed) {
4114
+ // If show() was triggered by a declarative open=true change while still hidden,
4115
+ // revert to a consistent closed state.
4116
+ if (this.open && this.hidden) {
4100
4117
  this._withUpdateGuard(()=>{
4101
- if (!this.open) this.open = true;
4102
- this.hidden = false;
4118
+ this.open = false;
4119
+ this.hidden = true;
4103
4120
  });
4104
- const animName = this.enter || this.name || 'fade-in';
4105
- await this._runAnimationSequence(animName, 'enter', false);
4106
4121
  }
4107
- /**
4122
+ return;
4123
+ }
4124
+ this._withUpdateGuard(()=>{
4125
+ if (!this.open) this.open = true;
4126
+ this.hidden = false;
4127
+ });
4128
+ const animName = this.enter || this.name || 'fade-in';
4129
+ await this._runAnimationSequence(animName, 'enter', false);
4130
+ }
4131
+ /**
4108
4132
  * Animate element out of view.
4109
4133
  * Fires cancelable `vi-animation-before-hide` — call preventDefault() to block.
4110
4134
  */ async hide() {
4111
- const exitName = this.exit || EXIT_COUNTERPART[this.name] || 'fade-out';
4112
- const allowed = this._dispatchCancelable('vi-animation-before-hide', {
4113
- name: exitName,
4114
- target: this,
4115
- phase: 'exit'
4116
- });
4117
- if (!allowed) {
4118
- if (!this.open && !this.hidden) {
4119
- this._withUpdateGuard(()=>{
4120
- this.open = true;
4121
- this.hidden = false;
4122
- });
4123
- }
4124
- return;
4125
- }
4126
- await this._runAnimationSequence(exitName, 'exit', true);
4135
+ const exitName = this.exit || EXIT_COUNTERPART[this.name] || 'fade-out';
4136
+ const allowed = this._dispatchCancelable('vi-animation-before-hide', {
4137
+ name: exitName,
4138
+ target: this,
4139
+ phase: 'exit'
4140
+ });
4141
+ if (!allowed) {
4142
+ if (!this.open && !this.hidden) {
4127
4143
  this._withUpdateGuard(()=>{
4128
- if (this.open) this.open = false;
4129
- this.hidden = true;
4144
+ this.open = true;
4145
+ this.hidden = false;
4130
4146
  });
4131
4147
  }
4132
- /** Toggle between show() and hide(). */ async toggle() {
4133
- if (this.open) {
4134
- await this.hide();
4135
- } else {
4136
- await this.show();
4137
- }
4138
- }
4139
- /** Play the current `name` animation without changing visibility. */ async play() {
4140
- const phase = this.open ? 'enter' : 'custom';
4141
- await this._runAnimationSequence(this.name, phase, false);
4142
- }
4143
- pause() {
4144
- this._activeAnimations.forEach((a)=>a.pause());
4145
- }
4146
- resume() {
4147
- this._activeAnimations.forEach((a)=>a.play());
4148
- }
4149
- reverse() {
4150
- this._activeAnimations.forEach((a)=>a.reverse());
4151
- }
4152
- /**
4148
+ return;
4149
+ }
4150
+ await this._runAnimationSequence(exitName, 'exit', true);
4151
+ this._withUpdateGuard(()=>{
4152
+ if (this.open) this.open = false;
4153
+ this.hidden = true;
4154
+ });
4155
+ }
4156
+ /** Toggle between show() and hide(). */ async toggle() {
4157
+ if (this.open) {
4158
+ await this.hide();
4159
+ } else {
4160
+ await this.show();
4161
+ }
4162
+ }
4163
+ /** Play the current `name` animation without changing visibility. */ async play() {
4164
+ const phase = this.open ? 'enter' : 'custom';
4165
+ await this._runAnimationSequence(this.name, phase, false);
4166
+ }
4167
+ pause() {
4168
+ this._activeAnimations.forEach((a)=>a.pause());
4169
+ }
4170
+ resume() {
4171
+ this._activeAnimations.forEach((a)=>a.play());
4172
+ }
4173
+ reverse() {
4174
+ this._activeAnimations.forEach((a)=>a.reverse());
4175
+ }
4176
+ /**
4153
4177
  * Cancel all running animations and fire `vi-animation-cancel`.
4154
4178
  */ cancel() {
4155
- this._cancelSilently();
4156
- this._dispatch('vi-animation-cancel', {
4157
- name: this.name,
4158
- target: this,
4159
- phase: 'custom'
4160
- });
4161
- }
4162
- /**
4179
+ this._cancelSilently();
4180
+ this._dispatch('vi-animation-cancel', {
4181
+ name: this.name,
4182
+ target: this,
4183
+ phase: 'custom'
4184
+ });
4185
+ }
4186
+ /**
4163
4187
  * Jump all running animations to their end state and fire `vi-animation-finish`.
4164
4188
  */ finish() {
4165
- const anims = [
4166
- ...this._activeAnimations
4167
- ];
4168
- // Clear state first so stale callbacks don't double-process
4169
- this._cancelSilently();
4170
- anims.forEach((a)=>{
4171
- try {
4172
- a.finish();
4173
- } catch {}
4174
- });
4175
- this._dispatch('vi-animation-finish', {
4176
- name: this.name,
4177
- target: this,
4178
- phase: 'custom'
4179
- });
4180
- }
4181
- // ─── Private helpers ──────────────────────────────────────────────────────
4182
- /**
4189
+ const anims = [
4190
+ ...this._activeAnimations
4191
+ ];
4192
+ // Clear state first so stale callbacks don't double-process
4193
+ this._cancelSilently();
4194
+ anims.forEach((a)=>{
4195
+ try {
4196
+ a.finish();
4197
+ } catch {}
4198
+ });
4199
+ this._dispatch('vi-animation-finish', {
4200
+ name: this.name,
4201
+ target: this,
4202
+ phase: 'custom'
4203
+ });
4204
+ }
4205
+ // ─── Private helpers ──────────────────────────────────────────────────────
4206
+ /**
4183
4207
  * Cancel all in-flight animations WITHOUT firing a public event.
4184
4208
  * Used for: self-interruption when a new sequence starts, and for lifecycle cleanup.
4185
4209
  */ _cancelSilently() {
4186
- this._sequenceId++; // invalidate any pending async continuations
4187
- this._activeAnimations.forEach((a)=>{
4188
- try {
4189
- a.cancel();
4190
- } catch {}
4191
- });
4192
- this._activeAnimations = [];
4193
- this._isAnimating = false;
4194
- }
4195
- /**
4210
+ this._sequenceId++; // invalidate any pending async continuations
4211
+ this._activeAnimations.forEach((a)=>{
4212
+ try {
4213
+ a.cancel();
4214
+ } catch {}
4215
+ });
4216
+ this._activeAnimations = [];
4217
+ this._isAnimating = false;
4218
+ }
4219
+ /**
4196
4220
  * Runs a function that mutates reactive properties without triggering
4197
4221
  * the updated() -> show()/hide() feedback loop.
4198
4222
  */ _withUpdateGuard(fn) {
4199
- this._updateGuard = true;
4200
- fn();
4201
- this.updateComplete.then(()=>{
4202
- this._updateGuard = false;
4203
- });
4204
- }
4205
- _getTargetElements() {
4206
- const slot = this.shadowRoot?.querySelector('slot');
4207
- if (!slot) return [
4208
- this
4209
- ];
4210
- const assignedNodes = slot.assignedElements({
4211
- flatten: true
4212
- });
4213
- if (assignedNodes.length === 0) return [
4214
- this
4215
- ];
4216
- if (!this.cascade) return assignedNodes;
4217
- const targetElements = [];
4218
- for (const node of assignedNodes){
4219
- let matched = false;
4220
- try {
4221
- if (node.matches(this.staggerSelector)) {
4222
- targetElements.push(node);
4223
- matched = true;
4224
- }
4225
- const children = Array.from(node.querySelectorAll(this.staggerSelector));
4226
- if (children.length > 0) {
4227
- targetElements.push(...children);
4228
- matched = true;
4229
- }
4230
- } catch {
4231
- return assignedNodes; // graceful fallback to all assigned nodes
4232
- }
4233
- if (!matched) targetElements.push(node);
4223
+ this._updateGuard = true;
4224
+ fn();
4225
+ this.updateComplete.then(()=>{
4226
+ this._updateGuard = false;
4227
+ });
4228
+ }
4229
+ _getTargetElements() {
4230
+ const childNodes = Array.from(this.children);
4231
+ if (childNodes.length === 0) return [
4232
+ this
4233
+ ];
4234
+ if (!this.cascade) return childNodes;
4235
+ const targetElements = [];
4236
+ for (const node of childNodes){
4237
+ let matched = false;
4238
+ try {
4239
+ if (node.matches(this.staggerSelector)) {
4240
+ targetElements.push(node);
4241
+ matched = true;
4234
4242
  }
4235
- return targetElements.length > 0 ? targetElements : assignedNodes;
4243
+ const children = Array.from(node.querySelectorAll(this.staggerSelector));
4244
+ if (children.length > 0) {
4245
+ targetElements.push(...children);
4246
+ matched = true;
4247
+ }
4248
+ } catch {
4249
+ return childNodes; // graceful fallback to all child nodes
4236
4250
  }
4237
- /**
4251
+ if (!matched) targetElements.push(node);
4252
+ }
4253
+ return targetElements.length > 0 ? targetElements : childNodes;
4254
+ }
4255
+ /**
4238
4256
  * Returns keyframes for a given animation name.
4239
4257
  * - Consumer keyframes are passed through as-is (Keyframe[] or PropertyIndexedKeyframes).
4240
4258
  * - Expand/collapse presets dynamically read scrollHeight/scrollWidth to avoid magic-number clipping.
4241
4259
  * - Falls back to PRESET_KEYFRAMES, then 'fade-in' if unknown.
4242
4260
  */ _getKeyframes(animName, phase, isReducedMotion, target) {
4243
- // Explicit consumer-supplied keyframes take highest priority
4244
- if (this.keyframes) return this.keyframes;
4245
- // For built-in presets under reduced motion, substitute with safe opacity fades
4246
- if (isReducedMotion) {
4247
- return PRESET_KEYFRAMES[phase === 'exit' ? 'fade-out' : 'fade-in'];
4248
- }
4249
- // Dynamic expand/collapse using actual element dimensions
4250
- if (EXPAND_COLLAPSE_PRESETS.has(animName) && target) {
4251
- const h = target.scrollHeight;
4252
- const w = target.scrollWidth;
4253
- switch(animName){
4254
- case 'expand-vertical':
4255
- return [
4256
- {
4257
- maxHeight: '0px',
4258
- opacity: 0,
4259
- overflow: 'hidden'
4260
- },
4261
- {
4262
- maxHeight: `${h}px`,
4263
- opacity: 1,
4264
- overflow: 'hidden'
4265
- }
4266
- ];
4267
- case 'collapse-vertical':
4268
- return [
4269
- {
4270
- maxHeight: `${h}px`,
4271
- opacity: 1,
4272
- overflow: 'hidden'
4273
- },
4274
- {
4275
- maxHeight: '0px',
4276
- opacity: 0,
4277
- overflow: 'hidden'
4278
- }
4279
- ];
4280
- case 'expand-horizontal':
4281
- return [
4282
- {
4283
- maxWidth: '0px',
4284
- opacity: 0,
4285
- overflow: 'hidden'
4286
- },
4287
- {
4288
- maxWidth: `${w}px`,
4289
- opacity: 1,
4290
- overflow: 'hidden'
4291
- }
4292
- ];
4293
- case 'collapse-horizontal':
4294
- return [
4295
- {
4296
- maxWidth: `${w}px`,
4297
- opacity: 1,
4298
- overflow: 'hidden'
4299
- },
4300
- {
4301
- maxWidth: '0px',
4302
- opacity: 0,
4303
- overflow: 'hidden'
4304
- }
4305
- ];
4306
- }
4307
- }
4308
- return PRESET_KEYFRAMES[animName] ?? PRESET_KEYFRAMES['fade-in'];
4309
- }
4310
- _calculateStaggerDelay(index, total, shuffledOrder) {
4311
- if (!this.cascade || total <= 1) return this.delay;
4312
- let orderIndex = index;
4313
- if (this.staggerDirection === 'reverse') {
4314
- orderIndex = total - 1 - index;
4315
- } else if (this.staggerDirection === 'center') {
4316
- orderIndex = Math.abs((total - 1) / 2 - index);
4317
- } else if (this.staggerDirection === 'random' && shuffledOrder) {
4318
- orderIndex = shuffledOrder[index];
4319
- }
4320
- return this.delay + orderIndex * this.stagger;
4321
- }
4322
- async _runAnimationSequence(animName, phase, isExitPhase) {
4323
- const isReduced = this._shouldReduceMotion();
4324
- const targets = this._getTargetElements();
4325
- if (targets.length === 0) return;
4326
- // Interrupt previous sequence silently (no vi-animation-cancel event)
4327
- this._cancelSilently();
4328
- const mySequenceId = this._sequenceId;
4329
- this._isAnimating = true;
4330
- // 'auto' mode: shorten duration AND substitute keyframes.
4331
- // 'fade-only' mode: substitute keyframes only, original duration is preserved.
4332
- const actualDuration = isReduced && this.reducedMotion !== 'fade-only' ? Math.min(this.duration, 100) : this.duration;
4333
- this._dispatch('vi-animation-start', {
4334
- name: animName,
4335
- target: this,
4336
- phase,
4337
- duration: actualDuration,
4338
- delay: this.delay
4339
- });
4340
- // Pre-compute shuffled order so all elements get unique, non-repeating delay slots
4341
- const shuffledOrder = this.staggerDirection === 'random' ? shuffleIndices(targets.length) : undefined;
4342
- const animationPromises = targets.map((el, index)=>{
4343
- const elementDelay = isReduced ? 0 : this._calculateStaggerDelay(index, targets.length, shuffledOrder);
4344
- const kf = this._getKeyframes(animName, phase, isReduced, el);
4345
- const anim = el.animate(kf, {
4346
- duration: actualDuration,
4347
- delay: elementDelay,
4348
- easing: this.easing,
4349
- iterations: this.iterations,
4350
- direction: this.direction,
4351
- fill: this.fill
4352
- });
4353
- this._activeAnimations.push(anim);
4354
- return anim.finished.then(()=>{
4355
- // For exit animations: commit the end-frame styles to element.style and
4356
- // cancel the WAAPI fill so external CSS can take over later (avoids
4357
- // invisible elements if the element is re-shown via show() or style).
4358
- if (isExitPhase) {
4359
- try {
4360
- anim.commitStyles();
4361
- } catch {}
4362
- try {
4363
- anim.cancel();
4364
- } catch {}
4261
+ // Explicit consumer-supplied keyframes take highest priority
4262
+ if (this.keyframes) return this.keyframes;
4263
+ // For built-in presets under reduced motion, substitute with safe opacity fades
4264
+ if (isReducedMotion) {
4265
+ return PRESET_KEYFRAMES[phase === 'exit' ? 'fade-out' : 'fade-in'];
4266
+ }
4267
+ // Dynamic expand/collapse using actual element dimensions
4268
+ if (EXPAND_COLLAPSE_PRESETS.has(animName) && target) {
4269
+ const h = target.scrollHeight;
4270
+ const w = target.scrollWidth;
4271
+ switch(animName){
4272
+ case 'expand-vertical':
4273
+ return [
4274
+ {
4275
+ maxHeight: '0px',
4276
+ opacity: 0,
4277
+ overflow: 'hidden'
4278
+ },
4279
+ {
4280
+ maxHeight: `${h}px`,
4281
+ opacity: 1,
4282
+ overflow: 'hidden'
4365
4283
  }
4366
- }, ()=>null);
4367
- });
4368
- await Promise.all(animationPromises);
4369
- // Discard stale result if a newer sequence has already started
4370
- if (this._sequenceId !== mySequenceId) return;
4371
- this._isAnimating = false;
4372
- this._activeAnimations = [];
4373
- this._dispatch('vi-animation-end', {
4374
- name: animName,
4375
- target: this,
4376
- phase,
4377
- completed: true
4378
- });
4284
+ ];
4285
+ case 'collapse-vertical':
4286
+ return [
4287
+ {
4288
+ maxHeight: `${h}px`,
4289
+ opacity: 1,
4290
+ overflow: 'hidden'
4291
+ },
4292
+ {
4293
+ maxHeight: '0px',
4294
+ opacity: 0,
4295
+ overflow: 'hidden'
4296
+ }
4297
+ ];
4298
+ case 'expand-horizontal':
4299
+ return [
4300
+ {
4301
+ maxWidth: '0px',
4302
+ opacity: 0,
4303
+ overflow: 'hidden'
4304
+ },
4305
+ {
4306
+ maxWidth: `${w}px`,
4307
+ opacity: 1,
4308
+ overflow: 'hidden'
4309
+ }
4310
+ ];
4311
+ case 'collapse-horizontal':
4312
+ return [
4313
+ {
4314
+ maxWidth: `${w}px`,
4315
+ opacity: 1,
4316
+ overflow: 'hidden'
4317
+ },
4318
+ {
4319
+ maxWidth: '0px',
4320
+ opacity: 0,
4321
+ overflow: 'hidden'
4322
+ }
4323
+ ];
4379
4324
  }
4380
- /**
4325
+ }
4326
+ return PRESET_KEYFRAMES[animName] ?? PRESET_KEYFRAMES['fade-in'];
4327
+ }
4328
+ _calculateStaggerDelay(index, total, shuffledOrder) {
4329
+ if (!this.cascade || total <= 1) return this.delay;
4330
+ let orderIndex = index;
4331
+ if (this.staggerDirection === 'reverse') {
4332
+ orderIndex = total - 1 - index;
4333
+ } else if (this.staggerDirection === 'center') {
4334
+ orderIndex = Math.abs((total - 1) / 2 - index);
4335
+ } else if (this.staggerDirection === 'random' && shuffledOrder) {
4336
+ orderIndex = shuffledOrder[index];
4337
+ }
4338
+ return this.delay + orderIndex * this.stagger;
4339
+ }
4340
+ async _runAnimationSequence(animName, phase, isExitPhase) {
4341
+ const isReduced = this._shouldReduceMotion();
4342
+ const targets = this._getTargetElements();
4343
+ if (targets.length === 0) return;
4344
+ // Interrupt previous sequence silently (no vi-animation-cancel event)
4345
+ this._cancelSilently();
4346
+ const mySequenceId = this._sequenceId;
4347
+ this._isAnimating = true;
4348
+ // 'auto' mode: shorten duration AND substitute keyframes.
4349
+ // 'fade-only' mode: substitute keyframes only, original duration is preserved.
4350
+ const actualDuration = isReduced && this.reducedMotion !== 'fade-only' ? Math.min(this.duration, 100) : this.duration;
4351
+ this._dispatch('vi-animation-start', {
4352
+ name: animName,
4353
+ target: this,
4354
+ phase,
4355
+ duration: actualDuration,
4356
+ delay: this.delay
4357
+ });
4358
+ // Pre-compute shuffled order so all elements get unique, non-repeating delay slots
4359
+ const shuffledOrder = this.staggerDirection === 'random' ? shuffleIndices(targets.length) : undefined;
4360
+ const animationPromises = targets.map((el, index)=>{
4361
+ const elementDelay = isReduced ? 0 : this._calculateStaggerDelay(index, targets.length, shuffledOrder);
4362
+ const kf = this._getKeyframes(animName, phase, isReduced, el);
4363
+ const anim = el.animate(kf, {
4364
+ duration: actualDuration,
4365
+ delay: elementDelay,
4366
+ easing: this.easing,
4367
+ iterations: this.iterations,
4368
+ direction: this.direction,
4369
+ fill: this.fill
4370
+ });
4371
+ this._activeAnimations.push(anim);
4372
+ return anim.finished.then(()=>{
4373
+ // For exit animations: commit the end-frame styles to element.style and
4374
+ // cancel the WAAPI fill so external CSS can take over later (avoids
4375
+ // invisible elements if the element is re-shown via show() or style).
4376
+ if (isExitPhase) {
4377
+ try {
4378
+ anim.commitStyles();
4379
+ } catch {}
4380
+ try {
4381
+ anim.cancel();
4382
+ } catch {}
4383
+ }
4384
+ }, ()=>null);
4385
+ });
4386
+ await Promise.all(animationPromises);
4387
+ // Discard stale result if a newer sequence has already started
4388
+ if (this._sequenceId !== mySequenceId) return;
4389
+ this._isAnimating = false;
4390
+ this._activeAnimations = [];
4391
+ this._dispatch('vi-animation-end', {
4392
+ name: animName,
4393
+ target: this,
4394
+ phase,
4395
+ completed: true
4396
+ });
4397
+ }
4398
+ /**
4381
4399
  * Returns whether any reduced-motion adaptation should be applied.
4382
4400
  *
4383
4401
  * Both 'auto' and 'fade-only' gate on the OS/browser preference so that the attribute
@@ -4387,35 +4405,33 @@ new class extends _identity {
4387
4405
  * - 'fade-only': substitute with opacity fade, but keep the original duration.
4388
4406
  * - 'disable': ignore OS preference entirely — always play the full animation.
4389
4407
  */ _shouldReduceMotion() {
4390
- if (this.reducedMotion === 'disable') return false;
4391
- // Gate on the OS/browser preference for both 'auto' and 'fade-only'.
4392
- return this._reducedMotionMQ?.matches ?? (typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches);
4393
- }
4394
- _dispatch(eventName, detail) {
4395
- this.dispatchEvent(new CustomEvent(eventName, {
4396
- detail,
4397
- bubbles: true,
4398
- composed: true
4399
- }));
4400
- }
4401
- /**
4408
+ if (this.reducedMotion === 'disable') return false;
4409
+ // Gate on the OS/browser preference for both 'auto' and 'fade-only'.
4410
+ return this._reducedMotionMQ?.matches ?? (typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches);
4411
+ }
4412
+ _dispatch(eventName, detail) {
4413
+ this.dispatchEvent(new CustomEvent(eventName, {
4414
+ detail,
4415
+ bubbles: true,
4416
+ composed: true
4417
+ }));
4418
+ }
4419
+ /**
4402
4420
  * Dispatch a cancelable event. Returns true if the animation should proceed
4403
4421
  * (i.e. preventDefault() was NOT called), false if it should be blocked.
4404
4422
  */ _dispatchCancelable(eventName, detail) {
4405
- const event = new CustomEvent(eventName, {
4406
- detail,
4407
- bubbles: true,
4408
- composed: true,
4409
- cancelable: true
4410
- });
4411
- this.dispatchEvent(event);
4412
- return !event.defaultPrevented;
4413
- }
4414
- render() {
4415
- return html`<slot></slot>`;
4416
- }
4417
- }
4423
+ const event = new CustomEvent(eventName, {
4424
+ detail,
4425
+ bubbles: true,
4426
+ composed: true,
4427
+ cancelable: true
4428
+ });
4429
+ this.dispatchEvent(event);
4430
+ return !event.defaultPrevented;
4418
4431
  }
4419
- }();
4432
+ static{
4433
+ _initClass();
4434
+ }
4435
+ }
4420
4436
 
4421
4437
  export { _ViAlert as ViAlert, _ViAnimation as ViAnimation, _ViBadge as ViBadge, _ViChip as ViChip, _ViChipGroup as ViChipGroup, ViElement, registerIcons };