@odx/foundation 1.0.0-beta.50 → 1.0.0-beta.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/components.js +29 -42
  2. package/dist/i18n.js +1 -1
  3. package/dist/loader.js +4 -7
  4. package/dist/main.js +61 -164
  5. package/dist/types/components/accordion/accordion.d.ts +2 -2
  6. package/dist/types/components/area-header/area-header.d.ts +2 -2
  7. package/dist/types/components/avatar/avatar.d.ts +4 -4
  8. package/dist/types/components/badge/badge.d.ts +2 -2
  9. package/dist/types/components/button/button.d.ts +4 -4
  10. package/dist/types/components/checkbox-group/checkbox-group.d.ts +2 -2
  11. package/dist/types/components/chip/chip.d.ts +2 -2
  12. package/dist/types/components/circular-progress-bar/circular-progress-bar.d.ts +2 -2
  13. package/dist/types/components/dropdown/dropdown.d.ts +2 -2
  14. package/dist/types/components/headline/headline.d.ts +2 -2
  15. package/dist/types/components/inline-message/inline-message.d.ts +2 -2
  16. package/dist/types/components/kpi/kpi.d.ts +3 -3
  17. package/dist/types/components/logo/logo.d.ts +2 -2
  18. package/dist/types/components/main-menu/main-menu.d.ts +0 -1
  19. package/dist/types/components/modal/modal.d.ts +2 -2
  20. package/dist/types/components/navigation-item/navigation-item.d.ts +2 -2
  21. package/dist/types/components/page/page.d.ts +3 -3
  22. package/dist/types/components/progress-bar/progress-bar.d.ts +2 -2
  23. package/dist/types/components/radio-group/radio-group.d.ts +2 -2
  24. package/dist/types/components/search-bar/search-bar.d.ts +2 -2
  25. package/dist/types/components/separator/separator.d.ts +2 -2
  26. package/dist/types/components/skeleton/skeleton.d.ts +3 -3
  27. package/dist/types/components/slider/slider.models.d.ts +3 -3
  28. package/dist/types/components/stack/stack.d.ts +4 -4
  29. package/dist/types/components/status/status.d.ts +2 -2
  30. package/dist/types/components/text/text.d.ts +3 -3
  31. package/dist/types/components/title/title.d.ts +2 -2
  32. package/dist/types/components/toast/toast.d.ts +2 -2
  33. package/dist/types/components/tooltip/tooltip.d.ts +2 -2
  34. package/dist/types/lib/controllers/focus-trap.controller.d.ts +1 -13
  35. package/dist/types/lib/drag-drop/is-draggable.d.ts +1 -1
  36. package/dist/types/lib/interactive/interactive-element.d.ts +1 -1
  37. package/dist/types/lib/interactive/interactive-link.d.ts +1 -1
  38. package/dist/types/lib/main.d.ts +1 -2
  39. package/dist/types/lib/mixins/active-descendant.d.ts +1 -1
  40. package/dist/types/lib/mixins/can-be-disabled.d.ts +1 -1
  41. package/dist/types/lib/mixins/can-be-expanded.d.ts +1 -1
  42. package/dist/types/lib/mixins/can-be-selected.d.ts +2 -1
  43. package/dist/types/lib/mixins/form-control.d.ts +1 -1
  44. package/dist/types/lib/mixins/number-control.d.ts +1 -1
  45. package/dist/types/lib/mixins/with-loading-state.d.ts +1 -1
  46. package/dist/types/lib/models/shape.d.ts +2 -2
  47. package/dist/types/lib/models/size.d.ts +2 -2
  48. package/dist/types/lib/models/state.d.ts +2 -2
  49. package/dist/types/lib/models/variant.d.ts +2 -2
  50. package/dist/types/lib/popover/popover-observer.d.ts +1 -1
  51. package/dist/types/lib/popover/popover.models.d.ts +3 -3
  52. package/dist/types/lib/utils/dedupe-mixin.d.ts +1 -1
  53. package/dist/types/lib/utils/dom.d.ts +14 -1
  54. package/dist/types/lib/utils/keyboard.d.ts +14 -0
  55. package/dist/types/lib/utils/search-text-content.d.ts +2 -1
  56. package/dist/types/lib/utils/shared-intersection-observer.d.ts +0 -7
  57. package/dist/types/lib/utils/shared-resize-observer.d.ts +0 -7
  58. package/dist/types/lib/utils/types.d.ts +1 -2
  59. package/dist/types/loader/main.d.ts +1 -1
  60. package/dist/{vendor-C_8wBEOn.js → vendor-kPOMiFOM.js} +71 -50
  61. package/package.json +4 -5
  62. package/dist/types/lib/utils/keyboard-events.d.ts +0 -43
@@ -1,11 +1,11 @@
1
- import { CanBeExpanded, InteractiveElement, getUniqueId, toAriaBooleanAttribute, customElement, requestUpdateOnAriaChange, CustomElement, ExpandableItemManager, enumFrom, Size, Variant, optionalAttr, InteractiveLink, createIntersectionObserver, createMutationObserver, getElementFromEvent, Shape, CanBeDisabled, optionalSlot, CheckboxGroupFormControl, CheckboxFormControl, toggleAttribute, SharedResizeObserver, PopoverPlacement, PopoverHost, getKeyboardEventInfo, PopoverPlacementOptions, searchTextContent, FormControl, ActiveDescendantsController, getAssignedElement, parseDate, waitForAnimations, forwardEvent, CanBeSelected, WithLoadingState, FocusTrapController, OptionControl, toPx, RadioGroupFormControl, ListboxFormControl, IsDraggable, NumberControl, IS_DRAG_ACTIVE_ATTRIBUTE, DragController } from '@odx/foundation';
1
+ import { CanBeExpanded, InteractiveElement, getUniqueId, toAriaBooleanAttribute, customElement, requestUpdateOnAriaChange, CustomElement, ExpandableItemManager, enumFrom, Size, Variant, optionalAttr, InteractiveLink, createIntersectionObserver, createMutationObserver, getElementFromEvent, Shape, CanBeDisabled, optionalSlot, CheckboxGroupFormControl, CheckboxFormControl, toggleAttribute, SharedResizeObserver, PopoverPlacement, PopoverHost, getKeyInfo, PopoverPlacementOptions, searchTextContent, FormControl, ActiveDescendantsController, getAssignedElement, parseDate, waitForAnimations, forwardEvent, CanBeSelected, WithLoadingState, OptionControl, toPx, RadioGroupFormControl, ListboxFormControl, IsDraggable, NumberControl, IS_DRAG_ACTIVE_ATTRIBUTE, DragController } from '@odx/foundation';
2
2
  import { html, isServer, css, nothing } from 'lit';
3
3
  import { property, queryAssignedElements, state, queryAll, query } from 'lit/decorators.js';
4
4
  import { when } from 'lit/directives/when.js';
5
5
  import { signal, computed, SignalWatcher } from '@lit-labs/preact-signals';
6
6
  import { repeat } from 'lit/directives/repeat.js';
7
7
  import { IsLocalized, setTranslation } from '@odx/foundation/i18n';
8
- import { R as RovingTabindexController, r as round, d as debounce } from './vendor-C_8wBEOn.js';
8
+ import { R as RovingTabindexController, r as round, d as debounce } from './vendor-kPOMiFOM.js';
9
9
  import { createContext, consume, provide } from '@lit/context';
10
10
 
11
11
  const styles$1d = ":host{display:block;margin-block:var(--odx-size-37)}:host([expanded])::part(indicator){--rotate: 180deg}";
@@ -799,7 +799,7 @@ OdxButtonGroup = __decorateClass$1a([
799
799
  customElement("odx-button-group", [styles$10])
800
800
  ], OdxButtonGroup);
801
801
 
