@odx/foundation 1.0.0-beta.113 → 1.0.0-beta.116

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.
@@ -15,6 +15,7 @@ export * from './mixins/can-be-disabled.js';
15
15
  export * from './mixins/can-be-expanded.js';
16
16
  export * from './mixins/is-draggable.js';
17
17
  export * from './models/drag-event.js';
18
+ export * from './models/layout.js';
18
19
  export * from './models/placement.js';
19
20
  export * from './models/shape.js';
20
21
  export * from './models/size.js';
@@ -25,3 +26,8 @@ export * from './utils/get-unique-id.js';
25
26
  export * from './utils/lit.js';
26
27
  export * from './utils/shared-resize-observer.js';
27
28
  export * from './utils/types.js';
29
+ declare global {
30
+ interface HTMLElement {
31
+ 'odx-gap': 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
32
+ }
33
+ }
@@ -0,0 +1,26 @@
1
+ import { ValuesOf } from '../utils/types.js';
2
+ export type Align = ValuesOf<typeof Align>;
3
+ export declare const Align: {
4
+ readonly BASELINE: "baseline";
5
+ readonly START: "start";
6
+ readonly CENTER: "center";
7
+ readonly END: "end";
8
+ };
9
+ export type Gap = ValuesOf<typeof Gap>;
10
+ export declare const Gap: {
11
+ readonly XS: "xs";
12
+ readonly SM: "sm";
13
+ readonly MD: "md";
14
+ readonly LG: "lg";
15
+ readonly XL: "xl";
16
+ readonly NONE: "none";
17
+ };
18
+ export type Justify = ValuesOf<typeof Justify>;
19
+ export declare const Justify: {
20
+ readonly START: "start";
21
+ readonly END: "end";
22
+ readonly CENTER: "center";
23
+ readonly SPACE_BETWEEN: "space-between";
24
+ readonly SPACE_AROUND: "space-around";
25
+ readonly SPACE_EVENLY: "space-evenly";
26
+ };
@@ -9,3 +9,10 @@ export declare const Variant: {
9
9
  readonly DANGER: "danger";
10
10
  readonly GHOST: "ghost";
11
11
  };
12
+ export type ProgressVariant = ValuesOf<typeof ProgressVariant>;
13
+ export declare const ProgressVariant: {
14
+ readonly CONFIRM: "confirm";
15
+ readonly NEUTRAL: "neutral";
16
+ readonly SUCCESS: "success";
17
+ readonly DANGER: "danger";
18
+ };
package/dist/main.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { _ as __decorateClass } from './_virtual_class-decorator-runtime.js';
2
2
  import { unsafeCSS, LitElement, html, isServer, nothing } from 'lit';
3
3
  import { property, queryAssignedElements, query } from 'lit/decorators.js';
4
- import { r as round, u as uniqBy, R as RovingTabindexController, m as minBy, c as computePosition, o as offset, s as shift, f as flip, a as size, b as arrow, h as hide, t as throttle } from './vendor.js';
4
+ import { r as round, u as uniqBy, R as RovingTabindexController, m as minBy, p as pick, c as computePosition, o as offset, s as shift, f as flip, a as size, b as arrow, h as hide, t as throttle } from './vendor.js';
5
5
 
6
6
  function parseDate(value) {
7
7
  const date = new Date(value);
@@ -76,7 +76,7 @@ function getKeyInfo(event) {
76
76
  };
77
77
  }
78
78
 
79
- 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-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}odx-accordion[indicator-position=start]{odx-accordion-item::part(indicator){--rotate: -90deg;order:-1}odx-accordion-item[expanded]::part(indicator){--rotate: 0}}odx-input{&:has([odx-button][slot=prefix]){padding-inline-start:var(--odx-spacing-12);[odx-button][slot=prefix]:last-of-type{margin-inline-end:calc(var(--odx-spacing-37) * -1)}}&:has([odx-button][slot=suffix]){padding-inline-end:var(--odx-spacing-12);[odx-button][slot=suffix]:first-of-type{margin-inline-start:calc(var(--odx-spacing-37) * -1)}}}}@layer reset{:host{outline:none;border:none;border-color:transparent}}";
79
+ 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-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}odx-accordion[indicator-position=start]{odx-accordion-item::part(indicator){--rotate: -90deg;order:-1}odx-accordion-item[expanded]::part(indicator){--rotate: 0}}odx-input{&:has([odx-button][slot=prefix]){padding-inline-start:var(--odx-spacing-12);[odx-button][slot=prefix]:last-of-type{margin-inline-end:calc(var(--odx-spacing-37) * -1)}}&:has([odx-button][slot=suffix]){padding-inline-end:var(--odx-spacing-12);[odx-button][slot=suffix]:first-of-type{margin-inline-start:calc(var(--odx-spacing-37) * -1)}}}}@layer base{.odx-visually-hidden:not(:focus-within),.odx-visually-hidden-force{position:absolute!important;border:none!important;padding:0!important;width:1px!important;height:1px!important;overflow:hidden!important;white-space:nowrap!important;clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important}}@layer base{.odx-cluster,.odx-stack{display:flex;flex-direction:column;gap:var(--odx-spacing-75);align-items:stretch;justify-content:flex-start;max-inline-size:100%;text-align:inherit}.odx-cluster{flex-flow:row wrap}.odx-align-baseline,.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}.odx-gap-none{gap:0}.odx-gap-xs{gap:var(--odx-spacing-25)}.odx-gap-sm{gap:var(--odx-spacing-50)}.odx-gap-md{gap:var(--odx-spacing-75)}.odx-gap-lg{gap:var(--odx-spacing-150)}.odx-gap-xl{gap:var(--odx-size-225)}.odx-nowrap{flex-wrap:nowrap}}@layer reset{:host{outline:none;border:none;border-color:transparent}}";
80
80
 