802
- const styles$$ = ":host{--_card-padding: var(--odx-size-150);display:grid;grid-template-areas:\"image image\" \"avatar avatar\" \"title header-actions\" \"content content\" \"footer footer\";grid-template-columns:1fr auto;place-content:flex-start;border-radius:var(--odx-border-radius-md);background-color:var(--odx-color-background-main);padding:var(--_card-padding);max-width:100%;overflow:clip}.header,.title{display:flex;place-items:center;margin-block-end:var(--odx-size-50);min-block-size:var(--odx-size-225);overflow:hidden}.title{grid-area:title}.header{grid-area:header-actions}.avatar{display:flex;grid-area:avatar;place-items:flex-end;margin-block-start:calc(-1 * var(--odx-size-50))}.image{position:relative;grid-area:image;margin:calc(-1 * var(--_card-padding));margin-block-end:var(--odx-size-150)}.image:after{position:absolute;inset:0;transition:var(--odx-transition-default);opacity:0;background-color:var(--odx-color-background-transparent-hover);content:\"\";pointer-events:none;backdrop-filter:blur(var(--odx-elevation-blur))}:host::part(content){grid-area:content}:host::part(footer){grid-area:footer}[part=image-container]+[part=avatar-container]{block-size:0}slot[name=image]::slotted(*){max-block-size:100%;max-inline-size:100%;pointer-events:none;object-fit:cover;aspect-ratio:16 / 9;user-select:none}slot[name=avatar]::slotted(*){margin:0}:host(:hover){cursor:pointer}:host(:hover) .image:after{opacity:1}";
802
+ const styles$$ = ":host{--_card-padding: var(--odx-size-150);display:grid;grid-template-areas:\"image image\" \"avatar avatar\" \"title header-actions\" \"content content\" \"footer footer\";grid-template-columns:1fr auto;place-content:flex-start;border-radius:var(--odx-border-radius-md);background-color:var(--odx-color-background-level-1);padding:var(--_card-padding);max-width:100%;overflow:clip}.header,.title{display:flex;place-items:center;margin-block-end:var(--odx-size-50);min-block-size:var(--odx-size-225);overflow:hidden}.title{grid-area:title}.header{grid-area:header-actions}.avatar{display:flex;grid-area:avatar;place-items:flex-end;margin-block-start:calc(-1 * var(--odx-size-50))}.image{position:relative;grid-area:image;margin:calc(-1 * var(--_card-padding));margin-block-end:var(--odx-size-150)}.image:after{position:absolute;inset:0;transition:var(--odx-transition-default);opacity:0;background-color:var(--odx-color-background-transparent-hover);content:\"\";pointer-events:none;backdrop-filter:blur(var(--odx-elevation-blur))}:host::part(content){grid-area:content}:host::part(footer){grid-area:footer}[part=image-container]+[part=avatar-container]{block-size:0}slot[name=image]::slotted(*){max-block-size:100%;max-inline-size:100%;pointer-events:none;object-fit:cover;aspect-ratio:16 / 9;user-select:none}slot[name=avatar]::slotted(*){margin:0}:host(:hover){cursor:pointer}:host(:hover) .image:after{opacity:1}";
803
803
 
804
804
  var __defProp$19 = Object.defineProperty;
805
805
  var __getOwnPropDesc$19 = Object.getOwnPropertyDescriptor;
@@ -1169,8 +1169,7 @@ let OdxDropdown = class extends PopoverHost {
1169
1169
  this.togglePopover();
1170
1170
  });
1171
1171
  __privateAdd$p(this, _handleKeyboardEvent$1, (event) => {
1172
- const { actions } = getKeyboardEventInfo(event);
1173
- if (!actions.enter || event.defaultPrevented) return;
1172
+ if (!getKeyInfo(event).enter || event.defaultPrevented) return;
1174
1173
  if (!this.isPopoverOpen()) {
1175
1174
  event.stopImmediatePropagation();
1176
1175
  }
@@ -1395,14 +1394,14 @@ let OdxAutocomplete = class extends CanBeDisabled(FormControl(CustomElement)) {
1395
1394
  });
1396
1395
  __privateAdd$n(this, _handleControlKeyboardEvent, (event) => {
1397
1396
  if (!this.control) return;
1398
- const { actions, direction } = getKeyboardEventInfo(event);
1399
- if (actions.enter || actions.start || actions.end || direction.down || direction.up) {
1397
+ const key = getKeyInfo(event);
1398
+ if (key.enter || key.start || key.end || key.down || key.up) {
1400
1399
  event.preventDefault();
1401
1400
  }
1402
- if (actions.space) {
1401
+ if (key.space) {
1403
1402
  event.stopImmediatePropagation();
1404
1403
  }
1405
- if (this.activeDescendants.activeItem && actions.enter) {
1404
+ if (this.activeDescendants.activeItem && key.enter) {
1406
1405
  __privateMethod$e(this, _OdxAutocomplete_instances, handleControlValueChange_fn).call(this, this.activeDescendants.activeItem.getTextLabel());
1407
1406
  }
1408
1407
  });
@@ -1846,7 +1845,7 @@ OdxTitle = __decorateClass$V([
1846
1845
  customElement("odx-title", [styles$Q])
1847
1846
  ], OdxTitle);
1848
1847
 
1849
- const styles$P = "@layer base{:host{display:block;position:relative}.base{display:flex;block-size:var(--odx-size-300);background-color:var(--odx-color-background-main);column-gap:var(--odx-size-150);padding-inline:var(--odx-size-150);place-items:center;z-index:1;position:relative}.background{position:absolute;inset:0;z-index:0;background-color:var(--odx-color-background-main);clip-path:inset(0 -100vmax);box-shadow:0 0 0 100vmax var(--odx-color-background-main)}odx-logo{flex:0 0 auto}::slotted(odx-title){width:max-content}::slotted(odx-main-menu-button){margin-inline-end:calc(-1 * var(--odx-size-75))}::slotted(odx-header-actions){margin-inline-start:auto}@media screen and (max-width: 600px){odx-logo{display:none}}}";
1848
+ const styles$P = "@layer base{:host{display:block;position:relative}.base{display:flex;position:relative;column-gap:var(--odx-size-150);place-items:center;z-index:1;background-color:var(--odx-color-background-level-1);padding-inline:var(--odx-size-150);block-size:var(--odx-size-300)}.background{position:absolute;inset:0;z-index:0;box-shadow:0 0 0 100vmax var(--odx-color-background-level-1);background-color:var(--odx-color-background-level-1);clip-path:inset(0 -100vmax)}odx-logo{flex:0 0 auto}::slotted(odx-title){width:max-content}::slotted(odx-main-menu-button){margin-inline-end:calc(-1 * var(--odx-size-75))}::slotted(odx-header-actions){margin-inline-start:auto}@media screen and (width <= 600px){odx-logo{display:none}}}";
1850
1849
 
1851
1850
  var __defProp$U = Object.defineProperty;
1852
1851
  var __getOwnPropDesc$U = Object.getOwnPropertyDescriptor;
@@ -2081,7 +2080,7 @@ OdxImage = __decorateClass$R([
2081
2080
  customElement("odx-image", [styles$M])
2082
2081
  ], OdxImage);
2083
2082
 
2084
- const styles$L = "@layer base{:host{--_color-background: var(--odx-color-background-main);--_color-foreground: var(--odx-color-foreground-rest);--_color-stroke: var(--odx-color-separator);--_icon-size: var(--odx-size-150);display:flex;gap:var(--odx-size-75);align-items:flex-start;transition:var(--odx-transition-reduced);transition-property:background-color,color,display,opacity;background-color:var(--_color-background);padding:var(--odx-size-75);line-height:var(--odx-typography-line-height-base);color:var(--_color-foreground);transition-behavior:allow-discrete;@starting-style{opacity:0}}.icon{--size: var(--_icon-size)}.base{flex:1 1 auto;line-height:var(--odx-typography-line-height-base);font-size:var(--odx-typography-font-size-2)}.action{--_color-foreground: inherit;margin-block-start:calc(-1 * var(--odx-size-37));margin-inline-end:calc(-1 * var(--odx-size-37))}}@layer state{:host([hidden]){display:none;opacity:0}}@layer variant{:host([variant=\"accent\"]){--_color-background: var(--odx-palette-blue-10);--_color-stroke: var(--odx-palette-blue-60)}:host([variant=\"danger\"]){--_color-background: var(--odx-color-background-danger-muted);--_color-foreground: var(--odx-palette-red-90);--_color-stroke: var(--odx-palette-red-60)}:host([variant=\"warning\"]){--_color-background: var(--odx-color-background-warning-muted);--_color-stroke: var(--odx-palette-yellow-60)}:host([variant=\"success\"]){--_color-background: var(--odx-color-background-success-muted);--_color-stroke: var(--odx-palette-green-60)}:host([emphasized]){border-inline-start:var(--odx-border-width-thickest) solid var(--_color-stroke);padding-inline-start:calc(var(--odx-size-75) - var(--odx-border-width-thickest))}}";
2083
+ const styles$L = "@layer base{:host{--_color-background: var(--odx-color-background-level-1);--_color-foreground: var(--odx-color-foreground-rest);--_color-stroke: var(--odx-color-separator);--_icon-size: var(--odx-size-150);display:flex;gap:var(--odx-size-75);align-items:flex-start;transition:var(--odx-transition-reduced);transition-property:background-color,color,display,opacity;background-color:var(--_color-background);padding:var(--odx-size-75);line-height:var(--odx-typography-line-height-base);color:var(--_color-foreground);transition-behavior:allow-discrete;@starting-style{opacity:0}}.icon{--size: var(--_icon-size)}.base{flex:1 1 auto;line-height:var(--odx-typography-line-height-base);font-size:var(--odx-typography-font-size-2)}.action{--_color-foreground: inherit;margin-block-start:calc(-1 * var(--odx-size-37));margin-inline-end:calc(-1 * var(--odx-size-37))}}@layer state{:host([hidden]){display:none;opacity:0}}@layer variant{:host([variant=\"accent\"]){--_color-background: var(--odx-color-background-accent-muted);--_color-stroke: var(--odx-palette-blue-60)}:host([variant=\"danger\"]){--_color-background: var(--odx-color-background-danger-muted);--_color-foreground: var(--odx-palette-red-90);--_color-stroke: var(--odx-palette-red-60)}:host([variant=\"warning\"]){--_color-background: var(--odx-color-background-warning-muted);--_color-stroke: var(--odx-palette-yellow-60)}:host([variant=\"success\"]){--_color-background: var(--odx-color-background-success-muted);--_color-stroke: var(--odx-palette-green-60)}:host([emphasized]){border-block-end:var(--odx-border-width-thick) solid var(--_color-stroke);padding-block-end:calc(var(--odx-size-75) - var(--odx-border-width-thick))}}";
2085
2084
 
2086
2085
  var __defProp$Q = Object.defineProperty;
2087
2086
  var __getOwnPropDesc$Q = Object.getOwnPropertyDescriptor;
@@ -2178,8 +2177,7 @@ let OdxInput = class extends FormControl(CustomElement) {
2178
2177
  this.value = event.target.value;
2179
2178
  });
2180
2179
  __privateAdd$i(this, _handleKeyDown$2, (event) => {
2181
- const { actions } = getKeyboardEventInfo(event);
2182
- if (!actions.escape) return;
2180
+ if (!getKeyInfo(event).escape) return;
2183
2181
  event.preventDefault();
2184
2182
  this.clear();
2185
2183
  });
@@ -2772,22 +2770,15 @@ var __decorateClass$D = (decorators, target, key, kind) => {
2772
2770
  var __accessCheck$d = (obj, member, msg) => member.has(obj) || __typeError$d("Cannot " + msg);
2773
2771
  var __privateGet$b = (obj, member, getter) => (__accessCheck$d(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
2774
2772
  var __privateAdd$d = (obj, member, value) => member.has(obj) ? __typeError$d("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
2775
- var _focusTrap, _handleSlotChange$4, _handleToggle;
2773
+ var _handleSlotChange$4;
2776
2774
  let OdxMainMenu = class extends CustomElement {
2777
2775
  constructor() {
2778
- super();
2779
- __privateAdd$d(this, _focusTrap, new FocusTrapController(this));
2776
+ super(...arguments);
2780
2777
  __privateAdd$d(this, _handleSlotChange$4, () => {
2781
2778
  for (const link of this.links) {
2782
2779
  link.slot ||= "link-navigation";
2783
2780
  }
2784
2781
  });
2785
- __privateAdd$d(this, _handleToggle, ({ newState }) => {
2786
- __privateGet$b(this, _focusTrap).toggle(newState === "open");
2787
- });
2788
- if (!isServer) {
2789
- this.addEventListener("toggle", __privateGet$b(this, _handleToggle));
2790
- }
2791
2782
  }
2792
2783
  connectedCallback() {
2793
2784
  super.connectedCallback();
@@ -2820,9 +2811,7 @@ let OdxMainMenu = class extends CustomElement {
2820
2811
  `;
2821
2812
  }
2822
2813
  };
2823
- _focusTrap = new WeakMap();
2824
2814
  _handleSlotChange$4 = new WeakMap();
2825
- _handleToggle = new WeakMap();
2826
2815
  __decorateClass$D([
2827
2816
  queryAssignedElements({ selector: "odx-link", flatten: true })
2828
2817
  ], OdxMainMenu.prototype, "links", 2);
@@ -2924,21 +2913,20 @@ let OdxMenu = class extends PopoverHost {
2924
2913
  this.hidePopover();
2925
2914
  });
2926
2915
  __privateAdd$c(this, _handleKeyDown$1, (event) => {
2927
- const { actions } = getKeyboardEventInfo(event);
2928
- if ((actions.tab || actions.backTab) && this.isPopoverOpen()) {
2916
+ const key = getKeyInfo(event);
2917
+ if ((key.tab || key.backTab) && this.isPopoverOpen()) {
2929
2918
  event?.preventDefault();
2930
2919
  event.stopPropagation();
2931
2920
  this.hidePopover();
2932
2921
  return;
2933
2922
  }
2934
- if (!actions.enter && !actions.space) return;
2923
+ if (!key.enter && !key.space) return;
2935
2924
  const [activeItem] = this.getItems().filter((item) => item.tabIndex === 0);
2936
2925
  if (!activeItem) return;
2937
2926
  activeItem.click();
2938
2927
  });
2939
2928
  __privateAdd$c(this, _handleReferenceKeyDown, (event) => {
2940
- const { direction } = getKeyboardEventInfo(event);
2941
- if (!direction.down) return;
2929
+ if (!getKeyInfo(event).down) return;
2942
2930
  this.showPopover();
2943
2931
  });
2944
2932
  }
@@ -2992,7 +2980,7 @@ OdxMenu = __decorateClass$A([
2992
2980
  customElement("odx-menu", [styles$y])
2993
2981
  ], OdxMenu);
2994
2982
 
2995
- const styles$x = "@layer base{:host{--max-inline-size: 640px;--margin-block-start: var(--odx-size-450);--_modal-transition: var(--odx-popover-transition, var(--odx-motion-duration-default));--_modal-transition-offset-x: 0;--_modal-transition-offset-y: calc(-1 * var(--_modal-offset));--_modal-outer-padding: var(--odx-breakpoint-spacing-150);display:contents;transition-property:display}:host,.base,.base::backdrop{transition:var(--odx-transition-default);transition-behavior:allow-discrete}.base,.base::backdrop{opacity:0}.base{transform:translateY(var(--odx-size-100));transition-property:opacity,display,overlay,transform,outline;margin-block-start:var(--margin-block-start);border:0;border-radius:var(--odx-border-radius-ml);box-shadow:var(--odx-shadow-level-2);background:transparent;padding:0;inline-size:min(var(--max-inline-size),100% - 2 * var(--_modal-outer-padding));overflow:unset;color:var(--odx-color-foreground-rest);&::backdrop{transition-property:opacity;background-color:var(--odx-color-backdrop);backdrop-filter:blur(var(--odx-elevation-blur))}}.inner{display:flex;flex-direction:column;border-radius:inherit;background-color:var(--odx-color-background-main);padding:var(--odx-spacing-50) var(--odx-breakpoint-spacing-150);max-block-size:calc(100dvh - 2 * var(--_modal-outer-padding))}.header,.footer{min-block-size:var(--odx-size-300)}.header{padding-inline-end:var(--odx-size-300)}.content{padding:var(--odx-size-75) 0}.dismiss-action{position:absolute;inset-block-start:var(--odx-spacing-50);inset-inline-end:var(--odx-breakpoint-spacing-150)}}@layer state{:host(:not([open])){display:none}.base:focus-visible{outline-color:var(--odx-focus-ring-color)}.base[open]{transform:translate(0);&,&::backdrop{opacity:1;@starting-style{opacity:0}}@starting-style{transform:translateY(var(--odx-size-100))}}}";
2983
+ const styles$x = "@layer base{:host{--max-inline-size: 640px;--margin-block-start: var(--odx-size-450);--_modal-transition: var(--odx-popover-transition, var(--odx-motion-duration-default));--_modal-transition-offset-x: 0;--_modal-transition-offset-y: calc(-1 * var(--_modal-offset));--_modal-outer-padding: var(--odx-breakpoint-spacing-150);display:contents;transition-property:display}:host,.base,.base::backdrop{transition:var(--odx-transition-default);transition-behavior:allow-discrete}.base,.base::backdrop{opacity:0}.base{transform:translateY(var(--odx-size-100));transition-property:opacity,display,overlay,transform,outline;margin-block-start:var(--margin-block-start);border:0;border-radius:var(--odx-border-radius-ml);box-shadow:var(--odx-shadow-level-2);background:transparent;padding:0;inline-size:min(var(--max-inline-size),100% - 2 * var(--_modal-outer-padding));overflow:unset;color:var(--odx-color-foreground-rest);&::backdrop{transition-property:opacity;background-color:var(--odx-color-backdrop);backdrop-filter:blur(var(--odx-elevation-blur))}}.inner{display:flex;flex-direction:column;border-radius:inherit;background-color:var(--odx-color-background-level-1);padding:var(--odx-spacing-50) var(--odx-breakpoint-spacing-150);max-block-size:calc(100dvh - 2 * var(--_modal-outer-padding))}.header,.footer{min-block-size:var(--odx-size-300)}.header{padding-inline-end:var(--odx-size-300)}.content{padding:var(--odx-size-75) 0}.dismiss-action{position:absolute;inset-block-start:var(--odx-spacing-50);inset-inline-end:var(--odx-breakpoint-spacing-150)}}@layer state{:host(:not([open])){display:none}.base:focus-visible{outline-color:var(--odx-focus-ring-color)}.base[open]{transform:translate(0);&,&::backdrop{opacity:1;@starting-style{opacity:0}}@starting-style{transform:translateY(var(--odx-size-100))}}}";
2996
2984
 
2997
2985
  var __defProp$z = Object.defineProperty;
2998
2986
  var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
@@ -3037,8 +3025,7 @@ let OdxModal = class extends CustomElement {
3037
3025
  this.showRequested = false;
3038
3026
  this.open = false;
3039
3027
  __privateAdd$b(this, _handleKeyDown, (event) => {
3040
- const { actions } = getKeyboardEventInfo(event);
3041
- if (!actions.escape) return;
3028
+ if (!getKeyInfo(event).escape) return;
3042
3029
  event.preventDefault();
3043
3030
  this.dismiss();
3044
3031
  });
@@ -3170,7 +3157,7 @@ OdxNavigationItem = __decorateClass$y([
3170
3157
  customElement("odx-navigation-item", [styles$w])
3171
3158
  ], OdxNavigationItem);
3172
3159
 
3173
- const styles$v = ":host{--_color-background: var(--odx-palette-transparent);--_color-foreground: inherit;display:inline-flex;gap:var(--odx-size-75);place-items:center;transition:var(--odx-transition-reduced);transition-property:background-color,color,outline-color;outline:var(--odx-focus-ring-outline);outline-offset:var(--odx-outline-offset-focus);border-radius:var(--odx-border-radius-controls);background-color:var(--_color-background);cursor:pointer;padding:var(--odx-size-37) var(--odx-size-75);color:var(--_color-foreground);user-select:none}odx-checkbox{margin:0}:host(:hover){--_color-background: var(--odx-color-background-transparent-hover)}:host([odx-active]),:host(:active){--_color-background: var(--odx-color-background-transparent-pressed)}:host([selected]){--_color-background: var(--odx-color-background-transparent-selected)}:host([selected]:hover){--_color-background: var(--odx-color-background-transparent-selected-hover)}:host([disabled]){--_color-background: var(--odx-color-background-disabled-rest);--_color-foreground: var(--odx-color-foreground-disabled-rest);cursor:not-allowed;pointer-events:none}:host([selected][disabled]){--_color-background: var(--odx-color-background-disabled-selected);--_color-foreground: var(--odx-color-foreground-disabled-selected)}:host([selected][odx-active]),:host([selected]:active){--_color-background: var(--odx-color-background-transparent-selected-hover)}:host(:focus-visible){outline-color:var(--odx-focus-ring-color)}";
3160
+ const styles$v = ":host{--_color-background: var(--odx-color-background-transparent);--_color-foreground: inherit;display:inline-flex;gap:var(--odx-size-75);place-items:center;transition:var(--odx-transition-reduced);transition-property:background-color,color,outline-color;outline:var(--odx-focus-ring-outline);outline-offset:var(--odx-outline-offset-focus);border-radius:var(--odx-border-radius-controls);background-color:var(--_color-background);cursor:pointer;padding:var(--odx-size-37) var(--odx-size-75);color:var(--_color-foreground);user-select:none}odx-checkbox{margin:0}:host(:hover){--_color-background: var(--odx-color-background-transparent-hover)}:host([odx-active]),:host(:active){--_color-background: var(--odx-color-background-transparent-pressed)}:host([selected]){--_color-background: var(--odx-color-background-transparent-selected)}:host([selected]:hover){--_color-background: var(--odx-color-background-transparent-selected-hover)}:host([disabled]){--_color-background: var(--odx-color-background-disabled-rest);--_color-foreground: var(--odx-color-foreground-disabled-rest);cursor:not-allowed;pointer-events:none}:host([selected][disabled]){--_color-background: var(--odx-color-background-disabled-selected);--_color-foreground: var(--odx-color-foreground-disabled-selected)}:host([selected][odx-active]),:host([selected]:active){--_color-background: var(--odx-color-background-transparent-selected-hover)}:host(:focus-visible){outline-color:var(--odx-focus-ring-color)}";
3174
3161
 
3175
3162
  var __defProp$x = Object.defineProperty;
3176
3163
  var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
@@ -3199,7 +3186,7 @@ OdxOption = __decorateClass$x([
3199
3186
  customElement("odx-option", [styles$v])
3200
3187
  ], OdxOption);
3201
3188
 
3202
- const styles$u = ":host{display:grid;grid-template-areas:\"navigation header sidebar\" \"navigation content sidebar\" \"footer footer footer\";grid-template-rows:minmax(0,auto) minmax(0,1fr) minmax(0,auto);grid-template-columns:minmax(0,auto) minmax(0,100%) minmax(0,auto);justify-content:start;padding-inline:var(--odx-size-75);inline-size:100%;max-inline-size:var(--max-inline-size)}.header,.navigation,.sidebar{position:sticky;inset-block-start:var(--scroll-margin-block-start);z-index:98;background-color:var(--odx-color-background-cool)}.navigation,.sidebar{--_size: calc(100dvh - var(--scroll-margin-block-start));inset-block-end:0;max-block-size:var(--_size);overflow:auto}.content{display:flex;flex-direction:column;grid-area:content;margin-block-end:var(--odx-size-150)}.footer{grid-area:footer}.header{grid-area:header}.navigation{grid-area:navigation;padding-inline-end:var(--odx-size-75)}.sidebar{grid-area:sidebar;padding-inline-start:var(--odx-size-75)}";
3189
+ const styles$u = ":host{display:grid;grid-template-areas:\"navigation header sidebar\" \"navigation content sidebar\" \"footer footer footer\";grid-template-rows:minmax(0,auto) minmax(0,1fr) minmax(0,auto);grid-template-columns:minmax(0,auto) minmax(0,100%) minmax(0,auto);justify-content:start;padding-inline:var(--odx-size-75);inline-size:100%;max-inline-size:var(--max-inline-size)}.header,.navigation,.sidebar{position:sticky;inset-block-start:var(--scroll-margin-block-start);z-index:98;background-color:var(--odx-color-background-base)}.navigation,.sidebar{--_size: calc(100dvh - var(--scroll-margin-block-start));inset-block-end:0;max-block-size:var(--_size);overflow:auto}.content{display:flex;flex-direction:column;grid-area:content;margin-block-end:var(--odx-size-150)}.footer{grid-area:footer}.header{grid-area:header}.navigation{grid-area:navigation;padding-inline-end:var(--odx-size-75)}.sidebar{grid-area:sidebar;padding-inline-start:var(--odx-size-75)}";
3203
3190
 
3204
3191
  var __defProp$w = Object.defineProperty;
3205
3192
  var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
@@ -3228,7 +3215,7 @@ OdxPageLayout = __decorateClass$w([
3228
3215
  customElement("odx-page-layout", [styles$u])
3229
3216
  ], OdxPageLayout);
3230
3217
 
3231
- const styles$t = "@layer base{:host{--max-inline-size: var(--odx-page-max-inline-size, 100%);--scroll-margin-block-start: calc(var(--header-size, 0px) + var(--subheader-size, 0px));display:grid;grid-template-areas:\"header\" \"subheader\" \"content\" \"footer\";grid-template-rows:minmax(0,auto) minmax(0,auto) minmax(0,1fr) minmax(0,auto);grid-template-columns:100%;min-block-size:100dvh}.header,.subheader{position:sticky;z-index:99}.subheader,.content{background-color:var(--odx-color-background-cool);padding-inline:var(--odx-size-75);inline-size:100%;max-inline-size:var(--max-inline-size)}.header{inset-block-start:0;grid-area:header}.subheader{inset-block-start:var(--header-size, 0);grid-area:subheader}.content{grid-area:content;block-size:100%}.footer{grid-area:footer}::slotted(odx-page-layout){min-block-size:100%}}@layer variant{:host([alignment=\"center\"]){.subheader,.content{margin-inline:auto}}:host([layout=\"narrow\"]){--max-inline-size: var(--odx-page-max-inline-size-narrow)}:host([layout=\"wide\"]){--max-inline-size: var(--odx-page-max-inline-size-wide)}}";
3218
+ const styles$t = "@layer base{:host{--max-inline-size: var(--odx-page-max-inline-size, 100%);--scroll-margin-block-start: calc(var(--header-size, 0px) + var(--subheader-size, 0px));display:grid;grid-template-areas:\"header\" \"subheader\" \"content\" \"footer\";grid-template-rows:minmax(0,auto) minmax(0,auto) minmax(0,1fr) minmax(0,auto);grid-template-columns:100%;min-block-size:100dvh}.header,.subheader{position:sticky;z-index:99}.subheader,.content{background-color:var(--odx-color-background-base);padding-inline:var(--odx-size-75);inline-size:100%;max-inline-size:var(--max-inline-size)}.header{inset-block-start:0;grid-area:header}.subheader{inset-block-start:var(--header-size, 0);grid-area:subheader}.content{grid-area:content;block-size:100%}.footer{grid-area:footer}::slotted(odx-page-layout){min-block-size:100%}}@layer variant{:host([alignment=\"center\"]){.subheader,.content{margin-inline:auto}}:host([layout=\"narrow\"]){--max-inline-size: var(--odx-page-max-inline-size-narrow)}:host([layout=\"wide\"]){--max-inline-size: var(--odx-page-max-inline-size-wide)}}";
3232
3219
 
3233
3220
  var __defProp$v = Object.defineProperty;
3234
3221
  var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
@@ -4147,18 +4134,18 @@ let OdxSlider = class extends CustomElement {
4147
4134
  });
4148
4135
  this.context = sliderContext.defaultValue;
4149
4136
  __privateAdd$6(this, _handleKeyboardEvent, (event) => {
4150
- const { actions, direction } = getKeyboardEventInfo(event);
4137
+ const key = getKeyInfo(event);
4151
4138
  const target = event.target;
4152
- if (target.localName !== OdxSliderHandle.selector || actions.tab || actions.backTab || target.disabled) return;
4139
+ if (target.localName !== OdxSliderHandle.selector || key.tab || key.backTab || target.disabled) return;
4153
4140
  event.preventDefault();
4154
4141
  event.stopPropagation();
4155
- if (direction.left || direction.down) {
4142
+ if (key.left || key.down) {
4156
4143
  target.value -= this.step;
4157
- } else if (direction.right || direction.up) {
4144
+ } else if (key.right || key.up) {
4158
4145
  target.value += this.step;
4159
- } else if (actions.start) {
4146
+ } else if (key.start) {
4160
4147
  target.value = this.context.min;
4161
- } else if (actions.end) {
4148
+ } else if (key.end) {
4162
4149
  target.value = this.context.max;
4163
4150
  }
4164
4151
  });
@@ -4972,7 +4959,7 @@ OdxToast = __decorateClass$5([
4972
4959
  customElement("odx-toast", [styles$4])
4973
4960
  ], OdxToast);
4974
4961
 
4975
- const styles$3 = ":host{--_border-radius: var(--odx-border-radius-sm);--_color-background: transparent;--_color-stroke: var(--odx-color-stroke-control-rest);--_color-foreground: var(--odx-color-foreground-rest);--_size: var(--odx-size-225);--_padding-inline: var(--odx-size-75);display:inline-flex;position:relative;place-items:center;transition:var(--odx-transition-default);transition-property:color,background-color,border-color,outline-color;margin:var(--odx-size-37);outline:var(--odx-focus-ring-outline);outline-offset:var(--odx-focus-ring-offset);outline-color:var(--_color-stroke);border:var(--odx-border-width-thin) solid var(--_color-stroke);border-radius:var(--odx-border-radius-controls);background-color:var(--_color-background);cursor:pointer;padding-inline:var(--_padding-inline);block-size:var(--_size);color:var(--_color-foreground);font-weight:var(--odx-typography-font-weight-medium);user-select:none}:host::part(label){display:inline-block}:host(:hover){--_color-background: var(--odx-color-background-control-hover);--_color-stroke: var(--odx-color-stroke-control-hover)}:host(:focus-visible){outline-color:var(--odx-focus-ring-color)}:host([pressed]){--_color-background: var(--odx-color-background-control-selected);--_color-foreground: var(--odx-color-foreground-inverse-static);--_color-stroke: var(--odx-color-stroke-control-selected)}:host([pressed]:not(:is([readonly],[disabled])):hover){--_color-background: var(--odx-color-background-control-selected-hover)}:host([disabled]){--_color-background: var(--odx-color-background-disabled-rest);--_color-foreground: var(--odx-color-foreground-disabled-rest);--_color-stroke: var(--odx-color-disabled-stroke);cursor:not-allowed}:host([readonly]){--_color-background: var(--odx-color-background-control-readonly);--_color-foreground: var(--odx-color-selection-control-foreground-readonly);--_color-stroke: var(--odx-color-stroke-control-readonly);cursor:default}:host([pressed][disabled]){--_color-background: var(--odx-color-background-disabled-selected);--_color-foreground: var(--odx-color-foreground-disabled-selected)}";
4962
+ const styles$3 = ":host{--_border-radius: var(--odx-border-radius-sm);--_color-background: transparent;--_color-stroke: var(--odx-color-stroke-control-rest);--_color-foreground: var(--odx-color-foreground-rest);--_size: var(--odx-size-225);--_padding-inline: var(--odx-size-75);display:inline-flex;position:relative;place-items:center;transition:var(--odx-transition-default);transition-property:color,background-color,border-color,outline-color;margin:var(--odx-size-37);outline:var(--odx-focus-ring-outline);outline-offset:var(--odx-focus-ring-offset);border:var(--odx-border-width-thin) solid var(--_color-stroke);border-radius:var(--odx-border-radius-controls);background-color:var(--_color-background);cursor:pointer;padding-inline:var(--_padding-inline);block-size:var(--_size);color:var(--_color-foreground);font-weight:var(--odx-typography-font-weight-medium);user-select:none}:host::part(label){display:inline-block}:host(:hover){--_color-background: var(--odx-color-background-control-hover);--_color-stroke: var(--odx-color-stroke-control-hover)}:host(:focus-visible){outline-color:var(--odx-focus-ring-color)}:host([pressed]){--_color-background: var(--odx-color-background-control-selected);--_color-foreground: var(--odx-color-foreground-inverse-static);--_color-stroke: var(--odx-color-stroke-control-selected)}:host([pressed]:not(:is([readonly],[disabled])):hover){--_color-background: var(--odx-color-background-control-selected-hover)}:host([disabled]){--_color-background: var(--odx-color-background-disabled-rest);--_color-foreground: var(--odx-color-foreground-disabled-rest);--_color-stroke: var(--odx-color-disabled-stroke);cursor:not-allowed}:host([readonly]){--_color-background: var(--odx-color-background-control-readonly);--_color-foreground: var(--odx-color-selection-control-foreground-readonly);--_color-stroke: var(--odx-color-stroke-control-readonly);cursor:default}:host([pressed][disabled]){--_color-background: var(--odx-color-background-disabled-selected);--_color-foreground: var(--odx-color-foreground-disabled-selected)}";
4976
4963
 
4977
4964
  var __defProp$4 = Object.defineProperty;
4978
4965
  var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
package/dist/i18n.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { signal, effect, computed, SignalWatcher } from '@lit-labs/preact-signals';
2
2
  import { parseDate, dedupeMixin } from '@odx/foundation';
3
3
  import { property } from 'lit/decorators.js';
4
- import { f as flattenObject } from './vendor-C_8wBEOn.js';
4
+ import { f as flattenObject } from './vendor-kPOMiFOM.js';
5
5
 
6
6
  const I18nConfig = (config) => ({
7
7
  defaultLocale: () => navigator.language,
package/dist/loader.js CHANGED
@@ -1,11 +1,8 @@
1
- async function defineCustomElements() {
1
+ (async function defineCustomElements() {
2
2
  const { OdxPopover } = await import('@odx/foundation');
3
3
  const components = Object.values(await import('@odx/foundation/components'));
4
4
  for (const entry of [OdxPopover, ...components]) {
5
- if (typeof entry !== "function" || !("define" in entry)) continue;
6
- entry.define?.();
5
+ if (typeof entry !== "function" || !("define" in entry) || typeof entry.define !== "function") continue;
6
+ entry.define();
7
7
  }
8
- }
9
- defineCustomElements();
10
-
11
- export { defineCustomElements };
8
+ })();
package/dist/main.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { LitElement, html, unsafeCSS, isServer, nothing } from 'lit';
2
2
  import { property, queryAssignedElements, query, state } from 'lit/decorators.js';
3
- import { u as uniqBy, r as round, R as RovingTabindexController, m as minBy } from './vendor-C_8wBEOn.js';
4
- export { p as enumFrom } from './vendor-C_8wBEOn.js';
5
- import { createFocusTrap } from 'focus-trap';
3
+ import { u as uniqBy, r as round, R as RovingTabindexController, m as minBy, t as throttle } from './vendor-kPOMiFOM.js';
4
+ export { p as enumFrom } from './vendor-kPOMiFOM.js';
6
5
  import { arrow, flip, computePosition, offset, shift, size, hide, autoUpdate } from '@floating-ui/dom';
7
6
  import { when } from 'lit/directives/when.js';
7
+ import { createIntersectionObserver as createIntersectionObserver$1, createResizeObserver as createResizeObserver$1 } from '@odx/foundation';
8
8
  export { computed, effect } from '@lit-labs/preact-signals';
9
9
 
10
10
  const Shape = {
@@ -40,17 +40,15 @@ const Variant = {
40
40
  const customElementStyles = "@layer reset,base,variant,state;@layer reset{:is(*){box-sizing:border-box;scrollbar-width:thin}:not(:defined){display:none}:before,:after{box-sizing:border-box}[popover]{outline:none;border:none}img,picture,video,canvas,svg{display:block;margin:0;max-width:100%}input,button,textarea,select{margin:0;font:inherit}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word;margin:0}p{text-wrap:pretty}h1,h2,h3,h4,h5,h6{text-wrap:balance}}@layer base{odx-stack{display:block}.odx-stack{&.odx-stack-horizontal{flex-flow:row}&.odx-stack-wrap{flex-flow:column wrap}&.odx-stack-horizontal.odx-stack-wrap{flex-flow:row wrap}--flow: column;display:flex;flex-flow:var(--flow);max-inline-size:100%;align-items:stretch;justify-content:flex-start;gap:var(--odx-size-75);text-align:start}}@layer base{.odx-align-start{align-items:flex-start}.odx-align-center{align-items:center}.odx-align-end{align-items:end}.odx-justify-start{justify-content:flex-start}.odx-justify-end{justify-content:flex-end}.odx-justify-center{justify-content:center}.odx-justify-space-between{justify-content:space-between}.odx-justify-space-around{justify-content:space-around}.odx-justify-space-evenly{justify-content:space-evenly}}@layer base{.odx-gap-none{gap:0}.odx-gap-xs{gap:var(--odx-size-25)}.odx-gap-sm{gap:var(--odx-size-50)}.odx-gap-md{gap:var(--odx-size-75)}.odx-gap-lg{gap:var(--odx-size-150)}.odx-gap-xl{gap:var(--odx-size-225)}}@layer base{odx-icon{transition:var(--odx-transition-default);transition-property:transform}[odxPreventTextOverflow]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}odx-list-item:has(:is([odx-button],odx-list-item::part(control)):not([disabled]):active){--_color-background-pressed: var(--_color-background-hover)}[odx-button]:has(odx-icon:only-child),[odx-button]:has(odx-avatar:only-child){--_min-inline-size: 0}[indicator-position=start] odx-accordion-item::part(indicator){--rotate: -90deg;order:-1}[indicator-position=start] odx-accordion-item[expanded]::part(indicator){--rotate: 0}odx-input:has([slot=suffix])::part(base){padding-inline-end:var(--odx-size-px)}}@layer reset{:host{border:none;border-color:transparent;outline:none}}";
41
41
 
42
42
  function mergeStyleSheets(...stylesheets) {
43
- const mergedStyles = [];
44
- for (const styles of stylesheets) {
45
- if (!styles) continue;
46
- mergedStyles.push(typeof styles === "string" ? unsafeCSS(styles) : styles);
47
- }
43
+ const mergedStyles = stylesheets.filter(Boolean).map((styles) => {
44
+ return typeof styles === "string" ? unsafeCSS(styles) : styles;
45
+ });
48
46
  return uniqBy(mergedStyles.flat(3), String);
49
47
  }
50
48
  function customElement(selector, styles = []) {
51
49
  return (target) => {
52
50
  target.selector = selector;
53
- target.styles = mergeStyleSheets(customElementStyles, target.styles, ...styles);
51
+ target.styles = mergeStyleSheets(customElementStyles, target.styles ?? "", ...styles);
54
52
  target.define = () => {
55
53
  if (customElements.get(selector)) return;
56
54
  customElements.define(selector, target);
@@ -99,6 +97,13 @@ function parseDate(value) {
99
97
  }
100
98
  return Number.isNaN(date.getTime()) ? null : date;
101
99
  }
100
+ function createIntersectionObserver(callback, options) {
101
+ try {
102
+ return new IntersectionObserver(callback, options);
103
+ } catch {
104
+ return { root: null, rootMargin: "", thresholds: [], takeRecords: () => [], observe: () => void 0, disconnect: () => void 0, unobserve: () => void 0 };
105
+ }
106
+ }
102
107
  function createMutationObserver(callback) {
103
108
  try {
104
109
  return new MutationObserver(callback);
@@ -106,6 +111,13 @@ function createMutationObserver(callback) {
106
111
  return { takeRecords: () => [], observe: () => void 0, disconnect: () => void 0 };
107
112
  }
108
113
  }
114
+ function createResizeObserver(callback) {
115
+ try {
116
+ return new ResizeObserver(callback);
117
+ } catch {
118
+ return { observe: () => void 0, disconnect: () => void 0, unobserve: () => void 0 };
119
+ }
120
+ }
109
121
  function findClosestDocument(node) {
110
122
  let parent = node.parentNode;
111
123
  while (parent && parent.nodeType !== Node.DOCUMENT_FRAGMENT_NODE && parent.nodeType !== Node.DOCUMENT_NODE) {
@@ -151,15 +163,6 @@ function fromAriaBooleanAttribute(value) {
151
163
  function toPx(value) {
152
164
  return Number.isNaN(Number(value)) ? null : `${round(Number(value), 2)}px`;
153
165
  }
154
- function limit(fn, fpsLimit = 60) {
155
- let lastUpdate = 0;
156
- return (...args) => {
157
- const now = performance.now();
158
- if (now - lastUpdate < 1e3 / fpsLimit) return;
159
- lastUpdate = now;
160
- fn(...args);
161
- };
162
- }
163
166
  function getAssignedElement(root, options) {
164
167
  const { slot, selector } = options ?? {};
165
168
  const slotSelector = `slot${slot ? `[name=${slot}]` : ":not([name])"}`;
@@ -298,44 +301,20 @@ const FormControl = dedupeMixin((superClass) => {
298
301
  return FormControlElement;
299
302
  });
300
303
 
301
- const KeyboardKey = {
302
- ARROW_UP: "ArrowUp",
303
- ARROW_DOWN: "ArrowDown",
304
- ARROW_LEFT: "ArrowLeft",
305
- ARROW_RIGHT: "ArrowRight",
306
- ENTER: "Enter",
307
- ESCAPE: "Escape",
308
- SPACE: " ",
309
- TAB: "Tab",
310
- BACKSPACE: "Backspace",
311
- DELETE: "Delete",
312
- END: "End",
313
- HOME: "Home",
314
- PAGE_UP: "PageUp",
315
- PAGE_DOWN: "PageDown",
316
- SHIFT: "Shift",
317
- CONTROL: "Control",
318
- ALT: "Alt",
319
- META: "Meta"
320
- };
321
- function getKeyboardEventInfo(event) {
322
- const { key } = event;
323
- const up = key === KeyboardKey.ARROW_UP;
324
- const right = key === KeyboardKey.ARROW_RIGHT;
325
- const down = key === KeyboardKey.ARROW_DOWN;
326
- const left = key === KeyboardKey.ARROW_LEFT;
304
+ function getKeyInfo(event) {
305
+ const { key, shiftKey } = event;
327
306
  return {
328
- axis: { x: left || right, y: up || down },
329
- direction: { up, right, down, left },
330
- actions: {
331
- enter: key === KeyboardKey.ENTER,
332
- escape: key === KeyboardKey.ESCAPE,
333
- space: key === KeyboardKey.SPACE,
334
- tab: key === KeyboardKey.TAB && !event.shiftKey,
335
- backTab: key === KeyboardKey.TAB && event.shiftKey,
336
- start: key === KeyboardKey.HOME,
337
- end: key === KeyboardKey.END
338
- }
307
+ up: key === "ArrowUp",
308
+ right: key === "ArrowRight",
309
+ down: key === "ArrowDown",
310
+ left: key === "ArrowLeft",
311
+ enter: key === "Enter",
312
+ escape: key === "Escape",
313
+ space: key === "Space",
314
+ tab: !shiftKey && key === "Tab",
315
+ backTab: shiftKey && key === "Tab",
316
+ start: key === "Home",
317
+ end: key === "End"
339
318
  };
340
319
  }
341
320
 
@@ -361,8 +340,8 @@ class CheckboxFormControl extends FormControl(CustomElement) {
361
340
  this.toggle(void 0, true);
362
341
  };
363
342
  this.#handleKeyboardEvent = (event) => {
364
- const { actions } = getKeyboardEventInfo(event);
365
- if (!actions.enter && !actions.space) return;
343
+ const key = getKeyInfo(event);
344
+ if (!key.enter && !key.space) return;
366
345
  const { localName } = event.target;
367
346
  event.preventDefault();
368
347
  if (event.type === "keydown" || LINK_SELECTORS.has(localName)) return;
@@ -578,16 +557,16 @@ class ActiveDescendantsController {
578
557
  this.#options.onChange?.(previousActiveItem, activeItem, previousActiveItem === void 0 && !!activeItem);
579
558
  }
580
559
  #handleKeyboardEvent = (event) => {
581
- const { actions, direction } = getKeyboardEventInfo(event);
582
- if (!direction.up && !direction.down && !actions.start && !actions.end) return;
560
+ const key = getKeyInfo(event);
561
+ if (!key.up && !key.down && !key.start && !key.end) return;
583
562
  event.preventDefault();
584
- if (direction.down) {
563
+ if (key.down) {
585
564
  this.next();
586
- } else if (direction.up) {
565
+ } else if (key.up) {
587
566
  this.previous();
588
- } else if (actions.start) {
567
+ } else if (key.start) {
589
568
  this.first();
590
- } else if (actions.end) {
569
+ } else if (key.end) {
591
570
  this.last();
592
571
  }
593
572
  };
@@ -729,8 +708,8 @@ class ListboxFormControl extends FormControl(CustomElement) {
729
708
  if (event.target !== this) return;
730
709
  const activeOption = this.activeDescendants.activeItem;
731
710
  if (!activeOption) return;
732
- const { actions } = getKeyboardEventInfo(event);
733
- if (!actions.enter && !actions.space) return;
711
+ const key = getKeyInfo(event);
712
+ if (!key.enter && !key.space) return;
734
713
  if (this.multiple) {
735
714
  event.stopPropagation();
736
715
  event.stopImmediatePropagation();
@@ -959,55 +938,6 @@ class ExpandableItemManager {
959
938
  };
960
939
  }
961
940
 
962
- const FocusTrapControllerOptions = (options) => ({
963
- escapeDeactivates: false,
964
- tabbableOptions: { getShadowRoot: true },
965
- ...options
966
- });
967
- class FocusTrapController {
968
- #host;
969
- #options;
970
- #focusTrap;
971
- constructor(host, options) {
972
- this.#host = host;
973
- this.#options = FocusTrapControllerOptions(options);
974
- this.#host.addController(this);
975
- }
976
- async activate() {
977
- await this.#host.updateComplete;
978
- this.#focusTrap?.activate();
979
- }
980
- async deactivate() {
981
- await this.#host.updateComplete;
982
- this.#focusTrap?.deactivate();
983
- }
984
- async toggle(state) {
985
- if (state ?? !this.#focusTrap?.active) {
986
- return this.activate();
987
- }
988
- return this.deactivate();
989
- }
990
- async hostConnected() {
991
- await this.#host.updateComplete;
992
- this.#focusTrap ??= createFocusTrap(this.#host, {
993
- ...this.#options,
994
- checkCanFocusTrap: this.#checkCanFocusTrap.bind(this),
995
- checkCanReturnFocus: this.#checkCanReturnFocus.bind(this)
996
- });
997
- }
998
- hostDisconnected() {
999
- this.deactivate();
1000
- }
1001
- async #checkCanFocusTrap(containers) {
1002
- await waitForAnimations(this.#host);
1003
- await this.#options.checkCanFocusTrap?.(containers);
1004
- }
1005
- async #checkCanReturnFocus(trigger) {
1006
- await waitForAnimations(this.#host);
1007
- await this.#options.checkCanReturnFocus?.(trigger);
1008
- }
1009
- }
1010
-
1011
941
  var __defProp$8 = Object.defineProperty;
1012
942
  var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
1013
943
  var __decorateClass$8 = (decorators, target, key, kind) => {
@@ -1586,7 +1516,7 @@ class PopoverHost extends CanBeDisabled(CustomElement) {
1586
1516
  this.#positionUpdater = autoUpdate(
1587
1517
  this.referenceElement,
1588
1518
  this,
1589
- limit(() => this.referenceElement && computePopoverPlacement(this.referenceElement, this, this.options)),
1519
+ throttle(() => this.referenceElement && computePopoverPlacement(this.referenceElement, this, this.options), 1e3 / 30),
1590
1520
  { animationFrame: true }
1591
1521
  );
1592
1522
  }
@@ -1702,79 +1632,46 @@ function searchTextContent(options) {
1702
1632
  return ranges;
1703
1633
  }
1704
1634
 
1705
- function createIntersectionObserver(callback, options) {
1706
- try {
1707
- return new IntersectionObserver(callback, options);
1708
- } catch {
1709
- return { root: null, rootMargin: "", thresholds: [], takeRecords: () => [], observe: () => void 0, disconnect: () => void 0, unobserve: () => void 0 };
1710
- }
1711
- }
1712
1635
  class SharedIntersectionObserverInstance {
1713
1636
  #observer;
1714
1637
  #handlers = /* @__PURE__ */ new WeakMap();
1715
- #updateLog = /* @__PURE__ */ new WeakMap();
1716
1638
  observe(target, handler, options = { fpsLimit: 60 }) {
1717
- this.#observer ??= createIntersectionObserver(this.#handleIntersection);
1718
1639
  this.unobserve(target);
1719
- this.#handlers.set(target, [handler, options.fpsLimit]);
1640
+ this.#handlers.set(target, throttle(handler, 1e3 / options.fpsLimit));
1641
+ this.#observer ??= createIntersectionObserver$1((entries) => {
1642
+ if (!this.#observer) return;
1643
+ for (const entry of entries) {
1644
+ this.#handlers.get(entry.target)?.([entry], this.#observer);
1645
+ }
1646
+ });
1720
1647
  this.#observer.observe(target);
1721
1648
  }
1722
1649
  unobserve(target) {
1723
1650
  this.#observer?.unobserve(target);
1724
1651
  this.#handlers.delete(target);
1725
1652
  }
1726
- #handleIntersection = (entries) => {
1727
- if (!this.#observer) return;
1728
- for (const entry of entries) {
1729
- const [handler, fpsLimit] = this.#handlers.get(entry.target) ?? [];
1730
- if (typeof handler !== "function" || !this.#shouldUpdate(entry.target, fpsLimit)) continue;
1731
- handler?.([entry], this.#observer);
1732
- this.#updateLog.set(entry.target, performance.now());
1733
- }
1734
- };
1735
- #shouldUpdate(target, fpsLimit) {
1736
- if (!target.isConnected || typeof fpsLimit !== "number" || fpsLimit < 1) return false;
1737
- return performance.now() - (this.#updateLog.get(target) ?? 0) >= 1e3 / fpsLimit;
1738
- }
1739
1653
  }
1740
1654
  const SharedIntersectionObserver = new SharedIntersectionObserverInstance();
1741
1655
 
1742
- function createResizeObserver(callback) {
1743
- try {
1744
- return new ResizeObserver(callback);
1745
- } catch {
1746
- return { observe: () => void 0, disconnect: () => void 0, unobserve: () => void 0 };
1747
- }
1748
- }
1749
1656
  class SharedResizeObserverInstance {
1750
1657
  #observer;
1751
1658
  #handlers = /* @__PURE__ */ new WeakMap();
1752
- #updateLog = /* @__PURE__ */ new WeakMap();
1753
1659
  observe(target, handler, options = { fpsLimit: 30 }) {
1754
1660
  this.unobserve(target);
1755
- const { fpsLimit, ...observerOptions } = options;
1756
- this.#observer ??= createResizeObserver(this.#handleResize);
1757
- this.#handlers.set(target, [handler, fpsLimit]);
1758
- this.#observer.observe(target, observerOptions);
1661
+ this.#handlers.set(target, throttle(handler, 1e3 / options.fpsLimit));
1662
+ this.#observer ??= createResizeObserver$1((entries) => {
1663
+ if (!this.#observer) return;
1664
+ for (const entry of entries) {
1665
+ this.#handlers.get(entry.target)?.([entry], this.#observer);
1666
+ }
1667
+ });
1668
+ this.#observer.observe(target, options);
1759
1669
  }
1760
1670
  unobserve(target) {
1761
1671
  this.#observer?.unobserve(target);
1762
1672
  this.#handlers.delete(target);
1763
1673
  }
1764
- #handleResize = (entries) => {
1765
- if (!this.#observer) return;
1766
- for (const entry of entries) {
1767
- const [handler, fpsLimit] = this.#handlers.get(entry.target) ?? [];
1768
- if (typeof handler !== "function" || !this.#shouldUpdate(entry.target, fpsLimit ?? 60)) continue;
1769
- handler?.([entry], this.#observer);
1770
- this.#updateLog.set(entry.target, performance.now());
1771
- }
1772
- };
1773
- #shouldUpdate(target, fpsLimit) {
1774
- if (!target.isConnected || fpsLimit < 1) return false;
1775
- return performance.now() - (this.#updateLog.get(target) ?? 0) >= 1e3 / fpsLimit;
1776
- }
1777
1674
  }
1778
1675
  const SharedResizeObserver = new SharedResizeObserverInstance();
1779
1676
 
1780
- export { ActiveDescendant, ActiveDescendantsController, ActiveDescendantsControllerOptions, CanBeDisabled, CanBeExpanded, CanBeSelected, CheckboxFormControl, CheckboxGroupFormControl, CustomElement, DragController, DragControllerOptions, ExpandableItemManager, ExpandableItemManagerOptions, FocusTrapController, FocusTrapControllerOptions, FormControl, IS_DRAG_ACTIVE_ATTRIBUTE, InteractiveElement, InteractiveLink, IsDraggable, KeyboardKey, ListboxFormControl, NumberControl, OdxPopover, OptionControl, PopoverHost, PopoverPlacement, PopoverPlacementOptions, PopoverSide, RadioGroupFormControl, Shape, SharedIntersectionObserver, SharedResizeObserver, Size, State, Variant, WithLoadingState, clearUniqueIdCache, createIntersectionObserver, createMutationObserver, createResizeObserver, customElement, dedupeMixin, findClosestDocument, forwardEvent, fromAriaBooleanAttribute, getAssignedElement, getElementFromEvent, getKeyboardEventInfo, getUniqueId, isDraggableElement, limit, optionalAttr, optionalSlot, parseDate, requestUpdateOnAriaChange, searchTextContent, toAriaBooleanAttribute, toPx, toggleAttribute, waitForAnimations };
1677
+ export { ActiveDescendant, ActiveDescendantsController, ActiveDescendantsControllerOptions, CanBeDisabled, CanBeExpanded, CanBeSelected, CheckboxFormControl, CheckboxGroupFormControl, CustomElement, DragController, DragControllerOptions, ExpandableItemManager, ExpandableItemManagerOptions, FormControl, IS_DRAG_ACTIVE_ATTRIBUTE, InteractiveElement, InteractiveLink, IsDraggable, ListboxFormControl, NumberControl, OdxPopover, OptionControl, PopoverHost, PopoverPlacement, PopoverPlacementOptions, PopoverSide, RadioGroupFormControl, Shape, SharedIntersectionObserver, SharedResizeObserver, Size, State, Variant, WithLoadingState, clearUniqueIdCache, createIntersectionObserver, createMutationObserver, createResizeObserver, customElement, dedupeMixin, findClosestDocument, forwardEvent, fromAriaBooleanAttribute, getAssignedElement, getElementFromEvent, getKeyInfo, getUniqueId, isDraggableElement, optionalAttr, optionalSlot, parseDate, requestUpdateOnAriaChange, searchTextContent, toAriaBooleanAttribute, toPx, toggleAttribute, waitForAnimations };
@@ -1,11 +1,11 @@
1
- import { CustomElement, EnumString } from '../../lib/main.js';
1
+ import { CustomElement, EnumValues } from '../../lib/main.js';
2
2
  import { OdxAccordionItem } from '../accordion-item/accordion-item.js';
3
3
  declare global {
4
4
  interface HTMLElementTagNameMap {
5
5
  'odx-accordion': OdxAccordion;
6
6
  }
7
7
  }
8
- export type AccordionIndicatorPosition = EnumString<typeof AccordionIndicatorPosition>;
8
+ export type AccordionIndicatorPosition = EnumValues<typeof AccordionIndicatorPosition>;
9
9
  export declare const AccordionIndicatorPosition: {
10
10
  readonly start: "start";
11
11
  readonly end: "end";