81
81
  function customElement(tagName, ...styles) {
82
82
  return (target) => {
@@ -1100,6 +1100,34 @@ const IsDraggable = (superClass) => {
1100
1100
  return IsDraggableElement;
1101
1101
  };
1102
1102
 
1103
+ const Size = {
1104
+ XS: "xs",
1105
+ SM: "sm",
1106
+ MD: "md",
1107
+ LG: "lg",
1108
+ XL: "xl",
1109
+ XXL: "xxl"
1110
+ };
1111
+
1112
+ const Align = {
1113
+ BASELINE: "baseline",
1114
+ START: "start",
1115
+ CENTER: "center",
1116
+ END: "end"
1117
+ };
1118
+ const Gap = {
1119
+ NONE: "none",
1120
+ ...pick(Size, ["XS", "SM", "MD", "LG", "XL"])
1121
+ };
1122
+ const Justify = {
1123
+ START: "start",
1124
+ END: "end",
1125
+ CENTER: "center",
1126
+ SPACE_BETWEEN: "space-between",
1127
+ SPACE_AROUND: "space-around",
1128
+ SPACE_EVENLY: "space-evenly"
1129
+ };
1130
+
1103
1131
  const Placement = {
1104
1132
  TOP: "top",
1105
1133
  TOP_START: "top-start",
@@ -1120,15 +1148,6 @@ const Shape = {
1120
1148
  RECTANGLE: "rectangle"
1121
1149
  };
1122
1150
 
1123
- const Size = {
1124
- XS: "xs",
1125
- SM: "sm",
1126
- MD: "md",
1127
- LG: "lg",
1128
- XL: "xl",
1129
- XXL: "xxl"
1130
- };
1131
-
1132
1151
  const Variant = {
1133
1152
  NEUTRAL: "neutral",
1134
1153
  PRIMARY: "primary",
@@ -1138,6 +1157,10 @@ const Variant = {
1138
1157
  DANGER: "danger",
1139
1158
  GHOST: "ghost"
1140
1159
  };
1160
+ const ProgressVariant = {
1161
+ ...pick(Variant, ["NEUTRAL", "DANGER", "SUCCESS"]),
1162
+ CONFIRM: "confirm"
1163
+ };
1141
1164
 
1142
1165
  function PopoverPlacementOptions(options) {
1143
1166
  return {
@@ -1150,6 +1173,7 @@ function PopoverPlacementOptions(options) {
1150
1173
  };
1151
1174
  }
1152
1175
  async function computePopoverPlacement(referenceElement, floatingElement, options) {
1176
+ if ("isConnected" in referenceElement && !referenceElement.isConnected) return;
1153
1177
  const { arrowElement, placement, offset: offset$1, matchReferenceWidth, enableFallback, fallbackAxisSideDirection, minHeight } = options;
1154
1178
  const arrowSize = arrowElement?.offsetWidth ?? 0;
1155
1179
  const arrowMiddleware = arrowElement ? arrow({ element: arrowElement, padding: arrowSize * 2 }) : void 0;
@@ -1206,4 +1230,4 @@ class SharedResizeObserverInstance {
1206
1230
  }
1207
1231
  const SharedResizeObserver = new SharedResizeObserverInstance();
1208
1232
 
1209
- export { ActiveDescendantsController, ActiveDescendantsControllerOptions, BadgeAlign, CanBeDisabled, CanBeExpanded, CheckboxFormControl, CheckboxGroupFormControl, CustomElement, DragController, DragControllerOptions, ExpandableItemManager, ExpandableItemManagerOptions, FormControl, IS_DRAG_ACTIVE_ATTRIBUTE, InteractiveElement, InteractiveLink, IsDraggable, ListboxFormControl, NumberFormControl, OptionControl, Placement, PopoverPlacementOptions, RadioGroupFormControl, Shape, SharedResizeObserver, Size, Variant, computePopoverPlacement, customElement, findClosestDocument, forwardEvent, getAssignedElement, getElementFromEvent, getIdFromHref, getKeyInfo, getUniqueId, optionalAttr, optionalSlot, parseDate, toAriaBooleanAttribute, toPx, waitForAnimations };
1233
+ export { ActiveDescendantsController, ActiveDescendantsControllerOptions, Align, BadgeAlign, CanBeDisabled, CanBeExpanded, CheckboxFormControl, CheckboxGroupFormControl, CustomElement, DragController, DragControllerOptions, ExpandableItemManager, ExpandableItemManagerOptions, FormControl, Gap, IS_DRAG_ACTIVE_ATTRIBUTE, InteractiveElement, InteractiveLink, IsDraggable, Justify, ListboxFormControl, NumberFormControl, OptionControl, Placement, PopoverPlacementOptions, ProgressVariant, RadioGroupFormControl, Shape, SharedResizeObserver, Size, Variant, computePopoverPlacement, customElement, findClosestDocument, forwardEvent, getAssignedElement, getElementFromEvent, getIdFromHref, getKeyInfo, getUniqueId, optionalAttr, optionalSlot, parseDate, toAriaBooleanAttribute, toPx, waitForAnimations };
package/dist/styles.css CHANGED
@@ -1 +1 @@
1
- @layer reset,base,variant,state,theme;@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-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}odx-accordion[indicator-position=start]{odx-accordion-item::part(indicator){--rotate: -90deg;order:-1}odx-accordion-item[expanded]::part(indicator){--rotate: 0}}odx-input{&:has([odx-button][slot=prefix]){padding-inline-start:var(--odx-spacing-12);[odx-button][slot=prefix]:last-of-type{margin-inline-end:calc(var(--odx-spacing-37) * -1)}}&:has([odx-button][slot=suffix]){padding-inline-end:var(--odx-spacing-12);[odx-button][slot=suffix]:first-of-type{margin-inline-start:calc(var(--odx-spacing-37) * -1)}}}}@layer base{h1,h2,h3,h4,h5,h6{display:block;font-family:var(--odx-typography-font-family-brand);font-weight:var(--odx-typography-font-weight-semibold)}h6{line-height:var(--odx-breakpoint-line-height-heading-6);font-size:var(--odx-breakpoint-font-size-heading-6)}h5{line-height:var(--odx-breakpoint-line-height-heading-5);font-size:var(--odx-breakpoint-font-size-heading-5)}h4{line-height:var(--odx-breakpoint-line-height-heading-4);font-size:var(--odx-breakpoint-font-size-heading-4)}h3{line-height:var(--odx-breakpoint-line-height-heading-3);font-size:var(--odx-breakpoint-font-size-heading-3)}h2{line-height:var(--odx-breakpoint-line-height-heading-2);font-size:var(--odx-breakpoint-font-size-heading-2)}h1{line-height:var(--odx-breakpoint-line-height-heading-1);font-size:var(--odx-breakpoint-font-size-heading-1)}}:root{--odx-color-stroke-control-rest: light-dark(var(--odx-palette-blue-80), var(--odx-palette-blue-00));--odx-color-stroke-control-hover: var(--odx-color-stroke-control-rest);--odx-color-stroke-control-pressed: var(--odx-color-stroke-control-rest);--odx-color-stroke-control-readonly: var(--odx-color-stroke-control-rest);--odx-color-background-control-selected: var(--odx-color-background-primary-rest);--odx-color-background-control-selected-hover: var(--odx-color-background-primary-hover);--odx-color-background-control-selected-pressed: var(--odx-color-background-primary-pressed)}@layer base{:root{--odx-transition-default: all var(--odx-motion-duration-default) var(--odx-motion-easing-default);--odx-transition-slow: all var(--odx-motion-duration-slow) var(--odx-motion-easing-default);--odx-transition-reduced: all var(--odx-motion-duration-fast) var(--odx-motion-easing-reduced);--odx-page-max-inline-size: 1600px;--odx-page-max-inline-size-narrow: 1200px;--odx-page-max-inline-size-wide: 2400px;scrollbar-color:var(--odx-color-background-brand) transparent;color-scheme:light}html,body{margin:0;padding:0}html{scroll-behavior:smooth}body{background-color:var(--odx-color-background-base);line-height:var(--odx-typography-line-height-base);color:var(--odx-color-foreground-rest);font-family:var(--odx-typography-font-family-base),"Noto Sans",Kanit,sans-serif;font-size:var(--odx-typography-font-size-base)}}
1
+ @layer reset,base,variant,state,theme;@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{h1,h2,h3,h4,h5,h6{display:block;font-family:var(--odx-typography-font-family-brand);font-weight:var(--odx-typography-font-weight-semibold)}h6{line-height:var(--odx-breakpoint-line-height-heading-6);font-size:var(--odx-breakpoint-font-size-heading-6)}h5{line-height:var(--odx-breakpoint-line-height-heading-5);font-size:var(--odx-breakpoint-font-size-heading-5)}h4{line-height:var(--odx-breakpoint-line-height-heading-4);font-size:var(--odx-breakpoint-font-size-heading-4)}h3{line-height:var(--odx-breakpoint-line-height-heading-3);font-size:var(--odx-breakpoint-font-size-heading-3)}h2{line-height:var(--odx-breakpoint-line-height-heading-2);font-size:var(--odx-breakpoint-font-size-heading-2)}h1{line-height:var(--odx-breakpoint-line-height-heading-1);font-size:var(--odx-breakpoint-font-size-heading-1)}}@layer base{.odx-visually-hidden:not(:focus-within),.odx-visually-hidden-force{position:absolute!important;border:none!important;padding:0!important;width:1px!important;height:1px!important;overflow:hidden!important;white-space:nowrap!important;clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important}}@layer base{.odx-cluster,.odx-stack{display:flex;flex-direction:column;gap:var(--odx-spacing-75);align-items:stretch;justify-content:flex-start;max-inline-size:100%;text-align:inherit}.odx-cluster{flex-flow:row wrap}.odx-align-baseline,.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}.odx-gap-none{gap:0}.odx-gap-xs{gap:var(--odx-spacing-25)}.odx-gap-sm{gap:var(--odx-spacing-50)}.odx-gap-md{gap:var(--odx-spacing-75)}.odx-gap-lg{gap:var(--odx-spacing-150)}.odx-gap-xl{gap:var(--odx-size-225)}.odx-nowrap{flex-wrap:nowrap}}@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}odx-accordion[indicator-position=start]{odx-accordion-item::part(indicator){--rotate: -90deg;order:-1}odx-accordion-item[expanded]::part(indicator){--rotate: 0}}odx-input{&:has([odx-button][slot=prefix]){padding-inline-start:var(--odx-spacing-12);[odx-button][slot=prefix]:last-of-type{margin-inline-end:calc(var(--odx-spacing-37) * -1)}}&:has([odx-button][slot=suffix]){padding-inline-end:var(--odx-spacing-12);[odx-button][slot=suffix]:first-of-type{margin-inline-start:calc(var(--odx-spacing-37) * -1)}}}}:root{--odx-color-stroke-control-rest: light-dark(var(--odx-palette-blue-80), var(--odx-palette-blue-00));--odx-color-stroke-control-hover: var(--odx-color-stroke-control-rest);--odx-color-stroke-control-pressed: var(--odx-color-stroke-control-rest);--odx-color-stroke-control-readonly: var(--odx-color-stroke-control-rest);--odx-color-background-control-selected: var(--odx-color-background-primary-rest);--odx-color-background-control-selected-hover: var(--odx-color-background-primary-hover);--odx-color-background-control-selected-pressed: var(--odx-color-background-primary-pressed)}@layer base{:root{--odx-transition-default: all var(--odx-motion-duration-default) var(--odx-motion-easing-default);--odx-transition-slow: all var(--odx-motion-duration-slow) var(--odx-motion-easing-default);--odx-transition-reduced: all var(--odx-motion-duration-fast) var(--odx-motion-easing-reduced);--odx-page-max-inline-size: 1600px;--odx-page-max-inline-size-narrow: 1200px;--odx-page-max-inline-size-wide: 2400px;scrollbar-color:var(--odx-color-background-brand) transparent;color-scheme:light}html,body{margin:0;padding:0}html{scroll-behavior:smooth}body{background-color:var(--odx-color-background-base);line-height:var(--odx-typography-line-height-base);color:var(--odx-color-foreground-rest);font-family:var(--odx-typography-font-family-base),"Noto Sans",Kanit,sans-serif;font-size:var(--odx-typography-font-size-base)}}
package/dist/vendor.js CHANGED
@@ -44,6 +44,54 @@ function o(r,e,t){return typeof r===e?()=>r:typeof r=="function"?r:t}class Focus
44
44
 
45
45
  class RovingTabindexController extends FocusGroupController{constructor(){super(...arguments);this.managed=true;this.manageIndexesAnimationFrame=0;}set focused(e){e!==this.focused&&(super.focused=e,this.manageTabindexes());}get focused(){return super.focused}clearElementCache(e=0){cancelAnimationFrame(this.manageIndexesAnimationFrame),super.clearElementCache(e),this.managed&&(this.manageIndexesAnimationFrame=requestAnimationFrame(()=>this.manageTabindexes()));}manageTabindexes(){this.focused&&!this.hostDelegatesFocus?this.updateTabindexes(()=>({tabIndex:-1})):this.updateTabindexes(e=>({removeTabIndex:e.contains(this.focusInElement)&&e!==this.focusInElement,tabIndex:e===this.focusInElement?0:-1}));}updateTabindexes(e){this.elements.forEach(a=>{const{tabIndex:n,removeTabIndex:s}=e(a);if(!s){this.focused?a!==this.elements[this.currentIndex]&&(a.tabIndex=n):a.tabIndex=n;return}const t=a;t.requestUpdate&&t.requestUpdate();});}manage(){this.managed=true,this.manageTabindexes(),super.manage();}unmanage(){this.managed=false,this.updateTabindexes(()=>({tabIndex:0})),super.unmanage();}hostUpdated(){super.hostUpdated(),this.host.hasUpdated||this.manageTabindexes();}}
46
46
 
47
+ function isPlainObject(value) {
48
+ if (!value || typeof value !== 'object') {
49
+ return false;
50
+ }
51
+ const proto = Object.getPrototypeOf(value);
52
+ const hasObjectPrototype = proto === null ||
53
+ proto === Object.prototype ||
54
+ Object.getPrototypeOf(proto) === null;
55
+ if (!hasObjectPrototype) {
56
+ return false;
57
+ }
58
+ return Object.prototype.toString.call(value) === '[object Object]';
59
+ }
60
+
61
+ function flattenObject(object, { delimiter = '.' } = {}) {
62
+ return flattenObjectImpl(object, '', delimiter);
63
+ }
64
+ function flattenObjectImpl(object, prefix = '', delimiter = '.') {
65
+ const result = {};
66
+ const keys = Object.keys(object);
67
+ for (let i = 0; i < keys.length; i++) {
68
+ const key = keys[i];
69
+ const value = object[key];
70
+ const prefixedKey = prefix ? `${prefix}${delimiter}${key}` : key;
71
+ if (isPlainObject(value) && Object.keys(value).length > 0) {
72
+ Object.assign(result, flattenObjectImpl(value, prefixedKey, delimiter));
73
+ continue;
74
+ }
75
+ if (Array.isArray(value)) {
76
+ Object.assign(result, flattenObjectImpl(value, prefixedKey, delimiter));
77
+ continue;
78
+ }
79
+ result[prefixedKey] = value;
80
+ }
81
+ return result;
82
+ }
83
+
84
+ function pick(obj, keys) {
85
+ const result = {};
86
+ for (let i = 0; i < keys.length; i++) {
87
+ const key = keys[i];
88
+ if (Object.hasOwn(obj, key)) {
89
+ result[key] = obj[key];
90
+ }
91
+ }
92
+ return result;
93
+ }
94
+
47
95
  /**
48
96
  * Custom positioning reference element.
49
97
  * @see https://floating-ui.com/docs/virtual-elements
@@ -1877,54 +1925,6 @@ function throttle(func, throttleMs, { signal, edges = ['leading', 'trailing'] }
1877
1925
  return throttled;
1878
1926
  }
1879
1927
 
1880
- function isPlainObject(value) {
1881
- if (!value || typeof value !== 'object') {
1882
- return false;
1883
- }
1884
- const proto = Object.getPrototypeOf(value);
1885
- const hasObjectPrototype = proto === null ||
1886
- proto === Object.prototype ||
1887
- Object.getPrototypeOf(proto) === null;
1888
- if (!hasObjectPrototype) {
1889
- return false;
1890
- }
1891
- return Object.prototype.toString.call(value) === '[object Object]';
1892
- }
1893
-
1894
- function flattenObject(object, { delimiter = '.' } = {}) {
1895
- return flattenObjectImpl(object, '', delimiter);
1896
- }
1897
- function flattenObjectImpl(object, prefix = '', delimiter = '.') {
1898
- const result = {};
1899
- const keys = Object.keys(object);
1900
- for (let i = 0; i < keys.length; i++) {
1901
- const key = keys[i];
1902
- const value = object[key];
1903
- const prefixedKey = prefix ? `${prefix}${delimiter}${key}` : key;
1904
- if (isPlainObject(value) && Object.keys(value).length > 0) {
1905
- Object.assign(result, flattenObjectImpl(value, prefixedKey, delimiter));
1906
- continue;
1907
- }
1908
- if (Array.isArray(value)) {
1909
- Object.assign(result, flattenObjectImpl(value, prefixedKey, delimiter));
1910
- continue;
1911
- }
1912
- result[prefixedKey] = value;
1913
- }
1914
- return result;
1915
- }
1916
-
1917
- function pick(obj, keys) {
1918
- const result = {};
1919
- for (let i = 0; i < keys.length; i++) {
1920
- const key = keys[i];
1921
- if (Object.hasOwn(obj, key)) {
1922
- result[key] = obj[key];
1923
- }
1924
- }
1925
- return result;
1926
- }
1927
-
1928
1928
  /**
1929
1929
  * @license
1930
1930
  * Copyright 2023 Google LLC
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@odx/foundation",
3
3
  "description": "A library of Web Component building blocks for ODX",
4
- "version": "1.0.0-beta.113",
4
+ "version": "1.0.0-beta.116",
5
5
  "author": "Drägerwerk AG & Co.KGaA",
6
6
  "license": "SEE LICENSE IN LICENSE",
7
7
  "homepage": "https://odx.draeger.com",
@@ -28,7 +28,7 @@
28
28
  "@floating-ui/dom": "1.7.0",
29
29
  "@lit-labs/preact-signals": "1.0.3",
30
30
  "@lit/context": "1.1.5",
31
- "@odx/icons": "4.0.0-rc.32",
31
+ "@odx/icons": "4.0.0-rc.33",
32
32
  "@spectrum-web-components/reactive-controllers": "1.6.0",
33
33
  "@wc-toolkit/cem-inheritance": "1.0.4",
34
34
  "@wc-toolkit/cem-validator": "1.0.3",
@@ -1,48 +0,0 @@
1
- import { CustomElement, ValuesOf } from '../../lib/main.js';
2
- import { PropertyValues, TemplateResult } from 'lit';
3
- declare global {
4
- interface HTMLElementTagNameMap {
5
- 'odx-circular-progress-bar': OdxCircularProgressBar;
6
- }
7
- }
8
- export type CircularProgressBarSize = ValuesOf<typeof CircularProgressBarSize>;
9
- export declare const CircularProgressBarSize: Pick<{
10
- readonly XS: "xs";
11
- readonly SM: "sm";
12
- readonly MD: "md";
13
- readonly LG: "lg";
14
- readonly XL: "xl";
15
- readonly XXL: "xxl";
16
- }, "SM" | "MD" | "LG">;
17
- /**
18
- * A circular progress bar that indicates the progress of a task.
19
- * @summary Displays the progress of a task in a circular format
20
- * @csspart inner - The inner SVG element
21
- * @csspart track - The track circle element
22
- * @csspart indicator - The indicator circle element
23
- */
24
- export declare class OdxCircularProgressBar extends CustomElement {
25
- #private;
26
- protected readonly viewPortSize = 100;
27
- /**
28
- * The value of the progress bar. Should be between -1 and 100.
29
- * -1 indicates an indeterminate state.
30
- */
31
- set value(val: number);
32
- get value(): number;
33
- /**
34
- * The stroke width of the progress bar.
35
- */
36
- stroke: number;
37
- /**
38
- * Indicates whether the progress bar is in an indeterminate state.
39
- */
40
- indeterminate: boolean;
41
- /**
42
- * The size of the progress bar.
43
- */
44
- size: CircularProgressBarSize;
45
- firstUpdated(changes: PropertyValues<this>): void;
46
- disconnectedCallback(): void;
47
- protected render(): TemplateResult;
48
- }
@@ -1,21 +0,0 @@
1
- import { CustomElement, ValuesOf } from '../../lib/main.js';
2
- import { PropertyValues } from 'lit';
3
- declare global {
4
- interface HTMLElementTagNameMap {
5
- 'odx-headline': OdxHeadline;
6
- }
7
- }
8
- export type HeadlineSize = ValuesOf<typeof HeadlineSize>;
9
- export declare const HeadlineSize: Pick<{
10
- readonly XS: "xs";
11
- readonly SM: "sm";
12
- readonly MD: "md";
13
- readonly LG: "lg";
14
- readonly XL: "xl";
15
- readonly XXL: "xxl";
16
- }, "SM" | "MD" | "LG" | "XL">;
17
- export declare class OdxHeadline extends CustomElement {
18
- size: HeadlineSize;
19
- level?: number;
20
- protected willUpdate(props: PropertyValues<this>): void;
21
- }
@@ -1,37 +0,0 @@
1
- import { CustomElement, ValuesOf } from '../../lib/main.js';
2
- declare global {
3
- interface HTMLElementTagNameMap {
4
- 'odx-stack': OdxStack;
5
- }
6
- }
7
- export type StackAlign = ValuesOf<typeof StackAlign>;
8
- export declare const StackAlign: {
9
- readonly START: "start";
10
- readonly CENTER: "center";
11
- readonly END: "end";
12
- };
13
- export type StackGap = ValuesOf<typeof StackGap>;
14
- export declare const StackGap: {
15
- readonly XS: "xs";
16
- readonly SM: "sm";
17
- readonly MD: "md";
18
- readonly LG: "lg";
19
- readonly XL: "xl";
20
- readonly NONE: "none";
21
- };
22
- export type StackJustify = ValuesOf<typeof StackJustify>;
23
- export declare const StackJustify: {
24
- readonly START: "start";
25
- readonly END: "end";
26
- readonly CENTER: "center";
27
- readonly SPACE_BETWEEN: "space-between";
28
- readonly SPACE_AROUND: "space-around";
29
- readonly SPACE_EVENLY: "space-evenly";
30
- };
31
- export declare class OdxStack extends CustomElement {
32
- align?: StackAlign;
33
- justify?: StackJustify;
34
- gap?: StackGap;
35
- horizontal: boolean;
36
- wrap: boolean;
37
- }